Files
sign/packages/ui/primitives/textarea.tsx

28 lines
862 B
TypeScript
Raw Normal View History

2023-06-09 18:21:18 +10:00
import * as React from 'react';
import { cn } from '../lib/utils';
export type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement>;
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
({ className, ...props }, ref) => {
return (
<textarea
className={cn(
2024-06-06 14:46:48 +10:00
'border-input ring-offset-background placeholder:text-muted-foreground/40 focus-visible:ring-ring flex h-20 w-full rounded-md border bg-transparent px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
2023-06-09 18:21:18 +10:00
className,
2024-06-06 14:46:48 +10:00
{
'ring-2 !ring-red-500 transition-all': props['aria-invalid'],
},
2023-06-09 18:21:18 +10:00
)}
ref={ref}
{...props}
/>
);
},
);
Textarea.displayName = 'Textarea';
export { Textarea };