fix: update form

This commit is contained in:
2025-06-16 16:26:23 +03:00
parent d53c5606ff
commit 39d4c3c362
30 changed files with 653 additions and 125 deletions

View File

@@ -13,6 +13,8 @@ type TextAreaProps = {
children?: ReactNode;
variant?: 'default' | 'ghost';
fullWidth?: boolean;
error?: string | boolean;
errorTextColor?: string;
} & DetailedHTMLProps<
TextareaHTMLAttributes<HTMLTextAreaElement>,
HTMLTextAreaElement
@@ -24,6 +26,8 @@ const TextArea = forwardRef(function TextArea(
children,
variant = 'default',
fullWidth = false,
error = false,
errorTextColor,
...props
}: TextAreaProps,
ref: Ref<HTMLTextAreaElement>,
@@ -33,10 +37,20 @@ const TextArea = forwardRef(function TextArea(
<textarea
{...props}
ref={ref}
className={clsx(className, s.Area, s['Area_' + variant])}
className={clsx(
className,
s.Area,
s['Area_' + variant],
error && s.Area_error,
)}
>
{children}
</textarea>
{error && (
<span className={s.Error} style={{ color: errorTextColor }}>
{error}
</span>
)}
</div>
);
});