@atlaskit/user-picker 11.6.1 → 11.6.3

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 (48) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/afm-cc/tsconfig.json +2 -2
  3. package/dist/cjs/analytics.js +1 -1
  4. package/dist/cjs/components/UserPicker.js +1 -1
  5. package/dist/cjs/components/styles.js +2 -2
  6. package/dist/es2019/analytics.js +1 -1
  7. package/dist/es2019/components/UserPicker.js +1 -1
  8. package/dist/es2019/components/styles.js +2 -2
  9. package/dist/esm/analytics.js +1 -1
  10. package/dist/esm/components/UserPicker.js +1 -1
  11. package/dist/esm/components/styles.js +2 -2
  12. package/dist/types/analytics.d.ts +3 -3
  13. package/dist/types/components/AddOptionAvatar.d.ts +1 -1
  14. package/dist/types/components/BaseUserPicker.d.ts +66 -66
  15. package/dist/types/components/EmailOption/main.d.ts +1 -1
  16. package/dist/types/components/ExternalUserOption/index.d.ts +2 -2
  17. package/dist/types/components/ExternalUserOption/main.d.ts +4 -4
  18. package/dist/types/components/ExternalUserSourcesContainer.d.ts +2 -2
  19. package/dist/types/components/HighlightText.d.ts +1 -1
  20. package/dist/types/components/Input.d.ts +2 -2
  21. package/dist/types/components/MultiValue.d.ts +2 -2
  22. package/dist/types/components/MultiValueContainer.d.ts +1 -1
  23. package/dist/types/components/Option.d.ts +2 -2
  24. package/dist/types/components/PopupUserPicker.d.ts +86 -86
  25. package/dist/types/components/SizeableAvatar.d.ts +1 -1
  26. package/dist/types/components/TeamOption/main.d.ts +1 -1
  27. package/dist/types/components/UserOption.d.ts +2 -2
  28. package/dist/types/components/UserPicker.d.ts +56 -56
  29. package/dist/types/types.d.ts +148 -148
  30. package/dist/types-ts4.5/analytics.d.ts +3 -3
  31. package/dist/types-ts4.5/components/AddOptionAvatar.d.ts +1 -1
  32. package/dist/types-ts4.5/components/BaseUserPicker.d.ts +66 -66
  33. package/dist/types-ts4.5/components/EmailOption/main.d.ts +1 -1
  34. package/dist/types-ts4.5/components/ExternalUserOption/index.d.ts +2 -2
  35. package/dist/types-ts4.5/components/ExternalUserOption/main.d.ts +4 -4
  36. package/dist/types-ts4.5/components/ExternalUserSourcesContainer.d.ts +2 -2
  37. package/dist/types-ts4.5/components/HighlightText.d.ts +1 -1
  38. package/dist/types-ts4.5/components/Input.d.ts +2 -2
  39. package/dist/types-ts4.5/components/MultiValue.d.ts +2 -2
  40. package/dist/types-ts4.5/components/MultiValueContainer.d.ts +1 -1
  41. package/dist/types-ts4.5/components/Option.d.ts +2 -2
  42. package/dist/types-ts4.5/components/PopupUserPicker.d.ts +86 -86
  43. package/dist/types-ts4.5/components/SizeableAvatar.d.ts +1 -1
  44. package/dist/types-ts4.5/components/TeamOption/main.d.ts +1 -1
  45. package/dist/types-ts4.5/components/UserOption.d.ts +2 -2
  46. package/dist/types-ts4.5/components/UserPicker.d.ts +56 -56
  47. package/dist/types-ts4.5/types.d.ts +148 -148
  48. package/package.json +7 -5
@@ -7,6 +7,41 @@ import { type EmailValidator } from './components/emailValidation';
7
7
  import { type StylesConfig, type SelectComponentsConfig } from '@atlaskit/select';
8
8
  import { type BaseUserPickerWithoutAnalytics } from './components/BaseUserPicker';
