Adjust helper text spcing, expose hidden prop
This commit is contained in:
1 parent
9e3a2bb03a
commit
817bbb1804
1 file changed
+8
-3
@@ -8,8 +8,8 @@ const getSx = (theme, type, maxWidth) => {
|
|||||||
maxWidth: maxWidth,
|
maxWidth: maxWidth,
|
||||||
"& .MuiFormHelperText-root": {
|
"& .MuiFormHelperText-root": {
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
bottom: `-${theme.spacing(12)}`,
|
bottom: `-${theme.spacing(24)}`,
|
||||||
minHeight: theme.spacing(12),
|
minHeight: theme.spacing(24),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -79,13 +79,17 @@ const TextInput = forwardRef(
|
|||||||
maxWidth = "100%",
|
maxWidth = "100%",
|
||||||
flex,
|
flex,
|
||||||
disabled = false,
|
disabled = false,
|
||||||
|
hidden = false,
|
||||||
},
|
},
|
||||||
ref
|
ref
|
||||||
) => {
|
) => {
|
||||||
const [fieldType, setFieldType] = useState(type);
|
const [fieldType, setFieldType] = useState(type);
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
return (
|
return (
|
||||||
<Stack flex={flex}>
|
<Stack
|
||||||
|
flex={flex}
|
||||||
|
display={hidden ? "none" : ""}
|
||||||
|
>
|
||||||
<Typography
|
<Typography
|
||||||
component="h3"
|
component="h3"
|
||||||
fontSize={"var(--env-var-font-size-medium)"}
|
fontSize={"var(--env-var-font-size-medium)"}
|
||||||
@@ -144,6 +148,7 @@ TextInput.propTypes = {
|
|||||||
maxWidth: PropTypes.string,
|
maxWidth: PropTypes.string,
|
||||||
flex: PropTypes.number,
|
flex: PropTypes.number,
|
||||||
disabled: PropTypes.bool,
|
disabled: PropTypes.bool,
|
||||||
|
hidden: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default TextInput;
|
export default TextInput;
|
||||||
Reference in new issue
Block a user