@atlaskit/user-picker 11.24.0 → 11.25.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.
Files changed (71) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/analytics.js +3 -2
  3. package/dist/cjs/components/AvatarItemOption.js +31 -2
  4. package/dist/cjs/components/AvatarOrIcon.js +1 -1
  5. package/dist/cjs/components/BaseUserPicker.js +69 -39
  6. package/dist/cjs/components/CustomOption/main.js +1 -1
  7. package/dist/cjs/components/EmailOption/main.js +1 -1
  8. package/dist/cjs/components/ExternalUserOption/ExternalAvatarItemOption.js +1 -1
  9. package/dist/cjs/components/ExternalUserOption/InfoIcon.js +1 -1
  10. package/dist/cjs/components/GroupOption/main.js +1 -1
  11. package/dist/cjs/components/MultiValue.js +48 -44
  12. package/dist/cjs/components/SingleValue.compiled.css +2 -0
  13. package/dist/cjs/components/SingleValue.js +12 -2
  14. package/dist/cjs/components/i18n.js +5 -0
  15. package/dist/cjs/components/utils.js +1 -1
  16. package/dist/cjs/util/group-options-by-type/index.js +7 -3
  17. package/dist/es2019/analytics.js +2 -1
  18. package/dist/es2019/components/AvatarItemOption.js +31 -2
  19. package/dist/es2019/components/AvatarOrIcon.js +1 -1
  20. package/dist/es2019/components/BaseUserPicker.js +30 -1
  21. package/dist/es2019/components/CustomOption/main.js +1 -1
  22. package/dist/es2019/components/EmailOption/main.js +1 -1
  23. package/dist/es2019/components/ExternalUserOption/ExternalAvatarItemOption.js +1 -1
  24. package/dist/es2019/components/ExternalUserOption/InfoIcon.js +1 -1
  25. package/dist/es2019/components/GroupOption/main.js +1 -1
  26. package/dist/es2019/components/MultiValue.js +43 -35
  27. package/dist/es2019/components/SingleValue.compiled.css +2 -0
  28. package/dist/es2019/components/SingleValue.js +11 -2
  29. package/dist/es2019/components/i18n.js +5 -0
  30. package/dist/es2019/components/utils.js +1 -1
  31. package/dist/es2019/util/group-options-by-type/index.js +7 -3
  32. package/dist/esm/analytics.js +2 -1
  33. package/dist/esm/components/AvatarItemOption.js +31 -2
  34. package/dist/esm/components/AvatarOrIcon.js +1 -1
  35. package/dist/esm/components/BaseUserPicker.js +69 -39
  36. package/dist/esm/components/CustomOption/main.js +1 -1
  37. package/dist/esm/components/EmailOption/main.js +1 -1
  38. package/dist/esm/components/ExternalUserOption/ExternalAvatarItemOption.js +1 -1
  39. package/dist/esm/components/ExternalUserOption/InfoIcon.js +1 -1
  40. package/dist/esm/components/GroupOption/main.js +1 -1
  41. package/dist/esm/components/MultiValue.js +46 -44
  42. package/dist/esm/components/SingleValue.compiled.css +2 -0
  43. package/dist/esm/components/SingleValue.js +11 -2
  44. package/dist/esm/components/i18n.js +5 -0
  45. package/dist/esm/components/utils.js +1 -1
  46. package/dist/esm/util/group-options-by-type/index.js +7 -3
  47. package/dist/types/analytics.d.ts +2 -2
  48. package/dist/types/components/AvatarItemOption.d.ts +2 -2
  49. package/dist/types/components/BaseUserPicker.d.ts +4 -1
  50. package/dist/types/components/ExternalUserOption/index.d.ts +4 -2
  51. package/dist/types/components/ExternalUserOption/main.d.ts +3 -2
  52. package/dist/types/components/GroupOption/main.d.ts +2 -2
  53. package/dist/types/components/PopupUserPicker.d.ts +90 -86
  54. package/dist/types/components/UserPicker.d.ts +2 -1
  55. package/dist/types/components/i18n.d.ts +5 -0
  56. package/dist/types/index.d.ts +1 -1
  57. package/dist/types/types.d.ts +4 -0
  58. package/dist/types/util/group-options-by-type/index.d.ts +2 -1
  59. package/dist/types-ts4.5/analytics.d.ts +2 -2
  60. package/dist/types-ts4.5/components/AvatarItemOption.d.ts +2 -2
  61. package/dist/types-ts4.5/components/BaseUserPicker.d.ts +4 -1
  62. package/dist/types-ts4.5/components/ExternalUserOption/index.d.ts +4 -2
  63. package/dist/types-ts4.5/components/ExternalUserOption/main.d.ts +3 -2
  64. package/dist/types-ts4.5/components/GroupOption/main.d.ts +2 -2
  65. package/dist/types-ts4.5/components/PopupUserPicker.d.ts +90 -86
  66. package/dist/types-ts4.5/components/UserPicker.d.ts +2 -1
  67. package/dist/types-ts4.5/components/i18n.d.ts +5 -0
  68. package/dist/types-ts4.5/index.d.ts +1 -1
  69. package/dist/types-ts4.5/types.d.ts +4 -0
  70. package/dist/types-ts4.5/util/group-options-by-type/index.d.ts +2 -1
  71. package/package.json +13 -7
