@atlaskit/smart-card 34.4.0 → 34.5.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 (159) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/common/ui/icons/angle-brackets-icon.js +2 -11
  3. package/dist/cjs/common/ui/icons/audio-icon.js +2 -11
  4. package/dist/cjs/common/ui/icons/blog-icon.js +13 -0
  5. package/dist/cjs/common/ui/icons/chart-bar-icon.js +2 -11
  6. package/dist/cjs/common/ui/icons/file-icon.js +2 -11
  7. package/dist/cjs/common/ui/icons/folder-icon.js +2 -11
  8. package/dist/cjs/common/ui/icons/image-icon.js +2 -11
  9. package/dist/cjs/common/ui/icons/list-bullet-icon.js +2 -11
  10. package/dist/cjs/common/ui/icons/page-icon.js +2 -12
  11. package/dist/cjs/common/ui/icons/types.js +5 -0
  12. package/dist/cjs/common/ui/icons/utils.js +47 -0
  13. package/dist/cjs/common/ui/icons/video-icon.js +2 -11
  14. package/dist/cjs/utils/analytics/analytics.js +1 -1
  15. package/dist/cjs/utils/index.js +398 -181
  16. package/dist/cjs/view/FlexibleCard/components/blocks/element-group/index.js +12 -12
  17. package/dist/cjs/view/FlexibleCard/components/blocks/metadata-block/MetadataBlockOld.js +85 -0
  18. package/dist/cjs/view/FlexibleCard/components/blocks/metadata-block/index.compiled.css +10 -0
  19. package/dist/cjs/view/FlexibleCard/components/blocks/metadata-block/index.js +39 -29
  20. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/index.compiled.css +1 -0
  21. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/index.js +16 -8
  22. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolved/index.compiled.css +2 -1
  23. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolved/index.js +38 -20
  24. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolving/TitleBlockResolvingViewOld.js +2 -2
  25. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolving/index.compiled.css +2 -1
  26. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolving/index.js +27 -6
  27. package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +43 -17
  28. package/dist/cjs/view/FlexibleCard/components/common/image-icon/index.js +28 -8
  29. package/dist/cjs/view/FlexibleCard/components/common/loading-skeleton/index.compiled.css +0 -2
  30. package/dist/cjs/view/FlexibleCard/components/common/loading-skeleton/index.js +13 -12
  31. package/dist/cjs/view/FlexibleCard/components/elements/icon/index.js +35 -8
  32. package/dist/cjs/view/FlexibleCard/components/utils.js +23 -2
  33. package/dist/cjs/view/HoverCard/components/views/resolving/index.js +29 -14
  34. package/dist/cjs/view/LinkUrl/index.js +1 -1
  35. package/dist/es2019/common/ui/icons/angle-brackets-icon.js +2 -11
  36. package/dist/es2019/common/ui/icons/audio-icon.js +2 -11
  37. package/dist/es2019/common/ui/icons/blog-icon.js +6 -0
  38. package/dist/es2019/common/ui/icons/chart-bar-icon.js +2 -11
  39. package/dist/es2019/common/ui/icons/file-icon.js +2 -11
  40. package/dist/es2019/common/ui/icons/folder-icon.js +2 -11
  41. package/dist/es2019/common/ui/icons/image-icon.js +2 -11
  42. package/dist/es2019/common/ui/icons/list-bullet-icon.js +2 -11
  43. package/dist/es2019/common/ui/icons/page-icon.js +2 -12
  44. package/dist/es2019/common/ui/icons/types.js +1 -0
  45. package/dist/es2019/common/ui/icons/utils.js +39 -0
  46. package/dist/es2019/common/ui/icons/video-icon.js +2 -11
  47. package/dist/es2019/utils/analytics/analytics.js +1 -1
  48. package/dist/es2019/utils/index.js +171 -54
  49. package/dist/es2019/view/FlexibleCard/components/blocks/element-group/index.js +12 -12
  50. package/dist/es2019/view/FlexibleCard/components/blocks/metadata-block/MetadataBlockOld.js +75 -0
  51. package/dist/es2019/view/FlexibleCard/components/blocks/metadata-block/index.compiled.css +10 -0
  52. package/dist/es2019/view/FlexibleCard/components/blocks/metadata-block/index.js +29 -24
  53. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/index.compiled.css +1 -0
  54. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/index.js +8 -3
  55. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolved/index.compiled.css +2 -1
  56. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolved/index.js +24 -4
  57. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolving/TitleBlockResolvingViewOld.js +2 -2
  58. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolving/index.compiled.css +2 -1
  59. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolving/index.js +27 -6
  60. package/dist/es2019/view/FlexibleCard/components/common/atlaskit-icon/index.js +46 -21
  61. package/dist/es2019/view/FlexibleCard/components/common/image-icon/index.js +28 -8
  62. package/dist/es2019/view/FlexibleCard/components/common/loading-skeleton/index.compiled.css +0 -2
  63. package/dist/es2019/view/FlexibleCard/components/common/loading-skeleton/index.js +14 -12
  64. package/dist/es2019/view/FlexibleCard/components/elements/icon/index.js +35 -10
  65. package/dist/es2019/view/FlexibleCard/components/utils.js +22 -1
  66. package/dist/es2019/view/HoverCard/components/views/resolving/index.js +21 -6
  67. package/dist/es2019/view/LinkUrl/index.js +1 -1
  68. package/dist/es2019/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +2 -2
  69. package/dist/es2019/view/RelatedLinksModal/views/errored/error-svg/index.js +2 -2
  70. package/dist/es2019/view/RelatedLinksModal/views/resolved/index.js +1 -1
  71. package/dist/es2019/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.js +2 -2
  72. package/dist/esm/common/ui/icons/angle-brackets-icon.js +2 -11
  73. package/dist/esm/common/ui/icons/audio-icon.js +2 -11
  74. package/dist/esm/common/ui/icons/blog-icon.js +6 -0
  75. package/dist/esm/common/ui/icons/chart-bar-icon.js +2 -11
  76. package/dist/esm/common/ui/icons/file-icon.js +2 -11
  77. package/dist/esm/common/ui/icons/folder-icon.js +2 -11
  78. package/dist/esm/common/ui/icons/image-icon.js +2 -11
  79. package/dist/esm/common/ui/icons/list-bullet-icon.js +2 -11
  80. package/dist/esm/common/ui/icons/page-icon.js +2 -12
  81. package/dist/esm/common/ui/icons/types.js +1 -0
  82. package/dist/esm/common/ui/icons/utils.js +40 -0
  83. package/dist/esm/common/ui/icons/video-icon.js +2 -11
  84. package/dist/esm/utils/analytics/analytics.js +1 -1
  85. package/dist/esm/utils/index.js +264 -97
  86. package/dist/esm/view/FlexibleCard/components/blocks/element-group/index.js +12 -12
  87. package/dist/esm/view/FlexibleCard/components/blocks/metadata-block/MetadataBlockOld.js +80 -0
  88. package/dist/esm/view/FlexibleCard/components/blocks/metadata-block/index.compiled.css +10 -0
  89. package/dist/esm/view/FlexibleCard/components/blocks/metadata-block/index.js +29 -24
  90. package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/index.compiled.css +1 -0
  91. package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/index.js +8 -3
  92. package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolved/index.compiled.css +2 -1
  93. package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolved/index.js +37 -19
  94. package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolving/TitleBlockResolvingViewOld.js +2 -2
  95. package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolving/index.compiled.css +2 -1
  96. package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolving/index.js +27 -6
  97. package/dist/esm/view/FlexibleCard/components/common/atlaskit-icon/index.js +47 -21
  98. package/dist/esm/view/FlexibleCard/components/common/image-icon/index.js +28 -8
  99. package/dist/esm/view/FlexibleCard/components/common/loading-skeleton/index.compiled.css +0 -2
  100. package/dist/esm/view/FlexibleCard/components/common/loading-skeleton/index.js +13 -11
  101. package/dist/esm/view/FlexibleCard/components/elements/icon/index.js +35 -8
  102. package/dist/esm/view/FlexibleCard/components/utils.js +22 -1
  103. package/dist/esm/view/HoverCard/components/views/resolving/index.js +21 -6
  104. package/dist/esm/view/LinkUrl/index.js +1 -1
  105. package/dist/esm/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +2 -2
  106. package/dist/esm/view/RelatedLinksModal/views/errored/error-svg/index.js +2 -2
  107. package/dist/esm/view/RelatedLinksModal/views/resolved/index.js +1 -1
  108. package/dist/esm/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.js +2 -2
  109. package/dist/types/common/ui/icons/angle-brackets-icon.d.ts +2 -6
  110. package/dist/types/common/ui/icons/audio-icon.d.ts +2 -6
  111. package/dist/types/common/ui/icons/blog-icon.d.ts +8 -0
  112. package/dist/types/common/ui/icons/chart-bar-icon.d.ts +2 -6
  113. package/dist/types/common/ui/icons/file-icon.d.ts +2 -6
  114. package/dist/types/common/ui/icons/folder-icon.d.ts +2 -6
  115. package/dist/types/common/ui/icons/image-icon.d.ts +2 -6
  116. package/dist/types/common/ui/icons/list-bullet-icon.d.ts +2 -6
  117. package/dist/types/common/ui/icons/page-icon.d.ts +2 -6
  118. package/dist/types/common/ui/icons/types.d.ts +6 -0
  119. package/dist/types/common/ui/icons/utils.d.ts +15 -0
  120. package/dist/types/common/ui/icons/video-icon.d.ts +2 -6
  121. package/dist/types/utils/index.d.ts +8 -2
  122. package/dist/types/view/FlexibleCard/components/blocks/metadata-block/MetadataBlockOld.d.ts +11 -0
  123. package/dist/types/view/FlexibleCard/components/blocks/metadata-block/index.d.ts +2 -9
  124. package/dist/types/view/FlexibleCard/components/blocks/title-block/resolved/index.d.ts +3 -1
  125. package/dist/types/view/FlexibleCard/components/common/atlaskit-icon/index.d.ts +1 -1
  126. package/dist/types/view/FlexibleCard/components/common/atlaskit-icon/types.d.ts +2 -1
  127. package/dist/types/view/FlexibleCard/components/common/image-icon/index.d.ts +1 -1
  128. package/dist/types/view/FlexibleCard/components/common/image-icon/types.d.ts +2 -0
  129. package/dist/types/view/FlexibleCard/components/common/loading-skeleton/LoadingSkeletonOld.d.ts +2 -2
  130. package/dist/types/view/FlexibleCard/components/common/loading-skeleton/index.d.ts +4 -3
  131. package/dist/types/view/FlexibleCard/components/common/loading-skeleton/types.d.ts +17 -1
  132. package/dist/types/view/FlexibleCard/components/utils.d.ts +2 -0
  133. package/dist/types/view/HoverCard/components/views/resolving/index.d.ts +0 -4
  134. package/dist/types-ts4.5/common/ui/icons/angle-brackets-icon.d.ts +2 -6
  135. package/dist/types-ts4.5/common/ui/icons/audio-icon.d.ts +2 -6
  136. package/dist/types-ts4.5/common/ui/icons/blog-icon.d.ts +8 -0
  137. package/dist/types-ts4.5/common/ui/icons/chart-bar-icon.d.ts +2 -6
  138. package/dist/types-ts4.5/common/ui/icons/file-icon.d.ts +2 -6
  139. package/dist/types-ts4.5/common/ui/icons/folder-icon.d.ts +2 -6
  140. package/dist/types-ts4.5/common/ui/icons/image-icon.d.ts +2 -6
  141. package/dist/types-ts4.5/common/ui/icons/list-bullet-icon.d.ts +2 -6
  142. package/dist/types-ts4.5/common/ui/icons/page-icon.d.ts +2 -6
  143. package/dist/types-ts4.5/common/ui/icons/types.d.ts +6 -0
  144. package/dist/types-ts4.5/common/ui/icons/utils.d.ts +15 -0
  145. package/dist/types-ts4.5/common/ui/icons/video-icon.d.ts +2 -6
  146. package/dist/types-ts4.5/utils/index.d.ts +8 -2
  147. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/metadata-block/MetadataBlockOld.d.ts +11 -0
  148. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/metadata-block/index.d.ts +2 -9
  149. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/resolved/index.d.ts +3 -1
  150. package/dist/types-ts4.5/view/FlexibleCard/components/common/atlaskit-icon/index.d.ts +1 -1
  151. package/dist/types-ts4.5/view/FlexibleCard/components/common/atlaskit-icon/types.d.ts +2 -1
  152. package/dist/types-ts4.5/view/FlexibleCard/components/common/image-icon/index.d.ts +1 -1
  153. package/dist/types-ts4.5/view/FlexibleCard/components/common/image-icon/types.d.ts +2 -0
  154. package/dist/types-ts4.5/view/FlexibleCard/components/common/loading-skeleton/LoadingSkeletonOld.d.ts +2 -2
  155. package/dist/types-ts4.5/view/FlexibleCard/components/common/loading-skeleton/index.d.ts +4 -3
  156. package/dist/types-ts4.5/view/FlexibleCard/components/common/loading-skeleton/types.d.ts +17 -1
  157. package/dist/types-ts4.5/view/FlexibleCard/components/utils.d.ts +2 -0
  158. package/dist/types-ts4.5/view/HoverCard/components/views/resolving/index.d.ts +0 -4
  159. package/package.json +8 -1
