@atlaskit/user-picker 11.6.0 → 11.6.2

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 (42) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/afm-cc/tsconfig.json +3 -3
  3. package/dist/cjs/analytics.js +1 -1
  4. package/dist/es2019/analytics.js +1 -1
  5. package/dist/esm/analytics.js +1 -1
  6. package/dist/types/analytics.d.ts +3 -3
  7. package/dist/types/components/AddOptionAvatar.d.ts +1 -1
  8. package/dist/types/components/BaseUserPicker.d.ts +66 -66
  9. package/dist/types/components/EmailOption/main.d.ts +1 -1
  10. package/dist/types/components/ExternalUserOption/index.d.ts +2 -2
  11. package/dist/types/components/ExternalUserOption/main.d.ts +4 -4
  12. package/dist/types/components/ExternalUserSourcesContainer.d.ts +2 -2
  13. package/dist/types/components/HighlightText.d.ts +1 -1
  14. package/dist/types/components/Input.d.ts +2 -2
  15. package/dist/types/components/MultiValue.d.ts +2 -2
  16. package/dist/types/components/MultiValueContainer.d.ts +1 -1
  17. package/dist/types/components/Option.d.ts +2 -2
  18. package/dist/types/components/PopupUserPicker.d.ts +86 -86
  19. package/dist/types/components/SizeableAvatar.d.ts +1 -1
  20. package/dist/types/components/TeamOption/main.d.ts +1 -1
  21. package/dist/types/components/UserOption.d.ts +2 -2
  22. package/dist/types/components/UserPicker.d.ts +56 -56
  23. package/dist/types/types.d.ts +148 -148
  24. package/dist/types-ts4.5/analytics.d.ts +3 -3
  25. package/dist/types-ts4.5/components/AddOptionAvatar.d.ts +1 -1
  26. package/dist/types-ts4.5/components/BaseUserPicker.d.ts +66 -66
  27. package/dist/types-ts4.5/components/EmailOption/main.d.ts +1 -1
  28. package/dist/types-ts4.5/components/ExternalUserOption/index.d.ts +2 -2
  29. package/dist/types-ts4.5/components/ExternalUserOption/main.d.ts +4 -4
  30. package/dist/types-ts4.5/components/ExternalUserSourcesContainer.d.ts +2 -2
  31. package/dist/types-ts4.5/components/HighlightText.d.ts +1 -1
  32. package/dist/types-ts4.5/components/Input.d.ts +2 -2
  33. package/dist/types-ts4.5/components/MultiValue.d.ts +2 -2
  34. package/dist/types-ts4.5/components/MultiValueContainer.d.ts +1 -1
  35. package/dist/types-ts4.5/components/Option.d.ts +2 -2
  36. package/dist/types-ts4.5/components/PopupUserPicker.d.ts +86 -86
  37. package/dist/types-ts4.5/components/SizeableAvatar.d.ts +1 -1
  38. package/dist/types-ts4.5/components/TeamOption/main.d.ts +1 -1
  39. package/dist/types-ts4.5/components/UserOption.d.ts +2 -2
  40. package/dist/types-ts4.5/components/UserPicker.d.ts +56 -56
  41. package/dist/types-ts4.5/types.d.ts +148 -148
  42. package/package.json +2 -3
@@ -11,77 +11,77 @@ export declare class UserPickerWithoutAnalytics extends React.Component<UserPick
11
11
  render(): JSX.Element;
12
12
  }
13
13
  export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
14
+ addMoreMessage?: string;
15
+ allowEmail?: boolean;
16
+ anchor?: React.ComponentType<any>;
17
+ appearance?: import("../types").Appearance;
18
+ ariaDescribedBy?: string;
19
+ ariaLabel?: string;
20
+ ariaLabelledBy?: string;
21
+ ariaLive?: "polite" | "off" | "assertive";
22
+ autoFocus?: boolean;
23
+ captureMenuScroll?: boolean;
24
+ clearValueLabel?: string;
25
+ closeMenuOnScroll?: boolean | EventListener;
26
+ components?: import("@atlaskit/select").SelectComponentsConfig<import("../types").OptionData, boolean>;
27
+ defaultValue?: import("../types").DefaultValue;
28
+ disableInput?: boolean;
29
+ emailLabel?: string;
14
30
  fieldId: string | null;
15
- options?: import("../types").OptionData[];
16
- width?: number | string;
31
+ footer?: React.ReactNode;
32
+ forwardedRef?: React.ForwardedRef<import("../types").UserPickerRef>;
33
+ groupByTypeOrder?: NonNullable<import("../types").OptionData["type"]>[];
34
+ header?: React.ReactNode;
17
35
  height?: number | string;
