Open History to see the last commit
1import { ark } from '@ark-ui/solid'
2import { splitProps } from 'solid-js'
3import type { HTMLArkProps } from '@ark-ui/solid'
4import { cn } from '@/utils'
5β
6// Ported from the original shadcn/ui + React component.
7// These are styled DOM primitives; stateful behavior can be layered on by
8// wrapping them with Ark UI machines via asChild.
9// https://ui.shadcn.com/
10β
11/**
12 * A styled textarea field for collecting longer free-form text.
13 *
14 * @example
15 * ```tsx
16 * <Textarea placeholder="Message" />
17 * ```
18 */
19function Textarea(props: HTMLArkProps<'textarea'>) {
20 const [local, others] = splitProps(props, ['class'])
21β
22 return (
23 <ark.textarea
24 data-slot="textarea"
25 class={cn(
26 'flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40',
27 local.class,
28 )}
29 {...others}
30 />
31 )
32}
33β
34export { Textarea }