{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "clipboard",
  "type": "registry:ui",
  "title": "Clipboard",
  "dependencies": [
    "@base-ui-next/react",
    "class-variance-authority"
  ],
  "registryDependencies": [
    "https://hamur.dev/r/react/utils.json",
    "https://hamur.dev/r/react/button.json"
  ],
  "files": [
    {
      "path": "react/clipboard.tsx",
      "content": "'use client'\n\nimport type * as React from 'react' // base-ui-next/ui clipboard@0.1.0\nimport { Clipboard as ClipboardPrimitive } from '@base-ui-next/react/clipboard'\nimport type { VariantProps } from 'class-variance-authority'\nimport { cn } from '@/lib/utils'\nimport { buttonVariants } from '@/components/ui/button'\n\nconst clipboardClassName = 'flex w-full flex-wrap items-center gap-2'\n\nconst clipboardLabelClassName =\n  'basis-full text-sm leading-none font-medium select-none data-disabled:opacity-50'\n\n/** `input`'s box, filling the row beside the Trigger and cutting a long value with an ellipsis. */\nconst clipboardInputClassName =\n  'h-9 w-full min-w-0 flex-1 truncate rounded-md border border-input bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 data-disabled:cursor-not-allowed data-disabled:opacity-50 md:text-sm dark:bg-input/30'\n\nconst clipboardValueClassName = 'min-w-0 truncate text-sm data-disabled:opacity-50'\n\n/** Beside `button`'s classes; dimmed while disabled and still focusable. */\nconst clipboardTriggerClassName =\n  'shrink-0 aria-disabled:cursor-not-allowed aria-disabled:opacity-50'\n\nconst clipboardIndicatorClassName =\n  'group/clipboard-indicator inline-flex shrink-0 items-center justify-center'\n\n/** The Indicator's lucide Copy, shown while idle or copying. */\nconst clipboardIndicatorCopyClassName =\n  'group-data-copied/clipboard-indicator:hidden group-data-failed/clipboard-indicator:hidden'\n\n/** The Indicator's lucide Check, shown while copied. */\nconst clipboardIndicatorCopiedClassName =\n  'hidden group-data-copied/clipboard-indicator:block'\n\n/** The Indicator's lucide X, shown while failed. */\nconst clipboardIndicatorFailedClassName =\n  'hidden text-destructive group-data-failed/clipboard-indicator:block'\n\ntype ButtonVariants = VariantProps<typeof buttonVariants>\n\n// lucide's icons, inline and hidden from assistive technology (10 · As built, BN-309).\nfunction SvgIcon({ children, ...props }: React.ComponentProps<'svg'>) {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth=\"2\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n      aria-hidden=\"true\"\n      {...props}\n    >\n      {children}\n    </svg>\n  )\n}\n\n// No shadcn item: Base UI's component ID as slug (docs/design/log/clipboard.md, decision 57).\n// One name per part; the Indicator goes inside the Trigger.\n\nfunction Clipboard({ className, ...props }: ClipboardPrimitive.Root.Props) {\n  return (\n    <ClipboardPrimitive.Root\n      data-slot=\"clipboard\"\n      className={cn(clipboardClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction ClipboardLabel({ className, ...props }: ClipboardPrimitive.Label.Props) {\n  return (\n    <ClipboardPrimitive.Label\n      data-slot=\"clipboard-label\"\n      className={cn(clipboardLabelClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction ClipboardInput({ className, ...props }: ClipboardPrimitive.Input.Props) {\n  return (\n    <ClipboardPrimitive.Input\n      data-slot=\"clipboard-input\"\n      className={cn(clipboardInputClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction ClipboardValue({ className, ...props }: ClipboardPrimitive.Value.Props) {\n  return (\n    <ClipboardPrimitive.Value\n      data-slot=\"clipboard-value\"\n      className={cn(clipboardValueClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction ClipboardTrigger({\n  className,\n  variant = 'outline',\n  size = 'icon',\n  ...props\n}: ClipboardPrimitive.Trigger.Props & ButtonVariants) {\n  return (\n    <ClipboardPrimitive.Trigger\n      data-slot=\"clipboard-trigger\"\n      className={cn(buttonVariants({ variant, size }), clipboardTriggerClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction ClipboardIndicator({ className, children, ...props }: ClipboardPrimitive.Indicator.Props) {\n  return (\n    <ClipboardPrimitive.Indicator\n      data-slot=\"clipboard-indicator\"\n      className={cn(clipboardIndicatorClassName, className)}\n      {...props}\n    >\n      {children ?? (\n        <>\n          <SvgIcon className={clipboardIndicatorCopyClassName}>\n            <rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n            <path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" />\n          </SvgIcon>\n          <SvgIcon className={clipboardIndicatorCopiedClassName}>\n            <path d=\"M20 6 9 17l-5-5\" />\n          </SvgIcon>\n          <SvgIcon className={clipboardIndicatorFailedClassName}>\n            <path d=\"M18 6 6 18\" />\n            <path d=\"m6 6 12 12\" />\n          </SvgIcon>\n        </>\n      )}\n    </ClipboardPrimitive.Indicator>\n  )\n}\n\nexport {\n  Clipboard,\n  ClipboardIndicator,\n  ClipboardInput,\n  ClipboardLabel,\n  ClipboardTrigger,\n  ClipboardValue,\n}\n",
      "type": "registry:ui",
      "target": "@ui/clipboard.tsx"
    }
  ],
  "meta": {
    "baseUiNext": {
      "version": "0.1.0",
      "hash": "867a4c347a27012d5aa74166d604b9b6101da0ab2602ea69f041653591fef007",
      "files": {
        "@ui/clipboard.tsx": "27c8e58874a4bc98ce781b831956b2ad1a8dec18c3c26ebbf60e6b37e700d8c5"
      }
    }
  }
}
