@atlaskit/profilecard 23.7.9 → 23.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/client/getOrgIdForCloudIdFromAGG.js +1 -1
  3. package/dist/cjs/client/getTeamFromAGG.js +1 -1
  4. package/dist/cjs/components/Team/TeamProfileCardTrigger.js +3 -3
  5. package/dist/cjs/components/team-profile-card/main.js +9 -2
  6. package/dist/cjs/components/team-profile-card/team-actions/index.compiled.css +7 -0
  7. package/dist/cjs/components/team-profile-card/team-actions/index.js +71 -0
  8. package/dist/cjs/components/team-profile-card/team-actions/messages.js +19 -0
  9. package/dist/cjs/components/team-profile-card/team-actions/more-actions/index.js +59 -0
  10. package/dist/cjs/components/team-profile-card/team-actions/more-actions/messages.js +14 -0
  11. package/dist/cjs/util/analytics.js +6 -4
  12. package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +1 -1
  13. package/dist/es2019/client/getTeamFromAGG.js +1 -1
  14. package/dist/es2019/components/Team/TeamProfileCardTrigger.js +3 -3
  15. package/dist/es2019/components/team-profile-card/main.js +9 -2
  16. package/dist/es2019/components/team-profile-card/team-actions/index.compiled.css +7 -0
  17. package/dist/es2019/components/team-profile-card/team-actions/index.js +63 -0
  18. package/dist/es2019/components/team-profile-card/team-actions/messages.js +13 -0
  19. package/dist/es2019/components/team-profile-card/team-actions/more-actions/index.js +37 -0
  20. package/dist/es2019/components/team-profile-card/team-actions/more-actions/messages.js +8 -0
  21. package/dist/es2019/util/analytics.js +6 -3
  22. package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +1 -1
  23. package/dist/esm/client/getTeamFromAGG.js +1 -1
  24. package/dist/esm/components/Team/TeamProfileCardTrigger.js +3 -3
  25. package/dist/esm/components/team-profile-card/main.js +9 -2
  26. package/dist/esm/components/team-profile-card/team-actions/index.compiled.css +7 -0
  27. package/dist/esm/components/team-profile-card/team-actions/index.js +61 -0
  28. package/dist/esm/components/team-profile-card/team-actions/messages.js +13 -0
  29. package/dist/esm/components/team-profile-card/team-actions/more-actions/index.js +49 -0
  30. package/dist/esm/components/team-profile-card/team-actions/more-actions/messages.js +8 -0
  31. package/dist/esm/util/analytics.js +6 -4
  32. package/dist/types/components/team-profile-card/main.d.ts +11 -2
  33. package/dist/types/components/team-profile-card/team-actions/index.d.ts +9 -0
  34. package/dist/types/components/team-profile-card/team-actions/messages.d.ts +12 -0
  35. package/dist/types/components/team-profile-card/team-actions/more-actions/index.d.ts +10 -0
  36. package/dist/types/components/team-profile-card/team-actions/more-actions/messages.d.ts +7 -0
  37. package/dist/types/util/analytics.d.ts +1 -1
  38. package/dist/types-ts4.5/components/team-profile-card/main.d.ts +11 -2
  39. package/dist/types-ts4.5/components/team-profile-card/team-actions/index.d.ts +9 -0
  40. package/dist/types-ts4.5/components/team-profile-card/team-actions/messages.d.ts +12 -0
  41. package/dist/types-ts4.5/components/team-profile-card/team-actions/more-actions/index.d.ts +10 -0
  42. package/dist/types-ts4.5/components/team-profile-card/team-actions/more-actions/messages.d.ts +7 -0
  43. package/dist/types-ts4.5/util/analytics.d.ts +1 -1
  44. package/package.json +7 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/profilecard
2
2
 
