@atlaskit/select 18.8.2 → 18.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/CHANGELOG.md +12 -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/PopupSelect/components.js +0 -4
  5. package/dist/cjs/Select.js +1 -1
  6. package/dist/cjs/createSelect.js +5 -36
  7. package/dist/es2019/PopupSelect/components.js +0 -2
  8. package/dist/es2019/Select.js +1 -1
  9. package/dist/es2019/createSelect.js +5 -35
  10. package/dist/esm/PopupSelect/components.js +0 -4
  11. package/dist/esm/Select.js +1 -1
  12. package/dist/esm/createSelect.js +6 -37
  13. package/dist/types/PopupSelect/PopupSelect.d.ts +0 -1
  14. package/dist/types/PopupSelect/components.d.ts +1 -2
  15. package/dist/types/index.d.ts +1 -1
  16. package/dist/types/types.d.ts +2 -2
  17. package/dist/types-ts4.5/PopupSelect/PopupSelect.d.ts +0 -1
  18. package/dist/types-ts4.5/PopupSelect/components.d.ts +1 -2
  19. package/dist/types-ts4.5/index.d.ts +1 -1
  20. package/dist/types-ts4.5/types.d.ts +2 -2
  21. package/package.json +2 -2
  22. package/dist/cjs/components/index.js +0 -96
  23. package/dist/cjs/components/indicators.js +0 -82
  24. package/dist/cjs/components/input-aria-describedby.js +0 -23
  25. package/dist/cjs/components/no-options.js +0 -18
  26. package/dist/es2019/components/index.js +0 -71
  27. package/dist/es2019/components/indicators.js +0 -68
  28. package/dist/es2019/components/input-aria-describedby.js +0 -16
  29. package/dist/es2019/components/no-options.js +0 -11
  30. package/dist/esm/components/index.js +0 -69
  31. package/dist/esm/components/indicators.js +0 -75
  32. package/dist/esm/components/input-aria-describedby.js +0 -16
  33. package/dist/esm/components/no-options.js +0 -11
  34. package/dist/types/components/index.d.ts +0 -15
  35. package/dist/types/components/indicators.d.ts +0 -9
  36. package/dist/types/components/input-aria-describedby.d.ts +0 -4
  37. package/dist/types/components/no-options.d.ts +0 -6
  38. package/dist/types-ts4.5/components/index.d.ts +0 -15
  39. package/dist/types-ts4.5/components/indicators.d.ts +0 -9
  40. package/dist/types-ts4.5/components/input-aria-describedby.d.ts +0 -4
  41. package/dist/types-ts4.5/components/no-options.d.ts +0 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/select
2
2
 
