2019-02-03 17:23:33 +07:00
|
|
|
import React from 'react';
|
2019-11-23 19:41:14 +07:00
|
|
|
import styled from '@emotion/styled';
|
2019-02-03 17:23:33 +07:00
|
|
|
|
2019-10-03 23:17:04 +07:00
|
|
|
import TextField from '../../muiComponents/TextField';
|
2019-10-31 14:12:18 +07:00
|
|
|
import Paper from '../../muiComponents/Paper';
|
2019-11-23 19:41:14 +07:00
|
|
|
import { Theme } from '../../design-tokens/theme';
|
2019-02-03 17:23:33 +07:00
|
|
|
|
2019-06-20 19:37:28 +07:00
|
|
|
export interface InputFieldProps {
|
|
|
|
color: string;
|
|
|
|
}
|
|
|
|
|
2019-07-15 16:57:32 +07:00
|
|
|
export const Wrapper = styled('div')({
|
2019-11-23 19:41:14 +07:00
|
|
|
width: '100%',
|
|
|
|
height: '32px',
|
|
|
|
position: 'relative',
|
|
|
|
zIndex: 1,
|
2019-07-15 16:57:32 +07:00
|
|
|
});
|
2019-02-03 17:23:33 +07:00
|
|
|
|
2019-11-23 19:41:14 +07:00
|
|
|
export const StyledTextField = styled(TextField)<{ theme?: Theme }>(props => ({
|
|
|
|
'& .MuiInputBase-root': {
|
|
|
|
':before': {
|
|
|
|
content: "''",
|
|
|
|
border: 'none',
|
|
|
|
},
|
|
|
|
':after': {
|
|
|
|
borderColor: props.theme && props.theme.palette.white,
|
|
|
|
},
|
|
|
|
':hover:before': {
|
|
|
|
content: 'none',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'& .MuiInputBase-input': {
|
|
|
|
color: props.theme && props.theme.palette.white,
|
|
|
|
},
|
|
|
|
}));
|
|
|
|
|
2019-10-03 23:17:04 +07:00
|
|
|
/* eslint-disable verdaccio/jsx-spread */
|
2019-11-23 19:41:14 +07:00
|
|
|
// @ts-ignore types of color are incompatible
|
|
|
|
export const InputField: React.FC<InputFieldProps> = ({ ...others }) => <StyledTextField {...others} />;
|
2019-05-11 13:59:39 +07:00
|
|
|
|
2019-07-15 16:57:32 +07:00
|
|
|
export const SuggestionContainer = styled(Paper)({
|
2019-11-23 19:41:14 +07:00
|
|
|
maxHeight: '500px',
|
|
|
|
overflowY: 'auto',
|
2019-07-15 16:57:32 +07:00
|
|
|
});
|