@atlaskit/user-picker 8.0.0 → 8.3.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.
- package/CHANGELOG.md +27 -0
- package/dist/cjs/clients/UserSourceProvider.js +97 -0
- package/dist/cjs/components/AddOptionAvatar.js +5 -3
- package/dist/cjs/components/AvatarItemOption.js +25 -7
- package/dist/cjs/components/ClearIndicator.js +25 -6
- package/dist/cjs/components/EmailOption/index.js +29 -0
- package/dist/cjs/components/{EmailOption.js → EmailOption/main.js} +7 -5
- package/dist/cjs/components/ExternalUserOption/index.js +29 -0
- package/dist/cjs/components/{ExternalUserOption.js → ExternalUserOption/main.js} +44 -25
- package/dist/cjs/components/ExternalUserSourcesContainer.js +42 -0
- package/dist/cjs/components/GroupOption/index.js +29 -0
- package/dist/cjs/components/{GroupOption.js → GroupOption/main.js} +8 -6
- package/dist/cjs/components/MessagesIntlProvider.js +3 -4
- package/dist/cjs/components/Option.js +26 -13
- package/dist/cjs/components/PopupControl.js +4 -2
- package/dist/cjs/components/TeamOption/index.js +29 -0
- package/dist/cjs/components/{TeamOption.js → TeamOption/main.js} +8 -6
- package/dist/cjs/components/UserOption.js +5 -3
- package/dist/cjs/components/UserPicker.js +8 -3
- package/dist/cjs/components/assets/github.js +3 -1
- package/dist/cjs/components/assets/google.js +6 -4
- package/dist/cjs/components/assets/microsoft.js +7 -5
- package/dist/cjs/components/assets/slack.js +11 -9
- package/dist/cjs/components/i18n.js +5 -0
- package/dist/cjs/components/styles.js +9 -7
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/clients/UserSourceProvider.js +56 -0
- package/dist/es2019/components/AddOptionAvatar.js +3 -3
- package/dist/es2019/components/AvatarItemOption.js +15 -6
- package/dist/es2019/components/ClearIndicator.js +14 -5
- package/dist/es2019/components/EmailOption/index.js +9 -0
- package/dist/es2019/components/{EmailOption.js → EmailOption/main.js} +6 -5
- package/dist/es2019/components/ExternalUserOption/index.js +9 -0
- package/dist/es2019/components/{ExternalUserOption.js → ExternalUserOption/main.js} +39 -23
- package/dist/es2019/components/ExternalUserSourcesContainer.js +27 -0
- package/dist/es2019/components/GroupOption/index.js +9 -0
- package/dist/es2019/components/{GroupOption.js → GroupOption/main.js} +7 -6
- package/dist/es2019/components/MessagesIntlProvider.js +3 -3
- package/dist/es2019/components/Option.js +23 -9
- package/dist/es2019/components/PopupControl.js +3 -2
- package/dist/es2019/components/TeamOption/index.js +9 -0
- package/dist/es2019/components/{TeamOption.js → TeamOption/main.js} +7 -6
- package/dist/es2019/components/UserOption.js +4 -3
- package/dist/es2019/components/UserPicker.js +7 -3
- package/dist/es2019/components/assets/github.js +2 -1
- package/dist/es2019/components/assets/google.js +5 -4
- package/dist/es2019/components/assets/microsoft.js +6 -5
- package/dist/es2019/components/assets/slack.js +10 -9
- package/dist/es2019/components/i18n.js +5 -0
- package/dist/es2019/components/styles.js +8 -7
- package/dist/es2019/version.json +1 -1
- package/dist/esm/clients/UserSourceProvider.js +73 -0
- package/dist/esm/components/AddOptionAvatar.js +4 -3
- package/dist/esm/components/AvatarItemOption.js +17 -6
- package/dist/esm/components/ClearIndicator.js +16 -5
- package/dist/esm/components/EmailOption/index.js +11 -0
- package/dist/esm/components/{EmailOption.js → EmailOption/main.js} +6 -5
- package/dist/esm/components/ExternalUserOption/index.js +11 -0
- package/dist/esm/components/{ExternalUserOption.js → ExternalUserOption/main.js} +41 -25
- package/dist/esm/components/ExternalUserSourcesContainer.js +29 -0
- package/dist/esm/components/GroupOption/index.js +11 -0
- package/dist/esm/components/{GroupOption.js → GroupOption/main.js} +7 -6
- package/dist/esm/components/MessagesIntlProvider.js +4 -4
- package/dist/esm/components/Option.js +25 -12
- package/dist/esm/components/PopupControl.js +3 -2
- package/dist/esm/components/TeamOption/index.js +11 -0
- package/dist/esm/components/{TeamOption.js → TeamOption/main.js} +7 -6
- package/dist/esm/components/UserOption.js +4 -3
- package/dist/esm/components/UserPicker.js +7 -3
- package/dist/esm/components/assets/github.js +2 -1
- package/dist/esm/components/assets/google.js +5 -4
- package/dist/esm/components/assets/microsoft.js +6 -5
- package/dist/esm/components/assets/slack.js +10 -9
- package/dist/esm/components/i18n.js +5 -0
- package/dist/esm/components/styles.js +8 -7
- package/dist/esm/version.json +1 -1
- package/dist/types/clients/UserSourceProvider.d.ts +11 -0
- package/dist/types/components/BaseUserPicker.d.ts +1 -1
- package/dist/types/components/EmailOption/index.d.ts +3 -0
- package/dist/types/components/{EmailOption.d.ts → EmailOption/main.d.ts} +2 -2
- package/dist/types/components/ExternalUserOption/index.d.ts +3 -0
- package/dist/types/components/{ExternalUserOption.d.ts → ExternalUserOption/main.d.ts} +1 -1
- package/dist/types/components/ExternalUserSourcesContainer.d.ts +14 -0
- package/dist/types/components/GroupOption/index.d.ts +3 -0
- package/dist/types/components/{GroupOption.d.ts → GroupOption/main.d.ts} +1 -1
- package/dist/types/components/MessagesIntlProvider.d.ts +2 -8
- package/dist/types/components/Option.d.ts +4 -1
- package/dist/types/components/PopupUserPicker.d.ts +1 -1
- package/dist/types/components/TeamOption/index.d.ts +3 -0
- package/dist/types/components/{TeamOption.d.ts → TeamOption/main.d.ts} +1 -1
- package/dist/types/components/UserPicker.d.ts +1 -1
- package/dist/types/components/i18n.d.ts +5 -0
- package/dist/types/types.d.ts +14 -0
- package/package.json +15 -2
|
@@ -12,12 +12,13 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
12
12
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
13
|
|
|
14
14
|
import { B400, N800, N200 } from '@atlaskit/theme/colors';
|
|
15
|
+
import { token } from '@atlaskit/tokens';
|
|
15
16
|
import React from 'react';
|
|
16
17
|
import { FormattedMessage } from 'react-intl-next';
|
|
17
|
-
import { AvatarItemOption, TextWrapper } from '
|
|
18
|
-
import { HighlightText } from '
|
|
19
|
-
import { messages } from '
|
|
20
|
-
import { SizeableAvatar } from '
|
|
18
|
+
import { AvatarItemOption, TextWrapper } from '.././AvatarItemOption';
|
|
19
|
+
import { HighlightText } from '.././HighlightText';
|
|
20
|
+
import { messages } from '.././i18n';
|
|
21
|
+
import { SizeableAvatar } from '.././SizeableAvatar';
|
|
21
22
|
export var TeamOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
22
23
|
_inherits(TeamOption, _React$PureComponent);
|
|
23
24
|
|
|
@@ -40,7 +41,7 @@ export var TeamOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
40
41
|
highlight = _this$props$team.highlight;
|
|
41
42
|
return [/*#__PURE__*/React.createElement(TextWrapper, {
|
|
42
43
|
key: "name",
|
|
43
|
-
color: _this.props.isSelected ? B400 : N800
|
|
44
|
+
color: _this.props.isSelected ? token('color.text.selected', B400) : token('color.text.highEmphasis', N800)
|
|
44
45
|
}, /*#__PURE__*/React.createElement(HighlightText, {
|
|
45
46
|
highlights: highlight && highlight.name
|
|
46
47
|
}, name))];
|
|
@@ -82,7 +83,7 @@ export var TeamOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
82
83
|
|
|
83
84
|
_defineProperty(_assertThisInitialized(_this), "getBylineComponent", function (isSelected, message) {
|
|
84
85
|
return /*#__PURE__*/React.createElement(TextWrapper, {
|
|
85
|
-
color: isSelected ? B400 : N200
|
|
86
|
+
color: isSelected ? token('color.text.selected', B400) : token('color.text.lowEmphasis', N200)
|
|
86
87
|
}, message);
|
|
87
88
|
});
|
|
88
89
|
|
|
@@ -11,6 +11,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
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
13
|
import { B400, N800, N200 } from '@atlaskit/theme/colors';
|
|
14
|
+
import { token } from '@atlaskit/tokens';
|
|
14
15
|
import React from 'react';
|
|
15
16
|
import { AvatarItemOption, TextWrapper } from './AvatarItemOption';
|
|
16
17
|
import { HighlightText } from './HighlightText';
|
|
@@ -39,7 +40,7 @@ export var UserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
39
40
|
highlight = _this$props$user.highlight;
|
|
40
41
|
var result = [/*#__PURE__*/React.createElement(TextWrapper, {
|
|
41
42
|
key: "name",
|
|
42
|
-
color: _this.props.isSelected ? B400 : N800
|
|
43
|
+
color: _this.props.isSelected ? token('color.text.selected', B400) : token('color.text.highEmphasis', N800)
|
|
43
44
|
}, /*#__PURE__*/React.createElement(HighlightText, {
|
|
44
45
|
highlights: highlight && highlight.name
|
|
45
46
|
}, name))];
|
|
@@ -48,7 +49,7 @@ export var UserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
48
49
|
result.push( /*#__PURE__*/React.createElement(React.Fragment, {
|
|
49
50
|
key: "publicName"
|
|
50
51
|
}, ' ', /*#__PURE__*/React.createElement(TextWrapper, {
|
|
51
|
-
color: _this.props.isSelected ? B400 : N200
|
|
52
|
+
color: _this.props.isSelected ? token('color.text.selected', B400) : token('color.text.lowEmphasis', N200)
|
|
52
53
|
}, "(", /*#__PURE__*/React.createElement(HighlightText, {
|
|
53
54
|
highlights: highlight && highlight.publicName
|
|
54
55
|
}, publicName), ")")));
|
|
@@ -59,7 +60,7 @@ export var UserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
59
60
|
|
|
60
61
|
_defineProperty(_assertThisInitialized(_this), "renderSecondaryText", function () {
|
|
61
62
|
return _this.props.user.byline ? /*#__PURE__*/React.createElement(TextWrapper, {
|
|
62
|
-
color: _this.props.isSelected ? B400 : N200
|
|
63
|
+
color: _this.props.isSelected ? token('color.text.selected', B400) : token('color.text.lowEmphasis', N200)
|
|
63
64
|
}, _this.props.user.byline) : undefined;
|
|
64
65
|
});
|
|
65
66
|
|
|
@@ -23,6 +23,7 @@ import { getComponents } from './components';
|
|
|
23
23
|
import { getCreatableProps } from './creatable';
|
|
24
24
|
import { getCreatableSuggestedEmailProps } from './creatableEmailSuggestion';
|
|
25
25
|
import MessagesIntlProvider from './MessagesIntlProvider';
|
|
26
|
+
import { ExusUserSourceProvider } from './../clients/UserSourceProvider';
|
|
26
27
|
export var UserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
|
|
27
28
|
_inherits(UserPickerWithoutAnalytics, _React$Component);
|
|
28
29
|
|
|
@@ -48,7 +49,8 @@ export var UserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component)
|
|
|
48
49
|
menuPosition = _this$props.menuPosition,
|
|
49
50
|
menuShouldBlockScroll = _this$props.menuShouldBlockScroll,
|
|
50
51
|
captureMenuScroll = _this$props.captureMenuScroll,
|
|
51
|
-
closeMenuOnScroll = _this$props.closeMenuOnScroll
|
|
52
|
+
closeMenuOnScroll = _this$props.closeMenuOnScroll,
|
|
53
|
+
loadUserSource = _this$props.loadUserSource;
|
|
52
54
|
var width = this.props.width;
|
|
53
55
|
var SelectComponent = allowEmail ? CreatableSelect : Select;
|
|
54
56
|
var creatableProps = suggestEmailsForDomain ? getCreatableSuggestedEmailProps(suggestEmailsForDomain, isValidEmail) : getCreatableProps(isValidEmail);
|
|
@@ -62,13 +64,15 @@ export var UserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component)
|
|
|
62
64
|
var pickerProps = allowEmail ? _objectSpread(_objectSpread(_objectSpread({}, defaultPickerProps), creatableProps), {}, {
|
|
63
65
|
emailLabel: emailLabel
|
|
64
66
|
}) : _objectSpread({}, defaultPickerProps);
|
|
65
|
-
return /*#__PURE__*/React.createElement(MessagesIntlProvider, null, /*#__PURE__*/React.createElement(
|
|
67
|
+
return /*#__PURE__*/React.createElement(MessagesIntlProvider, null, /*#__PURE__*/React.createElement(ExusUserSourceProvider, {
|
|
68
|
+
fetchUserSource: loadUserSource
|
|
69
|
+
}, /*#__PURE__*/React.createElement(BaseUserPickerWithoutAnalytics, _extends({}, this.props, {
|
|
66
70
|
width: width,
|
|
67
71
|
SelectComponent: SelectComponent,
|
|
68
72
|
styles: getStyles(width, isMulti, this.props.styles),
|
|
69
73
|
components: getComponents(isMulti, anchor),
|
|
70
74
|
pickerProps: pickerProps
|
|
71
|
-
})));
|
|
75
|
+
}))));
|
|
72
76
|
}
|
|
73
77
|
}]);
|
|
74
78
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { token } from '@atlaskit/tokens';
|
|
3
4
|
export function GitHubIcon(props) {
|
|
4
5
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
5
6
|
width: "12",
|
|
@@ -11,6 +12,6 @@ export function GitHubIcon(props) {
|
|
|
11
12
|
fillRule: "evenodd",
|
|
12
13
|
clipRule: "evenodd",
|
|
13
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",
|
|
14
|
-
fill:
|
|
15
|
+
fill: token('color.text.onBold', 'white')
|
|
15
16
|
}));
|
|
16
17
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { token } from '@atlaskit/tokens';
|
|
3
4
|
export function GoogleIcon(props) {
|
|
4
5
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
5
6
|
width: "12",
|
|
@@ -11,21 +12,21 @@ export function GoogleIcon(props) {
|
|
|
11
12
|
fillRule: "evenodd",
|
|
12
13
|
clipRule: "evenodd",
|
|
13
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",
|
|
14
|
-
fill:
|
|
15
|
+
fill: token('color.text.onBold', 'white')
|
|
15
16
|
}), /*#__PURE__*/React.createElement("path", {
|
|
16
17
|
fillRule: "evenodd",
|
|
17
18
|
clipRule: "evenodd",
|
|
18
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",
|
|
19
|
-
fill:
|
|
20
|
+
fill: token('color.text.onBold', 'white')
|
|
20
21
|
}), /*#__PURE__*/React.createElement("path", {
|
|
21
22
|
fillRule: "evenodd",
|
|
22
23
|
clipRule: "evenodd",
|
|
23
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",
|
|
24
|
-
fill:
|
|
25
|
+
fill: token('color.text.onBold', 'white')
|
|
25
26
|
}), /*#__PURE__*/React.createElement("path", {
|
|
26
27
|
fillRule: "evenodd",
|
|
27
28
|
clipRule: "evenodd",
|
|
28
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",
|
|
29
|
-
fill:
|
|
30
|
+
fill: token('color.text.onBold', 'white')
|
|
30
31
|
}));
|
|
31
32
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { token } from '@atlaskit/tokens';
|
|
3
4
|
export function MicrosoftIcon(props) {
|
|
4
5
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
5
6
|
width: "12",
|
|
@@ -11,21 +12,21 @@ export function MicrosoftIcon(props) {
|
|
|
11
12
|
clipPath: "url(#clip0)"
|
|
12
13
|
}, /*#__PURE__*/React.createElement("path", {
|
|
13
14
|
d: "M0 0H5.70233V5.7023H0V0Z",
|
|
14
|
-
fill:
|
|
15
|
+
fill: token('color.text.onBold', 'white')
|
|
15
16
|
}), /*#__PURE__*/React.createElement("path", {
|
|
16
17
|
d: "M6.29785 0H12.0002V5.7023H6.29785V0Z",
|
|
17
|
-
fill:
|
|
18
|
+
fill: token('color.text.onBold', 'white')
|
|
18
19
|
}), /*#__PURE__*/React.createElement("path", {
|
|
19
20
|
d: "M0 6.29688H5.70233V11.9992H0V6.29688Z",
|
|
20
|
-
fill:
|
|
21
|
+
fill: token('color.text.onBold', 'white')
|
|
21
22
|
}), /*#__PURE__*/React.createElement("path", {
|
|
22
23
|
d: "M6.29785 6.29688H12.0002V11.9992H6.29785V6.29688Z",
|
|
23
|
-
fill:
|
|
24
|
+
fill: token('color.text.onBold', 'white')
|
|
24
25
|
})), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
|
|
25
26
|
id: "clip0"
|
|
26
27
|
}, /*#__PURE__*/React.createElement("rect", {
|
|
27
28
|
width: "12",
|
|
28
29
|
height: "11.9999",
|
|
29
|
-
fill:
|
|
30
|
+
fill: token('color.text.onBold', 'white')
|
|
30
31
|
}))));
|
|
31
32
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { token } from '@atlaskit/tokens';
|
|
3
4
|
export function SlackIcon(props) {
|
|
4
5
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
5
6
|
width: "12",
|
|
@@ -11,33 +12,33 @@ export function SlackIcon(props) {
|
|
|
11
12
|
clipPath: "url(#clip0)"
|
|
12
13
|
}, /*#__PURE__*/React.createElement("path", {
|
|
13
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",
|
|
14
|
-
fill:
|
|
15
|
+
fill: token('color.text.onBold', 'white')
|
|
15
16
|
}), /*#__PURE__*/React.createElement("path", {
|
|
16
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",
|
|
17
|
-
fill:
|
|
18
|
+
fill: token('color.text.onBold', 'white')
|
|
18
19
|
}), /*#__PURE__*/React.createElement("path", {
|
|
19
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",
|
|
20
|
-
fill:
|
|
21
|
+
fill: token('color.text.onBold', 'white')
|
|
21
22
|
}), /*#__PURE__*/React.createElement("path", {
|
|
22
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",
|
|
23
|
-
fill:
|
|
24
|
+
fill: token('color.text.onBold', 'white')
|
|
24
25
|
}), /*#__PURE__*/React.createElement("path", {
|
|
25
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",
|
|
26
|
-
fill:
|
|
27
|
+
fill: token('color.text.onBold', 'white')
|
|
27
28
|
}), /*#__PURE__*/React.createElement("path", {
|
|
28
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",
|
|
29
|
-
fill:
|
|
30
|
+
fill: token('color.text.onBold', 'white')
|
|
30
31
|
}), /*#__PURE__*/React.createElement("path", {
|
|
31
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",
|
|
32
|
-
fill:
|
|
33
|
+
fill: token('color.text.onBold', 'white')
|
|
33
34
|
}), /*#__PURE__*/React.createElement("path", {
|
|
34
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",
|
|
35
|
-
fill:
|
|
36
|
+
fill: token('color.text.onBold', 'white')
|
|
36
37
|
})), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
|
|
37
38
|
id: "clip0"
|
|
38
39
|
}, /*#__PURE__*/React.createElement("rect", {
|
|
39
40
|
width: "12",
|
|
40
41
|
height: "11.9999",
|
|
41
|
-
fill:
|
|
42
|
+
fill: token('color.text.onBold', 'white')
|
|
42
43
|
}))));
|
|
43
44
|
}
|
|
@@ -65,6 +65,11 @@ export var messages = defineMessages({
|
|
|
65
65
|
defaultMessage: 'Found in:',
|
|
66
66
|
description: 'From where the external user is coming'
|
|
67
67
|
},
|
|
68
|
+
externalUserSourcesError: {
|
|
69
|
+
id: 'fabric.elements.user-picker.external.sourced.error',
|
|
70
|
+
defaultMessage: "We can't connect you right now.",
|
|
71
|
+
description: "Error message when we can't fetch a user's import sources"
|
|
72
|
+
},
|
|
68
73
|
slackProvider: {
|
|
69
74
|
id: 'fabric.elements.user-picker.slack.provider',
|
|
70
75
|
defaultMessage: 'Slack',
|
|
@@ -7,6 +7,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
7
7
|
|
|
8
8
|
import { AVATAR_SIZES, BORDER_WIDTH } from '@atlaskit/avatar';
|
|
9
9
|
import { B100, N0, N10, N20, N30, N40, N100, R50, R400 } from '@atlaskit/theme/colors';
|
|
10
|
+
import { token } from '@atlaskit/tokens';
|
|
10
11
|
import memoizeOne from 'memoize-one';
|
|
11
12
|
import { getAvatarSize } from './utils';
|
|
12
13
|
import { mergeStyles } from '@atlaskit/select';
|
|
@@ -28,14 +29,14 @@ export var getStyles = memoizeOne(function (width, isMulti, overrideStyles) {
|
|
|
28
29
|
var isMulti = state.selectProps.isMulti;
|
|
29
30
|
return _objectSpread(_objectSpread({}, css), {}, {
|
|
30
31
|
width: width,
|
|
31
|
-
borderColor: state.isFocused ? css.borderColor : state.selectProps.subtle || state.selectProps.noBorder ? 'transparent' : N40,
|
|
32
|
-
backgroundColor: state.isFocused ? css['backgroundColor'] : state.selectProps.subtle ? 'transparent' : state.selectProps.textFieldBackgroundColor ? N10 : N20,
|
|
32
|
+
borderColor: state.isFocused ? token('color.border.neutral', css.borderColor) : state.selectProps.subtle || state.selectProps.noBorder ? 'transparent' : token('color.border.neutral', N40),
|
|
33
|
+
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),
|
|
33
34
|
'&:hover .fabric-user-picker__clear-indicator': {
|
|
34
35
|
opacity: 1
|
|
35
36
|
},
|
|
36
37
|
':hover': _objectSpread(_objectSpread({}, css[':hover']), {}, {
|
|
37
|
-
borderColor: state.isFocused ? css[':hover'] ? css[':hover'].borderColor : B100 : state.selectProps.subtle ? state.selectProps.hoveringClearIndicator ? R50 : N30 : N40,
|
|
38
|
-
backgroundColor: state.selectProps.subtle && state.selectProps.hoveringClearIndicator ? R50 : state.isFocused ? css[':hover'] ? css[':hover'].backgroundColor : N0 : state.isDisabled ? N10 : N30
|
|
38
|
+
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),
|
|
39
|
+
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)
|
|
39
40
|
}),
|
|
40
41
|
padding: 0,
|
|
41
42
|
minHeight: isCompact ? 'none' : 44,
|
|
@@ -59,7 +60,7 @@ export var getStyles = memoizeOne(function (width, isMulti, overrideStyles) {
|
|
|
59
60
|
paddingTop: 0,
|
|
60
61
|
padding: 0,
|
|
61
62
|
':hover': {
|
|
62
|
-
color: R400
|
|
63
|
+
color: token('color.text.danger', R400)
|
|
63
64
|
}
|
|
64
65
|
});
|
|
65
66
|
},
|
|
@@ -157,14 +158,14 @@ export var getStyles = memoizeOne(function (width, isMulti, overrideStyles) {
|
|
|
157
158
|
paddingLeft: isMulti ? 0 : AVATAR_PADDING,
|
|
158
159
|
'& input::placeholder': {
|
|
159
160
|
/* Chrome, Firefox, Opera, Safari 10.1+ */
|
|
160
|
-
color: N100,
|
|
161
|
+
color: token('color.text.lowEmphasis', N100),
|
|
161
162
|
opacity: 1
|
|
162
163
|
/* Firefox */
|
|
163
164
|
|
|
164
165
|
},
|
|
165
166
|
'& input:-ms-input-placeholder': {
|
|
166
167
|
/* Internet Explorer 10-11 */
|
|
167
|
-
color: N100
|
|
168
|
+
color: token('color.text.lowEmphasis', N100)
|
|
168
169
|
}
|
|
169
170
|
});
|
|
170
171
|
}
|
package/dist/esm/version.json
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LoadUserSource, UserSource } from '../types';
|
|
3
|
+
export interface UserSourceContext {
|
|
4
|
+
fetchUserSource?: LoadUserSource;
|
|
5
|
+
}
|
|
6
|
+
export declare const ExusUserSourceProvider: React.FC<UserSourceContext>;
|
|
7
|
+
export declare const useUserSource: (accountId: string, existingSources?: UserSource[] | undefined) => {
|
|
8
|
+
sources: UserSource[];
|
|
9
|
+
loading: boolean;
|
|
10
|
+
error: string | null;
|
|
11
|
+
};
|
|
@@ -48,7 +48,7 @@ export declare class BaseUserPickerWithoutAnalytics extends React.Component<Base
|
|
|
48
48
|
private getAppearance;
|
|
49
49
|
render(): JSX.Element;
|
|
50
50
|
}
|
|
51
|
-
export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Pick<BaseUserPickerProps, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "SelectComponent" | "pickerProps">, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isDisabled" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "loadOptions" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "SelectComponent" | "pickerProps"> & Partial<Pick<Pick<BaseUserPickerProps, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "SelectComponent" | "pickerProps">, "isClearable" | "isMulti" | "textFieldBackgroundColor" | "subtle" | "noBorder">> & Partial<Pick<{
|
|
51
|
+
export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Pick<BaseUserPickerProps, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "SelectComponent" | "pickerProps">, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isDisabled" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "SelectComponent" | "pickerProps"> & Partial<Pick<Pick<BaseUserPickerProps, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "SelectComponent" | "pickerProps">, "isClearable" | "isMulti" | "textFieldBackgroundColor" | "subtle" | "noBorder">> & Partial<Pick<{
|
|
52
52
|
isMulti: boolean;
|
|
53
53
|
subtle: boolean;
|
|
54
54
|
noBorder: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Email } from '
|
|
3
|
-
import { EmailValidationResponse } from '
|
|
2
|
+
import { Email } from '../../types';
|
|
3
|
+
import { EmailValidationResponse } from '../emailValidation';
|
|
4
4
|
export declare type EmailOptionProps = {
|
|
5
5
|
email: Email;
|
|
6
6
|
isSelected: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ExternalUser } from '
|
|
2
|
+
import { ExternalUser } from '../../types';
|
|
3
3
|
export declare const ImageContainer: import("styled-components").StyledComponentClass<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, any, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>>;
|
|
4
4
|
export declare const SourcesTooltipContainer: import("styled-components").StyledComponentClass<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
|
|
5
5
|
export declare const SourceWrapper: import("styled-components").StyledComponentClass<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { UserSource } from '../types';
|
|
3
|
+
declare type SourcesChildrenFunc = ({ sources, sourcesLoading, sourcesError, }: {
|
|
4
|
+
sources: UserSource[];
|
|
5
|
+
sourcesLoading: boolean;
|
|
6
|
+
sourcesError: string | null;
|
|
7
|
+
}) => ReactNode;
|
|
8
|
+
interface SourcesContainerProps {
|
|
9
|
+
accountId: string;
|
|
10
|
+
initialSources: UserSource[];
|
|
11
|
+
children: SourcesChildrenFunc;
|
|
12
|
+
}
|
|
13
|
+
export declare const ExternalUserSourcesContainer: React.FC<SourcesContainerProps>;
|
|
14
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Group } from '
|
|
2
|
+
import { Group } from '../../types';
|
|
3
3
|
export declare const GroupOptionIconWrapper: import("styled-components").StyledComponentClass<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, any, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>>;
|
|
4
4
|
export declare type GroupOptionProps = {
|
|
5
5
|
group: Group;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
intl: IntlShape;
|
|
5
|
-
}
|
|
6
|
-
declare const _default: React.FC<import("react-intl-next").WithIntlProps<MessagesIntlProviderProps>> & {
|
|
7
|
-
WrappedComponent: React.ComponentType<MessagesIntlProviderProps>;
|
|
8
|
-
};
|
|
9
|
-
export default _default;
|
|
2
|
+
declare const MessagesIntlProvider: React.FC;
|
|
3
|
+
export default MessagesIntlProvider;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { OptionProps as AkOptionProps } from '@atlaskit/select';
|
|
1
2
|
import { FC } from 'react';
|
|
2
3
|
import { Option as OptionType } from '../types';
|
|
3
|
-
export declare type OptionProps = {
|
|
4
|
+
export declare type OptionProps = AkOptionProps & {
|
|
4
5
|
data: OptionType;
|
|
5
6
|
isSelected: boolean;
|
|
7
|
+
isDisabled: boolean;
|
|
8
|
+
isFocused: boolean;
|
|
6
9
|
status?: string;
|
|
7
10
|
selectProps: {
|
|
8
11
|
emailLabel?: string;
|
|
@@ -27,7 +27,7 @@ export declare class PopupUserPickerWithoutAnalytics extends React.Component<Pop
|
|
|
27
27
|
};
|
|
28
28
|
render(): JSX.Element;
|
|
29
29
|
}
|
|
30
|
-
export declare const PopupUserPicker: React.ForwardRefExoticComponent<Pick<Pick<PopupUserPickerProps, "placeholder" | "target" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "offset" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "popupTitle" | "boundariesElement" | "placement" | "rootBoundary" | "shouldFlip">, "placeholder" | "target" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "popupTitle"> & Partial<Pick<Pick<PopupUserPickerProps, "placeholder" | "target" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "offset" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "popupTitle" | "boundariesElement" | "placement" | "rootBoundary" | "shouldFlip">, "isMulti" | "offset" | "width" | "boundariesElement" | "placement" | "rootBoundary" | "shouldFlip">> & Partial<Pick<{
|
|
30
|
+
export declare const PopupUserPicker: React.ForwardRefExoticComponent<Pick<Pick<PopupUserPickerProps, "placeholder" | "target" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "offset" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "popupTitle" | "boundariesElement" | "placement" | "rootBoundary" | "shouldFlip">, "placeholder" | "target" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "popupTitle"> & Partial<Pick<Pick<PopupUserPickerProps, "placeholder" | "target" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "offset" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "popupTitle" | "boundariesElement" | "placement" | "rootBoundary" | "shouldFlip">, "isMulti" | "offset" | "width" | "boundariesElement" | "placement" | "rootBoundary" | "shouldFlip">> & Partial<Pick<{
|
|
31
31
|
boundariesElement: string;
|
|
32
32
|
width: number;
|
|
33
33
|
isMulti: boolean;
|
|
@@ -7,7 +7,7 @@ export declare class UserPickerWithoutAnalytics extends React.Component<UserPick
|
|
|
7
7
|
};
|
|
8
8
|
render(): JSX.Element;
|
|
9
9
|
}
|
|
10
|
-
export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Pick<UserPickerProps, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions">, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions"> & Partial<Pick<Pick<UserPickerProps, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions">, "isMulti" | "width">> & Partial<Pick<{
|
|
10
|
+
export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Pick<UserPickerProps, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions">, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions"> & Partial<Pick<Pick<UserPickerProps, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions">, "isMulti" | "width">> & Partial<Pick<{
|
|
11
11
|
width: number;
|
|
12
12
|
isMulti: boolean;
|
|
13
13
|
}, never>> & React.RefAttributes<any>>;
|
|
@@ -64,6 +64,11 @@ export declare const messages: {
|
|
|
64
64
|
defaultMessage: string;
|
|
65
65
|
description: string;
|
|
66
66
|
};
|
|
67
|
+
externalUserSourcesError: {
|
|
68
|
+
id: string;
|
|
69
|
+
defaultMessage: string;
|
|
70
|
+
description: string;
|
|
71
|
+
};
|
|
67
72
|
slackProvider: {
|
|
68
73
|
id: string;
|
|
69
74
|
defaultMessage: string;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -39,6 +39,13 @@ export declare type UserPickerProps = WithAnalyticsEventsProps & {
|
|
|
39
39
|
* sessionId?: user picker session identifier, used to track success metric for users providers
|
|
40
40
|
*/
|
|
41
41
|
loadOptions?: LoadOptions;
|
|
42
|
+
/**
|
|
43
|
+
* Function used to load user source if they are an external user.
|
|
44
|
+
* accepts two params:
|
|
45
|
+
* accountId: account ID of the user to lookup sources
|
|
46
|
+
* signal: AbortController signal to abort the request if the tooltip is closed
|
|
47
|
+
*/
|
|
48
|
+
loadUserSource?: LoadUserSource;
|
|
42
49
|
/** Callback for value change events fired whenever a selection is inserted or removed. */
|
|
43
50
|
onChange?: OnChange;
|
|
44
51
|
/** To enable multi user picker. */
|
|
@@ -253,6 +260,13 @@ export declare type Option<Data = OptionData> = {
|
|
|
253
260
|
value: string;
|
|
254
261
|
data: Data;
|
|
255
262
|
};
|
|
263
|
+
export interface UserSourceResult {
|
|
264
|
+
sourceId: string;
|
|
265
|
+
sourceType: UserSource;
|
|
266
|
+
}
|
|
267
|
+
export interface LoadUserSource {
|
|
268
|
+
(accountId: string, signal?: AbortSignal): Promise<UserSourceResult[]>;
|
|
269
|
+
}
|
|
256
270
|
export interface LoadOptions {
|
|
257
271
|
(searchText?: string, sessionId?: string): Promisable<OptionData | OptionData[]> | Iterable<Promisable<OptionData[] | OptionData> | OptionData | OptionData[]>;
|
|
258
272
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/user-picker",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.3.0",
|
|
4
4
|
"description": "Fabric component for display a dropdown to select a user from",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -32,10 +32,12 @@
|
|
|
32
32
|
"@atlaskit/lozenge": "^11.0.0",
|
|
33
33
|
"@atlaskit/popper": "^5.0.0",
|
|
34
34
|
"@atlaskit/select": "^15.2.0",
|
|
35
|
+
"@atlaskit/spinner": "^15.1.4",
|
|
35
36
|
"@atlaskit/theme": "^12.0.0",
|
|
37
|
+
"@atlaskit/tokens": "^0.4.0",
|
|
36
38
|
"@atlaskit/tooltip": "^17.5.0",
|
|
37
39
|
"@babel/runtime": "^7.0.0",
|
|
38
|
-
"lodash": "^4.17.
|
|
40
|
+
"lodash": "^4.17.21",
|
|
39
41
|
"memoize-one": "^6.0.0",
|
|
40
42
|
"uuid": "^3.1.0"
|
|
41
43
|
},
|
|
@@ -51,11 +53,17 @@
|
|
|
51
53
|
"@atlaskit/docs": "*",
|
|
52
54
|
"@atlaskit/elements-test-helpers": "^0.7.0",
|
|
53
55
|
"@atlaskit/modal-dialog": "^12.2.0",
|
|
56
|
+
"@atlaskit/radio": "^5.3.4",
|
|
54
57
|
"@atlaskit/range": "^5.0.11",
|
|
55
58
|
"@atlaskit/section-message": "^6.0.0",
|
|
56
59
|
"@atlaskit/textfield": "^5.0.0",
|
|
57
60
|
"@atlaskit/util-data-test": "^17.0.0",
|
|
58
61
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
62
|
+
"@testing-library/dom": "^7.7.3",
|
|
63
|
+
"@testing-library/jest-dom": "^4.1.0",
|
|
64
|
+
"@testing-library/react": "^8.0.1",
|
|
65
|
+
"@testing-library/react-hooks": "^1.0.4",
|
|
66
|
+
"@testing-library/user-event": "10.4.0",
|
|
59
67
|
"@types/uuid": "^3.4.4",
|
|
60
68
|
"enzyme": "^3.10.0",
|
|
61
69
|
"enzyme-react-intl": "^2.0.6",
|
|
@@ -68,5 +76,10 @@
|
|
|
68
76
|
"fabric",
|
|
69
77
|
"ui"
|
|
70
78
|
],
|
|
79
|
+
"techstack": {
|
|
80
|
+
"@repo/internal": {
|
|
81
|
+
"theming": "tokens"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
71
84
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
72
85
|
}
|