3
+ ## 23.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#145365](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/145365)
8
+ [`f172c99cc3866`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f172c99cc3866) -
9
+ [ux] show more icon in the team profile card if more action provided
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 23.8.0
16
+
17
+ ### Minor Changes
18
+
19
+ - [#141734](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/141734)
20
+ [`f714a477da668`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f714a477da668) -
21
+ Added Teamid to profilecard triggered ui event
22
+
3
23
  ## 23.7.9
4
24
 
5
25
  ### Patch Changes
@@ -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', "23.7.9");
14
+ headers.append('atl-client-version', "23.9.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', "23.7.9");
69
+ headers.append('atl-client-version', "23.9.0");
70
70
  return headers;
71
71
  };
72
72
  function getTeamFromAGG(_x, _x2, _x3) {
@@ -102,7 +102,7 @@ var TeamProfileCardTriggerInternal = exports.TeamProfileCardTriggerInternal = /*
102
102
  _this.openedByHover = false;
103
103
  _this.showProfilecard(0);
104
104
  if (!_this.state.visible) {
105
- _this.fireAnalytics((0, _analytics.cardTriggered)('team', 'click'));
105
+ _this.fireAnalytics((0, _analytics.cardTriggered)('team', 'click', _this.props.teamId));
106
106
  }
107
107
  }
108
108
  });
@@ -112,7 +112,7 @@ var TeamProfileCardTriggerInternal = exports.TeamProfileCardTriggerInternal = /*
112
112
  }
113
113
  if (!_this.state.visible) {
114
114
  _this.openedByHover = true;
115
- _this.fireAnalytics((0, _analytics.cardTriggered)('team', 'hover'));
115
+ _this.fireAnalytics((0, _analytics.cardTriggered)('team', 'hover', _this.props.teamId));
116
116
  }
117
117
  _this.showProfilecard(_config.DELAY_MS_SHOW);
118
118
  });
@@ -132,7 +132,7 @@ var TeamProfileCardTriggerInternal = exports.TeamProfileCardTriggerInternal = /*
132
132
  });
133
133
  _this.showProfilecard(0);
134
134
  if (!_this.state.visible) {
135
- _this.fireAnalytics((0, _analytics.cardTriggered)('team', 'click'));
135
+ _this.fireAnalytics((0, _analytics.cardTriggered)('team', 'click', _this.props.teamId));
136
136
  }
137
137
  }
138
138
  });
@@ -19,6 +19,7 @@ var _compiled = require("@atlaskit/primitives/compiled");
19
19
  var _teamsAvatar = _interopRequireDefault(require("@atlaskit/teams-avatar"));
20
20
  var _teamsPublic = require("@atlaskit/teams-public");
21
21
  var _analytics = require("../../util/analytics");
22
+ var _teamActions = require("./team-actions");
22
23
  var _main = require("./team-connections/main");
23
24
  var _teamContainersSkeleton = require("./team-containers-skeleton");
24
25
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
@@ -66,7 +67,9 @@ var TeamProfileCard = exports.TeamProfileCard = function TeamProfileCard(_ref3)
66
67
  cloudId = _ref3.cloudId,
67
68
  userId = _ref3.userId,
68
69
  isVerified = _ref3.isVerified,
69
- teamProfileUrl = _ref3.teamProfileUrl;
70
+ teamProfileUrl = _ref3.teamProfileUrl,
71
+ isKudosEnabled = _ref3.isKudosEnabled,
72
+ otherActions = _ref3.otherActions;
70
73
  var _useTeamContainers = (0, _teamsPublic.useTeamContainers)(teamId),
71
74
  teamContainers = _useTeamContainers.teamContainers,
72
75
  loading = _useTeamContainers.loading;
@@ -147,7 +150,11 @@ var TeamProfileCard = exports.TeamProfileCard = function TeamProfileCard(_ref3)
147
150
  },
148
151
  filterContainerId: containerId,
149
152
  isDisplayedOnProfileCard: true
150
- })), teamProfileUrl && /*#__PURE__*/_react.default.createElement(_compiled.Stack, {
153
+ })), isKudosEnabled || otherActions ? /*#__PURE__*/_react.default.createElement(_teamActions.ButtonSection, {
154
+ teamProfileUrl: teamProfileUrl,
155
+ isKudosEnabled: isKudosEnabled,
156
+ otherActions: otherActions
157
+ }) : teamProfileUrl && /*#__PURE__*/_react.default.createElement(_compiled.Stack, {
151
158
  xcss: styles.viewProfileContainerStyles
152
159
  }, /*#__PURE__*/_react.default.createElement(_compiled.Pressable, {
153
160
  onClick: onClick,
@@ -0,0 +1,7 @@
1
+ ._15a5nqa1{border-top-style:solid}
2
+ ._16jlkb7n{flex-grow:1}
3
+ ._19bv1ejb{padding-left:var(--ds-space-300,24px)}
4
+ ._1i53muej{border-top-color:var(--ds-border,#091e4224)}
5
+ ._ca0qpxbi{padding-top:var(--ds-space-200,1pc)}
6
+ ._u5f31ejb{padding-right:var(--ds-space-300,24px)}
7
+ ._uwhke4h9{border-top-width:var(--ds-border-width,1px)}
@@ -0,0 +1,71 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ "use strict";
3
+
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+ Object.defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+ exports.ButtonSection = void 0;
10
+ require("./index.compiled.css");
11
+ var _runtime = require("@compiled/react/runtime");
12
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
13
+ var _react = _interopRequireWildcard(require("react"));
14
+ var _reactIntlNext = require("react-intl-next");
15
+ var _analyticsNext = require("@atlaskit/analytics-next");
16
+ var _new = require("@atlaskit/button/new");
17
+ var _menu = require("@atlaskit/menu");
18
+ var _primitives = require("@atlaskit/primitives");
19
+ var _analytics = require("../../../util/analytics");
20
+ var _messages = require("./messages");
21
+ var _moreActions = require("./more-actions");
22
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
23
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
24
+ var GIVE_KUDOS_ACTION_ID = 'give-kudos';
25
+ var styles = {
26
+ containerStyles: "_uwhke4h9 _15a5nqa1 _1i53muej _19bv1ejb _u5f31ejb _ca0qpxbi",
27
+ actionContainerStyles: "_16jlkb7n"
28
+ };
29
+ var ButtonSection = exports.ButtonSection = function ButtonSection(_ref) {
30
+ var teamProfileUrl = _ref.teamProfileUrl,
31
+ isKudosEnabled = _ref.isKudosEnabled,
32
+ otherActions = _ref.otherActions;
33
+ var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
34
+ createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
35
+ var _useIntl = (0, _reactIntlNext.useIntl)(),
36
+ formatMessage = _useIntl.formatMessage;
37
+ var onTeamProfileClick = (0, _react.useCallback)(function () {
38
+ if (createAnalyticsEvent) {
39
+ (0, _analytics.fireEvent)(createAnalyticsEvent, {
40
+ action: 'clicked',
41
+ actionSubject: 'button',
42
+ actionSubjectId: 'viewTeamProfileButton',
43
+ attributes: {}
44
+ });
45
+ }
46
+ }, [createAnalyticsEvent]);
47
+ var extraActions = [];
48
+ if (isKudosEnabled) {
49
+ extraActions.push({
50
+ id: GIVE_KUDOS_ACTION_ID,
51
+ item: /*#__PURE__*/_react.default.createElement(_menu.ButtonItem, null, formatMessage(_messages.messages.giveKudos))
52
+ });
53
+ }
54
+ if (otherActions) {
55
+ extraActions.push.apply(extraActions, (0, _toConsumableArray2.default)(otherActions));
56
+ }
57
+ return /*#__PURE__*/_react.default.createElement(_primitives.Stack, {
58
+ xcss: styles.containerStyles
59
+ }, /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
60
+ space: "space.050"
61
+ }, teamProfileUrl && /*#__PURE__*/_react.default.createElement(_primitives.Box, {
62
+ xcss: styles.actionContainerStyles
63
+ }, /*#__PURE__*/_react.default.createElement(_new.LinkButton, {
64
+ onClick: onTeamProfileClick,
65
+ href: teamProfileUrl,
66
+ target: "_blank",
67
+ shouldFitContainer: true
68
+ }, formatMessage(_messages.messages.viewProfile))), extraActions.length > 0 && /*#__PURE__*/_react.default.createElement(_moreActions.MoreActions, {
69
+ actions: extraActions
70
+ })));
71
+ };
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.messages = void 0;
7
+ var _reactIntlNext = require("react-intl-next");
8
+ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
9
+ viewProfile: {
10
+ id: 'team-profile-card.team-actions.view-profile',
11
+ defaultMessage: 'View profile',
12
+ description: 'View profile button text'
13
+ },
14
+ giveKudos: {
15
+ id: 'team-profile-card.team-actions.give-kudos',
16
+ defaultMessage: 'Give kudos',
17
+ description: 'Give kudos button text'
18
+ }
19
+ });
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.MoreActions = void 0;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
+ var _react = _interopRequireWildcard(require("react"));
12
+ var _reactIntlNext = require("react-intl-next");
13
+ var _new = require("@atlaskit/button/new");
14
+ var _showMoreHorizontalMore = _interopRequireDefault(require("@atlaskit/icon/core/migration/show-more-horizontal--more"));
15
+ var _menu = require("@atlaskit/menu");
16
+ var _popup = _interopRequireDefault(require("@atlaskit/popup"));
17
+ var _primitives = require("@atlaskit/primitives");
18
+ var _messages = require("./messages");
19
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
20
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
21
+ var MoreActions = exports.MoreActions = function MoreActions(_ref) {
22
+ var actions = _ref.actions;
23
+ var _useIntl = (0, _reactIntlNext.useIntl)(),
24
+ formatMessage = _useIntl.formatMessage;
25
+ var _useState = (0, _react.useState)(false),
26
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
27
+ isOpen = _useState2[0],
28
+ setOpen = _useState2[1];
29
+ var onMoreClick = (0, _react.useCallback)(function (shouldBeOpen) {
30
+ setOpen(shouldBeOpen);
31
+ }, []);
32
+ return /*#__PURE__*/_react.default.createElement(_popup.default, {
33
+ isOpen: isOpen,
34
+ onClose: function onClose() {
35
+ return setOpen(false);
36
+ },
37
+ content: function content() {
38
+ return /*#__PURE__*/_react.default.createElement(_menu.MenuGroup, {
39
+ spacing: "cozy"
40
+ }, /*#__PURE__*/_react.default.createElement(_menu.Section, null, actions.map(function (action) {
41
+ return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
42
+ key: action.id
43
+ }, action.item);
44
+ })));
45
+ },
46
+ trigger: function trigger(triggerProps) {
47
+ return /*#__PURE__*/_react.default.createElement(_new.IconButton, (0, _extends2.default)({}, triggerProps, {
48
+ icon: _showMoreHorizontalMore.default,
49
+ label: formatMessage(_messages.messages.showMoreIconLabel),
50
+ onClick: function onClick() {
51
+ return onMoreClick(!isOpen);
52
+ },
53
+ isSelected: isOpen
54
+ }));
55
+ },
56
+ placement: "right-start",
57
+ shouldRenderToParent: false
58
+ });
59
+ };
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.messages = void 0;
7
+ var _reactIntlNext = require("react-intl-next");
8
+ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
9
+ showMoreIconLabel: {
10
+ id: 'team-profile-card.team-actions.more-actions.show-more-icon-label',
11
+ defaultMessage: 'Show more',
12
+ description: 'Show more icon label'
13
+ }
14
+ });
@@ -45,7 +45,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
45
45
  actionSubjectId: actionSubjectId,
