@atlaskit/smart-card 27.1.0 → 27.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 (147) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/extractors/flexible/extract-state.js +1 -2
  3. package/dist/cjs/messages.js +17 -2
  4. package/dist/cjs/utils/analytics/analytics.js +1 -1
  5. package/dist/cjs/view/BlockCard/components/ActionIcon.js +22 -14
  6. package/dist/cjs/view/BlockCard/components/Content.js +3 -1
  7. package/dist/cjs/view/BlockCard/components/ContentFooter.js +3 -1
  8. package/dist/cjs/view/BlockCard/components/ContentHeader.js +3 -1
  9. package/dist/cjs/view/BlockCard/components/Frame.js +6 -2
  10. package/dist/cjs/view/BlockCard/components/Link.js +3 -1
  11. package/dist/cjs/view/BlockCard/components/Name.js +3 -1
  12. package/dist/cjs/view/BlockCard/components/Provider.js +1 -0
  13. package/dist/cjs/view/BlockCard/views/ErroredView.js +3 -1
  14. package/dist/cjs/view/BlockCard/views/ForbiddenView.js +6 -2
  15. package/dist/cjs/view/BlockCard/views/NotFoundView.js +3 -1
  16. package/dist/cjs/view/BlockCard/views/ResolvedView.js +6 -2
  17. package/dist/cjs/view/BlockCard/views/ResolvingView.js +3 -1
  18. package/dist/cjs/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +2 -0
  19. package/dist/cjs/view/CardWithUrl/component-lazy/LazyLazilyRenderCard.js +3 -1
  20. package/dist/cjs/view/CardWithUrl/component-lazy/LoadingCardLink.js +3 -1
  21. package/dist/cjs/view/EmbedCard/components/ExpandedFrame.js +41 -29
  22. package/dist/cjs/view/EmbedCard/components/ImageIcon.js +3 -1
  23. package/dist/cjs/view/EmbedModal/components/link-info/index.js +11 -8
  24. package/dist/cjs/view/FlexibleCard/components/actions/follow-action/unfollow-icon/index.js +3 -1
  25. package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +3 -1
  26. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/index.js +1 -0
  27. package/dist/cjs/view/FlexibleCard/components/common/motion-wrapper/index.js +3 -0
  28. package/dist/cjs/view/FlexibleCard/components/container/layered-link/index.js +1 -0
  29. package/dist/cjs/view/FlexibleCard/components/elements/lozenge/index.js +3 -1
  30. package/dist/cjs/view/HoverCard/components/ContentContainer.js +2 -0
  31. package/dist/cjs/view/InlineCard/Frame/index.js +3 -1
  32. package/dist/cjs/view/InlineCard/Icon.js +3 -1
  33. package/dist/cjs/view/InlineCard/IconAndTitleLayout/index.js +23 -13
  34. package/dist/cjs/view/InlineCard/ResolvedView/index.js +3 -1
  35. package/dist/cjs/view/LinkUrl/index.js +1 -1
  36. package/dist/cjs/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +10 -7
  37. package/dist/cjs/view/RelatedLinksModal/components/related-link-item/index.js +56 -0
  38. package/dist/cjs/view/RelatedLinksModal/components/related-links-list/index.js +41 -0
  39. package/dist/cjs/view/RelatedLinksModal/views/resolved/index.js +31 -0
  40. package/dist/cjs/view/RelatedLinksModal/views/resolved/types.js +1 -0
  41. package/dist/cjs/view/common/Byline.js +3 -1
  42. package/dist/cjs/view/common/Icon.js +3 -1
  43. package/dist/cjs/view/common/MetadataList.js +3 -1
  44. package/dist/es2019/extractors/flexible/extract-state.js +1 -2
  45. package/dist/es2019/messages.js +17 -2
  46. package/dist/es2019/utils/analytics/analytics.js +1 -1
  47. package/dist/es2019/view/BlockCard/components/ActionIcon.js +22 -14
  48. package/dist/es2019/view/BlockCard/components/Content.js +3 -1
  49. package/dist/es2019/view/BlockCard/components/ContentFooter.js +3 -1
  50. package/dist/es2019/view/BlockCard/components/ContentHeader.js +3 -1
  51. package/dist/es2019/view/BlockCard/components/Frame.js +6 -2
  52. package/dist/es2019/view/BlockCard/components/Link.js +3 -1
  53. package/dist/es2019/view/BlockCard/components/Name.js +3 -1
  54. package/dist/es2019/view/BlockCard/components/Provider.js +1 -0
  55. package/dist/es2019/view/BlockCard/views/ErroredView.js +3 -1
  56. package/dist/es2019/view/BlockCard/views/ForbiddenView.js +6 -2
  57. package/dist/es2019/view/BlockCard/views/NotFoundView.js +3 -1
  58. package/dist/es2019/view/BlockCard/views/ResolvedView.js +6 -2
  59. package/dist/es2019/view/BlockCard/views/ResolvingView.js +3 -1
  60. package/dist/es2019/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +2 -0
  61. package/dist/es2019/view/CardWithUrl/component-lazy/LazyLazilyRenderCard.js +3 -1
  62. package/dist/es2019/view/CardWithUrl/component-lazy/LoadingCardLink.js +3 -1
  63. package/dist/es2019/view/EmbedCard/components/ExpandedFrame.js +14 -4
  64. package/dist/es2019/view/EmbedCard/components/ImageIcon.js +3 -1
  65. package/dist/es2019/view/EmbedModal/components/link-info/index.js +11 -8
  66. package/dist/es2019/view/FlexibleCard/components/actions/follow-action/unfollow-icon/index.js +3 -1
  67. package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +3 -1
  68. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/index.js +1 -0
  69. package/dist/es2019/view/FlexibleCard/components/common/motion-wrapper/index.js +3 -0
  70. package/dist/es2019/view/FlexibleCard/components/container/layered-link/index.js +1 -0
  71. package/dist/es2019/view/FlexibleCard/components/elements/lozenge/index.js +3 -1
  72. package/dist/es2019/view/HoverCard/components/ContentContainer.js +2 -0
  73. package/dist/es2019/view/InlineCard/Frame/index.js +3 -1
  74. package/dist/es2019/view/InlineCard/Icon.js +3 -1
  75. package/dist/es2019/view/InlineCard/IconAndTitleLayout/index.js +23 -13
  76. package/dist/es2019/view/InlineCard/ResolvedView/index.js +3 -1
  77. package/dist/es2019/view/LinkUrl/index.js +1 -1
  78. package/dist/es2019/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +10 -7
  79. package/dist/es2019/view/RelatedLinksModal/components/related-link-item/index.js +50 -0
  80. package/dist/es2019/view/RelatedLinksModal/components/related-links-list/index.js +33 -0
  81. package/dist/es2019/view/RelatedLinksModal/views/resolved/index.js +23 -0
  82. package/dist/es2019/view/RelatedLinksModal/views/resolved/types.js +0 -0
  83. package/dist/es2019/view/common/Byline.js +3 -1
  84. package/dist/es2019/view/common/Icon.js +3 -1
  85. package/dist/es2019/view/common/MetadataList.js +3 -1
  86. package/dist/esm/extractors/flexible/extract-state.js +1 -2
  87. package/dist/esm/messages.js +17 -2
  88. package/dist/esm/utils/analytics/analytics.js +1 -1
  89. package/dist/esm/view/BlockCard/components/ActionIcon.js +22 -14
  90. package/dist/esm/view/BlockCard/components/Content.js +3 -1
  91. package/dist/esm/view/BlockCard/components/ContentFooter.js +3 -1
  92. package/dist/esm/view/BlockCard/components/ContentHeader.js +3 -1
  93. package/dist/esm/view/BlockCard/components/Frame.js +6 -2
  94. package/dist/esm/view/BlockCard/components/Link.js +3 -1
  95. package/dist/esm/view/BlockCard/components/Name.js +3 -1
  96. package/dist/esm/view/BlockCard/components/Provider.js +1 -0
  97. package/dist/esm/view/BlockCard/views/ErroredView.js +3 -1
  98. package/dist/esm/view/BlockCard/views/ForbiddenView.js +6 -2
  99. package/dist/esm/view/BlockCard/views/NotFoundView.js +3 -1
  100. package/dist/esm/view/BlockCard/views/ResolvedView.js +6 -2
  101. package/dist/esm/view/BlockCard/views/ResolvingView.js +3 -1
  102. package/dist/esm/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +2 -0
  103. package/dist/esm/view/CardWithUrl/component-lazy/LazyLazilyRenderCard.js +3 -1
  104. package/dist/esm/view/CardWithUrl/component-lazy/LoadingCardLink.js +3 -1
  105. package/dist/esm/view/EmbedCard/components/ExpandedFrame.js +41 -29
  106. package/dist/esm/view/EmbedCard/components/ImageIcon.js +3 -1
  107. package/dist/esm/view/EmbedModal/components/link-info/index.js +11 -8
  108. package/dist/esm/view/FlexibleCard/components/actions/follow-action/unfollow-icon/index.js +3 -1
  109. package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +3 -1
  110. package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/index.js +1 -0
  111. package/dist/esm/view/FlexibleCard/components/common/motion-wrapper/index.js +3 -0
  112. package/dist/esm/view/FlexibleCard/components/container/layered-link/index.js +1 -0
  113. package/dist/esm/view/FlexibleCard/components/elements/lozenge/index.js +3 -1
  114. package/dist/esm/view/HoverCard/components/ContentContainer.js +2 -0
  115. package/dist/esm/view/InlineCard/Frame/index.js +3 -1
  116. package/dist/esm/view/InlineCard/Icon.js +3 -1
  117. package/dist/esm/view/InlineCard/IconAndTitleLayout/index.js +23 -13
  118. package/dist/esm/view/InlineCard/ResolvedView/index.js +3 -1
  119. package/dist/esm/view/LinkUrl/index.js +1 -1
  120. package/dist/esm/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +10 -7
  121. package/dist/esm/view/RelatedLinksModal/components/related-link-item/index.js +49 -0
  122. package/dist/esm/view/RelatedLinksModal/components/related-links-list/index.js +34 -0
  123. package/dist/esm/view/RelatedLinksModal/views/resolved/index.js +24 -0
  124. package/dist/esm/view/RelatedLinksModal/views/resolved/types.js +0 -0
  125. package/dist/esm/view/common/Byline.js +3 -1
  126. package/dist/esm/view/common/Icon.js +3 -1
  127. package/dist/esm/view/common/MetadataList.js +3 -1
  128. package/dist/types/messages.d.ts +1 -1
  129. package/dist/types/view/RelatedLinksModal/components/RelatedLinksBaseModal.d.ts +5 -4
  130. package/dist/types/view/RelatedLinksModal/components/related-link-item/index.d.ts +5 -0
  131. package/dist/types/view/RelatedLinksModal/components/related-links-list/index.d.ts +5 -0
  132. package/dist/types/view/RelatedLinksModal/components/types.d.ts +16 -0
  133. package/dist/types/view/RelatedLinksModal/views/resolved/index.d.ts +5 -0
  134. package/dist/types/view/RelatedLinksModal/views/resolved/types.d.ts +4 -0
  135. package/dist/types-ts4.5/messages.d.ts +1 -1
  136. package/dist/types-ts4.5/view/RelatedLinksModal/components/RelatedLinksBaseModal.d.ts +5 -4
  137. package/dist/types-ts4.5/view/RelatedLinksModal/components/related-link-item/index.d.ts +5 -0
  138. package/dist/types-ts4.5/view/RelatedLinksModal/components/related-links-list/index.d.ts +5 -0
  139. package/dist/types-ts4.5/view/RelatedLinksModal/components/types.d.ts +16 -0
  140. package/dist/types-ts4.5/view/RelatedLinksModal/views/resolved/index.d.ts +5 -0
  141. package/dist/types-ts4.5/view/RelatedLinksModal/views/resolved/types.d.ts +4 -0
  142. package/package.json +2 -5
  143. package/dist/types/view/RelatedLinksModal/types.d.ts +0 -6
  144. package/dist/types-ts4.5/view/RelatedLinksModal/types.d.ts +0 -6
  145. /package/dist/cjs/view/RelatedLinksModal/{types.js → components/types.js} +0 -0
  146. /package/dist/es2019/view/RelatedLinksModal/{types.js → components/types.js} +0 -0
  147. /package/dist/esm/view/RelatedLinksModal/{types.js → components/types.js} +0 -0
