{
  "$schema": "https://ui.shadcn.com/schema/registry.json",
  "name": "spurvik",
  "homepage": "https://spurvik.com",
  "items": [
    {
      "name": "article-50-badge",
      "type": "registry:component",
      "title": "EU AI Act Article 50 AI Notice Badge",
      "description": "Visible EU AI Act Art. 50 AI notice in all 24 EU languages. Loads https://spurvik.com/badge.js (MIT, zero cookies, no telemetry, Shadow DOM). attribution={false} = Pro white-label.",
      "author": "Spurvik (EyeTea Solutions ApS) <hello@spurvik.com>",
      "dependencies": [],
      "docs": "Render <Article50Badge systemName=\"Support Assistant\" /> where the notice should appear (or position=\"bottom-right\" to float). If you send a Content-Security-Policy, allow script-src https://spurvik.com. A visible notice supports your Art. 50(1) transparency work; it does not add Art. 50(2) machine-readable marking.",
      "categories": [
        "compliance",
        "ai"
      ],
      "files": [
        {
          "path": "components/article-50-badge.tsx",
          "type": "registry:component",
          "content": "\"use client\";\n\nimport { useEffect, useRef } from \"react\";\n\n/**\n * Spurvik Article 50 AI notice badge (EU AI Act Art. 50).\n *\n * Loads https://spurvik.com/badge.js (MIT, zero cookies, no telemetry, Shadow DOM)\n * once per page and renders the notice with its public create() API, so prop\n * changes update the badge and unmounting removes it.\n *\n *   <Article50Badge systemName=\"Support Assistant\" />                      // inline\n *   <Article50Badge systemName=\"Support Assistant\" position=\"bottom-right\" /> // floating\n *   <Article50Badge attribution={false} />  // Pro white-label: hides \"Art. 50 · Spurvik\"\n *\n * If your site sends a Content-Security-Policy, allow script-src https://spurvik.com.\n * A visible notice supports your Art. 50(1) transparency work; it does not add\n * Art. 50(2) machine-readable marking.\n */\n\nexport type Article50Notice =\n  | \"interaction\"\n  | \"generated\"\n  | \"deepfake\"\n  | \"public-interest\"\n  | \"emotion-biometric\";\n\nexport type Article50Locale =\n  | \"bg\" | \"cs\" | \"da\" | \"de\" | \"el\" | \"en\" | \"es\" | \"et\" | \"fi\" | \"fr\" | \"ga\" | \"hr\"\n  | \"hu\" | \"it\" | \"lt\" | \"lv\" | \"mt\" | \"nl\" | \"pl\" | \"pt\" | \"ro\" | \"sk\" | \"sl\" | \"sv\";\n\nexport type Article50Theme = \"dark\" | \"light\" | \"auto\";\nexport type Article50Position = \"inline\" | \"bottom-right\" | \"bottom-left\";\n\nexport interface Article50BadgeProps {\n  /** Name shown after the notice, e.g. \"Support Assistant\". */\n  systemName?: string;\n  /** Which Art. 50 notice to show. Default \"interaction\". */\n  notice?: Article50Notice;\n  /** One of the 24 EU languages. Omit to follow <html lang>. */\n  locale?: Article50Locale;\n  /** Default \"dark\". \"auto\" follows prefers-color-scheme. */\n  theme?: Article50Theme;\n  /** \"inline\" renders where the component sits; the others float. Default \"inline\". */\n  position?: Article50Position;\n  /** Show the small \"Art. 50 · Spurvik\" link. Default true; false = Pro white-label. */\n  attribution?: boolean;\n  className?: string;\n}\n\nconst BADGE_SRC = \"https://spurvik.com/badge.js\";\n\ninterface SpurvikBadgeApi {\n  version: string;\n  create: (options: {\n    systemName?: string;\n    notice?: Article50Notice;\n    locale?: Article50Locale;\n    theme?: Article50Theme;\n    position?: Article50Position;\n    attribution?: boolean;\n  }) => HTMLElement;\n  mount: () => void;\n}\n\nfunction badgeApi(): SpurvikBadgeApi | undefined {\n  return (window as unknown as { SpurvikBadge?: SpurvikBadgeApi }).SpurvikBadge;\n}\n\nlet loading: Promise<SpurvikBadgeApi> | null = null;\n\nfunction loadBadge(): Promise<SpurvikBadgeApi> {\n  const ready = badgeApi();\n  if (ready) return Promise.resolve(ready);\n  if (loading) return loading;\n  loading = new Promise<SpurvikBadgeApi>((resolve, reject) => {\n    const existing = document.querySelector<HTMLScriptElement>(`script[src=\"${BADGE_SRC}\"]`);\n    const script = existing ?? document.createElement(\"script\");\n    script.addEventListener(\n      \"load\",\n      () => {\n        const api = badgeApi();\n        if (api) resolve(api);\n        else reject(new Error(\"badge.js loaded but window.SpurvikBadge is missing\"));\n      },\n      { once: true },\n    );\n    script.addEventListener(\n      \"error\",\n      () => {\n        loading = null;\n        reject(new Error(`Could not load ${BADGE_SRC}`));\n      },\n      { once: true },\n    );\n    if (!existing) {\n      script.src = BADGE_SRC;\n      script.async = true;\n      script.dataset.spurvikLoader = \"react\";\n      script.dataset.cookieconsent = \"ignore\";\n      script.dataset.ucAllowed = \"true\";\n      document.head.appendChild(script);\n    }\n  });\n  return loading;\n}\n\nexport function Article50Badge({\n  systemName,\n  notice = \"interaction\",\n  locale,\n  theme = \"dark\",\n  position = \"inline\",\n  attribution = true,\n  className,\n}: Article50BadgeProps) {\n  const slot = useRef<HTMLDivElement>(null);\n\n  useEffect(() => {\n    let host: HTMLElement | null = null;\n    let cancelled = false;\n    loadBadge()\n      .then((api) => {\n        if (cancelled) return;\n        host = api.create({ systemName, notice, locale, theme, position, attribution });\n        if (position === \"inline\") slot.current?.appendChild(host);\n        else document.body.appendChild(host);\n      })\n      .catch((error: unknown) => {\n        console.error(\"[article-50-badge]\", error);\n      });\n    return () => {\n      cancelled = true;\n      host?.remove();\n    };\n  }, [systemName, notice, locale, theme, position, attribution]);\n\n  // data-spurvik-mounted tells badge.js's auto-mount to leave this slot alone\n  // (no duplicate floating badge); the effect above renders into it instead.\n  return (\n    <div\n      ref={slot}\n      className={className}\n      data-spurvik-badge=\"\"\n      data-spurvik-mounted=\"react\"\n      hidden={position !== \"inline\"}\n    />\n  );\n}\n\nexport default Article50Badge;\n"
        }
      ]
    },
    {
      "name": "ai-act-trust-card",
      "type": "registry:component",
      "title": "EU AI Act Art. 50 & 2 Dec 2026 C2PA SaaS Trust-Center Card",
      "description": "Interactive Shadow DOM EU AI Act Art. 50 & 2 December 2026 C2PA Readiness Card for SaaS /trust and /security pages across 10 EU languages. Loads https://spurvik.com/trust-widget.js (MIT, zero cookies, zero storage). attribution={false} = Pro white-label (€19/mo).",
      "author": "Spurvik (EyeTea Solutions ApS) <hello@spurvik.com>",
      "dependencies": [],
      "docs": "Render <AIActTrustCard domain=\"yourdomain.com\" /> on your /trust, /security, or footer page. On Free (€0), displays a subtle \"Art. 50 · Spurvik\" link plus live DPO Brief & C2PA Check links; set attribution={false} on Pro (€19/mo or €190/yr) or Done-For-You (€199 once) for white-label. If you send a Content-Security-Policy, allow script-src https://spurvik.com and connect-src https://console.spurvik.com.",
      "categories": [
        "eu-ai-act",
        "ai",
        "trust-center"
      ],
      "files": [
        {
          "path": "components/ai-act-trust-card.tsx",
          "type": "registry:component",
          "content": "\"use client\";\n\nimport { useEffect, useRef } from \"react\";\n\n/**\n * Spurvik SaaS Trust-Center Readiness Card (EU AI Act Art. 50 & 2 Dec 2026 C2PA).\n *\n * Loads https://spurvik.com/trust-widget.js (MIT, zero cookies, zero storage, Shadow DOM)\n * once per page and renders the live 4-signal card inside its own Shadow Root.\n *\n *   <AIActTrustCard domain=\"folk.app\" />\n *   <AIActTrustCard domain=\"personio.de\" locale=\"de\" theme=\"dark\" />\n *   <AIActTrustCard domain=\"folk.app\" attribution={false} /> // Pro white-label (€19/mo)\n */\n\nexport type TrustCardLocale =\n  | \"auto\" | \"en\" | \"de\" | \"fr\" | \"nl\" | \"da\" | \"sv\" | \"fi\" | \"es\" | \"it\" | \"pl\";\n\nexport type TrustCardTheme = \"dark\" | \"light\" | \"auto\";\n\nexport interface AIActTrustCardProps {\n  /** Public SaaS or store hostname, e.g. \"folk.app\" or \"yourdomain.com\". */\n  domain: string;\n  /** Card language (10 EU languages or \"auto\" to follow <html lang> / ccTLD). */\n  locale?: TrustCardLocale;\n  /** Visual theme. Default \"dark\". */\n  theme?: TrustCardTheme;\n  /** Hydrate live HTTPS / Art. 50 / C2PA signals from console.spurvik.com. Default true. */\n  live?: boolean;\n  /** Show subtle \"Art. 50 · Spurvik\" referral link. Default true; false = Pro white-label (€19/mo). */\n  attribution?: boolean;\n  className?: string;\n}\n\nconst WIDGET_SRC = \"https://spurvik.com/trust-widget.js\";\n\ninterface SpurvikTrustWidgetApi {\n  version: string;\n  create: (options: {\n    target: HTMLElement;\n    domain: string;\n    locale?: string;\n    theme?: string;\n    live?: string;\n    attribution?: string;\n  }) => HTMLElement | null;\n}\n\nfunction widgetApi(): SpurvikTrustWidgetApi | undefined {\n  return (window as unknown as { SpurvikTrustWidget?: SpurvikTrustWidgetApi }).SpurvikTrustWidget;\n}\n\nlet loading: Promise<SpurvikTrustWidgetApi> | null = null;\n\nfunction loadTrustWidget(): Promise<SpurvikTrustWidgetApi> {\n  const ready = widgetApi();\n  if (ready) return Promise.resolve(ready);\n  if (loading) return loading;\n  loading = new Promise<SpurvikTrustWidgetApi>((resolve, reject) => {\n    const existing = document.querySelector<HTMLScriptElement>(`script[src=\"${WIDGET_SRC}\"]`);\n    const script = existing ?? document.createElement(\"script\");\n    script.addEventListener(\n      \"load\",\n      () => {\n        const api = widgetApi();\n        if (api) resolve(api);\n        else reject(new Error(\"trust-widget.js loaded but window.SpurvikTrustWidget is missing\"));\n      },\n      { once: true },\n    );\n    script.addEventListener(\n      \"error\",\n      () => {\n        loading = null;\n        reject(new Error(`Could not load ${WIDGET_SRC}`));\n      },\n      { once: true },\n    );\n    if (!existing) {\n      script.src = WIDGET_SRC;\n      script.async = true;\n      script.dataset.spurvikMounted = \"react\";\n      script.dataset.cookieconsent = \"ignore\";\n      script.dataset.ucAllowed = \"true\";\n      document.head.appendChild(script);\n    }\n  });\n  return loading;\n}\n\nexport function AIActTrustCard({\n  domain,\n  locale = \"auto\",\n  theme = \"dark\",\n  live = true,\n  attribution = true,\n  className,\n}: AIActTrustCardProps) {\n  const slot = useRef<HTMLDivElement>(null);\n\n  useEffect(() => {\n    const el = slot.current;\n    if (!el || !domain) return;\n    let cancelled = false;\n    el.replaceChildren();\n    el.removeAttribute(\"data-spurvik-trust-widget\");\n    const hostNode = document.createElement(\"div\");\n    el.appendChild(hostNode);\n    loadTrustWidget()\n      .then((api) => {\n        if (cancelled) return;\n        api.create({\n          target: hostNode,\n          domain,\n          locale,\n          theme,\n          live: live ? \"true\" : \"false\",\n          attribution: attribution ? \"true\" : \"false\",\n        });\n      })\n      .catch((error: unknown) => {\n        console.error(\"[ai-act-trust-card]\", error);\n      });\n    return () => {\n      cancelled = true;\n      hostNode.remove();\n    };\n  }, [domain, locale, theme, live, attribution]);\n\n  return <div ref={slot} className={className} data-spurvik-trust-react=\"\" />;\n}\n\nexport default AIActTrustCard;\n"
        }
      ]
    }
  ]
}
