{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "textarea",
  "type": "registry:ui",
  "title": "Textarea",
  "description": "Textarea is a multi-line text field for free-form input such as comments, descriptions, or messages.",
  "dependencies": [
    "class-variance-authority@^0.7.1"
  ],
  "registryDependencies": [
    "https://wideset.co/r/motion.json",
    "https://wideset.co/r/styles.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/components/textarea/Textarea.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/textarea/Textarea.tsx",
      "content": "'use client';\n\nimport * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport { useDefaultMotion } from '@/lib/wideset/motion/MotionProvider';\nimport type { TextareaProps } from './Textarea.types';\nimport {\n  textareaMotionVariants,\n  textareaVariants,\n  textareaWrapperVariants,\n} from './Textarea.variants';\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n  (\n    {\n      size = 'md',\n      variant = 'primary',\n      disabled = false,\n      resize = 'vertical',\n      className,\n      contentClassName,\n      defaultMotion,\n      ...props\n    },\n    ref,\n  ) => {\n    const motion = useDefaultMotion(defaultMotion);\n    const canResizeHorizontally = resize === 'horizontal' || resize === 'both';\n    const widthClass = props.cols\n      ? `w-auto`\n      : canResizeHorizontally\n        ? `w-full`\n        : `w-full max-w-full`;\n\n    return (\n      <div\n        data-slot=\"textarea\"\n        className={cn(\n          textareaWrapperVariants({ size, disabled, variant, resize }),\n          textareaMotionVariants({ enabled: motion }),\n          widthClass,\n          className,\n        )}\n      >\n        <textarea\n          aria-invalid={variant === 'danger' || undefined}\n          data-disabled={disabled || undefined}\n          disabled={disabled}\n          ref={ref}\n          {...props}\n          className={cn(textareaVariants({ size }), widthClass, contentClassName)}\n        />\n      </div>\n    );\n  },\n);\n\nTextarea.displayName = 'Textarea';\n\nexport { Textarea };\n"
    },
    {
      "path": "src/components/textarea/Textarea.types.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/textarea/Textarea.types.ts",
      "content": "import type { VariantProps } from 'class-variance-authority';\nimport type { TextareaHTMLAttributes } from 'react';\n\nimport type { MotionProps } from '@/lib/wideset/motion/Motion.types';\nimport type { textareaWrapperVariants } from './Textarea.variants';\n\n/** A multiline text input. */\nexport type TextareaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'> &\n  MotionProps &\n  VariantProps<typeof textareaWrapperVariants> & {\n    /** Additional classes applied to the inner `<textarea>` element. `className` targets the outer wrapper. */\n    contentClassName?: string;\n    /**\n     * Directions in which the user can resize the field by dragging its corner.\n     * @default 'vertical'\n     */\n    resize?: 'none' | 'vertical' | 'horizontal' | 'both';\n  };\n"
    },
    {
      "path": "src/components/textarea/Textarea.variants.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/textarea/Textarea.variants.ts",
      "content": "import { cva } from 'class-variance-authority';\nimport { cn } from '@/lib/wideset/utils';\n\nimport { fieldFocusMotion, fieldShakeWithinMotion } from '@/lib/wideset/motion/recipes';\n\nexport const textareaVariants = cva(\n  cn(\n    'text-ws-static-strong relative flex items-center',\n    'box-border h-full min-h-lh resize-none overflow-auto overscroll-auto outline-hidden',\n  ),\n  {\n    variants: {\n      size: {\n        sm: 'typography-body-md px-ws-7 py-ws-4',\n        md: 'typography-body-md px-ws-9 py-ws-6',\n        lg: 'typography-body-lg px-ws-9 py-ws-8',\n      },\n    },\n    defaultVariants: {\n      size: 'md',\n    },\n  },\n);\n\nexport const textareaWrapperVariants = cva(\n  cn(\n    'text-ws-static-strong relative flex items-stretch',\n    'h-auto min-h-lh overflow-hidden',\n    'bg-ws-static-highlight-base border-ws-dynamic-secondary-default border',\n  ),\n  {\n    variants: {\n      resize: {\n        none: 'resize-none',\n        vertical: 'resize-y',\n        horizontal: 'resize-x',\n        both: 'resize',\n      },\n      variant: {\n        // No native `:invalid` styling: an empty `required` field is invalid before it is\n        // touched. The danger look comes only from `variant=\"danger\"`, as in TextInput.\n        primary:\n          'has-focus:not-active:border-ws-dynamic-primary-strong-default has-[:focus]:not-active:shadow-ws-forms-active',\n        danger: cn(\n          'has-focus:not-active:border-ws-dynamic-danger-strong-default has-[:focus]:not-active:shadow-ws-forms-active-danger',\n        ),\n      },\n      disabled: {\n        true: cn(\n          'text-ws-static-subtle',\n          'border-ws-dynamic-secondary-disabled bg-ws-static-alpha-subtle',\n          'hover:not-has-focus:border-ws-dynamic-secondary-disabled',\n          'active:border-ws-dynamic-secondary-disabled',\n          'has-focus:not-active:border-ws-dynamic-secondary-disabled',\n        ),\n        false: {},\n      },\n      size: {\n        sm: 'rounded-ws-container-sm',\n        md: 'rounded-ws-container-sm',\n        lg: 'rounded-ws-container-sm',\n      },\n    },\n    compoundVariants: [\n      {\n        disabled: false,\n        variant: 'danger',\n        className: cn(\n          'border-ws-dynamic-danger-strong-default',\n          'hover:not-has-focus:border-ws-dynamic-danger-strong-hover',\n          'active:border-ws-dynamic-danger-strong-pressed',\n        ),\n      },\n      {\n        disabled: false,\n        variant: 'primary',\n        className: cn(\n          'hover:not-has-focus:border-ws-dynamic-secondary-hover',\n          'active:border-ws-dynamic-secondary-pressed',\n        ),\n      },\n    ],\n    defaultVariants: {\n      variant: 'primary',\n      size: 'md',\n      resize: 'vertical',\n    },\n  },\n);\n\nexport const textareaMotionVariants = cva('', {\n  variants: {\n    enabled: { true: cn(fieldFocusMotion, fieldShakeWithinMotion), false: '' },\n  },\n  defaultVariants: { enabled: true },\n});\n"
    }
  ],
  "meta": {
    "version": "1.0.0",
    "commit": "8bb3627"
  }
}
