@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.
Files changed (56) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/components/AddOptionAvatar.js +16 -12
  3. package/dist/cjs/components/AvatarItemOption.js +56 -32
  4. package/dist/cjs/components/EmailOption/main.js +9 -7
  5. package/dist/cjs/components/ExternalUserOption/ExternalAvatarItemOption.js +62 -21
  6. package/dist/cjs/components/ExternalUserOption/InfoIcon.js +9 -15
  7. package/dist/cjs/components/ExternalUserOption/SourcesTooltipContent.js +29 -23
  8. package/dist/cjs/components/ExternalUserOption/main.js +28 -24
  9. package/dist/cjs/components/GroupOption/main.js +23 -19
  10. package/dist/cjs/components/MultiValue.js +18 -16
  11. package/dist/cjs/components/PopupControl.js +20 -21
  12. package/dist/cjs/components/SingleValue.js +25 -11
  13. package/dist/cjs/components/SingleValueContainer.js +9 -8
  14. package/dist/cjs/components/TeamOption/main.js +13 -11
  15. package/dist/cjs/components/UserOption.js +13 -11
  16. package/dist/cjs/version.json +1 -1
  17. package/dist/es2019/components/AddOptionAvatar.js +16 -11
  18. package/dist/es2019/components/AvatarItemOption.js +47 -42
  19. package/dist/es2019/components/EmailOption/main.js +11 -8
  20. package/dist/es2019/components/ExternalUserOption/ExternalAvatarItemOption.js +56 -41
  21. package/dist/es2019/components/ExternalUserOption/InfoIcon.js +9 -7
  22. package/dist/es2019/components/ExternalUserOption/SourcesTooltipContent.js +27 -21
  23. package/dist/es2019/components/ExternalUserOption/main.js +28 -24
  24. package/dist/es2019/components/GroupOption/main.js +22 -19
  25. package/dist/es2019/components/MultiValue.js +19 -13
  26. package/dist/es2019/components/PopupControl.js +21 -18
  27. package/dist/es2019/components/SingleValue.js +25 -22
  28. package/dist/es2019/components/SingleValueContainer.js +11 -7
  29. package/dist/es2019/components/TeamOption/main.js +15 -12
  30. package/dist/es2019/components/UserOption.js +15 -12
  31. package/dist/es2019/version.json +1 -1
  32. package/dist/esm/components/AddOptionAvatar.js +17 -11
  33. package/dist/esm/components/AvatarItemOption.js +56 -27
  34. package/dist/esm/components/EmailOption/main.js +10 -8
  35. package/dist/esm/components/ExternalUserOption/ExternalAvatarItemOption.js +65 -18
  36. package/dist/esm/components/ExternalUserOption/InfoIcon.js +9 -8
  37. package/dist/esm/components/ExternalUserOption/SourcesTooltipContent.js +27 -18
  38. package/dist/esm/components/ExternalUserOption/main.js +27 -18
  39. package/dist/esm/components/GroupOption/main.js +22 -15
  40. package/dist/esm/components/MultiValue.js +19 -13
  41. package/dist/esm/components/PopupControl.js +21 -11
  42. package/dist/esm/components/SingleValue.js +26 -9
  43. package/dist/esm/components/SingleValueContainer.js +10 -7
  44. package/dist/esm/components/TeamOption/main.js +14 -12
  45. package/dist/esm/components/UserOption.js +14 -12
  46. package/dist/esm/version.json +1 -1
  47. package/dist/types/components/AvatarItemOption.d.ts +3 -2
  48. package/dist/types/components/EmailOption/main.d.ts +1 -0
  49. package/dist/types/components/ExternalUserOption/ExternalAvatarItemOption.d.ts +1 -0
  50. package/dist/types/components/ExternalUserOption/SourcesTooltipContent.d.ts +3 -2
  51. package/dist/types/components/ExternalUserOption/main.d.ts +3 -2
  52. package/dist/types/components/GroupOption/main.d.ts +2 -1
  53. package/dist/types/components/MultiValue.d.ts +1 -0
  54. package/dist/types/components/PopupControl.d.ts +1 -0
  55. package/dist/types/components/SingleValueContainer.d.ts +1 -0
  56. package/package.json +4 -3
