@atlaskit/smart-card 19.0.0 → 19.0.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 (114) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/constants.js +4 -4
  3. package/dist/cjs/version.json +1 -1
  4. package/dist/cjs/view/FlexibleCard/components/actions/action/index.js +2 -2
  5. package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +1 -0
  6. package/dist/cjs/view/FlexibleCard/components/blocks/block/index.js +3 -2
  7. package/dist/cjs/view/FlexibleCard/components/blocks/element-group/index.js +1 -0
  8. package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/index.js +1 -0
  9. package/dist/cjs/view/FlexibleCard/components/blocks/metadata-block/index.js +1 -0
  10. package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/index.js +1 -0
  11. package/dist/cjs/view/FlexibleCard/components/blocks/snippet-block/index.js +1 -0
  12. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/index.js +2 -1
  13. package/dist/cjs/view/FlexibleCard/components/container/index.js +19 -6
  14. package/dist/cjs/view/FlexibleCard/components/container/layered-link/index.js +5 -0
  15. package/dist/cjs/view/FlexibleCard/components/elements/avatar-group/index.js +2 -2
  16. package/dist/cjs/view/FlexibleCard/components/elements/badge/index.js +2 -2
  17. package/dist/cjs/view/FlexibleCard/components/elements/date-time/index.js +2 -2
  18. package/dist/cjs/view/FlexibleCard/components/elements/icon/index.js +2 -2
  19. package/dist/cjs/view/FlexibleCard/components/elements/index.js +2 -2
  20. package/dist/cjs/view/FlexibleCard/components/elements/link/index.js +3 -3
  21. package/dist/cjs/view/FlexibleCard/components/elements/lozenge/index.js +2 -2
  22. package/dist/cjs/view/FlexibleCard/components/elements/media/index.js +2 -2
  23. package/dist/cjs/view/FlexibleCard/components/elements/text/index.js +2 -2
  24. package/dist/es2019/constants.js +4 -4
  25. package/dist/es2019/version.json +1 -1
  26. package/dist/es2019/view/FlexibleCard/components/actions/action/index.js +2 -2
  27. package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +1 -0
  28. package/dist/es2019/view/FlexibleCard/components/blocks/block/index.js +3 -2
  29. package/dist/es2019/view/FlexibleCard/components/blocks/element-group/index.js +1 -0
  30. package/dist/es2019/view/FlexibleCard/components/blocks/footer-block/index.js +1 -0
  31. package/dist/es2019/view/FlexibleCard/components/blocks/metadata-block/index.js +1 -0
  32. package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/index.js +1 -0
  33. package/dist/es2019/view/FlexibleCard/components/blocks/snippet-block/index.js +1 -0
  34. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/index.js +2 -1
  35. package/dist/es2019/view/FlexibleCard/components/container/index.js +19 -6
  36. package/dist/es2019/view/FlexibleCard/components/container/layered-link/index.js +5 -0
  37. package/dist/es2019/view/FlexibleCard/components/elements/avatar-group/index.js +2 -2
  38. package/dist/es2019/view/FlexibleCard/components/elements/badge/index.js +2 -2
  39. package/dist/es2019/view/FlexibleCard/components/elements/date-time/index.js +2 -2
  40. package/dist/es2019/view/FlexibleCard/components/elements/icon/index.js +2 -2
  41. package/dist/es2019/view/FlexibleCard/components/elements/index.js +2 -2
  42. package/dist/es2019/view/FlexibleCard/components/elements/link/index.js +3 -3
  43. package/dist/es2019/view/FlexibleCard/components/elements/lozenge/index.js +2 -2
  44. package/dist/es2019/view/FlexibleCard/components/elements/media/index.js +2 -2
  45. package/dist/es2019/view/FlexibleCard/components/elements/text/index.js +2 -2
  46. package/dist/esm/constants.js +4 -4
  47. package/dist/esm/version.json +1 -1
  48. package/dist/esm/view/FlexibleCard/components/actions/action/index.js +2 -2
  49. package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +1 -0
  50. package/dist/esm/view/FlexibleCard/components/blocks/block/index.js +3 -2
  51. package/dist/esm/view/FlexibleCard/components/blocks/element-group/index.js +1 -0
  52. package/dist/esm/view/FlexibleCard/components/blocks/footer-block/index.js +1 -0
  53. package/dist/esm/view/FlexibleCard/components/blocks/metadata-block/index.js +1 -0
  54. package/dist/esm/view/FlexibleCard/components/blocks/preview-block/index.js +1 -0
  55. package/dist/esm/view/FlexibleCard/components/blocks/snippet-block/index.js +1 -0
  56. package/dist/esm/view/FlexibleCard/components/blocks/title-block/index.js +2 -1
  57. package/dist/esm/view/FlexibleCard/components/container/index.js +19 -6
  58. package/dist/esm/view/FlexibleCard/components/container/layered-link/index.js +5 -0
  59. package/dist/esm/view/FlexibleCard/components/elements/avatar-group/index.js +2 -2
  60. package/dist/esm/view/FlexibleCard/components/elements/badge/index.js +2 -2
  61. package/dist/esm/view/FlexibleCard/components/elements/date-time/index.js +2 -2
  62. package/dist/esm/view/FlexibleCard/components/elements/icon/index.js +2 -2
  63. package/dist/esm/view/FlexibleCard/components/elements/index.js +2 -2
  64. package/dist/esm/view/FlexibleCard/components/elements/link/index.js +3 -3
  65. package/dist/esm/view/FlexibleCard/components/elements/lozenge/index.js +2 -2
  66. package/dist/esm/view/FlexibleCard/components/elements/media/index.js +2 -2
  67. package/dist/esm/view/FlexibleCard/components/elements/text/index.js +2 -2
  68. package/dist/types/constants.d.ts +4 -4
  69. package/dist/types/view/FlexibleCard/components/actions/action/index.d.ts +2 -2
  70. package/dist/types/view/FlexibleCard/components/actions/action/types.d.ts +43 -0
  71. package/dist/types/view/FlexibleCard/components/blocks/action-group/index.d.ts +1 -0
  72. package/dist/types/view/FlexibleCard/components/blocks/action-group/types.d.ts +25 -0
  73. package/dist/types/view/FlexibleCard/components/blocks/block/index.d.ts +3 -2
  74. package/dist/types/view/FlexibleCard/components/blocks/element-group/index.d.ts +1 -0
  75. package/dist/types/view/FlexibleCard/components/blocks/footer-block/index.d.ts +1 -0
  76. package/dist/types/view/FlexibleCard/components/blocks/footer-block/types.d.ts +8 -2
  77. package/dist/types/view/FlexibleCard/components/blocks/metadata-block/index.d.ts +1 -0
  78. package/dist/types/view/FlexibleCard/components/blocks/metadata-block/types.d.ts +22 -2
  79. package/dist/types/view/FlexibleCard/components/blocks/preview-block/index.d.ts +1 -0
  80. package/dist/types/view/FlexibleCard/components/blocks/snippet-block/index.d.ts +1 -0
  81. package/dist/types/view/FlexibleCard/components/blocks/snippet-block/types.d.ts +6 -2
  82. package/dist/types/view/FlexibleCard/components/blocks/title-block/index.d.ts +2 -1
  83. package/dist/types/view/FlexibleCard/components/blocks/title-block/types.d.ts +63 -13
  84. package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +68 -2
  85. package/dist/types/view/FlexibleCard/components/common/loading-skeleton/types.d.ts +5 -0
  86. package/dist/types/view/FlexibleCard/components/container/index.d.ts +5 -1
  87. package/dist/types/view/FlexibleCard/components/container/layered-link/index.d.ts +5 -0
  88. package/dist/types/view/FlexibleCard/components/container/types.d.ts +20 -10
  89. package/dist/types/view/FlexibleCard/components/elements/avatar-group/index.d.ts +2 -2
  90. package/dist/types/view/FlexibleCard/components/elements/avatar-group/types.d.ts +12 -0
  91. package/dist/types/view/FlexibleCard/components/elements/badge/index.d.ts +2 -2
  92. package/dist/types/view/FlexibleCard/components/elements/badge/types.d.ts +10 -0
  93. package/dist/types/view/FlexibleCard/components/elements/date-time/index.d.ts +2 -2
  94. package/dist/types/view/FlexibleCard/components/elements/date-time/types.d.ts +6 -0
  95. package/dist/types/view/FlexibleCard/components/elements/icon/index.d.ts +2 -2
  96. package/dist/types/view/FlexibleCard/components/elements/icon/types.d.ts +16 -3
  97. package/dist/types/view/FlexibleCard/components/elements/index.d.ts +2 -2
  98. package/dist/types/view/FlexibleCard/components/elements/link/index.d.ts +3 -3
  99. package/dist/types/view/FlexibleCard/components/elements/link/types.d.ts +21 -1
  100. package/dist/types/view/FlexibleCard/components/elements/lozenge/index.d.ts +2 -2
  101. package/dist/types/view/FlexibleCard/components/elements/lozenge/types.d.ts +6 -0
  102. package/dist/types/view/FlexibleCard/components/elements/media/index.d.ts +2 -2
  103. package/dist/types/view/FlexibleCard/components/elements/media/types.d.ts +6 -0
  104. package/dist/types/view/FlexibleCard/components/elements/text/index.d.ts +2 -2
  105. package/dist/types/view/FlexibleCard/components/elements/text/types.d.ts +10 -0
  106. package/dist/types/view/FlexibleCard/components/elements/types.d.ts +11 -0
  107. package/dist/types/view/FlexibleCard/components/types.d.ts +1 -0
  108. package/dist/types/view/FlexibleCard/types.d.ts +71 -1
  109. package/docs-helpers/flexible-ui-action-item.tsx +6 -0
  110. package/docs-helpers/flexible-ui-actions-prop.tsx +6 -0
  111. package/docs-helpers/flexible-ui-element-item.tsx +6 -0
  112. package/docs-helpers/flexible-ui-prop.tsx +6 -0
  113. package/docs-helpers/flexible-ui.tsx +28 -0
  114. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 19.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`49f905e71e5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/49f905e71e5) - Flexible UI: Add API document and update prop types.
8
+
3
9
  ## 19.0.0
4
10
 
5
11
  ### Major Changes
@@ -132,9 +132,6 @@ exports.ElementName = ElementName;
132
132
  ElementName["AuthorGroup"] = "AuthorGroup";
133
133
  ElementName["CollaboratorGroup"] = "CollaboratorGroup";
134
134
  ElementName["CommentCount"] = "CommentCount";
135
- ElementName["ViewCount"] = "ViewCount";
136
- ElementName["ReactCount"] = "ReactCount";
137
- ElementName["VoteCount"] = "VoteCount";
138
135
  ElementName["CreatedBy"] = "CreatedBy";
139
136
  ElementName["CreatedOn"] = "CreatedOn";
140
137
  ElementName["LinkIcon"] = "LinkIcon";
@@ -143,11 +140,14 @@ exports.ElementName = ElementName;
143
140
  ElementName["Preview"] = "Preview";
144
141
  ElementName["Priority"] = "Priority";
145
142
  ElementName["ProgrammingLanguage"] = "ProgrammingLanguage";
143
+ ElementName["Provider"] = "Provider";
144
+ ElementName["ReactCount"] = "ReactCount";
146
145
  ElementName["Snippet"] = "Snippet";
147
146
  ElementName["State"] = "State";
148
147
  ElementName["SubscriberCount"] = "SubscriberCount";
149
148
  ElementName["Title"] = "Title";
150
- ElementName["Provider"] = "Provider";
149
+ ElementName["ViewCount"] = "ViewCount";
150
+ ElementName["VoteCount"] = "VoteCount";
151
151
  })(ElementName || (exports.ElementName = ElementName = {}));
152
152
 
153
153
  var ActionName;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "19.0.0",
3
+ "version": "19.0.1",
4
4
  "sideEffects": false
5
5
  }
@@ -75,8 +75,8 @@ var ActionIcon = function ActionIcon(_ref) {
75
75
 
76
76
  var sizeToSpacing = (_sizeToSpacing = {}, (0, _defineProperty2.default)(_sizeToSpacing, _constants.SmartLinkSize.Small, 'none'), (0, _defineProperty2.default)(_sizeToSpacing, _constants.SmartLinkSize.Medium, 'compact'), (0, _defineProperty2.default)(_sizeToSpacing, _constants.SmartLinkSize.Large, 'compact'), (0, _defineProperty2.default)(_sizeToSpacing, _constants.SmartLinkSize.XLarge, 'default'), _sizeToSpacing);
77
77
  /**
78
- * An action that can be triggered with an on click.
79
- * @public
78
+ * A base action that can be triggered with an on click.
79
+ * @internal
80
80
  * @param {ActionProps} ActionProps - The props necessary for the Action.
81
81
  * @see DeleteAction
82
82
  * @see EditAction
@@ -39,6 +39,7 @@ var styles = (0, _core.css)(_templateObject || (_templateObject = (0, _taggedTem
39
39
  /**
40
40
  * Creates a group of Action components. Accepts an array of Actions, in addition to some styling
41
41
  * preferences.
42
+ * @internal
42
43
  * @param {ActionGroupProps} ActionGroupProps
43
44
  * @see Action
44
45
  */
@@ -23,8 +23,9 @@ var getBlockStyles = function getBlockStyles(direction, size) {
23
23
  return (0, _core.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n justify-content: flex-start;\n [data-separator] + [data-separator]:before {\n content: '\u2022';\n margin-right: ", "rem;\n }\n"])), (0, _utils.getBaseStyles)(direction, size), (0, _utils.getGapSize)(size));
24
24
  };
25
25
  /**
26
- * A block represents a collection of elements and actions that are arranged in a row.
27
- * All elements and actions should be contained within a Block.
26
+ * A block represents a collection of elements and actions that are arranged
27
+ * in a row. All elements and actions should be contained within a Block.
28
+ * @internal
28
29
  * @param {ActionGroupProps} ActionGroupProps
29
30
  * @see Action
30
31
  */
@@ -36,6 +36,7 @@ var getElementGroupStyles = function getElementGroupStyles(direction, size, alig
36
36
  /**
37
37
  * Creates a group of Action components. Accepts an array of Actions, in addition to some styling
38
38
  * preferences.
39
+ * @internal
39
40
  * @param {ActionGroupProps} ActionGroupProps
40
41
  * @see Action
41
42
  */
@@ -24,6 +24,7 @@ var _actionGroup = _interopRequireDefault(require("../action-group"));
24
24
  /**
25
25
  * Represents a FooterBlock, designed to contain elements and actions that should appear
26
26
  * at the bottom of a link card.
27
+ * @public
27
28
  * @param {FooterBlockProps} FooterBlockProps
28
29
  * @see Block
29
30
  */
@@ -77,6 +77,7 @@ var getMaxLines = function getMaxLines(maxLines) {
77
77
  /**
78
78
  * Represents a MetadataBlock, designed to contain groups of metadata in the form of elements.
79
79
  * Accepts an array of elements to be shown either primary (left hand side) or secondary (right hand side).
80
+ * @public
80
81
  * @param {MetadataBlockProps} MetadataBlockProps
81
82
  * @see Block
82
83
  */
@@ -23,6 +23,7 @@ var _excluded = ["status", "testId"];
23
23
 
24
24
  /**
25
25
  * Represents a PreviewBlock, which typically contains media or other large format content.
26
+ * @public
26
27
  * @param {PreviewBlock} PreviewBlock
27
28
  * @see Block
28
29
  */
@@ -27,6 +27,7 @@ var MAXIMUM_MAX_LINES = 3;
27
27
  var MINIMUM_MAX_LINES = 1;
28
28
  /**
29
29
  * Represents a SnippetBlock, which is used to display longer form text content, like descriptions.
30
+ * @public
30
31
  * @param {SnippetBlock} SnippetBlock
31
32
  * @see Block
32
33
  */
@@ -66,10 +66,11 @@ var getTitleBlockViewComponent = function getTitleBlockViewComponent(status) {
66
66
  }
67
67
  };
68
68
  /**
69
- * Represents a TitleBlock, which is the foundation of all Flexible Smart Links.
69
+ * Represents a TitleBlock, which is the foundation of Flexible UI.
70
70
  * This contains an icon, the link, and any associated metadata and actions in one block.
71
71
  * The TitleBlock will also render differently given the state of the smart link.
72
72
  * This can be found in the corresponding Resolving, Resolved and Errored views.
73
+ * @public
73
74
  * @param {TitleBlockProps} TitleBlockProps
74
75
  * @see Block
75
76
  * @see TitleBlockResolvingView
@@ -79,12 +79,21 @@ var renderChildren = function renderChildren(children, containerSize, containerT
79
79
  return _react.default.Children.map(children, function (child) {
80
80
  if ( /*#__PURE__*/_react.default.isValidElement(child) && (0, _flexible.isFlexibleUiBlock)(child)) {
81
81
  var blockSize = child.props.size;
82
+ var size = blockSize || containerSize;
83
+
84
+ if ((0, _flexible.isFlexibleUiTitleBlock)(child)) {
85
+ return /*#__PURE__*/_react.default.cloneElement(child, {
86
+ onClick: onClick,
87
+ retry: retry,
88
+ size: size,
89
+ status: status,
90
+ theme: containerTheme
91
+ });
92
+ }
93
+
82
94
  return /*#__PURE__*/_react.default.cloneElement(child, {
83
- onClick: onClick,
84
- retry: (0, _flexible.isFlexibleUiTitleBlock)(child) ? retry : undefined,
85
- size: blockSize || containerSize,
86
- status: status,
87
- theme: containerTheme
95
+ size: size,
96
+ status: status
88
97
  });
89
98
  }
90
99
  });
@@ -118,7 +127,11 @@ var getLayeredLink = function getLayeredLink(testId, context, children) {
118
127
  });
119
128
  };
120
129
  /**
121
- * This represents the container in which all Flexible UI Smart Links are rendered.
130
+ * A container is a hidden component that build the Flexible Smart Link.
131
+ * All of the Flexible UI components are wrapped inside the container.
132
+ * It inherits the ui props from Card component and applies the custom styling
133
+ * accordingly.
134
+ * @internal
122
135
  * @see Block
123
136
  */
124
137
 
@@ -16,6 +16,11 @@ var _core = require("@emotion/core");
16
16
  var _templateObject;
17
17
 
18
18
  var styles = (0, _core.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n // Stretch the invisible link over the whole of the post.\n // Hide the link\u2019s text.\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n overflow-x: hidden;\n text-indent: 100%;\n white-space: nowrap;\n\n // Needs a heightened specificity to trump other anchor.\n // Stack it under all other links in the post text.\n a&.layered-link {\n position: absolute;\n z-index: 0;\n }\n\n // When hovering over the layered link, any hidden action buttons inside\n // the Container should become visible.\n // As actions resides inside blocks and layered link is expected to be\n // on the same level of blocks. That makes the blocks, e.g. TitleBlock,\n // its sibling. Using general sibling combinator here to apply styling to\n // all the siblings of layered link.\n // The general sibling combinator (~) separates two selectors and matches all\n // iterations of the second element, that are following the first element\n // (though not necessarily immediately), and are children of the same parent\n // element.\n &:hover ~ * {\n .actions-button-group {\n opacity: 1;\n }\n }\n"])));
19
+ /**
20
+ * An anchor component to cover the entire container creating a clickable area.
21
+ * @internal
22
+ * @see `clickableContainer`
23
+ */
19
24
 
20
25
  var LayeredLink = function LayeredLink(_ref) {
21
26
  var target = _ref.target,
@@ -35,8 +35,8 @@ var getStyles = function getStyles(size) {
35
35
  }
36
36
  };
37
37
  /**
38
- * An element that displays a group of avatars.
39
- * @public
38
+ * A base element that displays a group of avatars.
39
+ * @internal
40
40
  * @param {AvatarGroupProps} AvatarGroupProps - The props necessary for the AvatarGroup.
41
41
  * @see AuthorGroup
42
42
  * @see CollaboratorGroup
@@ -65,8 +65,8 @@ var renderImageIcon = function renderImageIcon(url, testId) {
65
65
  }
66
66
  };
67
67
  /**
68
- * An element that displays some text with an associated icon.
69
- * @public
68
+ * A base element that displays some text with an associated icon.
69
+ * @internal
70
70
  * @param {BadgeProps} BadgeProps - The props necessary for the Badge.
71
71
  * @see CommentCount
72
72
  * @see ViewCount
@@ -33,8 +33,8 @@ var typeToDescriptorMap = {
33
33
  modified: _messages.messages.modified_on
34
34
  };
35
35
  /**
36
- * An element that displays an ISO Timestamp in text.
37
- * @public
36
+ * A base element that displays an ISO Timestamp in text.
37
+ * @internal
38
38
  * @param {DateTimeProps} DateTimeProps - The props necessary for the DateTime element.
39
39
  * @see CreatedOn
40
40
  * @see ModifiedOn
@@ -77,8 +77,8 @@ var renderImageIcon = function renderImageIcon(defaultIcon, icon, url, testId) {
77
77
  }
78
78
  };
79
79
  /**
80
- * An element that displays an Icon or favicon.
81
- * @public
80
+ * A base element that displays an Icon or favicon.
81
+ * @internal
82
82
  * @param {IconProps} IconProps - The props necessary for the Icon element.
83
83
  * @see LinkIcon
84
84
  */
@@ -14,12 +14,12 @@ var _constants = require("../../../../constants");
14
14
  // createElement and renderElementItems
15
15
 
16
16
  /**
17
- * Creates an AvatarGroup element using the data from AuthorGroup in the Flexible UI Context.
17
+ * An AvatarGroup element using the data from AuthorGroup in the Flexible UI Context.
18
18
  * @see AvatarGroup
19
19
  */
20
20
  var AuthorGroup = (0, _utils.createElement)(_constants.ElementName.AuthorGroup);
21
21
  /**
22
- * Creates an AvatarGroup element using the data from CollaboratorGroup in the Flexible UI Context.
22
+ * An AvatarGroup element using the data from CollaboratorGroup in the Flexible UI Context.
23
23
  * @see AvatarGroup
24
24
  */
25
25
 
@@ -63,9 +63,9 @@ var getMaxLines = function getMaxLines(maxLines) {
63
63
  return maxLines;
64
64
  };
65
65
  /**
66
- * An element that represent.
67
- * @public
68
- * @param {LinkProps} LinkProps - The props necessary for the Icon element.
66
+ * A base element that represent an anchor.
67
+ * @internal
68
+ * @param {LinkProps} LinkProps - The props necessary for the Link element.
69
69
  * @see LinkIcon
70
70
  */
71
71
 
@@ -19,8 +19,8 @@ var _templateObject;
19
19
 
20
20
  var styles = (0, _core.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n line-height: inherit;\n"])));
21
21
  /**
22
- * An element that displays a Lozenge.
23
- * @public
22
+ * A base element that displays a Lozenge.
23
+ * @internal
24
24
  * @param {LozengeProps} LozengeProps - The props necessary for the Lozenge element.
25
25
  * @see State
26
26
  */
@@ -29,8 +29,8 @@ var _templateObject;
29
29
  */
30
30
  var styles = (0, _core.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n aspect-ratio: 16 / 9;\n display: flex;\n width: 100%;\n\n // fallback\n @supports not (aspect-ratio: auto) {\n padding-top: 56.25%; // 16:9 ratio (9 / 16 = 0.5625)\n height: 0;\n position: relative;\n overflow: hidden;\n }\n\n > img {\n min-height: 100%;\n min-width: 100%;\n max-height: 100%;\n max-width: 100%;\n object-fit: cover;\n object-position: center center;\n\n // fallback\n @supports not (aspect-ratio: auto) {\n position: absolute;\n transform: translate(-50%, -50%);\n left: 50%;\n top: 50%;\n width: auto;\n height: auto;\n }\n }\n"])));
31
31
  /**
32
- * An element that displays a Media.
33
- * @public
32
+ * A base element that displays a Media.
33
+ * @internal
34
34
  * @param {MediaProps} MediaProps - The props necessary for the Media element.
35
35
  * @see Preview
36
36
  */
@@ -23,8 +23,8 @@ var getStyles = function getStyles(maxLines) {
23
23
  return (0, _core.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n font-size: 0.75rem;\n line-height: 1rem;\n ", "\n"])), _token.tokens.text, (0, _utils.getTruncateStyles)(maxLines));
24
24
  };
25
25
  /**
26
- * An element that displays some Text.
27
- * @public
26
+ * A base element that displays some Text.
27
+ * @internal
28
28
  * @param {TextProps} TextProps - The props necessary for the Text element.
29
29
  * @see Title
30
30
  */
@@ -109,9 +109,6 @@ export let ElementName;
109
109
  ElementName["AuthorGroup"] = "AuthorGroup";
110
110
  ElementName["CollaboratorGroup"] = "CollaboratorGroup";
111
111
  ElementName["CommentCount"] = "CommentCount";
112
- ElementName["ViewCount"] = "ViewCount";
113
- ElementName["ReactCount"] = "ReactCount";
114
- ElementName["VoteCount"] = "VoteCount";
115
112
  ElementName["CreatedBy"] = "CreatedBy";
116
113
  ElementName["CreatedOn"] = "CreatedOn";
117
114
  ElementName["LinkIcon"] = "LinkIcon";
@@ -120,11 +117,14 @@ export let ElementName;
120
117
  ElementName["Preview"] = "Preview";
121
118
  ElementName["Priority"] = "Priority";
122
119
  ElementName["ProgrammingLanguage"] = "ProgrammingLanguage";
120
+ ElementName["Provider"] = "Provider";
121
+ ElementName["ReactCount"] = "ReactCount";
123
122
  ElementName["Snippet"] = "Snippet";
124
123
  ElementName["State"] = "State";
125
124
  ElementName["SubscriberCount"] = "SubscriberCount";
126
125
  ElementName["Title"] = "Title";
127
- ElementName["Provider"] = "Provider";
126
+ ElementName["ViewCount"] = "ViewCount";
127
+ ElementName["VoteCount"] = "VoteCount";
128
128
  })(ElementName || (ElementName = {}));
129
129
 
130
130
  export let ActionName;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "19.0.0",
3
+ "version": "19.0.1",
4
4
  "sideEffects": false
5
5
  }
@@ -84,8 +84,8 @@ export const sizeToSpacing = {
84
84
  [SmartLinkSize.XLarge]: 'default'
85
85
  };
86
86
  /**
87
- * An action that can be triggered with an on click.
88
- * @public
87
+ * A base action that can be triggered with an on click.
88
+ * @internal
89
89
  * @param {ActionProps} ActionProps - The props necessary for the Action.
90
90
  * @see DeleteAction
91
91
  * @see EditAction
@@ -29,6 +29,7 @@ const styles = css`
29
29
  /**
30
30
  * Creates a group of Action components. Accepts an array of Actions, in addition to some styling
31
31
  * preferences.
32
+ * @internal
32
33
  * @param {ActionGroupProps} ActionGroupProps
33
34
  * @see Action
34
35
  */
