@atlaskit/profilecard 24.38.0 → 24.39.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 CHANGED
@@ -1,5 +1,16 @@
1
1
  # @atlaskit/profilecard
2
2
 
3
+ ## 24.39.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`ab3866dd7f659`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ab3866dd7f659) -
8
+ Focus on the heading in a profile card when it's rendered to keep the user in the focus trap
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
3
14
  ## 24.38.0
4
15
 
5
16
  ### Minor Changes
@@ -107,6 +107,9 @@
107
107
  {
108
108
  "path": "../../../design-system/theme/afm-cc/tsconfig.json"
109
109
  },
110
+ {
111
+ "path": "../../../editor/tmp-editor-statsig/afm-cc/tsconfig.json"
112
+ },
110
113
  {
111
114
  "path": "../../../design-system/tokens/afm-cc/tsconfig.json"
112
115
  },
@@ -107,6 +107,9 @@
107
107
  {
108
108
  "path": "../../../design-system/theme/afm-jira/tsconfig.json"
109
109
  },
110
+ {
111
+ "path": "../../../editor/tmp-editor-statsig/afm-jira/tsconfig.json"
112
+ },
110
113
  {
111
114
  "path": "../../../design-system/tokens/afm-jira/tsconfig.json"
112
115
  },
@@ -107,6 +107,9 @@
107
107
  {
108
108
  "path": "../../../design-system/theme/afm-products/tsconfig.json"
109
109
  },
110
+ {
111
+ "path": "../../../editor/tmp-editor-statsig/afm-products/tsconfig.json"
112
+ },
110
113
  {
111
114
  "path": "../../../design-system/tokens/afm-products/tsconfig.json"
112
115
  },
@@ -11,7 +11,7 @@ var _graphqlUtils = require("./graphqlUtils");
11
11
  var ORG_ID_FROM_CLOUD_ID_QUERY = "query OrgIdFromCloudId($cloudId: ID!) {\n\ttenantContexts(cloudIds: [$cloudId]) {\n\t\torgId\n\t}\n}";
12
12
  var addHeaders = function addHeaders(headers) {
13
13
  headers.append('atl-client-name', "@atlaskit/profilecard");
14
- headers.append('atl-client-version', "24.37.3");
14
+ headers.append('atl-client-version', "24.38.0");
15
15
  return headers;
16
16
  };
17
17
  function getOrgIdForCloudIdFromAGG(_x, _x2) {
@@ -66,7 +66,7 @@ var addHeaders = exports.addHeaders = function addHeaders(headers) {
66
66
  headers.append('X-ExperimentalApi', 'teams-beta');
67
67
  headers.append('X-ExperimentalApi', 'team-members-beta');
68
68
  headers.append('atl-client-name', "@atlaskit/profilecard");
69
- headers.append('atl-client-version', "24.37.3");
69
+ headers.append('atl-client-version', "24.38.0");
70
70
  return headers;
71
71
  };
72
72
  function getTeamFromAGG(_x, _x2, _x3) {
@@ -170,6 +170,7 @@ var ProfilecardInternal = exports.ProfilecardInternal = function ProfilecardInte
170
170
  actions: realActions,
171
171
  fireAnalyticsWithDuration: fireAnalyticsWithDuration,
172
172
  isTriggeredUsingKeyboard: props.isTriggeredUsingKeyboard,
173
+ isRenderedInPortal: props.isRenderedInPortal,
173
174
  fireAnalyticsWithDurationNext: fireAnalyticsWithDurationNext
174
175
  }))))));
175
176
  };
@@ -178,6 +179,7 @@ var Actions = function Actions(_ref) {
178
179
  fireAnalyticsWithDuration = _ref.fireAnalyticsWithDuration,
179
180
  fireAnalyticsWithDurationNext = _ref.fireAnalyticsWithDurationNext,
180
181
  isTriggeredUsingKeyboard = _ref.isTriggeredUsingKeyboard,
182
+ isRenderedInPortal = _ref.isRenderedInPortal,
181
183
  fullName = _ref.fullName;
182
184
  var onActionClick = (0, _react.useCallback)(function (action, args, event, index) {
183
185
  if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
@@ -228,7 +230,7 @@ var Actions = function Actions(_ref) {
228
230
  },
229
231
  href: action.link || '',
230
232
  target: action.target,
231
- autoFocus: index === 0 && isTriggeredUsingKeyboard,
233
+ autoFocus: index === 0 && isTriggeredUsingKeyboard && !isRenderedInPortal,
232
234
  id: "action-button-".concat(action.id),
233
235
  "aria-labelledby": (0, _platformFeatureFlags.fg)('enable_userprofilecard_arialabelfix') ? "action-button-".concat(action.id, " profilecard-name-label") : ''
234
236
  }, action.label, isKudos && /*#__PURE__*/_react.default.createElement(_Card.AnimationWrapper, null, /*#__PURE__*/_react.default.createElement(_Card.KudosBlobAnimation, null)));
@@ -17,6 +17,7 @@ var _reactIntlNext = require("react-intl-next");
17
17
  var _lozenge = _interopRequireDefault(require("@atlaskit/lozenge"));
18
18
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
19
19
  var _compiled = require("@atlaskit/primitives/compiled");
20
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
20
21
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
21
22
  var _relativeDate = _interopRequireDefault(require("../../internal/relative-date"));
22
23
  var _messages = _interopRequireDefault(require("../../messages"));
@@ -35,7 +36,7 @@ var styles = {
35
36
  disabledAccount: "_syazi7uo",
36
37
  activeAccount: "_syaz15cr"
37
38
  };
38
- var renderName = function renderName(nickname, fullName, meta, nameRef) {
39
+ var renderName = function renderName(nickname, fullName, meta, nameRef, isRenderedInPortal, isTriggeredUsingKeyboard) {
39
40
  if (!fullName && !nickname) {
40
41
  return null;
41
42
  }
@@ -58,12 +59,15 @@ var renderName = function renderName(nickname, fullName, meta, nameRef) {
58
59
  as: "h2",
59
60
  xcss: (0, _react2.cx)(styles.fullNameLabel, styles.activeAccount, meta ? (0, _platformFeatureFlags.fg)('enable_absolute_positioning_profile_card') ? styles.metaLabelWithHighSpecificity : styles.metaLabel : (0, _platformFeatureFlags.fg)('enable_absolute_positioning_profile_card') ? styles.noMetaLabelWithHighSpecificity : styles.noMetaLabel),
60
61
  testId: "profilecard-name",
61
- id: "profilecard-name-label"
62
+ id: "profilecard-name-label",
63
+ tabIndex: isTriggeredUsingKeyboard && isRenderedInPortal && (0, _expValEquals.expValEquals)('editor_a11y_7152_profile_card_tab_order', 'isEnabled', true) ? -1 : undefined
62
64
  }, displayName)) : /*#__PURE__*/_react.default.createElement(_compiled.Box, {
65
+ ref: nameRef,
63
66
  as: "h2",
64
67
  xcss: (0, _react2.cx)(styles.fullNameLabel, styles.activeAccount, meta ? (0, _platformFeatureFlags.fg)('enable_absolute_positioning_profile_card') ? styles.metaLabelWithHighSpecificity : styles.metaLabel : (0, _platformFeatureFlags.fg)('enable_absolute_positioning_profile_card') ? styles.noMetaLabelWithHighSpecificity : styles.noMetaLabel),
65
68
  testId: "profilecard-name",
66
- id: "profilecard-name-label"
69
+ id: "profilecard-name-label",
70
+ tabIndex: isTriggeredUsingKeyboard && isRenderedInPortal && (0, _expValEquals.expValEquals)('editor_a11y_7152_profile_card_tab_order', 'isEnabled', true) ? -1 : undefined
67
71
  }, displayName);
68
72
  };
