@atlaskit/select 17.8.0 → 17.10.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 (53) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/codemods/13.0.0-popper-props.ts +9 -2
  3. package/codemods/utils/helpers.ts +9 -8
  4. package/dist/cjs/PopupSelect/PopupSelect.js +3 -1
  5. package/dist/cjs/PopupSelect/components.js +3 -1
  6. package/dist/cjs/Select.js +1 -1
  7. package/dist/cjs/components/indicators.js +4 -4
  8. package/dist/cjs/components/input-options.js +1 -1
  9. package/dist/es2019/PopupSelect/PopupSelect.js +3 -1
  10. package/dist/es2019/PopupSelect/components.js +3 -1
  11. package/dist/es2019/Select.js +1 -1
  12. package/dist/es2019/components/indicators.js +4 -4
  13. package/dist/es2019/components/input-options.js +1 -1
  14. package/dist/esm/PopupSelect/PopupSelect.js +3 -1
  15. package/dist/esm/PopupSelect/components.js +3 -1
  16. package/dist/esm/Select.js +1 -1
  17. package/dist/esm/components/indicators.js +4 -4
  18. package/dist/esm/components/input-options.js +1 -1
  19. package/dist/types/CheckboxSelect.d.ts +1 -1
  20. package/dist/types/CountrySelect.d.ts +1 -1
  21. package/dist/types/PopupSelect/PopupSelect.d.ts +7 -5
  22. package/dist/types/PopupSelect/components.d.ts +2 -2
  23. package/dist/types/RadioSelect.d.ts +1 -1
  24. package/dist/types/components/index.d.ts +1 -1
  25. package/dist/types/components/indicators.d.ts +1 -1
  26. package/dist/types/components/input-aria-describedby.d.ts +1 -1
  27. package/dist/types/components/input-options.d.ts +1 -1
  28. package/dist/types/createSelect.d.ts +1 -1
  29. package/dist/types/extract-react-types/ert.d.ts +1 -1
  30. package/dist/types/extract-react-types/react-popper-props.d.ts +1 -1
  31. package/dist/types/extract-react-types/react-select-async.d.ts +1 -1
  32. package/dist/types/extract-react-types/react-select-creatable.d.ts +2 -2
  33. package/dist/types/extract-react-types/react-select-props.d.ts +3 -3
  34. package/dist/types/types.d.ts +5 -5
  35. package/dist/types/utils/grouped-options-announcement.d.ts +2 -2
  36. package/dist/types-ts4.5/CheckboxSelect.d.ts +1 -1
  37. package/dist/types-ts4.5/CountrySelect.d.ts +1 -1
  38. package/dist/types-ts4.5/PopupSelect/PopupSelect.d.ts +7 -5
  39. package/dist/types-ts4.5/PopupSelect/components.d.ts +2 -2
  40. package/dist/types-ts4.5/RadioSelect.d.ts +1 -1
  41. package/dist/types-ts4.5/components/index.d.ts +1 -1
  42. package/dist/types-ts4.5/components/indicators.d.ts +1 -1
  43. package/dist/types-ts4.5/components/input-aria-describedby.d.ts +1 -1
  44. package/dist/types-ts4.5/components/input-options.d.ts +1 -1
  45. package/dist/types-ts4.5/createSelect.d.ts +1 -1
  46. package/dist/types-ts4.5/extract-react-types/ert.d.ts +1 -1
  47. package/dist/types-ts4.5/extract-react-types/react-popper-props.d.ts +1 -1
  48. package/dist/types-ts4.5/extract-react-types/react-select-async.d.ts +1 -1
  49. package/dist/types-ts4.5/extract-react-types/react-select-creatable.d.ts +2 -2
  50. package/dist/types-ts4.5/extract-react-types/react-select-props.d.ts +3 -3
  51. package/dist/types-ts4.5/types.d.ts +5 -5
  52. package/dist/types-ts4.5/utils/grouped-options-announcement.d.ts +2 -2
  53. package/package.json +11 -8
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/select
2
2
 
3
+ ## 17.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#104208](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/104208)
8
+ [`0d4480895db7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0d4480895db7) -
9
+ Add support for React 18.
10
+
11
+ ## 17.9.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#96841](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/96841)
16
+ [`6cca90095b7e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6cca90095b7e) -
17
+ `ClearIndicator` button now uses the `Pressable` primitive.
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+
3
23
  ## 17.8.0
4
24
 
5
25
  ### Minor Changes
@@ -6,8 +6,15 @@ import {
6
6
  isUsingProp,
7
7
  } from './utils/helpers';
8
8
 
9
- import core, { API, ASTPath, FileInfo, JSXElement, Options } from 'jscodeshift';
10
- import { Collection } from 'jscodeshift/src/Collection';
9
+ import {
10
+ type default as core,
11
+ type API,
12
+ type ASTPath,
13
+ type FileInfo,
14
+ type JSXElement,
15
+ type Options,
16
+ } from 'jscodeshift';
17
+ import { type Collection } from 'jscodeshift/src/Collection';
11
18
 
