@atlaskit/react-select 2.1.0 → 2.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 (109) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/emotion/components/containers.js +111 -0
  3. package/dist/cjs/emotion/components/control.js +110 -0
  4. package/dist/cjs/emotion/components/group.js +71 -0
  5. package/dist/cjs/emotion/components/index.js +52 -0
  6. package/dist/cjs/emotion/components/indicators.js +137 -0
  7. package/dist/cjs/emotion/components/input.js +94 -0
  8. package/dist/cjs/emotion/components/internal/a11y-text.js +36 -0
  9. package/dist/cjs/emotion/components/internal/dummy-input.js +44 -0
  10. package/dist/cjs/emotion/components/internal/index.js +34 -0
  11. package/dist/cjs/emotion/components/internal/notify-open-layer-observer.js +21 -0
  12. package/dist/cjs/emotion/components/internal/required-input.js +43 -0
  13. package/dist/cjs/emotion/components/internal/scroll-manager.js +57 -0
  14. package/dist/cjs/emotion/components/internal/use-scroll-capture.js +132 -0
  15. package/dist/cjs/emotion/components/internal/use-scroll-lock.js +149 -0
  16. package/dist/cjs/emotion/components/live-region.js +182 -0
  17. package/dist/cjs/emotion/components/menu.js +456 -0
  18. package/dist/cjs/emotion/components/multi-value.js +224 -0
  19. package/dist/cjs/emotion/components/option.js +82 -0
  20. package/dist/cjs/emotion/components/placeholder.js +34 -0
  21. package/dist/cjs/emotion/components/single-value.js +40 -0
  22. package/dist/cjs/select.js +11 -8
  23. package/dist/es2019/emotion/components/containers.js +109 -0
  24. package/dist/es2019/emotion/components/control.js +107 -0
  25. package/dist/es2019/emotion/components/group.js +59 -0
  26. package/dist/es2019/emotion/components/index.js +41 -0
  27. package/dist/es2019/emotion/components/indicators.js +128 -0
  28. package/dist/es2019/emotion/components/input.js +86 -0
  29. package/dist/es2019/emotion/components/internal/a11y-text.js +27 -0
  30. package/dist/es2019/emotion/components/internal/dummy-input.js +37 -0
  31. package/dist/es2019/emotion/components/internal/index.js +4 -0
  32. package/dist/es2019/emotion/components/internal/notify-open-layer-observer.js +16 -0
  33. package/dist/es2019/emotion/components/internal/required-input.js +35 -0
  34. package/dist/es2019/emotion/components/internal/scroll-manager.js +49 -0
  35. package/dist/es2019/emotion/components/internal/use-scroll-capture.js +128 -0
  36. package/dist/es2019/emotion/components/internal/use-scroll-lock.js +143 -0
  37. package/dist/es2019/emotion/components/live-region.js +178 -0
  38. package/dist/es2019/emotion/components/menu.js +450 -0
  39. package/dist/es2019/emotion/components/multi-value.js +227 -0
  40. package/dist/es2019/emotion/components/option.js +78 -0
  41. package/dist/es2019/emotion/components/placeholder.js +28 -0
  42. package/dist/es2019/emotion/components/single-value.js +34 -0
  43. package/dist/es2019/select.js +11 -8
  44. package/dist/esm/emotion/components/containers.js +105 -0
  45. package/dist/esm/emotion/components/control.js +103 -0
  46. package/dist/esm/emotion/components/group.js +65 -0
  47. package/dist/esm/emotion/components/index.js +43 -0
  48. package/dist/esm/emotion/components/indicators.js +132 -0
  49. package/dist/esm/emotion/components/input.js +89 -0
  50. package/dist/esm/emotion/components/internal/a11y-text.js +29 -0
  51. package/dist/esm/emotion/components/internal/dummy-input.js +38 -0
  52. package/dist/esm/emotion/components/internal/index.js +4 -0
  53. package/dist/esm/emotion/components/internal/notify-open-layer-observer.js +15 -0
  54. package/dist/esm/emotion/components/internal/required-input.js +36 -0
  55. package/dist/esm/emotion/components/internal/scroll-manager.js +49 -0
  56. package/dist/esm/emotion/components/internal/use-scroll-capture.js +126 -0
  57. package/dist/esm/emotion/components/internal/use-scroll-lock.js +143 -0
  58. package/dist/esm/emotion/components/live-region.js +175 -0
  59. package/dist/esm/emotion/components/menu.js +454 -0
  60. package/dist/esm/emotion/components/multi-value.js +217 -0
  61. package/dist/esm/emotion/components/option.js +75 -0
  62. package/dist/esm/emotion/components/placeholder.js +27 -0
  63. package/dist/esm/emotion/components/single-value.js +33 -0
  64. package/dist/esm/select.js +11 -8
  65. package/dist/types/components/internal/notify-open-layer-observer.d.ts +4 -2
  66. package/dist/types/emotion/components/containers.d.ts +54 -0
  67. package/dist/types/emotion/components/control.d.ts +42 -0
  68. package/dist/types/emotion/components/group.d.ts +52 -0
  69. package/dist/types/emotion/components/index.d.ts +67 -0
  70. package/dist/types/emotion/components/indicators.d.ts +73 -0
  71. package/dist/types/emotion/components/input.d.ts +37 -0
  72. package/dist/types/emotion/components/internal/a11y-text.d.ts +8 -0
  73. package/dist/types/emotion/components/internal/dummy-input.d.ts +9 -0
  74. package/dist/types/emotion/components/internal/index.d.ts +4 -0
  75. package/dist/types/emotion/components/internal/notify-open-layer-observer.d.ts +11 -0
  76. package/dist/types/emotion/components/internal/required-input.d.ts +10 -0
  77. package/dist/types/emotion/components/internal/scroll-manager.d.ts +17 -0
  78. package/dist/types/emotion/components/internal/use-scroll-capture.d.ts +12 -0
  79. package/dist/types/emotion/components/internal/use-scroll-lock.d.ts +9 -0
  80. package/dist/types/emotion/components/live-region.d.ts +25 -0
  81. package/dist/types/emotion/components/menu.d.ts +116 -0
  82. package/dist/types/emotion/components/multi-value.d.ts +47 -0
  83. package/dist/types/emotion/components/option.d.ts +49 -0
  84. package/dist/types/emotion/components/placeholder.d.ts +22 -0
  85. package/dist/types/emotion/components/single-value.d.ts +28 -0
  86. package/dist/types/select.d.ts +7 -4
  87. package/dist/types-ts4.5/components/internal/notify-open-layer-observer.d.ts +4 -2
  88. package/dist/types-ts4.5/emotion/components/containers.d.ts +54 -0
  89. package/dist/types-ts4.5/emotion/components/control.d.ts +42 -0
  90. package/dist/types-ts4.5/emotion/components/group.d.ts +52 -0
  91. package/dist/types-ts4.5/emotion/components/index.d.ts +67 -0
  92. package/dist/types-ts4.5/emotion/components/indicators.d.ts +73 -0
  93. package/dist/types-ts4.5/emotion/components/input.d.ts +37 -0
  94. package/dist/types-ts4.5/emotion/components/internal/a11y-text.d.ts +8 -0
  95. package/dist/types-ts4.5/emotion/components/internal/dummy-input.d.ts +9 -0
  96. package/dist/types-ts4.5/emotion/components/internal/index.d.ts +4 -0
  97. package/dist/types-ts4.5/emotion/components/internal/notify-open-layer-observer.d.ts +11 -0
  98. package/dist/types-ts4.5/emotion/components/internal/required-input.d.ts +10 -0
  99. package/dist/types-ts4.5/emotion/components/internal/scroll-manager.d.ts +17 -0
  100. package/dist/types-ts4.5/emotion/components/internal/use-scroll-capture.d.ts +12 -0
  101. package/dist/types-ts4.5/emotion/components/internal/use-scroll-lock.d.ts +9 -0
  102. package/dist/types-ts4.5/emotion/components/live-region.d.ts +25 -0
  103. package/dist/types-ts4.5/emotion/components/menu.d.ts +116 -0
  104. package/dist/types-ts4.5/emotion/components/multi-value.d.ts +47 -0
  105. package/dist/types-ts4.5/emotion/components/option.d.ts +49 -0
  106. package/dist/types-ts4.5/emotion/components/placeholder.d.ts +22 -0
  107. package/dist/types-ts4.5/emotion/components/single-value.d.ts +28 -0
  108. package/dist/types-ts4.5/select.d.ts +7 -4
  109. package/package.json +3 -3
