@atlaskit/user-picker 8.8.5 → 9.0.1
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 +24 -0
- package/dist/cjs/analytics.js +1 -84
- package/dist/cjs/components/AddOptionAvatar.js +16 -12
- package/dist/cjs/components/AvatarItemOption.js +56 -32
- package/dist/cjs/components/EmailOption/main.js +9 -7
- package/dist/cjs/components/ExternalUserOption/ExternalAvatarItemOption.js +62 -21
- package/dist/cjs/components/ExternalUserOption/InfoIcon.js +9 -15
- package/dist/cjs/components/ExternalUserOption/SourcesTooltipContent.js +29 -23
- package/dist/cjs/components/ExternalUserOption/main.js +28 -24
- package/dist/cjs/components/GroupOption/main.js +23 -19
- package/dist/cjs/components/MultiValue.js +18 -16
- package/dist/cjs/components/PopupControl.js +20 -21
- package/dist/cjs/components/SingleValue.js +25 -11
- package/dist/cjs/components/SingleValueContainer.js +9 -8
- package/dist/cjs/components/TeamOption/main.js +13 -11
- package/dist/cjs/components/UserOption.js +13 -11
- package/dist/cjs/components/i18n.js +1 -1
- package/dist/cjs/index.js +0 -26
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics.js +0 -62
- package/dist/es2019/components/AddOptionAvatar.js +16 -11
- package/dist/es2019/components/AvatarItemOption.js +47 -42
- package/dist/es2019/components/EmailOption/main.js +11 -8
- package/dist/es2019/components/ExternalUserOption/ExternalAvatarItemOption.js +56 -41
- package/dist/es2019/components/ExternalUserOption/InfoIcon.js +9 -7
- package/dist/es2019/components/ExternalUserOption/SourcesTooltipContent.js +27 -21
- package/dist/es2019/components/ExternalUserOption/main.js +28 -24
- package/dist/es2019/components/GroupOption/main.js +22 -19
- package/dist/es2019/components/MultiValue.js +19 -13
- package/dist/es2019/components/PopupControl.js +21 -18
- package/dist/es2019/components/SingleValue.js +25 -22
- package/dist/es2019/components/SingleValueContainer.js +11 -7
- package/dist/es2019/components/TeamOption/main.js +15 -12
- package/dist/es2019/components/UserOption.js +15 -12
- package/dist/es2019/components/i18n.js +1 -1
- package/dist/es2019/index.js +0 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics.js +0 -66
- package/dist/esm/components/AddOptionAvatar.js +17 -11
- package/dist/esm/components/AvatarItemOption.js +56 -27
- package/dist/esm/components/EmailOption/main.js +10 -8
- package/dist/esm/components/ExternalUserOption/ExternalAvatarItemOption.js +65 -18
- package/dist/esm/components/ExternalUserOption/InfoIcon.js +9 -8
- package/dist/esm/components/ExternalUserOption/SourcesTooltipContent.js +27 -18
- package/dist/esm/components/ExternalUserOption/main.js +27 -18
- package/dist/esm/components/GroupOption/main.js +22 -15
- package/dist/esm/components/MultiValue.js +19 -13
- package/dist/esm/components/PopupControl.js +21 -11
- package/dist/esm/components/SingleValue.js +26 -9
- package/dist/esm/components/SingleValueContainer.js +10 -7
- package/dist/esm/components/TeamOption/main.js +14 -12
- package/dist/esm/components/UserOption.js +14 -12
- package/dist/esm/components/i18n.js +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics.d.ts +0 -10
- package/dist/types/components/AvatarItemOption.d.ts +3 -2
- package/dist/types/components/BaseUserPicker.d.ts +1 -1
- package/dist/types/components/EmailOption/main.d.ts +1 -0
- package/dist/types/components/ExternalUserOption/ExternalAvatarItemOption.d.ts +1 -0
- package/dist/types/components/ExternalUserOption/SourcesTooltipContent.d.ts +3 -2
- package/dist/types/components/ExternalUserOption/main.d.ts +3 -2
- package/dist/types/components/GroupOption/main.d.ts +2 -1
- package/dist/types/components/MultiValue.d.ts +1 -0
- package/dist/types/components/PopupControl.d.ts +1 -0
- package/dist/types/components/PopupUserPicker.d.ts +1 -1
- package/dist/types/components/SingleValueContainer.d.ts +1 -0
- package/dist/types/components/UserPicker.d.ts +1 -1
- package/dist/types/index.d.ts +0 -2
- package/docs/1-smart-user-picker.tsx +1 -1
- package/package.json +4 -3
- package/dist/cjs/components/smart-user-picker/components/index.js +0 -602
- package/dist/cjs/components/smart-user-picker/config/index.js +0 -50
- package/dist/cjs/components/smart-user-picker/index.js +0 -41
- package/dist/cjs/components/smart-user-picker/service/UsersClient.js +0 -85
- package/dist/cjs/components/smart-user-picker/service/index.js +0 -15
- package/dist/cjs/components/smart-user-picker/service/recommendationClient.js +0 -75
- package/dist/cjs/components/smart-user-picker/service/users-transformer.js +0 -98
- package/dist/es2019/components/smart-user-picker/components/index.js +0 -398
- package/dist/es2019/components/smart-user-picker/config/index.js +0 -37
- package/dist/es2019/components/smart-user-picker/index.js +0 -7
- package/dist/es2019/components/smart-user-picker/service/UsersClient.js +0 -65
- package/dist/es2019/components/smart-user-picker/service/index.js +0 -1
- package/dist/es2019/components/smart-user-picker/service/recommendationClient.js +0 -56
- package/dist/es2019/components/smart-user-picker/service/users-transformer.js +0 -77
- package/dist/esm/components/smart-user-picker/components/index.js +0 -582
- package/dist/esm/components/smart-user-picker/config/index.js +0 -38
- package/dist/esm/components/smart-user-picker/index.js +0 -7
- package/dist/esm/components/smart-user-picker/service/UsersClient.js +0 -79
- package/dist/esm/components/smart-user-picker/service/index.js +0 -1
- package/dist/esm/components/smart-user-picker/service/recommendationClient.js +0 -64
- package/dist/esm/components/smart-user-picker/service/users-transformer.js +0 -87
- package/dist/types/components/smart-user-picker/components/index.d.ts +0 -196
- package/dist/types/components/smart-user-picker/config/index.d.ts +0 -17
- package/dist/types/components/smart-user-picker/index.d.ts +0 -8
- package/dist/types/components/smart-user-picker/service/UsersClient.d.ts +0 -14
- package/dist/types/components/smart-user-picker/service/index.d.ts +0 -1
- package/dist/types/components/smart-user-picker/service/recommendationClient.d.ts +0 -23
- package/dist/types/components/smart-user-picker/service/users-transformer.d.ts +0 -25
|
@@ -5,24 +5,29 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
9
|
-
|
|
10
|
-
var _templateObject;
|
|
11
8
|
|
|
12
9
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
10
|
|
|
14
11
|
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; } }
|
|
15
12
|
|
|
13
|
+
/** @jsx jsx */
|
|
16
14
|
import React from 'react';
|
|
17
15
|
import { FormattedMessage } from 'react-intl-next';
|
|
18
|
-
import
|
|
16
|
+
import { css, jsx } from '@emotion/core';
|
|
19
17
|
import { N20, B400, N800, N200 } from '@atlaskit/theme/colors';
|
|
20
18
|
import { token } from '@atlaskit/tokens';
|
|
21
19
|
import PeopleIcon from '@atlaskit/icon/glyph/people';
|
|
22
|
-
import { AvatarItemOption,
|
|
20
|
+
import { AvatarItemOption, textWrapper } from '../AvatarItemOption';
|
|
23
21
|
import { messages } from '.././i18n';
|
|
24
|
-
import { HighlightText } from '
|
|
25
|
-
export var
|
|
22
|
+
import { HighlightText } from '../HighlightText';
|
|
23
|
+
export var groupOptionIconWrapper = css({
|
|
24
|
+
padding: '2px',
|
|
25
|
+
'> span': {
|
|
26
|
+
backgroundColor: token('color.background.neutral', N20),
|
|
27
|
+
borderRadius: '50%',
|
|
28
|
+
padding: '4px'
|
|
29
|
+
}
|
|
30
|
+
});
|
|
26
31
|
export var GroupOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
27
32
|
_inherits(GroupOption, _React$PureComponent);
|
|
28
33
|
|
|
@@ -45,16 +50,18 @@ export var GroupOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
45
50
|
_this$props$group = _this$props.group,
|
|
46
51
|
name = _this$props$group.name,
|
|
47
52
|
highlight = _this$props$group.highlight;
|
|
48
|
-
return [
|
|
53
|
+
return [jsx("span", {
|
|
49
54
|
key: "name",
|
|
50
|
-
|
|
51
|
-
},
|
|
55
|
+
css: textWrapper(isSelected ? token('color.text.selected', B400) : token('color.text', N800))
|
|
56
|
+
}, jsx(HighlightText, {
|
|
52
57
|
highlights: highlight && highlight.name
|
|
53
58
|
}, name))];
|
|
54
59
|
});
|
|
55
60
|
|
|
56
61
|
_defineProperty(_assertThisInitialized(_this), "renderAvatar", function () {
|
|
57
|
-
return
|
|
62
|
+
return jsx("span", {
|
|
63
|
+
css: groupOptionIconWrapper
|
|
64
|
+
}, jsx(PeopleIcon, {
|
|
58
65
|
label: "group-icon",
|
|
59
66
|
size: "medium"
|
|
60
67
|
}));
|
|
@@ -62,9 +69,9 @@ export var GroupOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
62
69
|
|
|
63
70
|
_defineProperty(_assertThisInitialized(_this), "renderByline", function () {
|
|
64
71
|
var isSelected = _this.props.isSelected;
|
|
65
|
-
return
|
|
66
|
-
|
|
67
|
-
},
|
|
72
|
+
return jsx("span", {
|
|
73
|
+
css: textWrapper(isSelected ? token('color.text.selected', B400) : token('color.text.subtlest', N200))
|
|
74
|
+
}, jsx(FormattedMessage, messages.groupByline));
|
|
68
75
|
});
|
|
69
76
|
|
|
70
77
|
_defineProperty(_assertThisInitialized(_this), "getLozengeProps", function () {
|
|
@@ -79,7 +86,7 @@ export var GroupOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
79
86
|
_createClass(GroupOption, [{
|
|
80
87
|
key: "render",
|
|
81
88
|
value: function render() {
|
|
82
|
-
return
|
|
89
|
+
return jsx(AvatarItemOption, {
|
|
83
90
|
avatar: this.renderAvatar(),
|
|
84
91
|
secondaryText: this.renderByline(),
|
|
85
92
|
primaryText: this.getPrimaryText(),
|
|
@@ -7,19 +7,17 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
7
7
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
11
10
|
var _excluded = ["children", "innerProps"];
|
|
12
11
|
|
|
13
|
-
var _templateObject, _templateObject2;
|
|
14
|
-
|
|
15
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
16
13
|
|
|
17
14
|
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; } }
|
|
18
15
|
|
|
16
|
+
/** @jsx jsx */
|
|
19
17
|
import React from 'react';
|
|
20
18
|
import { FormattedMessage } from 'react-intl-next';
|
|
21
19
|
import { components } from '@atlaskit/select';
|
|
22
|
-
import
|
|
20
|
+
import { css, jsx } from '@emotion/core';
|
|
23
21
|
import { AddOptionAvatar } from './AddOptionAvatar';
|
|
24
22
|
import { SizeableAvatar } from './SizeableAvatar';
|
|
25
23
|
import { messages } from './i18n';
|
|
@@ -41,8 +39,12 @@ export var scrollToValue = function scrollToValue(valueContainer, control) {
|
|
|
41
39
|
valueContainer.scrollIntoView(false);
|
|
42
40
|
}
|
|
43
41
|
};
|
|
44
|
-
var
|
|
45
|
-
|
|
42
|
+
var groupTagContainer = css({
|
|
43
|
+
paddingLeft: '2px'
|
|
44
|
+
});
|
|
45
|
+
var nameWrapper = css({
|
|
46
|
+
paddingLeft: '5px'
|
|
47
|
+
});
|
|
46
48
|
export var MultiValue = /*#__PURE__*/function (_React$Component) {
|
|
47
49
|
_inherits(MultiValue, _React$Component);
|
|
48
50
|
|
|
@@ -63,11 +65,11 @@ export var MultiValue = /*#__PURE__*/function (_React$Component) {
|
|
|
63
65
|
selectProps = _this$props.selectProps;
|
|
64
66
|
|
|
65
67
|
if (isEmail(data)) {
|
|
66
|
-
return selectProps.emailLabel ?
|
|
68
|
+
return selectProps.emailLabel ? jsx(AddOptionAvatar, {
|
|
67
69
|
isLozenge: true,
|
|
68
70
|
label: selectProps.emailLabel
|
|
69
|
-
}) :
|
|
70
|
-
return
|
|
71
|
+
}) : jsx(FormattedMessage, messages.addEmail, function (label) {
|
|
72
|
+
return jsx(AddOptionAvatar, {
|
|
71
73
|
isLozenge: true,
|
|
72
74
|
label: label
|
|
73
75
|
});
|
|
@@ -75,13 +77,15 @@ export var MultiValue = /*#__PURE__*/function (_React$Component) {
|
|
|
75
77
|
}
|
|
76
78
|
|
|
77
79
|
if (isGroup(data)) {
|
|
78
|
-
return
|
|
80
|
+
return jsx("div", {
|
|
81
|
+
css: groupTagContainer
|
|
82
|
+
}, jsx(PeopleIcon, {
|
|
79
83
|
label: "group-icon",
|
|
80
84
|
size: "small"
|
|
81
85
|
}));
|
|
82
86
|
}
|
|
83
87
|
|
|
84
|
-
return
|
|
88
|
+
return jsx(SizeableAvatar, {
|
|
85
89
|
appearance: "multi",
|
|
86
90
|
src: getAvatarUrl(data),
|
|
87
91
|
name: label
|
|
@@ -127,12 +131,14 @@ export var MultiValue = /*#__PURE__*/function (_React$Component) {
|
|
|
127
131
|
innerProps = _this$props3.innerProps,
|
|
128
132
|
rest = _objectWithoutProperties(_this$props3, _excluded);
|
|
129
133
|
|
|
130
|
-
return
|
|
134
|
+
return jsx(components.MultiValue, _extends({}, rest, {
|
|
131
135
|
innerProps: {
|
|
132
136
|
ref: this.containerRef
|
|
133
137
|
},
|
|
134
138
|
cropWithEllipsis: false
|
|
135
|
-
}), this.getElemBefore(), " ",
|
|
139
|
+
}), this.getElemBefore(), " ", jsx("div", {
|
|
140
|
+
css: nameWrapper
|
|
141
|
+
}, children));
|
|
136
142
|
}
|
|
137
143
|
}]);
|
|
138
144
|
|
|
@@ -3,43 +3,49 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
7
|
-
|
|
8
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
9
6
|
|
|
10
7
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11
8
|
|
|
12
9
|
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; } }
|
|
13
10
|
|
|
11
|
+
/** @jsx jsx */
|
|
14
12
|
import React from 'react';
|
|
15
13
|
import { themed } from '@atlaskit/theme/components';
|
|
16
14
|
import { token } from '@atlaskit/tokens';
|
|
17
15
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
18
16
|
import { components } from '@atlaskit/select';
|
|
19
|
-
import
|
|
17
|
+
import { css, jsx } from '@emotion/core';
|
|
20
18
|
import { N200, DN90 } from '@atlaskit/theme/colors';
|
|
21
19
|
var spacing = gridSize();
|
|
22
20
|
var fontSize = 12;
|
|
23
21
|
var innerHeight = spacing * 2; // 16px
|
|
24
22
|
|
|
25
23
|
var lineHeight = innerHeight / fontSize;
|
|
26
|
-
var
|
|
24
|
+
var controlWrapper = css({
|
|
25
|
+
display: 'flex',
|
|
26
|
+
flexDirection: 'column',
|
|
27
|
+
padding: "0px ".concat(spacing, "px ").concat(spacing, "px")
|
|
28
|
+
});
|
|
27
29
|
var getColor = themed({
|
|
28
30
|
light: token('color.text.subtlest', N200),
|
|
29
31
|
dark: token('color.text.subtlest', DN90)
|
|
30
32
|
});
|
|
31
33
|
|
|
32
|
-
var
|
|
34
|
+
var getLabelStyle = function getLabelStyle() {
|
|
33
35
|
var right = 0;
|
|
34
36
|
var bottom = spacing / 2;
|
|
35
37
|
var left = 0;
|
|
36
38
|
var top = spacing * 2.5;
|
|
37
|
-
|
|
39
|
+
var color = getColor();
|
|
40
|
+
return css({
|
|
41
|
+
color: color,
|
|
42
|
+
fontSize: "".concat(fontSize, "px"),
|
|
43
|
+
fontWeight: 600,
|
|
44
|
+
lineHeight: "".concat(lineHeight),
|
|
45
|
+
padding: "".concat(top, "px ").concat(right, "px ").concat(bottom, "px ").concat(left, "px")
|
|
46
|
+
});
|
|
38
47
|
};
|
|
39
48
|
|
|
40
|
-
var Label = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: ", ";\n font-size: ", "px;\n font-weight: 600;\n line-height: ", ";\n ", "\n"])), function (props) {
|
|
41
|
-
return getColor(props);
|
|
42
|
-
}, fontSize, lineHeight, getPadding);
|
|
43
49
|
export var PopupControl = /*#__PURE__*/function (_React$PureComponent) {
|
|
44
50
|
_inherits(PopupControl, _React$PureComponent);
|
|
45
51
|
|
|
@@ -55,7 +61,11 @@ export var PopupControl = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
55
61
|
key: "render",
|
|
56
62
|
value: function render() {
|
|
57
63
|
var popupTitle = this.props.selectProps.popupTitle;
|
|
58
|
-
return
|
|
64
|
+
return jsx("div", {
|
|
65
|
+
css: controlWrapper
|
|
66
|
+
}, jsx("div", {
|
|
67
|
+
css: getLabelStyle()
|
|
68
|
+
}, popupTitle), jsx(components.Control, this.props));
|
|
59
69
|
}
|
|
60
70
|
}]);
|
|
61
71
|
|
|
@@ -1,15 +1,30 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
3
|
var _excluded = ["ref"];
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/** @jsx jsx */
|
|
7
6
|
import { AvatarItem } from '@atlaskit/avatar';
|
|
8
|
-
import
|
|
9
|
-
import styled from 'styled-components';
|
|
7
|
+
import { css, jsx } from '@emotion/core';
|
|
10
8
|
import { SizeableAvatar } from './SizeableAvatar';
|
|
11
9
|
import { getAvatarUrl } from './utils';
|
|
12
|
-
var
|
|
10
|
+
var avatarItemComponent = css({
|
|
11
|
+
border: 'none !important',
|
|
12
|
+
padding: '0 !important',
|
|
13
|
+
width: 'auto',
|
|
14
|
+
overflow: 'hidden',
|
|
15
|
+
|
|
16
|
+
/* IE 11 needs this prop explicitly to flex items */
|
|
17
|
+
flex: '1 1 auto',
|
|
18
|
+
minWidth: '100px',
|
|
19
|
+
'& > span': {
|
|
20
|
+
boxSizing: 'border-box'
|
|
21
|
+
},
|
|
22
|
+
'&:hover': {
|
|
23
|
+
width: 'auto',
|
|
24
|
+
padding: 0,
|
|
25
|
+
border: 'none'
|
|
26
|
+
}
|
|
27
|
+
});
|
|
13
28
|
export var SingleValue = function SingleValue(props) {
|
|
14
29
|
var _props$data = props.data,
|
|
15
30
|
label = _props$data.label,
|
|
@@ -17,9 +32,9 @@ export var SingleValue = function SingleValue(props) {
|
|
|
17
32
|
_props$selectProps = props.selectProps,
|
|
18
33
|
appearance = _props$selectProps.appearance,
|
|
19
34
|
isFocused = _props$selectProps.isFocused;
|
|
20
|
-
return !isFocused ?
|
|
35
|
+
return !isFocused ? jsx(AvatarItem, {
|
|
21
36
|
backgroundColor: "transparent",
|
|
22
|
-
avatar:
|
|
37
|
+
avatar: jsx(SizeableAvatar, {
|
|
23
38
|
src: getAvatarUrl(data),
|
|
24
39
|
appearance: appearance,
|
|
25
40
|
name: label
|
|
@@ -29,6 +44,8 @@ export var SingleValue = function SingleValue(props) {
|
|
|
29
44
|
var ref = _ref.ref,
|
|
30
45
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
31
46
|
|
|
32
|
-
return
|
|
47
|
+
return jsx("div", _extends({
|
|
48
|
+
css: avatarItemComponent
|
|
49
|
+
}, props));
|
|
33
50
|
}) : null;
|
|
34
51
|
};
|
|
@@ -6,21 +6,22 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
6
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
10
9
|
var _excluded = ["children"];
|
|
11
10
|
|
|
12
|
-
var _templateObject;
|
|
13
|
-
|
|
14
11
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
15
12
|
|
|
16
13
|
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; } }
|
|
17
14
|
|
|
15
|
+
/** @jsx jsx */
|
|
18
16
|
import React from 'react';
|
|
19
|
-
import
|
|
17
|
+
import { css, jsx } from '@emotion/core';
|
|
20
18
|
import { components } from '@atlaskit/select';
|
|
21
19
|
import { SizeableAvatar } from './SizeableAvatar';
|
|
22
20
|
import { BORDER_PADDING } from './styles';
|
|
23
|
-
var
|
|
21
|
+
var placeholderIconContainer = css({
|
|
22
|
+
paddingLeft: "".concat(BORDER_PADDING, "px"),
|
|
23
|
+
lineHeight: 0
|
|
24
|
+
});
|
|
24
25
|
|
|
25
26
|
var showUserAvatar = function showUserAvatar(inputValue, value) {
|
|
26
27
|
return value && value.data && inputValue === value.label;
|
|
@@ -52,7 +53,7 @@ export var SingleValueContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
52
53
|
value = _this$props$selectPro.value;
|
|
53
54
|
|
|
54
55
|
if (isFocused || !hasValue) {
|
|
55
|
-
return
|
|
56
|
+
return jsx(SizeableAvatar, {
|
|
56
57
|
appearance: appearance,
|
|
57
58
|
src: showUserAvatar(inputValue, value) ? value.data.avatarUrl : undefined
|
|
58
59
|
});
|
|
@@ -71,7 +72,9 @@ export var SingleValueContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
71
72
|
children = _this$props2.children,
|
|
72
73
|
valueContainerProps = _objectWithoutProperties(_this$props2, _excluded);
|
|
73
74
|
|
|
74
|
-
return
|
|
75
|
+
return jsx(components.ValueContainer, valueContainerProps, jsx("div", {
|
|
76
|
+
css: placeholderIconContainer
|
|
77
|
+
}, this.renderAvatar()), children);
|
|
75
78
|
}
|
|
76
79
|
}]);
|
|
77
80
|
|
|
@@ -11,11 +11,13 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
11
11
|
|
|
12
12
|
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; } }
|
|
13
13
|
|
|
14
|
+
/** @jsx jsx */
|
|
14
15
|
import { B400, N800, N200 } from '@atlaskit/theme/colors';
|
|
15
16
|
import { token } from '@atlaskit/tokens';
|
|
17
|
+
import { jsx } from '@emotion/core';
|
|
16
18
|
import React from 'react';
|
|
17
19
|
import { FormattedMessage } from 'react-intl-next';
|
|
18
|
-
import { AvatarItemOption,
|
|
20
|
+
import { AvatarItemOption, textWrapper } from '.././AvatarItemOption';
|
|
19
21
|
import { HighlightText } from '.././HighlightText';
|
|
20
22
|
import { messages } from '.././i18n';
|
|
21
23
|
import { SizeableAvatar } from '.././SizeableAvatar';
|
|
@@ -39,10 +41,10 @@ export var TeamOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
39
41
|
var _this$props$team = _this.props.team,
|
|
40
42
|
name = _this$props$team.name,
|
|
41
43
|
highlight = _this$props$team.highlight;
|
|
42
|
-
return [
|
|
44
|
+
return [jsx("span", {
|
|
43
45
|
key: "name",
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
+
css: textWrapper(_this.props.isSelected ? token('color.text.selected', B400) : token('color.text', N800))
|
|
47
|
+
}, jsx(HighlightText, {
|
|
46
48
|
highlights: highlight && highlight.name
|
|
47
49
|
}, name))];
|
|
48
50
|
});
|
|
@@ -59,9 +61,9 @@ export var TeamOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
59
61
|
} else {
|
|
60
62
|
if (includesYou === true) {
|
|
61
63
|
if (memberCount > 50) {
|
|
62
|
-
return _this.getBylineComponent(isSelected,
|
|
64
|
+
return _this.getBylineComponent(isSelected, jsx(FormattedMessage, messages.plus50MembersWithYou));
|
|
63
65
|
} else {
|
|
64
|
-
return _this.getBylineComponent(isSelected,
|
|
66
|
+
return _this.getBylineComponent(isSelected, jsx(FormattedMessage, _extends({}, messages.memberCountWithYou, {
|
|
65
67
|
values: {
|
|
66
68
|
count: memberCount
|
|
67
69
|
}
|
|
@@ -69,9 +71,9 @@ export var TeamOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
69
71
|
}
|
|
70
72
|
} else {
|
|
71
73
|
if (memberCount > 50) {
|
|
72
|
-
return _this.getBylineComponent(isSelected,
|
|
74
|
+
return _this.getBylineComponent(isSelected, jsx(FormattedMessage, messages.plus50MembersWithoutYou));
|
|
73
75
|
} else {
|
|
74
|
-
return _this.getBylineComponent(isSelected,
|
|
76
|
+
return _this.getBylineComponent(isSelected, jsx(FormattedMessage, _extends({}, messages.memberCountWithoutYou, {
|
|
75
77
|
values: {
|
|
76
78
|
count: memberCount
|
|
77
79
|
}
|
|
@@ -82,8 +84,8 @@ export var TeamOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
82
84
|
});
|
|
83
85
|
|
|
84
86
|
_defineProperty(_assertThisInitialized(_this), "getBylineComponent", function (isSelected, message) {
|
|
85
|
-
return
|
|
86
|
-
|
|
87
|
+
return jsx("span", {
|
|
88
|
+
css: textWrapper(isSelected ? token('color.text.selected', B400) : token('color.text.subtlest', N200))
|
|
87
89
|
}, message);
|
|
88
90
|
});
|
|
89
91
|
|
|
@@ -91,7 +93,7 @@ export var TeamOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
91
93
|
var _this$props$team3 = _this.props.team,
|
|
92
94
|
avatarUrl = _this$props$team3.avatarUrl,
|
|
93
95
|
name = _this$props$team3.name;
|
|
94
|
-
return
|
|
96
|
+
return jsx(SizeableAvatar, {
|
|
95
97
|
appearance: "big",
|
|
96
98
|
src: avatarUrl,
|
|
97
99
|
name: name
|
|
@@ -110,7 +112,7 @@ export var TeamOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
110
112
|
_createClass(TeamOption, [{
|
|
111
113
|
key: "render",
|
|
112
114
|
value: function render() {
|
|
113
|
-
return
|
|
115
|
+
return jsx(AvatarItemOption, {
|
|
114
116
|
avatar: this.renderAvatar(),
|
|
115
117
|
secondaryText: this.renderByline(),
|
|
116
118
|
primaryText: this.getPrimaryText(),
|
|
@@ -10,10 +10,12 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
10
10
|
|
|
11
11
|
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; } }
|
|
12
12
|
|
|
13
|
+
/** @jsx jsx */
|
|
13
14
|
import { B400, N800, N200 } from '@atlaskit/theme/colors';
|
|
14
15
|
import { token } from '@atlaskit/tokens';
|
|
16
|
+
import { jsx } from '@emotion/core';
|
|
15
17
|
import React from 'react';
|
|
16
|
-
import { AvatarItemOption,
|
|
18
|
+
import { AvatarItemOption, textWrapper } from './AvatarItemOption';
|
|
17
19
|
import { HighlightText } from './HighlightText';
|
|
18
20
|
import { SizeableAvatar } from './SizeableAvatar';
|
|
19
21
|
import { hasValue } from './utils';
|
|
@@ -38,19 +40,19 @@ export var UserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
38
40
|
name = _this$props$user.name,
|
|
39
41
|
publicName = _this$props$user.publicName,
|
|
40
42
|
highlight = _this$props$user.highlight;
|
|
41
|
-
var result = [
|
|
43
|
+
var result = [jsx("span", {
|
|
42
44
|
key: "name",
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
+
css: textWrapper(_this.props.isSelected ? token('color.text.selected', B400) : token('color.text', N800))
|
|
46
|
+
}, jsx(HighlightText, {
|
|
45
47
|
highlights: highlight && highlight.name
|
|
46
48
|
}, name))];
|
|
47
49
|
|
|
48
50
|
if (hasValue(publicName) && name.trim() !== publicName.trim()) {
|
|
49
|
-
result.push(
|
|
51
|
+
result.push(jsx(React.Fragment, {
|
|
50
52
|
key: "publicName"
|
|
51
|
-
}, ' ',
|
|
52
|
-
|
|
53
|
-
}, "(",
|
|
53
|
+
}, ' ', jsx("span", {
|
|
54
|
+
css: textWrapper(_this.props.isSelected ? token('color.text.selected', B400) : token('color.text.subtlest', N200))
|
|
55
|
+
}, "(", jsx(HighlightText, {
|
|
54
56
|
highlights: highlight && highlight.publicName
|
|
55
57
|
}, publicName), ")")));
|
|
56
58
|
}
|
|
@@ -59,8 +61,8 @@ export var UserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
59
61
|
});
|
|
60
62
|
|
|
61
63
|
_defineProperty(_assertThisInitialized(_this), "renderSecondaryText", function () {
|
|
62
|
-
return _this.props.user.byline ?
|
|
63
|
-
|
|
64
|
+
return _this.props.user.byline ? jsx("span", {
|
|
65
|
+
css: textWrapper(_this.props.isSelected ? token('color.text.selected', B400) : token('color.text.subtlest', N200))
|
|
64
66
|
}, _this.props.user.byline) : undefined;
|
|
65
67
|
});
|
|
66
68
|
|
|
@@ -70,7 +72,7 @@ export var UserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
70
72
|
avatarUrl = _this$props$user2.avatarUrl,
|
|
71
73
|
name = _this$props$user2.name,
|
|
72
74
|
status = _this$props.status;
|
|
73
|
-
return
|
|
75
|
+
return jsx(SizeableAvatar, {
|
|
74
76
|
appearance: "big",
|
|
75
77
|
src: avatarUrl,
|
|
76
78
|
presence: status,
|
|
@@ -90,7 +92,7 @@ export var UserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
90
92
|
_createClass(UserOption, [{
|
|
91
93
|
key: "render",
|
|
92
94
|
value: function render() {
|
|
93
|
-
return
|
|
95
|
+
return jsx(AvatarItemOption, {
|
|
94
96
|
avatar: this.renderAvatar(),
|
|
95
97
|
primaryText: this.getPrimaryText(),
|
|
96
98
|
secondaryText: this.renderSecondaryText(),
|
|
@@ -62,7 +62,7 @@ export var messages = defineMessages({
|
|
|
62
62
|
},
|
|
63
63
|
externalUserSourcesHeading: {
|
|
64
64
|
id: 'fabric.elements.user-picker.external.sourced.from',
|
|
65
|
-
defaultMessage: '
|
|
65
|
+
defaultMessage: 'Found in:',
|
|
66
66
|
description: 'From where the external user is coming'
|
|
67
67
|
},
|
|
68
68
|
externalUserSourcesError: {
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { isValidEmail } from './components/emailValidation';
|
|
2
2
|
export { UserPicker as default } from './components/UserPicker';
|
|
3
|
-
export { getUserRecommendations, hydrateDefaultValues, SmartUserPicker, setSmartUserPickerEnv } from './components/smart-user-picker/index';
|
|
4
3
|
export { PopupUserPicker } from './components/PopupUserPicker';
|
|
5
4
|
export { isEmail, isExternalUser, isTeam, isUser } from './components/utils';
|
|
6
5
|
export { // Constants
|
package/dist/esm/version.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AnalyticsEventPayload } from '@atlaskit/analytics-next';
|
|
2
2
|
import { UserPickerProps, UserPickerState } from './types';
|
|
3
|
-
import { SmartUserPickerProps } from './components/smart-user-picker/index';
|
|
4
3
|
export declare type UserPickerSession = {
|
|
5
4
|
id: string;
|
|
6
5
|
start: number;
|
|
@@ -15,9 +14,6 @@ export interface EventCreator {
|
|
|
15
14
|
(props: UserPickerProps, state: UserPickerState, session?: UserPickerSession): AnalyticsEventPayload;
|
|
16
15
|
(props: UserPickerProps, state: UserPickerState, session?: UserPickerSession, ...args: any[]): AnalyticsEventPayload;
|
|
17
16
|
}
|
|
18
|
-
export interface SmartEventCreator {
|
|
19
|
-
(props: SmartUserPickerProps, ...args: any[]): AnalyticsEventPayload;
|
|
20
|
-
}
|
|
21
17
|
export declare const focusEvent: EventCreator;
|
|
22
18
|
export declare const clearEvent: EventCreator;
|
|
23
19
|
export declare const deleteEvent: EventCreator;
|
|
@@ -25,9 +21,3 @@ export declare const cancelEvent: EventCreator;
|
|
|
25
21
|
export declare const selectEvent: EventCreator;
|
|
26
22
|
export declare const searchedEvent: EventCreator;
|
|
27
23
|
export declare const failedEvent: EventCreator;
|
|
28
|
-
export declare const preparedUsersLoadedEvent: SmartEventCreator;
|
|
29
|
-
export declare const mountedWithPrefetchEvent: SmartEventCreator;
|
|
30
|
-
export declare const filterUsersEvent: SmartEventCreator;
|
|
31
|
-
export declare const requestUsersEvent: SmartEventCreator;
|
|
32
|
-
export declare const successfulRequestUsersEvent: SmartEventCreator;
|
|
33
|
-
export declare const failedRequestUsersEvent: SmartEventCreator;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { ReactNode } from 'react';
|
|
2
3
|
import { LozengeProps } from '../types';
|
|
3
|
-
export declare const
|
|
4
|
+
export declare const textWrapper: (color?: string | undefined) => import("@emotion/utils").SerializedStyles;
|
|
4
5
|
export declare type AvatarItemOptionProps = {
|
|
5
6
|
avatar: ReactNode;
|
|
6
7
|
primaryText?: ReactNode;
|
|
@@ -51,7 +51,7 @@ export declare class BaseUserPickerWithoutAnalytics extends React.Component<Base
|
|
|
51
51
|
private getAppearance;
|
|
52
52
|
render(): JSX.Element;
|
|
53
53
|
}
|
|
54
|
-
export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Pick<BaseUserPickerProps, "
|
|
54
|
+
export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Pick<BaseUserPickerProps, "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "placeholder" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "SelectComponent" | "pickerProps">, "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isDisabled" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "placeholder" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "SelectComponent" | "pickerProps"> & Partial<Pick<Pick<BaseUserPickerProps, "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "placeholder" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "SelectComponent" | "pickerProps">, "isClearable" | "isMulti" | "textFieldBackgroundColor" | "subtle" | "noBorder">> & Partial<Pick<{
|
|
55
55
|
isMulti: boolean;
|
|
56
56
|
subtle: boolean;
|
|
57
57
|
noBorder: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { ExternalUserSourcesData } from '../ExternalUserSourcesContainer';
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const sourcesTooltipContainer: import("@emotion/utils").SerializedStyles;
|
|
5
|
+
export declare const sourceWrapper: import("@emotion/utils").SerializedStyles;
|
|
5
6
|
export declare const SourcesTooltipContent: React.FC<ExternalUserSourcesData>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { ExternalUser } from '../../types';
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const imageContainer: import("@emotion/utils").SerializedStyles;
|
|
5
|
+
export declare const emailDomainWrapper: import("@emotion/utils").SerializedStyles;
|
|
5
6
|
export declare type ExternalUserOptionProps = {
|
|
6
7
|
user: ExternalUser;
|
|
7
8
|
status?: string;
|