-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathinput.tsx
More file actions
29 lines (26 loc) · 1.19 KB
/
input.tsx
File metadata and controls
29 lines (26 loc) · 1.19 KB
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
'use client'
import { cn } from '../../utils/cn'
function Input({
className,
type,
isError,
...props
}: React.ComponentProps<'input'> & { isError?: boolean }) {
return (
<input
type={type}
className={cn(
'bg-background file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-18 w-full min-w-0 rounded-md border px-6 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:bg-transparent file:rounded-sm file:px-4 file:h-full file:border-0 file:text-sm file:font-medium',
'disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-surface-disabled disabled:text-text-disabled disabled:border-border-disabled disabled:placeholder:text-text-disabled',
'focus-visible:border-ring focus-visible:ring-ring focus-visible:ring-[2px]',
'aria-invalid:ring-destructive dark:aria-invalid:ring-destructive aria-invalid:border-destructive',
className
)}
data-slot="input"
aria-invalid={isError}
{...props}
/>
)
}
type InputProps = React.ComponentPropsWithRef<typeof Input>
export { Input, type InputProps }