@@ -0,0 +1,73 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { type ReactNode } from 'react';
6
+ import { jsx } from '@emotion/react';
7
+ import { type CommonPropsAndClassName, type CSSObjectWithLabel, type GroupBase } from '../../types';
8
+ export interface DropdownIndicatorProps<Option = unknown, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>> extends CommonPropsAndClassName<Option, IsMulti, Group> {
9
+ /**
10
+ * The children to be rendered inside the indicator.
11
+ */
12
+ children?: ReactNode;
13
+ /**
14
+ * Props that will be passed on to the children.
15
+ */
16
+ innerProps: JSX.IntrinsicElements['div'];
17
+ /**
18
+ * The focused state of the select.
19
+ */
20
+ isFocused: boolean;
21
+ isDisabled: boolean;
22
+ /**
23
+ * Whether the select is compact.
24
+ */
25
+ isCompact?: boolean;
26
+ }
27
+ export declare const dropdownIndicatorCSS: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ isCompact, isDisabled, }: DropdownIndicatorProps<Option, IsMulti, Group>) => CSSObjectWithLabel;
28
+ export declare const DropdownIndicator: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: DropdownIndicatorProps<Option, IsMulti, Group>) => jsx.JSX.Element;
29
+ export interface ClearIndicatorProps<Option = unknown, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>> extends CommonPropsAndClassName<Option, IsMulti, Group> {
30
+ /**
31
+ * The children to be rendered inside the indicator.
32
+ */
33
+ children?: ReactNode;
34
+ /**
35
+ * Sets the `aria-label` for the clear icon button
36
+ */
37
+ clearControlLabel?: string;
38
+ /**
39
+ * Props that will be passed on to the children.
40
+ */
41
+ innerProps: JSX.IntrinsicElements['div'];
42
+ /**
43
+ * The focused state of the select.
44
+ */
45
+ isFocused: boolean;
46
+ /**
47
+ * Whether the select is compact.
48
+ */
49
+ isCompact?: boolean;
50
+ }
51
+ export declare const clearIndicatorCSS: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ isCompact, }: ClearIndicatorProps<Option, IsMulti, Group>) => CSSObjectWithLabel;
52
+ export declare const ClearIndicator: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: ClearIndicatorProps<Option, IsMulti, Group>) => jsx.JSX.Element;
53
+ export declare const loadingIndicatorCSS: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ isCompact, }: LoadingIndicatorProps<Option, IsMulti, Group>) => CSSObjectWithLabel;
54
+ export interface LoadingIndicatorProps<Option = unknown, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>> extends CommonPropsAndClassName<Option, IsMulti, Group> {
55
+ /**
56
+ * Props that will be passed on to the children.
57
+ */
58
+ innerProps: JSX.IntrinsicElements['div'];
59
+ /**
60
+ * The focused state of the select.
61
+ */
62
+ isFocused: boolean;
63
+ isDisabled: boolean;
64
+ /**
65
+ * Set size of the container.
66
+ */
67
+ size: number;
68
+ /**
69
+ * Whether the select is compact.
70
+ */
71
+ isCompact?: boolean;
72
+ }
73
+ export declare const LoadingIndicator: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ innerProps, isRtl, size, ...restProps }: LoadingIndicatorProps<Option, IsMulti, Group>) => jsx.JSX.Element;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { type InputHTMLAttributes } from 'react';
6
+ import { jsx } from '@emotion/react';
7
+ import { type CommonPropsAndClassName, type CSSObjectWithLabel, type GroupBase } from '../../types';
8
+ interface InputSpecificProps<Option = unknown, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>> extends InputHTMLAttributes<HTMLInputElement>, CommonPropsAndClassName<Option, IsMulti, Group> {
9
+ /**
10
+ * Reference to the internal element
11
+ */
12
+ innerRef?: (instance: HTMLInputElement | null) => void;
13
+ /**
14
+ * Set whether the input should be visible. Does not affect input size.
15
+ */
16
+ isHidden: boolean;
17
+ /**
18
+ * Whether the input is disabled
19
+ */
20
+ isDisabled?: boolean;
21
+ /**
22
+ * The ID of the form that the input belongs to
23
+ */
24
+ form?: string;
25
+ /**
26
+ * Set className for the input element
27
+ */
28
+ inputClassName?: string;
29
+ /**
30
+ * A testId prop is provided for specific elements. This is a unique string that appears as a data attribute data-testid in the rendered code and serves as a hook for automated tests.
31
+ */
32
+ testId?: string;
33
+ }
34
+ export type InputProps<Option = unknown, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>> = InputSpecificProps<Option, IsMulti, Group>;
35
+ export declare const inputCSS: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ isDisabled, value, }: InputProps<Option, IsMulti, Group>) => CSSObjectWithLabel;
36
+ declare const Input: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: InputProps<Option, IsMulti, Group>) => jsx.JSX.Element;
37
+ export default Input;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * @jsxRuntime classic
4
+ * @jsx jsx
5
+ */
6
+ import { jsx } from '@emotion/react';
7
+ declare const A11yText: (props: JSX.IntrinsicElements['span']) => jsx.JSX.Element;
8
+ export default A11yText;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { type Ref } from 'react';
6
+ import { jsx } from '@emotion/react';
7
+ export default function DummyInput({ innerRef, ...props }: JSX.IntrinsicElements['input'] & {
8
+ readonly innerRef: Ref<HTMLInputElement>;
9
+ }): jsx.JSX.Element;
@@ -0,0 +1,4 @@
1
+ export { default as A11yText } from './a11y-text';
2
+ export { default as DummyInput } from './dummy-input';
3
+ export { default as ScrollManager } from './scroll-manager';
4
+ export { default as RequiredInput } from './required-input';
@@ -0,0 +1,11 @@
1
+ type NotifyOpenLayerObserverProps = {
2
+ isOpen: boolean;
3
+ onClose: () => void;
4
+ };
5
+ /**
6
+ * Functional component wrapper around `useNotifyOpenLayerObserver`.
7
+ *
8
+ * This is needed as Select is a class component, which cannot use hooks directly.
9
+ */
10
+ export declare function NotifyOpenLayerObserver({ isOpen, onClose }: NotifyOpenLayerObserverProps): null;
11
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { type FocusEventHandler, type FunctionComponent } from 'react';
6
+ declare const RequiredInput: FunctionComponent<{
7
+ readonly name?: string;
8
+ readonly onFocus: FocusEventHandler<HTMLInputElement>;
9
+ }>;
10
+ export default RequiredInput;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { type ReactElement, type RefCallback } from 'react';
6
+ import { jsx } from '@emotion/react';
7
+ interface ScrollManagerProps {
8
+ readonly children: (ref: RefCallback<HTMLElement>) => ReactElement;
9
+ readonly lockEnabled: boolean;
10
+ readonly captureEnabled: boolean;
11
+ readonly onBottomArrive?: (event: WheelEvent | TouchEvent) => void;
12
+ readonly onBottomLeave?: (event: WheelEvent | TouchEvent) => void;
13
+ readonly onTopArrive?: (event: WheelEvent | TouchEvent) => void;
14
+ readonly onTopLeave?: (event: WheelEvent | TouchEvent) => void;
15
+ }
16
+ export default function ScrollManager({ children, lockEnabled, captureEnabled, onBottomArrive, onBottomLeave, onTopArrive, onTopLeave, }: ScrollManagerProps): jsx.JSX.Element;
17
+ export {};
@@ -0,0 +1,12 @@
1
+ interface Options {
2
+ readonly isEnabled: boolean;
3
+ readonly onBottomArrive?: (event: WheelEvent | TouchEvent) => void;
4
+ readonly onBottomLeave?: (event: WheelEvent | TouchEvent) => void;
5
+ readonly onTopArrive?: (event: WheelEvent | TouchEvent) => void;
6
+ readonly onTopLeave?: (event: WheelEvent | TouchEvent) => void;
7
+ }
8
+ /**
9
+ * {description}.
10
+ */
11
+ export default function useScrollCapture({ isEnabled, onBottomArrive, onBottomLeave, onTopArrive, onTopLeave, }: Options): (element: HTMLElement | null) => void;
12
+ export {};
@@ -0,0 +1,9 @@
1
+ interface Options {
2
+ readonly isEnabled: boolean;
3
+ readonly accountForScrollbars?: boolean;
4
+ }
5
+ /**
6
+ * {description}.
7
+ */
8
+ export default function useScrollLock({ isEnabled, accountForScrollbars }: Options): (element: HTMLElement | null) => void;
9
+ export {};
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ * @jsxFrag React.Fragment
5
+ */
6
+ import { type ReactNode } from 'react';
7
+ import { jsx } from '@emotion/react';
8
+ import { type AriaSelection } from '../../accessibility';
9
+ import { type CommonProps, type GroupBase, type Options } from '../../types';
10
+ interface LiveRegionProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> extends CommonProps<Option, IsMulti, Group> {
11
+ children: ReactNode;
12
+ innerProps: {
13
+ className?: string;
14
+ };
15
+ ariaSelection: AriaSelection<Option, IsMulti>;
16
+ focusedOption: Option | null;
17
+ focusedValue: Option | null;
18
+ selectValue: Options<Option>;
19
+ focusableOptions: Options<Option>;
20
+ isFocused: boolean;
21
+ id: string;
22
+ isAppleDevice: boolean;
23
+ }
24
+ declare const LiveRegion: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: LiveRegionProps<Option, IsMulti, Group>) => jsx.JSX.Element;
25
+ export default LiveRegion;
@@ -0,0 +1,116 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { type LegacyRef, type ReactElement, type ReactNode, type Ref } from 'react';
6
+ import { jsx } from '@emotion/react';
7
+ import { type CoercedMenuPlacement, type CommonProps, type CommonPropsAndClassName, type CSSObjectWithLabel, type GroupBase, type MenuPlacement, type MenuPosition } from '../../types';
8
+ interface MenuPlacementProps {
9
+ /**
10
+ * Set the minimum height of the menu.
11
+ */
12
+ minMenuHeight: number;
13
+ /**
14
+ * Set the maximum height of the menu.
15
+ */
16
+ maxMenuHeight: number;
17
+ /**
18
+ * Set whether the menu should be at the top, at the bottom. The auto options sets it to bottom.
19
+ */
20
+ menuPlacement: MenuPlacement;
21
+ /**
22
+ * The CSS position value of the menu, when "fixed" extra layout management is required
23
+ */
24
+ menuPosition: MenuPosition;
25
+ /**
26
+ * Set whether the page should scroll to show the menu.
27
+ */
28
+ menuShouldScrollIntoView: boolean;
29
+ }
30
+ export interface MenuProps<Option = unknown, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>> extends CommonPropsAndClassName<Option, IsMulti, Group>, MenuPlacementProps {
31
+ /**
32
+ * Reference to the internal element, consumed by the MenuPlacer component
33
+ */
34
+ innerRef: Ref<HTMLDivElement>;
35
+ innerProps: JSX.IntrinsicElements['div'];
36
+ isLoading: boolean;
37
+ placement: CoercedMenuPlacement;
38
+ /**
39
+ * The children to be rendered.
40
+ */
41
+ children: ReactNode;
42
+ }
43
+ interface PlacerProps {
44
+ placement: CoercedMenuPlacement;
45
+ maxHeight: number;
46
+ }
47
+ interface ChildrenProps {
48
+ ref: Ref<HTMLDivElement>;
49
+ placerProps: PlacerProps;
50
+ }
51
+ interface MenuPlacerProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> extends CommonProps<Option, IsMulti, Group>, MenuPlacementProps {
52
+ /**
53
+ * The children to be rendered.
54
+ */
55
+ children: (childrenProps: ChildrenProps) => ReactElement;
56
+ }
57
+ export declare const menuCSS: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ placement, }: MenuProps<Option, IsMulti, Group>) => CSSObjectWithLabel;
58
+ export declare const MenuPlacer: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: MenuPlacerProps<Option, IsMulti, Group>) => ReactElement<any, string | import("react").JSXElementConstructor<any>>;
59
+ declare const Menu: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: MenuProps<Option, IsMulti, Group>) => jsx.JSX.Element;
60
+ export default Menu;
61
+ export interface MenuListProps<Option = unknown, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>> extends CommonPropsAndClassName<Option, IsMulti, Group> {
62
+ /**
63
+ * Set the max height of the Menu component
64
+ */
65
+ maxHeight: number;
66
+ /**
67
+ * The children to be rendered.
68
+ */
69
+ children: ReactNode;
70
+ /**
71
+ * Inner ref to DOM ReactNode
72
+ */
73
+ innerRef: LegacyRef<HTMLDivElement>;
74
+ /**
75
+ * The currently focused option
76
+ */
77
+ focusedOption: Option;
78
+ /**
79
+ * Props to be passed to the menu-list wrapper.
80
+ */
81
+ innerProps: JSX.IntrinsicElements['div'];
82
+ }
83
+ export declare const menuListCSS: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ maxHeight, }: MenuListProps<Option, IsMulti, Group>) => CSSObjectWithLabel;
84
+ export declare const MenuList: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: MenuListProps<Option, IsMulti, Group>) => jsx.JSX.Element;
85
+ export declare const noOptionsMessageCSS: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({}: NoticeProps<Option, IsMulti, Group>) => CSSObjectWithLabel;
86
+ export declare const loadingMessageCSS: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({}: NoticeProps<Option, IsMulti, Group>) => CSSObjectWithLabel;
87
+ export interface NoticeProps<Option = unknown, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>> extends CommonPropsAndClassName<Option, IsMulti, Group> {
88
+ /**
89
+ * The children to be rendered.
90
+ */
91
+ children: ReactNode;
92
+ /**
93
+ * Props to be passed on to the wrapper.
94
+ */
95
+ innerProps: JSX.IntrinsicElements['div'];
96
+ }
97
+ export declare const NoOptionsMessage: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ children, innerProps, ...restProps }: NoticeProps<Option, IsMulti, Group>) => jsx.JSX.Element;
98
+ export declare const LoadingMessage: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ children, innerProps, ...restProps }: NoticeProps<Option, IsMulti, Group>) => jsx.JSX.Element;
99
+ export interface MenuPortalProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> extends CommonPropsAndClassName<Option, IsMulti, Group> {
100
+ appendTo: HTMLElement | undefined;
101
+ children: ReactNode;
102
+ controlElement: HTMLDivElement | null;
103
+ innerProps: JSX.IntrinsicElements['div'];
104
+ menuPlacement: MenuPlacement;
105
+ menuPosition: MenuPosition;
106
+ }
107
+ export interface PortalStyleArgs {
108
+ offset: number;
109
+ position: MenuPosition;
110
+ rect: {
111
+ left: number;
112
+ width: number;
113
+ };
114
+ }
115
+ export declare const menuPortalCSS: ({ rect, offset, position }: PortalStyleArgs) => CSSObjectWithLabel;
116
+ export declare const MenuPortal: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: MenuPortalProps<Option, IsMulti, Group>) => jsx.JSX.Element | null;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { type ComponentType, type ReactNode } from 'react';
6
+ import { jsx } from '@emotion/react';
7
+ import { type SelectProps } from '../../select';
8
+ import { type CommonPropsAndClassName, type CSSObjectWithLabel, type GroupBase } from '../../types';
9
+ interface MultiValueComponents<Option, IsMulti extends boolean, Group extends GroupBase<Option>> {
10
+ Container: ComponentType<MultiValueGenericProps<Option, IsMulti, Group>>;
11
+ Label: ComponentType<MultiValueGenericProps<Option, IsMulti, Group>>;
12
+ Remove: ComponentType<MultiValueRemoveProps<Option, IsMulti, Group>>;
13
+ }
14
+ export interface MultiValueProps<Option = unknown, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>> extends CommonPropsAndClassName<Option, IsMulti, Group> {
15
+ children: ReactNode;
16
+ components: MultiValueComponents<Option, IsMulti, Group>;
17
+ cropWithEllipsis?: boolean;
18
+ data: Option;
19
+ innerProps: JSX.IntrinsicElements['div'];
20
+ isFocused: boolean;
21
+ isDisabled: boolean;
22
+ removeProps: JSX.IntrinsicElements['div'];
23
+ index: number;
24
+ }
25
+ export declare const multiValueCSS: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ isDisabled, isFocused, }: MultiValueProps<Option, IsMulti, Group>) => CSSObjectWithLabel;
26
+ export declare const multiValueLabelCSS: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ cropWithEllipsis, isDisabled, }: MultiValueProps<Option, IsMulti, Group>) => CSSObjectWithLabel;
27
+ export declare const multiValueRemoveCSS: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ isFocused, }: MultiValueProps<Option, IsMulti, Group>) => CSSObjectWithLabel;
28
+ export interface MultiValueGenericProps<Option = unknown, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>> {
29
+ children: ReactNode;
30
+ data: any;
31
+ innerProps: {
32
+ className?: string;
33
+ };
34
+ selectProps: SelectProps<Option, IsMulti, Group>;
35
+ }
36
+ export declare const MultiValueContainer: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ children, innerProps, }: MultiValueGenericProps<Option, IsMulti, Group>) => jsx.JSX.Element;
37
+ export declare const MultiValueLabel: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ children, innerProps, }: MultiValueGenericProps<Option, IsMulti, Group>) => jsx.JSX.Element;
38
+ export interface MultiValueRemoveProps<Option = unknown, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>> {
39
+ children?: ReactNode;
40
+ data: Option;
41
+ innerProps: JSX.IntrinsicElements['div'];
42
+ selectProps: SelectProps<Option, IsMulti, Group>;
43
+ isDisabled: boolean;
44
+ }
45
+ export declare function MultiValueRemove<Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ isDisabled, innerProps, }: MultiValueRemoveProps<Option, IsMulti, Group>): jsx.JSX.Element;
46
+ declare const MultiValue: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: MultiValueProps<Option, IsMulti, Group>) => jsx.JSX.Element;
47
+ export default MultiValue;
@@ -0,0 +1,49 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { type ReactNode, type RefCallback } from 'react';
6
+ import { jsx } from '@emotion/react';
7
+ import { type CommonPropsAndClassName, type CSSObjectWithLabel, type GroupBase } from '../../types';
8
+ export interface OptionProps<Option = unknown, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>> extends CommonPropsAndClassName<Option, IsMulti, Group> {
9
+ /**
10
+ * The children to be rendered.
11
+ */
12
+ children: ReactNode;
13
+ /**
14
+ * Inner ref to DOM Node
15
+ */
16
+ innerRef: RefCallback<HTMLDivElement>;
17
+ /**
18
+ * props passed to the wrapping element for the group.
19
+ */
20
+ innerProps: JSX.IntrinsicElements['div'];
21
+ /**
22
+ * Text to be displayed representing the option.
23
+ */
24
+ label: string;
25
+ /**
26
+ * Type is used by the menu to determine whether this is an option or a group.
27
+ * In the case of option this is always `option`. *
28
+ */
29
+ type: 'option';
30
+ /**
31
+ * The data of the selected option.
32
+ */
33
+ data: Option;
34
+ /**
35
+ * Whether the option is disabled.
36
+ */
37
+ isDisabled: boolean;
38
+ /**
39
+ * Whether the option is focused.
40
+ */
41
+ isFocused: boolean;
42
+ /**
43
+ * Whether the option is selected.
44
+ */
45
+ isSelected: boolean;
46
+ }
47
+ export declare const optionCSS: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ isDisabled, isFocused, isSelected, }: OptionProps<Option, IsMulti, Group>) => CSSObjectWithLabel;
48
+ declare const Option: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: OptionProps<Option, IsMulti, Group>) => jsx.JSX.Element;
49
+ export default Option;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { type ReactNode } from 'react';
6
+ import { jsx } from '@emotion/react';
7
+ import { type CommonPropsAndClassName, type CSSObjectWithLabel, type GroupBase } from '../../types';
8
+ export interface PlaceholderProps<Option = unknown, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>> extends CommonPropsAndClassName<Option, IsMulti, Group> {
9
+ /**
10
+ * The children to be rendered.
11
+ */
12
+ children: ReactNode;
13
+ /**
14
+ * props passed to the wrapping element for the group.
15
+ */
16
+ innerProps: JSX.IntrinsicElements['div'];
17
+ isDisabled: boolean;
18
+ isFocused: boolean;
19
+ }
20
+ export declare const placeholderCSS: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ isDisabled, }: PlaceholderProps<Option, IsMulti, Group>) => CSSObjectWithLabel;
21
+ declare const Placeholder: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: PlaceholderProps<Option, IsMulti, Group>) => jsx.JSX.Element;
22
+ export default Placeholder;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { type ReactNode } from 'react';
6
+ import { jsx } from '@emotion/react';
7
+ import { type CommonPropsAndClassName, type CSSObjectWithLabel, type GroupBase } from '../../types';
8
+ export interface SingleValueProps<Option = unknown, IsMulti extends boolean = boolean, Group extends GroupBase<Option> = GroupBase<Option>> extends CommonPropsAndClassName<Option, IsMulti, Group> {
9
+ /**
10
+ * The children to be rendered.
11
+ */
12
+ children: ReactNode;
13
+ /**
14
+ * The data of the selected option rendered in the Single Value component.
15
+ */
16
+ data: Option;
17
+ /**
18
+ * Props passed to the wrapping element for the group.
19
+ */
20
+ innerProps: JSX.IntrinsicElements['div'];
21
+ /**
22
+ * Whether this is disabled.
23
+ */
24
+ isDisabled: boolean;
25
+ }
26
+ export declare const css: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({ isDisabled, }: SingleValueProps<Option, IsMulti, Group>) => CSSObjectWithLabel;
27
+ declare const SingleValue: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: SingleValueProps<Option, IsMulti, Group>) => jsx.JSX.Element;
28
+ export default SingleValue;
@@ -155,7 +155,7 @@ export interface SelectProps<Option, IsMulti extends boolean, Group extends Grou
155
155
  /**
156
156
  * Formats group labels in the menu as React components
157
157
  *
158
- * An example can be found in the [Replacing builtins](/advanced#replacing-builtins) documentation.
158
+ * An example can be found in the [Replacing builtins](https://react-select.com/advanced#replacing-builtins) documentation.
159
159
  */
