{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "text-with-copy",
  "title": "TextWithCopy",
  "description": "Text with a copy button beside it.",
  "registryDependencies": [
    "https://creance.pages.dev/r/copy-button.json",
    "https://creance.pages.dev/r/creance-base.json"
  ],
  "files": [
    {
      "path": "text-with-copy/TextWithCopy.css",
      "content": ".cr-text-copy {\n  display: inline-flex;\n  align-items: center;\n  gap: var(--cr-space-2);\n  max-width: 100%;\n  color: var(--cr-color-text-default);\n}\n\n.cr-text-copy__text {\n  min-width: 0;\n  overflow: hidden;\n  font-family: var(--cr-font-family-mono);\n  font-size: 0.93em;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n}\n\n.cr-text-copy[data-variant='block'] {\n  display: flex;\n  padding: 6px 6px 6px var(--cr-space-4);\n  border-radius: 14px;\n  background: var(--cr-color-bg-subtle);\n}\n\n.cr-text-copy[data-variant='block'] .cr-text-copy__text {\n  flex: 1;\n  font-size: var(--cr-font-size-md);\n}\n",
      "type": "registry:file",
      "target": "@components/creance/text-with-copy/TextWithCopy.css"
    },
    {
      "path": "text-with-copy/TextWithCopy.tsx",
      "content": "import type { ReactNode } from 'react';\nimport { cx } from '@/lib/creance/cx';\nimport { CopyButton } from '@/components/creance/copy-button/CopyButton';\nimport './TextWithCopy.css';\n\nexport interface TextWithCopyProps {\n  /** The exact text copied. */\n  value: string;\n  /** What shows, if different from `value`: a truncated ID, say. Defaults to `value`. */\n  children?: ReactNode;\n  /** Accessible name of the copy button. */\n  label?: string;\n  /** `inline` sits in a sentence; `block` is a full-width well, for commands. */\n  variant?: 'inline' | 'block';\n  className?: string;\n}\n\n/** Text in monospace with a copy button beside it. */\nexport function TextWithCopy({ value, children, label = 'Copy', variant = 'inline', className }: TextWithCopyProps) {\n  return (\n    <span className={cx('cr-text-copy', className)} data-variant={variant}>\n      <code className=\"cr-text-copy__text\">{children ?? value}</code>\n      <CopyButton value={value} label={label} />\n    </span>\n  );\n}\n",
      "type": "registry:ui",
      "target": "@components/creance/text-with-copy/TextWithCopy.tsx"
    }
  ],
  "categories": [
    "molecule",
    "actions"
  ],
  "type": "registry:ui"
}