@atlaskit/user-picker 8.3.5 → 8.6.0

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 (72) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/cjs/analytics.js +2 -0
  3. package/dist/cjs/clients/UserSourceProvider.js +27 -20
  4. package/dist/cjs/components/AddOptionAvatar.js +2 -2
  5. package/dist/cjs/components/AvatarItemOption.js +12 -18
  6. package/dist/cjs/components/EmailOption/main.js +2 -2
  7. package/dist/cjs/components/ExternalUserOption/ExternalAvatarItemOption.js +43 -0
  8. package/dist/cjs/components/ExternalUserOption/InfoIcon.js +57 -0
  9. package/dist/cjs/components/ExternalUserOption/main.js +34 -21
  10. package/dist/cjs/components/ExternalUserSourcesContainer.js +1 -2
  11. package/dist/cjs/components/GroupOption/main.js +3 -3
  12. package/dist/cjs/components/PopupControl.js +2 -2
  13. package/dist/cjs/components/TeamOption/main.js +2 -2
  14. package/dist/cjs/components/UserOption.js +3 -3
  15. package/dist/cjs/components/assets/github.js +1 -1
  16. package/dist/cjs/components/assets/google.js +4 -4
  17. package/dist/cjs/components/assets/microsoft.js +5 -5
  18. package/dist/cjs/components/assets/slack.js +9 -9
  19. package/dist/cjs/components/i18n.js +10 -0
  20. package/dist/cjs/components/smart-user-picker/components/index.js +4 -3
  21. package/dist/cjs/components/styles.js +6 -6
  22. package/dist/cjs/version.json +1 -1
  23. package/dist/es2019/analytics.js +2 -0
  24. package/dist/es2019/clients/UserSourceProvider.js +20 -15
  25. package/dist/es2019/components/AddOptionAvatar.js +2 -2
  26. package/dist/es2019/components/AvatarItemOption.js +5 -11
  27. package/dist/es2019/components/EmailOption/main.js +2 -2
  28. package/dist/es2019/components/ExternalUserOption/ExternalAvatarItemOption.js +49 -0
  29. package/dist/es2019/components/ExternalUserOption/InfoIcon.js +22 -0
  30. package/dist/es2019/components/ExternalUserOption/main.js +32 -18
  31. package/dist/es2019/components/ExternalUserSourcesContainer.js +1 -1
  32. package/dist/es2019/components/GroupOption/main.js +3 -3
  33. package/dist/es2019/components/PopupControl.js +2 -2
  34. package/dist/es2019/components/TeamOption/main.js +2 -2
  35. package/dist/es2019/components/UserOption.js +3 -3
  36. package/dist/es2019/components/assets/github.js +1 -1
  37. package/dist/es2019/components/assets/google.js +4 -4
  38. package/dist/es2019/components/assets/microsoft.js +5 -5
  39. package/dist/es2019/components/assets/slack.js +9 -9
  40. package/dist/es2019/components/i18n.js +10 -0
  41. package/dist/es2019/components/smart-user-picker/components/index.js +3 -1
  42. package/dist/es2019/components/styles.js +6 -6
  43. package/dist/es2019/version.json +1 -1
  44. package/dist/esm/analytics.js +2 -0
  45. package/dist/esm/clients/UserSourceProvider.js +27 -20
  46. package/dist/esm/components/AddOptionAvatar.js +2 -2
  47. package/dist/esm/components/AvatarItemOption.js +12 -18
  48. package/dist/esm/components/EmailOption/main.js +2 -2
  49. package/dist/esm/components/ExternalUserOption/ExternalAvatarItemOption.js +24 -0
  50. package/dist/esm/components/ExternalUserOption/InfoIcon.js +33 -0
  51. package/dist/esm/components/ExternalUserOption/main.js +28 -18
  52. package/dist/esm/components/ExternalUserSourcesContainer.js +1 -2
  53. package/dist/esm/components/GroupOption/main.js +3 -3
  54. package/dist/esm/components/PopupControl.js +2 -2
  55. package/dist/esm/components/TeamOption/main.js +2 -2
  56. package/dist/esm/components/UserOption.js +3 -3
  57. package/dist/esm/components/assets/github.js +1 -1
  58. package/dist/esm/components/assets/google.js +4 -4
  59. package/dist/esm/components/assets/microsoft.js +5 -5
  60. package/dist/esm/components/assets/slack.js +9 -9
  61. package/dist/esm/components/i18n.js +10 -0
  62. package/dist/esm/components/smart-user-picker/components/index.js +4 -3
  63. package/dist/esm/components/styles.js +6 -6
  64. package/dist/esm/version.json +1 -1
  65. package/dist/types/components/AvatarItemOption.d.ts +1 -2
  66. package/dist/types/components/ExternalUserOption/ExternalAvatarItemOption.d.ts +8 -0
  67. package/dist/types/components/ExternalUserOption/InfoIcon.d.ts +3 -0
  68. package/dist/types/components/i18n.d.ts +10 -0
  69. package/dist/types/components/smart-user-picker/components/index.d.ts +4 -0
  70. package/dist/types/components/smart-user-picker/service/recommendationClient.d.ts +1 -0
  71. package/dist/types/types.d.ts +1 -1
  72. package/package.json +8 -2
