@atlaskit/user-picker 12.0.0 → 12.0.2

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 (28) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/components/MultiValue.js +15 -12
  3. package/dist/cjs/components/MultiValueContainer.compiled.css +10 -4
  4. package/dist/cjs/components/MultiValueContainer.js +22 -7
  5. package/dist/cjs/components/styles.js +13 -7
  6. package/dist/es2019/components/MultiValue.js +15 -12
  7. package/dist/es2019/components/MultiValueContainer.compiled.css +10 -4
  8. package/dist/es2019/components/MultiValueContainer.js +20 -5
  9. package/dist/es2019/components/styles.js +11 -5
  10. package/dist/esm/components/MultiValue.js +15 -12
  11. package/dist/esm/components/MultiValueContainer.compiled.css +10 -4
  12. package/dist/esm/components/MultiValueContainer.js +21 -6
  13. package/dist/esm/components/styles.js +13 -7
  14. package/dist/types/components/MultiValue.d.ts +1 -1
  15. package/dist/types/components/MultiValueContainer.d.ts +3 -1
  16. package/dist/types/components/UserPicker.d.ts +7 -7
  17. package/dist/types/components/creatable.d.ts +1 -1
  18. package/dist/types/components/creatableEmailSuggestion.d.ts +1 -1
  19. package/dist/types/components/styles.d.ts +1 -1
  20. package/dist/types/util/group-options-by-type/index.d.ts +1 -1
  21. package/dist/types-ts4.5/components/MultiValue.d.ts +1 -1
  22. package/dist/types-ts4.5/components/MultiValueContainer.d.ts +3 -1
  23. package/dist/types-ts4.5/components/UserPicker.d.ts +7 -7
  24. package/dist/types-ts4.5/components/creatable.d.ts +1 -1
  25. package/dist/types-ts4.5/components/creatableEmailSuggestion.d.ts +1 -1
  26. package/dist/types-ts4.5/components/styles.d.ts +1 -1
  27. package/dist/types-ts4.5/util/group-options-by-type/index.d.ts +1 -1
  28. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/user-picker
2
2
 
3
+ ## 12.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`ea970883e4943`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ea970883e4943) -
8
+ Fixes bug where tags were overlapping in multi-select in smaller screen sizes.
9
+ - Updated dependencies
10
+
11
+ ## 12.0.1
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 12.0.0
4
18
 
5
19
  ### Major Changes
@@ -76,9 +76,8 @@ var nameWrapper = (0, _react2.css)({
76
76
  paddingLeft: "var(--ds-space-050, 4px)"
77
77
  });
78
78
  var avatarTagWrapperStyle = (0, _react2.css)({
79
- display: 'inline-flex',
80
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-space -- offsets AvatarTag's built-in space.050 margin down to space.025
81
- margin: '-2px'
79
+ display: 'flex',
80
+ font: "var(--ds-font-body-small, normal 400 12px/16px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)"
82
81
  });
83
82
  var MultiValue = exports.MultiValue = /*#__PURE__*/function (_React$Component) {
84
83
  function MultiValue(props) {
@@ -194,9 +193,8 @@ var MultiValue = exports.MultiValue = /*#__PURE__*/function (_React$Component) {
194
193
  } : {
195
194
  name: data.name
196
195
  };
197
- var removeAction = function removeAction() {
196
+ var onAfterRemoveAction = function onAfterRemoveAction() {
198
197
  removeProps.onClick({});
199
- return true;
200
198
  };
201
199
  if (isEmailOption) {
202
200
  return (0, _react2.jsx)("span", {
@@ -210,7 +208,8 @@ var MultiValue = exports.MultiValue = /*#__PURE__*/function (_React$Component) {
210
208
  isPendingAction: data.isPendingAction
211
209
  }),
212
210
  isRemovable: !isDisabled,
213
- onBeforeRemoveAction: removeAction
211
+ onAfterRemoveAction: onAfterRemoveAction,
212
+ hasMargin: false
214
213
  }));
215
214
  }
216
215
  if (isGroupOption) {
@@ -229,7 +228,8 @@ var MultiValue = exports.MultiValue = /*#__PURE__*/function (_React$Component) {
229
228
  size: "small"
230
229
  })),
231
230
  isRemovable: !isDisabled,
232
- onBeforeRemoveAction: removeAction
231
+ onAfterRemoveAction: onAfterRemoveAction,
232
+ hasMargin: false
233
233
  }));
234
234
  }
235
235
  if (data.icon) {
@@ -246,7 +246,8 @@ var MultiValue = exports.MultiValue = /*#__PURE__*/function (_React$Component) {
246
246
  }
247
247
  }, data.icon),
248
248
  isRemovable: !isDisabled,
249
- onBeforeRemoveAction: removeAction
249
+ hasMargin: false,
250
+ onAfterRemoveAction: onAfterRemoveAction
250
251
  }));
251
252
  }
252
253
  return (0, _react2.jsx)("span", {
@@ -258,10 +259,11 @@ var MultiValue = exports.MultiValue = /*#__PURE__*/function (_React$Component) {
258
259
  text: label,
259
260
  isVerified: isTeamOption ? data.verified : undefined,
260
261
  isRemovable: !isDisabled,
261
- onBeforeRemoveAction: removeAction,
262
+ onAfterRemoveAction: onAfterRemoveAction,
262
263
  avatar: function avatar(props) {
263
264
  return (0, _react2.jsx)(_teamsAvatar.default, (0, _extends2.default)({}, props, avatarProps));
264
- }
265
+ },
266
+ hasMargin: false
265
267
  }), canShowArchivedLozenge ? (0, _react2.jsx)(_primitives.Box, {
266
268
  xcss: archivedLozengeWrapper
267
269
  }, (0, _react2.jsx)(_lozenge.default, {
@@ -270,10 +272,11 @@ var MultiValue = exports.MultiValue = /*#__PURE__*/function (_React$Component) {
270
272
  type: "user",
271
273
  text: label,
272
274
  isRemovable: !isDisabled,
273
- onBeforeRemoveAction: removeAction,
275
+ onAfterRemoveAction: onAfterRemoveAction,
274
276
  avatar: function avatar(props) {
275
277
  return (0, _react2.jsx)(_avatar.default, (0, _extends2.default)({}, props, avatarProps));
276
- }
278
+ },
279
+ hasMargin: false
277
280
  }));
278
281
  }
279
282
  return (0, _react2.jsx)(_select.components.MultiValue, (0, _extends2.default)({}, rest, {
@@ -1,10 +1,16 @@
1
- ._18m91wug{overflow-y:auto}
1
+
2
+ ._zulp1b66{gap:var(--ds-space-050,4px)}._18m91wug{overflow-y:auto}
2
3
  ._19bv12x7{padding-left:var(--ds-space-075,6px)}
4
+ ._19bvu2gc{padding-left:var(--ds-space-100,8px)}
3
5
  ._1fjgglyw{scrollbar-width:none}
4
6
  ._1ke8idpf::-webkit-scrollbar{width:0}
7
+ ._1n261g80{flex-wrap:wrap}
5
8
  ._1reo15vq{overflow-x:hidden}
6
9
  ._1suq1j28::-webkit-scrollbar{background-color:transparent}
7
10
  ._c71l1osq{max-height:100%}
8
- ._ca0q12x7{padding-top:var(--ds-space-075,6px)}
9
- ._n3td12x7{padding-bottom:var(--ds-space-075,6px)}
10
- ._yv0e5bpd{grid-template-columns:auto 1fr}
11
+ ._ca0qu2gc{padding-top:var(--ds-space-100,8px)}
12
+ ._ca0qv77o{padding-top:var(--ds-space-025,2px)}
13
+ ._n3tdu2gc{padding-bottom:var(--ds-space-100,8px)}
14
+ ._n3tdv77o{padding-bottom:var(--ds-space-025,2px)}
15
+ ._yv0e5bpd{grid-template-columns:auto 1fr}
16
+ ._yv0en7od{grid-template-columns:unset}
@@ -19,18 +19,26 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
19
19
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
20
20
  var _select = require("@atlaskit/select");
21
21
  var _react = _interopRequireWildcard(require("react"));
22
- var _reactIntl = require("react-intl");
22
+ var _reactIntlNext = require("react-intl-next");
23
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
23
24
  var _i18n = require("./i18n");
24
25
  var _utils = require("./utils");
25
26
  var _ValueContainerWrapper = _interopRequireDefault(require("./ValueContainerWrapper"));
26
- var _excluded = ["children", "innerProps"];
27
+ var _react2 = require("@compiled/react");
28
+ var _excluded = ["children", "innerProps", "hasValue", "isCompact"];
27
29
  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); }
28
30
  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; }
