grommet
Version:
focus on the essential experience
30 lines • 1.15 kB
JavaScript
import styled, { css } from 'styled-components';
import { disabledStyle, inputStyle, styledComponentsConfig } from '../../utils';
var plainStyle = css(["outline:none;border:none;width:100%;-webkit-appearance:none;"]);
var resizeStyle = function resizeStyle(resize) {
if (resize === 'horizontal') {
return 'resize: horizontal;';
}
if (resize === 'vertical') {
return 'resize: vertical;';
}
if (resize) {
return 'resize: both;';
}
return 'resize: none;';
};
var StyledTextArea = styled.textarea.withConfig(styledComponentsConfig).withConfig({
displayName: "StyledTextArea",
componentId: "sc-17i3mwp-0"
})(["", " ", " ", " ", " ", " ", ";max-width:100%;"], inputStyle, function (props) {
return props.resize !== undefined && resizeStyle(props.resize);
}, function (props) {
return props.fillArg && 'height: 100%;';
}, function (props) {
return props.plain && plainStyle;
}, function (props) {
return props.disabled && disabledStyle(props.theme.textArea.disabled && props.theme.textArea.disabled.opacity);
}, function (props) {
return props.theme.textArea && props.theme.textArea.extend;
});
export { StyledTextArea };