@atlaskit/user-picker 10.12.4 → 10.12.6
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 +12 -0
- package/afm-cc/tsconfig.json +61 -0
- package/dist/cjs/analytics.js +1 -1
- package/dist/cjs/components/AddOptionAvatar.js +4 -2
- package/dist/cjs/components/AvatarItemOption.js +11 -11
- package/dist/cjs/components/CustomOption/main.js +9 -8
- package/dist/cjs/components/EmailOption/main.js +7 -6
- package/dist/cjs/components/ExternalUserOption/ExternalAvatarItemOption.js +7 -7
- package/dist/cjs/components/ExternalUserOption/InfoIcon.js +4 -2
- package/dist/cjs/components/ExternalUserOption/SourcesTooltipContent.js +14 -12
- package/dist/cjs/components/ExternalUserOption/main.js +10 -10
- package/dist/cjs/components/GroupOption/main.js +8 -8
- package/dist/cjs/components/Menu.js +2 -2
- package/dist/cjs/components/MultiValue.js +9 -9
- package/dist/cjs/components/PopupControl.js +11 -19
- package/dist/cjs/components/SingleValue.js +4 -3
- package/dist/cjs/components/SingleValueContainer.js +3 -3
- package/dist/cjs/components/TeamOption/main.js +14 -13
- package/dist/cjs/components/UserOption.js +12 -11
- package/dist/es2019/analytics.js +1 -1
- package/dist/es2019/components/AddOptionAvatar.js +4 -3
- package/dist/es2019/components/AvatarItemOption.js +12 -11
- package/dist/es2019/components/CustomOption/main.js +7 -5
- package/dist/es2019/components/EmailOption/main.js +7 -5
- package/dist/es2019/components/ExternalUserOption/ExternalAvatarItemOption.js +9 -7
- package/dist/es2019/components/ExternalUserOption/InfoIcon.js +4 -3
- package/dist/es2019/components/ExternalUserOption/SourcesTooltipContent.js +14 -13
- package/dist/es2019/components/ExternalUserOption/main.js +11 -10
- package/dist/es2019/components/GroupOption/main.js +9 -8
- package/dist/es2019/components/Menu.js +3 -2
- package/dist/es2019/components/MultiValue.js +9 -8
- package/dist/es2019/components/PopupControl.js +17 -26
- package/dist/es2019/components/SingleValue.js +5 -4
- package/dist/es2019/components/SingleValueContainer.js +4 -3
- package/dist/es2019/components/TeamOption/main.js +12 -10
- package/dist/es2019/components/UserOption.js +10 -8
- package/dist/esm/analytics.js +1 -1
- package/dist/esm/components/AddOptionAvatar.js +4 -3
- package/dist/esm/components/AvatarItemOption.js +12 -11
- package/dist/esm/components/CustomOption/main.js +7 -5
- package/dist/esm/components/EmailOption/main.js +7 -5
- package/dist/esm/components/ExternalUserOption/ExternalAvatarItemOption.js +9 -7
- package/dist/esm/components/ExternalUserOption/InfoIcon.js +4 -3
- package/dist/esm/components/ExternalUserOption/SourcesTooltipContent.js +14 -13
- package/dist/esm/components/ExternalUserOption/main.js +11 -10
- package/dist/esm/components/GroupOption/main.js +9 -8
- package/dist/esm/components/Menu.js +3 -2
- package/dist/esm/components/MultiValue.js +10 -9
- package/dist/esm/components/PopupControl.js +13 -20
- package/dist/esm/components/SingleValue.js +5 -4
- package/dist/esm/components/SingleValueContainer.js +4 -3
- package/dist/esm/components/TeamOption/main.js +12 -10
- package/dist/esm/components/UserOption.js +10 -8
- package/package.json +1 -1
|
@@ -11,38 +11,30 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
11
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
12
12
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
13
13
|
var _react = _interopRequireDefault(require("react"));
|
|
14
|
-
var _components = require("@atlaskit/theme/components");
|
|
15
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
16
14
|
var _select = require("@atlaskit/select");
|
|
17
15
|
var _react2 = require("@emotion/react");
|
|
18
16
|
var _colors = require("@atlaskit/theme/colors");
|
|
19
17
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
20
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
21
|
-
var spacing =
|
|
18
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
|
|
19
|
+
var spacing = 8;
|
|
22
20
|
var fontSize = 12;
|
|
23
21
|
var innerHeight = spacing * 2; // 16px
|
|
24
22
|
var lineHeight = innerHeight / fontSize;
|
|
25
23
|
var controlWrapper = (0, _react2.css)({
|
|
26
24
|
display: 'flex',
|
|
27
25
|
flexDirection: 'column',
|
|
28
|
-
padding: "0px ".concat(
|
|
29
|
-
});
|
|
30
|
-
var getColor = (0, _components.themed)({
|
|
31
|
-
light: "var(--ds-text-subtlest, ".concat(_colors.N200, ")"),
|
|
32
|
-
dark: "var(--ds-text-subtlest, ".concat(_colors.DN90, ")")
|
|
26
|
+
padding: "0px ".concat("var(--ds-space-100, 8px)", " ", "var(--ds-space-100, 8px)")
|
|
33
27
|
});
|
|
34
28
|
var getLabelStyle = function getLabelStyle() {
|
|
35
|
-
var right = 0;
|
|
36
|
-
var bottom = spacing / 2;
|
|
37
|
-
var left = 0;
|
|
38
|
-
var top = spacing * 2.5;
|
|
39
|
-
var color = getColor();
|
|
40
29
|
return (0, _react2.css)({
|
|
41
|
-
color:
|
|
30
|
+
color: "var(--ds-text-subtlest, ".concat(_colors.N200, ")"),
|
|
42
31
|
fontSize: "".concat(fontSize, "px"),
|
|
43
32
|
fontWeight: 600,
|
|
44
33
|
lineHeight: "".concat(lineHeight),
|
|
45
|
-
|
|
34
|
+
paddingBottom: "var(--ds-space-050, 4px)",
|
|
35
|
+
paddingLeft: "var(--ds-space-0, 0px)",
|
|
36
|
+
paddingRight: "var(--ds-space-0, 0px)",
|
|
37
|
+
paddingTop: "var(--ds-space-250, 20px)"
|
|
46
38
|
});
|
|
47
39
|
};
|
|
48
40
|
var PopupControl = exports.PopupControl = /*#__PURE__*/function (_React$PureComponent) {
|
|
@@ -56,11 +48,11 @@ var PopupControl = exports.PopupControl = /*#__PURE__*/function (_React$PureComp
|
|
|
56
48
|
key: "render",
|
|
57
49
|
value: function render() {
|
|
58
50
|
var popupTitle = this.props.selectProps.popupTitle;
|
|
59
|
-
return
|
|
51
|
+
return (0, _react2.jsx)("div", {
|
|
60
52
|
css: controlWrapper
|
|
61
|
-
},
|
|
53
|
+
}, (0, _react2.jsx)("div", {
|
|
62
54
|
css: getLabelStyle()
|
|
63
|
-
}, popupTitle),
|
|
55
|
+
}, popupTitle), (0, _react2.jsx)(_select.components.Control, this.props));
|
|
64
56
|
}
|
|
65
57
|
}]);
|
|
66
58
|
return PopupControl;
|
|
@@ -13,6 +13,7 @@ var _select = require("@atlaskit/select");
|
|
|
13
13
|
var _SizeableAvatar = require("./SizeableAvatar");
|
|
14
14
|
var _utils = require("./utils");
|
|
15
15
|
var _excluded = ["ref"];
|
|
16
|
+
/** @jsx jsx */
|
|
16
17
|
var avatarItemComponent = (0, _react.css)({
|
|
17
18
|
border: 'none !important',
|
|
18
19
|
padding: '0 !important',
|
|
@@ -35,9 +36,9 @@ var SingleValue = exports.SingleValue = function SingleValue(props) {
|
|
|
35
36
|
_props$selectProps = props.selectProps,
|
|
36
37
|
appearance = _props$selectProps.appearance,
|
|
37
38
|
isFocused = _props$selectProps.isFocused;
|
|
38
|
-
return !isFocused ?
|
|
39
|
+
return !isFocused ? (0, _react.jsx)(_select.components.SingleValue, props, (0, _react.jsx)(_avatar.AvatarItem, {
|
|
39
40
|
backgroundColor: "transparent",
|
|
40
|
-
avatar:
|
|
41
|
+
avatar: (0, _react.jsx)(_SizeableAvatar.SizeableAvatar, {
|
|
41
42
|
src: (0, _utils.getAvatarUrl)(data),
|
|
42
43
|
appearance: appearance,
|
|
43
44
|
name: label
|
|
@@ -46,7 +47,7 @@ var SingleValue = exports.SingleValue = function SingleValue(props) {
|
|
|
46
47
|
}, function (_ref) {
|
|
47
48
|
var ref = _ref.ref,
|
|
48
49
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
49
|
-
return
|
|
50
|
+
return (0, _react.jsx)("div", (0, _extends2.default)({
|
|
50
51
|
css: avatarItemComponent
|
|
51
52
|
}, props));
|
|
52
53
|
})) : null;
|
|
@@ -20,7 +20,7 @@ var _SizeableAvatar = require("./SizeableAvatar");
|
|
|
20
20
|
var _styles = require("./styles");
|
|
21
21
|
var _excluded = ["children"];
|
|
22
22
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
23
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
23
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
|
|
24
24
|
var placeholderIconContainer = (0, _react2.css)({
|
|
25
25
|
paddingLeft: "".concat(_styles.BORDER_PADDING, "px"),
|
|
26
26
|
lineHeight: 0,
|
|
@@ -48,7 +48,7 @@ var SingleValueContainer = exports.SingleValueContainer = /*#__PURE__*/function
|
|
|
48
48
|
inputValue = _this$props$selectPro.inputValue,
|
|
49
49
|
value = _this$props$selectPro.value;
|
|
50
50
|
if (isFocused || !hasValue) {
|
|
51
|
-
return
|
|
51
|
+
return (0, _react2.jsx)(_SizeableAvatar.SizeableAvatar, {
|
|
52
52
|
appearance: appearance,
|
|
53
53
|
src: showUserAvatar(inputValue, value) ? value.data.avatarUrl : undefined
|
|
54
54
|
});
|
|
@@ -63,7 +63,7 @@ var SingleValueContainer = exports.SingleValueContainer = /*#__PURE__*/function
|
|
|
63
63
|
var _this$props2 = this.props,
|
|
64
64
|
children = _this$props2.children,
|
|
65
65
|
valueContainerProps = (0, _objectWithoutProperties2.default)(_this$props2, _excluded);
|
|
66
|
-
return
|
|
66
|
+
return (0, _react2.jsx)(_select.components.ValueContainer, valueContainerProps, (0, _react2.jsx)("div", {
|
|
67
67
|
css: placeholderIconContainer
|
|
68
68
|
}, this.renderAvatar()), children);
|
|
69
69
|
}
|
|
@@ -14,14 +14,15 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
14
14
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
16
|
var _colors = require("@atlaskit/theme/colors");
|
|
17
|
-
var _react =
|
|
17
|
+
var _react = require("@emotion/react");
|
|
18
|
+
var _react2 = _interopRequireDefault(require("react"));
|
|
18
19
|
var _reactIntlNext = require("react-intl-next");
|
|
19
20
|
var _AvatarItemOption = require("../AvatarItemOption");
|
|
20
21
|
var _HighlightText = require("../HighlightText");
|
|
21
22
|
var _i18n = require("../i18n");
|
|
22
23
|
var _SizeableAvatar = require("../SizeableAvatar");
|
|
23
24
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
24
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
25
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
|
|
25
26
|
var TeamOption = exports.TeamOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
26
27
|
(0, _inherits2.default)(TeamOption, _React$PureComponent);
|
|
27
28
|
var _super = _createSuper(TeamOption);
|
|
@@ -36,10 +37,10 @@ var TeamOption = exports.TeamOption = /*#__PURE__*/function (_React$PureComponen
|
|
|
36
37
|
var _this$props$team = _this.props.team,
|
|
37
38
|
name = _this$props$team.name,
|
|
38
39
|
highlight = _this$props$team.highlight;
|
|
39
|
-
return [
|
|
40
|
+
return [(0, _react.jsx)("span", {
|
|
40
41
|
key: "name",
|
|
41
42
|
css: (0, _AvatarItemOption.textWrapper)(_this.props.isSelected ? "var(--ds-text-selected, ".concat(_colors.B400, ")") : "var(--ds-text, ".concat(_colors.N800, ")"))
|
|
42
|
-
},
|
|
43
|
+
}, (0, _react.jsx)(_HighlightText.HighlightText, {
|
|
43
44
|
highlights: highlight && highlight.name
|
|
44
45
|
}, name))];
|
|
45
46
|
});
|
|
@@ -56,9 +57,9 @@ var TeamOption = exports.TeamOption = /*#__PURE__*/function (_React$PureComponen
|
|
|
56
57
|
} else {
|
|
57
58
|
if (includesYou === true) {
|
|
58
59
|
if (memberCount > 50) {
|
|
59
|
-
return _this.getBylineComponent(isSelected,
|
|
60
|
+
return _this.getBylineComponent(isSelected, (0, _react.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.plus50MembersWithYou));
|
|
60
61
|
} else {
|
|
61
|
-
return _this.getBylineComponent(isSelected,
|
|
62
|
+
return _this.getBylineComponent(isSelected, (0, _react.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.memberCountWithYou, {
|
|
62
63
|
values: {
|
|
63
64
|
count: memberCount
|
|
64
65
|
}
|
|
@@ -66,9 +67,9 @@ var TeamOption = exports.TeamOption = /*#__PURE__*/function (_React$PureComponen
|
|
|
66
67
|
}
|
|
67
68
|
} else {
|
|
68
69
|
if (memberCount > 50) {
|
|
69
|
-
return _this.getBylineComponent(isSelected,
|
|
70
|
+
return _this.getBylineComponent(isSelected, (0, _react.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.plus50MembersWithoutYou));
|
|
70
71
|
} else {
|
|
71
|
-
return _this.getBylineComponent(isSelected,
|
|
72
|
+
return _this.getBylineComponent(isSelected, (0, _react.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.memberCountWithoutYou, {
|
|
72
73
|
values: {
|
|
73
74
|
count: memberCount
|
|
74
75
|
}
|
|
@@ -78,7 +79,7 @@ var TeamOption = exports.TeamOption = /*#__PURE__*/function (_React$PureComponen
|
|
|
78
79
|
}
|
|
79
80
|
});
|
|
80
81
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getBylineComponent", function (isSelected, message) {
|
|
81
|
-
return
|
|
82
|
+
return (0, _react.jsx)("span", {
|
|
82
83
|
css: (0, _AvatarItemOption.textWrapper)(isSelected ? "var(--ds-text-selected, ".concat(_colors.B400, ")") : "var(--ds-text-subtlest, ".concat(_colors.N200, ")")),
|
|
83
84
|
"data-testid": "user-picker-team-secondary-text"
|
|
84
85
|
}, message);
|
|
@@ -87,7 +88,7 @@ var TeamOption = exports.TeamOption = /*#__PURE__*/function (_React$PureComponen
|
|
|
87
88
|
var _this$props$team3 = _this.props.team,
|
|
88
89
|
avatarUrl = _this$props$team3.avatarUrl,
|
|
89
90
|
name = _this$props$team3.name;
|
|
90
|
-
return
|
|
91
|
+
return (0, _react.jsx)(_SizeableAvatar.SizeableAvatar, {
|
|
91
92
|
appearance: "big",
|
|
92
93
|
src: avatarUrl,
|
|
93
94
|
name: name
|
|
@@ -103,7 +104,7 @@ var TeamOption = exports.TeamOption = /*#__PURE__*/function (_React$PureComponen
|
|
|
103
104
|
if (!((_this$props$team4 = _this.props.team) !== null && _this$props$team4 !== void 0 && _this$props$team4.byline)) {
|
|
104
105
|
return undefined;
|
|
105
106
|
}
|
|
106
|
-
return
|
|
107
|
+
return (0, _react.jsx)("span", {
|
|
107
108
|
css: (0, _AvatarItemOption.textWrapper)(_this.props.isSelected ? "var(--ds-text-selected, ".concat(_colors.B400, ")") : "var(--ds-text-subtlest, ".concat(_colors.N200, ")"))
|
|
108
109
|
}, _this.props.team.byline);
|
|
109
110
|
});
|
|
@@ -112,7 +113,7 @@ var TeamOption = exports.TeamOption = /*#__PURE__*/function (_React$PureComponen
|
|
|
112
113
|
(0, _createClass2.default)(TeamOption, [{
|
|
113
114
|
key: "render",
|
|
114
115
|
value: function render() {
|
|
115
|
-
return
|
|
116
|
+
return (0, _react.jsx)(_AvatarItemOption.AvatarItemOption, {
|
|
116
117
|
avatar: this.renderAvatar(),
|
|
117
118
|
isDisabled: this.props.team.isDisabled,
|
|
118
119
|
lozenge: this.getLozengeProps(),
|
|
@@ -122,4 +123,4 @@ var TeamOption = exports.TeamOption = /*#__PURE__*/function (_React$PureComponen
|
|
|
122
123
|
}
|
|
123
124
|
}]);
|
|
124
125
|
return TeamOption;
|
|
125
|
-
}(
|
|
126
|
+
}(_react2.default.PureComponent);
|
|
@@ -13,13 +13,14 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
var _colors = require("@atlaskit/theme/colors");
|
|
16
|
-
var _react =
|
|
16
|
+
var _react = require("@emotion/react");
|
|
17
|
+
var _react2 = _interopRequireDefault(require("react"));
|
|
17
18
|
var _AvatarItemOption = require("./AvatarItemOption");
|
|
18
19
|
var _HighlightText = require("./HighlightText");
|
|
19
20
|
var _SizeableAvatar = require("./SizeableAvatar");
|
|
20
21
|
var _utils = require("./utils");
|
|
21
22
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
22
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
23
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
|
|
23
24
|
var UserOption = exports.UserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
24
25
|
(0, _inherits2.default)(UserOption, _React$PureComponent);
|
|
25
26
|
var _super = _createSuper(UserOption);
|
|
@@ -35,25 +36,25 @@ var UserOption = exports.UserOption = /*#__PURE__*/function (_React$PureComponen
|
|
|
35
36
|
name = _this$props$user.name,
|
|
36
37
|
publicName = _this$props$user.publicName,
|
|
37
38
|
highlight = _this$props$user.highlight;
|
|
38
|
-
var result = [
|
|
39
|
+
var result = [(0, _react.jsx)("span", {
|
|
39
40
|
key: "name",
|
|
40
41
|
css: (0, _AvatarItemOption.textWrapper)(_this.props.isSelected ? "var(--ds-text-selected, ".concat(_colors.B400, ")") : "var(--ds-text, ".concat(_colors.N800, ")"))
|
|
41
|
-
},
|
|
42
|
+
}, (0, _react.jsx)(_HighlightText.HighlightText, {
|
|
42
43
|
highlights: highlight && highlight.name
|
|
43
44
|
}, name))];
|
|
44
45
|
if ((0, _utils.hasValue)(publicName) && name.trim() !== publicName.trim()) {
|
|
45
|
-
result.push(
|
|
46
|
+
result.push((0, _react.jsx)(_react2.default.Fragment, {
|
|
46
47
|
key: "publicName"
|
|
47
|
-
}, ' ',
|
|
48
|
+
}, ' ', (0, _react.jsx)("span", {
|
|
48
49
|
css: (0, _AvatarItemOption.textWrapper)(_this.props.isSelected ? "var(--ds-text-selected, ".concat(_colors.B400, ")") : "var(--ds-text-subtlest, ".concat(_colors.N200, ")"))
|
|
49
|
-
}, "(",
|
|
50
|
+
}, "(", (0, _react.jsx)(_HighlightText.HighlightText, {
|
|
50
51
|
highlights: highlight && highlight.publicName
|
|
51
52
|
}, publicName), ")")));
|
|
52
53
|
}
|
|
53
54
|
return result;
|
|
54
55
|
});
|
|
55
56
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderSecondaryText", function () {
|
|
56
|
-
return _this.props.user.byline ?
|
|
57
|
+
return _this.props.user.byline ? (0, _react.jsx)("span", {
|
|
57
58
|
css: (0, _AvatarItemOption.textWrapper)(_this.props.isSelected ? "var(--ds-text-selected, ".concat(_colors.B400, ")") : "var(--ds-text-subtlest, ".concat(_colors.N200, ")"))
|
|
58
59
|
}, _this.props.user.byline) : undefined;
|
|
59
60
|
});
|
|
@@ -63,7 +64,7 @@ var UserOption = exports.UserOption = /*#__PURE__*/function (_React$PureComponen
|
|
|
63
64
|
avatarUrl = _this$props$user2.avatarUrl,
|
|
64
65
|
name = _this$props$user2.name,
|
|
65
66
|
status = _this$props.status;
|
|
66
|
-
return
|
|
67
|
+
return (0, _react.jsx)(_SizeableAvatar.SizeableAvatar, {
|
|
67
68
|
appearance: "big",
|
|
68
69
|
src: avatarUrl,
|
|
69
70
|
presence: status,
|
|
@@ -80,7 +81,7 @@ var UserOption = exports.UserOption = /*#__PURE__*/function (_React$PureComponen
|
|
|
80
81
|
(0, _createClass2.default)(UserOption, [{
|
|
81
82
|
key: "render",
|
|
82
83
|
value: function render() {
|
|
83
|
-
return
|
|
84
|
+
return (0, _react.jsx)(_AvatarItemOption.AvatarItemOption, {
|
|
84
85
|
avatar: this.renderAvatar(),
|
|
85
86
|
lozenge: this.getLozengeProps(),
|
|
86
87
|
isDisabled: this.props.user.isDisabled,
|
|
@@ -90,4 +91,4 @@ var UserOption = exports.UserOption = /*#__PURE__*/function (_React$PureComponen
|
|
|
90
91
|
}
|
|
91
92
|
}]);
|
|
92
93
|
return UserOption;
|
|
93
|
-
}(
|
|
94
|
+
}(_react2.default.PureComponent);
|
package/dist/es2019/analytics.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createAndFireEvent } from '@atlaskit/analytics-next';
|
|
|
2
2
|
import { v4 as uuidv4 } from 'uuid';
|
|
3
3
|
import { isCustom, isExternalUser } from './components/utils';
|
|
4
4
|
const packageName = "@atlaskit/user-picker";
|
|
5
|
-
const packageVersion = "10.12.
|
|
5
|
+
const packageVersion = "10.12.6";
|
|
6
6
|
const UUID_REGEXP_TEAMS_GROUPS = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
|
|
7
7
|
const UUID_REGEXP_OLD_AAID = /^[a-fA-F0-9]{1,8}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
|
|
8
8
|
const UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import EmailIcon from '@atlaskit/icon/glyph/email';
|
|
2
3
|
import { N40, N500 } from '@atlaskit/theme/colors';
|
|
3
4
|
import React from 'react';
|
|
4
|
-
import { css } from '@emotion/react';
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
5
6
|
const getEmailAvatarWrapperStyle = isLozenge => {
|
|
6
7
|
const padding = isLozenge ? 0 : 4;
|
|
7
8
|
return css({
|
|
@@ -16,9 +17,9 @@ export const AddOptionAvatar = ({
|
|
|
16
17
|
isLozenge,
|
|
17
18
|
label
|
|
18
19
|
}) => {
|
|
19
|
-
return
|
|
20
|
+
return jsx("div", {
|
|
20
21
|
css: getEmailAvatarWrapperStyle(isLozenge)
|
|
21
|
-
},
|
|
22
|
+
}, jsx(EmailIcon, {
|
|
22
23
|
label: label,
|
|
23
24
|
size: isLozenge ? 'small' : 'medium',
|
|
24
25
|
primaryColor: `var(--ds-text-subtle, ${N500})`
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import { css } from '@emotion/react';
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
3
4
|
import Lozenge from '@atlaskit/lozenge';
|
|
4
5
|
import { isLozengeText } from './utils';
|
|
5
6
|
const AsyncTooltip = /*#__PURE__*/React.lazy(() => import( /* webpackChunkName: "@atlaskit-internal_@atlaskit/tooltip" */'@atlaskit/tooltip').then(module => {
|
|
@@ -58,25 +59,25 @@ export const AvatarItemOption = ({
|
|
|
58
59
|
if (lozenge !== null && lozenge !== void 0 && lozenge.tooltip) {
|
|
59
60
|
// Note that entire Lozenge must be wrapped in the Tooltip (rather than just the
|
|
60
61
|
// Lozenge text) or tooltip won't work
|
|
61
|
-
return
|
|
62
|
-
fallback:
|
|
63
|
-
},
|
|
62
|
+
return jsx(React.Suspense, {
|
|
63
|
+
fallback: jsx(Lozenge, lozenge, lozenge.text)
|
|
64
|
+
}, jsx(AsyncTooltip, {
|
|
64
65
|
content: lozenge.tooltip
|
|
65
|
-
},
|
|
66
|
+
}, jsx(Lozenge, lozenge, lozenge.text)));
|
|
66
67
|
}
|
|
67
|
-
return
|
|
68
|
+
return jsx(Lozenge, lozenge, lozenge.text);
|
|
68
69
|
}
|
|
69
70
|
return lozenge;
|
|
70
71
|
};
|
|
71
|
-
return
|
|
72
|
+
return jsx("span", {
|
|
72
73
|
css: wrapper(isDisabled)
|
|
73
|
-
}, avatar,
|
|
74
|
+
}, avatar, jsx("div", {
|
|
74
75
|
css: optionWrapper
|
|
75
|
-
},
|
|
76
|
+
}, jsx("div", null, jsx("div", {
|
|
76
77
|
css: getTextStyle()
|
|
77
|
-
}, primaryText), secondaryText &&
|
|
78
|
+
}, primaryText), secondaryText && jsx("div", {
|
|
78
79
|
css: getTextStyle(true)
|
|
79
|
-
}, secondaryText))), lozenge &&
|
|
80
|
+
}, secondaryText))), lozenge && jsx("div", {
|
|
80
81
|
css: additionalInfo
|
|
81
82
|
}, renderLozenge()));
|
|
82
83
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
/** @jsx jsx */
|
|
2
3
|
import { B400, N800, N200 } from '@atlaskit/theme/colors';
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
3
5
|
import React from 'react';
|
|
4
6
|
import { AvatarItemOption, textWrapper } from '../AvatarItemOption';
|
|
5
7
|
import { HighlightText } from '../HighlightText';
|
|
@@ -14,14 +16,14 @@ export class CustomOption extends React.PureComponent {
|
|
|
14
16
|
highlight
|
|
15
17
|
}
|
|
16
18
|
} = this.props;
|
|
17
|
-
return [
|
|
19
|
+
return [jsx("span", {
|
|
18
20
|
key: "name",
|
|
19
21
|
css: textWrapper(this.props.isSelected ? `var(--ds-text-selected, ${B400})` : `var(--ds-text, ${N800})`)
|
|
20
|
-
},
|
|
22
|
+
}, jsx(HighlightText, {
|
|
21
23
|
highlights: highlight && highlight.name
|
|
22
24
|
}, name))];
|
|
23
25
|
});
|
|
24
|
-
_defineProperty(this, "getBylineComponent", (isSelected, message) =>
|
|
26
|
+
_defineProperty(this, "getBylineComponent", (isSelected, message) => jsx("span", {
|
|
25
27
|
css: textWrapper(isSelected ? `var(--ds-text-selected, ${B400})` : `var(--ds-text-subtlest, ${N200})`),
|
|
26
28
|
"data-testid": "user-picker-custom-secondary-text"
|
|
27
29
|
}, message));
|
|
@@ -39,7 +41,7 @@ export class CustomOption extends React.PureComponent {
|
|
|
39
41
|
name
|
|
40
42
|
}
|
|
41
43
|
} = this.props;
|
|
42
|
-
return
|
|
44
|
+
return jsx(SizeableAvatar, {
|
|
43
45
|
appearance: "big",
|
|
44
46
|
src: avatarUrl,
|
|
45
47
|
name: name
|
|
@@ -50,7 +52,7 @@ export class CustomOption extends React.PureComponent {
|
|
|
50
52
|
} : this.props.data.lozenge);
|
|
51
53
|
}
|
|
52
54
|
render() {
|
|
53
|
-
return
|
|
55
|
+
return jsx(AvatarItemOption, {
|
|
54
56
|
avatar: this.renderAvatar(),
|
|
55
57
|
isDisabled: this.props.data.isDisabled,
|
|
56
58
|
lozenge: this.getLozengeProps(),
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
/** @jsx jsx */
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { FormattedMessage } from 'react-intl-next';
|
|
4
5
|
import { B400, N200, N800 } from '@atlaskit/theme/colors';
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
5
7
|
import { AddOptionAvatar } from '../AddOptionAvatar';
|
|
6
8
|
import { AvatarItemOption, textWrapper } from '../AvatarItemOption';
|
|
7
9
|
import { messages } from '../i18n';
|
|
@@ -18,19 +20,19 @@ export class EmailOption extends React.PureComponent {
|
|
|
18
20
|
id
|
|
19
21
|
}
|
|
20
22
|
} = this.props;
|
|
21
|
-
return
|
|
23
|
+
return jsx("span", {
|
|
22
24
|
key: "name",
|
|
23
25
|
css: textWrapper(this.props.isSelected ? `var(--ds-text-selected, ${B400})` : `var(--ds-text, ${N800})`)
|
|
24
26
|
}, id);
|
|
25
27
|
});
|
|
26
28
|
_defineProperty(this, "renderSecondaryText", label => {
|
|
27
|
-
return
|
|
29
|
+
return jsx("span", {
|
|
28
30
|
css: textWrapper(this.props.isSelected ? `var(--ds-text-selected, ${B400})` : `var(--ds-text-subtlest, ${N200})`),
|
|
29
31
|
"data-testid": "user-picker-email-secondary-text"
|
|
30
32
|
}, label);
|
|
31
33
|
});
|
|
32
|
-
_defineProperty(this, "renderOption", label =>
|
|
33
|
-
avatar:
|
|
34
|
+
_defineProperty(this, "renderOption", label => jsx(AvatarItemOption, {
|
|
35
|
+
avatar: jsx(AddOptionAvatar, {
|
|
34
36
|
label: label
|
|
35
37
|
}),
|
|
36
38
|
lozenge: this.getLozengeProps(),
|
|
@@ -44,6 +46,6 @@ export class EmailOption extends React.PureComponent {
|
|
|
44
46
|
label,
|
|
45
47
|
emailValidity
|
|
46
48
|
} = this.props;
|
|
47
|
-
return label !== undefined ? this.renderOption(label) :
|
|
49
|
+
return label !== undefined ? this.renderOption(label) : jsx(FormattedMessage, getAddEmailMessage(emailValidity), label => this.renderOption(label));
|
|
48
50
|
}
|
|
49
51
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
2
4
|
import { B400 } from '@atlaskit/theme/colors';
|
|
3
5
|
const outerWrapper = isDisabled => css({
|
|
4
6
|
alignItems: 'center',
|
|
@@ -49,14 +51,14 @@ export const ExternalAvatarItemOption = ({
|
|
|
49
51
|
primaryText,
|
|
50
52
|
secondaryText,
|
|
51
53
|
sourcesInfoTooltip
|
|
52
|
-
}) =>
|
|
54
|
+
}) => jsx("div", {
|
|
53
55
|
css: outerWrapper(isDisabled)
|
|
54
|
-
}, avatar,
|
|
56
|
+
}, avatar, jsx("div", {
|
|
55
57
|
css: detailsWrapper
|
|
56
|
-
},
|
|
58
|
+
}, jsx("div", {
|
|
57
59
|
css: textSection
|
|
58
|
-
},
|
|
60
|
+
}, jsx("div", null, jsx("div", {
|
|
59
61
|
css: getTextStyle()
|
|
60
|
-
}, primaryText)), secondaryText &&
|
|
62
|
+
}, primaryText)), secondaryText && jsx("div", null, jsx("div", {
|
|
61
63
|
css: getTextStyle(true)
|
|
62
|
-
}, secondaryText))),
|
|
64
|
+
}, secondaryText))), jsx("div", null, sourcesInfoTooltip)));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import { useCallback, useState } from 'react';
|
|
2
|
-
import { css } from '@emotion/react';
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
3
4
|
import EditorPanelIcon from '@atlaskit/icon/glyph/editor/panel';
|
|
4
5
|
import { N50, N200 } from '@atlaskit/theme/colors';
|
|
5
6
|
const wrapper = css({
|
|
@@ -9,11 +10,11 @@ export default (() => {
|
|
|
9
10
|
const [isMouseHovered, setHoverState] = useState(false);
|
|
10
11
|
const onMouseEnter = useCallback(() => setHoverState(true), [setHoverState]);
|
|
11
12
|
const onMouseLeave = useCallback(() => setHoverState(false), [setHoverState]);
|
|
12
|
-
return
|
|
13
|
+
return jsx("div", {
|
|
13
14
|
css: wrapper,
|
|
14
15
|
onMouseEnter: onMouseEnter,
|
|
15
16
|
onMouseLeave: onMouseLeave
|
|
16
|
-
},
|
|
17
|
+
}, jsx(EditorPanelIcon, {
|
|
17
18
|
testId: "source-icon",
|
|
18
19
|
label: "",
|
|
19
20
|
size: "large",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { FormattedMessage } from 'react-intl-next';
|
|
3
|
-
import { css } from '@emotion/react';
|
|
4
|
+
import { css, jsx } from '@emotion/react';
|
|
4
5
|
import { AtlassianIcon, ConfluenceIcon, JiraIcon } from '@atlaskit/logo';
|
|
5
6
|
import Spinner from '@atlaskit/spinner/spinner';
|
|
6
7
|
import { SlackIcon } from '../assets/slack';
|
|
@@ -20,37 +21,37 @@ export const sourceWrapper = css({
|
|
|
20
21
|
});
|
|
21
22
|
const SUPPORTED_SOURCES = [{
|
|
22
23
|
sourceType: 'jira',
|
|
23
|
-
icon:
|
|
24
|
+
icon: jsx(JiraIcon, {
|
|
24
25
|
size: 'xsmall'
|
|
25
26
|
}),
|
|
26
27
|
label: messages.jiraSource
|
|
27
28
|
}, {
|
|
28
29
|
sourceType: 'confluence',
|
|
29
|
-
icon:
|
|
30
|
+
icon: jsx(ConfluenceIcon, {
|
|
30
31
|
size: 'xsmall'
|
|
31
32
|
}),
|
|
32
33
|
label: messages.confluenceSource
|
|
33
34
|
}, {
|
|
34
35
|
sourceType: 'other-atlassian',
|
|
35
|
-
icon:
|
|
36
|
+
icon: jsx(AtlassianIcon, {
|
|
36
37
|
size: 'xsmall'
|
|
37
38
|
}),
|
|
38
39
|
label: messages.otherAtlassianSource
|
|
39
40
|
}, {
|
|
40
41
|
sourceType: 'slack',
|
|
41
|
-
icon:
|
|
42
|
+
icon: jsx(SlackIcon, null),
|
|
42
43
|
label: messages.slackProvider
|
|
43
44
|
}, {
|
|
44
45
|
sourceType: 'google',
|
|
45
|
-
icon:
|
|
46
|
+
icon: jsx(GoogleIcon, null),
|
|
46
47
|
label: messages.googleProvider
|
|
47
48
|
}, {
|
|
48
49
|
sourceType: 'microsoft',
|
|
49
|
-
icon:
|
|
50
|
+
icon: jsx(MicrosoftIcon, null),
|
|
50
51
|
label: messages.microsoftProvider
|
|
51
52
|
}, {
|
|
52
53
|
sourceType: 'github',
|
|
53
|
-
icon:
|
|
54
|
+
icon: jsx(GitHubIcon, null),
|
|
54
55
|
label: messages.gitHubProvider
|
|
55
56
|
}];
|
|
56
57
|
export const SourcesTooltipContent = ({
|
|
@@ -58,19 +59,19 @@ export const SourcesTooltipContent = ({
|
|
|
58
59
|
sourcesLoading
|
|
59
60
|
}) => {
|
|
60
61
|
const sourcesToRender = React.useMemo(() => SUPPORTED_SOURCES.filter(supportedSource => sources.includes(supportedSource.sourceType)), [sources]);
|
|
61
|
-
return
|
|
62
|
+
return jsx(React.Fragment, null, !sourcesLoading && sources.length === 0 ? jsx("span", null, jsx(FormattedMessage, messages.externalUserSourcesError)) : jsx(React.Fragment, null, jsx("span", null, jsx(FormattedMessage, messages.externalUserSourcesHeading)), jsx("div", {
|
|
62
63
|
css: sourcesTooltipContainer
|
|
63
|
-
}, sourcesLoading &&
|
|
64
|
+
}, sourcesLoading && jsx(Spinner, {
|
|
64
65
|
size: "small",
|
|
65
66
|
appearance: "invert"
|
|
66
67
|
}), !sourcesLoading && sourcesToRender.map(({
|
|
67
68
|
sourceType,
|
|
68
69
|
icon,
|
|
69
70
|
label
|
|
70
|
-
}) =>
|
|
71
|
+
}) => jsx("div", {
|
|
71
72
|
css: sourceWrapper,
|
|
72
73
|
key: sourceType
|
|
73
|
-
},
|
|
74
|
+
}, jsx("span", {
|
|
74
75
|
css: imageContainer
|
|
75
|
-
}, icon),
|
|
76
|
+
}, icon), jsx("span", null, jsx(FormattedMessage, label)))))));
|
|
76
77
|
};
|