@atlaskit/user-picker 11.13.2 → 11.14.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 +12 -0
  2. package/afm-jira/tsconfig.json +1 -1
  3. package/dist/cjs/analytics.js +1 -1
  4. package/dist/cjs/components/BaseUserPicker.js +3 -6
  5. package/dist/cjs/components/GroupOption/main.js +23 -2
  6. package/dist/cjs/components/Option.js +4 -2
  7. package/dist/cjs/components/TeamOption/main.js +47 -14
  8. package/dist/cjs/components/UserPicker.js +5 -2
  9. package/dist/cjs/components/i18n.js +35 -0
  10. package/dist/es2019/analytics.js +1 -1
  11. package/dist/es2019/components/BaseUserPicker.js +3 -6
  12. package/dist/es2019/components/GroupOption/main.js +23 -2
  13. package/dist/es2019/components/Option.js +4 -2
  14. package/dist/es2019/components/TeamOption/main.js +40 -8
  15. package/dist/es2019/components/UserPicker.js +4 -2
  16. package/dist/es2019/components/i18n.js +35 -0
  17. package/dist/esm/analytics.js +1 -1
  18. package/dist/esm/components/BaseUserPicker.js +3 -6
  19. package/dist/esm/components/GroupOption/main.js +23 -2
  20. package/dist/esm/components/Option.js +4 -2
  21. package/dist/esm/components/TeamOption/main.js +47 -14
  22. package/dist/esm/components/UserPicker.js +5 -2
  23. package/dist/esm/components/i18n.js +35 -0
  24. package/dist/types/components/BaseUserPicker.d.ts +2 -1
  25. package/dist/types/components/GroupOption/main.d.ts +2 -0
  26. package/dist/types/components/Option.d.ts +1 -0
  27. package/dist/types/components/PopupUserPicker.d.ts +2 -0
  28. package/dist/types/components/TeamOption/main.d.ts +2 -0
  29. package/dist/types/components/UserPicker.d.ts +2 -1
  30. package/dist/types/components/components.d.ts +1 -1
  31. package/dist/types/components/i18n.d.ts +35 -0
  32. package/dist/types/types.d.ts +5 -0
  33. package/dist/types-ts4.5/components/BaseUserPicker.d.ts +2 -1
  34. package/dist/types-ts4.5/components/GroupOption/main.d.ts +2 -0
  35. package/dist/types-ts4.5/components/Option.d.ts +1 -0
  36. package/dist/types-ts4.5/components/PopupUserPicker.d.ts +2 -0
  37. package/dist/types-ts4.5/components/TeamOption/main.d.ts +2 -0
  38. package/dist/types-ts4.5/components/UserPicker.d.ts +2 -1
  39. package/dist/types-ts4.5/components/components.d.ts +1 -1
  40. package/dist/types-ts4.5/components/i18n.d.ts +35 -0
  41. package/dist/types-ts4.5/types.d.ts +5 -0
  42. package/package.json +5 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/user-picker
2
2
 
3
+ ## 11.14.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`24ef0db8a2bb6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/24ef0db8a2bb6) -
8
+ [ux] Updating verified team icon to surface for all groups and verified teams. Updated bylines for
9
+ team and group principals to "Official team" and "Admin group".
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 11.13.2
4
16
 
5
17
  ### Patch Changes
@@ -3,7 +3,7 @@
3
3
  "compilerOptions": {
4
4
  "declaration": true,
5
5
  "target": "es5",
6
- "outDir": "../../../../../tsDist/@atlaskit__user-picker/app",
6
+ "outDir": "../../../../../jira/tsDist/@atlaskit__user-picker/app",
7
7
  "rootDir": "../",
8
8
  "composite": true
9
9
  },
@@ -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; } // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
14
14
  var packageName = "@atlaskit/user-picker";
15
- var packageVersion = "11.13.1";
15
+ var packageVersion = "11.13.2";
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}$/;
@@ -25,7 +25,6 @@ var _i18n = require("./i18n");
25
25
  var _utils = require("./utils");
26
26
  var _groupOptionsByType = require("../util/group-options-by-type");
27
27
  var _ufoExperiences = require("../util/ufoExperiences");
28
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
29
28
  var _excluded = ["aria-labelledby", "aria-describedby"];
30
29
  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; }
31
30
  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; }
