{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "internal-drawer-vue",
  "title": "Internal Drawer (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/drawer.ts",
      "content": "import { Drawer, DrawerBackdrop, DrawerContent, DrawerDescription, DrawerTitle } from \"@ui-sdk/vue/drawer\";\nimport { withKindClass } from \"./kind-class\";\n\nexport const KindDrawer = Drawer;\nexport const KindDrawerBackdrop = withKindClass(\n  DrawerBackdrop,\n  \"fixed inset-0 z-50 bg-[var(--kind-color-scrim)] backdrop-blur-[var(--kind-scrim-blur)]\",\n  \"KindDrawerBackdrop\",\n);\nexport const KindDrawerContent = withKindClass(\n  DrawerContent,\n  \"flex h-full max-h-dvh w-[min(20rem,calc(100vw-3rem))] flex-col overflow-hidden border-[var(--kind-color-border)] bg-[var(--kind-color-raised)] text-[length:var(--kind-text-md)]/5 text-[var(--kind-color-fg)] shadow-[var(--kind-shadow-dialog)] outline-hidden data-[side=left]:border-e data-[side=right]:border-s data-[side=top]:h-auto data-[side=top]:w-full data-[side=top]:border-b data-[side=bottom]:h-auto data-[side=bottom]:w-full data-[side=bottom]:border-t\",\n  \"KindDrawerContent\",\n);\nexport const KindDrawerTitle = withKindClass(\n  DrawerTitle,\n  \"m-0 text-[length:var(--kind-text-xl)] font-semibold leading-6\",\n  \"KindDrawerTitle\",\n);\nexport const KindDrawerDescription = withKindClass(\n  DrawerDescription,\n  \"m-0 text-[var(--kind-color-muted)]\",\n  \"KindDrawerDescription\",\n);\n",
      "type": "registry:ui",
      "target": "@ui/vue/internal/drawer.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"
}