160
160
  formatGroupLabel: (group: Group) => ReactNode;
161
161
  /**
@@ -212,7 +212,7 @@ export interface SelectProps<Option, IsMulti extends boolean, Group extends Grou
212
212
  /**
213
213
  * Override the built-in logic to detect whether an option is disabled
214
214
  *
215
- * An example can be found in the [Replacing builtins](/advanced#replacing-builtins) documentation.
215
+ * An example can be found in the [Replacing builtins](https://react-select.com/advanced#replacing-builtins) documentation.
216
216
  */
217
217
  isOptionDisabled: (option: Option, selectValue: Options<Option>) => boolean;
218
218
  /**
@@ -275,7 +275,7 @@ export interface SelectProps<Option, IsMulti extends boolean, Group extends Grou
275
275
  /**
276
276
  * Whether the menu should use a portal, and where it should attach
277
277
  *
278
- * An example can be found in the [Portaling](/advanced#portaling) documentation
278
+ * An example can be found in the [Portaling](https://react-select.com/advanced#portaling) documentation
279
279
  */
280
280
  menuPortalTarget?: HTMLElement | null;
281
281
  /**
@@ -369,7 +369,7 @@ export interface SelectProps<Option, IsMulti extends boolean, Group extends Grou
369
369
  /**
370
370
  * Style modifier methods
371
371
  *
372
- * A basic example can be found at the bottom of the [Replacing builtins](/advanced#replacing-builtins) documentation.
372
+ * A basic example can be found at the bottom of the [Replacing builtins](https://react-select.com/advanced#replacing-builtins) documentation.
373
373
  */
