@atlaskit/user-picker 10.24.2 → 10.26.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 (42) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/afm-cc/tsconfig.json +6 -0
  3. package/afm-jira/tsconfig.json +6 -0
  4. package/afm-post-office/tsconfig.json +6 -0
  5. package/dist/cjs/analytics.js +1 -1
  6. package/dist/cjs/components/BaseUserPicker.js +2 -0
  7. package/dist/cjs/components/MultiValue.js +17 -3
  8. package/dist/cjs/components/SingleValue.js +17 -2
  9. package/dist/cjs/components/TeamOption/main.js +11 -1
  10. package/dist/cjs/components/UserPicker.js +1 -1
  11. package/dist/cjs/components/styles.js +3 -3
  12. package/dist/es2019/analytics.js +1 -1
  13. package/dist/es2019/components/BaseUserPicker.js +2 -0
  14. package/dist/es2019/components/MultiValue.js +23 -5
  15. package/dist/es2019/components/SingleValue.js +22 -3
  16. package/dist/es2019/components/TeamOption/main.js +11 -1
  17. package/dist/es2019/components/UserPicker.js +1 -1
  18. package/dist/es2019/components/styles.js +3 -3
  19. package/dist/esm/analytics.js +1 -1
  20. package/dist/esm/components/BaseUserPicker.js +2 -0
  21. package/dist/esm/components/MultiValue.js +19 -5
  22. package/dist/esm/components/SingleValue.js +18 -3
  23. package/dist/esm/components/TeamOption/main.js +11 -1
  24. package/dist/esm/components/UserPicker.js +1 -1
  25. package/dist/esm/components/styles.js +3 -3
  26. package/dist/types/components/BaseUserPicker.d.ts +156 -2
  27. package/dist/types/components/ExternalUserOption/index.d.ts +5 -1
  28. package/dist/types/components/ExternalUserOption/main.d.ts +5 -1
  29. package/dist/types/components/MultiValue.d.ts +1 -0
  30. package/dist/types/components/PopupUserPicker.d.ts +145 -1
  31. package/dist/types/components/UserPicker.d.ts +129 -1
  32. package/dist/types/components/styles.d.ts +1 -1
  33. package/dist/types/types.d.ts +3 -0
  34. package/dist/types-ts4.5/components/BaseUserPicker.d.ts +156 -2
  35. package/dist/types-ts4.5/components/ExternalUserOption/index.d.ts +5 -1
  36. package/dist/types-ts4.5/components/ExternalUserOption/main.d.ts +5 -1
  37. package/dist/types-ts4.5/components/MultiValue.d.ts +1 -0
  38. package/dist/types-ts4.5/components/PopupUserPicker.d.ts +151 -1
  39. package/dist/types-ts4.5/components/UserPicker.d.ts +129 -1
  40. package/dist/types-ts4.5/components/styles.d.ts +1 -1
  41. package/dist/types-ts4.5/types.d.ts +3 -0
  42. package/package.json +13 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @atlaskit/user-picker
2
2
 
