@atlaskit/profilecard 16.10.0 → 16.10.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/profilecard
2
2
 
3
+ ## 16.10.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
3
9
  ## 16.10.0
4
10
 
5
11
  ### Minor Changes
@@ -56,7 +56,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
56
56
  actionSubjectId: actionSubjectId,
57
57
  attributes: _objectSpread(_objectSpread({
58
58
  packageName: "@atlaskit/profilecard",
59
- packageVersion: "16.10.0"
59
+ packageVersion: "16.10.1"
60
60
  }, attributes), {}, {
61
61
  firedAt: (0, _performance.getPageTime)()
62
62
  })
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "16.10.0"
3
+ "version": "16.10.1"
4
4
  }
@@ -35,7 +35,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
35
35
  actionSubjectId,
36
36
  attributes: {
37
37
  packageName: "@atlaskit/profilecard",
38
- packageVersion: "16.10.0",
38
+ packageVersion: "16.10.1",
39
39
  ...attributes,
40
40
  firedAt: getPageTime()
41
41
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "16.10.0"
3
+ "version": "16.10.1"
4
4
  }
@@ -45,7 +45,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
45
45
  actionSubjectId: actionSubjectId,
46
46
  attributes: _objectSpread(_objectSpread({
47
47
  packageName: "@atlaskit/profilecard",
48
- packageVersion: "16.10.0"
48
+ packageVersion: "16.10.1"
49
49
  }, attributes), {}, {
50
50
  firedAt: getPageTime()
51
51
  })
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "16.10.0"
3
+ "version": "16.10.1"
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "16.10.0",
3
+ "version": "16.10.1",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -43,7 +43,7 @@
43
43
  "@atlaskit/avatar-group": "^9.0.0",
44
44
  "@atlaskit/button": "^16.3.0",
45
45
  "@atlaskit/dropdown-menu": "^11.2.0",
46
- "@atlaskit/give-kudos": "^0.5.0",
46
+ "@atlaskit/give-kudos": "^0.6.0",
47
47
  "@atlaskit/icon": "^21.10.0",
48
48
  "@atlaskit/lozenge": "^11.0.0",
49
49
  "@atlaskit/menu": "^1.3.0",
@@ -67,8 +67,8 @@
67
67
  "@atlaskit/dynamic-table": "^14.6.0",
68
68
  "@atlaskit/flag": "^14.5.0",
69
69
  "@atlaskit/inline-edit": "^12.0.0",
70
- "@atlaskit/select": "^15.3.0",
71
- "@atlaskit/util-data-test": "^17.3.0",
70
+ "@atlaskit/select": "^15.4.0",
71
+ "@atlaskit/util-data-test": "^17.5.0",
72
72
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
73
73
  "@testing-library/react": "^8.0.1",
74
74
  "enzyme": "^3.10.0",
package/report.api.md CHANGED
@@ -13,9 +13,11 @@ import { default as React_2 } from 'react';
13
13
  import { ReactElement } from 'react';
14
14
  import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
15
15
 
