@atlaskit/user-picker 11.0.7 → 11.0.9

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,22 @@
1
1
  # @atlaskit/user-picker
2
2
 
3
+ ## 11.0.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [#137751](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/137751)
8
+ [`bffaf88f6c035`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bffaf88f6c035) -
9
+ Add support for a clear indicator
10
+
11
+ ## 11.0.8
12
+
13
+ ### Patch Changes
14
+
15
+ - [#129972](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/129972)
16
+ [`b2d69a39e6687`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b2d69a39e6687) -
17
+ Update `@compiled/react` dependency for improved type checking support.
18
+ - Updated dependencies
19
+
3
20
  ## 11.0.7
4
21
 
5
22
  ### Patch Changes
@@ -12,7 +12,7 @@ var _utils = require("./components/utils");
12
12
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13
13
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
14
14
  var packageName = "@atlaskit/user-picker";
15
- var packageVersion = "11.0.7";
15
+ var packageVersion = "11.0.9";
16
16
  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}$/;
17
17
  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}$/;
18
18
  var UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
@@ -61,7 +61,8 @@ var PopupUserPickerWithoutAnalytics = exports.PopupUserPickerWithoutAnalytics =
61
61
  placement = _this$props.placement,
62
62
  rootBoundary = _this$props.rootBoundary,
63
63
  shouldFlip = _this$props.shouldFlip,
64
- styles = _this$props.styles;
64
+ styles = _this$props.styles,
65
+ strategy = _this$props.strategy;
65
66
  var width = this.props.width;
66
67
  var selectStyles = (0, _styles.getPopupStyles)(width, isMulti, styles,
67
68
  // eslint-disable-next-line @atlaskit/platform/no-preconditioning, @atlaskit/platform/ensure-feature-flag-prefix
@@ -71,7 +72,7 @@ var PopupUserPickerWithoutAnalytics = exports.PopupUserPickerWithoutAnalytics =
71
72
  width: width,
72
73
  styles: selectStyles,
73
74
  components: (0, _components.getPopupComponents)(!!popupTitle),
74
- pickerProps: (0, _popup.getPopupProps)(width, target, this.handleFlipStyle, boundariesElement, offset, placement, rootBoundary, shouldFlip, popupTitle)
75
+ pickerProps: (0, _popup.getPopupProps)(width, target, this.handleFlipStyle, boundariesElement, offset, placement, rootBoundary, shouldFlip, popupTitle, strategy)
75
76
  }));
76
77
  }
77
78
  }]);
@@ -83,6 +84,7 @@ var PopupUserPickerWithoutAnalytics = exports.PopupUserPickerWithoutAnalytics =
83
84
  offset: [0, 0],
84
85
  placement: 'auto',
85
86
  rootBoundary: 'viewport',
86
- shouldFlip: true
87
+ shouldFlip: true,
88
+ strategy: 'fixed'
87
89
  });
88
90
  var PopupUserPicker = exports.PopupUserPicker = (0, _analyticsNext.withAnalyticsEvents)()(PopupUserPickerWithoutAnalytics);
@@ -73,7 +73,9 @@ var UserPickerWithoutAnalytics = exports.UserPickerWithoutAnalytics = /*#__PURE_
73
73
  closeMenuOnScroll = _this$props.closeMenuOnScroll,
74
74
  loadUserSource = _this$props.loadUserSource,
75
75
  _this$props$required = _this$props.required,
76
- required = _this$props$required === void 0 ? false : _this$props$required;
76
+ required = _this$props$required === void 0 ? false : _this$props$required,
77
+ _this$props$showClear = _this$props.showClearIndicator,
78
+ showClearIndicator = _this$props$showClear === void 0 ? false : _this$props$showClear;
77
79
  var width = this.props.width;
78
80
  var SelectComponent = allowEmail ? _select.CreatableSelect : _select.default;
79
81
  var creatableProps = suggestEmailsForDomain ? (0, _creatableEmailSuggestion.getCreatableSuggestedEmailProps)(suggestEmailsForDomain, isValidEmail) : (0, _creatable.getCreatableProps)(isValidEmail);
@@ -100,7 +102,7 @@ var UserPickerWithoutAnalytics = exports.UserPickerWithoutAnalytics = /*#__PURE_
100
102
  styles: (0, _styles.getStyles)(width, isMulti, this.props.appearance === 'compact', this.props.styles, this.props.isInvalid,
101
103
  // eslint-disable-next-line @atlaskit/platform/no-preconditioning, @atlaskit/platform/ensure-feature-flag-prefix
102
104
  (0, _platformFeatureFlags.fg)('platform-component-visual-refresh') && (0, _platformFeatureFlags.fg)('visual-refresh-user-picker')),
103
- components: (0, _components.getComponents)(isMulti, anchor),
105
+ components: (0, _components.getComponents)(isMulti, anchor, showClearIndicator && (0, _platformFeatureFlags.fg)('user-picker-show-clear-indicator')),
104
106
  pickerProps: pickerProps
105
107
  })))));
106
108
  }
@@ -22,7 +22,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
22
22
  /**
23
23
  * Memoize getComponents to avoid rerenders.
24
24
  */
