@atlaskit/profilecard 19.7.15 → 19.9.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 (39) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/afm-cc/tsconfig.json +3 -0
  3. package/dist/cjs/client/getTeamFromAGG.js +1 -1
  4. package/dist/cjs/components/User/ProfileCard.js +17 -5
  5. package/dist/cjs/components/User/ProfileCardTrigger.js +7 -2
  6. package/dist/cjs/components/User/ProfileCardTriggerNext.js +347 -0
  7. package/dist/cjs/i18n/en.js +1 -0
  8. package/dist/cjs/i18n/en_GB.js +1 -0
  9. package/dist/cjs/i18n/en_ZZ.js +1 -0
  10. package/dist/cjs/util/analytics.js +1 -1
  11. package/dist/es2019/client/getTeamFromAGG.js +1 -1
  12. package/dist/es2019/components/User/ProfileCard.js +18 -6
  13. package/dist/es2019/components/User/ProfileCardTrigger.js +6 -1
  14. package/dist/es2019/components/User/ProfileCardTriggerNext.js +266 -0
  15. package/dist/es2019/i18n/en.js +1 -0
  16. package/dist/es2019/i18n/en_GB.js +1 -0
  17. package/dist/es2019/i18n/en_ZZ.js +1 -0
  18. package/dist/es2019/util/analytics.js +1 -1
  19. package/dist/esm/client/getTeamFromAGG.js +1 -1
  20. package/dist/esm/components/User/ProfileCard.js +18 -6
  21. package/dist/esm/components/User/ProfileCardTrigger.js +6 -1
  22. package/dist/esm/components/User/ProfileCardTriggerNext.js +337 -0
  23. package/dist/esm/i18n/en.js +1 -0
  24. package/dist/esm/i18n/en_GB.js +1 -0
  25. package/dist/esm/i18n/en_ZZ.js +1 -0
  26. package/dist/esm/util/analytics.js +1 -1
  27. package/dist/types/components/User/ProfileCardTrigger.d.ts +3 -4
  28. package/dist/types/components/User/ProfileCardTriggerNext.d.ts +3 -0
  29. package/dist/types/i18n/en.d.ts +1 -0
  30. package/dist/types/i18n/en_GB.d.ts +1 -0
  31. package/dist/types/i18n/en_ZZ.d.ts +1 -0
  32. package/dist/types/types.d.ts +4 -1
  33. package/dist/types-ts4.5/components/User/ProfileCardTrigger.d.ts +3 -4
  34. package/dist/types-ts4.5/components/User/ProfileCardTriggerNext.d.ts +3 -0
  35. package/dist/types-ts4.5/i18n/en.d.ts +1 -0
  36. package/dist/types-ts4.5/i18n/en_GB.d.ts +1 -0
  37. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +1 -0
  38. package/dist/types-ts4.5/types.d.ts +4 -1
  39. package/package.json +12 -6
