{"$schema":"https:\/\/ui.particle.academy\/schema\/registry-item.json","name":"pdf-viewer","type":"registry:ui","title":"PdfViewer","description":"Inline PDF via <object> \/ <iframe> with a download fallback.","package":"react-fancy","dependencies":[],"registryDependencies":[],"files":[{"path":"components\/fancy\/pdf-viewer\/PdfViewer.tsx","content":"import { forwardRef } from \"react\";\nimport { cn } from \"..\/..\/utils\/cn\";\nimport type { PdfViewerProps } from \".\/PdfViewer.types\";\n\n\/**\n * A standalone PDF viewer \u2014 embeds the document via the browser's native PDF\n * plugin (`<object>`), falling back to an `<iframe>`, then to a download link.\n * Fills its container, so give it a height (a `min-h` floor is built in).\n * Renders for PDF sources inside `<MediaViewer>`.\n *\n * ```tsx\n * <PdfViewer src=\"\/report.pdf\" title=\"report.pdf\" style={{ height: 600 }} \/>\n * ```\n *\/\nexport const PdfViewer = forwardRef<HTMLDivElement, PdfViewerProps>(\n  ({ src, title = \"PDF document\", className, style }, ref) => {\n    return (\n      <div\n        ref={ref}\n        data-react-fancy-pdf-viewer=\"\"\n        className={cn(\n          \"relative h-full min-h-[20rem] w-full overflow-hidden rounded-md bg-zinc-100 dark:bg-zinc-900\",\n          className,\n        )}\n        style={style}\n      >\n        <object data={src} type=\"application\/pdf\" className=\"h-full w-full\">\n          <iframe\n            src={src}\n            title={title}\n            className=\"h-full w-full border-0\"\n          \/>\n          <div className=\"flex h-full flex-col items-center justify-center gap-2 p-4 text-center text-sm text-zinc-500 dark:text-zinc-400\">\n            <span>This browser can&apos;t display the PDF inline.<\/span>\n            <a\n              href={src}\n              download\n              className=\"font-medium text-blue-600 hover:underline dark:text-blue-400\"\n            >\n              Download PDF\n            <\/a>\n          <\/div>\n        <\/object>\n      <\/div>\n    );\n  },\n);\n\nPdfViewer.displayName = \"PdfViewer\";\n","type":"registry:ui","target":"components\/fancy\/pdf-viewer\/PdfViewer.tsx"},{"path":"components\/fancy\/pdf-viewer\/PdfViewer.types.ts","content":"import type { CSSProperties } from \"react\";\n\nexport interface PdfViewerProps {\n  \/** PDF source \u2014 an `http(s):`, `data:`, or `blob:` URL. *\/\n  src: string;\n  \/** Accessible title for the embedded document (default `\"PDF document\"`). *\/\n  title?: string;\n  \/** Additional CSS classes for the container. *\/\n  className?: string;\n  \/** Inline styles for the container (e.g. a fixed height). *\/\n  style?: CSSProperties;\n}\n","type":"registry:ui","target":"components\/fancy\/pdf-viewer\/PdfViewer.types.ts"},{"path":"components\/fancy\/pdf-viewer\/index.ts","content":"export { PdfViewer } from \".\/PdfViewer\";\nexport type { PdfViewerProps } from \".\/PdfViewer.types\";\n","type":"registry:ui","target":"components\/fancy\/pdf-viewer\/index.ts"}]}