@@ -1,3 +1,4 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  /**
2
3
  * @jsxRuntime classic
3
4
  * @jsx jsx
@@ -7,6 +8,8 @@ import React, { useMemo } from 'react';
7
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
9
  import { css, jsx } from '@emotion/react';
9
10
  import LinkIcon from '@atlaskit/icon/core/migration/link';
11
+ import { fg } from '@atlaskit/platform-feature-flags';
12
+ import { Box, xcss } from '@atlaskit/primitives';
10
13
  import { SmartLinkPosition, SmartLinkSize } from '../../../../../constants';
11
14
  import AtlaskitIcon from '../../common/atlaskit-icon';
12
15
  import ImageIcon from '../../common/image-icon';
@@ -52,11 +55,14 @@ var getCustomRenderStyles = function getCustomRenderStyles(value) {
52
55
  );
53
56
  };
54
57
  var renderAtlaskitIcon = function renderAtlaskitIcon(icon, testId) {
58
+ var size = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : SmartLinkSize.Medium;
55
59
  if (icon) {
56
- return jsx(AtlaskitIcon, {
60
+ return jsx(AtlaskitIcon, _extends({
57
61
  icon: icon,
58
62
  testId: "".concat(testId, "-icon")
59
- });
63
+ }, fg('platform-smart-card-icon-migration') && {
64
+ size: size
65
+ }));
60
66
  }
61
67
  };
62
68
  var renderDefaultIcon = function renderDefaultIcon(label, testId) {
@@ -67,12 +73,17 @@ var renderDefaultIcon = function renderDefaultIcon(label, testId) {
67
73
  });
68
74
  };
69
75
  var renderImageIcon = function renderImageIcon(defaultIcon, url, testId) {
76
+ var size = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : SmartLinkSize.Medium;
77
+ var width = size === SmartLinkSize.Large ? "var(--ds-space-300, 24px)" : "var(--ds-space-200, 16px)";
70
78
  if (url) {
71
- return jsx(ImageIcon, {
79
+ return jsx(ImageIcon, _extends({
72
80
  defaultIcon: defaultIcon,
73
81
  testId: testId,
74
82
  url: url
75
- });
83
+ }, fg('platform-smart-card-icon-migration') && {
84
+ width: width,
85
+ height: width
86
+ }));
76
87
  }
77
88
  };
78
89
 
@@ -99,18 +110,34 @@ var Icon = function Icon(_ref) {
99
110
  url = _ref.url;
100
111
  var element = useMemo(function () {
101
112
  var defaultIcon = renderDefaultIcon(label, testId);
102
- return overrideIcon || (render === null || render === void 0 ? void 0 : render()) || renderImageIcon(defaultIcon, url, testId) || renderAtlaskitIcon(icon, testId) || defaultIcon;
103
- }, [overrideIcon, icon, label, render, testId, url]);
113
+ return overrideIcon || (render === null || render === void 0 ? void 0 : render()) || renderImageIcon(defaultIcon, url, testId, fg('platform-smart-card-icon-migration') ? size : undefined) || renderAtlaskitIcon(icon, testId, fg('platform-smart-card-icon-migration') ? size : undefined) || defaultIcon;
114
+ }, [overrideIcon, icon, label, render, testId, url, size]);
104
115
  var width = getIconWidth(size);
105
116
  var styles = getIconStyles(position, width);
106
117
  var renderStyles = render ? getCustomRenderStyles(width) : undefined;
107
118
  return jsx("div", {
119
+ css: [
108
120
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- needs dynamic css
109
- css: [styles, renderStyles, overrideCss],
121
+ !fg('platform-smart-card-icon-migration') && styles,
122
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- needs dynamic css
123
+ renderStyles,
124
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- needs dynamic css
125
+ overrideCss],
110
126
  "data-fit-to-content": true,
111
127
  "data-smart-element": name,
112
128
  "data-smart-element-icon": true,
113
129
  "data-testid": testId
114
- }, element);
130
+ }, fg('platform-smart-card-icon-migration') ? jsx(Box, {
131
+ xcss: iconWrapperStyle,
132
+ style: {
133
+ width: width,
134
+ height: width
135
+ }
136
+ }, element) : element);
115
137
  };
138
+ var iconWrapperStyle = xcss({
139
+ display: 'flex',
140
+ alignItems: 'center',
141
+ justifyContent: 'center'
142
+ });
116
143
  export default Icon;
@@ -8,6 +8,7 @@ import React from 'react';
8
8
  import { css } from '@emotion/react';
9
9
  import { FormattedMessage } from 'react-intl-next';
10
10
  import Loadable from 'react-loadable';
11
+ import { fg } from '@atlaskit/platform-feature-flags';
11
12
  import { SmartLinkSize } from '../../../constants';
12
13
  export var sizeToButtonSpacing = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, SmartLinkSize.Small, 'none'), SmartLinkSize.Medium, 'compact'), SmartLinkSize.Large, 'compact'), SmartLinkSize.XLarge, 'default');
13
14
  export var getFormattedMessage = function getFormattedMessage(message) {
@@ -54,7 +55,9 @@ export var getIconSizeStyles = function getIconSizeStyles(width) {
54
55
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
55
56
  return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t\tflex: 0 0 auto;\n\t\t", "\n\t\tspan,\n svg,\n img {\n\t\t\t", "\n\t\t}\n\t\tsvg {\n\t\t\tpadding: 0;\n\t\t}\n\t"])), sizeStyles, sizeStyles);
56
57
  };
57
- export var getIconWidth = function getIconWidth(size) {
58
+
59
+ // TODO Delete when cleaning platform-smart-card-icon-migration
60
+ export var getIconWidthOld = function getIconWidthOld(size) {
58
61
  switch (size) {
59
62
  case SmartLinkSize.XLarge:
60
63
  return '2rem';
@@ -67,6 +70,24 @@ export var getIconWidth = function getIconWidth(size) {
67
70
  return '.75rem';
68
71
  }
69
72
  };
73
+
74
+ // TODO Rename to getIconWidth when cleaning platform-smart-card-icon-migration
75
+ export var getIconWidthNew = function getIconWidthNew(size) {
76
+ switch (size) {
77
+ case SmartLinkSize.XLarge:
78
+ case SmartLinkSize.Large:
79
+ return "var(--ds-space-300, 24px)";
80
+ case SmartLinkSize.Medium:
81
+ case SmartLinkSize.Small:
82
+ default:
83
+ return "var(--ds-space-200, 16px)";
84
+ }
85
+ };
86
+
87
+ // TODO Delete when cleaning platform-smart-card-icon-migration
88
+ export var getIconWidth = function getIconWidth(size) {
89
+ return fg('platform-smart-card-icon-migration') ? getIconWidthNew(size) : getIconWidthOld(size);
90
+ };
70
91
  export var importIcon = function importIcon(importFn) {
71
92
  return Loadable({
72
93
  loader: function loader() {
@@ -3,11 +3,14 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
  * @jsxRuntime classic
4
4
  * @jsx jsx
5
5
  */