@@ -12,33 +12,33 @@ export function SlackIcon(props) {
12
12
  clipPath: "url(#clip0)"
13
13
  }, /*#__PURE__*/React.createElement("path", {
14
14
  d: "M2.51653 7.5688C2.51653 8.26133 1.9508 8.82706 1.25826 8.82706C0.565731 8.82706 0 8.26133 0 7.5688C0 6.87627 0.565731 6.31055 1.25826 6.31055H2.51653V7.5688Z",
15
- fill: token('color.text.onBold', 'white')
15
+ fill: token('color.text.inverse', 'white')
16
16
  }), /*#__PURE__*/React.createElement("path", {
17
17
  d: "M3.15039 7.5688C3.15039 6.87627 3.71612 6.31055 4.40865 6.31055C5.10119 6.31055 5.66692 6.87627 5.66692 7.5688V10.7193C5.66692 11.4119 5.10119 11.9776 4.40865 11.9776C3.71612 11.9776 3.15039 11.4119 3.15039 10.7193V7.5688Z",
18
- fill: token('color.text.onBold', 'white')
18
+ fill: token('color.text.inverse', 'white')
19
19
  }), /*#__PURE__*/React.createElement("path", {
20
20
  d: "M4.40865 2.51651C3.71612 2.51651 3.15039 1.95079 3.15039 1.25826C3.15039 0.565728 3.71612 0 4.40865 0C5.10119 0 5.66692 0.565728 5.66692 1.25826V2.51651H4.40865Z",
21
- fill: token('color.text.onBold', 'white')
21
+ fill: token('color.text.inverse', 'white')
22
22
  }), /*#__PURE__*/React.createElement("path", {
23
23
  d: "M4.4088 3.15039C5.10133 3.15039 5.66706 3.71612 5.66706 4.40865C5.66706 5.10118 5.10133 5.6669 4.4088 5.6669H1.25826C0.565731 5.6669 0 5.10118 0 4.40865C0 3.71612 0.565731 3.15039 1.25826 3.15039H4.4088Z",
24
- fill: token('color.text.onBold', 'white')
24
+ fill: token('color.text.inverse', 'white')
25
25
  }), /*#__PURE__*/React.createElement("path", {
26
26
  d: "M9.46094 4.40865C9.46094 3.71612 10.0267 3.15039 10.7192 3.15039C11.4117 3.15039 11.9775 3.71612 11.9775 4.40865C11.9775 5.10118 11.4117 5.6669 10.7192 5.6669H9.46094V4.40865Z",
27
- fill: token('color.text.onBold', 'white')
27
+ fill: token('color.text.inverse', 'white')
28
28
  }), /*#__PURE__*/React.createElement("path", {
29
29
  d: "M8.8261 4.40878C8.8261 5.10131 8.26036 5.66704 7.56783 5.66704C6.8753 5.66704 6.30957 5.10131 6.30957 4.40878V1.25826C6.30957 0.565728 6.8753 0 7.56783 0C8.26036 0 8.8261 0.565728 8.8261 1.25826V4.40878Z",
30
- fill: token('color.text.onBold', 'white')
30
+ fill: token('color.text.inverse', 'white')
31
31
  }), /*#__PURE__*/React.createElement("path", {
32
32
  d: "M7.56881 9.46094C8.26134 9.46094 8.82707 10.0267 8.82707 10.7192C8.82707 11.4117 8.26134 11.9775 7.56881 11.9775C6.87628 11.9775 6.31055 11.4117 6.31055 10.7192V9.46094H7.56881Z",
33
- fill: token('color.text.onBold', 'white')
33
+ fill: token('color.text.inverse', 'white')
34
34
  }), /*#__PURE__*/React.createElement("path", {
35
35
  d: "M7.56881 8.82706C6.87628 8.82706 6.31055 8.26133 6.31055 7.5688C6.31055 6.87627 6.87628 6.31055 7.56881 6.31055H10.7193C11.4119 6.31055 11.9776 6.87627 11.9776 7.5688C11.9776 8.26133 11.4119 8.82706 10.7193 8.82706H7.56881Z",
36
- fill: token('color.text.onBold', 'white')
36
+ fill: token('color.text.inverse', 'white')
37
37
  })), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
38
38
  id: "clip0"
39
39
  }, /*#__PURE__*/React.createElement("rect", {
40
40
  width: "12",
41
41
  height: "11.9999",
42
- fill: token('color.text.onBold', 'white')
42
+ fill: token('color.text.inverse', 'white')
43
43
  }))));
44
44
  }
