@atlaskit/user-picker 11.23.3 → 11.25.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.
Files changed (95) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/afm-cc/tsconfig.json +3 -0
  3. package/afm-jira/tsconfig.json +3 -0
  4. package/afm-products/tsconfig.json +3 -0
  5. package/dist/cjs/analytics.js +2 -1
  6. package/dist/cjs/components/AvatarItemOption.js +31 -2
  7. package/dist/cjs/components/AvatarOrIcon.js +1 -1
  8. package/dist/cjs/components/BaseUserPicker.js +69 -39
  9. package/dist/cjs/components/ClearIndicator.js +1 -1
  10. package/dist/cjs/components/Control.js +1 -1
  11. package/dist/cjs/components/CustomOption/main.js +1 -1
  12. package/dist/cjs/components/EmailOption/main.js +1 -1
  13. package/dist/cjs/components/ExternalUserOption/ExternalAvatarItemOption.js +1 -1
  14. package/dist/cjs/components/ExternalUserOption/InfoIcon.js +1 -1
  15. package/dist/cjs/components/GroupOption/main.js +1 -1
  16. package/dist/cjs/components/Input.js +1 -1
  17. package/dist/cjs/components/MultiValue.js +152 -10
  18. package/dist/cjs/components/MultiValueContainer.js +1 -1
  19. package/dist/cjs/components/SingleValue.compiled.css +2 -0
  20. package/dist/cjs/components/SingleValue.js +13 -3
  21. package/dist/cjs/components/SingleValueContainer.js +1 -1
  22. package/dist/cjs/components/UserPicker.js +1 -1
  23. package/dist/cjs/components/i18n.js +5 -0
  24. package/dist/cjs/components/styles.js +2 -1
  25. package/dist/cjs/components/utils.js +1 -1
  26. package/dist/cjs/util/group-options-by-type/index.js +7 -3
  27. package/dist/es2019/analytics.js +1 -0
  28. package/dist/es2019/components/AvatarItemOption.js +31 -2
  29. package/dist/es2019/components/AvatarOrIcon.js +1 -1
  30. package/dist/es2019/components/BaseUserPicker.js +30 -1
  31. package/dist/es2019/components/ClearIndicator.js +1 -1
  32. package/dist/es2019/components/Control.js +1 -1
  33. package/dist/es2019/components/CustomOption/main.js +1 -1
  34. package/dist/es2019/components/EmailOption/main.js +1 -1
  35. package/dist/es2019/components/ExternalUserOption/ExternalAvatarItemOption.js +1 -1
  36. package/dist/es2019/components/ExternalUserOption/InfoIcon.js +1 -1
  37. package/dist/es2019/components/GroupOption/main.js +1 -1
  38. package/dist/es2019/components/Input.js +1 -1
  39. package/dist/es2019/components/MultiValue.js +151 -11
  40. package/dist/es2019/components/MultiValueContainer.js +1 -1
  41. package/dist/es2019/components/SingleValue.compiled.css +2 -0
  42. package/dist/es2019/components/SingleValue.js +12 -3
  43. package/dist/es2019/components/SingleValueContainer.js +1 -1
  44. package/dist/es2019/components/UserPicker.js +1 -1
  45. package/dist/es2019/components/i18n.js +5 -0
  46. package/dist/es2019/components/styles.js +2 -1
  47. package/dist/es2019/components/utils.js +1 -1
  48. package/dist/es2019/util/group-options-by-type/index.js +7 -3
  49. package/dist/esm/analytics.js +1 -0
  50. package/dist/esm/components/AvatarItemOption.js +31 -2
  51. package/dist/esm/components/AvatarOrIcon.js +1 -1
  52. package/dist/esm/components/BaseUserPicker.js +69 -39
  53. package/dist/esm/components/ClearIndicator.js +1 -1
  54. package/dist/esm/components/Control.js +1 -1
  55. package/dist/esm/components/CustomOption/main.js +1 -1
  56. package/dist/esm/components/EmailOption/main.js +1 -1
  57. package/dist/esm/components/ExternalUserOption/ExternalAvatarItemOption.js +1 -1
  58. package/dist/esm/components/ExternalUserOption/InfoIcon.js +1 -1
  59. package/dist/esm/components/GroupOption/main.js +1 -1
  60. package/dist/esm/components/Input.js +1 -1
  61. package/dist/esm/components/MultiValue.js +150 -10
  62. package/dist/esm/components/MultiValueContainer.js +1 -1
  63. package/dist/esm/components/SingleValue.compiled.css +2 -0
  64. package/dist/esm/components/SingleValue.js +12 -3
  65. package/dist/esm/components/SingleValueContainer.js +1 -1
  66. package/dist/esm/components/UserPicker.js +1 -1
  67. package/dist/esm/components/i18n.js +5 -0
  68. package/dist/esm/components/styles.js +2 -1
  69. package/dist/esm/components/utils.js +1 -1
  70. package/dist/esm/util/group-options-by-type/index.js +7 -3
  71. package/dist/types/analytics.d.ts +2 -2
  72. package/dist/types/components/AvatarItemOption.d.ts +2 -2
  73. package/dist/types/components/BaseUserPicker.d.ts +4 -1
  74. package/dist/types/components/ExternalUserOption/index.d.ts +4 -2
  75. package/dist/types/components/ExternalUserOption/main.d.ts +3 -2
  76. package/dist/types/components/GroupOption/main.d.ts +2 -2
  77. package/dist/types/components/PopupUserPicker.d.ts +90 -86
  78. package/dist/types/components/UserPicker.d.ts +2 -1
  79. package/dist/types/components/i18n.d.ts +5 -0
  80. package/dist/types/index.d.ts +1 -1
  81. package/dist/types/types.d.ts +4 -0
  82. package/dist/types/util/group-options-by-type/index.d.ts +2 -1
  83. package/dist/types-ts4.5/analytics.d.ts +2 -2
  84. package/dist/types-ts4.5/components/AvatarItemOption.d.ts +2 -2
  85. package/dist/types-ts4.5/components/BaseUserPicker.d.ts +4 -1
  86. package/dist/types-ts4.5/components/ExternalUserOption/index.d.ts +4 -2
  87. package/dist/types-ts4.5/components/ExternalUserOption/main.d.ts +3 -2
  88. package/dist/types-ts4.5/components/GroupOption/main.d.ts +2 -2
  89. package/dist/types-ts4.5/components/PopupUserPicker.d.ts +90 -86
  90. package/dist/types-ts4.5/components/UserPicker.d.ts +2 -1
  91. package/dist/types-ts4.5/components/i18n.d.ts +5 -0
  92. package/dist/types-ts4.5/index.d.ts +1 -1
  93. package/dist/types-ts4.5/types.d.ts +4 -0
  94. package/dist/types-ts4.5/util/group-options-by-type/index.d.ts +2 -1
  95. package/package.json +16 -6