16
- // @public (undocumented)
17
- export interface ApiClientResponse {
18
- // (undocumented)
16
+ declare type AnalyticsFromDuration = (duration: number) => Record<string, any>;
17
+
18
+ declare type AnalyticsFunction = (generator: AnalyticsFromDuration) => void;
19
+
20
+ export declare interface ApiClientResponse {
19
21
  User: {
20
22
  id: string;
21
23
  isBot: boolean;
@@ -36,289 +38,234 @@ export interface ApiClientResponse {
36
38
  };
37
39
  }
38
40
 
39
- // @public (undocumented)
40
- export const DELAY_MS_HIDE = 200;
41
+ declare interface CacheConfig {
42
+ cacheSize?: number;
43
+ cacheMaxAge?: number;
44
+ }
45
+
46
+ declare interface CachedData<T> {
47
+ expire: number;
48
+ profile: T;
49
+ }
41
50
 
42
- // @public (undocumented)
43
- export const DELAY_MS_SHOW = 800;
51
+ declare class CachingClient<T> {
52
+ config: Required<CacheConfig>;
53
+ cache: LRUCache<string, CachedData<T>> | null;
54
+ constructor(config: CacheConfig);
55
+ setCachedProfile(cacheIdentifier: string, profile: T): void;
56
+ getCachedProfile(cacheIdentifier: string): T | null;
57
+ flushCache(): void;
58
+ }
44
59
 
45
- // @public (undocumented)
46
- export interface MessageIntlProviderProps {
47
- // (undocumented)
60
+ declare interface ClientOverrides {
61
+ userClient?: UserProfileClient;
62
+ teamClient?: TeamProfileClient;
63
+ teamCentralClient?: TeamCentralCardClient;
64
+ }
65
+
66
+ export declare const DELAY_MS_HIDE = 200;
67
+
68
+ export declare const DELAY_MS_SHOW = 800;
69
+
70
+ declare type FeatureFlagExtraContext = {
71
+ key: string;
72
+ value: string;
73
+ };
74
+
75
+ declare type LozengeColor =
76
+ | 'default'
77
+ | 'success'
78
+ | 'removed'
79
+ | 'inprogress'
80
+ | 'new'
81
+ | 'moved';
82
+
83
+ declare interface LozengeProps {
84
+ text: React_2.ReactNode;
85
+ appearance?: LozengeColor;
86
+ isBold?: boolean;
87
+ }
88
+
89
+ export declare interface MessageIntlProviderProps {
48
90
  children: React_2.ReactNode;
49
- // (undocumented)
50
91
  intl: IntlShape;
51
92
  }
52
93
 
53
- // @public
54
- export const modifyResponse: (
94
+ /**
95
+ * Transform response from GraphQL
96
+ * - Prefix `timestring` with `remoteWeekdayString` depending on `remoteWeekdayIndex`
97
+ * - Remove properties which will be not used later
98
+ * @ignore
99
+ * @param {object} response
100
+ * @return {object}
101
+ */
102
+ export declare const modifyResponse: (
55
103
  response: ApiClientResponse,
56
104
  ) => ProfileCardClientData;
57
105
 
58
- // @public (undocumented)
59
- export class ProfileCard extends React_2.PureComponent<ProfilecardProps> {
106
+ export declare class ProfileCard extends React_2.PureComponent<
107
+ ProfilecardProps
108
+ > {
109
+ static defaultProps: ProfilecardProps;
110
+ GIVE_KUDOS_ACTION_ID: string;
111
+ private timeOpen;
112
+ clientFetchProfile: () => void;
60
113
  constructor(props: ProfilecardProps);
61
- // (undocumented)
62
- callAnalytics: (id: string, options: any) => void;
63
- // (undocumented)
114
+ private durationSince;
64
115
  callClientFetchProfile: (...args: any) => void;
65
- // (undocumented)
66
- clientFetchProfile: () => void;
67
- // (undocumented)
116
+ callAnalytics: (id: string, options: any) => void;
68
117
  componentDidMount(): void;
69
- // (undocumented)
70
- static defaultProps: ProfilecardProps;
71
- // (undocumented)
72
- getActions(): ProfileCardAction[];
73
- // (undocumented)
74
- getDisabledAccountDesc(): {};
75
- // (undocumented)
76
- getDisabledAccountName(): string | JSX.Element | null | undefined;
77
- // (undocumented)
78
- GIVE_KUDOS_ACTION_ID: string;
79
- // (undocumented)
80
- kudosButtonCallback: () => void;
81
- // (undocumented)
118
+ renderErrorMessage(): JSX.Element;
82
119
  kudosUrl: () => string;
83
- // (undocumented)
84
- render(): JSX.Element;
85
- // (undocumented)
86
- renderActionsButtons(): JSX.Element | null;
87
- // (undocumented)
120
+ kudosButtonCallback: () => void;
121
+ getActions(): ProfileCardAction[];
88
122
  renderButton: (action: ProfileCardAction, idx: number) => ReactElement;
89
- // (undocumented)
90
- renderCardDetails(): JSX.Element;
91
- // (undocumented)
92
- renderCardDetailsApp(): JSX.Element;
93
- // (undocumented)
123
+ renderActionsButtons(): JSX.Element | null;
124
+ private onActionClick;
94
125
  renderCardDetailsDefault(): JSX.Element;
95
- // (undocumented)
96
126
  renderCardDetailsForDisabledAccount(): JSX.Element;
97
- // (undocumented)
127
+ getDisabledAccountName(): string | JSX.Element | null | undefined;
128
+ getDisabledAccountDesc(): {};
129
+ private renderFullNameAndPublicName;
98
130
  renderCustomLozenges(lozenges: LozengeProps[]): JSX.Element | null;
99
- // (undocumented)
100
- renderErrorMessage(): JSX.Element;
131
+ renderCardDetailsApp(): JSX.Element;
132
+ renderCardDetails(): JSX.Element;
133
+ render(): JSX.Element;
101
134
  }
102
135
 
103
- // @public (undocumented)
104
- export interface ProfileCardAction {
105
- // (undocumented)
136
+ export declare interface ProfileCardAction {
106
137
  callback?: (...args: any[]) => any;
107
- // (undocumented)
138
+ shouldRender?: (data: any) => boolean;
108
139
  id?: string;
109
- // (undocumented)
110
140
  label: React_2.ReactNode;
111
- // (undocumented)
112
141
  link?: string;
113
- // (undocumented)
114
- shouldRender?: (data: any) => boolean;
115
142
  }
116
143
 
117
- // @public (undocumented)
118
- export interface ProfileCardClientData {
119
- // (undocumented)
120
- avatarUrl?: string;
121
- // (undocumented)
122
- companyName?: string;
123
- // (undocumented)
124
- customLozenges?: LozengeProps[];
125
- // (undocumented)
126
- email?: string;
127
- // (undocumented)
128
- fullName?: string;
129
- // (undocumented)
144
+ export declare interface ProfileCardClientData {
130
145
  isBot: boolean;
131
- // (undocumented)
132
146
  isCurrentUser: boolean;
133
- // (undocumented)
134
147
  isNotMentionable: boolean;
135
- // (undocumented)
148
+ avatarUrl?: string;
149
+ email?: string;
150
+ fullName?: string;
136
151
  location?: string;
137
- // (undocumented)
138
152
  meta?: string;
139
- // (undocumented)
140
153
  nickname?: string;
141
- // (undocumented)
154
+ companyName?: string;
155
+ timestring?: string;
142
156
  status: StatusType;
143
- // (undocumented)
144
157
  statusModifiedDate?: number | null;
145
- // (undocumented)
146
- timestring?: string;
158
+ customLozenges?: LozengeProps[];
147
159
  }
148
160
 
149
- // @public (undocumented)
150
- export type ProfileCardErrorType = {
161
+ export declare type ProfileCardErrorType = {
151
162
  reason: 'default' | 'NotFound';
152
163
  } | null;
153
164
 
154
- // @public (undocumented)
155
- export interface ProfilecardProps {
156
- // (undocumented)
157
- actions?: ProfileCardAction[];
158
- // (undocumented)
159
- addFlag?: (flag: any) => void;
160
- // (undocumented)
161
- analytics?: any;
162
- // (undocumented)
163
- avatarUrl?: string;
164
- // (undocumented)
165
- clientFetchProfile?: any;
166
- // (undocumented)
167
- cloudId?: string;
168
- // (undocumented)
169
- companyName?: string;
170
- // (undocumented)
171
- customLozenges?: LozengeProps[];
172
- // (undocumented)
173
- disabledAccountMessage?: React_2.ReactNode;
174
- // (undocumented)
175
- email?: string;
176
- // (undocumented)
177
- errorType?: ProfileCardErrorType;
178
- // (undocumented)
179
- fullName?: string;
180
- // (undocumented)
181
- hasDisabledAccountLozenge?: boolean;
182
- // (undocumented)
165
+ export declare interface ProfilecardProps {
166
+ isLoading?: boolean;
183
167
  hasError?: boolean;
184
- // (undocumented)
168
+ errorType?: ProfileCardErrorType;
169
+ status?: StatusType;
185
170
  isBot?: boolean;
186
- // (undocumented)
187
- isCurrentUser?: boolean;
188
- // (undocumented)
189
- isKudosEnabled?: boolean;
190
- // (undocumented)
191
- isLoading?: boolean;
192
- // (undocumented)
193
171
  isNotMentionable?: boolean;
194
- // (undocumented)
195
- location?: string;
196
- // (undocumented)
172
+ avatarUrl?: string;
173
+ fullName?: string;
197
174
  meta?: string;
198
- // (undocumented)
175
+ userId?: string;
176
+ isCurrentUser?: boolean;
199
177
  nickname?: string;
200
- onReportingLinesClick?: (user: ReportingLinesUser) => void;
201
- // (undocumented)
202
- openKudosDrawer?: () => void;
178
+ email?: string;
179
+ location?: string;
180
+ companyName?: string;
181
+ timestring?: string;
182
+ actions?: ProfileCardAction[];
183
+ clientFetchProfile?: any;
184
+ analytics?: any;
185
+ statusModifiedDate?: number | null;
186
+ withoutElevation?: boolean;
187
+ /** Show manager and direct reports section on profile hover card, if available */
203
188
  reportingLines?: TeamCentralReportingLinesData;
189
+ /** Base URL to populate href value for manager's and direct reports' user avatar */
204
190
  reportingLinesProfileUrl?: string;
205
- // (undocumented)
206
- status?: StatusType;
207
- // (undocumented)
208
- statusModifiedDate?: number | null;
209
- // (undocumented)
191
+ /** Click handler when user clicks on manager's and direct reports' user avatar, un-clickable otherwise */
192
+ onReportingLinesClick?: (user: ReportingLinesUser) => void;
193
+ isKudosEnabled?: boolean;
210
194
  teamCentralBaseUrl?: string;
211
- // (undocumented)
212
- timestring?: string;
213
- // (undocumented)
214
- userId?: string;
215
- // (undocumented)
216
- withoutElevation?: boolean;
195
+ addFlag?: (flag: any) => void;
196
+ cloudId?: string;
197
+ disabledAccountMessage?: React_2.ReactNode;
198
+ hasDisabledAccountLozenge?: boolean;
199
+ customLozenges?: LozengeProps[];
200
+ openKudosDrawer?: () => void;
217
201
  }
218
202
 
219
- // @public (undocumented)
220
- class ProfileCardResourced extends React_2.PureComponent<
203
+ declare class ProfileCardResourced extends React_2.PureComponent<
221
204
  ProfileCardResourcedProps,
222
205
  ProfileCardResourcedState
223
206
  > {
224
- // (undocumented)
225
- clientFetchProfile: () => void;
226
- // (undocumented)
227
- closeKudosDrawer: () => void;
228
- // (undocumented)
207
+ static defaultProps: Partial<ProfileCardResourcedProps>;
208
+ _isMounted: boolean;
209
+ state: ProfileCardResourcedState;
229
210
  componentDidMount(): void;
230
- // (undocumented)
231
211
  componentDidUpdate(
232
212
  prevProps: ProfileCardResourcedProps,
233
213
  prevState: ProfileCardResourcedState,
234
214
  ): void;
235
- // (undocumented)
236
215
  componentWillUnmount(): void;
237
- // (undocumented)
238
- static defaultProps: Partial<ProfileCardResourcedProps>;
239
- // (undocumented)
240
- filterActions: () => ProfileCardAction[];
241
- // (undocumented)
242
- handleClientError(err: any): void;
243
- // (undocumented)
216
+ private callAnalytics;
217
+ clientFetchProfile: () => void;
244
218
  handleClientSuccess(
245
219
  profileData: ProfileCardClientData,
246
220
  reportingLinesData: TeamCentralReportingLinesData,
247
221
  shouldShowGiveKudos: boolean,
248
222
  ): void;
249
- // (undocumented)
250
- _isMounted: boolean;
251
- // (undocumented)
223
+ handleClientError(err: any): void;
224
+ filterActions: () => ProfileCardAction[];
252
225
  openKudosDrawer: () => void;
253
- // (undocumented)
226
+ closeKudosDrawer: () => void;
254
227
  render(): React_2.ReactNode;
255
- // (undocumented)
256
- state: ProfileCardResourcedState;
257
228
  }
258
229
  export default ProfileCardResourced;
259
230
 
260
- // @public (undocumented)
261
- export interface ProfileCardResourcedProps {
262
- // (undocumented)
263
- actions?: ProfileCardAction[];
264
- // (undocumented)
265
- addFlag?: (flag: any) => void;
266
- // (undocumented)
267
- analytics?: any;
268
- // (undocumented)
269
- children?: React_2.ReactNode;
270
- // (undocumented)
231
+ export declare interface ProfileCardResourcedProps {
232
+ userId: string;
271
233
  cloudId: string;
272
- // (undocumented)
234
+ resourceClient: ProfileClient_2;
235
+ actions?: ProfileCardAction[];
236
+ reportingLinesProfileUrl?: string;
273
237
  onReportingLinesClick?: (user: ReportingLinesUser) => void;
274
- // (undocumented)
238
+ analytics?: any;
275
239
  position?: ProfilecardTriggerPosition;
276
- // (undocumented)
277
- reportingLinesProfileUrl?: string;
278
- // (undocumented)
279
- resourceClient: ProfileClient_2;
280
- // (undocumented)
281
240
  trigger?: TriggerType;
282
- // (undocumented)
283
- userId: string;
241
+ children?: React_2.ReactNode;
242
+ addFlag?: (flag: any) => void;
284
243
  }
285
244
 
286
- // @public (undocumented)
287
- export interface ProfileCardResourcedState {
288
- // (undocumented)
289
- data: ProfileCardClientData | null;
290
- // (undocumented)
291
- error?: ProfileCardErrorType;
292
- // (undocumented)
245
+ export declare interface ProfileCardResourcedState {
246
+ visible?: boolean;
247
+ isLoading?: boolean;
293
248
  hasError: boolean;
294
- // (undocumented)
249
+ error?: ProfileCardErrorType;
250
+ data: ProfileCardClientData | null;
251
+ reportingLinesData?: TeamCentralReportingLinesData;
295
252
  isKudosEnabled?: boolean;
296
- // (undocumented)
297
- isLoading?: boolean;
298
- // (undocumented)
299
253
  kudosDrawerOpen: boolean;
300
- // (undocumented)
301
- reportingLinesData?: TeamCentralReportingLinesData;
302
- // (undocumented)
303
- visible?: boolean;
304
254
  }
305
255
 
306
- // @public (undocumented)
307
- export class ProfileCardTrigger extends React_2.PureComponent<
256
+ export declare class ProfileCardTrigger extends React_2.PureComponent<
308
257
  ProfileCardTriggerProps,
309
258
  ProfileCardTriggerState
310
259
  > {
311
- // (undocumented)
312
- clientFetchProfile: () => void;
313
- // (undocumented)
314
- closeKudosDrawer: () => void;
315
- // (undocumented)
316
- componentDidMount(): void;
317
- // (undocumented)
318
- componentDidUpdate(prevProps: ProfileCardTriggerProps): void;
319
- // (undocumented)
320
- componentWillUnmount(): void;
321
- // (undocumented)
260
+ static defaultProps: Partial<ProfileCardTriggerProps>;
261
+ _isMounted: boolean;
262
+ showDelay: number;
263
+ hideDelay: number;
264
+ showTimer: number;
265
+ hideTimer: number;
266
+ hideProfilecard: () => void;
267
+ showProfilecard: () => void;
268
+ onClick: (event: React_2.MouseEvent) => void;
322
269
  containerListeners:
323
270
  | {
324
271
  onMouseEnter: () => void;
@@ -330,55 +277,31 @@ export class ProfileCardTrigger extends React_2.PureComponent<
330
277
  onMouseEnter?: undefined;
331
278
  onMouseLeave?: undefined;
332
279
  };
333
- // (undocumented)
334
- static defaultProps: Partial<ProfileCardTriggerProps>;
335
- // (undocumented)
336
- filterActions(): ProfileCardAction[];
337
- // (undocumented)
338
- handleClientError(err: any): void;
339
- // (undocumented)
280
+ layerListeners: {
281
+ handleClickOutside: () => void;
282
+ handleEscapeKeydown: () => void;
283
+ };
284
+ state: ProfileCardTriggerState;
285
+ componentDidMount(): void;
286
+ componentDidUpdate(prevProps: ProfileCardTriggerProps): void;
287
+ componentWillUnmount(): void;
288
+ clientFetchProfile: () => void;
340
289
  handleClientSuccess(
341
290
  profileData: ProfileCardClientData,
342
291
  reportingLinesData: TeamCentralReportingLinesData,
343
292
  shouldShowGiveKudos: boolean,
344
293
  ): void;
345
- // (undocumented)
346
- hideDelay: number;
347
- // (undocumented)
348
- hideProfilecard: () => void;
349
- // (undocumented)
350
- hideTimer: number;
351
- // (undocumented)
352
- _isMounted: boolean;
353
- // (undocumented)
354
- layerListeners: {
355
- handleClickOutside: () => void;
356
- handleEscapeKeydown: () => void;
357
- };
358
- // (undocumented)
359
- onClick: (event: React_2.MouseEvent) => void;
360
- // (undocumented)
294
+ handleClientError(err: any): void;
295
+ filterActions(): ProfileCardAction[];
296
+ renderProfileCard(): JSX.Element;
361
297
  openKudosDrawer: () => void;
362
- // (undocumented)
363
- render(): JSX.Element;
364
- // (undocumented)
298
+ closeKudosDrawer: () => void;
365
299
  renderCard: () => JSX.Element;
366
- // (undocumented)
367
- renderProfileCard(): JSX.Element;
368
- // (undocumented)
369
300
  renderWithTrigger(): JSX.Element;
370
- // (undocumented)
371
- showDelay: number;
372
- // (undocumented)
373
- showProfilecard: () => void;
374
- // (undocumented)
375
- showTimer: number;
376
- // (undocumented)
377
- state: ProfileCardTriggerState;
301
+ render(): JSX.Element;
378
302
  }
379
303
 
380
- // @public (undocumented)
381
- export type ProfilecardTriggerPosition =
304
+ export declare type ProfilecardTriggerPosition =
382
305
  | 'bottom-start'
383
306
  | 'bottom'
384
307
  | 'bottom-end'
@@ -392,99 +315,91 @@ export type ProfilecardTriggerPosition =
392
315
  | 'right'
393
316
  | 'right-start';
394
317
 
395
- // @public (undocumented)
396
- export interface ProfileCardTriggerProps {
397
- // (undocumented)
398
- actions?: ProfileCardAction[];
399
- // (undocumented)
400
- addFlag?: (flag: any) => void;
401
- // (undocumented)
402
- analytics?: any;
403
- // (undocumented)
404
- children?: React_2.ReactNode;
318
+ export declare interface ProfileCardTriggerProps {
319
+ userId: string;
320
+ /**
321
+ A cloudId can be provided, and we'll verify that the target userId is an
322
+ actual user in the specified site.
323
+
324
+ Instead you can omit the cloudId and we won't do such a check.
325
+
326
+ If you have a cloudId and only want to show users who are in that site
327
+ then please provide it. If you're a site-less product or don't care about
328
+ verifying that the shown user is in a particular site, don't provide a
329
+ cloudId.
330
+ */
405
331
  cloudId?: string;
406
- // (undocumented)
332
+ resourceClient: ProfileClient_2;
333
+ actions?: ProfileCardAction[];
334
+ reportingLinesProfileUrl?: string;
407
335
  onReportingLinesClick?: (user: ReportingLinesUser) => void;
408
- // (undocumented)
336
+ analytics?: any;
409
337
  position?: ProfilecardTriggerPosition;
410
- // (undocumented)
411
- reportingLinesProfileUrl?: string;
412
- // (undocumented)
413
- resourceClient: ProfileClient_2;
414
- // (undocumented)
415
- testId?: string;
416
- // (undocumented)
417
338
  trigger?: TriggerType;
418
- // (undocumented)
419
- userId: string;
339
+ children?: React_2.ReactNode;
340
+ testId?: string;
341
+ addFlag?: (flag: any) => void;
420
342
  }
421
343
 
422
- // @public (undocumented)
423
- export interface ProfileCardTriggerState {
424
- // (undocumented)
425
- data: ProfileCardClientData | null;
426
- // (undocumented)
427
- error?: ProfileCardErrorType;
428
- // (undocumented)
429
- hasError: boolean;
430
- // (undocumented)
344
+ export declare interface ProfileCardTriggerState {
345
+ visible?: boolean;
431
346
  isLoading?: boolean;
432
- // (undocumented)
433
- kudosDrawerOpen: boolean;
434
- // (undocumented)
347
+ hasError: boolean;
348
+ error?: ProfileCardErrorType;
349
+ data: ProfileCardClientData | null;
435
350
  reportingLinesData?: TeamCentralReportingLinesData;
436
- // (undocumented)
437
351
  shouldShowGiveKudos?: boolean;
438
- // (undocumented)
439
352
  teamCentralBaseUrl?: string;
440
- // (undocumented)
441
- visible?: boolean;
353
+ kudosDrawerOpen: boolean;
442
354
  }
443
355
 
444
- // @public (undocumented)
445
- export class ProfileClient {
356
+ export declare class ProfileClient {
357
+ userClient: UserProfileClient;
358
+ teamClient: TeamProfileClient;
359
+ tcClient?: TeamCentralCardClient;
446
360
  constructor(config: ProfileClientOptions, clients?: ClientOverrides);
447
- // (undocumented)
448
361
  flushCache(): void;
449
- // (undocumented)
450
362
  getProfile(cloudId: string, userId: string): Promise<any>;
451
- // (undocumented)
452
- getReportingLines(userId: string): Promise<TeamCentralReportingLinesData>;
453
- // (undocumented)
454
- getTeamCentralBaseUrl(): string | undefined;
455
- // (undocumented)
456
363
  getTeamProfile(
457
364
  teamId: string,
458
365
  orgId?: string,
459
366
  analytics?: (event: Record<string, any>) => void,
460
367
  ): Promise<Team>;
461
- // (undocumented)
368
+ getReportingLines(userId: string): Promise<TeamCentralReportingLinesData>;
369
+ getTeamCentralBaseUrl(): string | undefined;
462
370
  shouldShowGiveKudos(): Promise<boolean>;
463
- // (undocumented)
464
- tcClient?: TeamCentralCardClient;
465
- // (undocumented)
466
- teamClient: TeamProfileClient;
467
- // (undocumented)
468
- userClient: UserProfileClient;
469
371
  }
470
372
 
471
- // @public (undocumented)
472
- export interface ProfileClientOptions {
473
- // (undocumented)
474
- cacheMaxAge?: number;
475
- // (undocumented)
476
- cacheSize?: number;
477
- // (undocumented)
373
+ declare interface ProfileClient_2 {
374
+ flushCache: () => void;
375
+ getProfile: (
376
+ cloudId: string,
377
+ userId: string,
378
+ ) => Promise<ProfileCardClientData>;
379
+ getTeamProfile: (
380
+ teamId: string,
381
+ orgId?: string,
382
+ fireAnalytics?: (event: Record<string, any>) => void,
383
+ ) => Promise<Team>;
384
+ getReportingLines: (userId: string) => Promise<TeamCentralReportingLinesData>;
385
+ shouldShowGiveKudos: () => Promise<boolean>;
386
+ getTeamCentralBaseUrl: () => string | undefined;
387
+ }
388
+
389
+ export declare interface ProfileClientOptions {
390
+ url: string;
478
391
  gatewayGraphqlUrl?: string;
479
- productIdentifier?: string;
480
- teamCentralBaseUrl?: string;
392
+ cacheSize?: number;
393
+ cacheMaxAge?: number;
394
+ /** Enables Team Central functionality if enabled e.g. /gateway/api/watermelon/graphql*/
481
395
  teamCentralUrl?: string;
482
- // (undocumented)
483
- url: string;
396
+ /** URL to the Team Central app e.g. team.atlassian.com */
397
+ teamCentralBaseUrl?: string;
398
+ /** Name of integrating product e.g. jira, atlas, confluence **/
399
+ productIdentifier?: string;
484
400
  }
485
401
 
486
- // @public (undocumented)
487
- export type RelativeDateKeyType =
402
+ export declare type RelativeDateKeyType =
488
403
  | 'ThisWeek'
489
404
  | 'ThisMonth'
490
405
  | 'LastMonth'
@@ -493,8 +408,18 @@ export type RelativeDateKeyType =
493
408
  | 'MoreThanAYear'
494
409
  | null;
495
410
 
496
- // @public (undocumented)
497
- export type StatusModifiedDateType =
411
+ declare interface ReportingLinesUser {
412
+ accountIdentifier: string;
413
+ identifierType: 'ATLASSIAN_ID' | 'BASE64_HASH' | 'UNKNOWN';
414
+ pii?: ReportingLinesUserPII;
415
+ }
416
+
417
+ declare interface ReportingLinesUserPII {
418
+ name: string;
419
+ picture?: string;
420
+ }
421
+
422
+ export declare type StatusModifiedDateType =
498
423
  | 'noDate'
499
424
  | 'thisWeek'
500
425
  | 'thisMonth'
@@ -503,42 +428,126 @@ export type StatusModifiedDateType =
503
428
  | 'severalMonths'
504
429
  | 'moreThanAYear';
505
430
 
506
- // @public (undocumented)
507
- export type StatusType = 'active' | 'inactive' | 'closed';
431
+ export declare type StatusType = 'active' | 'inactive' | 'closed';
508
432
 
509
- // @public (undocumented)
510
- export interface Team {
511
- // (undocumented)
512
- description: string;
513
- // (undocumented)
514
- displayName: string;
515
- // (undocumented)
516
- id: string;
517
- // (undocumented)
433
+ export declare interface Team {
518
434
  largeAvatarImageUrl?: string;
519
- // (undocumented)
435
+ smallAvatarImageUrl?: string;
520
436
  largeHeaderImageUrl?: string;
521
- // (undocumented)
437
+ smallHeaderImageUrl?: string;
438
+ id: string;
439
+ displayName: string;
440
+ description: string;
441
+ organizationId?: string;
522
442
  members?: {
523
443
  id: string;
524
444
  fullName: string;
525
445
  avatarUrl: string;
526
446
  }[];
527
- // (undocumented)
528
- organizationId?: string;
529
- // (undocumented)
530
- smallAvatarImageUrl?: string;
531
- // (undocumented)
532
- smallHeaderImageUrl?: string;
533
447
  }
534
448
 
535
- // @public (undocumented)
536
- export const TeamProfileCard: (
449
+ declare class TeamCentralCardClient extends CachingClient<
450
+ TeamCentralReportingLinesData
451
+ > {
452
+ options: TeamCentralCardClientOptions;
453
+ /**
454
+ * Simple circuit breaker to avoid making unnecessary calls to Team Central on auth failures
455
+ * This is to handle the case where products may have provided teamCentralUrl, but the site itself
456
+ * doesn't actually have any TC product.
457
+ *
458
+ * There's currently no way to reset this circuit breaker, but that's fine. This is meant to
459
+ * catch a pretty specific edge case.
460
+ */
461
+ bypassOnFailure: boolean;
462
+ featureFlagKeys: Map<string, boolean>;
463
+ constructor(options: TeamCentralCardClientOptions);
464
+ makeFeatureFlagCheckRequest(
465
+ featureKey: string,
466
+ context?: FeatureFlagExtraContext[],
467
+ ): Promise<boolean>;
468
+ makeRequest(userId: string): Promise<TeamCentralReportingLinesData>;
469
+ getReportingLines(userId: string): Promise<TeamCentralReportingLinesData>;
470
+ getFlagEnabled(
471
+ featureKey: string,
472
+ productIdentifier?: string,
473
+ ): Promise<boolean>;
474
+ private filterReportingLinesUser;
475
+ }
476
+
477
+ declare type TeamCentralCardClientOptions = ProfileClientOptions & {
478
+ teamCentralUrl: string;
479
+ };
480
+
481
+ declare interface TeamCentralReportingLinesData {
482
+ managers?: ReportingLinesUser[];
483
+ reports?: ReportingLinesUser[];
484
+ }
485
+
486
+ export declare const TeamProfileCard: (
537
487
  props: TeamProfilecardProps,
538
488
  ) => JSX.Element | null;
539
489
 
540
- // @public (undocumented)
541
- export const TeamProfileCardTrigger: React_2.ForwardRefExoticComponent<
490
+ declare interface TeamProfilecardCoreProps {
491
+ /**
492
+ The id of the user viewing the profile card.
493
+
494
+ This is used to determine whether to say that the member count is
495
+ "including you" or not.
496
+ */
497
+ viewingUserId?: string;
498
+ /**
499
+ A list of extra buttons to be displayed at the bottom of the card.
500
+ View Profile is always included by default.
501
+ */
502
+ actions?: ProfileCardAction[];
503
+ /**
504
+ A function allowing products to provide an href for the user avatars in the
505
+ profilecard, e.g. so they can link to user's profile pages.
506
+ */
507
+ generateUserLink?: (userId: string) => string;
508
+ /**
509
+ A function allowing products to provide an onClick handler for when the
510
+ user clicks on a user's avatar or avatar group item.
511
+ */
512
+ onUserClick?: (userId: string, event: React_2.MouseEvent<Element>) => void;
513
+ /**
514
+ This should be a link to the team's profile page. This will be used for:
515
+
516
+ - Wrapping the trigger in a link to the team profile page (unless
517
+ triggerLinkType is `none`).
518
+
519
+ - Providing the link for the View Profile action button on the card.
520
+ */
521
+ viewProfileLink: string;
522
+ /**
523
+ An onClick action that navigates to the team's profile page. Something you
524
+ may want, e.g. for an SPA site or tracking analytics of navigation. This
525
+ is optional, just the viewProfileLink will suffice. Will be used for:
526
+
527
+ - Adding an onClick to the trigger if the triggerLinkType is
528
+ `clickable-link`.
529
+
530
+ - Providing an onClick for the View Profile action button on the card.
531
+ */
532
+ viewProfileOnClick?: (event?: React_2.MouseEvent<Element>) => void;
533
+ }
534
+
535
+ declare interface TeamProfilecardProps extends TeamProfilecardCoreProps {
536
+ /** Indicates whether the team's details are still loading. */
537
+ isLoading?: boolean;
538
+ /** Indicates whether an error occurred whilst fetching team details. */
539
+ hasError?: boolean;
540
+ /** Describes the type of error that occurred, if any. */
541
+ errorType?: ProfileCardErrorType;
542
+ /** The details of the team to be shown. */
543
+ team?: Team;
544
+ /** A callback that will try to re-fetch data in case an error occurred. */
545
+ clientFetchProfile?: () => void;
546
+ /** Details relevant to passing around analytics. */
547
+ analytics: AnalyticsFunction;
548
+ }
549
+
550
+ export declare const TeamProfileCardTrigger: React_2.ForwardRefExoticComponent<
542
551
  Pick<
543
552
  Omit<
544
553
  TeamProfileCardTriggerProps & {
@@ -563,52 +572,106 @@ export const TeamProfileCardTrigger: React_2.ForwardRefExoticComponent<
563
572
  React_2.RefAttributes<any>
564
573
  >;
565
574
 
566
- // @public (undocumented)
567
- export class TeamProfileClient extends CachingClient<Team> {
575
+ declare interface TeamProfileCardTriggerProps extends TeamProfilecardCoreProps {
576
+ /** The id of the team. */
577
+ teamId: string;
578
+ /**
579
+ The id of the organization that the team belongs to.
580
+ Currently this is unused, but will become necessary in the future.
581
+ */
582
+ orgId: string;
583
+ /** An instance of ProfileClient. */
584
+ resourceClient: ProfileClient_2;
585
+ /**
586
+ The position relative to the trigger that the card should be displayed in.
587
+ */
588
+ position?: ProfilecardTriggerPosition;
589
+ /**
590
+ The interaction method used to trigger the team profile card to appear.
591
+
592
+ - Click is generally recommended, but your needs may vary.
593
+
594
+ - Hover works for mouse users, but does not support those who use a
595
+ keyboard or screen reader, avoid using this if it's possible or makes
596
+ sense.
597
+
598
+ - Hover-click is usable for scenarios like inline-edits, where mouse users
599
+ cannot click on the trigger without causing side effects, but keyboard
600
+ users are still able to navigate into and trigger the profile card.
601
+
602
+ Look at the "Team Profilecard Trigger" or "Trigger Link Types" examples to
603
+ see how they behave, or ask in #team-twp-people-teams on Slack for our
604
+ recommendations.
605
+ */
606
+ trigger?: 'hover' | 'click' | 'hover-click';
607
+ /**
608
+ We generally prefer to wrap the trigger in a link to the team profile
609
+ page. This prop determines how that link behaves.
610
+
611
+ - Link is generally the recommended prop (especially in combination with
612
+ click or hover-click for the trigger prop above). It wraps the trigger in
613
+ an anchor tag with the team profile link (that users can interact with
614
+ via middle-click, etc.), but left clicking on the link is suppressed.
615
+
616
+ - None does not wrap the trigger in a link at all. This makes it difficult
617
+ for keyboard or screen reader users to know how to trigger the profile
618
+ card. Generally avoid this.
619
+
620
+ - Clickable-link wraps the trigger in a link with no special behaviour.
621
+ This is suitable for places where you want the trigger to serve primarily
622
+ as a link, and optionally allow hovering to preview the team first.
623
+
624
+ Look at the example on "Trigger Link Types" for more in-depth analysis, or
625
+ ask in #team-twp-people-teams on Slack for our recommendations.
626
+ */
627
+ triggerLinkType?: 'none' | 'link' | 'clickable-link';
628
+ /**
629
+ This is the component that will cause a team profile card to appear when
630
+ interacted with according to the method specified by the trigger prop.
631
+ */
632
+ children?: React_2.ReactNode;
633
+ /**
634
+ * Used by the card to show Flags.
635
+ */
636
+ addFlag?: (flag: any) => void;
637
+ /**
638
+ * Optional cloudId. Pass this if rendering card within a sited context.
639
+ */
640
+ cloudId?: string;
641
+ }
642
+
643
+ export declare class TeamProfileClient extends CachingClient<Team> {
644
+ options: ProfileClientOptions;
568
645
  constructor(options: ProfileClientOptions);
569
- // (undocumented)
570
- getProfile(
646
+ makeRequestViaGateway(
571
647
  teamId: string,
572
- orgId: string | undefined,
573
- analytics?: (event: Record<string, any>) => void,
648
+ _orgId: string | undefined,
574
649
  ): Promise<Team>;
575
- // (undocumented)
576
650
  makeRequest(teamId: string, orgId: string | undefined): Promise<Team>;
577
- // (undocumented)
578
- makeRequestViaGateway(
651
+ getProfile(
579
652
  teamId: string,
580
- _orgId: string | undefined,
653
+ orgId: string | undefined,
654
+ analytics?: (event: Record<string, any>) => void,
581
655
  ): Promise<Team>;
582
- // (undocumented)
583
- options: ProfileClientOptions;
584
656
  }
585
657
 
586
- // @public (undocumented)
587
- export type TriggerType = 'hover' | 'click';
658
+ export declare type TriggerType = 'hover' | 'click';
588
659
 
589
- // @public (undocumented)
590
- export class UserProfileClient extends CachingClient<any> {
660
+ export declare class UserProfileClient extends CachingClient<any> {
661
+ options: ProfileClientOptions;
591
662
  constructor(options: ProfileClientOptions);
592
- // (undocumented)
593
- getProfile(cloudId: string, userId: string): Promise<any>;
594
- // (undocumented)
595
663
  makeRequest(cloudId: string, userId: string): Promise<ProfileCardClientData>;
596
- // (undocumented)
597
- options: ProfileClientOptions;
664
+ getProfile(cloudId: string, userId: string): Promise<any>;
598
665
  }
599
666
 
600
- // @public (undocumented)
601
- export function withOuterListeners<P>(
667
+ export declare function withOuterListeners<P>(
602
668
  Component: ComponentType<P>,
603
669
  ): React_2.ComponentClass<P & WithOuterListenersProps>;
604
670
 
605
- // @public (undocumented)
606
- export interface WithOuterListenersProps {
607
- // (undocumented)
671
+ export declare interface WithOuterListenersProps {
608
672
  handleClickOutside?: () => void;
609
- // (undocumented)
610
673
  handleEscapeKeydown?: () => void;
611
674
  }
612
675
 
613
- // (No @packageDocumentation comment for this package)
676
+ export {};
614
677
  ```