@@ -0,0 +1,337 @@
1
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
+ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
5
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
6
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
7
+ var _excluded = ["ref"];
8
+ 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; }
9
+ 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; }
10
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
11
+ import React, { Suspense, useCallback, useEffect, useMemo, useRef, useState } from 'react';
12
+ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
13
+ import { GiveKudosLauncherLazy, KudosType } from '@atlaskit/give-kudos';
14
+ import Popup from '@atlaskit/popup';
15
+ import { layers } from '@atlaskit/theme/constants';
16
+ import filterActionsInner from '../../internal/filterActions';
17
+ import { CardWrapper } from '../../styled/Card';
18
+ import { cardTriggered, fireEvent } from '../../util/analytics';
19
+ import { DELAY_MS_HIDE, DELAY_MS_SHOW } from '../../util/config';
20
+ import { ProfileCardLazy } from './lazyProfileCard';
21
+ import UserLoadingState from './UserLoadingState';
22
+ export default function ProfilecardTriggerNext(_ref) {
23
+ var _ref$trigger = _ref.trigger,
24
+ trigger = _ref$trigger === void 0 ? 'hover' : _ref$trigger,
25
+ userId = _ref.userId,
26
+ cloudId = _ref.cloudId,
27
+ resourceClient = _ref.resourceClient,
28
+ _ref$actions = _ref.actions,
29
+ actions = _ref$actions === void 0 ? [] : _ref$actions,
30
+ _ref$position = _ref.position,
31
+ position = _ref$position === void 0 ? 'bottom-start' : _ref$position,
32
+ children = _ref.children,
33
+ testId = _ref.testId,
34
+ addFlag = _ref.addFlag,
35
+ onReportingLinesClick = _ref.onReportingLinesClick,
36
+ ariaLabel = _ref.ariaLabel,
37
+ ariaLabelledBy = _ref.ariaLabelledBy;
38
+ var _useAnalyticsEvents = useAnalyticsEvents(),
39
+ createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
40
+ var _useState = useState(false),
41
+ _useState2 = _slicedToArray(_useState, 2),
42
+ isMounted = _useState2[0],
43
+ setIsMounted = _useState2[1];
44
+ var showDelay = trigger === 'click' ? 0 : DELAY_MS_SHOW;
45
+ var hideDelay = trigger === 'click' ? 0 : DELAY_MS_HIDE;
46
+ var _useState3 = useState(0),
47
+ _useState4 = _slicedToArray(_useState3, 2),
48
+ showTimer = _useState4[0],
49
+ setShowTimer = _useState4[1];
50
+ var _useState5 = useState(0),
51
+ _useState6 = _slicedToArray(_useState5, 2),
52
+ hideTimer = _useState6[0],
53
+ setHideTimer = _useState6[1];
54
+ var _useState7 = useState(false),
55
+ _useState8 = _slicedToArray(_useState7, 2),
56
+ visible = _useState8[0],
57
+ setVisible = _useState8[1];
58
+ var _useState9 = useState(undefined),
59
+ _useState10 = _slicedToArray(_useState9, 2),
60
+ isLoading = _useState10[0],
61
+ setIsLoading = _useState10[1];
62
+ var _useState11 = useState(false),
63
+ _useState12 = _slicedToArray(_useState11, 2),
64
+ hasError = _useState12[0],
65
+ setHasError = _useState12[1];
66
+ var _useState13 = useState(null),
67
+ _useState14 = _slicedToArray(_useState13, 2),
68
+ error = _useState14[0],
69
+ setError = _useState14[1];
70
+ var _useState15 = useState(null),
71
+ _useState16 = _slicedToArray(_useState15, 2),
72
+ data = _useState16[0],
73
+ setData = _useState16[1];
74
+ var _useState17 = useState(undefined),
75
+ _useState18 = _slicedToArray(_useState17, 2),
76
+ reportingLinesData = _useState18[0],
77
+ setReportingLinesData = _useState18[1];
78
+ var _useState19 = useState(false),
79
+ _useState20 = _slicedToArray(_useState19, 2),
80
+ shouldShowGiveKudos = _useState20[0],
81
+ setShouldShowGiveKudos = _useState20[1];
82
+ var _useState21 = useState(undefined),
83
+ _useState22 = _slicedToArray(_useState21, 2),
84
+ teamCentralBaseUrl = _useState22[0],
85
+ setTeamCentralBaseUrl = _useState22[1];
86
+ var _useState23 = useState(false),
87
+ _useState24 = _slicedToArray(_useState23, 2),
88
+ kudosDrawerOpen = _useState24[0],
89
+ setKudosDrawerOpen = _useState24[1];
90
+ var _useState25 = useState(false),
91
+ _useState26 = _slicedToArray(_useState25, 2),
92
+ isTriggeredUsingKeyboard = _useState26[0],
93
+ setTriggeredUsingKeyboard = _useState26[1];
94
+ var triggerRef = useRef(null);
95
+ useEffect(function () {
96
+ setIsMounted(true);
97
+ return function () {
98
+ setIsMounted(false);
99
+ clearTimeout(showTimer);
100
+ clearTimeout(hideTimer);
101
+ };
102
+ // eslint-disable-next-line react-hooks/exhaustive-deps
103
+ }, []);
104
+ useEffect(function () {
105
+ // Reset state when the userId changes
106
+ setIsLoading(undefined);
107
+ setHasError(false);
108
+ setError(null);
109
+ setData(null);
110
+ setReportingLinesData(undefined);
111
+ setShouldShowGiveKudos(false);
112
+ setTeamCentralBaseUrl(undefined);
113
+ }, [userId]);
114
+ var fireAnalytics = useCallback(function (payload) {
115
+ // Don't fire any analytics if the component is unmounted
116
+ if (!isMounted) {
117
+ return;
118
+ }
119
+ fireEvent(createAnalyticsEvent, payload);
120
+ }, [createAnalyticsEvent, isMounted]);
121
+ var hideProfilecard = useCallback(function () {
122
+ clearTimeout(showTimer);
123
+ clearTimeout(hideTimer);
124
+ if (!isTriggeredUsingKeyboard) {
125
+ setHideTimer(window.setTimeout(function () {
126
+ setVisible(false);
127
+ }, hideDelay));
128
+ }
129
+ setTriggeredUsingKeyboard(false);
130
+ }, [hideDelay, hideTimer, showTimer, isTriggeredUsingKeyboard]);
131
+ var handleKeyboardClose = useCallback(function (event) {
132
+ if (event.key !== 'Escape') {
133
+ return;
134
+ }
135
+ if (triggerRef.current) {
136
+ triggerRef.current.focus();
137
+ }
138
+ setTriggeredUsingKeyboard(false);
139
+ setVisible(false);
140
+ }, [setTriggeredUsingKeyboard, setVisible]);
141
+ var handleClientSuccess = useCallback(function (profileData, reportingLinesData, shouldShowGiveKudos) {
142
+ if (!isMounted) {
143
+ return;
144
+ }
145
+ setIsLoading(false);
146
+ setHasError(false);
147
+ setData(profileData);
148
+ setReportingLinesData(reportingLinesData);
149
+ setShouldShowGiveKudos(shouldShowGiveKudos);
150
+ }, [isMounted, setHasError, setIsLoading, setData, setReportingLinesData, setShouldShowGiveKudos]);
151
+ var handleClientError = useCallback(function (err) {
152
+ if (!isMounted) {
153
+ return;
154
+ }
155
+ setIsLoading(false);
156
+ setHasError(true);
157
+ setError(err);
158
+ }, [isMounted, setHasError, setIsLoading, setError]);
159
+ var clientFetchProfile = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
160
+ var requests, responses;
161
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
162
+ while (1) switch (_context.prev = _context.next) {
163
+ case 0:
164
+ if (!(isLoading === true)) {
165
+ _context.next = 2;
166
+ break;
167
+ }
168
+ return _context.abrupt("return");
169
+ case 2:
170
+ setTeamCentralBaseUrl(resourceClient.getTeamCentralBaseUrl());
171
+ setIsLoading(true);
172
+ setHasError(false);
173
+ setError(null);
174
+ setData(null);
175
+ _context.prev = 7;
176
+ requests = Promise.all([resourceClient.getProfile(cloudId || '', userId, fireAnalytics), resourceClient.getReportingLines(userId), resourceClient.shouldShowGiveKudos()]);
177
+ _context.next = 11;
178
+ return requests;
179
+ case 11:
180
+ responses = _context.sent;
181
+ handleClientSuccess.apply(void 0, _toConsumableArray(responses));
182
+ _context.next = 18;
183
+ break;
184
+ case 15:
185
+ _context.prev = 15;
186
+ _context.t0 = _context["catch"](7);
187
+ handleClientError(_context.t0);
188
+ case 18:
189
+ case "end":
190
+ return _context.stop();
191
+ }
192
+ }, _callee, null, [[7, 15]]);
193
+ })), [cloudId, fireAnalytics, isLoading, resourceClient, userId, handleClientSuccess, handleClientError]);
194
+ var showProfilecard = useCallback(function () {
195
+ clearTimeout(hideTimer);
196
+ clearTimeout(showTimer);
197
+ setShowTimer(window.setTimeout(function () {
198
+ if (!visible) {
199
+ void clientFetchProfile();
200
+ setVisible(true);
201
+ }
202
+ }, showDelay));
203
+ }, [hideTimer, showDelay, showTimer, visible, clientFetchProfile]);
204
+ var onClick = useCallback(function (event) {
205
+ // If the user clicks on the trigger then we don't want that click event to
206
+ // propagate out to parent containers. For example when clicking a mention
207
+ // lozenge in an inline-edit.
208
+ event.stopPropagation();
209
+ showProfilecard();
210
+ if (!visible) {
211
+ fireAnalytics(cardTriggered('user', 'click'));
212
+ }
213
+ }, [fireAnalytics, showProfilecard, visible]);
214
+ var onMouseEnter = useCallback(function () {
215
+ showProfilecard();
216
+ if (!visible) {
217
+ fireAnalytics(cardTriggered('user', 'hover'));
218
+ }
219
+ }, [fireAnalytics, showProfilecard, visible]);
220
+ var onKeyPress = useCallback(function (event) {
221
+ if (event.key === 'Enter' || event.key === ' ') {
222
+ event.preventDefault();
223
+ setTriggeredUsingKeyboard(true);
224
+ showProfilecard();
225
+ if (!visible) {
226
+ fireAnalytics(cardTriggered('user', 'click'));
227
+ }
228
+ }
229
+ }, [fireAnalytics, showProfilecard, visible]);
230
+ var onFocus = useCallback(function () {
231
+ showProfilecard();
232
+ }, [showProfilecard]);
233
+ var containerListeners = useMemo(function () {
234
+ return trigger === 'hover' ? {
235
+ onMouseEnter: onMouseEnter,
236
+ onMouseLeave: hideProfilecard,
237
+ onBlur: hideProfilecard,
238
+ onKeyPress: onKeyPress
239
+ } : {
240
+ onClick: onClick,
241
+ onKeyPress: onKeyPress
242
+ };
243
+ }, [hideProfilecard, onClick, onKeyPress, onMouseEnter, trigger]);
244
+ var filterActions = useCallback(function () {
245
+ return filterActionsInner(actions, data);
246
+ }, [actions, data]);
247
+ var openKudosDrawer = function openKudosDrawer() {
248
+ hideProfilecard();
249
+ setKudosDrawerOpen(true);
250
+ };
251
+ var closeKudosDrawer = function closeKudosDrawer() {
252
+ setKudosDrawerOpen(false);
253
+ };
254
+ var showLoading = isLoading === true || isLoading === undefined;
255
+ var wrapperProps = useMemo(function () {
256
+ return trigger === 'hover' ? {
257
+ onMouseEnter: onMouseEnter,
258
+ onMouseLeave: hideProfilecard,
259
+ onFocus: onFocus
260
+ } : {};
261
+ }, [hideProfilecard, onFocus, onMouseEnter, trigger]);
262
+ var profilecardProps = _objectSpread(_objectSpread({
263
+ userId: userId,
264
+ isCurrentUser: data === null || data === void 0 ? void 0 : data.isCurrentUser,
265
+ clientFetchProfile: clientFetchProfile
266
+ }, data), {}, {
267
+ reportingLines: reportingLinesData,
268
+ onReportingLinesClick: onReportingLinesClick,
269
+ isKudosEnabled: shouldShowGiveKudos,
270
+ teamCentralBaseUrl: teamCentralBaseUrl,
271
+ cloudId: cloudId,
272
+ openKudosDrawer: openKudosDrawer,
273
+ isTriggeredUsingKeyboard: isTriggeredUsingKeyboard
274
+ });
275
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Popup, {
276
+ isOpen: !!visible,
277
+ onClose: function onClose(event) {
278
+ hideProfilecard();
279
+ handleKeyboardClose(event);
280
+ },
281
+ placement: position,
282
+ content: function content() {
283
+ return showLoading ? /*#__PURE__*/React.createElement(LoadingView, {
284
+ fireAnalytics: fireAnalytics
285
+ }) : /*#__PURE__*/React.createElement("div", wrapperProps, visible && /*#__PURE__*/React.createElement(Suspense, {
286
+ fallback: null
287
+ }, /*#__PURE__*/React.createElement(ProfileCardLazy, _extends({}, profilecardProps, {
288
+ actions: filterActions(),
289
+ hasError: hasError,
290
+ errorType: error,
291
+ withoutElevation: true
292
+ }))));
293
+ },
294
+ trigger: function trigger(triggerProps) {
295
+ var callbackRef = triggerProps.ref,
296
+ innerProps = _objectWithoutProperties(triggerProps, _excluded);
297
+ var ref = function ref(element) {
298
+ triggerRef.current = element;
299
+ if (typeof callbackRef === 'function') {
300
+ callbackRef(element);
301
+ }
302
+ };
303
+ return /*#__PURE__*/React.createElement("span", _extends({}, innerProps, containerListeners, {
304
+ ref: ref,
305
+ "data-testid": testId,
306
+ role: "button",
307
+ tabIndex: 0,
308
+ "aria-label": ariaLabel,
309
+ "aria-labelledby": ariaLabelledBy
310
+ }), children);
311
+ },
312
+ zIndex: layers.modal(),
313
+ shouldUseCaptureOnOutsideClick: true,
314
+ autoFocus: trigger === 'click'
315
+ }), shouldShowGiveKudos && /*#__PURE__*/React.createElement(Suspense, {
316
+ fallback: null
317
+ }, /*#__PURE__*/React.createElement(GiveKudosLauncherLazy, {
318
+ isOpen: kudosDrawerOpen,
319
+ recipient: {
320
+ type: KudosType.INDIVIDUAL,
321
+ recipientId: userId
322
+ },
323
+ analyticsSource: "profile-card",
324
+ teamCentralBaseUrl: teamCentralBaseUrl,
325
+ cloudId: cloudId,
326
+ addFlag: addFlag,
327
+ onClose: closeKudosDrawer
328
+ })));
329
+ }
330
+ var LoadingView = function LoadingView(_ref3) {
331
+ var fireAnalytics = _ref3.fireAnalytics;
332
+ return /*#__PURE__*/React.createElement(CardWrapper, {
333
+ "data-testId": "profilecard.profilecardtrigger.loading"
334
+ }, /*#__PURE__*/React.createElement(UserLoadingState, {
335
+ fireAnalytics: fireAnalytics
336
+ }));
337
+ };
@@ -7,6 +7,7 @@
7
7
  */
