Skip to content

Commit

Permalink
feat(components/ui): add <Textarea> from shadcn-ui
Browse files Browse the repository at this point in the history
This patch adds the output of running:

```
$ pnpm shadcn-ui add textarea
```

...and then updating the `bg-transparent` with `bg-white
dark:bg-gray-950` to align with the background colors on the other form
fields (e.g. `<Input>` and `<Button>`).
  • Loading branch information
nicholaschiang committed Jul 23, 2023
1 parent 3aef447 commit 125debc
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions app/components/ui/textarea.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import * as React from 'react'

import { cn } from 'utils/cn'

export type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement>

const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
({ className, ...props }, ref) => {
return (
<textarea
className={cn(
'flex min-h-[60px] w-full rounded-md border border-gray-200 border-gray-200 bg-white dark:bg-gray-950 px-3 py-2 text-sm shadow-sm placeholder:text-gray-500 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-gray-400 disabled:cursor-not-allowed disabled:opacity-50 dark:border-gray-800 dark:border-gray-800 dark:placeholder:text-gray-400 dark:focus-visible:ring-gray-800',
className,
)}
ref={ref}
{...props}
/>
)
},
)
Textarea.displayName = 'Textarea'

export { Textarea }

0 comments on commit 125debc

Please sign in to comment.