46
46
  attributes: _objectSpread(_objectSpread({
47
47
  packageName: "@atlaskit/profilecard",
48
- packageVersion: "23.7.9"
48
+ packageVersion: "23.9.0"
49
49
  }, attributes), {}, {
50
50
  firedAt: Math.round((0, _performance.getPageTime)())
51
51
  })
@@ -63,10 +63,12 @@ var getActionSubject = function getActionSubject(type) {
63
63
  return 'user';
64
64
  }
65
65
  };
66
- var cardTriggered = exports.cardTriggered = function cardTriggered(type, method) {
67
- return createEvent('ui', 'triggered', getActionSubject(type), undefined, {
66
+ var cardTriggered = exports.cardTriggered = function cardTriggered(type, method, teamId) {
67
+ return createEvent('ui', 'triggered', getActionSubject(type), undefined, _objectSpread({
68
68
  method: method
69
- });
69
+ }, type === 'team' && teamId ? {
70
+ teamId: teamId
71
+ } : {}));
70
72
  };
71
73
  var teamRequestAnalytics = exports.teamRequestAnalytics = function teamRequestAnalytics(action, attributes) {
72
74
  return createEvent('operational', action, TEAM_SUBJECT, 'request', attributes);
@@ -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', "23.7.9");
9
+ headers.append('atl-client-version', "23.9.0");
10
10
  return headers;
11
11
  };
12
12
  export async function getOrgIdForCloudIdFromAGG(url, cloudId) {
@@ -75,7 +75,7 @@ export const addHeaders = headers => {
75
75
  headers.append('X-ExperimentalApi', 'teams-beta');
76
76
  headers.append('X-ExperimentalApi', 'team-members-beta');
77
77
  headers.append('atl-client-name', "@atlaskit/profilecard");
78
- headers.append('atl-client-version', "23.7.9");
78
+ headers.append('atl-client-version', "23.9.0");
79
79
  return headers;
80
80
  };
81
81
  export async function getTeamFromAGG(url, teamId, siteId) {
@@ -77,7 +77,7 @@ export class TeamProfileCardTriggerInternal extends React.PureComponent {
77
77
  this.openedByHover = false;
78
78
  this.showProfilecard(0);
79
79
  if (!this.state.visible) {
80
- this.fireAnalytics(cardTriggered('team', 'click'));
80
+ this.fireAnalytics(cardTriggered('team', 'click', this.props.teamId));
81
81
  }
82
82
  }
83
83
  });
@@ -87,7 +87,7 @@ export class TeamProfileCardTriggerInternal extends React.PureComponent {
87
87
  }
88
88
  if (!this.state.visible) {
89
89
  this.openedByHover = true;
90
- this.fireAnalytics(cardTriggered('team', 'hover'));
90
+ this.fireAnalytics(cardTriggered('team', 'hover', this.props.teamId));
91
91
  }
92
92
  this.showProfilecard(DELAY_MS_SHOW);
93
93
  });