29
31
  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; }
30
32
  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)); }
31
33
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
32
34
  var valueContainerStyles = {
33
- root: "_yv0e5bpd _ca0q12x7 _n3td12x7 _19bv12x7 _1reo15vq _18m91wug _1fjgglyw _c71l1osq _1suq1j28 _1ke8idpf"
35
+ root: "_yv0e5bpd _1reo15vq _18m91wug _1fjgglyw _c71l1osq _1suq1j28 _1ke8idpf",
36
+ paddingLegacy: "_ca0qu2gc _n3tdu2gc _19bvu2gc",
37
+ tagUpliftVerticalDefault: "_ca0qu2gc _n3tdu2gc",
38
+ tagUpliftVerticalCompact: "_ca0qv77o _n3tdv77o",
39
+ paddingLeftTight: "_19bv12x7",
40
+ paddingLeftWide: "_19bvu2gc",
41
+ withFlexAndGap: "_zulp1b66 _yv0en7od _1n261g80"
34
42
  };
35
43
  var MultiValueContainer = exports.MultiValueContainer = /*#__PURE__*/function (_React$PureComponent) {
36
44
  function MultiValueContainer(props) {
@@ -68,7 +76,7 @@ var MultiValueContainer = exports.MultiValueContainer = /*#__PURE__*/function (_
68
76
  return _this.props.children;
69
77
  }
70
78
  if (addMoreMessage === undefined) {
71
- return /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _i18n.messages.addMore, function (addMore) {
79
+ return /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _i18n.messages.addMore, function (addMore) {
72
80
  var _join, _addMoreMessages;
73
81
  var addMoreMessages = addMore;
74
82
  if (addMore && typeof addMore === 'string') {
@@ -119,17 +127,24 @@ var MultiValueContainer = exports.MultiValueContainer = /*#__PURE__*/function (_
119
127
  key: "render",
120
128
  value: function render() {
121
129
  var _this$props = this.props,
122
- children = _this$props.children,
123
- innerProps = _this$props.innerProps,
130
+ _children = _this$props.children,
131
+ _innerProps = _this$props.innerProps,
132
+ hasValue = _this$props.hasValue,
133
+ isCompact = _this$props.isCompact,
124
134
  valueContainerProps = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
125
135
  var props = _objectSpread(_objectSpread({}, valueContainerProps), {}, {
136
+ hasValue: hasValue,
137
+ isCompact: isCompact,
126
138
  innerProps: this.valueContainerInnerProps
127
139
  });
140
+ var ffTagUplifts = (0, _platformFeatureFlags.fg)('platform-dst-lozenge-tag-badge-visual-uplifts');
141
+ var controlRendersValueInControl = this.props.selectProps.controlShouldRenderValue !== false;
142
+ var tagUpliftChipRow = ffTagUplifts && hasValue && controlRendersValueInControl;
128
143
  return /*#__PURE__*/_react.default.createElement(_ValueContainerWrapper.default, {
129
144
  isEnabled: this.onValueContainerClick,
130
145
  onMouseDown: this.onValueContainerClick
131
146
  }, /*#__PURE__*/_react.default.createElement(_select.components.ValueContainer, (0, _extends2.default)({}, props, {
132
- xcss: valueContainerStyles.root
147
+ xcss: (0, _react2.cx)(valueContainerStyles.root, !ffTagUplifts && valueContainerStyles.paddingLegacy, ffTagUplifts && (isCompact ? valueContainerStyles.tagUpliftVerticalCompact : valueContainerStyles.tagUpliftVerticalDefault), ffTagUplifts && (tagUpliftChipRow ? valueContainerStyles.paddingLeftWide : valueContainerStyles.paddingLeftTight), tagUpliftChipRow && valueContainerStyles.withFlexAndGap)
133
148
  }), this.renderChildren()));
134
149
  }
135
150
  }], [{
@@ -45,7 +45,7 @@ var getStyles = exports.getStyles = (0, _memoizeOne.default)(function (width, is
45
45
  backgroundColor: state.selectProps.subtle && state.selectProps.hoveringClearIndicator ? "var(--ds-background-danger, #FFECEB)" : state.isFocused ? css[':hover'] ? "var(--ds-background-input, #FFFFFF)" : "var(--ds-background-input, #FFFFFF)" : state.isDisabled ? "var(--ds-background-disabled, #17171708)" : "var(--ds-background-input-hovered, #F8F8F8)"
46
46
  }),
47
47
  padding: 0,
48
- minHeight: minHeight ? minHeight : height || isCompact ? 'none' : 44,
48
+ minHeight: minHeight ? minHeight : height || isCompact ? isMulti && (0, _platformFeatureFlags.fg)('platform-dst-lozenge-tag-badge-visual-uplifts') ? 30 : 'none' : isMulti && (0, _platformFeatureFlags.fg)('platform-dst-lozenge-tag-badge-visual-uplifts') ? 42 : 44,
49
49
  /* IE 11 needs to set height explicitly to be vertical align when being in not compact mode */
50
50
  height: height ? height : isCompact || isMulti ? '100%' : 44,
51
51
  maxWidth: '100%'
@@ -85,9 +85,11 @@ var getStyles = exports.getStyles = (0, _memoizeOne.default)(function (width, is
85
85
  var isMulti = state.selectProps.isMulti;
86
86
  return _objectSpread(_objectSpread({}, css), {}, {
87
87
  gridTemplateColumns: 'auto 1fr',
88
- paddingTop: isCompact ? 0 : BORDER_PADDING,
89
- paddingBottom: isCompact ? 0 : BORDER_PADDING,
90
- paddingLeft: isMulti ? BORDER_PADDING : 0,
88
+ paddingTop: isCompact ? isMulti && (0, _platformFeatureFlags.fg)('platform-dst-lozenge-tag-badge-visual-uplifts') ? "var(--ds-space-025, 2px)" : 0 : isMulti && (0, _platformFeatureFlags.fg)('platform-dst-lozenge-tag-badge-visual-uplifts') ? "var(--ds-space-100, 8px)" : BORDER_PADDING,
89
+ paddingBottom: isCompact ? isMulti && (0, _platformFeatureFlags.fg)('platform-dst-lozenge-tag-badge-visual-uplifts') ? "var(--ds-space-025, 2px)" : 0 : isMulti && (0, _platformFeatureFlags.fg)('platform-dst-lozenge-tag-badge-visual-uplifts') ? "var(--ds-space-100, 8px)" : BORDER_PADDING,
90
+ // Match pre–tag-uplift leading inset when only the placeholder shows (share dialog VR, etc.).
91
+ paddingLeft: isMulti ? state.hasValue && state.selectProps.controlShouldRenderValue !== false && (0, _platformFeatureFlags.fg)('platform-dst-lozenge-tag-badge-visual-uplifts') ? "var(--ds-space-100, 8px)" : BORDER_PADDING : 0,
92
+ gap: isMulti && (0, _platformFeatureFlags.fg)('platform-dst-lozenge-tag-badge-visual-uplifts') ? "var(--ds-space-050, 4px)" : undefined,
91
93
  overflowX: 'hidden',
92
94
  overflowY: 'auto',
93
95
  scrollbarWidth: 'none',
@@ -146,14 +148,18 @@ var getStyles = exports.getStyles = (0, _memoizeOne.default)(function (width, is
146
148
  });
147
149
  },
148
150
  input: function input(css, state) {
149
- return _objectSpread(_objectSpread({}, css), {}, {
151
+ return _objectSpread(_objectSpread(_objectSpread({}, css), {}, {
150
152
  gridArea: '1/2/2/3',
151
153
  gridTemplateColumns: isMulti && state.placeholder ? '0 123px' : css.gridTemplateColumns,
152
154
  /* Necessary to make input height and tag height the same. */
153
- margin: "var(--ds-space-050, 4px)".concat(" 0"),
155
+ margin: isMulti && (0, _platformFeatureFlags.fg)('platform-dst-lozenge-tag-badge-visual-uplifts') ? 0 : "var(--ds-space-050, 4px)".concat(" 0"),
154
156
  /* Padding top and bottom of 2 is set by default. */
155
157
  paddingTop: 0,
156
- paddingBottom: 0,
158
+ paddingBottom: 0
159
+ }, isMulti && (0, _platformFeatureFlags.fg)('platform-dst-lozenge-tag-badge-visual-uplifts') && {
160
+ height: "var(--ds-space-250, 20px)",
161
+ alignItems: 'center'
162
+ }), {}, {
157
163
  paddingLeft: state.selectProps.isMulti ? 0 : BORDER_PADDING,
158
164
  '& input::placeholder': {
159
165
  /* Chrome, Firefox, Opera, Safari 10.1+ */
@@ -62,9 +62,8 @@ const nameWrapper = css({
62
62
  paddingLeft: "var(--ds-space-050, 4px)"
63
63
  });
64
64
  const avatarTagWrapperStyle = css({
65
- display: 'inline-flex',
66
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-space -- offsets AvatarTag's built-in space.050 margin down to space.025
67
- margin: '-2px'
65
+ display: 'flex',
66
+ font: "var(--ds-font-body-small, normal 400 12px/16px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)"
68
67
  });
69
68
  export class MultiValue extends React.Component {
70
69
  constructor(props) {
@@ -190,9 +189,8 @@ export class MultiValue extends React.Component {
190
189
  } : {
191
190
  name: data.name
192
191
  };
193
- const removeAction = () => {
192
+ const onAfterRemoveAction = () => {
194
193
  removeProps.onClick({});
195
- return true;
196
194
  };
197
195
  if (isEmailOption) {
198
196
  return jsx("span", {
@@ -206,7 +204,8 @@ export class MultiValue extends React.Component {
206
204
  isPendingAction: data.isPendingAction
207
205
  }),
208
206
  isRemovable: !isDisabled,
209
- onBeforeRemoveAction: removeAction
207
+ onAfterRemoveAction: onAfterRemoveAction,
208
+ hasMargin: false
210
209
  }));
211
210
  }
212
211
  if (isGroupOption) {
@@ -225,7 +224,8 @@ export class MultiValue extends React.Component {
225
224
  size: "small"
226
225
  })),
227
226
  isRemovable: !isDisabled,
228
- onBeforeRemoveAction: removeAction
227
+ onAfterRemoveAction: onAfterRemoveAction,
228
+ hasMargin: false
229
229
  }));
230
230
  }
231
231
  if (data.icon) {
@@ -242,7 +242,8 @@ export class MultiValue extends React.Component {
242
242
  }
243
243
  }, data.icon),
244
244
  isRemovable: !isDisabled,
245
- onBeforeRemoveAction: removeAction
245
+ hasMargin: false,
246
+ onAfterRemoveAction: onAfterRemoveAction
246
247
  }));
247
248
  }
248
249
  return jsx("span", {
@@ -254,8 +255,9 @@ export class MultiValue extends React.Component {
254
255
  text: label,
255
256
  isVerified: isTeamOption ? data.verified : undefined,
256
257
  isRemovable: !isDisabled,
257
- onBeforeRemoveAction: removeAction,
258
- avatar: props => jsx(TeamAvatar, _extends({}, props, avatarProps))
258
+ onAfterRemoveAction: onAfterRemoveAction,
259
+ avatar: props => jsx(TeamAvatar, _extends({}, props, avatarProps)),
260
+ hasMargin: false
259
261
  }), canShowArchivedLozenge ? jsx(Box, {
260
262
  xcss: archivedLozengeWrapper
261
263
  }, jsx(Lozenge, {
@@ -264,8 +266,9 @@ export class MultiValue extends React.Component {
264
266
  type: "user",
265
267
  text: label,
266
268
  isRemovable: !isDisabled,
267
- onBeforeRemoveAction: removeAction,
268
- avatar: props => jsx(Avatar, _extends({}, props, avatarProps))
269
+ onAfterRemoveAction: onAfterRemoveAction,
270
+ avatar: props => jsx(Avatar, _extends({}, props, avatarProps)),
271
+ hasMargin: false
269
272
  }));
270
273
  }
271
274
  return jsx(components.MultiValue, _extends({}, rest, {
@@ -1,10 +1,16 @@
1
- ._18m91wug{overflow-y:auto}
1
+
2
+ ._zulp1b66{gap:var(--ds-space-050,4px)}._18m91wug{overflow-y:auto}
2
3
  ._19bv12x7{padding-left:var(--ds-space-075,6px)}
4
+ ._19bvu2gc{padding-left:var(--ds-space-100,8px)}
3
5
  ._1fjgglyw{scrollbar-width:none}
4
6
  ._1ke8idpf::-webkit-scrollbar{width:0}
7
+ ._1n261g80{flex-wrap:wrap}
5
8
  ._1reo15vq{overflow-x:hidden}
6
9
  ._1suq1j28::-webkit-scrollbar{background-color:transparent}
7
10
  ._c71l1osq{max-height:100%}
8
- ._ca0q12x7{padding-top:var(--ds-space-075,6px)}
9
- ._n3td12x7{padding-bottom:var(--ds-space-075,6px)}
10
- ._yv0e5bpd{grid-template-columns:auto 1fr}
11
+ ._ca0qu2gc{padding-top:var(--ds-space-100,8px)}
12
+ ._ca0qv77o{padding-top:var(--ds-space-025,2px)}
13
+ ._n3tdu2gc{padding-bottom:var(--ds-space-100,8px)}
14
+ ._n3tdv77o{padding-bottom:var(--ds-space-025,2px)}
15
+ ._yv0e5bpd{grid-template-columns:auto 1fr}
16
+ ._yv0en7od{grid-template-columns:unset}
@@ -5,12 +5,20 @@ import "./MultiValueContainer.compiled.css";
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import { components } from '@atlaskit/select';
7
7
  import React, { Fragment } from 'react';
8
- import { FormattedMessage } from 'react-intl';
8
+ import { FormattedMessage } from 'react-intl-next';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
9
10
  import { messages } from './i18n';
10
11
  import { isChildInput } from './utils';
11
12
  import ValueContainerWrapper from './ValueContainerWrapper';
13
+ import { cx } from '@compiled/react';
12
14
  const valueContainerStyles = {
13
- root: "_yv0e5bpd _ca0q12x7 _n3td12x7 _19bv12x7 _1reo15vq _18m91wug _1fjgglyw _c71l1osq _1suq1j28 _1ke8idpf"
15
+ root: "_yv0e5bpd _1reo15vq _18m91wug _1fjgglyw _c71l1osq _1suq1j28 _1ke8idpf",
16
+ paddingLegacy: "_ca0qu2gc _n3tdu2gc _19bvu2gc",
17
+ tagUpliftVerticalDefault: "_ca0qu2gc _n3tdu2gc",
18
+ tagUpliftVerticalCompact: "_ca0qv77o _n3tdv77o",
19
+ paddingLeftTight: "_19bv12x7",
20
+ paddingLeftWide: "_19bvu2gc",
21
+ withFlexAndGap: "_zulp1b66 _yv0en7od _1n261g80"
14
22
  };
15
23
  export class MultiValueContainer extends React.PureComponent {
16
24
  static getDerivedStateFromProps(nextProps, prevState) {
@@ -108,19 +116,26 @@ export class MultiValueContainer extends React.PureComponent {
108
116
  }
109
117
  render() {
110
118
  const {
111
- children,
112
- innerProps,
119
+ children: _children,
120
+ innerProps: _innerProps,
121
+ hasValue,
122
+ isCompact,
113
123
  ...valueContainerProps
114
124
  } = this.props;
115
125
  const props = {
116
126
  ...valueContainerProps,
127
+ hasValue,
128
+ isCompact,
117
129
  innerProps: this.valueContainerInnerProps
118
130
  };
131
+ const ffTagUplifts = fg('platform-dst-lozenge-tag-badge-visual-uplifts');
132
+ const controlRendersValueInControl = this.props.selectProps.controlShouldRenderValue !== false;
133
+ const tagUpliftChipRow = ffTagUplifts && hasValue && controlRendersValueInControl;
119
134
  return /*#__PURE__*/React.createElement(ValueContainerWrapper, {
120
135
  isEnabled: this.onValueContainerClick,
121
136
  onMouseDown: this.onValueContainerClick
122
137
  }, /*#__PURE__*/React.createElement(components.ValueContainer, _extends({}, props, {
123
- xcss: valueContainerStyles.root
138
+ xcss: cx(valueContainerStyles.root, !ffTagUplifts && valueContainerStyles.paddingLegacy, ffTagUplifts && (isCompact ? valueContainerStyles.tagUpliftVerticalCompact : valueContainerStyles.tagUpliftVerticalDefault), ffTagUplifts && (tagUpliftChipRow ? valueContainerStyles.paddingLeftWide : valueContainerStyles.paddingLeftTight), tagUpliftChipRow && valueContainerStyles.withFlexAndGap)
124
139
  }), this.renderChildren()));
125
140
  }
126
141
  }
@@ -32,7 +32,7 @@ export const getStyles = memoizeOne((width, isMulti, isCompact, overrideStyles,
32
32
  backgroundColor: state.selectProps.subtle && state.selectProps.hoveringClearIndicator ? "var(--ds-background-danger, #FFECEB)" : state.isFocused ? css[':hover'] ? "var(--ds-background-input, #FFFFFF)" : "var(--ds-background-input, #FFFFFF)" : state.isDisabled ? "var(--ds-background-disabled, #17171708)" : "var(--ds-background-input-hovered, #F8F8F8)"
33
33
  },
34
34
  padding: 0,
35
- minHeight: minHeight ? minHeight : height || isCompact ? 'none' : 44,
35
+ minHeight: minHeight ? minHeight : height || isCompact ? isMulti && fg('platform-dst-lozenge-tag-badge-visual-uplifts') ? 30 : 'none' : isMulti && fg('platform-dst-lozenge-tag-badge-visual-uplifts') ? 42 : 44,
36
36
  /* IE 11 needs to set height explicitly to be vertical align when being in not compact mode */
37
37
  height: height ? height : isCompact || isMulti ? '100%' : 44,
38
38
  maxWidth: '100%'
@@ -73,9 +73,11 @@ export const getStyles = memoizeOne((width, isMulti, isCompact, overrideStyles,
73
73
  return {
74
74
  ...css,
75
75
  gridTemplateColumns: 'auto 1fr',
76
- paddingTop: isCompact ? 0 : BORDER_PADDING,
77
- paddingBottom: isCompact ? 0 : BORDER_PADDING,
78
- paddingLeft: isMulti ? BORDER_PADDING : 0,
76
+ paddingTop: isCompact ? isMulti && fg('platform-dst-lozenge-tag-badge-visual-uplifts') ? "var(--ds-space-025, 2px)" : 0 : isMulti && fg('platform-dst-lozenge-tag-badge-visual-uplifts') ? "var(--ds-space-100, 8px)" : BORDER_PADDING,
77
+ paddingBottom: isCompact ? isMulti && fg('platform-dst-lozenge-tag-badge-visual-uplifts') ? "var(--ds-space-025, 2px)" : 0 : isMulti && fg('platform-dst-lozenge-tag-badge-visual-uplifts') ? "var(--ds-space-100, 8px)" : BORDER_PADDING,
78
+ // Match pre–tag-uplift leading inset when only the placeholder shows (share dialog VR, etc.).
79
+ paddingLeft: isMulti ? state.hasValue && state.selectProps.controlShouldRenderValue !== false && fg('platform-dst-lozenge-tag-badge-visual-uplifts') ? "var(--ds-space-100, 8px)" : BORDER_PADDING : 0,
80
+ gap: isMulti && fg('platform-dst-lozenge-tag-badge-visual-uplifts') ? "var(--ds-space-050, 4px)" : undefined,
79
81
  overflowX: 'hidden',
80
82
  overflowY: 'auto',
81
83
  scrollbarWidth: 'none',
@@ -138,10 +140,14 @@ export const getStyles = memoizeOne((width, isMulti, isCompact, overrideStyles,
138
140
  gridArea: '1/2/2/3',
139
141
  gridTemplateColumns: isMulti && state.placeholder ? '0 123px' : css.gridTemplateColumns,
140
142
  /* Necessary to make input height and tag height the same. */
141
- margin: `${"var(--ds-space-050, 4px)"} 0`,
143
+ margin: isMulti && fg('platform-dst-lozenge-tag-badge-visual-uplifts') ? 0 : `${"var(--ds-space-050, 4px)"} 0`,
142
144
  /* Padding top and bottom of 2 is set by default. */
143
145
  paddingTop: 0,
144
146
  paddingBottom: 0,
147
+ ...(isMulti && fg('platform-dst-lozenge-tag-badge-visual-uplifts') && {
148
+ height: "var(--ds-space-250, 20px)",
149
+ alignItems: 'center'
150
+ }),
145
151
  paddingLeft: state.selectProps.isMulti ? 0 : BORDER_PADDING,
146
152
  '& input::placeholder': {
147
153
  /* Chrome, Firefox, Opera, Safari 10.1+ */
@@ -69,9 +69,8 @@ var nameWrapper = css({
69
69
  paddingLeft: "var(--ds-space-050, 4px)"
70
70
  });
71
71
  var avatarTagWrapperStyle = css({
72
- display: 'inline-flex',
73
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-space -- offsets AvatarTag's built-in space.050 margin down to space.025
74
- margin: '-2px'
72
+ display: 'flex',
73
+ font: "var(--ds-font-body-small, normal 400 12px/16px \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)"
75
74
  });
76
75
  export var MultiValue = /*#__PURE__*/function (_React$Component) {
77
76
  function MultiValue(props) {
@@ -187,9 +186,8 @@ export var MultiValue = /*#__PURE__*/function (_React$Component) {
187
186
  } : {
188
187
  name: data.name
189
188
  };
190
- var removeAction = function removeAction() {
189
+ var onAfterRemoveAction = function onAfterRemoveAction() {
191
190
  removeProps.onClick({});
192
- return true;
193
191
  };
194
192
  if (isEmailOption) {
195
193
  return jsx("span", {
@@ -203,7 +201,8 @@ export var MultiValue = /*#__PURE__*/function (_React$Component) {
203
201
  isPendingAction: data.isPendingAction
204
202
  }),
205
203
  isRemovable: !isDisabled,
206
- onBeforeRemoveAction: removeAction
204
+ onAfterRemoveAction: onAfterRemoveAction,
205
+ hasMargin: false
207
206
  }));
208
207
  }
209
208
  if (isGroupOption) {
@@ -222,7 +221,8 @@ export var MultiValue = /*#__PURE__*/function (_React$Component) {
222
221
  size: "small"
223
222
  })),
224
223
  isRemovable: !isDisabled,
225
- onBeforeRemoveAction: removeAction
224
+ onAfterRemoveAction: onAfterRemoveAction,
225
+ hasMargin: false
226
226
  }));
227
227
  }
228
228
  if (data.icon) {
@@ -239,7 +239,8 @@ export var MultiValue = /*#__PURE__*/function (_React$Component) {
239
239
  }
240
240
  }, data.icon),
241
241
  isRemovable: !isDisabled,
242
- onBeforeRemoveAction: removeAction
242
+ hasMargin: false,
243
+ onAfterRemoveAction: onAfterRemoveAction
243
244
  }));
244
245
  }
245
246
  return jsx("span", {
@@ -251,10 +252,11 @@ export var MultiValue = /*#__PURE__*/function (_React$Component) {
251
252
  text: label,
252
253
  isVerified: isTeamOption ? data.verified : undefined,
253
254
  isRemovable: !isDisabled,
254
- onBeforeRemoveAction: removeAction,
255
+ onAfterRemoveAction: onAfterRemoveAction,
255
256
  avatar: function avatar(props) {
256
257
  return jsx(TeamAvatar, _extends({}, props, avatarProps));
257
- }
258
+ },
259
+ hasMargin: false
258
260
  }), canShowArchivedLozenge ? jsx(Box, {
259
261
  xcss: archivedLozengeWrapper
260
262
  }, jsx(Lozenge, {
@@ -263,10 +265,11 @@ export var MultiValue = /*#__PURE__*/function (_React$Component) {
263
265
  type: "user",
264
266
  text: label,
265
267
  isRemovable: !isDisabled,
266
- onBeforeRemoveAction: removeAction,
268
+ onAfterRemoveAction: onAfterRemoveAction,
267
269
  avatar: function avatar(props) {
268
270
  return jsx(Avatar, _extends({}, props, avatarProps));
269
- }
271
+ },
272
+ hasMargin: false
270
273
  }));
271
274
  }
272
275
  return jsx(components.MultiValue, _extends({}, rest, {
@@ -1,10 +1,16 @@
1
- ._18m91wug{overflow-y:auto}
1
+
2
+ ._zulp1b66{gap:var(--ds-space-050,4px)}._18m91wug{overflow-y:auto}
2
3
  ._19bv12x7{padding-left:var(--ds-space-075,6px)}
4
+ ._19bvu2gc{padding-left:var(--ds-space-100,8px)}
3
5
  ._1fjgglyw{scrollbar-width:none}
4
6
  ._1ke8idpf::-webkit-scrollbar{width:0}
7
+ ._1n261g80{flex-wrap:wrap}
5
8
  ._1reo15vq{overflow-x:hidden}
6
9
  ._1suq1j28::-webkit-scrollbar{background-color:transparent}
7
10
  ._c71l1osq{max-height:100%}
8
- ._ca0q12x7{padding-top:var(--ds-space-075,6px)}
9
- ._n3td12x7{padding-bottom:var(--ds-space-075,6px)}
10
- ._yv0e5bpd{grid-template-columns:auto 1fr}
11
+ ._ca0qu2gc{padding-top:var(--ds-space-100,8px)}
12
+ ._ca0qv77o{padding-top:var(--ds-space-025,2px)}
13
+ ._n3tdu2gc{padding-bottom:var(--ds-space-100,8px)}
14
+ ._n3tdv77o{padding-bottom:var(--ds-space-025,2px)}
15
+ ._yv0e5bpd{grid-template-columns:auto 1fr}
16
+ ._yv0en7od{grid-template-columns:unset}
@@ -7,7 +7,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
7
7
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
8
  import _inherits from "@babel/runtime/helpers/inherits";
9
9
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
10
- var _excluded = ["children", "innerProps"];
10
+ var _excluded = ["children", "innerProps", "hasValue", "isCompact"];
11
11
  import "./MultiValueContainer.compiled.css";
12
12
  import { ax, ix } from "@compiled/react/runtime";
13
13
  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; }
@@ -16,12 +16,20 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
16
16
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
17
17
  import { components } from '@atlaskit/select';
18
18
  import React, { Fragment } from 'react';
19
- import { FormattedMessage } from 'react-intl';
19
+ import { FormattedMessage } from 'react-intl-next';
20
+ import { fg } from '@atlaskit/platform-feature-flags';
20
21
  import { messages } from './i18n';
21
22
  import { isChildInput } from './utils';
22
23
  import ValueContainerWrapper from './ValueContainerWrapper';
24
+ import { cx } from '@compiled/react';
23
25
  var valueContainerStyles = {
24
- root: "_yv0e5bpd _ca0q12x7 _n3td12x7 _19bv12x7 _1reo15vq _18m91wug _1fjgglyw _c71l1osq _1suq1j28 _1ke8idpf"
26
+ root: "_yv0e5bpd _1reo15vq _18m91wug _1fjgglyw _c71l1osq _1suq1j28 _1ke8idpf",
27
+ paddingLegacy: "_ca0qu2gc _n3tdu2gc _19bvu2gc",
28
+ tagUpliftVerticalDefault: "_ca0qu2gc _n3tdu2gc",
29
+ tagUpliftVerticalCompact: "_ca0qv77o _n3tdv77o",
30
+ paddingLeftTight: "_19bv12x7",
31
+ paddingLeftWide: "_19bvu2gc",
32
+ withFlexAndGap: "_zulp1b66 _yv0en7od _1n261g80"
25
33
  };
26
34
  export var MultiValueContainer = /*#__PURE__*/function (_React$PureComponent) {
27
35
  function MultiValueContainer(props) {
@@ -110,17 +118,24 @@ export var MultiValueContainer = /*#__PURE__*/function (_React$PureComponent) {
110
118
  key: "render",
111
119
  value: function render() {
112
120
  var _this$props = this.props,
113
- children = _this$props.children,
114
- innerProps = _this$props.innerProps,
121
+ _children = _this$props.children,
122
+ _innerProps = _this$props.innerProps,
123
+ hasValue = _this$props.hasValue,
124
+ isCompact = _this$props.isCompact,
115
125
  valueContainerProps = _objectWithoutProperties(_this$props, _excluded);
116
126
  var props = _objectSpread(_objectSpread({}, valueContainerProps), {}, {
127
+ hasValue: hasValue,
128
+ isCompact: isCompact,
117
129
  innerProps: this.valueContainerInnerProps
118
130
  });
131
+ var ffTagUplifts = fg('platform-dst-lozenge-tag-badge-visual-uplifts');
132
+ var controlRendersValueInControl = this.props.selectProps.controlShouldRenderValue !== false;
133
+ var tagUpliftChipRow = ffTagUplifts && hasValue && controlRendersValueInControl;
119
134
  return /*#__PURE__*/React.createElement(ValueContainerWrapper, {
120
135
  isEnabled: this.onValueContainerClick,
121
136
  onMouseDown: this.onValueContainerClick
122
137
  }, /*#__PURE__*/React.createElement(components.ValueContainer, _extends({}, props, {
123
- xcss: valueContainerStyles.root
138
+ xcss: cx(valueContainerStyles.root, !ffTagUplifts && valueContainerStyles.paddingLegacy, ffTagUplifts && (isCompact ? valueContainerStyles.tagUpliftVerticalCompact : valueContainerStyles.tagUpliftVerticalDefault), ffTagUplifts && (tagUpliftChipRow ? valueContainerStyles.paddingLeftWide : valueContainerStyles.paddingLeftTight), tagUpliftChipRow && valueContainerStyles.withFlexAndGap)
124
139
  }), this.renderChildren()));
125
140
  }
126
141
  }], [{
@@ -38,7 +38,7 @@ export var getStyles = memoizeOne(function (width, isMulti, isCompact, overrideS
38
38
  backgroundColor: state.selectProps.subtle && state.selectProps.hoveringClearIndicator ? "var(--ds-background-danger, #FFECEB)" : state.isFocused ? css[':hover'] ? "var(--ds-background-input, #FFFFFF)" : "var(--ds-background-input, #FFFFFF)" : state.isDisabled ? "var(--ds-background-disabled, #17171708)" : "var(--ds-background-input-hovered, #F8F8F8)"
39
39
  }),
40
40
  padding: 0,
41
- minHeight: minHeight ? minHeight : height || isCompact ? 'none' : 44,
41
+ minHeight: minHeight ? minHeight : height || isCompact ? isMulti && fg('platform-dst-lozenge-tag-badge-visual-uplifts') ? 30 : 'none' : isMulti && fg('platform-dst-lozenge-tag-badge-visual-uplifts') ? 42 : 44,
42
42
  /* IE 11 needs to set height explicitly to be vertical align when being in not compact mode */
43
43
  height: height ? height : isCompact || isMulti ? '100%' : 44,
44
44
  maxWidth: '100%'
@@ -78,9 +78,11 @@ export var getStyles = memoizeOne(function (width, isMulti, isCompact, overrideS
78
78
  var isMulti = state.selectProps.isMulti;
79
79
  return _objectSpread(_objectSpread({}, css), {}, {
80
80
  gridTemplateColumns: 'auto 1fr',
81
- paddingTop: isCompact ? 0 : BORDER_PADDING,
82
- paddingBottom: isCompact ? 0 : BORDER_PADDING,
83
- paddingLeft: isMulti ? BORDER_PADDING : 0,
81
+ paddingTop: isCompact ? isMulti && fg('platform-dst-lozenge-tag-badge-visual-uplifts') ? "var(--ds-space-025, 2px)" : 0 : isMulti && fg('platform-dst-lozenge-tag-badge-visual-uplifts') ? "var(--ds-space-100, 8px)" : BORDER_PADDING,
82
+ paddingBottom: isCompact ? isMulti && fg('platform-dst-lozenge-tag-badge-visual-uplifts') ? "var(--ds-space-025, 2px)" : 0 : isMulti && fg('platform-dst-lozenge-tag-badge-visual-uplifts') ? "var(--ds-space-100, 8px)" : BORDER_PADDING,
83
+ // Match pre–tag-uplift leading inset when only the placeholder shows (share dialog VR, etc.).
84
+ paddingLeft: isMulti ? state.hasValue && state.selectProps.controlShouldRenderValue !== false && fg('platform-dst-lozenge-tag-badge-visual-uplifts') ? "var(--ds-space-100, 8px)" : BORDER_PADDING : 0,
85
+ gap: isMulti && fg('platform-dst-lozenge-tag-badge-visual-uplifts') ? "var(--ds-space-050, 4px)" : undefined,
84
86
  overflowX: 'hidden',
85
87
  overflowY: 'auto',
86
88
  scrollbarWidth: 'none',
@@ -139,14 +141,18 @@ export var getStyles = memoizeOne(function (width, isMulti, isCompact, overrideS
139
141
  });
140
142
  },
141
143
  input: function input(css, state) {
142
- return _objectSpread(_objectSpread({}, css), {}, {
144
+ return _objectSpread(_objectSpread(_objectSpread({}, css), {}, {
143
145
  gridArea: '1/2/2/3',
144
146
  gridTemplateColumns: isMulti && state.placeholder ? '0 123px' : css.gridTemplateColumns,
145
147
  /* Necessary to make input height and tag height the same. */
146
- margin: "var(--ds-space-050, 4px)".concat(" 0"),
148
+ margin: isMulti && fg('platform-dst-lozenge-tag-badge-visual-uplifts') ? 0 : "var(--ds-space-050, 4px)".concat(" 0"),
147
149
  /* Padding top and bottom of 2 is set by default. */
148
150
  paddingTop: 0,
149
- paddingBottom: 0,
151
+ paddingBottom: 0
152
+ }, isMulti && fg('platform-dst-lozenge-tag-badge-visual-uplifts') && {
153
+ height: "var(--ds-space-250, 20px)",
154
+ alignItems: 'center'
155
+ }), {}, {
150
156
  paddingLeft: state.selectProps.isMulti ? 0 : BORDER_PADDING,
151
157
  '& input::placeholder': {
152
158
  /* Chrome, Firefox, Opera, Safari 10.1+ */
@@ -13,7 +13,7 @@ type Props = MultiValueProps<OptionType> & {
13
13
  isFocused?: boolean;
14
14
  ref?: React.RefObject<HTMLDivElement>;
15
15
  removeProps: {
16
- onClick: Function;
16
+ onClick: (e?: React.MouseEvent<HTMLDivElement>) => void;
17
17
  };
18
18
  selectProps: UserPickerProps;
19
19
  };
@@ -11,14 +11,16 @@ export type State = {
11
11
  };
12
12
  type Props = MultiValueProps<Option<User>[], true> & {
13
13
  innerProps?: ValueContainerInnerProps;
14
+ /** Passed through from Atlaskit Select value container (spacing compact). */
15
+ isCompact?: boolean;
14
16
  };
15
17
  type ValueContainerInnerProps = {
16
18
  ref: React.RefObject<HTMLDivElement>;
17
19
  };
18
20
  export declare class MultiValueContainer extends React.PureComponent<Props, State> {
19
21
  static getDerivedStateFromProps(nextProps: Props, prevState: State): {
20
- valueSize: number;
21
22
  previousValueSize: number;
23
+ valueSize: number;
22
24
  };
23
25
  private valueContainerInnerProps;
24
26
  private timeoutId;
@@ -25,20 +25,20 @@ export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
25
25
  ariaDescribedBy?: string;
26
26
  ariaLabel?: string;
27
27
  ariaLabelledBy?: string;
28
- ariaLive?: "polite" | "off" | "assertive";
28
+ ariaLive?: 'polite' | 'off' | 'assertive';
29
29
  autoFocus?: boolean;
30
30
  captureMenuScroll?: boolean;
31
31
  clearValueLabel?: string;
32
32
  closeMenuOnScroll?: boolean | EventListener;
33
33
  components?: SelectComponentsConfig<OptionData, boolean>;
34
- customGroupLabels?: Partial<Record<NonNullable<OptionData["type"]>, React.ReactNode>>;
34
+ customGroupLabels?: Partial<Record<NonNullable<OptionData['type']>, React.ReactNode>>;
35
35
  defaultValue?: DefaultValue;
36
36
  disableInput?: boolean;
37
37
  emailLabel?: string;
38
38
  fieldId: string | null;
39
39
  footer?: React.ReactNode;
40
40
  forwardedRef?: React.ForwardedRef<UserPickerRef>;
41
- groupByTypeOrder?: NonNullable<OptionData["type"]>[];
41
+ groupByTypeOrder?: NonNullable<OptionData['type']>[];
42
42
  header?: React.ReactNode;
43
43
  height?: number | string;
44
44
  includeTeamsUpdates?: boolean;
@@ -61,7 +61,7 @@ export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
61
61
  menuIsOpen?: boolean;
62
62
  menuMinWidth?: number;
63
63
  menuPortalTarget?: HTMLElement;
64
- menuPosition?: "absolute" | "fixed";
64
+ menuPosition?: 'absolute' | 'fixed';
65
65
  menuShouldBlockScroll?: boolean;
66
66
  minHeight?: number | string;
67
67
  name?: string;
@@ -83,14 +83,14 @@ export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
83
83
  openMenuOnFocus?: boolean;
84
84
  options?: OptionData[];
85
85
  placeholder?: React.ReactNode;
86
- placeholderAvatar?: "person" | "team";
86
+ placeholderAvatar?: 'person' | 'team';
87
87
  popupSelectProps?: PopupSelectProps<OptionData>;
88
88
  required?: boolean;
89
89
  search?: string;
90
90
  setIsFooterFocused?: React.Dispatch<React.SetStateAction<boolean>>;
91
91
  setIsHeaderFocused?: React.Dispatch<React.SetStateAction<boolean>>;
92
92
  showClearIndicator?: boolean;
93
- strategy?: "fixed" | "absolute";
93
+ strategy?: 'fixed' | 'absolute';
94
94
  styles?: StylesConfig;
95
95
  subtle?: boolean;
96
96
  suggestEmailsForDomain?: string;
@@ -98,7 +98,7 @@ export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
98
98
  UNSAFE_hasDraggableParentComponent?: boolean;
99
99
  value?: Value;
100
100
  width?: number | string;
101
- }, keyof WithAnalyticsEventsProps>, "search" | "appearance" | "height" | "minHeight" | "open" | "isDisabled" | "options" | "anchor" | "footer" | "header" | "subtle" | "value" | "placeholderAvatar" | "noOptionsMessage" | "placeholder" | "defaultValue" | "autoFocus" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "name" | "emailLabel" | "addMoreMessage" | "allowEmail" | "ariaDescribedBy" | "ariaLabel" | "ariaLabelledBy" | "ariaLive" | "captureMenuScroll" | "clearValueLabel" | "closeMenuOnScroll" | "components" | "disableInput" | "fieldId" | "forwardedRef" | "groupByTypeOrder" | "customGroupLabels" | "includeTeamsUpdates" | "inputId" | "isClearable" | "isFooterFocused" | "isHeaderFocused" | "isInvalid" | "isLoading" | "isValidEmail" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "maxOptions" | "maxPickerHeight" | "menuIsOpen" | "menuMinWidth" | "menuPortalTarget" | "menuPosition" | "menuShouldBlockScroll" | "noBorder" | "onClear" | "onClose" | "onInputChange" | "onOpen" | "onSelection" | "openMenuOnClick" | "openMenuOnFocus" | "popupSelectProps" | "required" | "setIsFooterFocused" | "setIsHeaderFocused" | "showClearIndicator" | "strategy" | "styles" | "suggestEmailsForDomain" | "textFieldBackgroundColor" | "UNSAFE_hasDraggableParentComponent"> & {
101
+ }, keyof WithAnalyticsEventsProps>, 'search' | 'appearance' | 'height' | 'minHeight' | 'open' | 'isDisabled' | 'options' | 'anchor' | 'footer' | 'header' | 'subtle' | 'value' | 'placeholderAvatar' | 'noOptionsMessage' | 'placeholder' | 'defaultValue' | 'autoFocus' | 'onFocus' | 'onBlur' | 'onChange' | 'onKeyDown' | 'name' | 'emailLabel' | 'addMoreMessage' | 'allowEmail' | 'ariaDescribedBy' | 'ariaLabel' | 'ariaLabelledBy' | 'ariaLive' | 'captureMenuScroll' | 'clearValueLabel' | 'closeMenuOnScroll' | 'components' | 'disableInput' | 'fieldId' | 'forwardedRef' | 'groupByTypeOrder' | 'customGroupLabels' | 'includeTeamsUpdates' | 'inputId' | 'isClearable' | 'isFooterFocused' | 'isHeaderFocused' | 'isInvalid' | 'isLoading' | 'isValidEmail' | 'loadOptions' | 'loadOptionsErrorMessage' | 'loadUserSource' | 'maxOptions' | 'maxPickerHeight' | 'menuIsOpen' | 'menuMinWidth' | 'menuPortalTarget' | 'menuPosition' | 'menuShouldBlockScroll' | 'noBorder' | 'onClear' | 'onClose' | 'onInputChange' | 'onOpen' | 'onSelection' | 'openMenuOnClick' | 'openMenuOnFocus' | 'popupSelectProps' | 'required' | 'setIsFooterFocused' | 'setIsHeaderFocused' | 'showClearIndicator' | 'strategy' | 'styles' | 'suggestEmailsForDomain' | 'textFieldBackgroundColor' | 'UNSAFE_hasDraggableParentComponent'> & {
102
102
  isMulti?: boolean | undefined;
103
103
  width?: number | string | undefined;
104
104
  } & {} & React.RefAttributes<any>>;
@@ -6,7 +6,7 @@ declare function creatableProps(isValidEmail?: EmailValidator): {
6
6
  formatCreateLabel: (inputText?: string) => string;
7
7
  getNewOptionData: (inputValue: string) => Option;
8
8
  isOptionDisabled: (option: Option) => boolean;
9
- isValidNewOption: (inputValue?: string) => boolean | "" | undefined;
9
+ isValidNewOption: (inputValue?: string) => boolean | '' | undefined;
10
10
  };
11
11
  export declare const getCreatableProps: typeof creatableProps;
12
12
  export {};
@@ -16,5 +16,5 @@ export declare const getCreatableSuggestedEmailProps: MemoizedFn<(emailDomain: s
16
16
  value: string;
17
17
  } | null;
18
18
  isOptionDisabled: (option: Option) => boolean;
19
- isValidNewOption: (inputValue?: string) => boolean | "" | undefined;
19
+ isValidNewOption: (inputValue?: string) => boolean | '' | undefined;
20
20
  }>;
@@ -1,6 +1,6 @@
1
1
  import { type StylesConfig } from '@atlaskit/select';
2
2
  import { type MemoizedFn } from 'memoize-one';
3
- export declare const BORDER_PADDING: "var(--ds-space-075)";
3
+ export declare const BORDER_PADDING: 'var(--ds-space-075)';
4
4
  export declare const AVATAR_PADDING = 6;
5
5
  export declare const INDICATOR_WIDTH = 39;
6
6
  export declare const getStyles: MemoizedFn<(width: string | number, isMulti?: boolean, isCompact?: boolean, overrideStyles?: StylesConfig, isVisualRefresh?: boolean, isPopupStyles?: boolean, height?: number | string, minHeight?: number | string) => StylesConfig>;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { type MemoizedFn } from 'memoize-one';
3
3
  import type { OptionData, Option, GroupedOptions } from '../../types';
4
- export declare const groupOptionsByType: MemoizedFn<(options: Option[], groupByTypeOrder: NonNullable<OptionData["type"]>[], customGroupLabels?: Partial<Record<NonNullable<OptionData["type"]>, React.ReactNode>>) => Option[] | GroupedOptions[]>;
4
+ export declare const groupOptionsByType: MemoizedFn<(options: Option[], groupByTypeOrder: NonNullable<OptionData['type']>[], customGroupLabels?: Partial<Record<NonNullable<OptionData['type']>, React.ReactNode>>) => Option[] | GroupedOptions[]>;
@@ -13,7 +13,7 @@ type Props = MultiValueProps<OptionType> & {
13
13
  isFocused?: boolean;
14
14
  ref?: React.RefObject<HTMLDivElement>;
15
15
  removeProps: {
16
- onClick: Function;
16
+ onClick: (e?: React.MouseEvent<HTMLDivElement>) => void;
17
17
  };
18
18
  selectProps: UserPickerProps;
19
19
  };
@@ -11,14 +11,16 @@ export type State = {
11
11
  };
12
12
  type Props = MultiValueProps<Option<User>[], true> & {
13
13
  innerProps?: ValueContainerInnerProps;
14
+ /** Passed through from Atlaskit Select value container (spacing compact). */
15
+ isCompact?: boolean;
14
16
  };
15
17
  type ValueContainerInnerProps = {
16
18
  ref: React.RefObject<HTMLDivElement>;
17
19
  };
18
20
  export declare class MultiValueContainer extends React.PureComponent<Props, State> {
19
21
  static getDerivedStateFromProps(nextProps: Props, prevState: State): {
20
- valueSize: number;
21
22
  previousValueSize: number;
23
+ valueSize: number;
22
24
  };
23
25
  private valueContainerInnerProps;
24
26
  private timeoutId;
@@ -25,20 +25,20 @@ export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
25
25
  ariaDescribedBy?: string;
26
26
  ariaLabel?: string;
27
27
  ariaLabelledBy?: string;
28
- ariaLive?: "polite" | "off" | "assertive";
28
+ ariaLive?: 'polite' | 'off' | 'assertive';
29
29
  autoFocus?: boolean;
30
30
  captureMenuScroll?: boolean;
31
31
  clearValueLabel?: string;
32
32
  closeMenuOnScroll?: boolean | EventListener;
33
33
  components?: SelectComponentsConfig<OptionData, boolean>;
34
- customGroupLabels?: Partial<Record<NonNullable<OptionData["type"]>, React.ReactNode>>;
34
+ customGroupLabels?: Partial<Record<NonNullable<OptionData['type']>, React.ReactNode>>;
35
35
  defaultValue?: DefaultValue;
36
36
  disableInput?: boolean;
37
37
  emailLabel?: string;
38
38
  fieldId: string | null;
39
39
  footer?: React.ReactNode;
40
40
  forwardedRef?: React.ForwardedRef<UserPickerRef>;
41
- groupByTypeOrder?: NonNullable<OptionData["type"]>[];
41
+ groupByTypeOrder?: NonNullable<OptionData['type']>[];
42
42
  header?: React.ReactNode;
43
43
  height?: number | string;
44
44
  includeTeamsUpdates?: boolean;
@@ -61,7 +61,7 @@ export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
61
61
  menuIsOpen?: boolean;
62
62
  menuMinWidth?: number;
63
63
  menuPortalTarget?: HTMLElement;
64
- menuPosition?: "absolute" | "fixed";
64
+ menuPosition?: 'absolute' | 'fixed';
65
65
  menuShouldBlockScroll?: boolean;
66
66
  minHeight?: number | string;
67
67
  name?: string;
@@ -83,14 +83,14 @@ export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
83
83
  openMenuOnFocus?: boolean;
84
84
  options?: OptionData[];
85
85
  placeholder?: React.ReactNode;
86
- placeholderAvatar?: "person" | "team";
86
+ placeholderAvatar?: 'person' | 'team';
87
87
  popupSelectProps?: PopupSelectProps<OptionData>;
88
88
  required?: boolean;
89
89
  search?: string;
90
90
  setIsFooterFocused?: React.Dispatch<React.SetStateAction<boolean>>;
91
91
  setIsHeaderFocused?: React.Dispatch<React.SetStateAction<boolean>>;
92
92
  showClearIndicator?: boolean;
93
- strategy?: "fixed" | "absolute";
93
+ strategy?: 'fixed' | 'absolute';
94
94
  styles?: StylesConfig;
95
95
  subtle?: boolean;
96
96
  suggestEmailsForDomain?: string;
@@ -98,7 +98,7 @@ export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
98
98
  UNSAFE_hasDraggableParentComponent?: boolean;
99
99
  value?: Value;
100
100
  width?: number | string;
101
- }, keyof WithAnalyticsEventsProps>, "search" | "appearance" | "height" | "minHeight" | "open" | "isDisabled" | "options" | "anchor" | "footer" | "header" | "subtle" | "value" | "placeholderAvatar" | "noOptionsMessage" | "placeholder" | "defaultValue" | "autoFocus" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "name" | "emailLabel" | "addMoreMessage" | "allowEmail" | "ariaDescribedBy" | "ariaLabel" | "ariaLabelledBy" | "ariaLive" | "captureMenuScroll" | "clearValueLabel" | "closeMenuOnScroll" | "components" | "disableInput" | "fieldId" | "forwardedRef" | "groupByTypeOrder" | "customGroupLabels" | "includeTeamsUpdates" | "inputId" | "isClearable" | "isFooterFocused" | "isHeaderFocused" | "isInvalid" | "isLoading" | "isValidEmail" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "maxOptions" | "maxPickerHeight" | "menuIsOpen" | "menuMinWidth" | "menuPortalTarget" | "menuPosition" | "menuShouldBlockScroll" | "noBorder" | "onClear" | "onClose" | "onInputChange" | "onOpen" | "onSelection" | "openMenuOnClick" | "openMenuOnFocus" | "popupSelectProps" | "required" | "setIsFooterFocused" | "setIsHeaderFocused" | "showClearIndicator" | "strategy" | "styles" | "suggestEmailsForDomain" | "textFieldBackgroundColor" | "UNSAFE_hasDraggableParentComponent"> & {
101
+ }, keyof WithAnalyticsEventsProps>, 'search' | 'appearance' | 'height' | 'minHeight' | 'open' | 'isDisabled' | 'options' | 'anchor' | 'footer' | 'header' | 'subtle' | 'value' | 'placeholderAvatar' | 'noOptionsMessage' | 'placeholder' | 'defaultValue' | 'autoFocus' | 'onFocus' | 'onBlur' | 'onChange' | 'onKeyDown' | 'name' | 'emailLabel' | 'addMoreMessage' | 'allowEmail' | 'ariaDescribedBy' | 'ariaLabel' | 'ariaLabelledBy' | 'ariaLive' | 'captureMenuScroll' | 'clearValueLabel' | 'closeMenuOnScroll' | 'components' | 'disableInput' | 'fieldId' | 'forwardedRef' | 'groupByTypeOrder' | 'customGroupLabels' | 'includeTeamsUpdates' | 'inputId' | 'isClearable' | 'isFooterFocused' | 'isHeaderFocused' | 'isInvalid' | 'isLoading' | 'isValidEmail' | 'loadOptions' | 'loadOptionsErrorMessage' | 'loadUserSource' | 'maxOptions' | 'maxPickerHeight' | 'menuIsOpen' | 'menuMinWidth' | 'menuPortalTarget' | 'menuPosition' | 'menuShouldBlockScroll' | 'noBorder' | 'onClear' | 'onClose' | 'onInputChange' | 'onOpen' | 'onSelection' | 'openMenuOnClick' | 'openMenuOnFocus' | 'popupSelectProps' | 'required' | 'setIsFooterFocused' | 'setIsHeaderFocused' | 'showClearIndicator' | 'strategy' | 'styles' | 'suggestEmailsForDomain' | 'textFieldBackgroundColor' | 'UNSAFE_hasDraggableParentComponent'> & {
102
102
  isMulti?: boolean | undefined;
103
103
  width?: number | string | undefined;
104
104
  } & {} & React.RefAttributes<any>>;
@@ -6,7 +6,7 @@ declare function creatableProps(isValidEmail?: EmailValidator): {
6
6
  formatCreateLabel: (inputText?: string) => string;
7
7
  getNewOptionData: (inputValue: string) => Option;
8
8
  isOptionDisabled: (option: Option) => boolean;
9
- isValidNewOption: (inputValue?: string) => boolean | "" | undefined;
9
+ isValidNewOption: (inputValue?: string) => boolean | '' | undefined;
10
10
  };
11
11
  export declare const getCreatableProps: typeof creatableProps;
12
12
  export {};
@@ -16,5 +16,5 @@ export declare const getCreatableSuggestedEmailProps: MemoizedFn<(emailDomain: s
16
16
  value: string;
17
17
  } | null;
18
18
  isOptionDisabled: (option: Option) => boolean;
19
- isValidNewOption: (inputValue?: string) => boolean | "" | undefined;
19
+ isValidNewOption: (inputValue?: string) => boolean | '' | undefined;
20
20
  }>;
@@ -1,6 +1,6 @@
1
1
  import { type StylesConfig } from '@atlaskit/select';
2
2
  import { type MemoizedFn } from 'memoize-one';
3
- export declare const BORDER_PADDING: "var(--ds-space-075)";
3
+ export declare const BORDER_PADDING: 'var(--ds-space-075)';
4
4
  export declare const AVATAR_PADDING = 6;
5
5
  export declare const INDICATOR_WIDTH = 39;
6
6
  export declare const getStyles: MemoizedFn<(width: string | number, isMulti?: boolean, isCompact?: boolean, overrideStyles?: StylesConfig, isVisualRefresh?: boolean, isPopupStyles?: boolean, height?: number | string, minHeight?: number | string) => StylesConfig>;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { type MemoizedFn } from 'memoize-one';
3
3
  import type { OptionData, Option, GroupedOptions } from '../../types';
4
- export declare const groupOptionsByType: MemoizedFn<(options: Option[], groupByTypeOrder: NonNullable<OptionData["type"]>[], customGroupLabels?: Partial<Record<NonNullable<OptionData["type"]>, React.ReactNode>>) => Option[] | GroupedOptions[]>;
4
+ export declare const groupOptionsByType: MemoizedFn<(options: Option[], groupByTypeOrder: NonNullable<OptionData['type']>[], customGroupLabels?: Partial<Record<NonNullable<OptionData['type']>, React.ReactNode>>) => Option[] | GroupedOptions[]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "12.0.0",
3
+ "version": "12.0.2",
4
4
  "description": "Fabric component for display a dropdown to select a user from",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -46,17 +46,17 @@
46
46
  "@atlaskit/analytics-next": "^11.2.0",
47
47
  "@atlaskit/avatar": "^25.11.0",
48
48
  "@atlaskit/feature-gate-js-client": "^5.5.0",
49
- "@atlaskit/icon": "^34.1.0",
49
+ "@atlaskit/icon": "^34.2.0",
50
50
  "@atlaskit/logo": "^20.0.0",
51
51
  "@atlaskit/lozenge": "^13.7.0",
52
- "@atlaskit/people-teams-ui-public": "^3.7.0",
52
+ "@atlaskit/people-teams-ui-public": "^4.0.0",
53
53
  "@atlaskit/platform-feature-flags": "^1.1.0",
54
54
  "@atlaskit/popper": "^7.2.0",
55
55
  "@atlaskit/primitives": "^19.0.0",
56
56
  "@atlaskit/select": "^21.10.0",
57
57
  "@atlaskit/spinner": "^19.1.0",
58
- "@atlaskit/tag": "^14.9.0",
59
- "@atlaskit/teams-avatar": "^2.5.0",
58
+ "@atlaskit/tag": "^14.10.0",
59
+ "@atlaskit/teams-avatar": "^2.6.0",
60
60
  "@atlaskit/tokens": "^13.0.0",
61
61
  "@atlaskit/tooltip": "^21.1.0",
62
62
  "@atlaskit/ufo": "^0.4.0",