{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "clipboard",
  "title": "Clipboard",
  "description": "A shadcn-style clipboard component built with Ark UI primitives.",
  "dependencies": ["@ark-ui/react", "lucide-react", "class-variance-authority"],
  "files": [
    {
      "path": "src/components/ui/clipboard.tsx",
      "content": "\"use client\";\n\nimport { Clipboard as ClipboardPrimitive } from \"@ark-ui/react/clipboard\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { Check, Copy } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst clipboardRootVariants = cva(\"w-full max-w-full\", {\n  defaultVariants: {\n    orientation: \"vertical\",\n  },\n  variants: {\n    orientation: {\n      horizontal: \"flex flex-row flex-wrap items-end gap-3\",\n      vertical: \"flex flex-col gap-1.5\",\n    },\n  },\n});\n\nconst clipboardLabelVariants = cva(\n  \"font-medium text-foreground text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-64\",\n);\n\nconst clipboardControlVariants = cva(\"flex min-w-0 items-stretch\", {\n  compoundVariants: [\n    {\n      class:\n        \"relative overflow-hidden rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-has-focus-within:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] has-focus-within:has-aria-invalid:border-destructive/64 has-focus-within:has-aria-invalid:ring-destructive/16 has-aria-invalid:border-destructive/36 has-focus-within:border-ring has-autofill:bg-foreground/4 has-disabled:opacity-64 has-[:disabled,:focus-within,[aria-invalid]]:shadow-none has-focus-within:ring-[3px] sm:text-sm dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:not-has-focus-within:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]\",\n      controlVariant: \"default\",\n      size: \"default\",\n    },\n    {\n      class:\n        \"relative overflow-hidden rounded-lg border border-input bg-background not-dark:bg-clip-padding text-sm text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-has-focus-within:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] has-focus-within:border-ring has-focus-within:ring-[3px] has-disabled:opacity-64 dark:bg-input/32 dark:not-has-disabled:not-has-focus-within:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]\",\n      controlVariant: \"default\",\n      size: \"sm\",\n    },\n    {\n      class:\n        \"relative overflow-hidden rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-has-focus-within:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] has-focus-within:border-ring has-focus-within:ring-[3px] has-disabled:opacity-64 sm:text-sm dark:bg-input/32 dark:not-has-disabled:not-has-focus-within:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]\",\n      controlVariant: \"default\",\n      size: \"lg\",\n    },\n  ],\n  defaultVariants: {\n    controlVariant: \"default\",\n    size: \"default\",\n  },\n  variants: {\n    controlVariant: {\n      card: \"gap-1 rounded-xl border border-input bg-card p-1 shadow-sm\",\n      default: \"gap-0\",\n      ghost:\n        \"gap-2 rounded-lg border-0 bg-transparent p-0 shadow-none ring-0 before:hidden\",\n      soft: \"gap-2 rounded-lg border-0 bg-muted/50 p-1.5 shadow-none ring-0 before:hidden\",\n      underline:\n        \"gap-2 border-0 border-b border-input rounded-none bg-transparent pb-px shadow-none ring-0 before:hidden has-focus-within:border-ring has-focus-within:ring-0\",\n    },\n    size: {\n      default: \"\",\n      lg: \"\",\n      sm: \"\",\n    },\n  },\n});\n\nconst clipboardInputVariants = cva(\n  \"min-w-0 flex-1 border-0 bg-transparent outline-none [transition:background-color_5000000s_ease-in-out_0s] placeholder:text-muted-foreground/72 read-only:cursor-text focus-visible:ring-0 disabled:cursor-not-allowed disabled:opacity-64\",\n  {\n    defaultVariants: {\n      controlVariant: \"default\",\n      size: \"default\",\n    },\n    variants: {\n      controlVariant: {\n        card: \"rounded-md px-2.5 py-2 text-sm\",\n        default:\n          \"rounded-none px-[calc(--spacing(3)-1px)] shadow-none not-in-data-[part=control]:rounded-lg not-in-data-[part=control]:border not-in-data-[part=control]:border-input\",\n        ghost: \"px-0 py-1 text-sm\",\n        soft: \"rounded-md px-2 py-1.5 text-sm\",\n        underline: \"px-0 py-1 text-sm\",\n      },\n      size: {\n        default:\n          \"min-h-8.5 leading-8.5 sm:min-h-7.5 sm:leading-7.5 not-in-data-[part=control]:h-8.5 not-in-data-[part=control]:leading-8.5 sm:not-in-data-[part=control]:h-7.5 sm:not-in-data-[part=control]:leading-7.5\",\n        lg: \"min-h-9.5 leading-9.5 sm:min-h-8.5 sm:leading-8.5 not-in-data-[part=control]:h-9.5 not-in-data-[part=control]:leading-9.5 sm:not-in-data-[part=control]:h-8.5 sm:not-in-data-[part=control]:leading-8.5\",\n        sm: \"min-h-7.5 leading-7.5 sm:min-h-6.5 sm:leading-6.5 not-in-data-[part=control]:h-7.5 not-in-data-[part=control]:leading-7.5 sm:not-in-data-[part=control]:h-6.5 sm:not-in-data-[part=control]:leading-6.5\",\n      },\n    },\n  },\n);\n\nconst clipboardTriggerVariants = cva(\n  \"inline-flex shrink-0 cursor-pointer items-center justify-center gap-1.5 font-medium text-sm whitespace-nowrap outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n  {\n    defaultVariants: {\n      controlVariant: \"default\",\n      size: \"default\",\n      triggerVariant: \"default\",\n    },\n    variants: {\n      controlVariant: {\n        card: \"\",\n        default: \"rounded-none border-0\",\n        ghost: \"rounded-md\",\n        soft: \"rounded-md\",\n        underline: \"rounded-md\",\n      },\n      size: {\n        default: \"min-h-8.5 min-w-8.5 px-2.5 sm:min-h-7.5 sm:min-w-7.5 sm:px-2\",\n        lg: \"min-h-9.5 min-w-9.5 px-3 sm:min-h-8.5 sm:min-w-8.5\",\n        sm: \"min-h-7.5 min-w-7.5 px-2 sm:min-h-6.5 sm:min-w-6.5 sm:px-1.5\",\n      },\n      triggerVariant: {\n        default:\n          \"border-s border-input bg-muted/40 text-foreground hover:bg-muted/60 data-copied:text-foreground\",\n        destructive:\n          \"border-s border-input bg-destructive/10 text-destructive hover:bg-destructive/15 data-copied:text-destructive\",\n        ghost:\n          \"border-transparent bg-transparent text-muted-foreground hover:bg-accent hover:text-foreground data-copied:text-foreground\",\n        outline:\n          \"border-s border-input bg-background text-foreground shadow-xs/5 hover:bg-accent/50 data-copied:text-foreground\",\n        primary:\n          \"border-s border-primary/24 bg-primary text-primary-foreground hover:bg-primary/90 data-copied:text-primary-foreground\",\n      },\n    },\n  },\n);\n\nconst clipboardValueTextVariants = cva(\n  \"min-w-0 flex-1 truncate text-foreground text-sm leading-6 sm:leading-5\",\n  {\n    defaultVariants: {\n      size: \"default\",\n    },\n    variants: {\n      size: {\n        default: \"text-sm\",\n        lg: \"text-base sm:text-sm\",\n        sm: \"text-xs sm:text-sm\",\n      },\n    },\n  },\n);\n\nexport type ClipboardRootProps = ClipboardPrimitive.RootProps &\n  VariantProps<typeof clipboardRootVariants>;\n\nexport const ClipboardRoot = ({\n  className,\n  orientation,\n  ...props\n}: ClipboardRootProps) => (\n  <ClipboardPrimitive.Root\n    className={cn(clipboardRootVariants({ orientation }), className)}\n    data-slot=\"clipboard-root\"\n    {...props}\n  />\n);\n\nexport type ClipboardLabelProps = ClipboardPrimitive.LabelProps &\n  VariantProps<typeof clipboardLabelVariants>;\n\nexport const ClipboardLabel = ({\n  className,\n  ...props\n}: ClipboardLabelProps) => (\n  <ClipboardPrimitive.Label\n    className={cn(clipboardLabelVariants(), className)}\n    data-slot=\"clipboard-label\"\n    {...props}\n  />\n);\n\nexport type ClipboardControlProps = ClipboardPrimitive.ControlProps &\n  VariantProps<typeof clipboardControlVariants>;\n\nexport const ClipboardControl = ({\n  className,\n  controlVariant,\n  size,\n  ...props\n}: ClipboardControlProps) => (\n  <ClipboardPrimitive.Control\n    className={cn(\n      clipboardControlVariants({ controlVariant, size }),\n      className,\n    )}\n    data-slot=\"clipboard-control\"\n    {...props}\n  />\n);\n\nexport type ClipboardInputProps = ClipboardPrimitive.InputProps &\n  VariantProps<typeof clipboardInputVariants>;\n\nexport const ClipboardInput = ({\n  className,\n  controlVariant,\n  size,\n  readOnly = true,\n  ...props\n}: ClipboardInputProps) => (\n  <ClipboardPrimitive.Input\n    className={cn(clipboardInputVariants({ controlVariant, size }), className)}\n    data-slot=\"clipboard-input\"\n    readOnly={readOnly}\n    {...props}\n  />\n);\n\nexport type ClipboardTriggerProps = ClipboardPrimitive.TriggerProps &\n  VariantProps<typeof clipboardTriggerVariants>;\n\nexport const ClipboardTrigger = ({\n  className,\n  controlVariant,\n  size,\n  triggerVariant,\n  ...props\n}: ClipboardTriggerProps) => (\n  <ClipboardPrimitive.Trigger\n    className={cn(\n      clipboardTriggerVariants({ controlVariant, size, triggerVariant }),\n      className,\n    )}\n    data-slot=\"clipboard-trigger\"\n    {...props}\n  />\n);\n\nexport type ClipboardIndicatorProps = ClipboardPrimitive.IndicatorProps;\n\nexport const ClipboardIndicator = ({\n  className,\n  copied = <Check className=\"size-4 text-emerald-600 dark:text-emerald-400\" />,\n  children = <Copy className=\"size-4 opacity-80\" />,\n  ...props\n}: ClipboardIndicatorProps) => (\n  <ClipboardPrimitive.Indicator\n    className={cn(\"inline-flex items-center justify-center\", className)}\n    copied={copied}\n    data-slot=\"clipboard-indicator\"\n    {...props}\n  >\n    {children}\n  </ClipboardPrimitive.Indicator>\n);\n\nexport type ClipboardValueTextProps = ClipboardPrimitive.ValueTextProps &\n  VariantProps<typeof clipboardValueTextVariants>;\n\nexport const ClipboardValueText = ({\n  className,\n  size,\n  ...props\n}: ClipboardValueTextProps) => (\n  <ClipboardPrimitive.ValueText\n    className={cn(clipboardValueTextVariants({ size }), className)}\n    data-slot=\"clipboard-value-text\"\n    {...props}\n  />\n);\n\nexport const ClipboardContext = ClipboardPrimitive.Context;\nexport const ClipboardRootProvider = ClipboardPrimitive.RootProvider;\n\nexport {\n  type ClipboardCopyStatusDetails,\n  useClipboard,\n  useClipboardContext,\n} from \"@ark-ui/react/clipboard\";\n",
      "type": "registry:ui",
      "target": "src/components/ui/clipboard.tsx"
    }
  ],
  "type": "registry:ui"
}
