mirror of
https://github.com/SomboChea/ui
synced 2024-06-27 21:45:33 +07:00
111f0c50e5
* chore: updated emotion dependency * feat: introduced theme * refactor: updated emotion styles * fix: fixed emotion error * fix: fixed tests * chore: add missing types Co-Authored-By: Thomas Klein <tmkn@users.noreply.github.com>
45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
import React from 'react';
|
|
import styled from '@emotion/styled';
|
|
|
|
import TextField from '../../muiComponents/TextField';
|
|
import Paper from '../../muiComponents/Paper';
|
|
import { Theme } from '../../design-tokens/theme';
|
|
|
|
export interface InputFieldProps {
|
|
color: string;
|
|
}
|
|
|
|
export const Wrapper = styled('div')({
|
|
width: '100%',
|
|
height: '32px',
|
|
position: 'relative',
|
|
zIndex: 1,
|
|
});
|
|
|
|
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,
|
|
},
|
|
}));
|
|
|
|
/* eslint-disable verdaccio/jsx-spread */
|
|
// @ts-ignore types of color are incompatible
|
|
export const InputField: React.FC<InputFieldProps> = ({ ...others }) => <StyledTextField {...others} />;
|
|
|
|
export const SuggestionContainer = styled(Paper)({
|
|
maxHeight: '500px',
|
|
overflowY: 'auto',
|
|
});
|