@atlaskit/user-picker 9.1.0 → 9.2.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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlaskit/user-picker
2
2
 
3
+ ## 9.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`607b182bb8a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/607b182bb8a) - Add typecasting to prevent type errors during multivaluecontainer placeholder translations. Also fix warnings for importing json attributes from version.json for analytics.
8
+
9
+ ## 9.2.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`64dc40c32bc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/64dc40c32bc) - Add support for aria-labelledby and aria-live
14
+
15
+ ## 9.1.1
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 9.1.0
4
22
 
5
23
  ### Minor Changes
@@ -13,7 +13,7 @@ var _analyticsNext = require("@atlaskit/analytics-next");
13
13
 
14
14
  var _uuid = require("uuid");
15
15
 
16
- var _version = require("./version.json");
16
+ var _version = _interopRequireDefault(require("./version.json"));
17
17
 
18
18
  var _utils = require("./components/utils");
19
19
 
@@ -21,6 +21,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
21
21
 
22
22
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
23
23
 
24
+ var packageName = _version.default.name;
25
+ var packageVersion = _version.default.version;
24
26
  var UUID_REGEXP_TEAMS_GROUPS = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
25
27
  var UUID_REGEXP_OLD_AAID = /^[a-fA-F0-9]{1,8}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
26
28
  var UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
@@ -47,8 +49,8 @@ var createEvent = function createEvent(eventType, action, actionSubject) {
47
49
  action: action,
48
50
  actionSubject: actionSubject,
49
51
  attributes: _objectSpread({
50
- packageName: _version.name,
51
- packageVersion: _version.version
52
+ packageName: packageName,
53
+ packageVersion: packageVersion
52
54
  }, attributes)
53
55
  };
54
56
  };
@@ -516,7 +516,9 @@ var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
516
516
  fieldId = _this$props4.fieldId,
517
517
  inputId = _this$props4.inputId,
518
518
  maxPickerHeight = _this$props4.maxPickerHeight,
519
- textFieldBackgroundColor = _this$props4.textFieldBackgroundColor;
519
+ textFieldBackgroundColor = _this$props4.textFieldBackgroundColor,
520
+ ariaLabelledBy = _this$props4.ariaLabelledBy,
521
+ ariaLive = _this$props4.ariaLive;
520
522
  var _this$state3 = this.state,
521
523
  count = _this$state3.count,
522
524
  hoveringClearIndicator = _this$state3.hoveringClearIndicator,