@@ -15,7 +15,9 @@ export const ImageIcon = ({
15
15
  return /*#__PURE__*/React.createElement(ImageLoader, {
16
16
  src: src,
17
17
  loading: defaultIcon,
18
- loaded: /*#__PURE__*/React.createElement(Image, {
18
+ loaded: /*#__PURE__*/React.createElement(Image
19
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
20
+ , {
19
21
  className: "smart-link-icon",
20
22
  src: src,
21
23
  alt: alt,
@@ -59,14 +59,17 @@ const LinkInfo = ({
59
59
  }) : jsx(VidFullScreenOnIcon, {
60
60
  label: message.defaultMessage
61
61
  });
62
- return jsx("span", {
63
- className: "smart-link-resize-button"
64
- }, jsx(LinkInfoButton, {
65
- content: jsx(FormattedMessage, message),
66
- icon: icon,
67
- onClick: onResizeButtonClick,
68
- testId: `${testId}-resize`
69
- }));
62
+ return (
63
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
64
+ jsx("span", {
65
+ className: "smart-link-resize-button"
66
+ }, jsx(LinkInfoButton, {
67
+ content: jsx(FormattedMessage, message),
68
+ icon: icon,
69
+ onClick: onResizeButtonClick,
70
+ testId: `${testId}-resize`
71
+ }))
72
+ );
70
73
  }, [onResizeButtonClick, size, testId]);
71
74
  return jsx("div", {
72
75
  css: containerStyles
@@ -6,7 +6,9 @@ const UnfollowGlyph = props => /*#__PURE__*/React.createElement("svg", {
6
6
  height: "16",
7
7
  viewBox: "0 0 16 16",
8
8
  "data-testid": props['data-testid'],
9
- "aria-label": props['aria-label'],
9
+ "aria-label": props['aria-label']
10
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
11
+ ,
10
12
  className: props.className,
11
13
  role: "presentation",
12
14
  xmlns: "http://www.w3.org/2000/svg"
@@ -103,7 +103,9 @@ const ActionGroup = ({
103
103
  return null;
104
104
  }, [appearance, isMoreThenTwoItems, isOpen, onActionItemClick, onOpenChange, renderableActionItems, size, ui === null || ui === void 0 ? void 0 : ui.zIndex, visibleButtonsNum]);
105
105
  return renderableActionItems.length > 0 ? jsx("div", {
106
- css: styles,
106
+ css: styles
107
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
108
+ ,
107
109
  className: "actions-button-group",
108
110
  "data-action-open": isOpen
109
111
  }, jsx(ButtonGroup, null, actionButtons, moreActionDropdown)) : null;
@@ -63,6 +63,7 @@ const TitleBlockErroredView = ({
63
63
  direction: SmartLinkDirection.Horizontal,
64
64
  align: SmartLinkAlignment.Right
65
65
  }, jsx("span", {
66
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
66
67
  className: hasAction ? 'has-action' : '',
67
68
  css: getMessageStyles(size, hasAction),
68
69
  onClick: onClick,
@@ -24,13 +24,16 @@ export const MotionWrapper = ({
24
24
  style: {
25
25
  height,
26
26
  minHeight,
27
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
27
28
  lineHeight: 0,
29
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
28
30
  overflow: 'hidden',
29
31
  // a fit for purpose state variable to control when the 'visible' styles should be appled
30
32
  opacity: height > 0 ? 1 : 0,
31
33
  // we only want to transition opacity and height when the error message is initially shown
32
34
  // not if its to be shown on mount
33
35
  transitionProperty: showTransition ? transition : 'none',
36
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
34
37
  transitionDuration: '0.3s'
35
38
  },
36
39
  ref: ref
@@ -49,6 +49,7 @@ const LayeredLink = ({
49
49
  }) => {
50
50
  const onMouseDown = useMouseDownEvent();
51
51
  return jsx("a", {
52
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
52
53
  className: "layered-link",
53
54
  css: styles,
54
55
  "data-testid": `${testId}-layered-link`,
@@ -35,7 +35,9 @@ const Lozenge = ({
35
35
  text: text,
36
36
  zIndex: ui === null || ui === void 0 ? void 0 : ui.zIndex
37
37
  }) : jsx(AtlaskitLozenge, {
38
- appearance: appearance,
38
+ appearance: appearance
39
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
40
+ ,
39
41
  style: style,
40
42
  testId: `${testId}-lozenge`
41
43
  }, text);
@@ -45,6 +45,7 @@ const ConnectedAIPrismContainer = ({
45
45
  setShowPrism(status === 'loading');
46
46
  }, [status]);
47
47
  const container = jsx("div", _extends({
48
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
48
49
  className: hoverCardClassName,
49
50
  css: [HoverCardContainer, !isAIEnabled ? popupContainerStyles : undefined],
50
51
  "data-testid": testId
@@ -69,6 +70,7 @@ const ContentContainer = ({
69
70
  }, props), children);
70
71
  }
71
72
  return jsx("div", _extends({
73
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
72
74
  className: hoverCardClassName,
73
75
  css: HoverCardContainer,
74
76
  "data-testid": testId
@@ -44,7 +44,9 @@ export const Frame = /*#__PURE__*/forwardRef((props, ref) => {
44
44
  onClick: handleClick,
45
45
  onMouseDown: handleMouseDown,
46
46
  onKeyPress: handleKeyPress,
47
- "data-testid": testId,
47
+ "data-testid": testId
48
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
49
+ ,
48
50
  className: className,
49
51
  ref: ref,
50
52
  isHovered: isHovered
@@ -43,7 +43,9 @@ export const Shimmer = ({
43
43
  width: 14,
44
44
  height: 14,
45
45
  borderRadius: 2,
46
- testId: testId,
46
+ testId: testId
47
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
48
+ ,
47
49
  style: skeletonCustomStyles
48
50
  });
49
51
  };
@@ -54,7 +54,9 @@ export class IconAndTitleLayout extends React.Component {
54
54
  }
55
55
  return /*#__PURE__*/React.createElement(ImageLoader, {
56
56
  src: url,
57
- loaded: /*#__PURE__*/React.createElement(Icon, {
57
+ loaded: /*#__PURE__*/React.createElement(Icon
58
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
59
+ , {
58
60
  className: "smart-link-icon",
59
61
  src: url,
60
62
  "data-testid": `${testId}-image`
@@ -101,22 +103,30 @@ export class IconAndTitleLayout extends React.Component {
101
103
  rightSide,
102
104
  testId = 'inline-card-icon-and-title'
103
105
  } = this.props;
104
- const titlePart = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconPositionWrapper, null, children || /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconEmptyWrapper, null), this.renderIcon(testId))), /*#__PURE__*/React.createElement(TitleWrapper, {
106
+ const titlePart = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconPositionWrapper, null, children || /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconEmptyWrapper, null), this.renderIcon(testId))), /*#__PURE__*/React.createElement(TitleWrapper
107
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
108
+ , {
105
109
  style: {
106
110
  color: titleTextColor
107
- },
111
+ }
112
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
113
+ ,
108
114
  className: TitleWrapperClassName
109
115
  }, title));
110
- return /*#__PURE__*/React.createElement(IconTitleWrapper, {
111
- style: {
112
- color: titleColor
113
- },
114
- "data-testid": testId
115
- }, link ? /*#__PURE__*/React.createElement(LinkAppearance, {
116
- href: link,
117
- onClick: this.handleClick,
118
- onKeyPress: this.handleKeyPress
119
- }, titlePart) : titlePart, rightSide ? /*#__PURE__*/React.createElement(NoLinkAppearance, null, rightSide) : null);
116
+ return (
117
+ /*#__PURE__*/
118
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
119
+ React.createElement(IconTitleWrapper, {
120
+ style: {
121
+ color: titleColor
122
+ },
123
+ "data-testid": testId
124
+ }, link ? /*#__PURE__*/React.createElement(LinkAppearance, {
125
+ href: link,
126
+ onClick: this.handleClick,
127
+ onKeyPress: this.handleKeyPress
128
+ }, titlePart) : titlePart, rightSide ? /*#__PURE__*/React.createElement(NoLinkAppearance, null, rightSide) : null)
129
+ );
120
130
  }
121
131
  }
122
132
  _defineProperty(IconAndTitleLayout, "defaultProps", {
@@ -15,7 +15,9 @@ export class InlineCardResolvedView extends React.Component {
15
15
  const appearance = lozenge.appearance || 'default';
16
16
  return /*#__PURE__*/React.createElement(LozengeWrapper, null, /*#__PURE__*/React.createElement(Lozenge, {
17
17
  testId: "inline-card-resolved-view-lozenge",
18
- appearance: appearance,
18
+ appearance: appearance
19
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
20
+ ,
19
21
  style: lozenge.style,
20
22
  isBold: lozenge.isBold
21
23
  }, lozenge.text));
@@ -7,7 +7,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
7
7
  import LinkWarningModal from './LinkWarningModal';
8
8
  const PACKAGE_DATA = {
9
9
  packageName: "@atlaskit/smart-card",
10
- packageVersion: "27.1.0",
10
+ packageVersion: "27.2.0",
11
11
  componentName: 'linkUrl'
12
12
  };
13
13
  const Link = withLinkClickedEvent('a');
@@ -1,18 +1,21 @@
1
- import React from 'react';
1
+ /** @jsx jsx */
2
+
3
+ import { jsx } from '@emotion/react';
2
4
  import { FormattedMessage } from 'react-intl-next';
3
5
  import Button from '@atlaskit/button/new';
4
6
  import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
5
7
  import { messages } from '../../../messages';
6
- const RelatedLinksModal = ({
8
+ const RelatedLinksBaseModal = ({
7
9
  onClose,
8
10
  showModal,
9
11
  children
10
12
  }) => {
11
- return /*#__PURE__*/React.createElement(ModalTransition, null, showModal && /*#__PURE__*/React.createElement(Modal, {
12
- onClose: onClose
13
- }, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement(ModalTitle, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.related_links_modal_title_nonfinal))), /*#__PURE__*/React.createElement(ModalBody, null, children), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
13
+ return jsx(ModalTransition, null, showModal && jsx(Modal, {
14
+ onClose: onClose,
15
+ width: "small"
16
+ }, jsx(ModalHeader, null, jsx(ModalTitle, null, jsx(FormattedMessage, messages.related_links_modal_title))), jsx(ModalBody, null, children), jsx(ModalFooter, null, jsx(Button, {
14
17
  appearance: "primary",
15
18
  onClick: onClose
16
- }, /*#__PURE__*/React.createElement(FormattedMessage, messages.close)))));
19
+ }, jsx(FormattedMessage, messages.close)))));
17
20
  };
18
- export default RelatedLinksModal;
21
+ export default RelatedLinksBaseModal;
@@ -0,0 +1,50 @@
1
+ /** @jsx jsx */
2
+ import { css, jsx } from '@emotion/react';
3
+ import { Box, xcss } from '@atlaskit/primitives';
4
+ import { Card, ElementName, SmartLinkPosition, SmartLinkSize, SmartLinkTheme, TitleBlock } from '../../../../index';
5
+ const hoverStyles = xcss({
6
+ ':hover': {
7
+ backgroundColor: 'color.background.input.hovered',
8
+ borderRadius: 'border.radius.100',
9
+ marginInline: 'space.negative.100',
10
+ paddingInline: 'space.100'
11
+ }
12
+ });
13
+ const relatedLinkItemStyles = css({
14
+ paddingTop: "var(--ds-space-100, 8px)",
15
+ paddingBottom: "var(--ds-space-100, 8px)",
16
+ gap: "var(--ds-space-150, 12px)",
17
+ font: "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
18
+ });
19
+ const RelatedLinkItem = ({
20
+ url,
21
+ testId
22
+ }) => {
23
+ const subtitle = [{
24
+ name: ElementName.Provider
25
+ }];
26
+ const ui = {
27
+ hideElevation: true,
28
+ hidePadding: true,
29
+ hideBackground: true,
30
+ theme: SmartLinkTheme.Black,
31
+ clickableContainer: true,
32
+ size: SmartLinkSize.Large
33
+ };
34
+ return jsx(Box, {
35
+ testId: testId,
36
+ xcss: hoverStyles
37
+ }, jsx(Card, {
38
+ appearance: "block",
39
+ ui: ui,
40
+ url: url
41
+ }, jsx(TitleBlock, {
42
+ maxLines: 1,
43
+ hideTitleTooltip: true,
44
+ position: SmartLinkPosition.Center,
45
+ subtitle: subtitle,
46
+ overrideCss: relatedLinkItemStyles,
47
+ anchorTarget: "_blank"
48
+ })));
49
+ };
50
+ export default RelatedLinkItem;
@@ -0,0 +1,33 @@
1
+ /** @jsx jsx */
2
+
3
+ import { jsx } from '@emotion/react';
4
+ import { FormattedMessage } from 'react-intl-next';
5
+ import { Box, Stack, xcss } from '@atlaskit/primitives';
6
+ import RelatedLinkItem from '../related-link-item';
7
+ import { messages } from '../../../../messages';
8
+ const RelatedLinksList = ({
9
+ urls,
10
+ title,
11
+ testId
12
+ }) => {
13
+ return jsx(Stack, {
14
+ testId: testId
15
+ }, jsx(Box, {
16
+ paddingBlockStart: "space.050",
17
+ xcss: xcss({
18
+ font: "var(--ds-font-heading-xxsmall, normal 600 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
19
+ textTransform: 'uppercase'
20
+ })
21
+ }, jsx(FormattedMessage, title)), urls.length > 0 && jsx(Box, null, urls.map((url, idx) => jsx(Stack, {
22
+ key: `${idx}-${url}`
23
+ }, jsx(RelatedLinkItem, {
24
+ url: url,
25
+ testId: `${testId}-item-${idx}`
26
+ })))), urls.length === 0 && jsx(Box, {
27
+ paddingBlock: "space.100",
28
+ xcss: xcss({
29
+ font: "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
30
+ })
31
+ }, jsx(FormattedMessage, messages.related_links_not_found)));
32
+ };
33
+ export default RelatedLinksList;
@@ -0,0 +1,23 @@
1
+ /** @jsx jsx */
2
+
3
+ import { jsx } from '@emotion/react';
4
+ import { messages } from '../../../../messages';
5
+ import RelatedLinksList from '../../components/related-links-list';
6
+ import { Stack } from '@atlaskit/primitives';
7
+ const RelatedLinksResolvedView = ({
8
+ incomingLinks = [],
9
+ outgoingLinks = []
10
+ }) => {
11
+ return jsx(Stack, {
12
+ space: "space.150"
13
+ }, jsx(RelatedLinksList, {
14
+ urls: incomingLinks,
15
+ title: messages.related_links_found_in,
16
+ testId: "incoming-related-links-list"
17
+ }), jsx(RelatedLinksList, {
18
+ urls: outgoingLinks,
19
+ title: messages.related_links_includes_links_to,
20
+ testId: "outgoing-related-links-list"
21
+ }));
22
+ };
23
+ export default RelatedLinksResolvedView;
@@ -29,6 +29,8 @@ export const Byline = ({
29
29
  // due to HTML its unwrapping behaviour on paste.
30
30
  MozUserSelect: 'none'
31
31
  }),
32
- "data-testid": testId,
32
+ "data-testid": testId
33
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
34
+ ,
33
35
  className: className
34
36
  }, text || children);
@@ -55,7 +55,9 @@ export const Icon = ({
55
55
  });
56
56
  return jsx("span", {
57
57
  css: getSpanStyles(isFlexibleUi),
58
- "data-testid": testId,
58
+ "data-testid": testId
59
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
60
+ ,
59
61
  className: blockCardIconImageClassName
60
62
  }, icon || image || placeholder);
61
63
  };
@@ -18,7 +18,9 @@ export const MetadataList = ({
18
18
  marginRight: '0px'
19
19
  }
20
20
  },
21
- "data-testid": testId,
21
+ "data-testid": testId
22
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
23
+ ,
22
24
  className: metadataListClassName
23
25
  }, items.map(item => jsx(Metadata, _extends({
24
26
  key: item.text
@@ -2,7 +2,6 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  import { extractLozenge } from '../common/lozenge';
5
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
6
5
  import { getExtensionKey } from '../../state/helpers';
7
6
  import extractServerAction from './extract-server-action';
8
7
  import { extractLink } from '@atlaskit/link-extractors';
@@ -58,7 +57,7 @@ var extractState = function extractState(response, actionOptions, id) {
58
57
  if (!lozenge) {
59
58
  return;
60
59
  }
61
- if (!canShowAction(CardAction.ChangeStatusAction, actionOptions) || getBooleanFF('platform.linking-platform.smart-card.disable-jira-status-action')) {
60
+ if (!canShowAction(CardAction.ChangeStatusAction, actionOptions)) {
62
61
  return lozenge;
63
62
  }
64
63
  var action = extractAction(response, id);
@@ -700,8 +700,8 @@ export var messages = defineMessages({
700
700
  defaultMessage: 'An error occurred',
701
701
  description: 'A generic error message to the user'
702
702
  },
703
- related_links_modal_title_nonfinal: {
704
- id: 'fabric.linking.related_links_modal_title.nonfinal',
703
+ related_links_modal_title: {
704
+ id: 'fabric.linking.related_links_modal_title',
705
705
  defaultMessage: 'Recent Links',
706
706
  description: 'Shown as the title for the related links modal'
707
707
  },
@@ -709,5 +709,20 @@ export var messages = defineMessages({
709
709
  id: 'fabric.linking.related_links_view_related_urls.nonfinal',
710
710
  defaultMessage: 'View recent links...',
711
711
  description: 'Action to view related links to the given resource'
712
+ },
713
+ related_links_found_in: {
714
+ id: 'fabric.linking.related_links_found_in',
715
+ defaultMessage: 'Found In',
716
+ description: 'Informs the user of the resources are found in the given url'
717
+ },
718
+ related_links_not_found: {
719
+ id: 'fabric.linking.related_links_not_found',
720
+ defaultMessage: 'We didn\'t find any links to show here.',
721
+ description: 'Informs the user that there are no related resources for the given url'
722
+ },
723
+ related_links_includes_links_to: {
724
+ id: 'fabric.linking.related_links_includes_links_to',
725
+ defaultMessage: 'Includes Links To',
726
+ description: 'Informs the user of the resources the url links to'
712
727
  }
713
728
  });
@@ -15,7 +15,7 @@ export var ANALYTICS_CHANNEL = 'media';
15
15
  export var context = {
16
16
  componentName: 'smart-cards',
17
17
  packageName: "@atlaskit/smart-card",
18
- packageVersion: "27.1.0"
18
+ packageVersion: "27.2.0"
19
19
  };
20
20
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
21
21
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -21,20 +21,28 @@ export var ActionIcon = function ActionIcon(_ref) {
21
21
  case 'loading':
22
22
  return null;
23
23
  case 'success':
24
- return /*#__PURE__*/React.createElement("div", {
25
- "data-testid": "check-icon",
26
- style: spinnerStyles
27
- }, /*#__PURE__*/React.createElement(CheckIcon, {
28
- size: "small",
29
- label: "check"
30
- }));
24
+ return (
25
+ /*#__PURE__*/
26
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
27
+ React.createElement("div", {
28
+ "data-testid": "check-icon",
29
+ style: spinnerStyles
30
+ }, /*#__PURE__*/React.createElement(CheckIcon, {
31
+ size: "small",
32
+ label: "check"
33
+ }))
34
+ );
31
35
  case 'failure':
32
- return /*#__PURE__*/React.createElement("div", {
33
- "data-testid": "cross-icon",
34
- style: spinnerStyles
35
- }, /*#__PURE__*/React.createElement(CrossIcon, {
36
- size: "small",
37
- label: "check"
38
- }));
36
+ return (
37
+ /*#__PURE__*/
38
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
39
+ React.createElement("div", {
40
+ "data-testid": "cross-icon",
41
+ style: spinnerStyles
42
+ }, /*#__PURE__*/React.createElement(CrossIcon, {
43
+ size: "small",
44
+ label: "check"
45
+ }))
46
+ );
39
47
  }
40
48
  };
@@ -21,7 +21,9 @@ export var Content = function Content(_ref) {
21
21
  justifyContent: isCompact ? 'unset' : ['unset', 'space-between'],
22
22
  flexGrow: 1
23
23
  }),
24
- "data-trello-do-not-use-override": "block-card-content",
24
+ "data-trello-do-not-use-override": "block-card-content"
25
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
26
+ ,
25
27
  className: blockCardContentClassName
26
28
  }, children);
27
29
  };
@@ -15,7 +15,9 @@ export var ContentFooter = function ContentFooter(_ref) {
15
15
  alignItems: ['unset', 'center'],
16
16
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
17
17
  marginTop: [gs(1), gs(1.5)]
18
- }),
18
+ })
19
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
20
+ ,
19
21
  className: contentFooterClassName
20
22
  }, children);
21
23
  };
@@ -25,7 +25,9 @@ export var ContentHeader = function ContentHeader(_ref) {
25
25
  // due to HTML its unwrapping behaviour on paste.
26
26
  MozUserSelect: 'none'
27
27
  },
28
- "data-trello-do-not-use-override": "block-card-content-header",
28
+ "data-trello-do-not-use-override": "block-card-content-header"
29
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
30
+ ,
29
31
  className: blockCardContentHeaderClassName
30
32
  }, children);
31
33
  };
@@ -41,7 +41,9 @@ export var ExpandedFrame = function ExpandedFrame(_ref) {
41
41
  overflow: 'hidden',
42
42
  boxShadow: "var(--ds-shadow-raised, ".concat("0 1px 1px ".concat(N50A, ", 0 0 1px 1px ").concat(N40A), ")")
43
43
  })),
44
- "data-testid": testId,
44
+ "data-testid": testId
45
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
46
+ ,
45
47
  className: className,
46
48
  "data-trello-do-not-use-override": testId
47
49
  }, children);
@@ -68,7 +70,9 @@ export var CompactFrame = function CompactFrame(_ref2) {
68
70
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
69
71
  padding: ["0px ".concat(gs(1)), '0']
70
72
  })),
71
- "data-testid": testId,
73
+ "data-testid": testId
74
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
75
+ ,
72
76
  className: className
73
77
  }, children);
74
78
  };
@@ -7,7 +7,9 @@ export var Link = function Link(_ref) {
7
7
  testId = _ref$testId === void 0 ? 'block-card' : _ref$testId,
8
8
  className = _ref.className;
9
9
  return jsx("span", {
10
- "data-testid": "".concat(testId, "-link"),
10
+ "data-testid": "".concat(testId, "-link")
11
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
12
+ ,
11
13
  className: className,
12
14
  css: {
13
15
  color: "var(--ds-link, ".concat(B400, ")"),
@@ -34,7 +34,9 @@ export var Name = function Name(_ref) {
34
34
  maxHeight: gs(6)
35
35
  },
36
36
  "data-testid": testId,
37
- "data-trello-do-not-use-override": "block-card-content-header-name",
37
+ "data-trello-do-not-use-override": "block-card-content-header-name"
38
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
39
+ ,
38
40
  className: blockCardContentHeaderNameClassName
39
41
  }, name);
40
42
  };
@@ -8,6 +8,7 @@ export var Provider = function Provider(_ref) {
8
8
  var iconToRender = icon || null;
9
9
  if (typeof icon === 'string') {
10
10
  iconToRender = jsx("img", {
11
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
11
12
  className: "smart-link-icon",
12
13
  css: {
13
14
  height: gs(1.5),
@@ -46,7 +46,9 @@ export var ErroredView = function ErroredView(_ref) {
46
46
  }, [onRetry]);
47
47
  return jsx(Frame, {
48
48
  isSelected: isSelected,
49
- testId: testId,
49
+ testId: testId
50
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
51
+ ,
50
52
  className: blockCardErroredViewClassName,
51
53
  isFluidHeight: true,
52
54
  inheritDimensions: inheritDimensions
@@ -61,7 +61,9 @@ export var ForbiddenView = function ForbiddenView(_ref) {
61
61
  var items = action !== undefined && !(buttonDisabled !== null && buttonDisabled !== void 0 ? buttonDisabled : false) ? [].concat(_toConsumableArray(actions), [action]) : actions;
62
62
  return jsx(Frame, {
63
63
  isSelected: isSelected,
64
- testId: testId,
64
+ testId: testId
65
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
66
+ ,
65
67
  className: blockCardForbiddenViewClassName,
66
68
  isFluidHeight: true
67
69
  }, jsx(Content, {
@@ -71,7 +73,9 @@ export var ForbiddenView = function ForbiddenView(_ref) {
71
73
  link: link
72
74
  }, jsx(Link, {
73
75
  url: link,
74
- testId: testId,
76
+ testId: testId
77
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
78
+ ,
75
79
  className: blockCardForbiddenViewLinkClassName
76
80
  })), jsx(Byline, null, jsx(UnresolvedText, {
77
81
  icon: jsx(LockIcon, {