@@ -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 styled from 'styled-components';
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 GroupTagContainer = styled.div`
30
- padding-left: 2px;
31
- `;
32
- const NameWrapper = styled.span`
33
- padding-left: 5px;
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 ? /*#__PURE__*/React.createElement(AddOptionAvatar, {
51
+ return selectProps.emailLabel ? jsx(AddOptionAvatar, {
50
52
  isLozenge: true,
51
53
  label: selectProps.emailLabel
52
- }) : /*#__PURE__*/React.createElement(FormattedMessage, messages.addEmail, label => /*#__PURE__*/React.createElement(AddOptionAvatar, {
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 /*#__PURE__*/React.createElement(GroupTagContainer, null, /*#__PURE__*/React.createElement(PeopleIcon, {
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 /*#__PURE__*/React.createElement(SizeableAvatar, {
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 /*#__PURE__*/React.createElement(components.MultiValue, _extends({}, rest, {
117
+ return jsx(components.MultiValue, _extends({}, rest, {
114
118
  innerProps: {
115
119
  ref: this.containerRef
116
120
  },
117
121
  cropWithEllipsis: false
118
- }), this.getElemBefore(), " ", /*#__PURE__*/React.createElement(NameWrapper, null, children));
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 styled, { css } from 'styled-components';
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 ControlWrapper = styled.div`
14
- display: flex;
15
- flex-direction: column;
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 getPadding = () => {
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
- return css`
29
- padding: ${top}px ${right}px ${bottom}px ${left}px;
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 /*#__PURE__*/React.createElement(ControlWrapper, null, /*#__PURE__*/React.createElement(Label, null, popupTitle), /*#__PURE__*/React.createElement(components.Control, this.props));
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 React from 'react';
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 AvatarItemComponent = styled.div`
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
- & > span {
16
- box-sizing: border-box;
17
- }
18
-
19
- &:hover {
20
- width: auto;
21
- padding: 0;
22
- border: none;
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 ? /*#__PURE__*/React.createElement(AvatarItem, {
37
+ return !isFocused ? jsx(AvatarItem, {
37
38
  backgroundColor: "transparent",
38
- avatar: /*#__PURE__*/React.createElement(SizeableAvatar, {
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
- }) => /*#__PURE__*/React.createElement(AvatarItemComponent, props)) : null;
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 styled from 'styled-components';
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 PlaceholderIconContainer = styled.div`
8
- padding-left: ${BORDER_PADDING}px;
9
- line-height: 0;
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 /*#__PURE__*/React.createElement(SizeableAvatar, {
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 /*#__PURE__*/React.createElement(components.ValueContainer, valueContainerProps, /*#__PURE__*/React.createElement(PlaceholderIconContainer, null, this.renderAvatar()), children);
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, TextWrapper } from '.././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 [/*#__PURE__*/React.createElement(TextWrapper, {
25
+ return [jsx("span", {
23
26
  key: "name",
24
- color: this.props.isSelected ? token('color.text.selected', B400) : token('color.text', N800)
25
- }, /*#__PURE__*/React.createElement(HighlightText, {
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, /*#__PURE__*/React.createElement(FormattedMessage, messages.plus50MembersWithYou));
47
+ return this.getBylineComponent(isSelected, jsx(FormattedMessage, messages.plus50MembersWithYou));
45
48
  } else {
46
- return this.getBylineComponent(isSelected, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.memberCountWithYou, {
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, /*#__PURE__*/React.createElement(FormattedMessage, messages.plus50MembersWithoutYou));
57
+ return this.getBylineComponent(isSelected, jsx(FormattedMessage, messages.plus50MembersWithoutYou));
55
58
  } else {
56
- return this.getBylineComponent(isSelected, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.memberCountWithoutYou, {
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) => /*#__PURE__*/React.createElement(TextWrapper, {
67
- color: isSelected ? token('color.text.selected', B400) : token('color.text.subtlest', N200)
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 /*#__PURE__*/React.createElement(SizeableAvatar, {
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 /*#__PURE__*/React.createElement(AvatarItemOption, {
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, TextWrapper } from './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 = [/*#__PURE__*/React.createElement(TextWrapper, {
24
+ const result = [jsx("span", {
22
25
  key: "name",
23
- color: this.props.isSelected ? token('color.text.selected', B400) : token('color.text', N800)
24
- }, /*#__PURE__*/React.createElement(HighlightText, {
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( /*#__PURE__*/React.createElement(React.Fragment, {
32
+ result.push(jsx(React.Fragment, {
30
33
  key: "publicName"
31
- }, ' ', /*#__PURE__*/React.createElement(TextWrapper, {
32
- color: this.props.isSelected ? token('color.text.selected', B400) : token('color.text.subtlest', N200)
33
- }, "(", /*#__PURE__*/React.createElement(HighlightText, {
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 ? /*#__PURE__*/React.createElement(TextWrapper, {
42
- color: this.props.isSelected ? token('color.text.selected', B400) : token('color.text.subtlest', N200)
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 /*#__PURE__*/React.createElement(SizeableAvatar, {
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 /*#__PURE__*/React.createElement(AvatarItemOption, {
70
+ return jsx(AvatarItemOption, {
68
71
  avatar: this.renderAvatar(),
69
72
  primaryText: this.getPrimaryText(),
70
73
  secondaryText: this.renderSecondaryText(),
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "9.0.0",
3
+ "version": "9.0.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,21 +1,27 @@
1
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
-
3
- var _templateObject;
4
-
1
+ /** @jsx jsx */
5
2
  import EmailIcon from '@atlaskit/icon/glyph/email';
6
3
  import { N40, N500 } from '@atlaskit/theme/colors';
7
4
  import { token } from '@atlaskit/tokens';
8
5
  import React from 'react';
9
- import styled from 'styled-components';
10
- var EmailAvatarWrapper = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: ", "px;\n\n background-color: ", ";\n border-radius: 50%;\n display: flex;\n align-items: center;\n"])), function (props) {
11
- return props.isLozenge ? 0 : 4;
12
- }, token('color.background.neutral', N40));
6
+ import { css, jsx } from '@emotion/core';
7
+
8
+ var getEmailAvatarWrapperStyle = function getEmailAvatarWrapperStyle(isLozenge) {
9
+ var padding = isLozenge ? 0 : 4;
10
+ return css({
11
+ padding: "".concat(padding, "px"),
12
+ backgroundColor: token('color.background.neutral', N40),
13
+ borderRadius: '50%',
14
+ display: 'flex',
15
+ alignItems: 'center'
16
+ });
17
+ };
18
+
13
19
  export var AddOptionAvatar = function AddOptionAvatar(_ref) {
14
20
  var isLozenge = _ref.isLozenge,
15
21
  label = _ref.label;
16
- return /*#__PURE__*/React.createElement(EmailAvatarWrapper, {
17
- isLozenge: isLozenge
18
- }, /*#__PURE__*/React.createElement(EmailIcon, {
22
+ return jsx("div", {
23
+ css: getEmailAvatarWrapperStyle(isLozenge)
24
+ }, jsx(EmailIcon, {
19
25
  label: label,
20
26
  size: isLozenge ? 'small' : 'medium',
21
27
  primaryColor: token('color.text.subtle', N500)
@@ -1,11 +1,12 @@
1
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
 
3
- var _templateObject, _templateObject2, _templateObject3, _templateObject4;
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
+ 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 */
5
8
  import React from 'react';
6
- import styled from 'styled-components';
7
- import { B400 } from '@atlaskit/theme/colors';
8
- import { token } from '@atlaskit/tokens';
9
+ import { css, jsx } from '@emotion/core';
9
10
  import Lozenge from '@atlaskit/lozenge';
10
11
  var AsyncTooltip = /*#__PURE__*/React.lazy(function () {
11
12
  return import(
@@ -16,22 +17,48 @@ var AsyncTooltip = /*#__PURE__*/React.lazy(function () {
16
17
  };
17
18
  });
18
19
  });
19
- var Wrapper = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n align-items: center;\n box-sizing: border-box;\n display: flex;\n line-height: 1;\n outline: none;\n margin: 0;\n width: 100%;\n cursor: pointer;\n"])));
20
- var Text = styled.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin: 0;\n color: ", ";\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n ", "\n"])), token('color.text.brand', B400), function (_ref) {
21
- var secondary = _ref.secondary;
22
- return secondary && "color: ".concat(token('color.text.brand', B400), "; font-size: 0.85em;");
20
+ var wrapper = css({
21
+ alignItems: 'center',
22
+ boxSizing: 'border-box',
23
+ display: 'flex',
24
+ lineHeight: 1,
25
+ outline: 'none',
26
+ margin: 0,
27
+ width: '100%',
28
+ cursor: 'pointer'
23
29
  });
24
- var AdditionalInfo = styled.span(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n float: right;\n"])));
25
- export var TextWrapper = styled.span(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n color: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n display: inline-block;\n"])), function (_ref2) {
26
- var color = _ref2.color;
27
- return color;
30
+
31
+ var getTextStyle = function getTextStyle(isSecondary) {
32
+ var secondaryCssArgs = isSecondary ? {
33
+ fontSize: '0.85em'
34
+ } : {};
35
+ return css(_objectSpread({
36
+ margin: 0,
37
+ overflowX: 'hidden',
38
+ textOverflow: 'ellipsis',
39
+ whiteSpace: 'nowrap'
40
+ }, secondaryCssArgs));
41
+ };
42
+
43
+ var additionalInfo = css({
44
+ float: 'right'
28
45
  });
29
- export var AvatarItemOption = function AvatarItemOption(_ref3) {
30
- var avatar = _ref3.avatar,
31
- primaryText = _ref3.primaryText,
32
- secondaryText = _ref3.secondaryText,
33
- lozenge = _ref3.lozenge;
34
- return /*#__PURE__*/React.createElement(Wrapper, null, avatar, /*#__PURE__*/React.createElement("div", {
46
+ export var textWrapper = function textWrapper(color) {
47
+ return css({
48
+ overflow: 'hidden',
49
+ textOverflow: 'ellipsis',
50
+ display: 'inline-block',
51
+ color: color
52
+ });
53
+ };
54
+ export var AvatarItemOption = function AvatarItemOption(_ref) {
55
+ var avatar = _ref.avatar,
56
+ primaryText = _ref.primaryText,
57
+ secondaryText = _ref.secondaryText,
58
+ lozenge = _ref.lozenge;
59
+ return jsx("span", {
60
+ css: wrapper
61
+ }, avatar, jsx("div", {
35
62
  style: {
36
63
  maxWidth: '100%',
37
64
  minWidth: 0,
@@ -39,15 +66,17 @@ export var AvatarItemOption = function AvatarItemOption(_ref3) {
39
66
  lineHeight: '1.4',
40
67
  paddingLeft: '8px'
41
68
  }
42
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Text, null, primaryText), /*#__PURE__*/React.createElement(AdditionalInfo, null, (lozenge === null || lozenge === void 0 ? void 0 : lozenge.text) && (lozenge !== null && lozenge !== void 0 && lozenge.tooltip ?
43
- /*#__PURE__*/
44
- // Note that entire Lozenge must be wrapped in the Tooltip (rather than just the
69
+ }, jsx("div", null, jsx("span", {
70
+ css: getTextStyle()
71
+ }, primaryText), jsx("span", {
72
+ css: additionalInfo
73
+ }, (lozenge === null || lozenge === void 0 ? void 0 : lozenge.text) && (lozenge !== null && lozenge !== void 0 && lozenge.tooltip ? // Note that entire Lozenge must be wrapped in the Tooltip (rather than just the
45
74
  // Lozenge text) or tooltip won't work
46
- React.createElement(React.Suspense, {
47
- fallback: /*#__PURE__*/React.createElement(Lozenge, lozenge, lozenge.text)
48
- }, /*#__PURE__*/React.createElement(AsyncTooltip, {
75
+ jsx(React.Suspense, {
76
+ fallback: jsx(Lozenge, lozenge, lozenge.text)
77
+ }, jsx(AsyncTooltip, {
49
78
  content: lozenge.tooltip
50
- }, /*#__PURE__*/React.createElement(Lozenge, lozenge, lozenge.text))) : /*#__PURE__*/React.createElement(Lozenge, lozenge, lozenge.text)))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Text, {
51
- secondary: true
79
+ }, jsx(Lozenge, lozenge, lozenge.text))) : jsx(Lozenge, lozenge, lozenge.text)))), jsx("div", null, jsx("span", {
80
+ css: getTextStyle(true)
52
81
  }, secondaryText))));
53
82
  };
@@ -10,12 +10,14 @@ 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 React from 'react';
14
15
  import { FormattedMessage } from 'react-intl-next';
15
16
  import { B400, N200, N800 } from '@atlaskit/theme/colors';
16
17
  import { token } from '@atlaskit/tokens';
18
+ import { jsx } from '@emotion/core';
17
19
  import { AddOptionAvatar } from '../AddOptionAvatar';
18
- import { AvatarItemOption, TextWrapper } from '../AvatarItemOption';
20
+ import { AvatarItemOption, textWrapper } from '../AvatarItemOption';
19
21
  import { messages } from '../i18n';
20
22
 
21
23
  var getAddEmailMessage = function getAddEmailMessage(validity) {
@@ -46,21 +48,21 @@ export var EmailOption = /*#__PURE__*/function (_React$PureComponent) {
46
48
 
47
49
  _defineProperty(_assertThisInitialized(_this), "renderPrimaryText", function () {
48
50
  var id = _this.props.email.id;
49
- return /*#__PURE__*/React.createElement(TextWrapper, {
51
+ return jsx("span", {
50
52
  key: "name",
51
- color: _this.props.isSelected ? token('color.text.selected', B400) : token('color.text', N800)
53
+ css: textWrapper(_this.props.isSelected ? token('color.text.selected', B400) : token('color.text', N800))
52
54
  }, id);
53
55
  });
54
56
 
55
57
  _defineProperty(_assertThisInitialized(_this), "renderSecondaryText", function (label) {
56
- return /*#__PURE__*/React.createElement(TextWrapper, {
57
- color: _this.props.isSelected ? token('color.text.selected', B400) : token('color.text.subtlest', N200)
58
+ return jsx("span", {
59
+ css: textWrapper(_this.props.isSelected ? token('color.text.selected', B400) : token('color.text.subtlest', N200))
58
60
  }, label);
59
61
  });
60
62
 
61
63
  _defineProperty(_assertThisInitialized(_this), "renderOption", function (label) {
62
- return /*#__PURE__*/React.createElement(AvatarItemOption, {
63
- avatar: /*#__PURE__*/React.createElement(AddOptionAvatar, {
64
+ return jsx(AvatarItemOption, {
65
+ avatar: jsx(AddOptionAvatar, {
64
66
  label: label
65
67
  }),
66
68
  primaryText: _this.renderPrimaryText(),
@@ -80,7 +82,7 @@ export var EmailOption = /*#__PURE__*/function (_React$PureComponent) {
80
82
  var _this$props = this.props,
81
83
  label = _this$props.label,
82
84
  emailValidity = _this$props.emailValidity;
83
- return label !== undefined ? this.renderOption(label) : /*#__PURE__*/React.createElement(FormattedMessage, getAddEmailMessage(emailValidity), function (label) {
85
+ return label !== undefined ? this.renderOption(label) : jsx(FormattedMessage, getAddEmailMessage(emailValidity), function (label) {
84
86
  return _this2.renderOption(label);
85
87
  });
86
88
  }