"use client"; import { Input as InputPrimitive } from "@base-ui/react/input"; import type * as React from "react"; import { cn } from "@/lib/utils"; export type InputProps = Omit< InputPrimitive.Props & React.RefAttributes, "size" > & { size?: "sm" | "default" | "lg" | number; unstyled?: boolean; nativeInput?: boolean; }; export function Input({ className, size = "default", unstyled = false, nativeInput = false, style, ...props }: InputProps): React.ReactElement { const inputClassName = cn( "h-8.5 w-full min-w-0 rounded-[inherit] px-[calc(--spacing(3)-1px)] leading-8.5 outline-none [transition:background-color_5000000s_ease-in-out_0s] placeholder:text-muted-foreground/72 sm:h-7.5 sm:leading-7.5", size === "sm" && "h-7.5 px-[calc(--spacing(2.5)-1px)] leading-7.5 sm:h-6.5 sm:leading-6.5", size === "lg" && "h-9.5 leading-9.5 sm:h-8.5 sm:leading-8.5", props.type === "search" && "[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none", props.type === "file" && "text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm", ); return ( {nativeInput ? ( ) : ( )} ); } export { InputPrimitive };