This commit is contained in:
Vula Builder
2026-06-04 11:25:13 +00:00
parent 23957dc1b4
commit 6f6894c1b4
+30
View File
@@ -0,0 +1,30 @@
'use client'
import { cn } from "@/lib/utils"
import { InputHTMLAttributes, forwardRef } from "react"
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
error?: string
}
const Input = forwardRef<HTMLInputElement, InputProps>(
({ className, error, ...props }, ref) => {
return (
<input
ref={ref}
className={cn(
"flex h-10 w-full rounded-md border border-border bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:border-[#000080] focus:ring-1 focus:ring-[#000080]/30 disabled:cursor-not-allowed disabled:opacity-50",
error && "border-red-500 focus:border-red-500 focus:ring-red-500/30",
className
)}
aria-invalid={error ? "true" : undefined}
aria-describedby={error ? `${props.id}-error` : undefined}
{...props}
/>
)
}
)
Input.displayName = "Input"
export default Input