@atlaskit/teams-public 0.5.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/cjs/controllers/hooks/use-team-containers/index.js +39 -1
- package/dist/cjs/index.js +8 -1
- package/dist/cjs/ui/team-containers/add-container-card/index.compiled.css +2 -0
- package/dist/cjs/ui/team-containers/add-container-card/index.js +26 -20
- package/dist/cjs/ui/team-containers/linked-container-card/index.compiled.css +9 -2
- package/dist/cjs/ui/team-containers/linked-container-card/index.js +46 -37
- package/dist/cjs/ui/team-containers/main.js +11 -10
- package/dist/cjs/ui/team-containers/types.js +5 -1
- package/dist/es2019/controllers/hooks/use-team-containers/index.js +19 -1
- package/dist/es2019/index.js +2 -1
- package/dist/es2019/ui/team-containers/add-container-card/index.compiled.css +2 -0
- package/dist/es2019/ui/team-containers/add-container-card/index.js +25 -19
- package/dist/es2019/ui/team-containers/linked-container-card/index.compiled.css +9 -2
- package/dist/es2019/ui/team-containers/linked-container-card/index.js +47 -38
- package/dist/es2019/ui/team-containers/main.js +11 -10
- package/dist/es2019/ui/team-containers/types.js +1 -0
- package/dist/esm/controllers/hooks/use-team-containers/index.js +39 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/ui/team-containers/add-container-card/index.compiled.css +2 -0
- package/dist/esm/ui/team-containers/add-container-card/index.js +27 -21
- package/dist/esm/ui/team-containers/linked-container-card/index.compiled.css +9 -2
- package/dist/esm/ui/team-containers/linked-container-card/index.js +47 -38
- package/dist/esm/ui/team-containers/main.js +11 -10
- package/dist/esm/ui/team-containers/types.js +1 -0
- package/dist/types/common/types.d.ts +8 -0
- package/dist/types/controllers/hooks/use-team-containers/index.d.ts +9 -1
- package/dist/types/index.d.ts +3 -0
- package/dist/types/services/types.d.ts +2 -9
- package/dist/types/ui/team-containers/linked-container-card/index.d.ts +3 -4
- package/dist/types/ui/team-containers/main.d.ts +1 -1
- package/dist/types/ui/team-containers/types.d.ts +9 -1
- package/dist/types-ts4.5/common/types.d.ts +8 -0
- package/dist/types-ts4.5/controllers/hooks/use-team-containers/index.d.ts +9 -1
- package/dist/types-ts4.5/index.d.ts +3 -0
- package/dist/types-ts4.5/services/types.d.ts +2 -9
- package/dist/types-ts4.5/ui/team-containers/linked-container-card/index.d.ts +3 -4
- package/dist/types-ts4.5/ui/team-containers/main.d.ts +1 -1
- package/dist/types-ts4.5/ui/team-containers/types.d.ts +9 -1
- package/package.json +2 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/teams-public
|
|
2
2
|
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#121085](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/121085)
|
|
8
|
+
[`56290b97f918e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/56290b97f918e) -
|
|
9
|
+
[ux] Allow consumer to override container card component
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 0.6.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- [#118229](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/118229)
|
|
20
|
+
[`bc2dbf27cd24c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bc2dbf27cd24c) -
|
|
21
|
+
[ux] Update team container list on add new container
|
|
22
|
+
|
|
3
23
|
## 0.5.2
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -6,11 +6,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.useTeamContainersHook = exports.useTeamContainers = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
13
|
var _react = require("react");
|
|
12
14
|
var _reactSweetState = require("react-sweet-state");
|
|
13
15
|
var _services = require("../../../services");
|
|
16
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
18
|
var initialState = {
|
|
15
19
|
teamContainers: [],
|
|
16
20
|
loading: true,
|
|
@@ -103,6 +107,38 @@ var actions = {
|
|
|
103
107
|
return _ref4.apply(this, arguments);
|
|
104
108
|
};
|
|
105
109
|
}();
|
|
110
|
+
},
|
|
111
|
+
addTeamContainer: function addTeamContainer(teamContainer) {
|
|
112
|
+
return /*#__PURE__*/function () {
|
|
113
|
+
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(_ref5) {
|
|
114
|
+
var setState, getState, _getState, teamContainers, containerExists;
|
|
115
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
116
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
117
|
+
case 0:
|
|
118
|
+
setState = _ref5.setState, getState = _ref5.getState;
|
|
119
|
+
_getState = getState(), teamContainers = _getState.teamContainers;
|
|
120
|
+
containerExists = teamContainers.some(function (container) {
|
|
121
|
+
return container.id === teamContainer.id;
|
|
122
|
+
});
|
|
123
|
+
if (!containerExists) {
|
|
124
|
+
_context3.next = 5;
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
return _context3.abrupt("return");
|
|
128
|
+
case 5:
|
|
129
|
+
setState({
|
|
130
|
+
teamContainers: [].concat((0, _toConsumableArray2.default)(teamContainers), [teamContainer])
|
|
131
|
+
});
|
|
132
|
+
case 6:
|
|
133
|
+
case "end":
|
|
134
|
+
return _context3.stop();
|
|
135
|
+
}
|
|
136
|
+
}, _callee3);
|
|
137
|
+
}));
|
|
138
|
+
return function (_x3) {
|
|
139
|
+
return _ref6.apply(this, arguments);
|
|
140
|
+
};
|
|
141
|
+
}();
|
|
106
142
|
}
|
|
107
143
|
};
|
|
108
144
|
var Store = (0, _reactSweetState.createStore)({
|
|
@@ -119,5 +155,7 @@ var useTeamContainers = exports.useTeamContainers = function useTeamContainers(t
|
|
|
119
155
|
(0, _react.useEffect)(function () {
|
|
120
156
|
actions.fetchTeamContainers(teamId);
|
|
121
157
|
}, [teamId, actions]);
|
|
122
|
-
return state
|
|
158
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
159
|
+
addTeamContainer: actions.addTeamContainer
|
|
160
|
+
});
|
|
123
161
|
};
|
package/dist/cjs/index.js
CHANGED
|
@@ -9,4 +9,11 @@ Object.defineProperty(exports, "TeamContainers", {
|
|
|
9
9
|
return _teamContainers.TeamContainers;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
|
|
12
|
+
Object.defineProperty(exports, "useTeamContainers", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _useTeamContainers.useTeamContainers;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _teamContainers = require("./ui/team-containers");
|
|
19
|
+
var _useTeamContainers = require("./controllers/hooks/use-team-containers");
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
._2rkoiti9{border-radius:var(--ds-border-radius-100,4px)}._12jimuej{outline-color:var(--ds-border,#091e4224)}
|
|
3
3
|
._12y3e4h9{outline-width:var(--ds-border-width,1px)}
|
|
4
4
|
._19bvutpp{padding-left:var(--ds-space-150,9pt)}
|
|
5
|
+
._1bsb1osq{width:100%}
|
|
5
6
|
._1qu2gq9o{outline-style:dashed}
|
|
7
|
+
._4cvr1h6o{align-items:center}
|
|
6
8
|
._ca0qutpp{padding-top:var(--ds-space-150,9pt)}
|
|
7
9
|
._n3tdutpp{padding-bottom:var(--ds-space-150,9pt)}
|
|
8
10
|
._syaz131l{color:var(--ds-text-subtlest,#626f86)}
|
|
@@ -13,16 +13,16 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _new = require("@atlaskit/button/new");
|
|
15
15
|
var _add = _interopRequireDefault(require("@atlaskit/icon/utility/add"));
|
|
16
|
-
var _menu = require("@atlaskit/menu");
|
|
17
16
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
18
17
|
var _getContainerProperties = require("../../../common/utils/get-container-properties");
|
|
19
18
|
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
19
|
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
20
|
var styles = {
|
|
21
|
+
card: "_4cvr1h6o _1bsb1osq",
|
|
22
22
|
container: "_2rkoiti9 _ca0qutpp _u5f3utpp _n3tdutpp _19bvutpp",
|
|
23
23
|
iconWrapper: "_2rkoiti9 _12y3e4h9 _12jimuej _1qu2gq9o _syaz131l _4cvxmuej _ksodnqa1"
|
|
24
24
|
};
|
|
25
|
-
var
|
|
25
|
+
var AddContainerCardWrapper = function AddContainerCardWrapper(_ref) {
|
|
26
26
|
var children = _ref.children;
|
|
27
27
|
var _useState = (0, _react.useState)(false),
|
|
28
28
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -48,22 +48,28 @@ var AddContainerCard = exports.AddContainerCard = function AddContainerCard(_ref
|
|
|
48
48
|
description = _getContainerProperti.description,
|
|
49
49
|
icon = _getContainerProperti.icon,
|
|
50
50
|
title = _getContainerProperti.title;
|
|
51
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
51
|
+
return /*#__PURE__*/_react.default.createElement(AddContainerCardWrapper, null, /*#__PURE__*/_react.default.createElement(_compiled.Inline, {
|
|
52
|
+
space: "space.100",
|
|
53
|
+
xcss: styles.card
|
|
54
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
55
|
+
xcss: styles.iconWrapper
|
|
56
|
+
}, /*#__PURE__*/_react.default.createElement(_new.IconButton, {
|
|
57
|
+
label: "Add a container",
|
|
58
|
+
appearance: "subtle",
|
|
59
|
+
icon: _add.default,
|
|
60
|
+
spacing: "compact",
|
|
61
|
+
testId: "add-icon",
|
|
62
|
+
onClick: function onClick(e) {
|
|
63
|
+
return onAddAContainerClick(e);
|
|
64
|
+
}
|
|
65
|
+
})), /*#__PURE__*/_react.default.createElement(_compiled.Stack, null, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
66
|
+
maxLines: 1,
|
|
67
|
+
weight: "medium",
|
|
68
|
+
color: "color.text"
|
|
69
|
+
}, title), /*#__PURE__*/_react.default.createElement(_compiled.Flex, {
|
|
70
|
+
gap: "space.050"
|
|
71
|
+
}, icon, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
72
|
+
size: "small",
|
|
73
|
+
color: "color.text.subtle"
|
|
74
|
+
}, description)))));
|
|
69
75
|
};
|
|
@@ -2,10 +2,17 @@
|
|
|
2
2
|
._2rkoiti9{border-radius:var(--ds-border-radius-100,4px)}
|
|
3
3
|
._1h6dz9xs{border-color:var(--ds-border-accent-gray,#758195)}._12jimuej{outline-color:var(--ds-border,#091e4224)}
|
|
4
4
|
._12y3e4h9{outline-width:var(--ds-border-width,1px)}
|
|
5
|
+
._18u01wug{margin-left:auto}
|
|
5
6
|
._19bvutpp{padding-left:var(--ds-space-150,9pt)}
|
|
6
|
-
.
|
|
7
|
+
._1bahesu3{justify-content:flex-end}
|
|
8
|
+
._1bsb1osq{width:100%}
|
|
9
|
+
._1bsbzwfg{width:2pc}
|
|
10
|
+
._1e0c1txw{display:flex}
|
|
7
11
|
._1qu2nqa1{outline-style:solid}
|
|
8
|
-
.
|
|
12
|
+
._1tkezwfg{min-height:2pc}
|
|
13
|
+
._1ul9zwfg{min-width:2pc}
|
|
14
|
+
._4cvr1h6o{align-items:center}
|
|
15
|
+
._4t3izwfg{height:2pc}
|
|
9
16
|
._ca0qutpp{padding-top:var(--ds-space-150,9pt)}
|
|
10
17
|
._n3tdutpp{padding-bottom:var(--ds-space-150,9pt)}
|
|
11
18
|
._syaz1fxt{color:var(--ds-text,#172b4d)}
|
|
@@ -16,7 +16,6 @@ var _new = require("@atlaskit/button/new");
|
|
|
16
16
|
var _cross = _interopRequireDefault(require("@atlaskit/icon/utility/cross"));
|
|
17
17
|
var _image = _interopRequireDefault(require("@atlaskit/image"));
|
|
18
18
|
var _link = _interopRequireDefault(require("@atlaskit/link"));
|
|
19
|
-
var _menu = require("@atlaskit/menu");
|
|
20
19
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
21
20
|
var _analytics = require("../../../common/utils/analytics");
|
|
22
21
|
var _getContainerProperties = require("../../../common/utils/get-container-properties");
|
|
@@ -24,9 +23,11 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
24
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; }
|
|
25
24
|
var styles = {
|
|
26
25
|
container: "_2rkoiti9 _1h6dz9xs _12y3e4h9 _12jimuej _1qu2nqa1 _ca0qutpp _u5f3utpp _n3tdutpp _19bvutpp _syaz1fxt",
|
|
27
|
-
|
|
26
|
+
card: "_4cvr1h6o _1bsb1osq",
|
|
27
|
+
iconWrapper: "_1bsbzwfg _4t3izwfg _1ul9zwfg _1tkezwfg",
|
|
28
|
+
crossIconWrapper: "_1e0c1txw _4cvr1h6o _1bahesu3 _18u01wug"
|
|
28
29
|
};
|
|
29
|
-
var
|
|
30
|
+
var LinkedCardWrapper = function LinkedCardWrapper(_ref) {
|
|
30
31
|
var children = _ref.children,
|
|
31
32
|
href = _ref.href,
|
|
32
33
|
handleMouseEnter = _ref.handleMouseEnter,
|
|
@@ -43,15 +44,15 @@ var CustomItemInner = function CustomItemInner(_ref) {
|
|
|
43
44
|
handleMouseLeave();
|
|
44
45
|
setHovered(false);
|
|
45
46
|
};
|
|
46
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
47
|
-
href: href,
|
|
48
|
-
appearance: "subtle"
|
|
49
|
-
}, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
47
|
+
return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
50
48
|
backgroundColor: hovered ? 'color.background.input.hovered' : 'color.background.input',
|
|
51
49
|
xcss: styles.container,
|
|
52
50
|
onMouseEnter: onMouseEnter,
|
|
53
51
|
onMouseLeave: onMouseLeave,
|
|
54
52
|
testId: "linked-container-card-inner"
|
|
53
|
+
}, /*#__PURE__*/_react.default.createElement(_link.default, {
|
|
54
|
+
href: href,
|
|
55
|
+
appearance: "subtle"
|
|
55
56
|
}, children));
|
|
56
57
|
};
|
|
57
58
|
var LinkedContainerCard = exports.LinkedContainerCard = function LinkedContainerCard(_ref2) {
|
|
@@ -69,39 +70,47 @@ var LinkedContainerCard = exports.LinkedContainerCard = function LinkedContainer
|
|
|
69
70
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
70
71
|
showCloseIcon = _useState4[0],
|
|
71
72
|
setShowCloseIcon = _useState4[1];
|
|
72
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
73
|
-
|
|
74
|
-
xcss: styles.iconWrapper
|
|
75
|
-
}, /*#__PURE__*/_react.default.createElement(_image.default, {
|
|
76
|
-
src: containerIcon,
|
|
77
|
-
alt: "",
|
|
78
|
-
testId: "linked-container-icon"
|
|
79
|
-
})),
|
|
80
|
-
description: /*#__PURE__*/_react.default.createElement(_compiled.Inline, {
|
|
81
|
-
space: "space.050"
|
|
82
|
-
}, icon, description),
|
|
83
|
-
iconAfter: showCloseIcon && /*#__PURE__*/_react.default.createElement(_compiled.Box, null, /*#__PURE__*/_react.default.createElement(_new.IconButton, {
|
|
84
|
-
label: "disconnect the container ".concat(title),
|
|
85
|
-
appearance: "subtle",
|
|
86
|
-
icon: _cross.default,
|
|
87
|
-
spacing: "compact",
|
|
88
|
-
onClick: function onClick(e) {
|
|
89
|
-
e.preventDefault();
|
|
90
|
-
onDisconnectButtonClick();
|
|
91
|
-
(0, _analytics.fireUIEvent)(createAnalyticsEvent, {
|
|
92
|
-
action: _analytics.AnalyticsAction.CLICKED,
|
|
93
|
-
actionSubject: 'button',
|
|
94
|
-
actionSubjectId: 'containerUnlinkButton'
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
})),
|
|
98
|
-
href: link,
|
|
73
|
+
return /*#__PURE__*/_react.default.createElement(LinkedCardWrapper, {
|
|
74
|
+
href: link || '#',
|
|
99
75
|
handleMouseEnter: function handleMouseEnter() {
|
|
100
76
|
return setShowCloseIcon(true);
|
|
101
77
|
},
|
|
102
78
|
handleMouseLeave: function handleMouseLeave() {
|
|
103
79
|
return setShowCloseIcon(false);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
80
|
+
}
|
|
81
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Inline, {
|
|
82
|
+
space: "space.100",
|
|
83
|
+
xcss: styles.card
|
|
84
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
85
|
+
xcss: styles.iconWrapper
|
|
86
|
+
}, /*#__PURE__*/_react.default.createElement(_image.default, {
|
|
87
|
+
src: containerIcon,
|
|
88
|
+
alt: "",
|
|
89
|
+
testId: "linked-container-icon"
|
|
90
|
+
})), /*#__PURE__*/_react.default.createElement(_compiled.Stack, null, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
91
|
+
maxLines: 1,
|
|
92
|
+
weight: "medium",
|
|
93
|
+
color: "color.text"
|
|
94
|
+
}, title), /*#__PURE__*/_react.default.createElement(_compiled.Flex, {
|
|
95
|
+
gap: "space.050"
|
|
96
|
+
}, icon, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
97
|
+
size: "small",
|
|
98
|
+
color: "color.text.subtle"
|
|
99
|
+
}, description))), showCloseIcon && /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
100
|
+
xcss: styles.crossIconWrapper
|
|
101
|
+
}, /*#__PURE__*/_react.default.createElement(_new.IconButton, {
|
|
102
|
+
label: "disconnect the container ".concat(title),
|
|
103
|
+
appearance: "subtle",
|
|
104
|
+
icon: _cross.default,
|
|
105
|
+
spacing: "compact",
|
|
106
|
+
onClick: function onClick(e) {
|
|
107
|
+
e.preventDefault();
|
|
108
|
+
onDisconnectButtonClick();
|
|
109
|
+
(0, _analytics.fireUIEvent)(createAnalyticsEvent, {
|
|
110
|
+
action: _analytics.AnalyticsAction.CLICKED,
|
|
111
|
+
actionSubject: 'button',
|
|
112
|
+
actionSubjectId: 'containerUnlinkButton'
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}))));
|
|
107
116
|
};
|
|
@@ -29,7 +29,8 @@ var ICON_COLOR = exports.ICON_COLOR = "var(--ds-icon-subtle, ".concat(_colors.N9
|
|
|
29
29
|
var MAX_NUMBER_OF_CONTAINERS_TO_SHOW = exports.MAX_NUMBER_OF_CONTAINERS_TO_SHOW = 4;
|
|
30
30
|
var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
31
31
|
var teamId = _ref.teamId,
|
|
32
|
-
onAddAContainerClick = _ref.onAddAContainerClick
|
|
32
|
+
onAddAContainerClick = _ref.onAddAContainerClick,
|
|
33
|
+
components = _ref.components;
|
|
33
34
|
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
34
35
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
35
36
|
var _useTeamContainers = (0, _useTeamContainers2.useTeamContainers)(teamId),
|
|
@@ -86,6 +87,7 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
86
87
|
actionSubject: 'unlinkContainerDialog'
|
|
87
88
|
});
|
|
88
89
|
}, [createAnalyticsEvent]);
|
|
90
|
+
var LinkedContainerCardComponent = (components === null || components === void 0 ? void 0 : components.ContainerCard) || _linkedContainerCard.LinkedContainerCard;
|
|
89
91
|
var handleDisconnect = (0, _react.useCallback)( /*#__PURE__*/function () {
|
|
90
92
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(containerId) {
|
|
91
93
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
@@ -124,16 +126,15 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
124
126
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_primitives.Stack, {
|
|
125
127
|
space: "space.200"
|
|
126
128
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Grid, {
|
|
127
|
-
templateColumns: "
|
|
128
|
-
gap: "space.100"
|
|
129
|
-
autoFlow: "row"
|
|
129
|
+
templateColumns: "repeat(auto-fill, minmax(270px, 1fr))",
|
|
130
|
+
gap: "space.100"
|
|
130
131
|
}, teamContainers.slice(0, MAX_NUMBER_OF_CONTAINERS_TO_SHOW).map(function (container) {
|
|
131
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
132
|
+
return /*#__PURE__*/_react.default.createElement(LinkedContainerCardComponent, {
|
|
132
133
|
key: container.id,
|
|
133
134
|
containerType: container.type,
|
|
134
135
|
title: container.name,
|
|
135
|
-
containerIcon: container.icon,
|
|
136
|
-
link: container.link,
|
|
136
|
+
containerIcon: container.icon || undefined,
|
|
137
|
+
link: container.link || undefined,
|
|
137
138
|
onDisconnectButtonClick: function onDisconnectButtonClick() {
|
|
138
139
|
return handleOpenDisconnectDialog({
|
|
139
140
|
containerId: container.id,
|
|
@@ -149,12 +150,12 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
149
150
|
onAddAContainerClick: onAddAContainerClick,
|
|
150
151
|
containerType: "ConfluenceSpace"
|
|
151
152
|
}), showMore && teamContainers.slice(MAX_NUMBER_OF_CONTAINERS_TO_SHOW).map(function (container) {
|
|
152
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
153
|
+
return /*#__PURE__*/_react.default.createElement(LinkedContainerCardComponent, {
|
|
153
154
|
key: container.id,
|
|
154
155
|
containerType: container.type,
|
|
155
156
|
title: container.name,
|
|
156
|
-
containerIcon: container.icon,
|
|
157
|
-
link: container.link,
|
|
157
|
+
containerIcon: container.icon || undefined,
|
|
158
|
+
link: container.link || undefined,
|
|
158
159
|
onDisconnectButtonClick: function onDisconnectButtonClick() {
|
|
159
160
|
return setIsDisconnectDialogOpen(true);
|
|
160
161
|
}
|
|
@@ -52,6 +52,21 @@ const actions = {
|
|
|
52
52
|
unlinkError: err
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
+
},
|
|
56
|
+
addTeamContainer: teamContainer => async ({
|
|
57
|
+
setState,
|
|
58
|
+
getState
|
|
59
|
+
}) => {
|
|
60
|
+
const {
|
|
61
|
+
teamContainers
|
|
62
|
+
} = getState();
|
|
63
|
+
const containerExists = teamContainers.some(container => container.id === teamContainer.id);
|
|
64
|
+
if (containerExists) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
setState({
|
|
68
|
+
teamContainers: [...teamContainers, teamContainer]
|
|
69
|
+
});
|
|
55
70
|
}
|
|
56
71
|
};
|
|
57
72
|
const Store = createStore({
|
|
@@ -65,5 +80,8 @@ export const useTeamContainers = teamId => {
|
|
|
65
80
|
useEffect(() => {
|
|
66
81
|
actions.fetchTeamContainers(teamId);
|
|
67
82
|
}, [teamId, actions]);
|
|
68
|
-
return
|
|
83
|
+
return {
|
|
84
|
+
...state,
|
|
85
|
+
addTeamContainer: actions.addTeamContainer
|
|
86
|
+
};
|
|
69
87
|
};
|
package/dist/es2019/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { TeamContainers } from './ui/team-containers';
|
|
1
|
+
export { TeamContainers } from './ui/team-containers';
|
|
2
|
+
export { useTeamContainers } from './controllers/hooks/use-team-containers';
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
._2rkoiti9{border-radius:var(--ds-border-radius-100,4px)}._12jimuej{outline-color:var(--ds-border,#091e4224)}
|
|
3
3
|
._12y3e4h9{outline-width:var(--ds-border-width,1px)}
|
|
4
4
|
._19bvutpp{padding-left:var(--ds-space-150,9pt)}
|
|
5
|
+
._1bsb1osq{width:100%}
|
|
5
6
|
._1qu2gq9o{outline-style:dashed}
|
|
7
|
+
._4cvr1h6o{align-items:center}
|
|
6
8
|
._ca0qutpp{padding-top:var(--ds-space-150,9pt)}
|
|
7
9
|
._n3tdutpp{padding-bottom:var(--ds-space-150,9pt)}
|
|
8
10
|
._syaz131l{color:var(--ds-text-subtlest,#626f86)}
|
|
@@ -4,14 +4,14 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
4
4
|
import React, { useState } from 'react';
|
|
5
5
|
import { IconButton } from '@atlaskit/button/new';
|
|
6
6
|
import AddIcon from '@atlaskit/icon/utility/add';
|
|
7
|
-
import {
|
|
8
|
-
import { Box, Inline } from '@atlaskit/primitives/compiled';
|
|
7
|
+
import { Box, Flex, Inline, Stack, Text } from '@atlaskit/primitives/compiled';
|
|
9
8
|
import { getContainerProperties } from '../../../common/utils/get-container-properties';
|
|
10
9
|
const styles = {
|
|
10
|
+
card: "_4cvr1h6o _1bsb1osq",
|
|
11
11
|
container: "_2rkoiti9 _ca0qutpp _u5f3utpp _n3tdutpp _19bvutpp",
|
|
12
12
|
iconWrapper: "_2rkoiti9 _12y3e4h9 _12jimuej _1qu2gq9o _syaz131l _4cvxmuej _ksodnqa1"
|
|
13
13
|
};
|
|
14
|
-
const
|
|
14
|
+
const AddContainerCardWrapper = ({
|
|
15
15
|
children
|
|
16
16
|
}) => {
|
|
17
17
|
const [hovered, setHovered] = useState(false);
|
|
@@ -33,20 +33,26 @@ export const AddContainerCard = ({
|
|
|
33
33
|
icon,
|
|
34
34
|
title
|
|
35
35
|
} = getContainerProperties(containerType);
|
|
36
|
-
return /*#__PURE__*/React.createElement(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
36
|
+
return /*#__PURE__*/React.createElement(AddContainerCardWrapper, null, /*#__PURE__*/React.createElement(Inline, {
|
|
37
|
+
space: "space.100",
|
|
38
|
+
xcss: styles.card
|
|
39
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
40
|
+
xcss: styles.iconWrapper
|
|
41
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
42
|
+
label: "Add a container",
|
|
43
|
+
appearance: "subtle",
|
|
44
|
+
icon: AddIcon,
|
|
45
|
+
spacing: "compact",
|
|
46
|
+
testId: "add-icon",
|
|
47
|
+
onClick: e => onAddAContainerClick(e)
|
|
48
|
+
})), /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(Text, {
|
|
49
|
+
maxLines: 1,
|
|
50
|
+
weight: "medium",
|
|
51
|
+
color: "color.text"
|
|
52
|
+
}, title), /*#__PURE__*/React.createElement(Flex, {
|
|
53
|
+
gap: "space.050"
|
|
54
|
+
}, icon, /*#__PURE__*/React.createElement(Text, {
|
|
55
|
+
size: "small",
|
|
56
|
+
color: "color.text.subtle"
|
|
57
|
+
}, description)))));
|
|
52
58
|
};
|
|
@@ -2,10 +2,17 @@
|
|
|
2
2
|
._2rkoiti9{border-radius:var(--ds-border-radius-100,4px)}
|
|
3
3
|
._1h6dz9xs{border-color:var(--ds-border-accent-gray,#758195)}._12jimuej{outline-color:var(--ds-border,#091e4224)}
|
|
4
4
|
._12y3e4h9{outline-width:var(--ds-border-width,1px)}
|
|
5
|
+
._18u01wug{margin-left:auto}
|
|
5
6
|
._19bvutpp{padding-left:var(--ds-space-150,9pt)}
|
|
6
|
-
.
|
|
7
|
+
._1bahesu3{justify-content:flex-end}
|
|
8
|
+
._1bsb1osq{width:100%}
|
|
9
|
+
._1bsbzwfg{width:2pc}
|
|
10
|
+
._1e0c1txw{display:flex}
|
|
7
11
|
._1qu2nqa1{outline-style:solid}
|
|
8
|
-
.
|
|
12
|
+
._1tkezwfg{min-height:2pc}
|
|
13
|
+
._1ul9zwfg{min-width:2pc}
|
|
14
|
+
._4cvr1h6o{align-items:center}
|
|
15
|
+
._4t3izwfg{height:2pc}
|
|
9
16
|
._ca0qutpp{padding-top:var(--ds-space-150,9pt)}
|
|
10
17
|
._n3tdutpp{padding-bottom:var(--ds-space-150,9pt)}
|
|
11
18
|
._syaz1fxt{color:var(--ds-text,#172b4d)}
|
|
@@ -7,15 +7,16 @@ import { IconButton } from '@atlaskit/button/new';
|
|
|
7
7
|
import CrossIcon from '@atlaskit/icon/utility/cross';
|
|
8
8
|
import Image from '@atlaskit/image';
|
|
9
9
|
import Link from '@atlaskit/link';
|
|
10
|
-
import {
|
|
11
|
-
import { Box, Inline } from '@atlaskit/primitives/compiled';
|
|
10
|
+
import { Box, Flex, Inline, Stack, Text } from '@atlaskit/primitives/compiled';
|
|
12
11
|
import { AnalyticsAction, fireUIEvent } from '../../../common/utils/analytics';
|
|
13
12
|
import { getContainerProperties } from '../../../common/utils/get-container-properties';
|
|
14
13
|
const styles = {
|
|
15
14
|
container: "_2rkoiti9 _1h6dz9xs _12y3e4h9 _12jimuej _1qu2nqa1 _ca0qutpp _u5f3utpp _n3tdutpp _19bvutpp _syaz1fxt",
|
|
16
|
-
|
|
15
|
+
card: "_4cvr1h6o _1bsb1osq",
|
|
16
|
+
iconWrapper: "_1bsbzwfg _4t3izwfg _1ul9zwfg _1tkezwfg",
|
|
17
|
+
crossIconWrapper: "_1e0c1txw _4cvr1h6o _1bahesu3 _18u01wug"
|
|
17
18
|
};
|
|
18
|
-
const
|
|
19
|
+
const LinkedCardWrapper = ({
|
|
19
20
|
children,
|
|
20
21
|
href,
|
|
21
22
|
handleMouseEnter,
|
|
@@ -30,15 +31,15 @@ const CustomItemInner = ({
|
|
|
30
31
|
handleMouseLeave();
|
|
31
32
|
setHovered(false);
|
|
32
33
|
};
|
|
33
|
-
return /*#__PURE__*/React.createElement(
|
|
34
|
-
href: href,
|
|
35
|
-
appearance: "subtle"
|
|
36
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
34
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
37
35
|
backgroundColor: hovered ? 'color.background.input.hovered' : 'color.background.input',
|
|
38
36
|
xcss: styles.container,
|
|
39
37
|
onMouseEnter: onMouseEnter,
|
|
40
38
|
onMouseLeave: onMouseLeave,
|
|
41
39
|
testId: "linked-container-card-inner"
|
|
40
|
+
}, /*#__PURE__*/React.createElement(Link, {
|
|
41
|
+
href: href,
|
|
42
|
+
appearance: "subtle"
|
|
42
43
|
}, children));
|
|
43
44
|
};
|
|
44
45
|
export const LinkedContainerCard = ({
|
|
@@ -56,35 +57,43 @@ export const LinkedContainerCard = ({
|
|
|
56
57
|
icon
|
|
57
58
|
} = getContainerProperties(containerType);
|
|
58
59
|
const [showCloseIcon, setShowCloseIcon] = useState(false);
|
|
59
|
-
return /*#__PURE__*/React.createElement(
|
|
60
|
-
|
|
61
|
-
xcss: styles.iconWrapper
|
|
62
|
-
}, /*#__PURE__*/React.createElement(Image, {
|
|
63
|
-
src: containerIcon,
|
|
64
|
-
alt: "",
|
|
65
|
-
testId: "linked-container-icon"
|
|
66
|
-
})),
|
|
67
|
-
description: /*#__PURE__*/React.createElement(Inline, {
|
|
68
|
-
space: "space.050"
|
|
69
|
-
}, icon, description),
|
|
70
|
-
iconAfter: showCloseIcon && /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(IconButton, {
|
|
71
|
-
label: `disconnect the container ${title}`,
|
|
72
|
-
appearance: "subtle",
|
|
73
|
-
icon: CrossIcon,
|
|
74
|
-
spacing: "compact",
|
|
75
|
-
onClick: e => {
|
|
76
|
-
e.preventDefault();
|
|
77
|
-
onDisconnectButtonClick();
|
|
78
|
-
fireUIEvent(createAnalyticsEvent, {
|
|
79
|
-
action: AnalyticsAction.CLICKED,
|
|
80
|
-
actionSubject: 'button',
|
|
81
|
-
actionSubjectId: 'containerUnlinkButton'
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
})),
|
|
85
|
-
href: link,
|
|
60
|
+
return /*#__PURE__*/React.createElement(LinkedCardWrapper, {
|
|
61
|
+
href: link || '#',
|
|
86
62
|
handleMouseEnter: () => setShowCloseIcon(true),
|
|
87
|
-
handleMouseLeave: () => setShowCloseIcon(false)
|
|
88
|
-
|
|
89
|
-
|
|
63
|
+
handleMouseLeave: () => setShowCloseIcon(false)
|
|
64
|
+
}, /*#__PURE__*/React.createElement(Inline, {
|
|
65
|
+
space: "space.100",
|
|
66
|
+
xcss: styles.card
|
|
67
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
68
|
+
xcss: styles.iconWrapper
|
|
69
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
70
|
+
src: containerIcon,
|
|
71
|
+
alt: "",
|
|
72
|
+
testId: "linked-container-icon"
|
|
73
|
+
})), /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(Text, {
|
|
74
|
+
maxLines: 1,
|
|
75
|
+
weight: "medium",
|
|
76
|
+
color: "color.text"
|
|
77
|
+
}, title), /*#__PURE__*/React.createElement(Flex, {
|
|
78
|
+
gap: "space.050"
|
|
79
|
+
}, icon, /*#__PURE__*/React.createElement(Text, {
|
|
80
|
+
size: "small",
|
|
81
|
+
color: "color.text.subtle"
|
|
82
|
+
}, description))), showCloseIcon && /*#__PURE__*/React.createElement(Box, {
|
|
83
|
+
xcss: styles.crossIconWrapper
|
|
84
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
85
|
+
label: `disconnect the container ${title}`,
|
|
86
|
+
appearance: "subtle",
|
|
87
|
+
icon: CrossIcon,
|
|
88
|
+
spacing: "compact",
|
|
89
|
+
onClick: e => {
|
|
90
|
+
e.preventDefault();
|
|
91
|
+
onDisconnectButtonClick();
|
|
92
|
+
fireUIEvent(createAnalyticsEvent, {
|
|
93
|
+
action: AnalyticsAction.CLICKED,
|
|
94
|
+
actionSubject: 'button',
|
|
95
|
+
actionSubjectId: 'containerUnlinkButton'
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}))));
|
|
90
99
|
};
|