18
- menuMinWidth?: number;
19
- maxPickerHeight?: number;
20
- textFieldBackgroundColor?: boolean;
36
+ inputId?: string;
37
+ isClearable?: boolean;
38
+ isDisabled?: boolean;
39
+ isInvalid?: boolean;
40
+ isLoading?: boolean;
41
+ isMulti?: boolean;
42
+ isValidEmail?: import("./emailValidation").EmailValidator;
21
43
  loadOptions?: import("../types").LoadOptions;
22
44
  loadOptionsErrorMessage?: (value: {
23
45
  inputValue: string;
24
46
  }) => React.ReactNode;
25
47
  loadUserSource?: import("../types").LoadUserSource;
26
- onChange?: import("../types").OnChange;
27
- isMulti?: boolean;
28
- search?: string;
29
- anchor?: React.ComponentType<any>;
30
- open?: boolean;
31
- isLoading?: boolean;
32
- onInputChange?: import("../types").OnInputChange;
33
- onSelection?: import("../types").OnOption;
34
- onFocus?: import("../types").OnPicker;
48
+ maxOptions?: number;
49
+ maxPickerHeight?: number;
50
+ menuMinWidth?: number;
51
+ menuPortalTarget?: HTMLElement;
52
+ menuPosition?: "absolute" | "fixed";
53
+ menuShouldBlockScroll?: boolean;
54
+ name?: string;
55
+ noBorder?: boolean;
56
+ noOptionsMessage?: ((value: {
57
+ inputValue: string;
58
+ }) => string | null | React.ReactNode) | null | React.ReactNode;
35
59
  onBlur?: import("../types").OnPicker;
60
+ onChange?: import("../types").OnChange;
36
61
  onClear?: import("../types").OnPicker;
37
- onOpen?: import("../types").OnPicker;
38
62
  onClose?: import("../types").OnPicker;
63
+ onFocus?: import("../types").OnPicker;
64
+ onInputChange?: import("../types").OnInputChange;
39
65
  onKeyDown?: (event: React.KeyboardEvent) => void;
40
- appearance?: import("../types").Appearance;
41
- subtle?: boolean;
42
- noBorder?: boolean;
43
- styles?: import("@atlaskit/select").StylesConfig;
44
- components?: import("@atlaskit/select").SelectComponentsConfig<import("../types").OptionData, boolean>;
45
- defaultValue?: import("../types").DefaultValue;
66
+ onOpen?: import("../types").OnPicker;
67
+ onSelection?: import("../types").OnOption;
68
+ open?: boolean;
69
+ openMenuOnClick?: boolean;
70
+ options?: import("../types").OptionData[];
46
71
  placeholder?: React.ReactNode;
47
72
  placeholderAvatar?: "person" | "team";
48
- addMoreMessage?: string;
49
- noOptionsMessage?: ((value: {
50
- inputValue: string;
51
- }) => string | null | React.ReactNode) | null | React.ReactNode;
52
- footer?: React.ReactNode;
53
- value?: import("../types").Value;
54
- isDisabled?: boolean;
55
- isInvalid?: boolean;
56
- isClearable?: boolean;
57
- clearValueLabel?: string;
58
- menuPosition?: "absolute" | "fixed";
59
- captureMenuScroll?: boolean;
60
- menuPortalTarget?: HTMLElement;
61
- allowEmail?: boolean;
62
- suggestEmailsForDomain?: string;
63
- emailLabel?: string;
64
- disableInput?: boolean;
65
- isValidEmail?: import("./emailValidation").EmailValidator;
66
- autoFocus?: boolean;
67
- maxOptions?: number;
68
- inputId?: string;
69
- closeMenuOnScroll?: boolean | EventListener;
70
- menuShouldBlockScroll?: boolean;
71
- ariaLabel?: string;
72
- ariaLabelledBy?: string;
73
- ariaDescribedBy?: string;
74
- ariaLive?: "polite" | "off" | "assertive";
75
- name?: string;
76
- header?: React.ReactNode;
77
73
  required?: boolean;
78
- UNSAFE_hasDraggableParentComponent?: boolean;
79
- openMenuOnClick?: boolean;
80
- strategy?: "fixed" | "absolute";
74
+ search?: string;
81
75
  showClearIndicator?: boolean;
