{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "opentui/panel",
  "title": "Panel",
  "description": "Titled bordered panel",
  "dependencies": [
    "@opentui/react"
  ],
  "registryDependencies": [
    "https://termcn.dev/r/opentui/use-theme.json"
  ],
  "files": [
    {
      "path": "registry/opentui/ui/panel.tsx",
      "content": "/* @jsxImportSource @opentui/react */\nimport type { ReactNode } from \"react\";\n\nimport { useTheme } from \"@/hooks/use-theme\";\nimport type { BorderStyle } from \"@/components/ui/types\";\n\nexport interface PanelProps {\n  title?: string;\n  titleColor?: string;\n  borderColor?: string;\n  borderStyle?: BorderStyle;\n  bordered?: boolean;\n  width?: number;\n  height?: number;\n  paddingX?: number;\n  paddingY?: number;\n  children?: ReactNode;\n}\n\nexport const Panel = ({\n  title,\n  titleColor,\n  borderColor,\n  borderStyle,\n  bordered = true,\n  width,\n  height,\n  paddingX = 1,\n  paddingY = 0,\n  children,\n}: PanelProps) => {\n  const theme = useTheme();\n\n  const inner = (\n    <>\n      {title ? (\n        <box\n          paddingLeft={paddingX}\n          paddingRight={paddingX}\n          borderStyle=\"single\"\n          borderColor={borderColor ?? theme.colors.border}\n        >\n          <text fg={titleColor ?? theme.colors.primary}>\n            <b>{title}</b>\n          </text>\n        </box>\n      ) : null}\n      <box\n        flexDirection=\"column\"\n        paddingLeft={paddingX}\n        paddingRight={paddingX}\n        paddingTop={paddingY}\n        paddingBottom={paddingY}\n      >\n        {children}\n      </box>\n    </>\n  );\n\n  if (!bordered) {\n    return (\n      <box flexDirection=\"column\" width={width} height={height}>\n        {inner}\n      </box>\n    );\n  }\n\n  return (\n    <box\n      flexDirection=\"column\"\n      borderStyle={borderStyle ?? theme.border.style}\n      borderColor={borderColor ?? theme.colors.border}\n      width={width}\n      height={height}\n    >\n      {inner}\n    </box>\n  );\n};\n",
      "type": "registry:ui",
      "target": "components/ui/panel.tsx"
    }
  ],
  "categories": [
    "utility"
  ],
  "type": "registry:ui"
}