{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ink/panel",
  "title": "Panel",
  "description": "Titled bordered panel",
  "dependencies": [
    "ink"
  ],
  "registryDependencies": [
    "https://termcn.dev/r/ink/terminal-style.json",
    "https://termcn.dev/r/ink/types.json",
    "https://termcn.dev/r/ink/use-theme.json",
    "https://termcn.dev/r/ink/use-unicode.json"
  ],
  "files": [
    {
      "path": "registry/ui/panel.tsx",
      "content": "import { useIsScreenReaderEnabled, Box, Text } from \"ink\";\nimport type { ReactNode } from \"react\";\n\nimport { useTheme } from \"@/hooks/use-theme\";\nimport { useUnicode } from \"@/hooks/use-unicode\";\nimport { resolveBorderStyle } from \"@/lib/terminal-style\";\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  \"aria-label\"?: string;\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  \"aria-label\": ariaLabel,\n}: PanelProps) => {\n  const unicode = useUnicode();\n  const theme = useTheme();\n  const isScreenReaderEnabled = useIsScreenReaderEnabled();\n\n  const inner = (\n    <>\n      {title && (\n        <Box\n          paddingX={paddingX}\n          borderStyle={resolveBorderStyle(\"single\", unicode)}\n          borderColor={borderColor ?? theme.colors.border}\n        >\n          <Text bold color={titleColor ?? theme.colors.primary}>\n            {title}\n          </Text>\n        </Box>\n      )}\n      <Box flexDirection=\"column\" paddingX={paddingX} paddingY={paddingY}>\n        {children}\n      </Box>\n    </>\n  );\n\n  if (!bordered) {\n    return (\n      <Box flexDirection=\"column\" width={width} height={height}>\n        {ariaLabel && <Text aria-label={ariaLabel}>{\"\"}</Text>}\n        {inner}\n      </Box>\n    );\n  }\n\n  return (\n    <Box\n      flexDirection=\"column\"\n      borderStyle={resolveBorderStyle(\n        isScreenReaderEnabled ? undefined : (borderStyle ?? theme.border.style),\n        unicode\n      )}\n      borderColor={borderColor ?? theme.colors.border}\n      width={width}\n      height={height}\n    >\n      {ariaLabel && <Text aria-label={ariaLabel}>{\"\"}</Text>}\n      {inner}\n    </Box>\n  );\n};\n",
      "type": "registry:ui"
    }
  ],
  "categories": [
    "utility"
  ],
  "type": "registry:ui"
}