@atlaskit/teams-public 1.1.1 → 1.2.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 (49) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/cjs/controllers/hooks/use-team-web-links/index.js +2 -2
  3. package/dist/cjs/controllers/hooks/use-team-web-links/multi-team.js +4 -4
  4. package/dist/cjs/next/ui/team-containers/team-link-card/index.compiled.css +0 -6
  5. package/dist/cjs/next/ui/team-containers/team-link-card/index.js +2 -9
  6. package/dist/cjs/ui/team-containers/main.js +0 -6
  7. package/dist/cjs/ui/team-containers/team-link-card/index.compiled.css +0 -4
  8. package/dist/cjs/ui/team-containers/team-link-card/index.js +1 -6
  9. package/dist/es2019/controllers/hooks/use-team-web-links/index.js +1 -1
  10. package/dist/es2019/controllers/hooks/use-team-web-links/multi-team.js +3 -3
  11. package/dist/es2019/next/ui/team-containers/team-link-card/index.compiled.css +0 -6
  12. package/dist/es2019/next/ui/team-containers/team-link-card/index.js +2 -9
  13. package/dist/es2019/ui/team-containers/main.js +0 -6
  14. package/dist/es2019/ui/team-containers/team-link-card/index.compiled.css +0 -4
  15. package/dist/es2019/ui/team-containers/team-link-card/index.js +1 -6
  16. package/dist/esm/controllers/hooks/use-team-web-links/index.js +2 -2
  17. package/dist/esm/controllers/hooks/use-team-web-links/multi-team.js +4 -4
  18. package/dist/esm/next/ui/team-containers/team-link-card/index.compiled.css +0 -6
  19. package/dist/esm/next/ui/team-containers/team-link-card/index.js +2 -9
  20. package/dist/esm/ui/team-containers/main.js +0 -6
  21. package/dist/esm/ui/team-containers/team-link-card/index.compiled.css +0 -4
  22. package/dist/esm/ui/team-containers/team-link-card/index.js +1 -6
  23. package/dist/types/common/ui/container-icon/index.d.ts +0 -2
  24. package/dist/types/controllers/hooks/use-team-web-links/index.d.ts +44 -42
  25. package/dist/types/controllers/hooks/use-team-web-links/multi-team.d.ts +10 -16
  26. package/dist/types/index.d.ts +1 -1
  27. package/dist/types/next/ui/team-containers/team-link-card/index.d.ts +1 -3
  28. package/dist/types/ui/team-containers/index.d.ts +1 -1
  29. package/dist/types/ui/team-containers/main.d.ts +2 -2
  30. package/dist/types/ui/team-containers/team-link-card/index.d.ts +1 -3
  31. package/dist/types/ui/team-containers/types.d.ts +2 -2
  32. package/dist/types-ts4.5/common/ui/container-icon/index.d.ts +0 -2
  33. package/dist/types-ts4.5/controllers/hooks/use-team-web-links/index.d.ts +44 -42
  34. package/dist/types-ts4.5/controllers/hooks/use-team-web-links/multi-team.d.ts +10 -16
  35. package/dist/types-ts4.5/index.d.ts +1 -1
  36. package/dist/types-ts4.5/next/ui/team-containers/team-link-card/index.d.ts +1 -3
  37. package/dist/types-ts4.5/ui/team-containers/index.d.ts +1 -1
  38. package/dist/types-ts4.5/ui/team-containers/main.d.ts +2 -2
  39. package/dist/types-ts4.5/ui/team-containers/team-link-card/index.d.ts +1 -3
  40. package/dist/types-ts4.5/ui/team-containers/types.d.ts +2 -2
  41. package/package.json +8 -8
  42. package/dist/cjs/ui/team-containers/linked-container-card/index.compiled.css +0 -23
  43. package/dist/cjs/ui/team-containers/linked-container-card/index.js +0 -173
  44. package/dist/es2019/ui/team-containers/linked-container-card/index.compiled.css +0 -23
  45. package/dist/es2019/ui/team-containers/linked-container-card/index.js +0 -157
  46. package/dist/esm/ui/team-containers/linked-container-card/index.compiled.css +0 -23
  47. package/dist/esm/ui/team-containers/linked-container-card/index.js +0 -164
  48. package/dist/types/ui/team-containers/linked-container-card/index.d.ts +0 -15
  49. package/dist/types-ts4.5/ui/team-containers/linked-container-card/index.d.ts +0 -15
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { type TeamContainerProps } from './types';
3
- export declare const ICON_BACKGROUND: "var(--ds-icon-inverse)";
4
- export declare const ICON_COLOR: "var(--ds-icon-subtle)";
3
+ export declare const ICON_BACKGROUND: 'var(--ds-icon-inverse)';
4
+ export declare const ICON_COLOR: 'var(--ds-icon-subtle)';
5
5
  export declare const MAX_NUMBER_OF_CONTAINERS_TO_SHOW = 4;