@@ -537,10 +536,8 @@ var BaseUserPickerWithoutAnalytics = exports.BaseUserPickerWithoutAnalytics = /*
537
536
  name: name,
538
537
  value: value,
539
538
  autoFocus: autoFocus !== undefined ? autoFocus : menuIsOpen,
540
- labelId: (0, _platformFeatureFlags.fg)('user_picker_migrate_aria_label_description') ? ariaLabelledBy !== null && ariaLabelledBy !== void 0 ? ariaLabelledBy : ariaLabelledByStandard : undefined,
541
- "aria-labelledby": (0, _platformFeatureFlags.fg)('user_picker_migrate_aria_label_description') ? undefined : ariaLabelledBy,
542
- descriptionId: (0, _platformFeatureFlags.fg)('user_picker_migrate_aria_label_description') ? ariaDescribedBy !== null && ariaDescribedBy !== void 0 ? ariaDescribedBy : ariaDescribedByStandard : undefined,
543
- "aria-describedby": (0, _platformFeatureFlags.fg)('user_picker_migrate_aria_label_description') ? undefined : ariaDescribedBy,
539
+ labelId: ariaLabelledBy !== null && ariaLabelledBy !== void 0 ? ariaLabelledBy : ariaLabelledByStandard,
540
+ descriptionId: ariaDescribedBy !== null && ariaDescribedBy !== void 0 ? ariaDescribedBy : ariaDescribedByStandard,
544
541
  "aria-live": ariaLive,
545
542
  "aria-required": required // This has been added as a safety net.
546
543
  ,
@@ -593,7 +590,7 @@ var BaseUserPickerWithoutAnalytics = exports.BaseUserPickerWithoutAnalytics = /*
593
590
  textFieldBackgroundColor: textFieldBackgroundColor,
594
591
  header: header,
595
592
  placeholderAvatar: placeholderAvatar
596
- }, (0, _platformFeatureFlags.fg)('user_picker_migrate_aria_label_description') ? restAriaProps : this.ariaProps, pickerProps, UNSAFE_hasDraggableParentComponent && {
593
+ }, restAriaProps, pickerProps, UNSAFE_hasDraggableParentComponent && {
597
594
  onValueContainerClick: this.handleClickDraggableParentComponent
598
595
  }, menuOpenDeciderProps));
599
596
  }
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.groupOptionIconWrapper = exports.GroupOption = void 0;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
8
9
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
10
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
11
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
@@ -16,6 +17,7 @@ var _reactIntlNext = require("react-intl-next");
16
17
  var _react2 = require("@emotion/react");
17
18
  var _colors = require("@atlaskit/theme/colors");
18
19
  var _peopleGroupPeople = _interopRequireDefault(require("@atlaskit/icon/core/migration/people-group--people"));
20
+ var _verifiedTeamIcon = require("@atlaskit/people-teams-ui-public/verified-team-icon");
19
21
  var _AvatarItemOption = require("../AvatarItemOption");
20
22
  var _i18n = require("../i18n");
21
23
  var _HighlightText = require("../HighlightText");
@@ -67,15 +69,34 @@ var GroupOption = exports.GroupOption = /*#__PURE__*/function (_React$PureCompon
67
69
  spacing: "spacious"
68
70
  }));
69
71
  });
72
+ (0, _defineProperty2.default)(_this, "renderVerifiedIcon", function () {
73
+ return (0, _react2.jsx)(_verifiedTeamIcon.VerifiedTeamIcon, {
74
+ label: "",
75
+ size: "small",
76
+ spacing: "none"
77
+ });
78
+ });
70
79
  (0, _defineProperty2.default)(_this, "renderByline", function () {
71
80
  var _this$props2 = _this.props,
72
81
  isSelected = _this$props2.isSelected,
73
- group = _this$props2.group;
82
+ group = _this$props2.group,
83
+ includeTeamsUpdates = _this$props2.includeTeamsUpdates;
84
+ var getGroupByline = function getGroupByline() {
85
+ if (includeTeamsUpdates) {
86
+ return (0, _react2.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.adminManagedGroupByline, {
87
+ values: {
88
+ verifiedIcon: _this.renderVerifiedIcon()
89
+ }
90
+ }));
91
+ } else {
92
+ return (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.groupByline);
93
+ }
94
+ };
74
95
  return (0, _react2.jsx)("span", {
75
96
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
76
97
  css: (0, _AvatarItemOption.textWrapper)(isSelected ? "var(--ds-text-selected, ".concat(_colors.B400, ")") : "var(--ds-text-subtlest, ".concat(_colors.N200, ")")),
77
98
  "data-testid": "user-picker-group-secondary-text"
78
- }, group.byline ? group.byline : (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.groupByline));
99
+ }, group.byline ? group.byline : getGroupByline());
79
100
  });
