|
|
@ -9,6 +9,7 @@ const FormFields = ({ |
|
|
|
set, |
|
|
|
set, |
|
|
|
label, |
|
|
|
label, |
|
|
|
borderClassname, |
|
|
|
borderClassname, |
|
|
|
|
|
|
|
inputClassname, |
|
|
|
type, |
|
|
|
type, |
|
|
|
maxLength, |
|
|
|
maxLength, |
|
|
|
max, |
|
|
|
max, |
|
|
@ -17,7 +18,7 @@ const FormFields = ({ |
|
|
|
onClick, |
|
|
|
onClick, |
|
|
|
}) => { |
|
|
|
}) => { |
|
|
|
const [value, setValue] = useState(defaultValue); |
|
|
|
const [value, setValue] = useState(defaultValue); |
|
|
|
|
|
|
|
console.log(value); |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div |
|
|
|
<div |
|
|
|
onClick={onClick} |
|
|
|
onClick={onClick} |
|
|
@ -31,8 +32,8 @@ const FormFields = ({ |
|
|
|
className={ |
|
|
|
className={ |
|
|
|
"text-xs absolute transition-all duration-300 pointer-events-none px-3 transform -translate-x-[7px]" + |
|
|
|
"text-xs absolute transition-all duration-300 pointer-events-none px-3 transform -translate-x-[7px]" + |
|
|
|
(value |
|
|
|
(value |
|
|
|
? `text-[#2483E1] bg-white top-[-10px]` |
|
|
|
? ` text-blue-600 bg-white top-[-10px]` |
|
|
|
: "text-[#0F0543] top-[10px]") |
|
|
|
: " text-gray-400 top-[10px]") |
|
|
|
} |
|
|
|
} |
|
|
|
> |
|
|
|
> |
|
|
|
{label} |
|
|
|
{label} |
|
|
@ -54,7 +55,7 @@ const FormFields = ({ |
|
|
|
e.target.value = value; |
|
|
|
e.target.value = value; |
|
|
|
}} |
|
|
|
}} |
|
|
|
className={`rtl w-full h-full px-4 py-2 outline-0 text-xs rounded-md text-[#0F0543] focus:bg-white border-[#E0E0E0] focus:border-[#2483E1] focus:ring-transparent
|
|
|
|
className={`rtl w-full h-full px-4 py-2 outline-0 text-xs rounded-md text-[#0F0543] focus:bg-white border-[#E0E0E0] focus:border-[#2483E1] focus:ring-transparent
|
|
|
|
${value === "" ? "bg-red-200 " : "bg-[#F9F9F9] "} `}
|
|
|
|
${!value ? "bg-[#F9F9F9] " : "bg-white "} `}
|
|
|
|
onChange={(e) => setValue(e.target.value)} |
|
|
|
onChange={(e) => setValue(e.target.value)} |
|
|
|
inputMode={type === "number" ? "numeric" : ""} |
|
|
|
inputMode={type === "number" ? "numeric" : ""} |
|
|
|
/> |
|
|
|
/> |
|
|
|