@@ -4,10 +4,11 @@ import { useTranslation } from "react-i18next";
44import cn from "classnames" ;
55import "./text-field.scss" ;
66
7- export interface TextFieldProps extends React . DetailedHTMLProps <
8- React . InputHTMLAttributes < HTMLInputElement > ,
9- HTMLInputElement
10- > {
7+ export interface TextFieldProps
8+ extends React . DetailedHTMLProps <
9+ React . InputHTMLAttributes < HTMLInputElement > ,
10+ HTMLInputElement
11+ > {
1112 theme ?: "primary" | "dark" ;
1213 label ?: string | React . ReactNode ;
1314 hint ?: string | React . ReactNode ;
@@ -42,7 +43,10 @@ export const TextField = React.forwardRef<HTMLInputElement, TextFieldProps>(
4243 const [ isPasswordVisible , setIsPasswordVisible ] = useState ( false ) ;
4344 const { t } = useTranslation ( "forms" ) ;
4445 const showPasswordToggleButton = props . type === "password" ;
45- const inputType = props . type === "password" && isPasswordVisible ? "text" : props . type ?? "text" ;
46+ const inputType =
47+ props . type === "password" && isPasswordVisible
48+ ? "text"
49+ : ( props . type ?? "text" ) ;
4650 const hintContent = error ? (
4751 < small className = "text-field-container__error-label" > { error } </ small >
4852 ) : hint ? (
@@ -106,4 +110,4 @@ export const TextField = React.forwardRef<HTMLInputElement, TextFieldProps>(
106110 ) ;
107111 }
108112) ;
109- TextField . displayName = "TextField" ;
113+ TextField . displayName = "TextField" ;
0 commit comments