forked from StellarSplit/StellarSplit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinput.tsx
More file actions
34 lines (31 loc) · 1021 Bytes
/
Copy pathinput.tsx
File metadata and controls
34 lines (31 loc) · 1021 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import React from "react";
import { cn } from "@utils/format";
export interface InputProps
extends React.InputHTMLAttributes<HTMLInputElement> {}
export const Input = React.forwardRef<HTMLInputElement, InputProps>(
({ className, type = "text", ...props }, ref) => {
return (
<input
ref={ref}
type={type}
className={cn(
// Layout & shape
"flex w-full rounded-lg px-3 py-2 text-sm",
// Colors
"bg-theme border border-primary",
"text-zinc-100 placeholder:text-zinc-500",
// Focus ring
"outline-none transition-colors duration-150",
"focus:border-amber-500/50 focus:ring-2 focus:ring-amber-500/20",
// Disabled
"disabled:pointer-events-none disabled:opacity-50",
// File input
"file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-zinc-300",
className
)}
{...props}
/>
);
}
);
Input.displayName = "Input";