retro-react
Version:
A React component library for building retro-style websites
66 lines (65 loc) • 2.04 kB
TypeScript
/// <reference types="react" />
import { ThemeUICSSObject } from 'theme-ui';
import { ComponentColors } from "../../utils/getColorScheme";
export declare type AutocompleteVariants = 'outlined' | 'filled';
export declare type AutocompleteSizes = 'small' | 'medium' | string;
export interface AutocompleteInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
/**
* Specifies the visual variant of the Autocomplete input.
*
* 'outlined' - Input will have an outline.
* 'filled' - Input will have a solid background color.
*
* @default 'filled'
*/
variant?: AutocompleteVariants;
/**
* Determines the color scheme of the Autocomplete input.
*
* @default 'primary'
*/
color?: ComponentColors | 'greyscale';
/**
* Specifies the size of the Autocomplete input.
*
* @default 'medium'
*/
size?: AutocompleteSizes;
/**
* Determines if the Autocomplete input should have rounded edges.
*
* @default false
*/
rounded?: boolean;
/**
* Message to display when there are no suggestions.
*
* @default 'No suggestions'
*/
noResultsMessage?: string;
/**
* Determines if the Autocomplete input should be clearable.
*
* @default true
*/
clearable?: boolean;
/**
* Allows for custom styles using ThemeUI's sx prop.
*/
sx?: ThemeUICSSObject;
}
export interface AutocompleteProps extends AutocompleteInputProps {
/**
* An array of strings that will be used as suggestions.
*
* @default []
*/
suggestions?: string[];
/**
* Callback function that will be called when a suggestion is selected.
*
* @default undefined
*/
onSuggestionSelect?: (selected: string) => void;
}
export declare const Autocomplete: import("react").ForwardRefExoticComponent<AutocompleteProps & import("react").RefAttributes<HTMLInputElement>>;