{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "code",
  "title": "Code",
  "description": "Inline code, or a scrollable block.",
  "registryDependencies": [
    "https://creance.pages.dev/r/creance-base.json"
  ],
  "files": [
    {
      "path": "code/Code.css",
      "content": ".cr-code {\n  padding: 1px 6px;\n  border-radius: var(--cr-radius-sm);\n  background: var(--cr-color-bg-subtle);\n  color: var(--cr-color-text-default);\n  font-family: var(--cr-font-family-mono);\n  font-size: 0.9em;\n}\n\n.cr-code-block {\n  margin: 0;\n  padding: var(--cr-space-3) var(--cr-space-4);\n  overflow: auto;\n  border-radius: var(--cr-radius-md);\n  background: var(--cr-color-bg-subtle);\n  color: var(--cr-color-text-default);\n  font-family: var(--cr-font-family-mono);\n  font-size: var(--cr-font-size-sm);\n  line-height: var(--cr-font-line-height-normal);\n}\n\n.cr-code-block:focus-visible {\n  outline: var(--cr-focus-width) solid var(--cr-color-focus);\n  outline-offset: var(--cr-focus-offset);\n}\n",
      "type": "registry:file",
      "target": "@components/creance/code/Code.css"
    },
    {
      "path": "code/Code.tsx",
      "content": "import type { HTMLAttributes } from 'react';\nimport { cx } from '@/lib/creance/cx';\nimport './Code.css';\n\nexport interface CodeProps extends HTMLAttributes<HTMLElement> {\n  /** Render as a `<pre>` block instead of inline `<code>`. */\n  block?: boolean;\n}\n\nexport function Code({ block = false, className, ...props }: CodeProps) {\n  if (!block) return <code className={cx('cr-code', className)} {...props} />;\n  return (\n    // tabIndex: a scrollable region must be reachable by keyboard.\n    // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n    <pre className={cx('cr-code-block', className)} tabIndex={0}>\n      <code {...props} />\n    </pre>\n  );\n}\n",
      "type": "registry:ui",
      "target": "@components/creance/code/Code.tsx"
    }
  ],
  "categories": [
    "atom",
    "data-display"
  ],
  "type": "registry:ui"
}