@atlaskit/select 16.1.9 → 16.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/Select.js +1 -1
  3. package/dist/cjs/version.json +1 -1
  4. package/dist/es2019/Select.js +1 -1
  5. package/dist/es2019/version.json +1 -1
  6. package/dist/esm/Select.js +1 -1
  7. package/dist/esm/version.json +1 -1
  8. package/dist/types/CountrySelect.d.ts +1 -1
  9. package/dist/types-ts4.0/AsyncCreatableSelect.d.ts +44 -0
  10. package/dist/types-ts4.0/AsyncSelect.d.ts +44 -0
  11. package/dist/types-ts4.0/CheckboxSelect.d.ts +4 -0
  12. package/dist/types-ts4.0/CountrySelect.d.ts +6 -0
  13. package/dist/types-ts4.0/CreatableSelect.d.ts +44 -0
  14. package/dist/types-ts4.0/PopupSelect/PopupSelect.d.ts +147 -0
  15. package/dist/types-ts4.0/PopupSelect/components.d.ts +19 -0
  16. package/dist/types-ts4.0/PopupSelect/index.d.ts +2 -0
  17. package/dist/types-ts4.0/RadioSelect.d.ts +4 -0
  18. package/dist/types-ts4.0/Select.d.ts +86 -0
  19. package/dist/types-ts4.0/components/index.d.ts +6 -0
  20. package/dist/types-ts4.0/components/indicators.d.ts +5 -0
  21. package/dist/types-ts4.0/components/input-options.d.ts +4 -0
  22. package/dist/types-ts4.0/createSelect.d.ts +45 -0
  23. package/dist/types-ts4.0/data/countries.d.ts +19 -0
  24. package/dist/types-ts4.0/entry-points/async-creatable-select.d.ts +1 -0
  25. package/dist/types-ts4.0/entry-points/async-select.d.ts +1 -0
  26. package/dist/types-ts4.0/entry-points/creatable-select.d.ts +1 -0
  27. package/dist/types-ts4.0/entry-points/select.d.ts +1 -0
  28. package/dist/types-ts4.0/extract-react-types/ert.d.ts +2 -0
  29. package/dist/types-ts4.0/extract-react-types/react-popper-props.d.ts +21 -0
  30. package/dist/types-ts4.0/extract-react-types/react-select-async.d.ts +24 -0
  31. package/dist/types-ts4.0/extract-react-types/react-select-creatable.d.ts +38 -0
  32. package/dist/types-ts4.0/extract-react-types/react-select-props.d.ts +182 -0
  33. package/dist/types-ts4.0/index.d.ts +19 -0
  34. package/dist/types-ts4.0/styles.d.ts +2 -0
  35. package/dist/types-ts4.0/types.d.ts +60 -0
  36. package/package.json +16 -17
  37. package/report.api.md +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/select
2
2
 
3
+ ## 16.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`ffeeae59446`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ffeeae59446) - Migrates unit tests from enzyme to RTL.
8
+
9
+ ## 16.2.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies
18
+
3
19
  ## 16.1.9
4
20
 
5
21
  ### Patch Changes
@@ -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 = "16.1.9";
12
+ var packageVersion = "16.2.1";
13
13
  var SelectWithoutAnalytics = (0, _createSelect.default)(_reactSelect.default);
14
14
  exports.SelectWithoutAnalytics = SelectWithoutAnalytics;
15
15
  var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/select",
3
- "version": "16.1.9",
3
+ "version": "16.2.1",
4
4
  "sideEffects": false
5
5
  }
@@ -2,7 +2,7 @@ import Select 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 = "16.1.9";
5
+ const packageVersion = "16.2.1";
6
6
  export const SelectWithoutAnalytics = createSelect(Select);
7
7
  const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