@@ -1,5 +1,9 @@
1
+ import { type CreateUIAnalyticsEvent, type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
2
+ import { type PopupSelectProps, type SelectComponentsConfig, type StylesConfig } from '@atlaskit/select';
1
3
  import React from 'react';
2
- import { type PopupUserPickerProps } from '../types';
4
+ import { type Appearance, type BoundariesElement, type DefaultValue, type LoadOptions, type LoadUserSource, type OnChange, type OnInputChange, type OnOption, type OnPicker, type OptionData, type PopupUserPickerProps, type RootBoundary, type Target, type UserPickerRef, type Value } from '../types';
5
+ import type { Placement } from '@popperjs/core';
6
+ import type { EmailValidator } from './emailValidation';
3
7
  interface State {
4
8
  flipped: boolean;
5
9
  }
@@ -23,23 +27,23 @@ export declare const PopupUserPicker: React.ForwardRefExoticComponent<Omit<Pick<
23
27
  addMoreMessage?: string;
24
28
  allowEmail?: boolean;
25
29
  anchor?: React.ComponentType<any>;
26
- appearance?: import("..").Appearance;
30
+ appearance?: Appearance;
27
31
  ariaDescribedBy?: string;
28
32
  ariaLabel?: string;
29
33
  ariaLabelledBy?: string;
30
- ariaLive?: "polite" | "off" | "assertive";
34
+ ariaLive?: 'polite' | 'off' | 'assertive';
31
35
  autoFocus?: boolean;
32
36
  captureMenuScroll?: boolean;
33
37
  clearValueLabel?: string;
34
38
  closeMenuOnScroll?: boolean | EventListener;
35
- components?: import("@atlaskit/select").SelectComponentsConfig<import("..").OptionData, boolean>;
36
- defaultValue?: import("..").DefaultValue;
39
+ components?: SelectComponentsConfig<OptionData, boolean>;
40
+ defaultValue?: DefaultValue;
37
41
  disableInput?: boolean;
38
42
  emailLabel?: string;
39
43
  fieldId: string | null;
40
44
  footer?: React.ReactNode;
41
- forwardedRef?: React.ForwardedRef<import("../types").UserPickerRef>;
42
- groupByTypeOrder?: NonNullable<import("..").OptionData["type"]>[];
45
+ forwardedRef?: React.ForwardedRef<UserPickerRef>;
46
+ groupByTypeOrder?: NonNullable<OptionData['type']>[];
43
47
  header?: React.ReactNode;
44
48
  height?: number | string;
45
49
  includeTeamsUpdates?: boolean;
@@ -51,18 +55,18 @@ export declare const PopupUserPicker: React.ForwardRefExoticComponent<Omit<Pick<
51
55
  isInvalid?: boolean;
52
56
  isLoading?: boolean;
53
57
  isMulti?: boolean;
54
- isValidEmail?: import("./emailValidation").EmailValidator;
55
- loadOptions?: import("..").LoadOptions;
58
+ isValidEmail?: EmailValidator;
59
+ loadOptions?: LoadOptions;
56
60
  loadOptionsErrorMessage?: (value: {
57
61
  inputValue: string;
58
62
  }) => React.ReactNode;
59
- loadUserSource?: import("../types").LoadUserSource;
63
+ loadUserSource?: LoadUserSource;
60
64
  maxOptions?: number;
61
65
  maxPickerHeight?: number;
62
66
  menuIsOpen?: boolean;
63
67
  menuMinWidth?: number;
64
68
  menuPortalTarget?: HTMLElement;
65
- menuPosition?: "absolute" | "fixed";
69
+ menuPosition?: 'absolute' | 'fixed';
66
70
  menuShouldBlockScroll?: boolean;
67
71
  minHeight?: number | string;
68
72
  name?: string;
@@ -70,130 +74,130 @@ export declare const PopupUserPicker: React.ForwardRefExoticComponent<Omit<Pick<
70
74
  noOptionsMessage?: ((value: {
71
75
  inputValue: string;
72
76
  }) => string | null | React.ReactNode) | null | React.ReactNode;
73
- onBlur?: import("..").OnPicker;
74
- onChange?: import("..").OnChange;
75
- onClear?: import("..").OnPicker;
76
- onClose?: import("..").OnPicker;
77
- onFocus?: import("..").OnPicker;
78
- onInputChange?: import("..").OnInputChange;
77
+ onBlur?: OnPicker;
78
+ onChange?: OnChange;
79
+ onClear?: OnPicker;
80
+ onClose?: OnPicker;
81
+ onFocus?: OnPicker;
82
+ onInputChange?: OnInputChange;
79
83
  onKeyDown?: (event: React.KeyboardEvent) => void;
80
- onOpen?: import("..").OnPicker;
81
- onSelection?: import("..").OnOption;
84
+ onOpen?: OnPicker;
85
+ onSelection?: OnOption;
82
86
  open?: boolean;
83
87
  openMenuOnClick?: boolean;
84
- options?: import("..").OptionData[];
88
+ options?: OptionData[];
85
89
  placeholder?: React.ReactNode;
86
- placeholderAvatar?: "person" | "team";
87
- popupSelectProps?: import("@atlaskit/select").PopupSelectProps<import("..").OptionData>;
90
+ placeholderAvatar?: 'person' | 'team';
91
+ popupSelectProps?: PopupSelectProps<OptionData>;
88
92
  required?: boolean;
89
93
  search?: string;
90
94
  setIsFooterFocused?: React.Dispatch<React.SetStateAction<boolean>>;
91
95
  setIsHeaderFocused?: React.Dispatch<React.SetStateAction<boolean>>;
92
96
  showClearIndicator?: boolean;
93
- strategy?: "fixed" | "absolute";
94
- styles?: import("@atlaskit/select").StylesConfig;
97
+ strategy?: 'fixed' | 'absolute';
98
+ styles?: StylesConfig;
95
99
  subtle?: boolean;
96
100
  suggestEmailsForDomain?: string;
97
101
  textFieldBackgroundColor?: boolean;
98
102
  UNSAFE_hasDraggableParentComponent?: boolean;
99
- value?: import("..").Value;
103
+ value?: Value;
100
104
  width?: number | string;
101
105
  } & {
102
- boundariesElement?: import("../types").BoundariesElement;
106
+ boundariesElement?: BoundariesElement;
103
107
  offset?: [number, number];
104
- placement?: import("@popperjs/core").Placement;
108
+ placement?: Placement;
105
109
  popupTitle?: string;
106
- rootBoundary?: import("../types").RootBoundary;
110
+ rootBoundary?: RootBoundary;
107
111
  shouldFlip?: boolean;
108
- target: import("..").Target;
109
- }, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, never> & {
110
- placeholder?: React.ReactNode;
111
- isDisabled?: boolean | undefined;
112
+ target: Target;
113
+ }, keyof WithAnalyticsEventsProps>, never> & {
114
+ footer?: React.ReactNode;
115
+ header?: React.ReactNode;
116
+ search?: string | undefined;
117
+ appearance?: Appearance | undefined;
118
+ height?: number | string | undefined;
119
+ minHeight?: number | string | undefined;
120
+ width?: number | string | undefined;
112
121
  offset?: [number, number] | undefined;
113
- onChange?: import("..").OnChange | undefined;
114
- onInputChange?: import("..").OnInputChange | undefined;
115
- value?: import("..").Value;
116
- appearance?: import("..").Appearance | undefined;
117
- autoFocus?: boolean | undefined;
118
- captureMenuScroll?: boolean | undefined;
119
- closeMenuOnScroll?: (boolean | EventListener) | undefined;
120
- components?: import("@atlaskit/select").SelectComponentsConfig<import("..").OptionData, boolean> | undefined;
121
- inputId?: string | undefined;
122
- isClearable?: boolean | undefined;
123
- isInvalid?: boolean | undefined;
124
- isLoading?: boolean | undefined;
125
- isMulti?: boolean | undefined;
126
- menuIsOpen?: boolean | undefined;
127
- menuPosition?: "absolute" | "fixed" | undefined;
128
- menuPortalTarget?: HTMLElement | undefined;
129
- menuShouldBlockScroll?: boolean | undefined;
122
+ shouldFlip?: boolean | undefined;
123
+ boundariesElement?: BoundariesElement | undefined;
124
+ placement?: Placement | undefined;
125
+ anchor?: React.ComponentType<any> | undefined;
126
+ onInputChange?: OnInputChange | undefined;
127
+ onSelection?: OnOption | undefined;
128
+ options?: OptionData[] | undefined;
129
+ required?: boolean | undefined;
130
130
  name?: string | undefined;
131
- noOptionsMessage?: React.ReactNode | ((value: {
132
- inputValue: string;
133
- }) => string | null | React.ReactNode);
134
- onBlur?: import("..").OnPicker | undefined;
135
- onFocus?: import("..").OnPicker | undefined;
131
+ placeholder?: React.ReactNode;
132
+ value?: Value;
133
+ onChange?: OnChange | undefined;
134
+ defaultValue?: DefaultValue;
135
+ autoFocus?: boolean | undefined;
136
+ onFocus?: OnPicker | undefined;
137
+ onBlur?: OnPicker | undefined;
136
138
  onKeyDown?: ((event: React.KeyboardEvent) => void) | undefined;
137
- openMenuOnClick?: boolean | undefined;
138
- options?: import("..").OptionData[] | undefined;
139
- styles?: import("@atlaskit/select").StylesConfig | undefined;
140
- required?: boolean | undefined;
141
- search?: string | undefined;
142
- anchor?: React.ComponentType<any> | undefined;
139
+ isDisabled?: boolean | undefined;
143
140
  addMoreMessage?: string | undefined;
144
141
  allowEmail?: boolean | undefined;
145
142
  ariaDescribedBy?: string | undefined;
146
143
  ariaLabel?: string | undefined;
147
144
  ariaLabelledBy?: string | undefined;
148
- ariaLive?: "polite" | "off" | "assertive" | undefined;
145
+ ariaLive?: 'polite' | 'off' | 'assertive' | undefined;
146
+ captureMenuScroll?: boolean | undefined;
149
147
  clearValueLabel?: string | undefined;
150
- defaultValue?: import("..").DefaultValue;
148
+ closeMenuOnScroll?: (boolean | EventListener) | undefined;
149
+ components?: SelectComponentsConfig<OptionData, boolean> | undefined;
151
150
  disableInput?: boolean | undefined;
152
151
  emailLabel?: string | undefined;
153
152
  fieldId?: string | null | undefined;
154
- footer?: React.ReactNode;
155
- forwardedRef?: React.ForwardedRef<import("../types").UserPickerRef> | undefined;
156
- groupByTypeOrder?: NonNullable<import("..").OptionData["type"]>[] | undefined;
157
- header?: React.ReactNode;
158
- height?: number | string | undefined;
153
+ forwardedRef?: React.ForwardedRef<UserPickerRef> | undefined;
154
+ groupByTypeOrder?: NonNullable<OptionData['type']>[] | undefined;
159
155
  includeTeamsUpdates?: boolean | undefined;
156
+ inputId?: string | undefined;
157
+ isClearable?: boolean | undefined;
160
158
  isFooterFocused?: boolean | undefined;
161
159
  isHeaderFocused?: boolean | undefined;
162
- isValidEmail?: import("./emailValidation").EmailValidator | undefined;
163
- loadOptions?: import("..").LoadOptions | undefined;
160
+ isInvalid?: boolean | undefined;
161
+ isLoading?: boolean | undefined;
162
+ isMulti?: boolean | undefined;
163
+ isValidEmail?: EmailValidator | undefined;
164
+ loadOptions?: LoadOptions | undefined;
164
165
  loadOptionsErrorMessage?: ((value: {
165
166
  inputValue: string;
166
167
  }) => React.ReactNode) | undefined;
167
- loadUserSource?: import("../types").LoadUserSource | undefined;
168
+ loadUserSource?: LoadUserSource | undefined;
168
169
  maxOptions?: number | undefined;
169
170
  maxPickerHeight?: number | undefined;
171
+ menuIsOpen?: boolean | undefined;
170
172
  menuMinWidth?: number | undefined;
171
- minHeight?: number | string | undefined;
173
+ menuPortalTarget?: HTMLElement | undefined;
174
+ menuPosition?: 'absolute' | 'fixed' | undefined;
175
+ menuShouldBlockScroll?: boolean | undefined;
172
176
  noBorder?: boolean | undefined;
173
- onClear?: import("..").OnPicker | undefined;
174
- onClose?: import("..").OnPicker | undefined;
175
- onOpen?: import("..").OnPicker | undefined;
176
- onSelection?: import("..").OnOption | undefined;
177
+ noOptionsMessage?: React.ReactNode | ((value: {
178
+ inputValue: string;
179
+ }) => string | null | React.ReactNode);
180
+ onClear?: OnPicker | undefined;
181
+ onClose?: OnPicker | undefined;
182
+ onOpen?: OnPicker | undefined;
177
183
  open?: boolean | undefined;
178
- placeholderAvatar?: "person" | "team" | undefined;
179
- popupSelectProps?: import("@atlaskit/select").PopupSelectProps<import("..").OptionData> | undefined;
184
+ openMenuOnClick?: boolean | undefined;
185
+ placeholderAvatar?: 'person' | 'team' | undefined;
186
+ popupSelectProps?: PopupSelectProps<OptionData> | undefined;
180
187
  setIsFooterFocused?: React.Dispatch<React.SetStateAction<boolean>> | undefined;
181
188
  setIsHeaderFocused?: React.Dispatch<React.SetStateAction<boolean>> | undefined;
182
189
  showClearIndicator?: boolean | undefined;
183
- strategy?: "fixed" | "absolute" | undefined;
190
+ strategy?: 'fixed' | 'absolute' | undefined;
191
+ styles?: StylesConfig | undefined;
184
192
  subtle?: boolean | undefined;
185
193
  suggestEmailsForDomain?: string | undefined;
186
194
  textFieldBackgroundColor?: boolean | undefined;
187
195
  UNSAFE_hasDraggableParentComponent?: boolean | undefined;
188
- width?: number | string | undefined;
189
- target?: import("..").Target | undefined;
190
196
  popupTitle?: string | undefined;
191
- placement?: import("@popperjs/core").Placement | undefined;
192
- rootBoundary?: import("../types").RootBoundary | undefined;
193
- boundariesElement?: import("../types").BoundariesElement | undefined;
194
- shouldFlip?: boolean | undefined;
197
+ rootBoundary?: RootBoundary | undefined;
198
+ target?: Target | undefined;
195
199
  } & {
196
200
  ref?: React.Ref<any> | undefined;
197
- createAnalyticsEvent?: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | undefined;
198
- }, "ref"> & React.RefAttributes<any>>;
201
+ createAnalyticsEvent?: CreateUIAnalyticsEvent | undefined;
202
+ }, 'ref'> & React.RefAttributes<any>>;
199
203
  export {};