@@ -90,6 +90,16 @@ export const messages = defineMessages({
90
90
  defaultMessage: 'GitHub',
91
91
  description: 'This external user is sourced from GitHub provider'
92
92
  },
93
+ jiraSource: {
94
+ id: 'fabric.elements.user-picker.source.jira',
95
+ defaultMessage: 'Jira',
96
+ description: 'This external user is sourced from Jira'
97
+ },
98
+ confluenceSource: {
99
+ id: 'fabric.elements.user-picker.source.confluence',
100
+ defaultMessage: 'Confluence',
101
+ description: 'This external user is sourced from Confluence'
102
+ },
93
103
  memberLozengeText: {
94
104
  id: 'fabric.elements.user-picker.member.lozenge.text',
95
105
  defaultMessage: 'MEMBER',
@@ -13,7 +13,7 @@ import getUserRecommendations from '../service/recommendationClient';
13
13
  import getUsersById from '../service/UsersClient';
14
14
  import MessagesIntlProvider from '../../MessagesIntlProvider';
15
15
 
16
- const hasContextChanged = (oldContext, newContext) => oldContext.siteId !== newContext.siteId || oldContext.productKey !== newContext.productKey || oldContext.principalId !== newContext.principalId || oldContext.containerId !== newContext.containerId || oldContext.objectId !== newContext.objectId || oldContext.childObjectId !== newContext.childObjectId;
16
+ const hasContextChanged = (oldContext, newContext) => oldContext.siteId !== newContext.siteId || oldContext.orgId !== newContext.orgId || oldContext.productKey !== newContext.productKey || oldContext.principalId !== newContext.principalId || oldContext.containerId !== newContext.containerId || oldContext.objectId !== newContext.objectId || oldContext.childObjectId !== newContext.childObjectId;
17
17
 
18
18
  const stringContains = (str, substr) => {
19
19
  if (str === null || str === undefined) {
@@ -147,6 +147,7 @@ class SmartUserPicker extends React.Component {
147
147
  principalId,
148
148
  productKey,
149
149
  siteId,
150
+ orgId,
150
151
  baseUrl,
151
152
  includeUsers,
152
153
  includeGroups,
@@ -168,6 +169,7 @@ class SmartUserPicker extends React.Component {
168
169
  principalId,
169
170
  productKey,
170
171
  siteId,
172
+ orgId,
171
173
  childObjectId,
172
174
  sessionId,
173
175
  productAttributes
@@ -20,14 +20,14 @@ export const getStyles = memoizeOne((width, isMulti, overrideStyles) => {
20
20
  const isMulti = state.selectProps.isMulti;
21
21
  return { ...css,
22
22
  width,
23
- borderColor: state.isFocused ? token('color.border.neutral', css.borderColor) : state.selectProps.subtle || state.selectProps.noBorder ? 'transparent' : token('color.border.neutral', N40),
24
- backgroundColor: state.isFocused ? token('color.background.default', css['backgroundColor']) : state.selectProps.subtle ? 'transparent' : state.selectProps.textFieldBackgroundColor ? token('color.background.subtleBorderedNeutral.resting', N10) : token('color.background.subtleNeutral.resting', N20),
23
+ borderColor: state.isFocused ? token('color.border', css.borderColor) : state.selectProps.subtle || state.selectProps.noBorder ? 'transparent' : token('color.border', N40),
24
+ backgroundColor: state.isFocused ? token('elevation.surface', css['backgroundColor']) : state.selectProps.subtle ? 'transparent' : state.selectProps.textFieldBackgroundColor ? token('color.background.input', N10) : token('color.background.neutral', N20),
25
25
  '&:hover .fabric-user-picker__clear-indicator': {
26
26
  opacity: 1
27
27
  },
28
28
  ':hover': { ...css[':hover'],
29
- borderColor: state.isFocused ? css[':hover'] ? token('color.border.focus', css[':hover'].borderColor) : token('color.border.focus', B100) : state.selectProps.subtle ? state.selectProps.hoveringClearIndicator ? token('color.iconBorder.danger', R50) : token('color.border.neutral', N30) : token('color.border.neutral', N40),
30
- backgroundColor: state.selectProps.subtle && state.selectProps.hoveringClearIndicator ? token('color.background.subtleDanger.resting', R50) : state.isFocused ? css[':hover'] ? token('color.background.default', css[':hover'].backgroundColor) : token('color.background.default', N0) : state.isDisabled ? token('color.background.disabled', N10) : token('color.background.default', N30)
29
+ borderColor: state.isFocused ? css[':hover'] ? token('color.border.focused', css[':hover'].borderColor) : token('color.border.focused', B100) : state.selectProps.subtle ? state.selectProps.hoveringClearIndicator ? token('color.icon.danger', R50) : token('color.border', N30) : token('color.border', N40),
30
+ backgroundColor: state.selectProps.subtle && state.selectProps.hoveringClearIndicator ? token('color.background.danger', R50) : state.isFocused ? css[':hover'] ? token('elevation.surface', css[':hover'].backgroundColor) : token('elevation.surface', N0) : state.isDisabled ? token('color.background.disabled', N10) : token('elevation.surface', N30)
31
31
  },
32
32
  padding: 0,
33
33
  minHeight: isCompact ? 'none' : 44,
@@ -136,14 +136,14 @@ export const getStyles = memoizeOne((width, isMulti, overrideStyles) => {
136
136
  paddingLeft: isMulti ? 0 : AVATAR_PADDING,
137
137
  '& input::placeholder': {
138
138
  /* Chrome, Firefox, Opera, Safari 10.1+ */
139
- color: token('color.text.lowEmphasis', N100),
139
+ color: token('color.text.subtlest', N100),
140
140
  opacity: 1
141
141
  /* Firefox */
142
142
 
143
143
  },
144
144
  '& input:-ms-input-placeholder': {
145
145
  /* Internet Explorer 10-11 */
146
- color: token('color.text.lowEmphasis', N100)
146
+ color: token('color.text.subtlest', N100)
147
147
  }
148
148
  })
149
149
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "8.3.5",
3
+ "version": "8.6.0",
4
4
  "sideEffects": false
5
5
  }
@@ -143,6 +143,7 @@ var createDefaultSmartPickerAttributes = function createDefaultSmartPickerAttrib
143
143
  productKey = props.productKey,
144
144
  principalId = props.principalId,
145
145
  siteId = props.siteId,
146
+ orgId = props.orgId,
146
147
  filterOptions = props.filterOptions;
147
148
  var sessionId = state.sessionId,
148
149
  query = state.query;
@@ -160,6 +161,7 @@ var createDefaultSmartPickerAttributes = function createDefaultSmartPickerAttrib
160
161
  productKey: productKey,
161
162
  queryLength: (query || '').length,
162
163
  siteId: siteId,
164
+ orgId: orgId,
163
165
  sessionId: sessionId
164
166
  };
165
167
  };
@@ -15,10 +15,10 @@ export var useUserSource = function useUserSource(accountId, shouldFetchSources,
15
15
  var _useContext = useContext(ExusUserSourceContext),
16
16
  fetchUserSource = _useContext.fetchUserSource;
17
17
 
18
- var _useState = useState(new Set(existingSources)),
18
+ var _useState = useState([]),
19
19
  _useState2 = _slicedToArray(_useState, 2),
20
- sources = _useState2[0],
21
- setUserSources = _useState2[1];
20
+ externalSources = _useState2[0],
21
+ setExternalSources = _useState2[1];
22
22
 
23
23
  var _useState3 = useState(true),
24
24
  _useState4 = _slicedToArray(_useState3, 2),
@@ -50,24 +50,31 @@ export var useUserSource = function useUserSource(accountId, shouldFetchSources,
50
50
  return cleanup;
51
51
  }
52
52
 
53
- if (isMounted) {
54
- fetchUserSource(accountId, abortController === null || abortController === void 0 ? void 0 : abortController.signal).then(function (externalSources) {
55
- setLoading(false);
56
- var externalSourceTypes = externalSources.map(function (source) {
57
- return source.sourceType;
58
- });
59
- setUserSources(new Set([].concat(_toConsumableArray(sources), _toConsumableArray(externalSourceTypes))));
60
- }).catch(function (error) {
61
- setLoading(false);
62
- setError(error);
53
+ fetchUserSource(accountId, abortController === null || abortController === void 0 ? void 0 : abortController.signal).then(function (externalSources) {
54
+ if (!isMounted) {
55
+ return;
56
+ }
57
+
58
+ setLoading(false);
59
+ var externalSourceTypes = externalSources.map(function (source) {
60
+ return source.sourceType;
63
61
  });
64
- }
62
+ setExternalSources(externalSourceTypes);
63
+ }).catch(function (error) {
64
+ if (!isMounted) {
65
+ return;
66
+ }
65
67
 
68
+ setLoading(false);
69
+ setError(error);
70
+ });
66
71
  return cleanup;
67
- }, [fetchUserSource, accountId, sources, abortController, shouldFetchSources]);
68
- return {
69
- sources: Array.from(sources),
70
- loading: loading,
71
- error: error
72
- };
72
+ }, [fetchUserSource, accountId, abortController, shouldFetchSources]);
73
+ return useMemo(function () {
74
+ return {
75
+ sources: Array.from(new Set([].concat(_toConsumableArray(existingSources !== null && existingSources !== void 0 ? existingSources : []), _toConsumableArray(externalSources)))),
76
+ loading: loading,
77
+ error: error
78
+ };
79
+ }, [error, existingSources, externalSources, loading]);
73
80
  };
@@ -9,7 +9,7 @@ import React from 'react';
9
9
  import styled from 'styled-components';
10
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
11
  return props.isLozenge ? 0 : 4;
12
- }, token('color.background.subtleNeutral.resting', N40));
12
+ }, token('color.background.neutral', N40));
13
13
  export var AddOptionAvatar = function AddOptionAvatar(_ref) {
14
14
  var isLozenge = _ref.isLozenge,
15
15
  label = _ref.label;
@@ -18,6 +18,6 @@ export var AddOptionAvatar = function AddOptionAvatar(_ref) {
18
18
  }, /*#__PURE__*/React.createElement(EmailIcon, {
19
19
  label: label,
20
20
  size: isLozenge ? 'small' : 'medium',
21
- primaryColor: token('color.text.mediumEmphasis', N500)
21
+ primaryColor: token('color.text.subtle', N500)
22
22
  }));