9
9
  export type UserPickerProps = WithAnalyticsEventsProps & {
10
+ /** Message to encourage the user to add more items to user picker. */
11
+ addMoreMessage?: string;
12
+ /** Whether the user is allowed to enter emails as a value. */
13
+ allowEmail?: boolean;
14
+ /** Anchor for the user picker popup. */
15
+ anchor?: React.ComponentType<any>;
16
+ /** Appearance of the user picker. */
17
+ appearance?: Appearance;
18
+ /** Accessibility: Identifies the element (or elements) that describe the current element.*/
19
+ ariaDescribedBy?: string;
20
+ /** Accessibility: Uses to set aria-label of the input*/
21
+ ariaLabel?: string;
22
+ /** Accessibility: Identifies the element (or elements) that labels the current element.*/
23
+ ariaLabelledBy?: string;
24
+ /** Accessibility: Used to set the priority with which screen reader should treat updates to live regions.*/
25
+ ariaLive?: 'polite' | 'off' | 'assertive';
26
+ /** Override the internal behaviour to automatically focus the control when the picker is open */
27
+ autoFocus?: boolean;
28
+ /** React-select prop for blocking menu scroll on container when menu scrolled to the very top/bottom of the menu */
29
+ captureMenuScroll?: boolean;
30
+ /** Optional tooltip to display on hover over the clear indicator. */
31
+ clearValueLabel?: string;
32
+ /** Whether to close menu on scroll */
33
+ closeMenuOnScroll?: boolean | EventListener;
34
+ /** Override the default components used in the user picker. */
35
+ components?: SelectComponentsConfig<OptionData, boolean>;
36
+ /** Default value for the field to be used on initial render.
37
+ * `defaultValue` differs from `value` in that it sets the initial value then leaves the component 'uncontrolled'
38
+ * whereas setting the `value` prop delegates responsibility for maintaining the value to the caller
39
+ * (i.e. listen to `onChange`) */
40
+ defaultValue?: DefaultValue;
41
+ /** Whether to disable interaction with the input */
42
+ disableInput?: boolean;
43
+ /** Email option label */
44
+ emailLabel?: string;
10
45
  /**
11
46
  * Used to configure additional information regarding where the
12
47
  * user picker has been mounted.
@@ -25,18 +60,30 @@ export type UserPickerProps = WithAnalyticsEventsProps & {
25
60
  * for the analytic events or does not care about SSR.
26
61
  */
27
62
  fieldId: string | null;
28
- /** List of users or teams to be used as options by the user picker. */
29
- options?: OptionData[];
30
- /** Width of the user picker field. It can be the amount of pixels as numbers or a string with the percentage. */
31
- width?: number | string;
63
+ /** Footer to be displayed in MenuList */
64
+ footer?: React.ReactNode;
65
+ /** Ref to the underlying select */
66
+ forwardedRef?: React.ForwardedRef<UserPickerRef>;
67
+ /** group the options by type */
68
+ groupByTypeOrder?: NonNullable<OptionData['type']>[];
69
+ /** Header to be displayed in MenuList */
70
+ header?: React.ReactNode;
32
71
  /** Sets the height of the user picker. If not set, the height settings will be based on the "compact" or "normal" appearance. */
33
72
  height?: number | string;
34
- /** Sets the minimum width for the menu. If not set, menu will always have the same width of the field. */
35
- menuMinWidth?: number;
36
- /** Sets max height of the user picker. If not set, the height will grow based on number of picked users. */
37
- maxPickerHeight?: number;
38
- /** Sets the background color to be the same color as a textfield (Atlaskit N10) */
39
- textFieldBackgroundColor?: boolean;
73
+ /** Allows clicking on a label with the same id to open user picker. */
74
+ inputId?: string;
75
+ /** Display a remove button on the single picker. True by default. */
76
+ isClearable?: boolean;
77
+ /** Disable all interactions with the picker, putting it in a read-only state. */
78
+ isDisabled?: boolean;
79
+ /** Display the picker with a style to show the value is invalid */
80
+ isInvalid?: boolean;
81
+ /** Show the loading indicator. */
82
+ isLoading?: boolean;
83
+ /** To enable multi user picker. */
84
+ isMulti?: boolean;
85
+ /** Override default email validation function. */
86
+ isValidEmail?: EmailValidator;
40
87
  /**
41
88
  * Function used to load options asynchronously.
42
89
  * accepts two optional params:
@@ -58,144 +105,93 @@ export type UserPickerProps = WithAnalyticsEventsProps & {
58
105
  * signal: AbortController signal to abort the request if the tooltip is closed
59
106
  */
60
107
  loadUserSource?: LoadUserSource;
61
- /** Callback for value change events fired whenever a selection is inserted or removed. */
62
- onChange?: OnChange;
63
- /** To enable multi user picker. */
64
- isMulti?: boolean;
65
- /** Input text value. */
66
- search?: string;
67
- /** Anchor for the user picker popup. */
68
- anchor?: React.ComponentType<any>;
69
- /** Controls if user picker menu is open or not. If not provided, UserPicker will control menu state internally. */
70
- open?: boolean;
71
- /** Show the loading indicator. */
72
- isLoading?: boolean;
73
- /** Callback for search input text change events. */
74
- onInputChange?: OnInputChange;
75
- /** Callback for when a selection is made. */
76
- onSelection?: OnOption;
77
- /** Callback for when the field gains focus. */
78
- onFocus?: OnPicker;
108
+ /** The maximum number options to be displayed in the dropdown menu during any state of search. The value should be non-negative. */
109
+ maxOptions?: number;
110
+ /** Sets max height of the user picker. If not set, the height will grow based on number of picked users. */
111
+ maxPickerHeight?: number;
112
+ /** Sets the minimum width for the menu. If not set, menu will always have the same width of the field. */
113
+ menuMinWidth?: number;
114
+ /** Whether the menu should use a portal, and where it should attach. */
115
+ menuPortalTarget?: HTMLElement;
116
+ /** React-select prop for controlling menu position */
117
+ menuPosition?: 'absolute' | 'fixed';
118
+ /** Whether to block scrolling actions */
119
+ menuShouldBlockScroll?: boolean;
120
+ /** Name to use for input element. */
121
+ name?: string;
122
+ /** Display the picker with no border. */
123
+ noBorder?: boolean;
124
+ /** Message to be shown when the menu is open but no options are provided.
125
+ * If message is null, no message will be displayed.
126
+ * If message is undefined, default message will be displayed.
127
+ */
128
+ noOptionsMessage?: ((value: {
129
+ inputValue: string;
130
+ }) => string | null | React.ReactNode) | null | React.ReactNode;
79
131
  /** Callback for when the field loses focus. */
80
132
  onBlur?: OnPicker;
133
+ /** Callback for value change events fired whenever a selection is inserted or removed. */
134
+ onChange?: OnChange;
81
135
  /** Callback for when the value/s in the picker is cleared. */
82
136
  onClear?: OnPicker;
83
- /** Callback that is triggered when popup picker is opened */
84
- onOpen?: OnPicker;
85
137
  /** Callback that is triggered when popup picker is closed */
86
138
  onClose?: OnPicker;
139
+ /** Callback for when the field gains focus. */
140
+ onFocus?: OnPicker;
141
+ /** Callback for search input text change events. */
142
+ onInputChange?: OnInputChange;
87
143
  /** Callback that is trigger on key down in text input */
88
144
  onKeyDown?: (event: React.KeyboardEvent) => void;
89
- /** Appearance of the user picker. */
90
- appearance?: Appearance;
91
- /** Display the picker with a subtle style. */
92
- subtle?: boolean;
93
- /** Display the picker with no border. */
94
- noBorder?: boolean;
145
+ /** Callback that is triggered when popup picker is opened */
146
+ onOpen?: OnPicker;
147
+ /** Callback for when a selection is made. */
148
+ onSelection?: OnOption;
149
+ /** Controls if user picker menu is open or not. If not provided, UserPicker will control menu state internally. */
150
+ open?: boolean;
151
+ /** Override the internal behaviour of default menu open on focus and applicable for single value select */
152
+ openMenuOnClick?: boolean;
153
+ /** List of users or teams to be used as options by the user picker. */
154
+ options?: OptionData[];
155
+ /** Placeholder text to be shown when there is no value in the field. */
156
+ placeholder?: React.ReactNode;
157
+ /** Placeholder avatar style - defaults to person */
158
+ placeholderAvatar?: 'person' | 'team';
159
+ /** Accessibility: A field to dictate if this is a mandatory field in the form. */
160
+ required?: boolean;
161
+ /** Input text value. */
162
+ search?: string;
163
+ /** Override default behavior and show the clear indicator. */
164
+ showClearIndicator?: boolean;
165
+ /** Positioning strategy for the popper element */
166
+ strategy?: 'fixed' | 'absolute';
95
167
  /**
96
168
  * You may pass through a `StylesConfig` to be merged with the picker default styles if a custom override is required.
97
169
  * Consider using noBorder, subtle before customising further.
98
170
  * See https://react-select.com/styles
99
171
  */
100
172
  styles?: StylesConfig;
101
- /** Override the default components used in the user picker. */
102
- components?: SelectComponentsConfig<OptionData, boolean>;
103
- /** Default value for the field to be used on initial render.
104
- * `defaultValue` differs from `value` in that it sets the initial value then leaves the component 'uncontrolled'
105
- * whereas setting the `value` prop delegates responsibility for maintaining the value to the caller
106
- * (i.e. listen to `onChange`) */
107
- defaultValue?: DefaultValue;
108
- /** Placeholder text to be shown when there is no value in the field. */
109
- placeholder?: React.ReactNode;
110
- /** Placeholder avatar style - defaults to person */
111
- placeholderAvatar?: 'person' | 'team';
112
- /** Message to encourage the user to add more items to user picker. */
113
- addMoreMessage?: string;
114
- /** Message to be shown when the menu is open but no options are provided.
115
- * If message is null, no message will be displayed.
116
- * If message is undefined, default message will be displayed.
117
- */
118
- noOptionsMessage?: ((value: {
119
- inputValue: string;
120
- }) => string | null | React.ReactNode) | null | React.ReactNode;
121
- /** Footer to be displayed in MenuList */
122
- footer?: React.ReactNode;
123
- /** Controls if the user picker has a value or not. If not provided, UserPicker will control the value internally. */
124
- value?: Value;
125
- /** Disable all interactions with the picker, putting it in a read-only state. */
126
- isDisabled?: boolean;
127
- /** Display the picker with a style to show the value is invalid */
128
- isInvalid?: boolean;
129
- /** Display a remove button on the single picker. True by default. */
130
- isClearable?: boolean;
131
- /** Optional tooltip to display on hover over the clear indicator. */
132
- clearValueLabel?: string;
133
- /** React-select prop for controlling menu position */
134
- menuPosition?: 'absolute' | 'fixed';
135
- /** React-select prop for blocking menu scroll on container when menu scrolled to the very top/bottom of the menu */
136
- captureMenuScroll?: boolean;
137
- /** Whether the menu should use a portal, and where it should attach. */
138
- menuPortalTarget?: HTMLElement;
139
- /** Whether the user is allowed to enter emails as a value. */
140
- allowEmail?: boolean;
173
+ /** Display the picker with a subtle style. */
174
+ subtle?: boolean;
141
175
  /** 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 */
142
176
  suggestEmailsForDomain?: string;
143
- /** Email option label */
144
- emailLabel?: string;
145
- /** Whether to disable interaction with the input */
146
- disableInput?: boolean;
147
- /** Override default email validation function. */
148
- isValidEmail?: EmailValidator;
149
- /** Override the internal behaviour to automatically focus the control when the picker is open */
150
- autoFocus?: boolean;
151
- /** The maximum number options to be displayed in the dropdown menu during any state of search. The value should be non-negative. */
152
- maxOptions?: number;
153
- /** Allows clicking on a label with the same id to open user picker. */
154
- inputId?: string;
155
- /** Whether to close menu on scroll */
156
- closeMenuOnScroll?: boolean | EventListener;
157
- /** Whether to block scrolling actions */
158
- menuShouldBlockScroll?: boolean;
159
- /** Accessibility: Uses to set aria-label of the input*/
160
- ariaLabel?: string;
161
- /** Accessibility: Identifies the element (or elements) that labels the current element.*/
162
- ariaLabelledBy?: string;
163
- /** Accessibility: Identifies the element (or elements) that describe the current element.*/
164
- ariaDescribedBy?: string;
165
- /** Accessibility: Used to set the priority with which screen reader should treat updates to live regions.*/
166
- ariaLive?: 'polite' | 'off' | 'assertive';
167
- /** Name to use for input element. */
168
- name?: string;
169
- /** Header to be displayed in MenuList */
170
- header?: React.ReactNode;
171
- /** Accessibility: A field to dictate if this is a mandatory field in the form. */
172
- required?: boolean;
177
+ /** Sets the background color to be the same color as a textfield (Atlaskit N10) */
178
+ textFieldBackgroundColor?: boolean;
173
179
  /**
174
180
  * Enables workaround for when <Select /> is nested inside <Draggable /> from react-beautiful-dnd
175
181
  * This relationship prevents the dropdown menu from opening because of bugs in the default focus state and clicking in a particular area of <Select />
176
182
  * Context: https://hello.atlassian.net/wiki/spaces/~989411314/pages/2861097485/Investigation+Notes+for+atlaskit+select+react-beautiful-dnd#Temporary-Solution
177
183
  */
178
184
  UNSAFE_hasDraggableParentComponent?: boolean;
179
- /** Override the internal behaviour of default menu open on focus and applicable for single value select */
180
- openMenuOnClick?: boolean;
181
- /** Positioning strategy for the popper element */
182
- strategy?: 'fixed' | 'absolute';
183
- /** Override default behavior and show the clear indicator. */
184
- showClearIndicator?: boolean;
185
- /** Ref to the underlying select */
186
- forwardedRef?: React.ForwardedRef<UserPickerRef>;
187
- /** group the options by type */
188
- groupByTypeOrder?: NonNullable<OptionData['type']>[];
185
+ /** Controls if the user picker has a value or not. If not provided, UserPicker will control the value internally. */
186
+ value?: Value;
187
+ /** Width of the user picker field. It can be the amount of pixels as numbers or a string with the percentage. */
188
+ width?: number | string;
189
189
  };
