@atlaskit/user-picker 10.2.5 → 10.4.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.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`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.
8
+
9
+ ## 10.3.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`413f440129c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/413f440129c) - [ux] Customised Menu component to allow users to include a footer in the dropdown list
14
+
3
15
  ## 10.2.5
4
16
 
5
17
  ### Patch Changes
@@ -442,6 +442,7 @@ var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
442
442
  loadOptionsErrorMessage = _this$props4.loadOptionsErrorMessage,
443
443
  addMoreMessage = _this$props4.addMoreMessage,
444
444
  noOptionsMessage = _this$props4.noOptionsMessage,
445
+ footer = _this$props4.footer,
445
446
  disableInput = _this$props4.disableInput,
446
447
  components = _this$props4.components,
447
448
  pickerProps = _this$props4.pickerProps,
@@ -490,6 +491,7 @@ var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
490
491
  blurInputOnSelect: !isMulti,
491
492
  closeMenuOnSelect: !isMulti,
492
493
  noOptionsMessage: showError ? loadOptionsErrorMessage : noOptionsMessage,
494
+ footer: footer,
493
495
  openMenuOnFocus: true,
494
496
  isDisabled: isDisabled,
495
497
  isFocused: menuIsOpen,
@@ -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",
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.Menu = void 0;
8
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
11
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
12
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
13
+ var _react = _interopRequireDefault(require("react"));
14
+ var _select = require("@atlaskit/select");
15
+ var _react2 = require("@emotion/react");
16
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
17
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
18
+ var getFooterStyle = function getFooterStyle() {
19
+ return (0, _react2.css)({
20
+ padding: '8px 16px'
21
+ });
22
+ };
23
+ var Menu = /*#__PURE__*/function (_React$Component) {
24
+ (0, _inherits2.default)(Menu, _React$Component);
25
+ var _super = _createSuper(Menu);
26
+ function Menu() {
27
+ (0, _classCallCheck2.default)(this, Menu);
28
+ return _super.apply(this, arguments);
29
+ }
30
+ (0, _createClass2.default)(Menu, [{
31
+ key: "render",
32
+ value: function render() {
33
+ return (0, _react2.jsx)(_select.components.Menu, this.props, this.props.children, this.props.selectProps.footer && (0, _react2.jsx)("div", {
34
+ css: getFooterStyle()
35
+ }, this.props.selectProps.footer));
36
+ }
37
+ }]);
38
+ return Menu;
39
+ }(_react.default.Component);
40
+ exports.Menu = Menu;
@@ -16,6 +16,7 @@ var _Input = require("./Input");
16
16
  var _SingleValueContainer = require("./SingleValueContainer");
17
17
  var _PopupInput = require("./PopupInput");
18
18
  var _PopupControl = require("./PopupControl");
19
+ var _Menu = require("./Menu");
19
20
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
20
21
  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; }
21
22
  /**
@@ -35,7 +36,8 @@ var getComponents = (0, _memoizeOne.default)(function (multi, anchor) {
35
36
  ClearIndicator: multi ? null : _ClearIndicator.ClearIndicator,
36
37
  Option: _Option.Option,
37
38
  ValueContainer: multi ? _MultiValueContainer.MultiValueContainer : _SingleValueContainer.SingleValueContainer,
38
- Input: _Input.Input
39
+ Input: _Input.Input,
40
+ Menu: _Menu.Menu
39
41
  };
40
42
  }
41
43
  });
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "10.2.5",
3
+ "version": "10.4.0",
4
4
  "sideEffects": false
5
5
  }
@@ -422,6 +422,7 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
422
422
  loadOptionsErrorMessage,
423
423
  addMoreMessage,
424
424
  noOptionsMessage,
425
+ footer,
425
426
  disableInput,
426
427
  components,
427
428
  pickerProps,
@@ -472,6 +473,7 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
472
473
  blurInputOnSelect: !isMulti,
473
474
  closeMenuOnSelect: !isMulti,
474
475
  noOptionsMessage: showError ? loadOptionsErrorMessage : noOptionsMessage,
476
+ footer: footer,
475
477
  openMenuOnFocus: true,
476
478
  isDisabled: isDisabled,
477
479
  isFocused: menuIsOpen,
@@ -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;
@@ -0,0 +1,16 @@
1
+ /** @jsx jsx */
2
+ import React from 'react';
3
+ import { components } from '@atlaskit/select';
4
+ import { css, jsx } from '@emotion/react';
5
+ const getFooterStyle = () => {
6
+ return css({
7
+ padding: '8px 16px'
8
+ });
9
+ };
10
+ export class Menu extends React.Component {
11
+ render() {
12
+ return jsx(components.Menu, this.props, this.props.children, this.props.selectProps.footer && jsx("div", {
13
+ css: getFooterStyle()
14
+ }, this.props.selectProps.footer));
15
+ }
16
+ }
@@ -8,6 +8,7 @@ import { Input } from './Input';
8
8
  import { SingleValueContainer } from './SingleValueContainer';