8
8
  //
9
9
  export default {
10
+ 'profilecard.user.trigger.aria-label': 'More information about {fullName}',
10
11
  'pt.profile-card.closed.account': 'Account deleted',
11
12
  'pt.profile-card.closed.account.has.date.a.few.months': 'Their account has been deleted for a few months.',
12
13
  'pt.profile-card.closed.account.has.date.last.month': 'Their account was deleted last month.',
@@ -7,6 +7,7 @@
7
7
  */
8
8
  //English (United Kingdom)
9
9
  export default {
10
+ 'profilecard.user.trigger.aria-label': 'More information about {fullName}',
10
11
  'pt.profile-card.closed.account': 'Account deleted',
11
12
  'pt.profile-card.closed.account.has.date.a.few.months': 'Their account has been deleted for a few months.',
12
13
  'pt.profile-card.closed.account.has.date.last.month': 'Their account was deleted last month.',
@@ -7,6 +7,7 @@
7
7
  */
8
8
  //
9
9
  export default {
10
+ 'profilecard.user.trigger.aria-label': '⁣⁢More information about {fullName}⁠‍⁡؜‍‌‌⁡‌؜⁡‌⁣⁤',
10
11
  'pt.profile-card.closed.account': '⁣⁢Account deleted⁠؜⁡‌؜⁠‍⁡⁠؜؜⁣⁤',
11
12
  'pt.profile-card.closed.account.has.date.a.few.months': '⁣⁢Their account has been deleted for a few months.⁠⁡⁠‍‌⁠⁡‍؜‌⁡‌‌؜⁣⁤',
12
13
  'pt.profile-card.closed.account.has.date.last.month': '⁣⁢Their account was deleted last month.⁡‍⁠‌⁡؜‍؜⁠‍⁠؜⁣⁤',
@@ -38,7 +38,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
38
38
  actionSubjectId: actionSubjectId,
39
39
  attributes: _objectSpread(_objectSpread({
40
40
  packageName: "@atlaskit/profilecard",
41
- packageVersion: "19.7.15"
41
+ packageVersion: "19.9.0"
42
42
  }, attributes), {}, {
43
43
  firedAt: Math.round(getPageTime())
44
44
  })
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
- import { AnalyticsProps, ProfileCardTriggerProps } from '../../types';
3
- declare const _default: React.ForwardRefExoticComponent<Pick<Omit<ProfileCardTriggerProps & AnalyticsProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, never> & Partial<Pick<Omit<ProfileCardTriggerProps & AnalyticsProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, keyof ProfileCardTriggerProps>> & Partial<Pick<Partial<ProfileCardTriggerProps>, never>> & React.RefAttributes<any>>;
4
- export default _default;
1
+ /// <reference types="react" />
2
+ import { ProfileCardTriggerProps } from '../../types';
3
+ export default function ProfilecardTriggerSwitch(props: ProfileCardTriggerProps): JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { ProfileCardTriggerProps } from '../../types';
3
+ export default function ProfilecardTriggerNext({ trigger, userId, cloudId, resourceClient, actions, position, children, testId, addFlag, onReportingLinesClick, ariaLabel, ariaLabelledBy, }: ProfileCardTriggerProps): JSX.Element;
@@ -5,6 +5,7 @@
5
5
  * DO NOT CHANGE IT BY HAND or your changes will be lost.
6
6
  */
7
7
  declare const _default: {
8
+ 'profilecard.user.trigger.aria-label': string;
8
9
  'pt.profile-card.closed.account': string;
9
10
  'pt.profile-card.closed.account.has.date.a.few.months': string;
10
11
  'pt.profile-card.closed.account.has.date.last.month': string;
@@ -5,6 +5,7 @@
5
5
  * DO NOT CHANGE IT BY HAND or your changes will be lost.
6
6
  */
7
7
  declare const _default: {
8
+ 'profilecard.user.trigger.aria-label': string;
8
9
  'pt.profile-card.closed.account': string;
9
10
  'pt.profile-card.closed.account.has.date.a.few.months': string;
10
11
  'pt.profile-card.closed.account.has.date.last.month': string;
@@ -5,6 +5,7 @@
5
5
  * DO NOT CHANGE IT BY HAND or your changes will be lost.
6
6
  */
7
7
  declare const _default: {
8
+ 'profilecard.user.trigger.aria-label': string;
8
9
  'pt.profile-card.closed.account': string;
9
10
  'pt.profile-card.closed.account.has.date.a.few.months': string;
10
11
  'pt.profile-card.closed.account.has.date.last.month': string;
@@ -108,9 +108,11 @@ export interface ProfileCardTriggerProps {
108
108
  onReportingLinesClick?: (user: ReportingLinesUser) => void;
109
109
  position?: ProfilecardTriggerPosition;
110
110
  trigger?: TriggerType;
111
- children?: React.ReactNode;
111
+ children: React.ReactNode;
112
112
  testId?: string;
113
113
  addFlag?: (flag: any) => void;
114
+ ariaLabel?: string;
115
+ ariaLabelledBy?: string;
114
116
  }
115
117
  export interface ProfileCardTriggerState {
116
118
  visible?: boolean;
@@ -295,6 +297,7 @@ export interface ProfilecardProps {
295
297
  hasDisabledAccountLozenge?: boolean;
296
298
  customLozenges?: LozengeProps[];
297
299
  openKudosDrawer?: () => void;
300
+ isTriggeredUsingKeyboard?: boolean;
298
301
  }
299
302
  export type AnalyticsFromDuration = (duration: number) => AnalyticsEventPayload;
300
303
  export type AnalyticsFunction = (generator: AnalyticsFromDuration) => void;
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
- import { AnalyticsProps, ProfileCardTriggerProps } from '../../types';
3
- declare const _default: React.ForwardRefExoticComponent<Pick<Omit<ProfileCardTriggerProps & AnalyticsProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, never> & Partial<Pick<Omit<ProfileCardTriggerProps & AnalyticsProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, keyof ProfileCardTriggerProps>> & Partial<Pick<Partial<ProfileCardTriggerProps>, never>> & React.RefAttributes<any>>;
4
- export default _default;
1
+ /// <reference types="react" />
2
+ import { ProfileCardTriggerProps } from '../../types';
3
+ export default function ProfilecardTriggerSwitch(props: ProfileCardTriggerProps): JSX.Element;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { ProfileCardTriggerProps } from '../../types';
3
+ export default function ProfilecardTriggerNext({ trigger, userId, cloudId, resourceClient, actions, position, children, testId, addFlag, onReportingLinesClick, ariaLabel, ariaLabelledBy, }: ProfileCardTriggerProps): JSX.Element;
@@ -5,6 +5,7 @@
5
5
  * DO NOT CHANGE IT BY HAND or your changes will be lost.
6
6
  */
7
7
  declare const _default: {
8
+ 'profilecard.user.trigger.aria-label': string;
8
9
  'pt.profile-card.closed.account': string;
9
10
  'pt.profile-card.closed.account.has.date.a.few.months': string;
10
11
  'pt.profile-card.closed.account.has.date.last.month': string;
@@ -5,6 +5,7 @@
5
5
  * DO NOT CHANGE IT BY HAND or your changes will be lost.
6
6
  */
7
7
  declare const _default: {
8
+ 'profilecard.user.trigger.aria-label': string;
8
9
  'pt.profile-card.closed.account': string;
9
10
  'pt.profile-card.closed.account.has.date.a.few.months': string;
10
11
  'pt.profile-card.closed.account.has.date.last.month': string;
@@ -5,6 +5,7 @@
5
5
  * DO NOT CHANGE IT BY HAND or your changes will be lost.
6
6
  */
7
7
  declare const _default: {
8
+ 'profilecard.user.trigger.aria-label': string;
8
9
  'pt.profile-card.closed.account': string;
9
10
  'pt.profile-card.closed.account.has.date.a.few.months': string;
10
11
  'pt.profile-card.closed.account.has.date.last.month': string;
@@ -108,9 +108,11 @@ export interface ProfileCardTriggerProps {
108
108
  onReportingLinesClick?: (user: ReportingLinesUser) => void;
109
109
  position?: ProfilecardTriggerPosition;
110
110
  trigger?: TriggerType;
111
- children?: React.ReactNode;
111
+ children: React.ReactNode;
112
112
  testId?: string;
113
113
  addFlag?: (flag: any) => void;
114
+ ariaLabel?: string;
115
+ ariaLabelledBy?: string;
114
116
  }
115
117
  export interface ProfileCardTriggerState {
116
118
  visible?: boolean;
@@ -295,6 +297,7 @@ export interface ProfilecardProps {
295
297
  hasDisabledAccountLozenge?: boolean;
296
298
  customLozenges?: LozengeProps[];
297
299
  openKudosDrawer?: () => void;
300
+ isTriggeredUsingKeyboard?: boolean;
298
301
  }
299
302
  export type AnalyticsFromDuration = (duration: number) => AnalyticsEventPayload;
300
303
  export type AnalyticsFunction = (generator: AnalyticsFromDuration) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "19.7.15",
3
+ "version": "19.9.0",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -52,21 +52,22 @@
52
52
  "access": "public"
53
53
  },
54
54
  "dependencies": {
55
- "@atlaskit/analytics-next": "^9.1.0",
55
+ "@atlaskit/analytics-next": "^9.2.0",
56
56
  "@atlaskit/avatar": "^21.4.0",
57
57
  "@atlaskit/avatar-group": "^9.5.0",
58
- "@atlaskit/button": "^17.2.0",
59
- "@atlaskit/dropdown-menu": "^12.1.0",
58
+ "@atlaskit/button": "^17.3.0",
59
+ "@atlaskit/dropdown-menu": "^12.5.0",
60
60
  "@atlaskit/empty-state": "^7.6.0",
61
61
  "@atlaskit/focus-ring": "^1.3.4",
62
62
  "@atlaskit/give-kudos": "^2.1.0",
63
63
  "@atlaskit/icon": "^22.0.0",
64
64
  "@atlaskit/lozenge": "^11.6.0",
65
65
  "@atlaskit/menu": "^2.1.0",
66
- "@atlaskit/popup": "^1.11.0",
66
+ "@atlaskit/platform-feature-flags": "^0.2.4",
67
+ "@atlaskit/popup": "^1.12.0",
67
68
  "@atlaskit/spinner": "^16.0.0",
68
69
  "@atlaskit/theme": "^12.6.0",
69
- "@atlaskit/tokens": "^1.34.0",
70
+ "@atlaskit/tokens": "^1.35.0",
70
71
  "@atlaskit/tooltip": "^18.1.0",
71
72
  "@babel/runtime": "^7.0.0",
72
73
  "@emotion/react": "^11.7.1",
@@ -108,5 +109,10 @@
108
109
  ]
109
110
  }
110
111
  },
112
+ "platform-feature-flags": {
113
+ "platform.profile-card-trigger-next": {
114
+ "type": "boolean"
115
+ }
116
+ },
111
117
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
112
118
  }