190
190
  export type UserPickerRef = {
191
- focus: () => void;
192
191
  blur: () => void;
192
+ focus: () => void;
193
193
  };
194
194
  export type PopupUserPickerProps = UserPickerProps & {
195
- /** Whether to use the popup version of the single picker */
196
- target: Target;
197
- /** Optional title assigned to popup picker */
198
- popupTitle?: string;
199
195
  /**
200
196
  * The boundary element that the popup will check for overflow.
201
197
  * Defaults to `"viewport"` which are parent scroll containers,
@@ -211,6 +207,8 @@ export type PopupUserPickerProps = UserPickerProps & {
211
207
  * Defaults to `"auto"`.
212
208
  */
213
209
  placement?: Placement;
210
+ /** Optional title assigned to popup picker */
211
+ popupTitle?: string;
214
212
  /**
215
213
  * The root boundary that the popup will check for overflow.
216
214
  * Defaults to `"viewport"` but can be set to `"document"`.
@@ -222,34 +220,36 @@ export type PopupUserPickerProps = UserPickerProps & {
222
220
  * fit in the viewport.
223
221
  */
224
222
  shouldFlip?: boolean;
223
+ /** Whether to use the popup version of the single picker */
224
+ target: Target;
225
225
  };
226
226
  export type AriaAttributesType = AriaAttributes['aria-labelledby'] | AriaAttributes['aria-describedby'];