@@ -13,8 +13,9 @@ const getBlockStyles = (direction, size) => css`
13
13
  }
14
14
  `;
15
15
  /**
16
- * A block represents a collection of elements and actions that are arranged in a row.
17
- * All elements and actions should be contained within a Block.
16
+ * A block represents a collection of elements and actions that are arranged
17
+ * in a row. All elements and actions should be contained within a Block.
18
+ * @internal
18
19
  * @param {ActionGroupProps} ActionGroupProps
19
20
  * @see Action
20
21
  */
@@ -30,6 +30,7 @@ export const getElementGroupStyles = (direction, size, align, width) => css`
30
30
  /**
31
31
  * Creates a group of Action components. Accepts an array of Actions, in addition to some styling
32
32
  * preferences.
33
+ * @internal
33
34
  * @param {ActionGroupProps} ActionGroupProps
34
35
  * @see Action
35
36
  */
@@ -8,6 +8,7 @@ import ActionGroup from '../action-group';
8
8
  /**
9
9
  * Represents a FooterBlock, designed to contain elements and actions that should appear
10
10
  * at the bottom of a link card.
11
+ * @public
11
12
  * @param {FooterBlockProps} FooterBlockProps
12
13
  * @see Block
13
14
  */
@@ -63,6 +63,7 @@ const getMaxLines = maxLines => {
63
63
  /**
64
64
  * Represents a MetadataBlock, designed to contain groups of metadata in the form of elements.
65
65
  * Accepts an array of elements to be shown either primary (left hand side) or secondary (right hand side).
66
+ * @public
66
67
  * @param {MetadataBlockProps} MetadataBlockProps
67
68
  * @see Block
68
69
  */
@@ -5,6 +5,7 @@ import Block from '../block';
5
5
  import { Preview } from '../../elements';
6
6
  /**
7
7
  * Represents a PreviewBlock, which typically contains media or other large format content.
8
+ * @public
8
9
  * @param {PreviewBlock} PreviewBlock
9
10
  * @see Block
10
11
  */
@@ -9,6 +9,7 @@ const MAXIMUM_MAX_LINES = 3;
9
9
  const MINIMUM_MAX_LINES = 1;
10
10
  /**
11
11
  * Represents a SnippetBlock, which is used to display longer form text content, like descriptions.
12
+ * @public
12
13
  * @param {SnippetBlock} SnippetBlock
13
14
  * @see Block
14
15
  */
@@ -42,10 +42,11 @@ const getTitleBlockViewComponent = status => {
42
42
  }
43
43
  };
44
44
  /**
45
- * Represents a TitleBlock, which is the foundation of all Flexible Smart Links.
45
+ * Represents a TitleBlock, which is the foundation of Flexible UI.
46
46
  * This contains an icon, the link, and any associated metadata and actions in one block.
47
47
  * The TitleBlock will also render differently given the state of the smart link.
48
48
  * This can be found in the corresponding Resolving, Resolved and Errored views.
49
+ * @public
49
50
  * @param {TitleBlockProps} TitleBlockProps
50
51
  * @see Block
51
52
  * @see TitleBlockResolvingView
@@ -81,12 +81,21 @@ const renderChildren = (children, containerSize, containerTheme, status, retry,
81
81
  const {
82
82
  size: blockSize
83
83
  } = child.props;
84
+ const size = blockSize || containerSize;
85
+
86
+ if (isFlexibleUiTitleBlock(child)) {
87
+ return /*#__PURE__*/React.cloneElement(child, {
88
+ onClick,
89
+ retry,
90
+ size,
91
+ status,
92
+ theme: containerTheme
93
+ });
94
+ }
95
+
84
96
  return /*#__PURE__*/React.cloneElement(child, {
85
- onClick,
86
- retry: isFlexibleUiTitleBlock(child) ? retry : undefined,
87
- size: blockSize || containerSize,
88
- status,
89
- theme: containerTheme
97
+ size,
98
+ status
90
99
  });
91
100
  }
92
101
  });
@@ -116,7 +125,11 @@ const getLayeredLink = (testId, context, children) => {
116
125
  });
117
126
  };
118
127
  /**
119
- * This represents the container in which all Flexible UI Smart Links are rendered.
128
+ * A container is a hidden component that build the Flexible Smart Link.
129
+ * All of the Flexible UI components are wrapped inside the container.
130
+ * It inherits the ui props from Card component and applies the custom styling
131
+ * accordingly.
132
+ * @internal
120
133
  * @see Block
121
134
  */
122
135
 
@@ -35,6 +35,11 @@ const styles = css`
35
35
  }