3
+ ## 10.26.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#153007](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/153007)
8
+ [`1c28c3db19101`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1c28c3db19101) -
9
+ Show verified icon for teams in user picker
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 10.25.0
16
+
17
+ ### Minor Changes
18
+
19
+ - [#148732](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/148732)
20
+ [`9391607579cb6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9391607579cb6) -
21
+ UserPicker component updated to accept isInvalid prop, and display invalid state styles when the
22
+ prop is set to true
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies
27
+
3
28
  ## 10.24.2
4
29
 
5
30
  ### Patch Changes
@@ -33,6 +33,12 @@
33
33
  {
34
34
  "path": "../../../design-system/lozenge/afm-cc/tsconfig.json"
35
35
  },
36
+ {
37
+ "path": "../../../people-and-teams/people-teams-ui-public/afm-cc/tsconfig.json"
38
+ },
39
+ {
40
+ "path": "../../../platform/feature-flags/afm-cc/tsconfig.json"
41
+ },
36
42
  {
37
43
  "path": "../../../design-system/popper/afm-cc/tsconfig.json"
38
44
  },
@@ -32,6 +32,12 @@
32
32
  {
33
33
  "path": "../../../design-system/lozenge/afm-jira/tsconfig.json"
34
34
  },
35
+ {
36
+ "path": "../../../people-and-teams/people-teams-ui-public/afm-jira/tsconfig.json"
37
+ },
38
+ {
39
+ "path": "../../../platform/feature-flags/afm-jira/tsconfig.json"
40
+ },
35
41
  {
36
42
  "path": "../../../design-system/popper/afm-jira/tsconfig.json"
37
43
  },
@@ -32,6 +32,12 @@
32
32
  {
33
33
  "path": "../../../design-system/lozenge/afm-post-office/tsconfig.json"
34
34
  },
35
+ {
36
+ "path": "../../../people-and-teams/people-teams-ui-public/afm-post-office/tsconfig.json"
37
+ },
38
+ {
39
+ "path": "../../../platform/feature-flags/afm-post-office/tsconfig.json"
40
+ },
35
41
  {
36
42
  "path": "../../../design-system/popper/afm-post-office/tsconfig.json"
37
43
  },
@@ -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 = "10.24.2";
15
+ var packageVersion = "10.26.0";
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}$/;
@@ -474,6 +474,7 @@ var BaseUserPickerWithoutAnalytics = exports.BaseUserPickerWithoutAnalytics = /*
474
474
  placeholder = _this$props4.placeholder,
475
475
  isClearable = _this$props4.isClearable,
476
476
  isDisabled = _this$props4.isDisabled,
477
+ isInvalid = _this$props4.isInvalid,
477
478
  clearValueLabel = _this$props4.clearValueLabel,
478
479
  menuMinWidth = _this$props4.menuMinWidth,
479
480
  menuPortalTarget = _this$props4.menuPortalTarget,
@@ -548,6 +549,7 @@ var BaseUserPickerWithoutAnalytics = exports.BaseUserPickerWithoutAnalytics = /*
548
549
  },
549
550
  footer: footer,
550
551
  isDisabled: isDisabled,
552
+ isInvalid: isInvalid,
551
553
  isFocused: menuIsOpen,
552
554
  backspaceRemovesValue: isMulti,
553
555
  filterOption: null // disable local filtering
@@ -24,6 +24,8 @@ var _SizeableAvatar = require("./SizeableAvatar");
24
24
  var _i18n = require("./i18n");
25
25
  var _utils = require("./utils");
26
26
  var _peopleGroupPeople = _interopRequireDefault(require("@atlaskit/icon/core/migration/people-group--people"));
27
+ var _verifiedTeamIcon = require("@atlaskit/people-teams-ui-public/verified-team-icon");
28
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
27
29
  var _excluded = ["children", "innerProps"];
28
30
  function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
29
31
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
@@ -85,9 +87,19 @@ var MultiValue = exports.MultiValue = /*#__PURE__*/function (_React$Component) {
85
87
  }
86
88
  return (0, _react2.jsx)(_SizeableAvatar.SizeableAvatar, {
87
89
  appearance: "multi",
88
- src: (0, _utils.getAvatarUrl)(data)
90
+ src: (0, _utils.getAvatarUrl)(data),
91
+ type: (0, _utils.isTeam)(data) && (0, _platformFeatureFlags.fg)('verified-team-in-user-picker') ? 'team' : 'person'
89
92
  });
90
93
  });
94
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getElemAfter", function () {
95
+ var data = _this.props.data.data;
96
+ if ((0, _utils.isTeam)(data) && data.verified && (0, _platformFeatureFlags.fg)('verified-team-in-user-picker')) {
97
+ return (0, _react2.jsx)(_verifiedTeamIcon.VerifiedTeamIcon, {
98
+ size: "small"
99
+ });
100
+ }
101
+ return null;
102
+ });
91
103
  _this.containerRef = /*#__PURE__*/_react.default.createRef();
92
104
  return _this;
93
105
  }
@@ -130,9 +142,11 @@ var MultiValue = exports.MultiValue = /*#__PURE__*/function (_React$Component) {
130
142
  ref: this.containerRef
131
143
  },
132
144
  cropWithEllipsis: false
133
- }), this.getElemBefore(), " ", (0, _react2.jsx)("div", {
145
+ }), (0, _react2.jsx)(_primitives.Inline, {
146
+ alignBlock: "center"
147
+ }, this.getElemBefore(), " ", (0, _react2.jsx)("div", {
134
148
  css: nameWrapper
135
- }, children));
149
+ }, children), this.getElemAfter()));
136
150
  }
137
151
  }]);
138
152
  return MultiValue;
@@ -12,6 +12,9 @@ var _react = require("@emotion/react");
12
12
  var _select = require("@atlaskit/select");
13
13
  var _SizeableAvatar = require("./SizeableAvatar");
14
14
  var _utils = require("./utils");
15
+ var _verifiedTeamIcon = require("@atlaskit/people-teams-ui-public/verified-team-icon");
16
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
+ var _primitives = require("@atlaskit/primitives");
15
18
  var _excluded = ["ref"];
16
19
  /**
17
20
  * @jsxRuntime classic
@@ -36,6 +39,15 @@ var avatarItemComponent = (0, _react.css)({
36
39
  border: 'none'
37
40
  }
38
41
  });
42
+ var ElementAfter = function ElementAfter(props) {
43
+ var data = props.data.data;
44
+ if ((0, _utils.isTeam)(data) && data.verified) {
45
+ return (0, _react.jsx)(_verifiedTeamIcon.VerifiedTeamIcon, {
46
+ size: "small"
47
+ });
48
+ }
49
+ return null;
50
+ };
39
51
  var SingleValue = exports.SingleValue = function SingleValue(props) {
40
52
  var _props$data = props.data,
41
53
  label = _props$data.label,
@@ -47,9 +59,12 @@ var SingleValue = exports.SingleValue = function SingleValue(props) {
47
59
  backgroundColor: "transparent",
48
60
  avatar: (0, _react.jsx)(_SizeableAvatar.SizeableAvatar, {
49
61
  src: (0, _utils.getAvatarUrl)(data),
50
- appearance: appearance
62
+ appearance: appearance,
63
+ type: (0, _utils.isTeam)(data) && (0, _platformFeatureFlags.fg)('verified-team-in-user-picker') ? 'team' : 'person'
51
64
  }),
52
- primaryText: label
65
+ primaryText: (0, _platformFeatureFlags.fg)('verified-team-in-user-picker') ? (0, _react.jsx)(_primitives.Inline, {
66
+ alignBlock: "center"
67
+ }, label, (0, _react.jsx)(ElementAfter, props)) : label
53
68
  }, function (_ref) {
54
69
  var ref = _ref.ref,
55
70
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
@@ -14,6 +14,9 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
14
14
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
15
15
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
16
  var _colors = require("@atlaskit/theme/colors");
17
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
+ var _primitives = require("@atlaskit/primitives");
19
+ var _verifiedTeamIcon = require("@atlaskit/people-teams-ui-public/verified-team-icon");
17
20
  var _react = require("@emotion/react");
18
21
  var _react2 = _interopRequireDefault(require("react"));
19
22
  var _reactIntlNext = require("react-intl-next");
@@ -39,14 +42,21 @@ var TeamOption = exports.TeamOption = /*#__PURE__*/function (_React$PureComponen
39
42
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getPrimaryText", function () {
40
43
  var _this$props$team = _this.props.team,
41
44
  name = _this$props$team.name,
42
- highlight = _this$props$team.highlight;
45
+ highlight = _this$props$team.highlight,
46
+ verified = _this$props$team.verified;
43
47
  return [(0, _react.jsx)("span", {
44
48
  key: "name"
45
49
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
46
50
  ,
47
51
  css: (0, _AvatarItemOption.textWrapper)(_this.props.isSelected ? "var(--ds-text-selected, ".concat(_colors.B400, ")") : "var(--ds-text, ".concat(_colors.N800, ")"))
52
+ }, (0, _platformFeatureFlags.fg)('verified-team-in-user-picker') ? (0, _react.jsx)(_primitives.Inline, {
53
+ alignBlock: "center"
48
54
  }, (0, _react.jsx)(_HighlightText.HighlightText, {
49
55
  highlights: highlight && highlight.name
56
+ }, name), verified && (0, _react.jsx)(_verifiedTeamIcon.VerifiedTeamIcon, {
57
+ size: "small"
58
+ })) : (0, _react.jsx)(_HighlightText.HighlightText, {
59
+ highlights: highlight && highlight.name
50
60
  }, name))];
51
61
  });
52
62
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderByline", function () {
@@ -95,7 +95,7 @@ var UserPickerWithoutAnalytics = exports.UserPickerWithoutAnalytics = /*#__PURE_
95
95
  SelectComponent: SelectComponent
96
96
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
97
97
  ,
98
- styles: (0, _styles.getStyles)(width, isMulti, this.props.appearance === 'compact', this.props.styles),
98
+ styles: (0, _styles.getStyles)(width, isMulti, this.props.appearance === 'compact', this.props.styles, this.props.isInvalid),
99
99
  components: (0, _components.getComponents)(isMulti, anchor),
100
100
  pickerProps: pickerProps
101
101
  })))));
@@ -17,7 +17,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
17
17
  var BORDER_PADDING = exports.BORDER_PADDING = "var(--ds-space-075, 6px)";
18
18
  var AVATAR_PADDING = exports.AVATAR_PADDING = 6;
19
19
  var INDICATOR_WIDTH = exports.INDICATOR_WIDTH = 39;
20
- var getStyles = exports.getStyles = (0, _memoizeOne.default)(function (width, isMulti, isCompact, overrideStyles) {
20
+ var getStyles = exports.getStyles = (0, _memoizeOne.default)(function (width, isMulti, isCompact, overrideStyles, isInvalid) {
21
21
  var styles = {
22
22
  menu: function menu(css, state) {
23
23
  return _objectSpread(_objectSpread({}, css), {}, {
@@ -35,13 +35,13 @@ var getStyles = exports.getStyles = (0, _memoizeOne.default)(function (width, is
35
35
  var isMulti = state.selectProps.isMulti;
36
36
  return _objectSpread(_objectSpread({}, css), {}, {
37
37
  width: width,
38
- borderColor: state.isFocused ? "var(--ds-border-focused, ".concat(css.borderColor, ")") : state.selectProps.subtle || state.selectProps.noBorder ? 'transparent' : "var(--ds-border-input, ".concat(_colors.N90, ")"),
38
+ borderColor: isInvalid ? "var(--ds-border-danger, ".concat(_colors.R400, ")") : state.isFocused ? "var(--ds-border-focused, ".concat(css.borderColor, ")") : state.selectProps.subtle || state.selectProps.noBorder ? 'transparent' : "var(--ds-border-input, ".concat(_colors.N90, ")"),
39
39
  backgroundColor: state.isFocused ? "var(--ds-background-input, ".concat(css['backgroundColor'], ")") : state.selectProps.subtle ? 'transparent' : state.selectProps.textFieldBackgroundColor ? "var(--ds-background-input, ".concat(_colors.N10, ")") : "var(--ds-background-input, ".concat(_colors.N20, ")"),
40
40
  '&:hover .fabric-user-picker__clear-indicator': {
41
41
  opacity: 1
42
42
  },
43
43
  ':hover': _objectSpread(_objectSpread({}, css[':hover']), {}, {
44
- borderColor: state.isFocused ? css[':hover'] ? "var(--ds-border-focused, ".concat(css[':hover'].borderColor, ")") : "var(--ds-border-focused, ".concat(_colors.B100, ")") : state.selectProps.subtle ? 'transparent' : "var(--ds-border-input, ".concat(_colors.N90, ")"),
44
+ borderColor: isInvalid ? "var(--ds-border-danger, ".concat(_colors.R400, ")") : state.isFocused ? css[':hover'] ? "var(--ds-border-focused, ".concat(css[':hover'].borderColor, ")") : "var(--ds-border-focused, ".concat(_colors.B100, ")") : state.selectProps.subtle ? 'transparent' : "var(--ds-border-input, ".concat(_colors.N90, ")"),
45
45
  backgroundColor: state.selectProps.subtle && state.selectProps.hoveringClearIndicator ? "var(--ds-background-danger, ".concat(_colors.R50, ")") : state.isFocused ? css[':hover'] ? "var(--ds-background-input, ".concat(css[':hover'].backgroundColor, ")") : "var(--ds-background-input, ".concat(_colors.N0, ")") : state.isDisabled ? "var(--ds-background-disabled, ".concat(_colors.N10, ")") : "var(--ds-background-input-hovered, ".concat(_colors.N30, ")")
46
46
  }),
47
47
  padding: 0,
@@ -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 = "10.24.2";
5
+ const packageVersion = "10.26.0";
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}$/;
@@ -450,6 +450,7 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
450
450
  placeholder,
451
451
  isClearable,
452
452
  isDisabled,
453
+ isInvalid,
453
454
  clearValueLabel,
454
455
  menuMinWidth,
455
456
  menuPortalTarget,
@@ -526,6 +527,7 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
526
527
  noOptionsMessage: showError ? loadOptionsErrorMessage : typeof noOptionsMessage === 'function' ? noOptionsMessage : () => noOptionsMessage,
527
528
  footer: footer,
528
529
  isDisabled: isDisabled,
530
+ isInvalid: isInvalid,
529
531
  isFocused: menuIsOpen,
530
532
  backspaceRemovesValue: isMulti,
531
533
  filterOption: null // disable local filtering
@@ -6,15 +6,17 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
6
6
  */
7
7
  import React from 'react';
8
8
  import { FormattedMessage } from 'react-intl-next';
9
- import { Box, xcss } from '@atlaskit/primitives';
9
+ import { Box, Inline, xcss } from '@atlaskit/primitives';
10
10
  import { components } from '@atlaskit/select';
11
11
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
12
12
  import { css, jsx } from '@emotion/react';
13
13
  import { AddOptionAvatar } from './AddOptionAvatar';
14
14
  import { SizeableAvatar } from './SizeableAvatar';
15
15
  import { messages } from './i18n';
16
- import { getAvatarUrl, isEmail, isGroup } from './utils';
16
+ import { getAvatarUrl, isEmail, isGroup, isTeam } from './utils';
17
17
  import PeopleIcon from '@atlaskit/icon/core/migration/people-group--people';
18
+ import { VerifiedTeamIcon } from '@atlaskit/people-teams-ui-public/verified-team-icon';
19
+ import { fg } from '@atlaskit/platform-feature-flags';
18
20
  export const scrollToValue = (valueContainer, control) => {
19
21
  const {
20
22
  top,
@@ -69,9 +71,23 @@ export class MultiValue extends React.Component {
69
71
  }
70
72
  return jsx(SizeableAvatar, {
71
73
  appearance: "multi",
72
- src: getAvatarUrl(data)
74
+ src: getAvatarUrl(data),
75
+ type: isTeam(data) && fg('verified-team-in-user-picker') ? 'team' : 'person'
73
76
  });
74
77
  });
78
+ _defineProperty(this, "getElemAfter", () => {
79
+ const {
80
+ data: {
81
+ data
82
+ }
83
+ } = this.props;
84
+ if (isTeam(data) && data.verified && fg('verified-team-in-user-picker')) {
85
+ return jsx(VerifiedTeamIcon, {
86
+ size: "small"
87
+ });
88
+ }
89
+ return null;
90
+ });
75
91
  this.containerRef = /*#__PURE__*/React.createRef();
76
92
  }
77
93
  componentDidUpdate() {
@@ -115,8 +131,10 @@ export class MultiValue extends React.Component {
115
131
  ref: this.containerRef
116
132
  },
117
133
  cropWithEllipsis: false
118
- }), this.getElemBefore(), " ", jsx("div", {
134
+ }), jsx(Inline, {
135
+ alignBlock: "center"
136
+ }, this.getElemBefore(), " ", jsx("div", {
119
137
  css: nameWrapper
120
- }, children));
138
+ }, children), this.getElemAfter()));
121
139
  }
122
140
  }
@@ -8,7 +8,10 @@ import { AvatarItem } from '@atlaskit/avatar';
8
8
  import { css, jsx } from '@emotion/react';
9
9
  import { components } from '@atlaskit/select';
10
10
  import { SizeableAvatar } from './SizeableAvatar';
11
- import { getAvatarUrl } from './utils';
11
+ import { getAvatarUrl, isTeam } from './utils';
12
+ import { VerifiedTeamIcon } from '@atlaskit/people-teams-ui-public/verified-team-icon';
13
+ import { fg } from '@atlaskit/platform-feature-flags';
14
+ import { Inline } from '@atlaskit/primitives';
12
15
  const avatarItemComponent = css({
13
16
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
14
17
  border: 'none !important',
@@ -27,6 +30,19 @@ const avatarItemComponent = css({
27
30
  border: 'none'
28
31
  }
29
32
  });
33
+ const ElementAfter = props => {
34
+ const {
35
+ data: {
36
+ data
37
+ }
38
+ } = props;
39
+ if (isTeam(data) && data.verified) {
40
+ return jsx(VerifiedTeamIcon, {
41
+ size: "small"
42
+ });
43
+ }
44
+ return null;
45
+ };
30
46
  export const SingleValue = props => {
31
47
  const {
32
48
  data: {
@@ -43,9 +59,12 @@ export const SingleValue = props => {
43
59
  backgroundColor: "transparent",
44
60
  avatar: jsx(SizeableAvatar, {
45
61
  src: getAvatarUrl(data),
46
- appearance: appearance
62
+ appearance: appearance,
63
+ type: isTeam(data) && fg('verified-team-in-user-picker') ? 'team' : 'person'
47
64
  }),
48
- primaryText: label
65
+ primaryText: fg('verified-team-in-user-picker') ? jsx(Inline, {
66
+ alignBlock: "center"
67
+ }, label, jsx(ElementAfter, props)) : label
49
68
  }, ({
50
69
  ref,
51
70
  ...props
@@ -5,6 +5,9 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
5
5
  * @jsx jsx
6
6
  */
7
7
  import { B400, N800, N200 } from '@atlaskit/theme/colors';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
9
+ import { Inline } from '@atlaskit/primitives';
10
+ import { VerifiedTeamIcon } from '@atlaskit/people-teams-ui-public/verified-team-icon';
8
11
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
12
  import { jsx } from '@emotion/react';
10
13
  import React from 'react';
@@ -20,7 +23,8 @@ export class TeamOption extends React.PureComponent {
20
23
  const {
21
24
  team: {
22
25
  name,
23
- highlight
26
+ highlight,
27
+ verified
24
28
  }
25
29
  } = this.props;
26
30
  return [jsx("span", {
@@ -28,8 +32,14 @@ export class TeamOption extends React.PureComponent {
28
32
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
29
33
  ,
30
34
  css: textWrapper(this.props.isSelected ? `var(--ds-text-selected, ${B400})` : `var(--ds-text, ${N800})`)
35
+ }, fg('verified-team-in-user-picker') ? jsx(Inline, {
36
+ alignBlock: "center"
31
37
  }, jsx(HighlightText, {
32
38
  highlights: highlight && highlight.name
39
+ }, name), verified && jsx(VerifiedTeamIcon, {
40
+ size: "small"
41
+ })) : jsx(HighlightText, {
42
+ highlights: highlight && highlight.name
33
43
  }, name))];
34
44
  });
35
45
  _defineProperty(this, "renderByline", () => {
@@ -71,7 +71,7 @@ export class UserPickerWithoutAnalytics extends React.Component {
71
71
  SelectComponent: SelectComponent
72
72
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
73
73
  ,
74
- styles: getStyles(width, isMulti, this.props.appearance === 'compact', this.props.styles),
74
+ styles: getStyles(width, isMulti, this.props.appearance === 'compact', this.props.styles, this.props.isInvalid),
75
75
  components: getComponents(isMulti, anchor),
76
76
  pickerProps: pickerProps
77
77
  })))));
@@ -4,7 +4,7 @@ import { mergeStyles } from '@atlaskit/select';
4
4
  export const BORDER_PADDING = "var(--ds-space-075, 6px)";
5
5
  export const AVATAR_PADDING = 6;
6
6
  export const INDICATOR_WIDTH = 39;
7
- export const getStyles = memoizeOne((width, isMulti, isCompact, overrideStyles) => {
7
+ export const getStyles = memoizeOne((width, isMulti, isCompact, overrideStyles, isInvalid) => {
8
8
  let styles = {
9
9
  menu: (css, state) => ({
10
10
  ...css,
@@ -21,14 +21,14 @@ export const getStyles = memoizeOne((width, isMulti, isCompact, overrideStyles)
21
21
  return {
22
22
  ...css,
23
23
  width,
24
- borderColor: state.isFocused ? `var(--ds-border-focused, ${css.borderColor})` : state.selectProps.subtle || state.selectProps.noBorder ? 'transparent' : `var(--ds-border-input, ${N90})`,
24
+ borderColor: isInvalid ? `var(--ds-border-danger, ${R400})` : state.isFocused ? `var(--ds-border-focused, ${css.borderColor})` : state.selectProps.subtle || state.selectProps.noBorder ? 'transparent' : `var(--ds-border-input, ${N90})`,
25
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
26
  '&:hover .fabric-user-picker__clear-indicator': {
27
27
  opacity: 1
28
28
  },
29
29
  ':hover': {
30
30
  ...css[':hover'],
31
- borderColor: state.isFocused ? css[':hover'] ? `var(--ds-border-focused, ${css[':hover'].borderColor})` : `var(--ds-border-focused, ${B100})` : state.selectProps.subtle ? 'transparent' : `var(--ds-border-input, ${N90})`,
31
+ borderColor: isInvalid ? `var(--ds-border-danger, ${R400})` : state.isFocused ? css[':hover'] ? `var(--ds-border-focused, ${css[':hover'].borderColor})` : `var(--ds-border-focused, ${B100})` : state.selectProps.subtle ? 'transparent' : `var(--ds-border-input, ${N90})`,
32
32
  backgroundColor: state.selectProps.subtle && state.selectProps.hoveringClearIndicator ? `var(--ds-background-danger, ${R50})` : state.isFocused ? css[':hover'] ? `var(--ds-background-input, ${css[':hover'].backgroundColor})` : `var(--ds-background-input, ${N0})` : state.isDisabled ? `var(--ds-background-disabled, ${N10})` : `var(--ds-background-input-hovered, ${N30})`
33
33
  },
34
34
  padding: 0,
@@ -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 = "10.24.2";
8
+ var packageVersion = "10.26.0";
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}$/;
@@ -467,6 +467,7 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
467
467
  placeholder = _this$props4.placeholder,
468
468
  isClearable = _this$props4.isClearable,
469
469
  isDisabled = _this$props4.isDisabled,
470
+ isInvalid = _this$props4.isInvalid,
470
471
  clearValueLabel = _this$props4.clearValueLabel,
471
472
  menuMinWidth = _this$props4.menuMinWidth,
472
473
  menuPortalTarget = _this$props4.menuPortalTarget,
@@ -541,6 +542,7 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
541
542
  },
542
543
  footer: footer,
543
544
  isDisabled: isDisabled,
545
+ isInvalid: isInvalid,
544
546
  isFocused: menuIsOpen,
545
547
  backspaceRemovesValue: isMulti,
546
548
  filterOption: null // disable local filtering
@@ -16,15 +16,17 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
16
16
  */
17
17
  import React from 'react';
18
18
  import { FormattedMessage } from 'react-intl-next';
19
- import { Box, xcss } from '@atlaskit/primitives';
19
+ import { Box, Inline, xcss } from '@atlaskit/primitives';
20
20
  import { components } from '@atlaskit/select';
21
21
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
22
22
  import { css, jsx } from '@emotion/react';
23
23
  import { AddOptionAvatar } from './AddOptionAvatar';
24
24
  import { SizeableAvatar } from './SizeableAvatar';
25
25
  import { messages } from './i18n';
26
- import { getAvatarUrl, isEmail, isGroup } from './utils';
26
+ import { getAvatarUrl, isEmail, isGroup, isTeam } from './utils';
27
27
  import PeopleIcon from '@atlaskit/icon/core/migration/people-group--people';
28
+ import { VerifiedTeamIcon } from '@atlaskit/people-teams-ui-public/verified-team-icon';
29
+ import { fg } from '@atlaskit/platform-feature-flags';
28
30
  export var scrollToValue = function scrollToValue(valueContainer, control) {
29
31
  var _valueContainer$getBo = valueContainer.getBoundingClientRect(),
30
32
  top = _valueContainer$getBo.top,
@@ -80,9 +82,19 @@ export var MultiValue = /*#__PURE__*/function (_React$Component) {
80
82
  }
81
83
  return jsx(SizeableAvatar, {
82
84
  appearance: "multi",
83
- src: getAvatarUrl(data)
85
+ src: getAvatarUrl(data),
86
+ type: isTeam(data) && fg('verified-team-in-user-picker') ? 'team' : 'person'
84
87
  });
85
88
  });
89
+ _defineProperty(_assertThisInitialized(_this), "getElemAfter", function () {
90
+ var data = _this.props.data.data;
91
+ if (isTeam(data) && data.verified && fg('verified-team-in-user-picker')) {
92
+ return jsx(VerifiedTeamIcon, {
93
+ size: "small"
94
+ });
95
+ }
96
+ return null;
97
+ });
86
98
  _this.containerRef = /*#__PURE__*/React.createRef();
87
99
  return _this;
88
100
  }
@@ -125,9 +137,11 @@ export var MultiValue = /*#__PURE__*/function (_React$Component) {
125
137
  ref: this.containerRef
126
138
  },
127
139
  cropWithEllipsis: false
128
- }), this.getElemBefore(), " ", jsx("div", {
140
+ }), jsx(Inline, {
141
+ alignBlock: "center"
142
+ }, this.getElemBefore(), " ", jsx("div", {
129
143
  css: nameWrapper
130
- }, children));
144
+ }, children), this.getElemAfter()));
131
145
  }
132
146
  }]);
133
147
  return MultiValue;
@@ -10,7 +10,10 @@ import { AvatarItem } from '@atlaskit/avatar';
10
10
  import { css, jsx } from '@emotion/react';
11
11
  import { components } from '@atlaskit/select';
12
12
  import { SizeableAvatar } from './SizeableAvatar';
13
- import { getAvatarUrl } from './utils';
13
+ import { getAvatarUrl, isTeam } from './utils';
14
+ import { VerifiedTeamIcon } from '@atlaskit/people-teams-ui-public/verified-team-icon';
15
+ import { fg } from '@atlaskit/platform-feature-flags';
16
+ import { Inline } from '@atlaskit/primitives';
14
17
  var avatarItemComponent = css({
15
18
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
16
19
  border: 'none !important',
@@ -29,6 +32,15 @@ var avatarItemComponent = css({
29
32
  border: 'none'
30
33
  }
31
34
  });
35
+ var ElementAfter = function ElementAfter(props) {
36
+ var data = props.data.data;
37
+ if (isTeam(data) && data.verified) {
38
+ return jsx(VerifiedTeamIcon, {
39
+ size: "small"
40
+ });
41
+ }
42
+ return null;
43
+ };
32
44
  export var SingleValue = function SingleValue(props) {
33
45
  var _props$data = props.data,
34
46
  label = _props$data.label,
@@ -40,9 +52,12 @@ export var SingleValue = function SingleValue(props) {
40
52
  backgroundColor: "transparent",
41
53
  avatar: jsx(SizeableAvatar, {
42
54
  src: getAvatarUrl(data),
43
- appearance: appearance
55
+ appearance: appearance,
56
+ type: isTeam(data) && fg('verified-team-in-user-picker') ? 'team' : 'person'
44
57
  }),
45
- primaryText: label
58
+ primaryText: fg('verified-team-in-user-picker') ? jsx(Inline, {
59
+ alignBlock: "center"
60
+ }, label, jsx(ElementAfter, props)) : label
46
61
  }, function (_ref) {
47
62
  var ref = _ref.ref,
48
63
  props = _objectWithoutProperties(_ref, _excluded);
@@ -13,6 +13,9 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
13
13
  * @jsx jsx
14
14
  */
15
15
  import { B400, N800, N200 } from '@atlaskit/theme/colors';
16
+ import { fg } from '@atlaskit/platform-feature-flags';
17
+ import { Inline } from '@atlaskit/primitives';
18
+ import { VerifiedTeamIcon } from '@atlaskit/people-teams-ui-public/verified-team-icon';
16
19
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
17
20
  import { jsx } from '@emotion/react';
18
21
  import React from 'react';
@@ -34,14 +37,21 @@ export var TeamOption = /*#__PURE__*/function (_React$PureComponent) {
34
37
  _defineProperty(_assertThisInitialized(_this), "getPrimaryText", function () {
35
38
  var _this$props$team = _this.props.team,
36
39
  name = _this$props$team.name,
37
- highlight = _this$props$team.highlight;
40
+ highlight = _this$props$team.highlight,
41
+ verified = _this$props$team.verified;
38
42
  return [jsx("span", {
39
43
  key: "name"
40
44
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
41
45
  ,
42
46
  css: textWrapper(_this.props.isSelected ? "var(--ds-text-selected, ".concat(B400, ")") : "var(--ds-text, ".concat(N800, ")"))
47
+ }, fg('verified-team-in-user-picker') ? jsx(Inline, {
48
+ alignBlock: "center"
43
49
  }, jsx(HighlightText, {
44
50
  highlights: highlight && highlight.name
51
+ }, name), verified && jsx(VerifiedTeamIcon, {
52
+ size: "small"
53
+ })) : jsx(HighlightText, {
54
+ highlights: highlight && highlight.name
45
55
  }, name))];
46
56
  });
47
57
  _defineProperty(_assertThisInitialized(_this), "renderByline", function () {
@@ -85,7 +85,7 @@ export var UserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component)
85
85
  SelectComponent: SelectComponent
86
86
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
87
87
  ,
88
- styles: getStyles(width, isMulti, this.props.appearance === 'compact', this.props.styles),
88
+ styles: getStyles(width, isMulti, this.props.appearance === 'compact', this.props.styles, this.props.isInvalid),
89
89
  components: getComponents(isMulti, anchor),
90
90
  pickerProps: pickerProps
91
91
  })))));