@atlaskit/user-picker 9.2.1 → 9.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlaskit/user-picker
2
2
 
3
+ ## 9.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`fd025cbb820`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fd025cbb820) - [ux] Fix input cursor position relative to the placeholder
8
+
9
+ ## 9.3.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`bc0b47732f8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bc0b47732f8) - [ux] Fix bug where user picker input is not being unfocused when disableInput is set. The new behavior will enable you to still focus on the input but not interact with it, unless it is to delete selected users.
14
+
15
+ ## 9.2.2
16
+
17
+ ### Patch Changes
18
+
19
+ - [`d27d65448a2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d27d65448a2) - [ux] Add margin-left to addMoreText field
20
+
3
21
  ## 9.2.1
4
22
 
5
23
  ### Patch Changes
@@ -152,7 +152,8 @@ var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
152
152
  });
153
153
 
154
154
  _this.setState({
155
- value: remainingValues ? remainingValues : []
155
+ value: remainingValues ? remainingValues : [],
156
+ menuIsOpen: true
156
157
  });
157
158
  }
158
159
 
@@ -366,8 +367,7 @@ var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
366
367
 
367
368
  if (event.keyCode === 32 && !_this.state.inputValue) {
368
369
  event.preventDefault();
369
-
370
- _this.setState({
370
+ !_this.props.disableInput && _this.setState({
371
371
  inputValue: ' '
372
372
  });
373
373
  }
@@ -582,6 +582,10 @@ var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
582
582
  value: function getDerivedStateFromProps(nextProps, prevState) {
583
583
  var derivedState = {};
584
584
 
585
+ if (nextProps.isDisabled || nextProps.disableInput) {
586
+ derivedState.menuIsOpen = false;
587
+ }
588
+
585
589
  if (nextProps.open !== undefined) {
586
590
  derivedState.menuIsOpen = nextProps.open;
587
591
  }
@@ -47,9 +47,15 @@ var Input = /*#__PURE__*/function (_React$Component) {
47
47
 
48
48
  _this = _super.call.apply(_super, [this].concat(args));
49
49
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleKeyPress", function (e) {
50
+ var _this$props$selectPro;
51
+
50
52
  if (e.key === 'Enter') {
51
53
  e.preventDefault();
52
54
  }
55
+
56
+ if ((_this$props$selectPro = _this.props.selectProps) !== null && _this$props$selectPro !== void 0 && _this$props$selectPro.disableInput) {
57
+ e.preventDefault();
58
+ }
53
59
  });
54
60
  return _this;
55
61
  }
@@ -57,10 +63,8 @@ var Input = /*#__PURE__*/function (_React$Component) {
57
63
  (0, _createClass2.default)(Input, [{
58
64
  key: "render",
59
65
  value: function render() {
60
- var selectProps = this.props.selectProps;
61
66
  return /*#__PURE__*/_react.default.createElement(_select.components.Input, (0, _extends2.default)({}, this.props, {
62
67
  innerRef: this.props.innerRef,
63
- isDisabled: selectProps && selectProps.disableInput,
64
68
  onKeyPress: this.handleKeyPress
65
69
  }));
66
70
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "9.2.1",
3
+ "version": "9.3.1",
4
4
  "sideEffects": false
5
5
  }
@@ -18,6 +18,10 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
18
18
  static getDerivedStateFromProps(nextProps, prevState) {
19
19
  const derivedState = {};
20
20
 
21
+ if (nextProps.isDisabled || nextProps.disableInput) {
22
+ derivedState.menuIsOpen = false;
23
+ }
24
+
21
25
  if (nextProps.open !== undefined) {
22
26
  derivedState.menuIsOpen = nextProps.open;
23
27
  }
@@ -119,7 +123,8 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
119
123
  if (removedValue && this.state.value && Array.isArray(this.state.value)) {
120
124
  const remainingValues = this.state.value.filter(val => val.data.id !== removedValue.data.id);
121
125
  this.setState({
122
- value: remainingValues ? remainingValues : []
126
+ value: remainingValues ? remainingValues : [],
127
+ menuIsOpen: true
123
128
  });
124
129
  }
125
130
 
@@ -324,7 +329,7 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
324
329
 
325
330
  if (event.keyCode === 32 && !this.state.inputValue) {
326
331
  event.preventDefault();
327
- this.setState({
332
+ !this.props.disableInput && this.setState({
328
333
  inputValue: ' '
329
334
  });
330
335
  }
@@ -7,19 +7,21 @@ export class Input extends React.Component {
7
7
  super(...args);
8
8
 
9
9
  _defineProperty(this, "handleKeyPress", e => {
10
+ var _this$props$selectPro;
11
+
10
12
  if (e.key === 'Enter') {
11
13
  e.preventDefault();
12
14
  }
15
+
16
+ if ((_this$props$selectPro = this.props.selectProps) !== null && _this$props$selectPro !== void 0 && _this$props$selectPro.disableInput) {
17
+ e.preventDefault();
18
+ }
13
19
  });
14
20
  }
15
21
 
16
22
  render() {
17
- const {
18
- selectProps
19
- } = this.props;
20
23
  return /*#__PURE__*/React.createElement(components.Input, _extends({}, this.props, {
21
24
  innerRef: this.props.innerRef,
22
- isDisabled: selectProps && selectProps.disableInput,
23
25
  onKeyPress: this.handleKeyPress
24
26
  }));
25
27
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "9.2.1",
3
+ "version": "9.3.1",
4
4
  "sideEffects": false
5
5
  }
@@ -135,7 +135,8 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
135
135
  });
136
136
 
137
137
  _this.setState({
138
- value: remainingValues ? remainingValues : []
138
+ value: remainingValues ? remainingValues : [],
139
+ menuIsOpen: true
139
140
  });
140
141
  }
141
142
 
@@ -364,8 +365,7 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
364
365
 
365
366
  if (event.keyCode === 32 && !_this.state.inputValue) {
366
367
  event.preventDefault();
367
-
368
- _this.setState({
368
+ !_this.props.disableInput && _this.setState({
369
369
  inputValue: ' '
370
370
  });
371
371
  }
@@ -584,6 +584,10 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
584
584
  value: function getDerivedStateFromProps(nextProps, prevState) {
585
585
  var derivedState = {};
586
586
 
587
+ if (nextProps.isDisabled || nextProps.disableInput) {
588
+ derivedState.menuIsOpen = false;
589
+ }
590
+
587
591
  if (nextProps.open !== undefined) {
588
592
  derivedState.menuIsOpen = nextProps.open;
589
593
  }
@@ -30,9 +30,15 @@ export var Input = /*#__PURE__*/function (_React$Component) {
30
30
  _this = _super.call.apply(_super, [this].concat(args));
31
31
 
32
32
  _defineProperty(_assertThisInitialized(_this), "handleKeyPress", function (e) {
33
+ var _this$props$selectPro;
34
+
33
35
  if (e.key === 'Enter') {
34
36
  e.preventDefault();
35
37
  }
38
+
39
+ if ((_this$props$selectPro = _this.props.selectProps) !== null && _this$props$selectPro !== void 0 && _this$props$selectPro.disableInput) {
40
+ e.preventDefault();
41
+ }
36
42
  });
37
43
 
38
44
  return _this;
@@ -41,10 +47,8 @@ export var Input = /*#__PURE__*/function (_React$Component) {
41
47
  _createClass(Input, [{
42
48
  key: "render",
43
49
  value: function render() {
44
- var selectProps = this.props.selectProps;
45
50
  return /*#__PURE__*/React.createElement(components.Input, _extends({}, this.props, {
46
51
  innerRef: this.props.innerRef,
47
- isDisabled: selectProps && selectProps.disableInput,
48
52
  onKeyPress: this.handleKeyPress
49
53
  }));
50
54
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "9.2.1",
3
+ "version": "9.3.1",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "9.2.1",
3
+ "version": "9.3.1",
4
4
  "description": "Fabric component for display a dropdown to select a user from",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -29,10 +29,10 @@
29
29
  "@atlaskit/analytics-next": "^8.2.0",
30
30
  "@atlaskit/avatar": "^21.0.0",
31
31
  "@atlaskit/icon": "^21.10.0",
32
- "@atlaskit/logo": "^13.7.0",
32
+ "@atlaskit/logo": "^13.8.0",
33
33
  "@atlaskit/lozenge": "^11.0.0",
34
34
  "@atlaskit/popper": "^5.0.0",
35
- "@atlaskit/select": "^15.3.0",
35
+ "@atlaskit/select": "^15.4.0",
36
36
  "@atlaskit/spinner": "^15.1.4",
37
37
  "@atlaskit/theme": "^12.1.0",
38
38
  "@atlaskit/tokens": "^0.10.0",
@@ -59,7 +59,7 @@
59
59
  "@atlaskit/range": "^6.0.0",
60
60
  "@atlaskit/section-message": "^6.0.0",
61
61
  "@atlaskit/textfield": "^5.0.0",
62
- "@atlaskit/util-data-test": "^17.3.0",
62
+ "@atlaskit/util-data-test": "^17.5.0",
63
63
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
64
64
  "@emotion/styled": "^10.0.7",
65
65
  "@testing-library/dom": "^7.7.3",
package/report.api.md CHANGED
@@ -9,8 +9,7 @@ import { ReactNode } from 'react';
9
9
  import { StylesConfig } from '@atlaskit/select';
10
10
  import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
11
11
 
12
- // @public (undocumented)
13
- export type ActionTypes =
12
+ export declare type ActionTypes =
14
13
  | 'select-option'
15
14
  | 'deselect-option'
16
15
  | 'remove-value'
@@ -19,11 +18,9 @@ export type ActionTypes =
19
18
  | 'clear'
20
19
  | 'create-option';
21
20
 
22
- // @public (undocumented)
23
- export type Appearance = 'normal' | 'compact';
21
+ export declare type Appearance = 'normal' | 'compact';
24
22
 
25
- // @public (undocumented)
26
- export type AtlasKitSelectChange = (
23
+ export declare type AtlasKitSelectChange = (
27
24
  value: AtlaskitSelectValue,
28
25
  extraInfo: {
29
26
  removedValue?: Option_2;
@@ -32,89 +29,77 @@ export type AtlasKitSelectChange = (
32
29
  },
33
30
  ) => void;
34
31
 
35
- // @public (undocumented)
36
- export type AtlaskitSelectValue = Option_2 | Array<Option_2> | null | undefined;
32
+ export declare type AtlaskitSelectValue =
33
+ | Option_2
34
+ | Array<Option_2>
35
+ | null
36
+ | undefined;
37
37
 
38
- // @public (undocumented)
39
- export type DefaultValue = Value | OptionIdentifier | OptionIdentifier[];
38
+ declare type BoundariesElement =
39
+ | 'scrollParent'
40
+ | 'window'
41
+ | 'viewport'
42
+ | HTMLElement;
40
43
 
41
- // @public (undocumented)
42
- export interface Email extends OptionData {
43
- // (undocumented)
44
- suggestion?: boolean;
45
- // (undocumented)
44
+ export declare type DefaultValue =
45
+ | Value
46
+ | OptionIdentifier
47
+ | OptionIdentifier[];
48
+
49
+ export declare interface Email extends OptionData {
46
50
  type: 'email';
51
+ suggestion?: boolean;
47
52
  }
48
53
 
49
- // @public (undocumented)
50
- export const EmailType = 'email';
54
+ export declare const EmailType = 'email';
51
55
 
52
- // @public (undocumented)
53
- export type EmailValidationResponse = 'INVALID' | 'POTENTIAL' | 'VALID';
56
+ export declare type EmailValidationResponse = 'INVALID' | 'POTENTIAL' | 'VALID';
54
57
 
55
- // @public (undocumented)
56
- export type EmailValidator = (inputText: string) => EmailValidationResponse;
58
+ export declare type EmailValidator = (
59
+ inputText: string,
60
+ ) => EmailValidationResponse;
57
61
 
58
- // @public (undocumented)
59
- export interface ExternalUser extends User {
60
- // (undocumented)
62
+ export declare interface ExternalUser extends User {
61
63
  externalUserType?: 'crossSite' | 'thirdParty';
62
- // (undocumented)
63
64
  requiresSourceHydration?: boolean;
64
- // (undocumented)
65
65
  sources: UserSource[];
66
66
  }
67
67
 
68
- // @public (undocumented)
69
- export interface Group extends OptionData {
70
- // (undocumented)
68
+ export declare interface Group extends OptionData {
71
69
  highlight?: GroupHighlight;
72
- // (undocumented)
73
70
  type: 'group';
74
71
  }
75
72
 
76
- // @public (undocumented)
77
- export interface GroupHighlight {
78
- // (undocumented)
73
+ export declare interface GroupHighlight {
79
74
  name: HighlightRange[];
80
75
  }
81
76
 
82
- // @public (undocumented)
83
- export const GroupType = 'group';
77
+ export declare const GroupType = 'group';
84
78
 
85
- // @public (undocumented)
86
- export interface HighlightRange {
87
- // (undocumented)
88
- end: number;
89
- // (undocumented)
79
+ export declare interface HighlightRange {
90
80
  start: number;
81
+ end: number;
91
82
  }
92
83
 
93
- // @public (undocumented)
94
- export type InputActionTypes =
84
+ export declare type InputActionTypes =
95
85
  | 'set-value'
96
86
  | 'input-change'
97
87
  | 'input-blur'
98
88
  | 'menu-close';
99
89
 
100
- // @public (undocumented)
101
- export const isEmail: (option: OptionData) => option is Email;
90
+ export declare const isEmail: (option: OptionData) => option is Email;
102
91
 
103
- // @public (undocumented)
104
- export const isExternalUser: (option: OptionData) => option is ExternalUser;
92
+ export declare const isExternalUser: (
93
+ option: OptionData,
94
+ ) => option is ExternalUser;
105
95
 
106
- // @public (undocumented)
107
- export const isTeam: (option: OptionData) => option is Team;
96
+ export declare const isTeam: (option: OptionData) => option is Team;
108
97
 
109
- // @public (undocumented)
110
- export const isUser: (option: OptionData) => option is User;
98
+ export declare const isUser: (option: OptionData) => option is User;
111
99
 
112
- // @public (undocumented)
113
- export const isValidEmail: EmailValidator;
100
+ export declare const isValidEmail: EmailValidator;
114
101
 
115
- // @public (undocumented)
116
- export interface LoadOptions {
117
- // (undocumented)
102
+ export declare interface LoadOptions {
118
103
  (searchText?: string, sessionId?: string):
119
104
  | Promisable<OptionData | OptionData[]>
120
105
  | Iterable<
@@ -122,59 +107,55 @@ export interface LoadOptions {
122
107
  >;
123
108
  }
124
109
 
125
- // @public (undocumented)
126
- export interface LozengeProps {
127
- // (undocumented)
128
- appearance?: LozengeColor;
129
- // (undocumented)
130
- isBold?: boolean;
131
- // (undocumented)
110
+ declare interface LoadUserSource {
111
+ (accountId: string, signal?: AbortSignal): Promise<UserSourceResult[]>;
112
+ }
113
+
114
+ declare type LozengeColor =
115
+ | 'default'
116
+ | 'success'
117
+ | 'removed'
118
+ | 'inprogress'
119
+ | 'new'
120
+ | 'moved';
121
+
122
+ export declare interface LozengeProps {
132
123
  text: string;
133
- // (undocumented)
134
124
  tooltip?: string;
125
+ appearance?: LozengeColor;
126
+ isBold?: boolean;
135
127
  }
136
128
 
137
- // @public (undocumented)
138
- export type OnChange = (value: Value, action: ActionTypes) => void;
129
+ export declare type OnChange = (value: Value, action: ActionTypes) => void;
139
130
 
140
- // @public (undocumented)
141
- export type OnInputChange = (query?: string, sessionId?: string) => void;
131
+ export declare type OnInputChange = (
132
+ query?: string,
133
+ sessionId?: string,
134
+ ) => void;
142
135
 
143
- // @public (undocumented)
144
- export type OnOption = (value: Value, sessionId?: string) => void;
136
+ export declare type OnOption = (value: Value, sessionId?: string) => void;
145
137
 
146
- // @public (undocumented)
147
- export type OnPicker = (sessionId?: string) => void;
138
+ export declare type OnPicker = (sessionId?: string) => void;
148
139
 
149
- // @public (undocumented)
150
- type Option_2<Data = OptionData> = {
140
+ declare type Option_2<Data = OptionData> = {
151
141
  label: string;
152
142
  value: string;
153
143
  data: Data;
154
144
  };
155
145
  export { Option_2 as Option };
156
146
 
157
- // @public (undocumented)
158
- export interface OptionData {
159
- // (undocumented)
147
+ export declare interface OptionData {
160
148
  avatarUrl?: any;
161
- // (undocumented)
162
- fixed?: boolean;
163
- // (undocumented)
164
149
  id: string;
165
- // (undocumented)
166
- lozenge?: string | LozengeProps;
167
- // (undocumented)
168
150
  name: string;
169
- // (undocumented)
170
151
  type?: 'user' | 'team' | 'email' | 'group';
152
+ fixed?: boolean;
153
+ lozenge?: string | LozengeProps;
171
154
  }
172
155
 
173
- // @public (undocumented)
174
- export type OptionIdentifier = Pick<OptionData, 'id' | 'type'>;
156
+ export declare type OptionIdentifier = Pick<OptionData, 'id' | 'type'>;
175
157
 
176
- // @public (undocumented)
177
- export const PopupUserPicker: React_2.ForwardRefExoticComponent<
158
+ export declare const PopupUserPicker: React_2.ForwardRefExoticComponent<
178
159
  Pick<
179
160
  Omit<PopupUserPickerProps, keyof WithAnalyticsEventsProps>,
180
161
  | 'target'
@@ -254,88 +235,86 @@ export const PopupUserPicker: React_2.ForwardRefExoticComponent<
254
235
  React_2.RefAttributes<any>
255
236
  >;
256
237
 
257
- // @public (undocumented)
258
- export type PopupUserPickerProps = UserPickerProps & {
238
+ export declare type PopupUserPickerProps = UserPickerProps & {
239
+ /** Whether to use the popup version of the single picker */
259
240
  target: Target;
241
+ /** Optional title assigned to popup picker */
260
242
  popupTitle?: string;
243
+ /**
244
+ * The boundary element that the popup will check for overflow.
245
+ * Defaults to `"viewport"` which are parent scroll containers,
246
+ * but can be set to any element.
247
+ */
261
248
  boundariesElement?: BoundariesElement;
249
+ /**
250
+ * Distance the popup should be offset from the reference in the format of [along, away] (units in px).
251
+ */
262
252
  offset?: [number, number];
253
+ /**
254
+ * Placement of where the popup should be displayed relative to the trigger element.
255
+ * Defaults to `"auto"`.
256
+ */
263
257
  placement?: Placement;
258
+ /**
259
+ * The root boundary that the popup will check for overflow.
260
+ * Defaults to `"viewport"` but can be set to `"document"`.
261
+ * See `@atlaskit/popper` for further details.
262
+ */
264
263
  rootBoundary?: RootBoundary;
264
+ /**
265
+ * Allows the dropdown menu to be placed on the opposite side of its trigger if it does not
266
+ * fit in the viewport.
267
+ */
265
268
  shouldFlip?: boolean;
266
269
  };
267
270
 
268
- // @public (undocumented)
269
- export type Promisable<T> = T | PromiseLike<T>;
271
+ export declare type Promisable<T> = T | PromiseLike<T>;
270
272
 
271
- // @public (undocumented)
272
- export type Target = (options: { ref: any; isOpen: boolean }) => ReactNode;
273
+ declare type RootBoundary = 'viewport' | 'document';
273
274
 
274
- // @public (undocumented)
275
- export interface Team extends OptionData {
276
- // (undocumented)
275
+ export declare type Target = (options: {
276
+ ref: any;
277
+ isOpen: boolean;
278
+ }) => ReactNode;
279
+
280
+ export declare interface Team extends OptionData {
277
281
  avatarUrl?: string;
278
- // (undocumented)
279
282
  description?: string;
280
- // (undocumented)
281
- highlight?: TeamHighlight;
282
- // (undocumented)
283
- includesYou?: boolean;
284
- // (undocumented)
285
283
  memberCount?: number;
286
- // (undocumented)
287
284
  members?: TeamMember[];
288
- // (undocumented)
285
+ includesYou?: boolean;
286
+ highlight?: TeamHighlight;
289
287
  type: 'team';
290
288
  }
291
289
 
292
- // @public (undocumented)
293
- export interface TeamHighlight {
294
- // (undocumented)
295
- description?: HighlightRange[];
296
- // (undocumented)
290
+ export declare interface TeamHighlight {
297
291
  name: HighlightRange[];
292
+ description?: HighlightRange[];
298
293
  }
299
294
 
300
- // @public (undocumented)
301
- export interface TeamMember {
302
- // (undocumented)
303
- id: string;
304
- // (undocumented)
295
+ export declare interface TeamMember {
305
296
  name: string;
297
+ id: string;
306
298
  }
307
299
 
308
- // @public (undocumented)
309
- export const TeamType = 'team';
300
+ export declare const TeamType = 'team';
310
301
 
311
- // @public (undocumented)
312
- export interface User extends OptionData {
313
- // (undocumented)
302
+ export declare interface User extends OptionData {
314
303
  avatarUrl?: string;
315
- // (undocumented)
304
+ publicName?: string;
305
+ highlight?: UserHighlight;
316
306
  byline?: string;
317
- // (undocumented)
307
+ type?: 'user';
318
308
  email?: string;
319
- // (undocumented)
320
- highlight?: UserHighlight;
321
- // (undocumented)
322
309
  isExternal?: boolean;
323
- // (undocumented)
324
- publicName?: string;
325
- // (undocumented)
326
- type?: 'user';
327
310
  }
328
311
 
329
- // @public (undocumented)
330
- export interface UserHighlight {
331
- // (undocumented)
312
+ export declare interface UserHighlight {
332
313
  name: HighlightRange[];
333
- // (undocumented)
334
314
  publicName: HighlightRange[];
335
315
  }
336
316
 
337
- // @public (undocumented)
338
- const UserPicker: React_2.ForwardRefExoticComponent<
317
+ declare const UserPicker: React_2.ForwardRefExoticComponent<
339
318
  Pick<
340
319
  Omit<UserPickerProps, keyof WithAnalyticsEventsProps>,
341
320
  | 'autoFocus'
@@ -403,62 +382,143 @@ const UserPicker: React_2.ForwardRefExoticComponent<
403
382
  >;
404
383
  export default UserPicker;
405
384
 
406
- // @public (undocumented)
407
- export type UserPickerProps = WithAnalyticsEventsProps & {
385
+ export declare type UserPickerProps = WithAnalyticsEventsProps & {
386
+ /**
387
+ * Used to configure additional information regarding where the
388
+ * user picker has been mounted.
389
+ *
390
+ * The purpose is to give more context as to where user picker events
391
+ * are being fired from, as the current data may not uniquely identify
392
+ * which field is the source.
393
+ *
394
+ * The value will be passed as a data attribute for analytics.
395
+ * Examples include "assignee", "watchers" and "share".
396
+ *
397
+ * A second usage for the fieldId is for server side rendering (SSR) where it must be a unique id per UserPicker
398
+ * instance contained in the serialized SSR content. E.g. a SPA page rendered through SSR that has multiple user pickers.
399
+ *
400
+ * fieldId can be set to null if the integrator is not listening
401
+ * for the analytic events or does not care about SSR.
402
+ */
408
403
  fieldId: string | null;
404
+ /** List of users or teams to be used as options by the user picker. */
409
405
  options?: OptionData[];
406
+ /** Width of the user picker field. It can be the amount of pixels as numbers or a string with the percentage. */
410
407
  width?: number | string;
408
+ /** Sets the minimum width for the menu. If not set, menu will always have the same width of the field. */
411
409
  menuMinWidth?: number;
410
+ /** Sets max height of the user picker. If not set, the height will grow based on number of picked users. */
412
411
  maxPickerHeight?: number;
412
+ /** Sets the background color to be the same color as a textfield (Atlaskit N10) */
413
413
  textFieldBackgroundColor?: boolean;
414
+ /**
415
+ * Function used to load options asynchronously.
416
+ * accepts two optional params:
417
+ * searchText?: optional text to filter results
418
+ * sessionId?: user picker session identifier, used to track success metric for users providers
419
+ */
414
420
  loadOptions?: LoadOptions;
421
+ /**
422
+ * Function used to load user source if they are an external user.
423
+ * accepts two params:
424
+ * accountId: account ID of the user to lookup sources
425
+ * signal: AbortController signal to abort the request if the tooltip is closed
426
+ */
415
427
  loadUserSource?: LoadUserSource;
428
+ /** Callback for value change events fired whenever a selection is inserted or removed. */
416
429
  onChange?: OnChange;
430
+ /** To enable multi user picker. */
417
431
  isMulti?: boolean;
432
+ /** Input text value. */
418
433
  search?: string;
434
+ /** Anchor for the user picker popup. */
419
435
  anchor?: React_2.ComponentType<any>;
436
+ /** Controls if user picker menu is open or not. If not provided, UserPicker will control menu state internally. */
420
437
  open?: boolean;
438
+ /** Show the loading indicator. */
421
439
  isLoading?: boolean;
440
+ /** Callback for search input text change events. */
422
441
  onInputChange?: OnInputChange;
442
+ /** Callback for when a selection is made. */
423
443
  onSelection?: OnOption;
444
+ /** Callback for when the field gains focus. */
424
445
  onFocus?: OnPicker;
446
+ /** Callback for when the field loses focus. */
425
447
  onBlur?: OnPicker;
448
+ /** Callback for when the value/s in the picker is cleared. */
426
449
  onClear?: OnPicker;
450
+ /** Callback that is triggered when popup picker is closed */
427
451
  onClose?: OnPicker;
452
+ /** Appearance of the user picker. */
428
453
  appearance?: Appearance;
454
+ /** Display the picker with a subtle style. */
429
455
  subtle?: boolean;
456
+ /** Display the picker with no border. */
430
457
  noBorder?: boolean;
458
+ /**
459
+ * You may pass through a `StylesConfig` to be merged with the picker default styles if a custom override is required.
460
+ * Consider using noBorder, subtle before customising further.
461
+ * See https://react-select.com/styles
462
+ */
431
463
  styles?: StylesConfig;
464
+ /** Default value for the field to be used on initial render.
465
+ * `defaultValue` differs from `value` in that it sets the initial value then leaves the component 'uncontrolled'
466
+ * whereas setting the `value` prop delegates responsibility for maintaining the value to the caller
467
+ * (i.e. listen to `onChange`) */
432
468
  defaultValue?: DefaultValue;
469
+ /** Placeholder text to be shown when there is no value in the field. */
433
470
  placeholder?: React_2.ReactNode;
471
+ /** Message to encourage the user to add more items to user picker. */
434
472
  addMoreMessage?: string;
473
+ /** Message to be shown when the menu is open but no options are provided.
474
+ * If message is null, no message will be displayed.
475
+ * If message is undefined, default message will be displayed.
476
+ */
435
477
  noOptionsMessage?:
436
478
  | ((value: { inputValue: string }) => string | null)
437
479
  | string
438
480
  | null;
481
+ /** Controls if the user picker has a value or not. If not provided, UserPicker will control the value internally. */
439
482
  value?: Value;
483
+ /** Disable all interactions with the picker, putting it in a read-only state. */
440
484
  isDisabled?: boolean;
485
+ /** Display a remove button on the single picker. True by default. */
441
486
  isClearable?: boolean;
487
+ /** Optional tooltip to display on hover over the clear indicator. */
442
488
  clearValueLabel?: string;
489
+ /** React-select prop for controlling menu position */
443
490
  menuPosition?: 'absolute' | 'fixed';
491
+ /** React-select prop for blocking menu scroll on container when menu scrolled to the very top/bottom of the menu */
444
492
  captureMenuScroll?: boolean;
493
+ /** Whether the menu should use a portal, and where it should attach. */
445
494
  menuPortalTarget?: HTMLElement;
495
+ /** Whether the user is allowed to enter emails as a value. */
446
496
  allowEmail?: boolean;
497
+ /** Setting this with allowEmail will cause the picker to constantly show an email option at the bottom for the supplied email domain/an email the user types in */
447
498
  suggestEmailsForDomain?: string;
499
+ /** Email option label */
448
500
  emailLabel?: string;
501
+ /** Whether to disable interaction with the input */
449
502
  disableInput?: boolean;
503
+ /** Override default email validation function. */
450
504
  isValidEmail?: EmailValidator;
505
+ /** Override the internal behaviour to automatically focus the control when the picker is open */
451
506
  autoFocus?: boolean;
507
+ /** The maximum number options to be displayed in the dropdown menu during any state of search. The value should be non-negative. */
452
508
  maxOptions?: number;
509
+ /** Allows clicking on a label with the same id to open user picker. */
453
510
  inputId?: string;
511
+ /** Whether to close menu on scroll */
454
512
  closeMenuOnScroll?: boolean | EventListener;
513
+ /** Whether to block scrolling actions */
455
514
  menuShouldBlockScroll?: boolean;
515
+ /** Accessibility: Identifies the element (or elements) that labels the current element.*/
456
516
  ariaLabelledBy?: string;
517
+ /** Accessibility: Used to set the priority with which screen reader should treat updates to live regions.*/
457
518
  ariaLive?: 'polite' | 'off' | 'assertive';
458
519
  };
459
520
 
460
- // @public (undocumented)
461
- export type UserPickerState = {
521
+ export declare type UserPickerState = {
462
522
  options: OptionData[];
463
523
  value?: AtlaskitSelectValue;
464
524
  isDefaultSet: boolean;
@@ -470,8 +530,7 @@ export type UserPickerState = {
470
530
  resolving: boolean;
471
531
  };
472
532
 
473
- // @public (undocumented)
474
- export type UserSource =
533
+ export declare type UserSource =
475
534
  | 'google'
476
535
  | 'slack'
477
536
  | 'microsoft'
@@ -480,11 +539,14 @@ export type UserSource =
480
539
  | 'confluence'
481
540
  | 'other-atlassian';
482
541
 
483
- // @public (undocumented)
484
- export const UserType = 'user';
542
+ declare interface UserSourceResult {
543
+ sourceId: string;
544
+ sourceType: UserSource;
545
+ }
546
+
547
+ export declare const UserType = 'user';
485
548
 
486
- // @public (undocumented)
487
- export type Value = OptionData | OptionData[] | null | undefined;
549
+ export declare type Value = OptionData | OptionData[] | null | undefined;
488
550
 
489
- // (No @packageDocumentation comment for this package)
551
+ export {};
490
552
  ```