{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sidebar-solid",
  "title": "Sidebar (Solid)",
  "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/solid@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup",
    "@kind-ui/internal-resizable-solid",
    "@kind-ui/internal-drawer-solid"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/solid/sidebar.tsx",
      "content": "import { type SidebarHandleState, sidebarPrimitive } from \"@kind-ui/agent-ui/core\";\nimport type { ComponentProps, JSX } from \"@solidjs/web\";\nimport { createParts } from \"@ui-sdk/solid/primitive\";\nimport { omit, Show } from \"solid-js\";\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?: JSX.Element };\nexport type SidebarPanelProps = ComponentProps<typeof parts.Heading>;\nexport type SidebarHandleProps = Omit<ComponentProps<typeof parts.Handle>, \"children\" | \"class\"> & {\n  /** Classes for the separator itself, UI SDK's Resizable handle. */\n  class?: string;\n};\nexport type SidebarInsetProps = ComponentProps<typeof parts.Inset>;\nexport type SidebarTriggerProps = ComponentProps<typeof parts.Trigger>;\n\ntype Render = (props: Record<string, unknown>, state: unknown) => JSX.Element;\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(props: SidebarProps) {\n  return (\n    <parts.Root {...omit(props, \"children\")}>\n      {(state) => <KindResizable {...state.resizable}>{props.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(props: SidebarPanelProps) {\n  const render = (\n    panel: Record<string, unknown>,\n    state: Parameters<NonNullable<SidebarPanelProps[\"render\"]>>[1],\n  ) => {\n    const element = () => {\n      const own = props.render as Render | undefined;\n      return own ? own(panel, state) : <aside {...panel} />;\n    };\n    return (\n      <KindResizablePanel {...state.resizablePanel}>\n        <Show when={state.overlay} fallback={element()}>\n          <KindDrawer {...state.drawer}>\n            <KindDrawerBackdrop data-agent-hidden=\"\" />\n            <KindDrawerContent {...state.drawerContent}>{element()}</KindDrawerContent>\n          </KindDrawer>\n        </Show>\n      </KindResizablePanel>\n    );\n  };\n  return <parts.Heading {...omit(props, \"render\")} render={render as SidebarPanelProps[\"render\"]} />;\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(props: SidebarHandleProps) {\n  return (\n    <parts.Handle {...omit(props, \"class\")}>\n      {(state: SidebarHandleState) => (\n        <KindResizableHandle aria-label={state[\"aria-label\"]} class={props.class} data-agent-hidden=\"\" />\n      )}\n    </parts.Handle>\n  );\n}\n\n/** The page beside the panel. */\nexport function SidebarInset(props: SidebarInsetProps) {\n  const render = (\n    inset: Record<string, unknown>,\n    state: Parameters<NonNullable<SidebarInsetProps[\"render\"]>>[1],\n  ) => {\n    const own = props.render as Render | undefined;\n    const element = own ? own(inset, state) : <div {...inset} />;\n    return <KindResizablePanel {...state.resizablePanel}>{element}</KindResizablePanel>;\n  };\n  return <parts.Inset {...omit(props, \"render\")} render={render as SidebarInsetProps[\"render\"]} />;\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/solid/sidebar.tsx"
    }
  ],
  "meta": {
    "layer": "solid"
  },
  "type": "registry:ui"
}
