@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.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/analytics.js +3 -2
- package/dist/cjs/components/AvatarItemOption.js +31 -2
- package/dist/cjs/components/AvatarOrIcon.js +1 -1
- package/dist/cjs/components/BaseUserPicker.js +69 -39
- package/dist/cjs/components/CustomOption/main.js +1 -1
- package/dist/cjs/components/EmailOption/main.js +1 -1
- package/dist/cjs/components/ExternalUserOption/ExternalAvatarItemOption.js +1 -1
- package/dist/cjs/components/ExternalUserOption/InfoIcon.js +1 -1
- package/dist/cjs/components/GroupOption/main.js +1 -1
- package/dist/cjs/components/MultiValue.js +48 -44
- package/dist/cjs/components/SingleValue.compiled.css +2 -0
- package/dist/cjs/components/SingleValue.js +12 -2
- package/dist/cjs/components/i18n.js +5 -0
- package/dist/cjs/components/utils.js +1 -1
- package/dist/cjs/util/group-options-by-type/index.js +7 -3
- package/dist/es2019/analytics.js +2 -1
- package/dist/es2019/components/AvatarItemOption.js +31 -2
- package/dist/es2019/components/AvatarOrIcon.js +1 -1
- package/dist/es2019/components/BaseUserPicker.js +30 -1
- package/dist/es2019/components/CustomOption/main.js +1 -1
- package/dist/es2019/components/EmailOption/main.js +1 -1
- package/dist/es2019/components/ExternalUserOption/ExternalAvatarItemOption.js +1 -1
- package/dist/es2019/components/ExternalUserOption/InfoIcon.js +1 -1
- package/dist/es2019/components/GroupOption/main.js +1 -1
- package/dist/es2019/components/MultiValue.js +43 -35
- package/dist/es2019/components/SingleValue.compiled.css +2 -0
- package/dist/es2019/components/SingleValue.js +11 -2
- package/dist/es2019/components/i18n.js +5 -0
- package/dist/es2019/components/utils.js +1 -1
- package/dist/es2019/util/group-options-by-type/index.js +7 -3
- package/dist/esm/analytics.js +2 -1
- package/dist/esm/components/AvatarItemOption.js +31 -2
- package/dist/esm/components/AvatarOrIcon.js +1 -1
- package/dist/esm/components/BaseUserPicker.js +69 -39
- package/dist/esm/components/CustomOption/main.js +1 -1
- package/dist/esm/components/EmailOption/main.js +1 -1
- package/dist/esm/components/ExternalUserOption/ExternalAvatarItemOption.js +1 -1
- package/dist/esm/components/ExternalUserOption/InfoIcon.js +1 -1
- package/dist/esm/components/GroupOption/main.js +1 -1
- package/dist/esm/components/MultiValue.js +46 -44
- package/dist/esm/components/SingleValue.compiled.css +2 -0
- package/dist/esm/components/SingleValue.js +11 -2
- package/dist/esm/components/i18n.js +5 -0
- package/dist/esm/components/utils.js +1 -1
- package/dist/esm/util/group-options-by-type/index.js +7 -3
- package/dist/types/analytics.d.ts +2 -2
- package/dist/types/components/AvatarItemOption.d.ts +2 -2
- package/dist/types/components/BaseUserPicker.d.ts +4 -1
- package/dist/types/components/ExternalUserOption/index.d.ts +4 -2
- package/dist/types/components/ExternalUserOption/main.d.ts +3 -2
- package/dist/types/components/GroupOption/main.d.ts +2 -2
- package/dist/types/components/PopupUserPicker.d.ts +90 -86
- package/dist/types/components/UserPicker.d.ts +2 -1
- package/dist/types/components/i18n.d.ts +5 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types.d.ts +4 -0
- package/dist/types/util/group-options-by-type/index.d.ts +2 -1
- package/dist/types-ts4.5/analytics.d.ts +2 -2
- package/dist/types-ts4.5/components/AvatarItemOption.d.ts +2 -2
- package/dist/types-ts4.5/components/BaseUserPicker.d.ts +4 -1
- package/dist/types-ts4.5/components/ExternalUserOption/index.d.ts +4 -2
- package/dist/types-ts4.5/components/ExternalUserOption/main.d.ts +3 -2
- package/dist/types-ts4.5/components/GroupOption/main.d.ts +2 -2
- package/dist/types-ts4.5/components/PopupUserPicker.d.ts +90 -86
- package/dist/types-ts4.5/components/UserPicker.d.ts +2 -1
- package/dist/types-ts4.5/components/i18n.d.ts +5 -0
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +4 -0
- package/dist/types-ts4.5/util/group-options-by-type/index.d.ts +2 -1
- 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?:
|
|
30
|
+
appearance?: Appearance;
|
|
27
31
|
ariaDescribedBy?: string;
|
|
28
32
|
ariaLabel?: string;
|
|
29
33
|
ariaLabelledBy?: string;
|
|
30
|
-
ariaLive?:
|
|
34
|
+
ariaLive?: 'polite' | 'off' | 'assertive';
|
|
31
35
|
autoFocus?: boolean;
|
|
32
36
|
captureMenuScroll?: boolean;
|
|
33
37
|
clearValueLabel?: string;
|
|
34
38
|
closeMenuOnScroll?: boolean | EventListener;
|
|
35
|
-
components?:
|
|
36
|
-
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<
|
|
42
|
-
groupByTypeOrder?: NonNullable<
|
|
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?:
|
|
55
|
-
loadOptions?:
|
|
58
|
+
isValidEmail?: EmailValidator;
|
|
59
|
+
loadOptions?: LoadOptions;
|
|
56
60
|
loadOptionsErrorMessage?: (value: {
|
|
57
61
|
inputValue: string;
|
|
58
62
|
}) => React.ReactNode;
|
|
59
|
-
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?:
|
|
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?:
|
|
74
|
-
onChange?:
|
|
75
|
-
onClear?:
|
|
76
|
-
onClose?:
|
|
77
|
-
onFocus?:
|
|
78
|
-
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?:
|
|
81
|
-
onSelection?:
|
|
84
|
+
onOpen?: OnPicker;
|
|
85
|
+
onSelection?: OnOption;
|
|
82
86
|
open?: boolean;
|
|
83
87
|
openMenuOnClick?: boolean;
|
|
84
|
-
options?:
|
|
88
|
+
options?: OptionData[];
|
|
85
89
|
placeholder?: React.ReactNode;
|
|
86
|
-
placeholderAvatar?:
|
|
87
|
-
popupSelectProps?:
|
|
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?:
|
|
94
|
-
styles?:
|
|
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?:
|
|
103
|
+
value?: Value;
|
|
100
104
|
width?: number | string;
|
|
101
105
|
} & {
|
|
102
|
-
boundariesElement?:
|
|
106
|
+
boundariesElement?: BoundariesElement;
|
|
103
107
|
offset?: [number, number];
|
|
104
|
-
placement?:
|
|
108
|
+
placement?: Placement;
|
|
105
109
|
popupTitle?: string;
|
|
106
|
-
rootBoundary?:
|
|
110
|
+
rootBoundary?: RootBoundary;
|
|
107
111
|
shouldFlip?: boolean;
|
|
108
|
-
target:
|
|
109
|
-
}, keyof
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
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
|
-
|
|
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?:
|
|
145
|
+
ariaLive?: 'polite' | 'off' | 'assertive' | undefined;
|
|
146
|
+
captureMenuScroll?: boolean | undefined;
|
|
149
147
|
clearValueLabel?: string | undefined;
|
|
150
|
-
|
|
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
|
-
|
|
155
|
-
|
|
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
|
-
|
|
163
|
-
|
|
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?:
|
|
168
|
+
loadUserSource?: LoadUserSource | undefined;
|
|
168
169
|
maxOptions?: number | undefined;
|
|
169
170
|
maxPickerHeight?: number | undefined;
|
|
171
|
+
menuIsOpen?: boolean | undefined;
|
|
170
172
|
menuMinWidth?: number | undefined;
|
|
171
|
-
|
|
173
|
+
menuPortalTarget?: HTMLElement | undefined;
|
|
174
|
+
menuPosition?: 'absolute' | 'fixed' | undefined;
|
|
175
|
+
menuShouldBlockScroll?: boolean | undefined;
|
|
172
176
|
noBorder?: boolean | undefined;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
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
|
-
|
|
179
|
-
|
|
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?:
|
|
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
|
-
|
|
192
|
-
|
|
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?:
|
|
198
|
-
},
|
|
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;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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';
|
package/dist/types/types.d.ts
CHANGED
|
@@ -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:
|
|
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) =>
|
|
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:
|
|
6
|
-
}, keyof
|
|
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:
|
|
9
|
-
export declare const emailDomainWrapper:
|
|
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:
|
|
8
|
+
export declare const groupOptionIconWrapper: SerializedStyles;
|
|
9
9
|
export type GroupOptionProps = {
|
|
10
10
|
group: Group;
|
|
11
11
|
includeTeamsUpdates?: boolean;
|