report fix

This commit is contained in:
hamid zarghami
2025-12-22 11:29:05 +03:30
parent e698efbedc
commit 4345eba974
6 changed files with 58 additions and 11 deletions
+8 -6
View File
@@ -9,17 +9,18 @@ type Props = {
labelText?: React.ReactNode;
value?: string;
valid?: boolean
inputClassName?: string;
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, "id">;
const InputField = React.forwardRef<HTMLInputElement, Props>(
({ onChange, htmlFor, labelText, children, valid = true, className, ...inputProps }, ref) => {
({ onChange, htmlFor, labelText, children, valid = true, className, inputClassName, ...inputProps }, ref) => {
return (
<div
spellCheck={false}
<div
spellCheck={false}
className={`${className} ${valid ? 'border-border' : 'border-invalid'} h-11 inline-flex relative border px-3 w-full rounded-normal group focus-within:border`}>
<label
className='absolute start-2 -top-2.5 px-2 bg-inherit text-[12px] text-foreground'
className='absolute start-2 -top-2.5 px-2 text-[12px] text-foreground bg-white'
htmlFor={htmlFor}>
{labelText}
</label>
@@ -29,8 +30,9 @@ const InputField = React.forwardRef<HTMLInputElement, Props>(
ref={ref}
onChange={onChange}
className={clsx(
inputProps['aria-errormessage'] && '!text-red-300',
'py-2.5 pt-3.5 text-sm2 w-full outline-0 !leading-6'
inputProps['aria-errormessage'] && 'text-red-300!',
'py-2.5 pt-3.5 text-sm2 w-full outline-0 leading-6!',
inputClassName
)}
name={htmlFor}
{...inputProps} />
+3 -3
View File
@@ -23,7 +23,7 @@ function PasswordField({ onChange, htmlFor, labelText, children, valid = true, c
spellCheck={false}
className={`${className} ${valid ? 'border-border' : 'border-invalid'} h-11 inline-flex relative border px-3 w-full rounded-normal group focus-within:border`}>
<label
className='absolute start-2 -top-2.5 px-2 bg-inherit text-[12px] text-foreground'
className='absolute start-2 bg-white -top-2.5 px-2 text-[12px] text-foreground'
htmlFor={htmlFor}>
{labelText}
</label>
@@ -33,8 +33,8 @@ function PasswordField({ onChange, htmlFor, labelText, children, valid = true, c
type={state ? 'text' : 'password'}
onChange={onChange}
className={clsx(
inputProps['aria-errormessage'] && '!text-red-300',
'py-2.5 pt-3.5 text-sm2 w-full outline-0 !leading-6'
inputProps['aria-errormessage'] && 'text-red-300!',
'py-2.5 pt-3.5 text-sm2 w-full outline-0 leading-6!'
)}
name={htmlFor}
{...inputProps} />