@@ -31,6 +31,7 @@ export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
31
31
  footer?: React.ReactNode;
32
32
  forwardedRef?: React.ForwardedRef<import("../types").UserPickerRef>;
33
33
  groupByTypeOrder?: NonNullable<import("..").OptionData["type"]>[];
34
+ customGroupLabels?: Partial<Record<NonNullable<import("..").OptionData["type"]>, React.ReactNode>>;
34
35
  header?: React.ReactNode;
35
36
  height?: number | string;
36
37
  includeTeamsUpdates?: boolean;
@@ -89,7 +90,7 @@ export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
89
90
  UNSAFE_hasDraggableParentComponent?: boolean;
90
91
  value?: import("..").Value;
91
92
  width?: number | string;
92
- }, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "placeholder" | "isDisabled" | "onChange" | "onInputChange" | "value" | "appearance" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isClearable" | "isInvalid" | "isLoading" | "menuIsOpen" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onFocus" | "onKeyDown" | "openMenuOnClick" | "options" | "styles" | "required" | "search" | "anchor" | "addMoreMessage" | "allowEmail" | "ariaDescribedBy" | "ariaLabel" | "ariaLabelledBy" | "ariaLive" | "clearValueLabel" | "defaultValue" | "disableInput" | "emailLabel" | "fieldId" | "footer" | "forwardedRef" | "groupByTypeOrder" | "header" | "height" | "includeTeamsUpdates" | "isFooterFocused" | "isHeaderFocused" | "isValidEmail" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "maxOptions" | "maxPickerHeight" | "menuMinWidth" | "minHeight" | "noBorder" | "onClear" | "onClose" | "onOpen" | "onSelection" | "open" | "placeholderAvatar" | "popupSelectProps" | "setIsFooterFocused" | "setIsHeaderFocused" | "showClearIndicator" | "strategy" | "subtle" | "suggestEmailsForDomain" | "textFieldBackgroundColor" | "UNSAFE_hasDraggableParentComponent"> & {
93
+ }, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "placeholder" | "isDisabled" | "onChange" | "onInputChange" | "value" | "appearance" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isClearable" | "isInvalid" | "isLoading" | "menuIsOpen" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onFocus" | "onKeyDown" | "openMenuOnClick" | "options" | "styles" | "required" | "search" | "anchor" | "addMoreMessage" | "allowEmail" | "ariaDescribedBy" | "ariaLabel" | "ariaLabelledBy" | "ariaLive" | "clearValueLabel" | "defaultValue" | "disableInput" | "emailLabel" | "fieldId" | "footer" | "forwardedRef" | "groupByTypeOrder" | "customGroupLabels" | "header" | "height" | "includeTeamsUpdates" | "isFooterFocused" | "isHeaderFocused" | "isValidEmail" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "maxOptions" | "maxPickerHeight" | "menuMinWidth" | "minHeight" | "noBorder" | "onClear" | "onClose" | "onOpen" | "onSelection" | "open" | "placeholderAvatar" | "popupSelectProps" | "setIsFooterFocused" | "setIsHeaderFocused" | "showClearIndicator" | "strategy" | "subtle" | "suggestEmailsForDomain" | "textFieldBackgroundColor" | "UNSAFE_hasDraggableParentComponent"> & {
93
94
  isMulti?: boolean | undefined;
94
95
  width?: number | string | undefined;
95
96
  } & {} & React.RefAttributes<any>>;
