@atlaskit/user-picker 9.0.0 → 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 +6 -0
- 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/version.json +1 -1
- 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/version.json +1 -1
- 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/version.json +1 -1
- package/dist/types/components/AvatarItemOption.d.ts +3 -2
- 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/SingleValueContainer.d.ts +1 -0
- package/package.json +4 -3
|
@@ -1,24 +1,71 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
+
|
|
7
|
+
/** @jsx jsx */
|
|
8
|
+
import { css, jsx } from '@emotion/core';
|
|
7
9
|
import { B400 } from '@atlaskit/theme/colors';
|
|
8
10
|
import { token } from '@atlaskit/tokens';
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
var outerWrapper = css({
|
|
12
|
+
alignItems: 'center',
|
|
13
|
+
boxSizing: 'border-box',
|
|
14
|
+
display: 'flex',
|
|
15
|
+
lineHeight: 1,
|
|
16
|
+
outline: 'none',
|
|
17
|
+
margin: 0,
|
|
18
|
+
width: '100%',
|
|
19
|
+
cursor: 'pointer'
|
|
20
|
+
});
|
|
21
|
+
var detailsWrapper = css({
|
|
22
|
+
display: 'flex',
|
|
23
|
+
maxWidth: '100%',
|
|
24
|
+
minWidth: 0,
|
|
25
|
+
flex: '1 1 100%',
|
|
26
|
+
lineHeight: 1.4,
|
|
27
|
+
paddingLeft: '8px',
|
|
28
|
+
alignItems: 'center'
|
|
29
|
+
});
|
|
30
|
+
var textSection = css({
|
|
31
|
+
width: 'calc(100% - 32px)',
|
|
32
|
+
flex: 'auto'
|
|
15
33
|
});
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
34
|
+
|
|
35
|
+
var getTextStyle = function getTextStyle(isSecondary) {
|
|
36
|
+
var secondaryCssArgs = isSecondary ? {
|
|
37
|
+
color: token('color.text.selected', B400),
|
|
38
|
+
fontSize: '0.85em'
|
|
39
|
+
} : {};
|
|
40
|
+
return css(_objectSpread(_objectSpread({
|
|
41
|
+
display: 'flex',
|
|
42
|
+
maxWidth: '100%',
|
|
43
|
+
margin: 0,
|
|
44
|
+
color: token('color.text.selected', B400)
|
|
45
|
+
}, {
|
|
46
|
+
secondaryCssArgs: secondaryCssArgs
|
|
47
|
+
}), {}, {
|
|
48
|
+
whiteSpace: 'nowrap',
|
|
49
|
+
'> span': {
|
|
50
|
+
maxWidth: 'inherit'
|
|
51
|
+
}
|
|
52
|
+
}));
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export var ExternalAvatarItemOption = function ExternalAvatarItemOption(_ref) {
|
|
56
|
+
var avatar = _ref.avatar,
|
|
57
|
+
primaryText = _ref.primaryText,
|
|
58
|
+
secondaryText = _ref.secondaryText,
|
|
59
|
+
sourcesInfoTooltip = _ref.sourcesInfoTooltip;
|
|
60
|
+
return jsx("div", {
|
|
61
|
+
css: outerWrapper
|
|
62
|
+
}, avatar, jsx("div", {
|
|
63
|
+
css: detailsWrapper
|
|
64
|
+
}, jsx("div", {
|
|
65
|
+
css: textSection
|
|
66
|
+
}, jsx("div", null, jsx("div", {
|
|
67
|
+
css: getTextStyle()
|
|
68
|
+
}, primaryText)), secondaryText && jsx("div", null, jsx("div", {
|
|
69
|
+
css: getTextStyle(true)
|
|
70
|
+
}, secondaryText))), jsx("div", null, sourcesInfoTooltip)));
|
|
24
71
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
import styled from 'styled-components';
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { useCallback, useState } from 'react';
|
|
5
|
+
import { css, jsx } from '@emotion/core';
|
|
8
6
|
import EditorPanelIcon from '@atlaskit/icon/glyph/editor/panel';
|
|
9
7
|
import { N50, N200 } from '@atlaskit/theme/colors';
|
|
10
8
|
import { token } from '@atlaskit/tokens';
|
|
11
|
-
var
|
|
9
|
+
var wrapper = css({
|
|
10
|
+
display: 'flex'
|
|
11
|
+
});
|
|
12
12
|
export default (function () {
|
|
13
13
|
var _useState = useState(false),
|
|
14
14
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -21,10 +21,11 @@ export default (function () {
|
|
|
21
21
|
var onMouseLeave = useCallback(function () {
|
|
22
22
|
return setHoverState(false);
|
|
23
23
|
}, [setHoverState]);
|
|
24
|
-
return
|
|
24
|
+
return jsx("div", {
|
|
25
|
+
css: wrapper,
|
|
25
26
|
onMouseEnter: onMouseEnter,
|
|
26
27
|
onMouseLeave: onMouseLeave
|
|
27
|
-
},
|
|
28
|
+
}, jsx(EditorPanelIcon, {
|
|
28
29
|
testId: "source-icon",
|
|
29
30
|
label: "",
|
|
30
31
|
size: "large",
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _templateObject, _templateObject2;
|
|
4
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
5
2
|
import React from 'react';
|
|
6
3
|
import { FormattedMessage } from 'react-intl-next';
|
|
7
|
-
import
|
|
4
|
+
import { css, jsx } from '@emotion/core';
|
|
8
5
|
import { AtlassianIcon, ConfluenceIcon, JiraIcon } from '@atlaskit/logo';
|
|
9
6
|
import Spinner from '@atlaskit/spinner/spinner';
|
|
10
7
|
import { SlackIcon } from '../assets/slack';
|
|
@@ -12,42 +9,49 @@ import { GoogleIcon } from '../assets/google';
|
|
|
12
9
|
import { MicrosoftIcon } from '../assets/microsoft';
|
|
13
10
|
import { GitHubIcon } from '../assets/github';
|
|
14
11
|
import { messages } from '../i18n';
|
|
15
|
-
import {
|
|
16
|
-
export var
|
|
17
|
-
|
|
12
|
+
import { imageContainer } from './main';
|
|
13
|
+
export var sourcesTooltipContainer = css({
|
|
14
|
+
paddingBottom: '4px',
|
|
15
|
+
paddingRight: '4px'
|
|
16
|
+
});
|
|
17
|
+
export var sourceWrapper = css({
|
|
18
|
+
paddingTop: '4px',
|
|
19
|
+
display: 'flex',
|
|
20
|
+
alignItems: 'center'
|
|
21
|
+
});
|
|
18
22
|
var SUPPORTED_SOURCES = [{
|
|
19
23
|
sourceType: 'jira',
|
|
20
|
-
icon:
|
|
24
|
+
icon: jsx(JiraIcon, {
|
|
21
25
|
size: 'xsmall'
|
|
22
26
|
}),
|
|
23
27
|
label: messages.jiraSource
|
|
24
28
|
}, {
|
|
25
29
|
sourceType: 'confluence',
|
|
26
|
-
icon:
|
|
30
|
+
icon: jsx(ConfluenceIcon, {
|
|
27
31
|
size: 'xsmall'
|
|
28
32
|
}),
|
|
29
33
|
label: messages.confluenceSource
|
|
30
34
|
}, {
|
|
31
35
|
sourceType: 'other-atlassian',
|
|
32
|
-
icon:
|
|
36
|
+
icon: jsx(AtlassianIcon, {
|
|
33
37
|
size: 'xsmall'
|
|
34
38
|
}),
|
|
35
39
|
label: messages.otherAtlassianSource
|
|
36
40
|
}, {
|
|
37
41
|
sourceType: 'slack',
|
|
38
|
-
icon:
|
|
42
|
+
icon: jsx(SlackIcon, null),
|
|
39
43
|
label: messages.slackProvider
|
|
40
44
|
}, {
|
|
41
45
|
sourceType: 'google',
|
|
42
|
-
icon:
|
|
46
|
+
icon: jsx(GoogleIcon, null),
|
|
43
47
|
label: messages.googleProvider
|
|
44
48
|
}, {
|
|
45
49
|
sourceType: 'microsoft',
|
|
46
|
-
icon:
|
|
50
|
+
icon: jsx(MicrosoftIcon, null),
|
|
47
51
|
label: messages.microsoftProvider
|
|
48
52
|
}, {
|
|
49
53
|
sourceType: 'github',
|
|
50
|
-
icon:
|
|
54
|
+
icon: jsx(GitHubIcon, null),
|
|
51
55
|
label: messages.gitHubProvider
|
|
52
56
|
}];
|
|
53
57
|
export var SourcesTooltipContent = function SourcesTooltipContent(_ref) {
|
|
@@ -58,15 +62,20 @@ export var SourcesTooltipContent = function SourcesTooltipContent(_ref) {
|
|
|
58
62
|
return sources.includes(supportedSource.sourceType);
|
|
59
63
|
});
|
|
60
64
|
}, [sources]);
|
|
61
|
-
return
|
|
65
|
+
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", {
|
|
66
|
+
css: sourcesTooltipContainer
|
|
67
|
+
}, sourcesLoading && jsx(Spinner, {
|
|
62
68
|
size: "small",
|
|
63
69
|
appearance: "invert"
|
|
64
70
|
}), !sourcesLoading && sourcesToRender.map(function (_ref2) {
|
|
65
71
|
var sourceType = _ref2.sourceType,
|
|
66
72
|
icon = _ref2.icon,
|
|
67
73
|
label = _ref2.label;
|
|
68
|
-
return
|
|
74
|
+
return jsx("div", {
|
|
75
|
+
css: sourceWrapper,
|
|
69
76
|
key: sourceType
|
|
70
|
-
},
|
|
77
|
+
}, jsx("span", {
|
|
78
|
+
css: imageContainer
|
|
79
|
+
}, icon), jsx("span", null, jsx(FormattedMessage, label)));
|
|
71
80
|
}))));
|
|
72
81
|
};
|
|
@@ -6,27 +6,34 @@ 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
|
-
|
|
11
|
-
var _templateObject, _templateObject2;
|
|
12
9
|
|
|
13
10
|
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); }; }
|
|
14
11
|
|
|
15
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; } }
|
|
16
13
|
|
|
14
|
+
/** @jsx jsx */
|
|
17
15
|
import React from 'react';
|
|
18
|
-
import
|
|
16
|
+
import { css, jsx } from '@emotion/core';
|
|
19
17
|
import { B400, N200, N800 } from '@atlaskit/theme/colors';
|
|
20
18
|
import { token } from '@atlaskit/tokens';
|
|
21
19
|
import Tooltip from '@atlaskit/tooltip';
|
|
22
|
-
import {
|
|
20
|
+
import { textWrapper } from '../AvatarItemOption';
|
|
23
21
|
import { SizeableAvatar } from '../SizeableAvatar';
|
|
24
22
|
import { ExternalUserSourcesContainer } from '../ExternalUserSourcesContainer';
|
|
25
23
|
import InfoIcon from './InfoIcon';
|
|
26
24
|
import { ExternalAvatarItemOption } from './ExternalAvatarItemOption';
|
|
27
25
|
import { SourcesTooltipContent } from './SourcesTooltipContent';
|
|
28
|
-
export var
|
|
29
|
-
|
|
26
|
+
export var imageContainer = css({
|
|
27
|
+
height: '16px',
|
|
28
|
+
width: '16px',
|
|
29
|
+
paddingRight: '4px',
|
|
30
|
+
display: 'flex',
|
|
31
|
+
alignItems: 'center',
|
|
32
|
+
justifyContent: 'center'
|
|
33
|
+
});
|
|
34
|
+
export var emailDomainWrapper = css({
|
|
35
|
+
fontWeight: 'bold'
|
|
36
|
+
});
|
|
30
37
|
export var ExternalUserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
31
38
|
_inherits(ExternalUserOption, _React$PureComponent);
|
|
32
39
|
|
|
@@ -45,9 +52,9 @@ export var ExternalUserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
45
52
|
|
|
46
53
|
_defineProperty(_assertThisInitialized(_this), "getPrimaryText", function () {
|
|
47
54
|
var name = _this.props.user.name;
|
|
48
|
-
return
|
|
55
|
+
return jsx("span", {
|
|
49
56
|
key: "name",
|
|
50
|
-
|
|
57
|
+
css: textWrapper(_this.props.isSelected ? token('color.text.selected', B400) : token('color.text', N800))
|
|
51
58
|
}, name);
|
|
52
59
|
});
|
|
53
60
|
|
|
@@ -64,9 +71,11 @@ export var ExternalUserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
64
71
|
emailDomain = _email$split2[1];
|
|
65
72
|
|
|
66
73
|
var emailDomainWithAt = "@".concat(emailDomain);
|
|
67
|
-
return
|
|
68
|
-
|
|
69
|
-
}, emailUser,
|
|
74
|
+
return jsx("span", {
|
|
75
|
+
css: textWrapper(_this.props.isSelected ? token('color.text.selected', B400) : token('color.text.subtlest', N200))
|
|
76
|
+
}, emailUser, jsx("span", {
|
|
77
|
+
css: emailDomainWrapper
|
|
78
|
+
}, emailDomainWithAt));
|
|
70
79
|
});
|
|
71
80
|
|
|
72
81
|
_defineProperty(_assertThisInitialized(_this), "renderAvatar", function () {
|
|
@@ -75,7 +84,7 @@ export var ExternalUserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
75
84
|
avatarUrl = _this$props$user.avatarUrl,
|
|
76
85
|
name = _this$props$user.name,
|
|
77
86
|
status = _this$props.status;
|
|
78
|
-
return
|
|
87
|
+
return jsx(SizeableAvatar, {
|
|
79
88
|
appearance: "big",
|
|
80
89
|
src: avatarUrl,
|
|
81
90
|
presence: status,
|
|
@@ -84,10 +93,10 @@ export var ExternalUserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
84
93
|
});
|
|
85
94
|
|
|
86
95
|
_defineProperty(_assertThisInitialized(_this), "getSourcesInfoTooltip", function () {
|
|
87
|
-
return _this.props.user.isExternal ?
|
|
96
|
+
return _this.props.user.isExternal ? jsx(Tooltip, {
|
|
88
97
|
content: _this.formattedTooltipContent(),
|
|
89
98
|
position: 'right-start'
|
|
90
|
-
},
|
|
99
|
+
}, jsx(InfoIcon, null)) : undefined;
|
|
91
100
|
});
|
|
92
101
|
|
|
93
102
|
return _this;
|
|
@@ -96,7 +105,7 @@ export var ExternalUserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
96
105
|
_createClass(ExternalUserOption, [{
|
|
97
106
|
key: "render",
|
|
98
107
|
value: function render() {
|
|
99
|
-
return
|
|
108
|
+
return jsx(ExternalAvatarItemOption, {
|
|
100
109
|
avatar: this.renderAvatar(),
|
|
101
110
|
primaryText: this.getPrimaryText(),
|
|
102
111
|
secondaryText: this.renderSecondaryText(),
|
|
@@ -110,12 +119,12 @@ export var ExternalUserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
110
119
|
id = _this$props$user2.id,
|
|
111
120
|
requiresSourceHydration = _this$props$user2.requiresSourceHydration,
|
|
112
121
|
sources = _this$props$user2.sources;
|
|
113
|
-
return
|
|
122
|
+
return jsx(ExternalUserSourcesContainer, {
|
|
114
123
|
accountId: id,
|
|
115
124
|
shouldFetchSources: Boolean(requiresSourceHydration),
|
|
116
125
|
initialSources: sources
|
|
117
126
|
}, function (sourceData) {
|
|
118
|
-
return
|
|
127
|
+
return jsx(SourcesTooltipContent, sourceData);
|
|
119
128
|
});
|
|
120
129
|
}
|
|
121
130
|
}]);
|
|
@@ -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
|
};
|