227
227
  export type BoundariesElement = 'scrollParent' | 'window' | 'viewport' | HTMLElement;
228
228
  export type RootBoundary = 'viewport' | 'document';
229
229
  export type UserPickerState = {
230
- options: OptionData[];
231
- value?: AtlaskitSelectValue;
232
- isDefaultSet: boolean;
233
- inflightRequest: number;
234
230
  count: number;
235
231
  hoveringClearIndicator: boolean;
236
- menuIsOpen: boolean;
232
+ inflightRequest: number;
233
+ initialFocusHandled: boolean;
237
234
  inputValue: string;
235
+ isDefaultSet: boolean;
236
+ menuIsOpen: boolean;
237
+ options: OptionData[];
238
238
  resolving: boolean;
239
239
  showError: boolean;
240
- initialFocusHandled: boolean;
240
+ value?: AtlaskitSelectValue;
241
241
  };
242
242
  export interface HighlightRange {
243
- start: number;
244
243
  end: number;
244
+ start: number;
245
245
  }
246
246
  export interface UserHighlight {
247
247
  name: HighlightRange[];
248
248
  publicName: HighlightRange[];
249
249
  }
250
250
  export interface TeamHighlight {
251
- name: HighlightRange[];
252
251
  description?: HighlightRange[];
252
+ name: HighlightRange[];
253
253
  }
