import EditIcon from '@mui/icons-material/Edit';
import { InputAdornment } from '@mui/material';
import { useState } from 'react';
import AutocompleteField from '.';
export default { title: 'InputField/Autocomplete' };
const options = [
{ id: 0, name: 'First Entity' },
{ id: 1, name: 'Second Entity' },
{ id: 2, name: 'Third Entity' }
];
const EndAdornment = (): JSX.Element => (
);
export const openWithThreeOptions = (): JSX.Element => {
return (
);
};
export const closeWithEndAdornment = (): JSX.Element => {
return (
}
label="Autocomplete"
options={options}
placeholder="Type here..."
value={options[1]}
/>
);
};
export const required = (): JSX.Element => {
return (
}
label="Autocomplete"
options={options}
placeholder="Type here..."
required
value={options[1]}
/>
);
};
export const closeWithError = (): JSX.Element => {
return (
}
error="Error"
freeSolo
label="Autocomplete"
options={options}
placeholder="Type here..."
value={options[1]}
/>
);
};
const autoSizeOptions = [
{ id: 0, name: 'First Entity' },
{ id: 1, name: 'Second Entity with a veryyyyy long label' },
{ id: 2, name: 'Another third entity option' }
];
interface AutoSizeAutocompleteFieldProps {
customPadding?: number;
endAdornment?: JSX.Element;
}
const AutoSizeAutocompleteField = ({
endAdornment,
customPadding
}: AutoSizeAutocompleteFieldProps): JSX.Element => {
const [value, setValue] = useState(null);
const change = (_, newValue): void => {
setValue(newValue);
};
return (
);
};
export const autoSize = (): JSX.Element => {
return ;
};