@atlaskit/smart-card 19.1.25 → 19.1.28

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 (27) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/cjs/version.json +1 -1
  3. package/dist/cjs/view/CardWithUrl/component.js +9 -1
  4. package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +2 -1
  5. package/dist/cjs/view/FlexibleCard/components/elements/index.js +30 -30
  6. package/dist/cjs/view/HoverCard/components/hover-card-content.js +15 -5
  7. package/dist/cjs/view/HoverCard/styled.js +10 -4
  8. package/dist/cjs/view/HoverCard/utils.js +2 -2
  9. package/dist/es2019/version.json +1 -1
  10. package/dist/es2019/view/CardWithUrl/component.js +8 -1
  11. package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +2 -1
  12. package/dist/es2019/view/FlexibleCard/components/elements/index.js +23 -23
  13. package/dist/es2019/view/HoverCard/components/hover-card-content.js +15 -6
  14. package/dist/es2019/view/HoverCard/styled.js +29 -2
  15. package/dist/es2019/view/HoverCard/utils.js +2 -2
  16. package/dist/esm/version.json +1 -1
  17. package/dist/esm/view/CardWithUrl/component.js +8 -1
  18. package/dist/esm/view/FlexibleCard/components/blocks/utils.js +2 -1
  19. package/dist/esm/view/FlexibleCard/components/elements/index.js +23 -23
  20. package/dist/esm/view/HoverCard/components/hover-card-content.js +15 -6
  21. package/dist/esm/view/HoverCard/styled.js +5 -2
  22. package/dist/esm/view/HoverCard/utils.js +2 -2
  23. package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +156 -6
  24. package/dist/types/view/FlexibleCard/components/elements/index.d.ts +20 -20
  25. package/dist/types/view/HoverCard/styled.d.ts +3 -0
  26. package/package.json +1 -1
  27. package/report.api.md +501 -0
@@ -1,7 +1,10 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
2
 
3
- var _templateObject;
3
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
4
4
 
5
5
  import { css } from '@emotion/core';
6
6
  import { loadingPlaceholderClassName } from '../../index';