@@ -107,7 +107,7 @@ export class TeamProfileCardTriggerInternal extends React.PureComponent {
107
107
  });
108
108
  this.showProfilecard(0);
109
109
  if (!this.state.visible) {
110
- this.fireAnalytics(cardTriggered('team', 'click'));
110
+ this.fireAnalytics(cardTriggered('team', 'click', this.props.teamId));
111
111
  }
112
112
  }
113
113
  });
@@ -11,6 +11,7 @@ import { Box, Inline, Pressable, Stack, Text } from '@atlaskit/primitives/compil
11
11
  import TeamAvatar from '@atlaskit/teams-avatar';
12
12
  import { TeamContainers, useTeamContainers } from '@atlaskit/teams-public';
13
13
  import { fireEvent } from '../../util/analytics';
14
+ import { ButtonSection } from './team-actions';
14
15
  import { TeamConnections } from './team-connections/main';
15
16
  import { TeamContainersSkeleton } from './team-containers-skeleton';
16
17
  const noop = () => {};
@@ -54,7 +55,9 @@ export const TeamProfileCard = ({
54
55
  cloudId,
55
56
  userId,
56
57
  isVerified,
57
- teamProfileUrl
58
+ teamProfileUrl,
59
+ isKudosEnabled,
60
+ otherActions
58
61
  }) => {
59
62
  const {
60
63
  teamContainers,
@@ -134,7 +137,11 @@ export const TeamProfileCard = ({
134
137
  },
135
138
  filterContainerId: containerId,
136
139
  isDisplayedOnProfileCard: true
137
- })), teamProfileUrl && /*#__PURE__*/React.createElement(Stack, {
140
+ })), isKudosEnabled || otherActions ? /*#__PURE__*/React.createElement(ButtonSection, {
141
+ teamProfileUrl: teamProfileUrl,
142
+ isKudosEnabled: isKudosEnabled,
143
+ otherActions: otherActions
144
+ }) : teamProfileUrl && /*#__PURE__*/React.createElement(Stack, {
138
145
  xcss: styles.viewProfileContainerStyles
139
146
  }, /*#__PURE__*/React.createElement(Pressable, {
140
147
  onClick: onClick,
@@ -0,0 +1,7 @@
1
+ ._15a5nqa1{border-top-style:solid}
2
+ ._16jlkb7n{flex-grow:1}
3
+ ._19bv1ejb{padding-left:var(--ds-space-300,24px)}
4
+ ._1i53muej{border-top-color:var(--ds-border,#091e4224)}
5
+ ._ca0qpxbi{padding-top:var(--ds-space-200,1pc)}
6
+ ._u5f31ejb{padding-right:var(--ds-space-300,24px)}
7
+ ._uwhke4h9{border-top-width:var(--ds-border-width,1px)}
@@ -0,0 +1,63 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import "./index.compiled.css";
3
+ import { ax, ix } from "@compiled/react/runtime";
4
+ import React, { useCallback } from 'react';
5
+ import { useIntl } from 'react-intl-next';
6
+ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
7
+ import { LinkButton } from '@atlaskit/button/new';
8
+ import { ButtonItem } from '@atlaskit/menu';
9
+ import { Box, Inline, Stack } from '@atlaskit/primitives';
10
+ import { fireEvent } from '../../../util/analytics';
11
+ import { messages } from './messages';
12
+ import { MoreActions } from './more-actions';
13
+ const GIVE_KUDOS_ACTION_ID = 'give-kudos';
14
+ const styles = {
15
+ containerStyles: "_uwhke4h9 _15a5nqa1 _1i53muej _19bv1ejb _u5f31ejb _ca0qpxbi",
16
+ actionContainerStyles: "_16jlkb7n"
17
+ };
18
+ export const ButtonSection = ({
19
+ teamProfileUrl,
20
+ isKudosEnabled,
21
+ otherActions
22
+ }) => {
23
+ const {
24
+ createAnalyticsEvent
25
+ } = useAnalyticsEvents();
26
+ const {
27
+ formatMessage
28
+ } = useIntl();
29
+ const onTeamProfileClick = useCallback(() => {
30
+ if (createAnalyticsEvent) {
31
+ fireEvent(createAnalyticsEvent, {
32
+ action: 'clicked',
33
+ actionSubject: 'button',
34
+ actionSubjectId: 'viewTeamProfileButton',
35
+ attributes: {}
36
+ });
37
+ }
38
+ }, [createAnalyticsEvent]);
39
+ const extraActions = [];
40
+ if (isKudosEnabled) {
41
+ extraActions.push({
42
+ id: GIVE_KUDOS_ACTION_ID,
43
+ item: /*#__PURE__*/React.createElement(ButtonItem, null, formatMessage(messages.giveKudos))
44
+ });
45
+ }
46
+ if (otherActions) {
47
+ extraActions.push(...otherActions);
48
+ }
49
+ return /*#__PURE__*/React.createElement(Stack, {
50
+ xcss: styles.containerStyles
51
+ }, /*#__PURE__*/React.createElement(Inline, {
52
+ space: "space.050"
53
+ }, teamProfileUrl && /*#__PURE__*/React.createElement(Box, {
54
+ xcss: styles.actionContainerStyles
55
+ }, /*#__PURE__*/React.createElement(LinkButton, {
56
+ onClick: onTeamProfileClick,
57
+ href: teamProfileUrl,
58
+ target: "_blank",
59
+ shouldFitContainer: true
60
+ }, formatMessage(messages.viewProfile))), extraActions.length > 0 && /*#__PURE__*/React.createElement(MoreActions, {
61
+ actions: extraActions
62
+ })));
63
+ };
@@ -0,0 +1,13 @@
1
+ import { defineMessages } from 'react-intl-next';
2
+ export const messages = defineMessages({
3
+ viewProfile: {
4
+ id: 'team-profile-card.team-actions.view-profile',
5
+ defaultMessage: 'View profile',
6
+ description: 'View profile button text'
7
+ },
8
+ giveKudos: {
9
+ id: 'team-profile-card.team-actions.give-kudos',
10
+ defaultMessage: 'Give kudos',
11
+ description: 'Give kudos button text'
12
+ }
13
+ });
@@ -0,0 +1,37 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React, { useCallback, useState } from 'react';
3
+ import { useIntl } from 'react-intl-next';
4
+ import { IconButton } from '@atlaskit/button/new';
5
+ import MoreIcon from '@atlaskit/icon/core/migration/show-more-horizontal--more';
6
+ import { MenuGroup, Section } from '@atlaskit/menu';
7
+ import Popup from '@atlaskit/popup';
8
+ import { Box } from '@atlaskit/primitives';
9
+ import { messages } from './messages';
10
+ export const MoreActions = ({
11
+ actions
12
+ }) => {
13
+ const {
14
+ formatMessage
15
+ } = useIntl();
16
+ const [isOpen, setOpen] = useState(false);
17
+ const onMoreClick = useCallback(shouldBeOpen => {
18
+ setOpen(shouldBeOpen);
19
+ }, []);
20
+ return /*#__PURE__*/React.createElement(Popup, {
21
+ isOpen: isOpen,
22
+ onClose: () => setOpen(false),
23
+ content: () => /*#__PURE__*/React.createElement(MenuGroup, {
24
+ spacing: "cozy"
25
+ }, /*#__PURE__*/React.createElement(Section, null, actions.map(action => /*#__PURE__*/React.createElement(Box, {
26
+ key: action.id
27
+ }, action.item)))),
28
+ trigger: triggerProps => /*#__PURE__*/React.createElement(IconButton, _extends({}, triggerProps, {
29
+ icon: MoreIcon,
30
+ label: formatMessage(messages.showMoreIconLabel),
31
+ onClick: () => onMoreClick(!isOpen),
32
+ isSelected: isOpen
33
+ })),
34
+ placement: "right-start",
35
+ shouldRenderToParent: false
36
+ });
37
+ };
@@ -0,0 +1,8 @@
1
+ import { defineMessages } from 'react-intl-next';
2
+ export const messages = defineMessages({
3
+ showMoreIconLabel: {
4
+ id: 'team-profile-card.team-actions.more-actions.show-more-icon-label',
5
+ defaultMessage: 'Show more',
6
+ description: 'Show more icon label'
7
+ }
8
+ });
@@ -32,7 +32,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
32
32
  actionSubjectId,
33
33
  attributes: {
34
34
  packageName: "@atlaskit/profilecard",
35
- packageVersion: "23.7.9",
35
+ packageVersion: "23.9.0",
36
36
  ...attributes,
37
37
  firedAt: Math.round(getPageTime())
38
38
  }
@@ -49,9 +49,12 @@ const getActionSubject = type => {
49
49
  return 'user';
50
50
  }
51
51
  };
52
- export const cardTriggered = (type, method) => {
52
+ export const cardTriggered = (type, method, teamId) => {
53
53
  return createEvent('ui', 'triggered', getActionSubject(type), undefined, {
54
- method
54
+ method,
55
+ ...(type === 'team' && teamId ? {
56
+ teamId
57
+ } : {})
55
58
  });
56
59
  };
57
60
  export const teamRequestAnalytics = (action, attributes) => createEvent('operational', action, TEAM_SUBJECT, 'request', attributes);
@@ -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', "23.7.9");
7
+ headers.append('atl-client-version', "23.9.0");
8
8
  return headers;
9
9
  };
10
10
  export function getOrgIdForCloudIdFromAGG(_x, _x2) {
@@ -57,7 +57,7 @@ export var 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', "23.7.9");
60
+ headers.append('atl-client-version', "23.9.0");
61
61
  return headers;
62
62
  };
63
63
  export function getTeamFromAGG(_x, _x2, _x3) {
@@ -92,7 +92,7 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
92
92
  _this.openedByHover = false;
93
93
  _this.showProfilecard(0);
94
94
  if (!_this.state.visible) {
95
- _this.fireAnalytics(cardTriggered('team', 'click'));
95
+ _this.fireAnalytics(cardTriggered('team', 'click', _this.props.teamId));
96
96
  }
97
97
  }
98
98
  });
@@ -102,7 +102,7 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
102
102
  }
103
103
  if (!_this.state.visible) {
104
104
  _this.openedByHover = true;
105
- _this.fireAnalytics(cardTriggered('team', 'hover'));
105
+ _this.fireAnalytics(cardTriggered('team', 'hover', _this.props.teamId));
106
106
  }
107
107
  _this.showProfilecard(DELAY_MS_SHOW);
108
108
  });