9
9
  import { PopupInput } from './PopupInput';
10
10
  import { PopupControl } from './PopupControl';
11
+ import { Menu } from './Menu';
11
12
 
12
13
  /**
13
14
  * Memoize getComponents to avoid rerenders.
@@ -26,7 +27,8 @@ export const getComponents = memoizeOne((multi, anchor) => {
26
27
  ClearIndicator: multi ? null : ClearIndicator,
27
28
  Option,
28
29
  ValueContainer: multi ? MultiValueContainer : SingleValueContainer,
29
- Input
30
+ Input,
31
+ Menu
30
32
  };
31
33
  }
32
34
  });
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "10.2.5",
3
+ "version": "10.4.0",
4
4
  "sideEffects": false
5
5
  }
@@ -435,6 +435,7 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
435
435
  loadOptionsErrorMessage = _this$props4.loadOptionsErrorMessage,
436
436
  addMoreMessage = _this$props4.addMoreMessage,
437
437
  noOptionsMessage = _this$props4.noOptionsMessage,
438
+ footer = _this$props4.footer,
438
439
  disableInput = _this$props4.disableInput,
439
440
  components = _this$props4.components,
440
441
  pickerProps = _this$props4.pickerProps,
@@ -483,6 +484,7 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
483
484
  blurInputOnSelect: !isMulti,
484
485
  closeMenuOnSelect: !isMulti,
485
486
  noOptionsMessage: showError ? loadOptionsErrorMessage : noOptionsMessage,
487
+ footer: footer,
486
488
  openMenuOnFocus: true,
487
489
  isDisabled: isDisabled,
488
490
  isFocused: menuIsOpen,
@@ -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",
@@ -0,0 +1,33 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _inherits from "@babel/runtime/helpers/inherits";
4
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
7
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
8
+ /** @jsx jsx */
9
+ import React from 'react';
10
+ import { components } from '@atlaskit/select';
11
+ import { css, jsx } from '@emotion/react';
12
+ var getFooterStyle = function getFooterStyle() {
13
+ return css({
14
+ padding: '8px 16px'
15
+ });
16
+ };
17
+ export var Menu = /*#__PURE__*/function (_React$Component) {
18
+ _inherits(Menu, _React$Component);
19
+ var _super = _createSuper(Menu);
20
+ function Menu() {
21
+ _classCallCheck(this, Menu);
22
+ return _super.apply(this, arguments);
23
+ }
24
+ _createClass(Menu, [{
25
+ key: "render",
26
+ value: function render() {
27
+ return jsx(components.Menu, this.props, this.props.children, this.props.selectProps.footer && jsx("div", {
28
+ css: getFooterStyle()
29
+ }, this.props.selectProps.footer));
30
+ }
31
+ }]);
32
+ return Menu;
33
+ }(React.Component);
@@ -11,6 +11,7 @@ import { Input } from './Input';
11
11
  import { SingleValueContainer } from './SingleValueContainer';
12
12
  import { PopupInput } from './PopupInput';
13
13
  import { PopupControl } from './PopupControl';
14
+ import { Menu } from './Menu';
14
15
 