7
- export var HoverCardContainer = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: none;\n border-width: 0;\n max-width: 350px;\n padding: 0;\n\n .", " {\n display: none;\n }\n"])), loadingPlaceholderClassName);
7
+ export var HoverCardContainer = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: none;\n border-width: 0;\n box-sizing: border-box;\n width: 24rem;\n padding: 1rem;\n\n .", " {\n display: none;\n }\n"])), loadingPlaceholderClassName);
8
+ export var titleBlockCss = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n gap: 0.5rem;\n"])));
9
+ export var metadataBlockCss = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n gap: 0px;\n\n /* primary element group */\n [data-smart-element-group]:first-of-type {\n flex-grow: 7;\n /* horizontal spacing between elements in group */\n > span {\n margin-right: 0.5rem;\n }\n }\n /* secondary element group */\n [data-smart-element-group]:last-of-type {\n flex-grow: 3;\n /* horizontal spacing between elements in group */\n > span {\n margin-left: 0.5rem;\n }\n }\n"])));
10
+ export var footerBlockCss = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding-top: 0.25rem;\n"])));
@@ -7,8 +7,8 @@ export var getSimulatedMetadata = function getSimulatedMetadata() {
7
7
  case 'confluence-object-provider':
8
8
  return {
9
9
  metadata: {
10
- primary: [ElementName.AuthorGroup, ElementName.CreatedBy, ElementName.CommentCount, ElementName.ReactCount],
11
- secondary: []
10
+ primary: [ElementName.AuthorGroup, ElementName.CreatedBy],
11
+ secondary: [ElementName.CommentCount, ElementName.ReactCount]
12
12
  }
13
13
  };
14
14
 
@@ -35,13 +35,11 @@ export declare type BlockProps = {
35
35
  */
36
36
  export declare type ElementItem = {
37
37
  /**
38
- * The name of the metadata element, used by Flexible UI to determine which
39
- * element to render.
38
+ * Any additional CSS properties to apply to the element.
40
39
  */
41
- name: ElementName.AuthorGroup | ElementName.CollaboratorGroup | ElementName.CommentCount | ElementName.CreatedBy | ElementName.CreatedOn | ElementName.ModifiedBy | ElementName.ModifiedOn | ElementName.Priority | ElementName.ProgrammingLanguage | ElementName.Provider | ElementName.ReactCount | ElementName.State | ElementName.SubscriberCount | ElementName.ViewCount | ElementName.VoteCount | ElementName.LatestCommit;
40
+ overrideCss?: SerializedStyles;
42
41
  /**
43
- * The size of the element to render.
44
- * The elements that support sizing are AuthorGroup and CollaboratorGroup.
42
+ * The size of the element to display.
45
43
  */
46
44
  size?: SmartLinkSize;
47
45
  /**
@@ -50,7 +48,7 @@ export declare type ElementItem = {
50
48
  * serving as a hook for automated tests
51
49
  */
52
50
  testId?: string;
53
- };
51
+ } & ElementItemProps;
54
52
  /**
55
53
  * Used to represent an Action when passing props into Flexible UI.
56
54
  */
@@ -102,3 +100,155 @@ export declare type CustomActionItem = BaseActionItem & {
102
100
  name: ActionName.CustomAction;
103
101
  } & ((Required<Pick<ActionProps, 'icon' | 'iconPosition'>> & Pick<ActionProps, 'content'>) | ((Required<Pick<ActionProps, 'content'>> & Pick<ActionProps, 'icon' | 'iconPosition'>) & Pick<ActionProps, 'tooltipMessage'>));
104
102
  export declare type ActionItem = NamedActionItem | CustomActionItem;
103
+ /**
104
+ * A type that contains all the possible combinations of elements with their corresponding props.
105
+ */
106
+ export declare type ElementItemProps = AuthorGroup | CollaboratorGroup | CommentCount | CreatedBy | CreatedOn | LatestCommit | LinkIcon | ModifiedBy | ModifiedOn | Preview | Priority | ProgrammingLanguage | Provider | ReactCount | Snippet | State | SubscriberCount | Title | ViewCount | VoteCount;
107
+ /**
108
+ * Represents the props available for an AuthorGroup element.
109
+ * @see AuthorGroup
110
+ */
111
+ export declare type AuthorGroup = {
112
+ name: ElementName.AuthorGroup;
113
+ };
114
+ /**
115
+ * Represents the props available for an CollaboratorGroup element.
116
+ * @see CollaboratorGroup
117
+ */
118
+ export declare type CollaboratorGroup = {
119
+ name: ElementName.CollaboratorGroup;
120
+ };
121
+ /**
122
+ * Represents the props available for an CommentCount element.
123
+ * @see CommentCount
124
+ */
125
+ export declare type CommentCount = {
126
+ name: ElementName.CommentCount;
127
+ };
128
+ /**
129
+ * Represents the props available for an CreatedBy element.
130
+ * @see CreatedBy
131
+ */
132
+ export declare type CreatedBy = {
133
+ name: ElementName.CreatedBy;
134
+ };
135
+ /**
136
+ * Represents the props available for an CreatedOn element.
137
+ * @see CreatedOn
138
+ */
139
+ export declare type CreatedOn = {
140
+ name: ElementName.CreatedOn;
141
+ /**
142
+ * A string which will be displayed before the specified element.
143
+ */
144
+ text?: string;
145
+ };
146
+ /**
147
+ * Represents the props available for an LastCommit element.
148
+ * @see BadgeProps
149
+ */
150
+ export declare type LatestCommit = {
151
+ name: ElementName.LatestCommit;
152
+ };
153
+ /**
154
+ * Represents the props available for an LinkIcon element.
155
+ * @see LinkIcon
156
+ */
157
+ export declare type LinkIcon = {
158
+ name: ElementName.LinkIcon;
159
+ };
160
+ /**
161
+ * Represents the props available for an ModifiedBy element.
162
+ * @see ModifiedBy
163
+ */
164
+ export declare type ModifiedBy = {
165
+ name: ElementName.ModifiedBy;
166
+ };
167
+ /**
168
+ * Represents the props available for an ModifiedOn element.
169
+ * @see ModifiedOn
170
+ */
171
+ export declare type ModifiedOn = {
172
+ name: ElementName.ModifiedOn;
173
+ /**
174
+ * A string which will be displayed before the specified element.
175
+ */
176
+ text?: string;
177
+ };
178
+ /**
179
+ * Represents the props available for an Preview element.
180
+ * @see Preview
181
+ */
182
+ export declare type Preview = {
183
+ name: ElementName.Preview;
184
+ };
185
+ /**
186
+ * Represents the props available for an Priority element.
187
+ * @see Priority
188
+ */
189
+ export declare type Priority = {
190
+ name: ElementName.Priority;
191
+ };
192
+ /**
193
+ * Represents the props available for an ProgrammingLanguage element.
194
+ * @see ProgrammingLanguage
195
+ */
196
+ export declare type ProgrammingLanguage = {
197
+ name: ElementName.ProgrammingLanguage;
198
+ };
199
+ /**
200
+ * Represents the props available for an Provider element.
201
+ * @see Provider
202
+ */
203
+ export declare type Provider = {
204
+ name: ElementName.Provider;
205
+ };
206
+ /**
207
+ * Represents the props available for an ReactCount element.
208
+ * @see ReactCount
209
+ */
210
+ export declare type ReactCount = {
211
+ name: ElementName.ReactCount;
212
+ };
213
+ /**
214
+ * Represents the props available for an Snippet element.
215
+ * @see Snippet
216
+ */
217
+ export declare type Snippet = {
218
+ name: ElementName.Snippet;
219
+ };
220
+ /**
221
+ * Represents the props available for an State element.
222
+ * @see State
223
+ */
224
+ export declare type State = {
225
+ name: ElementName.State;
226
+ };
227
+ /**
228
+ * Represents the props available for an SubscriberCount element.
229
+ * @see SubscriberCount
230
+ */
231
+ export declare type SubscriberCount = {
232
+ name: ElementName.SubscriberCount;
233
+ };
234
+ /**
235
+ * Represents the props available for an Title element.
236
+ * @see Title
237
+ */
238
+ export declare type Title = {
239
+ name: ElementName.Title;
240
+ };
241
+ /**
242
+ * Represents the props available for an ViewCount element.
243
+ * @see ViewCount
244
+ */
245
+ export declare type ViewCount = {
246
+ name: ElementName.ViewCount;
247
+ };
248
+ /**
249
+ * Represents the props available for an VoteCount element.
250
+ * @see VoteCount
251
+ */
252
+ export declare type VoteCount = {
253
+ name: ElementName.VoteCount;
254
+ };
@@ -23,30 +23,15 @@ export declare const CollaboratorGroup: import("react").FC<AvatarGroupProps>;
23
23
  */
24
24
  export declare const CommentCount: import("react").FC<BadgeProps>;
25
25
  /**
26
- * Creates a ViewCount Badge element using the data from ViewCount in the Flexible UI Context.
27
- * @see Badge
28
- */
29
- export declare const ViewCount: import("react").FC<BadgeProps>;
30
- /**
31
- * Creates a ReactCount Badge element using the data from ReactCount in the Flexible UI Context.
32
- * @see Badge
33
- */
34
- export declare const ReactCount: import("react").FC<BadgeProps>;
35
- /**
36
- * Creates a VoteCount Badge element using the data from VoteCount in the Flexible UI Context.
37
- * @see Badge
26
+ * Creates a CreatedOn DateTime element using the data from CreatedOn in the Flexible UI Context.
27
+ * @see DateTime
38
28
  */
39
- export declare const VoteCount: import("react").FC<BadgeProps>;
29
+ export declare const CreatedOn: import("react").FC<DateTimeProps>;
40
30
  /**
41
31
  * Creates a CreatedBy text element using the data from CreatedBy in the Flexible UI Context.
42
32
  * @see Text
43
33
  */
44
34
  export declare const CreatedBy: import("react").FC<TextProps>;
45
- /**
46
- * Creates a CreatedOn DateTime element using the data from CreatedOn in the Flexible UI Context.
47
- * @see DateTime
48
- */
49
- export declare const CreatedOn: import("react").FC<DateTimeProps>;
50
35
  /**
51
36
  * Creates an element that contains Last Commit hash
52
37
  */
@@ -81,6 +66,16 @@ export declare const Priority: import("react").FC<BadgeProps>;
81
66
  * @see Badge
82
67
  */
83
68
  export declare const ProgrammingLanguage: import("react").FC<BadgeProps>;
69
+ /**
70
+ * Creates a Provider Badge element using the data from Provider in the Flexible UI Context.
71
+ * @see Badge
72
+ */
73
+ export declare const Provider: import("react").FC<BadgeProps>;
74
+ /**
75
+ * Creates a ReactCount Badge element using the data from ReactCount in the Flexible UI Context.
76
+ * @see Badge
77
+ */
78
+ export declare const ReactCount: import("react").FC<BadgeProps>;
84
79
  /**
85
80
  * Creates a Snippet element using the data from Snippet in the Flexible UI Context.
86
81
  * @see Text
@@ -103,7 +98,12 @@ export declare const SubscriberCount: import("react").FC<BadgeProps>;
103
98
  */
104
99
  export declare const Title: import("react").FC<LinkProps>;
105
100
  /**
106
- * Creates a Provider Badge element using the data from Provider in the Flexible UI Context.
101
+ * Creates a ViewCount Badge element using the data from ViewCount in the Flexible UI Context.
107
102
  * @see Badge
108
103
  */
109
- export declare const Provider: import("react").FC<BadgeProps>;
104
+ export declare const ViewCount: import("react").FC<BadgeProps>;
105
+ /**
106
+ * Creates a VoteCount Badge element using the data from VoteCount in the Flexible UI Context.
107
+ * @see Badge
108
+ */
109
+ export declare const VoteCount: import("react").FC<BadgeProps>;
@@ -1 +1,4 @@
1
1
  export declare const HoverCardContainer: import("@emotion/utils").SerializedStyles;
2
+ export declare const titleBlockCss: import("@emotion/utils").SerializedStyles;
3
+ export declare const metadataBlockCss: import("@emotion/utils").SerializedStyles;
4
+ export declare const footerBlockCss: import("@emotion/utils").SerializedStyles;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "19.1.25",
3
+ "version": "19.1.28",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"