80
101
  (0, _defineProperty2.default)(_this, "getLozengeProps", function () {
81
102
  return typeof _this.props.group.lozenge === 'string' ? {
@@ -61,13 +61,15 @@ var dataOption = function dataOption(_ref2) {
61
61
  if ((0, _utils.isTeam)(data)) {
62
62
  return /*#__PURE__*/_react.default.createElement(_TeamOption.default, {
63
63
  team: data,
64
- isSelected: isSelected
64
+ isSelected: isSelected,
65
+ includeTeamsUpdates: data.includeTeamsUpdates
65
66
  });
66
67
  }
67
68
  if ((0, _utils.isGroup)(data)) {
68
69
  return /*#__PURE__*/_react.default.createElement(_GroupOption.default, {
69
70
  group: data,
70
- isSelected: isSelected
71
+ isSelected: isSelected,
72
+ includeTeamsUpdates: data.includeTeamsUpdates
71
73
  });
72
74
  }
73
75
  if ((0, _utils.isCustom)(data)) {
@@ -36,10 +36,12 @@ var TeamOption = exports.TeamOption = /*#__PURE__*/function (_React$PureComponen
36
36
  }
37
37
  _this = _callSuper(this, TeamOption, [].concat(args));
38
38
  (0, _defineProperty2.default)(_this, "getPrimaryText", function () {
39
- var _this$props$team = _this.props.team,
39
+ var _this$props = _this.props,
40
+ _this$props$team = _this$props.team,
40
41
  name = _this$props$team.name,
41
42
  highlight = _this$props$team.highlight,
42
- verified = _this$props$team.verified;
43
+ verified = _this$props$team.verified,
44
+ includeTeamsUpdates = _this$props.includeTeamsUpdates;
43
45
  return [(0, _react.jsx)("span", {
44
46
  key: "name"
45
47
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
@@ -49,14 +51,17 @@ var TeamOption = exports.TeamOption = /*#__PURE__*/function (_React$PureComponen
49
51
  alignBlock: "center"
50
52
  }, (0, _react.jsx)(_HighlightText.HighlightText, {
51
53
  highlights: highlight && highlight.name
52
- }, name), verified && (0, _react.jsx)(_verifiedTeamIcon.VerifiedTeamIcon, null)))];
54
+ }, name), verified && !includeTeamsUpdates && _this.renderVerifiedIcon()))];
53
55
  });
