/** * @file Input component */ import React from "react"; import styles from "./Input.module.css"; export type InputProps = { error?: boolean; variant?: "default" | "outline" | "filled"; label?: string; } & React.InputHTMLAttributes; export const Input = React.forwardRef( ({ error = false, variant = "default", label, className = "", ...props }, ref) => { const hasLabel = label !== undefined; const containerClasses = [hasLabel ? styles.inputWithLabel : styles.input, className].filter(Boolean).join(" "); if (hasLabel) { return (
{label}
); } return ( ); }, ); Input.displayName = "Input";