23
23
  };
@@ -17,24 +17,20 @@ var AsyncTooltip = /*#__PURE__*/React.lazy(function () {
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.selected', B400), function (_ref) {
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
21
  var secondary = _ref.secondary;
22
- return secondary && "color: ".concat(token('color.text.selected', B400), "; font-size: 0.85em;");
22
+ return secondary && "color: ".concat(token('color.text.brand', B400), "; font-size: 0.85em;");
23
23
  });
24
- var AdditionalInfo = styled.span(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n float: right;\n ", "\n"])), function (_ref2) {
25
- var withTooltip = _ref2.withTooltip;
26
- return withTooltip && " padding-top: 5px;";
27
- });
28
- export var TextWrapper = styled.span(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n color: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n display: inline-block;\n"])), function (_ref3) {
29
- var color = _ref3.color;
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;
30
27
  return color;
31
28
  });
32
- export var AvatarItemOption = function AvatarItemOption(_ref4) {
33
- var avatar = _ref4.avatar,
34
- primaryText = _ref4.primaryText,
35
- secondaryText = _ref4.secondaryText,
36
- lozenge = _ref4.lozenge,
37
- sourcesInfoTooltip = _ref4.sourcesInfoTooltip;
29
+ export var AvatarItemOption = function AvatarItemOption(_ref3) {
30
+ var avatar = _ref3.avatar,
31
+ primaryText = _ref3.primaryText,
32
+ secondaryText = _ref3.secondaryText,
33
+ lozenge = _ref3.lozenge;
38
34
  return /*#__PURE__*/React.createElement(Wrapper, null, avatar, /*#__PURE__*/React.createElement("div", {
39
35
  style: {
40
36
  maxWidth: '100%',
@@ -43,9 +39,7 @@ export var AvatarItemOption = function AvatarItemOption(_ref4) {
43
39
  lineHeight: '1.4',
44
40
  paddingLeft: '8px'
45
41
  }
46
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Text, null, primaryText), /*#__PURE__*/React.createElement(AdditionalInfo, {
47
- withTooltip: Boolean(sourcesInfoTooltip)
48
- }, !sourcesInfoTooltip && (lozenge === null || lozenge === void 0 ? void 0 : lozenge.text) && (lozenge !== null && lozenge !== void 0 && lozenge.tooltip ?
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 ?
49
43
  /*#__PURE__*/
50
44
  // Note that entire Lozenge must be wrapped in the Tooltip (rather than just the
51
45
  // Lozenge text) or tooltip won't work
@@ -53,7 +47,7 @@ export var AvatarItemOption = function AvatarItemOption(_ref4) {
53
47
  fallback: /*#__PURE__*/React.createElement(Lozenge, lozenge, lozenge.text)
54
48
  }, /*#__PURE__*/React.createElement(AsyncTooltip, {
55
49
  content: lozenge.tooltip
56
- }, /*#__PURE__*/React.createElement(Lozenge, lozenge, lozenge.text))) : /*#__PURE__*/React.createElement(Lozenge, lozenge, lozenge.text)), sourcesInfoTooltip)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Text, {
50
+ }, /*#__PURE__*/React.createElement(Lozenge, lozenge, lozenge.text))) : /*#__PURE__*/React.createElement(Lozenge, lozenge, lozenge.text)))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Text, {
57
51
  secondary: true
58
52
  }, secondaryText))));