54
56
  (0, _defineProperty2.default)(_this, "renderByline", function () {
55
- var _this$props = _this.props,
56
- isSelected = _this$props.isSelected,
57
- _this$props$team2 = _this$props.team,
58
- memberCount = _this$props$team2.memberCount,
59
- includesYou = _this$props$team2.includesYou;
57
+ var _this$props2 = _this.props,
58
+ isSelected = _this$props2.isSelected,
59
+ _this$props2$team = _this$props2.team,
60
+ memberCount = _this$props2$team.memberCount,
61
+ includesYou = _this$props2$team.includesYou,
62
+ verified = _this$props2$team.verified,
63
+ includeTeamsUpdates = _this$props2.includeTeamsUpdates;
64
+ var isVerified = includeTeamsUpdates && verified;
60
65
 
61
66
  // if Member count is missing, do not show the byline, regardless of the availability of includesYou
62
67
  if (memberCount === null || typeof memberCount === 'undefined') {
@@ -64,9 +69,18 @@ var TeamOption = exports.TeamOption = /*#__PURE__*/function (_React$PureComponen
64
69
  } else {
65
70
  if (includesYou === true) {
66
71
  if (memberCount > 50) {
67
- return _this.getBylineComponent(isSelected, (0, _react.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.plus50MembersWithYou));
72
+ return _this.getBylineComponent(isSelected, isVerified ? (0, _react.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.officialPlus50MembersWithYou, {
73
+ values: {
74
+ verifiedIcon: _this.renderVerifiedIcon()
75
+ }
76
+ })) : (0, _react.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.plus50MembersWithYou));
68
77
  } else {
69
- return _this.getBylineComponent(isSelected, (0, _react.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.memberCountWithYou, {
78
+ return _this.getBylineComponent(isSelected, isVerified ? (0, _react.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.officialMemberCountWithYou, {
79
+ values: {
80
+ verifiedIcon: _this.renderVerifiedIcon(),
81
+ count: memberCount
82
+ }
83
+ })) : (0, _react.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.memberCountWithYou, {
70
84
  values: {
71
85
  count: memberCount
72
86
  }
@@ -74,9 +88,18 @@ var TeamOption = exports.TeamOption = /*#__PURE__*/function (_React$PureComponen
74
88
  }
75
89
  } else {
76
90
  if (memberCount > 50) {
77
- return _this.getBylineComponent(isSelected, (0, _react.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.plus50MembersWithoutYou));
91
+ return _this.getBylineComponent(isSelected, isVerified ? (0, _react.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.officialPlus50MembersWithoutYou, {
92
+ values: {
93
+ verifiedIcon: _this.renderVerifiedIcon()
94
+ }
95
+ })) : (0, _react.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.plus50MembersWithoutYou));
78
96
  } else {
79
- return _this.getBylineComponent(isSelected, (0, _react.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.memberCountWithoutYou, {
97
+ return _this.getBylineComponent(isSelected, isVerified ? (0, _react.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.officialMemberCountWithoutYou, {
98
+ values: {
99
+ verifiedIcon: _this.renderVerifiedIcon(),
100
+ count: memberCount
101
+ }
102
+ })) : (0, _react.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.memberCountWithoutYou, {
80
103
  values: {
81
104
  count: memberCount
82
105
  }
@@ -100,14 +123,24 @@ var TeamOption = exports.TeamOption = /*#__PURE__*/function (_React$PureComponen
100
123
  type: "team"
101
124
  });
102
125
  });
126
+ (0, _defineProperty2.default)(_this, "renderVerifiedIcon", function () {
127
+ if (_this.props.team.verified) {
128
+ return (0, _react.jsx)(_verifiedTeamIcon.VerifiedTeamIcon, {
129
+ label: "",
130
+ size: "small",
131
+ spacing: "none"
132
+ });
133
+ }
134
+ return undefined;
135
+ });
103
136
  (0, _defineProperty2.default)(_this, "getLozengeProps", function () {
104
137
  return typeof _this.props.team.lozenge === 'string' ? {
105
138
  text: _this.props.team.lozenge
106
139
  } : _this.props.team.lozenge;
107
140
  });
108
141
  (0, _defineProperty2.default)(_this, "renderCustomByLine", function () {
109
- var _this$props$team3;
110
- if (!((_this$props$team3 = _this.props.team) !== null && _this$props$team3 !== void 0 && _this$props$team3.byline)) {
142
+ var _this$props$team2;
143
+ if (!((_this$props$team2 = _this.props.team) !== null && _this$props$team2 !== void 0 && _this$props$team2.byline)) {
111
144
  return undefined;
112
145
  }
113
146
  return (0, _react.jsx)("span", {
@@ -78,7 +78,9 @@ var UserPickerWithoutAnalytics = exports.UserPickerWithoutAnalytics = /*#__PURE_
78
78
  _this$props$required = _this$props.required,
79
79
  required = _this$props$required === void 0 ? false : _this$props$required,
80
80
  _this$props$showClear = _this$props.showClearIndicator,
81
- showClearIndicator = _this$props$showClear === void 0 ? false : _this$props$showClear;
81
+ showClearIndicator = _this$props$showClear === void 0 ? false : _this$props$showClear,
82
+ _this$props$includeTe = _this$props.includeTeamsUpdates,
83
+ includeTeamsUpdates = _this$props$includeTe === void 0 ? false : _this$props$includeTe;
82
84
  var width = this.props.width;
83
85
  var SelectComponent = allowEmail ? _select.CreatableSelect : _select.default;
84
86
  var creatableProps = suggestEmailsForDomain ? (0, _creatableEmailSuggestion.getCreatableSuggestedEmailProps)(suggestEmailsForDomain, isValidEmail) : (0, _creatable.getCreatableProps)(isValidEmail);
@@ -88,7 +90,8 @@ var UserPickerWithoutAnalytics = exports.UserPickerWithoutAnalytics = /*#__PURE_
88
90
  menuPosition: menuPosition,
89
91
  menuShouldBlockScroll: menuShouldBlockScroll,
90
92
  captureMenuScroll: captureMenuScroll,
91
- required: required
93
+ required: required,
94
+ includeTeamsUpdates: includeTeamsUpdates
92
95
  };
93
96
  var pickerProps = allowEmail ? _objectSpread(_objectSpread(_objectSpread({}, defaultPickerProps), creatableProps), {}, {
94
97
  emailLabel: emailLabel
@@ -31,6 +31,26 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
31
31
  defaultMessage: 'Something went wrong',
32
32
  description: 'Error message to display when options fail to load.'
33
33
  },
34
+ teamByline: {
35
+ id: 'fabric.elements.user-picker.team.byline',
36
+ defaultMessage: 'Team',
37
+ description: 'Byline for team'
38
+ },
39
+ officialTeamByline: {
40
+ id: 'fabric.elements.user-picker.team.byline.official',
41
+ defaultMessage: 'Official team {verifiedIcon}',
42
+ description: 'Byline for official team'
43
+ },
44
+ officialMemberCountWithoutYou: {
45
+ id: 'fabric.elements.user-picker.team.member.count.official',
46
+ defaultMessage: 'Official team {verifiedIcon} • {count} {count, plural, one {member} other {members}}',
47
+ description: 'Byline to show the number of members in the team when the current user is not a member of the team'
48
+ },
49
+ officialMemberCountWithYou: {
50
+ id: 'fabric.elements.user-picker.team.member.count.official.including.you',
51
+ defaultMessage: 'Official team {verifiedIcon} • {count} {count, plural, one {member} other {members}}, including you',
52
+ description: 'Byline to show the number of members in the team when the current user is also a member of the team'
53
+ },
34
54
  memberCountWithoutYou: {
35
55
  id: 'fabric.elements.user-picker.team.member.count',
36
56
  defaultMessage: 'Team • {count} {count, plural, one {member} other {members}}',
@@ -41,6 +61,16 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
41
61
  defaultMessage: 'Team • {count} {count, plural, one {member} other {members}}, including you',
42
62
  description: 'Byline to show the number of members in the team when the current user is also a member of the team'
43
63
  },
64
+ officialPlus50MembersWithoutYou: {
65
+ id: 'fabric.elements.user-picker.team.member.50plus.official',
66
+ defaultMessage: 'Official team {verifiedIcon} • 50+ members',
67
+ description: 'Byline to show the number of members in the team when the number exceeds 50'
68
+ },
69
+ officialPlus50MembersWithYou: {
70
+ id: 'fabric.elements.user-picker.team.member.50plus.official.including.you',
71
+ defaultMessage: 'Official team {verifiedIcon} • 50+ members, including you',
72
+ description: 'Byline to show the number of members in the team when the number exceeds 50 and also includes the current user'
73
+ },
44
74
  plus50MembersWithoutYou: {
45
75
  id: 'fabric.elements.user-picker.team.member.50plus',
46
76
  defaultMessage: 'Team • 50+ members',
@@ -66,6 +96,11 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
66
96
  defaultMessage: 'Enter an email address',
67
97
  description: 'Byline for a potentially valid email option.'
68
98
  },
99
+ adminManagedGroupByline: {
100
+ id: 'fabric.elements.user-picker.group.byline.admin-managed',
101
+ defaultMessage: 'Admin group {verifiedIcon}',
102
+ description: 'Byline for admin-managed groups with verified icon'
103
+ },
69
104
  groupByline: {
70
105
  id: 'fabric.elements.user-picker.group.byline',
71
106
  defaultMessage: 'Admin-managed group',
@@ -3,7 +3,7 @@ import { createAndFireEvent } from '@atlaskit/analytics-next';
3
3
  import { v4 as uuidv4 } from 'uuid';
4
4
  import { isCustom, isExternalUser } from './components/utils';
5
5
  const packageName = "@atlaskit/user-picker";
6
- const packageVersion = "11.13.1";
6
+ const packageVersion = "11.13.2";
7
7
  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}$/;
8
8
  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}$/;
9
9
  const UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
@@ -13,7 +13,6 @@ import { messages } from './i18n';
13
13
  import { callCallback, extractOptionValue, getOptions, isIterable, isPopupUserPickerByComponent, isDefaultValuePopulated, isSingleValue, optionToSelectableOptions } from './utils';
14
14
  import { groupOptionsByType } from '../util/group-options-by-type';
15
15
  import { userPickerOptionsShownUfoExperience } from '../util/ufoExperiences';
16
- import { fg } from '@atlaskit/platform-feature-flags';
17
16
  const loadingMessage = () => null;
18
17
  const classNamePrefix = 'fabric-user-picker';
19
18
  export class BaseUserPickerWithoutAnalytics extends React.Component {
@@ -518,10 +517,8 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
518
517
  name: name,
519
518
  value: value,
520
519
  autoFocus: autoFocus !== undefined ? autoFocus : menuIsOpen,
521
- labelId: fg('user_picker_migrate_aria_label_description') ? ariaLabelledBy !== null && ariaLabelledBy !== void 0 ? ariaLabelledBy : ariaLabelledByStandard : undefined,
522
- "aria-labelledby": fg('user_picker_migrate_aria_label_description') ? undefined : ariaLabelledBy,
523
- descriptionId: fg('user_picker_migrate_aria_label_description') ? ariaDescribedBy !== null && ariaDescribedBy !== void 0 ? ariaDescribedBy : ariaDescribedByStandard : undefined,
524
- "aria-describedby": fg('user_picker_migrate_aria_label_description') ? undefined : ariaDescribedBy,
520
+ labelId: ariaLabelledBy !== null && ariaLabelledBy !== void 0 ? ariaLabelledBy : ariaLabelledByStandard,
521
+ descriptionId: ariaDescribedBy !== null && ariaDescribedBy !== void 0 ? ariaDescribedBy : ariaDescribedByStandard,
525
522
  "aria-live": ariaLive,
526
523
  "aria-required": required // This has been added as a safety net.
527
524
  ,
@@ -572,7 +569,7 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
572
569
  textFieldBackgroundColor: textFieldBackgroundColor,
573
570
  header: header,
574
571
  placeholderAvatar: placeholderAvatar
575
- }, fg('user_picker_migrate_aria_label_description') ? restAriaProps : this.ariaProps, pickerProps, UNSAFE_hasDraggableParentComponent && {
572
+ }, restAriaProps, pickerProps, UNSAFE_hasDraggableParentComponent && {
576
573
  onValueContainerClick: this.handleClickDraggableParentComponent
577
574
  }, menuOpenDeciderProps));
578
575
  }
@@ -1,3 +1,4 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
3
  /**
3
4
  * @jsxRuntime classic
@@ -9,6 +10,7 @@ import { FormattedMessage } from 'react-intl-next';
9
10
  import { css, jsx } from '@emotion/react';
10
11
  import { N20, B400, N800, N200 } from '@atlaskit/theme/colors';
11
12
  import PeopleIcon from '@atlaskit/icon/core/migration/people-group--people';
13
+ import { VerifiedTeamIcon } from '@atlaskit/people-teams-ui-public/verified-team-icon';
12
14
  import { AvatarItemOption, textWrapper } from '../AvatarItemOption';
13
15
  import { messages } from '../i18n';
14
16
  import { HighlightText } from '../HighlightText';
@@ -51,16 +53,35 @@ export class GroupOption extends React.PureComponent {
51
53
  LEGACY_size: "medium",
52
54
  spacing: "spacious"
53
55
  })));
56
+ _defineProperty(this, "renderVerifiedIcon", () => {
57
+ return jsx(VerifiedTeamIcon, {
58
+ label: "",
59
+ size: "small",
60
+ spacing: "none"
61
+ });
62
+ });
54
63
  _defineProperty(this, "renderByline", () => {
55
64
  const {
56
65
  isSelected,
57
- group
66
+ group,
67
+ includeTeamsUpdates
58
68
  } = this.props;
69
+ const getGroupByline = () => {
70
+ if (includeTeamsUpdates) {
71
+ return jsx(FormattedMessage, _extends({}, messages.adminManagedGroupByline, {
72
+ values: {
73
+ verifiedIcon: this.renderVerifiedIcon()
74
+ }
75
+ }));
76
+ } else {
77
+ return jsx(FormattedMessage, messages.groupByline);
78
+ }
79
+ };
59
80
  return jsx("span", {
60
81
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
61
82
  css: textWrapper(isSelected ? `var(--ds-text-selected, ${B400})` : `var(--ds-text-subtlest, ${N200})`),
62
83
  "data-testid": "user-picker-group-secondary-text"
63
- }, group.byline ? group.byline : jsx(FormattedMessage, messages.groupByline));
84
+ }, group.byline ? group.byline : getGroupByline());
64
85
  });
65
86
  _defineProperty(this, "getLozengeProps", () => typeof this.props.group.lozenge === 'string' ? {
66
87
  text: this.props.group.lozenge
@@ -57,13 +57,15 @@ const dataOption = ({
57
57
  if (isTeam(data)) {
58
58
  return /*#__PURE__*/React.createElement(AsyncTeamOption, {
59
59
  team: data,
60
- isSelected: isSelected
60
+ isSelected: isSelected,
61
+ includeTeamsUpdates: data.includeTeamsUpdates
61
62
  });
62
63
  }
63
64
  if (isGroup(data)) {
64
65
  return /*#__PURE__*/React.createElement(AsyncGroupOption, {
65
66
  group: data,
66
- isSelected: isSelected
67
+ isSelected: isSelected,
68
+ includeTeamsUpdates: data.includeTeamsUpdates
67
69
  });
68
70
  }
69
71
  if (isCustom(data)) {
@@ -24,7 +24,8 @@ export class TeamOption extends React.PureComponent {
24
24
  name,
25
25
  highlight,
26
26
  verified
27
- }
27
+ },
28
+ includeTeamsUpdates
28
29
  } = this.props;
29
30
  return [jsx("span", {
30
31
  key: "name"
@@ -35,16 +36,19 @@ export class TeamOption extends React.PureComponent {
35
36
  alignBlock: "center"
36
37
  }, jsx(HighlightText, {
37
38
  highlights: highlight && highlight.name
38
- }, name), verified && jsx(VerifiedTeamIcon, null)))];
39
+ }, name), verified && !includeTeamsUpdates && this.renderVerifiedIcon()))];
39
40
  });
40
41
  _defineProperty(this, "renderByline", () => {
41
42
  const {
42
43
  isSelected,
43
44
  team: {
44
45
  memberCount,
45
- includesYou
46
- }
46
+ includesYou,
47
+ verified
48
+ },
49
+ includeTeamsUpdates
47
50
  } = this.props;
51
+ const isVerified = includeTeamsUpdates && verified;
48
52
 
49
53
  // if Member count is missing, do not show the byline, regardless of the availability of includesYou
50
54
  if (memberCount === null || typeof memberCount === 'undefined') {
@@ -52,9 +56,18 @@ export class TeamOption extends React.PureComponent {
52
56
  } else {
53
57
  if (includesYou === true) {
54
58
  if (memberCount > 50) {
55
- return this.getBylineComponent(isSelected, jsx(FormattedMessage, messages.plus50MembersWithYou));
59
+ return this.getBylineComponent(isSelected, isVerified ? jsx(FormattedMessage, _extends({}, messages.officialPlus50MembersWithYou, {
60
+ values: {
61
+ verifiedIcon: this.renderVerifiedIcon()
62
+ }
63
+ })) : jsx(FormattedMessage, messages.plus50MembersWithYou));
56
64
  } else {
57
- return this.getBylineComponent(isSelected, jsx(FormattedMessage, _extends({}, messages.memberCountWithYou, {
65
+ return this.getBylineComponent(isSelected, isVerified ? jsx(FormattedMessage, _extends({}, messages.officialMemberCountWithYou, {
66
+ values: {
67
+ verifiedIcon: this.renderVerifiedIcon(),
68
+ count: memberCount
69
+ }
70
+ })) : jsx(FormattedMessage, _extends({}, messages.memberCountWithYou, {
58
71
  values: {
59
72
  count: memberCount
60
73
  }
@@ -62,9 +75,18 @@ export class TeamOption extends React.PureComponent {
62
75
  }
63
76
  } else {
64
77
  if (memberCount > 50) {
65
- return this.getBylineComponent(isSelected, jsx(FormattedMessage, messages.plus50MembersWithoutYou));
78
+ return this.getBylineComponent(isSelected, isVerified ? jsx(FormattedMessage, _extends({}, messages.officialPlus50MembersWithoutYou, {
79
+ values: {
80
+ verifiedIcon: this.renderVerifiedIcon()
81
+ }
82
+ })) : jsx(FormattedMessage, messages.plus50MembersWithoutYou));
66
83
  } else {
67
- return this.getBylineComponent(isSelected, jsx(FormattedMessage, _extends({}, messages.memberCountWithoutYou, {
84
+ return this.getBylineComponent(isSelected, isVerified ? jsx(FormattedMessage, _extends({}, messages.officialMemberCountWithoutYou, {
85
+ values: {
86
+ verifiedIcon: this.renderVerifiedIcon(),
87
+ count: memberCount
88
+ }
89
+ })) : jsx(FormattedMessage, _extends({}, messages.memberCountWithoutYou, {
68
90
  values: {
69
91
  count: memberCount
70
92
  }
@@ -90,6 +112,16 @@ export class TeamOption extends React.PureComponent {
90
112
  type: "team"
91
113
  });
92
114
  });
115
+ _defineProperty(this, "renderVerifiedIcon", () => {
116
+ if (this.props.team.verified) {
117
+ return jsx(VerifiedTeamIcon, {
118
+ label: "",
119
+ size: "small",
120
+ spacing: "none"
121
+ });
122
+ }
123
+ return undefined;
124
+ });
93
125
  _defineProperty(this, "getLozengeProps", () => typeof this.props.team.lozenge === 'string' ? {
94
126
  text: this.props.team.lozenge
95
127
  } : this.props.team.lozenge);
@@ -51,7 +51,8 @@ export class UserPickerWithoutAnalytics extends React.Component {
51
51
  closeMenuOnScroll,
52
52
  loadUserSource,
53
53
  required = false,
54
- showClearIndicator = false
54
+ showClearIndicator = false,
55
+ includeTeamsUpdates = false
55
56
  } = this.props;
56
57
  const width = this.props.width;
57
58
  const SelectComponent = allowEmail ? CreatableSelect : Select;
@@ -62,7 +63,8 @@ export class UserPickerWithoutAnalytics extends React.Component {
62
63
  menuPosition,
63
64
  menuShouldBlockScroll,
64
65
  captureMenuScroll,
65
- required
66
+ required,
67
+ includeTeamsUpdates
66
68
  };
67
69
  const pickerProps = allowEmail ? {
68
70
  ...defaultPickerProps,
@@ -25,6 +25,26 @@ export const messages = defineMessages({
25
25
  defaultMessage: 'Something went wrong',
26
26
  description: 'Error message to display when options fail to load.'
27
27
  },
28
+ teamByline: {
29
+ id: 'fabric.elements.user-picker.team.byline',
30
+ defaultMessage: 'Team',
31
+ description: 'Byline for team'
32
+ },
33
+ officialTeamByline: {
34
+ id: 'fabric.elements.user-picker.team.byline.official',
35
+ defaultMessage: 'Official team {verifiedIcon}',
36
+ description: 'Byline for official team'
37
+ },
38
+ officialMemberCountWithoutYou: {
39
+ id: 'fabric.elements.user-picker.team.member.count.official',
40
+ defaultMessage: 'Official team {verifiedIcon} • {count} {count, plural, one {member} other {members}}',
41
+ description: 'Byline to show the number of members in the team when the current user is not a member of the team'
42
+ },
43
+ officialMemberCountWithYou: {
44
+ id: 'fabric.elements.user-picker.team.member.count.official.including.you',
45
+ defaultMessage: 'Official team {verifiedIcon} • {count} {count, plural, one {member} other {members}}, including you',
46
+ description: 'Byline to show the number of members in the team when the current user is also a member of the team'
47
+ },
28
48
  memberCountWithoutYou: {
29
49
  id: 'fabric.elements.user-picker.team.member.count',
30
50
  defaultMessage: 'Team • {count} {count, plural, one {member} other {members}}',
@@ -35,6 +55,16 @@ export const messages = defineMessages({
35
55
  defaultMessage: 'Team • {count} {count, plural, one {member} other {members}}, including you',
36
56
  description: 'Byline to show the number of members in the team when the current user is also a member of the team'
37
57
  },
58
+ officialPlus50MembersWithoutYou: {
59
+ id: 'fabric.elements.user-picker.team.member.50plus.official',
60
+ defaultMessage: 'Official team {verifiedIcon} • 50+ members',
61
+ description: 'Byline to show the number of members in the team when the number exceeds 50'
62
+ },
63
+ officialPlus50MembersWithYou: {
64
+ id: 'fabric.elements.user-picker.team.member.50plus.official.including.you',
65
+ defaultMessage: 'Official team {verifiedIcon} • 50+ members, including you',
66
+ description: 'Byline to show the number of members in the team when the number exceeds 50 and also includes the current user'
67
+ },
38
68
  plus50MembersWithoutYou: {
39
69
  id: 'fabric.elements.user-picker.team.member.50plus',
40
70
  defaultMessage: 'Team • 50+ members',
@@ -60,6 +90,11 @@ export const messages = defineMessages({
60
90
  defaultMessage: 'Enter an email address',
61
91
  description: 'Byline for a potentially valid email option.'
62
92
  },
93
+ adminManagedGroupByline: {
94
+ id: 'fabric.elements.user-picker.group.byline.admin-managed',
95
+ defaultMessage: 'Admin group {verifiedIcon}',
96
+ description: 'Byline for admin-managed groups with verified icon'
97
+ },
63
98
  groupByline: {
64
99
  id: 'fabric.elements.user-picker.group.byline',
65
100
  defaultMessage: 'Admin-managed group',
@@ -6,7 +6,7 @@ import { createAndFireEvent } from '@atlaskit/analytics-next';
6
6
  import { v4 as uuidv4 } from 'uuid';
7
7
  import { isCustom, isExternalUser } from './components/utils';
8
8
  var packageName = "@atlaskit/user-picker";
9
- var packageVersion = "11.13.1";
9
+ var packageVersion = "11.13.2";
10
10
  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}$/;
11
11
  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}$/;
12
12
  var UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;