@@ -170,6 +170,11 @@ export const messages = defineMessages({
170
170
  defaultMessage: 'Guest groups can only access certain spaces and have limited access to user info.',
171
171
  description: 'Tooltip text for lozenge showing that a group is for guests in Confluence'
172
172
  },
173
+ archivedLozenge: {
174
+ id: 'fabric.elements.user-picker.archived.lozenge.text',
175
+ defaultMessage: 'Archived',
176
+ description: 'Text within the lozenge when the selected team has been archived/disbanded'
177
+ },
173
178
  userTypeLabel: {
174
179
  id: 'fabric.elements.user-picker.user.type.label',
175
180
  defaultMessage: 'People',
@@ -1,6 +1,7 @@
1
1
  import { B100, N0, N10, N20, N30, N100, R50, R400, N90 } from '@atlaskit/theme/colors';
2
2
  import memoizeOne from 'memoize-one';
3
3
  import { mergeStyles } from '@atlaskit/select';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
4
5
  export const BORDER_PADDING = "var(--ds-space-075, 6px)";
5
6
  export const AVATAR_PADDING = 6;
6
7
  export const INDICATOR_WIDTH = 39;
@@ -22,7 +23,7 @@ export const getStyles = memoizeOne((width, isMulti, isCompact, overrideStyles,
22
23
  ...css,
23
24
  width,
24
25
  borderColor: state.isFocused ? `var(--ds-border-focused, ${css.borderColor})` : state.isInvalid ? `var(--ds-border-danger, ${R400})` : state.selectProps.subtle || state.selectProps.noBorder ? 'transparent' : `var(--ds-border-input, ${N90})`,
25
- backgroundColor: state.isFocused ? `var(--ds-background-input, ${css['backgroundColor']})` : state.selectProps.subtle ? 'transparent' : state.selectProps.textFieldBackgroundColor ? `var(--ds-background-input, ${N10})` : `var(--ds-background-input, ${N20})`,
26
+ backgroundColor: state.isFocused ? `var(--ds-background-input, ${css['backgroundColor']})` : state.selectProps.subtle ? 'transparent' : state.isDisabled && fg('platform-dst-lozenge-tag-badge-visual-uplifts') ? `var(--ds-background-disabled, ${N10})` : state.selectProps.textFieldBackgroundColor ? `var(--ds-background-input, ${N10})` : `var(--ds-background-input, ${N20})`,
26
27
  '&:hover .fabric-user-picker__clear-indicator': {
27
28
  opacity: 1
28
29
  },
@@ -3,7 +3,7 @@ import { CustomType, EmailType, TeamType, GroupType, UserType, ExternalUserType
3
3
  import { PopupSelect } from '@atlaskit/select';
4
4
  export const isExternalUser = option => option.type === ExternalUserType || Boolean(option.isExternal);
5
5
  export const isUser = option => option.type === undefined || option.type === UserType;
6
- export const isTeam = option => option.type === TeamType;
6
+ export const isTeam = option => (option === null || option === void 0 ? void 0 : option.type) === TeamType;
7
7
  export const isGroup = option => option.type === GroupType;
8
8
  export const isEmail = option => option.type === EmailType;
9
9
  export const isCustom = option => option.type === CustomType;
@@ -1,8 +1,12 @@
1
1
  import React from 'react';
2
+ import { fg } from '@atlaskit/platform-feature-flags';
2
3
  import { FormattedMessage } from 'react-intl-next';
3
4
  import memoizeOne from 'memoize-one';
4
5
  import { messages } from '../../components/i18n';
5
- const getLabelForType = type => {
6
+ const getLabelForType = (type, customLabels) => {
7
+ if (customLabels && type in customLabels && fg('jsm-wfo-assignee-recommendation-on-queues')) {
8
+ return /*#__PURE__*/React.createElement(React.Fragment, null, customLabels[type]);
9
+ }
6
10
  switch (type) {
7
11
  case 'user':
8
12
  return /*#__PURE__*/React.createElement(FormattedMessage, messages.userTypeLabel);
@@ -18,7 +22,7 @@ const getLabelForType = type => {
18
22
  return /*#__PURE__*/React.createElement(FormattedMessage, messages.otherTypeLabel);
19
23
  }
20
24
  };
21
- export const groupOptionsByType = memoizeOne((options, groupByTypeOrder) => {
25
+ export const groupOptionsByType = memoizeOne((options, groupByTypeOrder, customGroupLabels) => {
22
26
  // If groupByTypeOrder is empty, just return the original options
23
27
  if (groupByTypeOrder.length === 0) {
24
28
  return options;
@@ -38,7 +42,7 @@ export const groupOptionsByType = memoizeOne((options, groupByTypeOrder) => {
38
42
  groupByTypeOrder.forEach(type => {
39
43
  if (groupedMap.has(type)) {
40
44
  result.push({
41
- label: getLabelForType(type),
45
+ label: getLabelForType(type, customGroupLabels),
42
46
  options: groupedMap.get(type)
43
47
  });
44
48
  groupedMap.delete(type);
@@ -1,6 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  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; }
3
3
  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) { _defineProperty(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; }
4
+ // eslint-disable-next-line @typescript-eslint/consistent-type-imports
4
5
  import { createAndFireEvent } from '@atlaskit/analytics-next';
5
6
  import FeatureGates from '@atlaskit/feature-gate-js-client';
6
7
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
@@ -6,9 +6,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
6
6
  * @jsx jsx
7
7
  */
8
8
  import React from 'react';
9
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
10
10
  import { css, jsx } from '@emotion/react';
11
11
  import Lozenge from '@atlaskit/lozenge';
12
+ import Tag from '@atlaskit/tag';
12
13
  import { isLozengeText } from './utils';
13
14
  import { fg } from '@atlaskit/platform-feature-flags';
14
15
  var AsyncTooltip = /*#__PURE__*/React.lazy(function () {
@@ -107,12 +108,40 @@ export var textWrapper = function textWrapper(color) {
107
108
  color: color
108
109
  });
109
110
  };
111
+ var lozengeAppearanceToTagColor = {
112
+ default: 'standard',
113
+ success: 'lime',
114
+ removed: 'red',
115
+ inprogress: 'blue',
116
+ new: 'purple',
117
+ moved: 'orange'
118
+ };
110
119
  export var AvatarItemOption = function AvatarItemOption(_ref) {
111
120
  var avatar = _ref.avatar,
112
121
  isDisabled = _ref.isDisabled,
113
122
  lozenge = _ref.lozenge,
114
123
  primaryText = _ref.primaryText,
115
124
  secondaryText = _ref.secondaryText;
125
+ var renderTag = function renderTag() {
126
+ if (isLozengeText(lozenge) && !lozenge.isBold) {
127
+ var color = lozenge.appearance ? lozengeAppearanceToTagColor[lozenge.appearance] : 'standard';
128
+ var tag = jsx(Tag, {
129
+ text: lozenge.text,
130
+ color: color,
131
+ isRemovable: false,
132
+ migration_fallback: "lozenge"
133
+ });
134
+ if (lozenge.tooltip) {
135
+ return jsx(React.Suspense, {
136
+ fallback: tag
137
+ }, jsx(AsyncTooltip, {
138
+ content: lozenge.tooltip
139
+ }, tag));
140
+ }
141
+ return tag;
142
+ }
143
+ return renderLozenge();
144
+ };
116
145
  var renderLozenge = function renderLozenge() {
117
146
  if (isLozengeText(lozenge)) {
118
147
  if (lozenge !== null && lozenge !== void 0 && lozenge.tooltip) {
@@ -140,6 +169,6 @@ export var AvatarItemOption = function AvatarItemOption(_ref) {
140
169
  css: getTextStyle(true)
141
170
  }, secondaryText))), lozenge && jsx("div", {
142
171
  css: additionalInfo
143
- }, renderLozenge()))
172
+ }, fg('platform-dst-lozenge-tag-badge-visual-uplifts') ? renderTag() : renderLozenge()))
144
173
  );
145
174
  };
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { SizeableAvatar } from './SizeableAvatar';
7
7
  import { getAvatarSize } from './utils';
8
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
9
9
  import { css, jsx } from '@emotion/react';
10
10
  var iconStyle = css({
11
11
  display: 'flex',
@@ -14,6 +14,7 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
14
14
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
15
15
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
16
16
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
17
+ import { fg } from '@atlaskit/platform-feature-flags';
17
18
  import { withAnalyticsEvents } from '@atlaskit/analytics-next';
18
19
  import { UFOExperienceState } from '@atlaskit/ufo';
19
20
  import debounce from 'lodash/debounce';
@@ -345,7 +346,7 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
345
346
  hoveringClearIndicator: hoveringClearIndicator
346
347
  });
347
348
  });
348
- _defineProperty(_this, "getOptions", function () {
349
+ _defineProperty(_this, "getOptionsOld", function () {
349
350
  var options = getOptions(_this.state.options) || [];
350
351
  var _this$props2 = _this.props,
351
352
  maxOptions = _this$props2.maxOptions,
@@ -370,6 +371,35 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
370
371
  }
371
372
  return groupByTypeOrder ? groupOptionsByType(options, groupByTypeOrder) : options;
372
373
  });
374
+ _defineProperty(_this, "getOptionsNew", function () {
375
+ var options = getOptions(_this.state.options) || [];
376
+ var _this$props3 = _this.props,
377
+ maxOptions = _this$props3.maxOptions,
378
+ isMulti = _this$props3.isMulti,
379
+ groupByTypeOrder = _this$props3.groupByTypeOrder,
380
+ customGroupLabels = _this$props3.customGroupLabels;
381
+ if (maxOptions === 0) {
382
+ return [];
383
+ }
384
+ if (maxOptions && maxOptions > 0 && maxOptions < options.length) {
385
+ var _value3 = _this.state.value;
386
+ var filteredOptions = options;
387
+ // Filter out previously selected options
388
+ if (isMulti && Array.isArray(_value3)) {
389
+ var valueIds = _value3.map(function (item) {
390
+ return item.data.id;
391
+ });
392
+ filteredOptions = options.filter(function (option) {
393
+ return valueIds.indexOf(option.data.id) === -1;
394
+ });
395
+ }
396
+ return groupByTypeOrder ? groupOptionsByType(filteredOptions.slice(0, maxOptions), groupByTypeOrder, customGroupLabels) : filteredOptions.slice(0, maxOptions);
397
+ }
398
+ return groupByTypeOrder ? groupOptionsByType(options, groupByTypeOrder, customGroupLabels) : options;
399
+ });
400
+ _defineProperty(_this, "getOptions", function () {
401
+ return fg('jsm-wfo-assignee-recommendation-on-queues') ? _this.getOptionsNew() : _this.getOptionsOld();
402
+ });
373
403
  _defineProperty(_this, "getAppearance", function () {
374
404
  return _this.props.appearance ? _this.props.appearance : 'normal';
375
405
  });
@@ -435,9 +465,9 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
435
465
  }, {
436
466
  key: "componentDidMount",
437
467
  value: function componentDidMount() {
438
- var _this$props3 = this.props,
439
- open = _this$props3.open,
440
- search = _this$props3.search;
468
+ var _this$props4 = this.props,
469
+ open = _this$props4.open,
470
+ search = _this$props4.search;
441
471
  // load options when the picker open
442
472
  if (open) {
443
473
  if (!this.session) {
@@ -505,41 +535,41 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
505
535
  }, {
506
536
  key: "render",
507
537
  value: function render() {
508
- var _this$props4 = this.props,
509
- isMulti = _this$props4.isMulti,
510
- isLoading = _this$props4.isLoading,
511
- subtle = _this$props4.subtle,
512
- noBorder = _this$props4.noBorder,
513
- placeholder = _this$props4.placeholder,
514
- isClearable = _this$props4.isClearable,
515
- isDisabled = _this$props4.isDisabled,
516
- isInvalid = _this$props4.isInvalid,
517
- clearValueLabel = _this$props4.clearValueLabel,
518
- menuMinWidth = _this$props4.menuMinWidth,
519
- menuPortalTarget = _this$props4.menuPortalTarget,
520
- loadOptionsErrorMessage = _this$props4.loadOptionsErrorMessage,
521
- addMoreMessage = _this$props4.addMoreMessage,
522
- noOptionsMessage = _this$props4.noOptionsMessage,
523
- footer = _this$props4.footer,
524
- disableInput = _this$props4.disableInput,
525
- components = _this$props4.components,
526
- pickerProps = _this$props4.pickerProps,
527
- SelectComponent = _this$props4.SelectComponent,
528
- styles = _this$props4.styles,
529
- autoFocus = _this$props4.autoFocus,
530
- fieldId = _this$props4.fieldId,
531
- inputId = _this$props4.inputId,
532
- maxPickerHeight = _this$props4.maxPickerHeight,
533
- textFieldBackgroundColor = _this$props4.textFieldBackgroundColor,
534
- ariaLabelledBy = _this$props4.ariaLabelledBy,
535
- ariaDescribedBy = _this$props4.ariaDescribedBy,
536
- ariaLive = _this$props4.ariaLive,
537
- ariaLabel = _this$props4.ariaLabel,
538
- name = _this$props4.name,
539
- header = _this$props4.header,
540
- required = _this$props4.required,
541
- UNSAFE_hasDraggableParentComponent = _this$props4.UNSAFE_hasDraggableParentComponent,
542
- placeholderAvatar = _this$props4.placeholderAvatar;
538
+ var _this$props5 = this.props,
539
+ isMulti = _this$props5.isMulti,
540
+ isLoading = _this$props5.isLoading,
541
+ subtle = _this$props5.subtle,
542
+ noBorder = _this$props5.noBorder,
543
+ placeholder = _this$props5.placeholder,
544
+ isClearable = _this$props5.isClearable,
545
+ isDisabled = _this$props5.isDisabled,
546
+ isInvalid = _this$props5.isInvalid,
547
+ clearValueLabel = _this$props5.clearValueLabel,
548
+ menuMinWidth = _this$props5.menuMinWidth,
549
+ menuPortalTarget = _this$props5.menuPortalTarget,
550
+ loadOptionsErrorMessage = _this$props5.loadOptionsErrorMessage,
551
+ addMoreMessage = _this$props5.addMoreMessage,
552
+ noOptionsMessage = _this$props5.noOptionsMessage,
553
+ footer = _this$props5.footer,
554
+ disableInput = _this$props5.disableInput,
555
+ components = _this$props5.components,
556
+ pickerProps = _this$props5.pickerProps,
557
+ SelectComponent = _this$props5.SelectComponent,
558
+ styles = _this$props5.styles,
559
+ autoFocus = _this$props5.autoFocus,
560
+ fieldId = _this$props5.fieldId,
561
+ inputId = _this$props5.inputId,
562
+ maxPickerHeight = _this$props5.maxPickerHeight,
563
+ textFieldBackgroundColor = _this$props5.textFieldBackgroundColor,
564
+ ariaLabelledBy = _this$props5.ariaLabelledBy,
565
+ ariaDescribedBy = _this$props5.ariaDescribedBy,
566
+ ariaLive = _this$props5.ariaLive,
567
+ ariaLabel = _this$props5.ariaLabel,
568
+ name = _this$props5.name,
569
+ header = _this$props5.header,
570
+ required = _this$props5.required,
571
+ UNSAFE_hasDraggableParentComponent = _this$props5.UNSAFE_hasDraggableParentComponent,
572
+ placeholderAvatar = _this$props5.placeholderAvatar;
543
573
  var _this$state3 = this.state,
544
574
  count = _this$state3.count,
545
575
  hoveringClearIndicator = _this$state3.hoveringClearIndicator,
@@ -1,4 +1,4 @@
1
- /* ClearIndicator.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* ClearIndicator.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
4
  import _createClass from "@babel/runtime/helpers/createClass";
@@ -1,4 +1,4 @@
1
- /* Control.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* Control.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./Control.compiled.css";
4
4
  import * as React from 'react';
@@ -11,7 +11,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
11
11
  * @jsx jsx
12
12
  */
13
13
  import { B400, N800, N200 } from '@atlaskit/theme/colors';
14
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
14
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
15
15
  import { jsx } from '@emotion/react';
16
16
  import React from 'react';
17
17
  import { AvatarItemOption, textWrapper } from '../AvatarItemOption';
@@ -13,7 +13,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
13
13
  import React from 'react';
14
14
  import { FormattedMessage } from 'react-intl-next';
15
15
  import { B400, N200, N800 } from '@atlaskit/theme/colors';
16
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
16
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
17
17
  import { jsx } from '@emotion/react';
18
18
  import { AddOptionAvatar } from '../AddOptionAvatar';
19
19
  import { AvatarItemOption, textWrapper } from '../AvatarItemOption';
@@ -6,7 +6,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
6
6
  * @jsx jsx
7
7
  */
8
8
 
9
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
10
10
  import { css, jsx } from '@emotion/react';
11
11
  import { B400 } from '@atlaskit/theme/colors';
12
12
  var outerWrapper = function outerWrapper(isDisabled) {
@@ -4,7 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  * @jsx jsx
5
5
  */
6
6
  import { useCallback, useState } from 'react';
7
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
8
8
  import { css, jsx } from '@emotion/react';
9
9
  import EditorPanelIcon from '@atlaskit/icon/core/status-information';
10
10
  import { N50, N200 } from '@atlaskit/theme/colors';
@@ -13,7 +13,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
13
13
  */
14
14
  import React from 'react';
15
15
  import { FormattedMessage } from 'react-intl-next';
16
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
16
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
17
17
  import { css, jsx } from '@emotion/react';
18
18
  import { N20, B400, N800, N200 } from '@atlaskit/theme/colors';
19
19
  import PeopleIcon from '@atlaskit/icon/core/people-group';
@@ -1,4 +1,4 @@
1
- /* Input.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* Input.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
4
  import _createClass from "@babel/runtime/helpers/createClass";
@@ -6,7 +6,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
6
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  import _inherits from "@babel/runtime/helpers/inherits";
8
8
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
- var _excluded = ["children", "innerProps"];
9
+ var _excluded = ["children", "innerProps", "removeProps", "data"];
10
10
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
11
11
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
12
12
  /**
@@ -19,12 +19,19 @@ import { Box, Inline, xcss } from '@atlaskit/primitives';
19
19
  import { components } from '@atlaskit/select';
20
20
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
21
21
  import { css, jsx } from '@emotion/react';
22
+ import Avatar from '@atlaskit/avatar';
23
+ import { fg } from '@atlaskit/platform-feature-flags';
24
+ import { AvatarTag, default as Tag } from '@atlaskit/tag';
25
+ import TeamAvatar from '@atlaskit/teams-avatar';
22
26
  import { AddOptionAvatar } from './AddOptionAvatar';
23
27
  import { AvatarOrIcon } from './AvatarOrIcon';
24
28
  import { SizeableAvatar } from './SizeableAvatar';
25
29
  import { getAvatarUrl, isEmail, isGroup, isTeam } from './utils';
30
+ import Lozenge from '@atlaskit/lozenge';
26
31
  import PeopleIcon from '@atlaskit/icon/core/people-group';
27
32
  import { VerifiedTeamIcon } from '@atlaskit/people-teams-ui-public/verified-team-icon';
33
+ import { FormattedMessage } from 'react-intl-next';
34
+ import { messages } from './i18n';
28
35
  export var scrollToValue = function scrollToValue(valueContainer, control) {
29
36
  var _valueContainer$getBo = valueContainer.getBoundingClientRect(),
30
37
  top = _valueContainer$getBo.top,
@@ -38,14 +45,34 @@ export var scrollToValue = function scrollToValue(valueContainer, control) {
38
45
  valueContainer.scrollIntoView(false);
39
46
  }
40
47
  };
41
- var groupTagContainer = xcss({
48
+ var groupTagContainerOld = xcss({
42
49
  paddingLeft: 'space.025',
43
50
  marginTop: 'space.025'
44
51
  });
52
+ var groupTagContainer = xcss({
53
+ paddingLeft: 'space.050'
54
+ });
55
+ var archivedLozengeWrapper = xcss({
56
+ display: 'flex',
57
+ paddingLeft: 'space.050'
58
+ });
59
+ var iconStyle = css({
60
+ display: 'flex',
61
+ alignItems: 'center',
62
+ justifyContent: 'center',
63
+ flexShrink: 0,
64
+ width: '20px',
65
+ height: '20px'
66
+ });
45
67
  var nameWrapper = css({
46
68
  font: "var(--ds-font-body, normal 400 14px/20px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
47
69
  paddingLeft: "var(--ds-space-050, 4px)"
48
70
  });
71
+ var avatarTagWrapperStyle = css({
72
+ display: 'inline-flex',
73
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space -- offsets AvatarTag's built-in space.050 margin down to space.025
74
+ margin: '-2px'
75
+ });
49
76
  export var MultiValue = /*#__PURE__*/function (_React$Component) {
50
77
  function MultiValue(props) {
51
78
  var _this;
@@ -62,7 +89,7 @@ export var MultiValue = /*#__PURE__*/function (_React$Component) {
62
89
  }
63
90
  if (isGroup(data)) {
64
91
  return jsx(Box, {
65
- xcss: groupTagContainer
92
+ xcss: groupTagContainerOld
66
93
  }, jsx(PeopleIcon, {
67
94
  color: "currentColor",
68
95
  label: "" // This element is a decorative icon and does not require a label
@@ -86,11 +113,19 @@ export var MultiValue = /*#__PURE__*/function (_React$Component) {
86
113
  });
87
114
  _defineProperty(_this, "getElemAfter", function () {
88
115
  var data = _this.props.data.data;
116
+ var canShowArchivedLozenge = isTeam(data) && (data === null || data === void 0 ? void 0 : data.state) === 'DISBANDED' && fg('enable-sup-archive-experience');
89
117
  if (isGroup(data) && data.includeTeamsUpdates || isTeam(data) && data.verified) {
90
118
  return jsx(VerifiedTeamIcon, {
91
119
  size: data.includeTeamsUpdates ? 'small' : 'medium'
92
120
  });
93
121
  }
122
+ if (canShowArchivedLozenge) {
123
+ return jsx(Box, {
124
+ xcss: archivedLozengeWrapper
125
+ }, jsx(Lozenge, {
126
+ appearance: "default"
127
+ }, jsx(FormattedMessage, messages.archivedLozenge)));
128
+ }
94
129
  return null;
95
130
  });
96
131
  _this.containerRef = /*#__PURE__*/React.createRef();
@@ -109,16 +144,19 @@ export var MultiValue = /*#__PURE__*/function (_React$Component) {
109
144
  key: "shouldComponentUpdate",
110
145
  value: function shouldComponentUpdate(nextProps) {
111
146
  var _this$props = this.props,
112
- _this$props$data = _this$props.data,
113
- label = _this$props$data.label,
114
- data = _this$props$data.data,
147
+ option = _this$props.data,
115
148
  innerProps = _this$props.innerProps,
116
149
  isFocused = _this$props.isFocused;
117
- var _nextProps$data = nextProps.data,
118
- nextLabel = _nextProps$data.label,
119
- nextData = _nextProps$data.data,
150
+ var nextOption = nextProps.data,
120
151
  nextInnerProps = nextProps.innerProps,
121
152
  nextIsFocused = nextProps.isFocused;
153
+ if (option == null || nextOption == null) {
154
+ return option !== nextOption || innerProps !== nextInnerProps || isFocused !== nextIsFocused;
155
+ }
156
+ var label = option.label,
157
+ data = option.data;
158
+ var nextLabel = nextOption.label,
159
+ nextData = nextOption.data;
122
160
 
123
161
  // We can ignore onRemove here because it is an anonymous function
124
162
  // that will be recreated every time but with the same implementation.
@@ -129,9 +167,111 @@ export var MultiValue = /*#__PURE__*/function (_React$Component) {
129
167
  value: function render() {
130
168
  var _this$props2 = this.props,
131
169
  children = _this$props2.children,
132
- innerProps = _this$props2.innerProps,
170
+ _innerProps = _this$props2.innerProps,
171
+ removeProps = _this$props2.removeProps,
172
+ option = _this$props2.data,
133
173
  rest = _objectWithoutProperties(_this$props2, _excluded);
174
+ if (fg('platform-dst-lozenge-tag-badge-visual-uplifts')) {
175
+ var _this$props$selectPro;
176
+ var data = option.data,
177
+ label = option.label;
178
+ var isTeamOption = isTeam(data);
179
+ var isGroupOption = isGroup(data);
180
+ var isEmailOption = isEmail(data);
181
+ var avatarUrl = getAvatarUrl(data);
182
+ var isDisabled = Boolean((_this$props$selectPro = this.props.selectProps) === null || _this$props$selectPro === void 0 ? void 0 : _this$props$selectPro.isDisabled);
183
+ var canShowArchivedLozenge = isTeam(data) && (data === null || data === void 0 ? void 0 : data.state) === 'DISBANDED' && fg('enable-sup-archive-experience');
184
+ var avatarProps = avatarUrl ? {
185
+ name: data.name,
186
+ src: avatarUrl
187
+ } : {
188
+ name: data.name
189
+ };
190
+ var removeAction = function removeAction() {
191
+ removeProps.onClick({});
192
+ return true;
193
+ };
194
+ if (isEmailOption) {
195
+ return jsx("span", {
196
+ ref: this.containerRef,
197
+ css: avatarTagWrapperStyle,
198
+ "data-user-picker-multi-value": true
199
+ }, jsx(Tag, {
200
+ text: label,
201
+ elemBefore: jsx(AddOptionAvatar, {
202
+ isLozenge: true,
203
+ isPendingAction: data.isPendingAction
204
+ }),
205
+ isRemovable: !isDisabled,
206
+ onBeforeRemoveAction: removeAction
207
+ }));
208
+ }
209
+ if (isGroupOption) {
210
+ return jsx("span", {
211
+ ref: this.containerRef,
212
+ css: avatarTagWrapperStyle,
213
+ "data-user-picker-multi-value": true
214
+ }, jsx(Tag, {
215
+ text: label,
216
+ elemBefore: jsx(Box, {
217
+ xcss: groupTagContainer
218
+ }, jsx(PeopleIcon, {
219
+ color: "currentColor",
220
+ label: "" // This element is a decorative icon and does not require a label
221
+ ,
222
+ size: "small"
223
+ })),
224
+ isRemovable: !isDisabled,
225
+ onBeforeRemoveAction: removeAction
226
+ }));
227
+ }
228
+ if (data.icon) {
229
+ return jsx("span", {
230
+ ref: this.containerRef,
231
+ css: avatarTagWrapperStyle,
232
+ "data-user-picker-multi-value": true
233
+ }, jsx(Tag, {
234
+ text: label,
235
+ elemBefore: jsx("div", {
236
+ css: iconStyle,
237
+ style: {
238
+ color: data.iconColor
239
+ }
240
+ }, data.icon),
241
+ isRemovable: !isDisabled,
242
+ onBeforeRemoveAction: removeAction
243
+ }));
244
+ }
245
+ return jsx("span", {
246
+ ref: this.containerRef,
247
+ css: avatarTagWrapperStyle,
248
+ "data-user-picker-multi-value": true
249
+ }, isTeamOption ? jsx(React.Fragment, null, jsx(AvatarTag, {
250
+ type: "other",
251
+ text: label,
252
+ isVerified: isTeamOption ? data.verified : undefined,
253
+ isRemovable: !isDisabled,
254
+ onBeforeRemoveAction: removeAction,
255
+ avatar: function avatar(props) {
256
+ return jsx(TeamAvatar, _extends({}, props, avatarProps));
257
+ }
258
+ }), canShowArchivedLozenge ? jsx(Box, {
259
+ xcss: archivedLozengeWrapper
260
+ }, jsx(Lozenge, {
261
+ appearance: "default"
262
+ }, jsx(FormattedMessage, messages.archivedLozenge))) : null) : jsx(AvatarTag, {
263
+ type: "user",
264
+ text: label,
265
+ isRemovable: !isDisabled,
266
+ onBeforeRemoveAction: removeAction,
267
+ avatar: function avatar(props) {
268
+ return jsx(Avatar, _extends({}, props, avatarProps));
269
+ }
270
+ }));
271
+ }
134
272
  return jsx(components.MultiValue, _extends({}, rest, {
273
+ data: option,
274
+ removeProps: removeProps,
135
275
  innerProps: {
136
276
  ref: this.containerRef
137
277
  },
@@ -1,4 +1,4 @@
1
- /* MultiValueContainer.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* MultiValueContainer.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
4
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
@@ -1,6 +1,8 @@
1
1
  ._16jlkb7n{flex-grow:1}
2
2
  ._18m915vq{overflow-y:hidden}
3
+ ._19bv1b66{padding-left:var(--ds-space-050,4px)}
3
4
  ._1bto1l2s{text-overflow:ellipsis}
5
+ ._1e0c1txw{display:flex}
4
6
  ._1o9zkb7n{flex-shrink:1}
5
7
  ._1reo15vq{overflow-x:hidden}
6
8
  ._1ul953f4{min-width:75pt}