@@ -169,6 +169,11 @@ export declare const messages: {
169
169
  defaultMessage: string;
170
170
  description: string;
171
171
  };
172
+ archivedLozenge: {
173
+ id: string;
174
+ defaultMessage: string;
175
+ description: string;
176
+ };
172
177
  userTypeLabel: {
173
178
  id: string;
174
179
  defaultMessage: string;
@@ -5,4 +5,4 @@ export { PopupUserPicker } from './components/PopupUserPicker';
5
5
  export { SingleValue } from './components/SingleValue';
6
6
  export { isEmail, isExternalUser, isTeam, isUser, isGroup } from './components/utils';
7
7
  export { CustomType, EmailType, GroupType, TeamType, UserType, ExternalUserType, } from './types';
8
- export type { ActionTypes, Appearance, AtlasKitSelectChange, AtlaskitSelectValue, DefaultValue, InputActionTypes, LozengeProps, OnChange, OnInputChange, OnOption, OnPicker, Option, OptionData, OptionIdentifier, PopupUserPickerProps, Promisable, Target, UserPickerProps, UserPickerState, Value, Custom, Email, Group, GroupHighlight, HighlightRange, LoadOptions, Team, TeamMember, TeamHighlight, User, UserHighlight, ExternalUser, UserSource, } from './types';
8
+ export type { ActionTypes, Appearance, AtlasKitSelectChange, AtlaskitSelectValue, DefaultValue, InputActionTypes, LozengeProps, OnChange, OnInputChange, OnOption, OnPicker, Option, OptionData, OptionIdentifier, PopupUserPickerProps, Promisable, Target, TeamState, UserPickerProps, UserPickerState, Value, Custom, Email, Group, GroupHighlight, HighlightRange, LoadOptions, Team, TeamMember, TeamHighlight, User, UserHighlight, ExternalUser, UserSource, } from './types';
@@ -66,6 +66,8 @@ export type UserPickerProps = WithAnalyticsEventsProps & {
66
66
  forwardedRef?: React.ForwardedRef<UserPickerRef>;
67
67
  /** group the options by type */
68
68
  groupByTypeOrder?: NonNullable<OptionData['type']>[];
69
+ /** Custom labels for grouped option types. Overrides default labels when groupByTypeOrder is used. */
70
+ customGroupLabels?: Partial<Record<NonNullable<OptionData['type']>, React.ReactNode>>;
69
71
  /** Header to be displayed in MenuList */
70
72
  header?: React.ReactNode;
71
73
  /** Sets the height of the user picker. If not set, the height settings will be based on the "compact" or "normal" appearance. */
@@ -320,6 +322,7 @@ export interface LozengeProps {
320
322
  tooltip?: string;
321
323
  }
322
324
  export declare const TeamType = "team";
325
+ export type TeamState = 'ACTIVE' | 'DISBANDED' | 'PURGED';
323
326
  export interface TeamMember {
324
327
  id: string;
325
328
  name: string;
@@ -334,6 +337,7 @@ export interface Team extends OptionData {
334
337
  includeTeamsUpdates?: boolean;
335
338
  memberCount?: number;
336
339
  members?: TeamMember[];
340
+ state?: TeamState;
337
341
  teamTypeName?: string;
338
342
  type: 'team';
339
343
  verified?: boolean;
@@ -1,2 +1,3 @@
1
+ import React from 'react';
1
2
  import type { OptionData, Option, GroupedOptions } from '../../types';
2
- export declare const groupOptionsByType: import("memoize-one").MemoizedFn<(options: Option[], groupByTypeOrder: NonNullable<OptionData["type"]>[]) => Option[] | GroupedOptions[]>;
3
+ export declare const groupOptionsByType: import("memoize-one").MemoizedFn<(options: Option[], groupByTypeOrder: NonNullable<OptionData["type"]>[], customGroupLabels?: Partial<Record<NonNullable<OptionData["type"]>, React.ReactNode>>) => Option[] | GroupedOptions[]>;
@@ -1,4 +1,4 @@
1
- import { type AnalyticsEventPayload } from '@atlaskit/analytics-next';
1
+ import { UIAnalyticsEvent, type AnalyticsEventPayload, type CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
2
2
  import { type UserPickerProps, type UserPickerState } from './types';
3
3
  export type UserPickerSession = {
4
4
  downCount: number;
@@ -9,7 +9,7 @@ export type UserPickerSession = {
9
9
  upCount: number;
10
10
  };
11
11
  export declare const startSession: () => UserPickerSession;
12
- export declare const createAndFireEventInElementsChannel: (payload: AnalyticsEventPayload) => (createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent) => import("@atlaskit/analytics-next").UIAnalyticsEvent;
12
+ export declare const createAndFireEventInElementsChannel: (payload: AnalyticsEventPayload) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => UIAnalyticsEvent;
13
13
  export interface EventCreator {
14
14
  (props: UserPickerProps, state: UserPickerState, session?: UserPickerSession): AnalyticsEventPayload;
15
15
  (props: UserPickerProps, state: UserPickerState, session?: UserPickerSession, ...args: any[]): AnalyticsEventPayload;
@@ -3,9 +3,9 @@
3
3
  * @jsx jsx
4
4
  */
5
5
  import { type ReactNode } from 'react';
6
- import { jsx } from '@emotion/react';
6
+ import { jsx, type SerializedStyles } from '@emotion/react';
7
7
  import { type LozengeProps } from '../types';
8
- export declare const textWrapper: (color?: string) => import("@emotion/utils").SerializedStyles;
8
+ export declare const textWrapper: (color?: string) => SerializedStyles;
9
9
  export type AvatarItemOptionProps = {
10
10
  avatar: ReactNode;
11
11
  isDisabled?: boolean;
@@ -62,6 +62,8 @@ export declare class BaseUserPickerWithoutAnalytics extends React.Component<Base
62
62
  componentDidUpdate(prevProps: UserPickerProps, prevState: UserPickerState): void;
63
63
  private handleKeyDown;
64
64
  handleClearIndicatorHover: (hoveringClearIndicator: boolean) => void;
65
+ private getOptionsOld;
66
+ private getOptionsNew;
65
67
  private getOptions;
66
68
  private getAppearance;
67
69
  get ariaProps(): Partial<AriaAttributes>;
@@ -90,6 +92,7 @@ export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
90
92
  footer?: React.ReactNode;
91
93
  forwardedRef?: React.ForwardedRef<UserPickerRef>;
92
94
  groupByTypeOrder?: NonNullable<OptionData['type']>[];
95
+ customGroupLabels?: Partial<Record<NonNullable<OptionData['type']>, React.ReactNode>>;
93
96
  header?: React.ReactNode;
94
97
  height?: number | string;
95
98
  includeTeamsUpdates?: boolean;
@@ -160,7 +163,7 @@ export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
160
163
  */
161
164
  UNSAFE_hasDraggableParentComponent?: boolean;
162
165
  width: string | number;
163
- }, keyof WithAnalyticsEventsProps>, 'options' | 'noOptionsMessage' | 'placeholder' | 'addMoreMessage' | 'allowEmail' | 'anchor' | 'appearance' | 'ariaDescribedBy' | 'ariaLabel' | 'ariaLabelledBy' | 'ariaLive' | 'autoFocus' | 'captureMenuScroll' | 'clearValueLabel' | 'closeMenuOnScroll' | 'components' | 'defaultValue' | 'disableInput' | 'emailLabel' | 'fieldId' | 'footer' | 'forwardedRef' | 'groupByTypeOrder' | 'header' | 'height' | 'includeTeamsUpdates' | 'inputId' | 'isDisabled' | 'isFooterFocused' | 'isInvalid' | 'isLoading' | 'isValidEmail' | 'loadOptions' | 'loadUserSource' | 'maxOptions' | 'maxPickerHeight' | 'menuIsOpen' | 'menuMinWidth' | 'menuPortalTarget' | 'menuPosition' | 'menuShouldBlockScroll' | 'name' | 'onBlur' | 'onChange' | 'onClear' | 'onClose' | 'onFocus' | 'onInputChange' | 'onKeyDown' | 'onOpen' | 'onSelection' | 'open' | 'placeholderAvatar' | 'popupSelectProps' | 'required' | 'search' | 'setIsFooterFocused' | 'showClearIndicator' | 'strategy' | 'styles' | 'suggestEmailsForDomain' | 'UNSAFE_hasDraggableParentComponent' | 'value' | 'width' | 'pickerProps' | 'SelectComponent'> & {
166
+ }, keyof WithAnalyticsEventsProps>, 'options' | 'noOptionsMessage' | 'placeholder' | 'addMoreMessage' | 'allowEmail' | 'anchor' | 'appearance' | 'ariaDescribedBy' | 'ariaLabel' | 'ariaLabelledBy' | 'ariaLive' | 'autoFocus' | 'captureMenuScroll' | 'clearValueLabel' | 'closeMenuOnScroll' | 'components' | 'defaultValue' | 'disableInput' | 'emailLabel' | 'fieldId' | 'footer' | 'forwardedRef' | 'groupByTypeOrder' | 'customGroupLabels' | 'header' | 'height' | 'includeTeamsUpdates' | 'inputId' | 'isDisabled' | 'isFooterFocused' | 'isInvalid' | 'isLoading' | 'isValidEmail' | 'loadOptions' | 'loadUserSource' | 'maxOptions' | 'maxPickerHeight' | 'menuIsOpen' | 'menuMinWidth' | 'menuPortalTarget' | 'menuPosition' | 'menuShouldBlockScroll' | 'name' | 'onBlur' | 'onChange' | 'onClear' | 'onClose' | 'onFocus' | 'onInputChange' | 'onKeyDown' | 'onOpen' | 'onSelection' | 'open' | 'placeholderAvatar' | 'popupSelectProps' | 'required' | 'search' | 'setIsFooterFocused' | 'showClearIndicator' | 'strategy' | 'styles' | 'suggestEmailsForDomain' | 'UNSAFE_hasDraggableParentComponent' | 'value' | 'width' | 'pickerProps' | 'SelectComponent'> & {
164
167
  isClearable?: boolean | undefined;
165
168
  isMulti?: boolean | undefined;
166
169
  loadOptionsErrorMessage?: ((value: {
@@ -1,7 +1,9 @@
1
+ import type { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
1
2
  import React from 'react';
3
+ import type { ExternalUser } from '../../types';
2
4
  declare const AsyncExternalUserOption: React.LazyExoticComponent<React.ForwardRefExoticComponent<Omit<{
3
5
  isSelected: boolean;
4
6
  status?: string;
5
- user: import("../..").ExternalUser;
6
- }, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any>>>;
7
+ user: ExternalUser;
8
+ }, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>>;
7
9
  export default AsyncExternalUserOption;
@@ -3,10 +3,11 @@
3
3
  * @jsx jsx
4
4
  */
5
5
  import React from 'react';
6
+ import { type SerializedStyles } from '@emotion/react';
6
7
  import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
7
8
  import { type ExternalUser } from '../../types';
8
- export declare const imageContainer: import("@emotion/utils").SerializedStyles;
9
- export declare const emailDomainWrapper: import("@emotion/utils").SerializedStyles;
9
+ export declare const imageContainer: SerializedStyles;
10
+ export declare const emailDomainWrapper: SerializedStyles;
10
11
  export type ExternalUserOptionProps = WithAnalyticsEventsProps & {
11
12
  isSelected: boolean;
12
13
  status?: string;
@@ -3,9 +3,9 @@
3
3
  * @jsx jsx
4
4
  */
5
5
  import React from 'react';
6
- import { jsx } from '@emotion/react';
6
+ import { jsx, type SerializedStyles } from '@emotion/react';
7
7
  import { type Group } from '../../types';
8
- export declare const groupOptionIconWrapper: import("@emotion/utils").SerializedStyles;
8
+ export declare const groupOptionIconWrapper: SerializedStyles;
9
9
  export type GroupOptionProps = {
10
10
  group: Group;
11
11
  includeTeamsUpdates?: boolean;