@atlaskit/user-picker 12.1.3 → 13.0.0
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 +26 -0
- package/analytics/package.json +1 -8
- package/components/custom-option/main/package.json +1 -8
- package/components/custom-option/package.json +1 -8
- package/components/email-option/main/package.json +1 -8
- package/components/email-option/package.json +1 -8
- package/components/email-validation/package.json +1 -8
- package/components/group-option/main/package.json +1 -8
- package/components/group-option/package.json +1 -8
- package/components/option/package.json +1 -8
- package/components/popup-user-picker/package.json +1 -8
- package/components/single-value/package.json +1 -8
- package/components/team-option/main/package.json +1 -8
- package/components/team-option/package.json +1 -8
- package/components/user-option/package.json +1 -8
- package/components/user-picker/package.json +1 -8
- package/dist/cjs/analytics.js +1 -1
- package/dist/cjs/components/Control.compiled.css +1 -1
- package/dist/cjs/components/Control.js +1 -1
- package/dist/cjs/components/styles.js +2 -2
- package/dist/cjs/util/i18n-util.js +39 -39
- package/dist/es2019/analytics.js +1 -1
- package/dist/es2019/components/Control.compiled.css +1 -1
- package/dist/es2019/components/Control.js +1 -1
- package/dist/es2019/components/styles.js +2 -2
- package/dist/esm/analytics.js +1 -1
- package/dist/esm/components/Control.compiled.css +1 -1
- package/dist/esm/components/Control.js +1 -1
- package/dist/esm/components/styles.js +2 -2
- package/dist/esm/util/i18n-util.js +38 -38
- package/option/package.json +1 -8
- package/package.json +21 -29
- package/types/package.json +1 -8
- package/utils/package.json +1 -8
- package/dist/types-ts4.5/analytics.d.ts +0 -24
- package/dist/types-ts4.5/clients/UserSourceProvider.d.ts +0 -11
- package/dist/types-ts4.5/components/AddOptionAvatar.d.ts +0 -7
- package/dist/types-ts4.5/components/AvatarItemOption.d.ts +0 -16
- package/dist/types-ts4.5/components/AvatarOrIcon.d.ts +0 -17
- package/dist/types-ts4.5/components/BaseUserPicker.d.ts +0 -179
- package/dist/types-ts4.5/components/ClearIndicator.d.ts +0 -10
- package/dist/types-ts4.5/components/Control.d.ts +0 -8
- package/dist/types-ts4.5/components/CustomOption/index.d.ts +0 -4
- package/dist/types-ts4.5/components/CustomOption/main.d.ts +0 -15
- package/dist/types-ts4.5/components/EmailOption/index.d.ts +0 -4
- package/dist/types-ts4.5/components/EmailOption/main.d.ts +0 -21
- package/dist/types-ts4.5/components/ExternalUserOption/ExternalAvatarItemOption.d.ts +0 -14
- package/dist/types-ts4.5/components/ExternalUserOption/InfoIcon.d.ts +0 -3
- package/dist/types-ts4.5/components/ExternalUserOption/SourcesTooltipContent.d.ts +0 -3
- package/dist/types-ts4.5/components/ExternalUserOption/index.d.ts +0 -9
- package/dist/types-ts4.5/components/ExternalUserOption/main.d.ts +0 -20
- package/dist/types-ts4.5/components/ExternalUserSourcesContainer.d.ts +0 -15
- package/dist/types-ts4.5/components/GroupOption/index.d.ts +0 -4
- package/dist/types-ts4.5/components/GroupOption/main.d.ts +0 -21
- package/dist/types-ts4.5/components/HighlightText.d.ts +0 -9
- package/dist/types-ts4.5/components/Input.d.ts +0 -26
- package/dist/types-ts4.5/components/Menu.d.ts +0 -12
- package/dist/types-ts4.5/components/MessagesIntlProvider.d.ts +0 -3
- package/dist/types-ts4.5/components/MultiValue.d.ts +0 -29
- package/dist/types-ts4.5/components/MultiValueContainer.d.ts +0 -37
- package/dist/types-ts4.5/components/Option.d.ts +0 -15
- package/dist/types-ts4.5/components/PopupControl.d.ts +0 -10
- package/dist/types-ts4.5/components/PopupInput.d.ts +0 -8
- package/dist/types-ts4.5/components/PopupUserPicker.d.ts +0 -209
- package/dist/types-ts4.5/components/SingleValue.d.ts +0 -6
- package/dist/types-ts4.5/components/SingleValueContainer.d.ts +0 -15
- package/dist/types-ts4.5/components/SizeableAvatar.d.ts +0 -12
- package/dist/types-ts4.5/components/TeamOption/index.d.ts +0 -4
- package/dist/types-ts4.5/components/TeamOption/main.d.ts +0 -17
- package/dist/types-ts4.5/components/UserOption.d.ts +0 -15
- package/dist/types-ts4.5/components/UserPicker.d.ts +0 -105
- package/dist/types-ts4.5/components/ValueContainerWrapper.d.ts +0 -16
- package/dist/types-ts4.5/components/assets/github.d.ts +0 -2
- package/dist/types-ts4.5/components/assets/google.d.ts +0 -2
- package/dist/types-ts4.5/components/assets/microsoft.d.ts +0 -2
- package/dist/types-ts4.5/components/assets/slack.d.ts +0 -2
- package/dist/types-ts4.5/components/batch.d.ts +0 -1
- package/dist/types-ts4.5/components/components.d.ts +0 -61
- package/dist/types-ts4.5/components/creatable.d.ts +0 -12
- package/dist/types-ts4.5/components/creatableEmailSuggestion.d.ts +0 -20
- package/dist/types-ts4.5/components/emailValidation.d.ts +0 -3
- package/dist/types-ts4.5/components/i18n.d.ts +0 -212
- package/dist/types-ts4.5/components/popup.d.ts +0 -49
- package/dist/types-ts4.5/components/styles.d.ts +0 -7
- package/dist/types-ts4.5/components/utils.d.ts +0 -30
- package/dist/types-ts4.5/i18n/cs.d.ts +0 -50
- package/dist/types-ts4.5/i18n/da.d.ts +0 -50
- package/dist/types-ts4.5/i18n/de.d.ts +0 -50
- package/dist/types-ts4.5/i18n/en.d.ts +0 -50
- package/dist/types-ts4.5/i18n/en_GB.d.ts +0 -50
- package/dist/types-ts4.5/i18n/en_ZZ.d.ts +0 -50
- package/dist/types-ts4.5/i18n/es.d.ts +0 -50
- package/dist/types-ts4.5/i18n/et.d.ts +0 -15
- package/dist/types-ts4.5/i18n/fi.d.ts +0 -50
- package/dist/types-ts4.5/i18n/fr.d.ts +0 -50
- package/dist/types-ts4.5/i18n/hr.d.ts +0 -50
- package/dist/types-ts4.5/i18n/hu.d.ts +0 -50
- package/dist/types-ts4.5/i18n/index.d.ts +0 -36
- package/dist/types-ts4.5/i18n/is.d.ts +0 -7
- package/dist/types-ts4.5/i18n/it.d.ts +0 -50
- package/dist/types-ts4.5/i18n/ja.d.ts +0 -50
- package/dist/types-ts4.5/i18n/ko.d.ts +0 -50
- package/dist/types-ts4.5/i18n/languages.d.ts +0 -28
- package/dist/types-ts4.5/i18n/nb.d.ts +0 -50
- package/dist/types-ts4.5/i18n/nl.d.ts +0 -50
- package/dist/types-ts4.5/i18n/pl.d.ts +0 -50
- package/dist/types-ts4.5/i18n/pt_BR.d.ts +0 -50
- package/dist/types-ts4.5/i18n/pt_PT.d.ts +0 -15
- package/dist/types-ts4.5/i18n/ro.d.ts +0 -7
- package/dist/types-ts4.5/i18n/ru.d.ts +0 -50
- package/dist/types-ts4.5/i18n/sk.d.ts +0 -15
- package/dist/types-ts4.5/i18n/sl.d.ts +0 -50
- package/dist/types-ts4.5/i18n/sr_RS.d.ts +0 -50
- package/dist/types-ts4.5/i18n/sr_YR.d.ts +0 -50
- package/dist/types-ts4.5/i18n/sv.d.ts +0 -50
- package/dist/types-ts4.5/i18n/th.d.ts +0 -50
- package/dist/types-ts4.5/i18n/tr.d.ts +0 -50
- package/dist/types-ts4.5/i18n/uk.d.ts +0 -50
- package/dist/types-ts4.5/i18n/vi.d.ts +0 -50
- package/dist/types-ts4.5/i18n/zh.d.ts +0 -50
- package/dist/types-ts4.5/i18n/zh_TW.d.ts +0 -50
- package/dist/types-ts4.5/index.d.ts +0 -8
- package/dist/types-ts4.5/option.d.ts +0 -12
- package/dist/types-ts4.5/types.d.ts +0 -419
- package/dist/types-ts4.5/util/group-options-by-type/index.d.ts +0 -4
- package/dist/types-ts4.5/util/i18n-util.d.ts +0 -11
- package/dist/types-ts4.5/util/ufoExperiences.d.ts +0 -10
|
@@ -1,419 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
import type React from 'react';
|
|
3
|
-
import { type AriaAttributes } from 'react';
|
|
4
|
-
import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
5
|
-
import { type Placement } from '@atlaskit/popper';
|
|
6
|
-
import { type EmailValidator } from './components/emailValidation';
|
|
7
|
-
import { type StylesConfig, type SelectComponentsConfig, type PopupSelectProps } from '@atlaskit/select';
|
|
8
|
-
import { type BaseUserPickerWithoutAnalytics } from './components/BaseUserPicker';
|
|
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
|
-
/**
|
|
37
|
-
* Stable, locale-independent labels keyed by option type, used only for analytics events.
|
|
38
|
-
* When provided alongside `customGroupLabels`, the corresponding string will be emitted as the
|
|
39
|
-
* `selectedLabel` analytics attribute instead of the raw option type, allowing consumers to
|
|
40
|
-
* report meaningful group identifiers (e.g. `'recommendedAgents'`) without leaking display text.
|
|
41
|
-
*/
|
|
42
|
-
customGroupAnalyticsLabels?: Partial<Record<NonNullable<OptionData['type']>, string>>;
|
|
43
|
-
/** Custom labels for grouped option types. Overrides default labels when groupByTypeOrder is used. */
|
|
44
|
-
customGroupLabels?: Partial<Record<NonNullable<OptionData['type']>, React.ReactNode>>;
|
|
45
|
-
/** Default value for the field to be used on initial render.
|
|
46
|
-
* `defaultValue` differs from `value` in that it sets the initial value then leaves the component 'uncontrolled'
|
|
47
|
-
* whereas setting the `value` prop delegates responsibility for maintaining the value to the caller
|
|
48
|
-
* (i.e. listen to `onChange`) */
|
|
49
|
-
defaultValue?: DefaultValue;
|
|
50
|
-
/** Whether to disable interaction with the input */
|
|
51
|
-
disableInput?: boolean;
|
|
52
|
-
/** Email option label */
|
|
53
|
-
emailLabel?: string;
|
|
54
|
-
/**
|
|
55
|
-
* Used to configure additional information regarding where the
|
|
56
|
-
* user picker has been mounted.
|
|
57
|
-
*
|
|
58
|
-
* The purpose is to give more context as to where user picker events
|
|
59
|
-
* are being fired from, as the current data may not uniquely identify
|
|
60
|
-
* which field is the source.
|
|
61
|
-
*
|
|
62
|
-
* The value will be passed as a data attribute for analytics.
|
|
63
|
-
* Examples include "assignee", "watchers" and "share".
|
|
64
|
-
*
|
|
65
|
-
* A second usage for the fieldId is for server side rendering (SSR) where it must be a unique id per UserPicker
|
|
66
|
-
* instance contained in the serialized SSR content. E.g. a SPA page rendered through SSR that has multiple user pickers.
|
|
67
|
-
*
|
|
68
|
-
* fieldId can be set to null if the integrator is not listening
|
|
69
|
-
* for the analytic events or does not care about SSR.
|
|
70
|
-
*/
|
|
71
|
-
fieldId: string | null;
|
|
72
|
-
/** Footer to be displayed in MenuList */
|
|
73
|
-
footer?: React.ReactNode;
|
|
74
|
-
/** Ref to the underlying select */
|
|
75
|
-
forwardedRef?: React.ForwardedRef<UserPickerRef>;
|
|
76
|
-
/** group the options by type */
|
|
77
|
-
groupByTypeOrder?: NonNullable<OptionData['type']>[];
|
|
78
|
-
/** Header to be displayed in MenuList */
|
|
79
|
-
header?: React.ReactNode;
|
|
80
|
-
/** Sets the height of the user picker. If not set, the height settings will be based on the "compact" or "normal" appearance. */
|
|
81
|
-
height?: number | string;
|
|
82
|
-
/** Whether to include teams UI updates in the resultset. @default false */
|
|
83
|
-
includeTeamsUpdates?: boolean;
|
|
84
|
-
/** Allows clicking on a label with the same id to open user picker. */
|
|
85
|
-
inputId?: string;
|
|
86
|
-
/** Display a remove button on the single picker. True by default. */
|
|
87
|
-
isClearable?: boolean;
|
|
88
|
-
/** Disable all interactions with the picker, putting it in a read-only state. */
|
|
89
|
-
isDisabled?: boolean;
|
|
90
|
-
/** Checks if the footer is focused or not. This is needed to keep the menu open when the footer is focused */
|
|
91
|
-
isFooterFocused?: boolean;
|
|
92
|
-
/** Checks if the header is focused or not. This is needed to keep the menu open when the header is focused */
|
|
93
|
-
isHeaderFocused?: boolean;
|
|
94
|
-
/** Display the picker with a style to show the value is invalid */
|
|
95
|
-
isInvalid?: boolean;
|
|
96
|
-
/** Show the loading indicator. */
|
|
97
|
-
isLoading?: boolean;
|
|
98
|
-
/** To enable multi user picker. */
|
|
99
|
-
isMulti?: boolean;
|
|
100
|
-
/** Override default email validation function. */
|
|
101
|
-
isValidEmail?: EmailValidator;
|
|
102
|
-
/**
|
|
103
|
-
* Function used to load options asynchronously.
|
|
104
|
-
* accepts two optional params:
|
|
105
|
-
* searchText?: optional text to filter results
|
|
106
|
-
* sessionId?: user picker session identifier, used to track success metric for users providers
|
|
107
|
-
*/
|
|
108
|
-
loadOptions?: LoadOptions;
|
|
109
|
-
/**
|
|
110
|
-
* Function to generate the error message when there's a failure executing the loadOptions prop.
|
|
111
|
-
* If not provided, will default to a default error message.
|
|
112
|
-
*/
|
|
113
|
-
loadOptionsErrorMessage?: (value: {
|
|
114
|
-
inputValue: string;
|
|
115
|
-
}) => React.ReactNode;
|
|
116
|
-
/**
|
|
117
|
-
* Function used to load user source if they are an external user.
|
|
118
|
-
* accepts two params:
|
|
119
|
-
* accountId: account ID of the user to lookup sources
|
|
120
|
-
* signal: AbortController signal to abort the request if the tooltip is closed
|
|
121
|
-
*/
|
|
122
|
-
loadUserSource?: LoadUserSource;
|
|
123
|
-
/** The maximum number options to be displayed in the dropdown menu during any state of search. The value should be non-negative. */
|
|
124
|
-
maxOptions?: number;
|
|
125
|
-
/** Sets max height of the user picker. If not set, the height will grow based on number of picked users. */
|
|
126
|
-
maxPickerHeight?: number;
|
|
127
|
-
/** Whether the menu is open or not. */
|
|
128
|
-
menuIsOpen?: boolean;
|
|
129
|
-
/** Sets the minimum width for the menu. If not set, menu will always have the same width of the field. */
|
|
130
|
-
menuMinWidth?: number;
|
|
131
|
-
/** Whether the menu should use a portal, and where it should attach. */
|
|
132
|
-
menuPortalTarget?: HTMLElement;
|
|
133
|
-
/** React-select prop for controlling menu position */
|
|
134
|
-
menuPosition?: 'absolute' | 'fixed';
|
|
135
|
-
/** Whether to block scrolling actions */
|
|
136
|
-
menuShouldBlockScroll?: boolean;
|
|
137
|
-
/** Sets the minimum height of the user picker. If not set, the minimum height will be based on the "height" prop then "compact" or "normal" appearance if height is not set. */
|
|
138
|
-
minHeight?: number | string;
|
|
139
|
-
/** Name to use for input element. */
|
|
140
|
-
name?: string;
|
|
141
|
-
/** Display the picker with no border. */
|
|
142
|
-
noBorder?: boolean;
|
|
143
|
-
/** Message to be shown when the menu is open but no options are provided.
|
|
144
|
-
* If message is null, no message will be displayed.
|
|
145
|
-
* If message is undefined, default message will be displayed.
|
|
146
|
-
*/
|
|
147
|
-
noOptionsMessage?: ((value: {
|
|
148
|
-
inputValue: string;
|
|
149
|
-
}) => string | null | React.ReactNode) | null | React.ReactNode;
|
|
150
|
-
/** Callback for when the field loses focus. */
|
|
151
|
-
onBlur?: OnPicker;
|
|
152
|
-
/** Callback for value change events fired whenever a selection is inserted or removed. */
|
|
153
|
-
onChange?: OnChange;
|
|
154
|
-
/** Callback for when the value/s in the picker is cleared. */
|
|
155
|
-
onClear?: OnPicker;
|
|
156
|
-
/** Callback that is triggered when popup picker is closed */
|
|
157
|
-
onClose?: OnPicker;
|
|
158
|
-
/** Callback for when the field gains focus. */
|
|
159
|
-
onFocus?: OnPicker;
|
|
160
|
-
/** Callback for search input text change events. */
|
|
161
|
-
onInputChange?: OnInputChange;
|
|
162
|
-
/** Callback that is trigger on key down in text input */
|
|
163
|
-
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
164
|
-
/** Callback that is triggered when popup picker is opened */
|
|
165
|
-
onOpen?: OnPicker;
|
|
166
|
-
/** Callback for when a selection is made. */
|
|
167
|
-
onSelection?: OnOption;
|
|
168
|
-
/** Controls if user picker menu is open or not. If not provided, UserPicker will control menu state internally. */
|
|
169
|
-
open?: boolean;
|
|
170
|
-
/** Override the internal behaviour of default menu open on focus and applicable for single value select */
|
|
171
|
-
openMenuOnClick?: boolean;
|
|
172
|
-
/** Whether to open the menu when the input receives focus. Defaults to true for multi-select. */
|
|
173
|
-
openMenuOnFocus?: boolean;
|
|
174
|
-
/** List of users or teams to be used as options by the user picker. */
|
|
175
|
-
options?: OptionData[];
|
|
176
|
-
/** Placeholder text to be shown when there is no value in the field. */
|
|
177
|
-
placeholder?: React.ReactNode;
|
|
178
|
-
/** Placeholder avatar style - defaults to person */
|
|
179
|
-
placeholderAvatar?: 'person' | 'team';
|
|
180
|
-
/** Props to be passed to the popup select component */
|
|
181
|
-
popupSelectProps?: PopupSelectProps<OptionData>;
|
|
182
|
-
/** Accessibility: A field to dictate if this is a mandatory field in the form. */
|
|
183
|
-
required?: boolean;
|
|
184
|
-
/** Input text value. */
|
|
185
|
-
search?: string;
|
|
186
|
-
/** Sets if the footer is focused or not. This is needed to keep the menu open when the footer is focused */
|
|
187
|
-
setIsFooterFocused?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
188
|
-
/** Sets if the header is focused or not. This is needed to keep the menu open when the header is focused */
|
|
189
|
-
setIsHeaderFocused?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
190
|
-
/** Override default behavior and show the clear indicator. */
|
|
191
|
-
showClearIndicator?: boolean;
|
|
192
|
-
/** Positioning strategy for the popper element */
|
|
193
|
-
strategy?: 'fixed' | 'absolute';
|
|
194
|
-
/**
|
|
195
|
-
* You may pass through a `StylesConfig` to be merged with the picker default styles if a custom override is required.
|
|
196
|
-
* Consider using noBorder, subtle before customising further.
|
|
197
|
-
* See https://react-select.com/styles
|
|
198
|
-
*/
|
|
199
|
-
styles?: StylesConfig;
|
|
200
|
-
/** Display the picker with a subtle style. */
|
|
201
|
-
subtle?: boolean;
|
|
202
|
-
/** 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 */
|
|
203
|
-
suggestEmailsForDomain?: string;
|
|
204
|
-
/** Sets the background color to be the same color as a textfield (Atlaskit N10) */
|
|
205
|
-
textFieldBackgroundColor?: boolean;
|
|
206
|
-
/**
|
|
207
|
-
* Enables workaround for when <Select /> is nested inside <Draggable /> from react-beautiful-dnd
|
|
208
|
-
* This relationship prevents the dropdown menu from opening because of bugs in the default focus state and clicking in a particular area of <Select />
|
|
209
|
-
* Context: https://hello.atlassian.net/wiki/spaces/~989411314/pages/2861097485/Investigation+Notes+for+atlaskit+select+react-beautiful-dnd#Temporary-Solution
|
|
210
|
-
*/
|
|
211
|
-
UNSAFE_hasDraggableParentComponent?: boolean;
|
|
212
|
-
/** Controls if the user picker has a value or not. If not provided, UserPicker will control the value internally. */
|
|
213
|
-
value?: Value;
|
|
214
|
-
/** Width of the user picker field. It can be the amount of pixels as numbers or a string with the percentage. */
|
|
215
|
-
width?: number | string;
|
|
216
|
-
};
|
|
217
|
-
export type UserPickerRef = {
|
|
218
|
-
blur: () => void;
|
|
219
|
-
focus: () => void;
|
|
220
|
-
};
|
|
221
|
-
export type PopupUserPickerProps = UserPickerProps & {
|
|
222
|
-
/**
|
|
223
|
-
* The boundary element that the popup will check for overflow.
|
|
224
|
-
* Defaults to `"viewport"` which are parent scroll containers,
|
|
225
|
-
* but can be set to any element.
|
|
226
|
-
*/
|
|
227
|
-
boundariesElement?: BoundariesElement;
|
|
228
|
-
/**
|
|
229
|
-
* Distance the popup should be offset from the reference in the format of [along, away] (units in px).
|
|
230
|
-
*/
|
|
231
|
-
offset?: [
|
|
232
|
-
number,
|
|
233
|
-
number
|
|
234
|
-
];
|
|
235
|
-
/**
|
|
236
|
-
* Placement of where the popup should be displayed relative to the trigger element.
|
|
237
|
-
* Defaults to `"auto"`.
|
|
238
|
-
*/
|
|
239
|
-
placement?: Placement;
|
|
240
|
-
/** Optional title assigned to popup picker */
|
|
241
|
-
popupTitle?: string;
|
|
242
|
-
/**
|
|
243
|
-
* The root boundary that the popup will check for overflow.
|
|
244
|
-
* Defaults to `"viewport"` but can be set to `"document"`.
|
|
245
|
-
* See `@atlaskit/popper` for further details.
|
|
246
|
-
*/
|
|
247
|
-
rootBoundary?: RootBoundary;
|
|
248
|
-
/**
|
|
249
|
-
* Allows the dropdown menu to be placed on the opposite side of its trigger if it does not
|
|
250
|
-
* fit in the viewport.
|
|
251
|
-
*/
|
|
252
|
-
shouldFlip?: boolean;
|
|
253
|
-
/** Whether to use the popup version of the single picker */
|
|
254
|
-
target: Target;
|
|
255
|
-
};
|
|
256
|
-
export type AriaAttributesType = AriaAttributes['aria-labelledby'] | AriaAttributes['aria-describedby'];
|
|
257
|
-
export type BoundariesElement = 'scrollParent' | 'window' | 'viewport' | HTMLElement;
|
|
258
|
-
export type RootBoundary = 'viewport' | 'document';
|
|
259
|
-
export type UserPickerState = {
|
|
260
|
-
count: number;
|
|
261
|
-
hoveringClearIndicator: boolean;
|
|
262
|
-
inflightRequest: number;
|
|
263
|
-
initialFocusHandled: boolean;
|
|
264
|
-
inputValue: string;
|
|
265
|
-
isDefaultSet: boolean;
|
|
266
|
-
menuIsOpen: boolean;
|
|
267
|
-
options: OptionData[];
|
|
268
|
-
resolving: boolean;
|
|
269
|
-
showError: boolean;
|
|
270
|
-
value?: AtlaskitSelectValue;
|
|
271
|
-
};
|
|
272
|
-
export interface HighlightRange {
|
|
273
|
-
end: number;
|
|
274
|
-
start: number;
|
|
275
|
-
}
|
|
276
|
-
export interface UserHighlight {
|
|
277
|
-
name: HighlightRange[];
|
|
278
|
-
publicName: HighlightRange[];
|
|
279
|
-
}
|
|
280
|
-
export interface TeamHighlight {
|
|
281
|
-
description?: HighlightRange[];
|
|
282
|
-
name: HighlightRange[];
|
|
283
|
-
}
|
|
284
|
-
export interface GroupHighlight {
|
|
285
|
-
name: HighlightRange[];
|
|
286
|
-
}
|
|
287
|
-
export interface CustomHighlight {
|
|
288
|
-
name: HighlightRange[];
|
|
289
|
-
}
|
|
290
|
-
export interface OptionData {
|
|
291
|
-
appType?: string | null;
|
|
292
|
-
avatarUrl?: any;
|
|
293
|
-
data?: any;
|
|
294
|
-
fixed?: boolean;
|
|
295
|
-
icon?: ReactNode;
|
|
296
|
-
iconColor?: string;
|
|
297
|
-
id: string;
|
|
298
|
-
includeTeamsUpdates?: boolean;
|
|
299
|
-
isDisabled?: boolean;
|
|
300
|
-
lozenge?: string | LozengeProps | ReactNode;
|
|
301
|
-
name: string;
|
|
302
|
-
title?: string;
|
|
303
|
-
tooltip?: string;
|
|
304
|
-
type?: 'user' | 'team' | 'email' | 'group' | 'custom' | 'external_user';
|
|
305
|
-
verified?: boolean;
|
|
306
|
-
}
|
|
307
|
-
export declare const UserType = "user";
|
|
308
|
-
export declare const ExternalUserType = "external_user";
|
|
309
|
-
export type UserSource = 'google' | 'slack' | 'microsoft' | 'jira' | 'confluence' | 'other-atlassian' | 'email';
|
|
310
|
-
export interface ExternalUser extends User {
|
|
311
|
-
externalUserType?: 'crossSite' | 'thirdParty';
|
|
312
|
-
hasProductAccess?: boolean;
|
|
313
|
-
requiresSourceHydration?: boolean;
|
|
314
|
-
sources: UserSource[];
|
|
315
|
-
}
|
|
316
|
-
export interface User extends OptionData {
|
|
317
|
-
appType?: string | null;
|
|
318
|
-
avatarUrl?: string;
|
|
319
|
-
byline?: string;
|
|
320
|
-
email?: string;
|
|
321
|
-
highlight?: UserHighlight;
|
|
322
|
-
icon?: ReactNode;
|
|
323
|
-
isExternal?: boolean;
|
|
324
|
-
publicName?: string;
|
|
325
|
-
title?: string;
|
|
326
|
-
type?: 'user' | 'external_user';
|
|
327
|
-
userType?: 'DEFAULT' | 'APP' | 'CUSTOMER' | 'SYSTEM';
|
|
328
|
-
}
|
|
329
|
-
export type LozengeColor = 'default' | 'success' | 'removed' | 'inprogress' | 'new' | 'moved';
|
|
330
|
-
export interface LozengeProps {
|
|
331
|
-
appearance?: LozengeColor;
|
|
332
|
-
isBold?: boolean;
|
|
333
|
-
text: string;
|
|
334
|
-
tooltip?: string;
|
|
335
|
-
}
|
|
336
|
-
export declare const TeamType = "team";
|
|
337
|
-
export type TeamState = 'ACTIVE' | 'DISBANDED' | 'PURGED';
|
|
338
|
-
export interface TeamMember {
|
|
339
|
-
id: string;
|
|
340
|
-
name: string;
|
|
341
|
-
}
|
|
342
|
-
export interface Team extends OptionData {
|
|
343
|
-
avatarUrl?: string;
|
|
344
|
-
byline?: string;
|
|
345
|
-
description?: string;
|
|
346
|
-
highlight?: TeamHighlight;
|
|
347
|
-
icon?: ReactNode;
|
|
348
|
-
includesYou?: boolean;
|
|
349
|
-
includeTeamsUpdates?: boolean;
|
|
350
|
-
memberCount?: number;
|
|
351
|
-
members?: TeamMember[];
|
|
352
|
-
state?: TeamState;
|
|
353
|
-
teamTypeName?: string;
|
|
354
|
-
type: 'team';
|
|
355
|
-
verified?: boolean;
|
|
356
|
-
}
|
|
357
|
-
export declare const GroupType = "group";
|
|
358
|
-
export interface Group extends OptionData {
|
|
359
|
-
byline?: string;
|
|
360
|
-
highlight?: GroupHighlight;
|
|
361
|
-
includeTeamsUpdates?: boolean;
|
|
362
|
-
type: 'group';
|
|
363
|
-
}
|
|
364
|
-
export interface Custom extends OptionData {
|
|
365
|
-
analyticsType?: string;
|
|
366
|
-
avatarUrl?: string;
|
|
367
|
-
byline?: string;
|
|
368
|
-
highlight?: CustomHighlight;
|
|
369
|
-
icon?: ReactNode;
|
|
370
|
-
type: 'custom';
|
|
371
|
-
}
|
|
372
|
-
export type Value = OptionData | OptionData[] | null | undefined;
|
|
373
|
-
export type DefaultValue = Value | OptionIdentifier | OptionIdentifier[];
|
|
374
|
-
export type OptionIdentifier = Pick<OptionData, 'id' | 'type' | 'isDisabled'>;
|
|
375
|
-
export declare const EmailType = "email";
|
|
376
|
-
export declare const CustomType = "custom";
|
|
377
|
-
export interface Email extends OptionData {
|
|
378
|
-
isPendingAction?: boolean;
|
|
379
|
-
suggestion?: boolean;
|
|
380
|
-
type: 'email';
|
|
381
|
-
}
|
|
382
|
-
export type ActionTypes = 'select-option' | 'deselect-option' | 'remove-value' | 'pop-value' | 'set-value' | 'clear' | 'create-option';
|
|
383
|
-
export type OnChange = (value: Value, action: ActionTypes) => void;
|
|
384
|
-
export type OnInputChange = (query?: string, sessionId?: string) => void;
|
|
385
|
-
export type OnPicker = (sessionId?: string) => void;
|
|
386
|
-
export type OnOption = (value: Value, sessionId?: string, baseUserPicker?: BaseUserPickerWithoutAnalytics) => void;
|
|
387
|
-
export type Option<Data = OptionData> = {
|
|
388
|
-
data: Data;
|
|
389
|
-
isDisabled?: boolean;
|
|
390
|
-
label: string;
|
|
391
|
-
value: string;
|
|
392
|
-
};
|
|
393
|
-
export type GroupedOptions = {
|
|
394
|
-
label: React.JSX.Element;
|
|
395
|
-
options: Option[];
|
|
396
|
-
};
|
|
397
|
-
export interface UserSourceResult {
|
|
398
|
-
sourceId: string;
|
|
399
|
-
sourceType: UserSource;
|
|
400
|
-
}
|
|
401
|
-
export interface LoadUserSource {
|
|
402
|
-
(accountId: string, signal?: AbortSignal): Promise<UserSourceResult[]>;
|
|
403
|
-
}
|
|
404
|
-
export interface LoadOptions {
|
|
405
|
-
(searchText?: string, sessionId?: string): Promisable<OptionData | OptionData[]> | Iterable<Promisable<OptionData[] | OptionData> | OptionData | OptionData[]>;
|
|
406
|
-
}
|
|
407
|
-
export type Promisable<T> = T | PromiseLike<T>;
|
|
408
|
-
export type InputActionTypes = 'set-value' | 'input-change' | 'input-blur' | 'menu-close';
|
|
409
|
-
export type AtlaskitSelectValue = Option | Array<Option> | null | undefined;
|
|
410
|
-
export type AtlasKitSelectChange = (value: AtlaskitSelectValue, extraInfo: {
|
|
411
|
-
action: ActionTypes;
|
|
412
|
-
option?: Option;
|
|
413
|
-
removedValue?: Option;
|
|
414
|
-
}) => void;
|
|
415
|
-
export type Appearance = 'normal' | 'compact';
|
|
416
|
-
export type Target = (options: {
|
|
417
|
-
isOpen: boolean;
|
|
418
|
-
ref: any;
|
|
419
|
-
}) => ReactNode;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type MemoizedFn } from 'memoize-one';
|
|
3
|
-
import type { OptionData, Option, GroupedOptions } from '../../types';
|
|
4
|
-
export declare const groupOptionsByType: MemoizedFn<(options: Option[], groupByTypeOrder: NonNullable<OptionData['type']>[], customGroupLabels?: Partial<Record<NonNullable<OptionData['type']>, React.ReactNode>>) => Option[] | GroupedOptions[]>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tries to get the most specific messages bundle for a given locale.
|
|
3
|
-
*
|
|
4
|
-
* Strategy:
|
|
5
|
-
* 1. Try to find messages with the exact string (i.e. 'fr_FR')
|
|
6
|
-
* 2. If that doesn't work, try to find messages for the country locale (i.e. 'fr')
|
|
7
|
-
* 3. If that doesn't work, return english messages as a fallback.
|
|
8
|
-
*
|
|
9
|
-
* @param locale string specifying the locale like 'en_GB', or 'fr'.
|
|
10
|
-
*/
|
|
11
|
-
export declare const getMessagesForLocale: (locale: string) => Promise<Record<string, string>>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ConcurrentExperience } from '@atlaskit/ufo';
|
|
3
|
-
export declare const userPickerRenderedUfoExperience: ConcurrentExperience;
|
|
4
|
-
export declare const userPickerOptionsShownUfoExperience: ConcurrentExperience;
|
|
5
|
-
export declare class UfoErrorBoundary extends React.Component<React.PropsWithChildren<{
|
|
6
|
-
id: string;
|
|
7
|
-
}>> {
|
|
8
|
-
componentDidCatch(): void;
|
|
9
|
-
render(): React.ReactNode;
|
|
10
|
-
}
|