8
8
  export default withAnalyticsContext({
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/select",
3
- "version": "16.1.9",
3
+ "version": "16.2.1",
4
4
  "sideEffects": false
5
5
  }
@@ -2,7 +2,7 @@ import Select 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 = "16.1.9";
5
+ var packageVersion = "16.2.1";
6
6
  export var SelectWithoutAnalytics = createSelect(Select);
7
7
  var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
8
8
  export default withAnalyticsContext({
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/select",
3
- "version": "16.1.9",
3
+ "version": "16.2.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,6 +1,6 @@
1
1
  import { jsx } from '@emotion/react';
2
2
  import { groupedCountries } from './data/countries';
3
3
  import { SelectProps } from './types';
4
- declare type Country = typeof groupedCountries[number]['options'][number];
4
+ declare type Country = (typeof groupedCountries)[number]['options'][number];
5
5
  declare const CountrySelect: (props: SelectProps<Country>) => jsx.JSX.Element;
6
6
  export default CountrySelect;
@@ -0,0 +1,44 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ new <Option = import("./types").OptionType, IsMulti extends boolean = false>(props: import("./types").SelectProps<Option, IsMulti>): {
4
+ components: Partial<import("react-select/dist/declarations/src/components").SelectComponents<Option, IsMulti, import("react-select").GroupBase<Option>>>;
5
+ select: import("react-select/base").default<unknown, false, import("react-select").GroupBase<unknown>> | null;
6
+ UNSAFE_componentWillReceiveProps(nextProps: import("./types").SelectProps<Option, IsMulti>): void;
7
+ cacheComponents: (components: Partial<import("react-select/dist/declarations/src/components").SelectComponents<Option, IsMulti, import("react-select").GroupBase<Option>>>) => void;
8
+ focus(): void;
9
+ blur(): void;
10
+ onSelectRef: (ref: import("react-select/base").default<unknown, false, import("react-select").GroupBase<unknown>>) => void;
11
+ render(): JSX.Element;
12
+ context: any;
13
+ setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
14
+ forceUpdate(callBack?: (() => void) | undefined): void;
15
+ readonly props: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>> & Readonly<{
16
+ children?: import("react").ReactNode;
17
+ }>;
18
+ state: Readonly<{}>;
19
+ refs: {
20
+ [key: string]: import("react").ReactInstance;
21
+ };
22
+ componentDidMount?(): void;
23
+ shouldComponentUpdate?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): boolean;
24
+ componentWillUnmount?(): void;
25
+ componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
26
+ getSnapshotBeforeUpdate?(prevProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, prevState: Readonly<{}>): any;
27
+ componentDidUpdate?(prevProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, prevState: Readonly<{}>, snapshot?: any): void;
28
+ componentWillMount?(): void;
29
+ UNSAFE_componentWillMount?(): void;
30
+ componentWillReceiveProps?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextContext: any): void;
31
+ componentWillUpdate?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): void;
32
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): void;
33
+ };
34
+ defaultProps: {
35
+ validationState: string;
36
+ spacing: string;
37
+ onClickPreventDefault: boolean;
38
+ tabSelectsValue: boolean;
39
+ components: {};
40
+ styles: {};
41
+ };
42
+ contextType?: import("react").Context<any> | undefined;
43
+ };
44
+ export default _default;
@@ -0,0 +1,44 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ new <Option = import("./types").OptionType, IsMulti extends boolean = false>(props: import("./types").SelectProps<Option, IsMulti>): {
4
+ components: Partial<import("react-select/dist/declarations/src/components").SelectComponents<Option, IsMulti, import("react-select").GroupBase<Option>>>;
5
+ select: import("react-select/base").default<unknown, false, import("react-select").GroupBase<unknown>> | null;
6
+ UNSAFE_componentWillReceiveProps(nextProps: import("./types").SelectProps<Option, IsMulti>): void;
7
+ cacheComponents: (components: Partial<import("react-select/dist/declarations/src/components").SelectComponents<Option, IsMulti, import("react-select").GroupBase<Option>>>) => void;
8
+ focus(): void;
9
+ blur(): void;
10
+ onSelectRef: (ref: import("react-select/base").default<unknown, false, import("react-select").GroupBase<unknown>>) => void;
11
+ render(): JSX.Element;
12
+ context: any;
13
+ setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
14
+ forceUpdate(callBack?: (() => void) | undefined): void;
15
+ readonly props: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>> & Readonly<{
16
+ children?: import("react").ReactNode;
17
+ }>;
18
+ state: Readonly<{}>;
19
+ refs: {
20
+ [key: string]: import("react").ReactInstance;
21
+ };
22
+ componentDidMount?(): void;
23
+ shouldComponentUpdate?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): boolean;
24
+ componentWillUnmount?(): void;
25
+ componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
26
+ getSnapshotBeforeUpdate?(prevProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, prevState: Readonly<{}>): any;
27
+ componentDidUpdate?(prevProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, prevState: Readonly<{}>, snapshot?: any): void;
28
+ componentWillMount?(): void;
29
+ UNSAFE_componentWillMount?(): void;
30
+ componentWillReceiveProps?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextContext: any): void;
31
+ componentWillUpdate?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): void;
32
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): void;
33
+ };
34
+ defaultProps: {
35
+ validationState: string;
36
+ spacing: string;
37
+ onClickPreventDefault: boolean;
38
+ tabSelectsValue: boolean;
39
+ components: {};
40
+ styles: {};
41
+ };
42
+ contextType?: import("react").Context<any> | undefined;
43
+ };
44
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { SelectProps, OptionType } from './types';
3
+ declare const CheckboxSelect: ({ components, ...props }: SelectProps<OptionType, true>) => JSX.Element;
4
+ export default CheckboxSelect;
@@ -0,0 +1,6 @@
1
+ import { jsx } from '@emotion/react';
2
+ import { groupedCountries } from './data/countries';
3
+ import { SelectProps } from './types';
4
+ declare type Country = (typeof groupedCountries)[number]['options'][number];
5
+ declare const CountrySelect: (props: SelectProps<Country>) => jsx.JSX.Element;
6
+ export default CountrySelect;
@@ -0,0 +1,44 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ new <Option = import("./types").OptionType, IsMulti extends boolean = false>(props: import("./types").SelectProps<Option, IsMulti>): {
4
+ components: Partial<import("react-select/dist/declarations/src/components").SelectComponents<Option, IsMulti, import("react-select").GroupBase<Option>>>;
5
+ select: import("react-select/base").default<unknown, false, import("react-select").GroupBase<unknown>> | null;
6
+ UNSAFE_componentWillReceiveProps(nextProps: import("./types").SelectProps<Option, IsMulti>): void;
7
+ cacheComponents: (components: Partial<import("react-select/dist/declarations/src/components").SelectComponents<Option, IsMulti, import("react-select").GroupBase<Option>>>) => void;
8
+ focus(): void;
9
+ blur(): void;
10
+ onSelectRef: (ref: import("react-select/base").default<unknown, false, import("react-select").GroupBase<unknown>>) => void;
11
+ render(): JSX.Element;
12
+ context: any;
13
+ setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
14
+ forceUpdate(callBack?: (() => void) | undefined): void;
15
+ readonly props: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>> & Readonly<{
16
+ children?: import("react").ReactNode;
17
+ }>;
18
+ state: Readonly<{}>;
19
+ refs: {
20
+ [key: string]: import("react").ReactInstance;
21
+ };
22
+ componentDidMount?(): void;
23
+ shouldComponentUpdate?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): boolean;
24
+ componentWillUnmount?(): void;
25
+ componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
26
+ getSnapshotBeforeUpdate?(prevProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, prevState: Readonly<{}>): any;
27
+ componentDidUpdate?(prevProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, prevState: Readonly<{}>, snapshot?: any): void;
28
+ componentWillMount?(): void;
29
+ UNSAFE_componentWillMount?(): void;
30
+ componentWillReceiveProps?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextContext: any): void;
31
+ componentWillUpdate?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): void;
32
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): void;
33
+ };
34
+ defaultProps: {
35
+ validationState: string;
36
+ spacing: string;
37
+ onClickPreventDefault: boolean;
38
+ tabSelectsValue: boolean;
39
+ components: {};
40
+ styles: {};
41
+ };
42
+ contextType?: import("react").Context<any> | undefined;
43
+ };
44
+ export default _default;
@@ -0,0 +1,147 @@
1
+ import React, { PureComponent, ReactNode } from 'react';
2
+ import BaseSelect from 'react-select/base';
3
+ import { PopperProps } from 'react-popper';
4
+ import { OptionType, ActionMeta, ReactSelectProps, StylesConfig, ValueType, ValidationState } from '../types';
5
+ import { UnbindFn } from 'bind-event-listener';
6
+ declare type defaultModifiers = 'offset' | 'preventOverflow';
7
+ declare type PopperPropsNoChildren<Modifiers> = Omit<PopperProps<Modifiers>, 'children'>;
8
+ interface PopupSelectTriggerProps {
9
+ ref: any;
10
+ 'aria-haspopup': 'true';
11
+ 'aria-expanded': boolean;
12
+ 'aria-controls'?: string;
13
+ }
14
+ export declare type ModifierList = 'offset' | 'computeStyles' | 'preventOverflow' | 'handleFlipStyle' | 'flip' | 'popperOffsets' | 'arrow' | 'hide' | 'eventListeners' | 'applyStyles';
15
+ export interface PopupSelectProps<Option = OptionType, IsMulti extends boolean = false, Modifiers = ModifierList> extends ReactSelectProps<Option, IsMulti> {
16
+ /**
17
+ * Defines whether the menu should close when selected. Defaults to "true"
18
+ */
19
+ closeMenuOnSelect?: boolean;
20
+ /**
21
+ * The footer content shown at the bottom of the Popup, underneath the Select options
22
+ */
23
+ footer?: ReactNode;
24
+ /**
25
+ The props passed down to React Popper.
26
+
27
+ Use these to override the default positioning strategy, behaviour and placement used by this library.
28
+ For more information, see the Popper Props section below, or [React Popper documentation](https://popper.js.org/react-popper/v2/render-props).
29
+
30
+ */
31
+ popperProps?: PopperPropsNoChildren<Modifiers>;
32
+ /**
33
+ * The maximum number of options the select can contain without rendering the search field. Defaults to 5.
34
+ */
35
+ searchThreshold?: number;
36
+ /**
37
+ * If false, renders a select with no search field. If true, renders a search field in the select when the
38
+ * number of options exceeds the `searchThreshold`. Defaults to true.
39
+ */
40
+ isSearchable?: boolean;
41
+ /**
42
+ * The maximum width for the popup menu. Can be a number, representing width in pixels,
43
+ * or a string containing a CSS length datatype.
44
+ */
45
+ maxMenuWidth?: number | string;
46
+ /**
47
+ * The maximum width for the popup menu. Can be a number, representing width in pixels,
48
+ * or a string containing a CSS length datatype.
49
+ */
50
+ minMenuWidth?: number | string;
51
+ /**
52
+ Render props used to anchor the popup to your content.
53
+
54
+ Make this an interactive element, such as an @atlaskit/button component.
55
+
56
+ The provided render props in `options` are detailed below:
57
+ - `isOpen`: The current state of the popup.
58
+ Use this to change the appearance of your target based on the state of your component
59
+ - `ref`: Pass this ref to the element the Popup should be attached to
60
+ - `aria-haspopup`, `aria-expanded`, `aria-controls`: Spread these onto a target element to
61
+ ensure your experience is accessible
62
+ */
63
+ target?: (options: PopupSelectTriggerProps & {
64
+ isOpen: boolean;
65
+ }) => ReactNode;
66
+ isOpen?: boolean;
67
+ defaultIsOpen?: boolean;
68
+ /** The prop indicates if the component has a compacted look */
69
+ spacing?: string;
70
+ /** @deprecated Use isInvalid instead. The state of validation if used in a form */
71
+ validationState?: ValidationState;
72
+ /** This prop indicates if the component is in an error state */
73
+ isInvalid?: boolean;
74
+ testId?: string;
75
+ }
76
+ interface State<Modifiers = string> {
77
+ focusLockEnabled: boolean;
78
+ isOpen: boolean;
79
+ mergedComponents: Object;
80
+ mergedPopperProps: PopperPropsNoChildren<defaultModifiers | Modifiers>;
81
+ }
82
+ export default class PopupSelect<Option = OptionType, IsMulti extends boolean = false, Modifiers = ModifierList> extends PureComponent<PopupSelectProps<Option, IsMulti, Modifiers>, State> {
83
+ menuRef: HTMLElement | null;
84
+ selectRef: BaseSelect<Option, IsMulti> | null;
85
+ targetRef: HTMLElement | null;
86
+ unbindWindowClick: UnbindFn | null;
87
+ unbindWindowKeydown: UnbindFn | null;
88
+ defaultStyles: StylesConfig<Option, IsMulti>;
89
+ isOpenControlled: boolean;
90
+ defaultOpenState: boolean | undefined;
91
+ state: {
92
+ focusLockEnabled: boolean;
93
+ isOpen: boolean;
94
+ mergedComponents: {
95
+ Control: React.FC<import("../types").ControlProps<OptionType, boolean>>;
96
+ DropdownIndicator: () => import("@emotion/react").jsx.JSX.Element;
97
+ Menu: ({ children, innerProps, ...props }: import("../types").MenuProps<OptionType, boolean>) => import("@emotion/react").jsx.JSX.Element;
98
+ };
99
+ mergedPopperProps: PopperPropsNoChildren<string>;
100
+ };
101
+ popperWrapperId: string;
102
+ static defaultProps: {
103
+ closeMenuOnSelect: boolean;
104
+ components: {};
105
+ maxMenuHeight: number;
106
+ maxMenuWidth: number;
107
+ minMenuWidth: number;
108
+ popperProps: {};
109
+ isSearchable: boolean;
110
+ searchThreshold: number;
111
+ styles: {};
112
+ options: never[];
113
+ };
114
+ static getDerivedStateFromProps(props: PopupSelectProps<OptionType>, state: State): Partial<State<string>> | null;
115
+ componentDidMount(): void;
116
+ componentWillUnmount(): void;
117
+ componentDidUpdate(prevProps: PopupSelectProps<Option, IsMulti, Modifiers>): void;
118
+ handleKeyDown: (event: KeyboardEvent) => void;
119
+ handleClick: ({ target }: MouseEvent) => void;
120
+ handleSelectChange: (value: ValueType<Option, IsMulti>, actionMeta: ActionMeta<Option>) => void;
121
+ handleFirstPopperUpdate: () => void;
122
+ /**
123
+ * Opens the popup
124
+ *
125
+ * @param options.controlOverride - Force the popup to open when it's open state is being controlled
126
+ */
127
+ open: (options?: {
128
+ controlOverride?: boolean | undefined;
129
+ } | undefined) => void;
130
+ /**
131
+ * Closes the popup
132
+ *
133
+ * @param options.controlOverride - Force the popup to close when it's open state is being controlled
134
+ */
135
+ close: (options?: {
136
+ controlOverride?: boolean | undefined;
137
+ } | undefined) => void;
138
+ resolveTargetRef: (popperRef: React.Ref<HTMLElement>) => (ref: HTMLElement) => void;
139
+ resolveMenuRef: (popperRef: React.Ref<HTMLElement>) => (ref: HTMLElement) => void;
140
+ getSelectRef: (ref: BaseSelect<Option, IsMulti>) => void;
141
+ getItemCount: () => number;
142
+ getMaxHeight: () => number | undefined;
143
+ showSearchControl: () => boolean | undefined;
144
+ renderSelect: () => JSX.Element | null;
145
+ render(): JSX.Element;
146
+ }
147
+ export {};
@@ -0,0 +1,19 @@
1
+ /** @jsx jsx */
2
+ import { FC, ReactNode, CSSProperties } from 'react';
3
+ import { jsx } from '@emotion/react';
4
+ import { ControlProps, MenuProps, OptionType } from '../types';
5
+ interface MenuDialogProps {
6
+ maxWidth?: number | string;
7
+ minWidth?: number | string;
8
+ style: CSSProperties;
9
+ children: ReactNode;
10
+ id: string;
11
+ }
12
+ export declare const MenuDialog: FC<MenuDialogProps>;
13
+ export declare const DummyControl: FC<ControlProps<OptionType, boolean>>;
14
+ export declare const defaultComponents: {
15
+ Control: FC<ControlProps<OptionType, boolean>>;
16
+ DropdownIndicator: () => jsx.JSX.Element;
17
+ Menu: ({ children, innerProps, ...props }: MenuProps<OptionType, boolean>) => jsx.JSX.Element;
18
+ };
19
+ export {};
@@ -0,0 +1,2 @@
1
+ export { default } from './PopupSelect';
2
+ export type { PopupSelectProps, ModifierList } from './PopupSelect';
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { SelectProps, OptionType } from './types';
3
+ declare const RadioSelect: ({ components, ...props }: SelectProps<OptionType>) => JSX.Element;
4
+ export default RadioSelect;
@@ -0,0 +1,86 @@
1
+ /// <reference types="react" />
2
+ export declare const SelectWithoutAnalytics: {
3
+ new <Option = import("./types").OptionType, IsMulti extends boolean = false>(props: import("./types").SelectProps<Option, IsMulti>): {
4
+ components: Partial<import("react-select/dist/declarations/src/components").SelectComponents<Option, IsMulti, import("react-select").GroupBase<Option>>>;
5
+ select: import("react-select/base").default<unknown, false, import("react-select").GroupBase<unknown>> | null;
6
+ UNSAFE_componentWillReceiveProps(nextProps: import("./types").SelectProps<Option, IsMulti>): void;
7
+ cacheComponents: (components: Partial<import("react-select/dist/declarations/src/components").SelectComponents<Option, IsMulti, import("react-select").GroupBase<Option>>>) => void;
8
+ focus(): void;
9
+ blur(): void;
10
+ onSelectRef: (ref: import("react-select/base").default<unknown, false, import("react-select").GroupBase<unknown>>) => void;
11
+ render(): JSX.Element;
12
+ context: any;
13
+ setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
14
+ forceUpdate(callBack?: (() => void) | undefined): void;
15
+ readonly props: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>> & Readonly<{
16
+ children?: import("react").ReactNode;
17
+ }>;
18
+ state: Readonly<{}>;
19
+ refs: {
20
+ [key: string]: import("react").ReactInstance;
21
+ };
22
+ componentDidMount?(): void;
23
+ shouldComponentUpdate?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): boolean;
24
+ componentWillUnmount?(): void;
25
+ componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
26
+ getSnapshotBeforeUpdate?(prevProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, prevState: Readonly<{}>): any;
27
+ componentDidUpdate?(prevProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, prevState: Readonly<{}>, snapshot?: any): void;
28
+ componentWillMount?(): void;
29
+ UNSAFE_componentWillMount?(): void;
30
+ componentWillReceiveProps?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextContext: any): void;
31
+ componentWillUpdate?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): void;
32
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): void;
33
+ };
34
+ defaultProps: {
35
+ validationState: string;
36
+ spacing: string;
37
+ onClickPreventDefault: boolean;
38
+ tabSelectsValue: boolean;
39
+ components: {};
40
+ styles: {};
41
+ };
42
+ contextType?: import("react").Context<any> | undefined;
43
+ };
44
+ declare const _default: {
45
+ new <Option = import("./types").OptionType, IsMulti extends boolean = false>(props: import("./types").SelectProps<Option, IsMulti>): {
46
+ components: Partial<import("react-select/dist/declarations/src/components").SelectComponents<Option, IsMulti, import("react-select").GroupBase<Option>>>;
47
+ select: import("react-select/base").default<unknown, false, import("react-select").GroupBase<unknown>> | null;
48
+ UNSAFE_componentWillReceiveProps(nextProps: import("./types").SelectProps<Option, IsMulti>): void;
49
+ cacheComponents: (components: Partial<import("react-select/dist/declarations/src/components").SelectComponents<Option, IsMulti, import("react-select").GroupBase<Option>>>) => void;
50
+ focus(): void;
51
+ blur(): void;
52
+ onSelectRef: (ref: import("react-select/base").default<unknown, false, import("react-select").GroupBase<unknown>>) => void;
53
+ render(): JSX.Element;
54
+ context: any;
55
+ setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
56
+ forceUpdate(callBack?: (() => void) | undefined): void;
57
+ readonly props: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>> & Readonly<{
58
+ children?: import("react").ReactNode;
59
+ }>;
60
+ state: Readonly<{}>;
61
+ refs: {
62
+ [key: string]: import("react").ReactInstance;
63
+ };
64
+ componentDidMount?(): void;
65
+ shouldComponentUpdate?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): boolean;
66
+ componentWillUnmount?(): void;
67
+ componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
68
+ getSnapshotBeforeUpdate?(prevProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, prevState: Readonly<{}>): any;
69
+ componentDidUpdate?(prevProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, prevState: Readonly<{}>, snapshot?: any): void;
70
+ componentWillMount?(): void;
71
+ UNSAFE_componentWillMount?(): void;
72
+ componentWillReceiveProps?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextContext: any): void;
73
+ componentWillUpdate?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): void;
74
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): void;
75
+ };
76
+ defaultProps: {
77
+ validationState: string;
78
+ spacing: string;
79
+ onClickPreventDefault: boolean;
80
+ tabSelectsValue: boolean;
81
+ components: {};
82
+ styles: {};
83
+ };
84
+ contextType?: import("react").Context<any> | undefined;
85
+ };
86
+ export default _default;
@@ -0,0 +1,6 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ import { MultiValueRemoveProps } from '../types';
4
+ export { ClearIndicator, DropdownIndicator, LoadingIndicator, } from './indicators';
5
+ export declare const MultiValueRemove: (props: MultiValueRemoveProps<any>) => jsx.JSX.Element;
6
+ export declare const IndicatorSeparator: null;
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ import { ClearIndicatorProps, DropdownIndicatorProps, LoadingIndicatorProps } from '../types';
3
+ export declare const ClearIndicator: FC<ClearIndicatorProps<any>>;
4
+ export declare const DropdownIndicator: FC<DropdownIndicatorProps<any>>;
5
+ export declare const LoadingIndicator: FC<LoadingIndicatorProps<any>>;
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { OptionProps, OptionType } from '../types';
3
+ export declare const CheckboxOption: FC<OptionProps<OptionType, true>>;
4
+ export declare const RadioOption: FC<OptionProps>;
@@ -0,0 +1,45 @@
1
+ import React, { ComponentType } from 'react';
2
+ import BaseSelect from 'react-select/base';
3
+ import { SelectProps, SelectComponentsConfig, OptionType, AsyncSelectProps, CreatableSelectProps } from './types';
4
+ export default function createSelect(WrappedComponent: ComponentType<any>): {
5
+ new <Option = OptionType, IsMulti extends boolean = false>(props: SelectProps<Option, IsMulti>): {
6
+ components: Partial<import("react-select/dist/declarations/src/components").SelectComponents<Option, IsMulti, import("react-select").GroupBase<Option>>>;
7
+ select: BaseSelect | null;
8
+ UNSAFE_componentWillReceiveProps(nextProps: SelectProps<Option, IsMulti>): void;
9
+ cacheComponents: (components: Partial<import("react-select/dist/declarations/src/components").SelectComponents<Option, IsMulti, import("react-select").GroupBase<Option>>>) => void;
10
+ focus(): void;
11
+ blur(): void;
12
+ onSelectRef: (ref: BaseSelect) => void;
13
+ render(): JSX.Element;
14
+ context: any;
15
+ setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<SelectProps<Option, IsMulti> | AsyncSelectProps<Option, IsMulti> | CreatableSelectProps<Option, IsMulti>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
16
+ forceUpdate(callBack?: (() => void) | undefined): void;
17
+ readonly props: Readonly<SelectProps<Option, IsMulti> | AsyncSelectProps<Option, IsMulti> | CreatableSelectProps<Option, IsMulti>> & Readonly<{
18
+ children?: React.ReactNode;
19
+ }>;
20
+ state: Readonly<{}>;
21
+ refs: {
22
+ [key: string]: React.ReactInstance;
23
+ };
24
+ componentDidMount?(): void;
25
+ shouldComponentUpdate?(nextProps: Readonly<SelectProps<Option, IsMulti> | AsyncSelectProps<Option, IsMulti> | CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): boolean;
26
+ componentWillUnmount?(): void;
27
+ componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
28
+ getSnapshotBeforeUpdate?(prevProps: Readonly<SelectProps<Option, IsMulti> | AsyncSelectProps<Option, IsMulti> | CreatableSelectProps<Option, IsMulti>>, prevState: Readonly<{}>): any;
29
+ componentDidUpdate?(prevProps: Readonly<SelectProps<Option, IsMulti> | AsyncSelectProps<Option, IsMulti> | CreatableSelectProps<Option, IsMulti>>, prevState: Readonly<{}>, snapshot?: any): void;
30
+ componentWillMount?(): void;
31
+ UNSAFE_componentWillMount?(): void;
32
+ componentWillReceiveProps?(nextProps: Readonly<SelectProps<Option, IsMulti> | AsyncSelectProps<Option, IsMulti> | CreatableSelectProps<Option, IsMulti>>, nextContext: any): void;
33
+ componentWillUpdate?(nextProps: Readonly<SelectProps<Option, IsMulti> | AsyncSelectProps<Option, IsMulti> | CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): void;
34
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<SelectProps<Option, IsMulti> | AsyncSelectProps<Option, IsMulti> | CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): void;
35
+ };
36
+ defaultProps: {
37
+ validationState: string;
38
+ spacing: string;
39
+ onClickPreventDefault: boolean;
40
+ tabSelectsValue: boolean;
41
+ components: {};
42
+ styles: {};
43
+ };
44
+ contextType?: React.Context<any> | undefined;
45
+ };
@@ -0,0 +1,19 @@
1
+ interface Country {
2
+ abbr: string;
3
+ code: string;
4
+ icon: string;
5
+ name: string;
6
+ suggested?: boolean;
7
+ }
8
+ export declare const allCountries: Array<Country>;
9
+ export declare const groupedCountries: readonly [
10
+ {
11
+ readonly label: "Suggested";
12
+ readonly options: Country[];
13
+ },
14
+ {
15
+ readonly label: "All Countries";
16
+ readonly options: Country[];
17
+ }
18
+ ];
19
+ export {};
@@ -0,0 +1 @@
1
+ export { default } from '../AsyncCreatableSelect';
@@ -0,0 +1 @@
1
+ export { default } from '../AsyncSelect';
@@ -0,0 +1 @@
1
+ export { default } from '../CreatableSelect';
@@ -0,0 +1 @@
1
+ export { default, SelectWithoutAnalytics } from '../Select';
@@ -0,0 +1,2 @@
1
+ import { SelectProps, OptionType } from '../types';
2
+ export default function ertHackForSelect(_: SelectProps<OptionType>): void;
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ import { Modifier, Options } from '@popperjs/core';
3
+ declare 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
+ declare type Strategy = 'absolute' | 'fixed';
5
+ interface NativeReactPopperProps<Name = unknown> {
6
+ /** Function `(?HTMLElement) => void` that can be used to obtain popper reference */
7
+ innerRef?: React.Ref<any>;
8
+ /** One of the accepted placement values listed in the Popper.js documentation.
9
+ Your popper is going to be placed according to the value of this property.
10
+ Defaults to bottom.*/
11
+ placement?: Placement;
12
+ /** Describes the positioning strategy to use. By default, it is absolute, which in the simplest cases does not
13
+ * require repositioning of the popper. If your reference element is in a fixed container, use the fixed strategy. */
14
+ strategy: Strategy;
15
+ /** An object containing custom settings for the Popper.js modifiers.
16
+ You can use this property to override their settings or to inject your custom ones.
17
+ See [Popper Modifiers](https://popper.js.org/docs/v2/modifiers/) for full details. */
18
+ modifiers?: ReadonlyArray<Modifier<Name, Options>>;
19
+ }
20
+ export default function ertHackForPopper(_: NativeReactPopperProps): void;
21
+ export {};
@@ -0,0 +1,24 @@
1
+ import { GroupBase, OptionsOrGroups } from 'react-select';
2
+ export interface ReactSelectAsyncProps<Option = unknown, Group extends GroupBase<Option> = GroupBase<Option>> {
3
+ /**
4
+ * The default set of options to show before the user starts searching. When
5
+ * set to `true`, the results for loadOptions('') will be autoloaded.
6
+ */
7
+ defaultOptions?: OptionsOrGroups<Option, Group> | boolean;
8
+ /**
9
+ * If cacheOptions is truthy, then the loaded data will be cached. The cache
10
+ * will remain until `cacheOptions` changes value.
11
+ */
12
+ cacheOptions?: any;
13
+ /**
14
+ * Function that returns a promise, which is the set of options to be used
15
+ * once the promise resolves.
16
+ */
17
+ loadOptions?: (inputValue: string, callback: (options: OptionsOrGroups<Option, Group>) => void) => Promise<OptionsOrGroups<Option, Group>> | void;
18
+ /**
19
+ * Will cause the select to be displayed in the loading state, even if the
20
+ * Async select is not currently waiting for loadOptions to resolve
21
+ */
22
+ isLoading?: boolean;
23
+ }
24
+ export default function ertHackForPopper(_: ReactSelectAsyncProps): void;
@@ -0,0 +1,38 @@
1
+ import { ReactNode } from 'react';
2
+ import { GetOptionLabel, GetOptionValue, GroupBase, Options, OptionsOrGroups } from 'react-select';
3
+ export interface Accessors<Option> {
4
+ getOptionValue: GetOptionValue<Option>;
5
+ getOptionLabel: GetOptionLabel<Option>;
6
+ }
7
+ export interface ReactSelectCreatableProps<Option = unknown, Group extends GroupBase<Option> = GroupBase<Option>> {
8
+ /**
9
+ * Allow options to be created while the `isLoading` prop is true. Useful to
10
+ * prevent the "create new ..." option being displayed while async results are
11
+ * still being loaded.
12
+ */
13
+ allowCreateWhileLoading?: boolean;
14
+ /** Sets the position of the createOption element in your options list. Defaults to 'last' */
15
+ createOptionPosition?: 'first' | 'last';
16
+ /**
17
+ * Gets the label for the "create new ..." option in the menu. Is given the
18
+ * current input value.
19
+ */
20
+ formatCreateLabel?: (inputValue: string) => ReactNode;
21
+ /**
22
+ * Determines whether the "create new ..." option should be displayed based on
23
+ * the current input value, select value and options array.
24
+ */
25
+ isValidNewOption?: (inputValue: string, value: Options<Option>, options: OptionsOrGroups<Option, Group>, accessors: Accessors<Option>) => boolean;
26
+ /**
27
+ * Returns the data for the new option when it is created. Used to display the
28
+ * value, and is passed to `onChange`.
29
+ */
30
+ getNewOptionData?: (inputValue: string, optionLabel: ReactNode) => Option;
31
+ /**
32
+ * If provided, this will be called with the input value when a new option is
33
+ * created, and `onChange` will **not** be called. Use this when you need more
34
+ * control over what happens when new options are created.
35
+ */
36
+ onCreateOption?: (inputValue: string) => void;
37
+ }
38
+ export default function ertHackForSelect(_: ReactSelectCreatableProps): void;
@@ -0,0 +1,182 @@
1
+ import { FocusEventHandler, KeyboardEventHandler, ReactNode } from 'react';
2
+ interface FilterOptionOption<Option> {
3
+ readonly label: string;
4
+ readonly value: string;
5
+ readonly data: Option;
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';
9
+ interface NativeReactSelectProps<Option = unknown, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>> {
10
+ /** Aria label (for assistive tech) */
11
+ 'aria-label'?: string;
12
+ /** HTML ID of an element that should be used as the label (for assistive tech) */
13
+ 'aria-labelledby'?: string;
14
+ /** Used to set the priority with which screen reader should treat updates to live regions. The possible settings are?: off, polite (default) or assertive */
15
+ 'aria-live'?: 'off' | 'polite' | 'assertive';
16
+ /** Customize the messages used by the aria-live component. See react-select v5.4.0 documentation for full details */
17
+ ariaLiveMessages?: AriaLiveMessages<Option, IsMulti, Group>;
18
+ /** Focus the control when it is mounted */
19
+ autoFocus?: boolean;
20
+ /** Remove the currently focused option when the user presses backspace when Select isClearable or isMulti */
21
+ backspaceRemovesValue?: boolean;
22
+ /** Remove focus from the input when the user selects an option (handy for dismissing the keyboard on touch devices) */
23
+ blurInputOnSelect?: boolean;
24
+ /** When the user reaches the top/bottom of the menu, prevent scroll on the scroll-parent */
25
+ captureMenuScroll?: boolean;
26
+ /** Sets a className attribute on the outer component */
27
+ className?: string;
28
+ classNamePrefix?: string | null;
29
+ /** Close the select menu when the user selects an option */
30
+ closeMenuOnSelect?: boolean;
31
+ closeMenuOnScroll?: boolean | EventListener;
32
+ /**
33
+ * This complex object includes all the compositional components that are used
34
+ * in `react-select`. If you wish to overwrite a component, pass in an object
35
+ * with the appropriate namespace.
36
+ *
37
+ * If you only wish to restyle a component, we recommend using the `styles` prop
38
+ * instead. For a list of the components that can be passed in, and the shape
39
+ * that will be passed to them, see [the components docs](/components)
40
+ */
41
+ components?: SelectComponentsConfig<Option, IsMulti, Group>;
42
+ /** Whether the value of the select, e.g. SingleValue, should be displayed in the control. */
43
+ controlShouldRenderValue?: boolean;
44
+ /** Delimiter used to join multiple values into a single HTML Input value */
45
+ delimiter?: string;
46
+ /** Clear all values when the user presses escape AND the menu is closed */
47
+ escapeClearsValue?: boolean;
48
+ /** Custom method to filter whether an option should be displayed in the menu */
49
+ filterOption?: ((option?: FilterOptionOption<Option>, inputValue?: string) => boolean) | null;
50
+ /**
51
+ * Formats group labels in the menu as React components
52
+ *
53
+ * An example can be found in the [Replacing builtins](/advanced#replacing-builtins) documentation.
54
+ */
55
+ formatGroupLabel?: (group?: Group) => ReactNode;
56
+ /** Formats option labels in the menu and control as React components */
57
+ formatOptionLabel?: (data?: Option, formatOptionLabelMeta?: FormatOptionLabelMeta<Option>) => ReactNode;
58
+ /**
59
+ * Resolves option data to a string to be displayed as the label by components
60
+ *
61
+ * Note?: Failure to resolve to a string type can interfere with filtering and
62
+ * screen reader support.
63
+ */
64
+ getOptionLabel?: GetOptionLabel<Option>;
65
+ /** Resolves option data to a string to compare options and specify value attributes */
66
+ getOptionValue?: GetOptionValue<Option>;
67
+ /** Hide the selected option from the menu */
68
+ hideSelectedOptions?: boolean;
69
+ /** The id to set on the SelectContainer component. */
70
+ id?: string;
71
+ /** The value of the search input */
72
+ inputValue?: string;
73
+ /** The id of the search input */
74
+ inputId?: string;
75
+ /** Define an id prefix for the select components e.g. {your-id}-value */
76
+ instanceId?: number | string;
77
+ /** Is the select value clearable */
78
+ isClearable?: boolean;
79
+ /** Is the select disabled */
80
+ isDisabled?: boolean;
81
+ /** Is the select in a state of loading (async) */
82
+ isLoading?: boolean;
83
+ /**
84
+ * Override the built-in logic to detect whether an option is disabled
85
+ *
86
+ * An example can be found in the [Replacing builtins](/advanced#replacing-builtins) documentation.
87
+ */
88
+ isOptionDisabled?: (option?: Option, selectValue?: Options<Option>) => boolean;
89
+ /** Override the built-in logic to detect whether an option is selected */
90
+ isOptionSelected?: (option?: Option, selectValue?: Options<Option>) => boolean;
91
+ /** Support multiple selected options */
92
+ isMulti?: IsMulti;
93
+ /** Is the select direction right-to-left */
94
+ isRtl?: boolean;
95
+ /** Whether to enable search functionality */
96
+ isSearchable?: boolean;
97
+ /** Async?: Text to display when loading options */
98
+ loadingMessage?: (obj?: {
99
+ inputValue?: string;
100
+ }) => ReactNode;
101
+ /** Minimum height of the menu before flipping */
102
+ minMenuHeight?: number;
103
+ /** Maximum height of the menu before scrolling */
104
+ maxMenuHeight?: number;
105
+ /** Whether the menu is open */
106
+ menuIsOpen?: boolean;
107
+ /**
108
+ * Default placement of the menu in relation to the control. 'auto' will flip
109
+ * when there isn't enough space below the control.
110
+ */
111
+ menuPlacement?: MenuPlacement;
112
+ /** The CSS position value of the menu, when "fixed" extra layout management is required */
113
+ menuPosition?: MenuPosition;
114
+ /**
115
+ * Whether the menu should use a portal, and where it should attach
116
+ *
117
+ * An example can be found in the [Portaling](/advanced#portaling) documentation
118
+ */
119
+ menuPortalTarget?: HTMLElement | null;
120
+ /** Whether to block scroll events when the menu is open */
121
+ menuShouldBlockScroll?: boolean;
122
+ /** Whether the menu should be scrolled into view when it opens */
123
+ menuShouldScrollIntoView?: boolean;
124
+ /** Name of the HTML Input (optional - without this, no input will be rendered) */
125
+ name?: string;
126
+ /** Text to display when there are no options */
127
+ noOptionsMessage?: (obj?: {
128
+ inputValue?: string;
129
+ }) => ReactNode;
130
+ /** Handle blur events on the control */
131
+ onBlur?: FocusEventHandler<HTMLInputElement>;
132
+ /** Handle change events on the select */
133
+ onChange?: (newValue?: OnChangeValue<Option, IsMulti>, actionMeta?: ActionMeta<Option>) => void;
134
+ /** Handle focus events on the control */
135
+ onFocus?: FocusEventHandler<HTMLInputElement>;
136
+ /** Handle change events on the input */
137
+ onInputChange?: (newValue?: string, actionMeta?: InputActionMeta) => void;
138
+ /** Handle key down events on the select */
139
+ onKeyDown?: KeyboardEventHandler<HTMLDivElement>;
140
+ /** Handle the menu opening */
141
+ onMenuOpen?: () => void;
142
+ /** Handle the menu closing */
143
+ onMenuClose?: () => void;
144
+ /** Fired when the user scrolls to the top of the menu */
145
+ onMenuScrollToTop?: (event?: WheelEvent | TouchEvent) => void;
146
+ /** Fired when the user scrolls to the bottom of the menu */
147
+ onMenuScrollToBottom?: (event?: WheelEvent | TouchEvent) => void;
148
+ /** Allows control of whether the menu is opened when the Select is focused */
149
+ openMenuOnFocus?: boolean;
150
+ /** Allows control of whether the menu is opened when the Select is clicked */
151
+ openMenuOnClick?: boolean;
152
+ /** Array of options that populate the select menu */
153
+ options?: OptionsOrGroups<Option, Group>;
154
+ /** Number of options to jump in menu when page{up|down} keys are used */
155
+ pageSize?: number;
156
+ /** Placeholder for the select value */
157
+ placeholder?: ReactNode;
158
+ /** Status to relay to screen readers */
159
+ screenReaderStatus?: (obj?: {
160
+ count?: number;
161
+ }) => string;
162
+ /**
163
+ * Style modifier methods
164
+ *
165
+ * A basic example can be found at the bottom of the [Replacing builtins](/advanced#replacing-builtins) documentation.
166
+ */
167
+ styles?: StylesConfig;
168
+ /** Theme modifier method */
169
+ theme?: ThemeConfig;
170
+ /** Sets the tabIndex attribute on the input */
171
+ tabIndex?: number;
172
+ /** Select the currently focused option when the user presses tab */
173
+ tabSelectsValue?: boolean;
174
+ /** The value of the select; reflected by the selected option */
175
+ value?: PropsValue<Option>;
176
+ /** Sets the form attribute on the input */
177
+ form?: string;
178
+ /** Marks the value-holding input as required for form validation */
179
+ required?: boolean;
180
+ }
181
+ export default function ertHackForSelect(_: NativeReactSelectProps): void;
182
+ export {};
@@ -0,0 +1,19 @@
1
+ export { components, createFilter, mergeStyles } from 'react-select';
2
+ export { useAsync } from 'react-select/async';
3
+ export { useCreatable } from 'react-select/creatable';
4
+ export { CheckboxOption, RadioOption } from './components/input-options';
5
+ export { default, SelectWithoutAnalytics } from './entry-points/select';
6
+ export { default as AsyncSelect } from './entry-points/async-select';
7
+ export { default as CreatableSelect } from './entry-points/creatable-select';
8
+ export { default as AsyncCreatableSelect } from './entry-points/async-creatable-select';
9
+ export { default as CheckboxSelect } from './CheckboxSelect';
10
+ export { default as CountrySelect } from './CountrySelect';
11
+ export { default as RadioSelect } from './RadioSelect';
12
+ export { default as PopupSelect } from './PopupSelect';
13
+ export type { PopupSelectProps, ModifierList } from './PopupSelect';
14
+ export type { SelectInstance, ActionMeta, ControlProps, FormatOptionLabelMeta, InputActionMeta, InputProps, MenuProps, MenuListComponentProps, OptionProps, OptionsType, OptionType, SelectComponentsConfig, SelectProps, StylesConfig, ValueContainerProps, ValueType, GroupedOptionsType, GroupType, ClearIndicatorProps, DropdownIndicatorProps, IndicatorSeparatorProps, LoadingIndicatorProps, MultiValueProps, MultiValueRemoveProps, ReactSelectProps, SingleValueProps, NoticeProps, ValidationState, GroupProps, AsyncSelectProps, PlaceholderProps, } from './types';
15
+ /**
16
+ * Types not exported on the public API, didn't find usages in sourcegraph
17
+ *
18
+ * CreatableSelectProps,
19
+ */
@@ -0,0 +1,2 @@
1
+ import { StylesConfig, ValidationState } from './types';
2
+ export default function baseStyles<Option, IsMulti extends boolean>(validationState: ValidationState, isCompact: boolean | undefined, appearance: 'default' | 'subtle' | 'none'): StylesConfig<Option, IsMulti>;
@@ -0,0 +1,60 @@
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 { AsyncProps } from 'react-select/async';
5
+ import { CreatableProps } from 'react-select/creatable';
6
+ export declare type ValidationState = 'default' | 'error' | 'success';
7
+ export interface OptionType {
8
+ [key: string]: any;
9
+ label: string;
10
+ value: string | number;
11
+ }
12
+ export declare type OptionsType<Option = OptionType> = RSOptionsType<Option>;
13
+ export interface OptionProps<Option = OptionType, IsMulti extends boolean = false> extends ReactSelectOptionProps<Option, IsMulti> {
14
+ [key: string]: any;
15
+ Icon?: React.ComponentType<{
16
+ label: string;
17
+ size?: 'small' | 'medium' | 'large' | 'xlarge';
18
+ onClick?: (e: MouseEvent) => void;
19
+ primaryColor?: string;
20
+ secondaryColor?: string;
21
+ }>;
22
+ isDisabled: boolean;
23
+ isFocused: boolean;
24
+ isSelected: boolean;
25
+ }
26
+ interface CustomSelectProps extends WithAnalyticsEventsProps {
27
+ /** This prop affects the height of the select control. Compact is gridSize() * 4, default is gridSize * 5 */
28
+ spacing?: 'compact' | 'default';
29
+ /** This prop affects the backgroundColor and border of the Select field. 'subtle' makes these transparent while 'none' removes them completely */
30
+ appearance?: 'default' | 'subtle' | 'none';
31
+ /** Prop for testing */
32
+ testId?: string;
33
+ /** This prop indicates if the component is in an error state */
34
+ isInvalid?: boolean;
35
+ /** @deprecated Use isInvalid instead. The state of validation if used in a form. */
36
+ validationState?: ValidationState;
37
+ }
38
+ export interface SelectProps<Option, IsMulti extends boolean = false> extends ReactSelectProps<Option, IsMulti>, CustomSelectProps {
39
+ }
40
+ export interface AsyncSelectProps<Option, IsMulti extends boolean = false> extends AsyncProps<Option, IsMulti, GroupType<Option>>, CustomSelectProps {
41
+ }
42
+ export interface CreatableSelectProps<Option, IsMulti extends boolean = false> extends CreatableProps<Option, IsMulti, GroupType<Option>>, CustomSelectProps {
43
+ }
44
+ export declare type ActionMeta<Option = OptionType> = RSActionMeta<Option>;
45
+ export declare type ControlProps<Option, IsMulti extends boolean = false> = RSControlProps<Option, IsMulti>;
46
+ export declare type ValueType<Option, IsMulti extends boolean = false> = RSValueType<Option, IsMulti>;
47
+ export declare type StylesConfig<Option = OptionType, IsMulti extends boolean = false> = RSStylesConfig<Option, IsMulti>;
48
+ export declare type SelectComponentsConfig<Option, IsMulti extends boolean = false> = RSSelectComponentsConfig<Option, IsMulti, GroupType<Option>>;
49
+ export declare type GroupProps<Option, IsMulti extends boolean = false> = RSGroupProps<Option, IsMulti>;
50
+ export declare type MenuProps<Option, IsMulti extends boolean = false> = RSMenuProps<Option, IsMulti>;
51
+ export declare type MenuListComponentProps<Option, IsMulti extends boolean = false> = RSMenuListComponentProps<Option, IsMulti>;
52
+ export declare type PlaceholderProps<Option, IsMulti extends boolean = false> = RSPlaceholderProps<Option, IsMulti>;
53
+ export declare type ValueContainerProps<Option, IsMulti extends boolean = false> = RSValueContainerProps<Option, IsMulti>;
54
+ export declare type GroupedOptionsType<Option> = ReadonlyArray<GroupType<Option>>;
55
+ export type { SelectInstance, FormatOptionLabelMeta, InputActionMeta, GroupType, InputProps, MultiValueProps, ReactSelectProps, SingleValueProps, ClearIndicatorProps, DropdownIndicatorProps, IndicatorSeparatorProps, LoadingIndicatorProps, NoticeProps, MultiValueRemoveProps, };
56
+ declare module 'react-select/dist/declarations/src/Select' {
57
+ interface Props<Option, IsMulti extends boolean, Group extends GroupType<Option>> {
58
+ [key: string]: any;
59
+ }
60
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/select",
3
- "version": "16.1.9",
3
+ "version": "16.2.1",
4
4
  "description": "Select allows users to make a single selection or multiple selections from a list of options.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -30,12 +30,12 @@
30
30
  ".": "./src/index.tsx"
31
31
  },
32
32
  "dependencies": {
33
- "@atlaskit/analytics-next": "^9.0.0",
34
- "@atlaskit/icon": "^21.11.0",
35
- "@atlaskit/spinner": "^15.4.0",
36
- "@atlaskit/theme": "^12.4.0",
37
- "@atlaskit/tokens": "^1.2.0",
38
- "@atlaskit/visually-hidden": "^1.1.0",
33
+ "@atlaskit/analytics-next": "^9.1.0",
34
+ "@atlaskit/icon": "^21.12.0",
35
+ "@atlaskit/spinner": "^15.5.0",
36
+ "@atlaskit/theme": "^12.5.0",
37
+ "@atlaskit/tokens": "^1.3.0",
38
+ "@atlaskit/visually-hidden": "^1.2.0",
39
39
  "@babel/runtime": "^7.0.0",
40
40
  "@emotion/react": "^11.7.1",
41
41
  "@popperjs/core": "^2.9.1",
@@ -54,17 +54,17 @@
54
54
  "react-dom": "^16.8.0"
55
55
  },
56
56
  "devDependencies": {
57
- "@atlaskit/button": "^16.6.0",
58
- "@atlaskit/checkbox": "^12.4.0",
57
+ "@atlaskit/button": "^16.7.0",
58
+ "@atlaskit/checkbox": "^12.5.0",
59
59
  "@atlaskit/docs": "*",
60
- "@atlaskit/drawer": "^7.4.0",
61
- "@atlaskit/form": "^8.10.0",
62
- "@atlaskit/logo": "^13.13.0",
63
- "@atlaskit/modal-dialog": "^12.4.0",
64
- "@atlaskit/radio": "^5.4.0",
65
- "@atlaskit/section-message": "^6.3.0",
60
+ "@atlaskit/drawer": "^7.5.0",
61
+ "@atlaskit/form": "^8.11.0",
62
+ "@atlaskit/logo": "^13.14.0",
63
+ "@atlaskit/modal-dialog": "^12.5.0",
64
+ "@atlaskit/radio": "^5.5.0",
65
+ "@atlaskit/section-message": "^6.4.0",
66
66
  "@atlaskit/ssr": "*",
67
- "@atlaskit/tooltip": "^17.7.0",
67
+ "@atlaskit/tooltip": "^17.8.0",
68
68
  "@atlaskit/visual-regression": "*",
69
69
  "@atlaskit/webdriver-runner": "*",
70
70
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
@@ -72,7 +72,6 @@
72
72
  "@testing-library/react": "^12.1.5",
73
73
  "@testing-library/user-event": "^14.4.3",
74
74
  "ast-types": "^0.13.3",
75
- "enzyme": "^3.10.0",
76
75
  "jscodeshift": "^0.13.0",
77
76
  "react-dom": "^16.8.0",
78
77
  "react-value": "^0.2.0",
package/report.api.md CHANGED
@@ -323,7 +323,7 @@ export type ControlProps<
323
323
  > = ControlProps_2<Option, IsMulti>;
324
324
 
325
325
  // @public (undocumented)
326
- type Country = typeof groupedCountries[number]['options'][number];
326
+ type Country = (typeof groupedCountries)[number]['options'][number];
327
327
 
328
328
  // @public (undocumented)
329
329
  interface Country_2 {