@atlaskit/user-picker 10.3.0 → 10.5.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/user-picker
2
2
 
3
+ ## 10.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`eaf4a174f64`](https://bitbucket.org/atlassian/atlassian-frontend/commits/eaf4a174f64) - Added optional onOpen callback
8
+
9
+ ## 10.4.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`6734af6576d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6734af6576d) - Improved the behaviour of the aria-labelledby prop on the Input component. It used to use aria-describedby and if it didn't exist, fall back to using aria-labelledby. This has now been swapped to give aria-labelledby precedence with aria-describedby now being the fallback.
14
+
3
15
  ## 10.3.0
4
16
 
5
17
  ### Minor Changes
@@ -258,6 +258,7 @@ var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
258
258
  });
259
259
  });
260
260
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleOpen", function () {
261
+ (0, _utils.callCallback)(_this.props.onOpen, _this.getSessionId());
261
262
  _this.setState({
262
263
  menuIsOpen: true
263
264
  });
@@ -454,7 +455,8 @@ var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
454
455
  maxPickerHeight = _this$props4.maxPickerHeight,
455
456
  textFieldBackgroundColor = _this$props4.textFieldBackgroundColor,
456
457
  ariaLabelledBy = _this$props4.ariaLabelledBy,
457
- ariaLive = _this$props4.ariaLive;
458
+ ariaLive = _this$props4.ariaLive,
459
+ name = _this$props4.name;
458
460
  var _this$state3 = this.state,
459
461
  count = _this$state3.count,
460
462
  hoveringClearIndicator = _this$state3.hoveringClearIndicator,
@@ -465,6 +467,7 @@ var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
465
467
  showError = _this$state3.showError;
466
468
  var appearance = this.getAppearance();
467
469
  return /*#__PURE__*/_react.default.createElement(SelectComponent, (0, _extends2.default)({
470
+ name: name,
468
471
  value: value,
469
472
  autoFocus: autoFocus !== undefined ? autoFocus : menuIsOpen,
470
473
  "aria-labelledby": ariaLabelledBy,
@@ -52,8 +52,8 @@ var Input = /*#__PURE__*/function (_React$Component) {
52
52
  * {@link https://github.com/JedWatson/react-select/issues/5651#issue-1731353197 GitHub}
53
53
  */
54
54
  function get() {
55
- var _this$props$ariaDesc;
56
- return (_this$props$ariaDesc = this.props['aria-describedby']) !== null && _this$props$ariaDesc !== void 0 ? _this$props$ariaDesc : this.props['aria-labelledby'];
55
+ var _this$props$ariaLabe;
56
+ return (_this$props$ariaLabe = this.props['aria-labelledby']) !== null && _this$props$ariaLabe !== void 0 ? _this$props$ariaLabe : this.props['aria-describedby'];
57
57
  }
58
58
  }, {
59
59
  key: "ariaDescribedBy",
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "10.3.0",
3
+ "version": "10.5.0",
4
4
  "sideEffects": false
5
5
  }
@@ -247,6 +247,7 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
247
247
  });
248
248
  });
