@payfit/unity-components
Version:
63 lines (62 loc) • 2.25 kB
TypeScript
import { RefObject } from 'react';
import { VariantProps } from '@payfit/unity-themes';
import { PopoverProps } from 'react-aria-components/Popover';
import { AutocompleteProps } from '../Autocomplete.js';
export declare const autocompletePanel: import('tailwind-variants').TVReturnType<{
[key: string]: {
[key: string]: import('tailwind-merge').ClassNameValue | {
base?: import('tailwind-merge').ClassNameValue;
list?: import('tailwind-merge').ClassNameValue;
};
};
} | {
[x: string]: {
[x: string]: import('tailwind-merge').ClassNameValue | {
base?: import('tailwind-merge').ClassNameValue;
list?: import('tailwind-merge').ClassNameValue;
};
};
} | {}, {
base: string;
list: string;
}, undefined, {
[key: string]: {
[key: string]: import('tailwind-merge').ClassNameValue | {
base?: import('tailwind-merge').ClassNameValue;
list?: import('tailwind-merge').ClassNameValue;
};
};
} | {}, {
base: string;
list: string;
}, import('tailwind-variants').TVReturnType<unknown, {
base: string;
list: string;
}, undefined, unknown, unknown, undefined>>;
export interface AutocompletePanelProps<T extends object> extends VariantProps<typeof autocompletePanel>, Omit<PopoverProps, 'children'> {
/** Width of the panel, used to match the width of the search input */
panelWidth: string | null;
/** Reference to the search input element */
searchRef: RefObject<HTMLDivElement>;
/** The content to render inside the panel */
children: AutocompleteProps<T>['children'];
}
/**
* The `AutocompletePanel` component is used within the Autocomplete component to display the dropdown panel containing autocomplete results.
* It handles both the loading state and the empty state when no results are found.
* @example
* ```tsx
* <AutocompletePanel
* panelWidth={searchWidth}
* searchRef={searchRef}
* isLoading={isLoading}
* >
* {children}
* </AutocompletePanel>
* ```
*/
declare const AutocompletePanel: {
<T extends object>(props: AutocompletePanelProps<T>): import("react/jsx-runtime").JSX.Element;
displayName: string;
};
export { AutocompletePanel };