254
254
  export interface GroupHighlight {
255
255
  name: HighlightRange[];
@@ -264,9 +264,9 @@ export interface OptionData {
264
264
  isDisabled?: boolean;
265
265
  lozenge?: string | LozengeProps | ReactNode;
266
266
  name: string;
267
- type?: 'user' | 'team' | 'email' | 'group' | 'custom' | 'external_user';
268
- tooltip?: string;
269
267
  title?: string;
268
+ tooltip?: string;
269
+ type?: 'user' | 'team' | 'email' | 'group' | 'custom' | 'external_user';
270
270
  verified?: boolean;
271
271
  }
272
272
  export declare const UserType = "user";
@@ -274,54 +274,54 @@ export declare const ExternalUserType = "external_user";
274
274
  export type UserSource = 'google' | 'slack' | 'microsoft' | 'jira' | 'confluence' | 'other-atlassian';
275
275
  export interface ExternalUser extends User {
276
276
  externalUserType?: 'crossSite' | 'thirdParty';
277
+ hasProductAccess?: boolean;
277
278
  requiresSourceHydration?: boolean;
278
279
  sources: UserSource[];
279
- hasProductAccess?: boolean;
280
280
  }
281
281
  export interface User extends OptionData {
282
282
  avatarUrl?: string;
283
- publicName?: string;
284
- highlight?: UserHighlight;
285
283
  byline?: string;
286
- type?: 'user' | 'external_user';
287
284
  email?: string;
285
+ highlight?: UserHighlight;
288
286
  isExternal?: boolean;
287
+ publicName?: string;
289
288
  title?: string;
289
+ type?: 'user' | 'external_user';
290
290
  }
291
291
  export type LozengeColor = 'default' | 'success' | 'removed' | 'inprogress' | 'new' | 'moved';
292
292
  export interface LozengeProps {
293
- text: string;
294
- tooltip?: string;
295
293
  appearance?: LozengeColor;
296
294
  isBold?: boolean;
295
+ text: string;
296
+ tooltip?: string;
297
297
  }
298
298
  export declare const TeamType = "team";
299
299
  export interface TeamMember {
300
- name: string;
301
300
  id: string;
301
+ name: string;
302
302
  }
303
303
  export interface Team extends OptionData {
304
304
  avatarUrl?: string;
305
+ byline?: string;
305
306
  description?: string;
307
+ highlight?: TeamHighlight;
308
+ includesYou?: boolean;
306
309
  memberCount?: number;
307
310
  members?: TeamMember[];
308
- includesYou?: boolean;
309
- highlight?: TeamHighlight;
310
311
  type: 'team';
311
- byline?: string;
312
312
  verified?: boolean;
313
313
  }
314
314
  export declare const GroupType = "group";
315
315
  export interface Group extends OptionData {
316
+ byline?: string;
316
317
  highlight?: GroupHighlight;
317
318
  type: 'group';
318
- byline?: string;
319
319
  }
320
320
  export interface Custom extends OptionData {
321
+ analyticsType?: string;
321
322
  avatarUrl?: string;
322
323
  byline?: string;
323
324
  highlight?: CustomHighlight;
324
- analyticsType?: string;
325
325
  type: 'custom';
326
326
  }
327
327
  export type Value = OptionData | OptionData[] | null | undefined;
@@ -330,9 +330,9 @@ export type OptionIdentifier = Pick<OptionData, 'id' | 'type' | 'isDisabled'>;
330
330
  export declare const EmailType = "email";
331
331
  export declare const CustomType = "custom";
332
332
  export interface Email extends OptionData {
333
- type: 'email';
334
- suggestion?: boolean;
335
333
  isPendingAction?: boolean;
334
+ suggestion?: boolean;
335
+ type: 'email';
336
336
  }
337
337
  export type ActionTypes = 'select-option' | 'deselect-option' | 'remove-value' | 'pop-value' | 'set-value' | 'clear' | 'create-option';
338
338
  export type OnChange = (value: Value, action: ActionTypes) => void;
@@ -363,12 +363,12 @@ export type Promisable<T> = T | PromiseLike<T>;
363
363
  export type InputActionTypes = 'set-value' | 'input-change' | 'input-blur' | 'menu-close';
364
364
  export type AtlaskitSelectValue = Option | Array<Option> | null | undefined;
365
365
  export type AtlasKitSelectChange = (value: AtlaskitSelectValue, extraInfo: {
366
- removedValue?: Option;
367
- option?: Option;
368
366
  action: ActionTypes;
367
+ option?: Option;
368
+ removedValue?: Option;
369
369
  }) => void;
370
370
  export type Appearance = 'normal' | 'compact';
371
371
  export type Target = (options: {
372
- ref: any;
373
372
  isOpen: boolean;
373
+ ref: any;
374
374
  }) => ReactNode;
@@ -1,12 +1,12 @@
1
1
  import { type AnalyticsEventPayload } from '@atlaskit/analytics-next';
2
2
  import { type UserPickerProps, type UserPickerState } from './types';
3
3
  export type UserPickerSession = {
4
+ downCount: number;
4
5
  id: string;
5
- start: number;
6
6
  inputChangeTime: number;
7
- upCount: number;
8
- downCount: number;
9
7
  lastKey?: number;
8
+ start: number;
9
+ upCount: number;
10
10
  };
11
11
  export declare const startSession: () => UserPickerSession;
12
12
  export declare const createAndFireEventInElementsChannel: (payload: AnalyticsEventPayload) => (createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent) => import("@atlaskit/analytics-next").UIAnalyticsEvent;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  export type AddOptionAvatarProps = {
3
- label?: string;
4
3
  isLozenge?: boolean;
5
4
  isPendingAction?: boolean;
5
+ label?: string;
6
6
  };
7
7
  export declare const AddOptionAvatar: React.FunctionComponent<AddOptionAvatarProps>;
@@ -1,18 +1,18 @@
1
1
  import React from 'react';
2
2
  import type { Appearance, OptionData, UserPickerProps, UserPickerState } from '../types';
3
3
  export type BaseUserPickerProps = UserPickerProps & {
4
- SelectComponent: React.ComponentType<any>;
5
- pickerProps?: any;
6
- styles: any;
7
4
  components: any;
8
- width: string | number;
9
5
  name?: string;
6
+ pickerProps?: any;
7
+ SelectComponent: React.ComponentType<any>;
8
+ styles: any;
10
9
  /**
11
10
  * @deprecated This is a temporary prop to enable user-pickers to work in Draggable elements in react-beautiful-dnd.
12
11
  * See https://product-fabric.atlassian.net/browse/DSP-15701 for more details.
13
12
  * It may be removed in a future minor or patch when a longer-term workaround is found.
14
13
  */
15
14
  UNSAFE_hasDraggableParentComponent?: boolean;
15
+ width: string | number;
16
16
  };
17
17
  export declare class BaseUserPickerWithoutAnalytics extends React.Component<BaseUserPickerProps, UserPickerState> {
18
18
  static defaultProps: {
@@ -65,97 +65,97 @@ export declare class BaseUserPickerWithoutAnalytics extends React.Component<Base
65
65
  render(): React.JSX.Element;
66
66
  }
67
67
  export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
68
+ addMoreMessage?: string;
69
+ allowEmail?: boolean;
70
+ anchor?: React.ComponentType<any>;
71
+ appearance?: Appearance;
72
+ ariaDescribedBy?: string;
73
+ ariaLabel?: string;
74
+ ariaLabelledBy?: string;
75
+ ariaLive?: "polite" | "off" | "assertive";
76
+ autoFocus?: boolean;
77
+ captureMenuScroll?: boolean;
78
+ clearValueLabel?: string;
79
+ closeMenuOnScroll?: boolean | EventListener;
80
+ components?: import("@atlaskit/select").SelectComponentsConfig<OptionData, boolean>;
81
+ defaultValue?: import("../types").DefaultValue;
82
+ disableInput?: boolean;
83
+ emailLabel?: string;
68
84
  fieldId: string | null;
69
- options?: OptionData[];
70
- width?: number | string;
85
+ footer?: React.ReactNode;
86
+ forwardedRef?: React.ForwardedRef<import("../types").UserPickerRef>;
87
+ groupByTypeOrder?: NonNullable<OptionData["type"]>[];
88
+ header?: React.ReactNode;
71
89
  height?: number | string;
72
- menuMinWidth?: number;
73
- maxPickerHeight?: number;
74
- textFieldBackgroundColor?: boolean;
90
+ inputId?: string;
91
+ isClearable?: boolean;
92
+ isDisabled?: boolean;
93
+ isInvalid?: boolean;
94
+ isLoading?: boolean;
95
+ isMulti?: boolean;
96
+ isValidEmail?: import("./emailValidation").EmailValidator;
75
97
  loadOptions?: import("../types").LoadOptions;
76
98
  loadOptionsErrorMessage?: (value: {
77
99
  inputValue: string;
78
100
  }) => React.ReactNode;
79
101
  loadUserSource?: import("../types").LoadUserSource;
80
- onChange?: import("../types").OnChange;
81
- isMulti?: boolean;
82
- search?: string;
83
- anchor?: React.ComponentType<any>;
84
- open?: boolean;
85
- isLoading?: boolean;
86
- onInputChange?: import("../types").OnInputChange;
87
- onSelection?: import("../types").OnOption;
88
- onFocus?: import("../types").OnPicker;
102
+ maxOptions?: number;
103
+ maxPickerHeight?: number;
104
+ menuMinWidth?: number;
105
+ menuPortalTarget?: HTMLElement;
106
+ menuPosition?: "absolute" | "fixed";
107
+ menuShouldBlockScroll?: boolean;
108
+ name?: string;
109
+ noBorder?: boolean;
110
+ noOptionsMessage?: ((value: {
111
+ inputValue: string;
112
+ }) => string | null | React.ReactNode) | null | React.ReactNode;
89
113
  onBlur?: import("../types").OnPicker;
114
+ onChange?: import("../types").OnChange;
90
115
  onClear?: import("../types").OnPicker;
91
- onOpen?: import("../types").OnPicker;
92
116
  onClose?: import("../types").OnPicker;
117
+ onFocus?: import("../types").OnPicker;
118
+ onInputChange?: import("../types").OnInputChange;
93
119
  onKeyDown?: (event: React.KeyboardEvent) => void;
94
- appearance?: Appearance;
95
- subtle?: boolean;
96
- noBorder?: boolean;
97
- styles?: import("@atlaskit/select").StylesConfig;
98
- components?: import("@atlaskit/select").SelectComponentsConfig<OptionData, boolean>;
99
- defaultValue?: import("../types").DefaultValue;
120
+ onOpen?: import("../types").OnPicker;
121
+ onSelection?: import("../types").OnOption;
122
+ open?: boolean;
123
+ openMenuOnClick?: boolean;
124
+ options?: OptionData[];
100
125
  placeholder?: React.ReactNode;
101
126
  placeholderAvatar?: "person" | "team";
102
- addMoreMessage?: string;
103
- noOptionsMessage?: ((value: {
104
- inputValue: string;
105
- }) => string | null | React.ReactNode) | null | React.ReactNode;
106
- footer?: React.ReactNode;
107
- value?: import("../types").Value;
108
- isDisabled?: boolean;
109
- isInvalid?: boolean;
110
- isClearable?: boolean;
111
- clearValueLabel?: string;
112
- menuPosition?: "absolute" | "fixed";
113
- captureMenuScroll?: boolean;
114
- menuPortalTarget?: HTMLElement;
115
- allowEmail?: boolean;
116
- suggestEmailsForDomain?: string;
117
- emailLabel?: string;
118
- disableInput?: boolean;
119
- isValidEmail?: import("./emailValidation").EmailValidator;
120
- autoFocus?: boolean;
121
- maxOptions?: number;
122
- inputId?: string;
123
- closeMenuOnScroll?: boolean | EventListener;
124
- menuShouldBlockScroll?: boolean;
125
- ariaLabel?: string;
126
- ariaLabelledBy?: string;
127
- ariaDescribedBy?: string;
128
- ariaLive?: "polite" | "off" | "assertive";
129
- name?: string;
130
- header?: React.ReactNode;
131
127
  required?: boolean;
132
- UNSAFE_hasDraggableParentComponent?: boolean;
133
- openMenuOnClick?: boolean;
134
- strategy?: "fixed" | "absolute";
128
+ search?: string;
135
129
  showClearIndicator?: boolean;
136
- forwardedRef?: React.ForwardedRef<import("../types").UserPickerRef>;
137
- groupByTypeOrder?: NonNullable<OptionData["type"]>[];
130
+ strategy?: "fixed" | "absolute";
131
+ styles?: import("@atlaskit/select").StylesConfig;
132
+ subtle?: boolean;
133
+ suggestEmailsForDomain?: string;
134
+ textFieldBackgroundColor?: boolean;
135
+ UNSAFE_hasDraggableParentComponent?: boolean;
136
+ value?: import("../types").Value;
137
+ width?: number | string;
138
138
  } & {
139
- SelectComponent: React.ComponentType<any>;
140
- pickerProps?: any;
141
- styles: any;
142
139
  components: any;
143
- width: string | number;
144
140
  name?: string;
141
+ pickerProps?: any;
142
+ SelectComponent: React.ComponentType<any>;
143
+ styles: any;
145
144
  /**
146
145
  * @deprecated This is a temporary prop to enable user-pickers to work in Draggable elements in react-beautiful-dnd.
147
146
  * See https://product-fabric.atlassian.net/browse/DSP-15701 for more details.
148
147
  * It may be removed in a future minor or patch when a longer-term workaround is found.
149
148
  */
150
149
  UNSAFE_hasDraggableParentComponent?: boolean;
151
- }, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isInvalid" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "onKeyDown" | "styles" | "value" | "required" | "appearance" | "footer" | "defaultValue" | "anchor" | "fieldId" | "width" | "height" | "menuMinWidth" | "maxPickerHeight" | "loadOptions" | "loadUserSource" | "open" | "onSelection" | "onClear" | "onOpen" | "onClose" | "placeholderAvatar" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "ariaLabel" | "ariaLabelledBy" | "ariaDescribedBy" | "ariaLive" | "header" | "UNSAFE_hasDraggableParentComponent" | "strategy" | "showClearIndicator" | "forwardedRef" | "groupByTypeOrder" | "SelectComponent" | "pickerProps"> & {
150
+ width: string | number;
151
+ }, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isInvalid" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "onKeyDown" | "options" | "styles" | "value" | "required" | "appearance" | "footer" | "defaultValue" | "search" | "anchor" | "addMoreMessage" | "allowEmail" | "ariaDescribedBy" | "ariaLabel" | "ariaLabelledBy" | "ariaLive" | "clearValueLabel" | "disableInput" | "emailLabel" | "fieldId" | "forwardedRef" | "groupByTypeOrder" | "header" | "height" | "isValidEmail" | "loadOptions" | "loadUserSource" | "maxOptions" | "maxPickerHeight" | "menuMinWidth" | "onClear" | "onClose" | "onOpen" | "onSelection" | "open" | "placeholderAvatar" | "showClearIndicator" | "strategy" | "suggestEmailsForDomain" | "UNSAFE_hasDraggableParentComponent" | "width" | "pickerProps" | "SelectComponent"> & {
152
152
  isClearable?: boolean | undefined;
153
153
  isMulti?: boolean | undefined;
154
154
  openMenuOnClick?: boolean | undefined;
155
- textFieldBackgroundColor?: boolean | undefined;
156
155
  loadOptionsErrorMessage?: ((value: {
157
156
  inputValue: string;
158
157
  }) => React.ReactNode) | undefined;
159
- subtle?: boolean | undefined;
160
158
  noBorder?: boolean | undefined;
159
+ subtle?: boolean | undefined;
160
+ textFieldBackgroundColor?: boolean | undefined;
161
161
  } & {} & React.RefAttributes<any>>;