249
249
  _defineProperty(this, "handleOpen", () => {
250
+ callCallback(this.props.onOpen, this.getSessionId());
250
251
  this.setState({
251
252
  menuIsOpen: true
252
253
  });
@@ -434,7 +435,8 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
434
435
  maxPickerHeight,
435
436
  textFieldBackgroundColor,
436
437
  ariaLabelledBy,
437
- ariaLive
438
+ ariaLive,
439
+ name
438
440
  } = this.props;
439
441
  const {
440
442
  count,
@@ -447,6 +449,7 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
447
449
  } = this.state;
448
450
  const appearance = this.getAppearance();
449
451
  return /*#__PURE__*/React.createElement(SelectComponent, _extends({
452
+ name: name,
450
453
  value: value,
451
454
  autoFocus: autoFocus !== undefined ? autoFocus : menuIsOpen,
452
455
  "aria-labelledby": ariaLabelledBy,
@@ -26,8 +26,8 @@ export class Input extends React.Component {
26
26
  * {@link https://github.com/JedWatson/react-select/issues/5651#issue-1731353197 GitHub}
27
27
  */
28
28
  get ariaLabelledBy() {
29
- var _this$props$ariaDesc;
30
- return (_this$props$ariaDesc = this.props['aria-describedby']) !== null && _this$props$ariaDesc !== void 0 ? _this$props$ariaDesc : this.props['aria-labelledby'];
29
+ var _this$props$ariaLabe;
30
+ return (_this$props$ariaLabe = this.props['aria-labelledby']) !== null && _this$props$ariaLabe !== void 0 ? _this$props$ariaLabe : this.props['aria-describedby'];
31
31
  }
32
32
  get ariaDescribedBy() {
33
33
  var _this$props$selectPro2, _this$props$selectPro3;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "10.3.0",
3
+ "version": "10.5.0",
4
4
  "sideEffects": false
5
5
  }
@@ -251,6 +251,7 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
251
251
  });
252
252
  });
253
253
  _defineProperty(_assertThisInitialized(_this), "handleOpen", function () {
254
+ callCallback(_this.props.onOpen, _this.getSessionId());
254
255
  _this.setState({
255
256
  menuIsOpen: true
256
257
  });
@@ -447,7 +448,8 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
447
448
  maxPickerHeight = _this$props4.maxPickerHeight,
448
449
  textFieldBackgroundColor = _this$props4.textFieldBackgroundColor,
449
450
  ariaLabelledBy = _this$props4.ariaLabelledBy,
450
- ariaLive = _this$props4.ariaLive;
451
+ ariaLive = _this$props4.ariaLive,
452
+ name = _this$props4.name;
451
453
  var _this$state3 = this.state,
452
454
  count = _this$state3.count,
453
455
  hoveringClearIndicator = _this$state3.hoveringClearIndicator,
@@ -458,6 +460,7 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
458
460
  showError = _this$state3.showError;
459
461
  var appearance = this.getAppearance();
460
462
  return /*#__PURE__*/React.createElement(SelectComponent, _extends({
463
+ name: name,
461
464
  value: value,
462
465
  autoFocus: autoFocus !== undefined ? autoFocus : menuIsOpen,
463
466
  "aria-labelledby": ariaLabelledBy,
@@ -45,8 +45,8 @@ export var Input = /*#__PURE__*/function (_React$Component) {
45
45
  * {@link https://github.com/JedWatson/react-select/issues/5651#issue-1731353197 GitHub}
46
46
  */
47
47
  function get() {
48
- var _this$props$ariaDesc;
49
- return (_this$props$ariaDesc = this.props['aria-describedby']) !== null && _this$props$ariaDesc !== void 0 ? _this$props$ariaDesc : this.props['aria-labelledby'];
48
+ var _this$props$ariaLabe;
49
+ return (_this$props$ariaLabe = this.props['aria-labelledby']) !== null && _this$props$ariaLabe !== void 0 ? _this$props$ariaLabe : this.props['aria-describedby'];
50
50
  }
51
51
  }, {
52
52
  key: "ariaDescribedBy",
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "10.3.0",
3
+ "version": "10.5.0",
4
4
  "sideEffects": false
5
5
  }
@@ -6,6 +6,7 @@ export type BaseUserPickerProps = UserPickerProps & {
6
6
  styles: any;
7
7
  components: any;
8
8
  width: string | number;
9
+ name?: string;
9
10
  };
10
11
  export declare class BaseUserPickerWithoutAnalytics extends React.Component<BaseUserPickerProps, UserPickerState> {
11
12
  static defaultProps: {
@@ -54,7 +55,7 @@ export declare class BaseUserPickerWithoutAnalytics extends React.Component<Base
54
55
  get ariaProps(): {};
55
56
  render(): JSX.Element;
56
57
  }
57
- export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<BaseUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "noOptionsMessage" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "styles" | "value" | "footer" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "loadOptions" | "loadUserSource" | "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" | "loadOptionsErrorMessage" | "subtle" | "noBorder">> & Partial<Pick<{
58
+ export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<BaseUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "noOptionsMessage" | "placeholder" | "isDisabled" | "name" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "styles" | "value" | "footer" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "loadOptions" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "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" | "loadOptionsErrorMessage" | "subtle" | "noBorder">> & Partial<Pick<{
58
59
  isMulti: boolean;
59
60
  subtle: boolean;
60
61
  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>, "options" | "search" | "noOptionsMessage" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "styles" | "value" | "footer" | "target" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "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>, "offset" | "isMulti" | "width" | "placement" | "rootBoundary" | "boundariesElement" | "shouldFlip">> & Partial<Pick<{
30
+ export declare const PopupUserPicker: React.ForwardRefExoticComponent<Pick<Omit<PopupUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "noOptionsMessage" | "placeholder" | "isDisabled" | "name" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "styles" | "value" | "footer" | "target" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "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>, "offset" | "isMulti" | "width" | "placement" | "rootBoundary" | "boundariesElement" | "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>, "options" | "search" | "noOptionsMessage" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "styles" | "value" | "footer" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "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<{
13
+ export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<UserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "noOptionsMessage" | "placeholder" | "isDisabled" | "name" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "styles" | "value" | "footer" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "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>>;
@@ -75,6 +75,8 @@ export type UserPickerProps = WithAnalyticsEventsProps & {
75
75
  onBlur?: OnPicker;
76
76
  /** Callback for when the value/s in the picker is cleared. */
77
77
  onClear?: OnPicker;
78
+ /** Callback that is triggered when popup picker is opened */
79
+ onOpen?: OnPicker;
78
80
  /** Callback that is triggered when popup picker is closed */
79
81
  onClose?: OnPicker;
80
82
  /** Appearance of the user picker. */
@@ -145,6 +147,8 @@ export type UserPickerProps = WithAnalyticsEventsProps & {
145
147
  ariaLabelledBy?: string;
146
148
  /** Accessibility: Used to set the priority with which screen reader should treat updates to live regions.*/
147
149
  ariaLive?: 'polite' | 'off' | 'assertive';
150
+ /** Name to use for input element. */
151
+ name?: string;
148
152
  };
149
153
  export type PopupUserPickerProps = UserPickerProps & {
150
154
  /** Whether to use the popup version of the single picker */
@@ -6,6 +6,7 @@ export type BaseUserPickerProps = UserPickerProps & {
6
6
  styles: any;
7
7
  components: any;
8
8
  width: string | number;
9
+ name?: string;
9
10
  };
10
11
  export declare class BaseUserPickerWithoutAnalytics extends React.Component<BaseUserPickerProps, UserPickerState> {
11
12
  static defaultProps: {
@@ -54,7 +55,7 @@ export declare class BaseUserPickerWithoutAnalytics extends React.Component<Base
54
55
  get ariaProps(): {};
55
56
  render(): JSX.Element;
56
57
  }
57
- export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<BaseUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "noOptionsMessage" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "styles" | "value" | "footer" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "loadOptions" | "loadUserSource" | "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" | "loadOptionsErrorMessage" | "subtle" | "noBorder">> & Partial<Pick<{
58
+ export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<BaseUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "noOptionsMessage" | "placeholder" | "isDisabled" | "name" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "styles" | "value" | "footer" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "loadOptions" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "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" | "loadOptionsErrorMessage" | "subtle" | "noBorder">> & Partial<Pick<{
58
59
  isMulti: boolean;
59
60
  subtle: boolean;
60
61
  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>, "options" | "search" | "noOptionsMessage" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "styles" | "value" | "footer" | "target" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "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>, "offset" | "isMulti" | "width" | "placement" | "rootBoundary" | "boundariesElement" | "shouldFlip">> & Partial<Pick<{
30
+ export declare const PopupUserPicker: React.ForwardRefExoticComponent<Pick<Omit<PopupUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "noOptionsMessage" | "placeholder" | "isDisabled" | "name" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "styles" | "value" | "footer" | "target" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "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>, "offset" | "isMulti" | "width" | "placement" | "rootBoundary" | "boundariesElement" | "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>, "options" | "search" | "noOptionsMessage" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "styles" | "value" | "footer" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "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<{
13
+ export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<UserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "noOptionsMessage" | "placeholder" | "isDisabled" | "name" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "styles" | "value" | "footer" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "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>>;
@@ -75,6 +75,8 @@ export type UserPickerProps = WithAnalyticsEventsProps & {
75
75
  onBlur?: OnPicker;
76
76
  /** Callback for when the value/s in the picker is cleared. */
77
77
  onClear?: OnPicker;
78
+ /** Callback that is triggered when popup picker is opened */
79
+ onOpen?: OnPicker;
78
80
  /** Callback that is triggered when popup picker is closed */
79
81
  onClose?: OnPicker;
80
82
  /** Appearance of the user picker. */
@@ -145,6 +147,8 @@ export type UserPickerProps = WithAnalyticsEventsProps & {
145
147
  ariaLabelledBy?: string;
146
148
  /** Accessibility: Used to set the priority with which screen reader should treat updates to live regions.*/
147
149
  ariaLive?: 'polite' | 'off' | 'assertive';
150
+ /** Name to use for input element. */
151
+ name?: string;
148
152
  };
149
153
  export type PopupUserPickerProps = UserPickerProps & {
150
154
  /** 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": "10.3.0",
3
+ "version": "10.5.0",
4
4
  "description": "Fabric component for display a dropdown to select a user from",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -43,7 +43,7 @@
43
43
  "@atlaskit/select": "^16.5.0",
44
44
  "@atlaskit/spinner": "^15.5.0",
45
45
  "@atlaskit/theme": "^12.5.0",
46
- "@atlaskit/tokens": "^1.5.0",
46
+ "@atlaskit/tokens": "^1.13.0",
47
47
  "@atlaskit/tooltip": "^17.8.0",
48
48
  "@atlaskit/ufo": "^0.2.0",
49
49
  "@babel/runtime": "^7.0.0",
@@ -59,13 +59,7 @@
59
59
  },
60
60
  "devDependencies": {
61
61
  "@atlaskit/analytics-viewer": "^0.5.0",
62
- "@atlaskit/button": "^16.7.0",
63
- "@atlaskit/docs": "*",
64
62
  "@atlaskit/elements-test-helpers": "^0.7.0",
65
- "@atlaskit/modal-dialog": "^12.6.0",
66
- "@atlaskit/radio": "^5.6.0",
67
- "@atlaskit/range": "^7.1.0",
68
- "@atlaskit/section-message": "^6.4.0",
69
63
  "@atlaskit/util-data-test": "^17.8.0",
70
64
  "@atlaskit/visual-regression": "*",
71
65
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
package/report.api.md CHANGED
@@ -264,6 +264,7 @@ export const PopupUserPicker: React_2.ForwardRefExoticComponent<
264
264
  | 'menuPortalTarget'
265
265
  | 'menuPosition'
266
266
  | 'menuShouldBlockScroll'
267
+ | 'name'
267
268
  | 'noBorder'
268
269
  | 'noOptionsMessage'
269
270
  | 'onBlur'
@@ -272,6 +273,7 @@ export const PopupUserPicker: React_2.ForwardRefExoticComponent<
272
273
  | 'onClose'
273
274
  | 'onFocus'
274
275
  | 'onInputChange'
276
+ | 'onOpen'
275
277
  | 'onSelection'
276
278
  | 'open'
277
279
  | 'options'
@@ -432,6 +434,7 @@ const UserPicker: React_2.ForwardRefExoticComponent<
432
434
  | 'menuPortalTarget'
433
435
  | 'menuPosition'
434
436
  | 'menuShouldBlockScroll'
437
+ | 'name'
435
438
  | 'noBorder'
436
439
  | 'noOptionsMessage'
437
440
  | 'onBlur'
@@ -440,6 +443,7 @@ const UserPicker: React_2.ForwardRefExoticComponent<
440
443
  | 'onClose'
441
444
  | 'onFocus'
442
445
  | 'onInputChange'
446
+ | 'onOpen'
443
447
  | 'onSelection'
444
448
  | 'open'
445
449
  | 'options'
@@ -492,6 +496,7 @@ export type UserPickerProps = WithAnalyticsEventsProps & {
492
496
  onFocus?: OnPicker;
493
497
  onBlur?: OnPicker;
494
498
  onClear?: OnPicker;
499
+ onOpen?: OnPicker;
495
500
  onClose?: OnPicker;
496
501
  appearance?: Appearance;
497
502
  subtle?: boolean;
@@ -521,6 +526,7 @@ export type UserPickerProps = WithAnalyticsEventsProps & {
521
526
  menuShouldBlockScroll?: boolean;
522
527
  ariaLabelledBy?: string;
523
528
  ariaLive?: 'assertive' | 'off' | 'polite';
529
+ name?: string;
524
530
  };
525
531
 
526
532
  // @public (undocumented)
@@ -197,7 +197,7 @@ export interface OptionData {
197
197
  export type OptionIdentifier = Pick<OptionData, 'id' | 'isDisabled' | 'type'>;
198
198
 
199
199
  // @public (undocumented)
200
- export const PopupUserPicker: React_2.ForwardRefExoticComponent<Pick<Omit<PopupUserPickerProps, keyof WithAnalyticsEventsProps>, "addMoreMessage" | "allowEmail" | "anchor" | "appearance" | "ariaLabelledBy" | "ariaLive" | "autoFocus" | "captureMenuScroll" | "clearValueLabel" | "closeMenuOnScroll" | "defaultValue" | "disableInput" | "emailLabel" | "fieldId" | "footer" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isValidEmail" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "maxOptions" | "maxPickerHeight" | "menuMinWidth" | "menuPortalTarget" | "menuPosition" | "menuShouldBlockScroll" | "noBorder" | "noOptionsMessage" | "onBlur" | "onChange" | "onClear" | "onClose" | "onFocus" | "onInputChange" | "onSelection" | "open" | "options" | "placeholder" | "popupTitle" | "search" | "styles" | "subtle" | "suggestEmailsForDomain" | "target" | "textFieldBackgroundColor" | "value"> & Partial<Pick<Omit<PopupUserPickerProps, keyof WithAnalyticsEventsProps>, "boundariesElement" | "isMulti" | "offset" | "placement" | "rootBoundary" | "shouldFlip" | "width">> & Partial<Pick<{
200
+ export const PopupUserPicker: React_2.ForwardRefExoticComponent<Pick<Omit<PopupUserPickerProps, keyof WithAnalyticsEventsProps>, "addMoreMessage" | "allowEmail" | "anchor" | "appearance" | "ariaLabelledBy" | "ariaLive" | "autoFocus" | "captureMenuScroll" | "clearValueLabel" | "closeMenuOnScroll" | "defaultValue" | "disableInput" | "emailLabel" | "fieldId" | "footer" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isValidEmail" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "maxOptions" | "maxPickerHeight" | "menuMinWidth" | "menuPortalTarget" | "menuPosition" | "menuShouldBlockScroll" | "name" | "noBorder" | "noOptionsMessage" | "onBlur" | "onChange" | "onClear" | "onClose" | "onFocus" | "onInputChange" | "onOpen" | "onSelection" | "open" | "options" | "placeholder" | "popupTitle" | "search" | "styles" | "subtle" | "suggestEmailsForDomain" | "target" | "textFieldBackgroundColor" | "value"> & Partial<Pick<Omit<PopupUserPickerProps, keyof WithAnalyticsEventsProps>, "boundariesElement" | "isMulti" | "offset" | "placement" | "rootBoundary" | "shouldFlip" | "width">> & Partial<Pick<{
201
201
  boundariesElement: string;
202
202
  width: number;
203
203
  isMulti: boolean;
@@ -296,7 +296,7 @@ export interface UserHighlight {
296
296
  }
297
297
 
298
298
  // @public (undocumented)
299
- const UserPicker: React_2.ForwardRefExoticComponent<Pick<Omit<UserPickerProps, keyof WithAnalyticsEventsProps>, "addMoreMessage" | "allowEmail" | "anchor" | "appearance" | "ariaLabelledBy" | "ariaLive" | "autoFocus" | "captureMenuScroll" | "clearValueLabel" | "closeMenuOnScroll" | "defaultValue" | "disableInput" | "emailLabel" | "fieldId" | "footer" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isValidEmail" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "maxOptions" | "maxPickerHeight" | "menuMinWidth" | "menuPortalTarget" | "menuPosition" | "menuShouldBlockScroll" | "noBorder" | "noOptionsMessage" | "onBlur" | "onChange" | "onClear" | "onClose" | "onFocus" | "onInputChange" | "onSelection" | "open" | "options" | "placeholder" | "search" | "styles" | "subtle" | "suggestEmailsForDomain" | "textFieldBackgroundColor" | "value"> & Partial<Pick<Omit<UserPickerProps, keyof WithAnalyticsEventsProps>, "isMulti" | "width">> & Partial<Pick<{
299
+ const UserPicker: React_2.ForwardRefExoticComponent<Pick<Omit<UserPickerProps, keyof WithAnalyticsEventsProps>, "addMoreMessage" | "allowEmail" | "anchor" | "appearance" | "ariaLabelledBy" | "ariaLive" | "autoFocus" | "captureMenuScroll" | "clearValueLabel" | "closeMenuOnScroll" | "defaultValue" | "disableInput" | "emailLabel" | "fieldId" | "footer" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isValidEmail" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "maxOptions" | "maxPickerHeight" | "menuMinWidth" | "menuPortalTarget" | "menuPosition" | "menuShouldBlockScroll" | "name" | "noBorder" | "noOptionsMessage" | "onBlur" | "onChange" | "onClear" | "onClose" | "onFocus" | "onInputChange" | "onOpen" | "onSelection" | "open" | "options" | "placeholder" | "search" | "styles" | "subtle" | "suggestEmailsForDomain" | "textFieldBackgroundColor" | "value"> & Partial<Pick<Omit<UserPickerProps, keyof WithAnalyticsEventsProps>, "isMulti" | "width">> & Partial<Pick<{
300
300
  width: number;
301
301
  isMulti: boolean;
302
302
  }, never>> & React_2.RefAttributes<any>>;
@@ -326,6 +326,7 @@ export type UserPickerProps = WithAnalyticsEventsProps & {
326
326
  onFocus?: OnPicker;
327
327
  onBlur?: OnPicker;
328
328
  onClear?: OnPicker;
329
+ onOpen?: OnPicker;
329
330
  onClose?: OnPicker;
330
331
  appearance?: Appearance;
331
332
  subtle?: boolean;
@@ -357,6 +358,7 @@ export type UserPickerProps = WithAnalyticsEventsProps & {
357
358
  menuShouldBlockScroll?: boolean;
358
359
  ariaLabelledBy?: string;
359
360
  ariaLive?: 'assertive' | 'off' | 'polite';
361
+ name?: string;
360
362
  };
361
363
 
362
364
  // @public (undocumented)