36
36
  }
37
37
  `;
38
+ /**
39
+ * An anchor component to cover the entire container creating a clickable area.
40
+ * @internal
41
+ * @see `clickableContainer`
42
+ */
38
43
 
39
44
  const LayeredLink = ({
40
45
  target,
@@ -27,8 +27,8 @@ const getStyles = size => {
27
27
  }
28
28
  };
29
29
  /**
30
- * An element that displays a group of avatars.
31
- * @public
30
+ * A base element that displays a group of avatars.
31
+ * @internal
32
32
  * @param {AvatarGroupProps} AvatarGroupProps - The props necessary for the AvatarGroup.
33
33
  * @see AuthorGroup
34
34
  * @see CollaboratorGroup
@@ -71,8 +71,8 @@ const renderImageIcon = (url, testId) => {
71
71
  }
72
72
  };
73
73
  /**
74
- * An element that displays some text with an associated icon.
75
- * @public
74
+ * A base element that displays some text with an associated icon.
75
+ * @internal
76
76
  * @param {BadgeProps} BadgeProps - The props necessary for the Badge.
77
77
  * @see CommentCount
78
78
  * @see ViewCount
@@ -19,8 +19,8 @@ const typeToDescriptorMap = {
19
19
  modified: messages.modified_on
20
20
  };
21
21
  /**
22
- * An element that displays an ISO Timestamp in text.
23
- * @public
22
+ * A base element that displays an ISO Timestamp in text.
23
+ * @internal
24
24
  * @param {DateTimeProps} DateTimeProps - The props necessary for the DateTime element.
25
25
  * @see CreatedOn
26
26
  * @see ModifiedOn
@@ -67,8 +67,8 @@ const renderImageIcon = (defaultIcon, icon, url, testId) => {
67
67
  }
68
68
  };
69
69
  /**
70
- * An element that displays an Icon or favicon.
71
- * @public
70
+ * A base element that displays an Icon or favicon.
71
+ * @internal
72
72
  * @param {IconProps} IconProps - The props necessary for the Icon element.
73
73
  * @see LinkIcon
74
74
  */
@@ -5,12 +5,12 @@ import { ElementName } from '../../../../constants';
5
5
  // createElement and renderElementItems
6
6
 
7
7
  /**
8
- * Creates an AvatarGroup element using the data from AuthorGroup in the Flexible UI Context.
8
+ * An AvatarGroup element using the data from AuthorGroup in the Flexible UI Context.
9
9
  * @see AvatarGroup
10
10
  */
11
11
  export const AuthorGroup = createElement(ElementName.AuthorGroup);
12
12
  /**
13
- * Creates an AvatarGroup element using the data from CollaboratorGroup in the Flexible UI Context.
13
+ * An AvatarGroup element using the data from CollaboratorGroup in the Flexible UI Context.
14
14
  * @see AvatarGroup
15
15
  */
16
16
 
@@ -65,9 +65,9 @@ const getMaxLines = maxLines => {
65
65
  return maxLines;
66
66
  };
67
67
  /**
68
- * An element that represent.
69
- * @public
70
- * @param {LinkProps} LinkProps - The props necessary for the Icon element.
68
+ * A base element that represent an anchor.
69
+ * @internal
70
+ * @param {LinkProps} LinkProps - The props necessary for the Link element.
71
71
  * @see LinkIcon
72
72
  */
73
73
 
@@ -6,8 +6,8 @@ const styles = css`
6
6
  line-height: inherit;