69
73
  var disabledAccountDesc = function disabledAccountDesc(statusModifiedDate, disabledAccountMessage) {
@@ -129,8 +133,21 @@ var DisabledProfileCardDetails = function DisabledProfileCardDetails(props) {
129
133
  };
130
134
  var ProfileCardDetails = exports.ProfileCardDetails = function ProfileCardDetails(props) {
131
135
  var meta = props.meta,
132
- status = props.status;
136
+ status = props.status,
137
+ isRenderedInPortal = props.isRenderedInPortal,
138
+ isTriggeredUsingKeyboard = props.isTriggeredUsingKeyboard;
133
139
  var nameRef = (0, _react.useRef)(null);
140
+ _react.default.useEffect(function () {
141
+ if (nameRef !== null && nameRef !== void 0 && nameRef.current && isRenderedInPortal && isTriggeredUsingKeyboard && (0, _expValEquals.expValEquals)('editor_a11y_7152_profile_card_tab_order', 'isEnabled', true)) {
142
+ var rafId = requestAnimationFrame(function () {
143
+ var _nameRef$current;
144
+ (_nameRef$current = nameRef.current) === null || _nameRef$current === void 0 || _nameRef$current.focus();
145
+ });
146
+ return function () {
147
+ cancelAnimationFrame(rafId);
148
+ };
149
+ }
150
+ }, [isRenderedInPortal, isTriggeredUsingKeyboard]);
134
151
  if (props.isServiceAccount) {
135
152
  return /*#__PURE__*/_react.default.createElement(ServiceAccountProfileCardDetails, props);
136
153
  }
@@ -145,7 +162,7 @@ var ProfileCardDetails = exports.ProfileCardDetails = function ProfileCardDetail
145
162
  var lozenges = /*#__PURE__*/_react.default.createElement(CustomLozenges, {
146
163
  lozenges: props.customLozenges
147
164
  });
148
- return /*#__PURE__*/_react.default.createElement(_Card.DetailsGroup, null, renderName(props.nickname, props.fullName, meta, nameRef), meta && /*#__PURE__*/_react.default.createElement(_Card.JobTitleLabel, null, meta), meta && props.customLozenges && props.customLozenges.length > 0 ? /*#__PURE__*/_react.default.createElement(_compiled.Box, {
165
+ return /*#__PURE__*/_react.default.createElement(_Card.DetailsGroup, null, renderName(props.nickname, props.fullName, meta, nameRef, isRenderedInPortal, isTriggeredUsingKeyboard), meta && /*#__PURE__*/_react.default.createElement(_Card.JobTitleLabel, null, meta), meta && props.customLozenges && props.customLozenges.length > 0 ? /*#__PURE__*/_react.default.createElement(_compiled.Box, {
149
166
  paddingBlockStart: "space.150"
150
167
  }, lozenges) : lozenges, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
151
168
  xcss: styles.detailedListWrapperNext
@@ -20,6 +20,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
20
20
  var _popup = _interopRequireDefault(require("@atlaskit/popup"));
21
21
  var _teamsAppInternalAnalytics = require("@atlaskit/teams-app-internal-analytics");
22
22
  var _constants = require("@atlaskit/theme/constants");
23
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
23
24
  var _filterActions = _interopRequireDefault(require("../../internal/filterActions"));
24
25
  var _getLabelMessage = _interopRequireDefault(require("../../internal/getLabelMessage"));
25
26
  var _UserTrigger = require("../../styled/UserTrigger");
@@ -45,6 +46,7 @@ function ProfileCardContent(_ref) {
45
46
  hasError = _ref.hasError,
46
47
  errorType = _ref.errorType,
47
48
  agentActions = _ref.agentActions,
49
+ isRenderedInPortal = _ref.isRenderedInPortal,
48
50
  addFlag = _ref.addFlag,
49
51
  hideAgentMoreActions = _ref.hideAgentMoreActions,
50
52
  hideAiDisclaimer = _ref.hideAiDisclaimer;
@@ -64,6 +66,7 @@ function ProfileCardContent(_ref) {
64
66
  return /*#__PURE__*/_react.default.createElement(_react.Suspense, {
65
67
  fallback: null
66
68
  }, /*#__PURE__*/_react.default.createElement(_lazyProfileCard.ProfileCardLazy, (0, _extends2.default)({}, profilecardProps, {
69
+ isRenderedInPortal: isRenderedInPortal,
67
70
  actions: profileCardAction,
68
71
  hasError: hasError,
69
72
  errorType: errorType,
@@ -100,6 +103,7 @@ function ProfilecardTriggerNext(_ref2) {
100
103
  _ref2$ariaHideProfile = _ref2.ariaHideProfileTrigger,
101
104
  ariaHideProfileTrigger = _ref2$ariaHideProfile === void 0 ? false : _ref2$ariaHideProfile,
102
105
  propsIsVisible = _ref2.isVisible,
106
+ isRenderedInPortal = _ref2.isRenderedInPortal,
103
107
  ssrPlaceholderId = _ref2.ssrPlaceholderId,
104
108
  customShowDelay = _ref2.showDelay,
105
109
  customHideDelay = _ref2.hideDelay;
@@ -395,7 +399,8 @@ function ProfilecardTriggerNext(_ref2) {
395
399
  agentActions: agentActions,
396
400
  addFlag: addFlag,
397
401
  hideAgentMoreActions: hideAgentMoreActions,
398
- hideAiDisclaimer: hideAiDisclaimer
402
+ hideAiDisclaimer: hideAiDisclaimer,
403
+ isRenderedInPortal: isRenderedInPortal
399
404
  }));
400
405
  },
401
406
  trigger: function trigger(triggerProps) {
@@ -426,7 +431,7 @@ function ProfilecardTriggerNext(_ref2) {
426
431
  },
427
432
  zIndex: _constants.layers.modal(),
428
433
  shouldUseCaptureOnOutsideClick: true,
429
- autoFocus: autoFocus !== null && autoFocus !== void 0 ? autoFocus : trigger === 'click'
434
+ autoFocus: (0, _expValEquals.expValEquals)('editor_a11y_7152_profile_card_tab_order', 'isEnabled', true) ? isRenderedInPortal && isTriggeredUsingKeyboard ? false : autoFocus !== null && autoFocus !== void 0 ? autoFocus : trigger === 'click' : autoFocus !== null && autoFocus !== void 0 ? autoFocus : trigger === 'click'
430
435
  // This feature gate is currently enabled only for Jira_Web to avoid UI issues in Confluence_Web.
431
436
  ,
432
437
  shouldRenderToParent: (0, _platformFeatureFlags.fg)('enable_appropriate_reading_order_in_profile_card'),
@@ -13,7 +13,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
13
13
  var ANALYTICS_CHANNEL = 'peopleTeams';
14
14
  var PACKAGE_META_DATA = exports.PACKAGE_META_DATA = {
15
15
  packageName: "@atlaskit/profilecard",
16
- packageVersion: "24.37.3"
16
+ packageVersion: "24.38.0"
17
17
  };
18
18
  var runItLater = function runItLater(cb) {
19
19
  var requestIdleCallback = window.requestIdleCallback;
@@ -58,7 +58,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
58
58
  actionSubjectId: actionSubjectId,
59
59
  attributes: _objectSpread(_objectSpread({
60
60
  packageName: "@atlaskit/profilecard",
61
- packageVersion: "24.37.3"
61
+ packageVersion: "24.38.0"
62
62
  }, attributes), {}, {
63
63
  firedAt: Math.round((0, _performance.getPageTime)())
64
64
  })
@@ -6,7 +6,7 @@ const ORG_ID_FROM_CLOUD_ID_QUERY = `query OrgIdFromCloudId($cloudId: ID!) {
6
6
  }`;
7
7
  const addHeaders = headers => {
8
8
  headers.append('atl-client-name', "@atlaskit/profilecard");
9
- headers.append('atl-client-version', "24.37.3");
9
+ headers.append('atl-client-version', "24.38.0");
10
10
  return headers;
11
11
  };
12
12
  export async function getOrgIdForCloudIdFromAGG(url, cloudId) {
@@ -78,7 +78,7 @@ export const addHeaders = headers => {
78
78
  headers.append('X-ExperimentalApi', 'teams-beta');
79
79
  headers.append('X-ExperimentalApi', 'team-members-beta');
80
80
  headers.append('atl-client-name', "@atlaskit/profilecard");
81
- headers.append('atl-client-version', "24.37.3");
81
+ headers.append('atl-client-version', "24.38.0");
82
82
  return headers;
83
83
  };
84
84
  export async function getTeamFromAGG(url, teamId, siteId) {
@@ -155,6 +155,7 @@ export const ProfilecardInternal = props => {
155
155
  actions: realActions,
156
156
  fireAnalyticsWithDuration: fireAnalyticsWithDuration,
157
157
  isTriggeredUsingKeyboard: props.isTriggeredUsingKeyboard,
158
+ isRenderedInPortal: props.isRenderedInPortal,
158
159
  fireAnalyticsWithDurationNext: fireAnalyticsWithDurationNext
159
160
  }))))));
160
161
  };
@@ -163,6 +164,7 @@ const Actions = ({
163
164
  fireAnalyticsWithDuration,
164
165
  fireAnalyticsWithDurationNext,
165
166
  isTriggeredUsingKeyboard,
167
+ isRenderedInPortal,
166
168
  fullName
167
169
  }) => {
168
170
  const onActionClick = useCallback((action, args, event, index) => {
@@ -206,7 +208,7 @@ const Actions = ({
206
208
  onClick: (event, ...args) => onActionClick(action, args, event, index),
207
209
  href: action.link || '',
208
210
  target: action.target,
209
- autoFocus: index === 0 && isTriggeredUsingKeyboard,
211
+ autoFocus: index === 0 && isTriggeredUsingKeyboard && !isRenderedInPortal,
210
212
  id: `action-button-${action.id}`,
211
213
  "aria-labelledby": fg('enable_userprofilecard_arialabelfix') ? `action-button-${action.id} profilecard-name-label` : ''
212
214
  }, action.label, isKudos && /*#__PURE__*/React.createElement(AnimationWrapper, null, /*#__PURE__*/React.createElement(KudosBlobAnimation, null)));
@@ -8,6 +8,7 @@ import { FormattedMessage } from 'react-intl-next';
8
8
  import Lozenge from '@atlaskit/lozenge';
9
9
  import { fg } from '@atlaskit/platform-feature-flags';
10
10
  import { Box, Text } from '@atlaskit/primitives/compiled';
11
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
11
12
  import Tooltip from '@atlaskit/tooltip';
12
13
  import relativeDate from '../../internal/relative-date';
13
14
  import messages from '../../messages';
@@ -24,7 +25,7 @@ const styles = {
24
25
  disabledAccount: "_syazi7uo",
25
26
  activeAccount: "_syaz15cr"
26
27
  };
27
- const renderName = (nickname, fullName, meta, nameRef) => {
28
+ const renderName = (nickname, fullName, meta, nameRef, isRenderedInPortal, isTriggeredUsingKeyboard) => {
28
29
  if (!fullName && !nickname) {
29
30
  return null;
30
31
  }
@@ -47,12 +48,15 @@ const renderName = (nickname, fullName, meta, nameRef) => {
47
48
  as: "h2",
48
49
  xcss: cx(styles.fullNameLabel, styles.activeAccount, meta ? fg('enable_absolute_positioning_profile_card') ? styles.metaLabelWithHighSpecificity : styles.metaLabel : fg('enable_absolute_positioning_profile_card') ? styles.noMetaLabelWithHighSpecificity : styles.noMetaLabel),
49
50
  testId: "profilecard-name",
50
- id: "profilecard-name-label"
51
+ id: "profilecard-name-label",
52
+ tabIndex: isTriggeredUsingKeyboard && isRenderedInPortal && expValEquals('editor_a11y_7152_profile_card_tab_order', 'isEnabled', true) ? -1 : undefined
51
53
  }, displayName)) : /*#__PURE__*/React.createElement(Box, {
54
+ ref: nameRef,
52
55
  as: "h2",
53
56
  xcss: cx(styles.fullNameLabel, styles.activeAccount, meta ? fg('enable_absolute_positioning_profile_card') ? styles.metaLabelWithHighSpecificity : styles.metaLabel : fg('enable_absolute_positioning_profile_card') ? styles.noMetaLabelWithHighSpecificity : styles.noMetaLabel),
54
57
  testId: "profilecard-name",
55
- id: "profilecard-name-label"
58
+ id: "profilecard-name-label",
59
+ tabIndex: isTriggeredUsingKeyboard && isRenderedInPortal && expValEquals('editor_a11y_7152_profile_card_tab_order', 'isEnabled', true) ? -1 : undefined
56
60
  }, displayName);
57
61
  };
58
62
  const disabledAccountDesc = (statusModifiedDate, disabledAccountMessage, status = 'closed') => {
@@ -122,9 +126,22 @@ const DisabledProfileCardDetails = props => {
122
126
  export const ProfileCardDetails = props => {
123
127
  const {
124
128
  meta,
125
- status
129
+ status,
130
+ isRenderedInPortal,
131
+ isTriggeredUsingKeyboard
126
132
  } = props;
127
133
  const nameRef = useRef(null);
134
+ React.useEffect(() => {
135
+ if (nameRef !== null && nameRef !== void 0 && nameRef.current && isRenderedInPortal && isTriggeredUsingKeyboard && expValEquals('editor_a11y_7152_profile_card_tab_order', 'isEnabled', true)) {
136
+ const rafId = requestAnimationFrame(() => {
137
+ var _nameRef$current;
138
+ (_nameRef$current = nameRef.current) === null || _nameRef$current === void 0 ? void 0 : _nameRef$current.focus();
139
+ });
140
+ return () => {
141
+ cancelAnimationFrame(rafId);
142
+ };
143
+ }
144
+ }, [isRenderedInPortal, isTriggeredUsingKeyboard]);
128
145
  if (props.isServiceAccount) {
129
146
  return /*#__PURE__*/React.createElement(ServiceAccountProfileCardDetails, props);
130
147
  }
@@ -139,7 +156,7 @@ export const ProfileCardDetails = props => {
139
156
  const lozenges = /*#__PURE__*/React.createElement(CustomLozenges, {
140
157
  lozenges: props.customLozenges
141
158
  });
142
- return /*#__PURE__*/React.createElement(DetailsGroup, null, renderName(props.nickname, props.fullName, meta, nameRef), meta && /*#__PURE__*/React.createElement(JobTitleLabel, null, meta), meta && props.customLozenges && props.customLozenges.length > 0 ? /*#__PURE__*/React.createElement(Box, {
159
+ return /*#__PURE__*/React.createElement(DetailsGroup, null, renderName(props.nickname, props.fullName, meta, nameRef, isRenderedInPortal, isTriggeredUsingKeyboard), meta && /*#__PURE__*/React.createElement(JobTitleLabel, null, meta), meta && props.customLozenges && props.customLozenges.length > 0 ? /*#__PURE__*/React.createElement(Box, {
143
160
  paddingBlockStart: "space.150"
144
161
  }, lozenges) : lozenges, /*#__PURE__*/React.createElement(Box, {
145
162
  xcss: styles.detailedListWrapperNext
@@ -6,6 +6,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
6
6
  import Popup from '@atlaskit/popup';
7
7
  import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics';
8
8
  import { layers } from '@atlaskit/theme/constants';
9
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
10
  import filterActionsInner from '../../internal/filterActions';
10
11
  import getLabelMessage from '../../internal/getLabelMessage';
11
12
  import { CardWrapper } from '../../styled/UserTrigger';
@@ -26,6 +27,7 @@ function ProfileCardContent({
26
27
  hasError,
27
28
  errorType,
28
29
  agentActions,
30
+ isRenderedInPortal,
29
31
  addFlag,
30
32
  hideAgentMoreActions,
31
33
  hideAiDisclaimer
@@ -46,6 +48,7 @@ function ProfileCardContent({
46
48
  return /*#__PURE__*/React.createElement(Suspense, {
47
49
  fallback: null
48
50
  }, /*#__PURE__*/React.createElement(ProfileCardLazy, _extends({}, profilecardProps, {
51
+ isRenderedInPortal: isRenderedInPortal,
49
52
  actions: profileCardAction,
50
53
  hasError: hasError,
51
54
  errorType: errorType,
@@ -78,6 +81,7 @@ export default function ProfilecardTriggerNext({
78
81
  hideAiDisclaimer,
79
82
  ariaHideProfileTrigger = false,
80
83
  isVisible: propsIsVisible,
84
+ isRenderedInPortal,
81
85
  ssrPlaceholderId,
82
86
  showDelay: customShowDelay,
83
87
  hideDelay: customHideDelay
@@ -324,7 +328,8 @@ export default function ProfilecardTriggerNext({
324
328
  agentActions: agentActions,
325
329
  addFlag: addFlag,
326
330
  hideAgentMoreActions: hideAgentMoreActions,
327
- hideAiDisclaimer: hideAiDisclaimer
331
+ hideAiDisclaimer: hideAiDisclaimer,
332
+ isRenderedInPortal: isRenderedInPortal
328
333
  })),
329
334
  trigger: triggerProps => {
330
335
  const {
@@ -358,7 +363,7 @@ export default function ProfilecardTriggerNext({
358
363
  },
359
364
  zIndex: layers.modal(),
360
365
  shouldUseCaptureOnOutsideClick: true,
361
- autoFocus: autoFocus !== null && autoFocus !== void 0 ? autoFocus : trigger === 'click'
366
+ autoFocus: expValEquals('editor_a11y_7152_profile_card_tab_order', 'isEnabled', true) ? isRenderedInPortal && isTriggeredUsingKeyboard ? false : autoFocus !== null && autoFocus !== void 0 ? autoFocus : trigger === 'click' : autoFocus !== null && autoFocus !== void 0 ? autoFocus : trigger === 'click'
362
367
  // This feature gate is currently enabled only for Jira_Web to avoid UI issues in Confluence_Web.
363
368
  ,
364
369
  shouldRenderToParent: fg('enable_appropriate_reading_order_in_profile_card'),
@@ -4,7 +4,7 @@ import { getPageTime } from './performance';
4
4
  const ANALYTICS_CHANNEL = 'peopleTeams';
5
5
  export const PACKAGE_META_DATA = {
6
6
  packageName: "@atlaskit/profilecard",
7
- packageVersion: "24.37.3"
7
+ packageVersion: "24.38.0"
8
8
  };
9
9
  const runItLater = cb => {
10
10
  const requestIdleCallback = window.requestIdleCallback;
@@ -45,7 +45,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
45
45
  actionSubjectId,
46
46
  attributes: {
47
47
  packageName: "@atlaskit/profilecard",
48
- packageVersion: "24.37.3",
48
+ packageVersion: "24.38.0",
49
49
  ...attributes,
50
50
  firedAt: Math.round(getPageTime())
51
51
  }
@@ -4,7 +4,7 @@ import { AGGQuery } from './graphqlUtils';
4
4
  var ORG_ID_FROM_CLOUD_ID_QUERY = "query OrgIdFromCloudId($cloudId: ID!) {\n\ttenantContexts(cloudIds: [$cloudId]) {\n\t\torgId\n\t}\n}";
5
5
  var addHeaders = function addHeaders(headers) {
6
6
  headers.append('atl-client-name', "@atlaskit/profilecard");
7
- headers.append('atl-client-version', "24.37.3");
7
+ headers.append('atl-client-version', "24.38.0");
8
8
  return headers;
9
9
  };
10
10
  export function getOrgIdForCloudIdFromAGG(_x, _x2) {
@@ -59,7 +59,7 @@ export var addHeaders = function addHeaders(headers) {
59
59
  headers.append('X-ExperimentalApi', 'teams-beta');
60
60
  headers.append('X-ExperimentalApi', 'team-members-beta');
61
61
  headers.append('atl-client-name', "@atlaskit/profilecard");
62
- headers.append('atl-client-version', "24.37.3");
62
+ headers.append('atl-client-version', "24.38.0");
63
63
  return headers;
64
64
  };
65
65
  export function getTeamFromAGG(_x, _x2, _x3) {
@@ -161,6 +161,7 @@ export var ProfilecardInternal = function ProfilecardInternal(props) {
161
161
  actions: realActions,
162
162
  fireAnalyticsWithDuration: fireAnalyticsWithDuration,
163
163
  isTriggeredUsingKeyboard: props.isTriggeredUsingKeyboard,
164
+ isRenderedInPortal: props.isRenderedInPortal,
164
165
  fireAnalyticsWithDurationNext: fireAnalyticsWithDurationNext
165
166
  }))))));
166
167
  };
@@ -169,6 +170,7 @@ var Actions = function Actions(_ref) {
169
170
  fireAnalyticsWithDuration = _ref.fireAnalyticsWithDuration,
170
171
  fireAnalyticsWithDurationNext = _ref.fireAnalyticsWithDurationNext,
171
172
  isTriggeredUsingKeyboard = _ref.isTriggeredUsingKeyboard,
173
+ isRenderedInPortal = _ref.isRenderedInPortal,
172
174
  fullName = _ref.fullName;
173
175
  var onActionClick = useCallback(function (action, args, event, index) {
174
176
  if (fg('ptc-enable-profile-card-analytics-refactor')) {
@@ -219,7 +221,7 @@ var Actions = function Actions(_ref) {
219
221
  },
220
222
  href: action.link || '',
221
223
  target: action.target,
222
- autoFocus: index === 0 && isTriggeredUsingKeyboard,
224
+ autoFocus: index === 0 && isTriggeredUsingKeyboard && !isRenderedInPortal,
223
225
  id: "action-button-".concat(action.id),
224
226
  "aria-labelledby": fg('enable_userprofilecard_arialabelfix') ? "action-button-".concat(action.id, " profilecard-name-label") : ''
225
227
  }, action.label, isKudos && /*#__PURE__*/React.createElement(AnimationWrapper, null, /*#__PURE__*/React.createElement(KudosBlobAnimation, null)));
@@ -10,6 +10,7 @@ import { FormattedMessage } from 'react-intl-next';
10
10
  import Lozenge from '@atlaskit/lozenge';
11
11
  import { fg } from '@atlaskit/platform-feature-flags';
12
12
  import { Box, Text } from '@atlaskit/primitives/compiled';
13
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
13
14
  import Tooltip from '@atlaskit/tooltip';
14
15
  import relativeDate from '../../internal/relative-date';
15
16
  import messages from '../../messages';
@@ -26,7 +27,7 @@ var styles = {
26
27
  disabledAccount: "_syazi7uo",
27
28
  activeAccount: "_syaz15cr"
28
29
  };
29
- var renderName = function renderName(nickname, fullName, meta, nameRef) {
30
+ var renderName = function renderName(nickname, fullName, meta, nameRef, isRenderedInPortal, isTriggeredUsingKeyboard) {
30
31
  if (!fullName && !nickname) {
31
32
  return null;
32
33
  }
@@ -49,12 +50,15 @@ var renderName = function renderName(nickname, fullName, meta, nameRef) {
49
50
  as: "h2",
50
51
  xcss: cx(styles.fullNameLabel, styles.activeAccount, meta ? fg('enable_absolute_positioning_profile_card') ? styles.metaLabelWithHighSpecificity : styles.metaLabel : fg('enable_absolute_positioning_profile_card') ? styles.noMetaLabelWithHighSpecificity : styles.noMetaLabel),
51
52
  testId: "profilecard-name",
52
- id: "profilecard-name-label"
53
+ id: "profilecard-name-label",
54
+ tabIndex: isTriggeredUsingKeyboard && isRenderedInPortal && expValEquals('editor_a11y_7152_profile_card_tab_order', 'isEnabled', true) ? -1 : undefined
53
55
  }, displayName)) : /*#__PURE__*/React.createElement(Box, {
56
+ ref: nameRef,
54
57
  as: "h2",
55
58
  xcss: cx(styles.fullNameLabel, styles.activeAccount, meta ? fg('enable_absolute_positioning_profile_card') ? styles.metaLabelWithHighSpecificity : styles.metaLabel : fg('enable_absolute_positioning_profile_card') ? styles.noMetaLabelWithHighSpecificity : styles.noMetaLabel),
56
59
  testId: "profilecard-name",
57
- id: "profilecard-name-label"
60
+ id: "profilecard-name-label",
61
+ tabIndex: isTriggeredUsingKeyboard && isRenderedInPortal && expValEquals('editor_a11y_7152_profile_card_tab_order', 'isEnabled', true) ? -1 : undefined
58
62
  }, displayName);
59
63
  };
60
64
  var disabledAccountDesc = function disabledAccountDesc(statusModifiedDate, disabledAccountMessage) {
@@ -120,8 +124,21 @@ var DisabledProfileCardDetails = function DisabledProfileCardDetails(props) {
120
124
  };
121
125
  export var ProfileCardDetails = function ProfileCardDetails(props) {
122
126
  var meta = props.meta,
123
- status = props.status;
127
+ status = props.status,
128
+ isRenderedInPortal = props.isRenderedInPortal,
129
+ isTriggeredUsingKeyboard = props.isTriggeredUsingKeyboard;
124
130
  var nameRef = useRef(null);
131
+ React.useEffect(function () {
132
+ if (nameRef !== null && nameRef !== void 0 && nameRef.current && isRenderedInPortal && isTriggeredUsingKeyboard && expValEquals('editor_a11y_7152_profile_card_tab_order', 'isEnabled', true)) {
133
+ var rafId = requestAnimationFrame(function () {
134
+ var _nameRef$current;
135
+ (_nameRef$current = nameRef.current) === null || _nameRef$current === void 0 || _nameRef$current.focus();
136
+ });
137
+ return function () {
138
+ cancelAnimationFrame(rafId);
139
+ };
140
+ }
141
+ }, [isRenderedInPortal, isTriggeredUsingKeyboard]);
125
142
  if (props.isServiceAccount) {
126
143
  return /*#__PURE__*/React.createElement(ServiceAccountProfileCardDetails, props);
127
144
  }
@@ -136,7 +153,7 @@ export var ProfileCardDetails = function ProfileCardDetails(props) {
136
153
  var lozenges = /*#__PURE__*/React.createElement(CustomLozenges, {
137
154
  lozenges: props.customLozenges
138
155
  });
139
- return /*#__PURE__*/React.createElement(DetailsGroup, null, renderName(props.nickname, props.fullName, meta, nameRef), meta && /*#__PURE__*/React.createElement(JobTitleLabel, null, meta), meta && props.customLozenges && props.customLozenges.length > 0 ? /*#__PURE__*/React.createElement(Box, {
156
+ return /*#__PURE__*/React.createElement(DetailsGroup, null, renderName(props.nickname, props.fullName, meta, nameRef, isRenderedInPortal, isTriggeredUsingKeyboard), meta && /*#__PURE__*/React.createElement(JobTitleLabel, null, meta), meta && props.customLozenges && props.customLozenges.length > 0 ? /*#__PURE__*/React.createElement(Box, {
140
157
  paddingBlockStart: "space.150"
141
158
  }, lozenges) : lozenges, /*#__PURE__*/React.createElement(Box, {
142
159
  xcss: styles.detailedListWrapperNext
@@ -16,6 +16,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
16
16
  import Popup from '@atlaskit/popup';
17
17
  import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics';
18
18
  import { layers } from '@atlaskit/theme/constants';
19
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
19
20
  import filterActionsInner from '../../internal/filterActions';
20
21
  import getLabelMessage from '../../internal/getLabelMessage';
21
22
  import { CardWrapper } from '../../styled/UserTrigger';
@@ -36,6 +37,7 @@ function ProfileCardContent(_ref) {
36
37
  hasError = _ref.hasError,
37
38
  errorType = _ref.errorType,
38
39
  agentActions = _ref.agentActions,
40
+ isRenderedInPortal = _ref.isRenderedInPortal,
39
41
  addFlag = _ref.addFlag,
40
42
  hideAgentMoreActions = _ref.hideAgentMoreActions,
41
43
  hideAiDisclaimer = _ref.hideAiDisclaimer;
@@ -55,6 +57,7 @@ function ProfileCardContent(_ref) {
55
57
  return /*#__PURE__*/React.createElement(Suspense, {
56
58
  fallback: null
57
59
  }, /*#__PURE__*/React.createElement(ProfileCardLazy, _extends({}, profilecardProps, {
60
+ isRenderedInPortal: isRenderedInPortal,
58
61
  actions: profileCardAction,
59
62
  hasError: hasError,
60
63
  errorType: errorType,
@@ -91,6 +94,7 @@ export default function ProfilecardTriggerNext(_ref2) {
91
94
  _ref2$ariaHideProfile = _ref2.ariaHideProfileTrigger,
92
95
  ariaHideProfileTrigger = _ref2$ariaHideProfile === void 0 ? false : _ref2$ariaHideProfile,
93
96
  propsIsVisible = _ref2.isVisible,
97
+ isRenderedInPortal = _ref2.isRenderedInPortal,
94
98
  ssrPlaceholderId = _ref2.ssrPlaceholderId,
95
99
  customShowDelay = _ref2.showDelay,
96
100
  customHideDelay = _ref2.hideDelay;
@@ -386,7 +390,8 @@ export default function ProfilecardTriggerNext(_ref2) {
386
390
  agentActions: agentActions,
387
391
  addFlag: addFlag,
388
392
  hideAgentMoreActions: hideAgentMoreActions,
389
- hideAiDisclaimer: hideAiDisclaimer
393
+ hideAiDisclaimer: hideAiDisclaimer,
394
+ isRenderedInPortal: isRenderedInPortal
390
395
  }));
391
396
  },
392
397
  trigger: function trigger(triggerProps) {
@@ -417,7 +422,7 @@ export default function ProfilecardTriggerNext(_ref2) {
417
422
  },
418
423
  zIndex: layers.modal(),
419
424
  shouldUseCaptureOnOutsideClick: true,
420
- autoFocus: autoFocus !== null && autoFocus !== void 0 ? autoFocus : trigger === 'click'
425
+ autoFocus: expValEquals('editor_a11y_7152_profile_card_tab_order', 'isEnabled', true) ? isRenderedInPortal && isTriggeredUsingKeyboard ? false : autoFocus !== null && autoFocus !== void 0 ? autoFocus : trigger === 'click' : autoFocus !== null && autoFocus !== void 0 ? autoFocus : trigger === 'click'
421
426
  // This feature gate is currently enabled only for Jira_Web to avoid UI issues in Confluence_Web.
422
427
  ,
423
428
  shouldRenderToParent: fg('enable_appropriate_reading_order_in_profile_card'),
@@ -7,7 +7,7 @@ import { getPageTime } from './performance';
7
7
  var ANALYTICS_CHANNEL = 'peopleTeams';
8
8
  export var PACKAGE_META_DATA = {
9
9
  packageName: "@atlaskit/profilecard",
10
- packageVersion: "24.37.3"
10
+ packageVersion: "24.38.0"
11
11
  };
12
12
  var runItLater = function runItLater(cb) {
13
13
  var requestIdleCallback = window.requestIdleCallback;
@@ -52,7 +52,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
52
52
  actionSubjectId: actionSubjectId,
53
53
  attributes: _objectSpread(_objectSpread({
54
54
  packageName: "@atlaskit/profilecard",
55
- packageVersion: "24.37.3"
55
+ packageVersion: "24.38.0"
56
56
  }, attributes), {}, {
57
57
  firedAt: Math.round(getPageTime())
58
58
  })
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { type ProfileCardTriggerProps } from '../../types';
3
- export default function ProfilecardTriggerNext({ autoFocus, trigger, userId, cloudId, resourceClient, actions, position, children, testId, addFlag, onReportingLinesClick, ariaLabel, ariaLabelledBy, prepopulatedData, disabledAriaAttributes, onVisibilityChange, offset, viewingUserId, product, agentActions, hideAgentMoreActions, hideAiDisclaimer, ariaHideProfileTrigger, isVisible: propsIsVisible, ssrPlaceholderId, showDelay: customShowDelay, hideDelay: customHideDelay, }: ProfileCardTriggerProps): React.JSX.Element;
3
+ export default function ProfilecardTriggerNext({ autoFocus, trigger, userId, cloudId, resourceClient, actions, position, children, testId, addFlag, onReportingLinesClick, ariaLabel, ariaLabelledBy, prepopulatedData, disabledAriaAttributes, onVisibilityChange, offset, viewingUserId, product, agentActions, hideAgentMoreActions, hideAiDisclaimer, ariaHideProfileTrigger, isVisible: propsIsVisible, isRenderedInPortal, ssrPlaceholderId, showDelay: customShowDelay, hideDelay: customHideDelay, }: ProfileCardTriggerProps): React.JSX.Element;
@@ -189,6 +189,13 @@ export interface ProfileCardTriggerProps {
189
189
  disabledAriaAttributes?: boolean;
190
190
  onVisibilityChange?: (isVisible: boolean) => void;
191
191
  isVisible?: boolean;
192
+ /**
193
+ * Indicates whether the profile card is rendered in a portal.
194
+ *
195
+ * If true, the profile card will auto-focus the name element when opened for better accessibility,
196
+ * keeping the user's focus in the tab trap.
197
+ */
198
+ isRenderedInPortal?: boolean;
192
199
  offset?: [number, number];
193
200
  product?: string;
194
201
  viewingUserId?: string;
@@ -437,6 +444,13 @@ export interface ProfilecardProps {
437
444
  teamCentralBaseUrl?: string;
438
445
  addFlag?: (flag: any) => void;
439
446
  cloudId?: string;
447
+ /**
448
+ * Indicates whether the profile card is rendered in a portal.
449
+ *
450
+ * If true, the profile card will auto-focus the name element when opened for better accessibility,
451
+ * keeping the user's focus in the tab trap.
452
+ */
453
+ isRenderedInPortal?: boolean;
440
454
  disabledAccountMessage?: React.ReactNode;
441
455
  hasDisabledAccountLozenge?: boolean;
442
456
  customLozenges?: LozengeProps[];
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { type ProfileCardTriggerProps } from '../../types';
3
- export default function ProfilecardTriggerNext({ autoFocus, trigger, userId, cloudId, resourceClient, actions, position, children, testId, addFlag, onReportingLinesClick, ariaLabel, ariaLabelledBy, prepopulatedData, disabledAriaAttributes, onVisibilityChange, offset, viewingUserId, product, agentActions, hideAgentMoreActions, hideAiDisclaimer, ariaHideProfileTrigger, isVisible: propsIsVisible, ssrPlaceholderId, showDelay: customShowDelay, hideDelay: customHideDelay, }: ProfileCardTriggerProps): React.JSX.Element;
3
+ export default function ProfilecardTriggerNext({ autoFocus, trigger, userId, cloudId, resourceClient, actions, position, children, testId, addFlag, onReportingLinesClick, ariaLabel, ariaLabelledBy, prepopulatedData, disabledAriaAttributes, onVisibilityChange, offset, viewingUserId, product, agentActions, hideAgentMoreActions, hideAiDisclaimer, ariaHideProfileTrigger, isVisible: propsIsVisible, isRenderedInPortal, ssrPlaceholderId, showDelay: customShowDelay, hideDelay: customHideDelay, }: ProfileCardTriggerProps): React.JSX.Element;
@@ -189,6 +189,13 @@ export interface ProfileCardTriggerProps {
189
189
  disabledAriaAttributes?: boolean;
190
190
  onVisibilityChange?: (isVisible: boolean) => void;
191
191
  isVisible?: boolean;
192
+ /**
193
+ * Indicates whether the profile card is rendered in a portal.
194
+ *
195
+ * If true, the profile card will auto-focus the name element when opened for better accessibility,
196
+ * keeping the user's focus in the tab trap.
197
+ */
198
+ isRenderedInPortal?: boolean;
192
199
  offset?: [
193
200
  number,
194
201
  number
@@ -443,6 +450,13 @@ export interface ProfilecardProps {
443
450
  teamCentralBaseUrl?: string;
444
451
  addFlag?: (flag: any) => void;
445
452
  cloudId?: string;
453
+ /**
454
+ * Indicates whether the profile card is rendered in a portal.
455
+ *
456
+ * If true, the profile card will auto-focus the name element when opened for better accessibility,
457
+ * keeping the user's focus in the tab trap.
458
+ */
459
+ isRenderedInPortal?: boolean;
446
460
  disabledAccountMessage?: React.ReactNode;
447
461
  hasDisabledAccountLozenge?: boolean;
448
462
  customLozenges?: LozengeProps[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "24.38.0",
3
+ "version": "24.39.0",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -48,7 +48,7 @@
48
48
  "@atlaskit/css": "^0.19.0",
49
49
  "@atlaskit/dropdown-menu": "^16.5.0",
50
50
  "@atlaskit/empty-state": "^10.1.0",
51
- "@atlaskit/give-kudos": "^4.14.0",
51
+ "@atlaskit/give-kudos": "^4.15.0",
52
52
  "@atlaskit/heading": "^5.3.0",
53
53
  "@atlaskit/icon": "^32.0.0",
54
54
  "@atlaskit/link": "3.3.3",
@@ -68,6 +68,7 @@
68
68
  "@atlaskit/teams-avatar": "^2.4.0",
69
69
  "@atlaskit/teams-public": "^0.70.0",
70
70
  "@atlaskit/theme": "^21.0.0",
71
+ "@atlaskit/tmp-editor-statsig": "^32.5.0",
71
72
  "@atlaskit/tokens": "^11.0.0",
72
73
  "@atlaskit/tooltip": "^20.14.0",
73
74
  "@babel/runtime": "^7.0.0",