+ {label && (
+
+
+ {label}
+
+
+ )}
+ {renderRoot(
+ {
+ ...rootProps,
+ disabled,
+ },
+ value,
+ getTagProps,
+ )}
+ {error && errorText && (
+
+ {errorText}
+
+ )}
+
+
+ {loading && groupedOptions.length === 0 && (
+
+ {typeof loadingText === 'string' ? (
+
+ {loadingText}
+
+ ) : loadingText}
+
+ )}
+ {groupedOptions.length === 0 && !loading && (
+
+ {typeof noOptionsText === 'string' ? (
+
+ {noOptionsText}
+
+ ) : noOptionsText}
+
+ )}
+ {groupedOptions.length > 0 && (
+
+ {groupedOptions
+ // @ts-ignore
+ .map((option, index) => {
+ // @ts-ignore
+ if (groupBy && 'options' in option) {
+ return renderGroup({
+ key: option.key,
+ group: option.group,
+ // @ts-ignore
+ children: option.options.map((option2, index2) => (
+ renderListOption(option2, option.index + index2)
+ )),
+ });
+ }
+
+ return renderListOption(option as T, index);
+ })}
+
+ )}
+
+
+
+ );
+};
+
+// @ts-ignore
+Autocomplete.defaultProps = {
+ noOptionsText: 'No options',
+ loading: false,
+ loadingText: 'Loading...',
+ required: false,
+ allowCreateOption: false,
+ size: 'medium',
+};
diff --git a/packages/react-components/src/Autocomplete/index.ts b/packages/react-components/src/Autocomplete/index.ts
new file mode 100644
index 00000000..7020b66f
--- /dev/null
+++ b/packages/react-components/src/Autocomplete/index.ts
@@ -0,0 +1 @@
+export { Autocomplete } from './autocomplete';
diff --git a/packages/react-components/src/hooks/index.ts b/packages/react-components/src/hooks/index.ts
index 5be5ca6a..c33abf1d 100644
--- a/packages/react-components/src/hooks/index.ts
+++ b/packages/react-components/src/hooks/index.ts
@@ -21,3 +21,4 @@ export type {
export { useEventCallback } from './use_event_callback';
export { useEnhancedEffect } from './use_enhanced_effect';
export { useDebounceCallback } from './use_debounce_callback';
+export { useOutsideClick } from './use_outside_click';
diff --git a/packages/react-components/src/hooks/use_autocomplete.ts b/packages/react-components/src/hooks/use_autocomplete.ts
index 8ada1741..14b06734 100644
--- a/packages/react-components/src/hooks/use_autocomplete.ts
+++ b/packages/react-components/src/hooks/use_autocomplete.ts
@@ -34,8 +34,8 @@ export type AutocompleteGroupedOption