@@ -122,7 +122,7 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
122
122
  });
123
123
  _this.showProfilecard(0);
124
124
  if (!_this.state.visible) {
125
- _this.fireAnalytics(cardTriggered('team', 'click'));
125
+ _this.fireAnalytics(cardTriggered('team', 'click', _this.props.teamId));
126
126
  }
127
127
  }
128
128
  });
@@ -11,6 +11,7 @@ import { Box, Inline, Pressable, Stack, Text } from '@atlaskit/primitives/compil
11
11
  import TeamAvatar from '@atlaskit/teams-avatar';
12
12
  import { TeamContainers, useTeamContainers } from '@atlaskit/teams-public';
13
13
  import { fireEvent } from '../../util/analytics';
14
+ import { ButtonSection } from './team-actions';
14
15
  import { TeamConnections } from './team-connections/main';
15
16
  import { TeamContainersSkeleton } from './team-containers-skeleton';
16
17
  var noop = function noop() {};
@@ -56,7 +57,9 @@ export var TeamProfileCard = function TeamProfileCard(_ref3) {
56
57
  cloudId = _ref3.cloudId,
57
58
  userId = _ref3.userId,
58
59
  isVerified = _ref3.isVerified,
59
- teamProfileUrl = _ref3.teamProfileUrl;
60
+ teamProfileUrl = _ref3.teamProfileUrl,
61
+ isKudosEnabled = _ref3.isKudosEnabled,
62
+ otherActions = _ref3.otherActions;
60
63
  var _useTeamContainers = useTeamContainers(teamId),
61
64
  teamContainers = _useTeamContainers.teamContainers,
62
65
  loading = _useTeamContainers.loading;
@@ -137,7 +140,11 @@ export var TeamProfileCard = function TeamProfileCard(_ref3) {
137
140
  },
138
141
  filterContainerId: containerId,
139
142
  isDisplayedOnProfileCard: true
140
- })), teamProfileUrl && /*#__PURE__*/React.createElement(Stack, {
143
+ })), isKudosEnabled || otherActions ? /*#__PURE__*/React.createElement(ButtonSection, {
144
+ teamProfileUrl: teamProfileUrl,
145
+ isKudosEnabled: isKudosEnabled,
146
+ otherActions: otherActions
147
+ }) : teamProfileUrl && /*#__PURE__*/React.createElement(Stack, {
141
148
  xcss: styles.viewProfileContainerStyles
142
149
  }, /*#__PURE__*/React.createElement(Pressable, {
143
150
  onClick: onClick,
@@ -0,0 +1,7 @@
1
+ ._15a5nqa1{border-top-style:solid}
2
+ ._16jlkb7n{flex-grow:1}
3
+ ._19bv1ejb{padding-left:var(--ds-space-300,24px)}
4
+ ._1i53muej{border-top-color:var(--ds-border,#091e4224)}
5
+ ._ca0qpxbi{padding-top:var(--ds-space-200,1pc)}
6
+ ._u5f31ejb{padding-right:var(--ds-space-300,24px)}
7
+ ._uwhke4h9{border-top-width:var(--ds-border-width,1px)}
@@ -0,0 +1,61 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
+ import "./index.compiled.css";
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ import React, { useCallback } from 'react';
6
+ import { useIntl } from 'react-intl-next';
7
+ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
8
+ import { LinkButton } from '@atlaskit/button/new';
9
+ import { ButtonItem } from '@atlaskit/menu';
10
+ import { Box, Inline, Stack } from '@atlaskit/primitives';
11
+ import { fireEvent } from '../../../util/analytics';
12
+ import { messages } from './messages';
13
+ import { MoreActions } from './more-actions';
14
+ var GIVE_KUDOS_ACTION_ID = 'give-kudos';
15
+ var styles = {
16
+ containerStyles: "_uwhke4h9 _15a5nqa1 _1i53muej _19bv1ejb _u5f31ejb _ca0qpxbi",
17
+ actionContainerStyles: "_16jlkb7n"
18
+ };
19
+ export var ButtonSection = function ButtonSection(_ref) {
20
+ var teamProfileUrl = _ref.teamProfileUrl,
21
+ isKudosEnabled = _ref.isKudosEnabled,
22
+ otherActions = _ref.otherActions;
23
+ var _useAnalyticsEvents = useAnalyticsEvents(),
24
+ createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
25
+ var _useIntl = useIntl(),
26
+ formatMessage = _useIntl.formatMessage;
27
+ var onTeamProfileClick = useCallback(function () {
28
+ if (createAnalyticsEvent) {
29
+ fireEvent(createAnalyticsEvent, {
30
+ action: 'clicked',
31
+ actionSubject: 'button',
32
+ actionSubjectId: 'viewTeamProfileButton',
33
+ attributes: {}
34
+ });
35
+ }
36
+ }, [createAnalyticsEvent]);
37
+ var extraActions = [];
38
+ if (isKudosEnabled) {
39
+ extraActions.push({
40
+ id: GIVE_KUDOS_ACTION_ID,
41
+ item: /*#__PURE__*/React.createElement(ButtonItem, null, formatMessage(messages.giveKudos))
42
+ });
43
+ }
44
+ if (otherActions) {
45
+ extraActions.push.apply(extraActions, _toConsumableArray(otherActions));
46
+ }
47
+ return /*#__PURE__*/React.createElement(Stack, {
48
+ xcss: styles.containerStyles
49
+ }, /*#__PURE__*/React.createElement(Inline, {
50
+ space: "space.050"
51
+ }, teamProfileUrl && /*#__PURE__*/React.createElement(Box, {
52
+ xcss: styles.actionContainerStyles
53
+ }, /*#__PURE__*/React.createElement(LinkButton, {
54
+ onClick: onTeamProfileClick,
55
+ href: teamProfileUrl,
56
+ target: "_blank",
57
+ shouldFitContainer: true
58
+ }, formatMessage(messages.viewProfile))), extraActions.length > 0 && /*#__PURE__*/React.createElement(MoreActions, {
59
+ actions: extraActions
60
+ })));
61
+ };
@@ -0,0 +1,13 @@
1
+ import { defineMessages } from 'react-intl-next';
2
+ export var messages = defineMessages({
3
+ viewProfile: {
4
+ id: 'team-profile-card.team-actions.view-profile',
5
+ defaultMessage: 'View profile',
6
+ description: 'View profile button text'
7
+ },
8
+ giveKudos: {
9
+ id: 'team-profile-card.team-actions.give-kudos',
10
+ defaultMessage: 'Give kudos',
11
+ description: 'Give kudos button text'
12
+ }
13
+ });
@@ -0,0 +1,49 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
+ import React, { useCallback, useState } from 'react';
4
+ import { useIntl } from 'react-intl-next';
5
+ import { IconButton } from '@atlaskit/button/new';
6
+ import MoreIcon from '@atlaskit/icon/core/migration/show-more-horizontal--more';
7
+ import { MenuGroup, Section } from '@atlaskit/menu';
8
+ import Popup from '@atlaskit/popup';
9
+ import { Box } from '@atlaskit/primitives';
10
+ import { messages } from './messages';
11
+ export var MoreActions = function MoreActions(_ref) {
12
+ var actions = _ref.actions;
13
+ var _useIntl = useIntl(),
14
+ formatMessage = _useIntl.formatMessage;
15
+ var _useState = useState(false),
16
+ _useState2 = _slicedToArray(_useState, 2),
17
+ isOpen = _useState2[0],
18
+ setOpen = _useState2[1];
19
+ var onMoreClick = useCallback(function (shouldBeOpen) {
20
+ setOpen(shouldBeOpen);
21
+ }, []);
22
+ return /*#__PURE__*/React.createElement(Popup, {
23
+ isOpen: isOpen,
24
+ onClose: function onClose() {
25
+ return setOpen(false);
26
+ },
27
+ content: function content() {
28
+ return /*#__PURE__*/React.createElement(MenuGroup, {
29
+ spacing: "cozy"
30
+ }, /*#__PURE__*/React.createElement(Section, null, actions.map(function (action) {
31
+ return /*#__PURE__*/React.createElement(Box, {
32
+ key: action.id
33
+ }, action.item);
34
+ })));
35
+ },
36
+ trigger: function trigger(triggerProps) {
37
+ return /*#__PURE__*/React.createElement(IconButton, _extends({}, triggerProps, {
38
+ icon: MoreIcon,
39
+ label: formatMessage(messages.showMoreIconLabel),
40
+ onClick: function onClick() {
41
+ return onMoreClick(!isOpen);
42
+ },
43
+ isSelected: isOpen
44
+ }));
45
+ },
46
+ placement: "right-start",
47
+ shouldRenderToParent: false
48
+ });
49
+ };
@@ -0,0 +1,8 @@
1
+ import { defineMessages } from 'react-intl-next';
2
+ export var messages = defineMessages({
3
+ showMoreIconLabel: {
4
+ id: 'team-profile-card.team-actions.more-actions.show-more-icon-label',
5
+ defaultMessage: 'Show more',
6
+ description: 'Show more icon label'
7
+ }
8
+ });
@@ -39,7 +39,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
39
39
  actionSubjectId: actionSubjectId,
40
40
  attributes: _objectSpread(_objectSpread({
41
41
  packageName: "@atlaskit/profilecard",
42
- packageVersion: "23.7.9"
42
+ packageVersion: "23.9.0"
43
43
  }, attributes), {}, {
44
44
  firedAt: Math.round(getPageTime())
45
45
  })
@@ -57,10 +57,12 @@ var getActionSubject = function getActionSubject(type) {
57
57
  return 'user';
58
58
  }
59
59
  };
60
- export var cardTriggered = function cardTriggered(type, method) {
61
- return createEvent('ui', 'triggered', getActionSubject(type), undefined, {
60
+ export var cardTriggered = function cardTriggered(type, method, teamId) {
61
+ return createEvent('ui', 'triggered', getActionSubject(type), undefined, _objectSpread({
62
62
  method: method
63
- });
63
+ }, type === 'team' && teamId ? {
64
+ teamId: teamId
65
+ } : {}));
64
66
  };
65
67
  export var teamRequestAnalytics = function teamRequestAnalytics(action, attributes) {
66
68
  return createEvent('operational', action, TEAM_SUBJECT, 'request', attributes);
@@ -1,4 +1,8 @@
1
- /// <reference types="react" />
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import React from 'react';
2
6
  import { type AvatarProps } from '@atlaskit/avatar-group';
3
7
  interface TeamProfileCardProps {
4
8
  containerId: string;
@@ -13,6 +17,11 @@ interface TeamProfileCardProps {
13
17
  userId: string;
14
18
  isVerified?: boolean;
15
19
  teamProfileUrl?: string;
20
+ isKudosEnabled?: boolean;
21
+ otherActions?: {
22
+ id: string;
23
+ item: React.ReactNode;
24
+ }[];
16
25
  }
17
- export declare const TeamProfileCard: ({ containerId, teamId, displayName, description, avatarImageUrl, headerImageUrl, memberAvatars, memberCount, cloudId, userId, isVerified, teamProfileUrl, }: TeamProfileCardProps) => JSX.Element;
26
+ export declare const TeamProfileCard: ({ containerId, teamId, displayName, description, avatarImageUrl, headerImageUrl, memberAvatars, memberCount, cloudId, userId, isVerified, teamProfileUrl, isKudosEnabled, otherActions, }: TeamProfileCardProps) => JSX.Element;
18
27
  export {};
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { ActionItem } from './more-actions';
3
+ type ButtonSectionProps = {
4
+ teamProfileUrl?: string;
5
+ isKudosEnabled?: boolean;
6
+ otherActions?: ActionItem[];
7
+ };
8
+ export declare const ButtonSection: ({ teamProfileUrl, isKudosEnabled, otherActions, }: ButtonSectionProps) => React.JSX.Element;
9
+ export {};
@@ -0,0 +1,12 @@
1
+ export declare const messages: {
2
+ viewProfile: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ giveKudos: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ description: string;
11
+ };
12
+ };
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ export type ActionItem = {
3
+ id: string;
4
+ item: React.ReactNode;
5
+ };
6
+ type MoreActionsProps = {
7
+ actions: ActionItem[];
8
+ };
9
+ export declare const MoreActions: ({ actions }: MoreActionsProps) => React.JSX.Element;
10
+ export {};
@@ -0,0 +1,7 @@
1
+ export declare const messages: {
2
+ showMoreIconLabel: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ };
@@ -12,7 +12,7 @@ interface AnalyticsEvent {
12
12
  source?: string;
13
13
  }
14
14
  export declare const fireEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent | undefined, body: AnalyticsEvent) => void;
15
- export declare const cardTriggered: (type: ProfileType, method: 'hover' | 'click') => AnalyticsEventPayload;
15
+ export declare const cardTriggered: (type: ProfileType, method: 'hover' | 'click', teamId?: string) => AnalyticsEventPayload;
16
16
  export declare const teamRequestAnalytics: (action: 'triggered' | 'succeeded' | 'failed', attributes?: {
17
17
  duration: number;
18
18
  } & GenericAttributes) => AnalyticsEventPayload;
@@ -1,4 +1,8 @@
1
- /// <reference types="react" />
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import React from 'react';
2
6
  import { type AvatarProps } from '@atlaskit/avatar-group';
3
7
  interface TeamProfileCardProps {
4
8
  containerId: string;
@@ -13,6 +17,11 @@ interface TeamProfileCardProps {
13
17
  userId: string;
14
18
  isVerified?: boolean;
15
19
  teamProfileUrl?: string;
20
+ isKudosEnabled?: boolean;
21
+ otherActions?: {
22
+ id: string;
23
+ item: React.ReactNode;
24
+ }[];
16
25
  }
17
- export declare const TeamProfileCard: ({ containerId, teamId, displayName, description, avatarImageUrl, headerImageUrl, memberAvatars, memberCount, cloudId, userId, isVerified, teamProfileUrl, }: TeamProfileCardProps) => JSX.Element;
26
+ export declare const TeamProfileCard: ({ containerId, teamId, displayName, description, avatarImageUrl, headerImageUrl, memberAvatars, memberCount, cloudId, userId, isVerified, teamProfileUrl, isKudosEnabled, otherActions, }: TeamProfileCardProps) => JSX.Element;
18
27
  export {};
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { ActionItem } from './more-actions';
3
+ type ButtonSectionProps = {
4
+ teamProfileUrl?: string;
5
+ isKudosEnabled?: boolean;
6
+ otherActions?: ActionItem[];
7
+ };
8
+ export declare const ButtonSection: ({ teamProfileUrl, isKudosEnabled, otherActions, }: ButtonSectionProps) => React.JSX.Element;
9
+ export {};
@@ -0,0 +1,12 @@
1
+ export declare const messages: {
2
+ viewProfile: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ giveKudos: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ description: string;
11
+ };
12
+ };
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ export type ActionItem = {
3
+ id: string;
4
+ item: React.ReactNode;
5
+ };
6
+ type MoreActionsProps = {
7
+ actions: ActionItem[];
8
+ };
9
+ export declare const MoreActions: ({ actions }: MoreActionsProps) => React.JSX.Element;
10
+ export {};
@@ -0,0 +1,7 @@
1
+ export declare const messages: {
2
+ showMoreIconLabel: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ };
@@ -12,7 +12,7 @@ interface AnalyticsEvent {
12
12
  source?: string;
13
13
  }
14
14
  export declare const fireEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent | undefined, body: AnalyticsEvent) => void;
15
- export declare const cardTriggered: (type: ProfileType, method: 'hover' | 'click') => AnalyticsEventPayload;
15
+ export declare const cardTriggered: (type: ProfileType, method: 'hover' | 'click', teamId?: string) => AnalyticsEventPayload;
16
16
  export declare const teamRequestAnalytics: (action: 'triggered' | 'succeeded' | 'failed', attributes?: {
17
17
  duration: number;
18
18
  } & GenericAttributes) => AnalyticsEventPayload;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "23.7.9",
3
+ "version": "23.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/"
@@ -56,10 +56,10 @@
56
56
  "@atlaskit/avatar-group": "^12.0.0",
57
57
  "@atlaskit/button": "^23.0.0",
58
58
  "@atlaskit/css": "^0.10.0",
59
- "@atlaskit/dropdown-menu": "^14.0.0",
59
+ "@atlaskit/dropdown-menu": "^14.1.0",
60
60
  "@atlaskit/empty-state": "^9.0.0",
61
61
  "@atlaskit/focus-ring": "^3.0.0",
62
- "@atlaskit/give-kudos": "^4.0.0",
62
+ "@atlaskit/give-kudos": "^4.1.0",
63
63
  "@atlaskit/heading": "^5.2.0",
64
64
  "@atlaskit/icon": "^25.6.0",
65
65
  "@atlaskit/logo": "^16.0.0",
@@ -68,15 +68,15 @@
68
68
  "@atlaskit/modal-dialog": "^14.1.0",
69
69
  "@atlaskit/people-teams-ui-public": "^3.1.0",
70
70
  "@atlaskit/platform-feature-flags": "^1.1.0",
71
- "@atlaskit/popup": "^4.0.0",
71
+ "@atlaskit/popup": "^4.1.0",
72
72
  "@atlaskit/primitives": "^14.4.0",
73
- "@atlaskit/rovo-agent-components": "^2.6.0",
73
+ "@atlaskit/rovo-agent-components": "^2.7.0",
74
74
  "@atlaskit/rovo-triggers": "^2.10.0",
75
75
  "@atlaskit/spinner": "^18.0.0",
76
76
  "@atlaskit/teams-avatar": "^2.3.0",
77
77
  "@atlaskit/teams-public": "^0.24.0",
78
78
  "@atlaskit/theme": "^18.0.0",
79
- "@atlaskit/tokens": "^4.7.0",
79
+ "@atlaskit/tokens": "^4.8.0",
80
80
  "@atlaskit/tooltip": "^20.0.0",
81
81
  "@babel/runtime": "^7.0.0",
82
82
  "@compiled/react": "^0.18.3",
@@ -95,7 +95,7 @@
95
95
  "react-dom": "^18.2.0"
96
96
  },
97
97
  "devDependencies": {
98
- "@af/visual-regression": "^1.3.0",
98
+ "@af/visual-regression": "workspace:^",
99
99
  "@atlassian/feature-flags-test-utils": "^0.3.0",
100
100
  "@atlassian/ptc-test-utils": "^0.8.0",
101
101
  "@testing-library/react": "^13.4.0",