59
53
  };
@@ -48,13 +48,13 @@ export var EmailOption = /*#__PURE__*/function (_React$PureComponent) {
48
48
  var id = _this.props.email.id;
49
49
  return /*#__PURE__*/React.createElement(TextWrapper, {
50
50
  key: "name",
51
- color: _this.props.isSelected ? token('color.text.selected', B400) : token('color.text.highEmphasis', N800)
51
+ color: _this.props.isSelected ? token('color.text.brand', B400) : token('color.text', N800)
52
52
  }, id);
53
53
  });
54
54
 
55
55
  _defineProperty(_assertThisInitialized(_this), "renderSecondaryText", function (label) {
56
56
  return /*#__PURE__*/React.createElement(TextWrapper, {
57
- color: _this.props.isSelected ? token('color.text.selected', B400) : token('color.text.lowEmphasis', N200)
57
+ color: _this.props.isSelected ? token('color.text.brand', B400) : token('color.text.subtlest', N200)
58
58
  }, label);
59
59
  });
60
60
 
@@ -0,0 +1,24 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
+
3
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
4
+
5
+ import React from 'react';
6
+ import styled from 'styled-components';
7
+ import { B400 } from '@atlaskit/theme/colors';
8
+ import { token } from '@atlaskit/tokens';
9
+ var OuterWrapper = styled.div(_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"])));
10
+ var DetailsWrapper = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n max-width: 100%;\n min-width: 0;\n flex: 1 1 100%;\n line-height: 1.4;\n padding-left: 8px;\n align-items: center;\n"])));
11
+ var TextSection = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: calc(100% - 32px);\n flex: auto;\n"])));
12
+ var Text = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n max-width: 100%;\n margin: 0;\n color: ", ";\n ", "\n white-space: nowrap;\n\n > span {\n max-width: inherit;\n }\n"])), token('color.text.selected', B400), function (_ref) {
13
+ var secondary = _ref.secondary;
14
+ return secondary && "color: ".concat(token('color.text.selected', B400), "; font-size: 0.85em;");
15
+ });
16
+ export var ExternalAvatarItemOption = function ExternalAvatarItemOption(_ref2) {
17
+ var avatar = _ref2.avatar,
18
+ primaryText = _ref2.primaryText,
19
+ secondaryText = _ref2.secondaryText,
20
+ sourcesInfoTooltip = _ref2.sourcesInfoTooltip;
21
+ return /*#__PURE__*/React.createElement(OuterWrapper, null, avatar, /*#__PURE__*/React.createElement(DetailsWrapper, null, /*#__PURE__*/React.createElement(TextSection, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Text, null, primaryText)), secondaryText && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Text, {
22
+ secondary: true
23
+ }, secondaryText))), /*#__PURE__*/React.createElement("div", null, sourcesInfoTooltip)));
24
+ };
@@ -0,0 +1,33 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
3
+
4
+ var _templateObject;
5
+
6
+ import React, { useCallback, useState } from 'react';
7
+ import styled from 'styled-components';
8
+ import EditorPanelIcon from '@atlaskit/icon/glyph/editor/panel';
9
+ import { N50, N200 } from '@atlaskit/theme/colors';
10
+ import { token } from '@atlaskit/tokens';
11
+ var Wrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n"])));
12
+ export default (function () {
13
+ var _useState = useState(false),
14
+ _useState2 = _slicedToArray(_useState, 2),
15
+ isMouseHovered = _useState2[0],
16
+ setHoverState = _useState2[1];
17
+
18
+ var onMouseEnter = useCallback(function () {
19
+ return setHoverState(true);
20
+ }, [setHoverState]);
21
+ var onMouseLeave = useCallback(function () {
22
+ return setHoverState(false);
23
+ }, [setHoverState]);
24
+ return /*#__PURE__*/React.createElement(Wrapper, {
25
+ onMouseEnter: onMouseEnter,
26
+ onMouseLeave: onMouseLeave
27
+ }, /*#__PURE__*/React.createElement(EditorPanelIcon, {
28
+ testId: "source-icon",
29
+ label: "",
30
+ size: "large",
31
+ primaryColor: token('color.text.lowEmphasis', isMouseHovered ? N200 : N50)
32
+ }));
33
+ });
@@ -14,24 +14,27 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
14
14
 
15
15
  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
16
 
17
+ import React from 'react';
18
+ import { FormattedMessage } from 'react-intl-next';
19
+ import styled from 'styled-components';
20
+ import { ConfluenceIcon } from '@atlaskit/logo/confluence-icon';
21
+ import { JiraIcon } from '@atlaskit/logo/jira-icon';
22
+ import Spinner from '@atlaskit/spinner';
17
23
  import { B400, N200, N800 } from '@atlaskit/theme/colors';
