@atlaskit/select 18.8.2 → 18.9.1

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 (44) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/codemods/18.3.0-select-props.tsx +0 -1
  3. package/codemods/__tests__/next-select-props.tsx +0 -7
  4. package/dist/cjs/CountrySelect.js +1 -0
  5. package/dist/cjs/PopupSelect/components.js +0 -4
  6. package/dist/cjs/Select.js +1 -1
  7. package/dist/cjs/createSelect.js +5 -36
  8. package/dist/es2019/CountrySelect.js +1 -0
  9. package/dist/es2019/PopupSelect/components.js +0 -2
  10. package/dist/es2019/Select.js +1 -1
  11. package/dist/es2019/createSelect.js +5 -35
  12. package/dist/esm/CountrySelect.js +1 -0
  13. package/dist/esm/PopupSelect/components.js +0 -4
  14. package/dist/esm/Select.js +1 -1
  15. package/dist/esm/createSelect.js +6 -37
  16. package/dist/types/PopupSelect/PopupSelect.d.ts +0 -1
  17. package/dist/types/PopupSelect/components.d.ts +1 -2
  18. package/dist/types/index.d.ts +1 -1
  19. package/dist/types/types.d.ts +2 -2
  20. package/dist/types-ts4.5/PopupSelect/PopupSelect.d.ts +0 -1
  21. package/dist/types-ts4.5/PopupSelect/components.d.ts +1 -2
  22. package/dist/types-ts4.5/index.d.ts +1 -1
  23. package/dist/types-ts4.5/types.d.ts +2 -2
  24. package/package.json +5 -5
  25. package/dist/cjs/components/index.js +0 -96
  26. package/dist/cjs/components/indicators.js +0 -82
  27. package/dist/cjs/components/input-aria-describedby.js +0 -23
  28. package/dist/cjs/components/no-options.js +0 -18
  29. package/dist/es2019/components/index.js +0 -71
  30. package/dist/es2019/components/indicators.js +0 -68
  31. package/dist/es2019/components/input-aria-describedby.js +0 -16
  32. package/dist/es2019/components/no-options.js +0 -11
  33. package/dist/esm/components/index.js +0 -69
  34. package/dist/esm/components/indicators.js +0 -75
  35. package/dist/esm/components/input-aria-describedby.js +0 -16
  36. package/dist/esm/components/no-options.js +0 -11
  37. package/dist/types/components/index.d.ts +0 -15
  38. package/dist/types/components/indicators.d.ts +0 -9
  39. package/dist/types/components/input-aria-describedby.d.ts +0 -4
  40. package/dist/types/components/no-options.d.ts +0 -6
  41. package/dist/types-ts4.5/components/index.d.ts +0 -15
  42. package/dist/types-ts4.5/components/indicators.d.ts +0 -9
  43. package/dist/types-ts4.5/components/input-aria-describedby.d.ts +0 -4
  44. package/dist/types-ts4.5/components/no-options.d.ts +0 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlaskit/select
2
2
 