6
6
  export declare const TeamContainers: ({ teamId, onAddAContainerClick, onEditContainerClick, components, userId, cloudId, filterContainerId, isDisplayedOnProfileCard, isReadOnly, onError, maxNumberOfContainersToShow, elemBeforeCards, hideSubTextIcon, }: TeamContainerProps) => React.JSX.Element;
@@ -12,10 +12,8 @@ export interface TeamLinkCardProps {
12
12
  subType?: ContainerSubTypes;
13
13
  name?: string;
14
14
  };
15
- iconsLoading?: boolean;
16
- iconHasLoaded?: boolean;
17
15
  openInNewTab?: boolean;
18
16
  isReadOnly?: boolean;
19
17
  hideSubTextIcon?: boolean;
20
18
  }
21
- export declare const TeamLinkCard: ({ containerType, title, containerIcon, link, containerId, containerTypeProperties, onDisconnectButtonClick, onEditLinkClick, iconsLoading, iconHasLoaded, openInNewTab, isReadOnly, hideSubTextIcon, }: TeamLinkCardProps) => React.JSX.Element;
19
+ export declare const TeamLinkCard: ({ containerType, title, containerIcon, link, containerId, containerTypeProperties, onDisconnectButtonClick, onEditLinkClick, openInNewTab, isReadOnly, hideSubTextIcon, }: TeamLinkCardProps) => React.JSX.Element;
@@ -2,7 +2,7 @@ import { type ComponentType } from 'react';
2
2
  import type { GridProps } from '@atlaskit/primitives/compiled';
3
3
  import { type TeamContainersSkeletonProps } from '../../common/ui/team-containers-skeleton';
4
4
  import type { AddContainerCardProps } from './add-container-card';
5
- import { type LinkedContainerCardProps } from './linked-container-card';
5
+ import { type TeamLinkCardProps } from './team-link-card';
6
6
  export type FlagType = FlagAppearance;
7
7
  type FlagAppearance = 'error' | 'info' | 'normal' | 'success' | 'warning';
