@atlaskit/profilecard 24.22.1 → 24.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/profilecard
2
2
 
3
+ ## 24.23.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 24.23.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`829b6192f8717`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/829b6192f8717) -
14
+ [ux] In profile card, add tooltip for truncated text
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies
19
+
3
20
  ## 24.22.1
4
21
 
5
22
  ### Patch Changes
@@ -59,12 +59,6 @@
59
59
  {
60
60
  "path": "../../../design-system/icon/afm-cc/tsconfig.json"
61
61
  },
62
- {
63
- "path": "../../../design-system/link/afm-cc/tsconfig.json"
64
- },
65
- {
66
- "path": "../../../design-system/logo/afm-cc/tsconfig.json"
67
- },
68
62
  {
69
63
  "path": "../../../design-system/lozenge/afm-cc/tsconfig.json"
70
64
  },
@@ -59,12 +59,6 @@
59
59
  {
60
60
  "path": "../../../design-system/icon/afm-jira/tsconfig.json"
61
61
  },
62
- {
63
- "path": "../../../design-system/link/afm-jira/tsconfig.json"
64
- },
65
- {
66
- "path": "../../../design-system/logo/afm-jira/tsconfig.json"
67
- },
68
62
  {
69
63
  "path": "../../../design-system/lozenge/afm-jira/tsconfig.json"
70
64
  },
@@ -59,12 +59,6 @@
59
59
  {
60
60
  "path": "../../../design-system/icon/afm-products/tsconfig.json"
61
61
  },
62
- {
63
- "path": "../../../design-system/link/afm-products/tsconfig.json"
64
- },
65
- {
66
- "path": "../../../design-system/logo/afm-products/tsconfig.json"
67
- },
68
62
  {
69
63
  "path": "../../../design-system/lozenge/afm-products/tsconfig.json"
70
64
  },
@@ -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', "0.0.0-development");
14
+ headers.append('atl-client-version', "24.23.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', "0.0.0-development");
69
+ headers.append('atl-client-version', "24.23.0");
70
70
  return headers;
71
71
  };