25
- var getComponents = exports.getComponents = (0, _memoizeOne.default)(function (multi, anchor) {
25
+ var getComponents = exports.getComponents = (0, _memoizeOne.default)(function (multi, anchor, showClearIndicator) {
26
26
  if (anchor) {
27
27
  return {
28
28
  Control: anchor,
@@ -33,7 +33,7 @@ var getComponents = exports.getComponents = (0, _memoizeOne.default)(function (m
33
33
  MultiValue: _MultiValue.MultiValue,
34
34
  DropdownIndicator: null,
35
35
  SingleValue: _SingleValue.SingleValue,
36
- ClearIndicator: multi ? null : _ClearIndicator.ClearIndicator,
36
+ ClearIndicator: showClearIndicator || !multi ? _ClearIndicator.ClearIndicator : null,
37
37
  Option: _Option.Option,
38
38
  ValueContainer: multi ? _MultiValueContainer.MultiValueContainer : _SingleValueContainer.SingleValueContainer,
39
39
  Input: _Input.Input,
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.getPopupProps = void 0;
8
8
  var _memoizeOne = _interopRequireDefault(require("memoize-one"));
9
- var getPopupProps = exports.getPopupProps = (0, _memoizeOne.default)(function (width, target, onFlip, boundariesElement, offset, placement, rootBoundary, shouldFlip, popupTitle) {
9
+ var getPopupProps = exports.getPopupProps = (0, _memoizeOne.default)(function (width, target, onFlip, boundariesElement, offset, placement, rootBoundary, shouldFlip, popupTitle, strategy) {
10
10
  return {
11
11
  searchThreshold: -1,
12
12
  controlShouldRenderValue: true,
@@ -17,7 +17,7 @@ var getPopupProps = exports.getPopupProps = (0, _memoizeOne.default)(function (w
17
17
  popupTitle: popupTitle,
18
18
  popperProps: {
19
19
  placement: placement || 'auto',
20
- strategy: 'fixed',
20
+ strategy: strategy || 'fixed',
21
21
  modifiers: [{
22
22
  name: 'offset',
23
23
  options: {
@@ -2,7 +2,7 @@ import { createAndFireEvent } from '@atlaskit/analytics-next';
2
2
  import { v4 as uuidv4 } from 'uuid';
3
3
  import { isCustom, isExternalUser } from './components/utils';
4
4
  const packageName = "@atlaskit/user-picker";
5
- const packageVersion = "11.0.7";
5
+ const packageVersion = "11.0.9";
6
6
  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}$/;
7
7
  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}$/;
8
8
  const UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
@@ -44,7 +44,8 @@ export class PopupUserPickerWithoutAnalytics extends React.Component {
44
44
  placement,
45
45
  rootBoundary,
46
46
  shouldFlip,
47
- styles
47
+ styles,
48
+ strategy
48
49
  } = this.props;
49
50
  const width = this.props.width;
50
51
  const selectStyles = getPopupStyles(width, isMulti, styles,
@@ -55,7 +56,7 @@ export class PopupUserPickerWithoutAnalytics extends React.Component {
55
56
  width: width,
56
57
  styles: selectStyles,
57
58
  components: getPopupComponents(!!popupTitle),
58
- pickerProps: getPopupProps(width, target, this.handleFlipStyle, boundariesElement, offset, placement, rootBoundary, shouldFlip, popupTitle)
59
+ pickerProps: getPopupProps(width, target, this.handleFlipStyle, boundariesElement, offset, placement, rootBoundary, shouldFlip, popupTitle, strategy)
59
60
  }));
60
61
  }
61
62
  }
@@ -66,6 +67,7 @@ _defineProperty(PopupUserPickerWithoutAnalytics, "defaultProps", {
66
67
  offset: [0, 0],
67
68
  placement: 'auto',
68
69
  rootBoundary: 'viewport',
69
- shouldFlip: true
70
+ shouldFlip: true,
71
+ strategy: 'fixed'
70
72
  });
71
73
  export const PopupUserPicker = withAnalyticsEvents()(PopupUserPickerWithoutAnalytics);
@@ -45,7 +45,8 @@ export class UserPickerWithoutAnalytics extends React.Component {
45
45
  captureMenuScroll,
46
46
  closeMenuOnScroll,
47
47
  loadUserSource,
48
- required = false
48
+ required = false,
49
+ showClearIndicator = false
49
50
  } = this.props;
50
51
  const width = this.props.width;
51
52
  const SelectComponent = allowEmail ? CreatableSelect : Select;
@@ -77,7 +78,7 @@ export class UserPickerWithoutAnalytics extends React.Component {
77
78
  styles: getStyles(width, isMulti, this.props.appearance === 'compact', this.props.styles, this.props.isInvalid,
78
79
  // eslint-disable-next-line @atlaskit/platform/no-preconditioning, @atlaskit/platform/ensure-feature-flag-prefix
79
80
  fg('platform-component-visual-refresh') && fg('visual-refresh-user-picker')),
80
- components: getComponents(isMulti, anchor),
81
+ components: getComponents(isMulti, anchor, showClearIndicator && fg('user-picker-show-clear-indicator')),
81
82
  pickerProps: pickerProps
82
83
  })))));
83
84
  }
@@ -9,11 +9,10 @@ import { SingleValueContainer } from './SingleValueContainer';
9
9
  import { PopupInput } from './PopupInput';
10
10
  import { PopupControl } from './PopupControl';
11
11
  import { Menu } from './Menu';
12
-
13
12
  /**
14
13
  * Memoize getComponents to avoid rerenders.
15
14
  */
16
- export const getComponents = memoizeOne((multi, anchor) => {
15
+ export const getComponents = memoizeOne((multi, anchor, showClearIndicator) => {
17
16
  if (anchor) {
18
17
  return {
19
18
  Control: anchor,
@@ -24,7 +23,7 @@ export const getComponents = memoizeOne((multi, anchor) => {
24
23
  MultiValue,
25
24
  DropdownIndicator: null,
26
25
  SingleValue,
27
- ClearIndicator: multi ? null : ClearIndicator,
26
+ ClearIndicator: showClearIndicator || !multi ? ClearIndicator : null,
28
27
  Option,
29
28
  ValueContainer: multi ? MultiValueContainer : SingleValueContainer,
30
29
  Input,
@@ -1,5 +1,5 @@
1
1
  import memoizeOne from 'memoize-one';
2
- export const getPopupProps = memoizeOne((width, target, onFlip, boundariesElement, offset, placement, rootBoundary, shouldFlip, popupTitle) => ({
2
+ export const getPopupProps = memoizeOne((width, target, onFlip, boundariesElement, offset, placement, rootBoundary, shouldFlip, popupTitle, strategy) => ({
3
3
  searchThreshold: -1,
4
4
  controlShouldRenderValue: true,
5
5
  minMenuWidth: width,
@@ -9,7 +9,7 @@ export const getPopupProps = memoizeOne((width, target, onFlip, boundariesElemen
9
9
  popupTitle,
10
10
  popperProps: {
11
11
  placement: placement || 'auto',
12
- strategy: 'fixed',
12
+ strategy: strategy || 'fixed',
13
13
  modifiers: [{
14
14
  name: 'offset',
15
15
  options: {
@@ -5,7 +5,7 @@ import { createAndFireEvent } from '@atlaskit/analytics-next';
5
5
  import { v4 as uuidv4 } from 'uuid';
6
6
  import { isCustom, isExternalUser } from './components/utils';
7
7
  var packageName = "@atlaskit/user-picker";
8
- var packageVersion = "11.0.7";
8
+ var packageVersion = "11.0.9";
9
9
  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}$/;
10
10
  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}$/;
11
11
  var UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
@@ -54,7 +54,8 @@ export var PopupUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compo
54
54
  placement = _this$props.placement,
55
55
  rootBoundary = _this$props.rootBoundary,
56
56
  shouldFlip = _this$props.shouldFlip,
57
- styles = _this$props.styles;
57
+ styles = _this$props.styles,
58
+ strategy = _this$props.strategy;
58
59
  var width = this.props.width;
59
60
  var selectStyles = getPopupStyles(width, isMulti, styles,
60
61
  // eslint-disable-next-line @atlaskit/platform/no-preconditioning, @atlaskit/platform/ensure-feature-flag-prefix
@@ -64,7 +65,7 @@ export var PopupUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compo
64
65
  width: width,
65
66
  styles: selectStyles,
66
67
  components: getPopupComponents(!!popupTitle),
67
- pickerProps: getPopupProps(width, target, this.handleFlipStyle, boundariesElement, offset, placement, rootBoundary, shouldFlip, popupTitle)
68
+ pickerProps: getPopupProps(width, target, this.handleFlipStyle, boundariesElement, offset, placement, rootBoundary, shouldFlip, popupTitle, strategy)
68
69
  }));
69
70
  }
70
71
  }]);
@@ -76,6 +77,7 @@ _defineProperty(PopupUserPickerWithoutAnalytics, "defaultProps", {
76
77
  offset: [0, 0],
77
78
  placement: 'auto',
78
79
  rootBoundary: 'viewport',
79
- shouldFlip: true
80
+ shouldFlip: true,
81
+ strategy: 'fixed'
80
82
  });
81
83
  export var PopupUserPicker = withAnalyticsEvents()(PopupUserPickerWithoutAnalytics);
@@ -63,7 +63,9 @@ export var UserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component)
63
63
  closeMenuOnScroll = _this$props.closeMenuOnScroll,
64
64
  loadUserSource = _this$props.loadUserSource,
65
65
  _this$props$required = _this$props.required,
66
- required = _this$props$required === void 0 ? false : _this$props$required;
66
+ required = _this$props$required === void 0 ? false : _this$props$required,
67
+ _this$props$showClear = _this$props.showClearIndicator,
68
+ showClearIndicator = _this$props$showClear === void 0 ? false : _this$props$showClear;
67
69
  var width = this.props.width;
68
70
  var SelectComponent = allowEmail ? CreatableSelect : Select;
69
71
  var creatableProps = suggestEmailsForDomain ? getCreatableSuggestedEmailProps(suggestEmailsForDomain, isValidEmail) : getCreatableProps(isValidEmail);
@@ -90,7 +92,7 @@ export var UserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component)
90
92
  styles: getStyles(width, isMulti, this.props.appearance === 'compact', this.props.styles, this.props.isInvalid,
91
93
  // eslint-disable-next-line @atlaskit/platform/no-preconditioning, @atlaskit/platform/ensure-feature-flag-prefix
92
94
  fg('platform-component-visual-refresh') && fg('visual-refresh-user-picker')),
93
- components: getComponents(isMulti, anchor),
95
+ components: getComponents(isMulti, anchor, showClearIndicator && fg('user-picker-show-clear-indicator')),
94
96
  pickerProps: pickerProps
95
97
  })))));
96
98
  }
@@ -12,11 +12,10 @@ import { SingleValueContainer } from './SingleValueContainer';
12
12
  import { PopupInput } from './PopupInput';
13
13
  import { PopupControl } from './PopupControl';
14
14
  import { Menu } from './Menu';
15
-
16
15
  /**
17
16
  * Memoize getComponents to avoid rerenders.
18
17
  */
19
- export var getComponents = memoizeOne(function (multi, anchor) {
18
+ export var getComponents = memoizeOne(function (multi, anchor, showClearIndicator) {
20
19
  if (anchor) {
21
20
  return {
22
21
  Control: anchor,
@@ -27,7 +26,7 @@ export var getComponents = memoizeOne(function (multi, anchor) {
27
26
  MultiValue: MultiValue,
28
27
  DropdownIndicator: null,
29
28
  SingleValue: SingleValue,
30
- ClearIndicator: multi ? null : ClearIndicator,
29
+ ClearIndicator: showClearIndicator || !multi ? ClearIndicator : null,
31
30
  Option: Option,
32
31
  ValueContainer: multi ? MultiValueContainer : SingleValueContainer,
33
32
  Input: Input,
@@ -1,5 +1,5 @@
1
1
  import memoizeOne from 'memoize-one';
2
- export var getPopupProps = memoizeOne(function (width, target, onFlip, boundariesElement, offset, placement, rootBoundary, shouldFlip, popupTitle) {
2
+ export var getPopupProps = memoizeOne(function (width, target, onFlip, boundariesElement, offset, placement, rootBoundary, shouldFlip, popupTitle, strategy) {
3
3
  return {
4
4
  searchThreshold: -1,
5
5
  controlShouldRenderValue: true,
@@ -10,7 +10,7 @@ export var getPopupProps = memoizeOne(function (width, target, onFlip, boundarie
10
10
  popupTitle: popupTitle,
11
11
  popperProps: {
12
12
  placement: placement || 'auto',
13
- strategy: 'fixed',
13
+ strategy: strategy || 'fixed',
14
14
  modifiers: [{
15
15
  name: 'offset',
16
16
  options: {
@@ -129,6 +129,8 @@ export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
129
129
  required?: boolean | undefined;
130
130
  UNSAFE_hasDraggableParentComponent?: boolean | undefined;
131
131
  openMenuOnClick?: boolean | undefined;
132
+ strategy?: "absolute" | "fixed" | undefined;
133
+ showClearIndicator?: boolean | undefined;
132
134
  } & {
133
135
  SelectComponent: React.ComponentType<any>;
134
136
  pickerProps?: any;
@@ -142,7 +144,7 @@ export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
142
144
  * It may be removed in a future minor or patch when a longer-term workaround is found.
143
145
  */
144
146
  UNSAFE_hasDraggableParentComponent?: boolean | undefined;
145
- }, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isInvalid" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "onKeyDown" | "styles" | "value" | "required" | "appearance" | "footer" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "loadOptions" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "onClose" | "placeholderAvatar" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "ariaLabel" | "ariaLabelledBy" | "ariaDescribedBy" | "ariaLive" | "header" | "UNSAFE_hasDraggableParentComponent" | "SelectComponent" | "pickerProps"> & {
147
+ }, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isInvalid" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "onKeyDown" | "styles" | "value" | "required" | "appearance" | "footer" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "loadOptions" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "onClose" | "placeholderAvatar" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "ariaLabel" | "ariaLabelledBy" | "ariaDescribedBy" | "ariaLive" | "header" | "UNSAFE_hasDraggableParentComponent" | "strategy" | "showClearIndicator" | "SelectComponent" | "pickerProps"> & {
146
148
  isClearable?: boolean | undefined;
147
149
  isMulti?: boolean | undefined;
148
150
  openMenuOnClick?: boolean | undefined;
@@ -84,6 +84,8 @@ export declare const PopupUserPicker: React.ForwardRefExoticComponent<Omit<Pick<
84
84
  required?: boolean | undefined;
85
85
  UNSAFE_hasDraggableParentComponent?: boolean | undefined;
86
86
  openMenuOnClick?: boolean | undefined;
87
+ strategy?: "absolute" | "fixed" | undefined;
88
+ showClearIndicator?: boolean | undefined;
87
89
  } & {
88
90
  target: import("../types").Target;
89
91
  popupTitle?: string | undefined;
@@ -159,6 +161,8 @@ export declare const PopupUserPicker: React.ForwardRefExoticComponent<Omit<Pick<
159
161
  ariaLive?: "polite" | "off" | "assertive" | undefined;
160
162
  header?: React.ReactNode;
161
163
  UNSAFE_hasDraggableParentComponent?: boolean | undefined;
164
+ strategy?: "absolute" | "fixed" | undefined;
165
+ showClearIndicator?: boolean | undefined;
162
166
  popupTitle?: string | undefined;
163
167
  placement?: import("@popperjs/core").Placement | undefined;
164
168
  rootBoundary?: import("../types").RootBoundary | undefined;
@@ -75,7 +75,9 @@ export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
75
75
  required?: boolean | undefined;
76
76
  UNSAFE_hasDraggableParentComponent?: boolean | undefined;
77
77
  openMenuOnClick?: boolean | undefined;
78
- }, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isInvalid" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "onKeyDown" | "openMenuOnClick" | "styles" | "value" | "required" | "appearance" | "footer" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "onClose" | "subtle" | "noBorder" | "placeholderAvatar" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "ariaLabel" | "ariaLabelledBy" | "ariaDescribedBy" | "ariaLive" | "header" | "UNSAFE_hasDraggableParentComponent"> & {
78
+ strategy?: "absolute" | "fixed" | undefined;
79
+ showClearIndicator?: boolean | undefined;
80
+ }, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isInvalid" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "onKeyDown" | "openMenuOnClick" | "styles" | "value" | "required" | "appearance" | "footer" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "onClose" | "subtle" | "noBorder" | "placeholderAvatar" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "ariaLabel" | "ariaLabelledBy" | "ariaDescribedBy" | "ariaLive" | "header" | "UNSAFE_hasDraggableParentComponent" | "strategy" | "showClearIndicator"> & {
79
81
  isMulti?: boolean | undefined;
80
82
  width?: string | number | undefined;
81
83
  } & {} & React.RefAttributes<any>>;
@@ -10,7 +10,7 @@ import { Menu } from './Menu';
10
10
  /**
11
11
  * Memoize getComponents to avoid rerenders.
12
12
  */
13
- export declare const getComponents: import("memoize-one").MemoizedFn<(multi?: boolean, anchor?: React.ComponentType<any>) => {
13
+ export declare const getComponents: import("memoize-one").MemoizedFn<(multi?: boolean, anchor?: React.ComponentType<any>, showClearIndicator?: boolean) => {
14
14
  Control: import("react").ComponentType<any>;
15
15
  Option: import("react").FC<import("./Option").OptionProps>;
16
16
  MultiValue?: undefined;
@@ -1,6 +1,6 @@
1
1
  import { type Placement } from '@atlaskit/popper';
2
2
  import { type Target, type BoundariesElement, type RootBoundary } from '../types';
3
- export declare const getPopupProps: import("memoize-one").MemoizedFn<(width: string | number, target: Target, onFlip: (data: any) => any, boundariesElement?: BoundariesElement, offset?: number[], placement?: Placement, rootBoundary?: RootBoundary, shouldFlip?: boolean, popupTitle?: string) => {
3
+ export declare const getPopupProps: import("memoize-one").MemoizedFn<(width: string | number, target: Target, onFlip: (data: any) => any, boundariesElement?: BoundariesElement, offset?: number[], placement?: Placement, rootBoundary?: RootBoundary, shouldFlip?: boolean, popupTitle?: string, strategy?: 'fixed' | 'absolute') => {
4
4
  searchThreshold: number;
5
5
  controlShouldRenderValue: boolean;
6
6
  minMenuWidth: string | number;
@@ -10,7 +10,7 @@ export declare const getPopupProps: import("memoize-one").MemoizedFn<(width: str
10
10
  popupTitle: string | undefined;
11
11
  popperProps: {
12
12
  placement: Placement;
13
- strategy: string;
13
+ strategy: "absolute" | "fixed";
14
14
  modifiers: ({
15
15
  name: string;
16
16
  options: {
@@ -174,6 +174,10 @@ export type UserPickerProps = WithAnalyticsEventsProps & {
174
174
  UNSAFE_hasDraggableParentComponent?: boolean;
175
175
  /** Override the internal behaviour of default menu open on focus and applicable for single value select */
176
176
  openMenuOnClick?: boolean;
177
+ /** Positioning strategy for the popper element */
178
+ strategy?: 'fixed' | 'absolute';
179
+ /** Override default behavior and show the clear indicator. */
180
+ showClearIndicator?: boolean;
177
181
  };
178
182
  export type PopupUserPickerProps = UserPickerProps & {
179
183
  /** Whether to use the popup version of the single picker */
@@ -129,6 +129,8 @@ export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
129
129
  required?: boolean | undefined;
130
130
  UNSAFE_hasDraggableParentComponent?: boolean | undefined;
131
131
  openMenuOnClick?: boolean | undefined;
132
+ strategy?: "absolute" | "fixed" | undefined;
133
+ showClearIndicator?: boolean | undefined;
132
134
  } & {
133
135
  SelectComponent: React.ComponentType<any>;
134
136
  pickerProps?: any;
@@ -142,7 +144,7 @@ export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
142
144
  * It may be removed in a future minor or patch when a longer-term workaround is found.
143
145
  */
144
146
  UNSAFE_hasDraggableParentComponent?: boolean | undefined;
145
- }, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isInvalid" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "onKeyDown" | "styles" | "value" | "required" | "appearance" | "footer" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "loadOptions" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "onClose" | "placeholderAvatar" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "ariaLabel" | "ariaLabelledBy" | "ariaDescribedBy" | "ariaLive" | "header" | "UNSAFE_hasDraggableParentComponent" | "SelectComponent" | "pickerProps"> & {
147
+ }, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isInvalid" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "onKeyDown" | "styles" | "value" | "required" | "appearance" | "footer" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "loadOptions" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "onClose" | "placeholderAvatar" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "ariaLabel" | "ariaLabelledBy" | "ariaDescribedBy" | "ariaLive" | "header" | "UNSAFE_hasDraggableParentComponent" | "strategy" | "showClearIndicator" | "SelectComponent" | "pickerProps"> & {
146
148
  isClearable?: boolean | undefined;
147
149
  isMulti?: boolean | undefined;
148
150
  openMenuOnClick?: boolean | undefined;
@@ -84,6 +84,8 @@ export declare const PopupUserPicker: React.ForwardRefExoticComponent<Omit<Pick<
84
84
  required?: boolean | undefined;
85
85
  UNSAFE_hasDraggableParentComponent?: boolean | undefined;
86
86
  openMenuOnClick?: boolean | undefined;
87
+ strategy?: "absolute" | "fixed" | undefined;
88
+ showClearIndicator?: boolean | undefined;
87
89
  } & {
88
90
  target: import("../types").Target;
89
91
  popupTitle?: string | undefined;
@@ -165,6 +167,8 @@ export declare const PopupUserPicker: React.ForwardRefExoticComponent<Omit<Pick<
165
167
  ariaLive?: "polite" | "off" | "assertive" | undefined;
166
168
  header?: React.ReactNode;
167
169
  UNSAFE_hasDraggableParentComponent?: boolean | undefined;
170
+ strategy?: "absolute" | "fixed" | undefined;
171
+ showClearIndicator?: boolean | undefined;
168
172
  popupTitle?: string | undefined;
169
173
  placement?: import("@popperjs/core").Placement | undefined;
170
174
  rootBoundary?: import("../types").RootBoundary | undefined;
@@ -75,7 +75,9 @@ export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
75
75
  required?: boolean | undefined;
76
76
  UNSAFE_hasDraggableParentComponent?: boolean | undefined;
77
77
  openMenuOnClick?: boolean | undefined;
78
- }, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isInvalid" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "onKeyDown" | "openMenuOnClick" | "styles" | "value" | "required" | "appearance" | "footer" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "onClose" | "subtle" | "noBorder" | "placeholderAvatar" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "ariaLabel" | "ariaLabelledBy" | "ariaDescribedBy" | "ariaLive" | "header" | "UNSAFE_hasDraggableParentComponent"> & {
78
+ strategy?: "absolute" | "fixed" | undefined;
79
+ showClearIndicator?: boolean | undefined;
80
+ }, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isInvalid" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "onKeyDown" | "openMenuOnClick" | "styles" | "value" | "required" | "appearance" | "footer" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "onClose" | "subtle" | "noBorder" | "placeholderAvatar" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "ariaLabel" | "ariaLabelledBy" | "ariaDescribedBy" | "ariaLive" | "header" | "UNSAFE_hasDraggableParentComponent" | "strategy" | "showClearIndicator"> & {
79
81
  isMulti?: boolean | undefined;
80
82
  width?: string | number | undefined;
81
83
  } & {} & React.RefAttributes<any>>;
@@ -10,7 +10,7 @@ import { Menu } from './Menu';
10
10
  /**
11
11
  * Memoize getComponents to avoid rerenders.
12
12
  */
13
- export declare const getComponents: import("memoize-one").MemoizedFn<(multi?: boolean, anchor?: React.ComponentType<any>) => {
13
+ export declare const getComponents: import("memoize-one").MemoizedFn<(multi?: boolean, anchor?: React.ComponentType<any>, showClearIndicator?: boolean) => {
14
14
  Control: import("react").ComponentType<any>;
15
15
  Option: import("react").FC<import("./Option").OptionProps>;
16
16
  MultiValue?: undefined;
@@ -1,6 +1,6 @@
1
1
  import { type Placement } from '@atlaskit/popper';
2
2
  import { type Target, type BoundariesElement, type RootBoundary } from '../types';
3
- export declare const getPopupProps: import("memoize-one").MemoizedFn<(width: string | number, target: Target, onFlip: (data: any) => any, boundariesElement?: BoundariesElement, offset?: number[], placement?: Placement, rootBoundary?: RootBoundary, shouldFlip?: boolean, popupTitle?: string) => {
3
+ export declare const getPopupProps: import("memoize-one").MemoizedFn<(width: string | number, target: Target, onFlip: (data: any) => any, boundariesElement?: BoundariesElement, offset?: number[], placement?: Placement, rootBoundary?: RootBoundary, shouldFlip?: boolean, popupTitle?: string, strategy?: 'fixed' | 'absolute') => {
4
4
  searchThreshold: number;
5
5
  controlShouldRenderValue: boolean;
6
6
  minMenuWidth: string | number;
@@ -10,7 +10,7 @@ export declare const getPopupProps: import("memoize-one").MemoizedFn<(width: str
10
10
  popupTitle: string | undefined;
11
11
  popperProps: {
12
12
  placement: Placement;
13
- strategy: string;
13
+ strategy: "absolute" | "fixed";
14
14
  modifiers: ({
15
15
  name: string;
16
16
  options: {
@@ -174,6 +174,10 @@ export type UserPickerProps = WithAnalyticsEventsProps & {
174
174
  UNSAFE_hasDraggableParentComponent?: boolean;
175
175
  /** Override the internal behaviour of default menu open on focus and applicable for single value select */
176
176
  openMenuOnClick?: boolean;
177
+ /** Positioning strategy for the popper element */
178
+ strategy?: 'fixed' | 'absolute';
179
+ /** Override default behavior and show the clear indicator. */
180
+ showClearIndicator?: boolean;
177
181
  };
178
182
  export type PopupUserPickerProps = UserPickerProps & {
179
183
  /** 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": "11.0.7",
3
+ "version": "11.0.9",
4
4
  "description": "Fabric component for display a dropdown to select a user from",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -51,22 +51,22 @@
51
51
  "dependencies": {
52
52
  "@atlaskit/analytics-next": "^11.0.0",
53
53
  "@atlaskit/avatar": "^25.0.0",
54
- "@atlaskit/icon": "^25.0.0",
54
+ "@atlaskit/icon": "^25.5.0",
55
55
  "@atlaskit/logo": "^16.0.0",
56
56
  "@atlaskit/lozenge": "^12.2.0",
57
- "@atlaskit/people-teams-ui-public": "^3.0.0",
57
+ "@atlaskit/people-teams-ui-public": "^3.1.0",
58
58
  "@atlaskit/platform-feature-flags": "^1.1.0",
59
59
  "@atlaskit/popper": "^7.0.0",
60
- "@atlaskit/primitives": "^14.1.0",
61
- "@atlaskit/select": "^20.0.0",
60
+ "@atlaskit/primitives": "^14.4.0",
61
+ "@atlaskit/select": "^20.3.0",
62
62
  "@atlaskit/spinner": "^18.0.0",
63
- "@atlaskit/teams-avatar": "^2.1.0",
63
+ "@atlaskit/teams-avatar": "^2.3.0",
64
64
  "@atlaskit/theme": "^18.0.0",
65
- "@atlaskit/tokens": "^4.4.0",
65
+ "@atlaskit/tokens": "^4.7.0",
66
66
  "@atlaskit/tooltip": "^20.0.0",
67
67
  "@atlaskit/ufo": "^0.4.0",
68
68
  "@babel/runtime": "^7.0.0",
69
- "@compiled/react": "^0.18.2",
69
+ "@compiled/react": "^0.18.3",
70
70
  "@emotion/react": "^11.7.1",
71
71
  "lodash": "^4.17.21",
72
72
  "memoize-one": "^6.0.0",
@@ -80,7 +80,7 @@
80
80
  "devDependencies": {
81
81
  "@atlaskit/analytics-viewer": "^0.8.0",
82
82
  "@atlaskit/elements-test-helpers": "^0.9.0",
83
- "@atlaskit/heading": "^5.1.0",
83
+ "@atlaskit/heading": "^5.2.0",
84
84
  "@atlaskit/visual-regression": "^0.10.0",
85
85
  "@atlassian/feature-flags-test-utils": "^0.3.0",
86
86
  "@emotion/styled": "^11.0.0",
@@ -120,6 +120,9 @@
120
120
  },
121
121
  "visual-refresh-user-picker": {
122
122
  "type": "boolean"
123
+ },
124
+ "user-picker-show-clear-indicator": {
125
+ "type": "boolean"
123
126
  }
124
127
  }
125
128
  }