{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "internal-menu-vue",
  "title": "Internal Menu (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/menu.ts",
      "content": "import {\n  Menu,\n  MenuCheckboxItem,\n  MenuContent,\n  MenuGroup,\n  MenuGroupLabel,\n  MenuItem,\n  MenuItemIcon,\n  MenuItemIndicator,\n  MenuRadioGroup,\n  MenuRadioItem,\n  MenuSeparator,\n  MenuSub,\n  MenuSubContent,\n  MenuSubTrigger,\n  MenuTrigger,\n} from \"@ui-sdk/vue/menu\";\nimport { type FunctionalComponent, h, type VNode } from \"vue\";\nimport { withKindClass } from \"./kind-class\";\n\nconst content =\n  \"z-50 min-w-50 rounded-[var(--kind-popup-radius)] bg-[var(--kind-color-raised)] p-[var(--kind-popup-padding)] text-[length:var(--kind-text-md)]/5 text-[var(--kind-color-fg)] shadow-[var(--kind-shadow-popover)] outline-hidden data-[presentation=sheet]:w-full data-[presentation=sheet]:max-w-none data-[presentation=sheet]:rounded-b-none data-[presentation=sheet]:pb-[max(0.5rem,env(safe-area-inset-bottom))] data-[presentation=sheet]:[&_:is([data-slot=menu-item],[data-slot=menu-checkbox-item],[data-slot=menu-radio-item],[data-slot=menu-trigger])]:py-2.5\";\nconst item =\n  \"flex cursor-default select-none items-center gap-2 rounded-[var(--kind-radius-md)] px-2.5 py-1.5 outline-hidden focus-visible:bg-[var(--kind-color-selected)] data-highlighted:bg-[var(--kind-color-selected)] data-disabled:opacity-[var(--kind-disabled-opacity)] has-[[data-menu-description]]:items-start data-destructive:text-[var(--kind-color-danger)] [&_[data-menu-text]]:flex [&_[data-menu-text]]:min-w-0 [&_[data-menu-text]]:flex-col [&_[data-menu-description]]:text-[length:var(--kind-text-xs)]/4 [&_[data-menu-description]]:text-[var(--kind-color-muted)]\";\n\nexport const KindMenu = Menu;\nexport const KindMenuTrigger = withKindClass(\n  MenuTrigger,\n  \"inline-flex h-[var(--kind-trigger-height)] items-center justify-center gap-1.5 rounded-[var(--kind-radius-full)] px-3 text-[length:var(--kind-text-md)]/5 font-medium text-[var(--kind-color-fg)] hover:bg-[var(--kind-color-hover)] data-open:bg-[var(--kind-color-selected)] focus-visible:[outline:var(--kind-focus-ring)] focus-visible:[outline-offset:var(--kind-focus-offset)] data-disabled:cursor-not-allowed data-disabled:opacity-[var(--kind-disabled-opacity)] data-pending:cursor-wait\",\n  \"KindMenuTrigger\",\n);\nexport const KindMenuContent = withKindClass(MenuContent, content, \"KindMenuContent\");\nexport const KindMenuItem = withKindClass(MenuItem, item, \"KindMenuItem\");\nexport const KindMenuCheckboxItem = withKindClass(MenuCheckboxItem, item, \"KindMenuCheckboxItem\");\nexport const KindMenuRadioGroup = MenuRadioGroup;\nexport const KindMenuRadioItem = withKindClass(MenuRadioItem, item, \"KindMenuRadioItem\");\nexport const KindMenuItemIndicator = withKindClass(\n  MenuItemIndicator,\n  \"inline-flex h-5 w-4 shrink-0 items-center justify-center text-[var(--kind-color-accent)] data-unchecked:invisible\",\n  \"KindMenuItemIndicator\",\n);\nexport const KindMenuItemIcon = withKindClass(\n  MenuItemIcon,\n  \"inline-flex h-5 w-4 shrink-0 items-center justify-center text-[var(--kind-color-muted)] [&_svg]:size-4\",\n  \"KindMenuItemIcon\",\n);\nexport const KindMenuSub = MenuSub;\nexport const KindMenuSubTrigger = withKindClass(\n  MenuSubTrigger,\n  `${item} data-open:bg-[var(--kind-color-selected)]`,\n  \"KindMenuSubTrigger\",\n);\nexport const KindMenuSubContent = withKindClass(MenuSubContent, content, \"KindMenuSubContent\");\nexport const KindMenuGroup = withKindClass(MenuGroup, \"py-0.5\", \"KindMenuGroup\");\nexport const KindMenuGroupLabel = withKindClass(\n  MenuGroupLabel,\n  \"px-2.5 pt-1.5 pb-1 text-[length:var(--kind-text-xs)]/4 font-medium text-[var(--kind-color-muted)]\",\n  \"KindMenuGroupLabel\",\n);\nexport const KindMenuSeparator = withKindClass(\n  MenuSeparator,\n  \"mx-2.5 my-1 h-px bg-[var(--kind-color-border)]\",\n  \"KindMenuSeparator\",\n);\n\nexport type KindMenuItemContentProps = {\n  /** An image URL, or a node such as an inline `svg`. */\n  icon?: unknown;\n  label: string;\n  description?: string | undefined;\n  /** Trailing text, like a model's cost. */\n  meta?: string | undefined;\n  /** What screen readers hear in place of `meta`. */\n  metaLabel?: string | undefined;\n};\n\n/**\n * A data row's icon and text, the label over an optional description, then its trailing `meta`, as menus built on\n * `menuBase` draw them.\n */\nexport const KindMenuItemContent: FunctionalComponent<KindMenuItemContentProps> = (props) => [\n  props.icon !== undefined\n    ? h(KindMenuItemIcon, null, {\n        default: () =>\n          typeof props.icon === \"string\" ? h(\"img\", { src: props.icon, alt: \"\" }) : (props.icon as VNode),\n      })\n    : null,\n  h(\"span\", { \"data-menu-text\": \"\" }, [\n    h(\"span\", props.label),\n    props.description ? h(\"span\", { \"data-menu-description\": \"\" }, props.description) : null,\n  ]),\n  props.meta\n    ? h(\"span\", { \"data-menu-meta\": \"\", \"aria-hidden\": props.metaLabel ? \"true\" : undefined }, props.meta)\n    : null,\n  props.meta && props.metaLabel ? h(\"span\", { \"data-menu-meta-label\": \"\" }, props.metaLabel) : null,\n];\nKindMenuItemContent.props = [\"icon\", \"label\", \"description\", \"meta\", \"metaLabel\"];\n\n// `@ui-sdk/vue` hands a part's state as a proxy that tracks each key read and has no keys of its own, so a spread\n// copies nothing: these read what `menuBase`'s parts hand UI SDK Menu key by key.\n\ntype MenuState = {\n  controller: unknown;\n  presentation: unknown;\n  open: boolean;\n  onOpenChange: unknown;\n  onAction: unknown;\n  onCheckedChange: unknown;\n  onValueChange: unknown;\n};\ntype MenuTriggerState = {\n  \"aria-label\": string;\n  disabled: boolean;\n  \"data-kind-trigger\"?: \"\";\n  \"data-kind-icon-button\"?: \"\";\n};\n\n/** The root's state as UI SDK `Menu`'s props: `h(KindMenu, menuProps(state), …)`. */\nexport const menuProps = <State extends MenuState>(state: State) => ({\n  controller: state.controller as State[\"controller\"],\n  presentation: state.presentation as State[\"presentation\"],\n  open: state.open,\n  onOpenChange: state.onOpenChange as State[\"onOpenChange\"],\n  onAction: state.onAction as State[\"onAction\"],\n  onCheckedChange: state.onCheckedChange as State[\"onCheckedChange\"],\n  onValueChange: state.onValueChange as State[\"onValueChange\"],\n});\n\n/** The trigger's state as UI SDK `MenuTrigger`'s props. */\nexport const menuTriggerProps = <State extends MenuTriggerState>(state: State) => ({\n  \"aria-label\": state[\"aria-label\"],\n  disabled: state.disabled,\n  \"data-kind-trigger\": state[\"data-kind-trigger\"],\n  \"data-kind-icon-button\": state[\"data-kind-icon-button\"],\n});\n",
      "type": "registry:ui",
      "target": "@ui/vue/internal/menu.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"
}