72
72
  function getTeamFromAGG(_x, _x2, _x3) {
@@ -2,6 +2,7 @@
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
6
  Object.defineProperty(exports, "__esModule", {
6
7
  value: true
7
8
  });
@@ -10,18 +11,20 @@ require("./ProfileCardDetails.compiled.css");
10
11
  var _runtime = require("@compiled/react/runtime");
11
12
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
12
13
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
- var _react = _interopRequireDefault(require("react"));
14
+ var _react = _interopRequireWildcard(require("react"));
14
15
  var _react2 = require("@compiled/react");
15
16
  var _reactIntlNext = require("react-intl-next");
16
17
  var _lozenge = _interopRequireDefault(require("@atlaskit/lozenge"));
17
18
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
19
  var _compiled = require("@atlaskit/primitives/compiled");
20
+ var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
19
21
  var _relativeDate = _interopRequireDefault(require("../../internal/relative-date"));
20
22
  var _messages = _interopRequireDefault(require("../../messages"));
21
23
  var _Card = require("../../styled/Card");
22
24
  var _Icon = require("../Icon");
23
25
  var _ReportingLinesDetails = _interopRequireDefault(require("./ReportingLinesDetails"));
24
26
  var _excluded = ["text"];
27
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
25
28
  var styles = {
26
29
  detailedListWrapperNext: "_19pkxy5q _2hwxze3t _otyrze3t _18u0ze3t _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t",
27
30
  fullNameLabel: "_1reo15vq _18m915vq _11c81ixg _1bto1l2s _o5721q9c",
@@ -32,14 +35,31 @@ var styles = {
32
35
  disabledAccount: "_syazi7uo",
33
36
  activeAccount: "_syaz15cr"
34
37
  };
35
- var renderName = function renderName(nickname, fullName, meta) {
38
+ var renderName = function renderName(nickname, fullName, meta, nameRef) {
36
39
  if (!fullName && !nickname) {
37
40
  return null;
38
41
  }
39
42
  var isNicknameRedundant = !nickname || nickname === fullName;
40
43
  var shownNickname = " (".concat(nickname, ") ");
41
44
  var displayName = isNicknameRedundant ? fullName : "".concat(fullName).concat(shownNickname);
42
- return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
45
+ return (0, _platformFeatureFlags.fg)('enable_profilecard_text_truncation_tooltip') ? /*#__PURE__*/_react.default.createElement(_tooltip.default, {
46
+ content: displayName,
47
+ position: "top",
48
+ isScreenReaderAnnouncementDisabled: true,
49
+ canAppear: function canAppear() {
50
+ if (!(nameRef !== null && nameRef !== void 0 && nameRef.current)) {
51
+ return false;
52
+ }
53
+ // Only showing the tooltip when the element has been truncated (ellipsis)
54
+ return nameRef.current.scrollWidth > nameRef.current.clientWidth;
55
+ }
56
+ }, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
57
+ ref: nameRef,
58
+ as: "h2",
59
+ 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
+ testId: "profilecard-name",
61
+ id: "profilecard-name-label"
62
+ }, displayName)) : /*#__PURE__*/_react.default.createElement(_compiled.Box, {
43
63
  as: "h2",
44
64
  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),
45
65
  testId: "profilecard-name",
@@ -110,6 +130,7 @@ var DisabledProfileCardDetails = function DisabledProfileCardDetails(props) {
110
130
  var ProfileCardDetails = exports.ProfileCardDetails = function ProfileCardDetails(props) {
111
131
  var meta = props.meta,
112
132
  status = props.status;
133
+ var nameRef = (0, _react.useRef)(null);
113
134
  if (props.isServiceAccount) {
114
135
  return /*#__PURE__*/_react.default.createElement(ServiceAccountProfileCardDetails, props);
115
136
  }
@@ -121,7 +142,7 @@ var ProfileCardDetails = exports.ProfileCardDetails = function ProfileCardDetail
121
142
  status: status
122
143
  }));
123
144
  }
124
- return /*#__PURE__*/_react.default.createElement(_Card.DetailsGroup, null, renderName(props.nickname, props.fullName, meta), meta && /*#__PURE__*/_react.default.createElement(_Card.JobTitleLabel, null, meta), /*#__PURE__*/_react.default.createElement(CustomLozenges, {
145
+ return /*#__PURE__*/_react.default.createElement(_Card.DetailsGroup, null, renderName(props.nickname, props.fullName, meta, nameRef), meta && /*#__PURE__*/_react.default.createElement(_Card.JobTitleLabel, null, meta), /*#__PURE__*/_react.default.createElement(CustomLozenges, {
125
146
  lozenges: props.customLozenges
126
147
  }), /*#__PURE__*/_react.default.createElement(_compiled.Box, {
127
148
  xcss: styles.detailedListWrapperNext
@@ -4,7 +4,7 @@
4
4
  ._zulp12x7{gap:var(--ds-space-075,6px)}
5
5
  ._zulpu2gc{gap:var(--ds-space-100,8px)}
6
6
  ._12vemgnk{background-repeat:no-repeat}
7
- ._154i1ejb{top:var(--ds-space-300,24px)}
7
+ ._154i1jfw{top:var(--ds-space-500,40px)}
8
8
  ._154ixy5q{top:var(--ds-space-400,2pc)}
9
9
  ._154ize3t{top:var(--ds-space-0,0)}
10
10
  ._16jlkb7n{flex-grow:1}
@@ -3,19 +3,22 @@
3
3
  "use strict";
4
4
 
5
5
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
7
  Object.defineProperty(exports, "__esModule", {
7
8
  value: true
8
9
  });
9
10
  exports.ProfileImage = exports.OverflowActionButtonsWrapper = exports.LozengeWrapper = exports.KudosBlobAnimationStyle = exports.KudosBlobAnimation = exports.JobTitleLabel = exports.DisabledInfo = exports.DetailsLabelText = exports.DetailsLabelIcon = exports.DetailsLabel = exports.DetailsGroup = exports.CustomLozengeContainer = exports.CardContent = exports.CardContainer = exports.AppTitleLabel = exports.AnimationWrapper = exports.AnimatedKudosButton = exports.ActionsFlexSpacer = exports.ActionButtonGroup = void 0;
10
11
  require("./Card.compiled.css");
11
12
  var _runtime = require("@compiled/react/runtime");
12
- var _react = _interopRequireDefault(require("react"));
13
+ var _react = _interopRequireWildcard(require("react"));
13
14
  var _css = require("@atlaskit/css");
14
15
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
16
  var _compiled = require("@atlaskit/primitives/compiled");
17
+ var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
18
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
16
19
  var kudosButtonAnimationTransformationCompiled = null;
17
20
  var styles = {
18
- profileImage: "_kqswstnw _154i1ejb _1ltv1ejb",
21
+ profileImage: "_kqswstnw _154i1jfw _1ltv1ejb",
19
22
  actionsFlexSpacer: "_16jlkb7n _1o9zidpf _i0dl1wug",
20
23
  kudosBlobAnimationStyle: "_1e0cglyw _4t3i1w81 _1bsb1w81 _1pby1mrw _kqswstnw _154ixy5q",
21
24
  animationWrapper: "_mkrz1rip _kqswstnw _154ize3t _1ltvze3t _94n5ze3t _1xi2ze3t",
@@ -37,11 +40,11 @@ var styles = {
37
40
  detailsLabelIcon: "_1e0c1txw _1o9zidpf _syaz1rpy _1bsb7vkz _4t3i7vkz _s7n4jp4b _19pkze3t",
38
41
  detailsLabelText: "_1reo15vq _18m915vq _11c8dcr7 _1bto1l2s _syazi7uo _19pkze3t _18u0ze3t",
39
42
  kudosBlobAnimation: "_1e0cglyw _4t3i1w81 _1bsb1w81 _1pby1mrw _kqswstnw _j7hq1q51 _tip8kb7n _5sagi11n _1itkdsyg",
40
- jobTitleLabel: "_19pkze3t _otyrze3t _18u0utpp _2hwxze3t",
43
+ jobTitleLabel: "_19pkze3t _otyrze3t _18u0ze3t _2hwxze3t",
41
44
  appTitleLabel: "_2rko12b0 _syazi7uo _u5f312x7 _19bv12x7 _1bsb1ns9 _19pk1b66 _otyrze3t _18u0utpp _2hwxze3t"
42
45
  };
43
46
  var stylesCompiled = {
44
- jobTitleLabel: "_19pkze3t _otyrze3t _18u0utpp _2hwxze3t _1br315cr",
47
+ jobTitleLabel: "_19pkze3t _otyrze3t _18u0ze3t _2hwxze3t _1br315cr",
45
48
  actionButtonGroup: "_zulp12x7 _uiztglyw _19pkpxbi _2hwxze3t _18u0ze3t _otyrze3t _y3gnusic _1bahesu3 _1e0c1txw _1oqbazsu"
46
49
  };
47
50
  var ProfileImage = exports.ProfileImage = function ProfileImage(_ref) {
@@ -126,9 +129,26 @@ var CustomLozengeContainer = exports.CustomLozengeContainer = function CustomLoz
126
129
  };
127
130
  var JobTitleLabel = exports.JobTitleLabel = function JobTitleLabel(_ref1) {
128
131
  var children = _ref1.children;
132
+ var textRef = (0, _react.useRef)(null);
129
133
  return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
130
134
  xcss: (0, _css.cx)((0, _platformFeatureFlags.fg)('enable_absolute_positioning_profile_card') ? stylesCompiled.jobTitleLabel : styles.jobTitleLabel)
135
+ }, (0, _platformFeatureFlags.fg)('enable_profilecard_text_truncation_tooltip') ? /*#__PURE__*/_react.default.createElement(_tooltip.default, {
136
+ content: children,
137
+ position: "bottom",
138
+ isScreenReaderAnnouncementDisabled: true,
139
+ canAppear: function canAppear() {
140
+ if (!textRef.current) {
141
+ return false;
142
+ }
143
+ // Only showing the tooltip when the element has been truncated (ellipsis)
144
+ return textRef.current.scrollHeight > textRef.current.clientHeight;
145
+ }
131
146
  }, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
147
+ ref: textRef,
148
+ maxLines: 1,
149
+ color: "color.text.inverse",
150
+ id: "profile-card-job-title-label-text"
151
+ }, children)) : /*#__PURE__*/_react.default.createElement(_compiled.Text, {
132
152
  maxLines: 1,
133
153
  color: "color.text.inverse",
134
154
  id: "profile-card-job-title-label-text"
@@ -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: "0.0.0-development"
16
+ packageVersion: "24.23.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: "0.0.0-development"
61
+ packageVersion: "24.23.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', "0.0.0-development");
9
+ headers.append('atl-client-version', "24.23.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', "0.0.0-development");
81
+ headers.append('atl-client-version', "24.23.0");
82
82
  return headers;
83
83
  };
84
84
  export async function getTeamFromAGG(url, teamId, siteId) {
@@ -2,12 +2,13 @@
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./ProfileCardDetails.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
- import React from 'react';
5
+ import React, { useRef } from 'react';
6
6
  import { cx } from '@compiled/react';
7
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 Tooltip from '@atlaskit/tooltip';
11
12
  import relativeDate from '../../internal/relative-date';
12
13
  import messages from '../../messages';
13
14
  import { AppTitleLabel, CustomLozengeContainer, DetailsGroup, DisabledInfo, JobTitleLabel, LozengeWrapper } from '../../styled/Card';
@@ -23,14 +24,31 @@ const styles = {
23
24
  disabledAccount: "_syazi7uo",
24
25
  activeAccount: "_syaz15cr"
25
26
  };
26
- const renderName = (nickname, fullName, meta) => {
27
+ const renderName = (nickname, fullName, meta, nameRef) => {
27
28
  if (!fullName && !nickname) {
28
29
  return null;
29
30
  }
30
31
  const isNicknameRedundant = !nickname || nickname === fullName;
31
32
  const shownNickname = ` (${nickname}) `;
32
33
  const displayName = isNicknameRedundant ? fullName : `${fullName}${shownNickname}`;
33
- return /*#__PURE__*/React.createElement(Box, {
34
+ return fg('enable_profilecard_text_truncation_tooltip') ? /*#__PURE__*/React.createElement(Tooltip, {
35
+ content: displayName,
36
+ position: "top",
37
+ isScreenReaderAnnouncementDisabled: true,
38
+ canAppear: () => {
39
+ if (!(nameRef !== null && nameRef !== void 0 && nameRef.current)) {
40
+ return false;
41
+ }
42
+ // Only showing the tooltip when the element has been truncated (ellipsis)
43
+ return nameRef.current.scrollWidth > nameRef.current.clientWidth;
44
+ }
45
+ }, /*#__PURE__*/React.createElement(Box, {
46
+ ref: nameRef,
47
+ as: "h2",
48
+ 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
+ testId: "profilecard-name",
50
+ id: "profilecard-name-label"
51
+ }, displayName)) : /*#__PURE__*/React.createElement(Box, {
34
52
  as: "h2",
35
53
  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),
36
54
  testId: "profilecard-name",
@@ -106,6 +124,7 @@ export const ProfileCardDetails = props => {
106
124
  meta,
107
125
  status
108
126
  } = props;
127
+ const nameRef = useRef(null);
109
128
  if (props.isServiceAccount) {
110
129
  return /*#__PURE__*/React.createElement(ServiceAccountProfileCardDetails, props);
111
130
  }
@@ -117,7 +136,7 @@ export const ProfileCardDetails = props => {
117
136
  status: status
118
137
  }));
119
138
  }
120
- return /*#__PURE__*/React.createElement(DetailsGroup, null, renderName(props.nickname, props.fullName, meta), meta && /*#__PURE__*/React.createElement(JobTitleLabel, null, meta), /*#__PURE__*/React.createElement(CustomLozenges, {
139
+ return /*#__PURE__*/React.createElement(DetailsGroup, null, renderName(props.nickname, props.fullName, meta, nameRef), meta && /*#__PURE__*/React.createElement(JobTitleLabel, null, meta), /*#__PURE__*/React.createElement(CustomLozenges, {
121
140
  lozenges: props.customLozenges
122
141
  }), /*#__PURE__*/React.createElement(Box, {
123
142
  xcss: styles.detailedListWrapperNext
@@ -4,7 +4,7 @@
4
4
  ._zulp12x7{gap:var(--ds-space-075,6px)}
5
5
  ._zulpu2gc{gap:var(--ds-space-100,8px)}
6
6
  ._12vemgnk{background-repeat:no-repeat}
7
- ._154i1ejb{top:var(--ds-space-300,24px)}
7
+ ._154i1jfw{top:var(--ds-space-500,40px)}
8
8
  ._154ixy5q{top:var(--ds-space-400,2pc)}
9
9
  ._154ize3t{top:var(--ds-space-0,0)}
10
10
  ._16jlkb7n{flex-grow:1}
@@ -2,13 +2,14 @@
2
2
  /* eslint-disable @atlaskit/design-system/no-styled-tagged-template-expression -- needs manual remediation */
3
3
  import "./Card.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
- import React from 'react';
5
+ import React, { useRef } from 'react';
6
6
  import { cx } from '@atlaskit/css';
7
7
  import { fg } from '@atlaskit/platform-feature-flags';
8
8
  import { Box, Text } from '@atlaskit/primitives/compiled';
9
+ import Tooltip from '@atlaskit/tooltip';
9
10
  const kudosButtonAnimationTransformationCompiled = null;
10
11
  const styles = {
11
- profileImage: "_kqswstnw _154i1ejb _1ltv1ejb",
12
+ profileImage: "_kqswstnw _154i1jfw _1ltv1ejb",
12
13
  actionsFlexSpacer: "_16jlkb7n _1o9zidpf _i0dl1wug",
13
14
  kudosBlobAnimationStyle: "_1e0cglyw _4t3i1w81 _1bsb1w81 _1pby1mrw _kqswstnw _154ixy5q",
14
15
  animationWrapper: "_mkrz1rip _kqswstnw _154ize3t _1ltvze3t _94n5ze3t _1xi2ze3t",
@@ -30,11 +31,11 @@ const styles = {
30
31
  detailsLabelIcon: "_1e0c1txw _1o9zidpf _syaz1rpy _1bsb7vkz _4t3i7vkz _s7n4jp4b _19pkze3t",
31
32
  detailsLabelText: "_1reo15vq _18m915vq _11c8dcr7 _1bto1l2s _syazi7uo _19pkze3t _18u0ze3t",
32
33
  kudosBlobAnimation: "_1e0cglyw _4t3i1w81 _1bsb1w81 _1pby1mrw _kqswstnw _j7hq1q51 _tip8kb7n _5sagi11n _1itkdsyg",
33
- jobTitleLabel: "_19pkze3t _otyrze3t _18u0utpp _2hwxze3t",
34
+ jobTitleLabel: "_19pkze3t _otyrze3t _18u0ze3t _2hwxze3t",
34
35
  appTitleLabel: "_2rko12b0 _syazi7uo _u5f312x7 _19bv12x7 _1bsb1ns9 _19pk1b66 _otyrze3t _18u0utpp _2hwxze3t"
35
36
  };
36
37
  const stylesCompiled = {
37
- jobTitleLabel: "_19pkze3t _otyrze3t _18u0utpp _2hwxze3t _1br315cr",
38
+ jobTitleLabel: "_19pkze3t _otyrze3t _18u0ze3t _2hwxze3t _1br315cr",
38
39
  actionButtonGroup: "_zulp12x7 _uiztglyw _19pkpxbi _2hwxze3t _18u0ze3t _otyrze3t _y3gnusic _1bahesu3 _1e0c1txw _1oqbazsu"
39
40
  };
40
41
  export const ProfileImage = ({
@@ -103,13 +104,32 @@ export const CustomLozengeContainer = ({
103
104
  }, children);
104
105
  export const JobTitleLabel = ({
105
106
  children
106
- }) => /*#__PURE__*/React.createElement(Box, {
107
- xcss: cx(fg('enable_absolute_positioning_profile_card') ? stylesCompiled.jobTitleLabel : styles.jobTitleLabel)
108
- }, /*#__PURE__*/React.createElement(Text, {
109
- maxLines: 1,
110
- color: "color.text.inverse",
111
- id: "profile-card-job-title-label-text"
112
- }, children));
107
+ }) => {
108
+ const textRef = useRef(null);
109
+ return /*#__PURE__*/React.createElement(Box, {
110
+ xcss: cx(fg('enable_absolute_positioning_profile_card') ? stylesCompiled.jobTitleLabel : styles.jobTitleLabel)
111
+ }, fg('enable_profilecard_text_truncation_tooltip') ? /*#__PURE__*/React.createElement(Tooltip, {
112
+ content: children,
113
+ position: "bottom",
114
+ isScreenReaderAnnouncementDisabled: true,
115
+ canAppear: () => {
116
+ if (!textRef.current) {
117
+ return false;
118
+ }
119
+ // Only showing the tooltip when the element has been truncated (ellipsis)
120
+ return textRef.current.scrollHeight > textRef.current.clientHeight;
121
+ }
122
+ }, /*#__PURE__*/React.createElement(Text, {
123
+ ref: textRef,
124
+ maxLines: 1,
125
+ color: "color.text.inverse",
126
+ id: "profile-card-job-title-label-text"
127
+ }, children)) : /*#__PURE__*/React.createElement(Text, {
128
+ maxLines: 1,
129
+ color: "color.text.inverse",
130
+ id: "profile-card-job-title-label-text"
131
+ }, children));
132
+ };
113
133
  export const AppTitleLabel = ({
114
134
  children
115
135
  }) => /*#__PURE__*/React.createElement(Box, {
@@ -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: "0.0.0-development"
7
+ packageVersion: "24.23.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: "0.0.0-development",
48
+ packageVersion: "24.23.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', "0.0.0-development");
7
+ headers.append('atl-client-version', "24.23.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', "0.0.0-development");
62
+ headers.append('atl-client-version', "24.23.0");
63
63
  return headers;
64
64
  };
65
65
  export function getTeamFromAGG(_x, _x2, _x3) {
@@ -4,12 +4,13 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
4
4
  var _excluded = ["text"];
5
5
  import "./ProfileCardDetails.compiled.css";
6
6
  import { ax, ix } from "@compiled/react/runtime";
7
- import React from 'react';
7
+ import React, { useRef } from 'react';
8
8
  import { cx } from '@compiled/react';
9
9
  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 Tooltip from '@atlaskit/tooltip';
13
14
  import relativeDate from '../../internal/relative-date';
14
15
  import messages from '../../messages';
15
16
  import { AppTitleLabel, CustomLozengeContainer, DetailsGroup, DisabledInfo, JobTitleLabel, LozengeWrapper } from '../../styled/Card';
@@ -25,14 +26,31 @@ var styles = {
25
26
  disabledAccount: "_syazi7uo",
26
27
  activeAccount: "_syaz15cr"
27
28
  };
28
- var renderName = function renderName(nickname, fullName, meta) {
29
+ var renderName = function renderName(nickname, fullName, meta, nameRef) {
29
30
  if (!fullName && !nickname) {
30
31
  return null;
31
32
  }
32
33
  var isNicknameRedundant = !nickname || nickname === fullName;
33
34
  var shownNickname = " (".concat(nickname, ") ");
34
35
  var displayName = isNicknameRedundant ? fullName : "".concat(fullName).concat(shownNickname);
35
- return /*#__PURE__*/React.createElement(Box, {
36
+ return fg('enable_profilecard_text_truncation_tooltip') ? /*#__PURE__*/React.createElement(Tooltip, {
37
+ content: displayName,
38
+ position: "top",
39
+ isScreenReaderAnnouncementDisabled: true,
40
+ canAppear: function canAppear() {
41
+ if (!(nameRef !== null && nameRef !== void 0 && nameRef.current)) {
42
+ return false;
43
+ }
44
+ // Only showing the tooltip when the element has been truncated (ellipsis)
45
+ return nameRef.current.scrollWidth > nameRef.current.clientWidth;
46
+ }
47
+ }, /*#__PURE__*/React.createElement(Box, {
48
+ ref: nameRef,
49
+ as: "h2",
50
+ 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
+ testId: "profilecard-name",
52
+ id: "profilecard-name-label"
53
+ }, displayName)) : /*#__PURE__*/React.createElement(Box, {
36
54
  as: "h2",
37
55
  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),
38
56
  testId: "profilecard-name",
@@ -103,6 +121,7 @@ var DisabledProfileCardDetails = function DisabledProfileCardDetails(props) {
103
121
  export var ProfileCardDetails = function ProfileCardDetails(props) {
104
122
  var meta = props.meta,
105
123
  status = props.status;
124
+ var nameRef = useRef(null);
106
125
  if (props.isServiceAccount) {
107
126
  return /*#__PURE__*/React.createElement(ServiceAccountProfileCardDetails, props);
108
127
  }
@@ -114,7 +133,7 @@ export var ProfileCardDetails = function ProfileCardDetails(props) {
114
133
  status: status
115
134
  }));
116
135
  }
117
- return /*#__PURE__*/React.createElement(DetailsGroup, null, renderName(props.nickname, props.fullName, meta), meta && /*#__PURE__*/React.createElement(JobTitleLabel, null, meta), /*#__PURE__*/React.createElement(CustomLozenges, {
136
+ return /*#__PURE__*/React.createElement(DetailsGroup, null, renderName(props.nickname, props.fullName, meta, nameRef), meta && /*#__PURE__*/React.createElement(JobTitleLabel, null, meta), /*#__PURE__*/React.createElement(CustomLozenges, {
118
137
  lozenges: props.customLozenges
119
138
  }), /*#__PURE__*/React.createElement(Box, {
120
139
  xcss: styles.detailedListWrapperNext
@@ -4,7 +4,7 @@
4
4
  ._zulp12x7{gap:var(--ds-space-075,6px)}
5
5
  ._zulpu2gc{gap:var(--ds-space-100,8px)}
6
6
  ._12vemgnk{background-repeat:no-repeat}
7
- ._154i1ejb{top:var(--ds-space-300,24px)}
7
+ ._154i1jfw{top:var(--ds-space-500,40px)}
8
8
  ._154ixy5q{top:var(--ds-space-400,2pc)}
9
9
  ._154ize3t{top:var(--ds-space-0,0)}
10
10
  ._16jlkb7n{flex-grow:1}
@@ -2,13 +2,14 @@
2
2
  /* eslint-disable @atlaskit/design-system/no-styled-tagged-template-expression -- needs manual remediation */
3
3
  import "./Card.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
- import React from 'react';
5
+ import React, { useRef } from 'react';
6
6
  import { cx } from '@atlaskit/css';
7
7
  import { fg } from '@atlaskit/platform-feature-flags';
8
8
  import { Box, Text } from '@atlaskit/primitives/compiled';
9
+ import Tooltip from '@atlaskit/tooltip';
9
10
  var kudosButtonAnimationTransformationCompiled = null;
10
11
  var styles = {
11
- profileImage: "_kqswstnw _154i1ejb _1ltv1ejb",
12
+ profileImage: "_kqswstnw _154i1jfw _1ltv1ejb",
12
13
  actionsFlexSpacer: "_16jlkb7n _1o9zidpf _i0dl1wug",
13
14
  kudosBlobAnimationStyle: "_1e0cglyw _4t3i1w81 _1bsb1w81 _1pby1mrw _kqswstnw _154ixy5q",
14
15
  animationWrapper: "_mkrz1rip _kqswstnw _154ize3t _1ltvze3t _94n5ze3t _1xi2ze3t",
@@ -30,11 +31,11 @@ var styles = {
30
31
  detailsLabelIcon: "_1e0c1txw _1o9zidpf _syaz1rpy _1bsb7vkz _4t3i7vkz _s7n4jp4b _19pkze3t",
31
32
  detailsLabelText: "_1reo15vq _18m915vq _11c8dcr7 _1bto1l2s _syazi7uo _19pkze3t _18u0ze3t",
32
33
  kudosBlobAnimation: "_1e0cglyw _4t3i1w81 _1bsb1w81 _1pby1mrw _kqswstnw _j7hq1q51 _tip8kb7n _5sagi11n _1itkdsyg",
33
- jobTitleLabel: "_19pkze3t _otyrze3t _18u0utpp _2hwxze3t",
34
+ jobTitleLabel: "_19pkze3t _otyrze3t _18u0ze3t _2hwxze3t",
34
35
  appTitleLabel: "_2rko12b0 _syazi7uo _u5f312x7 _19bv12x7 _1bsb1ns9 _19pk1b66 _otyrze3t _18u0utpp _2hwxze3t"
35
36
  };
36
37
  var stylesCompiled = {
37
- jobTitleLabel: "_19pkze3t _otyrze3t _18u0utpp _2hwxze3t _1br315cr",
38
+ jobTitleLabel: "_19pkze3t _otyrze3t _18u0ze3t _2hwxze3t _1br315cr",
38
39
  actionButtonGroup: "_zulp12x7 _uiztglyw _19pkpxbi _2hwxze3t _18u0ze3t _otyrze3t _y3gnusic _1bahesu3 _1e0c1txw _1oqbazsu"
39
40
  };
40
41
  export var ProfileImage = function ProfileImage(_ref) {
@@ -119,9 +120,26 @@ export var CustomLozengeContainer = function CustomLozengeContainer(_ref0) {
119
120
  };
120
121
  export var JobTitleLabel = function JobTitleLabel(_ref1) {
121
122
  var children = _ref1.children;
123
+ var textRef = useRef(null);
122
124
  return /*#__PURE__*/React.createElement(Box, {
123
125
  xcss: cx(fg('enable_absolute_positioning_profile_card') ? stylesCompiled.jobTitleLabel : styles.jobTitleLabel)
126
+ }, fg('enable_profilecard_text_truncation_tooltip') ? /*#__PURE__*/React.createElement(Tooltip, {
127
+ content: children,
128
+ position: "bottom",
129
+ isScreenReaderAnnouncementDisabled: true,
130
+ canAppear: function canAppear() {
131
+ if (!textRef.current) {
132
+ return false;
133
+ }
134
+ // Only showing the tooltip when the element has been truncated (ellipsis)
135
+ return textRef.current.scrollHeight > textRef.current.clientHeight;
136
+ }
124
137
  }, /*#__PURE__*/React.createElement(Text, {
138
+ ref: textRef,
139
+ maxLines: 1,
140
+ color: "color.text.inverse",
141
+ id: "profile-card-job-title-label-text"
142
+ }, children)) : /*#__PURE__*/React.createElement(Text, {
125
143
  maxLines: 1,
126
144
  color: "color.text.inverse",
127
145
  id: "profile-card-job-title-label-text"
@@ -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: "0.0.0-development"
10
+ packageVersion: "24.23.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: "0.0.0-development"
55
+ packageVersion: "24.23.0"
56
56
  }, attributes), {}, {
57
57
  firedAt: Math.round(getPageTime())
58
58
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "24.22.1",
3
+ "version": "24.23.1",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -52,8 +52,6 @@
52
52
  "@atlaskit/give-kudos": "^4.4.0",
53
53
  "@atlaskit/heading": "^5.2.0",
54
54
  "@atlaskit/icon": "^29.0.0",
55
- "@atlaskit/link": "^3.2.0",
56
- "@atlaskit/logo": "^19.9.0",
57
55
  "@atlaskit/lozenge": "^13.1.0",
58
56
  "@atlaskit/menu": "^8.4.0",
59
57
  "@atlaskit/modal-dialog": "^14.7.0",
@@ -62,13 +60,13 @@
62
60
  "@atlaskit/platform-feature-flags-react": "^0.4.0",
63
61
  "@atlaskit/popup": "^4.6.0",
64
62
  "@atlaskit/primitives": "^16.4.0",
65
- "@atlaskit/rovo-agent-components": "^3.14.0",
66
- "@atlaskit/rovo-triggers": "^4.6.0",
63
+ "@atlaskit/rovo-agent-components": "^3.15.0",
64
+ "@atlaskit/rovo-triggers": "^4.8.0",
67
65
  "@atlaskit/spinner": "^19.0.0",
68
66
  "@atlaskit/teams-app-config": "^1.12.0",
69
67
  "@atlaskit/teams-app-internal-analytics": "^1.20.0",
70
68
  "@atlaskit/teams-avatar": "^2.4.0",
71
- "@atlaskit/teams-public": "^0.63.0",
69
+ "@atlaskit/teams-public": "^0.64.0",
72
70
  "@atlaskit/theme": "^21.0.0",
73
71
  "@atlaskit/tokens": "^8.4.0",
74
72
  "@atlaskit/tooltip": "^20.10.0",
@@ -168,6 +166,9 @@
168
166
  },
169
167
  "rovo_agent_empty_state_refresh": {
170
168
  "type": "boolean"
169
+ },
170
+ "enable_profilecard_text_truncation_tooltip": {
171
+ "type": "boolean"
171
172
  }
172
173
  },
173
174
  "sideEffects": [