@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
|
@@ -1,26 +1,28 @@
|
|
|
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 { textWrapper } from '../AvatarItemOption';
|
|
8
10
|
import { SizeableAvatar } from '../SizeableAvatar';
|
|
9
11
|
import { ExternalUserSourcesContainer } from '../ExternalUserSourcesContainer';
|
|
10
12
|
import InfoIcon from './InfoIcon';
|
|
11
13
|
import { ExternalAvatarItemOption } from './ExternalAvatarItemOption';
|
|
12
14
|
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
|
-
|
|
15
|
+
export const imageContainer = css({
|
|
16
|
+
height: '16px',
|
|
17
|
+
width: '16px',
|
|
18
|
+
paddingRight: '4px',
|
|
19
|
+
display: 'flex',
|
|
20
|
+
alignItems: 'center',
|
|
21
|
+
justifyContent: 'center'
|
|
22
|
+
});
|
|
23
|
+
export const emailDomainWrapper = css({
|
|
24
|
+
fontWeight: 'bold'
|
|
25
|
+
});
|
|
24
26
|
export class ExternalUserOption extends React.PureComponent {
|
|
25
27
|
constructor(...args) {
|
|
26
28
|
super(...args);
|
|
@@ -31,9 +33,9 @@ export class ExternalUserOption extends React.PureComponent {
|
|
|
31
33
|
name
|
|
32
34
|
}
|
|
33
35
|
} = this.props;
|
|
34
|
-
return
|
|
36
|
+
return jsx("span", {
|
|
35
37
|
key: "name",
|
|
36
|
-
|
|
38
|
+
css: textWrapper(this.props.isSelected ? token('color.text.selected', B400) : token('color.text', N800))
|
|
37
39
|
}, name);
|
|
38
40
|
});
|
|
39
41
|
|
|
@@ -48,9 +50,11 @@ export class ExternalUserOption extends React.PureComponent {
|
|
|
48
50
|
|
|
49
51
|
const [emailUser, emailDomain] = email.split('@');
|
|
50
52
|
const emailDomainWithAt = `@${emailDomain}`;
|
|
51
|
-
return
|
|
52
|
-
|
|
53
|
-
}, emailUser,
|
|
53
|
+
return jsx("span", {
|
|
54
|
+
css: textWrapper(this.props.isSelected ? token('color.text.selected', B400) : token('color.text.subtlest', N200))
|
|
55
|
+
}, emailUser, jsx("span", {
|
|
56
|
+
css: emailDomainWrapper
|
|
57
|
+
}, emailDomainWithAt));
|
|
54
58
|
});
|
|
55
59
|
|
|
56
60
|
_defineProperty(this, "renderAvatar", () => {
|
|
@@ -61,7 +65,7 @@ export class ExternalUserOption extends React.PureComponent {
|
|
|
61
65
|
},
|
|
62
66
|
status
|
|
63
67
|
} = this.props;
|
|
64
|
-
return
|
|
68
|
+
return jsx(SizeableAvatar, {
|
|
65
69
|
appearance: "big",
|
|
66
70
|
src: avatarUrl,
|
|
67
71
|
presence: status,
|
|
@@ -69,14 +73,14 @@ export class ExternalUserOption extends React.PureComponent {
|
|
|
69
73
|
});
|
|
70
74
|
});
|
|
71
75
|
|
|
72
|
-
_defineProperty(this, "getSourcesInfoTooltip", () => this.props.user.isExternal ?
|
|
76
|
+
_defineProperty(this, "getSourcesInfoTooltip", () => this.props.user.isExternal ? jsx(Tooltip, {
|
|
73
77
|
content: this.formattedTooltipContent(),
|
|
74
78
|
position: 'right-start'
|
|
75
|
-
},
|
|
79
|
+
}, jsx(InfoIcon, null)) : undefined);
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
render() {
|
|
79
|
-
return
|
|
83
|
+
return jsx(ExternalAvatarItemOption, {
|
|
80
84
|
avatar: this.renderAvatar(),
|
|
81
85
|
primaryText: this.getPrimaryText(),
|
|
82
86
|
secondaryText: this.renderSecondaryText(),
|
|
@@ -92,11 +96,11 @@ export class ExternalUserOption extends React.PureComponent {
|
|
|
92
96
|
sources
|
|
93
97
|
}
|
|
94
98
|
} = this.props;
|
|
95
|
-
return
|
|
99
|
+
return jsx(ExternalUserSourcesContainer, {
|
|
96
100
|
accountId: id,
|
|
97
101
|
shouldFetchSources: Boolean(requiresSourceHydration),
|
|
98
102
|
initialSources: sources
|
|
99
|
-
}, sourceData =>
|
|
103
|
+
}, sourceData => jsx(SourcesTooltipContent, sourceData));
|
|
100
104
|
}
|
|
101
105
|
|
|
102
106
|
}
|
|
@@ -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(),
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
2
4
|
import { B400, N800, N200 } from '@atlaskit/theme/colors';
|
|
3
5
|
import { token } from '@atlaskit/tokens';
|
|
6
|
+
import { jsx } from '@emotion/core';
|
|
4
7
|
import React from 'react';
|
|
5
|
-
import { AvatarItemOption,
|
|
8
|
+
import { AvatarItemOption, textWrapper } from './AvatarItemOption';
|
|
6
9
|
import { HighlightText } from './HighlightText';
|
|
7
10
|
import { SizeableAvatar } from './SizeableAvatar';
|
|
8
11
|
import { hasValue } from './utils';
|
|
@@ -18,19 +21,19 @@ export class UserOption extends React.PureComponent {
|
|
|
18
21
|
highlight
|
|
19
22
|
}
|
|
20
23
|
} = this.props;
|
|
21
|
-
const result = [
|
|
24
|
+
const result = [jsx("span", {
|
|
22
25
|
key: "name",
|
|
23
|
-
|
|
24
|
-
},
|
|
26
|
+
css: textWrapper(this.props.isSelected ? token('color.text.selected', B400) : token('color.text', N800))
|
|
27
|
+
}, jsx(HighlightText, {
|
|
25
28
|
highlights: highlight && highlight.name
|
|
26
29
|
}, name))];
|
|
27
30
|
|
|
28
31
|
if (hasValue(publicName) && name.trim() !== publicName.trim()) {
|
|
29
|
-
result.push(
|
|
32
|
+
result.push(jsx(React.Fragment, {
|
|
30
33
|
key: "publicName"
|
|
31
|
-
}, ' ',
|
|
32
|
-
|
|
33
|
-
}, "(",
|
|
34
|
+
}, ' ', jsx("span", {
|
|
35
|
+
css: textWrapper(this.props.isSelected ? token('color.text.selected', B400) : token('color.text.subtlest', N200))
|
|
36
|
+
}, "(", jsx(HighlightText, {
|
|
34
37
|
highlights: highlight && highlight.publicName
|
|
35
38
|
}, publicName), ")")));
|
|
36
39
|
}
|
|
@@ -38,8 +41,8 @@ export class UserOption extends React.PureComponent {
|
|
|
38
41
|
return result;
|
|
39
42
|
});
|
|
40
43
|
|
|
41
|
-
_defineProperty(this, "renderSecondaryText", () => this.props.user.byline ?
|
|
42
|
-
|
|
44
|
+
_defineProperty(this, "renderSecondaryText", () => this.props.user.byline ? jsx("span", {
|
|
45
|
+
css: textWrapper(this.props.isSelected ? token('color.text.selected', B400) : token('color.text.subtlest', N200))
|
|
43
46
|
}, this.props.user.byline) : undefined);
|
|
44
47
|
|
|
45
48
|
_defineProperty(this, "renderAvatar", () => {
|
|
@@ -50,7 +53,7 @@ export class UserOption extends React.PureComponent {
|
|
|
50
53
|
},
|
|
51
54
|
status
|
|
52
55
|
} = this.props;
|
|
53
|
-
return
|
|
56
|
+
return jsx(SizeableAvatar, {
|
|
54
57
|
appearance: "big",
|
|
55
58
|
src: avatarUrl,
|
|
56
59
|
presence: status,
|
|
@@ -64,7 +67,7 @@ export class UserOption extends React.PureComponent {
|
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
render() {
|
|
67
|
-
return
|
|
70
|
+
return jsx(AvatarItemOption, {
|
|
68
71
|
avatar: this.renderAvatar(),
|
|
69
72
|
primaryText: this.getPrimaryText(),
|
|
70
73
|
secondaryText: this.renderSecondaryText(),
|
|
@@ -62,7 +62,7 @@ export const 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/es2019/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/es2019/version.json
CHANGED