8
8
  export interface Flag {
@@ -75,7 +75,7 @@ export interface TeamContainersEmptyStateProps {
75
75
  hasNoPermissions?: boolean;
76
76
  }
77
77
  export interface TeamContainersComponent {
78
- ContainerCard?: ComponentType<LinkedContainerCardProps>;
78
+ ContainerCard?: ComponentType<TeamLinkCardProps>;
79
79
  TeamContainersSkeleton?: ComponentType<TeamContainersSkeletonProps>;
80
80
  TeamContainersEmptyState?: ComponentType<TeamContainersEmptyStateProps>;
81
81
  AddContainerCard?: ComponentType<AddContainerCardProps>;
package/package.json CHANGED
@@ -33,27 +33,27 @@
33
33
  "dependencies": {
34
34
  "@atlaskit/afm-i18n-platform-people-and-teams-teams-public": "2.39.0",
35
35
  "@atlaskit/analytics-next": "^11.2.0",
36
- "@atlaskit/avatar": "^25.11.0",
36
+ "@atlaskit/avatar": "^25.14.0",
37
37
  "@atlaskit/button": "^23.11.0",
38
38
  "@atlaskit/css": "^0.19.0",
39
39
  "@atlaskit/dropdown-menu": "^16.8.0",
40
40
  "@atlaskit/feature-gate-js-client": "^5.5.0",
41
41
  "@atlaskit/heading": "^5.4.0",
42
- "@atlaskit/icon": "^34.2.0",
42
+ "@atlaskit/icon": "^34.3.0",
43
43
  "@atlaskit/image": "^3.0.0",
44
44
  "@atlaskit/link": "^3.4.0",
45
- "@atlaskit/modal-dialog": "^14.15.0",
45
+ "@atlaskit/modal-dialog": "^14.18.0",
46
46
  "@atlaskit/people-teams-ui-public": "^4.0.0",
47
47
  "@atlaskit/platform-feature-flags": "^1.1.0",
48
48
  "@atlaskit/primitives": "^19.0.0",
49
49
  "@atlaskit/skeleton": "^2.1.0",
50
50
  "@atlaskit/teams-app-internal-analytics": "^1.27.0",
51
- "@atlaskit/teams-app-internal-navigation": "^1.8.0",
51
+ "@atlaskit/teams-app-internal-navigation": "^1.9.0",
52
52
  "@atlaskit/teams-app-internal-product-permissions": "^1.3.0",
53
53
  "@atlaskit/teams-client": "^4.32.0",
54
- "@atlaskit/tile": "^1.0.0",
54
+ "@atlaskit/tile": "^1.1.0",
55
55
  "@atlaskit/tokens": "^13.0.0",
56
- "@atlaskit/tooltip": "^21.1.0",
56
+ "@atlaskit/tooltip": "^21.2.0",
57
57
  "@babel/runtime": "^7.0.0",
58
58
  "@compiled/react": "^0.20.0",
59
59
  "@types/string-hash": "^1.1.3",
@@ -76,7 +76,7 @@
76
76
  "@atlassian/feature-flags-test-utils": "^1.0.0",
77
77
  "@atlassian/ptc-test-utils": "^0.12.0",
78
78
  "@atlassian/react-compiler-gating": "workspace:^",
79
- "@atlassian/teams-app-internal-playground": "^2.1.0",
79
+ "@atlassian/teams-app-internal-playground": "^2.3.0",
80
80
  "@atlassian/testing-library": "^0.5.0",
81
81
  "@testing-library/react": "^16.3.0",
82
82
  "@testing-library/user-event": "^14.4.3",
@@ -118,7 +118,7 @@
118
118
  }
119
119
  },
120
120
  "name": "@atlaskit/teams-public",
121
- "version": "1.1.1",
121
+ "version": "1.2.0",
122
122
  "description": "Public components related to teams",
123
123
  "author": "Atlassian Pty Ltd",
124
124
  "license": "Apache-2.0",
@@ -1,23 +0,0 @@
1
-
2
- ._2rkoy0do{border-radius:var(--ds-radius-small,8px)}
3
- ._1h6d8yml{border-color:var(--ds-border-accent-gray,#7d818a)}._12ji1l7x{outline-color:var(--ds-border,#0b120e24)}
4
- ._12y3e4h9{outline-width:var(--ds-border-width,1px)}
5
- ._18u01wug{margin-left:auto}
6
- ._19bvutpp{padding-left:var(--ds-space-150,9pt)}
7
- ._1bah1h6o{justify-content:center}
8
- ._1bahesu3{justify-content:flex-end}
9
- ._1bsb1osq{width:100%}
10
- ._1bsb1u1b{width:34px}
11
- ._1bsbzwfg{width:2pc}
12
- ._1e0c1txw{display:flex}
13
- ._1qu2nqa1{outline-style:solid}
14
- ._1tkezwfg{min-height:2pc}
15
- ._1ul9zwfg{min-width:2pc}
16
- ._4cvr1h6o{align-items:center}
17
- ._4t3i1u1b{height:34px}
18
- ._4t3izwfg{height:2pc}
19
- ._bfhkhfxm{background-color:var(--ds-surface-sunken,#f8f8f8)}
20
- ._ca0qutpp{padding-top:var(--ds-space-150,9pt)}
21
- ._n3tdutpp{padding-bottom:var(--ds-space-150,9pt)}
22
- ._syazi7uo{color:var(--ds-text,#292a2e)}
23
- ._u5f3utpp{padding-right:var(--ds-space-150,9pt)}
@@ -1,173 +0,0 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.39.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.LinkedContainerCard = void 0;
10
- require("./index.compiled.css");
11
- var _runtime = require("@compiled/react/runtime");
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
14
- var _react = _interopRequireWildcard(require("react"));
15
- var _reactIntl = require("react-intl");
16
- var _avatar = _interopRequireDefault(require("@atlaskit/avatar"));
17
- var _new = require("@atlaskit/button/new");
18
- var _cross = _interopRequireDefault(require("@atlaskit/icon/core/cross"));
19
- var _link = _interopRequireDefault(require("@atlaskit/link"));
20
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
21
- var _compiled = require("@atlaskit/primitives/compiled");
22
- var _teamsAppInternalAnalytics = require("@atlaskit/teams-app-internal-analytics");
23
- var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
24
- var _loomAvatar = require("../../../common/ui/loom-avatar");
25
- var _getContainerProperties = require("../../../common/utils/get-container-properties");
26
- 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); }
27
- var messages = (0, _reactIntl.defineMessages)({
28
- disconnectTooltip: {
29
- id: 'ptc-directory.team-containers.disconnect-button.tooltip',
30
- defaultMessage: 'Disconnect',
31
- description: 'Tooltip for the disconnect button'
32
- }
33
- });
34
- var styles = {
35
- container: "_2rkoy0do _1h6d8yml _12y3e4h9 _12ji1l7x _1qu2nqa1 _ca0qutpp _u5f3utpp _n3tdutpp _19bvutpp _syazi7uo",
36
- card: "_4cvr1h6o _1bsb1osq",
37
- iconWrapper: "_1bsbzwfg _4t3izwfg _1ul9zwfg _1tkezwfg",
38
- crossIconWrapper: "_1e0c1txw _4cvr1h6o _1bahesu3 _18u01wug",
39
- linkIconWrapper: "_2rkoy0do _1bsb1u1b _4t3i1u1b _1e0c1txw _4cvr1h6o _1bah1h6o _12ji1l7x _1qu2nqa1 _bfhkhfxm"
40
- };
41
- var LinkedCardWrapper = function LinkedCardWrapper(_ref) {
42
- var children = _ref.children,
43
- href = _ref.href,
44
- handleMouseEnter = _ref.handleMouseEnter,
45
- handleMouseLeave = _ref.handleMouseLeave,
46
- containerType = _ref.containerType,
47
- containerId = _ref.containerId;
48
- var _useState = (0, _react.useState)(false),
49
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
50
- hovered = _useState2[0],
51
- setHovered = _useState2[1];
52
- var onMouseEnter = function onMouseEnter() {
53
- handleMouseEnter();
54
- setHovered(true);
55
- };
56
- var _useAnalyticsEvents = (0, _teamsAppInternalAnalytics.useAnalyticsEvents)(),
57
- fireEvent = _useAnalyticsEvents.fireEvent;
58
- var onMouseLeave = function onMouseLeave() {
59
- handleMouseLeave();
60
- setHovered(false);
61
- };
62
- return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
63
- backgroundColor: hovered ? 'color.background.input.hovered' : 'color.background.input',
64
- xcss: styles.container,
65
- onMouseEnter: onMouseEnter,
66
- onMouseLeave: onMouseLeave,
67
- testId: "linked-container-card-inner"
68
- }, /*#__PURE__*/_react.default.createElement(_link.default, {
69
- href: href,
70
- appearance: "subtle",
71
- onClick: function onClick() {
72
- fireEvent('ui.container.clicked.teamContainer', {
73
- containerSelected: {
74
- container: containerType,
75
- containerId: containerId
76
- }
77
- });
78
- }
79
- }, children));
80
- };
81
- var getContainerIcon = function getContainerIcon(containerType, title, containerIcon) {
82
- if (containerType === 'LoomSpace') {
83
- return /*#__PURE__*/_react.default.createElement(_loomAvatar.LoomSpaceAvatar, {
84
- spaceName: title,
85
- size: 'medium',
86
- testId: "linked-container-icon"
87
- });
88
- }
89
- return /*#__PURE__*/_react.default.createElement(_avatar.default, {
90
- appearance: "square",
91
- size: "medium",
92
- src: containerIcon,
93
- testId: "linked-container-icon"
94
- });
95
- };
96
- var LinkedContainerCard = exports.LinkedContainerCard = function LinkedContainerCard(_ref2) {
97
- var containerType = _ref2.containerType,
98
- title = _ref2.title,
99
- containerIcon = _ref2.containerIcon,
100
- link = _ref2.link,
101
- containerId = _ref2.containerId,
102
- containerTypeProperties = _ref2.containerTypeProperties,
103
- onDisconnectButtonClick = _ref2.onDisconnectButtonClick;
104
- var _getContainerProperti = (0, _getContainerProperties.getContainerProperties)({
105
- containerType: containerType,
106
- iconSize: (0, _platformFeatureFlags.fg)('enable_medium_size_icons_for_team_link_cards') ? 'medium' : 'small',
107
- containerTypeProperties: containerTypeProperties
108
- }),
109
- description = _getContainerProperti.description,
110
- icon = _getContainerProperti.icon,
111
- containerTypeText = _getContainerProperti.containerTypeText;
112
- var _useState3 = (0, _react.useState)(false),
113
- _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
114
- showCloseIcon = _useState4[0],
115
- setShowCloseIcon = _useState4[1];
116
- var _useIntl = (0, _reactIntl.useIntl)(),
117
- formatMessage = _useIntl.formatMessage;
118
- var _useAnalyticsEvents2 = (0, _teamsAppInternalAnalytics.useAnalyticsEvents)(),
119
- fireEvent = _useAnalyticsEvents2.fireEvent;
120
- return /*#__PURE__*/_react.default.createElement(LinkedCardWrapper, {
121
- href: link || '#',
122
- handleMouseEnter: function handleMouseEnter() {
123
- return setShowCloseIcon(true);
124
- },
125
- handleMouseLeave: function handleMouseLeave() {
126
- return setShowCloseIcon(false);
127
- },
128
- containerType: containerType,
129
- containerId: containerId
130
- }, /*#__PURE__*/_react.default.createElement(_compiled.Inline, {
131
- space: "space.100",
132
- xcss: styles.card
133
- }, getContainerIcon(containerType, title, containerIcon), /*#__PURE__*/_react.default.createElement(_compiled.Stack, (0, _platformFeatureFlags.fg)('enable_medium_size_icons_for_team_link_cards') ? {
134
- space: 'space.025'
135
- } : {}, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
136
- maxLines: 1,
137
- weight: "medium",
138
- color: "color.text"
139
- }, title), /*#__PURE__*/_react.default.createElement(_compiled.Flex, {
140
- gap: "space.050",
141
- alignItems: "center"
142
- }, icon, /*#__PURE__*/_react.default.createElement(_compiled.Inline, {
143
- space: "space.050"
144
- }, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
145
- size: "small",
146
- color: "color.text.subtle"
147
- }, description), /*#__PURE__*/_react.default.createElement(_compiled.Text, {
148
- size: "small",
149
- color: "color.text.subtle"
150
- }, containerTypeText)))), showCloseIcon && /*#__PURE__*/_react.default.createElement(_compiled.Box, {
151
- xcss: styles.crossIconWrapper
152
- }, /*#__PURE__*/_react.default.createElement(_tooltip.default, {
153
- content: formatMessage(messages.disconnectTooltip),
154
- position: "top"
155
- }, /*#__PURE__*/_react.default.createElement(_new.IconButton, {
156
- label: "disconnect the container ".concat(title),
157
- appearance: "subtle",
158
- icon: function icon(iconProps) {
159
- return /*#__PURE__*/_react.default.createElement(_cross.default, (0, _extends2.default)({}, iconProps, {
160
- size: "small"
161
- }));
162
- },
163
- spacing: "compact",
164
- onClick: function onClick(e) {
165
- e.preventDefault();
166
- e.stopPropagation();
167
- onDisconnectButtonClick();
168
- fireEvent('ui.button.clicked.containerUnlinkButton', {
169
- containerSelected: null
170
- });
171
- }
172
- })))));
173
- };
@@ -1,23 +0,0 @@
1
-
2
- ._2rkoy0do{border-radius:var(--ds-radius-small,8px)}
3
- ._1h6d8yml{border-color:var(--ds-border-accent-gray,#7d818a)}._12ji1l7x{outline-color:var(--ds-border,#0b120e24)}
4
- ._12y3e4h9{outline-width:var(--ds-border-width,1px)}
5
- ._18u01wug{margin-left:auto}
6
- ._19bvutpp{padding-left:var(--ds-space-150,9pt)}
7
- ._1bah1h6o{justify-content:center}
8
- ._1bahesu3{justify-content:flex-end}
9
- ._1bsb1osq{width:100%}
10
- ._1bsb1u1b{width:34px}
11
- ._1bsbzwfg{width:2pc}
12
- ._1e0c1txw{display:flex}
13
- ._1qu2nqa1{outline-style:solid}
14
- ._1tkezwfg{min-height:2pc}
15
- ._1ul9zwfg{min-width:2pc}
16
- ._4cvr1h6o{align-items:center}
17
- ._4t3i1u1b{height:34px}
18
- ._4t3izwfg{height:2pc}
19
- ._bfhkhfxm{background-color:var(--ds-surface-sunken,#f8f8f8)}
20
- ._ca0qutpp{padding-top:var(--ds-space-150,9pt)}
21
- ._n3tdutpp{padding-bottom:var(--ds-space-150,9pt)}
22
- ._syazi7uo{color:var(--ds-text,#292a2e)}
23
- ._u5f3utpp{padding-right:var(--ds-space-150,9pt)}
@@ -1,157 +0,0 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.39.1 */
2
- import _extends from "@babel/runtime/helpers/extends";
3
- import "./index.compiled.css";
4
- import { ax, ix } from "@compiled/react/runtime";
5
- import React, { useState } from 'react';
6
- import { defineMessages, useIntl } from 'react-intl';
7
- import Avatar from '@atlaskit/avatar';
8
- import { IconButton } from '@atlaskit/button/new';
9
- import CrossIcon from '@atlaskit/icon/core/cross';
10
- import Link from '@atlaskit/link';
11
- import { fg } from '@atlaskit/platform-feature-flags';
12
- import { Box, Flex, Inline, Stack, Text } from '@atlaskit/primitives/compiled';
13
- import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics';
14
- import Tooltip from '@atlaskit/tooltip';
15
- import { LoomSpaceAvatar } from '../../../common/ui/loom-avatar';
16
- import { getContainerProperties } from '../../../common/utils/get-container-properties';
17
- const messages = defineMessages({
18
- disconnectTooltip: {
19
- id: 'ptc-directory.team-containers.disconnect-button.tooltip',
20
- defaultMessage: 'Disconnect',
21
- description: 'Tooltip for the disconnect button'
22
- }
23
- });
24
- const styles = {
25
- container: "_2rkoy0do _1h6d8yml _12y3e4h9 _12ji1l7x _1qu2nqa1 _ca0qutpp _u5f3utpp _n3tdutpp _19bvutpp _syazi7uo",
26
- card: "_4cvr1h6o _1bsb1osq",
27
- iconWrapper: "_1bsbzwfg _4t3izwfg _1ul9zwfg _1tkezwfg",
28
- crossIconWrapper: "_1e0c1txw _4cvr1h6o _1bahesu3 _18u01wug",
29
- linkIconWrapper: "_2rkoy0do _1bsb1u1b _4t3i1u1b _1e0c1txw _4cvr1h6o _1bah1h6o _12ji1l7x _1qu2nqa1 _bfhkhfxm"
30
- };
31
- const LinkedCardWrapper = ({
32
- children,
33
- href,
34
- handleMouseEnter,
35
- handleMouseLeave,
36
- containerType,
37
- containerId
38
- }) => {
39
- const [hovered, setHovered] = useState(false);
40
- const onMouseEnter = () => {
41
- handleMouseEnter();
42
- setHovered(true);
43
- };
44
- const {
45
- fireEvent
46
- } = useAnalyticsEvents();
47
- const onMouseLeave = () => {
48
- handleMouseLeave();
49
- setHovered(false);
50
- };
51
- return /*#__PURE__*/React.createElement(Box, {
52
- backgroundColor: hovered ? 'color.background.input.hovered' : 'color.background.input',
53
- xcss: styles.container,
54
- onMouseEnter: onMouseEnter,
55
- onMouseLeave: onMouseLeave,
56
- testId: "linked-container-card-inner"
57
- }, /*#__PURE__*/React.createElement(Link, {
58
- href: href,
59
- appearance: "subtle",
60
- onClick: () => {
61
- fireEvent('ui.container.clicked.teamContainer', {
62
- containerSelected: {
63
- container: containerType,
64
- containerId
65
- }
66
- });
67
- }
68
- }, children));
69
- };
70
- const getContainerIcon = (containerType, title, containerIcon) => {
71
- if (containerType === 'LoomSpace') {
72
- return /*#__PURE__*/React.createElement(LoomSpaceAvatar, {
73
- spaceName: title,
74
- size: 'medium',
75
- testId: "linked-container-icon"
76
- });
77
- }
78
- return /*#__PURE__*/React.createElement(Avatar, {
79
- appearance: "square",
80
- size: "medium",
81
- src: containerIcon,
82
- testId: "linked-container-icon"
83
- });
84
- };
85
- export const LinkedContainerCard = ({
86
- containerType,
87
- title,
88
- containerIcon,
89
- link,
90
- containerId,
91
- containerTypeProperties,
92
- onDisconnectButtonClick
93
- }) => {
94
- const {
95
- description,
96
- icon,
97
- containerTypeText
98
- } = getContainerProperties({
99
- containerType,
100
- iconSize: fg('enable_medium_size_icons_for_team_link_cards') ? 'medium' : 'small',
101
- containerTypeProperties
102
- });
103
- const [showCloseIcon, setShowCloseIcon] = useState(false);
104
- const {
105
- formatMessage
106
- } = useIntl();
107
- const {
108
- fireEvent
109
- } = useAnalyticsEvents();
110
- return /*#__PURE__*/React.createElement(LinkedCardWrapper, {
111
- href: link || '#',
112
- handleMouseEnter: () => setShowCloseIcon(true),
113
- handleMouseLeave: () => setShowCloseIcon(false),
114
- containerType: containerType,
115
- containerId: containerId
116
- }, /*#__PURE__*/React.createElement(Inline, {
117
- space: "space.100",
118
- xcss: styles.card
119
- }, getContainerIcon(containerType, title, containerIcon), /*#__PURE__*/React.createElement(Stack, fg('enable_medium_size_icons_for_team_link_cards') ? {
120
- space: 'space.025'
121
- } : {}, /*#__PURE__*/React.createElement(Text, {
122
- maxLines: 1,
123
- weight: "medium",
124
- color: "color.text"
125
- }, title), /*#__PURE__*/React.createElement(Flex, {
126
- gap: "space.050",
127
- alignItems: "center"
128
- }, icon, /*#__PURE__*/React.createElement(Inline, {
129
- space: "space.050"
130
- }, /*#__PURE__*/React.createElement(Text, {
131
- size: "small",
132
- color: "color.text.subtle"
133
- }, description), /*#__PURE__*/React.createElement(Text, {
134
- size: "small",
135
- color: "color.text.subtle"
136
- }, containerTypeText)))), showCloseIcon && /*#__PURE__*/React.createElement(Box, {
137
- xcss: styles.crossIconWrapper
138
- }, /*#__PURE__*/React.createElement(Tooltip, {
139
- content: formatMessage(messages.disconnectTooltip),
140
- position: "top"
141
- }, /*#__PURE__*/React.createElement(IconButton, {
142
- label: `disconnect the container ${title}`,
143
- appearance: "subtle",
144
- icon: iconProps => /*#__PURE__*/React.createElement(CrossIcon, _extends({}, iconProps, {
145
- size: "small"
146
- })),
147
- spacing: "compact",
148
- onClick: e => {
149
- e.preventDefault();
150
- e.stopPropagation();
151
- onDisconnectButtonClick();
152
- fireEvent('ui.button.clicked.containerUnlinkButton', {
153
- containerSelected: null
154
- });
155
- }
156
- })))));
157
- };
@@ -1,23 +0,0 @@
1
-
2
- ._2rkoy0do{border-radius:var(--ds-radius-small,8px)}
3
- ._1h6d8yml{border-color:var(--ds-border-accent-gray,#7d818a)}._12ji1l7x{outline-color:var(--ds-border,#0b120e24)}
4
- ._12y3e4h9{outline-width:var(--ds-border-width,1px)}
5
- ._18u01wug{margin-left:auto}
6
- ._19bvutpp{padding-left:var(--ds-space-150,9pt)}
7
- ._1bah1h6o{justify-content:center}
8
- ._1bahesu3{justify-content:flex-end}
9
- ._1bsb1osq{width:100%}
10
- ._1bsb1u1b{width:34px}
11
- ._1bsbzwfg{width:2pc}
12
- ._1e0c1txw{display:flex}
13
- ._1qu2nqa1{outline-style:solid}
14
- ._1tkezwfg{min-height:2pc}
15
- ._1ul9zwfg{min-width:2pc}
16
- ._4cvr1h6o{align-items:center}
17
- ._4t3i1u1b{height:34px}
18
- ._4t3izwfg{height:2pc}
19
- ._bfhkhfxm{background-color:var(--ds-surface-sunken,#f8f8f8)}
20
- ._ca0qutpp{padding-top:var(--ds-space-150,9pt)}
21
- ._n3tdutpp{padding-bottom:var(--ds-space-150,9pt)}
22
- ._syazi7uo{color:var(--ds-text,#292a2e)}
23
- ._u5f3utpp{padding-right:var(--ds-space-150,9pt)}
@@ -1,164 +0,0 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.39.1 */
2
- import _extends from "@babel/runtime/helpers/extends";
3
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
- import "./index.compiled.css";
5
- import { ax, ix } from "@compiled/react/runtime";
6
- import React, { useState } from 'react';
7
- import { defineMessages, useIntl } from 'react-intl';
8
- import Avatar from '@atlaskit/avatar';
9
- import { IconButton } from '@atlaskit/button/new';
10
- import CrossIcon from '@atlaskit/icon/core/cross';
11
- import Link from '@atlaskit/link';
12
- import { fg } from '@atlaskit/platform-feature-flags';
13
- import { Box, Flex, Inline, Stack, Text } from '@atlaskit/primitives/compiled';
14
- import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics';
15
- import Tooltip from '@atlaskit/tooltip';
16
- import { LoomSpaceAvatar } from '../../../common/ui/loom-avatar';
17
- import { getContainerProperties } from '../../../common/utils/get-container-properties';
18
- var messages = defineMessages({
19
- disconnectTooltip: {
20
- id: 'ptc-directory.team-containers.disconnect-button.tooltip',
21
- defaultMessage: 'Disconnect',
22
- description: 'Tooltip for the disconnect button'
23
- }
24
- });
25
- var styles = {
26
- container: "_2rkoy0do _1h6d8yml _12y3e4h9 _12ji1l7x _1qu2nqa1 _ca0qutpp _u5f3utpp _n3tdutpp _19bvutpp _syazi7uo",
27
- card: "_4cvr1h6o _1bsb1osq",
28
- iconWrapper: "_1bsbzwfg _4t3izwfg _1ul9zwfg _1tkezwfg",
29
- crossIconWrapper: "_1e0c1txw _4cvr1h6o _1bahesu3 _18u01wug",
30
- linkIconWrapper: "_2rkoy0do _1bsb1u1b _4t3i1u1b _1e0c1txw _4cvr1h6o _1bah1h6o _12ji1l7x _1qu2nqa1 _bfhkhfxm"
31
- };
32
- var LinkedCardWrapper = function LinkedCardWrapper(_ref) {
33
- var children = _ref.children,
34
- href = _ref.href,
35
- handleMouseEnter = _ref.handleMouseEnter,
36
- handleMouseLeave = _ref.handleMouseLeave,
37
- containerType = _ref.containerType,
38
- containerId = _ref.containerId;
39
- var _useState = useState(false),
40
- _useState2 = _slicedToArray(_useState, 2),
41
- hovered = _useState2[0],
42
- setHovered = _useState2[1];
43
- var onMouseEnter = function onMouseEnter() {
44
- handleMouseEnter();
45
- setHovered(true);
46
- };
47
- var _useAnalyticsEvents = useAnalyticsEvents(),
48
- fireEvent = _useAnalyticsEvents.fireEvent;
49
- var onMouseLeave = function onMouseLeave() {
50
- handleMouseLeave();
51
- setHovered(false);
52
- };
53
- return /*#__PURE__*/React.createElement(Box, {
54
- backgroundColor: hovered ? 'color.background.input.hovered' : 'color.background.input',
55
- xcss: styles.container,
56
- onMouseEnter: onMouseEnter,
57
- onMouseLeave: onMouseLeave,
58
- testId: "linked-container-card-inner"
59
- }, /*#__PURE__*/React.createElement(Link, {
60
- href: href,
61
- appearance: "subtle",
62
- onClick: function onClick() {
63
- fireEvent('ui.container.clicked.teamContainer', {
64
- containerSelected: {
65
- container: containerType,
66
- containerId: containerId
67
- }
68
- });
69
- }
70
- }, children));
71
- };
72
- var getContainerIcon = function getContainerIcon(containerType, title, containerIcon) {
73
- if (containerType === 'LoomSpace') {
74
- return /*#__PURE__*/React.createElement(LoomSpaceAvatar, {
75
- spaceName: title,
76
- size: 'medium',
77
- testId: "linked-container-icon"
78
- });
79
- }
80
- return /*#__PURE__*/React.createElement(Avatar, {
81
- appearance: "square",
82
- size: "medium",
83
- src: containerIcon,
84
- testId: "linked-container-icon"
85
- });
86
- };
87
- export var LinkedContainerCard = function LinkedContainerCard(_ref2) {
88
- var containerType = _ref2.containerType,
89
- title = _ref2.title,
90
- containerIcon = _ref2.containerIcon,
91
- link = _ref2.link,
92
- containerId = _ref2.containerId,
93
- containerTypeProperties = _ref2.containerTypeProperties,
94
- onDisconnectButtonClick = _ref2.onDisconnectButtonClick;
95
- var _getContainerProperti = getContainerProperties({
96
- containerType: containerType,
97
- iconSize: fg('enable_medium_size_icons_for_team_link_cards') ? 'medium' : 'small',
98
- containerTypeProperties: containerTypeProperties
99
- }),
100
- description = _getContainerProperti.description,
101
- icon = _getContainerProperti.icon,
102
- containerTypeText = _getContainerProperti.containerTypeText;
103
- var _useState3 = useState(false),
104
- _useState4 = _slicedToArray(_useState3, 2),
105
- showCloseIcon = _useState4[0],
106
- setShowCloseIcon = _useState4[1];
107
- var _useIntl = useIntl(),
108
- formatMessage = _useIntl.formatMessage;
109
- var _useAnalyticsEvents2 = useAnalyticsEvents(),
110
- fireEvent = _useAnalyticsEvents2.fireEvent;
111
- return /*#__PURE__*/React.createElement(LinkedCardWrapper, {
112
- href: link || '#',
113
- handleMouseEnter: function handleMouseEnter() {
114
- return setShowCloseIcon(true);
115
- },
116
- handleMouseLeave: function handleMouseLeave() {
117
- return setShowCloseIcon(false);
118
- },
119
- containerType: containerType,
120
- containerId: containerId
121
- }, /*#__PURE__*/React.createElement(Inline, {
122
- space: "space.100",
123
- xcss: styles.card
124
- }, getContainerIcon(containerType, title, containerIcon), /*#__PURE__*/React.createElement(Stack, fg('enable_medium_size_icons_for_team_link_cards') ? {
125
- space: 'space.025'
126
- } : {}, /*#__PURE__*/React.createElement(Text, {
127
- maxLines: 1,
128
- weight: "medium",
129
- color: "color.text"
130
- }, title), /*#__PURE__*/React.createElement(Flex, {
131
- gap: "space.050",
132
- alignItems: "center"
133
- }, icon, /*#__PURE__*/React.createElement(Inline, {
134
- space: "space.050"
135
- }, /*#__PURE__*/React.createElement(Text, {
136
- size: "small",
137
- color: "color.text.subtle"
138
- }, description), /*#__PURE__*/React.createElement(Text, {
139
- size: "small",
140
- color: "color.text.subtle"
141
- }, containerTypeText)))), showCloseIcon && /*#__PURE__*/React.createElement(Box, {
142
- xcss: styles.crossIconWrapper
143
- }, /*#__PURE__*/React.createElement(Tooltip, {
144
- content: formatMessage(messages.disconnectTooltip),
145
- position: "top"
146
- }, /*#__PURE__*/React.createElement(IconButton, {
147
- label: "disconnect the container ".concat(title),
148
- appearance: "subtle",
149
- icon: function icon(iconProps) {
150
- return /*#__PURE__*/React.createElement(CrossIcon, _extends({}, iconProps, {
151
- size: "small"
152
- }));
153
- },
154
- spacing: "compact",
155
- onClick: function onClick(e) {
156
- e.preventDefault();
157
- e.stopPropagation();
158
- onDisconnectButtonClick();
159
- fireEvent('ui.button.clicked.containerUnlinkButton', {
160
- containerSelected: null
161
- });
162
- }
163
- })))));
164
- };