3
+ ## 18.9.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 18.9.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#177875](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/177875)
14
+ [`d0c3d27216b7c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d0c3d27216b7c) -
15
+ Remove theme prop and merge customized components for performance
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 18.8.2
4
22
 
5
23
  ### Patch Changes
@@ -64,7 +64,6 @@ function updateSelectProps(j: core.JSCodeshift, source: ReturnType<typeof j>, va
64
64
  'isRTL',
65
65
  'menuShouldBlockScroll',
66
66
  'screenReaderStatus',
67
- 'theme',
68
67
  ];
69
68
 
70
69
  const propsToReplace = {
@@ -22,7 +22,6 @@ describe('Update Select props', () => {
22
22
  isRTL={true}
23
23
  menuShouldBlockScroll={true}
24
24
  screenReaderStatus={''}
25
- theme={{}}
26
25
  />
27
26
  );
28
27
  };
@@ -54,7 +53,6 @@ describe('Update Select props', () => {
54
53
  isRTL={true}
55
54
  menuShouldBlockScroll={true}
56
55
  screenReaderStatus={''}
57
- theme={{}}
58
56
  />
59
57
  );
60
58
  };
@@ -73,7 +71,6 @@ describe('Update Select props', () => {
73
71
  isRTL={true}
74
72
  menuShouldBlockScroll={true}
75
73
  screenReaderStatus={''}
76
- theme={{}}
77
74
  />
78
75
  );
79
76
  };
@@ -108,7 +105,6 @@ describe('Update Select props', () => {
108
105
  isRTL={true}
109
106
  menuShouldBlockScroll={true}
110
107
  screenReaderStatus={''}
111
- theme={{}}
112
108
  />
113
109
  );
114
110
  };
@@ -247,7 +243,6 @@ describe('Update Select props', () => {
247
243
  isRTL={true}
248
244
  menuShouldBlockScroll={true}
249
245
  screenReaderStatus={''}
250
- theme={{}}
251
246
  />
252
247
  );
253
248
  };
@@ -264,7 +259,6 @@ describe('Update Select props', () => {
264
259
  isRTL={true}
265
260
  menuShouldBlockScroll={true}
266
261
  screenReaderStatus={''}
267
- theme={{}}
268
262
  />
269
263
  );
270
264
  };
@@ -289,7 +283,6 @@ describe('Update Select props', () => {
289
283
  isRTL={true}
290
284
  menuShouldBlockScroll={true}
291
285
  screenReaderStatus={''}
292
- theme={{}}
293
286
  />
294
287
  );
295
288
  };
@@ -21,6 +21,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
21
21
  var labelStyles = (0, _react.css)({
22
22
  display: 'flex',
23
23
  alignItems: 'center',
24
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
24
25
  lineHeight: 1.2
25
26
  });
26
27
  var flagStyles = (0, _react.css)({
@@ -108,9 +108,6 @@ var Menu = function Menu(_ref3) {
108
108
  innerProps = _ref3.innerProps;
109
109
  return (0, _react2.jsx)("div", innerProps, children);
110
110
  };
111
- var IndicatorSeparator = function IndicatorSeparator(props) {
112
- return (0, _react2.jsx)(_reactSelect.components.IndicatorSeparator, props);
113
- };
114
111
  var ClearIndicator = function ClearIndicator(props) {
115
112
  return (0, _react2.jsx)(_reactSelect.components.ClearIndicator, props);
116
113
  };
@@ -121,7 +118,6 @@ var defaultComponents = exports.defaultComponents = {
121
118
  Control: Control,
122
119
  DropdownIndicator: DropdownIndicator,
123
120
  Menu: Menu,
124
- IndicatorSeparator: IndicatorSeparator,
125
121
  ClearIndicator: ClearIndicator,
126
122
  MultiValueRemove: MultiValueRemove
127
123
  };
@@ -11,7 +11,7 @@ var _createSelect = _interopRequireDefault(require("./createSelect"));
11
11
  /* eslint-disable @repo/internal/react/require-jsdoc */
12
12
 
13
13
  var packageName = "@atlaskit/select";
14
- var packageVersion = "18.8.2";
14
+ var packageVersion = "18.9.1";
15
15
  var SelectWithoutAnalytics = exports.SelectWithoutAnalytics = (0, _createSelect.default)(_async.default);
16
16
  var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
17
17
  var Select = (0, _analyticsNext.withAnalyticsContext)({
@@ -11,11 +11,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
11
11
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
12
12
  var _react = _interopRequireWildcard(require("react"));
13
13
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
- var _components = require("./components");
15
- var _inputAriaDescribedby = require("./components/input-aria-describedby");
16
- var _noOptions = require("./components/no-options");
17
14
  var _groupedOptionsAnnouncement = require("./utils/grouped-options-announcement");
18
- var _excluded = ["ariaLiveMessages", "components", "isInvalid", "onClickPreventDefault", "tabSelectsValue", "validationState"];
15
+ var _excluded = ["ariaLiveMessages", "isInvalid", "onClickPreventDefault", "tabSelectsValue", "validationState"];
19
16
  /* eslint-disable @atlaskit/platform/ensure-feature-flag-prefix */
20
17
  // eslint-disable-next-line @repo/internal/fs/filename-pattern-match
21
18
  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); }
@@ -25,7 +22,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
25
22
  function createSelect(WrappedComponent) {
26
23
  var AtlaskitSelect = /*#__PURE__*/(0, _react.forwardRef)(function AtlaskitSelect(props, forwardedRef) {
27
24
  var ariaLiveMessages = props.ariaLiveMessages,
28
- componentsProp = props.components,
29
25
  isInvalid = props.isInvalid,
30
26
  _props$onClickPrevent = props.onClickPreventDefault,
31
27
  onClickPreventDefault = _props$onClickPrevent === void 0 ? true : _props$onClickPrevent,
@@ -35,31 +31,6 @@ function createSelect(WrappedComponent) {
35
31
  validationState = _props$validationStat === void 0 ? 'default' : _props$validationStat,
36
32
  restProps = (0, _objectWithoutProperties2.default)(props, _excluded);
37
33
  var internalSelectRef = (0, _react.useRef)(null);
38
- var components = (0, _react.useMemo)(function () {
39
- return _objectSpread({
40
- ClearIndicator: _components.ClearIndicator,
41
- DropdownIndicator: _components.DropdownIndicator,
42
- LoadingIndicator: _components.LoadingIndicator,
43
- MultiValueRemove: _components.MultiValueRemove,
44
- IndicatorSeparator: _components.IndicatorSeparator,
45
- Input: _inputAriaDescribedby.Input,
46
- NoOptionsMessage: _noOptions.NoOptionsMessage
47
- }, componentsProp);
48
- }, [componentsProp]);
49
- var descriptionId = props['aria-describedby'] || props['descriptionId'];
50
- var isSearchable = props.isSearchable;
51
- (0, _react.useEffect)(function () {
52
- if (!isSearchable && descriptionId) {
53
- var _internalSelectRef$cu;
54
- // when isSearchable is false, react-select will create its own dummy input instead of using ours,
55
- // so we need to manually add the additional aria-describedby using ref.
56
- var input = (_internalSelectRef$cu = internalSelectRef.current) === null || _internalSelectRef$cu === void 0 ? void 0 : _internalSelectRef$cu.inputRef;
57
- var ariaDescribedby = input === null || input === void 0 ? void 0 : input.getAttribute('aria-describedby');
58
- if (!(ariaDescribedby !== null && ariaDescribedby !== void 0 && ariaDescribedby.includes(descriptionId))) {
59
- input === null || input === void 0 || input.setAttribute('aria-describedby', "".concat(ariaDescribedby, " ").concat(descriptionId));
60
- }
61
- }
62
- }, [descriptionId, isSearchable]);
63
34
 
64
35
  /**
65
36
  * The following `useImperativeHandle` hook exists for the sake of backwards compatibility.
@@ -72,12 +43,12 @@ function createSelect(WrappedComponent) {
72
43
  return {
73
44
  select: internalSelectRef.current,
74
45
  focus: function focus() {
75
- var _internalSelectRef$cu2;
76
- return (_internalSelectRef$cu2 = internalSelectRef.current) === null || _internalSelectRef$cu2 === void 0 ? void 0 : _internalSelectRef$cu2.focus();
46
+ var _internalSelectRef$cu;
47
+ return (_internalSelectRef$cu = internalSelectRef.current) === null || _internalSelectRef$cu === void 0 ? void 0 : _internalSelectRef$cu.focus();
77
48
  },
78
49
  blur: function blur() {
79
- var _internalSelectRef$cu3;
80
- return (_internalSelectRef$cu3 = internalSelectRef.current) === null || _internalSelectRef$cu3 === void 0 ? void 0 : _internalSelectRef$cu3.blur();
50
+ var _internalSelectRef$cu2;
51
+ return (_internalSelectRef$cu2 = internalSelectRef.current) === null || _internalSelectRef$cu2 === void 0 ? void 0 : _internalSelectRef$cu2.blur();
81
52
  }
82
53
  };
83
54
  }, []);
@@ -96,10 +67,8 @@ function createSelect(WrappedComponent) {
96
67
  onClickPreventDefault: onClickPreventDefault,
97
68
  isInvalid: isInvalid || validationState === 'error'
98
69
  }, restProps, {
99
- components: components
100
70
  // indicates react-select to be async by default using the base Select component
101
71
  // so that makers can pass all async props on the base select to async load options.
102
- ,
103
72
  isAsync: true
104
73
  }));
105
74
  });
@@ -15,6 +15,7 @@ import { isCountryOptionsGrouped, onCountryOptionFocus } from './utils/country-g
15
15
  const labelStyles = css({
16
16
  display: 'flex',
17
17
  alignItems: 'center',
18
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
18
19
  lineHeight: 1.2
19
20
  });
20
21
  const flagStyles = css({
@@ -94,14 +94,12 @@ const Menu = ({
94
94
  children,
95
95
  innerProps
96
96
  }) => jsx("div", innerProps, children);
97
- const IndicatorSeparator = props => jsx(components.IndicatorSeparator, props);
98
97
  const ClearIndicator = props => jsx(components.ClearIndicator, props);
99
98
  const MultiValueRemove = props => jsx(components.MultiValueRemove, props);
100
99
  export const defaultComponents = {
101
100
  Control,
102
101
  DropdownIndicator,
103
102
  Menu,
104
- IndicatorSeparator,
105
103
  ClearIndicator,
106
104
  MultiValueRemove
107
105
  };
@@ -3,7 +3,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
3
3
  import AsyncSelect from '@atlaskit/react-select/async';
4
4
  import createSelect from './createSelect';
5
5
  const packageName = "@atlaskit/select";
6
- const packageVersion = "18.8.2";
6
+ const packageVersion = "18.9.1";
7
7
  export const SelectWithoutAnalytics = createSelect(AsyncSelect);
8
8
  const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
9
9
  const Select = withAnalyticsContext({
@@ -1,17 +1,13 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  /* eslint-disable @atlaskit/platform/ensure-feature-flag-prefix */
3
3
  // eslint-disable-next-line @repo/internal/fs/filename-pattern-match
4
- import React, { forwardRef, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
4
+ import React, { forwardRef, useImperativeHandle, useRef } from 'react';
5
5
  import { fg } from '@atlaskit/platform-feature-flags';
6
- import { ClearIndicator, DropdownIndicator, IndicatorSeparator, LoadingIndicator, MultiValueRemove } from './components';
7
- import { Input } from './components/input-aria-describedby';
8
- import { NoOptionsMessage } from './components/no-options';
9
6
  import { isOptionsGrouped, onFocus } from './utils/grouped-options-announcement';
10
7
  export default function createSelect(WrappedComponent) {
11
8
  const AtlaskitSelect = /*#__PURE__*/forwardRef(function AtlaskitSelect(props, forwardedRef) {
12
9
  const {
13
10
  ariaLiveMessages,
14
- components: componentsProp,
15
11
  isInvalid,
16
12
  // TODO: set to true when cleaning up validationState prop so it has a default value
17
13
  onClickPreventDefault = true,
@@ -20,30 +16,6 @@ export default function createSelect(WrappedComponent) {
20
16
  ...restProps
21
17
  } = props;
22
18
  const internalSelectRef = useRef(null);
23
- const components = useMemo(() => ({
24
- ClearIndicator,
25
- DropdownIndicator,
26
- LoadingIndicator,
27
- MultiValueRemove,
28
- IndicatorSeparator,
29
- Input,
30
- NoOptionsMessage,
31
- ...componentsProp
32
- }), [componentsProp]);
33
- const descriptionId = props['aria-describedby'] || props['descriptionId'];
34
- const isSearchable = props.isSearchable;
35
- useEffect(() => {
36
- if (!isSearchable && descriptionId) {
37
- var _internalSelectRef$cu;
38
- // when isSearchable is false, react-select will create its own dummy input instead of using ours,
39
- // so we need to manually add the additional aria-describedby using ref.
40
- const input = (_internalSelectRef$cu = internalSelectRef.current) === null || _internalSelectRef$cu === void 0 ? void 0 : _internalSelectRef$cu.inputRef;
41
- const ariaDescribedby = input === null || input === void 0 ? void 0 : input.getAttribute('aria-describedby');
42
- if (!(ariaDescribedby !== null && ariaDescribedby !== void 0 && ariaDescribedby.includes(descriptionId))) {
43
- input === null || input === void 0 ? void 0 : input.setAttribute('aria-describedby', `${ariaDescribedby} ${descriptionId}`);
44
- }
45
- }
46
- }, [descriptionId, isSearchable]);
47
19
 
48
20
  /**
49
21
  * The following `useImperativeHandle` hook exists for the sake of backwards compatibility.
@@ -55,12 +27,12 @@ export default function createSelect(WrappedComponent) {
55
27
  useImperativeHandle(forwardedRef, () => ({
56
28
  select: internalSelectRef.current,
57
29
  focus: () => {
58
- var _internalSelectRef$cu2;
59
- return (_internalSelectRef$cu2 = internalSelectRef.current) === null || _internalSelectRef$cu2 === void 0 ? void 0 : _internalSelectRef$cu2.focus();
30
+ var _internalSelectRef$cu;
31
+ return (_internalSelectRef$cu = internalSelectRef.current) === null || _internalSelectRef$cu === void 0 ? void 0 : _internalSelectRef$cu.focus();
60
32
  },
61
33
  blur: () => {
62
- var _internalSelectRef$cu3;
63
- return (_internalSelectRef$cu3 = internalSelectRef.current) === null || _internalSelectRef$cu3 === void 0 ? void 0 : _internalSelectRef$cu3.blur();
34
+ var _internalSelectRef$cu2;
35
+ return (_internalSelectRef$cu2 = internalSelectRef.current) === null || _internalSelectRef$cu2 === void 0 ? void 0 : _internalSelectRef$cu2.blur();
64
36
  }
65
37
  }), []);
66
38
  return /*#__PURE__*/React.createElement(WrappedComponent, _extends({
@@ -79,10 +51,8 @@ export default function createSelect(WrappedComponent) {
79
51
  onClickPreventDefault: onClickPreventDefault,
80
52
  isInvalid: isInvalid || validationState === 'error'
81
53
  }, restProps, {
82
- components: components
83
54
  // indicates react-select to be async by default using the base Select component
84
55
  // so that makers can pass all async props on the base select to async load options.
85
- ,
86
56
  isAsync: true
87
57
  }));
88
58
  });
@@ -18,6 +18,7 @@ import { isCountryOptionsGrouped, onCountryOptionFocus } from './utils/country-g
18
18
  var labelStyles = css({
19
19
  display: 'flex',
20
20
  alignItems: 'center',
21
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
21
22
  lineHeight: 1.2
22
23
  });
23
24
  var flagStyles = css({
@@ -103,9 +103,6 @@ var Menu = function Menu(_ref3) {
103
103
  innerProps = _ref3.innerProps;
104
104
  return jsx("div", innerProps, children);
105
105
  };
106
- var IndicatorSeparator = function IndicatorSeparator(props) {
107
- return jsx(components.IndicatorSeparator, props);
108
- };
109
106
  var ClearIndicator = function ClearIndicator(props) {
110
107
  return jsx(components.ClearIndicator, props);
111
108
  };
@@ -116,7 +113,6 @@ export var defaultComponents = {
116
113
  Control: Control,
117
114
  DropdownIndicator: DropdownIndicator,
118
115
  Menu: Menu,
119
- IndicatorSeparator: IndicatorSeparator,
120
116
  ClearIndicator: ClearIndicator,
121
117
  MultiValueRemove: MultiValueRemove
122
118
  };
@@ -3,7 +3,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
3
3
  import AsyncSelect from '@atlaskit/react-select/async';
4
4
  import createSelect from './createSelect';
5
5
  var packageName = "@atlaskit/select";
6
- var packageVersion = "18.8.2";
6
+ var packageVersion = "18.9.1";
7
7
  export var SelectWithoutAnalytics = createSelect(AsyncSelect);
8
8
  var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
9
9
  var Select = withAnalyticsContext({
@@ -1,21 +1,17 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["ariaLiveMessages", "components", "isInvalid", "onClickPreventDefault", "tabSelectsValue", "validationState"];
4
+ var _excluded = ["ariaLiveMessages", "isInvalid", "onClickPreventDefault", "tabSelectsValue", "validationState"];
5
5
  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; }
6
6
  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; }
7
7
  /* eslint-disable @atlaskit/platform/ensure-feature-flag-prefix */
8
8
  // eslint-disable-next-line @repo/internal/fs/filename-pattern-match
9
- import React, { forwardRef, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
9
+ import React, { forwardRef, useImperativeHandle, useRef } from 'react';
10
10
  import { fg } from '@atlaskit/platform-feature-flags';
11
- import { ClearIndicator, DropdownIndicator, IndicatorSeparator, LoadingIndicator, MultiValueRemove } from './components';
12
- import { Input } from './components/input-aria-describedby';
13
- import { NoOptionsMessage } from './components/no-options';
14
11
  import { isOptionsGrouped, onFocus as _onFocus } from './utils/grouped-options-announcement';
15
12
  export default function createSelect(WrappedComponent) {
16
13
  var AtlaskitSelect = /*#__PURE__*/forwardRef(function AtlaskitSelect(props, forwardedRef) {
17
14
  var ariaLiveMessages = props.ariaLiveMessages,
18
- componentsProp = props.components,
19
15
  isInvalid = props.isInvalid,
20
16
  _props$onClickPrevent = props.onClickPreventDefault,
21
17
  onClickPreventDefault = _props$onClickPrevent === void 0 ? true : _props$onClickPrevent,
@@ -25,31 +21,6 @@ export default function createSelect(WrappedComponent) {
25
21
  validationState = _props$validationStat === void 0 ? 'default' : _props$validationStat,
26
22
  restProps = _objectWithoutProperties(props, _excluded);
27
23
  var internalSelectRef = useRef(null);
28
- var components = useMemo(function () {
29
- return _objectSpread({
30
- ClearIndicator: ClearIndicator,
31
- DropdownIndicator: DropdownIndicator,
32
- LoadingIndicator: LoadingIndicator,
33
- MultiValueRemove: MultiValueRemove,
34
- IndicatorSeparator: IndicatorSeparator,
35
- Input: Input,
36
- NoOptionsMessage: NoOptionsMessage
37
- }, componentsProp);
38
- }, [componentsProp]);
39
- var descriptionId = props['aria-describedby'] || props['descriptionId'];
40
- var isSearchable = props.isSearchable;
41
- useEffect(function () {
42
- if (!isSearchable && descriptionId) {
43
- var _internalSelectRef$cu;
44
- // when isSearchable is false, react-select will create its own dummy input instead of using ours,
45
- // so we need to manually add the additional aria-describedby using ref.
46
- var input = (_internalSelectRef$cu = internalSelectRef.current) === null || _internalSelectRef$cu === void 0 ? void 0 : _internalSelectRef$cu.inputRef;
47
- var ariaDescribedby = input === null || input === void 0 ? void 0 : input.getAttribute('aria-describedby');
48
- if (!(ariaDescribedby !== null && ariaDescribedby !== void 0 && ariaDescribedby.includes(descriptionId))) {
49
- input === null || input === void 0 || input.setAttribute('aria-describedby', "".concat(ariaDescribedby, " ").concat(descriptionId));
50
- }
51
- }
52
- }, [descriptionId, isSearchable]);
53
24
 
54
25
  /**
55
26
  * The following `useImperativeHandle` hook exists for the sake of backwards compatibility.
@@ -62,12 +33,12 @@ export default function createSelect(WrappedComponent) {
62
33
  return {
63
34
  select: internalSelectRef.current,
64
35
  focus: function focus() {
65
- var _internalSelectRef$cu2;
66
- return (_internalSelectRef$cu2 = internalSelectRef.current) === null || _internalSelectRef$cu2 === void 0 ? void 0 : _internalSelectRef$cu2.focus();
36
+ var _internalSelectRef$cu;
37
+ return (_internalSelectRef$cu = internalSelectRef.current) === null || _internalSelectRef$cu === void 0 ? void 0 : _internalSelectRef$cu.focus();
67
38
  },
68
39
  blur: function blur() {
69
- var _internalSelectRef$cu3;
70
- return (_internalSelectRef$cu3 = internalSelectRef.current) === null || _internalSelectRef$cu3 === void 0 ? void 0 : _internalSelectRef$cu3.blur();
40
+ var _internalSelectRef$cu2;
41
+ return (_internalSelectRef$cu2 = internalSelectRef.current) === null || _internalSelectRef$cu2 === void 0 ? void 0 : _internalSelectRef$cu2.blur();
71
42
  }
72
43
  };
73
44
  }, []);
@@ -86,10 +57,8 @@ export default function createSelect(WrappedComponent) {
86
57
  onClickPreventDefault: onClickPreventDefault,
87
58
  isInvalid: isInvalid || validationState === 'error'
88
59
  }, restProps, {
89
- components: components
90
60
  // indicates react-select to be async by default using the base Select component
91
61
  // so that makers can pass all async props on the base select to async load options.
92
- ,
93
62
  isAsync: true
94
63
  }));
95
64
  });
@@ -114,7 +114,6 @@ export default class PopupSelect<Option = OptionType, IsMulti extends boolean =
114
114
  Control: React.FC<import("../types").ControlProps<OptionType, boolean>>;
115
115
  DropdownIndicator: () => import("@emotion/react").jsx.JSX.Element;
116
116
  Menu: ({ children, innerProps }: import("../types").MenuProps<OptionType, boolean>) => import("@emotion/react").jsx.JSX.Element;
117
- IndicatorSeparator: (props: import("@atlaskit/react-select").IndicatorSeparatorProps<unknown, boolean, GroupBase<unknown>>) => import("@emotion/react").jsx.JSX.Element;
118
117
  ClearIndicator: (props: import("@atlaskit/react-select").ClearIndicatorProps<unknown, boolean, GroupBase<unknown>>) => import("@emotion/react").jsx.JSX.Element;
119
118
  MultiValueRemove: (props: import("@atlaskit/react-select").MultiValueRemoveProps<unknown, boolean, GroupBase<unknown>>) => import("@emotion/react").jsx.JSX.Element;
120
119
  };
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { type CSSProperties, type FC, type ReactNode } from 'react';
6
6
  import { jsx } from '@emotion/react';
7
- import { type ClearIndicatorProps, type ControlProps, type IndicatorSeparatorProps, type MenuProps, type MultiValueRemoveProps, type OptionType } from '../types';
7
+ import { type ClearIndicatorProps, type ControlProps, type MenuProps, type MultiValueRemoveProps, type OptionType } from '../types';
8
8
  interface MenuDialogProps {
9
9
  maxWidth?: number | string;
10
10
  minWidth?: number | string;
@@ -28,7 +28,6 @@ export declare const defaultComponents: {
28
28
  Control: FC<ControlProps<OptionType, boolean>>;
29
29
  DropdownIndicator: () => jsx.JSX.Element;
30
30
  Menu: ({ children, innerProps }: MenuProps<OptionType, boolean>) => jsx.JSX.Element;
31
- IndicatorSeparator: (props: IndicatorSeparatorProps) => jsx.JSX.Element;
32
31
  ClearIndicator: (props: ClearIndicatorProps) => jsx.JSX.Element;
33
32
  MultiValueRemove: (props: MultiValueRemoveProps) => jsx.JSX.Element;
34
33
  };
@@ -13,7 +13,7 @@ export { default as CountrySelect } from './CountrySelect';
13
13
  export { default as RadioSelect } from './RadioSelect';
14
14
  export { default as PopupSelect } from './PopupSelect';
15
15
  export type { PopupSelectProps, ModifierList } from './PopupSelect';
16
- export type { SelectInstance, ActionMeta, ControlProps, FormatOptionLabelMeta, InputActionMeta, InputProps, MenuProps, MenuListComponentProps, OptionProps, OptionsType, OptionType, SelectComponentsConfig, SelectProps, StylesConfig, ValueContainerProps, ValueType, GroupedOptionsType, GroupType, ClearIndicatorProps, DropdownIndicatorProps, IndicatorsContainerProps, IndicatorSeparatorProps, LoadingIndicatorProps, MultiValueProps, MultiValueRemoveProps, ReactSelectProps, SingleValueProps, NoticeProps, ValidationState, GroupProps, AsyncSelectProps, PlaceholderProps, AriaOnFocusProps, } from './types';
16
+ export type { SelectInstance, ActionMeta, ControlProps, FormatOptionLabelMeta, InputActionMeta, InputProps, MenuProps, MenuListComponentProps, OptionProps, OptionsType, OptionType, SelectComponentsConfig, SelectProps, StylesConfig, ValueContainerProps, ValueType, GroupedOptionsType, GroupType, ClearIndicatorProps, DropdownIndicatorProps, IndicatorsContainerProps, LoadingIndicatorProps, MultiValueProps, MultiValueRemoveProps, ReactSelectProps, SingleValueProps, NoticeProps, ValidationState, GroupProps, AsyncSelectProps, PlaceholderProps, AriaOnFocusProps, } from './types';
17
17
  /**
18
18
  * Types not exported on the public API, didn't find usages in sourcegraph
19
19
  *
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
- import { type AriaOnFocusProps, type ClearIndicatorProps, type DropdownIndicatorProps, type FormatOptionLabelMeta, type GroupBase as GroupType, type IndicatorsContainerProps, type IndicatorSeparatorProps, type InputActionMeta, type InputProps, type LoadingIndicatorProps, type MultiValueProps, type MultiValueRemoveProps, type NoticeProps, type OptionProps as ReactSelectOptionProps, type Props as ReactSelectProps, type ActionMeta as RSActionMeta, type ControlProps as RSControlProps, type GroupProps as RSGroupProps, type MenuListProps as RSMenuListComponentProps, type MenuProps as RSMenuProps, type Options as RSOptionsType, type PlaceholderProps as RSPlaceholderProps, type SelectComponentsConfig as RSSelectComponentsConfig, type StylesConfig as RSStylesConfig, type ValueContainerProps as RSValueContainerProps, type OnChangeValue as RSValueType, type SelectInstance, type SingleValueProps } from '@atlaskit/react-select';
3
+ import { type AriaOnFocusProps, type ClearIndicatorProps, type DropdownIndicatorProps, type FormatOptionLabelMeta, type GroupBase as GroupType, type IndicatorsContainerProps, type InputActionMeta, type InputProps, type LoadingIndicatorProps, type MultiValueProps, type MultiValueRemoveProps, type NoticeProps, type OptionProps as ReactSelectOptionProps, type Props as ReactSelectProps, type ActionMeta as RSActionMeta, type ControlProps as RSControlProps, type GroupProps as RSGroupProps, type MenuListProps as RSMenuListComponentProps, type MenuProps as RSMenuProps, type Options as RSOptionsType, type PlaceholderProps as RSPlaceholderProps, type SelectComponentsConfig as RSSelectComponentsConfig, type StylesConfig as RSStylesConfig, type ValueContainerProps as RSValueContainerProps, type OnChangeValue as RSValueType, type SelectInstance, type SingleValueProps } from '@atlaskit/react-select';
4
4
  import { type AsyncProps } from '@atlaskit/react-select/async';
5
5
  import type BaseSelect from '@atlaskit/react-select/base';
6
6
  import { type CreatableProps } from '@atlaskit/react-select/creatable';
@@ -82,4 +82,4 @@ export type AtlaskitSelectRefType = {
82
82
  blur: () => void;
83
83
  focus: () => void;
84
84
  };
85
- export type { SelectInstance, FormatOptionLabelMeta, InputActionMeta, GroupType, InputProps, MultiValueProps, ReactSelectProps, SingleValueProps, ClearIndicatorProps, DropdownIndicatorProps, IndicatorsContainerProps, IndicatorSeparatorProps, LoadingIndicatorProps, NoticeProps, MultiValueRemoveProps, AriaOnFocusProps, };
85
+ export type { SelectInstance, FormatOptionLabelMeta, InputActionMeta, GroupType, InputProps, MultiValueProps, ReactSelectProps, SingleValueProps, ClearIndicatorProps, DropdownIndicatorProps, IndicatorsContainerProps, LoadingIndicatorProps, NoticeProps, MultiValueRemoveProps, AriaOnFocusProps, };
@@ -114,7 +114,6 @@ export default class PopupSelect<Option = OptionType, IsMulti extends boolean =
114
114
  Control: React.FC<import("../types").ControlProps<OptionType, boolean>>;
115
115
  DropdownIndicator: () => import("@emotion/react").jsx.JSX.Element;
116
116
  Menu: ({ children, innerProps }: import("../types").MenuProps<OptionType, boolean>) => import("@emotion/react").jsx.JSX.Element;
117
- IndicatorSeparator: (props: import("@atlaskit/react-select").IndicatorSeparatorProps<unknown, boolean, GroupBase<unknown>>) => import("@emotion/react").jsx.JSX.Element;
118
117
  ClearIndicator: (props: import("@atlaskit/react-select").ClearIndicatorProps<unknown, boolean, GroupBase<unknown>>) => import("@emotion/react").jsx.JSX.Element;
119
118
  MultiValueRemove: (props: import("@atlaskit/react-select").MultiValueRemoveProps<unknown, boolean, GroupBase<unknown>>) => import("@emotion/react").jsx.JSX.Element;
120
119
  };
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { type CSSProperties, type FC, type ReactNode } from 'react';
6
6
  import { jsx } from '@emotion/react';
7
- import { type ClearIndicatorProps, type ControlProps, type IndicatorSeparatorProps, type MenuProps, type MultiValueRemoveProps, type OptionType } from '../types';
7
+ import { type ClearIndicatorProps, type ControlProps, type MenuProps, type MultiValueRemoveProps, type OptionType } from '../types';
8
8
  interface MenuDialogProps {
9
9
  maxWidth?: number | string;
10
10
  minWidth?: number | string;
@@ -28,7 +28,6 @@ export declare const defaultComponents: {
28
28
  Control: FC<ControlProps<OptionType, boolean>>;
29
29
  DropdownIndicator: () => jsx.JSX.Element;
30
30
  Menu: ({ children, innerProps }: MenuProps<OptionType, boolean>) => jsx.JSX.Element;
31
- IndicatorSeparator: (props: IndicatorSeparatorProps) => jsx.JSX.Element;
32
31
  ClearIndicator: (props: ClearIndicatorProps) => jsx.JSX.Element;
33
32
  MultiValueRemove: (props: MultiValueRemoveProps) => jsx.JSX.Element;
34
33
  };
@@ -13,7 +13,7 @@ export { default as CountrySelect } from './CountrySelect';
13
13
  export { default as RadioSelect } from './RadioSelect';
14
14
  export { default as PopupSelect } from './PopupSelect';
15
15
  export type { PopupSelectProps, ModifierList } from './PopupSelect';
16
- export type { SelectInstance, ActionMeta, ControlProps, FormatOptionLabelMeta, InputActionMeta, InputProps, MenuProps, MenuListComponentProps, OptionProps, OptionsType, OptionType, SelectComponentsConfig, SelectProps, StylesConfig, ValueContainerProps, ValueType, GroupedOptionsType, GroupType, ClearIndicatorProps, DropdownIndicatorProps, IndicatorsContainerProps, IndicatorSeparatorProps, LoadingIndicatorProps, MultiValueProps, MultiValueRemoveProps, ReactSelectProps, SingleValueProps, NoticeProps, ValidationState, GroupProps, AsyncSelectProps, PlaceholderProps, AriaOnFocusProps, } from './types';
16
+ export type { SelectInstance, ActionMeta, ControlProps, FormatOptionLabelMeta, InputActionMeta, InputProps, MenuProps, MenuListComponentProps, OptionProps, OptionsType, OptionType, SelectComponentsConfig, SelectProps, StylesConfig, ValueContainerProps, ValueType, GroupedOptionsType, GroupType, ClearIndicatorProps, DropdownIndicatorProps, IndicatorsContainerProps, LoadingIndicatorProps, MultiValueProps, MultiValueRemoveProps, ReactSelectProps, SingleValueProps, NoticeProps, ValidationState, GroupProps, AsyncSelectProps, PlaceholderProps, AriaOnFocusProps, } from './types';
17
17
  /**
18
18
  * Types not exported on the public API, didn't find usages in sourcegraph
19
19
  *
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
- import { type AriaOnFocusProps, type ClearIndicatorProps, type DropdownIndicatorProps, type FormatOptionLabelMeta, type GroupBase as GroupType, type IndicatorsContainerProps, type IndicatorSeparatorProps, type InputActionMeta, type InputProps, type LoadingIndicatorProps, type MultiValueProps, type MultiValueRemoveProps, type NoticeProps, type OptionProps as ReactSelectOptionProps, type Props as ReactSelectProps, type ActionMeta as RSActionMeta, type ControlProps as RSControlProps, type GroupProps as RSGroupProps, type MenuListProps as RSMenuListComponentProps, type MenuProps as RSMenuProps, type Options as RSOptionsType, type PlaceholderProps as RSPlaceholderProps, type SelectComponentsConfig as RSSelectComponentsConfig, type StylesConfig as RSStylesConfig, type ValueContainerProps as RSValueContainerProps, type OnChangeValue as RSValueType, type SelectInstance, type SingleValueProps } from '@atlaskit/react-select';
3
+ import { type AriaOnFocusProps, type ClearIndicatorProps, type DropdownIndicatorProps, type FormatOptionLabelMeta, type GroupBase as GroupType, type IndicatorsContainerProps, type InputActionMeta, type InputProps, type LoadingIndicatorProps, type MultiValueProps, type MultiValueRemoveProps, type NoticeProps, type OptionProps as ReactSelectOptionProps, type Props as ReactSelectProps, type ActionMeta as RSActionMeta, type ControlProps as RSControlProps, type GroupProps as RSGroupProps, type MenuListProps as RSMenuListComponentProps, type MenuProps as RSMenuProps, type Options as RSOptionsType, type PlaceholderProps as RSPlaceholderProps, type SelectComponentsConfig as RSSelectComponentsConfig, type StylesConfig as RSStylesConfig, type ValueContainerProps as RSValueContainerProps, type OnChangeValue as RSValueType, type SelectInstance, type SingleValueProps } from '@atlaskit/react-select';
4
4
  import { type AsyncProps } from '@atlaskit/react-select/async';
5
5
  import type BaseSelect from '@atlaskit/react-select/base';
6
6
  import { type CreatableProps } from '@atlaskit/react-select/creatable';
@@ -82,4 +82,4 @@ export type AtlaskitSelectRefType = {
82
82
  blur: () => void;
83
83
  focus: () => void;
84
84
  };
85
- export type { SelectInstance, FormatOptionLabelMeta, InputActionMeta, GroupType, InputProps, MultiValueProps, ReactSelectProps, SingleValueProps, ClearIndicatorProps, DropdownIndicatorProps, IndicatorsContainerProps, IndicatorSeparatorProps, LoadingIndicatorProps, NoticeProps, MultiValueRemoveProps, AriaOnFocusProps, };
85
+ export type { SelectInstance, FormatOptionLabelMeta, InputActionMeta, GroupType, InputProps, MultiValueProps, ReactSelectProps, SingleValueProps, ClearIndicatorProps, DropdownIndicatorProps, IndicatorsContainerProps, LoadingIndicatorProps, NoticeProps, MultiValueRemoveProps, AriaOnFocusProps, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/select",
3
- "version": "18.8.2",
3
+ "version": "18.9.1",
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/"
@@ -43,13 +43,13 @@
43
43
  "dependencies": {
44
44
  "@atlaskit/analytics-next": "^10.2.0",
45
45
  "@atlaskit/ds-lib": "^3.3.0",
46
- "@atlaskit/icon": "^23.1.0",
46
+ "@atlaskit/icon": "^23.3.0",
47
47
  "@atlaskit/platform-feature-flags": "^0.3.0",
48
48
  "@atlaskit/primitives": "^13.3.0",
49
- "@atlaskit/react-select": "^1.5.0",
49
+ "@atlaskit/react-select": "^1.6.0",
50
50
  "@atlaskit/spinner": "^16.3.0",
51
51
  "@atlaskit/theme": "^14.0.0",
52
- "@atlaskit/tokens": "^2.4.0",
52
+ "@atlaskit/tokens": "^3.0.0",
53
53
  "@atlaskit/visually-hidden": "^1.5.0",
54
54
  "@babel/runtime": "^7.0.0",
55
55
  "@emotion/react": "^11.7.1",
@@ -69,7 +69,7 @@
69
69
  "@af/integration-testing": "*",
70
70
  "@af/visual-regression": "*",
71
71
  "@atlaskit/checkbox": "^15.2.0",
72
- "@atlaskit/modal-dialog": "^12.18.0",
72
+ "@atlaskit/modal-dialog": "^12.19.0",
73
73
  "@atlaskit/radio": "^7.0.0",
74
74
  "@atlaskit/ssr": "*",
75
75
  "@atlaskit/visual-regression": "*",