@atlaskit/select 17.13.1 → 17.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlaskit/select
2
2
 
3
+ ## 17.14.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#130406](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/130406)
8
+ [`9d04736c97bfe`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9d04736c97bfe) -
9
+ Added feature flag for fixing react18 bug(https://product-fabric.atlassian.net/browse/DSP-19701)
10
+ for handling menu triggers
11
+
12
+ ## 17.13.2
13
+
14
+ ### Patch Changes
15
+
16
+ - [#129726](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/129726)
17
+ [`778c15c1d279a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/778c15c1d279a) -
18
+ [ux] Removed feature flag `platform.design-system-team.select-new-typography_7m89c` resulting in
19
+ minor visual changes to typography.
20
+
3
21
  ## 17.13.1
4
22
 
5
23
  ### Patch Changes
@@ -30,7 +30,7 @@ var _Select = _interopRequireDefault(require("../Select"));
30
30
  var _styles = _interopRequireDefault(require("../styles"));
31
31
  var _groupedOptionsAnnouncement = require("../utils/grouped-options-announcement");
32
32
  var _components = require("./components");
33
- var _excluded = ["footer", "label", "maxMenuWidth", "minMenuWidth", "placeholder", "target", "testId"];
33
+ var _excluded = ["footer", "label", "maxMenuWidth", "minMenuWidth", "placeholder", "target", "testId", "onMenuOpen", "onMenuClose"];
34
34
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
35
35
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
36
36
  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; }
@@ -178,7 +178,9 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
178
178
  * @param options.controlOverride - Force the popup to open when it's open state is being controlled
179
179
  */
180
180
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "open", function (options) {
181
- var onOpen = _this.props.onOpen;
181
+ var _this$props2 = _this.props,
182
+ onOpen = _this$props2.onOpen,
183
+ onMenuOpen = _this$props2.onMenuOpen;
182
184
  if (!(options !== null && options !== void 0 && options.controlOverride) && _this.isOpenControlled) {
183
185
  // Prevent popup opening if it's open state is already being controlled
184
186
  return;
@@ -186,6 +188,9 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
186
188
  if (onOpen) {
187
189
  onOpen();
188
190
  }
191
+ if (onMenuOpen && (0, _platformFeatureFlags.fg)('platform-design-system-dsp-19701-no-node-resolver')) {
192
+ onMenuOpen();
193
+ }
189
194
  _this.setState({
190
195
  isOpen: true
191
196
  });
@@ -211,7 +216,9 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
211
216
  */
212
217
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "close", function (options) {
213
218
  var _this$unbindWindowKey, _this2;
214
- var onClose = _this.props.onClose;
219
+ var _this$props3 = _this.props,
220
+ onClose = _this$props3.onClose,
221
+ onMenuClose = _this$props3.onMenuClose;
215
222
  if (!(options !== null && options !== void 0 && options.controlOverride) && _this.isOpenControlled) {
216
223
  // Prevent popup closing if it's open state is already being controlled
217
224
  return;
@@ -219,6 +226,9 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
219
226
  if (onClose) {
220
227
  onClose();
221
228
  }
229
+ if (onMenuClose && (0, _platformFeatureFlags.fg)('platform-design-system-dsp-19701-no-node-resolver')) {
230
+ onMenuClose();
231
+ }
222
232
  _this.setState({
223
233
  isOpen: false
224
234
  });
@@ -296,23 +306,29 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
296
306
  });
297
307
  // if the threshold is exceeded, AND isSearchable is true, then display the search control
298
308
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "showSearchControl", function () {
299
- var _this$props2 = _this.props,
300
- searchThreshold = _this$props2.searchThreshold,
301
- isSearchable = _this$props2.isSearchable;
309
+ var _this$props4 = _this.props,
310
+ searchThreshold = _this$props4.searchThreshold,
311
+ isSearchable = _this$props4.isSearchable;
302
312
  return isSearchable && _this.getItemCount() > searchThreshold;
303
313
  });
304
314
  // Renderers
305
315
  // ==============================
306
316
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderSelect", function () {
307
- var _this$props3 = _this.props,
308
- footer = _this$props3.footer,
309
- label = _this$props3.label,
310
- maxMenuWidth = _this$props3.maxMenuWidth,
311
- minMenuWidth = _this$props3.minMenuWidth,
312
- placeholder = _this$props3.placeholder,
313
- target = _this$props3.target,
314
- testId = _this$props3.testId,
315
- props = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
317
+ var _this$props5 = _this.props,
318
+ footer = _this$props5.footer,
319
+ label = _this$props5.label,
320
+ maxMenuWidth = _this$props5.maxMenuWidth,
321
+ minMenuWidth = _this$props5.minMenuWidth,
322
+ placeholder = _this$props5.placeholder,
323
+ target = _this$props5.target,
324
+ testId = _this$props5.testId,
325
+ onMenuOpen = _this$props5.onMenuOpen,
326
+ onMenuClose = _this$props5.onMenuClose,
327
+ props = (0, _objectWithoutProperties2.default)(_this$props5, _excluded);
328
+ var menuHandlers = !(0, _platformFeatureFlags.fg)('platform-design-system-dsp-19701-no-node-resolver') ? {
329
+ onMenuOpen: onMenuOpen,
330
+ onMenuClose: onMenuClose
331
+ } : {};
316
332
  var _this$state = _this.state,
317
333
  focusLockEnabled = _this$state.focusLockEnabled,
318
334
  isOpen = _this$state.isOpen,
@@ -389,42 +405,49 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
389
405
  var placement = _ref2.placement,
390
406
  ref = _ref2.ref,
391
407
  style = _ref2.style;
392
- return /*#__PURE__*/_react.default.createElement(_reactNodeResolver.default, {
393
- innerRef: _this.resolveMenuRef(ref)
394
- }, /*#__PURE__*/_react.default.createElement(_components.MenuDialog
395
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
396
- , {
397
- style: style,
398
- "data-placement": placement,
399
- minWidth: minMenuWidth,
400
- maxWidth: maxMenuWidth,
401
- id: _this.popperWrapperId,
402
- testId: testId
403
- }, /*#__PURE__*/_react.default.createElement(_reactFocusLock.default, {
404
- disabled: !focusLockEnabled,
405
- returnFocus: true
406
- }, /*#__PURE__*/_react.default.createElement(InternalSelect, (0, _extends2.default)({
407
- "aria-label": providedAriaLabel,
408
- backspaceRemovesValue: false,
409
- controlShouldRenderValue: false,
410
- isClearable: false,
411
- tabSelectsValue: false,
412
- menuIsOpen: true,
413
- placeholder: placeholder,
414
- ref: _this.getSelectRef
415
- }, props, {
416
- isSearchable: showSearchControl
417
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
418
- ,
419
- styles: (0, _reactSelect.mergeStyles)(_this.defaultStyles, props.styles || {}),
420
- maxMenuHeight: _this.getMaxHeight(),
421
- components: selectComponents,
422
- onChange: _this.handleSelectChange,
423
- ariaLiveMessages: !showSearchControl ? _objectSpread({
424
- // Overwriting ariaLiveMessages builtin onFocus method to announce selected option when popup has been opened
425
- onFocus: onReactSelectFocus
426
- }, props.ariaLiveMessages) : props.ariaLiveMessages
427
- })), footer)));
408
+ return (
409
+ /*#__PURE__*/
410
+ // When the feature flag 'platform-design-system-dsp-19701-no-node-resolver' is enabled,
411
+ // we directly pass the ref to MenuDialog instead of wrapping it with NodeResolver.
412
+ _react.default.createElement(ConditionalNodeResolverWrapper, {
413
+ hasNodeResolver: !(0, _platformFeatureFlags.fg)('platform-design-system-dsp-19701-no-node-resolver'),
414
+ innerRef: _this.resolveMenuRef(ref)
415
+ }, /*#__PURE__*/_react.default.createElement(_components.MenuDialog
416
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
417
+ , {
418
+ style: style,
419
+ "data-placement": placement,
420
+ minWidth: minMenuWidth,
421
+ maxWidth: maxMenuWidth,
422
+ id: _this.popperWrapperId,
423
+ testId: testId,
424
+ ref: !(0, _platformFeatureFlags.fg)('platform-design-system-dsp-19701-no-node-resolver') ? null : _this.resolveMenuRef(ref)
425
+ }, /*#__PURE__*/_react.default.createElement(_reactFocusLock.default, {
426
+ disabled: !focusLockEnabled,
427
+ returnFocus: true
428
+ }, /*#__PURE__*/_react.default.createElement(InternalSelect, (0, _extends2.default)({
429
+ "aria-label": providedAriaLabel,
430
+ backspaceRemovesValue: false,
431
+ controlShouldRenderValue: false,
432
+ isClearable: false,
433
+ tabSelectsValue: false,
434
+ menuIsOpen: true,
435
+ placeholder: placeholder,
436
+ ref: _this.getSelectRef
437
+ }, props, menuHandlers, {
438
+ isSearchable: showSearchControl
439
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
440
+ ,
441
+ styles: (0, _reactSelect.mergeStyles)(_this.defaultStyles, props.styles || {}),
442
+ maxMenuHeight: _this.getMaxHeight(),
443
+ components: selectComponents,
444
+ onChange: _this.handleSelectChange,
445
+ ariaLiveMessages: !showSearchControl ? _objectSpread({
446
+ // Overwriting ariaLiveMessages builtin onFocus method to announce selected option when popup has been opened
447
+ onFocus: onReactSelectFocus
448
+ }, props.ariaLiveMessages) : props.ariaLiveMessages
449
+ })), footer)))
450
+ );
428
451
  });
429
452
  return mergedPopperProps.strategy === 'fixed' ? popper : /*#__PURE__*/(0, _reactDom.createPortal)(popper, portalDestination);
430
453
  });
@@ -525,4 +548,25 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
525
548
  searchThreshold: 5,
526
549
  styles: {},
527
550
  options: []
528
- });
551
+ });
552
+ /**
553
+ * A wrapper component that conditionally applies a NodeResolver to its children.
554
+ *
555
+ * Note: NodeResolver should not be used in React 18 concurrent mode. This component
556
+ * is intended to be removed once the feature flag is removed.
557
+ * @param {boolean} props.hasNodeResolver - Determines whether to apply the NodeResolver.
558
+ * @param {ReactElement} props.children - The child elements to be wrapped.
559
+ * @param {(instance: HTMLDivElement) => void} props.innerRef - A ref callback to get the instance of the HTMLDivElement.
560
+ * @returns {ReactElement} The children wrapped with NodeResolver if hasNodeResolver is true, otherwise just the children.
561
+ */
562
+ var ConditionalNodeResolverWrapper = function ConditionalNodeResolverWrapper(_ref4) {
563
+ var hasNodeResolver = _ref4.hasNodeResolver,
564
+ children = _ref4.children,
565
+ innerRef = _ref4.innerRef;
566
+ if (hasNodeResolver) {
567
+ return /*#__PURE__*/_react.default.createElement(_reactNodeResolver.default, {
568
+ innerRef: innerRef
569
+ }, children);
570
+ }
571
+ return children;
572
+ };
@@ -7,7 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.defaultComponents = exports.MenuDialog = exports.DummyControl = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
- var _react = require("@emotion/react");
10
+ var _react = require("react");
11
+ var _react2 = require("@emotion/react");
11
12
  var _reactSelect = require("react-select");
12
13
  var _search = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/search"));
13
14
  var _colors = require("@atlaskit/theme/colors");
@@ -23,7 +24,7 @@ var _excluded = ["innerRef", "innerProps"];
23
24
  // Styled Components
24
25
  // ==============================
25
26
 
26
- var menuDialogStyles = (0, _react.css)({
27
+ var menuDialogStyles = (0, _react2.css)({
27
28
  zIndex: _constants.layers.modal(),
28
29
  backgroundColor: "var(--ds-surface-overlay, white)",
29
30
  borderRadius: "var(--ds-border-radius-100, 4px)",
@@ -35,14 +36,15 @@ var menuDialogStyles = (0, _react.css)({
35
36
  * Wrapper for PopupSelect component.
36
37
  *
37
38
  */
38
- var MenuDialog = exports.MenuDialog = function MenuDialog(_ref) {
39
+ var MenuDialog = exports.MenuDialog = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
39
40
  var maxWidth = _ref.maxWidth,
40
41
  minWidth = _ref.minWidth,
41
42
  children = _ref.children,
42
43
  id = _ref.id,
43
44
  style = _ref.style,
44
45
  testId = _ref.testId;
45
- return (0, _react.jsx)("div", {
46
+ return (0, _react2.jsx)("div", {
47
+ ref: ref,
46
48
  css: [menuDialogStyles,
47
49
  // There is not a limited amount of values for the widths, so they need
48
50
  // to remain dynamic.
@@ -57,35 +59,35 @@ var MenuDialog = exports.MenuDialog = function MenuDialog(_ref) {
57
59
  id: id,
58
60
  "data-testid": testId && "".concat(testId, "--menu")
59
61
  }, children);
60
- };
62
+ });
61
63
 
62
64
  // ==============================
63
65
  // Custom Components
64
66
  // ==============================
65
67
 
66
- var dropdownStyles = (0, _react.css)({
68
+ var dropdownStyles = (0, _react2.css)({
67
69
  width: 32,
68
70
  marginInlineEnd: "var(--ds-space-025, 2px)",
69
71
  textAlign: 'center'
70
72
  });
71
73
  var DropdownIndicator = function DropdownIndicator() {
72
- return (0, _react.jsx)("div", {
74
+ return (0, _react2.jsx)("div", {
73
75
  css: dropdownStyles
74
- }, (0, _react.jsx)(_search.default, {
76
+ }, (0, _react2.jsx)(_search.default, {
75
77
  label: "open"
76
78
  }));
77
79
  };
78
- var controlStyles = (0, _react.css)({
80
+ var controlStyles = (0, _react2.css)({
79
81
  padding: "var(--ds-space-100, 8px)".concat(" ", "var(--ds-space-100, 8px)", " ", "var(--ds-space-050, 4px)")
80
82
  });
81
83
  var Control = function Control(_ref2) {
82
84
  var innerRef = _ref2.innerRef,
83
85
  innerProps = _ref2.innerProps,
84
86
  props = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
85
- return (0, _react.jsx)("div", {
87
+ return (0, _react2.jsx)("div", {
86
88
  ref: innerRef,
87
89
  css: controlStyles
88
- }, (0, _react.jsx)(_reactSelect.components.Control, (0, _extends2.default)({}, props, {
90
+ }, (0, _react2.jsx)(_reactSelect.components.Control, (0, _extends2.default)({}, props, {
89
91
  innerProps: innerProps
90
92
  })));
91
93
  };
@@ -102,14 +104,14 @@ var Control = function Control(_ref2) {
102
104
  * - [Usage](https://atlassian.design/components/{packageName}/usage)
103
105
  */
104
106
  var DummyControl = exports.DummyControl = function DummyControl(props) {
105
- return (0, _react.jsx)(_visuallyHidden.default, null, (0, _react.jsx)(_reactSelect.components.Control, props));
107
+ return (0, _react2.jsx)(_visuallyHidden.default, null, (0, _react2.jsx)(_reactSelect.components.Control, props));
106
108
  };
107
109
 
108
110
  // NOTE `props` intentionally omitted from `Fragment`
109
111
  var Menu = function Menu(_ref3) {
110
112
  var children = _ref3.children,
111
113
  innerProps = _ref3.innerProps;
112
- return (0, _react.jsx)("div", innerProps, children);
114
+ return (0, _react2.jsx)("div", innerProps, children);
113
115
  };
114
116
  var defaultComponents = exports.defaultComponents = {
115
117
  Control: Control,
@@ -9,7 +9,7 @@ var _reactSelect = _interopRequireDefault(require("react-select"));
9
9
  var _analyticsNext = require("@atlaskit/analytics-next");
10
10
  var _createSelect = _interopRequireDefault(require("./createSelect"));
11
11
  var packageName = "@atlaskit/select";
12
- var packageVersion = "17.13.1";
12
+ var packageVersion = "17.14.0";
13
13
  var SelectWithoutAnalytics = exports.SelectWithoutAnalytics = (0, _createSelect.default)(_reactSelect.default);
14
14
  var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
15
15
  var Select = (0, _analyticsNext.withAnalyticsContext)({
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = baseStyles;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
10
9
  var _colors = require("@atlaskit/theme/colors");
11
10
  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; }
12
11
  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; }
@@ -16,11 +15,8 @@ function baseStyles(validationState) {
16
15
  return {
17
16
  container: function container(css, _ref) {
18
17
  var isDisabled = _ref.isDisabled;
19
- return _objectSpread(_objectSpread(_objectSpread({}, css), (0, _platformFeatureFlags.fg)('platform.design-system-team.select-new-typography_7m89c') ? {
20
- font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
21
- } : {
22
- fontFamily: "var(--ds-font-family-body, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
23
- }), {}, {
18
+ return _objectSpread(_objectSpread({}, css), {}, {
19
+ font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
24
20
  // react-select disables pointer events when isDisabled is true.
25
21
  // We override this and make the inner container turn it off instead.
26
22
  pointerEvents: 'all',
@@ -200,8 +196,6 @@ function baseStyles(validationState) {
200
196
  var isDisabled = _ref6.isDisabled;
201
197
  return _objectSpread(_objectSpread({}, css), {}, {
202
198
  color: isDisabled ? "var(--ds-text-disabled, ".concat(_colors.N70, ")") : "var(--ds-text, ".concat(_colors.N800, ")")
203
- }, !(0, _platformFeatureFlags.fg)('platform.design-system-team.select-new-typography_7m89c') && {
204
- lineHeight: '1rem'
205
199
  });
206
200
  },
207
201
  menu: function menu(css) {
@@ -246,9 +240,8 @@ function baseStyles(validationState) {
246
240
  },
247
241
  multiValueLabel: function multiValueLabel(css, _ref8) {
248
242
  var isDisabled = _ref8.isDisabled;
249
- return _objectSpread(_objectSpread(_objectSpread({}, css), (0, _platformFeatureFlags.fg)('platform.design-system-team.select-new-typography_7m89c') && {
250
- font: "var(--ds-font-body-UNSAFE_small, normal 400 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
251
- }), {}, {
243
+ return _objectSpread(_objectSpread({}, css), {}, {
244
+ font: "var(--ds-font-body-UNSAFE_small, normal 400 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
252
245
  padding: "var(--ds-space-025, 2px)",
253
246
  color: isDisabled ? "var(--ds-text-disabled, ".concat(_colors.N70, ")") : 'inherit',
254
247
  paddingRight: "var(--ds-space-025, 2px)"
@@ -274,9 +267,8 @@ function baseStyles(validationState) {
274
267
  });
275
268
  },
276
269
  groupHeading: function groupHeading(css) {
277
- return _objectSpread(_objectSpread(_objectSpread({}, css), (0, _platformFeatureFlags.fg)('platform.design-system-team.select-new-typography_7m89c') && {
278
- font: "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
279
- }), {}, {
270
+ return _objectSpread(_objectSpread({}, css), {}, {
271
+ font: "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
280
272
  color: "var(--ds-text-subtle, ".concat(_colors.N200, ")")
281
273
  });
282
274
  }
@@ -149,7 +149,8 @@ export default class PopupSelect extends PureComponent {
149
149
  */
150
150
  _defineProperty(this, "open", options => {
151
151
  const {
152
- onOpen
152
+ onOpen,
153
+ onMenuOpen
153
154
  } = this.props;
154
155
  if (!(options !== null && options !== void 0 && options.controlOverride) && this.isOpenControlled) {
155
156
  // Prevent popup opening if it's open state is already being controlled
@@ -158,6 +159,9 @@ export default class PopupSelect extends PureComponent {
158
159
  if (onOpen) {
159
160
  onOpen();
160
161
  }
162
+ if (onMenuOpen && fg('platform-design-system-dsp-19701-no-node-resolver')) {
163
+ onMenuOpen();
164
+ }
161
165
  this.setState({
162
166
  isOpen: true
163
167
  });
@@ -184,7 +188,8 @@ export default class PopupSelect extends PureComponent {
184
188
  _defineProperty(this, "close", options => {
185
189
  var _this$unbindWindowKey;
186
190
  const {
187
- onClose
191
+ onClose,
192
+ onMenuClose
188
193
  } = this.props;
189
194
  if (!(options !== null && options !== void 0 && options.controlOverride) && this.isOpenControlled) {
190
195
  // Prevent popup closing if it's open state is already being controlled
@@ -193,6 +198,9 @@ export default class PopupSelect extends PureComponent {
193
198
  if (onClose) {
194
199
  onClose();
195
200
  }
201
+ if (onMenuClose && fg('platform-design-system-dsp-19701-no-node-resolver')) {
202
+ onMenuClose();
203
+ }
196
204
  this.setState({
197
205
  isOpen: false
198
206
  });
@@ -285,8 +293,14 @@ export default class PopupSelect extends PureComponent {
285
293
  placeholder,
286
294
  target,
287
295
  testId,
296
+ onMenuOpen,
297
+ onMenuClose,
288
298
  ...props
289
299
  } = this.props;
300
+ const menuHandlers = !fg('platform-design-system-dsp-19701-no-node-resolver') ? {
301
+ onMenuOpen,
302
+ onMenuClose
303
+ } : {};
290
304
  const {
291
305
  focusLockEnabled,
292
306
  isOpen,
@@ -368,7 +382,12 @@ export default class PopupSelect extends PureComponent {
368
382
  placement,
369
383
  ref,
370
384
  style
371
- }) => /*#__PURE__*/React.createElement(NodeResolver, {
385
+ }) =>
386
+ /*#__PURE__*/
387
+ // When the feature flag 'platform-design-system-dsp-19701-no-node-resolver' is enabled,
388
+ // we directly pass the ref to MenuDialog instead of wrapping it with NodeResolver.
389
+ React.createElement(ConditionalNodeResolverWrapper, {
390
+ hasNodeResolver: !fg('platform-design-system-dsp-19701-no-node-resolver'),
372
391
  innerRef: this.resolveMenuRef(ref)
373
392
  }, /*#__PURE__*/React.createElement(MenuDialog
374
393
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
@@ -378,7 +397,8 @@ export default class PopupSelect extends PureComponent {
378
397
  minWidth: minMenuWidth,
379
398
  maxWidth: maxMenuWidth,
380
399
  id: this.popperWrapperId,
381
- testId: testId
400
+ testId: testId,
401
+ ref: !fg('platform-design-system-dsp-19701-no-node-resolver') ? null : this.resolveMenuRef(ref)
382
402
  }, /*#__PURE__*/React.createElement(FocusLock, {
383
403
  disabled: !focusLockEnabled,
384
404
  returnFocus: true
@@ -391,7 +411,7 @@ export default class PopupSelect extends PureComponent {
391
411
  menuIsOpen: true,
392
412
  placeholder: placeholder,
393
413
  ref: this.getSelectRef
394
- }, props, {
414
+ }, props, menuHandlers, {
395
415
  isSearchable: showSearchControl
396
416
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
397
417
  ,
@@ -501,4 +521,26 @@ _defineProperty(PopupSelect, "defaultProps", {
501
521
  searchThreshold: 5,
502
522
  styles: {},
503
523
  options: []
504
- });
524
+ });
525
+ /**
526
+ * A wrapper component that conditionally applies a NodeResolver to its children.
527
+ *
528
+ * Note: NodeResolver should not be used in React 18 concurrent mode. This component
529
+ * is intended to be removed once the feature flag is removed.
530
+ * @param {boolean} props.hasNodeResolver - Determines whether to apply the NodeResolver.
531
+ * @param {ReactElement} props.children - The child elements to be wrapped.
532
+ * @param {(instance: HTMLDivElement) => void} props.innerRef - A ref callback to get the instance of the HTMLDivElement.
533
+ * @returns {ReactElement} The children wrapped with NodeResolver if hasNodeResolver is true, otherwise just the children.
534
+ */
535
+ const ConditionalNodeResolverWrapper = ({
536
+ hasNodeResolver,
537
+ children,
538
+ innerRef
539
+ }) => {
540
+ if (hasNodeResolver) {
541
+ return /*#__PURE__*/React.createElement(NodeResolver, {
542
+ innerRef: innerRef
543
+ }, children);
544
+ }
545
+ return children;
546
+ };
@@ -3,6 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
  * @jsxRuntime classic
4
4
  * @jsx jsx
5
5
  */
6
+ import { forwardRef } from 'react';
6
7
 
7
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
9
  import { css, jsx } from '@emotion/react';
@@ -28,14 +29,15 @@ const menuDialogStyles = css({
28
29
  * Wrapper for PopupSelect component.
29
30
  *
30
31
  */
31
- export const MenuDialog = ({
32
+ export const MenuDialog = /*#__PURE__*/forwardRef(({
32
33
  maxWidth,
33
34
  minWidth,
34
35
  children,
35
36
  id,
36
37
  style,
37
38
  testId
38
- }) => jsx("div", {
39
+ }, ref) => jsx("div", {
40
+ ref: ref,
39
41
  css: [menuDialogStyles,
40
42
  // There is not a limited amount of values for the widths, so they need
41
43
  // to remain dynamic.
@@ -49,7 +51,7 @@ export const MenuDialog = ({
49
51
  style: style,
50
52
  id: id,
51
53
  "data-testid": testId && `${testId}--menu`
52
- }, children);
54
+ }, children));
53
55
 
54
56
  // ==============================
55
57
  // Custom Components
@@ -2,7 +2,7 @@ import ReactSelect from 'react-select';
2
2
  import { withAnalyticsEvents, withAnalyticsContext, createAndFireEvent } from '@atlaskit/analytics-next';
3
3
  import createSelect from './createSelect';
4
4
  const packageName = "@atlaskit/select";
5
- const packageVersion = "17.13.1";
5
+ const packageVersion = "17.14.0";
6
6
  export const SelectWithoutAnalytics = createSelect(ReactSelect);
7
7
  const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
8
8
  const Select = withAnalyticsContext({
@@ -1,4 +1,3 @@
1
- import { fg } from '@atlaskit/platform-feature-flags';
2
1
  import { B100, B400, B50, G400, N0, N100, N20, N200, N30, N300, N40, N500, N70, N800, R400, R75 } from '@atlaskit/theme/colors';
3
2
  export default function baseStyles(validationState, isCompact = false, appearance) {
4
3
  return {
@@ -6,11 +5,7 @@ export default function baseStyles(validationState, isCompact = false, appearanc
6
5
  isDisabled
7
6
  }) => ({
8
7
  ...css,
9
- ...(fg('platform.design-system-team.select-new-typography_7m89c') ? {
10
- font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
11
- } : {
12
- fontFamily: "var(--ds-font-family-body, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
13
- }),
8
+ font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
14
9
  // react-select disables pointer events when isDisabled is true.
15
10
  // We override this and make the inner container turn it off instead.
16
11
  pointerEvents: 'all',
@@ -191,10 +186,7 @@ export default function baseStyles(validationState, isCompact = false, appearanc
191
186
  isDisabled
192
187
  }) => ({
193
188
  ...css,
194
- color: isDisabled ? `var(--ds-text-disabled, ${N70})` : `var(--ds-text, ${N800})`,
195
- ...(!fg('platform.design-system-team.select-new-typography_7m89c') && {
196
- lineHeight: '1rem'
197
- })
189
+ color: isDisabled ? `var(--ds-text-disabled, ${N70})` : `var(--ds-text, ${N800})`
198
190
  }),
199
191
  menu: css => ({
200
192
  ...css,
@@ -240,9 +232,7 @@ export default function baseStyles(validationState, isCompact = false, appearanc
240
232
  isDisabled
241
233
  }) => ({
242
234
  ...css,
243
- ...(fg('platform.design-system-team.select-new-typography_7m89c') && {
244
- font: "var(--ds-font-body-UNSAFE_small, normal 400 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
245
- }),
235
+ font: "var(--ds-font-body-UNSAFE_small, normal 400 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
246
236
  padding: "var(--ds-space-025, 2px)",
247
237
  color: isDisabled ? `var(--ds-text-disabled, ${N70})` : 'inherit',
248
238
  paddingRight: "var(--ds-space-025, 2px)"
@@ -268,9 +258,7 @@ export default function baseStyles(validationState, isCompact = false, appearanc
268
258
  }),
269
259
  groupHeading: css => ({
270
260
  ...css,
271
- ...(fg('platform.design-system-team.select-new-typography_7m89c') && {
272
- font: "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
273
- }),
261
+ font: "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
274
262
  color: `var(--ds-text-subtle, ${N200})`
275
263
  })
276
264
  };
@@ -7,7 +7,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
7
7
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
8
8
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
9
9
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
10
- var _excluded = ["footer", "label", "maxMenuWidth", "minMenuWidth", "placeholder", "target", "testId"];
10
+ var _excluded = ["footer", "label", "maxMenuWidth", "minMenuWidth", "placeholder", "target", "testId", "onMenuOpen", "onMenuClose"];
11
11
  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; }
12
12
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13
13
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -168,7 +168,9 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
168
168
  * @param options.controlOverride - Force the popup to open when it's open state is being controlled
169
169
  */
170
170
  _defineProperty(_assertThisInitialized(_this), "open", function (options) {
171
- var onOpen = _this.props.onOpen;
171
+ var _this$props2 = _this.props,
172
+ onOpen = _this$props2.onOpen,
173
+ onMenuOpen = _this$props2.onMenuOpen;
172
174
  if (!(options !== null && options !== void 0 && options.controlOverride) && _this.isOpenControlled) {
173
175
  // Prevent popup opening if it's open state is already being controlled
174
176
  return;
@@ -176,6 +178,9 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
176
178
  if (onOpen) {
177
179
  onOpen();
178
180
  }
181
+ if (onMenuOpen && fg('platform-design-system-dsp-19701-no-node-resolver')) {
182
+ onMenuOpen();
183
+ }
179
184
  _this.setState({
180
185
  isOpen: true
181
186
  });
@@ -201,7 +206,9 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
201
206
  */
202
207
  _defineProperty(_assertThisInitialized(_this), "close", function (options) {
203
208
  var _this$unbindWindowKey, _this2;
204
- var onClose = _this.props.onClose;
209
+ var _this$props3 = _this.props,
210
+ onClose = _this$props3.onClose,
211
+ onMenuClose = _this$props3.onMenuClose;
205
212
  if (!(options !== null && options !== void 0 && options.controlOverride) && _this.isOpenControlled) {
206
213
  // Prevent popup closing if it's open state is already being controlled
207
214
  return;
@@ -209,6 +216,9 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
209
216
  if (onClose) {
210
217
  onClose();
211
218
  }
219
+ if (onMenuClose && fg('platform-design-system-dsp-19701-no-node-resolver')) {
220
+ onMenuClose();
221
+ }
212
222
  _this.setState({
213
223
  isOpen: false
214
224
  });
@@ -286,23 +296,29 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
286
296
  });
287
297
  // if the threshold is exceeded, AND isSearchable is true, then display the search control
288
298
  _defineProperty(_assertThisInitialized(_this), "showSearchControl", function () {
289
- var _this$props2 = _this.props,
290
- searchThreshold = _this$props2.searchThreshold,
291
- isSearchable = _this$props2.isSearchable;
299
+ var _this$props4 = _this.props,
300
+ searchThreshold = _this$props4.searchThreshold,
301
+ isSearchable = _this$props4.isSearchable;
292
302
  return isSearchable && _this.getItemCount() > searchThreshold;
293
303
  });
294
304
  // Renderers
295
305
  // ==============================
296
306
  _defineProperty(_assertThisInitialized(_this), "renderSelect", function () {
297
- var _this$props3 = _this.props,
298
- footer = _this$props3.footer,
299
- label = _this$props3.label,
300
- maxMenuWidth = _this$props3.maxMenuWidth,
301
- minMenuWidth = _this$props3.minMenuWidth,
302
- placeholder = _this$props3.placeholder,
303
- target = _this$props3.target,
304
- testId = _this$props3.testId,
305
- props = _objectWithoutProperties(_this$props3, _excluded);
307
+ var _this$props5 = _this.props,
308
+ footer = _this$props5.footer,
309
+ label = _this$props5.label,
310
+ maxMenuWidth = _this$props5.maxMenuWidth,
311
+ minMenuWidth = _this$props5.minMenuWidth,
312
+ placeholder = _this$props5.placeholder,
313
+ target = _this$props5.target,
314
+ testId = _this$props5.testId,
315
+ onMenuOpen = _this$props5.onMenuOpen,
316
+ onMenuClose = _this$props5.onMenuClose,
317
+ props = _objectWithoutProperties(_this$props5, _excluded);
318
+ var menuHandlers = !fg('platform-design-system-dsp-19701-no-node-resolver') ? {
319
+ onMenuOpen: onMenuOpen,
320
+ onMenuClose: onMenuClose
321
+ } : {};
306
322
  var _this$state = _this.state,
307
323
  focusLockEnabled = _this$state.focusLockEnabled,
308
324
  isOpen = _this$state.isOpen,
@@ -379,42 +395,49 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
379
395
  var placement = _ref2.placement,
380
396
  ref = _ref2.ref,
381
397
  style = _ref2.style;
382
- return /*#__PURE__*/React.createElement(NodeResolver, {
383
- innerRef: _this.resolveMenuRef(ref)
384
- }, /*#__PURE__*/React.createElement(MenuDialog
385
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
386
- , {
387
- style: style,
388
- "data-placement": placement,
389
- minWidth: minMenuWidth,
390
- maxWidth: maxMenuWidth,
391
- id: _this.popperWrapperId,
392
- testId: testId
393
- }, /*#__PURE__*/React.createElement(FocusLock, {
394
- disabled: !focusLockEnabled,
395
- returnFocus: true
396
- }, /*#__PURE__*/React.createElement(InternalSelect, _extends({
397
- "aria-label": providedAriaLabel,
398
- backspaceRemovesValue: false,
399
- controlShouldRenderValue: false,
400
- isClearable: false,
401
- tabSelectsValue: false,
402
- menuIsOpen: true,
403
- placeholder: placeholder,
404
- ref: _this.getSelectRef
405
- }, props, {
406
- isSearchable: showSearchControl
407
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
408
- ,
409
- styles: mergeStyles(_this.defaultStyles, props.styles || {}),
410
- maxMenuHeight: _this.getMaxHeight(),
411
- components: selectComponents,
412
- onChange: _this.handleSelectChange,
413
- ariaLiveMessages: !showSearchControl ? _objectSpread({
414
- // Overwriting ariaLiveMessages builtin onFocus method to announce selected option when popup has been opened
415
- onFocus: onReactSelectFocus
416
- }, props.ariaLiveMessages) : props.ariaLiveMessages
417
- })), footer)));
398
+ return (
399
+ /*#__PURE__*/
400
+ // When the feature flag 'platform-design-system-dsp-19701-no-node-resolver' is enabled,
401
+ // we directly pass the ref to MenuDialog instead of wrapping it with NodeResolver.
402
+ React.createElement(ConditionalNodeResolverWrapper, {
403
+ hasNodeResolver: !fg('platform-design-system-dsp-19701-no-node-resolver'),
404
+ innerRef: _this.resolveMenuRef(ref)
405
+ }, /*#__PURE__*/React.createElement(MenuDialog
406
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
407
+ , {
408
+ style: style,
409
+ "data-placement": placement,
410
+ minWidth: minMenuWidth,
411
+ maxWidth: maxMenuWidth,
412
+ id: _this.popperWrapperId,
413
+ testId: testId,
414
+ ref: !fg('platform-design-system-dsp-19701-no-node-resolver') ? null : _this.resolveMenuRef(ref)
415
+ }, /*#__PURE__*/React.createElement(FocusLock, {
416
+ disabled: !focusLockEnabled,
417
+ returnFocus: true
418
+ }, /*#__PURE__*/React.createElement(InternalSelect, _extends({
419
+ "aria-label": providedAriaLabel,
420
+ backspaceRemovesValue: false,
421
+ controlShouldRenderValue: false,
422
+ isClearable: false,
423
+ tabSelectsValue: false,
424
+ menuIsOpen: true,
425
+ placeholder: placeholder,
426
+ ref: _this.getSelectRef
427
+ }, props, menuHandlers, {
428
+ isSearchable: showSearchControl
429
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
430
+ ,
431
+ styles: mergeStyles(_this.defaultStyles, props.styles || {}),
432
+ maxMenuHeight: _this.getMaxHeight(),
433
+ components: selectComponents,
434
+ onChange: _this.handleSelectChange,
435
+ ariaLiveMessages: !showSearchControl ? _objectSpread({
436
+ // Overwriting ariaLiveMessages builtin onFocus method to announce selected option when popup has been opened
437
+ onFocus: onReactSelectFocus
438
+ }, props.ariaLiveMessages) : props.ariaLiveMessages
439
+ })), footer)))
440
+ );
418
441
  });
419
442
  return mergedPopperProps.strategy === 'fixed' ? popper : /*#__PURE__*/createPortal(popper, portalDestination);
420
443
  });
@@ -516,4 +539,25 @@ _defineProperty(PopupSelect, "defaultProps", {
516
539
  styles: {},
517
540
  options: []
518
541
  });
519
- export { PopupSelect as default };
542
+ export { PopupSelect as default };
543
+ /**
544
+ * A wrapper component that conditionally applies a NodeResolver to its children.
545
+ *
546
+ * Note: NodeResolver should not be used in React 18 concurrent mode. This component
547
+ * is intended to be removed once the feature flag is removed.
548
+ * @param {boolean} props.hasNodeResolver - Determines whether to apply the NodeResolver.
549
+ * @param {ReactElement} props.children - The child elements to be wrapped.
550
+ * @param {(instance: HTMLDivElement) => void} props.innerRef - A ref callback to get the instance of the HTMLDivElement.
551
+ * @returns {ReactElement} The children wrapped with NodeResolver if hasNodeResolver is true, otherwise just the children.
552
+ */
553
+ var ConditionalNodeResolverWrapper = function ConditionalNodeResolverWrapper(_ref4) {
554
+ var hasNodeResolver = _ref4.hasNodeResolver,
555
+ children = _ref4.children,
556
+ innerRef = _ref4.innerRef;
557
+ if (hasNodeResolver) {
558
+ return /*#__PURE__*/React.createElement(NodeResolver, {
559
+ innerRef: innerRef
560
+ }, children);
561
+ }
562
+ return children;
563
+ };
@@ -5,6 +5,7 @@ var _excluded = ["innerRef", "innerProps"];
5
5
  * @jsxRuntime classic
6
6
  * @jsx jsx
7
7
  */
8
+ import { forwardRef } from 'react';
8
9
 
9
10
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
11
  import { css, jsx } from '@emotion/react';
@@ -30,7 +31,7 @@ var menuDialogStyles = css({
30
31
  * Wrapper for PopupSelect component.
31
32
  *
32
33
  */
33
- export var MenuDialog = function MenuDialog(_ref) {
34
+ export var MenuDialog = /*#__PURE__*/forwardRef(function (_ref, ref) {
34
35
  var maxWidth = _ref.maxWidth,
35
36
  minWidth = _ref.minWidth,
36
37
  children = _ref.children,
@@ -38,6 +39,7 @@ export var MenuDialog = function MenuDialog(_ref) {
38
39
  style = _ref.style,
39
40
  testId = _ref.testId;
40
41
  return jsx("div", {
42
+ ref: ref,
41
43
  css: [menuDialogStyles,
42
44
  // There is not a limited amount of values for the widths, so they need
43
45
  // to remain dynamic.
@@ -52,7 +54,7 @@ export var MenuDialog = function MenuDialog(_ref) {
52
54
  id: id,
53
55
  "data-testid": testId && "".concat(testId, "--menu")
54
56
  }, children);
55
- };
57
+ });
56
58
 
57
59
  // ==============================
58
60
  // Custom Components
@@ -2,7 +2,7 @@ import ReactSelect from 'react-select';
2
2
  import { withAnalyticsEvents, withAnalyticsContext, createAndFireEvent } from '@atlaskit/analytics-next';
3
3
  import createSelect from './createSelect';
4
4
  var packageName = "@atlaskit/select";
5
- var packageVersion = "17.13.1";
5
+ var packageVersion = "17.14.0";
6
6
  export var SelectWithoutAnalytics = createSelect(ReactSelect);
7
7
  var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
8
8
  var Select = withAnalyticsContext({
@@ -1,7 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
- import { fg } from '@atlaskit/platform-feature-flags';
5
4
  import { B100, B400, B50, G400, N0, N100, N20, N200, N30, N300, N40, N500, N70, N800, R400, R75 } from '@atlaskit/theme/colors';
6
5
  export default function baseStyles(validationState) {
7
6
  var isCompact = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
@@ -9,11 +8,8 @@ export default function baseStyles(validationState) {
9
8
  return {
10
9
  container: function container(css, _ref) {
11
10
  var isDisabled = _ref.isDisabled;
12
- return _objectSpread(_objectSpread(_objectSpread({}, css), fg('platform.design-system-team.select-new-typography_7m89c') ? {
13
- font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
14
- } : {
15
- fontFamily: "var(--ds-font-family-body, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
16
- }), {}, {
11
+ return _objectSpread(_objectSpread({}, css), {}, {
12
+ font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
17
13
  // react-select disables pointer events when isDisabled is true.
18
14
  // We override this and make the inner container turn it off instead.
19
15
  pointerEvents: 'all',
@@ -193,8 +189,6 @@ export default function baseStyles(validationState) {
193
189
  var isDisabled = _ref6.isDisabled;
194
190
  return _objectSpread(_objectSpread({}, css), {}, {
195
191
  color: isDisabled ? "var(--ds-text-disabled, ".concat(N70, ")") : "var(--ds-text, ".concat(N800, ")")
196
- }, !fg('platform.design-system-team.select-new-typography_7m89c') && {
197
- lineHeight: '1rem'
198
192
  });
199
193
  },
200
194
  menu: function menu(css) {
@@ -239,9 +233,8 @@ export default function baseStyles(validationState) {
239
233
  },
240
234
  multiValueLabel: function multiValueLabel(css, _ref8) {
241
235
  var isDisabled = _ref8.isDisabled;
242
- return _objectSpread(_objectSpread(_objectSpread({}, css), fg('platform.design-system-team.select-new-typography_7m89c') && {
243
- font: "var(--ds-font-body-UNSAFE_small, normal 400 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
244
- }), {}, {
236
+ return _objectSpread(_objectSpread({}, css), {}, {
237
+ font: "var(--ds-font-body-UNSAFE_small, normal 400 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
245
238
  padding: "var(--ds-space-025, 2px)",
246
239
  color: isDisabled ? "var(--ds-text-disabled, ".concat(N70, ")") : 'inherit',
247
240
  paddingRight: "var(--ds-space-025, 2px)"
@@ -267,9 +260,8 @@ export default function baseStyles(validationState) {
267
260
  });
268
261
  },
269
262
  groupHeading: function groupHeading(css) {
270
- return _objectSpread(_objectSpread(_objectSpread({}, css), fg('platform.design-system-team.select-new-typography_7m89c') && {
271
- font: "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
272
- }), {}, {
263
+ return _objectSpread(_objectSpread({}, css), {}, {
264
+ font: "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
273
265
  color: "var(--ds-text-subtle, ".concat(N200, ")")
274
266
  });
275
267
  }
@@ -150,7 +150,7 @@ export default class PopupSelect<Option = OptionType, IsMulti extends boolean =
150
150
  controlOverride?: boolean;
151
151
  }) => void;
152
152
  resolveTargetRef: (popperRef: React.Ref<HTMLElement>) => (ref: HTMLElement) => void;
153
- resolveMenuRef: (popperRef: React.Ref<HTMLElement>) => (ref: HTMLElement) => void;
153
+ resolveMenuRef: (popperRef: React.Ref<HTMLElement>) => (ref: HTMLDivElement) => void;
154
154
  getSelectRef: (ref: AtlaskitSelectRefType) => void;
155
155
  getItemCount: () => number;
156
156
  getMaxHeight: () => number | undefined;
@@ -18,7 +18,7 @@ interface MenuDialogProps {
18
18
  * Wrapper for PopupSelect component.
19
19
  *
20
20
  */
21
- export declare const MenuDialog: FC<MenuDialogProps>;
21
+ export declare const MenuDialog: import("react").ForwardRefExoticComponent<MenuDialogProps & import("react").RefAttributes<HTMLDivElement>>;
22
22
  /**
23
23
  * __Dummy control__
24
24
  *
@@ -150,7 +150,7 @@ export default class PopupSelect<Option = OptionType, IsMulti extends boolean =
150
150
  controlOverride?: boolean;
151
151
  }) => void;
152
152
  resolveTargetRef: (popperRef: React.Ref<HTMLElement>) => (ref: HTMLElement) => void;
153
- resolveMenuRef: (popperRef: React.Ref<HTMLElement>) => (ref: HTMLElement) => void;
153
+ resolveMenuRef: (popperRef: React.Ref<HTMLElement>) => (ref: HTMLDivElement) => void;
154
154
  getSelectRef: (ref: AtlaskitSelectRefType) => void;
155
155
  getItemCount: () => number;
156
156
  getMaxHeight: () => number | undefined;
@@ -18,7 +18,7 @@ interface MenuDialogProps {
18
18
  * Wrapper for PopupSelect component.
19
19
  *
20
20
  */
21
- export declare const MenuDialog: FC<MenuDialogProps>;
21
+ export declare const MenuDialog: import("react").ForwardRefExoticComponent<MenuDialogProps & import("react").RefAttributes<HTMLDivElement>>;
22
22
  /**
23
23
  * __Dummy control__
24
24
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/select",
3
- "version": "17.13.1",
3
+ "version": "17.14.0",
4
4
  "description": "Select allows users to make a single selection or multiple selections from a list of options.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -32,7 +32,7 @@
32
32
  "name": "Select",
33
33
  "category": "Components"
34
34
  },
35
- "runReact18": true
35
+ "runReact18": false
36
36
  },
37
37
  "af:exports": {
38
38
  "./AsyncSelect": "./src/entry-points/async-select.tsx",
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@atlaskit/analytics-next": "^10.1.0",
46
- "@atlaskit/icon": "^22.12.0",
46
+ "@atlaskit/icon": "^22.13.0",
47
47
  "@atlaskit/platform-feature-flags": "^0.3.0",
48
48
  "@atlaskit/primitives": "^12.0.0",
49
49
  "@atlaskit/spinner": "^16.3.0",
@@ -107,7 +107,7 @@
107
107
  "platform.design-system-team.use-default-select-in-popup-select_46rmj": {
108
108
  "type": "boolean"
109
109
  },
110
- "platform.design-system-team.select-new-typography_7m89c": {
110
+ "platform-design-system-dsp-19701-no-node-resolver": {
111
111
  "type": "boolean"
112
112
  }
113
113
  },