@@ -528,6 +530,8 @@ var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
528
530
  return /*#__PURE__*/_react.default.createElement(SelectComponent, (0, _extends2.default)({
529
531
  value: value,
530
532
  autoFocus: autoFocus !== undefined ? autoFocus : menuIsOpen,
533
+ "aria-labelledby": ariaLabelledBy,
534
+ "aria-live": ariaLive,
531
535
  ref: this.handleSelectRef,
532
536
  isMulti: isMulti,
533
537
  options: this.getOptions(),
@@ -95,7 +95,16 @@ var MultiValueContainer = /*#__PURE__*/function (_React$PureComponent) {
95
95
 
96
96
  if (addMoreMessage === undefined) {
97
97
  return /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _i18n.messages.addMore, function (addMore) {
98
- return _this.addPlaceholder(addMore);
98
+ var _join, _addMoreMessages;
99
+
100
+ var addMoreMessages = addMore;
101
+
102
+ if (addMore && typeof addMore === 'string') {
103
+ addMoreMessages = [addMore];
104
+ }
105
+
106
+ var placeholder = (_join = (_addMoreMessages = addMoreMessages) === null || _addMoreMessages === void 0 ? void 0 : _addMoreMessages.join('')) !== null && _join !== void 0 ? _join : '';
107
+ return _this.addPlaceholder(placeholder);
99
108
  });
100
109
  }
101
110
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "9.1.0",
3
+ "version": "9.2.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,7 +1,9 @@
1
1
  import { createAndFireEvent } from '@atlaskit/analytics-next';
2
2
  import { v4 as uuidv4 } from 'uuid';
3
- import { name as packageName, version as packageVersion } from './version.json';
3
+ import versionJson from './version.json';
4
4
  import { isExternalUser } from './components/utils';
5
+ const packageName = versionJson.name;
6
+ const packageVersion = versionJson.version;
5
7
  const UUID_REGEXP_TEAMS_GROUPS = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
6
8
  const UUID_REGEXP_OLD_AAID = /^[a-fA-F0-9]{1,8}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
7
9
  const UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
@@ -470,7 +470,9 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
470
470
  fieldId,
471
471
  inputId,
472
472
  maxPickerHeight,
473
- textFieldBackgroundColor
473
+ textFieldBackgroundColor,
474
+ ariaLabelledBy,
475
+ ariaLive
474
476
  } = this.props;
475
477
  const {
476
478
  count,
@@ -484,6 +486,8 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
484
486
  return /*#__PURE__*/React.createElement(SelectComponent, _extends({
485
487
  value: value,
486
488
  autoFocus: autoFocus !== undefined ? autoFocus : menuIsOpen,
489
+ "aria-labelledby": ariaLabelledBy,
490
+ "aria-live": ariaLive,
487
491
  ref: this.handleSelectRef,
488
492
  isMulti: isMulti,
489
493
  options: this.getOptions(),
@@ -67,7 +67,18 @@ export class MultiValueContainer extends React.PureComponent {
67
67
  }
68
68
 
69
69
  if (addMoreMessage === undefined) {
70
- return /*#__PURE__*/React.createElement(FormattedMessage, messages.addMore, addMore => this.addPlaceholder(addMore));
70
+ return /*#__PURE__*/React.createElement(FormattedMessage, messages.addMore, addMore => {
71
+ var _join, _addMoreMessages;
72
+
73
+ let addMoreMessages = addMore;
74
+
75
+ if (addMore && typeof addMore === 'string') {
76
+ addMoreMessages = [addMore];
77
+ }
78
+
79
+ const placeholder = (_join = (_addMoreMessages = addMoreMessages) === null || _addMoreMessages === void 0 ? void 0 : _addMoreMessages.join('')) !== null && _join !== void 0 ? _join : '';
80
+ return this.addPlaceholder(placeholder);
81
+ });
71
82
  }
72
83
 
73
84
  return this.addPlaceholder(addMoreMessage);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "9.1.0",
3
+ "version": "9.2.1",
4
4
  "sideEffects": false
5
5
  }
@@ -6,8 +6,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
6
6
 
7
7
  import { createAndFireEvent } from '@atlaskit/analytics-next';
8
8
  import { v4 as uuidv4 } from 'uuid';
9
- import { name as packageName, version as packageVersion } from './version.json';
9
+ import versionJson from './version.json';
10
10
  import { isExternalUser } from './components/utils';
11
+ var packageName = versionJson.name;
12
+ var packageVersion = versionJson.version;
11
13
  var UUID_REGEXP_TEAMS_GROUPS = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
12
14
  var UUID_REGEXP_OLD_AAID = /^[a-fA-F0-9]{1,8}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
13
15
  var UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
@@ -518,7 +518,9 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
518
518
  fieldId = _this$props4.fieldId,
519
519
  inputId = _this$props4.inputId,
520
520
  maxPickerHeight = _this$props4.maxPickerHeight,
521
- textFieldBackgroundColor = _this$props4.textFieldBackgroundColor;
521
+ textFieldBackgroundColor = _this$props4.textFieldBackgroundColor,
522
+ ariaLabelledBy = _this$props4.ariaLabelledBy,
523
+ ariaLive = _this$props4.ariaLive;
522
524
  var _this$state3 = this.state,
523
525
  count = _this$state3.count,
524
526
  hoveringClearIndicator = _this$state3.hoveringClearIndicator,
@@ -530,6 +532,8 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
530
532
  return /*#__PURE__*/React.createElement(SelectComponent, _extends({
531
533
  value: value,
532
534
  autoFocus: autoFocus !== undefined ? autoFocus : menuIsOpen,
535
+ "aria-labelledby": ariaLabelledBy,
536
+ "aria-live": ariaLive,
533
537
  ref: this.handleSelectRef,
534
538
  isMulti: isMulti,
535
539
  options: this.getOptions(),
@@ -77,7 +77,16 @@ export var MultiValueContainer = /*#__PURE__*/function (_React$PureComponent) {
77
77
 
78
78
  if (addMoreMessage === undefined) {
79
79
  return /*#__PURE__*/React.createElement(FormattedMessage, messages.addMore, function (addMore) {
80
- return _this.addPlaceholder(addMore);
80
+ var _join, _addMoreMessages;
81
+
82
+ var addMoreMessages = addMore;
83
+
84
+ if (addMore && typeof addMore === 'string') {
85
+ addMoreMessages = [addMore];
86
+ }
87
+
88
+ var placeholder = (_join = (_addMoreMessages = addMoreMessages) === null || _addMoreMessages === void 0 ? void 0 : _addMoreMessages.join('')) !== null && _join !== void 0 ? _join : '';
89
+ return _this.addPlaceholder(placeholder);
81
90
  });
82
91
  }
83
92
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "9.1.0",
3
+ "version": "9.2.1",
4
4
  "sideEffects": false
5
5
  }
@@ -51,7 +51,7 @@ export declare class BaseUserPickerWithoutAnalytics extends React.Component<Base
51
51
  private getAppearance;
52
52
  render(): JSX.Element;
53
53
  }
54
- export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<BaseUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isDisabled" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "placeholder" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "SelectComponent" | "pickerProps"> & Partial<Pick<Omit<BaseUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "isClearable" | "isMulti" | "textFieldBackgroundColor" | "subtle" | "noBorder">> & Partial<Pick<{
54
+ export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<BaseUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isDisabled" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "placeholder" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "ariaLabelledBy" | "ariaLive" | "SelectComponent" | "pickerProps"> & Partial<Pick<Omit<BaseUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "isClearable" | "isMulti" | "textFieldBackgroundColor" | "subtle" | "noBorder">> & Partial<Pick<{
55
55
  isMulti: boolean;
56
56
  subtle: boolean;
57
57
  noBorder: boolean;
@@ -27,7 +27,7 @@ export declare class PopupUserPickerWithoutAnalytics extends React.Component<Pop
27
27
  };
28
28
  render(): JSX.Element;
29
29
  }
30
- export declare const PopupUserPicker: React.ForwardRefExoticComponent<Pick<Omit<PopupUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "target" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "placeholder" | "styles" | "value" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "popupTitle"> & Partial<Pick<Omit<PopupUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "isMulti" | "width" | "offset" | "boundariesElement" | "placement" | "rootBoundary" | "shouldFlip">> & Partial<Pick<{
30
+ export declare const PopupUserPicker: React.ForwardRefExoticComponent<Pick<Omit<PopupUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "target" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "placeholder" | "styles" | "value" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "ariaLabelledBy" | "ariaLive" | "popupTitle"> & Partial<Pick<Omit<PopupUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "isMulti" | "width" | "offset" | "boundariesElement" | "placement" | "rootBoundary" | "shouldFlip">> & Partial<Pick<{
31
31
  boundariesElement: string;
32
32
  width: number;
33
33
  isMulti: boolean;
@@ -10,7 +10,7 @@ export declare class UserPickerWithoutAnalytics extends React.Component<UserPick
10
10
  componentDidMount(): void;
11
11
  render(): JSX.Element;
12
12
  }
13
- export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<UserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "placeholder" | "styles" | "value" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions"> & Partial<Pick<Omit<UserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "isMulti" | "width">> & Partial<Pick<{
13
+ export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<UserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "placeholder" | "styles" | "value" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "ariaLabelledBy" | "ariaLive"> & Partial<Pick<Omit<UserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "isMulti" | "width">> & Partial<Pick<{
14
14
  width: number;
15
15
  isMulti: boolean;
16
16
  }, never>> & React.RefAttributes<any>>;
@@ -132,6 +132,10 @@ export declare type UserPickerProps = WithAnalyticsEventsProps & {
132
132
  closeMenuOnScroll?: boolean | EventListener;
133
133
  /** Whether to block scrolling actions */
134
134
  menuShouldBlockScroll?: boolean;
135
+ /** Accessibility: Identifies the element (or elements) that labels the current element.*/
136
+ ariaLabelledBy?: string;
137
+ /** Accessibility: Used to set the priority with which screen reader should treat updates to live regions.*/
138
+ ariaLive?: 'polite' | 'off' | 'assertive';
135
139
  };
136
140
  export declare type PopupUserPickerProps = UserPickerProps & {
137
141
  /** Whether to use the popup version of the single picker */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "9.1.0",
3
+ "version": "9.2.1",
4
4
  "description": "Fabric component for display a dropdown to select a user from",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -27,12 +27,12 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@atlaskit/analytics-next": "^8.2.0",
30
- "@atlaskit/avatar": "^20.5.0",
30
+ "@atlaskit/avatar": "^21.0.0",
31
31
  "@atlaskit/icon": "^21.10.0",
32
- "@atlaskit/logo": "^13.6.0",
32
+ "@atlaskit/logo": "^13.7.0",
33
33
  "@atlaskit/lozenge": "^11.0.0",
34
34
  "@atlaskit/popper": "^5.0.0",
35
- "@atlaskit/select": "^15.2.0",
35
+ "@atlaskit/select": "^15.3.0",
36
36
  "@atlaskit/spinner": "^15.1.4",
37
37
  "@atlaskit/theme": "^12.1.0",
38
38
  "@atlaskit/tokens": "^0.10.0",
@@ -59,7 +59,7 @@
59
59
  "@atlaskit/range": "^6.0.0",
60
60
  "@atlaskit/section-message": "^6.0.0",
61
61
  "@atlaskit/textfield": "^5.0.0",
62
- "@atlaskit/util-data-test": "^17.2.0",
62
+ "@atlaskit/util-data-test": "^17.3.0",
63
63
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
64
64
  "@emotion/styled": "^10.0.7",
65
65
  "@testing-library/dom": "^7.7.3",
package/report.api.md ADDED
@@ -0,0 +1,490 @@
1
+ ## API Report File for "@atlaskit/user-picker"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+ import { Placement } from '@atlaskit/popper';
7
+ import { default as React_2 } from 'react';
8
+ import { ReactNode } from 'react';
9
+ import { StylesConfig } from '@atlaskit/select';
10
+ import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
11
+
12
+ // @public (undocumented)
13
+ export type ActionTypes =
14
+ | 'select-option'
15
+ | 'deselect-option'
16
+ | 'remove-value'
17
+ | 'pop-value'
18
+ | 'set-value'
19
+ | 'clear'
20
+ | 'create-option';
21
+
22
+ // @public (undocumented)
23
+ export type Appearance = 'normal' | 'compact';
24
+
25
+ // @public (undocumented)
26
+ export type AtlasKitSelectChange = (
27
+ value: AtlaskitSelectValue,
28
+ extraInfo: {
29
+ removedValue?: Option_2;
30
+ option?: Option_2;
31
+ action: ActionTypes;
32
+ },
33
+ ) => void;
34
+
35
+ // @public (undocumented)
36
+ export type AtlaskitSelectValue = Option_2 | Array<Option_2> | null | undefined;
37
+
38
+ // @public (undocumented)
39
+ export type DefaultValue = Value | OptionIdentifier | OptionIdentifier[];
40
+
41
+ // @public (undocumented)
42
+ export interface Email extends OptionData {
43
+ // (undocumented)
44
+ suggestion?: boolean;
45
+ // (undocumented)
46
+ type: 'email';
47
+ }
48
+
49
+ // @public (undocumented)
50
+ export const EmailType = 'email';
51
+
52
+ // @public (undocumented)
53
+ export type EmailValidationResponse = 'INVALID' | 'POTENTIAL' | 'VALID';
54
+
55
+ // @public (undocumented)
56
+ export type EmailValidator = (inputText: string) => EmailValidationResponse;
57
+
58
+ // @public (undocumented)
59
+ export interface ExternalUser extends User {
60
+ // (undocumented)
61
+ externalUserType?: 'crossSite' | 'thirdParty';
62
+ // (undocumented)
63
+ requiresSourceHydration?: boolean;
64
+ // (undocumented)
65
+ sources: UserSource[];
66
+ }
67
+
68
+ // @public (undocumented)
69
+ export interface Group extends OptionData {
70
+ // (undocumented)
71
+ highlight?: GroupHighlight;
72
+ // (undocumented)
73
+ type: 'group';
74
+ }
75
+
76
+ // @public (undocumented)
77
+ export interface GroupHighlight {
78
+ // (undocumented)
79
+ name: HighlightRange[];
80
+ }
81
+
82
+ // @public (undocumented)
83
+ export const GroupType = 'group';
84
+
85
+ // @public (undocumented)
86
+ export interface HighlightRange {
87
+ // (undocumented)
88
+ end: number;
89
+ // (undocumented)
90
+ start: number;
91
+ }
92
+
93
+ // @public (undocumented)
94
+ export type InputActionTypes =
95
+ | 'set-value'
96
+ | 'input-change'
97
+ | 'input-blur'
98
+ | 'menu-close';
99
+
100
+ // @public (undocumented)
101
+ export const isEmail: (option: OptionData) => option is Email;
102
+
103
+ // @public (undocumented)
104
+ export const isExternalUser: (option: OptionData) => option is ExternalUser;
105
+
106
+ // @public (undocumented)
107
+ export const isTeam: (option: OptionData) => option is Team;
108
+
109
+ // @public (undocumented)
110
+ export const isUser: (option: OptionData) => option is User;
111
+
112
+ // @public (undocumented)
113
+ export const isValidEmail: EmailValidator;
114
+
115
+ // @public (undocumented)
116
+ export interface LoadOptions {
117
+ // (undocumented)
118
+ (searchText?: string, sessionId?: string):
119
+ | Promisable<OptionData | OptionData[]>
120
+ | Iterable<
121
+ Promisable<OptionData[] | OptionData> | OptionData | OptionData[]
122
+ >;
123
+ }
124
+
125
+ // @public (undocumented)
126
+ export interface LozengeProps {
127
+ // (undocumented)
128
+ appearance?: LozengeColor;
129
+ // (undocumented)
130
+ isBold?: boolean;
131
+ // (undocumented)
132
+ text: string;
133
+ // (undocumented)
134
+ tooltip?: string;
135
+ }
136
+
137
+ // @public (undocumented)
138
+ export type OnChange = (value: Value, action: ActionTypes) => void;
139
+
140
+ // @public (undocumented)
141
+ export type OnInputChange = (query?: string, sessionId?: string) => void;
142
+
143
+ // @public (undocumented)
144
+ export type OnOption = (value: Value, sessionId?: string) => void;
145
+
146
+ // @public (undocumented)
147
+ export type OnPicker = (sessionId?: string) => void;
148
+
149
+ // @public (undocumented)
150
+ type Option_2<Data = OptionData> = {
151
+ label: string;
152
+ value: string;
153
+ data: Data;
154
+ };
155
+ export { Option_2 as Option };
156
+
157
+ // @public (undocumented)
158
+ export interface OptionData {
159
+ // (undocumented)
160
+ avatarUrl?: any;
161
+ // (undocumented)
162
+ fixed?: boolean;
163
+ // (undocumented)
164
+ id: string;
165
+ // (undocumented)
166
+ lozenge?: string | LozengeProps;
167
+ // (undocumented)
168
+ name: string;
169
+ // (undocumented)
170
+ type?: 'user' | 'team' | 'email' | 'group';
171
+ }
172
+
173
+ // @public (undocumented)
174
+ export type OptionIdentifier = Pick<OptionData, 'id' | 'type'>;
175
+
176
+ // @public (undocumented)
177
+ export const PopupUserPicker: React_2.ForwardRefExoticComponent<
178
+ Pick<
179
+ Omit<PopupUserPickerProps, keyof WithAnalyticsEventsProps>,
180
+ | 'target'
181
+ | 'autoFocus'
182
+ | 'captureMenuScroll'
183
+ | 'closeMenuOnScroll'
184
+ | 'inputId'
185
+ | 'isClearable'
186
+ | 'isDisabled'
187
+ | 'isLoading'
188
+ | 'menuPosition'
189
+ | 'menuPortalTarget'
190
+ | 'menuShouldBlockScroll'
191
+ | 'noOptionsMessage'
192
+ | 'onBlur'
193
+ | 'onChange'
194
+ | 'onFocus'
195
+ | 'onInputChange'
196
+ | 'options'
197
+ | 'placeholder'
198
+ | 'styles'
199
+ | 'value'
200
+ | 'defaultValue'
201
+ | 'fieldId'
202
+ | 'menuMinWidth'
203
+ | 'maxPickerHeight'
204
+ | 'textFieldBackgroundColor'
205
+ | 'loadOptions'
206
+ | 'loadUserSource'
207
+ | 'search'
208
+ | 'anchor'
209
+ | 'open'
210
+ | 'onSelection'
211
+ | 'onClear'
212
+ | 'onClose'
213
+ | 'appearance'
214
+ | 'subtle'
215
+ | 'noBorder'
216
+ | 'addMoreMessage'
217
+ | 'clearValueLabel'
218
+ | 'allowEmail'
219
+ | 'suggestEmailsForDomain'
220
+ | 'emailLabel'
221
+ | 'disableInput'
222
+ | 'isValidEmail'
223
+ | 'maxOptions'
224
+ | 'ariaLabelledBy'
225
+ | 'ariaLive'
226
+ | 'popupTitle'
227
+ > &
228
+ Partial<
229
+ Pick<
230
+ Omit<PopupUserPickerProps, keyof WithAnalyticsEventsProps>,
231
+ | 'isMulti'
232
+ | 'width'
233
+ | 'offset'
234
+ | 'boundariesElement'
235
+ | 'placement'
236
+ | 'rootBoundary'
237
+ | 'shouldFlip'
238
+ >
239
+ > &
240
+ Partial<
241
+ Pick<
242
+ {
243
+ boundariesElement: string;
244
+ width: number;
245
+ isMulti: boolean;
246
+ offset: number[];
247
+ placement: string;
248
+ rootBoundary: string;
249
+ shouldFlip: boolean;
250
+ },
251
+ never
252
+ >
253
+ > &
254
+ React_2.RefAttributes<any>
255
+ >;
256
+
257
+ // @public (undocumented)
258
+ export type PopupUserPickerProps = UserPickerProps & {
259
+ target: Target;
260
+ popupTitle?: string;
261
+ boundariesElement?: BoundariesElement;
262
+ offset?: [number, number];
263
+ placement?: Placement;
264
+ rootBoundary?: RootBoundary;
265
+ shouldFlip?: boolean;
266
+ };
267
+
268
+ // @public (undocumented)
269
+ export type Promisable<T> = T | PromiseLike<T>;
270
+
271
+ // @public (undocumented)
272
+ export type Target = (options: { ref: any; isOpen: boolean }) => ReactNode;
273
+
274
+ // @public (undocumented)
275
+ export interface Team extends OptionData {
276
+ // (undocumented)
277
+ avatarUrl?: string;
278
+ // (undocumented)
279
+ description?: string;
280
+ // (undocumented)
281
+ highlight?: TeamHighlight;
282
+ // (undocumented)
283
+ includesYou?: boolean;
284
+ // (undocumented)
285
+ memberCount?: number;
286
+ // (undocumented)
287
+ members?: TeamMember[];
288
+ // (undocumented)
289
+ type: 'team';
290
+ }
291
+
292
+ // @public (undocumented)
293
+ export interface TeamHighlight {
294
+ // (undocumented)
295
+ description?: HighlightRange[];
296
+ // (undocumented)
297
+ name: HighlightRange[];
298
+ }
299
+
300
+ // @public (undocumented)
301
+ export interface TeamMember {
302
+ // (undocumented)
303
+ id: string;
304
+ // (undocumented)
305
+ name: string;
306
+ }
307
+
308
+ // @public (undocumented)
309
+ export const TeamType = 'team';
310
+
311
+ // @public (undocumented)
312
+ export interface User extends OptionData {
313
+ // (undocumented)
314
+ avatarUrl?: string;
315
+ // (undocumented)
316
+ byline?: string;
317
+ // (undocumented)
318
+ email?: string;
319
+ // (undocumented)
320
+ highlight?: UserHighlight;
321
+ // (undocumented)
322
+ isExternal?: boolean;
323
+ // (undocumented)
324
+ publicName?: string;
325
+ // (undocumented)
326
+ type?: 'user';
327
+ }
328
+
329
+ // @public (undocumented)
330
+ export interface UserHighlight {
331
+ // (undocumented)
332
+ name: HighlightRange[];
333
+ // (undocumented)
334
+ publicName: HighlightRange[];
335
+ }
336
+
337
+ // @public (undocumented)
338
+ const UserPicker: React_2.ForwardRefExoticComponent<
339
+ Pick<
340
+ Omit<UserPickerProps, keyof WithAnalyticsEventsProps>,
341
+ | 'autoFocus'
342
+ | 'captureMenuScroll'
343
+ | 'closeMenuOnScroll'
344
+ | 'inputId'
345
+ | 'isClearable'
346
+ | 'isDisabled'
347
+ | 'isLoading'
348
+ | 'menuPosition'
349
+ | 'menuPortalTarget'
350
+ | 'menuShouldBlockScroll'
351
+ | 'noOptionsMessage'
352
+ | 'onBlur'
353
+ | 'onChange'
354
+ | 'onFocus'
355
+ | 'onInputChange'
356
+ | 'options'
357
+ | 'placeholder'
358
+ | 'styles'
359
+ | 'value'
360
+ | 'defaultValue'
361
+ | 'fieldId'
362
+ | 'menuMinWidth'
363
+ | 'maxPickerHeight'
364
+ | 'textFieldBackgroundColor'
365
+ | 'loadOptions'
366
+ | 'loadUserSource'
367
+ | 'search'
368
+ | 'anchor'
369
+ | 'open'
370
+ | 'onSelection'
371
+ | 'onClear'
372
+ | 'onClose'
373
+ | 'appearance'
374
+ | 'subtle'
375
+ | 'noBorder'
376
+ | 'addMoreMessage'
377
+ | 'clearValueLabel'
378
+ | 'allowEmail'
379
+ | 'suggestEmailsForDomain'
380
+ | 'emailLabel'
381
+ | 'disableInput'
382
+ | 'isValidEmail'
383
+ | 'maxOptions'
384
+ | 'ariaLabelledBy'
385
+ | 'ariaLive'
386
+ > &
387
+ Partial<
388
+ Pick<
389
+ Omit<UserPickerProps, keyof WithAnalyticsEventsProps>,
390
+ 'isMulti' | 'width'
391
+ >
392
+ > &
393
+ Partial<
394
+ Pick<
395
+ {
396
+ width: number;
397
+ isMulti: boolean;
398
+ },
399
+ never
400
+ >
401
+ > &
402
+ React_2.RefAttributes<any>
403
+ >;
404
+ export default UserPicker;
405
+
406
+ // @public (undocumented)
407
+ export type UserPickerProps = WithAnalyticsEventsProps & {
408
+ fieldId: string | null;
409
+ options?: OptionData[];
410
+ width?: number | string;
411
+ menuMinWidth?: number;
412
+ maxPickerHeight?: number;
413
+ textFieldBackgroundColor?: boolean;
414
+ loadOptions?: LoadOptions;
415
+ loadUserSource?: LoadUserSource;
416
+ onChange?: OnChange;
417
+ isMulti?: boolean;
418
+ search?: string;
419
+ anchor?: React_2.ComponentType<any>;
420
+ open?: boolean;
421
+ isLoading?: boolean;
422
+ onInputChange?: OnInputChange;
423
+ onSelection?: OnOption;
424
+ onFocus?: OnPicker;
425
+ onBlur?: OnPicker;
426
+ onClear?: OnPicker;
427
+ onClose?: OnPicker;
428
+ appearance?: Appearance;
429
+ subtle?: boolean;
430
+ noBorder?: boolean;
431
+ styles?: StylesConfig;
432
+ defaultValue?: DefaultValue;
433
+ placeholder?: React_2.ReactNode;
434
+ addMoreMessage?: string;
435
+ noOptionsMessage?:
436
+ | ((value: { inputValue: string }) => string | null)
437
+ | string
438
+ | null;
439
+ value?: Value;
440
+ isDisabled?: boolean;
441
+ isClearable?: boolean;
442
+ clearValueLabel?: string;
443
+ menuPosition?: 'absolute' | 'fixed';
444
+ captureMenuScroll?: boolean;
445
+ menuPortalTarget?: HTMLElement;
446
+ allowEmail?: boolean;
447
+ suggestEmailsForDomain?: string;
448
+ emailLabel?: string;
449
+ disableInput?: boolean;
450
+ isValidEmail?: EmailValidator;
451
+ autoFocus?: boolean;
452
+ maxOptions?: number;
453
+ inputId?: string;
454
+ closeMenuOnScroll?: boolean | EventListener;
455
+ menuShouldBlockScroll?: boolean;
456
+ ariaLabelledBy?: string;
457
+ ariaLive?: 'polite' | 'off' | 'assertive';
458
+ };
459
+
460
+ // @public (undocumented)
461
+ export type UserPickerState = {
462
+ options: OptionData[];
463
+ value?: AtlaskitSelectValue;
464
+ isDefaultSet: boolean;
465
+ inflightRequest: number;
466
+ count: number;
467
+ hoveringClearIndicator: boolean;
468
+ menuIsOpen: boolean;
469
+ inputValue: string;
470
+ resolving: boolean;
471
+ };
472
+
473
+ // @public (undocumented)
474
+ export type UserSource =
475
+ | 'google'
476
+ | 'slack'
477
+ | 'microsoft'
478
+ | 'github'
479
+ | 'jira'
480
+ | 'confluence'
481
+ | 'other-atlassian';
482
+
483
+ // @public (undocumented)
484
+ export const UserType = 'user';
485
+
486
+ // @public (undocumented)
487
+ export type Value = OptionData | OptionData[] | null | undefined;
488
+
489
+ // (No @packageDocumentation comment for this package)
490
+ ```