{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sidebar-vue",
  "title": "Sidebar (Vue)",
  "description": "A panel beside the page that a person resizes and collapses, turning into a drawer on a narrow screen.",
  "dependencies": [
    "@kind-ui/agent-ui@0.9.0",
    "@ui-sdk/core@0.1.0-beta.17",
    "@ui-sdk/vue@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup",
    "@kind-ui/internal-resizable-vue",
    "@kind-ui/internal-drawer-vue"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/vue/sidebar.ts",
      "content": "import {\n  type SidebarHandleState,\n  type SidebarInsetState,\n  type SidebarPanelState,\n  type SidebarRootState,\n  sidebarPrimitive,\n} from \"@kind-ui/agent-ui/core\";\nimport { createParts } from \"@ui-sdk/vue/primitive\";\nimport { type Component, defineComponent, h, type VNode } from \"vue\";\nimport { KindDrawer, KindDrawerBackdrop, KindDrawerContent } from \"./internal/drawer\";\nimport { KindResizable, KindResizableHandle, KindResizablePanel } from \"./internal/resizable\";\n\nconst parts = createParts(sidebarPrimitive, {\n  root: \"div\",\n  heading: \"aside\",\n  handle: \"div\",\n  inset: \"div\",\n  trigger: \"button\",\n});\n\ntype RenderScope<State> = { props: Record<string, unknown>; state: State; children: Component };\n\n// The caller's own `#render` slot, else the part's element with its children.\nconst element = <State>(\n  tag: string,\n  scope: RenderScope<State>,\n  render: ((scope: RenderScope<State>) => VNode[]) | undefined,\n) => (render ? render(scope) : h(tag, scope.props, [h(scope.children)]));\n\n/**\n * A panel beside the page that a person resizes and collapses, and that turns into a modal drawer on a narrow\n * screen. Write `SidebarPanel`, `SidebarHandle` and `SidebarInset` inside it in reading order, and a\n * `SidebarTrigger` anywhere inside. The Resizable stays mounted on a narrow screen, so the page in the inset never\n * mounts again; only the panel's content moves into the drawer.\n */\nexport const Sidebar = defineComponent({\n  name: \"Sidebar\",\n  inheritAttrs: false,\n  setup(_, { attrs, slots }) {\n    return () =>\n      h(parts.Root, attrs, {\n        render: slots.render,\n        default: ({ state }: { state: SidebarRootState }) => h(KindResizable, state.resizable, slots.default),\n      });\n  },\n}) as unknown as typeof parts.Root;\n\n/** The panel, an `aside` named by the sidebar's `label`: a Resizable panel beside the page, else a drawer. */\nexport const SidebarPanel = defineComponent({\n  name: \"SidebarPanel\",\n  inheritAttrs: false,\n  setup(_, { attrs, slots }) {\n    return () =>\n      h(parts.Heading, attrs, {\n        ...slots,\n        render: (scope: RenderScope<SidebarPanelState>) => {\n          const { state } = scope;\n          const panel = element(\"aside\", scope, slots.render);\n          return [\n            h(KindResizablePanel, state.resizablePanel, () =>\n              state.overlay\n                ? h(KindDrawer, state.drawer, () => [\n                    h(KindDrawerBackdrop, { \"data-agent-hidden\": \"\" }),\n                    h(KindDrawerContent, state.drawerContent, () => panel),\n                  ])\n                : panel,\n            ),\n          ];\n        },\n      });\n  },\n}) as unknown as typeof parts.Heading;\n\n/** The resize handle between the panel and the inset, named \"Resize <label>\". Absent while the panel is a drawer. */\nexport const SidebarHandle = defineComponent({\n  name: \"SidebarHandle\",\n  inheritAttrs: false,\n  setup(_, { attrs, slots }) {\n    return () => {\n      // `class` styles the separator itself, UI SDK's Resizable handle.\n      const { class: className, ...rest } = attrs;\n      return h(parts.Handle, rest, {\n        render: slots.render,\n        default: ({ state }: { state: SidebarHandleState }) =>\n          h(KindResizableHandle, {\n            \"aria-label\": state[\"aria-label\"],\n            class: className,\n            \"data-agent-hidden\": \"\",\n          }),\n      });\n    };\n  },\n}) as unknown as typeof parts.Handle;\n\n/** The page beside the panel. */\nexport const SidebarInset = defineComponent({\n  name: \"SidebarInset\",\n  inheritAttrs: false,\n  setup(_, { attrs, slots }) {\n    return () =>\n      h(parts.Inset, attrs, {\n        ...slots,\n        render: (scope: RenderScope<SidebarInsetState>) => [\n          h(KindResizablePanel, scope.state.resizablePanel, () => element(\"div\", scope, slots.render)),\n        ],\n      });\n  },\n}) as unknown as typeof parts.Inset;\n\n/** Opens and closes the panel, named \"Show <label>\" or \"Hide <label>\". Without a slot it shows the panel icon. */\nexport const SidebarTrigger = parts.Trigger;\n",
      "type": "registry:ui",
      "target": "@ui/vue/sidebar.ts"
    }
  ],
  "meta": {
    "layer": "vue"
  },
  "type": "registry:ui"
}
