Skip to content
File

Blob: src/client/components/ui/input.tsx

typescript19 lines
1import { forwardRef, type InputHTMLAttributes, type TextareaHTMLAttributes } from "react";
2 
3const inputBase =
4 "w-full rounded-xl border border-zinc-700/60 bg-zinc-800/80 px-4 py-2.5 text-zinc-100 placeholder:text-zinc-500 focus:border-accent-500/50 focus:outline-none focus:ring-1 focus:ring-accent-500/30";
5 
6export const Input = forwardRef<HTMLInputElement, InputHTMLAttributes<HTMLInputElement>>(function Input(
7 { className = "", ...rest },
8 ref,
9) {
10 return <input ref={ref} className={`${inputBase} ${className}`} {...rest} />;
11});
12 
13export const Textarea = forwardRef<HTMLTextAreaElement, TextareaHTMLAttributes<HTMLTextAreaElement>>(function Textarea(
14 { className = "", rows = 3, ...rest },
15 ref,
16) {
17 return <textarea ref={ref} rows={rows} className={`${inputBase} resize-y ${className}`} {...rest} />;
18});