374
374
  styles: StylesConfig<Option, IsMulti, Group>;
375
375
  /**
@@ -424,6 +424,7 @@ export interface SelectProps<Option, IsMulti extends boolean, Group extends Grou
424
424
  spacing?: 'compact' | 'default';
425
425
  appearance: 'default' | 'subtle' | 'none';
426
426
  [key: string]: any;
427
+ UNSAFE_is_experimental_generic?: boolean;
427
428
  }
428
429
  export declare const defaultProps: {
429
430
  'aria-live': string | undefined;
@@ -466,6 +467,7 @@ export declare const defaultProps: {
466
467
  styles: {};
467
468
  tabIndex: number;
468
469
  tabSelectsValue: boolean;
470
+ UNSAFE_is_experimental_generic: boolean;
469
471
  };
470
472
  interface State<Option, IsMulti extends boolean, Group extends GroupBase<Option>> {
471
473
  ariaSelection: AriaSelection<Option, IsMulti> | null;
@@ -545,6 +547,7 @@ export default class Select<Option = unknown, IsMulti extends boolean = false, G
545
547
  styles: {};
546
548
  tabIndex: number;
547
549
  tabSelectsValue: boolean;
550
+ UNSAFE_is_experimental_generic: boolean;
548
551
  };
549
552
  state: State<Option, IsMulti, Group>;
550
553
  blockOptionHover: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-select",
3
- "version": "2.1.0",
3
+ "version": "2.2.1",
4
4
  "description": "A forked version of react-select to only be used in atlaskit/select",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,9 +33,9 @@
33
33
  "@atlaskit/icon": "^25.5.0",
34
34
  "@atlaskit/layering": "^2.1.0",
35
35
  "@atlaskit/platform-feature-flags": "^1.1.0",
36
- "@atlaskit/primitives": "^14.3.0",
36
+ "@atlaskit/primitives": "^14.4.0",
37
37
  "@atlaskit/spinner": "^18.0.0",
38
- "@atlaskit/tokens": "^4.6.0",
38
+ "@atlaskit/tokens": "^4.7.0",
39
39
  "@babel/runtime": "^7.0.0",
40
40
  "@emotion/react": "^11.7.1",
41
41
  "@floating-ui/dom": "^1.0.1",