feat: improve app ui and project metadata
This commit is contained in:
30
apps/web/components/ui/TextInput.tsx
Normal file
30
apps/web/components/ui/TextInput.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import type { InputHTMLAttributes } from "react";
|
||||
|
||||
import { cn, inputClass, type InputState } from "@/lib/ui/variants";
|
||||
|
||||
interface TextInputProps extends InputHTMLAttributes<HTMLInputElement> {
|
||||
controlSize?: "sm" | "md";
|
||||
state?: InputState;
|
||||
}
|
||||
|
||||
const inputSizes: Record<NonNullable<TextInputProps["controlSize"]>, string> = {
|
||||
sm: "px-2 py-1 text-xs",
|
||||
md: "px-3 py-2 text-sm",
|
||||
};
|
||||
|
||||
export function TextInput({
|
||||
className,
|
||||
controlSize = "md",
|
||||
state,
|
||||
...props
|
||||
}: TextInputProps) {
|
||||
return (
|
||||
<input
|
||||
className={inputClass({
|
||||
state,
|
||||
className: cn(inputSizes[controlSize], className),
|
||||
})}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user