3
+ ## 18.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#177875](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/177875)
8
+ [`d0c3d27216b7c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d0c3d27216b7c) -
9
+ Remove theme prop and merge customized components for performance
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 18.8.2
4
16
 
5
17
  ### 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
  };
@@ -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.0";
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
  });
@@ -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.0";
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
  });
@@ -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.0";
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.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/"
@@ -46,7 +46,7 @@
46
46
  "@atlaskit/icon": "^23.1.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
52
  "@atlaskit/tokens": "^2.4.0",
@@ -1,96 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- Object.defineProperty(exports, "ClearIndicator", {
8
- enumerable: true,
9
- get: function get() {
10
- return _indicators.ClearIndicator;
11
- }
12
- });
13
- Object.defineProperty(exports, "DropdownIndicator", {
14
- enumerable: true,
15
- get: function get() {
16
- return _indicators.DropdownIndicator;
17
- }
18
- });
19
- exports.IndicatorSeparator = void 0;
20
- Object.defineProperty(exports, "LoadingIndicator", {
21
- enumerable: true,
22
- get: function get() {
23
- return _indicators.LoadingIndicator;
24
- }
25
- });
26
- exports.MultiValueRemove = void 0;
27
- var _react = require("@emotion/react");
28
- var _selectClear = _interopRequireDefault(require("@atlaskit/icon/glyph/select-clear"));
29
- var _cross = _interopRequireDefault(require("@atlaskit/icon/utility/cross"));
30
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
31
- var _primitives = require("@atlaskit/primitives");
32
- var _reactSelect = require("@atlaskit/react-select");
33
- var _indicators = require("./indicators");
34
- /**
35
- * @jsxRuntime classic
36
- * @jsx jsx
37
- */
38
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
39
-
40
- var disabledStyles = (0, _react.css)({
41
- display: 'none'
42
- });
43
- var enabledStyles = (0, _react.css)({
44
- display: 'inherit'
45
- });
46
- var iconWrapperStyles = (0, _primitives.xcss)({
47
- padding: 'space.025'
48
- });
49
-
50
- /**
51
- * __Multi value remove__
52
- *
53
- * The icon used to remove individual selections from a multi-select.
54
- *
55
- */
56
- var MultiValueRemove = exports.MultiValueRemove = function MultiValueRemove(props) {
57
- var isDisabled = props.selectProps.isDisabled;
58
- var renderIcon = function renderIcon() {
59
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
60
- if ((0, _platformFeatureFlags.fg)('platform-component-visual-refresh')) {
61
- return (0, _react.jsx)(_cross.default, {
62
- label: "Clear",
63
- color: "currentColor"
64
- });
65
- }
66
-
67
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
68
- if ((0, _platformFeatureFlags.fg)('platform-visual-refresh-icons-legacy-facade')) {
69
- return (0, _react.jsx)(_primitives.Inline, {
70
- xcss: iconWrapperStyles
71
- }, (0, _react.jsx)(_cross.default, {
72
- label: "Clear",
73
- color: "currentColor"
74
- }));
75
- }
76
- return (
77
- // eslint-disable-next-line @atlaskit/design-system/no-legacy-icons
78
- (0, _react.jsx)(_selectClear.default, {
79
- label: "Clear",
80
- primaryColor: "transparent",
81
- size: "small",
82
- secondaryColor: "inherit"
83
- })
84
- );
85
- };
86
- return (
87
- // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
88
- (0, _react.jsx)(_reactSelect.components.MultiValueRemove, props, (0, _react.jsx)("div", {
89
- css: isDisabled ? disabledStyles : enabledStyles,
90
- "data-testid": isDisabled ? 'hide-clear-icon' : 'show-clear-icon'
91
- }, renderIcon()))
92
- );
93
- };
94
-
95
- // eslint-disable-next-line @repo/internal/react/require-jsdoc
96
- var IndicatorSeparator = exports.IndicatorSeparator = null;
@@ -1,82 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.LoadingIndicator = exports.DropdownIndicator = exports.ClearIndicator = void 0;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
- var _react = require("@emotion/react");
12
- var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/utility/migration/chevron-down"));
13
- var _crossCircleSelectClear = _interopRequireDefault(require("@atlaskit/icon/utility/migration/cross-circle--select-clear"));
14
- var _primitives = require("@atlaskit/primitives");
15
- var _reactSelect = require("@atlaskit/react-select");
16
- var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
17
- var _excluded = ["clearControlLabel"];
18
- /* eslint-disable @repo/internal/react/require-jsdoc */
19
- /**
20
- * @jsxRuntime classic
21
- * @jsx jsx
22
- */
23
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
24
- 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; }
25
- 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; }
26
- var iconContainerStyles = (0, _primitives.xcss)({
27
- all: 'unset',
28
- outline: 'revert',
29
- display: 'flex',
30
- alignItems: 'center',
31
- justifyContent: 'center',
32
- padding: 'space.025'
33
- });
34
- var dropdownWrapperStyles = (0, _primitives.xcss)({
35
- padding: 'space.075'
36
- });
37
- var ClearIndicator = exports.ClearIndicator = function ClearIndicator(_ref) {
38
- var _ref$clearControlLabe = _ref.clearControlLabel,
39
- clearControlLabel = _ref$clearControlLabe === void 0 ? 'clear' : _ref$clearControlLabe,
40
- props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
41
- return (0, _react.jsx)(_reactSelect.components.ClearIndicator, _objectSpread(_objectSpread({}, props), {}, {
42
- innerProps: _objectSpread(_objectSpread({}, props.innerProps), {}, {
43
- 'aria-hidden': 'false'
44
- })
45
- }), (0, _react.jsx)(_primitives.Pressable, {
46
- xcss: iconContainerStyles,
47
- tabIndex: -1,
48
- "aria-label": clearControlLabel
49
- }, (0, _react.jsx)(_crossCircleSelectClear.default, {
50
- label: "",
51
- color: "currentColor",
52
- LEGACY_size: "small",
53
- LEGACY_margin: "var(--ds-space-negative-025, -0.125rem)"
54
- })));
55
- };
56
- var DropdownIndicator = exports.DropdownIndicator = function DropdownIndicator(props) {
57
- return (
58
- // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
59
- (0, _react.jsx)(_reactSelect.components.DropdownIndicator, props, (0, _react.jsx)(_primitives.Inline, {
60
- as: "span",
61
- xcss: dropdownWrapperStyles
62
- }, (0, _react.jsx)(_chevronDown.default, {
63
- color: "currentColor",
64
- label: "open",
65
- LEGACY_margin: "var(--ds-space-negative-075, -0.375rem)"
66
- })))
67
- );
68
- };
69
- var LoadingIndicator = exports.LoadingIndicator = function LoadingIndicator(props) {
70
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
71
- var loadingStyles = (0, _react.css)(props.getStyles('loadingIndicator', props));
72
- return (
73
- // This *must* be constructed this way because this is being consumed by
74
- // `react-select` and we don't control what it wants.
75
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
76
- (0, _react.jsx)("div", (0, _extends2.default)({
77
- css: loadingStyles
78
- }, props.innerProps), (0, _react.jsx)(_spinner.default, {
79
- size: "small"
80
- }))
81
- );
82
- };
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.Input = Input;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- var _react = _interopRequireDefault(require("react"));
10
- var _reactSelect = require("@atlaskit/react-select");
11
- function Input(props) {
12
- var _ariaDescribedByAttri;
13
- var ariaDescribedByAttribute = props['aria-describedby'];
14
- var passed_describedby = props.selectProps['aria-describedby'] || props.selectProps.descriptionId;
15
- if (passed_describedby && !((_ariaDescribedByAttri = ariaDescribedByAttribute) !== null && _ariaDescribedByAttri !== void 0 && _ariaDescribedByAttri.includes(passed_describedby))) {
16
- ariaDescribedByAttribute = props['aria-describedby'] + ' ' + passed_describedby;
17
- } else {
18
- ariaDescribedByAttribute = props['aria-describedby'] || passed_describedby;
19
- }
20
- return /*#__PURE__*/_react.default.createElement(_reactSelect.components.Input, (0, _extends2.default)({}, props, {
21
- "aria-describedby": ariaDescribedByAttribute
22
- }));
23
- }
@@ -1,18 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.NoOptionsMessage = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _primitives = require("@atlaskit/primitives");
10
- var _reactSelect = require("@atlaskit/react-select");
11
- /**
12
- * __No options message__
13
- */
14
- var NoOptionsMessage = exports.NoOptionsMessage = function NoOptionsMessage(props) {
15
- return /*#__PURE__*/_react.default.createElement(_reactSelect.components.NoOptionsMessage, props, /*#__PURE__*/_react.default.createElement(_primitives.Text, {
16
- color: "color.text.subtle"
17
- }, props.children || "No options"));
18
- };
@@ -1,71 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
- import { css, jsx } from '@emotion/react';
7
- import LegacySelectClearIcon from '@atlaskit/icon/glyph/select-clear';
8
- import CrossIcon from '@atlaskit/icon/utility/cross';
9
- import { fg } from '@atlaskit/platform-feature-flags';
10
- import { Inline, xcss } from '@atlaskit/primitives';
11
- import { components } from '@atlaskit/react-select';
12
- export { ClearIndicator, DropdownIndicator, LoadingIndicator } from './indicators';
13
- const disabledStyles = css({
14
- display: 'none'
15
- });
16
- const enabledStyles = css({
17
- display: 'inherit'
18
- });
19
- const iconWrapperStyles = xcss({
20
- padding: 'space.025'
21
- });
22
-
23
- /**
24
- * __Multi value remove__
25
- *
26
- * The icon used to remove individual selections from a multi-select.
27
- *
28
- */
29
- export const MultiValueRemove = props => {
30
- const {
31
- isDisabled
32
- } = props.selectProps;
33
- const renderIcon = () => {
34
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
35
- if (fg('platform-component-visual-refresh')) {
36
- return jsx(CrossIcon, {
37
- label: "Clear",
38
- color: "currentColor"
39
- });
40
- }
41
-
42
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
43
- if (fg('platform-visual-refresh-icons-legacy-facade')) {
44
- return jsx(Inline, {
45
- xcss: iconWrapperStyles
46
- }, jsx(CrossIcon, {
47
- label: "Clear",
48
- color: "currentColor"
49
- }));
50
- }
51
- return (
52
- // eslint-disable-next-line @atlaskit/design-system/no-legacy-icons
53
- jsx(LegacySelectClearIcon, {
54
- label: "Clear",
55
- primaryColor: "transparent",
56
- size: "small",
57
- secondaryColor: "inherit"
58
- })
59
- );
60
- };
61
- return (
62
- // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
63
- jsx(components.MultiValueRemove, props, jsx("div", {
64
- css: isDisabled ? disabledStyles : enabledStyles,
65
- "data-testid": isDisabled ? 'hide-clear-icon' : 'show-clear-icon'
66
- }, renderIcon()))
67
- );
68
- };
69
-
70
- // eslint-disable-next-line @repo/internal/react/require-jsdoc
71
- export const IndicatorSeparator = null;
@@ -1,68 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- /* eslint-disable @repo/internal/react/require-jsdoc */
3
- /**
4
- * @jsxRuntime classic
5
- * @jsx jsx
6
- */
7
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
- import { css, jsx } from '@emotion/react';
9
- import DownIcon from '@atlaskit/icon/utility/migration/chevron-down';
10
- import CrossIcon from '@atlaskit/icon/utility/migration/cross-circle--select-clear';
11
- import { Inline, Pressable, xcss } from '@atlaskit/primitives';
12
- import { components } from '@atlaskit/react-select';
13
- import Spinner from '@atlaskit/spinner';
14
- const iconContainerStyles = xcss({
15
- all: 'unset',
16
- outline: 'revert',
17
- display: 'flex',
18
- alignItems: 'center',
19
- justifyContent: 'center',
20
- padding: 'space.025'
21
- });
22
- const dropdownWrapperStyles = xcss({
23
- padding: 'space.075'
24
- });
25
- export const ClearIndicator = ({
26
- clearControlLabel = 'clear',
27
- ...props
28
- }) => {
29
- return jsx(components.ClearIndicator, _extends({}, props, {
30
- innerProps: {
31
- ...props.innerProps,
32
- 'aria-hidden': 'false'
33
- }
34
- }), jsx(Pressable, {
35
- xcss: iconContainerStyles,
36
- tabIndex: -1,
37
- "aria-label": clearControlLabel
38
- }, jsx(CrossIcon, {
39
- label: "",
40
- color: "currentColor",
41
- LEGACY_size: "small",
42
- LEGACY_margin: "var(--ds-space-negative-025, -0.125rem)"
43
- })));
44
- };
45
- export const DropdownIndicator = props =>
46
- // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
47
- jsx(components.DropdownIndicator, props, jsx(Inline, {
48
- as: "span",
49
- xcss: dropdownWrapperStyles
50
- }, jsx(DownIcon, {
51
- color: "currentColor",
52
- label: "open",
53
- LEGACY_margin: "var(--ds-space-negative-075, -0.375rem)"
54
- })));
55
- export const LoadingIndicator = props => {
56
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
57
- const loadingStyles = css(props.getStyles('loadingIndicator', props));
58
- return (
59
- // This *must* be constructed this way because this is being consumed by
60
- // `react-select` and we don't control what it wants.
61
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
62
- jsx("div", _extends({
63
- css: loadingStyles
64
- }, props.innerProps), jsx(Spinner, {
65
- size: "small"
66
- }))
67
- );
68
- };
@@ -1,16 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
3
- import { components } from '@atlaskit/react-select';
4
- export function Input(props) {
5
- var _ariaDescribedByAttri;
6
- let ariaDescribedByAttribute = props['aria-describedby'];
7
- const passed_describedby = props.selectProps['aria-describedby'] || props.selectProps.descriptionId;
8
- if (passed_describedby && !((_ariaDescribedByAttri = ariaDescribedByAttribute) !== null && _ariaDescribedByAttri !== void 0 && _ariaDescribedByAttri.includes(passed_describedby))) {
9
- ariaDescribedByAttribute = props['aria-describedby'] + ' ' + passed_describedby;
10
- } else {
11
- ariaDescribedByAttribute = props['aria-describedby'] || passed_describedby;
12
- }
13
- return /*#__PURE__*/React.createElement(components.Input, _extends({}, props, {
14
- "aria-describedby": ariaDescribedByAttribute
15
- }));
16
- }
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import { Text } from '@atlaskit/primitives';
3
- import { components } from '@atlaskit/react-select';
4
- /**
5
- * __No options message__
6
- */
7
- export const NoOptionsMessage = props => {
8
- return /*#__PURE__*/React.createElement(components.NoOptionsMessage, props, /*#__PURE__*/React.createElement(Text, {
9
- color: "color.text.subtle"
10
- }, props.children || `No options`));
11
- };
@@ -1,69 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
- import { css, jsx } from '@emotion/react';
7
- import LegacySelectClearIcon from '@atlaskit/icon/glyph/select-clear';
8
- import CrossIcon from '@atlaskit/icon/utility/cross';
9
- import { fg } from '@atlaskit/platform-feature-flags';
10
- import { Inline, xcss } from '@atlaskit/primitives';
11
- import { components } from '@atlaskit/react-select';
12
- export { ClearIndicator, DropdownIndicator, LoadingIndicator } from './indicators';
13
- var disabledStyles = css({
14
- display: 'none'
15
- });
16
- var enabledStyles = css({
17
- display: 'inherit'
18
- });
19
- var iconWrapperStyles = xcss({
20
- padding: 'space.025'
21
- });
22
-
23
- /**
24
- * __Multi value remove__
25
- *
26
- * The icon used to remove individual selections from a multi-select.
27
- *
28
- */
29
- export var MultiValueRemove = function MultiValueRemove(props) {
30
- var isDisabled = props.selectProps.isDisabled;
31
- var renderIcon = function renderIcon() {
32
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
33
- if (fg('platform-component-visual-refresh')) {
34
- return jsx(CrossIcon, {
35
- label: "Clear",
36
- color: "currentColor"
37
- });
38
- }
39
-
40
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
41
- if (fg('platform-visual-refresh-icons-legacy-facade')) {
42
- return jsx(Inline, {
43
- xcss: iconWrapperStyles
44
- }, jsx(CrossIcon, {
45
- label: "Clear",
46
- color: "currentColor"
47
- }));
48
- }
49
- return (
50
- // eslint-disable-next-line @atlaskit/design-system/no-legacy-icons
51
- jsx(LegacySelectClearIcon, {
52
- label: "Clear",
53
- primaryColor: "transparent",
54
- size: "small",
55
- secondaryColor: "inherit"
56
- })
57
- );
58
- };
59
- return (
60
- // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
61
- jsx(components.MultiValueRemove, props, jsx("div", {
62
- css: isDisabled ? disabledStyles : enabledStyles,
63
- "data-testid": isDisabled ? 'hide-clear-icon' : 'show-clear-icon'
64
- }, renderIcon()))
65
- );
66
- };
67
-
68
- // eslint-disable-next-line @repo/internal/react/require-jsdoc
69
- export var IndicatorSeparator = null;
@@ -1,75 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["clearControlLabel"];
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
- 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
- /* eslint-disable @repo/internal/react/require-jsdoc */
8
- /**
9
- * @jsxRuntime classic
10
- * @jsx jsx
11
- */
12
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
13
- import { css, jsx } from '@emotion/react';
14
- import DownIcon from '@atlaskit/icon/utility/migration/chevron-down';
15
- import CrossIcon from '@atlaskit/icon/utility/migration/cross-circle--select-clear';
16
- import { Inline, Pressable, xcss } from '@atlaskit/primitives';
17
- import { components } from '@atlaskit/react-select';
18
- import Spinner from '@atlaskit/spinner';
19
- var iconContainerStyles = xcss({
20
- all: 'unset',
21
- outline: 'revert',
22
- display: 'flex',
23
- alignItems: 'center',
24
- justifyContent: 'center',
25
- padding: 'space.025'
26
- });
27
- var dropdownWrapperStyles = xcss({
28
- padding: 'space.075'
29
- });
30
- export var ClearIndicator = function ClearIndicator(_ref) {
31
- var _ref$clearControlLabe = _ref.clearControlLabel,
32
- clearControlLabel = _ref$clearControlLabe === void 0 ? 'clear' : _ref$clearControlLabe,
33
- props = _objectWithoutProperties(_ref, _excluded);
34
- return jsx(components.ClearIndicator, _objectSpread(_objectSpread({}, props), {}, {
35
- innerProps: _objectSpread(_objectSpread({}, props.innerProps), {}, {
36
- 'aria-hidden': 'false'
37
- })
38
- }), jsx(Pressable, {
39
- xcss: iconContainerStyles,
40
- tabIndex: -1,
41
- "aria-label": clearControlLabel
42
- }, jsx(CrossIcon, {
43
- label: "",
44
- color: "currentColor",
45
- LEGACY_size: "small",
46
- LEGACY_margin: "var(--ds-space-negative-025, -0.125rem)"
47
- })));
48
- };
49
- export var DropdownIndicator = function DropdownIndicator(props) {
50
- return (
51
- // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
52
- jsx(components.DropdownIndicator, props, jsx(Inline, {
53
- as: "span",
54
- xcss: dropdownWrapperStyles
55
- }, jsx(DownIcon, {
56
- color: "currentColor",
57
- label: "open",
58
- LEGACY_margin: "var(--ds-space-negative-075, -0.375rem)"
59
- })))
60
- );
61
- };
62
- export var LoadingIndicator = function LoadingIndicator(props) {
63
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
64
- var loadingStyles = css(props.getStyles('loadingIndicator', props));
65
- return (
66
- // This *must* be constructed this way because this is being consumed by
67
- // `react-select` and we don't control what it wants.
68
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
69
- jsx("div", _extends({
70
- css: loadingStyles
71
- }, props.innerProps), jsx(Spinner, {
72
- size: "small"
73
- }))
74
- );
75
- };
@@ -1,16 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
3
- import { components } from '@atlaskit/react-select';
4
- export function Input(props) {
5
- var _ariaDescribedByAttri;
6
- var ariaDescribedByAttribute = props['aria-describedby'];
7
- var passed_describedby = props.selectProps['aria-describedby'] || props.selectProps.descriptionId;
8
- if (passed_describedby && !((_ariaDescribedByAttri = ariaDescribedByAttribute) !== null && _ariaDescribedByAttri !== void 0 && _ariaDescribedByAttri.includes(passed_describedby))) {
9
- ariaDescribedByAttribute = props['aria-describedby'] + ' ' + passed_describedby;
10
- } else {
11
- ariaDescribedByAttribute = props['aria-describedby'] || passed_describedby;
12
- }
13
- return /*#__PURE__*/React.createElement(components.Input, _extends({}, props, {
14
- "aria-describedby": ariaDescribedByAttribute
15
- }));
16
- }
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import { Text } from '@atlaskit/primitives';
3
- import { components } from '@atlaskit/react-select';
4
- /**
5
- * __No options message__
6
- */
7
- export var NoOptionsMessage = function NoOptionsMessage(props) {
8
- return /*#__PURE__*/React.createElement(components.NoOptionsMessage, props, /*#__PURE__*/React.createElement(Text, {
9
- color: "color.text.subtle"
10
- }, props.children || "No options"));
11
- };
@@ -1,15 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { jsx } from '@emotion/react';
6
- import { type MultiValueRemoveProps } from '../types';
7
- export { ClearIndicator, DropdownIndicator, LoadingIndicator } from './indicators';
8
- /**
9
- * __Multi value remove__
10
- *
11
- * The icon used to remove individual selections from a multi-select.
12
- *
13
- */
14
- export declare const MultiValueRemove: (props: MultiValueRemoveProps<any>) => jsx.JSX.Element;
15
- export declare const IndicatorSeparator: null;
@@ -1,9 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { jsx } from '@emotion/react';
6
- import { type ClearIndicatorProps, type DropdownIndicatorProps, type LoadingIndicatorProps } from '../types';
7
- export declare const ClearIndicator: <Option extends unknown, IsMulti extends boolean = false>({ clearControlLabel, ...props }: ClearIndicatorProps<Option, IsMulti>) => jsx.JSX.Element;
8
- export declare const DropdownIndicator: <Option extends unknown, IsMulti extends boolean = false>(props: DropdownIndicatorProps<Option, IsMulti>) => jsx.JSX.Element;
9
- export declare const LoadingIndicator: <Option extends unknown, IsMulti extends boolean = false>(props: LoadingIndicatorProps<Option, IsMulti>) => jsx.JSX.Element;
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import { type InputProps } from '@atlaskit/react-select';
3
- import type { OptionType } from '../types';
4
- export declare function Input<Option = OptionType, IsMulti extends boolean = false>(props: InputProps<Option, IsMulti>): JSX.Element;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import { type NoticeProps, type OptionType } from '../types';
3
- /**
4
- * __No options message__
5
- */
6
- export declare const NoOptionsMessage: (props: NoticeProps<OptionType>) => JSX.Element;
@@ -1,15 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { jsx } from '@emotion/react';
6
- import { type MultiValueRemoveProps } from '../types';
7
- export { ClearIndicator, DropdownIndicator, LoadingIndicator } from './indicators';
8
- /**
9
- * __Multi value remove__
10
- *
11
- * The icon used to remove individual selections from a multi-select.
12
- *
13
- */
14
- export declare const MultiValueRemove: (props: MultiValueRemoveProps<any>) => jsx.JSX.Element;
15
- export declare const IndicatorSeparator: null;
@@ -1,9 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { jsx } from '@emotion/react';
6
- import { type ClearIndicatorProps, type DropdownIndicatorProps, type LoadingIndicatorProps } from '../types';
7
- export declare const ClearIndicator: <Option extends unknown, IsMulti extends boolean = false>({ clearControlLabel, ...props }: ClearIndicatorProps<Option, IsMulti>) => jsx.JSX.Element;
8
- export declare const DropdownIndicator: <Option extends unknown, IsMulti extends boolean = false>(props: DropdownIndicatorProps<Option, IsMulti>) => jsx.JSX.Element;
9
- export declare const LoadingIndicator: <Option extends unknown, IsMulti extends boolean = false>(props: LoadingIndicatorProps<Option, IsMulti>) => jsx.JSX.Element;
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import { type InputProps } from '@atlaskit/react-select';
3
- import type { OptionType } from '../types';
4
- export declare function Input<Option = OptionType, IsMulti extends boolean = false>(props: InputProps<Option, IsMulti>): JSX.Element;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import { type NoticeProps, type OptionType } from '../types';
3
- /**
4
- * __No options message__
5
- */
6
- export declare const NoOptionsMessage: (props: NoticeProps<OptionType>) => JSX.Element;