{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "preview-ribbon",
  "type": "registry:component",
  "title": "Preview ribbon",
  "description": "Keeps a draft label visible within preview 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-ribbon.tsx",
      "type": "registry:component",
      "target": "@components/knock/preview-ribbon.tsx",
      "content": "/**\n * MIT License — Copyright (c) 2026 Knock contributors.\n * Keeps a draft label visible within preview 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.2.0\n * @minimalExample <PreviewRibbon />\n * @fullExample <PreviewRibbon theme=\"light\" labels={{ draft: \"Draft preview\", description: \"For review only.\" }} className=\"sticky top-0\" />\n * @lifecycle unlocked\n * @whenToUse Draft status should travel with the work, including into the screenshots that leave the review.\n * @notFor A dismissible banner. There is no dismiss action by design: a ribbon that can be closed is absent from the screenshot that needed it.\n * @pitfall Position belongs to you. Without sticky or fixed positioning from your own className, the ribbon scrolls away with the page.\n * @a11y Native controls, visible focus, localized labels; lifecycle messages use polite announcements. No modal dialog is created.\n */\n'use client';\n\nexport interface PreviewRibbonProps {\n  /** Localized draft label and supporting context. */\n  labels?: {\n    /** Localized draft. */\n    draft?: string;\n\n    /** Localized description. */\n    description?: string;\n  };\n\n  /** Explicit theme; omitted follows the system preference. */\n  theme?: 'light' | 'dark';\n  /** Additional wrapper classes. */\n  className?: string;\n}\nexport function PreviewRibbon({ labels, theme, className = '' }: PreviewRibbonProps) {\n  return (\n    <div\n      data-knock-item=\"ribbon\"\n      data-theme={theme}\n      className={`flex flex-wrap items-center justify-center gap-x-3 gap-y-1 border-y border-[var(--knock-border,var(--knock-line))] bg-[var(--knock-bg,var(--knock-surface))] px-4 py-2 text-xs ${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      <svg\n        aria-hidden=\"true\"\n        width=\"16\"\n        height=\"16\"\n        viewBox=\"0 0 24 24\"\n        fill=\"none\"\n        stroke=\"currentColor\"\n        strokeWidth=\"1.5\"\n        className=\"text-[var(--knock-accent,var(--knock-highlight))]\"\n      >\n        <path d=\"M12 3v18M3 12h18M5 5l14 14M5 19 19 5\" />\n      </svg>\n      <strong className=\"font-semibold uppercase tracking-widest\">\n        {labels?.draft ?? 'Work in progress'}\n      </strong>\n      <span className=\"text-[var(--knock-muted,var(--knock-secondary))]\">\n        {labels?.description ?? 'A private preview, not the finished thing.'}\n      </span>\n    </div>\n  );\n}\n"
    }
  ],
  "meta": {
    "version": "0.2.0",
    "lifecycle": "unlocked",
    "whenToUse": "Draft status should travel with the work, including into the screenshots that leave the review.",
    "notFor": "A dismissible banner. There is no dismiss action by design: a ribbon that can be closed is absent from the screenshot that needed it.",
    "pitfalls": [
      "Position belongs to you. Without sticky or fixed positioning from your own className, the ribbon scrolls away with the page."
    ],
    "dependencies": [],
    "usedBy": [
      "preview-chrome"
    ],
    "sourceHash": "d6f6151e26b1613692ee93fd967d1970ba0a46a034f97476eead3325d50cf25d",
    "component": "PreviewRibbon",
    "contract": "Keeps a draft label visible within preview screenshots. Does not verify codes, persist state, or grant or revoke access. Contract: the consumer owns lifecycle timestamps and action callbacks.",
    "props": [
      {
        "name": "labels",
        "type": "{ draft?: string; description?: string; }",
        "required": false,
        "default": null,
        "description": "Localized draft label and supporting context.",
        "properties": [
          {
            "name": "draft",
            "type": "string",
            "required": false,
            "default": "'Work in progress'"
          },
          {
            "name": "description",
            "type": "string",
            "required": false,
            "default": "'A private preview, not the finished thing.'"
          }
        ]
      },
      {
        "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": "''",
      "labels.draft": "'Work in progress'",
      "labels.description": "'A private preview, not the finished thing.'"
    },
    "slots": [],
    "a11y": "Native controls, visible focus, localized labels; lifecycle messages use polite announcements. No modal dialog is created.",
    "unsupportedProps": [
      "onSuccess",
      "password",
      "correctCode",
      "attempts",
      "maxAttempts",
      "onUnlock"
    ],
    "examples": {
      "minimal": "'use client';\nimport { useState } from 'react';\nimport { PreviewRibbon } from '@/components/knock/preview-ribbon';\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 ribbon example\">\n    {/* Demo consumer state only. Integrate your authorization outside this UI. */}\n    <PreviewRibbon />\n    <p role=\"status\">{message}</p>\n  </section>;\n}\n",
      "full": "'use client';\nimport { useState } from 'react';\nimport { PreviewRibbon } from '@/components/knock/preview-ribbon';\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 ribbon example\">\n    {/* Demo consumer state only. Integrate your authorization outside this UI. */}\n    <PreviewRibbon theme=\"light\" labels={{ draft: \"Draft preview\", description: \"For review only.\" }} className=\"sticky top-0\" />\n    <p role=\"status\">{message}</p>\n  </section>;\n}\n"
    }
  },
  "docs": "UI only. Read https://knock.codes/docs/preview-ribbon.md. Consumers own authorization."
}
