@atlaskit/profilecard 19.8.0 → 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.
- package/CHANGELOG.md +10 -0
- package/dist/cjs/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/components/User/ProfileCard.js +12 -3
- package/dist/cjs/components/User/ProfileCardTriggerNext.js +41 -18
- package/dist/cjs/i18n/en.js +1 -0
- package/dist/cjs/i18n/en_GB.js +1 -0
- package/dist/cjs/i18n/en_ZZ.js +1 -0
- package/dist/cjs/util/analytics.js +1 -1
- package/dist/es2019/client/getTeamFromAGG.js +1 -1
- package/dist/es2019/components/User/ProfileCard.js +13 -4
- package/dist/es2019/components/User/ProfileCardTriggerNext.js +39 -20
- package/dist/es2019/i18n/en.js +1 -0
- package/dist/es2019/i18n/en_GB.js +1 -0
- package/dist/es2019/i18n/en_ZZ.js +1 -0
- package/dist/es2019/util/analytics.js +1 -1
- package/dist/esm/client/getTeamFromAGG.js +1 -1
- package/dist/esm/components/User/ProfileCard.js +13 -4
- package/dist/esm/components/User/ProfileCardTriggerNext.js +42 -19
- package/dist/esm/i18n/en.js +1 -0
- package/dist/esm/i18n/en_GB.js +1 -0
- package/dist/esm/i18n/en_ZZ.js +1 -0
- package/dist/esm/util/analytics.js +1 -1
- package/dist/types/components/User/ProfileCardTriggerNext.d.ts +1 -1
- package/dist/types/i18n/en.d.ts +1 -0
- package/dist/types/i18n/en_GB.d.ts +1 -0
- package/dist/types/i18n/en_ZZ.d.ts +1 -0
- package/dist/types/types.d.ts +3 -0
- package/dist/types-ts4.5/components/User/ProfileCardTriggerNext.d.ts +1 -1
- package/dist/types-ts4.5/i18n/en.d.ts +1 -0
- package/dist/types-ts4.5/i18n/en_GB.d.ts +1 -0
- package/dist/types-ts4.5/i18n/en_ZZ.d.ts +1 -0
- package/dist/types-ts4.5/types.d.ts +3 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/profilecard
|
|
2
2
|
|
|
3
|
+
## 19.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#70817](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70817) [`bc59c17947b6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bc59c17947b6) - Add focus to view profile button when Profile card display
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
3
13
|
## 19.8.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
|
@@ -57,7 +57,7 @@ var addHeaders = exports.addHeaders = function addHeaders(headers) {
|
|
|
57
57
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
58
58
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
59
59
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
60
|
-
headers.append('atl-client-version', "19.
|
|
60
|
+
headers.append('atl-client-version', "19.9.0");
|
|
61
61
|
return headers;
|
|
62
62
|
};
|
|
63
63
|
function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -131,12 +131,14 @@ var ProfilecardInternal = exports.ProfilecardInternal = function ProfilecardInte
|
|
|
131
131
|
fireAnalyticsWithDuration: fireAnalyticsWithDuration
|
|
132
132
|
})), realActions && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Card.ActionsFlexSpacer, null), /*#__PURE__*/_react.default.createElement(Actions, {
|
|
133
133
|
actions: realActions,
|
|
134
|
-
fireAnalyticsWithDuration: fireAnalyticsWithDuration
|
|
134
|
+
fireAnalyticsWithDuration: fireAnalyticsWithDuration,
|
|
135
|
+
isTriggeredUsingKeyboard: props.isTriggeredUsingKeyboard
|
|
135
136
|
})))));
|
|
136
137
|
};
|
|
137
138
|
var Actions = function Actions(_ref) {
|
|
138
139
|
var actions = _ref.actions,
|
|
139
|
-
fireAnalyticsWithDuration = _ref.fireAnalyticsWithDuration
|
|
140
|
+
fireAnalyticsWithDuration = _ref.fireAnalyticsWithDuration,
|
|
141
|
+
isTriggeredUsingKeyboard = _ref.isTriggeredUsingKeyboard;
|
|
140
142
|
var onActionClick = (0, _react.useCallback)(function (action, args, event, index) {
|
|
141
143
|
fireAnalyticsWithDuration(function (duration) {
|
|
142
144
|
return (0, _analytics.actionClicked)('user', {
|
|
@@ -152,6 +154,12 @@ var Actions = function Actions(_ref) {
|
|
|
152
154
|
action.callback.apply(action, [event].concat((0, _toConsumableArray2.default)(args)));
|
|
153
155
|
}
|
|
154
156
|
}, [fireAnalyticsWithDuration]);
|
|
157
|
+
var buttonRef = (0, _react.useRef)(null);
|
|
158
|
+
(0, _react.useEffect)(function () {
|
|
159
|
+
if (actions.length > 0 && buttonRef.current && isTriggeredUsingKeyboard) {
|
|
160
|
+
buttonRef.current.focus();
|
|
161
|
+
}
|
|
162
|
+
}, [isTriggeredUsingKeyboard, actions.length]);
|
|
155
163
|
if (!actions || actions.length === 0) {
|
|
156
164
|
return null;
|
|
157
165
|
}
|
|
@@ -173,7 +181,8 @@ var Actions = function Actions(_ref) {
|
|
|
173
181
|
}
|
|
174
182
|
return onActionClick(action, args, event, index);
|
|
175
183
|
},
|
|
176
|
-
href: action.link
|
|
184
|
+
href: action.link,
|
|
185
|
+
ref: index === 0 ? buttonRef : undefined
|
|
177
186
|
}, action.label, isKudos && /*#__PURE__*/_react.default.createElement(_Card.AnimationWrapper, null, /*#__PURE__*/_react.default.createElement(_Card.KudosBlobAnimation, null))));
|
|
178
187
|
if (isKudos) {
|
|
179
188
|
return /*#__PURE__*/_react.default.createElement(_Card.AnimatedKudosButton, {
|
|
@@ -14,7 +14,6 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
14
14
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
15
15
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
16
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
-
var _reactIntlNext = require("react-intl-next");
|
|
18
17
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
19
18
|
var _giveKudos = require("@atlaskit/give-kudos");
|
|
20
19
|
var _popup = _interopRequireDefault(require("@atlaskit/popup"));
|
|
@@ -43,11 +42,11 @@ function ProfilecardTriggerNext(_ref) {
|
|
|
43
42
|
children = _ref.children,
|
|
44
43
|
testId = _ref.testId,
|
|
45
44
|
addFlag = _ref.addFlag,
|
|
46
|
-
onReportingLinesClick = _ref.onReportingLinesClick
|
|
45
|
+
onReportingLinesClick = _ref.onReportingLinesClick,
|
|
46
|
+
ariaLabel = _ref.ariaLabel,
|
|
47
|
+
ariaLabelledBy = _ref.ariaLabelledBy;
|
|
47
48
|
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
48
49
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
49
|
-
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
50
|
-
formatMessage = _useIntl.formatMessage;
|
|
51
50
|
var _useState = (0, _react.useState)(false),
|
|
52
51
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
53
52
|
isMounted = _useState2[0],
|
|
@@ -98,6 +97,11 @@ function ProfilecardTriggerNext(_ref) {
|
|
|
98
97
|
_useState24 = (0, _slicedToArray2.default)(_useState23, 2),
|
|
99
98
|
kudosDrawerOpen = _useState24[0],
|
|
100
99
|
setKudosDrawerOpen = _useState24[1];
|
|
100
|
+
var _useState25 = (0, _react.useState)(false),
|
|
101
|
+
_useState26 = (0, _slicedToArray2.default)(_useState25, 2),
|
|
102
|
+
isTriggeredUsingKeyboard = _useState26[0],
|
|
103
|
+
setTriggeredUsingKeyboard = _useState26[1];
|
|
104
|
+
var triggerRef = (0, _react.useRef)(null);
|
|
101
105
|
(0, _react.useEffect)(function () {
|
|
102
106
|
setIsMounted(true);
|
|
103
107
|
return function () {
|
|
@@ -127,10 +131,23 @@ function ProfilecardTriggerNext(_ref) {
|
|
|
127
131
|
var hideProfilecard = (0, _react.useCallback)(function () {
|
|
128
132
|
clearTimeout(showTimer);
|
|
129
133
|
clearTimeout(hideTimer);
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
+
if (!isTriggeredUsingKeyboard) {
|
|
135
|
+
setHideTimer(window.setTimeout(function () {
|
|
136
|
+
setVisible(false);
|
|
137
|
+
}, hideDelay));
|
|
138
|
+
}
|
|
139
|
+
setTriggeredUsingKeyboard(false);
|
|
140
|
+
}, [hideDelay, hideTimer, showTimer, isTriggeredUsingKeyboard]);
|
|
141
|
+
var handleKeyboardClose = (0, _react.useCallback)(function (event) {
|
|
142
|
+
if (event.key !== 'Escape') {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
if (triggerRef.current) {
|
|
146
|
+
triggerRef.current.focus();
|
|
147
|
+
}
|
|
148
|
+
setTriggeredUsingKeyboard(false);
|
|
149
|
+
setVisible(false);
|
|
150
|
+
}, [setTriggeredUsingKeyboard, setVisible]);
|
|
134
151
|
var handleClientSuccess = (0, _react.useCallback)(function (profileData, reportingLinesData, shouldShowGiveKudos) {
|
|
135
152
|
if (!isMounted) {
|
|
136
153
|
return;
|
|
@@ -213,6 +230,7 @@ function ProfilecardTriggerNext(_ref) {
|
|
|
213
230
|
var onKeyPress = (0, _react.useCallback)(function (event) {
|
|
214
231
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
215
232
|
event.preventDefault();
|
|
233
|
+
setTriggeredUsingKeyboard(true);
|
|
216
234
|
showProfilecard();
|
|
217
235
|
if (!visible) {
|
|
218
236
|
fireAnalytics((0, _analytics.cardTriggered)('user', 'click'));
|
|
@@ -261,11 +279,15 @@ function ProfilecardTriggerNext(_ref) {
|
|
|
261
279
|
isKudosEnabled: shouldShowGiveKudos,
|
|
262
280
|
teamCentralBaseUrl: teamCentralBaseUrl,
|
|
263
281
|
cloudId: cloudId,
|
|
264
|
-
openKudosDrawer: openKudosDrawer
|
|
282
|
+
openKudosDrawer: openKudosDrawer,
|
|
283
|
+
isTriggeredUsingKeyboard: isTriggeredUsingKeyboard
|
|
265
284
|
});
|
|
266
285
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_popup.default, {
|
|
267
286
|
isOpen: !!visible,
|
|
268
|
-
onClose:
|
|
287
|
+
onClose: function onClose(event) {
|
|
288
|
+
hideProfilecard();
|
|
289
|
+
handleKeyboardClose(event);
|
|
290
|
+
},
|
|
269
291
|
placement: position,
|
|
270
292
|
content: function content() {
|
|
271
293
|
return showLoading ? /*#__PURE__*/_react.default.createElement(LoadingView, {
|
|
@@ -280,20 +302,21 @@ function ProfilecardTriggerNext(_ref) {
|
|
|
280
302
|
}))));
|
|
281
303
|
},
|
|
282
304
|
trigger: function trigger(triggerProps) {
|
|
283
|
-
var
|
|
305
|
+
var callbackRef = triggerProps.ref,
|
|
284
306
|
innerProps = (0, _objectWithoutProperties2.default)(triggerProps, _excluded);
|
|
307
|
+
var ref = function ref(element) {
|
|
308
|
+
triggerRef.current = element;
|
|
309
|
+
if (typeof callbackRef === 'function') {
|
|
310
|
+
callbackRef(element);
|
|
311
|
+
}
|
|
312
|
+
};
|
|
285
313
|
return /*#__PURE__*/_react.default.createElement("span", (0, _extends2.default)({}, innerProps, containerListeners, {
|
|
286
314
|
ref: ref,
|
|
287
315
|
"data-testid": testId,
|
|
288
316
|
role: "button",
|
|
289
317
|
tabIndex: 0,
|
|
290
|
-
"aria-label":
|
|
291
|
-
|
|
292
|
-
defaultMessage: 'More information about {fullName}',
|
|
293
|
-
description: 'Label for profile card trigger'
|
|
294
|
-
}, {
|
|
295
|
-
fullName: profilecardProps.fullName
|
|
296
|
-
})
|
|
318
|
+
"aria-label": ariaLabel,
|
|
319
|
+
"aria-labelledby": ariaLabelledBy
|
|
297
320
|
}), children);
|
|
298
321
|
},
|
|
299
322
|
zIndex: _constants.layers.modal(),
|
package/dist/cjs/i18n/en.js
CHANGED
|
@@ -13,6 +13,7 @@ exports.default = void 0;
|
|
|
13
13
|
*/
|
|
14
14
|
//
|
|
15
15
|
var _default = exports.default = {
|
|
16
|
+
'profilecard.user.trigger.aria-label': 'More information about {fullName}',
|
|
16
17
|
'pt.profile-card.closed.account': 'Account deleted',
|
|
17
18
|
'pt.profile-card.closed.account.has.date.a.few.months': 'Their account has been deleted for a few months.',
|
|
18
19
|
'pt.profile-card.closed.account.has.date.last.month': 'Their account was deleted last month.',
|
package/dist/cjs/i18n/en_GB.js
CHANGED
|
@@ -13,6 +13,7 @@ exports.default = void 0;
|
|
|
13
13
|
*/
|
|
14
14
|
//English (United Kingdom)
|
|
15
15
|
var _default = exports.default = {
|
|
16
|
+
'profilecard.user.trigger.aria-label': 'More information about {fullName}',
|
|
16
17
|
'pt.profile-card.closed.account': 'Account deleted',
|
|
17
18
|
'pt.profile-card.closed.account.has.date.a.few.months': 'Their account has been deleted for a few months.',
|
|
18
19
|
'pt.profile-card.closed.account.has.date.last.month': 'Their account was deleted last month.',
|
package/dist/cjs/i18n/en_ZZ.js
CHANGED
|
@@ -13,6 +13,7 @@ exports.default = void 0;
|
|
|
13
13
|
*/
|
|
14
14
|
//
|
|
15
15
|
var _default = exports.default = {
|
|
16
|
+
'profilecard.user.trigger.aria-label': 'More information about {fullName}',
|
|
16
17
|
'pt.profile-card.closed.account': 'Account deleted',
|
|
17
18
|
'pt.profile-card.closed.account.has.date.a.few.months': 'Their account has been deleted for a few months.',
|
|
18
19
|
'pt.profile-card.closed.account.has.date.last.month': 'Their account was deleted last month.',
|
|
@@ -44,7 +44,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
44
44
|
actionSubjectId: actionSubjectId,
|
|
45
45
|
attributes: _objectSpread(_objectSpread({
|
|
46
46
|
packageName: "@atlaskit/profilecard",
|
|
47
|
-
packageVersion: "19.
|
|
47
|
+
packageVersion: "19.9.0"
|
|
48
48
|
}, attributes), {}, {
|
|
49
49
|
firedAt: Math.round((0, _performance.getPageTime)())
|
|
50
50
|
})
|
|
@@ -67,7 +67,7 @@ export const addHeaders = headers => {
|
|
|
67
67
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
68
68
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
69
69
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
70
|
-
headers.append('atl-client-version', "19.
|
|
70
|
+
headers.append('atl-client-version', "19.9.0");
|
|
71
71
|
return headers;
|
|
72
72
|
};
|
|
73
73
|
export async function getTeamFromAGG(url, teamId, siteId) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { FormattedMessage } from 'react-intl-next';
|
|
4
4
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
5
5
|
import Avatar from '@atlaskit/avatar';
|
|
@@ -118,12 +118,14 @@ export const ProfilecardInternal = props => {
|
|
|
118
118
|
fireAnalyticsWithDuration: fireAnalyticsWithDuration
|
|
119
119
|
})), realActions && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ActionsFlexSpacer, null), /*#__PURE__*/React.createElement(Actions, {
|
|
120
120
|
actions: realActions,
|
|
121
|
-
fireAnalyticsWithDuration: fireAnalyticsWithDuration
|
|
121
|
+
fireAnalyticsWithDuration: fireAnalyticsWithDuration,
|
|
122
|
+
isTriggeredUsingKeyboard: props.isTriggeredUsingKeyboard
|
|
122
123
|
})))));
|
|
123
124
|
};
|
|
124
125
|
const Actions = ({
|
|
125
126
|
actions,
|
|
126
|
-
fireAnalyticsWithDuration
|
|
127
|
+
fireAnalyticsWithDuration,
|
|
128
|
+
isTriggeredUsingKeyboard
|
|
127
129
|
}) => {
|
|
128
130
|
const onActionClick = useCallback((action, args, event, index) => {
|
|
129
131
|
fireAnalyticsWithDuration(duration => actionClicked('user', {
|
|
@@ -138,6 +140,12 @@ const Actions = ({
|
|
|
138
140
|
action.callback(event, ...args);
|
|
139
141
|
}
|
|
140
142
|
}, [fireAnalyticsWithDuration]);
|
|
143
|
+
const buttonRef = useRef(null);
|
|
144
|
+
useEffect(() => {
|
|
145
|
+
if (actions.length > 0 && buttonRef.current && isTriggeredUsingKeyboard) {
|
|
146
|
+
buttonRef.current.focus();
|
|
147
|
+
}
|
|
148
|
+
}, [isTriggeredUsingKeyboard, actions.length]);
|
|
141
149
|
if (!actions || actions.length === 0) {
|
|
142
150
|
return null;
|
|
143
151
|
}
|
|
@@ -154,7 +162,8 @@ const Actions = ({
|
|
|
154
162
|
appearance: "default",
|
|
155
163
|
key: action.id || index,
|
|
156
164
|
onClick: (event, ...args) => onActionClick(action, args, event, index),
|
|
157
|
-
href: action.link
|
|
165
|
+
href: action.link,
|
|
166
|
+
ref: index === 0 ? buttonRef : undefined
|
|
158
167
|
}, action.label, isKudos && /*#__PURE__*/React.createElement(AnimationWrapper, null, /*#__PURE__*/React.createElement(KudosBlobAnimation, null))));
|
|
159
168
|
if (isKudos) {
|
|
160
169
|
return /*#__PURE__*/React.createElement(AnimatedKudosButton, {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React, { Suspense, useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
|
-
import { useIntl } from 'react-intl-next';
|
|
2
|
+
import React, { Suspense, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
3
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
5
4
|
import { GiveKudosLauncherLazy, KudosType } from '@atlaskit/give-kudos';
|
|
6
5
|
import Popup from '@atlaskit/popup';
|
|
@@ -21,14 +20,13 @@ export default function ProfilecardTriggerNext({
|
|
|
21
20
|
children,
|
|
22
21
|
testId,
|
|
23
22
|
addFlag,
|
|
24
|
-
onReportingLinesClick
|
|
23
|
+
onReportingLinesClick,
|
|
24
|
+
ariaLabel,
|
|
25
|
+
ariaLabelledBy
|
|
25
26
|
}) {
|
|
26
27
|
const {
|
|
27
28
|
createAnalyticsEvent
|
|
28
29
|
} = useAnalyticsEvents();
|
|
29
|
-
const {
|
|
30
|
-
formatMessage
|
|
31
|
-
} = useIntl();
|
|
32
30
|
const [isMounted, setIsMounted] = useState(false);
|
|
33
31
|
const showDelay = trigger === 'click' ? 0 : DELAY_MS_SHOW;
|
|
34
32
|
const hideDelay = trigger === 'click' ? 0 : DELAY_MS_HIDE;
|
|
@@ -43,6 +41,8 @@ export default function ProfilecardTriggerNext({
|
|
|
43
41
|
const [shouldShowGiveKudos, setShouldShowGiveKudos] = useState(false);
|
|
44
42
|
const [teamCentralBaseUrl, setTeamCentralBaseUrl] = useState(undefined);
|
|
45
43
|
const [kudosDrawerOpen, setKudosDrawerOpen] = useState(false);
|
|
44
|
+
const [isTriggeredUsingKeyboard, setTriggeredUsingKeyboard] = useState(false);
|
|
45
|
+
const triggerRef = useRef(null);
|
|
46
46
|
useEffect(() => {
|
|
47
47
|
setIsMounted(true);
|
|
48
48
|
return () => {
|
|
@@ -72,10 +72,23 @@ export default function ProfilecardTriggerNext({
|
|
|
72
72
|
const hideProfilecard = useCallback(() => {
|
|
73
73
|
clearTimeout(showTimer);
|
|
74
74
|
clearTimeout(hideTimer);
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
if (!isTriggeredUsingKeyboard) {
|
|
76
|
+
setHideTimer(window.setTimeout(() => {
|
|
77
|
+
setVisible(false);
|
|
78
|
+
}, hideDelay));
|
|
79
|
+
}
|
|
80
|
+
setTriggeredUsingKeyboard(false);
|
|
81
|
+
}, [hideDelay, hideTimer, showTimer, isTriggeredUsingKeyboard]);
|
|
82
|
+
const handleKeyboardClose = useCallback(event => {
|
|
83
|
+
if (event.key !== 'Escape') {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (triggerRef.current) {
|
|
87
|
+
triggerRef.current.focus();
|
|
88
|
+
}
|
|
89
|
+
setTriggeredUsingKeyboard(false);
|
|
90
|
+
setVisible(false);
|
|
91
|
+
}, [setTriggeredUsingKeyboard, setVisible]);
|
|
79
92
|
const handleClientSuccess = useCallback((profileData, reportingLinesData, shouldShowGiveKudos) => {
|
|
80
93
|
if (!isMounted) {
|
|
81
94
|
return;
|
|
@@ -141,6 +154,7 @@ export default function ProfilecardTriggerNext({
|
|
|
141
154
|
const onKeyPress = useCallback(event => {
|
|
142
155
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
143
156
|
event.preventDefault();
|
|
157
|
+
setTriggeredUsingKeyboard(true);
|
|
144
158
|
showProfilecard();
|
|
145
159
|
if (!visible) {
|
|
146
160
|
fireAnalytics(cardTriggered('user', 'click'));
|
|
@@ -185,11 +199,15 @@ export default function ProfilecardTriggerNext({
|
|
|
185
199
|
isKudosEnabled: shouldShowGiveKudos,
|
|
186
200
|
teamCentralBaseUrl: teamCentralBaseUrl,
|
|
187
201
|
cloudId: cloudId,
|
|
188
|
-
openKudosDrawer: openKudosDrawer
|
|
202
|
+
openKudosDrawer: openKudosDrawer,
|
|
203
|
+
isTriggeredUsingKeyboard: isTriggeredUsingKeyboard
|
|
189
204
|
};
|
|
190
205
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Popup, {
|
|
191
206
|
isOpen: !!visible,
|
|
192
|
-
onClose:
|
|
207
|
+
onClose: event => {
|
|
208
|
+
hideProfilecard();
|
|
209
|
+
handleKeyboardClose(event);
|
|
210
|
+
},
|
|
193
211
|
placement: position,
|
|
194
212
|
content: () => showLoading ? /*#__PURE__*/React.createElement(LoadingView, {
|
|
195
213
|
fireAnalytics: fireAnalytics
|
|
@@ -203,21 +221,22 @@ export default function ProfilecardTriggerNext({
|
|
|
203
221
|
})))),
|
|
204
222
|
trigger: triggerProps => {
|
|
205
223
|
const {
|
|
206
|
-
ref,
|
|
224
|
+
ref: callbackRef,
|
|
207
225
|
...innerProps
|
|
208
226
|
} = triggerProps;
|
|
227
|
+
const ref = element => {
|
|
228
|
+
triggerRef.current = element;
|
|
229
|
+
if (typeof callbackRef === 'function') {
|
|
230
|
+
callbackRef(element);
|
|
231
|
+
}
|
|
232
|
+
};
|
|
209
233
|
return /*#__PURE__*/React.createElement("span", _extends({}, innerProps, containerListeners, {
|
|
210
234
|
ref: ref,
|
|
211
235
|
"data-testid": testId,
|
|
212
236
|
role: "button",
|
|
213
237
|
tabIndex: 0,
|
|
214
|
-
"aria-label":
|
|
215
|
-
|
|
216
|
-
defaultMessage: 'More information about {fullName}',
|
|
217
|
-
description: 'Label for profile card trigger'
|
|
218
|
-
}, {
|
|
219
|
-
fullName: profilecardProps.fullName
|
|
220
|
-
})
|
|
238
|
+
"aria-label": ariaLabel,
|
|
239
|
+
"aria-labelledby": ariaLabelledBy
|
|
221
240
|
}), children);
|
|
222
241
|
},
|
|
223
242
|
zIndex: layers.modal(),
|
package/dist/es2019/i18n/en.js
CHANGED
|
@@ -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.',
|
|
@@ -31,7 +31,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
|
|
|
31
31
|
actionSubjectId,
|
|
32
32
|
attributes: {
|
|
33
33
|
packageName: "@atlaskit/profilecard",
|
|
34
|
-
packageVersion: "19.
|
|
34
|
+
packageVersion: "19.9.0",
|
|
35
35
|
...attributes,
|
|
36
36
|
firedAt: Math.round(getPageTime())
|
|
37
37
|
}
|
|
@@ -48,7 +48,7 @@ export var addHeaders = function addHeaders(headers) {
|
|
|
48
48
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
49
49
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
50
50
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
51
|
-
headers.append('atl-client-version', "19.
|
|
51
|
+
headers.append('atl-client-version', "19.9.0");
|
|
52
52
|
return headers;
|
|
53
53
|
};
|
|
54
54
|
export function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
-
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
4
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
5
5
|
import { FormattedMessage } from 'react-intl-next';
|
|
6
6
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
7
7
|
import Avatar from '@atlaskit/avatar';
|
|
@@ -121,12 +121,14 @@ export var ProfilecardInternal = function ProfilecardInternal(props) {
|
|
|
121
121
|
fireAnalyticsWithDuration: fireAnalyticsWithDuration
|
|
122
122
|
})), realActions && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ActionsFlexSpacer, null), /*#__PURE__*/React.createElement(Actions, {
|
|
123
123
|
actions: realActions,
|
|
124
|
-
fireAnalyticsWithDuration: fireAnalyticsWithDuration
|
|
124
|
+
fireAnalyticsWithDuration: fireAnalyticsWithDuration,
|
|
125
|
+
isTriggeredUsingKeyboard: props.isTriggeredUsingKeyboard
|
|
125
126
|
})))));
|
|
126
127
|
};
|
|
127
128
|
var Actions = function Actions(_ref) {
|
|
128
129
|
var actions = _ref.actions,
|
|
129
|
-
fireAnalyticsWithDuration = _ref.fireAnalyticsWithDuration
|
|
130
|
+
fireAnalyticsWithDuration = _ref.fireAnalyticsWithDuration,
|
|
131
|
+
isTriggeredUsingKeyboard = _ref.isTriggeredUsingKeyboard;
|
|
130
132
|
var onActionClick = useCallback(function (action, args, event, index) {
|
|
131
133
|
fireAnalyticsWithDuration(function (duration) {
|
|
132
134
|
return actionClicked('user', {
|
|
@@ -142,6 +144,12 @@ var Actions = function Actions(_ref) {
|
|
|
142
144
|
action.callback.apply(action, [event].concat(_toConsumableArray(args)));
|
|
143
145
|
}
|
|
144
146
|
}, [fireAnalyticsWithDuration]);
|
|
147
|
+
var buttonRef = useRef(null);
|
|
148
|
+
useEffect(function () {
|
|
149
|
+
if (actions.length > 0 && buttonRef.current && isTriggeredUsingKeyboard) {
|
|
150
|
+
buttonRef.current.focus();
|
|
151
|
+
}
|
|
152
|
+
}, [isTriggeredUsingKeyboard, actions.length]);
|
|
145
153
|
if (!actions || actions.length === 0) {
|
|
146
154
|
return null;
|
|
147
155
|
}
|
|
@@ -163,7 +171,8 @@ var Actions = function Actions(_ref) {
|
|
|
163
171
|
}
|
|
164
172
|
return onActionClick(action, args, event, index);
|
|
165
173
|
},
|
|
166
|
-
href: action.link
|
|
174
|
+
href: action.link,
|
|
175
|
+
ref: index === 0 ? buttonRef : undefined
|
|
167
176
|
}, action.label, isKudos && /*#__PURE__*/React.createElement(AnimationWrapper, null, /*#__PURE__*/React.createElement(KudosBlobAnimation, null))));
|
|
168
177
|
if (isKudos) {
|
|
169
178
|
return /*#__PURE__*/React.createElement(AnimatedKudosButton, {
|
|
@@ -8,8 +8,7 @@ var _excluded = ["ref"];
|
|
|
8
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
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
10
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
11
|
-
import React, { Suspense, useCallback, useEffect, useMemo, useState } from 'react';
|
|
12
|
-
import { useIntl } from 'react-intl-next';
|
|
11
|
+
import React, { Suspense, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
13
12
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
14
13
|
import { GiveKudosLauncherLazy, KudosType } from '@atlaskit/give-kudos';
|
|
15
14
|
import Popup from '@atlaskit/popup';
|
|
@@ -33,11 +32,11 @@ export default function ProfilecardTriggerNext(_ref) {
|
|
|
33
32
|
children = _ref.children,
|
|
34
33
|
testId = _ref.testId,
|
|
35
34
|
addFlag = _ref.addFlag,
|
|
36
|
-
onReportingLinesClick = _ref.onReportingLinesClick
|
|
35
|
+
onReportingLinesClick = _ref.onReportingLinesClick,
|
|
36
|
+
ariaLabel = _ref.ariaLabel,
|
|
37
|
+
ariaLabelledBy = _ref.ariaLabelledBy;
|
|
37
38
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
38
39
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
39
|
-
var _useIntl = useIntl(),
|
|
40
|
-
formatMessage = _useIntl.formatMessage;
|
|
41
40
|
var _useState = useState(false),
|
|
42
41
|
_useState2 = _slicedToArray(_useState, 2),
|
|
43
42
|
isMounted = _useState2[0],
|
|
@@ -88,6 +87,11 @@ export default function ProfilecardTriggerNext(_ref) {
|
|
|
88
87
|
_useState24 = _slicedToArray(_useState23, 2),
|
|
89
88
|
kudosDrawerOpen = _useState24[0],
|
|
90
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);
|
|
91
95
|
useEffect(function () {
|
|
92
96
|
setIsMounted(true);
|
|
93
97
|
return function () {
|
|
@@ -117,10 +121,23 @@ export default function ProfilecardTriggerNext(_ref) {
|
|
|
117
121
|
var hideProfilecard = useCallback(function () {
|
|
118
122
|
clearTimeout(showTimer);
|
|
119
123
|
clearTimeout(hideTimer);
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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]);
|
|
124
141
|
var handleClientSuccess = useCallback(function (profileData, reportingLinesData, shouldShowGiveKudos) {
|
|
125
142
|
if (!isMounted) {
|
|
126
143
|
return;
|
|
@@ -203,6 +220,7 @@ export default function ProfilecardTriggerNext(_ref) {
|
|
|
203
220
|
var onKeyPress = useCallback(function (event) {
|
|
204
221
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
205
222
|
event.preventDefault();
|
|
223
|
+
setTriggeredUsingKeyboard(true);
|
|
206
224
|
showProfilecard();
|
|
207
225
|
if (!visible) {
|
|
208
226
|
fireAnalytics(cardTriggered('user', 'click'));
|
|
@@ -251,11 +269,15 @@ export default function ProfilecardTriggerNext(_ref) {
|
|
|
251
269
|
isKudosEnabled: shouldShowGiveKudos,
|
|
252
270
|
teamCentralBaseUrl: teamCentralBaseUrl,
|
|
253
271
|
cloudId: cloudId,
|
|
254
|
-
openKudosDrawer: openKudosDrawer
|
|
272
|
+
openKudosDrawer: openKudosDrawer,
|
|
273
|
+
isTriggeredUsingKeyboard: isTriggeredUsingKeyboard
|
|
255
274
|
});
|
|
256
275
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Popup, {
|
|
257
276
|
isOpen: !!visible,
|
|
258
|
-
onClose:
|
|
277
|
+
onClose: function onClose(event) {
|
|
278
|
+
hideProfilecard();
|
|
279
|
+
handleKeyboardClose(event);
|
|
280
|
+
},
|
|
259
281
|
placement: position,
|
|
260
282
|
content: function content() {
|
|
261
283
|
return showLoading ? /*#__PURE__*/React.createElement(LoadingView, {
|
|
@@ -270,20 +292,21 @@ export default function ProfilecardTriggerNext(_ref) {
|
|
|
270
292
|
}))));
|
|
271
293
|
},
|
|
272
294
|
trigger: function trigger(triggerProps) {
|
|
273
|
-
var
|
|
295
|
+
var callbackRef = triggerProps.ref,
|
|
274
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
|
+
};
|
|
275
303
|
return /*#__PURE__*/React.createElement("span", _extends({}, innerProps, containerListeners, {
|
|
276
304
|
ref: ref,
|
|
277
305
|
"data-testid": testId,
|
|
278
306
|
role: "button",
|
|
279
307
|
tabIndex: 0,
|
|
280
|
-
"aria-label":
|
|
281
|
-
|
|
282
|
-
defaultMessage: 'More information about {fullName}',
|
|
283
|
-
description: 'Label for profile card trigger'
|
|
284
|
-
}, {
|
|
285
|
-
fullName: profilecardProps.fullName
|
|
286
|
-
})
|
|
308
|
+
"aria-label": ariaLabel,
|
|
309
|
+
"aria-labelledby": ariaLabelledBy
|
|
287
310
|
}), children);
|
|
288
311
|
},
|
|
289
312
|
zIndex: layers.modal(),
|
package/dist/esm/i18n/en.js
CHANGED
|
@@ -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.',
|
package/dist/esm/i18n/en_GB.js
CHANGED
|
@@ -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.',
|
package/dist/esm/i18n/en_ZZ.js
CHANGED
|
@@ -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.
|
|
41
|
+
packageVersion: "19.9.0"
|
|
42
42
|
}, attributes), {}, {
|
|
43
43
|
firedAt: Math.round(getPageTime())
|
|
44
44
|
})
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ProfileCardTriggerProps } from '../../types';
|
|
3
|
-
export default function ProfilecardTriggerNext({ trigger, userId, cloudId, resourceClient, actions, position, children, testId, addFlag, onReportingLinesClick, }: ProfileCardTriggerProps): JSX.Element;
|
|
3
|
+
export default function ProfilecardTriggerNext({ trigger, userId, cloudId, resourceClient, actions, position, children, testId, addFlag, onReportingLinesClick, ariaLabel, ariaLabelledBy, }: ProfileCardTriggerProps): JSX.Element;
|
package/dist/types/i18n/en.d.ts
CHANGED
|
@@ -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;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -111,6 +111,8 @@ export interface ProfileCardTriggerProps {
|
|
|
111
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,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ProfileCardTriggerProps } from '../../types';
|
|
3
|
-
export default function ProfilecardTriggerNext({ trigger, userId, cloudId, resourceClient, actions, position, children, testId, addFlag, onReportingLinesClick, }: ProfileCardTriggerProps): JSX.Element;
|
|
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;
|
|
@@ -111,6 +111,8 @@ export interface ProfileCardTriggerProps {
|
|
|
111
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.
|
|
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,11 +52,11 @@
|
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@atlaskit/analytics-next": "^9.
|
|
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.
|
|
59
|
-
"@atlaskit/dropdown-menu": "^12.
|
|
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",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@atlaskit/lozenge": "^11.6.0",
|
|
65
65
|
"@atlaskit/menu": "^2.1.0",
|
|
66
66
|
"@atlaskit/platform-feature-flags": "^0.2.4",
|
|
67
|
-
"@atlaskit/popup": "^1.
|
|
67
|
+
"@atlaskit/popup": "^1.12.0",
|
|
68
68
|
"@atlaskit/spinner": "^16.0.0",
|
|
69
69
|
"@atlaskit/theme": "^12.6.0",
|
|
70
70
|
"@atlaskit/tokens": "^1.35.0",
|