7
7
  `;
8
8
  /**
9
- * An element that displays a Lozenge.
10
- * @public
9
+ * A base element that displays a Lozenge.
10
+ * @internal
11
11
  * @param {LozengeProps} LozengeProps - The props necessary for the Lozenge element.
12
12
  * @see State
13
13
  */
@@ -46,8 +46,8 @@ const styles = css`
46
46
  }
47
47
  `;
48
48
  /**
49
- * An element that displays a Media.
50
- * @public
49
+ * A base element that displays a Media.
50
+ * @internal
51
51
  * @param {MediaProps} MediaProps - The props necessary for the Media element.
52
52
  * @see Preview
53
53
  */
@@ -11,8 +11,8 @@ const getStyles = maxLines => css`
11
11
  ${getTruncateStyles(maxLines)}
12
12
  `;
13
13
  /**
14
- * An element that displays some Text.
15
- * @public
14
+ * A base element that displays some Text.
15
+ * @internal
16
16
  * @param {TextProps} TextProps - The props necessary for the Text element.
17
17
  * @see Title
18
18
  */
@@ -109,9 +109,6 @@ export var ElementName;
109
109
  ElementName["AuthorGroup"] = "AuthorGroup";
110
110
  ElementName["CollaboratorGroup"] = "CollaboratorGroup";
111
111
  ElementName["CommentCount"] = "CommentCount";
112
- ElementName["ViewCount"] = "ViewCount";
113
- ElementName["ReactCount"] = "ReactCount";
114
- ElementName["VoteCount"] = "VoteCount";
115
112
  ElementName["CreatedBy"] = "CreatedBy";
116
113
  ElementName["CreatedOn"] = "CreatedOn";
117
114
  ElementName["LinkIcon"] = "LinkIcon";
@@ -120,11 +117,14 @@ export var ElementName;
120
117
  ElementName["Preview"] = "Preview";
121
118
  ElementName["Priority"] = "Priority";
122
119
  ElementName["ProgrammingLanguage"] = "ProgrammingLanguage";
120
+ ElementName["Provider"] = "Provider";
121
+ ElementName["ReactCount"] = "ReactCount";
123
122
  ElementName["Snippet"] = "Snippet";
124
123
  ElementName["State"] = "State";
125
124
  ElementName["SubscriberCount"] = "SubscriberCount";
126
125
  ElementName["Title"] = "Title";
127
- ElementName["Provider"] = "Provider";
126
+ ElementName["ViewCount"] = "ViewCount";
127
+ ElementName["VoteCount"] = "VoteCount";
128
128
  })(ElementName || (ElementName = {}));
129
129
 
130
130
  export var ActionName;