{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sidebar",
  "title": "Sidebar",
  "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/react@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup",
    "@kind-ui/internal-resizable",
    "@kind-ui/internal-drawer"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/react/sidebar.tsx",
      "content": "\"use client\";\n\nimport { sidebarPrimitive } from \"@kind-ui/agent-ui/core\";\nimport { createParts, renderElement } from \"@ui-sdk/react/primitive\";\nimport type { ComponentProps, ReactNode } from \"react\";\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\nexport type SidebarProps = Omit<ComponentProps<typeof parts.Root>, \"children\"> & { children?: ReactNode };\nexport type SidebarPanelProps = ComponentProps<typeof parts.Heading>;\nexport type SidebarHandleProps = Omit<ComponentProps<typeof parts.Handle>, \"children\" | \"className\"> & {\n  /** Classes for the separator itself, UI SDK's Resizable handle. */\n  className?: string;\n};\nexport type SidebarInsetProps = ComponentProps<typeof parts.Inset>;\nexport type SidebarTriggerProps = ComponentProps<typeof parts.Trigger>;\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 function Sidebar({ children, ...props }: SidebarProps) {\n  return (\n    <parts.Root {...props}>\n      {({ resizable }) => <KindResizable {...resizable}>{children}</KindResizable>}\n    </parts.Root>\n  );\n}\n\n/** The panel, an `aside` named by the sidebar's `label`: a Resizable panel beside the page, else a drawer. */\nexport function SidebarPanel({ render, ...props }: SidebarPanelProps) {\n  return (\n    <parts.Heading\n      {...props}\n      render={(panel, state) => {\n        const element = renderElement(\"aside\", panel, render, state);\n        return (\n          <KindResizablePanel {...state.resizablePanel}>\n            {state.overlay ? (\n              <KindDrawer {...state.drawer}>\n                <KindDrawerBackdrop data-agent-hidden=\"\" />\n                <KindDrawerContent {...state.drawerContent}>{element}</KindDrawerContent>\n              </KindDrawer>\n            ) : (\n              element\n            )}\n          </KindResizablePanel>\n        );\n      }}\n    />\n  );\n}\n\n/** The resize handle between the panel and the inset, named \"Resize <label>\". Absent while the panel is a drawer. */\nexport function SidebarHandle({ className, ...props }: SidebarHandleProps) {\n  return (\n    <parts.Handle {...props}>\n      {(state) => (\n        <KindResizableHandle aria-label={state[\"aria-label\"]} className={className} data-agent-hidden=\"\" />\n      )}\n    </parts.Handle>\n  );\n}\n\n/** The page beside the panel. */\nexport function SidebarInset({ render, ...props }: SidebarInsetProps) {\n  return (\n    <parts.Inset\n      {...props}\n      render={(inset, state) => {\n        const element = renderElement(\"div\", inset, render, state);\n        return <KindResizablePanel {...state.resizablePanel}>{element}</KindResizablePanel>;\n      }}\n    />\n  );\n}\n\n/** Opens and closes the panel, named \"Show <label>\" or \"Hide <label>\". Without children it shows the panel icon. */\nexport function SidebarTrigger(props: SidebarTriggerProps) {\n  return <parts.Trigger {...props} />;\n}\n",
      "type": "registry:ui",
      "target": "@ui/sidebar.tsx"
    }
  ],
  "meta": {
    "layer": "react"
  },
  "type": "registry:ui"
}