82
- forwardedRef?: React.ForwardedRef<import("../types").UserPickerRef>;
83
- groupByTypeOrder?: NonNullable<import("../types").OptionData["type"]>[];
84
- }, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isClearable" | "isInvalid" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "onKeyDown" | "openMenuOnClick" | "styles" | "value" | "required" | "appearance" | "footer" | "defaultValue" | "anchor" | "fieldId" | "height" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "open" | "onSelection" | "onClear" | "onOpen" | "onClose" | "subtle" | "noBorder" | "placeholderAvatar" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "ariaLabel" | "ariaLabelledBy" | "ariaDescribedBy" | "ariaLive" | "header" | "UNSAFE_hasDraggableParentComponent" | "strategy" | "showClearIndicator" | "forwardedRef" | "groupByTypeOrder"> & {
76
+ strategy?: "fixed" | "absolute";
77
+ styles?: import("@atlaskit/select").StylesConfig;
78
+ subtle?: boolean;
79
+ suggestEmailsForDomain?: string;
80
+ textFieldBackgroundColor?: boolean;
81
+ UNSAFE_hasDraggableParentComponent?: boolean;
82
+ value?: import("../types").Value;
83
+ width?: number | string;
84
+ }, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isClearable" | "isInvalid" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "onKeyDown" | "openMenuOnClick" | "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" | "loadOptionsErrorMessage" | "loadUserSource" | "maxOptions" | "maxPickerHeight" | "menuMinWidth" | "noBorder" | "onClear" | "onClose" | "onOpen" | "onSelection" | "open" | "placeholderAvatar" | "showClearIndicator" | "strategy" | "subtle" | "suggestEmailsForDomain" | "textFieldBackgroundColor" | "UNSAFE_hasDraggableParentComponent"> & {
85
85
  isMulti?: boolean | undefined;
86
86
  width?: number | string | undefined;
87
87
  } & {} & React.RefAttributes<any>>;
@@ -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,
@@ -214,6 +210,8 @@ export type PopupUserPickerProps = UserPickerProps & {
214
210
  * Defaults to `"auto"`.
215
211
  */
216
212
  placement?: Placement;
213
+ /** Optional title assigned to popup picker */
214
+ popupTitle?: string;
217
215
  /**
218
216
  * The root boundary that the popup will check for overflow.
219
217
  * Defaults to `"viewport"` but can be set to `"document"`.
@@ -225,34 +223,36 @@ export type PopupUserPickerProps = UserPickerProps & {
225
223
  * fit in the viewport.
226
224
  */
227
225
  shouldFlip?: boolean;
226
+ /** Whether to use the popup version of the single picker */
227
+ target: Target;
228
228
  };
229
229
  export type AriaAttributesType = AriaAttributes['aria-labelledby'] | AriaAttributes['aria-describedby'];
230
230
  export type BoundariesElement = 'scrollParent' | 'window' | 'viewport' | HTMLElement;
231
231
  export type RootBoundary = 'viewport' | 'document';
232
232
  export type UserPickerState = {
233
- options: OptionData[];
234
- value?: AtlaskitSelectValue;
235
- isDefaultSet: boolean;
236
- inflightRequest: number;
237
233
  count: number;
238
234
  hoveringClearIndicator: boolean;
239
- menuIsOpen: boolean;
235
+ inflightRequest: number;
236
+ initialFocusHandled: boolean;
240
237
  inputValue: string;
238
+ isDefaultSet: boolean;
239
+ menuIsOpen: boolean;
240
+ options: OptionData[];
241
241
  resolving: boolean;
242
242
  showError: boolean;
243
- initialFocusHandled: boolean;
243
+ value?: AtlaskitSelectValue;
244
244
  };
245
245
  export interface HighlightRange {
246
- start: number;
247
246
  end: number;
247
+ start: number;
248
248
  }
249
249
  export interface UserHighlight {
250
250
  name: HighlightRange[];
251
251
  publicName: HighlightRange[];
252
252
  }
253
253
  export interface TeamHighlight {
254
- name: HighlightRange[];
255
254
  description?: HighlightRange[];
255
+ name: HighlightRange[];
256
256
  }
