返回 JoyAI-Echo
input.tsx
1 import * as React from "react";
2
3 import { cn } from "@/lib/utils";
4
5 export type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
6
7 const Input = React.forwardRef<HTMLInputElement, InputProps>(
8 ({ className, type, ...props }, ref) => {
9 return (
10 <input
11 type={type}
12 className={cn(
13 "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
14 className,
15 )}
16 ref={ref}
17 {...props}
18 />
19 );
20 },
21 );
22 Input.displayName = "Input";
23
24 export { Input };
25
25 lines Plain Text