6
+ import React from 'react';
7
+
6
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
9
  import { jsx } from '@emotion/react';
10
+ import { fg } from '@atlaskit/platform-feature-flags';
8
11
  import { CustomBlock } from '../../../../FlexibleCard/components/blocks';
9
12
  import ActionGroup from '../../../../FlexibleCard/components/blocks/action-group';
10
- import LoadingSkeleton from '../../../../FlexibleCard/components/common/loading-skeleton';
13
+ import { LoadingSkeletonNew, LoadingSkeletonOld } from '../../../../FlexibleCard/components/common/loading-skeleton';
11
14
  import Icon from '../../../../FlexibleCard/components/elements/icon';
12
15
  import { CARD_WIDTH_REM } from '../../../styled';
13
16
  import { getTitleStyles, loadingViewContainer, skeletonContainer, titleBlockStyles } from './styled';
@@ -22,6 +25,7 @@ var HoverCardLoadingView = function HoverCardLoadingView(_ref) {
22
25
  items: actions,
23
26
  visibleButtonsNum: 2
24
27
  });
28
+ var LoadingSkeleton = fg('platform-smart-card-icon-migration') ? LoadingSkeletonNew : LoadingSkeletonOld;
25
29
  return (
26
30
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
27
31
  jsx("div", {
@@ -40,18 +44,29 @@ var HoverCardLoadingView = function HoverCardLoadingView(_ref) {
40
44
  }), jsx("span", {
41
45
  css: getTitleStyles(lineHeightRem),
42
46
  "data-testid": "".concat(testId, "-title")
43
- }, jsx(LoadingSkeleton, {
47
+ }, fg('platform-smart-card-icon-migration') ? jsx(LoadingSkeletonNew, {
48
+ height: "".concat(lineHeightRem, "rem")
49
+ }) : jsx(LoadingSkeletonOld, {
44
50
  height: lineHeightRem
45
- })), actionGroup), jsx(LoadingSkeleton, {
51
+ })), actionGroup), fg('platform-smart-card-icon-migration') ? jsx(React.Fragment, null, jsx(LoadingSkeletonNew, {
52
+ width: "".concat(skeletonWidth, "rem"),
53
+ height: "".concat(lineHeightRem, "rem")
54
+ }), jsx(LoadingSkeletonNew, {
55
+ width: "".concat(skeletonWidth, "rem"),
56
+ height: "".concat(lineHeightRem * 3, "rem")
57
+ }), jsx(LoadingSkeletonNew, {
58
+ width: "".concat(skeletonWidth, "rem"),
59
+ height: "".concat(lineHeightRem, "rem")
60
+ })) : jsx(React.Fragment, null, jsx(LoadingSkeletonOld, {
46
61
  width: skeletonWidth,
47
62
  height: lineHeightRem
48
- }), jsx(LoadingSkeleton, {
63
+ }), jsx(LoadingSkeletonOld, {
49
64
  width: skeletonWidth,
50
65
  height: lineHeightRem * 3
51
- }), jsx(LoadingSkeleton, {
66
+ }), jsx(LoadingSkeletonOld, {
52
67
  width: skeletonWidth,
53
68
  height: lineHeightRem
54
- })))
69
+ }))))
55
70
  );