18
24
  import { token } from '@atlaskit/tokens';
19
- import React from 'react';
20
- import { AvatarItemOption, TextWrapper } from '../AvatarItemOption';
21
- import { SizeableAvatar } from '../SizeableAvatar';
22
- import EditorPanelIcon from '@atlaskit/icon/glyph/editor/panel';
23
25
  import Tooltip from '@atlaskit/tooltip';
24
- import Spinner from '@atlaskit/spinner';
25
- import styled from 'styled-components';
26
+ import { TextWrapper } from '../AvatarItemOption';
27
+ import { SizeableAvatar } from '../SizeableAvatar';
26
28
  import { SlackIcon } from '../assets/slack';
27
29
  import { GoogleIcon } from '../assets/google';
28
30
  import { MicrosoftIcon } from '../assets/microsoft';
29
31
  import { GitHubIcon } from '../assets/github';
30
- import { FormattedMessage } from 'react-intl-next';
31
32
  import { messages } from '../i18n';
32
33
  import { ExternalUserSourcesContainer } from '../ExternalUserSourcesContainer';
33
- export var ImageContainer = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 12px;\n width: 12px;\n padding-right: 4px;\n"])));
34
- export var SourcesTooltipContainer = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding-bottom: 4px;\n"])));
34
+ import InfoIcon from './InfoIcon';
35
+ import { ExternalAvatarItemOption } from './ExternalAvatarItemOption';
36
+ export var ImageContainer = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 16px;\n width: 16px;\n padding-right: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n"])));
37
+ export var SourcesTooltipContainer = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding-bottom: 4px;\n padding-right: 4px;\n"])));
35
38
  export var SourceWrapper = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding-top: 4px;\n display: flex;\n align-items: center;\n"])));
