@atlaskit/profilecard 23.12.0 → 23.13.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 (46) hide show
  1. package/CHANGELOG.md +8 -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-profile-card/main.compiled.css +5 -0
  5. package/dist/cjs/components/team-profile-card/main.js +113 -11
  6. package/dist/cjs/components/team-profile-card/mocks.js +22 -0
  7. package/dist/cjs/components/team-profile-card/team-actions/index.js +13 -45
  8. package/dist/cjs/components/team-profile-card/team-actions/messages.js +0 -5
  9. package/dist/cjs/components/team-profile-card/team-connections/main.js +52 -1
  10. package/dist/cjs/components/team-profile-card/team-containers-skeleton/index.compiled.css +3 -1
  11. package/dist/cjs/components/team-profile-card/team-containers-skeleton/index.js +6 -3
  12. package/dist/cjs/util/analytics.js +1 -1
  13. package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +1 -1
  14. package/dist/es2019/client/getTeamFromAGG.js +1 -1
  15. package/dist/es2019/components/team-profile-card/main.compiled.css +5 -0
  16. package/dist/es2019/components/team-profile-card/main.js +116 -14
  17. package/dist/es2019/components/team-profile-card/mocks.js +22 -0
  18. package/dist/es2019/components/team-profile-card/team-actions/index.js +10 -43
  19. package/dist/es2019/components/team-profile-card/team-actions/messages.js +0 -5
  20. package/dist/es2019/components/team-profile-card/team-connections/main.js +53 -0
  21. package/dist/es2019/components/team-profile-card/team-containers-skeleton/index.compiled.css +3 -1
  22. package/dist/es2019/components/team-profile-card/team-containers-skeleton/index.js +6 -3
  23. package/dist/es2019/util/analytics.js +1 -1
  24. package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +1 -1
  25. package/dist/esm/client/getTeamFromAGG.js +1 -1
  26. package/dist/esm/components/team-profile-card/main.compiled.css +5 -0
  27. package/dist/esm/components/team-profile-card/main.js +116 -14
  28. package/dist/esm/components/team-profile-card/mocks.js +22 -0
  29. package/dist/esm/components/team-profile-card/team-actions/index.js +12 -44
  30. package/dist/esm/components/team-profile-card/team-actions/messages.js +0 -5
  31. package/dist/esm/components/team-profile-card/team-connections/main.js +50 -0
  32. package/dist/esm/components/team-profile-card/team-containers-skeleton/index.compiled.css +3 -1
  33. package/dist/esm/components/team-profile-card/team-containers-skeleton/index.js +6 -3
  34. package/dist/esm/util/analytics.js +1 -1
  35. package/dist/types/components/team-profile-card/main.d.ts +2 -2
  36. package/dist/types/components/team-profile-card/team-actions/index.d.ts +5 -6
  37. package/dist/types/components/team-profile-card/team-actions/messages.d.ts +0 -5
  38. package/dist/types/components/team-profile-card/team-connections/main.d.ts +1 -0
  39. package/dist/types-ts4.5/components/team-profile-card/main.d.ts +2 -2
  40. package/dist/types-ts4.5/components/team-profile-card/team-actions/index.d.ts +5 -6
  41. package/dist/types-ts4.5/components/team-profile-card/team-actions/messages.d.ts +0 -5
  42. package/dist/types-ts4.5/components/team-profile-card/team-connections/main.d.ts +1 -0
  43. package/package.json +1 -1
  44. package/dist/cjs/components/team-profile-card/team-actions/index.compiled.css +0 -7
  45. package/dist/es2019/components/team-profile-card/team-actions/index.compiled.css +0 -7
  46. package/dist/esm/components/team-profile-card/team-actions/index.compiled.css +0 -7
@@ -1,57 +1,33 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
2
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
5
- var _excluded = ["teamProfileUrl", "isKudosEnabled", "otherActions", "loading"];
6
- import "./index.compiled.css";
7
- import { ax, ix } from "@compiled/react/runtime";
4
+ var _excluded = ["isKudosEnabled", "otherActions", "loading"];
8
5
  import React, { Suspense, useCallback, useState } from 'react';
