{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "internal-textarea-vue",
  "title": "Internal Textarea (Vue)",
  "description": "Internal primitive used by Agent UI components; add a component instead.",
  "dependencies": [
    "@ui-sdk/core@0.1.0-beta.17",
    "@ui-sdk/vue@0.1.0-beta.17"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "packages/agent-ui/src/vue/internal/textarea.ts",
      "content": "import { Textarea } from \"@ui-sdk/vue/textarea\";\nimport { withKindClass } from \"./kind-class\";\n\nexport const KindTextarea = withKindClass(\n  Textarea,\n  \"block min-h-16 max-h-40 w-full resize-none rounded-[var(--kind-radius-lg)] border border-[var(--kind-color-border)] bg-[var(--kind-color-surface)] px-3 py-2 text-[length:inherit] leading-[inherit] text-[var(--kind-color-fg)] placeholder:text-[var(--kind-color-muted)] outline-hidden data-disabled:cursor-not-allowed data-disabled:opacity-[var(--kind-disabled-opacity)] data-readonly:text-[var(--kind-color-muted)]\",\n  \"KindTextarea\",\n);\n",
      "type": "registry:ui",
      "target": "@ui/vue/internal/textarea.ts"
    },
    {
      "path": "packages/agent-ui/src/vue/internal/kind-class.ts",
      "content": "import {\n  type Component,\n  cloneVNode,\n  defineComponent,\n  Fragment,\n  h,\n  isVNode,\n  type Slots,\n  type VNode,\n} from \"vue\";\n\ntype RenderSlot = (scope: Record<string, unknown>) => VNode[];\n\nconst bareParts = new WeakMap<object, Component>();\n\n// A Kind part rendered as another (`<KindToolbarButton>` whose `#render` slot holds a `<KindMenuTrigger>`) renders\n// the target's bare UI SDK part, so the element gets the outer base classes once instead of both lists.\nfunction bareNodes(nodes: VNode[]): VNode[] {\n  return nodes.map((node) => {\n    if (!isVNode(node)) return node;\n    if (node.type === Fragment && Array.isArray(node.children))\n      return h(Fragment, { key: node.key ?? undefined }, bareNodes(node.children as VNode[]));\n    const bare = bareParts.get(node.type as object);\n    if (!bare) return node;\n    // A clone keeps the node's directives (`v-show`), transition, key and ref.\n    const clone = cloneVNode(node);\n    clone.type = bare;\n    clone.children = bareSlots(node.children as Slots | null);\n    return clone;\n  });\n}\n\nfunction bareSlots(slots: Slots | null): Slots | null {\n  const render = slots?.render as RenderSlot | undefined;\n  if (!render) return slots;\n  return { ...slots, render: (scope: Record<string, unknown>) => bareNodes(render(scope)) };\n}\n\n/**\n * Passes a UI SDK part through with Kind's classes before the caller's `class`. Vue binds `class` as a string, an\n * array or an object, never a function of the part's state: style state through `data-*` attributes.\n */\nexport function withKindClass<C extends Component>(component: C, base: string, name: string): C {\n  const Kind = defineComponent({\n    name,\n    inheritAttrs: false,\n    setup(_, { attrs, slots }) {\n      return () => h(component, { ...attrs, class: [base, attrs.class] }, bareSlots(slots) ?? undefined);\n    },\n  });\n  bareParts.set(Kind, component);\n  return Kind as unknown as C;\n}\n",
      "type": "registry:ui",
      "target": "@ui/vue/internal/kind-class.ts"
    }
  ],
  "meta": {
    "layer": "vue",
    "hidden": true
  },
  "categories": [
    "internal"
  ],
  "type": "registry:ui"
}