36
39
  export var EmailDomainWrapper = styled.span(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n font-weight: bold;\n"])));
37
40
  var SourcesInfoMap = new Map([['slack', {
@@ -50,6 +53,18 @@ var SourcesInfoMap = new Map([['slack', {
50
53
  key: 'github',
51
54
  icon: /*#__PURE__*/React.createElement(GitHubIcon, null),
52
55
  label: messages.gitHubProvider
56
+ }], ['jira', {
57
+ key: 'jira',
58
+ icon: /*#__PURE__*/React.createElement(JiraIcon, {
59
+ size: 'xsmall'
60
+ }),
61
+ label: messages.jiraSource
62
+ }], ['confluence', {
63
+ key: 'confluence',
64
+ icon: /*#__PURE__*/React.createElement(ConfluenceIcon, {
65
+ size: 'xsmall'
66
+ }),
67
+ label: messages.confluenceSource
53
68
  }]]);
54
69
  export var ExternalUserOption = /*#__PURE__*/function (_React$PureComponent) {
55
70
  _inherits(ExternalUserOption, _React$PureComponent);
@@ -71,7 +86,7 @@ export var ExternalUserOption = /*#__PURE__*/function (_React$PureComponent) {
71
86
  var name = _this.props.user.name;
72
87
  return /*#__PURE__*/React.createElement(TextWrapper, {
73
88
  key: "name",
74
- color: _this.props.isSelected ? token('color.text.selected', B400) : token('color.text.highEmphasis', N800)
89
+ color: _this.props.isSelected ? token('color.text.brand', B400) : token('color.text', N800)
75
90
  }, name);
76
91
  });
77
92
 
@@ -89,7 +104,7 @@ export var ExternalUserOption = /*#__PURE__*/function (_React$PureComponent) {
89
104
 
90
105
  var emailDomainWithAt = "@".concat(emailDomain);
91
106
  return /*#__PURE__*/React.createElement(TextWrapper, {
92
- color: _this.props.isSelected ? token('color.text.selected', B400) : token('color.text.lowEmphasis', N200)
107
+ color: _this.props.isSelected ? token('color.text.brand', B400) : token('color.text.subtlest', N200)
93
108
  }, emailUser, /*#__PURE__*/React.createElement(EmailDomainWrapper, null, emailDomainWithAt));
94
109
  });
95
110
 
@@ -111,12 +126,7 @@ export var ExternalUserOption = /*#__PURE__*/function (_React$PureComponent) {
111
126
  return _this.props.user.isExternal ? /*#__PURE__*/React.createElement(Tooltip, {
112
127
  content: _this.formattedTooltipContent(),
113
128
  position: 'right-start'
114
- }, /*#__PURE__*/React.createElement(EditorPanelIcon, {
115
- testId: "source-icon",
116
- label: "",
117
- size: "large",
118
- primaryColor: token('color.text.lowEmphasis', N200)
119
- })) : undefined;
129
+ }, /*#__PURE__*/React.createElement(InfoIcon, null)) : undefined;
120
130
  });
121
131
 
122
132
  return _this;
@@ -125,7 +135,7 @@ export var ExternalUserOption = /*#__PURE__*/function (_React$PureComponent) {
125
135
  _createClass(ExternalUserOption, [{
126
136
  key: "render",
127
137
  value: function render() {
128
- return /*#__PURE__*/React.createElement(AvatarItemOption, {
138
+ return /*#__PURE__*/React.createElement(ExternalAvatarItemOption, {
129
139
  avatar: this.renderAvatar(),
130
140
  primaryText: this.getPrimaryText(),
131
141
  secondaryText: this.renderSecondaryText(),
@@ -4,8 +4,7 @@ export var ExternalUserSourcesContainer = function ExternalUserSourcesContainer(
4
4
  var children = _ref.children,
5
5
  accountId = _ref.accountId,
6
6
  shouldFetchSources = _ref.shouldFetchSources,
7
- _ref$initialSources = _ref.initialSources,
8
- initialSources = _ref$initialSources === void 0 ? [] : _ref$initialSources;
7
+ initialSources = _ref.initialSources;
9
8
 
10
9
  var _useUserSource = useUserSource(accountId, shouldFetchSources, initialSources),
11
10
  sources = _useUserSource.sources,
@@ -22,7 +22,7 @@ import PeopleIcon from '@atlaskit/icon/glyph/people';
22
22
  import { AvatarItemOption, TextWrapper } from '.././AvatarItemOption';
23
23
  import { messages } from '.././i18n';
24
24
  import { HighlightText } from '.././HighlightText';
25
- export var GroupOptionIconWrapper = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 2px;\n\n > span {\n background-color: ", ";\n border-radius: 50%;\n padding: 4px;\n }\n"])), token('color.background.subtleNeutral.resting', N20));
25
+ export var GroupOptionIconWrapper = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 2px;\n\n > span {\n background-color: ", ";\n border-radius: 50%;\n padding: 4px;\n }\n"])), token('color.background.neutral', N20));
26
26
  export var GroupOption = /*#__PURE__*/function (_React$PureComponent) {
27
27
  _inherits(GroupOption, _React$PureComponent);
28
28
 
@@ -47,7 +47,7 @@ export var GroupOption = /*#__PURE__*/function (_React$PureComponent) {
47
47
  highlight = _this$props$group.highlight;
48
48
  return [/*#__PURE__*/React.createElement(TextWrapper, {
49
49
  key: "name",
50
- color: isSelected ? token('color.text.selected', B400) : token('color.text.highEmphasis', N800)
50
+ color: isSelected ? token('color.text.brand', B400) : token('color.text', N800)
51
51
  }, /*#__PURE__*/React.createElement(HighlightText, {
52
52
  highlights: highlight && highlight.name
53
53
  }, name))];
@@ -63,7 +63,7 @@ export var GroupOption = /*#__PURE__*/function (_React$PureComponent) {
63
63
  _defineProperty(_assertThisInitialized(_this), "renderByline", function () {
64
64
  var isSelected = _this.props.isSelected;
65
65
  return /*#__PURE__*/React.createElement(TextWrapper, {
66
- color: isSelected ? token('color.text.selected', B400) : token('color.text.lowEmphasis', N200)
66
+ color: isSelected ? token('color.text.brand', B400) : token('color.text.subtlest', N200)
67
67
  }, /*#__PURE__*/React.createElement(FormattedMessage, messages.groupByline));
68
68
  });
69
69
 
@@ -25,8 +25,8 @@ var innerHeight = spacing * 2; // 16px
25
25
  var lineHeight = innerHeight / fontSize;
26
26
  var ControlWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n padding: 0px ", "px ", "px;\n"])), spacing, spacing);
27
27
  var getColor = themed({
28
- light: token('color.text.lowEmphasis', N200),
29
- dark: token('color.text.lowEmphasis', DN90)
28
+ light: token('color.text.subtlest', N200),
29
+ dark: token('color.text.subtlest', DN90)
30
30
  });
31
31
 
32
32
  var getPadding = function getPadding() {
@@ -41,7 +41,7 @@ export var TeamOption = /*#__PURE__*/function (_React$PureComponent) {
41
41
  highlight = _this$props$team.highlight;
42
42
  return [/*#__PURE__*/React.createElement(TextWrapper, {
43
43
  key: "name",
44
- color: _this.props.isSelected ? token('color.text.selected', B400) : token('color.text.highEmphasis', N800)
44
+ color: _this.props.isSelected ? token('color.text.brand', B400) : token('color.text', N800)
45
45
  }, /*#__PURE__*/React.createElement(HighlightText, {
46
46
  highlights: highlight && highlight.name
47
47
  }, name))];
@@ -83,7 +83,7 @@ export var TeamOption = /*#__PURE__*/function (_React$PureComponent) {
83
83
 
84
84
  _defineProperty(_assertThisInitialized(_this), "getBylineComponent", function (isSelected, message) {
85
85
  return /*#__PURE__*/React.createElement(TextWrapper, {
86
- color: isSelected ? token('color.text.selected', B400) : token('color.text.lowEmphasis', N200)
86
+ color: isSelected ? token('color.text.brand', B400) : token('color.text.subtlest', N200)
87
87
  }, message);
88
88
  });
89
89
 
@@ -40,7 +40,7 @@ export var UserOption = /*#__PURE__*/function (_React$PureComponent) {
40
40
  highlight = _this$props$user.highlight;
41
41
  var result = [/*#__PURE__*/React.createElement(TextWrapper, {
42
42
  key: "name",
43
- color: _this.props.isSelected ? token('color.text.selected', B400) : token('color.text.highEmphasis', N800)
43
+ color: _this.props.isSelected ? token('color.text.brand', B400) : token('color.text', N800)
44
44
  }, /*#__PURE__*/React.createElement(HighlightText, {
45
45
  highlights: highlight && highlight.name
46
46
  }, name))];
@@ -49,7 +49,7 @@ export var UserOption = /*#__PURE__*/function (_React$PureComponent) {
49
49
  result.push( /*#__PURE__*/React.createElement(React.Fragment, {
50
50
  key: "publicName"
51
51
  }, ' ', /*#__PURE__*/React.createElement(TextWrapper, {
52
- color: _this.props.isSelected ? token('color.text.selected', B400) : token('color.text.lowEmphasis', N200)
52
+ color: _this.props.isSelected ? token('color.text.brand', B400) : token('color.text.subtlest', N200)
53
53
  }, "(", /*#__PURE__*/React.createElement(HighlightText, {
54
54
  highlights: highlight && highlight.publicName
55
55
  }, publicName), ")")));
@@ -60,7 +60,7 @@ export var UserOption = /*#__PURE__*/function (_React$PureComponent) {
60
60
 
61
61
  _defineProperty(_assertThisInitialized(_this), "renderSecondaryText", function () {
62
62
  return _this.props.user.byline ? /*#__PURE__*/React.createElement(TextWrapper, {
63
- color: _this.props.isSelected ? token('color.text.selected', B400) : token('color.text.lowEmphasis', N200)
63
+ color: _this.props.isSelected ? token('color.text.brand', B400) : token('color.text.subtlest', N200)
64
64
  }, _this.props.user.byline) : undefined;
65
65
  });
66
66
 
@@ -12,6 +12,6 @@ export function GitHubIcon(props) {
12
12
  fillRule: "evenodd",
13
13
  clipRule: "evenodd",
14
14
  d: "M11.9778 0C5.3635 0 0 5.45261 0 12.179C0 17.5601 3.432 22.1253 8.19114 23.7357C8.78975 23.8484 9.00952 23.4715 9.00952 23.1498C9.00952 22.8594 8.99841 21.9 8.99326 20.8823C5.66103 21.6191 4.95789 19.4454 4.95789 19.4454C4.41303 18.0376 3.62796 17.6633 3.62796 17.6633C2.54122 16.9074 3.70988 16.923 3.70988 16.923C4.91266 17.0089 5.54598 18.178 5.54598 18.178C6.61428 20.0399 8.34803 19.5016 9.03154 19.1904C9.13904 18.4033 9.44945 17.866 9.792 17.5619C7.13157 17.2539 4.33487 16.2096 4.33487 11.5429C4.33487 10.2133 4.80278 9.12682 5.56899 8.27391C5.44463 7.96716 5.03464 6.72844 5.68502 5.05087C5.68502 5.05087 6.69084 4.72354 8.97976 6.29927C9.9352 6.02942 10.9599 5.89409 11.9778 5.88945C12.9957 5.89409 14.0212 6.02942 14.9784 6.29927C17.2645 4.72354 18.269 5.05087 18.269 5.05087C18.9209 6.72844 18.5107 7.96716 18.3864 8.27391C19.1544 9.12682 19.6191 10.2133 19.6191 11.5429C19.6191 16.2207 16.8171 17.2507 14.1499 17.5522C14.5795 17.9301 14.9623 18.6713 14.9623 19.8076C14.9623 21.4371 14.9484 22.7487 14.9484 23.1498C14.9484 23.4739 15.164 23.8537 15.7712 23.7341C20.5277 22.1219 23.9554 17.5582 23.9554 12.179C23.9554 5.45261 18.5927 0 11.9778 0Z",
15
- fill: token('color.text.onBold', 'white')
15
+ fill: token('color.text.inverse', 'white')
16
16
  }));
17
17
  }
@@ -12,21 +12,21 @@ export function GoogleIcon(props) {
12
12
  fillRule: "evenodd",
13
13
  clipRule: "evenodd",
14
14
  d: "M8.32062 3.21332L10.014 1.55999C8.97396 0.593331 7.62063 0 6.00062 0C3.65396 0 1.62729 1.34666 0.640625 3.30665L2.58062 4.81331C3.06729 3.36665 4.41396 2.31999 6.00062 2.31999C7.12729 2.31999 7.88729 2.80665 8.32062 3.21332Z",
15
- fill: token('color.text.onBold', 'white')
15
+ fill: token('color.text.inverse', 'white')
16
16
  }), /*#__PURE__*/React.createElement("path", {
17
17
  fillRule: "evenodd",
18
18
  clipRule: "evenodd",
19
19
  d: "M11.76 6.13291C11.76 5.63958 11.72 5.27958 11.6333 4.90625H6V7.13291H9.30667C9.24 7.68624 8.88 8.51957 8.08 9.07957L9.97333 10.5462C11.1067 9.49956 11.76 7.95957 11.76 6.13291V6.13291V6.13291Z",
20
- fill: token('color.text.onBold', 'white')
20
+ fill: token('color.text.inverse', 'white')
21
21
  }), /*#__PURE__*/React.createElement("path", {
22
22
  fillRule: "evenodd",
23
23
  clipRule: "evenodd",
24
24
  d: "M2.58667 7.18662C2.46 6.81329 2.38667 6.41329 2.38667 5.99996C2.38667 5.58663 2.46 5.18663 2.58 4.8133L0.64 3.30664C0.233333 4.11997 0 5.0333 0 5.99996C0 6.96662 0.233333 7.87995 0.64 8.69328L2.58667 7.18662V7.18662Z",
25
- fill: token('color.text.onBold', 'white')
25
+ fill: token('color.text.inverse', 'white')
26
26
  }), /*#__PURE__*/React.createElement("path", {
27
27
  fillRule: "evenodd",
28
28
  clipRule: "evenodd",
29
29
  d: "M6.00079 12.0008C7.62079 12.0008 8.98079 11.4675 9.97413 10.5475L8.08079 9.08083C7.57413 9.43416 6.89413 9.68082 6.00079 9.68082C4.41413 9.68082 3.06746 8.63416 2.58746 7.1875L0.647461 8.69416C1.63413 10.6542 3.65413 12.0008 6.00079 12.0008V12.0008V12.0008Z",
30
- fill: token('color.text.onBold', 'white')
30
+ fill: token('color.text.inverse', 'white')
31
31
  }));
32
32
  }