{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "preview-watermark",
  "type": "registry:component",
  "title": "Preview watermark",
  "description": "Marks unlocked work with a light recipient or build overlay for screenshots. Does not verify codes, persist state, or grant or revoke access. Contract: the consumer owns lifecycle timestamps and action callbacks.",
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/components/preview-watermark.tsx",
      "type": "registry:component",
      "target": "@components/knock/preview-watermark.tsx",
      "content": "/**\n * MIT License — Copyright (c) 2026 Knock contributors.\n * Marks unlocked work with a light recipient or build overlay for screenshots.\n * Does not verify codes, persist state, or grant or revoke access.\n * Contract: the consumer owns lifecycle timestamps and action callbacks.\n * @version 0.1.0\n * @minimalExample <PreviewWatermark><p>Preview content</p></PreviewWatermark>\n * @fullExample <PreviewWatermark recipient=\"Acme Co.\" buildLabel=\"acme-v1\" theme=\"light\" labels={{ mark: \"Private preview\" }}><p>Preview content</p></PreviewWatermark>\n * @lifecycle unlocked\n * @whenToUse Unlocked work should carry who it was prepared for, including into screenshots that leave the review.\n * @notFor A draft status strip. Use Preview ribbon when the label should sit above the work rather than across it.\n * @pitfall The overlay is visual. It does not prevent copies, and it is not authorization.\n * @a11y Native controls, visible focus, localized labels; the repeating mark is decorative and hidden from assistive technology. No modal dialog is created.\n */\n'use client';\n\nimport { type ReactNode } from 'react';\n\nexport interface PreviewWatermarkProps {\n  /** Work shown under the mark; required. */\n  children: ReactNode;\n  /** Intended recipient name or organization. */\n  recipient?: string;\n  /** Preview build identifier. */\n  buildLabel?: string;\n  /** Localized mark text when recipient and build are omitted. */\n  labels?: {\n    /** Localized repeating mark. */\n    mark?: string;\n  };\n  /** Explicit theme; omitted follows the system preference. */\n  theme?: 'light' | 'dark';\n  /** Additional wrapper classes. */\n  className?: string;\n}\nexport function PreviewWatermark({\n  children,\n  recipient,\n  buildLabel,\n  labels,\n  theme,\n  className = '',\n}: PreviewWatermarkProps) {\n  const mark =\n    [recipient, buildLabel].filter(Boolean).join(' · ') || labels?.mark || 'Private preview';\n  return (\n    <div\n      data-knock-item=\"watermark\"\n      data-theme={theme}\n      className={`relative overflow-hidden ${className}`}\n    >\n      <style>{`[data-knock-item]{--knock-surface:#fffefa;--knock-text:#30382c;--knock-secondary:#65705b;--knock-line:#d8dece;--knock-highlight:#a3462d;color:var(--knock-ink,var(--knock-text));color-scheme:light}[data-knock-item][data-theme=dark]{--knock-surface:#293028;--knock-text:#f0f3e9;--knock-secondary:#b6c2ab;--knock-line:#59654f;--knock-highlight:#f1a187;color-scheme:dark}@media(prefers-color-scheme:dark){[data-knock-item]:not([data-theme=light]){--knock-surface:#293028;--knock-text:#f0f3e9;--knock-secondary:#b6c2ab;--knock-line:#59654f;--knock-highlight:#f1a187;color-scheme:dark}}[data-knock-item] a:focus-visible,[data-knock-item] button:focus-visible,[data-knock-item] [tabindex]:focus-visible{outline:2px solid var(--knock-accent,var(--knock-highlight));outline-offset:4px}[data-knock-item] button,[data-knock-item] a{overflow-wrap:anywhere}@media(prefers-reduced-motion:reduce){[data-knock-item] *{animation:none!important;transition:none!important}}`}</style>\n      <div\n        aria-hidden=\"true\"\n        className=\"pointer-events-none absolute inset-0 z-10 select-none overflow-hidden text-[11px] font-medium uppercase tracking-[0.3em] text-[var(--knock-muted,var(--knock-secondary))] opacity-25\"\n      >\n        <div className=\"flex h-[200%] w-[200%] origin-center -translate-x-1/4 -translate-y-1/4 -rotate-12 flex-wrap content-start gap-x-16 gap-y-10 p-6\">\n          {Array.from({ length: 24 }, (_, index) => (\n            <span key={index}>{mark}</span>\n          ))}\n        </div>\n      </div>\n      <div className=\"relative\">{children}</div>\n    </div>\n  );\n}\n"
    }
  ],
  "meta": {
    "version": "0.1.0",
    "lifecycle": "unlocked",
    "whenToUse": "Unlocked work should carry who it was prepared for, including into screenshots that leave the review.",
    "notFor": "A draft status strip. Use Preview ribbon when the label should sit above the work rather than across it.",
    "pitfalls": [
      "The overlay is visual. It does not prevent copies, and it is not authorization."
    ],
    "dependencies": [],
    "usedBy": [],
    "sourceHash": "cde4033691e510b370c58f09ee5c74b1a177cfd709817a95abea924270562088",
    "component": "PreviewWatermark",
    "contract": "Marks unlocked work with a light recipient or build overlay for screenshots. Does not verify codes, persist state, or grant or revoke access. Contract: the consumer owns lifecycle timestamps and action callbacks.",
    "props": [
      {
        "name": "children",
        "type": "ReactNode",
        "required": true,
        "default": null,
        "description": "Work shown under the mark; required."
      },
      {
        "name": "recipient",
        "type": "string",
        "required": false,
        "default": null,
        "description": "Intended recipient name or organization."
      },
      {
        "name": "buildLabel",
        "type": "string",
        "required": false,
        "default": null,
        "description": "Preview build identifier."
      },
      {
        "name": "labels",
        "type": "{ mark?: string; }",
        "required": false,
        "default": null,
        "description": "Localized mark text when recipient and build are omitted.",
        "properties": [
          {
            "name": "mark",
            "type": "string",
            "required": false,
            "default": null
          }
        ]
      },
      {
        "name": "theme",
        "type": "'light' | 'dark'",
        "required": false,
        "default": null,
        "description": "Explicit theme; omitted follows the system preference."
      },
      {
        "name": "className",
        "type": "string",
        "required": false,
        "default": "''",
        "description": "Additional wrapper classes."
      }
    ],
    "defaults": {
      "className": "''"
    },
    "slots": [
      "children"
    ],
    "a11y": "Native controls, visible focus, localized labels; the repeating mark is decorative and hidden from assistive technology. No modal dialog is created.",
    "unsupportedProps": [
      "onSuccess",
      "password",
      "correctCode",
      "attempts",
      "maxAttempts",
      "onUnlock"
    ],
    "examples": {
      "minimal": "'use client';\nimport { useState } from 'react';\nimport { PreviewWatermark } from '@/components/knock/preview-watermark';\n\nexport default function Example() {\n  const [value, setValue] = useState('');\n  const [unlocked, setUnlocked] = useState(false);\n  const [message, setMessage] = useState('');\n  return <section aria-label=\"Preview watermark example\">\n    {/* Demo consumer state only. Integrate your authorization outside this UI. */}\n    <PreviewWatermark><p>Preview content</p></PreviewWatermark>\n    <p role=\"status\">{message}</p>\n  </section>;\n}\n",
      "full": "'use client';\nimport { useState } from 'react';\nimport { PreviewWatermark } from '@/components/knock/preview-watermark';\n\nexport default function Example() {\n  const [value, setValue] = useState('');\n  const [unlocked, setUnlocked] = useState(false);\n  const [message, setMessage] = useState('');\n  return <section aria-label=\"Preview watermark example\">\n    {/* Demo consumer state only. Integrate your authorization outside this UI. */}\n    <PreviewWatermark recipient=\"Acme Co.\" buildLabel=\"acme-v1\" theme=\"light\" labels={{ mark: \"Private preview\" }}><p>Preview content</p></PreviewWatermark>\n    <p role=\"status\">{message}</p>\n  </section>;\n}\n"
    }
  },
  "docs": "UI only. Read https://knock.codes/docs/preview-watermark.md. Consumers own authorization."
}