257
257
  export interface GroupHighlight {
258
258
  name: HighlightRange[];
@@ -267,9 +267,9 @@ export interface OptionData {
267
267
  isDisabled?: boolean;
268
268
  lozenge?: string | LozengeProps | ReactNode;
269
269
  name: string;
270
- type?: 'user' | 'team' | 'email' | 'group' | 'custom' | 'external_user';
271
- tooltip?: string;
272
270
  title?: string;
271
+ tooltip?: string;
272
+ type?: 'user' | 'team' | 'email' | 'group' | 'custom' | 'external_user';
273
273
  verified?: boolean;
274
274
  }
275
275
  export declare const UserType = "user";
@@ -277,54 +277,54 @@ export declare const ExternalUserType = "external_user";
277
277
  export type UserSource = 'google' | 'slack' | 'microsoft' | 'jira' | 'confluence' | 'other-atlassian';
278
278
  export interface ExternalUser extends User {
279
279
  externalUserType?: 'crossSite' | 'thirdParty';
280
+ hasProductAccess?: boolean;
280
281
  requiresSourceHydration?: boolean;
281
282
  sources: UserSource[];
282
- hasProductAccess?: boolean;
283
283
  }
284
284
  export interface User extends OptionData {
285
285
  avatarUrl?: string;
286
- publicName?: string;
287
- highlight?: UserHighlight;
288
286
  byline?: string;
289
- type?: 'user' | 'external_user';
290
287
  email?: string;
288
+ highlight?: UserHighlight;
291
289
  isExternal?: boolean;
290
+ publicName?: string;
292
291
  title?: string;
292
+ type?: 'user' | 'external_user';
293
293
  }
294
294
  export type LozengeColor = 'default' | 'success' | 'removed' | 'inprogress' | 'new' | 'moved';
295
295
  export interface LozengeProps {
296
- text: string;
297
- tooltip?: string;
298
296
  appearance?: LozengeColor;
299
297
  isBold?: boolean;
298
+ text: string;
299
+ tooltip?: string;
300
300
  }
301
301
  export declare const TeamType = "team";
302
302
  export interface TeamMember {
303
- name: string;
304
303
  id: string;
304
+ name: string;
305
305
  }
306
306
  export interface Team extends OptionData {
307
307
  avatarUrl?: string;
308
+ byline?: string;
308
309
  description?: string;
310
+ highlight?: TeamHighlight;
311
+ includesYou?: boolean;
309
312
  memberCount?: number;
310
313
  members?: TeamMember[];
311
- includesYou?: boolean;
312
- highlight?: TeamHighlight;
313
314
  type: 'team';
314
- byline?: string;
315
315
  verified?: boolean;
316
316
  }
317
317
  export declare const GroupType = "group";
318
318
  export interface Group extends OptionData {
319
+ byline?: string;
319
320
  highlight?: GroupHighlight;
320
321
  type: 'group';
321
- byline?: string;
322
322
  }
323
323
  export interface Custom extends OptionData {
324
+ analyticsType?: string;
324
325
  avatarUrl?: string;
325
326
  byline?: string;
326
327
  highlight?: CustomHighlight;
327
- analyticsType?: string;
328
328
  type: 'custom';
329
329
  }
330
330
  export type Value = OptionData | OptionData[] | null | undefined;
@@ -333,9 +333,9 @@ export type OptionIdentifier = Pick<OptionData, 'id' | 'type' | 'isDisabled'>;
333
333
  export declare const EmailType = "email";
334
334
  export declare const CustomType = "custom";
335
335
  export interface Email extends OptionData {
336
- type: 'email';
337
- suggestion?: boolean;
338
336
  isPendingAction?: boolean;
337
+ suggestion?: boolean;
338
+ type: 'email';
339
339
  }
340
340
  export type ActionTypes = 'select-option' | 'deselect-option' | 'remove-value' | 'pop-value' | 'set-value' | 'clear' | 'create-option';
341
341
  export type OnChange = (value: Value, action: ActionTypes) => void;
@@ -366,12 +366,12 @@ export type Promisable<T> = T | PromiseLike<T>;
366
366
  export type InputActionTypes = 'set-value' | 'input-change' | 'input-blur' | 'menu-close';
367
367
  export type AtlaskitSelectValue = Option | Array<Option> | null | undefined;
368
368
  export type AtlasKitSelectChange = (value: AtlaskitSelectValue, extraInfo: {
369
- removedValue?: Option;
370
- option?: Option;
371
369
  action: ActionTypes;
370
+ option?: Option;
371
+ removedValue?: Option;
372
372
  }) => void;
373
373
  export type Appearance = 'normal' | 'compact';
374
374
  export type Target = (options: {
375
- ref: any;
376
375
  isOpen: boolean;
376
+ ref: any;
377
377
  }) => ReactNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "11.6.0",
3
+ "version": "11.6.2",
4
4
  "description": "Fabric component for display a dropdown to select a user from",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -50,7 +50,7 @@
50
50
  "dependencies": {
51
51
  "@atlaskit/analytics-next": "^11.1.0",
52
52
  "@atlaskit/avatar": "^25.1.0",
53
- "@atlaskit/icon": "^27.12.0",
53
+ "@atlaskit/icon": "^28.0.0",
54
54
  "@atlaskit/logo": "^19.7.0",
55
55
  "@atlaskit/lozenge": "^13.0.0",
56
56
  "@atlaskit/people-teams-ui-public": "^3.1.0",
@@ -80,7 +80,6 @@
80
80
  "@atlaskit/analytics-viewer": "^0.9.0",
81
81
  "@atlaskit/elements-test-helpers": "workspace:^",
82
82
  "@atlaskit/heading": "^5.2.0",
83
- "@atlaskit/visual-regression": "workspace:^",
84
83
  "@atlassian/feature-flags-test-utils": "^0.3.0",
85
84
  "@emotion/styled": "^11.0.0",
86
85
  "@testing-library/dom": "^10.1.0",