forked from SPARCS-UP-Mindanao/TechTix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTextArea.tsx
More file actions
27 lines (21 loc) · 949 Bytes
/
TextArea.tsx
File metadata and controls
27 lines (21 loc) · 949 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
import * as React from 'react';
import { cn } from '@/utils/classes';
export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
variant?: 'default' | 'custard';
}
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(({ className, variant = 'default', ...props }, ref) => {
const variantClass = variant === 'custard' ? 'bg-[#feefdb] text-[#312541] placeholder:text-gray-600' : 'bg-input';
return (
<textarea
ref={ref}
className={cn(
'flex min-h-[100px] w-full rounded-md border border-border px-3 py-1 text-sm shadow-xs transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50',
variantClass,
className
)}
{...props}
/>
);
});
Textarea.displayName = 'Textarea';
export { Textarea };