9
6
  import { useIntl } from 'react-intl-next';
10
- import { useAnalyticsEvents } from '@atlaskit/analytics-next';
11
- import { LinkButton } from '@atlaskit/button/new';
12
7
  import { GiveKudosLauncherLazy, KudosType } from '@atlaskit/give-kudos';
13
8
  import { ButtonItem } from '@atlaskit/menu';
14
- import { Box, Inline, Stack } from '@atlaskit/primitives';
15
9
  import { extractIdFromAri } from '../../../client/getTeamFromAGG';
16
- import { fireEvent } from '../../../util/analytics';
17
10
  import { messages } from './messages';
18
11
  import { MoreActions } from './more-actions';
19
12
  var GIVE_KUDOS_ACTION_ID = 'give-kudos';
20
- var styles = {
21
- containerStyles: "_uwhke4h9 _15a5nqa1 _1i53muej _19bv1ejb _u5f31ejb _ca0qpxbi",
22
- actionContainerStyles: "_16jlkb7n"
23
- };
24
- export var ButtonSection = function ButtonSection(_ref) {
25
- var teamProfileUrl = _ref.teamProfileUrl,
26
- isKudosEnabled = _ref.isKudosEnabled,
13
+ export var TeamActions = function TeamActions(_ref) {
14
+ var isKudosEnabled = _ref.isKudosEnabled,
27
15
  otherActions = _ref.otherActions,
28
16
  loading = _ref.loading,
29
17
  props = _objectWithoutProperties(_ref, _excluded);
30
- var _useAnalyticsEvents = useAnalyticsEvents(),
31
- createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
32
18
  var _useIntl = useIntl(),
33
19
  formatMessage = _useIntl.formatMessage;
34
20
  var _useState = useState(false),
35
21
  _useState2 = _slicedToArray(_useState, 2),
36
22
  isKudosOpen = _useState2[0],
37
23
  setIsKudosOpen = _useState2[1];
38
- var onTeamProfileClick = useCallback(function () {
39
- if (createAnalyticsEvent) {
40
- fireEvent(createAnalyticsEvent, {
41
- action: 'clicked',
42
- actionSubject: 'button',
43
- actionSubjectId: 'viewTeamProfileButton',
44
- attributes: {}
45
- });
46
- }
47
- }, [createAnalyticsEvent]);
48
24
  var onKudosClick = useCallback(function () {
49
25
  setIsKudosOpen(true);
50
26
  }, []);
51
- var extraActions = [];
27
+ var actions = [];
52
28
  var kudosProps = null;
53
29
  if (isKudosEnabled) {
54
- extraActions.push({
30
+ actions.push({
55
31
  id: GIVE_KUDOS_ACTION_ID,
56
32
  item: /*#__PURE__*/React.createElement(ButtonItem, {
57
33
  onClick: onKudosClick
@@ -60,23 +36,15 @@ export var ButtonSection = function ButtonSection(_ref) {
60
36
  kudosProps = props;
61
37
  }
62
38
  if (otherActions) {
63
- extraActions.push.apply(extraActions, _toConsumableArray(otherActions));
39
+ actions.push.apply(actions, _toConsumableArray(otherActions));
64
40
  }
65
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Stack, {
66
- xcss: styles.containerStyles
67
- }, /*#__PURE__*/React.createElement(Inline, {
68
- space: "space.050"
69
- }, teamProfileUrl && /*#__PURE__*/React.createElement(Box, {
70
- xcss: styles.actionContainerStyles
71
- }, /*#__PURE__*/React.createElement(LinkButton, {
72
- onClick: onTeamProfileClick,
73
- href: teamProfileUrl,
74
- target: "_blank",
75
- shouldFitContainer: true
76
- }, formatMessage(messages.viewProfile))), extraActions.length > 0 && /*#__PURE__*/React.createElement(MoreActions, {
77
- actions: extraActions,
41
+ if (actions.length === 0) {
42
+ return null;
43
+ }
44
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MoreActions, {
45
+ actions: actions,
78
46
  loading: loading
79
- }))), isKudosEnabled && kudosProps && /*#__PURE__*/React.createElement(Suspense, {
47
+ }), isKudosEnabled && kudosProps && /*#__PURE__*/React.createElement(Suspense, {
80
48
  fallback: null
81
49
  }, /*#__PURE__*/React.createElement(GiveKudosLauncherLazy, {
82
50
  isOpen: isKudosOpen,
@@ -1,10 +1,5 @@
1
1
  import { defineMessages } from 'react-intl-next';
2
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
3
  giveKudos: {
9
4
  id: 'team-profile-card.team-actions.give-kudos',
10
5
  defaultMessage: 'Give kudos',
@@ -3,6 +3,7 @@ import "./main.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React, { useCallback } from 'react';
5
5
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
6
+ import Avatar from '@atlaskit/avatar';
6
7
  import { LinkItem } from '@atlaskit/menu';
7
8
  import { Box, Inline, Stack, Text } from '@atlaskit/primitives/compiled';
8
9
  import { getContainerProperties } from '@atlaskit/teams-public';
@@ -61,4 +62,53 @@ export var TeamConnections = function TeamConnections(_ref) {
61
62
  xcss: styles.containerTypeIconButtonStyles,
62
63
  testId: "container-type-icon"
63
64
  }, icon)));
65
+ };
66
+ export var NewTeamConnections = function NewTeamConnections(_ref2) {
67
+ var containerType = _ref2.containerType,
68
+ title = _ref2.title,
69
+ containerIcon = _ref2.containerIcon,
70
+ link = _ref2.link;
71
+ var _getContainerProperti2 = getContainerProperties(containerType, 'medium'),
72
+ description = _getContainerProperti2.description,
73
+ icon = _getContainerProperti2.icon,
74
+ containerTypeText = _getContainerProperti2.containerTypeText;
75
+ var _useAnalyticsEvents2 = useAnalyticsEvents(),
76
+ createAnalyticsEvent = _useAnalyticsEvents2.createAnalyticsEvent;
77
+ var onClick = useCallback(function () {
78
+ fireEvent(createAnalyticsEvent, {
79
+ action: 'clicked',
80
+ actionSubject: 'teamConnectionItem',
81
+ actionSubjectId: 'teamProfileCard',
82
+ attributes: {
83
+ container: containerType
84
+ }
85
+ });
86
+ }, [containerType, createAnalyticsEvent]);
87
+ return /*#__PURE__*/React.createElement(LinkItem, {
88
+ href: link,
89
+ onClick: onClick,
90
+ description: /*#__PURE__*/React.createElement(Inline, {
91
+ space: "space.050"
92
+ }, /*#__PURE__*/React.createElement(Text, {
93
+ size: "small",
94
+ color: "color.text.subtlest"
95
+ }, description), /*#__PURE__*/React.createElement(Text, {
96
+ size: "small",
97
+ color: "color.text.subtlest"
98
+ }, containerTypeText)),
99
+ iconBefore: /*#__PURE__*/React.createElement(Avatar, {
100
+ size: "small",
101
+ appearance: "square",
102
+ src: containerIcon,
103
+ testId: "linked-container-icon"
104
+ }),
105
+ iconAfter: /*#__PURE__*/React.createElement(Box, {
106
+ backgroundColor: 'color.background.neutral.subtle',
107
+ xcss: styles.containerTypeIconButtonStyles,
108
+ testId: "container-type-icon"
109
+ }, icon)
110
+ }, /*#__PURE__*/React.createElement(Text, {
111
+ maxLines: 1,
112
+ color: "color.text"
113
+ }, title));
64
114
  };
@@ -1,3 +1,5 @@
1
1
 
2
2
  ._2rko1q77{border-radius:var(--ds-border-radius-400,1pc)}
3
- ._1rjc1b66{padding-block:var(--ds-space-050,4px)}._1bsbvbgk{width:4pc}
3
+ ._1rjc1b66{padding-block:var(--ds-space-050,4px)}._1bsbvbgk{width:4pc}
4
+ ._bozgpxbi{padding-inline-start:var(--ds-space-200,1pc)}
5
+ ._y4tipxbi{padding-inline-end:var(--ds-space-200,1pc)}
@@ -6,11 +6,14 @@ import React from 'react';
6
6
  import { Box, Stack } from '@atlaskit/primitives/compiled';
7
7
  import { LinkedContainerCardSkeleton } from './linked-container-card-skeleton';
8
8
  var styles = {
9
- showMoreButtonSkeleton: "_2rko1q77 _1rjc1b66 _1bsbvbgk"
9
+ showMoreButtonSkeleton: "_2rko1q77 _1rjc1b66 _1bsbvbgk",
10
+ containerSkeletonWrapper: "_bozgpxbi _y4tipxbi"
10
11
  };
11
12
  export var TeamContainersSkeleton = function TeamContainersSkeleton(_ref) {
12
13
  var numberOfContainers = _ref.numberOfContainers;
13
- return /*#__PURE__*/React.createElement(Stack, {
14
+ return /*#__PURE__*/React.createElement(Box, {
15
+ xcss: styles.containerSkeletonWrapper
16
+ }, /*#__PURE__*/React.createElement(Stack, {
14
17
  space: "space.200",
15
18
  testId: "profile-card-team-containers-skeleton"
16
19
  }, /*#__PURE__*/React.createElement(Stack, {
@@ -22,5 +25,5 @@ export var TeamContainersSkeleton = function TeamContainersSkeleton(_ref) {
22
25
  })), /*#__PURE__*/React.createElement(Box, {
23
26
  backgroundColor: "color.background.neutral",
24
27
  xcss: styles.showMoreButtonSkeleton
25
- }));
28
+ })));
26
29
  };
@@ -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.12.0"
42
+ packageVersion: "23.13.0"
43
43
  }, attributes), {}, {
44
44
  firedAt: Math.round(getPageTime())
45
45
  })
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { type AvatarProps } from '@atlaskit/avatar-group';
3
- import { type ButtonSectionProps } from './team-actions';
3
+ import { TeamActionsProps } from './team-actions';
4
4
  type TeamProfileCardProps = {
5
5
  containerId: string;
6
6
  teamId: string;
@@ -14,6 +14,6 @@ type TeamProfileCardProps = {
14
14
  userId: string;
15
15
  isVerified?: boolean;
16
16
  teamProfileUrl?: string;
17
- } & ButtonSectionProps;
17
+ } & TeamActionsProps;
18
18
  export declare const TeamProfileCard: ({ containerId, teamId, displayName, description, avatarImageUrl, headerImageUrl, memberAvatars, memberCount, cloudId, userId, isVerified, teamProfileUrl, ...props }: TeamProfileCardProps) => JSX.Element;
19
19
  export {};
@@ -1,20 +1,19 @@
1
1
  import React from 'react';
2
2
  import { type ActionItem } from './more-actions';
3
- type BaseButtonSectionProps = {
4
- teamProfileUrl?: string;
3
+ type BaseTeamActionsProps = {
5
4
  otherActions?: ActionItem[];
6
5
  cloudId: string;
7
6
  teamId: string;
8
7
  loading?: boolean;
9
8
  };
10
- type KudosEnabledProps = BaseButtonSectionProps & {
9
+ type KudosEnabledProps = BaseTeamActionsProps & {
11
10
  isKudosEnabled: true;
12
11
  teamCentralBaseUrl: string;
13
12
  analyticsSource: string;
14
13
  };
15
- type KudosDisabledProps = BaseButtonSectionProps & {
14
+ type KudosDisabledProps = BaseTeamActionsProps & {
16
15
  isKudosEnabled?: false;
17
16
  };
18
- export type ButtonSectionProps = KudosEnabledProps | KudosDisabledProps;
19
- export declare const ButtonSection: ({ teamProfileUrl, isKudosEnabled, otherActions, loading, ...props }: ButtonSectionProps) => React.JSX.Element;
17
+ export type TeamActionsProps = KudosEnabledProps | KudosDisabledProps;
18
+ export declare const TeamActions: ({ isKudosEnabled, otherActions, loading, ...props }: TeamActionsProps) => React.JSX.Element | null;
20
19
  export {};
@@ -1,9 +1,4 @@
1
1
  export declare const messages: {
2
- viewProfile: {
3
- id: string;
4
- defaultMessage: string;
5
- description: string;
6
- };
7
2
  giveKudos: {
8
3
  id: string;
9
4
  defaultMessage: string;
@@ -1,3 +1,4 @@
1
1
  import React from 'react';
2
2
  import { type LinkedContainerCardProps } from '@atlaskit/teams-public';
3
3
  export declare const TeamConnections: ({ containerType, title, containerIcon, link, }: LinkedContainerCardProps) => React.JSX.Element;
4
+ export declare const NewTeamConnections: ({ containerType, title, containerIcon, link, }: LinkedContainerCardProps) => React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { type AvatarProps } from '@atlaskit/avatar-group';
3
- import { type ButtonSectionProps } from './team-actions';
3
+ import { TeamActionsProps } from './team-actions';
4
4
  type TeamProfileCardProps = {
5
5
  containerId: string;
6
6
  teamId: string;
@@ -14,6 +14,6 @@ type TeamProfileCardProps = {
14
14
  userId: string;
15
15
  isVerified?: boolean;
16
16
  teamProfileUrl?: string;
17
- } & ButtonSectionProps;
17
+ } & TeamActionsProps;
18
18
  export declare const TeamProfileCard: ({ containerId, teamId, displayName, description, avatarImageUrl, headerImageUrl, memberAvatars, memberCount, cloudId, userId, isVerified, teamProfileUrl, ...props }: TeamProfileCardProps) => JSX.Element;
19
19
  export {};
@@ -1,20 +1,19 @@
1
1
  import React from 'react';
2
2
  import { type ActionItem } from './more-actions';
3
- type BaseButtonSectionProps = {
4
- teamProfileUrl?: string;
3
+ type BaseTeamActionsProps = {
5
4
  otherActions?: ActionItem[];
6
5
  cloudId: string;
7
6
  teamId: string;
8
7
  loading?: boolean;
9
8
  };
10
- type KudosEnabledProps = BaseButtonSectionProps & {
9
+ type KudosEnabledProps = BaseTeamActionsProps & {
11
10
  isKudosEnabled: true;
12
11
  teamCentralBaseUrl: string;
13
12
  analyticsSource: string;
14
13
  };
15
- type KudosDisabledProps = BaseButtonSectionProps & {
14
+ type KudosDisabledProps = BaseTeamActionsProps & {
16
15
  isKudosEnabled?: false;
17
16
  };
18
- export type ButtonSectionProps = KudosEnabledProps | KudosDisabledProps;
19
- export declare const ButtonSection: ({ teamProfileUrl, isKudosEnabled, otherActions, loading, ...props }: ButtonSectionProps) => React.JSX.Element;
17
+ export type TeamActionsProps = KudosEnabledProps | KudosDisabledProps;
18
+ export declare const TeamActions: ({ isKudosEnabled, otherActions, loading, ...props }: TeamActionsProps) => React.JSX.Element | null;
20
19
  export {};
@@ -1,9 +1,4 @@
1
1
  export declare const messages: {
2
- viewProfile: {
3
- id: string;
4
- defaultMessage: string;
5
- description: string;
6
- };
7
2
  giveKudos: {
8
3
  id: string;
9
4
  defaultMessage: string;
@@ -1,3 +1,4 @@
1
1
  import React from 'react';
2
2
  import { type LinkedContainerCardProps } from '@atlaskit/teams-public';
3
3
  export declare const TeamConnections: ({ containerType, title, containerIcon, link, }: LinkedContainerCardProps) => React.JSX.Element;
4
+ export declare const NewTeamConnections: ({ containerType, title, containerIcon, link, }: LinkedContainerCardProps) => React.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "23.12.0",
3
+ "version": "23.13.0",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -1,7 +0,0 @@
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)}
@@ -1,7 +0,0 @@
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)}
@@ -1,7 +0,0 @@
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)}