{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "internal-toolbar-vue",
  "title": "Internal Toolbar (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/toolbar.ts",
      "content": "import { Toolbar, ToolbarButton, ToolbarGroup, ToolbarSeparator } from \"@ui-sdk/vue/toolbar\";\nimport { withKindClass } from \"./kind-class\";\n\nexport const KindToolbar = withKindClass(\n  Toolbar,\n  \"flex items-center gap-0.5 data-[orientation=vertical]:flex-col\",\n  \"KindToolbar\",\n);\nexport const KindToolbarButton = withKindClass(\n  ToolbarButton,\n  \"inline-flex h-[var(--kind-control-height-sm)] min-w-[var(--kind-control-height-sm)] items-center justify-center gap-1.5 rounded-[var(--kind-radius-full)] px-2 text-[length:var(--kind-text-md)]/5 text-[var(--kind-toolbar-button-fg,var(--kind-color-muted))] hover:bg-[var(--kind-color-hover)] hover:text-[var(--kind-color-fg)] focus-visible:[outline:var(--kind-focus-ring)] focus-visible:[outline-offset:var(--kind-focus-offset)] data-disabled:opacity-[var(--kind-disabled-opacity)]\",\n  \"KindToolbarButton\",\n);\nexport const KindToolbarGroup = withKindClass(\n  ToolbarGroup,\n  \"flex items-center gap-1 data-[orientation=vertical]:flex-col\",\n  \"KindToolbarGroup\",\n);\nexport const KindToolbarSeparator = withKindClass(\n  ToolbarSeparator,\n  \"bg-[var(--kind-color-border)] data-[orientation=horizontal]:my-1 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:self-stretch data-[orientation=vertical]:mx-1 data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch\",\n  \"KindToolbarSeparator\",\n);\n",
      "type": "registry:ui",
      "target": "@ui/vue/internal/toolbar.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"
}
