@devopness/ui-react
Version:
Devopness Design System React Components - Painless essential DevOps to everyone
33 lines (32 loc) • 1.11 kB
TypeScript
import { ComponentPropsWithoutRef } from 'react';
import { default as MuiAutocomplete } from '@mui/material/Autocomplete';
import { Input } from '../Input';
/**
* Props for the Autocomplete component
*/
type AutocompleteProps = {
/** Props passed directly to Input component */
inputProps: Omit<ComponentPropsWithoutRef<typeof Input>, 'type'>;
/** Props passed directly to MUI Autocomplete component */
autocompleteProps: Pick<ComponentPropsWithoutRef<typeof MuiAutocomplete>, 'options' | 'onInputChange' | 'onChange' | 'onBlur' | 'value' | 'open'>;
};
/**
* Autocomplete component
*
* Wraps a Material UI Autocomplete with a styled Input component.
*
* @example
* ```tsx
* <Autocomplete
* inputProps={{ placeholder: 'Type something' }}
* autocompleteProps={{
* options: ['Option 1', 'Option 2'],
* value: 'Option 1',
* onChange: (val) => console.log(val)
* }}
* />
* ```
*/
declare const Autocomplete: ({ inputProps, autocompleteProps }: AutocompleteProps) => import("react/jsx-runtime").JSX.Element;
export { Autocomplete };
export type { AutocompleteProps };