15
16
  /**
16
17
  * Memoize getComponents to avoid rerenders.
@@ -29,7 +30,8 @@ export var getComponents = memoizeOne(function (multi, anchor) {
29
30
  ClearIndicator: multi ? null : ClearIndicator,
30
31
  Option: Option,
31
32
  ValueContainer: multi ? MultiValueContainer : SingleValueContainer,
32
- Input: Input
33
+ Input: Input,
34
+ Menu: Menu
33
35
  };
34
36
  }
35
37
  });
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "10.2.5",
3
+ "version": "10.4.0",
4
4
  "sideEffects": false
5
5
  }
@@ -54,7 +54,7 @@ export declare class BaseUserPickerWithoutAnalytics extends React.Component<Base
54
54
  get ariaProps(): {};
55
55
  render(): JSX.Element;
56
56
  }
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" | "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<{
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
58
  isMulti: boolean;
59
59
  subtle: boolean;
60
60
  noBorder: boolean;
@@ -0,0 +1,10 @@
1
+ /** @jsx jsx */
2
+ import React from 'react';
3
+ import { UserPickerProps } from '../types';
4
+ import { jsx } from '@emotion/react';
5
+ export type Props = {
6
+ selectProps: UserPickerProps;
7
+ };
8
+ export declare class Menu extends React.Component<Props> {
9
+ render(): jsx.JSX.Element;
10
+ }
@@ -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" | "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" | "rootBoundary" | "boundariesElement" | "placement" | "shouldFlip">> & Partial<Pick<{
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<{
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" | "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" | "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<{
14
14
  width: number;
15
15
  isMulti: boolean;
16
16
  }, never>> & React.RefAttributes<any>>;
@@ -6,6 +6,7 @@ import { Input } from './Input';
6
6
  import { SingleValueContainer } from './SingleValueContainer';
7
7
  import { PopupInput } from './PopupInput';
8
8
  import { PopupControl } from './PopupControl';
9
+ import { Menu } from './Menu';
9
10
  /**
10
11
  * Memoize getComponents to avoid rerenders.
11
12
  */
@@ -18,6 +19,7 @@ export declare const getComponents: import("memoize-one").MemoizedFn<(multi?: bo
18
19
  ClearIndicator?: undefined;
19
20
  ValueContainer?: undefined;
20
21
  Input?: undefined;
22
+ Menu?: undefined;
21
23
  } | {
22
24
  MultiValue: typeof MultiValue;
23
25
  DropdownIndicator: null;
@@ -26,6 +28,7 @@ export declare const getComponents: import("memoize-one").MemoizedFn<(multi?: bo
26
28
  Option: import("react").FC<import("./Option").OptionProps>;
27
29
  ValueContainer: typeof MultiValueContainer | typeof SingleValueContainer;
28
30
  Input: typeof Input;
31
+ Menu: typeof Menu;
29
32
  Control?: undefined;
30
33
  }>;
31
34
  export declare const getPopupComponents: import("memoize-one").MemoizedFn<(hasPopupTitle: boolean) => {
@@ -105,6 +105,8 @@ export type UserPickerProps = WithAnalyticsEventsProps & {
105
105
  noOptionsMessage?: ((value: {
106
106
  inputValue: string;
107
107
  }) => string | null) | null;
108
+ /** Footer to be displayed in MenuList */
109
+ footer?: React.ReactNode;
108
110
  /** Controls if the user picker has a value or not. If not provided, UserPicker will control the value internally. */
109
111
  value?: Value;
110
112
  /** Disable all interactions with the picker, putting it in a read-only state. */
@@ -54,7 +54,7 @@ export declare class BaseUserPickerWithoutAnalytics extends React.Component<Base
54
54
  get ariaProps(): {};
55
55
  render(): JSX.Element;
56
56
  }
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" | "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<{
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
58
  isMulti: boolean;
59
59
  subtle: boolean;
60
60
  noBorder: boolean;
@@ -0,0 +1,10 @@
1
+ /** @jsx jsx */
2
+ import React from 'react';
3
+ import { UserPickerProps } from '../types';
4
+ import { jsx } from '@emotion/react';
5
+ export type Props = {
6
+ selectProps: UserPickerProps;
7
+ };
8
+ export declare class Menu extends React.Component<Props> {
9
+ render(): jsx.JSX.Element;
10
+ }
@@ -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" | "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" | "rootBoundary" | "boundariesElement" | "placement" | "shouldFlip">> & Partial<Pick<{
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<{
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" | "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" | "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<{
14
14
  width: number;
15
15
  isMulti: boolean;
16
16
  }, never>> & React.RefAttributes<any>>;
@@ -6,6 +6,7 @@ import { Input } from './Input';
6
6
  import { SingleValueContainer } from './SingleValueContainer';
7
7
  import { PopupInput } from './PopupInput';
8
8
  import { PopupControl } from './PopupControl';
9
+ import { Menu } from './Menu';
9
10
  /**
10
11
  * Memoize getComponents to avoid rerenders.
11
12
  */
@@ -18,6 +19,7 @@ export declare const getComponents: import("memoize-one").MemoizedFn<(multi?: bo
18
19
  ClearIndicator?: undefined;
19
20
  ValueContainer?: undefined;
20
21
  Input?: undefined;
22
+ Menu?: undefined;
21
23
  } | {
22
24
  MultiValue: typeof MultiValue;
23
25
  DropdownIndicator: null;
@@ -26,6 +28,7 @@ export declare const getComponents: import("memoize-one").MemoizedFn<(multi?: bo
26
28
  Option: import("react").FC<import("./Option").OptionProps>;
27
29
  ValueContainer: typeof MultiValueContainer | typeof SingleValueContainer;
28
30
  Input: typeof Input;
31
+ Menu: typeof Menu;
29
32
  Control?: undefined;
30
33
  }>;
31
34
  export declare const getPopupComponents: import("memoize-one").MemoizedFn<(hasPopupTitle: boolean) => {
@@ -105,6 +105,8 @@ export type UserPickerProps = WithAnalyticsEventsProps & {
105
105
  noOptionsMessage?: ((value: {
106
106
  inputValue: string;
107
107
  }) => string | null) | null;
108
+ /** Footer to be displayed in MenuList */
109
+ footer?: React.ReactNode;
108
110
  /** Controls if the user picker has a value or not. If not provided, UserPicker will control the value internally. */
109
111
  value?: Value;
110
112
  /** Disable all interactions with the picker, putting it in a read-only state. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "10.2.5",
3
+ "version": "10.4.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.6.0",
47
47
  "@atlaskit/tooltip": "^17.8.0",
48
48
  "@atlaskit/ufo": "^0.2.0",
49
49
  "@babel/runtime": "^7.0.0",
@@ -62,7 +62,7 @@
62
62
  "@atlaskit/button": "^16.7.0",
63
63
  "@atlaskit/docs": "*",
64
64
  "@atlaskit/elements-test-helpers": "^0.7.0",
65
- "@atlaskit/modal-dialog": "^12.5.0",
65
+ "@atlaskit/modal-dialog": "^12.6.0",
66
66
  "@atlaskit/radio": "^5.6.0",
67
67
  "@atlaskit/range": "^7.1.0",
68
68
  "@atlaskit/section-message": "^6.4.0",
package/report.api.md CHANGED
@@ -249,6 +249,7 @@ export const PopupUserPicker: React_2.ForwardRefExoticComponent<
249
249
  | 'disableInput'
250
250
  | 'emailLabel'
251
251
  | 'fieldId'
252
+ | 'footer'
252
253
  | 'inputId'
253
254
  | 'isClearable'
254
255
  | 'isDisabled'
@@ -416,6 +417,7 @@ const UserPicker: React_2.ForwardRefExoticComponent<
416
417
  | 'disableInput'
417
418
  | 'emailLabel'
418
419
  | 'fieldId'
420
+ | 'footer'
419
421
  | 'inputId'
420
422
  | 'isClearable'
421
423
  | 'isDisabled'
@@ -499,6 +501,7 @@ export type UserPickerProps = WithAnalyticsEventsProps & {
499
501
  placeholder?: React_2.ReactNode;
500
502
  addMoreMessage?: string;
501
503
  noOptionsMessage?: ((value: { inputValue: string }) => null | string) | null;
504
+ footer?: React_2.ReactNode;
502
505
  value?: Value;
503
506
  isDisabled?: boolean;
504
507
  isClearable?: boolean;
@@ -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" | "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" | "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<{
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" | "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" | "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<{
300
300
  width: number;
301
301
  isMulti: boolean;
302
302
  }, never>> & React_2.RefAttributes<any>>;
@@ -337,6 +337,7 @@ export type UserPickerProps = WithAnalyticsEventsProps & {
337
337
  noOptionsMessage?: ((value: {
338
338
  inputValue: string;
339
339
  }) => null | string) | null;
340
+ footer?: React_2.ReactNode;
340
341
  value?: Value;
341
342
  isDisabled?: boolean;
342
343
  isClearable?: boolean;