56
71
  };
57
72
  export default HoverCardLoadingView;
@@ -13,7 +13,7 @@ import LinkWarningModal from './LinkWarningModal';
13
13
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
14
14
  var PACKAGE_DATA = {
15
15
  packageName: "@atlaskit/smart-card",
16
- packageVersion: "34.4.0",
16
+ packageVersion: "34.5.1",
17
17
  componentName: 'linkUrl'
18
18
  };
19
19
  var Anchor = withLinkClickedEvent('a');
@@ -2,11 +2,11 @@ import React, { useCallback, useRef } from 'react';
2
2
  import { FormattedMessage } from 'react-intl-next';
3
3
  import Button from '@atlaskit/button/new';
4
4
  import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
5
- import { fg } from "@atlaskit/platform-feature-flags";
5
+ import { fg } from '@atlaskit/platform-feature-flags';
6
6
  import { Box, xcss } from '@atlaskit/primitives';
7
7
  import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
8
8
  import { messages } from '../../../messages';
9
- import RelatedLinksBaseModalOld from "./RelatedLinksBaseModalOld";
9
+ import RelatedLinksBaseModalOld from './RelatedLinksBaseModalOld';
10
10
  var fixedWidth = 'small'; // pre-defined 400px by Atlaskit
11
11
 
