{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "textarea",
  "title": "Textarea",
  "description": "A textarea in the same box as Input, which grows with its text and then scrolls.",
  "dependencies": [
    "@ui-sdk/react",
    "@ui-sdk/core"
  ],
  "registryDependencies": [
    "https://kinoui.com/r/input.json",
    "https://kinoui.com/r/theme.json"
  ],
  "files": [
    {
      "path": "registry/components/kino/textarea.tsx",
      "content": "'use client'\n\nimport {\n  focusControl,\n  InputInvalidIcon,\n  inputBoxClassName,\n} from '@/registry/components/kino/input'\nimport { InputGroup as InputGroupPrimitive } from '@ui-sdk/react/input'\nimport { Textarea as TextareaPrimitive } from '@ui-sdk/react/textarea'\nimport type { ComponentProps } from 'react'\n\nimport { cn } from '@/lib/utils'\n\n/** A textarea's corner: the control's, but never a pill. */\nconst textareaRadiusClassName = 'rounded-(--control-radius-capped)'\n\n/** A multiline control's size in its box, which the Token input shares: it grows to a height, then scrolls. */\nconst textareaSizeClassName =\n  'max-h-64 min-h-20 w-full px-(--control-padding) text-base scrollbar-thin outline-hidden group-has-aria-invalid/input:pe-9 md:text-sm'\n\n/** The textarea inside a box: it grows with its text, then scrolls. */\nconst textareaControlClassName = cn(\n  textareaSizeClassName,\n  'resize-none bg-transparent py-2 placeholder:text-muted-foreground read-only:text-muted-foreground',\n)\n\ntype TextareaProps = Omit<ComponentProps<typeof TextareaPrimitive>, 'className'> & {\n  className?: string\n}\n\n/** ui-sdk's textarea alone, growing with its text up to its height, for a box of your own. */\nfunction TextareaControl({ className, autoResize = true, ...props }: TextareaProps) {\n  return (\n    <TextareaPrimitive\n      autoResize={autoResize}\n      // CSS sizes it on first paint, before ui-sdk's autoResize runs, so nothing below it moves on load.\n      className={cn(\n        textareaControlClassName,\n        autoResize && 'field-sizing-content',\n        // One row is a one-line field that grows as its text wraps, such as a title.\n        props.rows === 1 && 'min-h-0',\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\n/** The box the textarea sits in, with its invalid mark; the props go to the textarea, `className` to the box. */\nfunction Textarea({ className, ...props }: TextareaProps) {\n  return (\n    <InputGroupPrimitive\n      onPointerDown={focusControl}\n      className={cn(\n        inputBoxClassName,\n        textareaRadiusClassName,\n        'cursor-text items-stretch',\n        className,\n      )}\n    >\n      <TextareaControl {...props} />\n      <InputInvalidIcon className='absolute end-0 top-2.5' />\n    </InputGroupPrimitive>\n  )\n}\n\nexport { Textarea, TextareaControl, textareaRadiusClassName, textareaSizeClassName }\n",
      "type": "registry:component",
      "target": "@components/kino/textarea.tsx"
    }
  ],
  "type": "registry:component"
}