@atlaskit/user-picker 8.8.6 → 9.0.2
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 +7 -81
- 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 +61 -35
- 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/index.js +0 -26
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics.js +3 -61
- 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 +56 -29
- 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/index.js +0 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics.js +5 -65
- 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 +65 -32
- 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/index.js +0 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics.d.ts +1 -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/index.d.ts +1 -1
- package/dist/types/components/ExternalUserOption/main.d.ts +6 -11
- 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 +5 -4
- 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
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { FormattedMessage } from 'react-intl-next';
|
|
3
|
-
import
|
|
4
|
+
import { css, jsx } from '@emotion/core';
|
|
4
5
|
import { AtlassianIcon, ConfluenceIcon, JiraIcon } from '@atlaskit/logo';
|
|
5
6
|
import Spinner from '@atlaskit/spinner/spinner';
|
|
6
7
|
import { SlackIcon } from '../assets/slack';
|
|
@@ -8,49 +9,49 @@ import { GoogleIcon } from '../assets/google';
|
|
|
8
9
|
import { MicrosoftIcon } from '../assets/microsoft';
|
|
9
10
|
import { GitHubIcon } from '../assets/github';
|
|
10
11
|
import { messages } from '../i18n';
|
|
11
|
-
import {
|
|
12
|
-
export const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export const
|
|
17
|
-
|
|
18
|
-
display: flex
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
import { imageContainer } from './main';
|
|
13
|
+
export const sourcesTooltipContainer = css({
|
|
14
|
+
paddingBottom: '4px',
|
|
15
|
+
paddingRight: '4px'
|
|
16
|
+
});
|
|
17
|
+
export const sourceWrapper = css({
|
|
18
|
+
paddingTop: '4px',
|
|
19
|
+
display: 'flex',
|
|
20
|
+
alignItems: 'center'
|
|
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,14 +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", {
|
|
63
|
+
css: sourcesTooltipContainer
|
|
64
|
+
}, sourcesLoading && jsx(Spinner, {
|
|
62
65
|
size: "small",
|
|
63
66
|
appearance: "invert"
|
|
64
67
|
}), !sourcesLoading && sourcesToRender.map(({
|
|
65
68
|
sourceType,
|
|
66
69
|
icon,
|
|
67
70
|
label
|
|
68
|
-
}) =>
|
|
71
|
+
}) => jsx("div", {
|
|
72
|
+
css: sourceWrapper,
|
|
69
73
|
key: sourceType
|
|
70
|
-
},
|
|
74
|
+
}, jsx("span", {
|
|
75
|
+
css: imageContainer
|
|
76
|
+
}, icon), jsx("span", null, jsx(FormattedMessage, label)))))));
|
|
71
77
|
};
|
|
@@ -1,29 +1,34 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
2
4
|
import React from 'react';
|
|
3
|
-
import
|
|
5
|
+
import { css, jsx } from '@emotion/core';
|
|
4
6
|
import { B400, N200, N800 } from '@atlaskit/theme/colors';
|
|
5
7
|
import { token } from '@atlaskit/tokens';
|
|
6
8
|
import Tooltip from '@atlaskit/tooltip';
|
|
7
|
-
import {
|
|
9
|
+
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
10
|
+
import { createAndFireEventInElementsChannel, userInfoEvent } from '../../analytics';
|
|
11
|
+
import { textWrapper } from '../AvatarItemOption';
|
|
8
12
|
import { SizeableAvatar } from '../SizeableAvatar';
|
|
9
13
|
import { ExternalUserSourcesContainer } from '../ExternalUserSourcesContainer';
|
|
10
14
|
import InfoIcon from './InfoIcon';
|
|
11
15
|
import { ExternalAvatarItemOption } from './ExternalAvatarItemOption';
|
|
12
16
|
import { SourcesTooltipContent } from './SourcesTooltipContent';
|
|
13
|
-
export const
|
|
14
|
-
height: 16px
|
|
15
|
-
width: 16px
|
|
16
|
-
|
|
17
|
-
display: flex
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
export const imageContainer = css({
|
|
18
|
+
height: '16px',
|
|
19
|
+
width: '16px',
|
|
20
|
+
paddingRight: '4px',
|
|
21
|
+
display: 'flex',
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
justifyContent: 'center'
|
|
24
|
+
});
|
|
25
|
+
export const emailDomainWrapper = css({
|
|
26
|
+
fontWeight: 'bold'
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
class ExternalUserOptionImpl extends React.PureComponent {
|
|
30
|
+
constructor(..._args) {
|
|
31
|
+
super(..._args);
|
|
27
32
|
|
|
28
33
|
_defineProperty(this, "getPrimaryText", () => {
|
|
29
34
|
const {
|
|
@@ -31,9 +36,9 @@ export class ExternalUserOption extends React.PureComponent {
|
|
|
31
36
|
name
|
|
32
37
|
}
|
|
33
38
|
} = this.props;
|
|
34
|
-
return
|
|
39
|
+
return jsx("span", {
|
|
35
40
|
key: "name",
|
|
36
|
-
|
|
41
|
+
css: textWrapper(this.props.isSelected ? token('color.text.selected', B400) : token('color.text', N800))
|
|
37
42
|
}, name);
|
|
38
43
|
});
|
|
39
44
|
|
|
@@ -48,9 +53,11 @@ export class ExternalUserOption extends React.PureComponent {
|
|
|
48
53
|
|
|
49
54
|
const [emailUser, emailDomain] = email.split('@');
|
|
50
55
|
const emailDomainWithAt = `@${emailDomain}`;
|
|
51
|
-
return
|
|
52
|
-
|
|
53
|
-
}, emailUser,
|
|
56
|
+
return jsx("span", {
|
|
57
|
+
css: textWrapper(this.props.isSelected ? token('color.text.selected', B400) : token('color.text.subtlest', N200))
|
|
58
|
+
}, emailUser, jsx("span", {
|
|
59
|
+
css: emailDomainWrapper
|
|
60
|
+
}, emailDomainWithAt));
|
|
54
61
|
});
|
|
55
62
|
|
|
56
63
|
_defineProperty(this, "renderAvatar", () => {
|
|
@@ -61,7 +68,7 @@ export class ExternalUserOption extends React.PureComponent {
|
|
|
61
68
|
},
|
|
62
69
|
status
|
|
63
70
|
} = this.props;
|
|
64
|
-
return
|
|
71
|
+
return jsx(SizeableAvatar, {
|
|
65
72
|
appearance: "big",
|
|
66
73
|
src: avatarUrl,
|
|
67
74
|
presence: status,
|
|
@@ -69,14 +76,32 @@ export class ExternalUserOption extends React.PureComponent {
|
|
|
69
76
|
});
|
|
70
77
|
});
|
|
71
78
|
|
|
72
|
-
_defineProperty(this, "
|
|
79
|
+
_defineProperty(this, "fireEvent", (eventCreator, ...args) => {
|
|
80
|
+
const {
|
|
81
|
+
createAnalyticsEvent
|
|
82
|
+
} = this.props;
|
|
83
|
+
|
|
84
|
+
if (createAnalyticsEvent) {
|
|
85
|
+
createAndFireEventInElementsChannel(eventCreator(...args))(createAnalyticsEvent);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
_defineProperty(this, "onShow", () => {
|
|
90
|
+
const {
|
|
91
|
+
user
|
|
92
|
+
} = this.props;
|
|
93
|
+
this.fireEvent(userInfoEvent, user.sources, user.id);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
_defineProperty(this, "getSourcesInfoTooltip", () => this.props.user.isExternal ? jsx(Tooltip, {
|
|
73
97
|
content: this.formattedTooltipContent(),
|
|
74
|
-
position: 'right-start'
|
|
75
|
-
|
|
98
|
+
position: 'right-start',
|
|
99
|
+
onShow: this.onShow
|
|
100
|
+
}, jsx(InfoIcon, null)) : undefined);
|
|
76
101
|
}
|
|
77
102
|
|
|
78
103
|
render() {
|
|
79
|
-
return
|
|
104
|
+
return jsx(ExternalAvatarItemOption, {
|
|
80
105
|
avatar: this.renderAvatar(),
|
|
81
106
|
primaryText: this.getPrimaryText(),
|
|
82
107
|
secondaryText: this.renderSecondaryText(),
|
|
@@ -92,11 +117,13 @@ export class ExternalUserOption extends React.PureComponent {
|
|
|
92
117
|
sources
|
|
93
118
|
}
|
|
94
119
|
} = this.props;
|
|
95
|
-
return
|
|
120
|
+
return jsx(ExternalUserSourcesContainer, {
|
|
96
121
|
accountId: id,
|
|
97
122
|
shouldFetchSources: Boolean(requiresSourceHydration),
|
|
98
123
|
initialSources: sources
|
|
99
|
-
}, sourceData =>
|
|
124
|
+
}, sourceData => jsx(SourcesTooltipContent, sourceData));
|
|
100
125
|
}
|
|
101
126
|
|
|
102
|
-
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export const ExternalUserOption = withAnalyticsEvents()(ExternalUserOptionImpl);
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
2
4
|
import React from 'react';
|
|
3
5
|
import { FormattedMessage } from 'react-intl-next';
|
|
4
|
-
import
|
|
6
|
+
import { css, jsx } from '@emotion/core';
|
|
5
7
|
import { N20, B400, N800, N200 } from '@atlaskit/theme/colors';
|
|
6
8
|
import { token } from '@atlaskit/tokens';
|
|
7
9
|
import PeopleIcon from '@atlaskit/icon/glyph/people';
|
|
8
|
-
import { AvatarItemOption,
|
|
10
|
+
import { AvatarItemOption, textWrapper } from '../AvatarItemOption';
|
|
9
11
|
import { messages } from '.././i18n';
|
|
10
|
-
import { HighlightText } from '
|
|
11
|
-
export const
|
|
12
|
-
padding: 2px
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
padding: 4px;
|
|
12
|
+
import { HighlightText } from '../HighlightText';
|
|
13
|
+
export const groupOptionIconWrapper = css({
|
|
14
|
+
padding: '2px',
|
|
15
|
+
'> span': {
|
|
16
|
+
backgroundColor: token('color.background.neutral', N20),
|
|
17
|
+
borderRadius: '50%',
|
|
18
|
+
padding: '4px'
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
+
});
|
|
20
21
|
export class GroupOption extends React.PureComponent {
|
|
21
22
|
constructor(...args) {
|
|
22
23
|
super(...args);
|
|
@@ -29,15 +30,17 @@ export class GroupOption extends React.PureComponent {
|
|
|
29
30
|
highlight
|
|
30
31
|
}
|
|
31
32
|
} = this.props;
|
|
32
|
-
return [
|
|
33
|
+
return [jsx("span", {
|
|
33
34
|
key: "name",
|
|
34
|
-
|
|
35
|
-
},
|
|
35
|
+
css: textWrapper(isSelected ? token('color.text.selected', B400) : token('color.text', N800))
|
|
36
|
+
}, jsx(HighlightText, {
|
|
36
37
|
highlights: highlight && highlight.name
|
|
37
38
|
}, name))];
|
|
38
39
|
});
|
|
39
40
|
|
|
40
|
-
_defineProperty(this, "renderAvatar", () =>
|
|
41
|
+
_defineProperty(this, "renderAvatar", () => jsx("span", {
|
|
42
|
+
css: groupOptionIconWrapper
|
|
43
|
+
}, jsx(PeopleIcon, {
|
|
41
44
|
label: "group-icon",
|
|
42
45
|
size: "medium"
|
|
43
46
|
})));
|
|
@@ -46,9 +49,9 @@ export class GroupOption extends React.PureComponent {
|
|
|
46
49
|
const {
|
|
47
50
|
isSelected
|
|
48
51
|
} = this.props;
|
|
49
|
-
return
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
+
return jsx("span", {
|
|
53
|
+
css: textWrapper(isSelected ? token('color.text.selected', B400) : token('color.text.subtlest', N200))
|
|
54
|
+
}, jsx(FormattedMessage, messages.groupByline));
|
|
52
55
|
});
|
|
53
56
|
|
|
54
57
|
_defineProperty(this, "getLozengeProps", () => typeof this.props.group.lozenge === 'string' ? {
|
|
@@ -57,7 +60,7 @@ export class GroupOption extends React.PureComponent {
|
|
|
57
60
|
}
|
|
58
61
|
|
|
59
62
|
render() {
|
|
60
|
-
return
|
|
63
|
+
return jsx(AvatarItemOption, {
|
|
61
64
|
avatar: this.renderAvatar(),
|
|
62
65
|
secondaryText: this.renderByline(),
|
|
63
66
|
primaryText: this.getPrimaryText(),
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
|
|
4
|
+
/** @jsx jsx */
|
|
3
5
|
import React from 'react';
|
|
4
6
|
import { FormattedMessage } from 'react-intl-next';
|
|
5
7
|
import { components } from '@atlaskit/select';
|
|
6
|
-
import
|
|
8
|
+
import { css, jsx } from '@emotion/core';
|
|
7
9
|
import { AddOptionAvatar } from './AddOptionAvatar';
|
|
8
10
|
import { SizeableAvatar } from './SizeableAvatar';
|
|
9
11
|
import { messages } from './i18n';
|
|
@@ -26,12 +28,12 @@ export const scrollToValue = (valueContainer, control) => {
|
|
|
26
28
|
valueContainer.scrollIntoView(false);
|
|
27
29
|
}
|
|
28
30
|
};
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
const groupTagContainer = css({
|
|
32
|
+
paddingLeft: '2px'
|
|
33
|
+
});
|
|
34
|
+
const nameWrapper = css({
|
|
35
|
+
paddingLeft: '5px'
|
|
36
|
+
});
|
|
35
37
|
export class MultiValue extends React.Component {
|
|
36
38
|
constructor(props) {
|
|
37
39
|
super(props);
|
|
@@ -46,23 +48,25 @@ export class MultiValue extends React.Component {
|
|
|
46
48
|
} = this.props;
|
|
47
49
|
|
|
48
50
|
if (isEmail(data)) {
|
|
49
|
-
return selectProps.emailLabel ?
|
|
51
|
+
return selectProps.emailLabel ? jsx(AddOptionAvatar, {
|
|
50
52
|
isLozenge: true,
|
|
51
53
|
label: selectProps.emailLabel
|
|
52
|
-
}) :
|
|
54
|
+
}) : jsx(FormattedMessage, messages.addEmail, label => jsx(AddOptionAvatar, {
|
|
53
55
|
isLozenge: true,
|
|
54
56
|
label: label
|
|
55
57
|
}));
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
if (isGroup(data)) {
|
|
59
|
-
return
|
|
61
|
+
return jsx("div", {
|
|
62
|
+
css: groupTagContainer
|
|
63
|
+
}, jsx(PeopleIcon, {
|
|
60
64
|
label: "group-icon",
|
|
61
65
|
size: "small"
|
|
62
66
|
}));
|
|
63
67
|
}
|
|
64
68
|
|
|
65
|
-
return
|
|
69
|
+
return jsx(SizeableAvatar, {
|
|
66
70
|
appearance: "multi",
|
|
67
71
|
src: getAvatarUrl(data),
|
|
68
72
|
name: label
|
|
@@ -110,12 +114,14 @@ export class MultiValue extends React.Component {
|
|
|
110
114
|
innerProps,
|
|
111
115
|
...rest
|
|
112
116
|
} = this.props;
|
|
113
|
-
return
|
|
117
|
+
return jsx(components.MultiValue, _extends({}, rest, {
|
|
114
118
|
innerProps: {
|
|
115
119
|
ref: this.containerRef
|
|
116
120
|
},
|
|
117
121
|
cropWithEllipsis: false
|
|
118
|
-
}), this.getElemBefore(), " ",
|
|
122
|
+
}), this.getElemBefore(), " ", jsx("div", {
|
|
123
|
+
css: nameWrapper
|
|
124
|
+
}, children));
|
|
119
125
|
}
|
|
120
126
|
|
|
121
127
|
}
|
|
@@ -1,42 +1,41 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { themed } from '@atlaskit/theme/components';
|
|
3
4
|
import { token } from '@atlaskit/tokens';
|
|
4
5
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
5
6
|
import { components } from '@atlaskit/select';
|
|
6
|
-
import
|
|
7
|
+
import { css, jsx } from '@emotion/core';
|
|
7
8
|
import { N200, DN90 } from '@atlaskit/theme/colors';
|
|
8
9
|
const spacing = gridSize();
|
|
9
10
|
const fontSize = 12;
|
|
10
11
|
const innerHeight = spacing * 2; // 16px
|
|
11
12
|
|
|
12
13
|
const lineHeight = innerHeight / fontSize;
|
|
13
|
-
const
|
|
14
|
-
display: flex
|
|
15
|
-
|
|
16
|
-
padding: 0px ${spacing}px ${spacing}px
|
|
17
|
-
|
|
14
|
+
const controlWrapper = css({
|
|
15
|
+
display: 'flex',
|
|
16
|
+
flexDirection: 'column',
|
|
17
|
+
padding: `0px ${spacing}px ${spacing}px`
|
|
18
|
+
});
|
|
18
19
|
const getColor = themed({
|
|
19
20
|
light: token('color.text.subtlest', N200),
|
|
20
21
|
dark: token('color.text.subtlest', DN90)
|
|
21
22
|
});
|
|
22
23
|
|
|
23
|
-
const
|
|
24
|
+
const getLabelStyle = () => {
|
|
24
25
|
const right = 0;
|
|
25
26
|
const bottom = spacing / 2;
|
|
26
27
|
const left = 0;
|
|
27
28
|
const top = spacing * 2.5;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
const color = getColor();
|
|
30
|
+
return css({
|
|
31
|
+
color,
|
|
32
|
+
fontSize: `${fontSize}px`,
|
|
33
|
+
fontWeight: 600,
|
|
34
|
+
lineHeight: `${lineHeight}`,
|
|
35
|
+
padding: `${top}px ${right}px ${bottom}px ${left}px`
|
|
36
|
+
});
|
|
31
37
|
};
|
|
32
38
|
|
|
33
|
-
const Label = styled.div`
|
|
34
|
-
color: ${props => getColor(props)};
|
|
35
|
-
font-size: ${fontSize}px;
|
|
36
|
-
font-weight: 600;
|
|
37
|
-
line-height: ${lineHeight};
|
|
38
|
-
${getPadding}
|
|
39
|
-
`;
|
|
40
39
|
export class PopupControl extends React.PureComponent {
|
|
41
40
|
render() {
|
|
42
41
|
const {
|
|
@@ -44,7 +43,11 @@ export class PopupControl extends React.PureComponent {
|
|
|
44
43
|
popupTitle
|
|
45
44
|
}
|
|
46
45
|
} = this.props;
|
|
47
|
-
return
|
|
46
|
+
return jsx("div", {
|
|
47
|
+
css: controlWrapper
|
|
48
|
+
}, jsx("div", {
|
|
49
|
+
css: getLabelStyle()
|
|
50
|
+
}, popupTitle), jsx(components.Control, this.props));
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
}
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
1
4
|
import { AvatarItem } from '@atlaskit/avatar';
|
|
2
|
-
import
|
|
3
|
-
import styled from 'styled-components';
|
|
5
|
+
import { css, jsx } from '@emotion/core';
|
|
4
6
|
import { SizeableAvatar } from './SizeableAvatar';
|
|
5
7
|
import { getAvatarUrl } from './utils';
|
|
6
|
-
const
|
|
7
|
-
border: none !important
|
|
8
|
-
padding: 0 !important
|
|
9
|
-
width: auto
|
|
10
|
-
overflow: hidden
|
|
11
|
-
/* IE 11 needs this prop explicitly to flex items */
|
|
12
|
-
flex: 1 1 auto;
|
|
13
|
-
min-width: 100px;
|
|
8
|
+
const avatarItemComponent = css({
|
|
9
|
+
border: 'none !important',
|
|
10
|
+
padding: '0 !important',
|
|
11
|
+
width: 'auto',
|
|
12
|
+
overflow: 'hidden',
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
/* IE 11 needs this prop explicitly to flex items */
|
|
15
|
+
flex: '1 1 auto',
|
|
16
|
+
minWidth: '100px',
|
|
17
|
+
'& > span': {
|
|
18
|
+
boxSizing: 'border-box'
|
|
19
|
+
},
|
|
20
|
+
'&:hover': {
|
|
21
|
+
width: 'auto',
|
|
22
|
+
padding: 0,
|
|
23
|
+
border: 'none'
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
+
});
|
|
25
26
|
export const SingleValue = props => {
|
|
26
27
|
const {
|
|
27
28
|
data: {
|
|
@@ -33,9 +34,9 @@ export const SingleValue = props => {
|
|
|
33
34
|
isFocused
|
|
34
35
|
}
|
|
35
36
|
} = props;
|
|
36
|
-
return !isFocused ?
|
|
37
|
+
return !isFocused ? jsx(AvatarItem, {
|
|
37
38
|
backgroundColor: "transparent",
|
|
38
|
-
avatar:
|
|
39
|
+
avatar: jsx(SizeableAvatar, {
|
|
39
40
|
src: getAvatarUrl(data),
|
|
40
41
|
appearance: appearance,
|
|
41
42
|
name: label
|
|
@@ -44,5 +45,7 @@ export const SingleValue = props => {
|
|
|
44
45
|
}, ({
|
|
45
46
|
ref,
|
|
46
47
|
...props
|
|
47
|
-
}) =>
|
|
48
|
+
}) => jsx("div", _extends({
|
|
49
|
+
css: avatarItemComponent
|
|
50
|
+
}, props))) : null;
|
|
48
51
|
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
2
4
|
import React from 'react';
|
|
3
|
-
import
|
|
5
|
+
import { css, jsx } from '@emotion/core';
|
|
4
6
|
import { components } from '@atlaskit/select';
|
|
5
7
|
import { SizeableAvatar } from './SizeableAvatar';
|
|
6
8
|
import { BORDER_PADDING } from './styles';
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
const placeholderIconContainer = css({
|
|
10
|
+
paddingLeft: `${BORDER_PADDING}px`,
|
|
11
|
+
lineHeight: 0
|
|
12
|
+
});
|
|
11
13
|
|
|
12
14
|
const showUserAvatar = (inputValue, value) => value && value.data && inputValue === value.label;
|
|
13
15
|
|
|
@@ -27,7 +29,7 @@ export class SingleValueContainer extends React.Component {
|
|
|
27
29
|
} = this.props;
|
|
28
30
|
|
|
29
31
|
if (isFocused || !hasValue) {
|
|
30
|
-
return
|
|
32
|
+
return jsx(SizeableAvatar, {
|
|
31
33
|
appearance: appearance,
|
|
32
34
|
src: showUserAvatar(inputValue, value) ? value.data.avatarUrl : undefined
|
|
33
35
|
});
|
|
@@ -42,7 +44,9 @@ export class SingleValueContainer extends React.Component {
|
|
|
42
44
|
children,
|
|
43
45
|
...valueContainerProps
|
|
44
46
|
} = this.props;
|
|
45
|
-
return
|
|
47
|
+
return jsx(components.ValueContainer, valueContainerProps, jsx("div", {
|
|
48
|
+
css: placeholderIconContainer
|
|
49
|
+
}, this.renderAvatar()), children);
|
|
46
50
|
}
|
|
47
51
|
|
|
48
52
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
|
|
4
|
+
/** @jsx jsx */
|
|
3
5
|
import { B400, N800, N200 } from '@atlaskit/theme/colors';
|
|
4
6
|
import { token } from '@atlaskit/tokens';
|
|
7
|
+
import { jsx } from '@emotion/core';
|
|
5
8
|
import React from 'react';
|
|
6
9
|
import { FormattedMessage } from 'react-intl-next';
|
|
7
|
-
import { AvatarItemOption,
|
|
10
|
+
import { AvatarItemOption, textWrapper } from '.././AvatarItemOption';
|
|
8
11
|
import { HighlightText } from '.././HighlightText';
|
|
9
12
|
import { messages } from '.././i18n';
|
|
10
13
|
import { SizeableAvatar } from '.././SizeableAvatar';
|
|
@@ -19,10 +22,10 @@ export class TeamOption extends React.PureComponent {
|
|
|
19
22
|
highlight
|
|
20
23
|
}
|
|
21
24
|
} = this.props;
|
|
22
|
-
return [
|
|
25
|
+
return [jsx("span", {
|
|
23
26
|
key: "name",
|
|
24
|
-
|
|
25
|
-
},
|
|
27
|
+
css: textWrapper(this.props.isSelected ? token('color.text.selected', B400) : token('color.text', N800))
|
|
28
|
+
}, jsx(HighlightText, {
|
|
26
29
|
highlights: highlight && highlight.name
|
|
27
30
|
}, name))];
|
|
28
31
|
});
|
|
@@ -41,9 +44,9 @@ export class TeamOption extends React.PureComponent {
|
|
|
41
44
|
} else {
|
|
42
45
|
if (includesYou === true) {
|
|
43
46
|
if (memberCount > 50) {
|
|
44
|
-
return this.getBylineComponent(isSelected,
|
|
47
|
+
return this.getBylineComponent(isSelected, jsx(FormattedMessage, messages.plus50MembersWithYou));
|
|
45
48
|
} else {
|
|
46
|
-
return this.getBylineComponent(isSelected,
|
|
49
|
+
return this.getBylineComponent(isSelected, jsx(FormattedMessage, _extends({}, messages.memberCountWithYou, {
|
|
47
50
|
values: {
|
|
48
51
|
count: memberCount
|
|
49
52
|
}
|
|
@@ -51,9 +54,9 @@ export class TeamOption extends React.PureComponent {
|
|
|
51
54
|
}
|
|
52
55
|
} else {
|
|
53
56
|
if (memberCount > 50) {
|
|
54
|
-
return this.getBylineComponent(isSelected,
|
|
57
|
+
return this.getBylineComponent(isSelected, jsx(FormattedMessage, messages.plus50MembersWithoutYou));
|
|
55
58
|
} else {
|
|
56
|
-
return this.getBylineComponent(isSelected,
|
|
59
|
+
return this.getBylineComponent(isSelected, jsx(FormattedMessage, _extends({}, messages.memberCountWithoutYou, {
|
|
57
60
|
values: {
|
|
58
61
|
count: memberCount
|
|
59
62
|
}
|
|
@@ -63,8 +66,8 @@ export class TeamOption extends React.PureComponent {
|
|
|
63
66
|
}
|
|
64
67
|
});
|
|
65
68
|
|
|
66
|
-
_defineProperty(this, "getBylineComponent", (isSelected, message) =>
|
|
67
|
-
|
|
69
|
+
_defineProperty(this, "getBylineComponent", (isSelected, message) => jsx("span", {
|
|
70
|
+
css: textWrapper(isSelected ? token('color.text.selected', B400) : token('color.text.subtlest', N200))
|
|
68
71
|
}, message));
|
|
69
72
|
|
|
70
73
|
_defineProperty(this, "renderAvatar", () => {
|
|
@@ -74,7 +77,7 @@ export class TeamOption extends React.PureComponent {
|
|
|
74
77
|
name
|
|
75
78
|
}
|
|
76
79
|
} = this.props;
|
|
77
|
-
return
|
|
80
|
+
return jsx(SizeableAvatar, {
|
|
78
81
|
appearance: "big",
|
|
79
82
|
src: avatarUrl,
|
|
80
83
|
name: name
|
|
@@ -87,7 +90,7 @@ export class TeamOption extends React.PureComponent {
|
|
|
87
90
|
}
|
|
88
91
|
|
|
89
92
|
render() {
|
|
90
|
-
return
|
|
93
|
+
return jsx(AvatarItemOption, {
|
|
91
94
|
avatar: this.renderAvatar(),
|
|
92
95
|
secondaryText: this.renderByline(),
|
|
93
96
|
primaryText: this.getPrimaryText(),
|