UNPKG

@makeen.io/material-ui-kit

Version:
84 lines (36 loc) 3.84 kB
import _extends from "@babel/runtime/helpers/extends";import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";function _templateObject() {var data = _taggedTemplateLiteral(["\n ", "\n\n & {\n &.success {\n .MuiOutlinedInput-notchedOutline {\n border-color: ", ";\n }\n }\n\n .MuiInputBase-root.Mui-disabled {\n color: ", ";\n background-color: ", ";\n }\n\n .MuiFormLabel-root.Mui-focused {\n color: ", ";\n }\n\n .MuiOutlinedInput-notchedOutline {\n legend {\n height: 5px;\n }\n }\n\n .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline {\n border-color: ", ";\n border-width: 1px;\n }\n\n .MuiInputAdornment-positionEnd {\n margin-right: 16px;\n }\n\n .MuiInputBase-input {\n height: 20px;\n }\n\n .MuiInputBase-inputMultiline {\n height: auto;\n }\n\n .MuiInputAdornment-root p {\n font-size: 15px;\n line-height: 1.33;\n }\n\n .MuiFormHelperText-root {\n font-size: 12px;\n line-height: 1.33;\n margin-top: 4px;\n margin-left: 16px;\n }\n }\n"]);_templateObject = function _templateObject() {return data;};return data;}import React from "react"; import InputAdornment from "@material-ui/core/InputAdornment"; import MuiTextField from "@material-ui/core/TextField"; import styled from "styled-components"; export default styled(function (_ref) {var id = _ref.id,errorText = _ref.errorText,readOnly = _ref.readOnly,register = _ref.register,className = _ref.className,prefix = _ref.prefix,leftIcon = _ref.leftIcon,rightIcon = _ref.rightIcon,helper = _ref.helper,success = _ref.success,_ref$type = _ref.type,type = _ref$type === void 0 ? "text" : _ref$type,rest = _objectWithoutProperties(_ref, ["id", "errorText", "readOnly", "register", "className", "prefix", "leftIcon", "rightIcon", "helper", "success", "type"]); var inputProps = { autoComplete: "off", endAdornment: null, startAdornment: null, type: type }; if (prefix) { inputProps.startAdornment = /*#__PURE__*/React.createElement(InputAdornment, { position: "start" }, prefix); } if (leftIcon) { inputProps.startAdornment = /*#__PURE__*/React.createElement(InputAdornment, { position: "start" }, leftIcon); } if (rightIcon) { inputProps.endAdornment = /*#__PURE__*/React.createElement(InputAdornment, { position: "end" }, rightIcon); } var classNames = success ? "".concat(className, " success") : className; var inputLabelProps = {}; var alwaysShrinkInputTypes = ["time", "week"]; if (alwaysShrinkInputTypes.includes(type)) { inputLabelProps.shrink = true; } return /*#__PURE__*/React.createElement("div", { className: classNames }, /*#__PURE__*/ React.createElement(MuiTextField, _extends({}, rest, { multiline: rest.rows ? rest.rows > 1 : false, id: id, fullWidth: true, helperText: errorText || helper, inputRef: register, InputProps: inputProps, variant: "outlined", error: !!errorText, InputLabelProps: inputLabelProps }))); })(_templateObject(), function (_ref2) {var customStyle = _ref2.customStyle;return customStyle ? customStyle() : "";}, function (_ref3) {var theme = _ref3.theme;return theme.palette.inputColors.outlinedBorderColor;}, function (_ref4) {var theme = _ref4.theme;return theme.palette.inputColors.disabledColor;}, function (_ref5) {var theme = _ref5.theme;return theme.palette.inputColors.disabledBackgroundColor;}, function (_ref6) {var theme = _ref6.theme;return theme.palette.inputColors.focusedColor;}, function (_ref7) {var theme = _ref7.theme;return theme.palette.inputColors.focusedOutlinedBorderColor;}); //# sourceMappingURL=Input.js.map