@atlaskit/user-picker 11.13.2 → 11.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/afm-jira/tsconfig.json +1 -1
- package/dist/cjs/analytics.js +1 -1
- package/dist/cjs/components/BaseUserPicker.js +3 -6
- package/dist/cjs/components/GroupOption/main.js +23 -2
- package/dist/cjs/components/Option.js +4 -2
- package/dist/cjs/components/SingleValue.js +8 -3
- package/dist/cjs/components/SingleValueContainer.js +4 -1
- package/dist/cjs/components/TeamOption/main.js +47 -14
- package/dist/cjs/components/UserPicker.js +5 -2
- package/dist/cjs/components/i18n.js +35 -0
- package/dist/cjs/index.js +7 -0
- package/dist/es2019/analytics.js +1 -1
- package/dist/es2019/components/BaseUserPicker.js +3 -6
- package/dist/es2019/components/GroupOption/main.js +23 -2
- package/dist/es2019/components/Option.js +4 -2
- package/dist/es2019/components/SingleValue.js +8 -3
- package/dist/es2019/components/SingleValueContainer.js +4 -1
- package/dist/es2019/components/TeamOption/main.js +40 -8
- package/dist/es2019/components/UserPicker.js +4 -2
- package/dist/es2019/components/i18n.js +35 -0
- package/dist/es2019/index.js +1 -0
- package/dist/esm/analytics.js +1 -1
- package/dist/esm/components/BaseUserPicker.js +3 -6
- package/dist/esm/components/GroupOption/main.js +23 -2
- package/dist/esm/components/Option.js +4 -2
- package/dist/esm/components/SingleValue.js +8 -3
- package/dist/esm/components/SingleValueContainer.js +4 -1
- package/dist/esm/components/TeamOption/main.js +47 -14
- package/dist/esm/components/UserPicker.js +5 -2
- package/dist/esm/components/i18n.js +35 -0
- package/dist/esm/index.js +1 -0
- package/dist/types/components/BaseUserPicker.d.ts +2 -1
- package/dist/types/components/GroupOption/main.d.ts +2 -0
- package/dist/types/components/Option.d.ts +1 -0
- package/dist/types/components/PopupUserPicker.d.ts +2 -0
- package/dist/types/components/SingleValue.d.ts +4 -2
- package/dist/types/components/TeamOption/main.d.ts +2 -0
- package/dist/types/components/UserPicker.d.ts +2 -1
- package/dist/types/components/components.d.ts +1 -1
- package/dist/types/components/i18n.d.ts +35 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/types.d.ts +6 -0
- package/dist/types-ts4.5/components/BaseUserPicker.d.ts +2 -1
- package/dist/types-ts4.5/components/GroupOption/main.d.ts +2 -0
- package/dist/types-ts4.5/components/Option.d.ts +1 -0
- package/dist/types-ts4.5/components/PopupUserPicker.d.ts +2 -0
- package/dist/types-ts4.5/components/SingleValue.d.ts +4 -2
- package/dist/types-ts4.5/components/TeamOption/main.d.ts +2 -0
- package/dist/types-ts4.5/components/UserPicker.d.ts +2 -1
- package/dist/types-ts4.5/components/components.d.ts +1 -1
- package/dist/types-ts4.5/components/i18n.d.ts +35 -0
- package/dist/types-ts4.5/index.d.ts +1 -0
- package/dist/types-ts4.5/types.d.ts +6 -0
- package/package.json +5 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/user-picker
|
|
2
2
|
|
|
3
|
+
## 11.15.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`9b49b64b62885`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9b49b64b62885) -
|
|
8
|
+
set avatarAppearanceShape for SingleValue and SingleValueContainer based on appType
|
|
9
|
+
|
|
10
|
+
## 11.14.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- [`24ef0db8a2bb6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/24ef0db8a2bb6) -
|
|
15
|
+
[ux] Updating verified team icon to surface for all groups and verified teams. Updated bylines for
|
|
16
|
+
team and group principals to "Official team" and "Admin group".
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 11.13.2
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/afm-jira/tsconfig.json
CHANGED
package/dist/cjs/analytics.js
CHANGED
|
@@ -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 = "
|
|
15
|
+
var packageVersion = "0.0.0-development";
|
|
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:
|
|
541
|
-
|
|
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
|
-
},
|
|
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 : (
|
|
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)) {
|
|
@@ -12,6 +12,8 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
12
12
|
var _select = require("@atlaskit/select");
|
|
13
13
|
var _SizeableAvatar = require("./SizeableAvatar");
|
|
14
14
|
var _utils = require("./utils");
|
|
15
|
+
var _avatar = require("@atlaskit/avatar");
|
|
16
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
17
|
var _verifiedTeamIcon = require("@atlaskit/people-teams-ui-public/verified-team-icon");
|
|
16
18
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
17
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
@@ -21,8 +23,10 @@ var styles = {
|
|
|
21
23
|
avatarItemText: "_syazi7uo _1reo15vq _1bto1l2s _o5721q9c"
|
|
22
24
|
};
|
|
23
25
|
var ElementAfter = function ElementAfter(props) {
|
|
24
|
-
var data = props.data.data
|
|
25
|
-
|
|
26
|
+
var data = props.data.data,
|
|
27
|
+
shouldShowVerifiedIcon = props.shouldShowVerifiedIcon;
|
|
28
|
+
var showIcon = shouldShowVerifiedIcon ? shouldShowVerifiedIcon(data) : (0, _utils.isTeam)(data) && data.verified;
|
|
29
|
+
if (showIcon) {
|
|
26
30
|
return /*#__PURE__*/React.createElement(_verifiedTeamIcon.VerifiedTeamIcon, null);
|
|
27
31
|
}
|
|
28
32
|
return null;
|
|
@@ -39,7 +43,8 @@ var SingleValue = exports.SingleValue = function SingleValue(props) {
|
|
|
39
43
|
}, /*#__PURE__*/React.createElement(_SizeableAvatar.SizeableAvatar, {
|
|
40
44
|
src: (0, _utils.getAvatarUrl)(data),
|
|
41
45
|
appearance: appearance,
|
|
42
|
-
type: (0, _utils.isTeam)(data) ? 'team' : 'person'
|
|
46
|
+
type: (0, _utils.isTeam)(data) ? 'team' : 'person',
|
|
47
|
+
avatarAppearanceShape: (0, _platformFeatureFlags.fg)('jira_ai_agent_avatar_user_picker_user_option') ? (0, _avatar.getAppearanceForAppType)(data.appType) : undefined
|
|
43
48
|
}), /*#__PURE__*/React.createElement(_compiled.Box, {
|
|
44
49
|
xcss: styles.avatarItem
|
|
45
50
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -20,6 +20,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
20
20
|
var _select = require("@atlaskit/select");
|
|
21
21
|
var _SizeableAvatar = require("./SizeableAvatar");
|
|
22
22
|
var _ValueContainerWrapper = _interopRequireDefault(require("./ValueContainerWrapper"));
|
|
23
|
+
var _avatar = require("@atlaskit/avatar");
|
|
24
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
23
25
|
var _excluded = ["children"];
|
|
24
26
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
25
27
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
@@ -52,7 +54,8 @@ var SingleValueContainer = exports.SingleValueContainer = /*#__PURE__*/function
|
|
|
52
54
|
return /*#__PURE__*/_react.default.createElement(_SizeableAvatar.SizeableAvatar, {
|
|
53
55
|
appearance: appearance,
|
|
54
56
|
type: placeholderAvatar,
|
|
55
|
-
src: showUserAvatar(inputValue, value) ? value.data.avatarUrl : undefined
|
|
57
|
+
src: showUserAvatar(inputValue, value) ? value.data.avatarUrl : undefined,
|
|
58
|
+
avatarAppearanceShape: value && value.data && (0, _platformFeatureFlags.fg)('jira_ai_agent_avatar_user_picker_user_option') ? (0, _avatar.getAppearanceForAppType)(value.data.appType) : undefined
|
|
56
59
|
});
|
|
57
60
|
}
|
|
58
61
|
return null;
|
|
@@ -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
|
|
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 &&
|
|
54
|
+
}, name), verified && !includeTeamsUpdates && _this.renderVerifiedIcon()))];
|
|
53
55
|
});
|
|
54
56
|
(0, _defineProperty2.default)(_this, "renderByline", function () {
|
|
55
|
-
var _this$
|
|
56
|
-
isSelected = _this$
|
|
57
|
-
_this$
|
|
58
|
-
memberCount = _this$
|
|
59
|
-
includesYou = _this$
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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$
|
|
110
|
-
if (!((_this$props$
|
|
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',
|
package/dist/cjs/index.js
CHANGED
|
@@ -33,6 +33,12 @@ Object.defineProperty(exports, "PopupUserPicker", {
|
|
|
33
33
|
return _PopupUserPicker.PopupUserPicker;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
+
Object.defineProperty(exports, "SingleValue", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function get() {
|
|
39
|
+
return _SingleValue.SingleValue;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
36
42
|
Object.defineProperty(exports, "TeamType", {
|
|
37
43
|
enumerable: true,
|
|
38
44
|
get: function get() {
|
|
@@ -90,5 +96,6 @@ Object.defineProperty(exports, "isValidEmail", {
|
|
|
90
96
|
var _emailValidation = require("./components/emailValidation");
|
|
91
97
|
var _UserPicker = require("./components/UserPicker");
|
|
92
98
|
var _PopupUserPicker = require("./components/PopupUserPicker");
|
|
99
|
+
var _SingleValue = require("./components/SingleValue");
|
|
93
100
|
var _utils = require("./components/utils");
|
|
94
101
|
var _types = require("./types");
|
package/dist/es2019/analytics.js
CHANGED
|
@@ -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 = "
|
|
6
|
+
const packageVersion = "0.0.0-development";
|
|
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:
|
|
522
|
-
|
|
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
|
-
},
|
|
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 :
|
|
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)) {
|
|
@@ -5,6 +5,8 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
5
5
|
import { components } from '@atlaskit/select';
|
|
6
6
|
import { SizeableAvatar } from './SizeableAvatar';
|
|
7
7
|
import { getAvatarUrl, isTeam } from './utils';
|
|
8
|
+
import { getAppearanceForAppType } from '@atlaskit/avatar';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
10
|
import { VerifiedTeamIcon } from '@atlaskit/people-teams-ui-public/verified-team-icon';
|
|
9
11
|
import { Box, Flex, Inline } from '@atlaskit/primitives/compiled';
|
|
10
12
|
const styles = {
|
|
@@ -16,9 +18,11 @@ const ElementAfter = props => {
|
|
|
16
18
|
const {
|
|
17
19
|
data: {
|
|
18
20
|
data
|
|
19
|
-
}
|
|
21
|
+
},
|
|
22
|
+
shouldShowVerifiedIcon
|
|
20
23
|
} = props;
|
|
21
|
-
|
|
24
|
+
const showIcon = shouldShowVerifiedIcon ? shouldShowVerifiedIcon(data) : isTeam(data) && data.verified;
|
|
25
|
+
if (showIcon) {
|
|
22
26
|
return /*#__PURE__*/React.createElement(VerifiedTeamIcon, null);
|
|
23
27
|
}
|
|
24
28
|
return null;
|
|
@@ -40,7 +44,8 @@ export const SingleValue = props => {
|
|
|
40
44
|
}, /*#__PURE__*/React.createElement(SizeableAvatar, {
|
|
41
45
|
src: getAvatarUrl(data),
|
|
42
46
|
appearance: appearance,
|
|
43
|
-
type: isTeam(data) ? 'team' : 'person'
|
|
47
|
+
type: isTeam(data) ? 'team' : 'person',
|
|
48
|
+
avatarAppearanceShape: fg('jira_ai_agent_avatar_user_picker_user_option') ? getAppearanceForAppType(data.appType) : undefined
|
|
44
49
|
}), /*#__PURE__*/React.createElement(Box, {
|
|
45
50
|
xcss: styles.avatarItem
|
|
46
51
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -7,6 +7,8 @@ import React from 'react';
|
|
|
7
7
|
import { components } from '@atlaskit/select';
|
|
8
8
|
import { SizeableAvatar } from './SizeableAvatar';
|
|
9
9
|
import ValueContainerWrapper from './ValueContainerWrapper';
|
|
10
|
+
import { getAppearanceForAppType } from '@atlaskit/avatar';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
12
|
const valueContainerStyles = {
|
|
11
13
|
root: "_yv0e5bpd _ca0q12x7 _n3td12x7 _19bvze3t _1reo15vq _18m91wug _1fjgglyw _c71l1osq _1suq1j28 _1ke8idpf"
|
|
12
14
|
};
|
|
@@ -32,7 +34,8 @@ export class SingleValueContainer extends React.Component {
|
|
|
32
34
|
return /*#__PURE__*/React.createElement(SizeableAvatar, {
|
|
33
35
|
appearance: appearance,
|
|
34
36
|
type: placeholderAvatar,
|
|
35
|
-
src: showUserAvatar(inputValue, value) ? value.data.avatarUrl : undefined
|
|
37
|
+
src: showUserAvatar(inputValue, value) ? value.data.avatarUrl : undefined,
|
|
38
|
+
avatarAppearanceShape: value && value.data && fg('jira_ai_agent_avatar_user_picker_user_option') ? getAppearanceForAppType(value.data.appType) : undefined
|
|
36
39
|
});
|
|
37
40
|
}
|
|
38
41
|
return null;
|