12
12
  var boxStyles = xcss({
@@ -3,8 +3,8 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./index.compiled.css";
4
4
  import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
- import { fg } from "@atlaskit/platform-feature-flags";
7
- import { ErrorSVGOld } from "./ErrorSvgOld";
6
+ import { fg } from '@atlaskit/platform-feature-flags';
7
+ import { ErrorSVGOld } from './ErrorSvgOld';
8
8
  var errorStyles = null;
9
9
  var ErrorSVGNew = function ErrorSVGNew(props) {
10
10
  var id = 'related-links-error-svg';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { AnalyticsContext } from '@atlaskit/analytics-next';
3
- import { fg } from "@atlaskit/platform-feature-flags";
3
+ import { fg } from '@atlaskit/platform-feature-flags';
4
4
  import { Stack } from '@atlaskit/primitives';
5
5
  import { messages } from '../../../../messages';
6
6
  import RelatedLinksList from '../../components/related-links-list';
@@ -3,8 +3,8 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./index.compiled.css";
4
4
  import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
- import { fg } from "@atlaskit/platform-feature-flags";
7
- import { UnavailableSVGOld } from "./UnavailableSvgOld";
6
+ import { fg } from '@atlaskit/platform-feature-flags';
7
+ import { UnavailableSVGOld } from './UnavailableSvgOld';
8
8
  var unavailableStyles = null;
9
9
  var UnavailableSVGNew = function UnavailableSVGNew(props) {
10
10
  var id = 'related-links-unavailable-svg';
@@ -1,7 +1,3 @@
1
- import { type ComponentPropsWithoutRef } from 'react';
2
- import AngleBracketsIcon from '@atlaskit/icon/core/angle-brackets';
3
- declare const AngleBracketsIconWithColor: {
4
- (props: ComponentPropsWithoutRef<typeof AngleBracketsIcon>): JSX.Element;
5
- displayName: string;
6
- };
1
+ /// <reference types="react" />
2
+ declare const AngleBracketsIconWithColor: import("react").FC<import("./types").AtlaskitIconTileProps>;
7
3
  export default AngleBracketsIconWithColor;
@@ -1,7 +1,3 @@
1
- import { type ComponentPropsWithoutRef } from 'react';
2
- import AudioIcon from '@atlaskit/icon/core/audio';
3
- declare const AudioIconWithColor: {
4
- (props: ComponentPropsWithoutRef<typeof AudioIcon>): JSX.Element;
5
- displayName: string;
6
- };
1
+ /// <reference types="react" />
2
+ declare const AudioIconWithColor: import("react").FC<import("./types").AtlaskitIconTileProps>;
7
3
  export default AudioIconWithColor;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ declare const BlogIconWithColor: import("react").FC<{
3
+ label: string;
4
+ testId?: string | undefined;
5
+ } & {
6
+ size?: import("../../..").SmartLinkSize | undefined;
7
+ }>;
8
+ export default BlogIconWithColor;
@@ -1,7 +1,3 @@
1
- import { type ComponentPropsWithoutRef } from 'react';
2
- import ChartBarIcon from '@atlaskit/icon/core/chart-bar';
3
- declare const ChartBarIconWithColor: {
4
- (props: ComponentPropsWithoutRef<typeof ChartBarIcon>): JSX.Element;
5
- displayName: string;
6
- };
1
+ /// <reference types="react" />
2
+ declare const ChartBarIconWithColor: import("react").FC<import("./types").AtlaskitIconTileProps>;
7
3
  export default ChartBarIconWithColor;
@@ -1,7 +1,3 @@
1
- import { type ComponentPropsWithoutRef } from 'react';
2
- import FileIcon from '@atlaskit/icon/core/file';
3
- declare const FileIconWithColor: {
4
- (props: ComponentPropsWithoutRef<typeof FileIcon>): JSX.Element;
5
- displayName: string;
6
- };
1
+ /// <reference types="react" />
2
+ declare const FileIconWithColor: import("react").FC<import("./types").AtlaskitIconTileProps>;
7
3
  export default FileIconWithColor;
@@ -1,7 +1,3 @@
1
- import { type ComponentPropsWithoutRef } from 'react';
2
- import FolderClosedIcon from '@atlaskit/icon/core/folder-closed';
3
- declare const FolderClosedIconWithColor: {
4
- (props: ComponentPropsWithoutRef<typeof FolderClosedIcon>): JSX.Element;
5
- displayName: string;
6
- };
1
+ /// <reference types="react" />
2
+ declare const FolderClosedIconWithColor: import("react").FC<import("./types").AtlaskitIconTileProps>;
7
3
  export default FolderClosedIconWithColor;
@@ -1,7 +1,3 @@
1
- import { type ComponentPropsWithoutRef } from 'react';
2
- import ImageIcon from '@atlaskit/icon/core/image';
3
- declare const ImageIconWithColor: {
4
- (props: ComponentPropsWithoutRef<typeof ImageIcon>): JSX.Element;
5
- displayName: string;
6
- };
1
+ /// <reference types="react" />
2
+ declare const ImageIconWithColor: import("react").FC<import("./types").AtlaskitIconTileProps>;
7
3
  export default ImageIconWithColor;
@@ -1,7 +1,3 @@
1
- import { type ComponentPropsWithoutRef } from 'react';
2
- import ListBulletedIcon from '@atlaskit/icon/core/list-bulleted';
3
- declare const ListBulletedIconWithColor: {
4
- (props: ComponentPropsWithoutRef<typeof ListBulletedIcon>): JSX.Element;
5
- displayName: string;
6
- };
1
+ /// <reference types="react" />
2
+ declare const ListBulletedIconWithColor: import("react").FC<import("./types").AtlaskitIconTileProps>;
7
3
  export default ListBulletedIconWithColor;
@@ -1,7 +1,3 @@
1
- import { type ComponentPropsWithoutRef } from 'react';
2
- import PageIcon from '@atlaskit/icon/core/page';
3
- declare const PageIconWithColor: {
4
- (props: ComponentPropsWithoutRef<typeof PageIcon>): JSX.Element;
5
- displayName: string;
6
- };
1
+ /// <reference types="react" />
2
+ declare const PageIconWithColor: import("react").FC<import("./types").AtlaskitIconTileProps>;
7
3
  export default PageIconWithColor;
@@ -0,0 +1,6 @@
1
+ import type { ComponentPropsWithoutRef } from 'react';
2
+ import { IconTile } from '@atlaskit/icon';
3
+ import { SmartLinkSize } from '../../../constants';
4
+ export type AtlaskitIconTileProps = Omit<ComponentPropsWithoutRef<typeof IconTile>, 'appearance' | 'icon' | 'size'> & {
5
+ size?: SmartLinkSize;
6
+ };
@@ -0,0 +1,15 @@
1
+ import React, { type ComponentPropsWithoutRef, type ComponentType } from 'react';
2
+ import { IconTile } from '@atlaskit/icon';
3
+ import { SmartLinkSize } from '../../../constants';
4
+ import type { AtlaskitIconTileProps } from './types';
5
+ export declare const transformSmartLinkSizeToIconTileSize: (size?: SmartLinkSize) => "24" | "16";
6
+ type IconProps = {
7
+ label: string;
8
+ testId?: string;
9
+ };
10
+ export declare const renderIconPerSize: (IconSmall: ComponentType<IconProps>, IconLarge: ComponentType<IconProps>) => React.FC<IconProps & {
11
+ size?: SmartLinkSize;
12
+ }>;
13
+ type IconTileProps = ComponentPropsWithoutRef<typeof IconTile>;
14
+ export declare const renderIconTile: (Icon: IconTileProps['icon'], appearance: IconTileProps['appearance'], LegacyIcon: ComponentType<Omit<AtlaskitIconTileProps, 'size'>>) => React.FC<AtlaskitIconTileProps>;
15
+ export {};
@@ -1,7 +1,3 @@
1
- import { type ComponentPropsWithoutRef } from 'react';
2
- import VideoIcon from '@atlaskit/icon/core/video';
3
- declare const VideoIconWithColor: {
4
- (props: ComponentPropsWithoutRef<typeof VideoIcon>): JSX.Element;
5
- displayName: string;
6
- };
1
+ /// <reference types="react" />
2
+ declare const VideoIconWithColor: import("react").FC<import("./types").AtlaskitIconTileProps>;
7
3
  export default VideoIconWithColor;
@@ -1,12 +1,14 @@
1
1
  import React from 'react';
2
2
  import { type ActiveThemeState } from '@atlaskit/tokens';
3
- import { IconType } from '../constants';
3
+ import { IconType, SmartLinkSize } from '../constants';
4
4
  export declare const isSpecialEvent: (evt: React.MouseEvent | React.KeyboardEvent) => boolean;
5
5
  export declare const isIframe: () => boolean;
6
6
  /**
7
7
  * Meta key = cmd on mac, windows key on windows
8
8
  * Ctrl key on mac by default triggers a right click instead of left click
9
9
  * Ctrl key on Windows has the same behaviour of cmd key of mac (open in new tab)
10
+ * Shift key is also a "special" key because the default behavior of Chromium-based browsers is to open the
11
+ * link in a new window; Arc browser has custom logic to show links in its "peek" window when shift is held.
10
12
  *
11
13
  * `isSpecialKey` on a mouse event on mac with default behaviour should be equivalent to opening in new tab
12
14
  * On Windows it will be equivalent to opening a new tab, unless its the Window key that is held
@@ -16,7 +18,10 @@ export declare const isSpecialKey: (event: React.MouseEvent | React.KeyboardEven
16
18
  export declare const isSpecialClick: (event: React.MouseEvent) => boolean;
17
19
  export declare const getIconForFileType: (fileMimeType: string) => React.ReactNode | undefined;
18
20
  export declare const getLabelForFileType: (fileMimeType: string) => React.ReactNode | undefined;
19
- export declare const getLazyIcons: () => Partial<Record<IconType, () => Promise<unknown>>>;
21
+ export declare const getLazyIcons: () => Partial<Record<IconType, {
22
+ default: () => Promise<unknown>;
23
+ large?: () => Promise<unknown>;
24
+ }>>;
20
25
  export declare const getIframeSandboxAttribute: (isTrusted: boolean) => "allow-downloads allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation allow-same-origin allow-scripts" | undefined;
21
26
  export declare const handleOnClick: (handler: Function) => (e: React.BaseSyntheticEvent) => void;
22
27
  export declare const isIntersectionObserverSupported: () => boolean;
@@ -30,3 +35,4 @@ export declare const openUrl: (url?: string) => Promise<void>;
30
35
  * @param themeState
31
36
  */
32
37
  export declare const getPreviewUrlWithTheme: (previewUrl: string, themeState: Partial<ActiveThemeState>) => string;
38
+ export declare const isIconSizeLarge: (size?: SmartLinkSize) => boolean | undefined;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { type MetadataBlockProps } from './types';
3
+ /**
4
+ * Represents a MetadataBlock, designed to contain groups of metadata in the form of elements.
5
+ * Accepts an array of elements to be shown either primary (left hand side) or secondary (right hand side).
6
+ * @public
7
+ * @param {MetadataBlockProps} MetadataBlockProps
8
+ * @see Block
9
+ */
10
+ declare const MetadataBlockOld: ({ maxLines, status, testId, primary, secondary, ...blockProps }: MetadataBlockProps) => JSX.Element | null;
11
+ export default MetadataBlockOld;
@@ -1,11 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { type MetadataBlockProps } from './types';
3
- /**
4
- * Represents a MetadataBlock, designed to contain groups of metadata in the form of elements.
5
- * Accepts an array of elements to be shown either primary (left hand side) or secondary (right hand side).
6
- * @public
7
- * @param {MetadataBlockProps} MetadataBlockProps
8
- * @see Block
9
- */
10
- declare const MetadataBlock: ({ maxLines, status, testId, primary, secondary, ...blockProps }: MetadataBlockProps) => JSX.Element | null;
11
- export default MetadataBlock;
3
+ declare const MetadataBlockExported: (props: MetadataBlockProps) => JSX.Element;
4
+ export default MetadataBlockExported;
@@ -2,9 +2,11 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- /// <reference types="react" />
5
+ import type { ComponentPropsWithoutRef } from 'react';
6
+ import Block from '../../block';
6
7
  import { type TitleBlockViewProps } from '../types';
7
8
  import TitleBlockResolvedViewOld from './TitleBlockResolvedViewOld';
9
+ export declare const BlockFeatureGated: ({ className, ...props }: ComponentPropsWithoutRef<typeof Block>) => JSX.Element;
8
10
  /**
9
11
  * This renders a fully resolved TitleBlock.
10
12
  * This should render when a Smart Link returns a valid response.
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { type AtlaskitIconProps } from './types';
3
- declare const AtlaskitIcon: ({ icon, label, testId }: AtlaskitIconProps) => JSX.Element | null;
3
+ declare const AtlaskitIcon: ({ icon, label, testId, size }: AtlaskitIconProps) => JSX.Element | null;
4
4
  export default AtlaskitIcon;
@@ -1,6 +1,7 @@
1
- import { type IconType } from '../../../../../constants';
1
+ import { type IconType, SmartLinkSize } from '../../../../../constants';
2
2
  export type AtlaskitIconProps = {
3
3
  icon: IconType;
4
4
  label?: string;
5
5
  testId?: string;
6
+ size?: SmartLinkSize;
6
7
  };
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { type ImageIconProps } from './types';
3
- declare const ImageIcon: ({ defaultIcon, testId, url, onError, onLoad }: ImageIconProps) => JSX.Element;
3
+ declare const ImageIcon: ({ defaultIcon, testId, url, width, height, onError, onLoad, }: ImageIconProps) => JSX.Element;
4
4
  export default ImageIcon;
@@ -3,6 +3,8 @@ export type ImageIconProps = {
3
3
  defaultIcon?: React.ReactNode;
4
4
  testId?: string;
5
5
  url: string;
6
+ width?: string;
7
+ height?: string;
6
8
  onError?: () => void;
7
9
  onLoad?: () => void;
8
10
  };
@@ -3,6 +3,6 @@
3
3
  * @jsx jsx
4
4
  */
5
5
  import { jsx } from '@emotion/react';
6
- import { type LoadingSkeletonProps } from './types';
7
- declare const LoadingSkeletonOld: ({ testId, width, height }: LoadingSkeletonProps) => jsx.JSX.Element;
6
+ import { type LoadingSkeletonPropsOld } from './types';
7
+ declare const LoadingSkeletonOld: ({ testId, width, height }: LoadingSkeletonPropsOld) => jsx.JSX.Element;
8
8
  export default LoadingSkeletonOld;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { type LoadingSkeletonProps } from './types';
3
- declare const LoadingSkeleton: (props: LoadingSkeletonProps) => JSX.Element;
4
- export default LoadingSkeleton;
2
+ import type { LoadingSkeletonPropsNew, LoadingSkeletonPropsOld } from './types';
3
+ declare const LoadingSkeletonNew: ({ testId, width, height }: LoadingSkeletonPropsNew) => JSX.Element;
4
+ declare const LoadingSkeletonOld: (props: LoadingSkeletonPropsOld) => JSX.Element;
5
+ export { LoadingSkeletonOld, LoadingSkeletonNew };
@@ -1,4 +1,4 @@
1
- export type LoadingSkeletonProps = {
1
+ export type LoadingSkeletonPropsOld = {
2
2
  /**
3
3
  * A `testId` prop is provided for specified elements, which is a unique
4
4
  * string that appears as a data attribute `data-testid` in the rendered
@@ -14,3 +14,19 @@ export type LoadingSkeletonProps = {
14
14
  */
15
15
  height?: number;
16
16
  };
17
+ export type LoadingSkeletonPropsNew = {
18
+ /**
19
+ * A `testId` prop is provided for specified elements, which is a unique
20
+ * string that appears as a data attribute `data-testid` in the rendered
21
+ * code, serving as a hook for automated tests
22
+ */
23
+ testId?: string;
24
+ /**
25
+ * Width of the loading skeleton, defaults to width of the parent element
26
+ */
27
+ width?: string;
28
+ /**
29
+ * Height of loading skeleton, defaults to height of the parent element
30
+ */
31
+ height?: string;
32
+ };
@@ -12,6 +12,8 @@ export declare const getFormattedMessageAsString: (intl: IntlShape, message: Mes
12
12
  * @deprecated remove on FF bandicoots-compiled-migration-smartcard clean up
13
13
  */
14
14
  export declare const getIconSizeStyles: (width: string) => SerializedStyles;
15
+ export declare const getIconWidthOld: (size?: SmartLinkSize) => string;
16
+ export declare const getIconWidthNew: (size?: SmartLinkSize) => string;
15
17
  export declare const getIconWidth: (size?: SmartLinkSize) => string;
16
18
  export declare const importIcon: (importFn: () => Promise<any>) => any;
17
19
  export declare const getLinkLineHeight: (size: SmartLinkSize) => string;
@@ -1,7 +1,3 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
1
  import { jsx } from '@emotion/react';
6
2
  import { type HoverCardLoadingViewProps } from './types';
7
3
  declare const HoverCardLoadingView: ({ titleBlockProps }: HoverCardLoadingViewProps) => jsx.JSX.Element;
@@ -1,7 +1,3 @@
1
- import { type ComponentPropsWithoutRef } from 'react';
2
- import AngleBracketsIcon from '@atlaskit/icon/core/angle-brackets';
3
- declare const AngleBracketsIconWithColor: {
4
- (props: ComponentPropsWithoutRef<typeof AngleBracketsIcon>): JSX.Element;
5
- displayName: string;
6
- };
1
+ /// <reference types="react" />
2
+ declare const AngleBracketsIconWithColor: import("react").FC<import("./types").AtlaskitIconTileProps>;
7
3
  export default AngleBracketsIconWithColor;
@@ -1,7 +1,3 @@
1
- import { type ComponentPropsWithoutRef } from 'react';
2
- import AudioIcon from '@atlaskit/icon/core/audio';
3
- declare const AudioIconWithColor: {
4
- (props: ComponentPropsWithoutRef<typeof AudioIcon>): JSX.Element;
5
- displayName: string;
6
- };
1
+ /// <reference types="react" />
2
+ declare const AudioIconWithColor: import("react").FC<import("./types").AtlaskitIconTileProps>;
7
3
  export default AudioIconWithColor;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ declare const BlogIconWithColor: import("react").FC<{
3
+ label: string;
4
+ testId?: string | undefined;
5
+ } & {
6
+ size?: import("../../..").SmartLinkSize | undefined;
7
+ }>;
8
+ export default BlogIconWithColor;
@@ -1,7 +1,3 @@
1
- import { type ComponentPropsWithoutRef } from 'react';
2
- import ChartBarIcon from '@atlaskit/icon/core/chart-bar';
3
- declare const ChartBarIconWithColor: {
4
- (props: ComponentPropsWithoutRef<typeof ChartBarIcon>): JSX.Element;
5
- displayName: string;
6
- };
1
+ /// <reference types="react" />
2
+ declare const ChartBarIconWithColor: import("react").FC<import("./types").AtlaskitIconTileProps>;
7
3
  export default ChartBarIconWithColor;
@@ -1,7 +1,3 @@
1
- import { type ComponentPropsWithoutRef } from 'react';
2
- import FileIcon from '@atlaskit/icon/core/file';
3
- declare const FileIconWithColor: {
4
- (props: ComponentPropsWithoutRef<typeof FileIcon>): JSX.Element;
5
- displayName: string;
6
- };
1
+ /// <reference types="react" />
2
+ declare const FileIconWithColor: import("react").FC<import("./types").AtlaskitIconTileProps>;
7
3
  export default FileIconWithColor;