12
19
  function updatePopperProps(
13
20
  j: core.JSCodeshift,
@@ -1,12 +1,13 @@
1
- import { NodePath } from 'ast-types/lib/node-path';
2
- import core, {
3
- ASTPath,
4
- ImportDeclaration,
5
- JSXAttribute,
6
- JSXElement,
7
- Node,
1
+ import { type NodePath } from 'ast-types/lib/node-path';
2
+ import {
3
+ type default as core,
4
+ type ASTPath,
5
+ type ImportDeclaration,
6
+ type JSXAttribute,
7
+ type JSXElement,
8
+ type Node,
8
9
  } from 'jscodeshift';
9
- import { Collection } from 'jscodeshift/src/Collection';
10
+ import { type Collection } from 'jscodeshift/src/Collection';
10
11
 
11
12
  export type Nullable<T> = T | null;
12
13
 
@@ -343,7 +343,9 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
343
343
  style = _ref2.style;
344
344
  return /*#__PURE__*/_react.default.createElement(_reactNodeResolver.default, {
345
345
  innerRef: _this.resolveMenuRef(ref)
346
- }, /*#__PURE__*/_react.default.createElement(_components.MenuDialog, {
346
+ }, /*#__PURE__*/_react.default.createElement(_components.MenuDialog
347
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
348
+ , {
347
349
  style: style,
348
350
  "data-placement": placement,
349
351
  minWidth: minMenuWidth,
@@ -40,7 +40,9 @@ var MenuDialog = exports.MenuDialog = function MenuDialog(_ref) {
40
40
  {
41
41
  maxWidth: maxWidth,
42
42
  minWidth: minWidth
43
- }],
43
+ }]
44
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
45
+ ,
44
46
  style: style,
45
47
  id: id,
46
48
  "data-testid": testId && "".concat(testId, "--menu")
@@ -9,7 +9,7 @@ var _reactSelect = _interopRequireDefault(require("react-select"));
9
9
  var _analyticsNext = require("@atlaskit/analytics-next");
10
10
  var _createSelect = _interopRequireDefault(require("./createSelect"));
11
11
  var packageName = "@atlaskit/select";
12
- var packageVersion = "17.8.0";
12
+ var packageVersion = "17.10.0";
13
13
  var SelectWithoutAnalytics = exports.SelectWithoutAnalytics = (0, _createSelect.default)(_reactSelect.default);
14
14
  var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
15
15
  var Select = (0, _analyticsNext.withAnalyticsContext)({
@@ -9,12 +9,13 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _react = require("@emotion/react");
11
11
  var _reactSelect = require("react-select");
12
+ var _primitives = require("@atlaskit/primitives");
12
13
  var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
13
14
  var _selectClear = _interopRequireDefault(require("@atlaskit/icon/glyph/select-clear"));
14
15
  var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
15
16
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
16
17
  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; } /** @jsx jsx */
17
- var iconContainerStyles = (0, _react.css)({
18
+ var iconContainerStyles = (0, _primitives.xcss)({
18
19
  all: 'unset',
19
20
  outline: 'revert',
20
21
  display: 'flex',
@@ -25,9 +26,8 @@ var ClearIndicator = exports.ClearIndicator = function ClearIndicator(props) {
25
26
  innerProps: _objectSpread(_objectSpread({}, props.innerProps), {}, {
26
27
  'aria-hidden': 'false'
27
28
  })
28
- }), (0, _react.jsx)("button", {
29
- css: iconContainerStyles,
30
- type: "button",
29
+ }), (0, _react.jsx)(_primitives.Pressable, {
30
+ xcss: iconContainerStyles,
31
31
  tabIndex: -1
32
32
  }, (0, _react.jsx)(_selectClear.default, {
33
33
  size: "small",
@@ -202,7 +202,7 @@ var ControlOption = /*#__PURE__*/function (_Component) {
202
202
  return (
203
203
  // These need to remain this way because `react-select` passes props with
204
204
  // styles inside, and that must be done dynamically.
205
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
205
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
206
206
  (0, _react.jsx)("div", (0, _extends2.default)({
207
207
  css: styles,
208
208
  className: classes,
@@ -319,7 +319,9 @@ export default class PopupSelect extends PureComponent {
319
319
  style
320
320
  }) => /*#__PURE__*/React.createElement(NodeResolver, {
321
321
  innerRef: this.resolveMenuRef(ref)
322
- }, /*#__PURE__*/React.createElement(MenuDialog, {
322
+ }, /*#__PURE__*/React.createElement(MenuDialog
323
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
324
+ , {
323
325
  style: style,
324
326
  "data-placement": placement,
325
327
  minWidth: minMenuWidth,
@@ -33,7 +33,9 @@ export const MenuDialog = ({
33
33
  {
34
34
  maxWidth,
35
35
  minWidth
36
- }],
36
+ }]
37
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
38
+ ,
37
39
  style: style,
38
40
  id: id,
39
41
  "data-testid": testId && `${testId}--menu`
@@ -2,7 +2,7 @@ import ReactSelect from 'react-select';
2
2
  import { withAnalyticsEvents, withAnalyticsContext, createAndFireEvent } from '@atlaskit/analytics-next';
3
3
  import createSelect from './createSelect';
4
4
  const packageName = "@atlaskit/select";
5
- const packageVersion = "17.8.0";
5
+ const packageVersion = "17.10.0";
6
6
  export const SelectWithoutAnalytics = createSelect(ReactSelect);
7
7
  const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
8
8
  const Select = withAnalyticsContext({
@@ -2,10 +2,11 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  /** @jsx jsx */
3
3
  import { jsx, css } from '@emotion/react';
4
4
  import { components } from 'react-select';
5
+ import { Pressable, xcss } from '@atlaskit/primitives';
5
6
  import Spinner from '@atlaskit/spinner';
6
7
  import SelectClearIcon from '@atlaskit/icon/glyph/select-clear';
7
8
  import DownIcon from '@atlaskit/icon/glyph/chevron-down';
8
- const iconContainerStyles = css({
9
+ const iconContainerStyles = xcss({
9
10
  all: 'unset',
10
11
  outline: 'revert',
11
12
  display: 'flex',
@@ -16,9 +17,8 @@ export const ClearIndicator = props => jsx(components.ClearIndicator, _extends({
16
17
  ...props.innerProps,
17
18
  'aria-hidden': 'false'
18
19
  }
19
- }), jsx("button", {
20
- css: iconContainerStyles,
21
- type: "button",
20
+ }), jsx(Pressable, {
21
+ xcss: iconContainerStyles,
22
22
  tabIndex: -1
23
23
  }, jsx(SelectClearIcon, {
24
24
  size: "small",
@@ -175,7 +175,7 @@ class ControlOption extends Component {
175
175
  return (
176
176
  // These need to remain this way because `react-select` passes props with
177
177
  // styles inside, and that must be done dynamically.
178
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
178
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
179
179
  jsx("div", _extends({
180
180
  css: styles,
181
181
  className: classes,
@@ -333,7 +333,9 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
333
333
  style = _ref2.style;
334
334
  return /*#__PURE__*/React.createElement(NodeResolver, {
335
335
  innerRef: _this.resolveMenuRef(ref)
336
- }, /*#__PURE__*/React.createElement(MenuDialog, {
336
+ }, /*#__PURE__*/React.createElement(MenuDialog
337
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
338
+ , {
337
339
  style: style,
338
340
  "data-placement": placement,
339
341
  minWidth: minMenuWidth,
@@ -35,7 +35,9 @@ export var MenuDialog = function MenuDialog(_ref) {
35
35
  {
36
36
  maxWidth: maxWidth,
37
37
  minWidth: minWidth
38
- }],
38
+ }]
39
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
40
+ ,
39
41
  style: style,
40
42
  id: id,
41
43
  "data-testid": testId && "".concat(testId, "--menu")
@@ -2,7 +2,7 @@ import ReactSelect from 'react-select';
2
2
  import { withAnalyticsEvents, withAnalyticsContext, createAndFireEvent } from '@atlaskit/analytics-next';
3
3
  import createSelect from './createSelect';
4
4
  var packageName = "@atlaskit/select";
5
- var packageVersion = "17.8.0";
5
+ var packageVersion = "17.10.0";
6
6
  export var SelectWithoutAnalytics = createSelect(ReactSelect);
7
7
  var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
8
8
  var Select = withAnalyticsContext({
@@ -5,10 +5,11 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
5
5
  /** @jsx jsx */
6
6
  import { jsx, css } from '@emotion/react';
7
7
  import { components } from 'react-select';
8
+ import { Pressable, xcss } from '@atlaskit/primitives';
8
9
  import Spinner from '@atlaskit/spinner';
9
10
  import SelectClearIcon from '@atlaskit/icon/glyph/select-clear';
10
11
  import DownIcon from '@atlaskit/icon/glyph/chevron-down';
11
- var iconContainerStyles = css({
12
+ var iconContainerStyles = xcss({
12
13
  all: 'unset',
13
14
  outline: 'revert',
14
15
  display: 'flex',
@@ -19,9 +20,8 @@ export var ClearIndicator = function ClearIndicator(props) {
19
20
  innerProps: _objectSpread(_objectSpread({}, props.innerProps), {}, {
20
21
  'aria-hidden': 'false'
21
22
  })
22
- }), jsx("button", {
23
- css: iconContainerStyles,
24
- type: "button",
23
+ }), jsx(Pressable, {
24
+ xcss: iconContainerStyles,
25
25
  tabIndex: -1
26
26
  }, jsx(SelectClearIcon, {
27
27
  size: "small",
@@ -196,7 +196,7 @@ var ControlOption = /*#__PURE__*/function (_Component) {
196
196
  return (
197
197
  // These need to remain this way because `react-select` passes props with
198
198
  // styles inside, and that must be done dynamically.
199
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
199
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
200
200
  jsx("div", _extends({
201
201
  css: styles,
202
202
  className: classes,
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { SelectProps, OptionType } from './types';
2
+ import { type SelectProps, type OptionType } from './types';
3
3
  declare const CheckboxSelect: <OptionT extends OptionType>({ components, ...props }: SelectProps<OptionT, true>) => JSX.Element;
4
4
  export default CheckboxSelect;
@@ -1,6 +1,6 @@
1
1
  import { jsx } from '@emotion/react';
2
2
  import { groupedCountries } from './data/countries';
3
- import { SelectProps } from './types';
3
+ import { type SelectProps } from './types';
4
4
  type Country = (typeof groupedCountries)[number]['options'][number];
5
5
  declare const CountrySelect: (props: SelectProps<Country>) => jsx.JSX.Element;
6
6
  export default CountrySelect;
@@ -1,7 +1,7 @@
1
- import React, { KeyboardEventHandler, PureComponent, ReactNode } from 'react';
2
- import { PopperProps } from 'react-popper';
3
- import { OptionType, ActionMeta, ReactSelectProps, StylesConfig, ValueType, ValidationState, AtlaskitSelectRefType } from '../types';
4
- import { UnbindFn } from 'bind-event-listener';
1
+ import React, { type KeyboardEventHandler, PureComponent, type ReactNode } from 'react';
2
+ import { type PopperProps } from 'react-popper';
3
+ import { type OptionType, type ActionMeta, type ReactSelectProps, type StylesConfig, type ValueType, type ValidationState, type AtlaskitSelectRefType } from '../types';
4
+ import { type UnbindFn } from 'bind-event-listener';
5
5
  type defaultModifiers = 'offset' | 'preventOverflow';
6
6
  type PopperPropsNoChildren<Modifiers> = Omit<PopperProps<Modifiers>, 'children'>;
7
7
  interface PopupSelectTriggerProps {
@@ -97,7 +97,9 @@ export default class PopupSelect<Option = OptionType, IsMulti extends boolean =
97
97
  isOpen: boolean;
98
98
  mergedComponents: {
99
99
  Control: React.FC<import("../types").ControlProps<OptionType, boolean>>;
100
- DropdownIndicator: () => import("@emotion/react").jsx.JSX.Element;
100
+ DropdownIndicator: () => import("@emotion/react").jsx.JSX.Element; /**
101
+ * The maximum number of options the select can contain without rendering the search field. The default is `5`.
102
+ */
101
103
  Menu: ({ children, innerProps }: import("../types").MenuProps<OptionType, boolean>) => import("@emotion/react").jsx.JSX.Element;
102
104
  };
103
105
  mergedPopperProps: PopperPropsNoChildren<string>;
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
- import { FC, ReactNode, CSSProperties } from 'react';
2
+ import { type FC, type ReactNode, type CSSProperties } from 'react';
3
3
  import { jsx } from '@emotion/react';
4
- import { ControlProps, MenuProps, OptionType } from '../types';
4
+ import { type ControlProps, type MenuProps, type OptionType } from '../types';
5
5
  interface MenuDialogProps {
6
6
  maxWidth?: number | string;
7
7
  minWidth?: number | string;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { SelectProps, OptionType } from './types';
2
+ import { type SelectProps, type OptionType } from './types';
3
3
  declare const RadioSelect: React.MemoExoticComponent<({ components, ...props }: SelectProps<OptionType>) => JSX.Element>;
4
4
  export default RadioSelect;
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/react';
3
- import { MultiValueRemoveProps } from '../types';
3
+ import { type MultiValueRemoveProps } from '../types';
4
4
  export { ClearIndicator, DropdownIndicator, LoadingIndicator, } from './indicators';
5
5
  export declare const MultiValueRemove: (props: MultiValueRemoveProps<any>) => jsx.JSX.Element;
6
6
  export declare const IndicatorSeparator: null;
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/react';
3
- import { ClearIndicatorProps, DropdownIndicatorProps, LoadingIndicatorProps } from '../types';
3
+ import { type ClearIndicatorProps, type DropdownIndicatorProps, type LoadingIndicatorProps } from '../types';
4
4
  export declare const ClearIndicator: <Option extends unknown, IsMulti extends boolean = false>(props: ClearIndicatorProps<Option, IsMulti>) => jsx.JSX.Element;
5
5
  export declare const DropdownIndicator: <Option extends unknown, IsMulti extends boolean = false>(props: DropdownIndicatorProps<Option, IsMulti>) => jsx.JSX.Element;
6
6
  export declare const LoadingIndicator: <Option extends unknown, IsMulti extends boolean = false>(props: LoadingIndicatorProps<Option, IsMulti>) => jsx.JSX.Element;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { InputProps } from 'react-select';
2
+ import { type InputProps } from 'react-select';
3
3
  import type { OptionType } from '../types';
4
4
  export declare function Input<Option = OptionType, IsMulti extends boolean = false>(props: InputProps<Option, IsMulti>): JSX.Element;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  /** @jsx jsx */
3
3
  import { jsx } from '@emotion/react';
4
- import { OptionProps, OptionType } from '../types';
4
+ import { type OptionProps, type OptionType } from '../types';
5
5
  export declare const CheckboxOption: <OptionT extends OptionType>(props: OptionProps<OptionT, true>) => JSX.Element;
6
6
  export declare const RadioOption: <OptionT extends OptionType>(props: OptionProps<OptionT, false>) => jsx.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { type ComponentType, type Ref } from 'react';
2
- import { SelectProps, OptionType, AsyncSelectProps, CreatableSelectProps, AtlaskitSelectRefType } from './types';
2
+ import { type SelectProps, type OptionType, type AsyncSelectProps, type CreatableSelectProps, type AtlaskitSelectRefType } from './types';
3
3
  type AtlaskitSelectProps<Option extends unknown, IsMulti extends boolean> = SelectProps<Option, IsMulti> | AsyncSelectProps<Option, IsMulti> | CreatableSelectProps<Option, IsMulti>;
4
4
  export default function createSelect(WrappedComponent: ComponentType<any>): <Option extends unknown = OptionType, IsMulti extends boolean = false>(props: AtlaskitSelectProps<Option, IsMulti> & {
5
5
  ref?: Ref<AtlaskitSelectRefType>;
@@ -1,2 +1,2 @@
1
- import { SelectProps, OptionType } from '../types';
1
+ import { type SelectProps, type OptionType } from '../types';
2
2
  export default function ertHackForSelect(_: SelectProps<OptionType>): void;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { Modifier, Options } from '@popperjs/core';
2
+ import { type Modifier, type Options } from '@popperjs/core';
3
3
  type Placement = 'auto' | 'auto-start' | 'auto-end' | 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'right' | 'right-start' | 'right-end' | 'left' | 'left-start' | 'left-end';
4
4
  type Strategy = 'absolute' | 'fixed';
5
5
  interface NativeReactPopperProps<Name = unknown> {
@@ -1,4 +1,4 @@
1
- import { GroupBase, OptionsOrGroups } from 'react-select';
1
+ import { type GroupBase, type OptionsOrGroups } from 'react-select';
2
2
  export interface ReactSelectAsyncProps<Option = unknown, Group extends GroupBase<Option> = GroupBase<Option>> {
3
3
  /**
4
4
  * The default set of options to show before the user starts searching. When
@@ -1,5 +1,5 @@
1
- import { ReactNode } from 'react';
2
- import { GetOptionLabel, GetOptionValue, GroupBase, Options, OptionsOrGroups } from 'react-select';
1
+ import { type ReactNode } from 'react';
2
+ import { type GetOptionLabel, type GetOptionValue, type GroupBase, type Options, type OptionsOrGroups } from 'react-select';
3
3
  export interface Accessors<Option> {
4
4
  getOptionValue: GetOptionValue<Option>;
5
5
  getOptionLabel: GetOptionLabel<Option>;
@@ -1,11 +1,11 @@
1
- import { FocusEventHandler, KeyboardEventHandler, ReactNode } from 'react';
1
+ import { type FocusEventHandler, type KeyboardEventHandler, type ReactNode } from 'react';
2
2
  interface FilterOptionOption<Option> {
3
3
  readonly label: string;
4
4
  readonly value: string;
5
5
  readonly data: Option;
6
6
  }
7
- import { StylesConfig } from '../types';
8
- import { ActionMeta, AriaLiveMessages, FormatOptionLabelMeta, GetOptionLabel, GetOptionValue, GroupBase, InputActionMeta, MenuPlacement, MenuPosition, OnChangeValue, Options, OptionsOrGroups, PropsValue, SelectComponentsConfig, ThemeConfig } from 'react-select';
7
+ import { type StylesConfig } from '../types';
8
+ import { type ActionMeta, type AriaLiveMessages, type FormatOptionLabelMeta, type GetOptionLabel, type GetOptionValue, type GroupBase, type InputActionMeta, type MenuPlacement, type MenuPosition, type OnChangeValue, type Options, type OptionsOrGroups, type PropsValue, type SelectComponentsConfig, type ThemeConfig } from 'react-select';
9
9
  interface NativeReactSelectProps<Option = unknown, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>> {
10
10
  /** Use this to provide a descriptive name for people who use assistive technology. */
11
11
  'aria-label'?: string;
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
- import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
- import { SelectInstance, Props as ReactSelectProps, FormatOptionLabelMeta, OnChangeValue as RSValueType, ActionMeta as RSActionMeta, GroupBase as GroupType, Options as RSOptionsType, SelectComponentsConfig as RSSelectComponentsConfig, StylesConfig as RSStylesConfig, InputActionMeta, ClearIndicatorProps, DropdownIndicatorProps, IndicatorSeparatorProps, LoadingIndicatorProps, NoticeProps, ControlProps as RSControlProps, GroupProps as RSGroupProps, InputProps, MenuProps as RSMenuProps, MenuListProps as RSMenuListComponentProps, MultiValueProps, OptionProps as ReactSelectOptionProps, PlaceholderProps as RSPlaceholderProps, SingleValueProps, ValueContainerProps as RSValueContainerProps, MultiValueRemoveProps } from 'react-select';
4
- import BaseSelect from 'react-select/base';
5
- import { AsyncProps } from 'react-select/async';
6
- import { CreatableProps } from 'react-select/creatable';
2
+ import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
+ import { type SelectInstance, type Props as ReactSelectProps, type FormatOptionLabelMeta, type OnChangeValue as RSValueType, type ActionMeta as RSActionMeta, type GroupBase as GroupType, type Options as RSOptionsType, type SelectComponentsConfig as RSSelectComponentsConfig, type StylesConfig as RSStylesConfig, type InputActionMeta, type ClearIndicatorProps, type DropdownIndicatorProps, type IndicatorSeparatorProps, type LoadingIndicatorProps, type NoticeProps, type ControlProps as RSControlProps, type GroupProps as RSGroupProps, type InputProps, type MenuProps as RSMenuProps, type MenuListProps as RSMenuListComponentProps, type MultiValueProps, type OptionProps as ReactSelectOptionProps, type PlaceholderProps as RSPlaceholderProps, type SingleValueProps, type ValueContainerProps as RSValueContainerProps, type MultiValueRemoveProps } from 'react-select';
4
+ import type BaseSelect from 'react-select/base';
5
+ import { type AsyncProps } from 'react-select/async';
6
+ import { type CreatableProps } from 'react-select/creatable';
7
7
  export type ValidationState = 'default' | 'error' | 'success';
8
8
  export interface OptionType {
9
9
  [key: string]: any;
@@ -1,4 +1,4 @@
1
- import { AriaOnFocusProps, GroupBase, OptionsOrGroups } from 'react-select';
2
- import { GroupType, OptionType } from '../types';
1
+ import { type AriaOnFocusProps, type GroupBase, type OptionsOrGroups } from 'react-select';
2
+ import { type GroupType, type OptionType } from '../types';
3
3
  export declare function onFocus(props: AriaOnFocusProps<OptionType, GroupBase<OptionType>>): string;
4
4
  export declare const isOptionsGrouped: (arr: OptionsOrGroups<OptionType, GroupType<OptionType>> | undefined) => boolean | undefined;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { SelectProps, OptionType } from './types';
2
+ import { type SelectProps, type OptionType } from './types';
3
3
  declare const CheckboxSelect: <OptionT extends OptionType>({ components, ...props }: SelectProps<OptionT, true>) => JSX.Element;
4
4
  export default CheckboxSelect;
@@ -1,6 +1,6 @@
1
1
  import { jsx } from '@emotion/react';
2
2
  import { groupedCountries } from './data/countries';
3
- import { SelectProps } from './types';
3
+ import { type SelectProps } from './types';
4
4
  type Country = (typeof groupedCountries)[number]['options'][number];
5
5
  declare const CountrySelect: (props: SelectProps<Country>) => jsx.JSX.Element;
6
6
  export default CountrySelect;
@@ -1,7 +1,7 @@
1
- import React, { KeyboardEventHandler, PureComponent, ReactNode } from 'react';
2
- import { PopperProps } from 'react-popper';
3
- import { OptionType, ActionMeta, ReactSelectProps, StylesConfig, ValueType, ValidationState, AtlaskitSelectRefType } from '../types';
4
- import { UnbindFn } from 'bind-event-listener';
1
+ import React, { type KeyboardEventHandler, PureComponent, type ReactNode } from 'react';
2
+ import { type PopperProps } from 'react-popper';
3
+ import { type OptionType, type ActionMeta, type ReactSelectProps, type StylesConfig, type ValueType, type ValidationState, type AtlaskitSelectRefType } from '../types';
4
+ import { type UnbindFn } from 'bind-event-listener';
5
5
  type defaultModifiers = 'offset' | 'preventOverflow';
6
6
  type PopperPropsNoChildren<Modifiers> = Omit<PopperProps<Modifiers>, 'children'>;
7
7
  interface PopupSelectTriggerProps {
@@ -97,7 +97,9 @@ export default class PopupSelect<Option = OptionType, IsMulti extends boolean =
97
97
  isOpen: boolean;
98
98
  mergedComponents: {
99
99
  Control: React.FC<import("../types").ControlProps<OptionType, boolean>>;
100
- DropdownIndicator: () => import("@emotion/react").jsx.JSX.Element;
100
+ DropdownIndicator: () => import("@emotion/react").jsx.JSX.Element; /**
101
+ * The maximum number of options the select can contain without rendering the search field. The default is `5`.
102
+ */
101
103
  Menu: ({ children, innerProps }: import("../types").MenuProps<OptionType, boolean>) => import("@emotion/react").jsx.JSX.Element;
102
104
  };
103
105
  mergedPopperProps: PopperPropsNoChildren<string>;
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
- import { FC, ReactNode, CSSProperties } from 'react';
2
+ import { type FC, type ReactNode, type CSSProperties } from 'react';
3
3
  import { jsx } from '@emotion/react';
4
- import { ControlProps, MenuProps, OptionType } from '../types';
4
+ import { type ControlProps, type MenuProps, type OptionType } from '../types';
5
5
  interface MenuDialogProps {
6
6
  maxWidth?: number | string;
7
7
  minWidth?: number | string;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { SelectProps, OptionType } from './types';
2
+ import { type SelectProps, type OptionType } from './types';
3
3
  declare const RadioSelect: React.MemoExoticComponent<({ components, ...props }: SelectProps<OptionType>) => JSX.Element>;
4
4
  export default RadioSelect;
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/react';
3
- import { MultiValueRemoveProps } from '../types';
3
+ import { type MultiValueRemoveProps } from '../types';
4
4
  export { ClearIndicator, DropdownIndicator, LoadingIndicator, } from './indicators';
5
5
  export declare const MultiValueRemove: (props: MultiValueRemoveProps<any>) => jsx.JSX.Element;
6
6
  export declare const IndicatorSeparator: null;
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/react';
3
- import { ClearIndicatorProps, DropdownIndicatorProps, LoadingIndicatorProps } from '../types';
3
+ import { type ClearIndicatorProps, type DropdownIndicatorProps, type LoadingIndicatorProps } from '../types';
4
4
  export declare const ClearIndicator: <Option extends unknown, IsMulti extends boolean = false>(props: ClearIndicatorProps<Option, IsMulti>) => jsx.JSX.Element;
5
5
  export declare const DropdownIndicator: <Option extends unknown, IsMulti extends boolean = false>(props: DropdownIndicatorProps<Option, IsMulti>) => jsx.JSX.Element;
6
6
  export declare const LoadingIndicator: <Option extends unknown, IsMulti extends boolean = false>(props: LoadingIndicatorProps<Option, IsMulti>) => jsx.JSX.Element;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { InputProps } from 'react-select';
2
+ import { type InputProps } from 'react-select';
3
3
  import type { OptionType } from '../types';
4
4
  export declare function Input<Option = OptionType, IsMulti extends boolean = false>(props: InputProps<Option, IsMulti>): JSX.Element;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  /** @jsx jsx */
3
3
  import { jsx } from '@emotion/react';
4
- import { OptionProps, OptionType } from '../types';
4
+ import { type OptionProps, type OptionType } from '../types';
5
5
  export declare const CheckboxOption: <OptionT extends OptionType>(props: OptionProps<OptionT, true>) => JSX.Element;
6
6
  export declare const RadioOption: <OptionT extends OptionType>(props: OptionProps<OptionT, false>) => jsx.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { type ComponentType, type Ref } from 'react';
2
- import { SelectProps, OptionType, AsyncSelectProps, CreatableSelectProps, AtlaskitSelectRefType } from './types';
2
+ import { type SelectProps, type OptionType, type AsyncSelectProps, type CreatableSelectProps, type AtlaskitSelectRefType } from './types';
3
3
  type AtlaskitSelectProps<Option extends unknown, IsMulti extends boolean> = SelectProps<Option, IsMulti> | AsyncSelectProps<Option, IsMulti> | CreatableSelectProps<Option, IsMulti>;
4
4
  export default function createSelect(WrappedComponent: ComponentType<any>): <Option extends unknown = OptionType, IsMulti extends boolean = false>(props: AtlaskitSelectProps<Option, IsMulti> & {
5
5
  ref?: Ref<AtlaskitSelectRefType>;
@@ -1,2 +1,2 @@
1
- import { SelectProps, OptionType } from '../types';
1
+ import { type SelectProps, type OptionType } from '../types';
2
2
  export default function ertHackForSelect(_: SelectProps<OptionType>): void;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { Modifier, Options } from '@popperjs/core';
2
+ import { type Modifier, type Options } from '@popperjs/core';
3
3
  type Placement = 'auto' | 'auto-start' | 'auto-end' | 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'right' | 'right-start' | 'right-end' | 'left' | 'left-start' | 'left-end';
4
4
  type Strategy = 'absolute' | 'fixed';
5
5
  interface NativeReactPopperProps<Name = unknown> {
@@ -1,4 +1,4 @@
1
- import { GroupBase, OptionsOrGroups } from 'react-select';
1
+ import { type GroupBase, type OptionsOrGroups } from 'react-select';
2
2
  export interface ReactSelectAsyncProps<Option = unknown, Group extends GroupBase<Option> = GroupBase<Option>> {
3
3
  /**
4
4
  * The default set of options to show before the user starts searching. When
@@ -1,5 +1,5 @@
1
- import { ReactNode } from 'react';
2
- import { GetOptionLabel, GetOptionValue, GroupBase, Options, OptionsOrGroups } from 'react-select';
1
+ import { type ReactNode } from 'react';
2
+ import { type GetOptionLabel, type GetOptionValue, type GroupBase, type Options, type OptionsOrGroups } from 'react-select';
3
3
  export interface Accessors<Option> {
4
4
  getOptionValue: GetOptionValue<Option>;
5
5
  getOptionLabel: GetOptionLabel<Option>;
@@ -1,11 +1,11 @@
1
- import { FocusEventHandler, KeyboardEventHandler, ReactNode } from 'react';
1
+ import { type FocusEventHandler, type KeyboardEventHandler, type ReactNode } from 'react';
2
2
  interface FilterOptionOption<Option> {
3
3
  readonly label: string;
4
4
  readonly value: string;
5
5
  readonly data: Option;
6
6
  }
7
- import { StylesConfig } from '../types';
8
- import { ActionMeta, AriaLiveMessages, FormatOptionLabelMeta, GetOptionLabel, GetOptionValue, GroupBase, InputActionMeta, MenuPlacement, MenuPosition, OnChangeValue, Options, OptionsOrGroups, PropsValue, SelectComponentsConfig, ThemeConfig } from 'react-select';
7
+ import { type StylesConfig } from '../types';
8
+ import { type ActionMeta, type AriaLiveMessages, type FormatOptionLabelMeta, type GetOptionLabel, type GetOptionValue, type GroupBase, type InputActionMeta, type MenuPlacement, type MenuPosition, type OnChangeValue, type Options, type OptionsOrGroups, type PropsValue, type SelectComponentsConfig, type ThemeConfig } from 'react-select';
9
9
  interface NativeReactSelectProps<Option = unknown, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>> {
10
10
  /** Use this to provide a descriptive name for people who use assistive technology. */
11
11
  'aria-label'?: string;
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
- import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
- import { SelectInstance, Props as ReactSelectProps, FormatOptionLabelMeta, OnChangeValue as RSValueType, ActionMeta as RSActionMeta, GroupBase as GroupType, Options as RSOptionsType, SelectComponentsConfig as RSSelectComponentsConfig, StylesConfig as RSStylesConfig, InputActionMeta, ClearIndicatorProps, DropdownIndicatorProps, IndicatorSeparatorProps, LoadingIndicatorProps, NoticeProps, ControlProps as RSControlProps, GroupProps as RSGroupProps, InputProps, MenuProps as RSMenuProps, MenuListProps as RSMenuListComponentProps, MultiValueProps, OptionProps as ReactSelectOptionProps, PlaceholderProps as RSPlaceholderProps, SingleValueProps, ValueContainerProps as RSValueContainerProps, MultiValueRemoveProps } from 'react-select';
4
- import BaseSelect from 'react-select/base';
5
- import { AsyncProps } from 'react-select/async';
6
- import { CreatableProps } from 'react-select/creatable';
2
+ import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
+ import { type SelectInstance, type Props as ReactSelectProps, type FormatOptionLabelMeta, type OnChangeValue as RSValueType, type ActionMeta as RSActionMeta, type GroupBase as GroupType, type Options as RSOptionsType, type SelectComponentsConfig as RSSelectComponentsConfig, type StylesConfig as RSStylesConfig, type InputActionMeta, type ClearIndicatorProps, type DropdownIndicatorProps, type IndicatorSeparatorProps, type LoadingIndicatorProps, type NoticeProps, type ControlProps as RSControlProps, type GroupProps as RSGroupProps, type InputProps, type MenuProps as RSMenuProps, type MenuListProps as RSMenuListComponentProps, type MultiValueProps, type OptionProps as ReactSelectOptionProps, type PlaceholderProps as RSPlaceholderProps, type SingleValueProps, type ValueContainerProps as RSValueContainerProps, type MultiValueRemoveProps } from 'react-select';
4
+ import type BaseSelect from 'react-select/base';
5
+ import { type AsyncProps } from 'react-select/async';
6
+ import { type CreatableProps } from 'react-select/creatable';
7
7
  export type ValidationState = 'default' | 'error' | 'success';
8
8
  export interface OptionType {
9
9
  [key: string]: any;
@@ -1,4 +1,4 @@
1
- import { AriaOnFocusProps, GroupBase, OptionsOrGroups } from 'react-select';
2
- import { GroupType, OptionType } from '../types';
1
+ import { type AriaOnFocusProps, type GroupBase, type OptionsOrGroups } from 'react-select';
2
+ import { type GroupType, type OptionType } from '../types';
3
3
  export declare function onFocus(props: AriaOnFocusProps<OptionType, GroupBase<OptionType>>): string;
4
4
  export declare const isOptionsGrouped: (arr: OptionsOrGroups<OptionType, GroupType<OptionType>> | undefined) => boolean | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/select",
3
- "version": "17.8.0",
3
+ "version": "17.10.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/"
@@ -31,7 +31,8 @@
31
31
  "website": {
32
32
  "name": "Select",
33
33
  "category": "Components"
34
- }
34
+ },
35
+ "runReact18": true
35
36
  },
36
37
  "af:exports": {
37
38
  "./AsyncSelect": "./src/entry-points/async-select.tsx",
@@ -42,25 +43,26 @@
42
43
  },
43
44
  "dependencies": {
44
45
  "@atlaskit/analytics-next": "^9.3.0",
45
- "@atlaskit/icon": "^22.1.0",
46
+ "@atlaskit/icon": "^22.3.0",
46
47
  "@atlaskit/platform-feature-flags": "^0.2.0",
48
+ "@atlaskit/primitives": "^6.3.0",
47
49
  "@atlaskit/spinner": "^16.1.0",
48
- "@atlaskit/theme": "^12.7.0",
49
- "@atlaskit/tokens": "^1.45.0",
50
+ "@atlaskit/theme": "^12.8.0",
51
+ "@atlaskit/tokens": "^1.49.0",
50
52
  "@atlaskit/visually-hidden": "^1.3.0",
51
53
  "@babel/runtime": "^7.0.0",
52
54
  "@emotion/react": "^11.7.1",
53
- "@popperjs/core": "^2.9.1",
55
+ "@popperjs/core": "^2.11.8",
54
56
  "bind-event-listener": "^3.0.0",
55
57
  "react-focus-lock": "^2.9.5",
56
58
  "react-node-resolver": "^1.0.1",
57
- "react-popper": "^2.2.3",
59
+ "react-popper": "^2.3.0",
58
60
  "react-select": "^5.4.0",
59
61
  "react-uid": "^2.2.0",
60
62
  "shallow-equal": "^3.1.0"
61
63
  },
62
64
  "peerDependencies": {
63
- "react": "^16.8.0",
65
+ "react": "^16.8.0 || ^17.0.0 || ~18.2.0",
64
66
  "react-dom": "^16.8.0"
65
67
  },
66
68
  "devDependencies": {
@@ -81,6 +83,7 @@
81
83
  "ast-types": "^0.13.3",
82
84
  "jscodeshift": "^0.13.0",
83
85
  "react-dom": "^16.8.0",
86
+ "react-select-event": "^5.5.0",
84
87
  "react-value": "^0.2.0",
85
88
  "typescript": "~5.4.2",
86
89
  "wait-for-expect": "^1.2.0"