Skip to content

armgit / pdfcn

Public Imported from GitHub
0

Beautiful pdf components, built on Takumi and Forme. 100% Free, Zero config, one command setup.

Add dual-base pdfcn registry with Takumi and Forme parity.

Aniket-508871c9ca7dd95
diff --git a/.gitignore b/.gitignore
index c7f284b..54468ae 100644
--- a/.gitignore
+++ b/.gitignore
@@ -44,4 +44,5 @@ next-env.d.ts
# generated content
.contentlayer
.content-collections
-.source
\ No newline at end of file
+.source
+.pdfx-ref/
diff --git a/README.md b/README.md
index 1653b22..bbf1551 100644
--- a/README.md
+++ b/README.md
@@ -1,97 +1,47 @@
<p align="center">
- <img src="https://startercn.vercel.app/og" alt="startercn banner" />
+ <img src="https://pdfcn.vercel.app/og" alt="pdfcn banner" />
</p>
-<h1 align="center">startercn</h1>
+<h1 align="center">pdfcn</h1>
<p align="center">
- A template for building and publishing your own custom shadcn registry components. Includes documentation, landing page, and everything you need to deploy your component registry.
+ A shadcn registry of PDF components for <strong>Takumi PDF</strong> and <strong>Forme PDF</strong> — invoices, reports, tables, and primitives with live PDF preview.
<br />
<br />
- <a href="https://github.com/shadcn-labs/startercn"><img src="https://www.shieldcn.dev/github/stars/shadcn-labs/startercn.svg?variant=secondary&size=xs&theme=zinc" alt="GitHub Stars" /></a>
- <a href="https://github.com/shadcn-labs/startercn/actions"><img src="https://www.shieldcn.dev/github/ci/shadcn-labs/startercn.svg?variant=secondary&size=xs&theme=zinc" alt="CI" /></a>
- <a href="https://discord.com/invite/N6G36KhYK4"><img src="https://www.shieldcn.dev/discord/online-members/N6G36KhYK4.svg?variant=secondary&size=xs&theme=zinc" alt="Discord Members" /></a>
- <a href="https://x.com/shadcnlabs"><img src="https://www.shieldcn.dev/x/follow/shadcnlabs.svg?variant=branded&size=xs&theme=zinc" alt="X Follow" /></a>
+ 100% catalog parity with <a href="https://github.com/akii09/pdfx">pdfx</a> across both bases.
</p>
-## Features
+## Bases
-- 📦 **Ready-to-use template** - Fork and start building immediately
-- 📚 **Documentation site** - Beautiful docs powered by Fumadocs
-- 🎨 **Shadcn registry compatible** - Works with `npx shadcn add`
-- 🤖 **[Agent ready](https://www.mintlify.com/score/startercn)** - Includes `llms.txt`, `llms-full.txt`, agent skills discovery routes, and API catalog endpoints
-- 🔊 **[Web audio feedback](https://audio.raphaelsalaja.com/)** - Built-in sound effects powered by `@web-kits/audio`
-- 📳 **[Web haptics](https://haptics.lochie.me/)** - Optional haptic feedback hooks for supported devices via `web-haptics`
-- ✨ **[Motion animations](https://motion.dev/)** - `motion`-powered UI polish for copy states, text transitions, and interactive elements
-- 🎯 **[Animated icons](https://lucide-animated.com/)** - Reusable animated icons for navigation, sharing, sponsorship, and CTAs
-- 🔄 **[View transitions](https://nextjs.org/docs/app/api-reference/config/next-config-js/viewTransition)** - Next.js view transitions enabled for smoother navigation between pages
-- 🚀 **Deploy ready** - Deploy anywhere
+| Base | Generate | Browser preview |
+| -------- | --------------------------------------------------------- | --------------------------------------------------- |
+| `takumi` | [`takumi-pdf`](https://takumi.kane.tw/docs/pdf) | [react-pdf](https://github.com/wojtekmaj/react-pdf) |
+| `forme` | [`@formepdf/react`](https://docs.formepdf.com/quickstart) | `@formepdf/core` / browser |
-## Built In
-
-- `Next.js 16` with the App Router
-- `React 19` and `TypeScript`
-- `Tailwind CSS 4`
-- `Fumadocs` for documentation
-- `shiki` + `rehype-pretty-code` for code blocks
-- `sonner` for toasts
-- `radix-ui` + `vaul` for accessible primitives
-- `@vercel/analytics` for analytics
-
-## Quick Start
-
-1. **Use this template** - Click "Use this template" on GitHub
-
-2. **Install dependencies**:
+## Install
```bash
-pnpm install
+npx shadcn@latest add @pdfcn/takumi/text
+npx shadcn@latest add @pdfcn/forme/invoice-minimal
```
-3. **Replace the placeholder component** at `registry/new-york/your-component.tsx`
-
-4. **Update `registry.json`** with your component details
-
-5. **Build the registry**:
+## Develop
```bash
+pnpm install
pnpm registry:build
-```
-
-6. **Start development**:
-
-```bash
pnpm dev
```
-7. **Deploy** and share your component!
-
-## Usage
-
-Once deployed, users can install your component with:
+## Structure
-```bash
-npx shadcn@latest add https://your-domain.com/r/your-component.json
```
-
-## Project Structure
-
+registry/
+ bases/
+ takumi/ # components, blocks, lib
+ forme/ # same catalog
+ themes/ # shared PdfcnTheme tokens
+examples/
+ takumi/
+ forme/
```
-├── registry/
-│ └── new-york/ # Your components go here
-│ └── your-component.tsx
-├── registry.json # Component registry manifest
-├── content/docs/ # Documentation (MDX)
-├── app/ # Next.js app
-└── public/r/ # Built registry files (auto-generated)
-```
-
-## Scripts
-
-- `pnpm dev` - Start development server
-- `pnpm build` - Build for production
-- `pnpm registry:build` - Rebuild the component registry
-
-## License
-
-[MIT](./LICENSE)
diff --git a/app/(app)/(root)/page.tsx b/app/(app)/(root)/page.tsx
index c22d4a0..951e1fd 100644
--- a/app/(app)/(root)/page.tsx
+++ b/app/(app)/(root)/page.tsx
@@ -1,8 +1,8 @@
import { CommandBox } from "@/components/command-box";
import { HomeCtas } from "@/components/home-ctas";
import { PageTransition } from "@/components/page-transition";
+import { PdfPreview } from "@/components/pdf-preview";
import { ROUTES } from "@/constants/routes";
-import { YourComponent } from "@/registry/new-york/your-component";
import { BreadcrumbJsonLd } from "@/seo/json-ld";
export const dynamic = "force-static";
@@ -15,13 +15,17 @@ export default function IndexPage() {
<PageTransition>
<section className="container-wrapper relative">
<div className="container flex flex-col items-center gap-4 py-16 text-center md:py-20 lg:py-24">
- <h1 className="max-w-7xl text-4xl font-bold tracking-tight sm:text-5xl md:text-6xl from-foreground via-foreground to-foreground/65 bg-linear-to-b bg-clip-text text-transparent">
- startercn
+ <h1 className="max-w-7xl bg-linear-to-b from-foreground via-foreground to-foreground/65 bg-clip-text text-4xl font-bold tracking-tight text-transparent sm:text-5xl md:text-6xl">
+ pdfcn
</h1>
<p className="max-w-2xl text-lg text-muted-foreground sm:text-xl">
- A starter kit for building and publishing your own shadcn registry
- components. Fork, customize, and deploy.
+ PDF components for Takumi and Forme — invoices, reports, and
+ primitives with live preview. Install with{" "}
+ <code className="rounded bg-muted px-1.5 py-0.5 text-sm">
+ npx shadcn add
+ </code>
+ .
</p>
<CommandBox className="mt-4 w-full max-w-xl" />
@@ -32,7 +36,11 @@ export default function IndexPage() {
<section className="container-wrapper pb-8 lg:pb-12">
<div className="container flex flex-col items-center gap-6">
- <YourComponent className="w-full max-w-md" />
+ <PdfPreview
+ base="takumi"
+ className="w-full max-w-2xl"
+ name="invoice-minimal"
+ />
</div>
</section>
</PageTransition>
diff --git a/app/api/pdf/forme/route.tsx b/app/api/pdf/forme/route.tsx
new file mode 100644
index 0000000..7ddc849
--- /dev/null
+++ b/app/api/pdf/forme/route.tsx
@@ -0,0 +1,27 @@
+import { renderDocument } from "@formepdf/core";
+
+import { demos } from "@/examples/__index__";
+
+export async function GET(request: Request) {
+ const { searchParams } = new URL(request.url);
+ const name = searchParams.get("name");
+
+ if (!name || !(name in demos.forme)) {
+ return new Response(`Unknown demo: ${name}`, { status: 404 });
+ }
+
+ try {
+ const Demo = demos.forme[name as keyof typeof demos.forme];
+ const pdfBytes = await renderDocument(<Demo />);
+
+ return new Response(Buffer.from(pdfBytes), {
+ headers: {
+ "Cache-Control": "no-store",
+ "Content-Type": "application/pdf",
+ },
+ });
+ } catch (error) {
+ const message = error instanceof Error ? error.message : "Render failed";
+ return new Response(message, { status: 500 });
+ }
+}
diff --git a/app/api/pdf/takumi/route.tsx b/app/api/pdf/takumi/route.tsx
new file mode 100644
index 0000000..fefbe29
--- /dev/null
+++ b/app/api/pdf/takumi/route.tsx
@@ -0,0 +1,32 @@
+import { googleFonts } from "@takumi-rs/helpers";
+import { render } from "takumi-pdf";
+
+import { demos } from "@/examples/__index__";
+
+export async function GET(request: Request) {
+ const { searchParams } = new URL(request.url);
+ const name = searchParams.get("name");
+
+ if (!name || !(name in demos.takumi)) {
+ return new Response(`Unknown demo: ${name}`, { status: 404 });
+ }
+
+ try {
+ const Demo = demos.takumi[name as keyof typeof demos.takumi];
+ const pdf = await render(<Demo />, {
+ fonts: await googleFonts(["Inter", "Times New Roman"]),
+ margin: { bottom: 48, left: 48, right: 48, top: 48 },
+ size: "a4",
+ });
+
+ return new Response(Buffer.from(pdf), {
+ headers: {
+ "Cache-Control": "no-store",
+ "Content-Type": "application/pdf",
+ },
+ });
+ } catch (error) {
+ const message = error instanceof Error ? error.message : "Render failed";
+ return new Response(message, { status: 500 });
+ }
+}
diff --git a/app/og/docs/[...slug]/route.tsx b/app/og/docs/[...slug]/route.tsx
index 553ad38..53d8410 100644
--- a/app/og/docs/[...slug]/route.tsx
+++ b/app/og/docs/[...slug]/route.tsx
@@ -8,7 +8,7 @@ export const revalidate = false;
export const GET = async (
_req: Request,
- { params }: RouteContext<"/og/docs/[...slug]">
+ { params }: { params: Promise<{ slug: string[] }> }
) => {
const { slug } = await params;
const page = source.getPage(slug.slice(0, -1));
diff --git a/components.json b/components.json
index 4ee62ee..6f1f2f3 100644
--- a/components.json
+++ b/components.json
@@ -17,5 +17,8 @@
"lib": "@/lib",
"hooks": "@/hooks"
},
- "iconLibrary": "lucide"
+ "iconLibrary": "lucide",
+ "registries": {
+ "@pdfcn": "https://pdfcn.vercel.app/r/{name}.json"
+ }
}
diff --git a/components/pdf-preview.tsx b/components/pdf-preview.tsx
new file mode 100644
index 0000000..112562b
--- /dev/null
+++ b/components/pdf-preview.tsx
@@ -0,0 +1,132 @@
+"use client";
+
+import { useEffect, useState } from "react";
+import { Document, Page, pdfjs } from "react-pdf";
+
+import { cn } from "@/lib/utils";
+import type { BaseName } from "@/registry/bases";
+
+import "react-pdf/dist/Page/AnnotationLayer.css";
+import "react-pdf/dist/Page/TextLayer.css";
+
+pdfjs.GlobalWorkerOptions.workerSrc = new URL(
+ "pdfjs-dist/build/pdf.worker.min.mjs",
+ import.meta.url
+).toString();
+
+interface PdfPreviewProps {
+ base: BaseName;
+ name: string;
+ className?: string;
+ height?: number;
+}
+
+export function PdfPreview({
+ base,
+ name,
+ className,
+ height = 640,
+}: PdfPreviewProps) {
+ const [data, setData] = useState<Uint8Array | null>(null);
+ const [error, setError] = useState<string | null>(null);
+ const [numPages, setNumPages] = useState(0);
+ const [page, setPage] = useState(1);
+
+ useEffect(() => {
+ let cancelled = false;
+ setData(null);
+ setError(null);
+ setPage(1);
+
+ (async () => {
+ try {
+ if (base === "takumi") {
+ const res = await fetch(
+ `/api/pdf/takumi?name=${encodeURIComponent(name)}`
+ );
+ if (!res.ok) {
+ throw new Error(await res.text());
+ }
+ const buf = new Uint8Array(await res.arrayBuffer());
+ if (!cancelled) {
+ setData(buf);
+ }
+ return;
+ }
+
+ const res = await fetch(
+ `/api/pdf/forme?name=${encodeURIComponent(name)}`
+ );
+ if (!res.ok) {
+ throw new Error(await res.text());
+ }
+ const buf = new Uint8Array(await res.arrayBuffer());
+ if (!cancelled) {
+ setData(buf);
+ }
+ } catch (error) {
+ if (!cancelled) {
+ setError(
+ error instanceof Error ? error.message : "Failed to render PDF"
+ );
+ }
+ }
+ })();
+
+ return () => {
+ cancelled = true;
+ };
+ }, [base, name]);
+
+ return (
+ <div
+ className={cn("overflow-hidden rounded-lg border bg-muted/30", className)}
+ style={{ minHeight: height }}
+ >
+ {error && (
+ <div className="flex h-full items-center justify-center p-8 text-sm text-muted-foreground">
+ {error}
+ </div>
+ )}
+ {!error && !data && (
+ <div className="flex h-full items-center justify-center p-8 text-sm text-muted-foreground">
+ Rendering PDF…
+ </div>
+ )}
+ {data && (
+ <div className="flex flex-col items-center gap-3 p-4">
+ <Document
+ file={{ data }}
+ onLoadSuccess={({ numPages: n }) => setNumPages(n)}
+ loading={null}
+ >
+ <Page pageNumber={page} width={560} />
+ </Document>
+ {numPages > 1 && (
+ <div className="flex items-center gap-3 text-sm">
+ <button
+ type="button"
+ className="rounded border px-2 py-1 disabled:opacity-40"
+ disabled={page <= 1}
+ onClick={() => setPage((p) => Math.max(1, p - 1))}
+ >
+ Prev
+ </button>
+ <span>
+ {page} / {numPages}
+ </span>
+ <button
+ type="button"
+ className="rounded border px-2 py-1 disabled:opacity-40"
+ disabled={page >= numPages}
+ onClick={() => setPage((p) => Math.min(numPages, p + 1))}
+ >
+ Next
+ </button>
+ </div>
+ )}
+ </div>
+ )}
+ </div>
+ );
+}
diff --git a/constants/site.ts b/constants/site.ts
index fc6fc64..70c4c73 100644
--- a/constants/site.ts
+++ b/constants/site.ts
@@ -1,4 +1,4 @@
-export const FALLBACK_SITE_ORIGIN = "https://startercn.vercel.app" as const;
+export const FALLBACK_SITE_ORIGIN = "https://pdfcn.vercel.app" as const;
const getBaseUrl = () => {
if (process.env.NODE_ENV !== "production") {
@@ -20,19 +20,19 @@ export const SITE = {
TWITTER: "@alaymanguy",
},
DESCRIPTION: {
- LONG: "A starter kit for building and publishing your own shadcn registry components.",
- SHORT: "Build your own shadcn registry",
+ LONG: "A shadcn registry of PDF components for Takumi PDF and Forme PDF — invoices, reports, tables, and primitives with live PDF preview.",
+ SHORT: "PDF component registry for Takumi and Forme",
},
KEYWORDS: [
"shadcn",
"shadcn registry",
- "component registry",
- "shadcn components",
- "next.js",
- "tailwindcss",
+ "pdf components",
+ "takumi-pdf",
+ "forme pdf",
+ "react pdf",
"npx shadcn add",
] as const,
- NAME: "startercn",
+ NAME: "pdfcn",
OG_IMAGE: `${baseUrl}/og`,
REGISTRY: baseUrl,
URL: baseUrl,
diff --git a/content/docs/(root)/bases.mdx b/content/docs/(root)/bases.mdx
new file mode 100644
index 0000000..c52b3b1
--- /dev/null
+++ b/content/docs/(root)/bases.mdx
@@ -0,0 +1,13 @@
+---
+title: Bases
+description: Takumi and Forme registry bases.
+---
+
+# Bases
+
+| Base | Generate | Preview |
+| -------- | ------------------------------------ | --------------------------- |
+| `takumi` | `takumi-pdf` | `react-pdf` (wojtekmaj) |
+| `forme` | `@formepdf/react` + `@formepdf/core` | Forme browser/server render |
+
+Install namespaced items: `@pdfcn/takumi/<name>` or `@pdfcn/forme/<name>`.
diff --git a/content/docs/(root)/index.mdx b/content/docs/(root)/index.mdx
index 3fe06da..ae01cf3 100644
--- a/content/docs/(root)/index.mdx
+++ b/content/docs/(root)/index.mdx
@@ -1,81 +1,22 @@
---
title: Introduction
-description: A template for building and publishing your own shadcn registry components.
+description: pdfcn is a shadcn registry of PDF components for Takumi PDF and Forme PDF.
---
-A **ready-to-use template** for creating and publishing custom components to the [shadcn registry](https://ui.shadcn.com/docs/registry).
+# pdfcn
-## What You Get
+A registry of PDF primitives, layouts, and document blocks with **100% parity** across two bases:
-- 📦 **Simple structure** - One component file + one config file
-- 📚 **Documentation site** - Powered by Fumadocs
-- 🎨 **Registry compatible** - Works with `npx shadcn add`
-- 🤖 **[Agent ready](https://www.mintlify.com/score/startercn)** - Ships with `llms.txt`, `llms-full.txt`, API catalog routes, and agent skill discovery endpoints
-- 🔊 **[Web audio feedback](https://audio.raphaelsalaja.com/)** - Built-in interaction sounds powered by `@web-kits/audio`
-- 📳 **[Web haptics](https://haptics.lochie.me/)** - Optional haptic feedback for supported devices via `web-haptics`
-- ✨ **[Motion animations](https://motion.dev/)** - Uses `motion` for animated UI states and transitions
-- 🎯 **[Animated icons](https://lucide-animated.com/)** - Includes reusable animated icons for buttons, sharing, and navigation
-- 🔄 **[View transitions](https://nextjs.org/docs/app/api-reference/config/next-config-js/viewTransition)** - Uses Next.js view transitions for smoother page changes
-- 🚀 **Deploy ready** - Deploy anywhere
+- **Takumi PDF** — JSX/Tailwind to paged PDF (WASM). Browser preview via `react-pdf`.
+- **Forme PDF** — React primitives with Forme’s layout engine. Client and server render.
-## Tech Stack
-
-- `Next.js 16` + App Router
-- `React 19`
-- `Tailwind CSS 4`
-- `Fumadocs`
-- `motion`
-- `@web-kits/audio`
-- `web-haptics`
-- `shiki` + `rehype-pretty-code`
-
-## How It Works
-
-1. Edit your component at `registry/new-york/your-component.tsx`
-2. Update `registry.json` with your component name and details
-3. Run `pnpm registry:build`
-
-That's it. Deploy your app and users can install your component:
+## Install
```bash
-npx shadcn@latest add https://your-site.com/r/your-component.json
+npx shadcn@latest add @pdfcn/takumi/text
+npx shadcn@latest add @pdfcn/forme/invoice-minimal
```
-## FAQ
-
-<Accordion type="multiple">
-
-<AccordionItem value="faq-1">
-<AccordionTrigger>
-Why copy/paste instead of npm packages?
-</AccordionTrigger>
-<AccordionContent>
-
-The shadcn philosophy gives you **ownership** of the code. You can customize components to your exact needs without fighting library constraints.
-
-</AccordionContent>
-</AccordionItem>
-
-<AccordionItem value="faq-2">
-<AccordionTrigger>
-Which frameworks are supported?
-</AccordionTrigger>
-<AccordionContent>
-
-Any React framework: Next.js, Remix, Astro, Gatsby, Vite, etc.
-
-</AccordionContent>
-</AccordionItem>
-
-<AccordionItem value="faq-3">
-<AccordionTrigger>
-Can I publish multiple components?
-</AccordionTrigger>
-<AccordionContent>
-
-Yes! Add more files to `registry/new-york/` and list them in `registry.json`.
-
-</AccordionContent>
-</AccordionItem>
+## Bases
-</Accordion>
+Switch bases in the docs to see the same component implemented for each engine. Public props and variants match [pdfx](https://github.com/akii09/pdfx) — only the PDF primitives differ.
diff --git a/content/docs/(root)/meta.json b/content/docs/(root)/meta.json
index 2d9af18..8da4046 100644
--- a/content/docs/(root)/meta.json
+++ b/content/docs/(root)/meta.json
@@ -1,4 +1,4 @@
{
"title": "Get Started",
- "pages": ["index", "[Installation](/docs/installation)"]
+ "pages": ["index", "bases"]
}
diff --git a/content/docs/blocks/index.mdx b/content/docs/blocks/index.mdx
new file mode 100644
index 0000000..f39bf53
--- /dev/null
+++ b/content/docs/blocks/index.mdx
@@ -0,0 +1,8 @@
+---
+title: Blocks
+description: Full PDF document templates — invoices and reports.
+---
+
+# Blocks
+
+Invoice and report templates composed from registry components.
diff --git a/content/docs/blocks/invoice-classic.mdx b/content/docs/blocks/invoice-classic.mdx
new file mode 100644
index 0000000..51e2128
--- /dev/null
+++ b/content/docs/blocks/invoice-classic.mdx
@@ -0,0 +1,24 @@
+---
+title: Invoice Classic
+description: Invoice Classic PDF block for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Invoice Classic
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/invoice-classic
+```
+
+<PdfPreview base="takumi" name="invoice-classic" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/invoice-classic
+```
+
+<PdfPreview base="forme" name="invoice-classic" />
diff --git a/content/docs/blocks/invoice-consultant.mdx b/content/docs/blocks/invoice-consultant.mdx
new file mode 100644
index 0000000..05e8959
--- /dev/null
+++ b/content/docs/blocks/invoice-consultant.mdx
@@ -0,0 +1,24 @@
+---
+title: Invoice Consultant
+description: Invoice Consultant PDF block for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Invoice Consultant
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/invoice-consultant
+```
+
+<PdfPreview base="takumi" name="invoice-consultant" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/invoice-consultant
+```
+
+<PdfPreview base="forme" name="invoice-consultant" />
diff --git a/content/docs/blocks/invoice-corporate.mdx b/content/docs/blocks/invoice-corporate.mdx
new file mode 100644
index 0000000..a6c0191
--- /dev/null
+++ b/content/docs/blocks/invoice-corporate.mdx
@@ -0,0 +1,24 @@
+---
+title: Invoice Corporate
+description: Invoice Corporate PDF block for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Invoice Corporate
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/invoice-corporate
+```
+
+<PdfPreview base="takumi" name="invoice-corporate" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/invoice-corporate
+```
+
+<PdfPreview base="forme" name="invoice-corporate" />
diff --git a/content/docs/blocks/invoice-creative.mdx b/content/docs/blocks/invoice-creative.mdx
new file mode 100644
index 0000000..34978fb
--- /dev/null
+++ b/content/docs/blocks/invoice-creative.mdx
@@ -0,0 +1,24 @@
+---
+title: Invoice Creative
+description: Invoice Creative PDF block for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Invoice Creative
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/invoice-creative
+```
+
+<PdfPreview base="takumi" name="invoice-creative" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/invoice-creative
+```
+
+<PdfPreview base="forme" name="invoice-creative" />
diff --git a/content/docs/blocks/invoice-minimal.mdx b/content/docs/blocks/invoice-minimal.mdx
new file mode 100644
index 0000000..463c0df
--- /dev/null
+++ b/content/docs/blocks/invoice-minimal.mdx
@@ -0,0 +1,24 @@
+---
+title: Invoice Minimal
+description: Invoice Minimal PDF block for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Invoice Minimal
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/invoice-minimal
+```
+
+<PdfPreview base="takumi" name="invoice-minimal" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/invoice-minimal
+```
+
+<PdfPreview base="forme" name="invoice-minimal" />
diff --git a/content/docs/blocks/invoice-modern.mdx b/content/docs/blocks/invoice-modern.mdx
new file mode 100644
index 0000000..aa26eef
--- /dev/null
+++ b/content/docs/blocks/invoice-modern.mdx
@@ -0,0 +1,24 @@
+---
+title: Invoice Modern
+description: Invoice Modern PDF block for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Invoice Modern
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/invoice-modern
+```
+
+<PdfPreview base="takumi" name="invoice-modern" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/invoice-modern
+```
+
+<PdfPreview base="forme" name="invoice-modern" />
diff --git a/content/docs/blocks/meta.json b/content/docs/blocks/meta.json
new file mode 100644
index 0000000..f9fcefa
--- /dev/null
+++ b/content/docs/blocks/meta.json
@@ -0,0 +1,16 @@
+{
+ "title": "Blocks",
+ "pages": [
+ "index",
+ "invoice-classic",
+ "invoice-consultant",
+ "invoice-corporate",
+ "invoice-creative",
+ "invoice-minimal",
+ "invoice-modern",
+ "report-financial",
+ "report-marketing",
+ "report-operations",
+ "report-security"
+ ]
+}
diff --git a/content/docs/blocks/report-financial.mdx b/content/docs/blocks/report-financial.mdx
new file mode 100644
index 0000000..3701981
--- /dev/null
+++ b/content/docs/blocks/report-financial.mdx
@@ -0,0 +1,24 @@
+---
+title: Report Financial
+description: Report Financial PDF block for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Report Financial
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/report-financial
+```
+
+<PdfPreview base="takumi" name="report-financial" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/report-financial
+```
+
+<PdfPreview base="forme" name="report-financial" />
diff --git a/content/docs/blocks/report-marketing.mdx b/content/docs/blocks/report-marketing.mdx
new file mode 100644
index 0000000..adc368e
--- /dev/null
+++ b/content/docs/blocks/report-marketing.mdx
@@ -0,0 +1,24 @@
+---
+title: Report Marketing
+description: Report Marketing PDF block for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Report Marketing
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/report-marketing
+```
+
+<PdfPreview base="takumi" name="report-marketing" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/report-marketing
+```
+
+<PdfPreview base="forme" name="report-marketing" />
diff --git a/content/docs/blocks/report-operations.mdx b/content/docs/blocks/report-operations.mdx
new file mode 100644
index 0000000..1636748
--- /dev/null
+++ b/content/docs/blocks/report-operations.mdx
@@ -0,0 +1,24 @@
+---
+title: Report Operations
+description: Report Operations PDF block for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Report Operations
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/report-operations
+```
+
+<PdfPreview base="takumi" name="report-operations" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/report-operations
+```
+
+<PdfPreview base="forme" name="report-operations" />
diff --git a/content/docs/blocks/report-security.mdx b/content/docs/blocks/report-security.mdx
new file mode 100644
index 0000000..2306fbc
--- /dev/null
+++ b/content/docs/blocks/report-security.mdx
@@ -0,0 +1,24 @@
+---
+title: Report Security
+description: Report Security PDF block for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Report Security
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/report-security
+```
+
+<PdfPreview base="takumi" name="report-security" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/report-security
+```
+
+<PdfPreview base="forme" name="report-security" />
diff --git a/content/docs/components/alert.mdx b/content/docs/components/alert.mdx
new file mode 100644
index 0000000..b5f1b41
--- /dev/null
+++ b/content/docs/components/alert.mdx
@@ -0,0 +1,24 @@
+---
+title: Alert
+description: Alert PDF component for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Alert
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/alert
+```
+
+<PdfPreview base="takumi" name="alert" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/alert
+```
+
+<PdfPreview base="forme" name="alert" />
diff --git a/content/docs/components/badge.mdx b/content/docs/components/badge.mdx
new file mode 100644
index 0000000..fdf15ca
--- /dev/null
+++ b/content/docs/components/badge.mdx
@@ -0,0 +1,24 @@
+---
+title: Badge
+description: Badge PDF component for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Badge
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/badge
+```
+
+<PdfPreview base="takumi" name="badge" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/badge
+```
+
+<PdfPreview base="forme" name="badge" />
diff --git a/content/docs/components/card.mdx b/content/docs/components/card.mdx
new file mode 100644
index 0000000..fba8206
--- /dev/null
+++ b/content/docs/components/card.mdx
@@ -0,0 +1,24 @@
+---
+title: Card
+description: Card PDF component for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Card
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/card
+```
+
+<PdfPreview base="takumi" name="card" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/card
+```
+
+<PdfPreview base="forme" name="card" />
diff --git a/content/docs/components/data-table.mdx b/content/docs/components/data-table.mdx
new file mode 100644
index 0000000..831a784
--- /dev/null
+++ b/content/docs/components/data-table.mdx
@@ -0,0 +1,24 @@
+---
+title: Data Table
+description: Data Table PDF component for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Data Table
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/data-table
+```
+
+<PdfPreview base="takumi" name="data-table" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/data-table
+```
+
+<PdfPreview base="forme" name="data-table" />
diff --git a/content/docs/components/divider.mdx b/content/docs/components/divider.mdx
new file mode 100644
index 0000000..c7b87ec
--- /dev/null
+++ b/content/docs/components/divider.mdx
@@ -0,0 +1,24 @@
+---
+title: Divider
+description: Divider PDF component for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Divider
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/divider
+```
+
+<PdfPreview base="takumi" name="divider" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/divider
+```
+
+<PdfPreview base="forme" name="divider" />
diff --git a/content/docs/components/form.mdx b/content/docs/components/form.mdx
new file mode 100644
index 0000000..34a85f1
--- /dev/null
+++ b/content/docs/components/form.mdx
@@ -0,0 +1,24 @@
+---
+title: Form
+description: Form PDF component for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Form
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/form
+```
+
+<PdfPreview base="takumi" name="form" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/form
+```
+
+<PdfPreview base="forme" name="form" />
diff --git a/content/docs/components/graph.mdx b/content/docs/components/graph.mdx
new file mode 100644
index 0000000..2cc3380
--- /dev/null
+++ b/content/docs/components/graph.mdx
@@ -0,0 +1,24 @@
+---
+title: Graph
+description: Graph PDF component for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Graph
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/graph
+```
+
+<PdfPreview base="takumi" name="graph" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/graph
+```
+
+<PdfPreview base="forme" name="graph" />
diff --git a/content/docs/components/heading.mdx b/content/docs/components/heading.mdx
new file mode 100644
index 0000000..aae376e
--- /dev/null
+++ b/content/docs/components/heading.mdx
@@ -0,0 +1,24 @@
+---
+title: Heading
+description: Heading PDF component for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Heading
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/heading
+```
+
+<PdfPreview base="takumi" name="heading" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/heading
+```
+
+<PdfPreview base="forme" name="heading" />
diff --git a/content/docs/components/index.mdx b/content/docs/components/index.mdx
index 7179dbc..9de235c 100644
--- a/content/docs/components/index.mdx
+++ b/content/docs/components/index.mdx
@@ -1,6 +1,8 @@
---
title: Components
-description: Browse the components available in this registry.
+description: PDF UI primitives available on both Takumi and Forme bases.
---
-<ComponentsList />
+# Components
+
+Every component exists for both `takumi` and `forme` with matching props.
diff --git a/content/docs/components/keep-together.mdx b/content/docs/components/keep-together.mdx
new file mode 100644
index 0000000..e9b4506
--- /dev/null
+++ b/content/docs/components/keep-together.mdx
@@ -0,0 +1,24 @@
+---
+title: Keep Together
+description: Keep Together PDF component for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Keep Together
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/keep-together
+```
+
+<PdfPreview base="takumi" name="keep-together" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/keep-together
+```
+
+<PdfPreview base="forme" name="keep-together" />
diff --git a/content/docs/components/key-value.mdx b/content/docs/components/key-value.mdx
new file mode 100644
index 0000000..9a798c9
--- /dev/null
+++ b/content/docs/components/key-value.mdx
@@ -0,0 +1,24 @@
+---
+title: Key Value
+description: Key Value PDF component for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Key Value
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/key-value
+```
+
+<PdfPreview base="takumi" name="key-value" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/key-value
+```
+
+<PdfPreview base="forme" name="key-value" />
diff --git a/content/docs/components/link.mdx b/content/docs/components/link.mdx
new file mode 100644
index 0000000..896cb91
--- /dev/null
+++ b/content/docs/components/link.mdx
@@ -0,0 +1,24 @@
+---
+title: Link
+description: Link PDF component for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Link
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/link
+```
+
+<PdfPreview base="takumi" name="link" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/link
+```
+
+<PdfPreview base="forme" name="link" />
diff --git a/content/docs/components/list.mdx b/content/docs/components/list.mdx
new file mode 100644
index 0000000..49c357f
--- /dev/null
+++ b/content/docs/components/list.mdx
@@ -0,0 +1,24 @@
+---
+title: List
+description: List PDF component for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# List
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/list
+```
+
+<PdfPreview base="takumi" name="list" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/list
+```
+
+<PdfPreview base="forme" name="list" />
diff --git a/content/docs/components/meta.json b/content/docs/components/meta.json
index aef6c05..24b049a 100644
--- a/content/docs/components/meta.json
+++ b/content/docs/components/meta.json
@@ -1,4 +1,30 @@
{
"title": "Components",
- "pages": ["index", "your-component"]
+ "pages": [
+ "index",
+ "alert",
+ "badge",
+ "card",
+ "data-table",
+ "divider",
+ "form",
+ "graph",
+ "heading",
+ "keep-together",
+ "key-value",
+ "link",
+ "list",
+ "page-break",
+ "page-footer",
+ "page-header",
+ "page-number",
+ "pdf-image",
+ "qrcode",
+ "section",
+ "signature",
+ "stack",
+ "table",
+ "text",
+ "watermark"
+ ]
}
diff --git a/content/docs/components/page-break.mdx b/content/docs/components/page-break.mdx
new file mode 100644
index 0000000..3c09ed2
--- /dev/null
+++ b/content/docs/components/page-break.mdx
@@ -0,0 +1,24 @@
+---
+title: Page Break
+description: Page Break PDF component for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Page Break
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/page-break
+```
+
+<PdfPreview base="takumi" name="page-break" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/page-break
+```
+
+<PdfPreview base="forme" name="page-break" />
diff --git a/content/docs/components/page-footer.mdx b/content/docs/components/page-footer.mdx
new file mode 100644
index 0000000..d271a53
--- /dev/null
+++ b/content/docs/components/page-footer.mdx
@@ -0,0 +1,24 @@
+---
+title: Page Footer
+description: Page Footer PDF component for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Page Footer
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/page-footer
+```
+
+<PdfPreview base="takumi" name="page-footer" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/page-footer
+```
+
+<PdfPreview base="forme" name="page-footer" />
diff --git a/content/docs/components/page-header.mdx b/content/docs/components/page-header.mdx
new file mode 100644
index 0000000..9e458db
--- /dev/null
+++ b/content/docs/components/page-header.mdx
@@ -0,0 +1,24 @@
+---
+title: Page Header
+description: Page Header PDF component for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Page Header
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/page-header
+```
+
+<PdfPreview base="takumi" name="page-header" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/page-header
+```
+
+<PdfPreview base="forme" name="page-header" />
diff --git a/content/docs/components/page-number.mdx b/content/docs/components/page-number.mdx
new file mode 100644
index 0000000..ddfa44c
--- /dev/null
+++ b/content/docs/components/page-number.mdx
@@ -0,0 +1,24 @@
+---
+title: Page Number
+description: Page Number PDF component for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Page Number
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/page-number
+```
+
+<PdfPreview base="takumi" name="page-number" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/page-number
+```
+
+<PdfPreview base="forme" name="page-number" />
diff --git a/content/docs/components/pdf-image.mdx b/content/docs/components/pdf-image.mdx
new file mode 100644
index 0000000..0ee1ede
--- /dev/null
+++ b/content/docs/components/pdf-image.mdx
@@ -0,0 +1,24 @@
+---
+title: Pdf Image
+description: Pdf Image PDF component for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Pdf Image
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/pdf-image
+```
+
+<PdfPreview base="takumi" name="pdf-image" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/pdf-image
+```
+
+<PdfPreview base="forme" name="pdf-image" />
diff --git a/content/docs/components/qrcode.mdx b/content/docs/components/qrcode.mdx
new file mode 100644
index 0000000..e048e00
--- /dev/null
+++ b/content/docs/components/qrcode.mdx
@@ -0,0 +1,24 @@
+---
+title: Qrcode
+description: Qrcode PDF component for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Qrcode
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/qrcode
+```
+
+<PdfPreview base="takumi" name="qrcode" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/qrcode
+```
+
+<PdfPreview base="forme" name="qrcode" />
diff --git a/content/docs/components/section.mdx b/content/docs/components/section.mdx
new file mode 100644
index 0000000..a58d1bf
--- /dev/null
+++ b/content/docs/components/section.mdx
@@ -0,0 +1,24 @@
+---
+title: Section
+description: Section PDF component for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Section
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/section
+```
+
+<PdfPreview base="takumi" name="section" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/section
+```
+
+<PdfPreview base="forme" name="section" />
diff --git a/content/docs/components/signature.mdx b/content/docs/components/signature.mdx
new file mode 100644
index 0000000..bfba0d5
--- /dev/null
+++ b/content/docs/components/signature.mdx
@@ -0,0 +1,24 @@
+---
+title: Signature
+description: Signature PDF component for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Signature
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/signature
+```
+
+<PdfPreview base="takumi" name="signature" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/signature
+```
+
+<PdfPreview base="forme" name="signature" />
diff --git a/content/docs/components/stack.mdx b/content/docs/components/stack.mdx
new file mode 100644
index 0000000..302e562
--- /dev/null
+++ b/content/docs/components/stack.mdx
@@ -0,0 +1,24 @@
+---
+title: Stack
+description: Stack PDF component for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Stack
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/stack
+```
+
+<PdfPreview base="takumi" name="stack" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/stack
+```
+
+<PdfPreview base="forme" name="stack" />
diff --git a/content/docs/components/table.mdx b/content/docs/components/table.mdx
new file mode 100644
index 0000000..522f051
--- /dev/null
+++ b/content/docs/components/table.mdx
@@ -0,0 +1,24 @@
+---
+title: Table
+description: Table PDF component for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Table
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/table
+```
+
+<PdfPreview base="takumi" name="table" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/table
+```
+
+<PdfPreview base="forme" name="table" />
diff --git a/content/docs/components/text.mdx b/content/docs/components/text.mdx
new file mode 100644
index 0000000..36a6ab9
--- /dev/null
+++ b/content/docs/components/text.mdx
@@ -0,0 +1,24 @@
+---
+title: Text
+description: Text PDF component for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Text
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/text
+```
+
+<PdfPreview base="takumi" name="text" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/text
+```
+
+<PdfPreview base="forme" name="text" />
diff --git a/content/docs/components/watermark.mdx b/content/docs/components/watermark.mdx
new file mode 100644
index 0000000..dea80d7
--- /dev/null
+++ b/content/docs/components/watermark.mdx
@@ -0,0 +1,24 @@
+---
+title: Watermark
+description: Watermark PDF component for Takumi and Forme.
+---
+
+import { PdfPreview } from "@/components/pdf-preview";
+
+# Watermark
+
+## Takumi
+
+```bash
+npx shadcn@latest add @pdfcn/takumi/watermark
+```
+
+<PdfPreview base="takumi" name="watermark" />
+
+## Forme
+
+```bash
+npx shadcn@latest add @pdfcn/forme/watermark
+```
+
+<PdfPreview base="forme" name="watermark" />
diff --git a/content/docs/meta.json b/content/docs/meta.json
index 8d47af8..3c949fe 100644
--- a/content/docs/meta.json
+++ b/content/docs/meta.json
@@ -1,4 +1,4 @@
{
- "root": true,
- "pages": ["(root)", "components"]
+ "title": "Documentation",
+ "pages": ["(root)", "components", "blocks"]
}
diff --git a/examples/__index__.ts b/examples/__index__.ts
new file mode 100644
index 0000000..0e8dcb1
--- /dev/null
+++ b/examples/__index__.ts
@@ -0,0 +1,150 @@
+import type { ComponentType } from "react";
+
+import forme_alert from "@/examples/forme/alert";
+import forme_badge from "@/examples/forme/badge";
+import forme_card from "@/examples/forme/card";
+import forme_data_table from "@/examples/forme/data-table";
+import forme_divider from "@/examples/forme/divider";
+import forme_form from "@/examples/forme/form";
+import forme_graph from "@/examples/forme/graph";
+import forme_heading from "@/examples/forme/heading";
+import forme_invoice_classic from "@/examples/forme/invoice-classic";
+import forme_invoice_consultant from "@/examples/forme/invoice-consultant";
+import forme_invoice_corporate from "@/examples/forme/invoice-corporate";
+import forme_invoice_creative from "@/examples/forme/invoice-creative";
+import forme_invoice_minimal from "@/examples/forme/invoice-minimal";
+import forme_invoice_modern from "@/examples/forme/invoice-modern";
+import forme_keep_together from "@/examples/forme/keep-together";
+import forme_key_value from "@/examples/forme/key-value";
+import forme_link from "@/examples/forme/link";
+import forme_list from "@/examples/forme/list";
+import forme_page_break from "@/examples/forme/page-break";
+import forme_page_footer from "@/examples/forme/page-footer";
+import forme_page_header from "@/examples/forme/page-header";
+import forme_page_number from "@/examples/forme/page-number";
+import forme_pdf_image from "@/examples/forme/pdf-image";
+import forme_qrcode from "@/examples/forme/qrcode";
+import forme_report_financial from "@/examples/forme/report-financial";
+import forme_report_marketing from "@/examples/forme/report-marketing";
+import forme_report_operations from "@/examples/forme/report-operations";
+import forme_report_security from "@/examples/forme/report-security";
+import forme_section from "@/examples/forme/section";
+import forme_signature from "@/examples/forme/signature";
+import forme_stack from "@/examples/forme/stack";
+import forme_table from "@/examples/forme/table";
+import forme_text from "@/examples/forme/text";
+import forme_watermark from "@/examples/forme/watermark";
+import takumi_alert from "@/examples/takumi/alert";
+import takumi_badge from "@/examples/takumi/badge";
+import takumi_card from "@/examples/takumi/card";
+import takumi_data_table from "@/examples/takumi/data-table";
+import takumi_divider from "@/examples/takumi/divider";
+import takumi_form from "@/examples/takumi/form";
+import takumi_graph from "@/examples/takumi/graph";
+import takumi_heading from "@/examples/takumi/heading";
+import takumi_invoice_classic from "@/examples/takumi/invoice-classic";
+import takumi_invoice_consultant from "@/examples/takumi/invoice-consultant";
+import takumi_invoice_corporate from "@/examples/takumi/invoice-corporate";
+import takumi_invoice_creative from "@/examples/takumi/invoice-creative";
+import takumi_invoice_minimal from "@/examples/takumi/invoice-minimal";
+import takumi_invoice_modern from "@/examples/takumi/invoice-modern";
+import takumi_keep_together from "@/examples/takumi/keep-together";
+import takumi_key_value from "@/examples/takumi/key-value";
+import takumi_link from "@/examples/takumi/link";
+import takumi_list from "@/examples/takumi/list";
+import takumi_page_break from "@/examples/takumi/page-break";
+import takumi_page_footer from "@/examples/takumi/page-footer";
+import takumi_page_header from "@/examples/takumi/page-header";
+import takumi_page_number from "@/examples/takumi/page-number";
+import takumi_pdf_image from "@/examples/takumi/pdf-image";
+import takumi_qrcode from "@/examples/takumi/qrcode";
+import takumi_report_financial from "@/examples/takumi/report-financial";
+import takumi_report_marketing from "@/examples/takumi/report-marketing";
+import takumi_report_operations from "@/examples/takumi/report-operations";
+import takumi_report_security from "@/examples/takumi/report-security";
+import takumi_section from "@/examples/takumi/section";
+import takumi_signature from "@/examples/takumi/signature";
+import takumi_stack from "@/examples/takumi/stack";
+import takumi_table from "@/examples/takumi/table";
+import takumi_text from "@/examples/takumi/text";
+import takumi_watermark from "@/examples/takumi/watermark";
+import type { BaseName } from "@/registry/bases";
+
+type DemoMap = Record<string, ComponentType>;
+
+export const demos: Record<BaseName, DemoMap> = {
+ forme: {
+ alert: forme_alert,
+ badge: forme_badge,
+ card: forme_card,
+ "data-table": forme_data_table,
+ divider: forme_divider,
+ form: forme_form,
+ graph: forme_graph,
+ heading: forme_heading,
+ "invoice-classic": forme_invoice_classic,
+ "invoice-consultant": forme_invoice_consultant,
+ "invoice-corporate": forme_invoice_corporate,
+ "invoice-creative": forme_invoice_creative,
+ "invoice-minimal": forme_invoice_minimal,
+ "invoice-modern": forme_invoice_modern,
+ "keep-together": forme_keep_together,
+ "key-value": forme_key_value,
+ link: forme_link,
+ list: forme_list,
+ "page-break": forme_page_break,
+ "page-footer": forme_page_footer,
+ "page-header": forme_page_header,
+ "page-number": forme_page_number,
+ "pdf-image": forme_pdf_image,
+ qrcode: forme_qrcode,
+ "report-financial": forme_report_financial,
+ "report-marketing": forme_report_marketing,
+ "report-operations": forme_report_operations,
+ "report-security": forme_report_security,
+ section: forme_section,
+ signature: forme_signature,
+ stack: forme_stack,
+ table: forme_table,
+ text: forme_text,
+ watermark: forme_watermark,
+ },
+ takumi: {
+ alert: takumi_alert,
+ badge: takumi_badge,
+ card: takumi_card,
+ "data-table": takumi_data_table,
+ divider: takumi_divider,
+ form: takumi_form,
+ graph: takumi_graph,
+ heading: takumi_heading,
+ "invoice-classic": takumi_invoice_classic,
+ "invoice-consultant": takumi_invoice_consultant,
+ "invoice-corporate": takumi_invoice_corporate,
+ "invoice-creative": takumi_invoice_creative,
+ "invoice-minimal": takumi_invoice_minimal,
+ "invoice-modern": takumi_invoice_modern,
+ "keep-together": takumi_keep_together,
+ "key-value": takumi_key_value,
+ link: takumi_link,
+ list: takumi_list,
+ "page-break": takumi_page_break,
+ "page-footer": takumi_page_footer,
+ "page-header": takumi_page_header,
+ "page-number": takumi_page_number,
+ "pdf-image": takumi_pdf_image,
+ qrcode: takumi_qrcode,
+ "report-financial": takumi_report_financial,
+ "report-marketing": takumi_report_marketing,
+ "report-operations": takumi_report_operations,
+ "report-security": takumi_report_security,
+ section: takumi_section,
+ signature: takumi_signature,
+ stack: takumi_stack,
+ table: takumi_table,
+ text: takumi_text,
+ watermark: takumi_watermark,
+ },
+};
+
+export type DemoName = string;
diff --git a/examples/forme/alert.tsx b/examples/forme/alert.tsx
new file mode 100644
index 0000000..3534e3c
--- /dev/null
+++ b/examples/forme/alert.tsx
@@ -0,0 +1,24 @@
+import { Document, Page } from "@formepdf/react";
+
+import { PdfAlert } from "@/registry/bases/forme/components/alert";
+import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4" margin={48}>
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return (
+ <PdfAlert variant="info" title="Info">
+ Alert body
+ </PdfAlert>
+ );
+}
diff --git a/examples/forme/badge.tsx b/examples/forme/badge.tsx
new file mode 100644
index 0000000..f94a9c3
--- /dev/null
+++ b/examples/forme/badge.tsx
@@ -0,0 +1,20 @@
+import { Document, Page } from "@formepdf/react";
+
+import { Badge } from "@/registry/bases/forme/components/badge";
+import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4" margin={48}>
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return <Badge>Badge</Badge>;
+}
diff --git a/examples/forme/card.tsx b/examples/forme/card.tsx
new file mode 100644
index 0000000..5fc5a85
--- /dev/null
+++ b/examples/forme/card.tsx
@@ -0,0 +1,20 @@
+import { Document, Page } from "@formepdf/react";
+
+import { PdfCard } from "@/registry/bases/forme/components/card";
+import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4" margin={48}>
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return <PdfCard title="Card">Card body</PdfCard>;
+}
diff --git a/examples/forme/data-table.tsx b/examples/forme/data-table.tsx
new file mode 100644
index 0000000..ba8cf82
--- /dev/null
+++ b/examples/forme/data-table.tsx
@@ -0,0 +1,31 @@
+import { Document, Page } from "@formepdf/react";
+
+import { DataTable } from "@/registry/bases/forme/components/data-table";
+import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4" margin={48}>
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return (
+ <DataTable
+ columns={[
+ { header: "Name", key: "name" },
+ { header: "Price", key: "price" },
+ ]}
+ data={[
+ { name: "Widget", price: "$10" },
+ { name: "Gadget", price: "$20" },
+ ]}
+ />
+ );
+}
diff --git a/examples/forme/divider.tsx b/examples/forme/divider.tsx
new file mode 100644
index 0000000..fbfbc0e
--- /dev/null
+++ b/examples/forme/divider.tsx
@@ -0,0 +1,20 @@
+import { Document, Page } from "@formepdf/react";
+
+import { Divider } from "@/registry/bases/forme/components/divider";
+import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4" margin={48}>
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return <Divider />;
+}
diff --git a/examples/forme/form.tsx b/examples/forme/form.tsx
new file mode 100644
index 0000000..1b69609
--- /dev/null
+++ b/examples/forme/form.tsx
@@ -0,0 +1,25 @@
+import { Document, Page } from "@formepdf/react";
+
+import { PdfForm } from "@/registry/bases/forme/components/form";
+import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4" margin={48}>
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return (
+ <PdfForm
+ title="Contact"
+ groups={[{ fields: [{ label: "Email" }, { label: "Phone" }] }]}
+ />
+ );
+}
diff --git a/examples/forme/graph.tsx b/examples/forme/graph.tsx
new file mode 100644
index 0000000..98cdc16
--- /dev/null
+++ b/examples/forme/graph.tsx
@@ -0,0 +1,29 @@
+import { Document, Page } from "@formepdf/react";
+
+import { PdfGraph } from "@/registry/bases/forme/components/graph";
+import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4" margin={48}>
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return (
+ <PdfGraph
+ variant="bar"
+ data={[
+ { label: "Q1", value: 30 },
+ { label: "Q2", value: 45 },
+ { label: "Q3", value: 28 },
+ ]}
+ />
+ );
+}
diff --git a/examples/forme/heading.tsx b/examples/forme/heading.tsx
new file mode 100644
index 0000000..71a887c
--- /dev/null
+++ b/examples/forme/heading.tsx
@@ -0,0 +1,20 @@
+import { Document, Page } from "@formepdf/react";
+
+import { Heading } from "@/registry/bases/forme/components/heading";
+import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4" margin={48}>
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return <Heading level={1}>Heading</Heading>;
+}
diff --git a/examples/forme/invoice-classic.tsx b/examples/forme/invoice-classic.tsx
new file mode 100644
index 0000000..c995c42
--- /dev/null
+++ b/examples/forme/invoice-classic.tsx
@@ -0,0 +1,5 @@
+import { InvoiceClassicDocument } from "@/registry/bases/forme/blocks/invoice-classic/invoice-classic";
+
+export default function Demo() {
+ return <InvoiceClassicDocument />;
+}
diff --git a/examples/forme/invoice-consultant.tsx b/examples/forme/invoice-consultant.tsx
new file mode 100644
index 0000000..d28588d
--- /dev/null
+++ b/examples/forme/invoice-consultant.tsx
@@ -0,0 +1,5 @@
+import { InvoiceConsultantDocument } from "@/registry/bases/forme/blocks/invoice-consultant/invoice-consultant";
+
+export default function Demo() {
+ return <InvoiceConsultantDocument />;
+}
diff --git a/examples/forme/invoice-corporate.tsx b/examples/forme/invoice-corporate.tsx
new file mode 100644
index 0000000..d93b82d
--- /dev/null
+++ b/examples/forme/invoice-corporate.tsx
@@ -0,0 +1,5 @@
+import { InvoiceCorporateDocument } from "@/registry/bases/forme/blocks/invoice-corporate/invoice-corporate";
+
+export default function Demo() {
+ return <InvoiceCorporateDocument />;
+}
diff --git a/examples/forme/invoice-creative.tsx b/examples/forme/invoice-creative.tsx
new file mode 100644
index 0000000..f855db3
--- /dev/null
+++ b/examples/forme/invoice-creative.tsx
@@ -0,0 +1,5 @@
+import { InvoiceCreativeDocument } from "@/registry/bases/forme/blocks/invoice-creative/invoice-creative";
+
+export default function Demo() {
+ return <InvoiceCreativeDocument />;
+}
diff --git a/examples/forme/invoice-minimal.tsx b/examples/forme/invoice-minimal.tsx
new file mode 100644
index 0000000..b9fae31
--- /dev/null
+++ b/examples/forme/invoice-minimal.tsx
@@ -0,0 +1,5 @@
+import { InvoiceMinimalDocument } from "@/registry/bases/forme/blocks/invoice-minimal/invoice-minimal";
+
+export default function Demo() {
+ return <InvoiceMinimalDocument />;
+}
diff --git a/examples/forme/invoice-modern.tsx b/examples/forme/invoice-modern.tsx
new file mode 100644
index 0000000..02ad140
--- /dev/null
+++ b/examples/forme/invoice-modern.tsx
@@ -0,0 +1,5 @@
+import { InvoiceModernDocument } from "@/registry/bases/forme/blocks/invoice-modern/invoice-modern";
+
+export default function Demo() {
+ return <InvoiceModernDocument />;
+}
diff --git a/examples/forme/keep-together.tsx b/examples/forme/keep-together.tsx
new file mode 100644
index 0000000..28bd7c3
--- /dev/null
+++ b/examples/forme/keep-together.tsx
@@ -0,0 +1,25 @@
+import { Document, Page } from "@formepdf/react";
+
+import { KeepTogether } from "@/registry/bases/forme/components/keep-together";
+import { Text } from "@/registry/bases/forme/components/text";
+import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4" margin={48}>
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return (
+ <KeepTogether>
+ <Text>Keep these lines together on one page.</Text>
+ </KeepTogether>
+ );
+}
diff --git a/examples/forme/key-value.tsx b/examples/forme/key-value.tsx
new file mode 100644
index 0000000..3258230
--- /dev/null
+++ b/examples/forme/key-value.tsx
@@ -0,0 +1,16 @@
+import { Document, Page } from "@formepdf/react";
+
+import { KeyValue } from "@/registry/bases/forme/components/key-value";
+import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4" margin={48}>
+ <PdfcnThemeProvider>
+ <KeyValue items={[{ key: "Name", value: "Ada" }]} />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
diff --git a/examples/forme/link.tsx b/examples/forme/link.tsx
new file mode 100644
index 0000000..9239034
--- /dev/null
+++ b/examples/forme/link.tsx
@@ -0,0 +1,16 @@
+import { Document, Page } from "@formepdf/react";
+
+import { Link } from "@/registry/bases/forme/components/link";
+import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4" margin={48}>
+ <PdfcnThemeProvider>
+ <Link href="https://example.com">Example</Link>
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
diff --git a/examples/forme/list.tsx b/examples/forme/list.tsx
new file mode 100644
index 0000000..b0ea737
--- /dev/null
+++ b/examples/forme/list.tsx
@@ -0,0 +1,18 @@
+import { Document, Page } from "@formepdf/react";
+
+import { PdfList } from "@/registry/bases/forme/components/list";
+import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4" margin={48}>
+ <PdfcnThemeProvider>
+ <PdfList
+ items={[{ text: "Alpha" }, { text: "Beta" }, { text: "Gamma" }]}
+ />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
diff --git a/examples/forme/page-break.tsx b/examples/forme/page-break.tsx
new file mode 100644
index 0000000..ba80f9c
--- /dev/null
+++ b/examples/forme/page-break.tsx
@@ -0,0 +1,27 @@
+import { Document, Page } from "@formepdf/react";
+
+import { PageBreak } from "@/registry/bases/forme/components/page-break";
+import { Text } from "@/registry/bases/forme/components/text";
+import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4" margin={48}>
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return (
+ <>
+ <Text>Before</Text>
+ <PageBreak />
+ <Text>After</Text>
+ </>
+ );
+}
diff --git a/examples/forme/page-footer.tsx b/examples/forme/page-footer.tsx
new file mode 100644
index 0000000..aed0355
--- /dev/null
+++ b/examples/forme/page-footer.tsx
@@ -0,0 +1,20 @@
+import { Document, Page } from "@formepdf/react";
+
+import { PageFooter } from "@/registry/bases/forme/components/page-footer";
+import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4" margin={48}>
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return <PageFooter leftText="pdfcn" rightText="Confidential" />;
+}
diff --git a/examples/forme/page-header.tsx b/examples/forme/page-header.tsx
new file mode 100644
index 0000000..5d6bf8a
--- /dev/null
+++ b/examples/forme/page-header.tsx
@@ -0,0 +1,20 @@
+import { Document, Page } from "@formepdf/react";
+
+import { PageHeader } from "@/registry/bases/forme/components/page-header";
+import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4" margin={48}>
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return <PageHeader title="Company" subtitle="Invoice" />;
+}
diff --git a/examples/forme/page-number.tsx b/examples/forme/page-number.tsx
new file mode 100644
index 0000000..2102826
--- /dev/null
+++ b/examples/forme/page-number.tsx
@@ -0,0 +1,20 @@
+import { Document, Page } from "@formepdf/react";
+
+import { PdfPageNumber } from "@/registry/bases/forme/components/page-number";
+import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4" margin={48}>
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return <PdfPageNumber />;
+}
diff --git a/examples/forme/pdf-image.tsx b/examples/forme/pdf-image.tsx
new file mode 100644
index 0000000..fde08d7
--- /dev/null
+++ b/examples/forme/pdf-image.tsx
@@ -0,0 +1,21 @@
+import { Document, Page } from "@formepdf/react";
+
+import { PdfImage } from "@/registry/bases/forme/components/pdf-image";
+import { Text } from "@/registry/bases/forme/components/text";
+import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4" margin={48}>
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return <Text>PdfImage demo — pass src in your document.</Text>;
+}
diff --git a/examples/forme/qrcode.tsx b/examples/forme/qrcode.tsx
new file mode 100644
index 0000000..47b836f
--- /dev/null
+++ b/examples/forme/qrcode.tsx
@@ -0,0 +1,20 @@
+import { Document, Page } from "@formepdf/react";
+
+import { PdfQRCode } from "@/registry/bases/forme/components/qrcode";
+import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4" margin={48}>
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return <PdfQRCode value="https://pdfcn.dev" />;
+}
diff --git a/examples/forme/report-financial.tsx b/examples/forme/report-financial.tsx
new file mode 100644
index 0000000..92e1460
--- /dev/null
+++ b/examples/forme/report-financial.tsx
@@ -0,0 +1,5 @@
+import { FinancialReportDocument } from "@/registry/bases/forme/blocks/report-financial/report-financial";
+
+export default function Demo() {
+ return <FinancialReportDocument />;
+}
diff --git a/examples/forme/report-marketing.tsx b/examples/forme/report-marketing.tsx
new file mode 100644
index 0000000..50a35d2
--- /dev/null
+++ b/examples/forme/report-marketing.tsx
@@ -0,0 +1,5 @@
+import { MarketingReportDocument } from "@/registry/bases/forme/blocks/report-marketing/report-marketing";
+
+export default function Demo() {
+ return <MarketingReportDocument />;
+}
diff --git a/examples/forme/report-operations.tsx b/examples/forme/report-operations.tsx
new file mode 100644
index 0000000..68d8e78
--- /dev/null
+++ b/examples/forme/report-operations.tsx
@@ -0,0 +1,5 @@
+import { OperationsReportDocument } from "@/registry/bases/forme/blocks/report-operations/report-operations";
+
+export default function Demo() {
+ return <OperationsReportDocument />;
+}
diff --git a/examples/forme/report-security.tsx b/examples/forme/report-security.tsx
new file mode 100644
index 0000000..90e7eff
--- /dev/null
+++ b/examples/forme/report-security.tsx
@@ -0,0 +1,5 @@
+import { SecurityReportDocument } from "@/registry/bases/forme/blocks/report-security/report-security";
+
+export default function Demo() {
+ return <SecurityReportDocument />;
+}
diff --git a/examples/forme/section.tsx b/examples/forme/section.tsx
new file mode 100644
index 0000000..dfcf1aa
--- /dev/null
+++ b/examples/forme/section.tsx
@@ -0,0 +1,25 @@
+import { Document, Page } from "@formepdf/react";
+
+import { Section } from "@/registry/bases/forme/components/section";
+import { Text } from "@/registry/bases/forme/components/text";
+import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4" margin={48}>
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return (
+ <Section>
+ <Text>Section body</Text>
+ </Section>
+ );
+}
diff --git a/examples/forme/signature.tsx b/examples/forme/signature.tsx
new file mode 100644
index 0000000..d44f144
--- /dev/null
+++ b/examples/forme/signature.tsx
@@ -0,0 +1,20 @@
+import { Document, Page } from "@formepdf/react";
+
+import { PdfSignatureBlock } from "@/registry/bases/forme/components/signature";
+import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4" margin={48}>
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return <PdfSignatureBlock name="Jane Doe" label="Authorized Signature" />;
+}
diff --git a/examples/forme/stack.tsx b/examples/forme/stack.tsx
new file mode 100644
index 0000000..b35e0d9
--- /dev/null
+++ b/examples/forme/stack.tsx
@@ -0,0 +1,26 @@
+import { Document, Page } from "@formepdf/react";
+
+import { Stack } from "@/registry/bases/forme/components/stack";
+import { Text } from "@/registry/bases/forme/components/text";
+import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4" margin={48}>
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return (
+ <Stack gap="md">
+ <Text>One</Text>
+ <Text>Two</Text>
+ </Stack>
+ );
+}
diff --git a/examples/forme/table.tsx b/examples/forme/table.tsx
new file mode 100644
index 0000000..b301581
--- /dev/null
+++ b/examples/forme/table.tsx
@@ -0,0 +1,44 @@
+import { Document, Page } from "@formepdf/react";
+
+import {
+ Table,
+ TableBody,
+ TableCell,
+ TableHeader,
+ TableRow,
+ Text,
+} from "@/registry/bases/forme/components";
+import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4" margin={48}>
+ <PdfcnThemeProvider>
+ <Table>
+ <TableHeader>
+ <TableRow>
+ <TableCell>
+ <Text>Item</Text>
+ </TableCell>
+ <TableCell>
+ <Text>Qty</Text>
+ </TableCell>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ <TableRow>
+ <TableCell>
+ <Text>Widget</Text>
+ </TableCell>
+ <TableCell>
+ <Text>2</Text>
+ </TableCell>
+ </TableRow>
+ </TableBody>
+ </Table>
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
diff --git a/examples/forme/text.tsx b/examples/forme/text.tsx
new file mode 100644
index 0000000..0498ef8
--- /dev/null
+++ b/examples/forme/text.tsx
@@ -0,0 +1,20 @@
+import { Document, Page } from "@formepdf/react";
+
+import { Text } from "@/registry/bases/forme/components/text";
+import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4" margin={48}>
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return <Text>Hello from pdfcn forme</Text>;
+}
diff --git a/examples/forme/watermark.tsx b/examples/forme/watermark.tsx
new file mode 100644
index 0000000..b286a89
--- /dev/null
+++ b/examples/forme/watermark.tsx
@@ -0,0 +1,26 @@
+import { Document, Page } from "@formepdf/react";
+
+import { Text } from "@/registry/bases/forme/components/text";
+import { PdfWatermark } from "@/registry/bases/forme/components/watermark";
+import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4" margin={48}>
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return (
+ <>
+ <PdfWatermark text="DRAFT" />
+ <Text>Document content</Text>
+ </>
+ );
+}
diff --git a/examples/takumi/alert.tsx b/examples/takumi/alert.tsx
new file mode 100644
index 0000000..41fd81f
--- /dev/null
+++ b/examples/takumi/alert.tsx
@@ -0,0 +1,23 @@
+import { PdfAlert } from "@/registry/bases/takumi/components/alert";
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";
+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4">
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return (
+ <PdfAlert variant="info" title="Info">
+ Alert body
+ </PdfAlert>
+ );
+}
diff --git a/examples/takumi/badge.tsx b/examples/takumi/badge.tsx
new file mode 100644
index 0000000..c184ca5
--- /dev/null
+++ b/examples/takumi/badge.tsx
@@ -0,0 +1,19 @@
+import { Badge } from "@/registry/bases/takumi/components/badge";
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";
+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4">
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return <Badge>Badge</Badge>;
+}
diff --git a/examples/takumi/card.tsx b/examples/takumi/card.tsx
new file mode 100644
index 0000000..cb53a0e
--- /dev/null
+++ b/examples/takumi/card.tsx
@@ -0,0 +1,19 @@
+import { PdfCard } from "@/registry/bases/takumi/components/card";
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";
+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4">
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return <PdfCard title="Card">Card body</PdfCard>;
+}
diff --git a/examples/takumi/data-table.tsx b/examples/takumi/data-table.tsx
new file mode 100644
index 0000000..8ab1df8
--- /dev/null
+++ b/examples/takumi/data-table.tsx
@@ -0,0 +1,30 @@
+import { DataTable } from "@/registry/bases/takumi/components/data-table";
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";
+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4">
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return (
+ <DataTable
+ columns={[
+ { header: "Name", key: "name" },
+ { header: "Price", key: "price" },
+ ]}
+ data={[
+ { name: "Widget", price: "$10" },
+ { name: "Gadget", price: "$20" },
+ ]}
+ />
+ );
+}
diff --git a/examples/takumi/divider.tsx b/examples/takumi/divider.tsx
new file mode 100644
index 0000000..690eeed
--- /dev/null
+++ b/examples/takumi/divider.tsx
@@ -0,0 +1,19 @@
+import { Divider } from "@/registry/bases/takumi/components/divider";
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";
+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4">
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return <Divider />;
+}
diff --git a/examples/takumi/form.tsx b/examples/takumi/form.tsx
new file mode 100644
index 0000000..8f887ac
--- /dev/null
+++ b/examples/takumi/form.tsx
@@ -0,0 +1,24 @@
+import { PdfForm } from "@/registry/bases/takumi/components/form";
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";
+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4">
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return (
+ <PdfForm
+ title="Contact"
+ groups={[{ fields: [{ label: "Email" }, { label: "Phone" }] }]}
+ />
+ );
+}
diff --git a/examples/takumi/graph.tsx b/examples/takumi/graph.tsx
new file mode 100644
index 0000000..ec5fe0f
--- /dev/null
+++ b/examples/takumi/graph.tsx
@@ -0,0 +1,28 @@
+import { PdfGraph } from "@/registry/bases/takumi/components/graph";
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";
+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4">
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return (
+ <PdfGraph
+ variant="bar"
+ data={[
+ { label: "Q1", value: 30 },
+ { label: "Q2", value: 45 },
+ { label: "Q3", value: 28 },
+ ]}
+ />
+ );
+}
diff --git a/examples/takumi/heading.tsx b/examples/takumi/heading.tsx
new file mode 100644
index 0000000..23ffcb1
--- /dev/null
+++ b/examples/takumi/heading.tsx
@@ -0,0 +1,19 @@
+import { Heading } from "@/registry/bases/takumi/components/heading";
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";
+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4">
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return <Heading level={1}>Heading</Heading>;
+}
diff --git a/examples/takumi/invoice-classic.tsx b/examples/takumi/invoice-classic.tsx
new file mode 100644
index 0000000..61e2e11
--- /dev/null
+++ b/examples/takumi/invoice-classic.tsx
@@ -0,0 +1,5 @@
+import { InvoiceClassicDocument } from "@/registry/bases/takumi/blocks/invoice-classic/invoice-classic";
+
+export default function Demo() {
+ return <InvoiceClassicDocument />;
+}
diff --git a/examples/takumi/invoice-consultant.tsx b/examples/takumi/invoice-consultant.tsx
new file mode 100644
index 0000000..94f2054
--- /dev/null
+++ b/examples/takumi/invoice-consultant.tsx
@@ -0,0 +1,5 @@
+import { InvoiceConsultantDocument } from "@/registry/bases/takumi/blocks/invoice-consultant/invoice-consultant";
+
+export default function Demo() {
+ return <InvoiceConsultantDocument />;
+}
diff --git a/examples/takumi/invoice-corporate.tsx b/examples/takumi/invoice-corporate.tsx
new file mode 100644
index 0000000..6809b32
--- /dev/null
+++ b/examples/takumi/invoice-corporate.tsx
@@ -0,0 +1,5 @@
+import { InvoiceCorporateDocument } from "@/registry/bases/takumi/blocks/invoice-corporate/invoice-corporate";
+
+export default function Demo() {
+ return <InvoiceCorporateDocument />;
+}
diff --git a/examples/takumi/invoice-creative.tsx b/examples/takumi/invoice-creative.tsx
new file mode 100644
index 0000000..52f465f
--- /dev/null
+++ b/examples/takumi/invoice-creative.tsx
@@ -0,0 +1,5 @@
+import { InvoiceCreativeDocument } from "@/registry/bases/takumi/blocks/invoice-creative/invoice-creative";
+
+export default function Demo() {
+ return <InvoiceCreativeDocument />;
+}
diff --git a/examples/takumi/invoice-minimal.tsx b/examples/takumi/invoice-minimal.tsx
new file mode 100644
index 0000000..b1c28c0
--- /dev/null
+++ b/examples/takumi/invoice-minimal.tsx
@@ -0,0 +1,5 @@
+import { InvoiceMinimalDocument } from "@/registry/bases/takumi/blocks/invoice-minimal/invoice-minimal";
+
+export default function Demo() {
+ return <InvoiceMinimalDocument />;
+}
diff --git a/examples/takumi/invoice-modern.tsx b/examples/takumi/invoice-modern.tsx
new file mode 100644
index 0000000..d4a6f81
--- /dev/null
+++ b/examples/takumi/invoice-modern.tsx
@@ -0,0 +1,5 @@
+import { InvoiceModernDocument } from "@/registry/bases/takumi/blocks/invoice-modern/invoice-modern";
+
+export default function Demo() {
+ return <InvoiceModernDocument />;
+}
diff --git a/examples/takumi/keep-together.tsx b/examples/takumi/keep-together.tsx
new file mode 100644
index 0000000..ab6d1d0
--- /dev/null
+++ b/examples/takumi/keep-together.tsx
@@ -0,0 +1,24 @@
+import { KeepTogether } from "@/registry/bases/takumi/components/keep-together";
+import { Text } from "@/registry/bases/takumi/components/text";
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";
+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4">
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return (
+ <KeepTogether>
+ <Text>Keep these lines together on one page.</Text>
+ </KeepTogether>
+ );
+}
diff --git a/examples/takumi/key-value.tsx b/examples/takumi/key-value.tsx
new file mode 100644
index 0000000..2e5ca64
--- /dev/null
+++ b/examples/takumi/key-value.tsx
@@ -0,0 +1,15 @@
+import { KeyValue } from "@/registry/bases/takumi/components/key-value";
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";
+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4">
+ <PdfcnThemeProvider>
+ <KeyValue items={[{ key: "Name", value: "Ada" }]} />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
diff --git a/examples/takumi/link.tsx b/examples/takumi/link.tsx
new file mode 100644
index 0000000..671406f
--- /dev/null
+++ b/examples/takumi/link.tsx
@@ -0,0 +1,15 @@
+import { Link } from "@/registry/bases/takumi/components/link";
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";
+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4">
+ <PdfcnThemeProvider>
+ <Link href="https://example.com">Example</Link>
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
diff --git a/examples/takumi/list.tsx b/examples/takumi/list.tsx
new file mode 100644
index 0000000..4c2aada
--- /dev/null
+++ b/examples/takumi/list.tsx
@@ -0,0 +1,17 @@
+import { PdfList } from "@/registry/bases/takumi/components/list";
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";
+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4">
+ <PdfcnThemeProvider>
+ <PdfList
+ items={[{ text: "Alpha" }, { text: "Beta" }, { text: "Gamma" }]}
+ />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
diff --git a/examples/takumi/page-break.tsx b/examples/takumi/page-break.tsx
new file mode 100644
index 0000000..a18c6bf
--- /dev/null
+++ b/examples/takumi/page-break.tsx
@@ -0,0 +1,26 @@
+import { PageBreak } from "@/registry/bases/takumi/components/page-break";
+import { Text } from "@/registry/bases/takumi/components/text";
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";
+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4">
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return (
+ <>
+ <Text>Before</Text>
+ <PageBreak />
+ <Text>After</Text>
+ </>
+ );
+}
diff --git a/examples/takumi/page-footer.tsx b/examples/takumi/page-footer.tsx
new file mode 100644
index 0000000..d40660e
--- /dev/null
+++ b/examples/takumi/page-footer.tsx
@@ -0,0 +1,19 @@
+import { PageFooter } from "@/registry/bases/takumi/components/page-footer";
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";
+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4">
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return <PageFooter leftText="pdfcn" rightText="Confidential" />;
+}
diff --git a/examples/takumi/page-header.tsx b/examples/takumi/page-header.tsx
new file mode 100644
index 0000000..fbb4cdf
--- /dev/null
+++ b/examples/takumi/page-header.tsx
@@ -0,0 +1,19 @@
+import { PageHeader } from "@/registry/bases/takumi/components/page-header";
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";
+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4">
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return <PageHeader title="Company" subtitle="Invoice" />;
+}
diff --git a/examples/takumi/page-number.tsx b/examples/takumi/page-number.tsx
new file mode 100644
index 0000000..5696f51
--- /dev/null
+++ b/examples/takumi/page-number.tsx
@@ -0,0 +1,19 @@
+import { PdfPageNumber } from "@/registry/bases/takumi/components/page-number";
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";
+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4">
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return <PdfPageNumber />;
+}
diff --git a/examples/takumi/pdf-image.tsx b/examples/takumi/pdf-image.tsx
new file mode 100644
index 0000000..d357984
--- /dev/null
+++ b/examples/takumi/pdf-image.tsx
@@ -0,0 +1,20 @@
+import { PdfImage } from "@/registry/bases/takumi/components/pdf-image";
+import { Text } from "@/registry/bases/takumi/components/text";
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";
+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4">
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return <Text>PdfImage demo — pass src in your document.</Text>;
+}
diff --git a/examples/takumi/qrcode.tsx b/examples/takumi/qrcode.tsx
new file mode 100644
index 0000000..ce1b493
--- /dev/null
+++ b/examples/takumi/qrcode.tsx
@@ -0,0 +1,19 @@
+import { PdfQRCode } from "@/registry/bases/takumi/components/qrcode";
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";
+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4">
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return <PdfQRCode value="https://pdfcn.dev" />;
+}
diff --git a/examples/takumi/report-financial.tsx b/examples/takumi/report-financial.tsx
new file mode 100644
index 0000000..43c2da6
--- /dev/null
+++ b/examples/takumi/report-financial.tsx
@@ -0,0 +1,5 @@
+import { FinancialReportDocument } from "@/registry/bases/takumi/blocks/report-financial/report-financial";
+
+export default function Demo() {
+ return <FinancialReportDocument />;
+}
diff --git a/examples/takumi/report-marketing.tsx b/examples/takumi/report-marketing.tsx
new file mode 100644
index 0000000..736aabc
--- /dev/null
+++ b/examples/takumi/report-marketing.tsx
@@ -0,0 +1,5 @@
+import { MarketingReportDocument } from "@/registry/bases/takumi/blocks/report-marketing/report-marketing";
+
+export default function Demo() {
+ return <MarketingReportDocument />;
+}
diff --git a/examples/takumi/report-operations.tsx b/examples/takumi/report-operations.tsx
new file mode 100644
index 0000000..ee50d83
--- /dev/null
+++ b/examples/takumi/report-operations.tsx
@@ -0,0 +1,5 @@
+import { OperationsReportDocument } from "@/registry/bases/takumi/blocks/report-operations/report-operations";
+
+export default function Demo() {
+ return <OperationsReportDocument />;
+}
diff --git a/examples/takumi/report-security.tsx b/examples/takumi/report-security.tsx
new file mode 100644
index 0000000..738fb58
--- /dev/null
+++ b/examples/takumi/report-security.tsx
@@ -0,0 +1,5 @@
+import { SecurityReportDocument } from "@/registry/bases/takumi/blocks/report-security/report-security";
+
+export default function Demo() {
+ return <SecurityReportDocument />;
+}
diff --git a/examples/takumi/section.tsx b/examples/takumi/section.tsx
new file mode 100644
index 0000000..5f821e7
--- /dev/null
+++ b/examples/takumi/section.tsx
@@ -0,0 +1,24 @@
+import { Section } from "@/registry/bases/takumi/components/section";
+import { Text } from "@/registry/bases/takumi/components/text";
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";
+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4">
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return (
+ <Section>
+ <Text>Section body</Text>
+ </Section>
+ );
+}
diff --git a/examples/takumi/signature.tsx b/examples/takumi/signature.tsx
new file mode 100644
index 0000000..b7bb682
--- /dev/null
+++ b/examples/takumi/signature.tsx
@@ -0,0 +1,19 @@
+import { PdfSignatureBlock } from "@/registry/bases/takumi/components/signature";
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";
+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4">
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return <PdfSignatureBlock name="Jane Doe" label="Authorized Signature" />;
+}
diff --git a/examples/takumi/stack.tsx b/examples/takumi/stack.tsx
new file mode 100644
index 0000000..b87818f
--- /dev/null
+++ b/examples/takumi/stack.tsx
@@ -0,0 +1,25 @@
+import { Stack } from "@/registry/bases/takumi/components/stack";
+import { Text } from "@/registry/bases/takumi/components/text";
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";
+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4">
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return (
+ <Stack gap="md">
+ <Text>One</Text>
+ <Text>Two</Text>
+ </Stack>
+ );
+}
diff --git a/examples/takumi/table.tsx b/examples/takumi/table.tsx
new file mode 100644
index 0000000..13be9fd
--- /dev/null
+++ b/examples/takumi/table.tsx
@@ -0,0 +1,43 @@
+import {
+ Table,
+ TableBody,
+ TableCell,
+ TableHeader,
+ TableRow,
+ Text,
+} from "@/registry/bases/takumi/components";
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";
+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4">
+ <PdfcnThemeProvider>
+ <Table>
+ <TableHeader>
+ <TableRow>
+ <TableCell>
+ <Text>Item</Text>
+ </TableCell>
+ <TableCell>
+ <Text>Qty</Text>
+ </TableCell>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ <TableRow>
+ <TableCell>
+ <Text>Widget</Text>
+ </TableCell>
+ <TableCell>
+ <Text>2</Text>
+ </TableCell>
+ </TableRow>
+ </TableBody>
+ </Table>
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
diff --git a/examples/takumi/text.tsx b/examples/takumi/text.tsx
new file mode 100644
index 0000000..028e553
--- /dev/null
+++ b/examples/takumi/text.tsx
@@ -0,0 +1,19 @@
+import { Text } from "@/registry/bases/takumi/components/text";
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";
+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4">
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return <Text>Hello from pdfcn takumi</Text>;
+}
diff --git a/examples/takumi/watermark.tsx b/examples/takumi/watermark.tsx
new file mode 100644
index 0000000..5aae35f
--- /dev/null
+++ b/examples/takumi/watermark.tsx
@@ -0,0 +1,25 @@
+import { Text } from "@/registry/bases/takumi/components/text";
+import { PdfWatermark } from "@/registry/bases/takumi/components/watermark";
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";
+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4">
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return (
+ <>
+ <PdfWatermark text="DRAFT" />
+ <Text>Document content</Text>
+ </>
+ );
+}
diff --git a/lib/registry.ts b/lib/registry.ts
index ad224d3..b58e4e8 100644
--- a/lib/registry.ts
+++ b/lib/registry.ts
@@ -1,6 +1,7 @@
import path from "node:path";
import { readFileFromRoot } from "@/lib/read-file";
+import type { BaseName } from "@/registry/bases";
export const readOptionalFromRoot = async (
relativePath: string
@@ -12,17 +13,32 @@ export const readOptionalFromRoot = async (
}
};
-export const getRegistryUiSourceCandidates = ({ name }: { name: string }) => [
- path.join("registry", "new-york", `${name}.tsx`),
-];
+export const getRegistryUiSourceCandidates = ({
+ name,
+ base = "takumi",
+}: {
+ name: string;
+ base?: BaseName;
+}) => {
+ const slug = name.includes("/") ? name.split("/").pop()! : name;
+ return [
+ path.join("registry", "bases", base, "components", slug, `${slug}.tsx`),
+ path.join("registry", "bases", base, "blocks", slug, `${slug}.tsx`),
+ path.join("registry", "bases", base, "components", `${slug}.tsx`),
+ ];
+};
-export const getDemoSource = (name: string): Promise<string | null> =>
- readOptionalFromRoot(path.join("examples", `${name}.tsx`));
+export const getDemoSource = (
+ name: string,
+ base: BaseName = "takumi"
+): Promise<string | null> =>
+ readOptionalFromRoot(path.join("examples", base, `${name}.tsx`));
export const getRegistrySource = async (
- name: string
+ name: string,
+ base: BaseName = "takumi"
): Promise<string | null> => {
- const candidates = getRegistryUiSourceCandidates({ name });
+ const candidates = getRegistryUiSourceCandidates({ base, name });
for (const candidate of candidates) {
const code = await readOptionalFromRoot(candidate);
diff --git a/mdx-components.tsx b/mdx-components.tsx
index e2f24fe..708edcc 100644
--- a/mdx-components.tsx
+++ b/mdx-components.tsx
@@ -10,6 +10,7 @@ import { ComponentSource } from "@/components/component-source";
import { ComponentsList } from "@/components/components-list";
import { CopyButton } from "@/components/copy-button";
import { getIconForLanguageExtension } from "@/components/icons";
+import { PdfPreview } from "@/components/pdf-preview";
import {
Accordion,
AccordionContent,
@@ -99,6 +100,7 @@ export const mdxComponents = {
{...props}
/>
),
+ PdfPreview,
Step: ({ className, children, ...props }: React.ComponentProps<"h3">) => (
<h3
className={cn(
diff --git a/next.config.mjs b/next.config.mjs
index 4c9b3c7..89476f1 100644
--- a/next.config.mjs
+++ b/next.config.mjs
@@ -52,6 +52,11 @@ const nextConfig = {
},
];
},
+ serverExternalPackages: [
+ "takumi-pdf",
+ "@formepdf/core",
+ "@takumi-rs/helpers",
+ ],
};
const withMDX = createMDX({});
diff --git a/package.json b/package.json
index 101744a..383d444 100644
--- a/package.json
+++ b/package.json
@@ -1,5 +1,5 @@
{
- "name": "startercn",
+ "name": "pdfcn",
"version": "0.1.0",
"private": true,
"scripts": {
@@ -7,14 +7,18 @@
"build": "pnpm registry:build && next build",
"start": "next start",
"typecheck": "tsc --noEmit",
- "registry:build": "shadcn build registry.json --output ./public/r",
+ "registry:build": "node scripts/generate-registry.mjs && node scripts/build-registry.mjs",
"postinstall": "fumadocs-mdx",
"check": "ultracite check",
"fix": "ultracite fix",
- "prepare": "lefthook install"
+ "prepare": "lefthook install",
+ "registry:generate": "node scripts/generate-registry.mjs"
},
"dependencies": {
+ "@formepdf/core": "^0.10.5",
+ "@formepdf/react": "^0.10.5",
"@tailwindcss/postcss": "^4.2.4",
+ "@takumi-rs/helpers": "^2.5.11",
"@vercel/analytics": "^2.0.1",
"@web-kits/audio": "^0.1.0",
"class-variance-authority": "^0.7.1",
@@ -29,24 +33,30 @@
"motion": "^12.38.0",
"next": "16.2.4",
"next-themes": "0.4.6",
+ "pdfjs-dist": "^6.2.108",
"postcss": "^8.5.10",
+ "qrcode": "^1.5.4",
"radix-ui": "^1.4.3",
"react": "19.2.5",
"react-dom": "19.2.5",
"react-hotkeys-hook": "^5.2.4",
+ "react-pdf": "^10.4.1",
"rehype-pretty-code": "^0.14.3",
"shiki": "^4.0.2",
"sonner": "^2.0.7",
"tailwind-merge": "^3.5.0",
+ "takumi-pdf": "^0.4.1",
"ts-morph": "^26.0.0",
"vaul": "^1.1.2",
"web-haptics": "^0.0.6",
"zod": "^4.3.6"
},
"devDependencies": {
+ "@formepdf/cli": "^0.10.5",
"@tailwindcss/postcss": "^4.2.4",
"@types/mdx": "^2.0.13",
"@types/node": "^25.6.0",
+ "@types/qrcode": "^1.5.6",
"@types/react": "19.2.14",
"@types/react-dom": "19.2.3",
"lefthook": "^2.1.6",
@@ -54,6 +64,7 @@
"oxlint": "^1.61.0",
"shadcn": "4.5.0",
"tailwindcss": "^4.2.4",
+ "tsx": "^4.23.10",
"tw-animate-css": "^1.4.0",
"typescript": "^6.0.3",
"ultracite": "7.6.1"
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 0d480cb..06c6435 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -8,9 +8,18 @@ importers:
.:
dependencies:
+ '@formepdf/core':
+ specifier: ^0.10.5
+ version: 0.10.5([email protected])
+ '@formepdf/react':
+ specifier: ^0.10.5
+ version: 0.10.5([email protected])
'@tailwindcss/postcss':
specifier: ^4.2.4
version: 4.2.4
+ '@takumi-rs/helpers':
+ specifier: ^2.5.11
+ version: 2.5.11([email protected])
'@vercel/analytics':
specifier: ^2.0.1
@@ -53,9 +62,15 @@ importers:
next-themes:
specifier: 0.4.6
+ pdfjs-dist:
+ specifier: ^6.2.108
+ version: 6.2.108
postcss:
specifier: ^8.5.10
version: 8.5.10
+ qrcode:
+ specifier: ^1.5.4
+ version: 1.5.4
radix-ui:
specifier: ^1.4.3
@@ -68,6 +83,9 @@ importers:
react-hotkeys-hook:
specifier: ^5.2.4
+ react-pdf:
+ specifier: ^10.4.1
rehype-pretty-code:
specifier: ^0.14.3
version: 0.14.3([email protected])
@@ -80,6 +98,9 @@ importers:
tailwind-merge:
specifier: ^3.5.0
version: 3.5.0
+ takumi-pdf:
+ specifier: ^0.4.1
+ version: 0.4.1([email protected])
ts-morph:
specifier: ^26.0.0
version: 26.0.0
@@ -93,12 +114,18 @@ importers:
specifier: ^4.3.6
version: 4.3.6
devDependencies:
+ '@formepdf/cli':
+ specifier: ^0.10.5
+ version: 0.10.5([email protected])
'@types/mdx':
specifier: ^2.0.13
version: 2.0.13
'@types/node':
specifier: ^25.6.0
version: 25.6.0
+ '@types/qrcode':
+ specifier: ^1.5.6
+ version: 1.5.6
'@types/react':
specifier: 19.2.14
version: 19.2.14
@@ -120,6 +147,9 @@ importers:
tailwindcss:
specifier: ^4.2.4
version: 4.2.4
+ tsx:
+ specifier: ^4.23.10
+ version: 4.23.10
tw-animate-css:
specifier: ^1.4.0
version: 1.4.0
@@ -290,126 +320,252 @@ packages:
'@emnapi/[email protected]':
resolution: {integrity: sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==}
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA==}
+ engines: {node: '>=18'}
+ cpu: [ppc64]
+ os: [aix]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-lhRUCeuOyJQURhTxl4WkpFTjIsbDayJHih5kZC1giwE+MhIzAb7mEsQMqMf18rHLsrb5qI1tafG20mLxEWcWlA==}
engines: {node: '>=18'}
cpu: [ppc64]
os: [aix]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-cNLgeqCqV8WxfcTIOeL4OAtSmL8JjcN6m09XIgro1Wi7cF4t/THaWEa7eL5CMoMBdjoHOTh/vwTO/o2TRXIyzg==}
+ engines: {node: '>=18'}
+ cpu: [arm64]
+ os: [android]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-+WzIXQOSaGs33tLEgYPYe/yQHf0WTU0X42Jca3y8NWMbUVhp7rUnw+vAsRC/QiDrdD31IszMrZy+qwPOPjd+rw==}
engines: {node: '>=18'}
cpu: [arm64]
os: [android]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-tmwl4hJkCfNHwFB3nBa8z1Uy3ypZpxqxfTQOcHX+xRByyYgunVbZ9MzUUfb0RxaHIMnbHagwAxuTL+tnNM+1/Q==}
+ engines: {node: '>=18'}
+ cpu: [arm]
+ os: [android]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-wqh0ByljabXLKHeWXYLqoJ5jKC4XBaw6Hk08OfMrCRd2nP2ZQ5eleDZC41XHyCNgktBGYMbqnrJKq/K/lzPMSQ==}
engines: {node: '>=18'}
cpu: [arm]
os: [android]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-B6Q0YQDqMx9D7rvIcsXfmJfvUYLoP722bgfBlO5cGvNVb5V/+Y7nhBE3mHV9OpxBf4eAS2S68KZztiPaWq4XYw==}
+ engines: {node: '>=18'}
+ cpu: [x64]
+ os: [android]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-+VJggoaKhk2VNNqVL7f6S189UzShHC/mR9EE8rDdSkdpN0KflSwWY/gWjDrNxxisg8Fp1ZCD9jLMo4m0OUfeUA==}
engines: {node: '>=18'}
cpu: [x64]
os: [android]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-kj3AnYWc+CekmZnS5IPu9D+HWtUI49hbnyqk0FLEJDbzCIQt7hg7ucF1SQAilhtYpIujfaHr6O0UHlzzSPdOeA==}
+ engines: {node: '>=18'}
+ cpu: [arm64]
+ os: [darwin]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-0T+A9WZm+bZ84nZBtk1ckYsOvyA3x7e2Acj1KdVfV4/2tdG4fzUp91YHx+GArWLtwqp77pBXVCPn2We7Letr0Q==}
engines: {node: '>=18'}
cpu: [arm64]
os: [darwin]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-WeSrmwwHaPkNR5H3yYfowhZcbriGqooyu3zI/3GGpF8AyUdsrrP0X6KumITGA9WOyiJavnGZUwPGvxvwfWPHIA==}
+ engines: {node: '>=18'}
+ cpu: [x64]
+ os: [darwin]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-fyzLm/DLDl/84OCfp2f/XQ4flmORsjU7VKt8HLjvIXChJoFFOIL6pLJPH4Yhd1n1gGFF9mPwtlN5Wf82DZs+LQ==}
engines: {node: '>=18'}
cpu: [x64]
os: [darwin]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-UN8HXjtJ0k/Mj6a9+5u6+2eZ2ERD7Edt1Q9IZiB5UZAIdPnVKDoG7mdTVGhHJIeEml60JteamR3qhsr1r8gXvg==}
+ engines: {node: '>=18'}
+ cpu: [arm64]
+ os: [freebsd]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-l9GeW5UZBT9k9brBYI+0WDffcRxgHQD8ShN2Ur4xWq/NFzUKm3k5lsH4PdaRgb2w7mI9u61nr2gI2mLI27Nh3Q==}
engines: {node: '>=18'}
cpu: [arm64]
os: [freebsd]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-TvW7wE/89PYW+IevEJXZ5sF6gJRDY/14hyIGFXdIucxCsbRmLUcjseQu1SyTko+2idmCw94TgyaEZi9HUSOe3Q==}
+ engines: {node: '>=18'}
+ cpu: [x64]
+ os: [freebsd]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-BXoQai/A0wPO6Es3yFJ7APCiKGc1tdAEOgeTNy3SsB491S3aHn4S4r3e976eUnPdU+NbdtmBuLncYir2tMU9Nw==}
engines: {node: '>=18'}
cpu: [x64]
os: [freebsd]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-7HnAD6074BW43YvvUmE/35Id9/NB7BeX5EoNkK9obndmZBUk8xmJJeU7DwmUeN7tkysslb2eSl6CTrYz6oEMQg==}
+ engines: {node: '>=18'}
+ cpu: [arm64]
+ os: [linux]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-RVyzfb3FWsGA55n6WY0MEIEPURL1FcbhFE6BffZEMEekfCzCIMtB5yyDcFnVbTnwk+CLAgTujmV/Lgvih56W+A==}
engines: {node: '>=18'}
cpu: [arm64]
os: [linux]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-n0WRM/gWIdU29J57hJyUdIsk0WarGd6To0s+Y+LwvlC55wt+GT/OgkwoXCXvIue1i1sSNWblHEig00GBWiJgfA==}
+ engines: {node: '>=18'}
+ cpu: [arm]
+ os: [linux]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-CjaaREJagqJp7iTaNQjjidaNbCKYcd4IDkzbwwxtSvjI7NZm79qiHc8HqciMddQ6CKvJT6aBd8lO9kN/ZudLlw==}
engines: {node: '>=18'}
cpu: [arm]
os: [linux]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-sfv0tGPQhcZOgTKO3oBE9xpHuUqguHvSo4jl+wjnKwFpapx+vUDcawbwPNuBIAYdRAvIDBfZVvXprIj3HA+Ugw==}
+ engines: {node: '>=18'}
+ cpu: [ia32]
+ os: [linux]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-KBnSTt1kxl9x70q+ydterVdl+Cn0H18ngRMRCEQfrbqdUuntQQ0LoMZv47uB97NljZFzY6HcfqEZ2SAyIUTQBQ==}
engines: {node: '>=18'}
cpu: [ia32]
os: [linux]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-CN9AZr8kEndGooS35ntToZLTQLHEjtVB5n7dl8ZcTZMonJ7CCfStrYhrzF97eAecqVbVJ7APOEe18RPI4KLhwQ==}
+ engines: {node: '>=18'}
+ cpu: [loong64]
+ os: [linux]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-zpSlUce1mnxzgBADvxKXX5sl8aYQHo2ezvMNI8I0lbblJtp8V4odlm3Yzlj7gPyt3T8ReksE6bK+pT3WD+aJRg==}
engines: {node: '>=18'}
cpu: [loong64]
os: [linux]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-iMkk7qr/wl3exJATwkISxI7kTcmHKE+BlymIAbHO8xanq/TjHaaVThFF6ipWzPHryoFsesNQJPE/3wFJw4+huw==}
+ engines: {node: '>=18'}
+ cpu: [mips64el]
+ os: [linux]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-2jIfP6mmjkdmeTlsX/9vmdmhBmKADrWqN7zcdtHIeNSCH1SqIoNI63cYsjQR8J+wGa4Y5izRcSHSm8K3QWmk3w==}
engines: {node: '>=18'}
cpu: [mips64el]
os: [linux]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-shsVrgCZ57Vr2L8mm39kO5PPIb+843FStGt7sGGoqiiWYconSxwTiuswC1VJZLCjNiMLAMh34jg4VSEQb+iEbw==}
+ engines: {node: '>=18'}
+ cpu: [ppc64]
+ os: [linux]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-bc0FE9wWeC0WBm49IQMPSPILRocGTQt3j5KPCA8os6VprfuJ7KD+5PzESSrJ6GmPIPJK965ZJHTUlSA6GNYEhg==}
engines: {node: '>=18'}
cpu: [ppc64]
os: [linux]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-4eSFWnU9Hhd68fW16GD0TINewo1L6dRrB+oLNNbYyMUAeOD2yCK5KXGK1GH4qD/kT+bTEXjsyTCiJGHPZ3eM9Q==}
+ engines: {node: '>=18'}
+ cpu: [riscv64]
+ os: [linux]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-SQPZOwoTTT/HXFXQJG/vBX8sOFagGqvZyXcgLA3NhIqcBv1BJU1d46c0rGcrij2B56Z2rNiSLaZOYW5cUk7yLQ==}
engines: {node: '>=18'}
cpu: [riscv64]
os: [linux]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-S0Bh0A53b0YHL2XEXC20bHLuGMOhFDO6GN4b3YjRLK//Ep3ql3erpNcPlEFed93hsQAjAQDNsvcK+hV90FubSw==}
+ engines: {node: '>=18'}
+ cpu: [s390x]
+ os: [linux]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-SCfR0HN8CEEjnYnySJTd2cw0k9OHB/YFzt5zgJEwa+wL/T/raGWYMBqwDNAC6dqFKmJYZoQBRfHjgwLHGSrn3Q==}
engines: {node: '>=18'}
cpu: [s390x]
os: [linux]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-8Qi4nQcCTbLnK9WoMjdC9NiTG6/E38RNICU6sUNqK0QFxCYgoARqVqxdFmWkdonVsvGqWhmm7MO0jyTqLqwj0Q==}
+ engines: {node: '>=18'}
+ cpu: [x64]
+ os: [linux]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-us0dSb9iFxIi8srnpl931Nvs65it/Jd2a2K3qs7fz2WfGPHqzfzZTfec7oxZJRNPXPnNYZtanmRc4AL/JwVzHQ==}
engines: {node: '>=18'}
cpu: [x64]
os: [linux]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-wuLK/VztRRpMt9zyHSazyCVdCXlpHkKm34WUyinD2lzK07FAHTq0KQvZZlXikNWkDGoT6x3TD51jKQ7gMVpopw==}
+ engines: {node: '>=18'}
+ cpu: [arm64]
+ os: [netbsd]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-CR/RYotgtCKwtftMwJlUU7xCVNg3lMYZ0RzTmAHSfLCXw3NtZtNpswLEj/Kkf6kEL3Gw+BpOekRX0BYCtklhUw==}
engines: {node: '>=18'}
cpu: [arm64]
os: [netbsd]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-VefFaQUc4FMmJuAxmIHgUmfNiLXY438XrL4GDNV1Y1H/RW3qow68xTwjZKfj/+Plp9NANmzbH5R40Meudu8mmw==}
+ engines: {node: '>=18'}
+ cpu: [x64]
+ os: [netbsd]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-nU1yhmYutL+fQ71Kxnhg8uEOdC0pwEW9entHykTgEbna2pw2dkbFSMeqjjyHZoCmt8SBkOSvV+yNmm94aUrrqw==}
engines: {node: '>=18'}
cpu: [x64]
os: [netbsd]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-YQbi46SBct6iKnszhSvdluqDmxCJA+Pu280Av9WICNwQmMxV7nLRHZfjQzwbPs3jeWnuAhE9Jy0NrnJ12Oz+0A==}
+ engines: {node: '>=18'}
+ cpu: [arm64]
+ os: [openbsd]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-cXb5vApOsRsxsEl4mcZ1XY3D4DzcoMxR/nnc4IyqYs0rTI8ZKmW6kyyg+11Z8yvgMfAEldKzP7AdP64HnSC/6g==}
engines: {node: '>=18'}
cpu: [arm64]
os: [openbsd]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-+iDS6zpNM6EnJyWv0bMGLWSWeXGN/HTaF/LXHXHwejGsVi+ooqDfMCCTerNFxEkM3wYVcExkeGXNqshc9iMaOA==}
+ engines: {node: '>=18'}
+ cpu: [x64]
+ os: [openbsd]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-8wZM2qqtv9UP3mzy7HiGYNH/zjTA355mpeuA+859TyR+e+Tc08IHYpLJuMsfpDJwoLo1ikIJI8jC3GFjnRClzA==}
engines: {node: '>=18'}
@@ -422,24 +578,48 @@ packages:
cpu: [arm64]
os: [openharmony]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-hTdsW27jcktEvpwNHJU4ZwWFGkz2zRJUz8pvddmXPtXDzVKTTINmlmga3ZzwcuMpUvLw7JkLy9QLKyGpD2Yxig==}
+ engines: {node: '>=18'}
+ cpu: [x64]
+ os: [sunos]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-1ZgjUoEdHZZl/YlV76TSCz9Hqj9h9YmMGAgAPYd+q4SicWNX3G5GCyx9uhQWSLcbvPW8Ni7lj4gDa1T40akdlw==}
engines: {node: '>=18'}
cpu: [x64]
os: [sunos]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-LihEQ2BBKVFLOC9ZItT9iFprsE9tqjDjnbulhHoFxYQtQfai7qfluVODIYxt1PgdoyQkz23+01rzwNwYfutxUQ==}
+ engines: {node: '>=18'}
+ cpu: [arm64]
+ os: [win32]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-Q9StnDmQ/enxnpxCCLSg0oo4+34B9TdXpuyPeTedN/6+iXBJ4J+zwfQI28u/Jl40nOYAxGoNi7mFP40RUtkmUA==}
engines: {node: '>=18'}
cpu: [arm64]
os: [win32]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-q+iGUwfs8tncmFC9pcnD5IvRHAzmbwQ3GPS5/ceCyHdjXubwQWI12MKWSNSMYLJMq23/IUCvJMS76PDqXe1fxA==}
+ engines: {node: '>=18'}
+ cpu: [ia32]
+ os: [win32]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-zF3ag/gfiCe6U2iczcRzSYJKH1DCI+ByzSENHlM2FcDbEeo5Zd2C86Aq0tKUYAJJ1obRP84ymxIAksZUcdztHA==}
engines: {node: '>=18'}
cpu: [ia32]
os: [win32]
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-7VTgWzgMGvup6aSqDPLiW5zHaxYJGTO4OokMjIlrCtf+VpEL+cXKtCvg723iguPYI5oaUNdS+/V7OU2gvXVWEg==}
+ engines: {node: '>=18'}
+ cpu: [x64]
+ os: [win32]
+
'@esbuild/[email protected]':
resolution: {integrity: sha512-pEl1bO9mfAmIC+tW5btTmrKaujg3zGtUmWNdCw/xs70FBjwAL3o9OEKNHvNmnyylD6ubxUERiEhdsL0xBQ9efw==}
engines: {node: '>=18'}
@@ -461,6 +641,25 @@ packages:
'@floating-ui/[email protected]':
resolution: {integrity: sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg==}
+ '@formepdf/[email protected]':
+ resolution: {integrity: sha512-oCi4zoDpzcMU0aFWpdk9gNlIGhGW0C+HofUxSbtyfs+pNiaVXtZyOLUSz/TmnbDOfGsWxihNcJ7YfnOcvaO/ow==}
+ hasBin: true
+
+ '@formepdf/[email protected]':
+ resolution: {integrity: sha512-G30kOp84ZwBgw4lLukdUDK3Cz+mUjYuESFoIU4dg3lqqL6Wnumg+90dFpxI1UXD53HCNA1fQzJdjVPzejBfoeg==}
+ peerDependencies:
+ react: ^18 || ^19
+
+ '@formepdf/[email protected]':
+ resolution: {integrity: sha512-izdrsuhcxTmH65Gsi6mbHboylBI4W9PFfYKKd9wRrSPdYw0irvDWxDb4tKUTc8BycmM0ODzN/WIJLiJdRAw1tQ==}
+ peerDependencies:
+ react: ^18 || ^19
+
+ '@formepdf/[email protected]':
+ resolution: {integrity: sha512-ucqx4iM3EvWVnXnX098J2MVUstu0ww0mRz353isc+LLwGDopgxamSEMzhflU0uxB+PeXKKnFz1BZTItxlDmSXg==}
+ peerDependencies:
+ react: ^18 || ^19
+
resolution: {integrity: sha512-GwtvgtXxnWsucXvbQXkRgqksiH2Qed37H9xHZocE5sA3N8O8O8/8FA3uclQXxXVzc9XBZuEOMK7+r02FmSpHtw==}
engines: {node: '>=18.14.1'}
@@ -688,6 +887,156 @@ packages:
resolution: {integrity: sha512-qmDvJIjcNsZ6tXWy2G9yuCgMPTTn35GMA3dPpSLm7QJVpbQzYdw0ALy1bKoivXnEM3U93/OrK+/M719b+fg84Q==}
engines: {node: '>=18'}
+ '@napi-rs/[email protected]':
+ resolution: {integrity: sha512-hjhCKhntPv9+t4ckHymdx0phYNcVW+GKQR6Lzw2zE+pOVjOplSmtx9nNNknTjbEDLcuLZqA1y8ufKg1XfgftzQ==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [android]
+
+ '@napi-rs/[email protected]':
+ resolution: {integrity: sha512-7kSCdUhoXiO+AaIMXdBGdtp6EctZNkmF62Rea/BmVQlwKaM3bBhOzyGUzxyxz9dv5vdBfpyAaxhSRSJF4kqK4A==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [android]
+
+ '@napi-rs/[email protected]':
+ resolution: {integrity: sha512-2PcswRaC7Ly645DGt88///zuFDhJxJYdKAs1uU3mfk1atYkXufgcgLfBpk6Tm12nCQBaNt1wpybuPZ4qOhTo8A==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [darwin]
+
+ '@napi-rs/[email protected]':
+ resolution: {integrity: sha512-ds14V1BPagLszQyaDTeggny5fNeTCqsUQ5QhFj9VDxSEfzrVxXtdbR0LoFyKa0Siaaw8KvqSk4t7k/WoZJwvbg==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [darwin]
+
+ '@napi-rs/[email protected]':
+ resolution: {integrity: sha512-ePNZtj7pNIva/siZMg+HmbeozkIjqUIYdoymH8HaA3qK7LfzFN4WMBM8G6HQ9ZC+H3+Dnn5pqtiXpgLykaPOhw==}
+ engines: {node: '>= 10'}
+ cpu: [x64]
+ os: [darwin]
+
+ '@napi-rs/[email protected]':
+ resolution: {integrity: sha512-qof3LRAAycmkV2I1izZo9RoSHF8kCQr5O05sFwv0jK8rSdYV6KHVwimo6Qb7RxZj40WHKbLHm5JDaUF0o5XUAA==}
+ engines: {node: '>= 10'}
+ cpu: [x64]
+ os: [darwin]
+
+ '@napi-rs/[email protected]':
+ resolution: {integrity: sha512-d5cDB48oWFGU8/XPhUOFAlySgb/VAu7D+s8fi55K1Pcfg8aPplHWqMgibhVLU8ky7Pyg/fuiVLz4Nf3JrSTuUA==}
+ engines: {node: '>= 10'}
+ cpu: [arm]
+ os: [linux]
+
+ '@napi-rs/[email protected]':
+ resolution: {integrity: sha512-FU2kKZLmolHA9+KcUA+l1+xH3WTLUUTQDU/kLv9SEUr2TrRPu94aytOeizFJDHPs/QBcw4QL1mCQhetQXYBbag==}
+ engines: {node: '>= 10'}
+ cpu: [arm]
+ os: [linux]
+
+ '@napi-rs/[email protected]':
+ resolution: {integrity: sha512-rDxgxRu69RvDlX/bh9o22DxLsGr8EqsNgotL9+RwQE1S0b0cqeatqsw6aW45mukm0B42DIAaAacKaYQ8cqS1nw==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [linux]
+ libc: [glibc]
+
+ '@napi-rs/[email protected]':
+ resolution: {integrity: sha512-GVSjntxKeA+/y/ZKf1F+cmUw1WeIkE5aMRPqnZUlBTBvBcrvgWccJAWuYCKPX4QJQwZILIIwhgdAbl51yj6fpA==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [linux]
+ libc: [glibc]
+
+ '@napi-rs/[email protected]':
+ resolution: {integrity: sha512-K3mDW66N+xT2/V439u1alFANiBUjdEx2gLiNYnCmUsva5jZMxWTjafBYwTzYK+EMFMHrUoabuU+T1BIP5CgbYQ==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [linux]
+ libc: [musl]
+
+ '@napi-rs/[email protected]':
+ resolution: {integrity: sha512-J51oK/axyZ13kxycumSMfLiDZMdWdOVvqDFI28BpuViZHE3A0bQfr8B5vg8YnPEnqLD3BSn1hkdlh2buspEcNQ==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [linux]
+ libc: [musl]
+
+ '@napi-rs/[email protected]':
+ resolution: {integrity: sha512-mooqUBTIsccZpnoQC4NgrC1v6C1vof39etLNMnBwCY+p0gajWJvAHLGQ6g/gGyS5YrpDW+GefSN4+Cvcr08UWw==}
+ engines: {node: '>= 10'}
+ cpu: [riscv64]
+ os: [linux]
+ libc: [glibc]
+
+ '@napi-rs/[email protected]':
+ resolution: {integrity: sha512-CtQgQjoVTX67jS9XuCTtJ40Sl7wRLMguoFnnGnfDmCWf7kzKFZVwj5ynqUOIGKFMSB61ZCuQlwPvVNxYTTseaw==}
+ engines: {node: '>= 10'}
+ cpu: [riscv64]
+ os: [linux]
+ libc: [glibc]
+
+ '@napi-rs/[email protected]':
+ resolution: {integrity: sha512-1eCvkDCazm7FFhsT7DfGOdSaHgZVK3bt/dSBl5EWHOWmnz+I7j8tPseJqqD81NF+MH21jKUK4wQSDjN0mdhnTg==}
+ engines: {node: '>= 10'}
+ cpu: [x64]
+ os: [linux]
+ libc: [glibc]
+
+ '@napi-rs/[email protected]':
+ resolution: {integrity: sha512-jtfzAHFp+FRaR7zGT4jyCe6wUgAG/dVb5A4Apd8FY9jKarntDfUAlJXscugiH7ZF5kKnu7/lHFk9LaDPcrGEVQ==}
+ engines: {node: '>= 10'}
+ cpu: [x64]
+ os: [linux]
+ libc: [glibc]
+
+ '@napi-rs/[email protected]':
+ resolution: {integrity: sha512-20arT6lnI19S68qNlii73TSEDbECNgzMz2EpldC1V3mZFuRkeujXkcebRk0LRJe9SEUAooYiLokfMViY8IX7yA==}
+ engines: {node: '>= 10'}
+ cpu: [x64]
+ os: [linux]
+ libc: [musl]
+
+ '@napi-rs/[email protected]':
+ resolution: {integrity: sha512-xTzaUCKUHTY4bCGadeeRZggbRVbGUT1petg7Z8r9AJR2+D9Bqu6nQAgqBGC6D47tA70LjaaaLTrJ7wNY1T74dg==}
+ engines: {node: '>= 10'}
+ cpu: [x64]
+ os: [linux]
+ libc: [musl]
+
+ '@napi-rs/[email protected]':
+ resolution: {integrity: sha512-DZFFT1wIAg37LJw37yhMRFfjATd3vTQzjZ1Yki8u2vhO6Hi5VE6BVaGQ1aaDu7xb4iMErz+9EOwjpS7xcxFeBw==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [win32]
+
+ '@napi-rs/[email protected]':
+ resolution: {integrity: sha512-ktVLuBkI6QVOm5BwO/WbdGwxgeetAMJa7TTmR8qBarXF0OU2NKjvjUtPJAl2y8t+zBRczJl/1VOl9gua6WcK2g==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [win32]
+
+ '@napi-rs/[email protected]':
+ resolution: {integrity: sha512-MyT1j3mHC2+Lu4pBi9mKyMJhtP6U7k7EldY7sj/uS5gJA65gTXt8MefJQXLJo5d/vZbuWmfxzkEUNc/urV3pHA==}
+ engines: {node: '>= 10'}
+ cpu: [x64]
+ os: [win32]
+
+ '@napi-rs/[email protected]':
+ resolution: {integrity: sha512-SGhlQ8bDjL1Cz2KnsKMasr/5sTcwG/SZkB6WCJxLsmSm/3aS2C+3p39bA7iZ2/94+NkVDySZfbiGoaSZSFHYxA==}
+ engines: {node: '>= 10'}
+ cpu: [x64]
+ os: [win32]
+
+ '@napi-rs/[email protected]':
+ resolution: {integrity: sha512-xglYA6q3XO5P3BNJYxVZ1IV7DLVjp1Py6nwag88YntrS+3vKHyYcMqXVS4ZztJmwz2uGvz1FWhI/4LgbR5uQDA==}
+ engines: {node: '>= 10'}
+
+ '@napi-rs/[email protected]':
+ resolution: {integrity: sha512-OlI657a5XXvKGFX7kNeIzJ8rO7IXt87Mqu2H8rXE46viAuOfum/JA7ysX7+eBhxNKznT+RCZh418mndlcFX3+w==}
+ engines: {node: '>= 10'}
+
resolution: {integrity: sha512-dKkkOzOSwFYe5RX6y26fZgkSpVAlIOJKQHIiydQcrWH6y/97+RceSOAdjZ14Qa3zLduVUy0TXcn+EiM6t4rPgw==}
@@ -1875,6 +2224,18 @@ packages:
'@tailwindcss/[email protected]':
resolution: {integrity: sha512-wgAVj6nUWAolAu8YFvzT2cTBIElWHkjZwFYovF+xsqKsW2ADxM/X2opxj5NsF/qVccAOjRNe8X2IdPzMsWyHTg==}
+ '@takumi-rs/[email protected]':
+ resolution: {integrity: sha512-J6Fl3QMDfV/zKdiTUzJ16VJSUX778imyoVkU90uoqe0Fc9lK1/DVCmTpXq87jTjnkokAb9w2Y1hCT1XnyxqnAg==}
+ engines: {node: '>=18'}
+ peerDependencies:
+ preact: ^10.0.0
+ react: ^18.0.0 || ^19.0.0
+ peerDependenciesMeta:
+ preact:
+ optional: true
+ react:
+ optional: true
+
'@ts-morph/[email protected]':
resolution: {integrity: sha512-Wf29UqxWDpc+i61k3oIOzcUfQt79PIT9y/MWfAGlrkjg6lBC1hwDECLXPVJAhWjiGbfBCxZd65F/LIZF3+jeJQ==}
@@ -1902,6 +2263,9 @@ packages:
resolution: {integrity: sha512-+qIYRKdNYJwY3vRCZMdJbPLJAtGjQBudzZzdzwQYkEPQd+PJGixUL5QfvCLDaULoLv+RhT3LDkwEfKaAkgSmNQ==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-te7NQcV2BOvdj2b1hCAHzAoMNuj65kNBMz0KBaxM6c3VGBOhU0dURQKOtH8CFNI/dsKkwlv32p26qYQTWoB5bw==}
+
resolution: {integrity: sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==}
peerDependencies:
@@ -2072,6 +2436,10 @@ packages:
resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==}
engines: {node: '>=6'}
+ resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==}
+ engines: {node: '>=6'}
+
resolution: {integrity: sha512-bOoxfJPyYo+ds6W0YfptaCWbFnJYjh2Y1Eow5lRv+vI2u8ganPZqNm1JwNh0t2ELQCqIWg4B3dWEusgAmsoyOw==}
@@ -2094,6 +2462,10 @@ packages:
resolution: {integrity: sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==}
+ resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==}
+ engines: {node: '>= 14.16.0'}
+
resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==}
engines: {node: '>= 20.19.0'}
@@ -2119,6 +2491,9 @@ packages:
resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==}
+ resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==}
+
resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}
engines: {node: '>=12'}
@@ -2221,6 +2596,10 @@ packages:
supports-color:
optional: true
+ resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==}
+ engines: {node: '>=0.10.0'}
+
resolution: {integrity: sha512-GtpQYB283KrPp6nRw50q3U9/VfOutZOe103qlN7BPP6Ad27xYnOIWv4lPzo8HCAL+mMZofJ9KEy30fq6MfaK6Q==}
@@ -2270,6 +2649,9 @@ packages:
resolution: {integrity: sha512-DPi0FmjiSU5EvQV0++GFDOJ9ASQUVFh5kD+OzOnYdi7n3Wpm9hWWGfB/O2blfHcMVTL5WkQXSnRiK9makhrcnw==}
engines: {node: '>=0.3.1'}
+ resolution: {integrity: sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==}
+
resolution: {integrity: sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==}
engines: {node: '>=12'}
@@ -2331,6 +2713,11 @@ packages:
resolution: {integrity: sha512-8Ja+rNJ0Lt56Pcf3TAmpBZjmx8ZcK5Ts4cAzIOjsjevg9oSXJnl6SUQ2EevU8tv3h6ZLWmoKL5H4fgWvdvfETw==}
+ resolution: {integrity: sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA==}
+ engines: {node: '>=18'}
+ hasBin: true
+
resolution: {integrity: sha512-sNR9MHpXSUV/XB4zmsFKN+QgVG82Cc7+/aaxJ8Adi8hyOac+EXptIp45QBPaVyX3N70664wRbTcLTOemCAnyqw==}
engines: {node: '>=18'}
@@ -2465,6 +2852,10 @@ packages:
resolution: {integrity: sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==}
engines: {node: '>= 18.0.0'}
+ resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==}
+ engines: {node: '>=8'}
+
resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==}
engines: {node: '>=12.20.0'}
@@ -2495,6 +2886,11 @@ packages:
resolution: {integrity: sha512-CTXd6rk/M3/ULNQj8FBqBWHYBVYybQ3VPBw0xGKFe3tuH7ytT6ACnvzpIQ3UZtB8yvUKC2cXn1a+x+5EVQLovA==}
engines: {node: '>=14.14'}
+ resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==}
+ engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
+ os: [darwin]
+
resolution: {integrity: sha512-o8N7YocCSdoehR7cTSYv9usvE3F5q0rrnoro3hGRnSI1SdolmeuxTbdfQgebaP61E7wAI4hIWgo7CzImGRT2Tw==}
peerDependencies:
@@ -3023,6 +3419,10 @@ packages:
resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==}
+ resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==}
+ engines: {node: '>=8'}
+
resolution: {integrity: sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==}
engines: {node: '>=18'}
@@ -3030,6 +3430,10 @@ packages:
resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==}
+ resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==}
+ hasBin: true
+
resolution: {integrity: sha512-NxVFwLAnrd9i7KUBxC4DrUhmgjzOs+1Qm50D3oF1/oL+r1NpZ4gA7xvG0/zJ8evR7zIKn4vLf7qTNduWFtCrRw==}
engines: {node: 20 || >=22}
@@ -3045,6 +3449,12 @@ packages:
resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==}
+ resolution: {integrity: sha512-3SEQqTpV9oqVsIWqAcmDuaNeo7yBO3tqPtqGRcKkEo0lrzD3wqbKG9mkxO65KoOgXqj+zH2phJ2LiAsdzlogSw==}
+
+ resolution: {integrity: sha512-G/hncXrl4Qt7mauJEXSg3AcdYzmpkIITTNl5I+rH9sog5Yw0kK6vseJjCaPfOXqOqQuPUP89Rkhfz5kPS8ijtw==}
+
resolution: {integrity: sha512-o5vL7aDWatOTX8LzaS1WMoaoxIiLRQJuIKKe2wAw6IeULDHaqbiqiggmx+pKvZDb1Sj+pE46Sn1T7lCqfFtg1Q==}
engines: {node: '>=16'}
@@ -3112,6 +3522,14 @@ packages:
resolution: {integrity: sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==}
engines: {node: '>=18'}
+ resolution: {integrity: sha512-3+B21mYK2IqUWnd2EivABLT7ueDhb0b8/dGK8LoFQPrU61YITeCMn14F7y7qZafWNZhUEKb24cJdiT5Wxs3prg==}
+ peerDependencies:
+ '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==}
@@ -3386,6 +3804,10 @@ packages:
resolution: {integrity: sha512-csuQ9x3Yr0cEIs/Zgx/OEt9iBw9vqIunAPQkx19R/fiMq2oGVTgcMqO/V3Ybqefr1TBvosI6jU539ksaBULJyA==}
+ resolution: {integrity: sha512-YgBpdJHPyQ2UE5x+hlSXcnejzAvD0b22U2OuAP+8OnlJT+PjWPxtgmGqKKc+RgTM63U9gN0YzrYc71R2WT/hTA==}
+ engines: {node: '>=18'}
+
resolution: {integrity: sha512-smsWv2LzFjP03xmvFoJ331ss6h+jixfA4UUV/Bsiyuu4YJPfN+FIQGOIiv4w9/+MoHkfkJ22UIaQWRVFRfH6Vw==}
engines: {node: '>=20'}
@@ -3412,6 +3834,18 @@ packages:
oxlint-tsgolint:
optional: true
+ resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==}
+ engines: {node: '>=6'}
+
+ resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==}
+ engines: {node: '>=6'}
+
resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==}
engines: {node: '>=6'}
@@ -3440,6 +3874,10 @@ packages:
resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==}
+ resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==}
+ engines: {node: '>=8'}
+
resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}
engines: {node: '>=8'}
@@ -3461,6 +3899,14 @@ packages:
resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==}
+ resolution: {integrity: sha512-DlOzet0HO7OEnmUmB6wWGJrrdvbyJKftI1bhMitK7O2N8W2gc757yyYBbINy9IDafXAV9wmKr9t7xsTaNKRG5Q==}
+ engines: {node: '>=20.16.0 || >=22.3.0'}
+
+ resolution: {integrity: sha512-YxFb+SQcodN2rnX9Tn3dHYlqfb7NjlzzfONPpJd+AKoKtUjEdevTfbC07d5TcczzOK6261auRkP/M8OBHs9vFQ==}
+ engines: {node: '>=22.13.0 || >=24'}
+
resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}
@@ -3476,6 +3922,10 @@ packages:
resolution: {integrity: sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==}
engines: {node: '>=16.20.0'}
+ resolution: {integrity: sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==}
+ engines: {node: '>=10.13.0'}
+
resolution: {integrity: sha512-orRsuYpJVw8LdAwqqLykBj9ecS5/cRHlI5+nvTo8LcCKmzDmqVORXtOIYEEQuL9D4BxtA1lm5isAqzQZCoQ6Eg==}
engines: {node: '>=4'}
@@ -3507,6 +3957,11 @@ packages:
resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==}
engines: {node: '>= 0.10'}
+ resolution: {integrity: sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==}
+ engines: {node: '>=10.13.0'}
+ hasBin: true
+
resolution: {integrity: sha512-6YHEFRL9mfgcAvql/XhwTvf5jKcOiiupt2FiJxHkiX1z4j7WL8J/jRHYLluORvc1XxB5rV20KoeK00gVJamspg==}
engines: {node: '>=0.6'}
@@ -3546,6 +4001,16 @@ packages:
react: '>=16.8.0'
react-dom: '>=16.8.0'
+ resolution: {integrity: sha512-kS/35staVCBqS29verTQJQZXw7RfsRCPO3fdJoW1KXylcv7A9dw6DZ3vJXC2w+bIBgLw5FN4pOFvKSQtkQhPfA==}
+ peerDependencies:
+ '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
resolution: {integrity: sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q==}
engines: {node: '>=10'}
@@ -3580,6 +4045,10 @@ packages:
resolution: {integrity: sha512-llUJLzz1zTUBrskt2pwZgLq59AemifIftw4aB7JxOqf1HY2FDaGDxgwpAPVzHU1kdWabH7FauP4i1oEeer2WCA==}
engines: {node: '>=0.10.0'}
+ resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==}
+ engines: {node: '>= 14.18.0'}
+
resolution: {integrity: sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==}
engines: {node: '>= 20.19.0'}
@@ -3649,6 +4118,9 @@ packages:
resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==}
engines: {node: '>=0.10.0'}
+ resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==}
+
resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==}
engines: {node: '>=4'}
@@ -3701,6 +4173,9 @@ packages:
resolution: {integrity: sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==}
engines: {node: '>= 18'}
+ resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==}
+
resolution: {integrity: sha512-kjnC1DXBHcxaOaOXBHBeRtltsDG2nUiUni+jP92M9gYdW12rsmx92UsfpH7o5tDRs7I1ZZPSQJQGv3UaRfCiuw==}
@@ -3849,6 +4324,15 @@ packages:
resolution: {integrity: sha512-HhKppgO81FQof5m6TEnuBWCZGgfRAWbaeOaGT00KOy/Pf/j6oUihdvBpA7ltCeAvZpFhW3j0PTclkxsd4IXYDA==}
+ resolution: {integrity: sha512-gYGZOUVRsI490cwC0WCNfFU5lGaZhWyr5i7udB6D7MrHwb3CzECbg40ECpieyKP3TBaVKC6lQwsg5UUJDsDSZw==}
+ engines: {node: '>=18'}
+ peerDependencies:
+ react: ^18.0.0 || ^19.0.0
+ peerDependenciesMeta:
+ react:
+ optional: true
+
resolution: {integrity: sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==}
engines: {node: '>=6'}
@@ -3903,6 +4387,11 @@ packages:
resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
+ resolution: {integrity: sha512-0Vb9eKU47njkxv/6B8CRZRDsxNDT/Pz+BIU+M5jw7xL3TdzAjSxlZUxu0xFL/kLpaG3sHZ0LH2wbK1T1yo7CUQ==}
+ engines: {node: '>=18.0.0'}
+ hasBin: true
+
resolution: {integrity: sha512-7bziOlRqH0hJx80h/3mbicLW7o8qLsH5+RaLR2t+OHM3D0JlWGODQKQ4cxbK7WlvmUxpcj6Kgu6EKqjrGFe3QQ==}
@@ -4030,6 +4519,9 @@ packages:
resolution: {integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==}
+ resolution: {integrity: sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==}
+
resolution: {integrity: sha512-eCzcf1LDi20+Fr0x9V3OkX92k0gxEQXaHajmhXHitsnk6SxPeshv8TBtBRqxyst8HI1uf2FyFVE7QS3jo1gkrw==}
peerDependencies:
@@ -4054,6 +4546,9 @@ packages:
resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==}
engines: {node: '>= 8'}
+ resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==}
+
resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==}
engines: {node: '>= 8'}
@@ -4064,6 +4559,10 @@ packages:
engines: {node: ^16.13.0 || >=18.0.0}
hasBin: true
+ resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==}
+ engines: {node: '>=8'}
+
resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==}
engines: {node: '>=10'}
@@ -4071,10 +4570,29 @@ packages:
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
+ resolution: {integrity: sha512-54dMVAo4WIe6SKy3vBgN+9bJZqqQ8IMRevAkOLQALhi49qkkQDQfWdAZ8KQlXiEabw88ARXXdUrlvtbKQX+aKw==}
+ engines: {node: '>=10.0.0'}
+ peerDependencies:
+ bufferutil: ^4.0.1
+ utf-8-validate: '>=5.0.2'
+ peerDependenciesMeta:
+ bufferutil:
+ optional: true
+ utf-8-validate:
+ optional: true
+
+ resolution: {integrity: sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw==}
+ engines: {node: '>=18'}
+
resolution: {integrity: sha512-g/eziiSUNBSsdDJtCLB8bdYEUMj4jR7AGeUo96p/3dTafgjHhpF4RiCFPiRILwjQoDXx5MqkBr4fwWtR3Ky4Wg==}
engines: {node: '>=20'}
+ resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==}
+
resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}
engines: {node: '>=10'}
@@ -4087,10 +4605,18 @@ packages:
engines: {node: '>= 14.6'}
hasBin: true
+ resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==}
+ engines: {node: '>=6'}
+
resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==}
engines: {node: '>=12'}
+ resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==}
+ engines: {node: '>=8'}
+
resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==}
engines: {node: '>=12'}
@@ -4352,81 +4878,156 @@ snapshots:
tslib: 2.8.1
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
+ '@esbuild/[email protected]':
+ optional: true
+
'@esbuild/[email protected]':
optional: true
@@ -4447,6 +5048,33 @@ snapshots:
'@floating-ui/[email protected]': {}
+ dependencies:
+ '@formepdf/renderer': 0.10.5([email protected])
+ chokidar: 4.0.3
+ open: 10.2.0
+ ws: 8.21.2
+ transitivePeerDependencies:
+ - bufferutil
+ - react
+ - utf-8-validate
+
+ dependencies:
+ '@formepdf/react': 0.10.5([email protected])
+ react: 19.2.5
+
+ dependencies:
+ react: 19.2.5
+
+ dependencies:
+ '@formepdf/core': 0.10.5([email protected])
+ '@formepdf/react': 0.10.5([email protected])
+ esbuild: 0.24.2
+ react: 19.2.5
+
dependencies:
hono: 4.12.15
@@ -4655,6 +5283,102 @@ snapshots:
outvariant: 1.4.3
strict-event-emitter: 0.5.1
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optionalDependencies:
+ '@napi-rs/canvas-android-arm64': 0.1.100
+ '@napi-rs/canvas-darwin-arm64': 0.1.100
+ '@napi-rs/canvas-darwin-x64': 0.1.100
+ '@napi-rs/canvas-linux-arm-gnueabihf': 0.1.100
+ '@napi-rs/canvas-linux-arm64-gnu': 0.1.100
+ '@napi-rs/canvas-linux-arm64-musl': 0.1.100
+ '@napi-rs/canvas-linux-riscv64-gnu': 0.1.100
+ '@napi-rs/canvas-linux-x64-gnu': 0.1.100
+ '@napi-rs/canvas-linux-x64-musl': 0.1.100
+ '@napi-rs/canvas-win32-arm64-msvc': 0.1.100
+ '@napi-rs/canvas-win32-x64-msvc': 0.1.100
+ optional: true
+
+ '@napi-rs/[email protected]':
+ optionalDependencies:
+ '@napi-rs/canvas-android-arm64': 1.0.3
+ '@napi-rs/canvas-darwin-arm64': 1.0.3
+ '@napi-rs/canvas-darwin-x64': 1.0.3
+ '@napi-rs/canvas-linux-arm-gnueabihf': 1.0.3
+ '@napi-rs/canvas-linux-arm64-gnu': 1.0.3
+ '@napi-rs/canvas-linux-arm64-musl': 1.0.3
+ '@napi-rs/canvas-linux-riscv64-gnu': 1.0.3
+ '@napi-rs/canvas-linux-x64-gnu': 1.0.3
+ '@napi-rs/canvas-linux-x64-musl': 1.0.3
+ '@napi-rs/canvas-win32-arm64-msvc': 1.0.3
+ '@napi-rs/canvas-win32-x64-msvc': 1.0.3
+ optional: true
+
'@next/[email protected]': {}
@@ -5710,6 +6434,10 @@ snapshots:
postcss: 8.5.10
tailwindcss: 4.2.4
+ optionalDependencies:
+ react: 19.2.5
+
'@ts-morph/[email protected]':
dependencies:
fast-glob: 3.3.3
@@ -5742,6 +6470,10 @@ snapshots:
dependencies:
undici-types: 7.19.2
+ '@types/[email protected]':
+ dependencies:
+ '@types/node': 25.6.0
+
dependencies:
'@types/react': 19.2.14
@@ -5874,6 +6606,8 @@ snapshots:
+
@@ -5888,6 +6622,10 @@ snapshots:
+ dependencies:
+ readdirp: 4.1.2
+
dependencies:
readdirp: 5.0.0
@@ -5908,6 +6646,12 @@ snapshots:
+ dependencies:
+ string-width: 4.2.3
+ strip-ansi: 6.0.1
+ wrap-ansi: 6.2.0
+
dependencies:
string-width: 4.2.3
@@ -5988,6 +6732,8 @@ snapshots:
dependencies:
ms: 2.1.3
+
dependencies:
character-entities: 2.0.2
@@ -6019,6 +6765,8 @@ snapshots:
+
@@ -6079,6 +6827,34 @@ snapshots:
esast-util-from-estree: 2.0.0
vfile-message: 4.0.3
+ optionalDependencies:
+ '@esbuild/aix-ppc64': 0.24.2
+ '@esbuild/android-arm': 0.24.2
+ '@esbuild/android-arm64': 0.24.2
+ '@esbuild/android-x64': 0.24.2
+ '@esbuild/darwin-arm64': 0.24.2
+ '@esbuild/darwin-x64': 0.24.2
+ '@esbuild/freebsd-arm64': 0.24.2
+ '@esbuild/freebsd-x64': 0.24.2
+ '@esbuild/linux-arm': 0.24.2
+ '@esbuild/linux-arm64': 0.24.2
+ '@esbuild/linux-ia32': 0.24.2
+ '@esbuild/linux-loong64': 0.24.2
+ '@esbuild/linux-mips64el': 0.24.2
+ '@esbuild/linux-ppc64': 0.24.2
+ '@esbuild/linux-riscv64': 0.24.2
+ '@esbuild/linux-s390x': 0.24.2
+ '@esbuild/linux-x64': 0.24.2
+ '@esbuild/netbsd-arm64': 0.24.2
+ '@esbuild/netbsd-x64': 0.24.2
+ '@esbuild/openbsd-arm64': 0.24.2
+ '@esbuild/openbsd-x64': 0.24.2
+ '@esbuild/sunos-x64': 0.24.2
+ '@esbuild/win32-arm64': 0.24.2
+ '@esbuild/win32-ia32': 0.24.2
+ '@esbuild/win32-x64': 0.24.2
+
optionalDependencies:
'@esbuild/aix-ppc64': 0.28.0
@@ -6292,6 +7068,11 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ dependencies:
+ locate-path: 5.0.0
+ path-exists: 4.0.0
+
dependencies:
fetch-blob: 3.2.0
@@ -6315,6 +7096,9 @@ snapshots:
jsonfile: 6.2.1
universalify: 2.0.1
+ optional: true
+
dependencies:
'@orama/orama': 3.1.18
@@ -6774,6 +7558,10 @@ snapshots:
+ dependencies:
+ p-locate: 4.1.0
+
dependencies:
chalk: 5.6.2
@@ -6781,6 +7569,10 @@ snapshots:
+ dependencies:
+ js-tokens: 4.0.0
+
@@ -6795,6 +7587,10 @@ snapshots:
dependencies:
'@jridgewell/sourcemap-codec': 1.5.5
+
+
@@ -6968,6 +7764,10 @@ snapshots:
+ optionalDependencies:
+ '@types/react': 19.2.14
+
@@ -7390,6 +8190,13 @@ snapshots:
regex: 6.1.0
regex-recursion: 6.0.2
+ dependencies:
+ default-browser: 5.5.0
+ define-lazy-prop: 3.0.0
+ is-inside-container: 1.0.0
+ wsl-utils: 0.1.0
+
dependencies:
default-browser: 5.5.0
@@ -7459,6 +8266,16 @@ snapshots:
'@oxlint/binding-win32-ia32-msvc': 1.61.0
'@oxlint/binding-win32-x64-msvc': 1.61.0
+ dependencies:
+ p-try: 2.2.0
+
+ dependencies:
+ p-limit: 2.3.0
+
+
dependencies:
callsites: 3.1.0
@@ -7492,6 +8309,8 @@ snapshots:
+
@@ -7507,6 +8326,14 @@ snapshots:
+ optionalDependencies:
+ '@napi-rs/canvas': 0.1.100
+
+ optionalDependencies:
+ '@napi-rs/canvas': 1.0.3
+
@@ -7515,6 +8342,8 @@ snapshots:
+
dependencies:
cssesc: 3.0.0
@@ -7550,6 +8379,12 @@ snapshots:
forwarded: 0.2.0
ipaddr.js: 1.9.1
+ dependencies:
+ dijkstrajs: 1.0.3
+ pngjs: 5.0.0
+ yargs: 15.4.1
+
dependencies:
side-channel: 1.1.0
@@ -7638,6 +8473,21 @@ snapshots:
react: 19.2.5
react-dom: 19.2.5([email protected])
+ dependencies:
+ clsx: 2.1.1
+ dequal: 2.0.3
+ make-cancellable-promise: 2.0.0
+ make-event-props: 2.0.0
+ merge-refs: 2.0.0(@types/[email protected])
+ pdfjs-dist: 5.4.296
+ react: 19.2.5
+ react-dom: 19.2.5([email protected])
+ tiny-invariant: 1.3.3
+ warning: 4.0.3
+ optionalDependencies:
+ '@types/react': 19.2.14
+
dependencies:
react: 19.2.5
@@ -7667,6 +8517,8 @@ snapshots:
+
@@ -7794,6 +8646,8 @@ snapshots:
+
@@ -7859,6 +8713,8 @@ snapshots:
transitivePeerDependencies:
- supports-color
+
@@ -8066,6 +8922,14 @@ snapshots:
+ dependencies:
+ '@takumi-rs/helpers': 2.5.11([email protected])
+ optionalDependencies:
+ react: 19.2.5
+ transitivePeerDependencies:
+ - preact
+
@@ -8112,6 +8976,12 @@ snapshots:
+ dependencies:
+ esbuild: 0.28.0
+ optionalDependencies:
+ fsevents: 2.3.3
+
@@ -8248,6 +9118,10 @@ snapshots:
'@types/unist': 3.0.3
vfile-message: 4.0.3
+ dependencies:
+ loose-envify: 1.4.0
+
optionalDependencies:
react: 19.2.5
@@ -8257,6 +9131,8 @@ snapshots:
+
dependencies:
isexe: 2.0.0
@@ -8265,6 +9141,12 @@ snapshots:
dependencies:
isexe: 3.1.5
+ dependencies:
+ ansi-styles: 4.3.0
+ string-width: 4.2.3
+ strip-ansi: 6.0.1
+
dependencies:
ansi-styles: 4.3.0
@@ -8273,19 +9155,46 @@ snapshots:
+
+ dependencies:
+ is-wsl: 3.1.1
+
dependencies:
is-wsl: 3.1.1
powershell-utils: 0.1.0
+
+ dependencies:
+ camelcase: 5.3.1
+ decamelize: 1.2.0
+
+ dependencies:
+ cliui: 6.0.0
+ decamelize: 1.2.0
+ find-up: 4.1.0
+ get-caller-file: 2.0.5
+ require-directory: 2.1.1
+ require-main-filename: 2.0.0
+ set-blocking: 2.0.0
+ string-width: 4.2.3
+ which-module: 2.0.1
+ y18n: 4.0.3
+ yargs-parser: 18.1.3
+
dependencies:
cliui: 8.0.1
diff --git a/public/r/forme/alert.json b/public/r/forme/alert.json
new file mode 100644
index 0000000..65cc5cd
--- /dev/null
+++ b/public/r/forme/alert.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/alert",
+ "title": "Alert",
+ "description": "Alert PDF component (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/components/alert/alert.tsx",
+ "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport type { ReactNode } from \"react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { Circle, Line, Path, Svg } from \"../../lib/forme-svg\";\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\n\nexport type AlertVariant = \"info\" | \"success\" | \"warning\" | \"error\";\n\n/**\n * Alert box with severity variants for info, success, warning, and error states.\n * Props - `variant` | `title` | `children` | `showIcon` | `showBorder` | `style`\n * @see {@link PdfAlertProps}\n */\nexport interface PdfAlertProps extends Omit<PDFComponentProps, \"children\"> {\n /**\n * @default 'info'\n */\n variant?: AlertVariant;\n title?: string;\n children?: ReactNode;\n /**\n * @default true\n */\n showIcon?: boolean;\n /**\n * @default true\n */\n showBorder?: boolean;\n}\n\n/** Stroke width for all alert SVG icons (SVG user units). */\nconst ICON_STROKE_WIDTH = 1.5;\n\nconst SvgWrap = ({ children }: { children: ReactNode }) => (\n <Svg width={16} height={16} viewBox=\"0 0 16 16\">\n {children}\n </Svg>\n);\n\nconst ICON_MAP = {\n error: ({ color }: { color: string }) => (\n <SvgWrap>\n <Circle\n cx={8}\n cy={8}\n r={7}\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n />\n <Line\n x1={5.5}\n y1={5.5}\n x2={10.5}\n y2={10.5}\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n />\n <Line\n x1={10.5}\n y1={5.5}\n x2={5.5}\n y2={10.5}\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n />\n </SvgWrap>\n ),\n info: ({ color }: { color: string }) => (\n <SvgWrap>\n <Circle\n cx={8}\n cy={8}\n r={7}\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n />\n <Circle cx={8} cy={4.5} r={1} fill={color} />\n <Line\n x1={8}\n y1={7}\n x2={8}\n y2={11.5}\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n />\n </SvgWrap>\n ),\n success: ({ color }: { color: string }) => (\n <SvgWrap>\n <Circle\n cx={8}\n cy={8}\n r={7}\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n />\n <Path\n d=\"M5 8 L7 10 L11 6\"\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </SvgWrap>\n ),\n warning: ({ color }: { color: string }) => (\n <SvgWrap>\n <Path\n d=\"M8 1.5 L15 14.5 L1 14.5 Z\"\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinejoin=\"round\"\n />\n <Line\n x1={8}\n y1={6}\n x2={8}\n y2={10}\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n />\n <Circle cx={8} cy={12.5} r={0.75} fill={color} />\n </SvgWrap>\n ),\n};\n\nfunction AlertIcon({\n variant,\n color,\n}: {\n variant: AlertVariant;\n color: string;\n}) {\n const Icon = ICON_MAP[variant];\n return <Icon color={color} />;\n}\n\nfunction createAlertStyles(theme: PdfcnTheme) {\n const { typography, colors, primitives } = theme;\n\n const variantColors = {\n error: colors.destructive ?? \"#EF4444\",\n info: colors.info ?? \"#3B82F6\",\n success: colors.success ?? \"#22C55E\",\n warning: colors.warning ?? \"#F59E0B\",\n } satisfies Record<AlertVariant, string>;\n\n const bl = (color: string) => ({\n borderLeftColor: color,\n borderLeftWidth: 4,\n });\n\n const sheet = StyleSheet.create({\n bg: {\n backgroundColor: colors.muted,\n },\n borderError: bl(variantColors.error),\n borderInfo: bl(variantColors.info),\n borderSuccess: bl(variantColors.success),\n borderWarning: bl(variantColors.warning),\n container: {\n borderRadius: 4,\n flexDirection: \"row\",\n marginBottom: theme.spacing.componentGap,\n padding: 12,\n },\n contentContainer: { flex: 1 },\n description: {\n color: colors.mutedForeground,\n fontFamily: typography.body.fontFamily,\n fontSize: primitives.typography.sm,\n lineHeight: typography.body.lineHeight,\n },\n iconContainer: {\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n marginRight: 10,\n paddingTop: 2,\n width: 20,\n },\n title: {\n color: colors.foreground,\n fontFamily: typography.heading.fontFamily,\n fontSize: primitives.typography.sm,\n fontWeight: primitives.fontWeights.semibold,\n marginBottom: 4,\n },\n });\n\n return {\n ...sheet,\n borderMap: {\n error: sheet.borderError,\n info: sheet.borderInfo,\n success: sheet.borderSuccess,\n warning: sheet.borderWarning,\n } as Record<AlertVariant, Style>,\n /** Resolved hex colors for each variant — used to tint the SVG icons. */\n variantColors,\n };\n}\n\nexport function PdfAlert({\n variant = \"info\",\n title,\n children,\n showIcon = true,\n showBorder = true,\n style,\n}: PdfAlertProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createAlertStyles(theme), [theme]);\n\n if (!title && !children) {return null;}\n\n const containerStyles: Style[] = [\n styles.container,\n styles.bg,\n ...(showBorder ? [styles.borderMap[variant]] : []),\n ...(style ? [style].flat() : []),\n ];\n\n return (\n <View wrap={false} style={containerStyles as never}>\n {showIcon && (\n <View style={styles.iconContainer}>\n <AlertIcon variant={variant} color={styles.variantColors[variant]} />\n </View>\n )}\n <View style={styles.contentContainer}>\n {title && <PDFText style={styles.title}>{title}</PDFText>}\n {typeof children === \"string\" ? (\n <PDFText style={styles.description}>{children}</PDFText>\n ) : (\n children\n )}\n </View>\n </View>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/alert/index.ts",
+ "content": "export { PdfAlert, type PdfAlertProps, type AlertVariant } from \"./alert\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/forme/badge.json b/public/r/forme/badge.json
new file mode 100644
index 0000000..daa544c
--- /dev/null
+++ b/public/r/forme/badge.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/badge",
+ "title": "Badge",
+ "description": "Badge PDF component (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/components/badge/badge.tsx",
+ "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type BadgeVariant =\n | \"default\"\n | \"primary\"\n | \"success\"\n | \"warning\"\n | \"destructive\"\n | \"info\"\n | \"outline\";\nexport type BadgeSize = \"sm\" | \"md\" | \"lg\";\n\n/**\n * Inline label for status, tags, or categories.\n *\n * Accepts text via either `label` prop or `children` (string). `label` takes\n * precedence when both are provided. The children pattern (`<Badge>text</Badge>`)\n * is supported for compatibility with common React idioms, but note that\n * `@formepdf/react` doesn't support JSX children the way HTML does — only\n * string children are accepted.\n *\n * Props - `label` | `children` | `variant` | `size` | `background` | `color` | `style`\n * @see {@link BadgeProps}\n */\nexport interface BadgeProps extends Omit<PDFComponentProps, \"children\"> {\n /** Text to display. Takes precedence over children when both are provided. */\n label?: string;\n /** String children as an alternative to the label prop. */\n children?: string;\n /**\n * @default 'default'\n */\n variant?: BadgeVariant;\n /**\n * @default 'md'\n */\n size?: BadgeSize;\n background?: string;\n color?: string;\n}\n\nfunction createBadgeStyles(t: PdfcnTheme) {\n const { spacing, borderRadius, fontWeights } = t.primitives;\n const c = t.colors;\n const textBase = {\n fontFamily: t.typography.body.fontFamily,\n fontWeight: fontWeights.semibold,\n letterSpacing: 0.3,\n };\n const variantBox = (borderColor: string, bgColor: string = c.muted) => ({\n backgroundColor: bgColor,\n borderColor,\n borderStyle: \"solid\" as const,\n borderWidth: spacing[0.5],\n });\n const sheet = StyleSheet.create({\n containerBase: {\n alignItems: \"center\" as const,\n alignSelf: \"flex-start\" as const,\n borderRadius: borderRadius.full,\n flexDirection: \"row\" as const,\n },\n sizeLg: { paddingHorizontal: spacing[4], paddingVertical: spacing[2] },\n sizeMd: { paddingHorizontal: spacing[3], paddingVertical: spacing[1] },\n sizeSm: { paddingHorizontal: spacing[2], paddingVertical: spacing[0.5] },\n textDefault: { ...textBase, color: c.mutedForeground },\n textDestructive: { ...textBase, color: c.destructive },\n textInfo: { ...textBase, color: c.info },\n textLg: { fontSize: t.primitives.typography.sm },\n textMd: { fontSize: t.primitives.typography.xs },\n textOutline: { ...textBase, color: c.foreground },\n textPrimary: { ...textBase, color: c.primaryForeground },\n textSm: { fontSize: t.primitives.typography.xs - 1 },\n textSuccess: { ...textBase, color: c.success },\n textWarning: { ...textBase, color: c.warning },\n variantDefault: variantBox(c.border),\n variantDestructive: variantBox(c.destructive),\n variantInfo: variantBox(c.info),\n variantOutline: variantBox(c.border, c.background),\n variantPrimary: variantBox(c.primary, c.primary),\n variantSuccess: variantBox(c.success),\n variantWarning: variantBox(c.warning),\n });\n return {\n ...sheet,\n containerSizeMap: {\n sm: sheet.sizeSm,\n md: sheet.sizeMd,\n lg: sheet.sizeLg,\n } as Record<BadgeSize, Style>,\n containerVariantMap: {\n default: sheet.variantDefault,\n primary: sheet.variantPrimary,\n success: sheet.variantSuccess,\n warning: sheet.variantWarning,\n destructive: sheet.variantDestructive,\n info: sheet.variantInfo,\n outline: sheet.variantOutline,\n } as Record<BadgeVariant, Style>,\n textSizeMap: {\n sm: sheet.textSm,\n md: sheet.textMd,\n lg: sheet.textLg,\n } as Record<BadgeSize, Style>,\n textVariantMap: {\n default: sheet.textDefault,\n primary: sheet.textPrimary,\n success: sheet.textSuccess,\n warning: sheet.textWarning,\n destructive: sheet.textDestructive,\n info: sheet.textInfo,\n outline: sheet.textOutline,\n } as Record<BadgeVariant, Style>,\n };\n}\n\nexport function Badge({\n label,\n children,\n variant = \"default\",\n size = \"md\",\n background,\n color,\n style,\n}: BadgeProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createBadgeStyles(theme), [theme]);\n // `label` takes precedence; fall back to string children for React idiom compatibility\n const text = label ?? children ?? \"\";\n const containerStyles: Style[] = [\n styles.containerBase,\n styles.containerVariantMap[variant],\n styles.containerSizeMap[size],\n ...(background\n ? [{ backgroundColor: resolveColor(background, theme.colors) }]\n : []),\n ...(style ? [style].flat() : []),\n ];\n const textStyles: Style[] = [\n styles.textVariantMap[variant],\n styles.textSizeMap[size],\n ...(color ? [{ color: resolveColor(color, theme.colors) }] : []),\n ];\n return (\n <View style={containerStyles as never}>\n <PDFText style={textStyles as never}>{text}</PDFText>\n </View>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/badge/index.ts",
+ "content": "export {\n Badge,\n type BadgeProps,\n type BadgeVariant,\n type BadgeSize,\n} from \"./badge\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/forme/card.json b/public/r/forme/card.json
new file mode 100644
index 0000000..8583aaf
--- /dev/null
+++ b/public/r/forme/card.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/card",
+ "title": "Card",
+ "description": "Card PDF component (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/components/card/card.tsx",
+ "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport type { ReactNode } from \"react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\n\nexport type CardVariant = \"default\" | \"bordered\" | \"muted\";\n\n/**\n * Bordered content card with optional title and padding presets.\n * Props - `title` | `children` | `variant` | `padding` | `wrap` | `style`\n * @see {@link PdfCardProps}\n */\nexport interface PdfCardProps extends Omit<PDFComponentProps, \"children\"> {\n title?: string;\n children?: ReactNode;\n /**\n * @default 'default'\n */\n variant?: CardVariant;\n /**\n * @default 'md'\n */\n padding?: \"sm\" | \"md\" | \"lg\";\n /**\n * When false, the card will not split across PDF pages.\n * @default false\n */\n wrap?: boolean;\n}\n\nfunction createCardStyles(t: PdfcnTheme) {\n const { spacing, borderRadius, fontWeights } = t.primitives;\n return StyleSheet.create({\n body: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n lineHeight: t.typography.body.lineHeight,\n },\n card: {\n backgroundColor: t.colors.background,\n borderColor: t.colors.border,\n borderRadius: borderRadius.sm,\n borderStyle: \"solid\",\n borderWidth: 1,\n marginBottom: t.spacing.componentGap,\n },\n cardBordered: { borderWidth: 2 },\n cardMuted: { backgroundColor: t.colors.muted },\n paddingLg: { padding: spacing[4] },\n paddingMd: { padding: spacing[3] },\n paddingSm: { padding: spacing[2] },\n title: {\n borderBottomColor: t.colors.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n color: t.colors.foreground,\n fontFamily: t.typography.heading.fontFamily,\n fontSize: t.primitives.typography.base,\n fontWeight: fontWeights.semibold,\n lineHeight: t.typography.heading.lineHeight,\n marginBottom: spacing[2],\n paddingBottom: spacing[1] + 2,\n },\n });\n}\n\nexport function PdfCard({\n title,\n children,\n variant = \"default\",\n padding = \"md\",\n wrap = false,\n style,\n}: PdfCardProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createCardStyles(theme), [theme]);\n const paddingMap = {\n lg: styles.paddingLg,\n md: styles.paddingMd,\n sm: styles.paddingSm,\n };\n const cardStyles: Style[] = [styles.card];\n if (variant === \"bordered\") {cardStyles.push(styles.cardBordered);}\n if (variant === \"muted\") {cardStyles.push(styles.cardMuted);}\n cardStyles.push(paddingMap[padding]);\n if (style) {cardStyles.push(style);}\n return (\n <View wrap={wrap} style={cardStyles as never}>\n {title ? <PDFText style={styles.title}>{title}</PDFText> : null}\n {typeof children === \"string\" ? (\n <PDFText style={styles.body}>{children}</PDFText>\n ) : (\n children\n )}\n </View>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/card/index.ts",
+ "content": "export { PdfCard, type PdfCardProps, type CardVariant } from \"./card\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/forme/data-table.json b/public/r/forme/data-table.json
new file mode 100644
index 0000000..0f8a5b4
--- /dev/null
+++ b/public/r/forme/data-table.json
@@ -0,0 +1,37 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/data-table",
+ "title": "Data Table",
+ "description": "Data Table PDF component (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils",
+ "forme/table"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/components/data-table/data-table.styles.ts",
+ "content": "import { StyleSheet } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\n/**\n * Creates compact-mode cell and text styles for the DataTable component.\n * Used when `size=\"compact\"` to render denser rows with smaller font sizes.\n * @param t - The resolved PdfcnTheme instance.\n */\nexport function createCompactStyles(t: PdfcnTheme) {\n const { spacing, fontWeights, lineHeights } = t.primitives;\n return StyleSheet.create({\n cell: {\n paddingHorizontal: spacing[2],\n paddingVertical: spacing[0.5],\n },\n footerText: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n fontWeight: fontWeights.semibold,\n lineHeight: lineHeights.normal,\n },\n headerText: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n fontWeight: fontWeights.semibold,\n lineHeight: lineHeights.normal,\n },\n text: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n lineHeight: lineHeights.normal,\n },\n });\n}\n\n/**\n * Converts an arbitrary cell value to a display string.\n * Returns an empty string for null/undefined values.\n * @param value - The raw cell value to format.\n */\nexport function formatValue(value: unknown): string {\n if (value === null || value === undefined) {return \"\";}\n if (typeof value === \"number\") {return String(value);}\n return String(value);\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/data-table/data-table.tsx",
+ "content": "import { Text as PDFText } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport { Fragment } from \"react\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport {\n Table,\n TableBody,\n TableCell,\n TableFooter,\n TableHeader,\n TableRow,\n} from \"../table\";\nimport { createCompactStyles, formatValue } from \"./data-table.styles\";\nimport type { DataTableProps } from \"./data-table.types\";\n\nexport function DataTable<T extends Record<string, unknown>>({\n columns,\n data,\n variant = \"grid\",\n footer,\n stripe = false,\n size = \"default\",\n noWrap = false,\n style,\n}: DataTableProps<T>) {\n const theme = usePdfcnTheme();\n const compact = useSafeMemo(() => createCompactStyles(theme), [theme]);\n const isCompact = size === \"compact\";\n\n return (\n <Table variant={variant} zebraStripe={stripe} noWrap={noWrap} style={style}>\n <TableHeader>\n <TableRow header>\n {columns.map((col) => (\n <TableCell\n key={col.key}\n header\n align={col.align ?? \"left\"}\n width={col.width}\n style={isCompact ? compact.cell : undefined}\n >\n {isCompact ? (\n <PDFText\n style={\n [\n compact.headerText,\n col.align ? ({ textAlign: col.align } as Style) : {},\n ] as never\n }\n >\n {col.header}\n </PDFText>\n ) : (\n col.header\n )}\n </TableCell>\n ))}\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.map((row, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: DataTable has no row id; order is stable for static data\n <Fragment key={i}>\n <TableRow>\n {columns.map((col) => {\n const value = row[col.key];\n const rendered = col.render ? col.render(value, row) : null;\n const text = rendered === null ? formatValue(value) : null;\n return (\n <TableCell\n key={col.key}\n align={col.align ?? \"left\"}\n width={col.width}\n style={isCompact ? compact.cell : undefined}\n >\n {isCompact ? (\n rendered !== null ? (\n rendered\n ) : (\n <PDFText\n style={\n [\n compact.text,\n col.align\n ? ({ textAlign: col.align } as Style)\n : {},\n ] as never\n }\n >\n {text}\n </PDFText>\n )\n ) : (rendered !== null ? (\n rendered\n ) : (\n text\n ))}\n </TableCell>\n );\n })}\n </TableRow>\n </Fragment>\n ))}\n </TableBody>\n {footer && (\n <TableFooter>\n <TableRow footer>\n {columns.map((col) => {\n const value = col.key in footer ? footer[col.key] : \"\";\n const rendered = col.renderFooter\n ? col.renderFooter(value)\n : null;\n const text = rendered === null ? formatValue(value) : null;\n return (\n <TableCell\n key={col.key}\n footer={!!value}\n align={col.align ?? \"left\"}\n width={col.width}\n style={isCompact ? compact.cell : undefined}\n >\n {isCompact ? (\n rendered !== null ? (\n rendered\n ) : (\n <PDFText\n style={\n [\n value ? compact.footerText : compact.text,\n col.align\n ? ({ textAlign: col.align } as Style)\n : {},\n ] as never\n }\n >\n {text}\n </PDFText>\n )\n ) : (rendered !== null ? (\n rendered\n ) : (\n text\n ))}\n </TableCell>\n );\n })}\n </TableRow>\n </TableFooter>\n )}\n </Table>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/data-table/data-table.types.ts",
+ "content": "import type React from \"react\";\n\nimport type { PDFComponentProps } from \"@/registry/themes\";\n\nimport type { TableVariant } from \"../table/table.types\";\n\n/** DataTable row density size. */\nexport type DataTableSize = \"default\" | \"compact\";\n\n/**\n * Column definition for a DataTable.\n * Props - `key` | `header` | `align` | `width` | `render` | `renderFooter`\n * @see {@link DataTableColumn}\n */\nexport interface DataTableColumn<T = Record<string, unknown>> {\n key: keyof T & string;\n header: string;\n align?: \"left\" | \"center\" | \"right\";\n width?: string | number;\n /**\n * Custom cell renderer. Must return @formepdf/react elements (Text, View,\n * Image, etc.) — NOT HTML DOM elements. TypeScript accepts ReactNode but DOM\n * nodes will crash at runtime in the PDF renderer.\n */\n render?: (value: unknown, row: T) => React.ReactNode;\n /**\n * Custom footer cell renderer. Same constraint: return @formepdf/react\n * elements only — no HTML/DOM nodes.\n */\n renderFooter?: (value: unknown) => React.ReactNode;\n}\n\n/**\n * Data table for PDF rendering with column definitions, footer support, and stripe options.\n * Props - `columns` | `data` | `variant` | `footer` | `stripe` | `size` | `noWrap` | `style`\n * @see {@link DataTableProps}\n */\nexport interface DataTableProps<T = Record<string, unknown>> extends Omit<\n PDFComponentProps,\n \"children\"\n> {\n columns: DataTableColumn<T>[];\n data: T[];\n /**\n * @default 'grid'\n */\n variant?: TableVariant;\n footer?: Partial<Record<keyof T & string, string | number>>;\n stripe?: boolean;\n /**\n * @default 'default'\n */\n size?: DataTableSize;\n noWrap?: boolean;\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/data-table/index.ts",
+ "content": "export { DataTable } from \"./data-table\";\nexport type {\n DataTableProps,\n DataTableColumn,\n DataTableSize,\n} from \"./data-table.types\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/forme/divider.json b/public/r/forme/divider.json
new file mode 100644
index 0000000..8b875f2
--- /dev/null
+++ b/public/r/forme/divider.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/divider",
+ "title": "Divider",
+ "description": "Divider PDF component (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/components/divider/divider.tsx",
+ "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type DividerVariant = \"solid\" | \"dashed\" | \"dotted\";\nexport type DividerThickness = \"thin\" | \"medium\" | \"thick\";\nexport type DividerSpacing = \"none\" | \"sm\" | \"md\" | \"lg\";\n\n/**\n * Horizontal rule with optional label, style variants, and spacing presets.\n * Props - `spacing` | `variant` | `color` | `thickness` | `label` | `width` | `style`\n * @see {@link DividerProps}\n */\nexport interface DividerProps extends Omit<PDFComponentProps, \"children\"> {\n /**\n * @default 'md'\n */\n spacing?: DividerSpacing;\n /**\n * @default 'solid'\n */\n variant?: DividerVariant;\n color?: string;\n /**\n * @default 'thin'\n */\n thickness?: DividerThickness;\n label?: string;\n width?: string | number;\n}\n\nfunction createDividerStyles(t: PdfcnTheme) {\n const { spacing, fontWeights } = t.primitives;\n return StyleSheet.create({\n base: { borderBottomColor: t.colors.border, borderBottomStyle: \"solid\" },\n dashed: { borderBottomStyle: \"dashed\" },\n dotted: { borderBottomStyle: \"dotted\" },\n labelContainer: { alignItems: \"center\", flexDirection: \"row\" },\n labelLine: {\n borderBottomColor: t.colors.border,\n borderBottomStyle: \"solid\",\n flex: 1,\n },\n labelText: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n fontWeight: fontWeights.medium,\n letterSpacing: t.primitives.letterSpacing.wider * 10,\n paddingHorizontal: spacing[3],\n textTransform: \"uppercase\",\n },\n medium: { borderBottomWidth: spacing[1] },\n solid: { borderBottomStyle: \"solid\" },\n spacingLg: { marginVertical: t.spacing.sectionGap },\n spacingMd: { marginVertical: t.spacing.componentGap },\n spacingNone: { marginVertical: spacing[0] },\n spacingSm: { marginVertical: t.spacing.paragraphGap },\n thick: { borderBottomWidth: spacing[2] },\n thin: { borderBottomWidth: spacing[0.5] },\n } as any);\n}\n\nexport function Divider({\n spacing = \"md\",\n variant = \"solid\",\n color,\n thickness = \"thin\",\n label,\n width,\n style,\n}: DividerProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createDividerStyles(theme), [theme]);\n const spacingMap = {\n lg: styles.spacingLg,\n md: styles.spacingMd,\n none: styles.spacingNone,\n sm: styles.spacingSm,\n };\n const variantMap = {\n dashed: styles.dashed,\n dotted: styles.dotted,\n solid: styles.solid,\n };\n const thicknessMap = {\n medium: styles.medium,\n thick: styles.thick,\n thin: styles.thin,\n };\n\n if (label) {\n const lineStyle: Style[] = [\n styles.labelLine,\n thicknessMap[thickness],\n variantMap[variant],\n ];\n if (color)\n {lineStyle.push({ borderBottomColor: resolveColor(color, theme.colors) } as any);}\n const containerStyles: Style[] = [\n styles.labelContainer,\n spacingMap[spacing],\n ];\n if (width !== undefined) {containerStyles.push({ width } as Style);}\n if (style) {containerStyles.push(...[style].flat());}\n const labelTextStyle: Style[] = [styles.labelText];\n if (color)\n {labelTextStyle.push({ color: resolveColor(color, theme.colors) });}\n return (\n <View style={containerStyles as never}>\n <View style={lineStyle as never} />\n <PDFText style={labelTextStyle as never}>{label}</PDFText>\n <View style={lineStyle as never} />\n </View>\n );\n }\n\n const styleArray: Style[] = [\n styles.base,\n spacingMap[spacing],\n variantMap[variant],\n thicknessMap[thickness],\n ];\n if (color)\n {styleArray.push({ borderBottomColor: resolveColor(color, theme.colors) });}\n if (width !== undefined) {styleArray.push({ width } as Style);}\n if (style) {styleArray.push(...[style].flat());}\n return <View style={styleArray as never} />;\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/divider/index.ts",
+ "content": "export {\n Divider,\n type DividerProps,\n type DividerVariant,\n type DividerThickness,\n type DividerSpacing,\n} from \"./divider\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/forme/form.json b/public/r/forme/form.json
new file mode 100644
index 0000000..e7e728a
--- /dev/null
+++ b/public/r/forme/form.json
@@ -0,0 +1,36 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/form",
+ "title": "Form",
+ "description": "Form PDF component (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/components/form/form.styles.ts",
+ "content": "import { StyleSheet } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport type { PdfFormVariant } from \"./form.types\";\n\n/** Style factory for fillable form layouts, derived from the active theme. */\nexport function createFormStyles(\n t: PdfcnTheme,\n variant: PdfFormVariant = \"underline\"\n) {\n const { spacing, borderRadius, fontWeights, typography } = t.primitives;\n const borderColor = t.colors.border;\n const hairline = 0.75; // lighter than spacing[0.5]=2pt — more refined\n const rule = 1; // group title rule\n\n const fieldAreaByVariant: Record<PdfFormVariant, object> = {\n box: {\n borderColor: borderColor,\n borderRadius: borderRadius.sm,\n borderStyle: \"solid\",\n borderWidth: hairline,\n },\n ghost: {\n backgroundColor: t.colors.muted,\n borderRadius: borderRadius.sm,\n },\n outlined: {\n borderColor: t.colors.foreground,\n borderRadius: borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: hairline,\n },\n underline: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n },\n };\n\n const hasPadding =\n variant === \"box\" || variant === \"outlined\" || variant === \"ghost\";\n\n return StyleSheet.create({\n column: {\n flex: 1,\n },\n\n columnsRow: {\n flexDirection: \"row\",\n gap: spacing[4],\n },\n fieldAbove: {\n marginBottom: spacing[3],\n width: \"100%\",\n },\n fieldArea: {\n width: \"100%\" as const,\n ...fieldAreaByVariant[variant],\n },\n\n fieldLeft: {\n alignItems: \"flex-end\",\n flexDirection: \"row\",\n gap: spacing[2],\n marginBottom: spacing[3],\n },\n fieldLeftArea: {\n flex: 1,\n },\n\n formDivider: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n marginBottom: spacing[4],\n },\n formSubtitle: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n lineHeight: t.typography.body.lineHeight,\n marginBottom: spacing[3],\n },\n\n formTitle: {\n color: t.colors.foreground,\n fontFamily: t.typography.heading.fontFamily,\n fontSize: typography.xl,\n fontWeight: fontWeights.bold,\n lineHeight: t.typography.heading.lineHeight,\n marginBottom: spacing[1],\n },\n group: {\n marginBottom: spacing[5],\n },\n\n groupTitle: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.semibold,\n letterSpacing: 0.8,\n lineHeight: 1.2,\n marginBottom: spacing[3],\n textTransform: \"uppercase\",\n },\n hint: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n opacity: 0.14,\n paddingBottom: hasPadding ? spacing[1] : 0,\n paddingHorizontal: hasPadding ? spacing[2] : 0,\n paddingTop: hasPadding ? spacing[1] : spacing[0.5],\n },\n labelAbove: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.medium,\n letterSpacing: 0.5,\n lineHeight: 1.2,\n marginBottom: spacing[1],\n textTransform: \"uppercase\",\n },\n\n labelLeft: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.medium,\n lineHeight: t.typography.body.lineHeight,\n paddingBottom: hasPadding ? spacing[1] : 0,\n width: 80,\n },\n\n root: {\n marginBottom: t.spacing.componentGap,\n width: \"100%\",\n },\n });\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/form/form.tsx",
+ "content": "import { Text as PDFText, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { createFormStyles } from \"./form.styles\";\nimport type {\n FormLayout,\n PdfFormField,\n PdfFormGroup,\n PdfFormProps,\n} from \"./form.types\";\n\nfunction renderFieldAbove(\n field: PdfFormField,\n idx: number,\n styles: ReturnType<typeof createFormStyles>\n) {\n const areaHeight = field.height ?? 18;\n const areaStyle: Style[] = [styles.fieldArea, { minHeight: areaHeight }];\n\n return (\n <View key={`${field.label}-${idx}`} style={styles.fieldAbove}>\n <PDFText style={styles.labelAbove}>{field.label}</PDFText>\n <View style={areaStyle as never}>\n {field.hint ? (\n <PDFText style={styles.hint}>{field.hint}</PDFText>\n ) : null}\n </View>\n </View>\n );\n}\n\nfunction renderFieldLeft(\n field: PdfFormField,\n idx: number,\n styles: ReturnType<typeof createFormStyles>\n) {\n const areaHeight = field.height ?? 18;\n const areaStyle: Style[] = [\n styles.fieldArea,\n styles.fieldLeftArea,\n { minHeight: areaHeight },\n ];\n\n return (\n <View key={`${field.label}-${idx}`} style={styles.fieldLeft}>\n <PDFText style={styles.labelLeft}>{field.label}</PDFText>\n <View style={areaStyle as never}>\n {field.hint ? (\n <PDFText style={styles.hint}>{field.hint}</PDFText>\n ) : null}\n </View>\n </View>\n );\n}\n\nfunction renderGroup(\n group: PdfFormGroup,\n gi: number,\n styles: ReturnType<typeof createFormStyles>,\n labelPosition: \"above\" | \"left\"\n) {\n const layout: FormLayout = group.layout ?? \"single\";\n const cols = layout === \"three-column\" ? 3 : (layout === \"two-column\" ? 2 : 1);\n\n const renderField = (field: PdfFormField, idx: number) =>\n labelPosition === \"left\"\n ? renderFieldLeft(field, idx, styles)\n : renderFieldAbove(field, idx, styles);\n\n if (cols === 1) {\n return (\n <View key={`group-${gi}`} style={styles.group}>\n {group.title ? (\n <PDFText style={styles.groupTitle}>{group.title}</PDFText>\n ) : null}\n {group.fields.map(renderField)}\n </View>\n );\n }\n\n const chunkSize = Math.ceil(group.fields.length / cols);\n const chunks: PdfFormField[][] = [];\n for (let i = 0; i < group.fields.length; i += chunkSize) {\n chunks.push(group.fields.slice(i, i + chunkSize));\n }\n while (chunks.length < cols) {\n chunks.push([]);\n }\n\n return (\n <View key={`group-${gi}`} style={styles.group}>\n {group.title ? (\n <PDFText style={styles.groupTitle}>{group.title}</PDFText>\n ) : null}\n <View style={styles.columnsRow}>\n {chunks.map((chunk, ci) => (\n <View\n key={`col-${gi}-${chunk[0]?.label ?? ci}`}\n style={styles.column}\n >\n {chunk.map(renderField)}\n </View>\n ))}\n </View>\n </View>\n );\n}\n\nexport function PdfForm({\n title,\n subtitle,\n groups,\n variant = \"underline\",\n labelPosition = \"above\",\n noWrap = false,\n style,\n}: PdfFormProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(\n () => createFormStyles(theme, variant),\n [theme, variant]\n );\n\n const rootStyles: Style[] = [styles.root];\n if (style) {rootStyles.push(style);}\n\n const inner = (\n <View style={rootStyles as never}>\n {title ? <PDFText style={styles.formTitle}>{title}</PDFText> : null}\n {subtitle ? (\n <PDFText style={styles.formSubtitle}>{subtitle}</PDFText>\n ) : null}\n {title || subtitle ? <View style={styles.formDivider} /> : null}\n {groups.map((group, gi) => renderGroup(group, gi, styles, labelPosition))}\n </View>\n );\n\n return noWrap ? <View wrap={false}>{inner}</View> : inner;\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/form/form.types.ts",
+ "content": "import type { Style } from \"@formepdf/react\";\n\n/** Visual style variant for the fillable form. */\nexport type PdfFormVariant = \"underline\" | \"box\" | \"outlined\" | \"ghost\";\n\n/** Column layout for a form section. */\nexport type FormLayout = \"single\" | \"two-column\" | \"three-column\";\n\n/** Label position relative to the field. */\nexport type FormLabelPosition = \"above\" | \"left\";\n\n/**\n * A single fillable field definition.\n * Props - `label` | `hint` | `height` | `width`\n * @see {@link PdfFormField}\n */\nexport interface PdfFormField {\n label: string;\n hint?: string;\n /**\n * Height of the blank field area in points.\n * @default 18\n */\n height?: number;\n width?: number | string;\n}\n\n/**\n * A logical group of fields with an optional section title.\n * Props - `title` | `fields` | `layout`\n * @see {@link PdfFormGroup}\n */\nexport interface PdfFormGroup {\n title?: string;\n fields: PdfFormField[];\n /**\n * @default 'single'\n */\n layout?: FormLayout;\n}\n\n/**\n * Fillable PDF form with grouped fields, layout variants, and label positioning options.\n * Props - `title` | `subtitle` | `groups` | `variant` | `labelPosition` | `noWrap` | `style`\n * @see {@link PdfFormProps}\n */\nexport interface PdfFormProps {\n title?: string;\n subtitle?: string;\n groups: PdfFormGroup[];\n /**\n * @default 'underline'\n */\n variant?: PdfFormVariant;\n /**\n * @default 'above'\n */\n labelPosition?: FormLabelPosition;\n noWrap?: boolean;\n style?: Style;\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/form/index.ts",
+ "content": "export { PdfForm } from \"./form\";\nexport type {\n PdfFormProps,\n PdfFormVariant,\n PdfFormField,\n PdfFormGroup,\n FormLayout,\n FormLabelPosition,\n} from \"./form.types\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/forme/graph.json b/public/r/forme/graph.json
new file mode 100644
index 0000000..3de889a
--- /dev/null
+++ b/public/r/forme/graph.json
@@ -0,0 +1,41 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/graph",
+ "title": "Graph",
+ "description": "Graph PDF component (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/components/graph/graph.styles.ts",
+ "content": "import { StyleSheet } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nexport function createGraphStyles(t: PdfcnTheme) {\n return StyleSheet.create({\n chartWithRightLegend: {\n alignItems: \"flex-start\",\n display: \"flex\",\n flexDirection: \"row\",\n },\n container: {\n display: \"flex\",\n flexDirection: \"column\",\n marginBottom: t.spacing.componentGap,\n },\n legendColumn: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n marginLeft: 12,\n marginTop: 18,\n minWidth: 120,\n },\n legendItem: {\n alignItems: \"center\",\n display: \"flex\",\n flexDirection: \"row\",\n gap: 4,\n },\n legendRow: {\n display: \"flex\",\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: 12,\n marginTop: 6,\n },\n legendText: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n },\n subtitle: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginBottom: 6,\n },\n title: {\n color: t.colors.foreground,\n fontFamily: t.typography.heading.fontFamily,\n fontSize: t.primitives.typography.base,\n fontWeight: t.primitives.fontWeights.semibold,\n marginBottom: 2,\n },\n });\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/graph/graph.tsx",
+ "content": "import { Text as PDFText, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport type React from \"react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { Circle, G, Line, Path, Rect, Svg, SvgText } from \"../../lib/forme-svg\";\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { createGraphStyles } from \"./graph.styles\";\nimport type { ChartLayout, GraphProps, GraphSeries } from \"./graph.types\";\nimport {\n GRAPH_SAFE_WIDTHS,\n arcPath,\n buildLayout,\n fmtNum,\n getDefaultPalette,\n getGraphWidth,\n normalizeData,\n polarToCartesian,\n smoothPath,\n truncate,\n} from \"./graph.utils\";\n\n/**\n * Shared Y-axis grid lines and tick labels for cartesian charts (bar, line, area).\n * Extracted to avoid duplicating the identical block across render functions.\n */\nfunction renderGridAndYAxis(\n ticks: number[],\n toY: (v: number) => number,\n chartX: number,\n chartW: number,\n showGrid: boolean,\n gridColor: string,\n textColor: string\n) {\n return (\n <>\n {ticks.map((tick) => {\n const ty = toY(tick);\n return (\n <G key={`grid-${tick}`}>\n {showGrid && (\n <Line\n x1={chartX}\n y1={ty}\n x2={chartX + chartW}\n y2={ty}\n stroke={gridColor}\n strokeWidth={0.5}\n strokeDasharray=\"3 3\"\n />\n )}\n <SvgText\n x={chartX - 4}\n y={ty + 3}\n fill={textColor}\n textAnchor=\"end\"\n style={{ fontSize: 7 }}\n >\n {fmtNum(tick)}\n </SvgText>\n </G>\n );\n })}\n </>\n );\n}\n\nfunction renderBarChart(\n series: GraphSeries[],\n layout: ChartLayout,\n palette: string[],\n showGrid: boolean,\n showValues: boolean,\n theme: PdfcnTheme\n) {\n const { chartX, chartY, chartW, chartH, yMin, yMax, yTicks, xLabels } =\n layout;\n const nCategories = xLabels.length;\n const nSeries = series.length;\n const groupGap = 0.25;\n const groupW = chartW / nCategories;\n const barW = (groupW * (1 - groupGap)) / nSeries;\n const textColor = theme.colors.mutedForeground;\n const gridColor = theme.colors.border;\n const axisColor = theme.colors.foreground;\n const range = yMax - yMin || 1;\n const toY = (v: number) => chartY + chartH - ((v - yMin) / range) * chartH;\n\n return (\n <>\n {renderGridAndYAxis(\n yTicks,\n toY,\n chartX,\n chartW,\n showGrid,\n gridColor,\n textColor\n )}\n\n <Line\n x1={chartX}\n y1={chartY + chartH}\n x2={chartX + chartW}\n y2={chartY + chartH}\n stroke={axisColor}\n strokeWidth={1}\n />\n\n {xLabels.map((label, ci) => {\n const groupLeft = chartX + ci * groupW + groupW * (groupGap / 2);\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <G key={`group-${ci}`}>\n {series.map((s, si) => {\n const val = s.data[ci]?.value ?? 0;\n const color =\n s.data[ci]?.color ?? s.color ?? palette[si % palette.length];\n const barH = ((val - yMin) / range) * chartH;\n const bx = groupLeft + si * barW;\n const by = chartY + chartH - barH;\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <G key={`bar-${ci}-${si}`}>\n <Rect\n x={bx}\n y={by}\n width={barW - 1}\n height={barH}\n fill={color}\n />\n {showValues && barH > 10 && (\n <SvgText\n x={bx + barW / 2 - 0.5}\n y={by - 2}\n fill={axisColor}\n textAnchor=\"middle\"\n style={{ fontSize: 6 }}\n >\n {fmtNum(val)}\n </SvgText>\n )}\n </G>\n );\n })}\n <SvgText\n x={groupLeft + (nSeries * barW) / 2}\n y={chartY + chartH + 10}\n fill={textColor}\n textAnchor=\"middle\"\n style={{ fontSize: 7 }}\n >\n {truncate(label, 10)}\n </SvgText>\n </G>\n );\n })}\n </>\n );\n}\n\nfunction renderHorizontalBarChart(\n series: GraphSeries[],\n layout: ChartLayout,\n palette: string[],\n showValues: boolean,\n theme: PdfcnTheme\n) {\n const { chartX, chartY, chartW, chartH, xLabels } = layout;\n const nCategories = xLabels.length;\n const allValues = series.flatMap((s) => s.data.map((d) => d.value));\n const maxVal = Math.max(...allValues, 1);\n const rowH = chartH / nCategories;\n const barH = rowH * 0.5;\n const textColor = theme.colors.mutedForeground;\n const axisColor = theme.colors.foreground;\n const labelW = 60;\n\n return (\n <>\n {xLabels.map((label, ci) => {\n const rowY = chartY + ci * rowH;\n const val = series[0]?.data[ci]?.value ?? 0;\n const color =\n series[0]?.data[ci]?.color ??\n series[0]?.color ??\n palette[ci % palette.length];\n const barW = (val / maxVal) * (chartW - labelW);\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <G key={`hbar-${ci}`}>\n <SvgText\n x={chartX + labelW - 4}\n y={rowY + rowH / 2 + 3}\n fill={textColor}\n textAnchor=\"end\"\n style={{ fontSize: 7 }}\n >\n {truncate(label, 14)}\n </SvgText>\n <Rect\n x={chartX + labelW}\n y={rowY + (rowH - barH) / 2}\n width={Math.max(barW, 1)}\n height={barH}\n fill={color}\n />\n {showValues && (\n <SvgText\n x={chartX + labelW + barW + 3}\n y={rowY + rowH / 2 + 3}\n fill={axisColor}\n textAnchor=\"start\"\n style={{ fontSize: 6 }}\n >\n {fmtNum(val)}\n </SvgText>\n )}\n </G>\n );\n })}\n <Line\n x1={chartX + labelW}\n y1={chartY}\n x2={chartX + labelW}\n y2={chartY + chartH}\n stroke={axisColor}\n strokeWidth={1}\n />\n </>\n );\n}\n\nfunction renderLineAreaChart(\n series: GraphSeries[],\n layout: ChartLayout,\n palette: string[],\n showGrid: boolean,\n showValues: boolean,\n showDots: boolean,\n smooth: boolean,\n isArea: boolean,\n theme: PdfcnTheme\n) {\n const { chartX, chartY, chartW, chartH, yMin, yMax, yTicks, xLabels } =\n layout;\n const range = yMax - yMin || 1;\n const textColor = theme.colors.mutedForeground;\n const gridColor = theme.colors.border;\n const axisColor = theme.colors.foreground;\n const nPoints = xLabels.length;\n\n const xFor = (i: number) => chartX + (i / Math.max(nPoints - 1, 1)) * chartW;\n const yFor = (v: number) => chartY + chartH - ((v - yMin) / range) * chartH;\n\n return (\n <>\n {renderGridAndYAxis(\n yTicks,\n yFor,\n chartX,\n chartW,\n showGrid,\n gridColor,\n textColor\n )}\n\n <Line\n x1={chartX}\n y1={chartY + chartH}\n x2={chartX + chartW}\n y2={chartY + chartH}\n stroke={axisColor}\n strokeWidth={1}\n />\n\n {series.map((s, si) => {\n const color = s.color ?? palette[si % palette.length];\n const points = s.data.map((d, i) => ({ x: xFor(i), y: yFor(d.value) }));\n\n const lineDStr = smooth\n ? smoothPath(points)\n : `M ${points.map((p) => `${p.x} ${p.y}`).join(\" L \")}`;\n\n const areaPath =\n isArea && points.length > 1\n ? `${lineDStr} L ${points.at(-1)!.x} ${chartY + chartH} L ${points[0]!.x} ${chartY + chartH} Z`\n : null;\n\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <G key={`series-${si}`}>\n {isArea && areaPath && (\n <Path d={areaPath} fill={color} fillOpacity={0.2} stroke=\"none\" />\n )}\n <Path d={lineDStr} stroke={color} strokeWidth={2} fill=\"none\" />\n {showDots &&\n points.map((p, pi) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <Circle\n key={`dot-${pi}`}\n cx={p.x}\n cy={p.y}\n r={3}\n fill={color}\n />\n ))}\n {showValues &&\n points.map((p, pi) => (\n <SvgText\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n key={`val-${pi}`}\n x={p.x}\n y={p.y - 5}\n fill={color}\n textAnchor=\"middle\"\n style={{ fontSize: 6 }}\n >\n {fmtNum(s.data[pi].value)}\n </SvgText>\n ))}\n </G>\n );\n })}\n\n {xLabels.map((label, i) => (\n <SvgText\n key={`xlabel-${label}`}\n x={xFor(i)}\n y={chartY + chartH + 10}\n fill={textColor}\n textAnchor=\"middle\"\n style={{ fontSize: 7 }}\n >\n {truncate(label, 8)}\n </SvgText>\n ))}\n </>\n );\n}\n\nfunction renderPieDonutChart(\n series: GraphSeries[],\n layout: ChartLayout,\n palette: string[],\n centerLabel: string | undefined,\n isDonut: boolean,\n theme: PdfcnTheme\n) {\n const { svgW, svgH } = layout;\n const cx = svgW / 2;\n const cy = svgH / 2;\n const r = Math.min(svgW, svgH) / 2 - 20;\n const innerR = isDonut ? r * 0.52 : 0;\n const textColor = theme.colors.mutedForeground;\n\n const data = series[0]?.data ?? [];\n const total = data.reduce((sum, d) => sum + d.value, 0) || 1;\n\n let currentAngle = 0;\n\n return (\n <>\n {data.map((d, i) => {\n const color = d.color ?? palette[i % palette.length];\n const sweep = (d.value / total) * 360;\n const midAngle = currentAngle + sweep / 2;\n const path = arcPath(\n cx,\n cy,\n r,\n currentAngle,\n currentAngle + sweep,\n innerR\n );\n currentAngle += sweep;\n\n const labelR = r * 1.18;\n const lp = polarToCartesian(cx, cy, labelR, midAngle);\n const anchor = lp.x > cx ? \"start\" : \"end\";\n\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <G key={`slice-${i}`}>\n <Path d={path} fill={color} stroke=\"white\" strokeWidth={1} />\n {/* Show label only if slice is large enough to label */}\n {sweep > 15 && (\n <SvgText\n x={lp.x}\n y={lp.y + 3}\n fill={textColor}\n textAnchor={anchor}\n style={{ fontSize: 7 }}\n >\n {truncate(d.label, 10)}\n </SvgText>\n )}\n </G>\n );\n })}\n\n {isDonut && centerLabel && (\n <>\n <Circle cx={cx} cy={cy} r={innerR} fill=\"white\" />\n <SvgText\n x={cx}\n y={cy + 4}\n fill={theme.colors.foreground}\n textAnchor=\"middle\"\n style={{ fontSize: 9, fontWeight: \"bold\" }}\n >\n {centerLabel}\n </SvgText>\n </>\n )}\n </>\n );\n}\n\nfunction Legend({\n series,\n palette,\n styles,\n position = \"bottom\",\n}: {\n series: GraphSeries[];\n palette: string[];\n styles: ReturnType<typeof createGraphStyles>;\n position?: \"bottom\" | \"right\";\n}) {\n const containerStyle =\n position === \"right\" ? styles.legendColumn : styles.legendRow;\n\n return (\n <View style={containerStyle as never}>\n {series.map((s, i) => (\n <View key={s.name} style={styles.legendItem}>\n <Svg width={10} height={10}>\n <Rect\n x={0}\n y={2}\n width={8}\n height={8}\n fill={s.color ?? palette[i % palette.length]}\n />\n </Svg>\n <PDFText style={styles.legendText}>{s.name}</PDFText>\n </View>\n ))}\n </View>\n );\n}\n\n/**\n * PdfGraph — renders bar, horizontal-bar, line, area, pie, and donut charts\n * natively inside react-pdf documents using SVG primitives.\n *\n * No external chart libraries are required or used — all rendering is done via\n * react-pdf's built-in SVG support (`<Svg>`, `<Rect>`, `<Path>`, `<Line>`, etc.).\n *\n * @example Bar chart\n * ```tsx\n * <PdfGraph\n * variant=\"bar\"\n * title=\"Monthly Revenue\"\n * data={[\n * { label: 'Jan', value: 42000 },\n * { label: 'Feb', value: 38000 },\n * { label: 'Mar', value: 55000 },\n * ]}\n * />\n * ```\n *\n * @example Donut chart with center label\n * ```tsx\n * <PdfGraph\n * variant=\"donut\"\n * data={[\n * { label: 'Product A', value: 45 },\n * { label: 'Product B', value: 30 },\n * { label: 'Other', value: 25 },\n * ]}\n * centerLabel=\"$1.2M\"\n * />\n * ```\n *\n * **Limitations (by design):**\n * - No interactivity (PDFs are static)\n * - No animations\n * - SVG Text inside charts uses SVG font attributes (not react-pdf StyleSheet fonts)\n * - For print PDFs use SVG-friendly fonts registered with Font.register()\n */\nexport function PdfGraph({\n variant = \"bar\",\n data,\n title,\n subtitle,\n xLabel,\n yLabel,\n width: explicitWidth,\n height = 260,\n fullWidth = false,\n containerPadding = 0,\n wrapperPadding = 0,\n colors,\n showValues = false,\n showGrid = true,\n legend = \"bottom\",\n centerLabel,\n showDots = true,\n smooth = false,\n yTicks: yTickCount = 5,\n noWrap = true,\n style,\n}: GraphProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createGraphStyles(theme), [theme]);\n const palette = colors ?? getDefaultPalette(theme);\n const series = normalizeData(data);\n\n const width = useSafeMemo(() => {\n if (fullWidth)\n {return getGraphWidth(theme, { containerPadding, wrapperPadding });}\n return explicitWidth ?? GRAPH_SAFE_WIDTHS.default;\n }, [fullWidth, explicitWidth, theme, containerPadding, wrapperPadding]);\n\n const isPieOrDonut = variant === \"pie\" || variant === \"donut\";\n const layout = buildLayout(series, width, height, isPieOrDonut, yTickCount);\n const { chartX, chartW } = layout;\n\n let chartContent: React.ReactNode = null;\n\n switch (variant) {\n case \"bar\": {\n chartContent = renderBarChart(\n series,\n layout,\n palette,\n showGrid,\n showValues,\n theme\n );\n break;\n }\n case \"horizontal-bar\": {\n chartContent = renderHorizontalBarChart(\n series,\n layout,\n palette,\n showValues,\n theme\n );\n break;\n }\n case \"line\":\n case \"area\": {\n chartContent = renderLineAreaChart(\n series,\n layout,\n palette,\n showGrid,\n showValues,\n showDots,\n smooth,\n variant === \"area\",\n theme\n );\n break;\n }\n case \"pie\": {\n chartContent = renderPieDonutChart(\n series,\n layout,\n palette,\n undefined,\n false,\n theme\n );\n break;\n }\n case \"donut\": {\n chartContent = renderPieDonutChart(\n series,\n layout,\n palette,\n centerLabel,\n true,\n theme\n );\n break;\n }\n }\n\n const showLegend = legend !== \"none\" && !isPieOrDonut;\n\n const containerStyles: Style[] = [styles.container];\n if (style) {containerStyles.push(style);}\n\n const content = (\n <View style={containerStyles as never}>\n {title && <PDFText style={styles.title}>{title}</PDFText>}\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n <View\n style={legend === \"right\" ? styles.chartWithRightLegend : undefined}\n >\n <Svg width={width} height={height}>\n {chartContent}\n {!isPieOrDonut && xLabel && (\n <SvgText\n x={chartX + chartW / 2}\n y={height - 2}\n fill={theme.colors.mutedForeground}\n textAnchor=\"middle\"\n style={{ fontSize: 8 }}\n >\n {xLabel}\n </SvgText>\n )}\n {!isPieOrDonut && yLabel && (\n <SvgText\n x={2}\n y={10}\n fill={theme.colors.mutedForeground}\n textAnchor=\"start\"\n style={{ fontSize: 8 }}\n >\n {yLabel}\n </SvgText>\n )}\n </Svg>\n {showLegend &&\n legend === \"right\" &&\n Legend({ palette, position: \"right\", series, styles })}\n </View>\n {showLegend &&\n legend === \"bottom\" &&\n Legend({ palette, position: \"bottom\", series, styles })}\n </View>\n );\n\n return noWrap ? <View wrap={false}>{content}</View> : content;\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/graph/graph.types.ts",
+ "content": "import type { Style } from \"@formepdf/react\";\n\n/**\n * Options for calculating graph width based on theme page margins and container context.\n * Props - `containerPadding` | `wrapperPadding` | `pageWidth`\n * @see {@link GraphWidthOptions}\n */\nexport interface GraphWidthOptions {\n containerPadding?: number;\n wrapperPadding?: number;\n pageWidth?: number;\n}\n\nexport type GraphVariant =\n | \"bar\"\n | \"horizontal-bar\"\n | \"line\"\n | \"area\"\n | \"pie\"\n | \"donut\";\n\nexport type GraphLegendPosition = \"bottom\" | \"right\" | \"none\";\n\n/**\n * A single data point with a label, numeric value, and optional color override.\n * Props - `label` | `value` | `color`\n * @see {@link GraphDataPoint}\n */\nexport interface GraphDataPoint {\n label: string;\n value: number;\n color?: string;\n}\n\n/**\n * A named data series containing multiple data points, used for multi-series charts.\n * Props - `name` | `data` | `color`\n * @see {@link GraphSeries}\n */\nexport interface GraphSeries {\n name: string;\n data: GraphDataPoint[];\n color?: string;\n}\n\n/**\n * Multi-variant PDF chart (bar, line, area, pie, donut) rendered with SVG primitives.\n * Props - `variant` | `data` | `title` | `subtitle` | `xLabel` | `yLabel` | `width` | `height` | `fullWidth` | `containerPadding` | `wrapperPadding` | `colors` | `showValues` | `showGrid` | `legend` | `centerLabel` | `showDots` | `smooth` | `yTicks` | `noWrap` | `style`\n * @see {@link GraphProps}\n */\nexport interface GraphProps {\n /**\n * @default 'bar'\n */\n variant?: GraphVariant;\n data: GraphDataPoint[] | GraphSeries[];\n title?: string;\n subtitle?: string;\n xLabel?: string;\n yLabel?: string;\n /**\n * @default 420\n */\n width?: number;\n /**\n * @default 260\n */\n height?: number;\n /**\n * @default false\n */\n fullWidth?: boolean;\n containerPadding?: number;\n wrapperPadding?: number;\n colors?: string[];\n /**\n * @default false\n */\n showValues?: boolean;\n /**\n * @default true\n */\n showGrid?: boolean;\n /**\n * @default 'bottom'\n */\n legend?: GraphLegendPosition;\n centerLabel?: string;\n /**\n * @default true\n */\n showDots?: boolean;\n /**\n * @default false\n */\n smooth?: boolean;\n /**\n * @default 5\n */\n yTicks?: number;\n /**\n * @default true\n */\n noWrap?: boolean;\n style?: Style;\n}\n\n/** Internal chart layout dimensions computed from props and data. */\nexport interface ChartLayout {\n svgW: number;\n svgH: number;\n chartX: number;\n chartY: number;\n chartW: number;\n chartH: number;\n yMin: number;\n yMax: number;\n yTicks: number[];\n xLabels: string[];\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/graph/graph.utils.ts",
+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport type {\n ChartLayout,\n GraphDataPoint,\n GraphSeries,\n GraphWidthOptions,\n} from \"./graph.types\";\n\n/** Standard A4 page width in PDF points. */\nexport const A4_WIDTH = 595;\n\n/**\n * Pre-calculated safe graph widths for common scenarios.\n * These values work with all built-in themes on A4 pages.\n */\nexport const GRAPH_SAFE_WIDTHS = {\n /** Safe width for graph directly in page content (no extra containers) */\n default: 420,\n /** Safe width for graph inside a Section with md padding */\n inSection: 400,\n /** Safe width for graph inside a Section + bordered wrapper (like graphShell) */\n inSectionWithWrapper: 380,\n} as const;\n\n/**\n * Calculate the safe graph width based on theme page margins and container context.\n *\n * This utility ensures graphs don't overflow their container by accounting for:\n * - Page margins (from theme)\n * - Container padding (e.g., Section component)\n * - Wrapper padding (e.g., a bordered graphShell View)\n *\n * @example\n * ```tsx\n * const width = getGraphWidth(theme);\n * // For a graph inside a Section with padding=\"md\" (12pt) and a graphShell (12pt):\n * const width = getGraphWidth(theme, { containerPadding: 12, wrapperPadding: 12 });\n * ```\n */\nexport function getGraphWidth(\n theme: PdfcnTheme,\n options: GraphWidthOptions = {}\n): number {\n const {\n containerPadding = 0,\n wrapperPadding = 0,\n pageWidth = A4_WIDTH,\n } = options;\n const { marginLeft, marginRight } = theme.spacing.page;\n const availableWidth =\n pageWidth -\n marginLeft -\n marginRight -\n containerPadding * 2 -\n wrapperPadding * 2;\n return Math.max(Math.floor(availableWidth), 100);\n}\n\nexport const CHART_MARGINS = {\n axisBottom: 24,\n axisLeft: 40,\n pieBottom: 10,\n pieLeft: 10,\n right: 10,\n top: 10,\n} as const;\n\n/** Normalize to always work with GraphSeries[]. */\nexport function normalizeData(\n data: GraphDataPoint[] | GraphSeries[]\n): GraphSeries[] {\n if (data.length === 0) {return [];}\n if (\"label\" in data[0] && \"value\" in data[0]) {\n return [{ data: data as GraphDataPoint[], name: \"Series 1\" }];\n }\n return data as GraphSeries[];\n}\n\n/** Compute nice Y-axis ticks for a given value range. */\nexport function computeYTicks(\n min: number,\n max: number,\n count: number\n): number[] {\n if (min === max) {return [0, max || 1];}\n const step = (max - min) / (count - 1);\n return Array.from({ length: count }, (_, i) => {\n const v = min + i * step;\n return Math.round(v * 100) / 100;\n });\n}\n\n/** Format a number for display on axis labels. */\nexport function fmtNum(v: number): string {\n if (Math.abs(v) >= 1_000_000) {return `${(v / 1_000_000).toFixed(1)}M`;}\n if (Math.abs(v) >= 1000) {return `${(v / 1_000).toFixed(1)}K`;}\n if (!Number.isInteger(v)) {return v.toFixed(1);}\n return String(v);\n}\n\n/** Truncate a label to at most maxLen characters. */\nexport function truncate(s: string, maxLen: number): string {\n return s.length > maxLen ? `${s.slice(0, maxLen - 1)}…` : s;\n}\n\n/** Polar to Cartesian coordinate conversion for pie/donut arcs. */\nexport function polarToCartesian(\n cx: number,\n cy: number,\n r: number,\n angleDeg: number\n) {\n const rad = ((angleDeg - 90) * Math.PI) / 180;\n return { x: cx + r * Math.cos(rad), y: cy + r * Math.sin(rad) };\n}\n\n/** Build an SVG arc path for a pie/donut slice. */\nexport function arcPath(\n cx: number,\n cy: number,\n r: number,\n startAngle: number,\n endAngle: number,\n innerR = 0\n): string {\n const safeEnd = Math.min(endAngle, startAngle + 359.999);\n const large = safeEnd - startAngle > 180 ? 1 : 0;\n const s = polarToCartesian(cx, cy, r, safeEnd);\n const e = polarToCartesian(cx, cy, r, startAngle);\n if (innerR === 0) {\n return `M ${cx} ${cy} L ${s.x} ${s.y} A ${r} ${r} 0 ${large} 0 ${e.x} ${e.y} Z`;\n }\n const si = polarToCartesian(cx, cy, innerR, safeEnd);\n const ei = polarToCartesian(cx, cy, innerR, startAngle);\n return [\n `M ${s.x} ${s.y}`,\n `A ${r} ${r} 0 ${large} 0 ${e.x} ${e.y}`,\n `L ${ei.x} ${ei.y}`,\n `A ${innerR} ${innerR} 0 ${large} 1 ${si.x} ${si.y}`,\n \"Z\",\n ].join(\" \");\n}\n\n/** Compute smooth bezier control points (Catmull-Rom → cubic bezier). */\nexport function smoothPath(\n points: { x: number; y: number }[],\n tension = 0.4\n): string {\n if (points.length < 2) {return \"\";}\n if (points.length === 2) {\n return `M ${points[0].x} ${points[0].y} L ${points[1].x} ${points[1].y}`;\n }\n const parts: string[] = [`M ${points[0].x} ${points[0].y}`];\n for (let i = 0; i < points.length - 1; i++) {\n const p0 = points[Math.max(i - 1, 0)];\n const p1 = points[i];\n const p2 = points[i + 1];\n const p3 = points[Math.min(i + 2, points.length - 1)];\n const cp1x = p1.x + (p2.x - p0.x) * tension;\n const cp1y = p1.y + (p2.y - p0.y) * tension;\n const cp2x = p2.x - (p3.x - p1.x) * tension;\n const cp2y = p2.y - (p3.y - p1.y) * tension;\n parts.push(`C ${cp1x} ${cp1y} ${cp2x} ${cp2y} ${p2.x} ${p2.y}`);\n }\n return parts.join(\" \");\n}\n\n/** Get the default chart color palette from the theme. */\nexport function getDefaultPalette(t: PdfcnTheme): string[] {\n return [\n t.colors.primary,\n t.colors.info ?? \"#3B82F6\",\n t.colors.success ?? \"#22C55E\",\n t.colors.warning ?? \"#F59E0B\",\n t.colors.destructive ?? \"#EF4444\",\n \"#8B5CF6\",\n \"#F97316\",\n \"#14B8A6\",\n ];\n}\n\n/** Derive ChartLayout from series data, SVG dimensions, and variant. */\nexport function buildLayout(\n series: GraphSeries[],\n width: number,\n height: number,\n isPieOrDonut: boolean,\n yTickCount: number\n): ChartLayout {\n const mL = isPieOrDonut ? CHART_MARGINS.pieLeft : CHART_MARGINS.axisLeft;\n const mB = isPieOrDonut ? CHART_MARGINS.pieBottom : CHART_MARGINS.axisBottom;\n const chartX = mL;\n const chartY = CHART_MARGINS.top;\n const chartW = width - mL - CHART_MARGINS.right;\n const chartH = height - CHART_MARGINS.top - mB;\n const allValues = series.flatMap((s) => s.data.map((d) => d.value));\n const rawMin = Math.min(...allValues, 0);\n const rawMax = Math.max(...allValues, 1);\n const yMin = Math.min(0, rawMin);\n const yMax = rawMax + (rawMax - yMin) * 0.08;\n return {\n chartH,\n chartW,\n chartX,\n chartY,\n svgH: height,\n svgW: width,\n xLabels: series[0]?.data.map((d) => d.label) ?? [],\n yMax,\n yMin,\n yTicks: computeYTicks(yMin, yMax, yTickCount),\n };\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/graph/index.ts",
+ "content": "export { PdfGraph } from \"./graph\";\nexport { A4_WIDTH, GRAPH_SAFE_WIDTHS, getGraphWidth } from \"./graph.utils\";\nexport type {\n GraphDataPoint,\n GraphLegendPosition,\n GraphProps,\n GraphSeries,\n GraphVariant,\n GraphWidthOptions,\n} from \"./graph.types\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/forme/heading.json b/public/r/forme/heading.json
new file mode 100644
index 0000000..b3f9c02
--- /dev/null
+++ b/public/r/forme/heading.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/heading",
+ "title": "Heading",
+ "description": "Heading PDF component (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/components/heading/heading.tsx",
+ "content": "import { StyleSheet, Text } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type HeadingWeight = \"normal\" | \"medium\" | \"semibold\" | \"bold\";\nexport type HeadingTracking = \"tighter\" | \"tight\" | \"normal\" | \"wide\" | \"wider\";\n\n/**\n * PDF heading mapped to h1–h6 font sizes from the theme.\n * Props - `level` | `align` | `color` | `transform` | `weight` | `tracking` | `noMargin` | `keepWithNext` | `children` | `style`\n * @see {@link HeadingProps}\n */\nexport interface HeadingProps extends PDFComponentProps {\n /**\n * @default 1\n */\n level?: 1 | 2 | 3 | 4 | 5 | 6;\n /**\n * @default 'left'\n */\n align?: \"left\" | \"center\" | \"right\";\n color?: string;\n transform?: \"uppercase\" | \"lowercase\" | \"capitalize\";\n /**\n * @default 'bold'\n */\n weight?: HeadingWeight;\n /**\n * @default 'normal'\n */\n tracking?: HeadingTracking;\n /**\n * @default false\n */\n noMargin?: boolean;\n keepWithNext?: boolean;\n}\n\nfunction createHeadingStyles(t: PdfcnTheme) {\n const { heading } = t.typography;\n const { spacing, fontWeights, letterSpacing } = t.primitives;\n const { sectionGap, componentGap, paragraphGap } = t.spacing;\n const base = {\n color: t.colors.foreground,\n fontFamily: heading.fontFamily,\n fontWeight: fontWeights.bold,\n lineHeight: heading.lineHeight,\n };\n return StyleSheet.create({\n capitalize: { textTransform: \"capitalize\" },\n h1: {\n ...base,\n fontSize: heading.fontSize.h1,\n marginBottom: paragraphGap,\n marginTop: spacing[0],\n },\n h2: {\n ...base,\n fontSize: heading.fontSize.h2,\n marginBottom: paragraphGap,\n marginTop: sectionGap,\n },\n h3: {\n ...base,\n fontSize: heading.fontSize.h3,\n marginBottom: paragraphGap,\n marginTop: componentGap,\n },\n h4: {\n ...base,\n fontSize: heading.fontSize.h4,\n marginBottom: paragraphGap,\n marginTop: paragraphGap,\n },\n h5: {\n ...base,\n fontSize: heading.fontSize.h5,\n marginBottom: spacing[1],\n marginTop: paragraphGap,\n },\n h6: {\n ...base,\n fontSize: heading.fontSize.h6,\n marginBottom: spacing[1],\n marginTop: paragraphGap,\n },\n lowercase: { textTransform: \"lowercase\" },\n noMargin: { marginBottom: 0, marginTop: 0 },\n trackingNormal: { letterSpacing: letterSpacing.normal },\n trackingTight: { letterSpacing: letterSpacing.tight * 10 },\n trackingTighter: { letterSpacing: letterSpacing.tight * 15 },\n trackingWide: { letterSpacing: letterSpacing.wide * 10 },\n trackingWider: { letterSpacing: letterSpacing.wider * 10 },\n uppercase: {\n letterSpacing: letterSpacing.wider * 10,\n textTransform: \"uppercase\",\n },\n weightBold: { fontWeight: fontWeights.bold },\n weightMedium: { fontWeight: fontWeights.medium },\n weightNormal: { fontWeight: fontWeights.regular },\n weightSemibold: { fontWeight: fontWeights.semibold },\n });\n}\n\nexport function Heading({\n level = 1,\n align,\n color,\n transform,\n weight,\n tracking,\n noMargin,\n keepWithNext = true,\n children,\n style,\n}: HeadingProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createHeadingStyles(theme), [theme]);\n const safeLevel = Math.min(Math.max(Math.round(level), 1), 6) as\n | 1\n | 2\n | 3\n | 4\n | 5\n | 6;\n const weightMap = {\n bold: styles.weightBold,\n medium: styles.weightMedium,\n normal: styles.weightNormal,\n semibold: styles.weightSemibold,\n };\n const trackingMap = {\n normal: styles.trackingNormal,\n tight: styles.trackingTight,\n tighter: styles.trackingTighter,\n wide: styles.trackingWide,\n wider: styles.trackingWider,\n };\n const transformMap = {\n capitalize: styles.capitalize,\n lowercase: styles.lowercase,\n uppercase: styles.uppercase,\n };\n const styleArray: Style[] = [\n styles[`h${safeLevel}` as keyof typeof styles] as Style,\n ];\n if (weight && weight in weightMap) {styleArray.push(weightMap[weight]);}\n if (tracking && tracking in trackingMap)\n {styleArray.push(trackingMap[tracking]);}\n if (transform && transform in transformMap)\n {styleArray.push(transformMap[transform as keyof typeof transformMap]);}\n if (noMargin) {styleArray.push(styles.noMargin);}\n const semantic = {} as Style;\n if (align) {semantic.textAlign = align;}\n if (color) {semantic.color = resolveColor(color, theme.colors);}\n if (Object.keys(semantic).length > 0) {styleArray.push(semantic);}\n if (style) {styleArray.push(...[style].flat());}\n return <Text style={styleArray as never}>{children}</Text>;\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/heading/index.ts",
+ "content": "export {\n Heading,\n type HeadingProps,\n type HeadingWeight,\n type HeadingTracking,\n} from \"./heading\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/forme/invoice-classic.json b/public/r/forme/invoice-classic.json
new file mode 100644
index 0000000..6900234
--- /dev/null
+++ b/public/r/forme/invoice-classic.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/invoice-classic",
+ "title": "Invoice Classic",
+ "description": "Invoice Classic PDF block (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/invoice-classic/invoice-classic.tsx",
+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfImage,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport type { InvoiceClassicData } from \"./invoice-classic.types\";\n\n// Sample data — replace with your own props or data source\nconst sampleData: InvoiceClassicData = {\n billTo: {\n address: \"456 Client Ave, Suite 2\",\n email: \"[email protected]\",\n name: \"Client Corp.\",\n phone: \"+1 (555) 123-4567\",\n },\n companyAddress: \"City, Country\",\n companyEmail: \"[email protected]\",\n companyName: \"Your Company\",\n dueDate: \"March 17, 2026\",\n invoiceDate: \"February 17, 2026\",\n invoiceNumber: \"INV-2026-001\",\n items: [\n { description: \"Web Development\", quantity: 1, unitPrice: 12500 },\n { description: \"UI/UX Design\", quantity: 1, unitPrice: 8750 },\n { description: \"Consulting\", quantity: 10, unitPrice: 1500 },\n ],\n logo: \"/favicon.png\",\n notes: \"Thank you for your business!\",\n paymentTerms: {\n dueDate: \"March 17, 2026\",\n gst: \"GSTIN 123456789\",\n method: \"UPI / Card / Bank Transfer\",\n },\n subtitle: \"Professional Services\",\n summary: {\n subtotal: 36250,\n tax: 2537.5,\n total: 38787.5,\n },\n};\n\nexport function InvoiceClassicDocument({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceClassicData;\n}) {\n return (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceClassicContent data={data} />\n </PdfcnThemeProvider>\n );\n}\n\nfunction InvoiceClassicContent({ data }: { data: InvoiceClassicData }) {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n page: {\n backgroundColor: theme.colors.background,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <PageHeader\n variant=\"logo-left\"\n logo={\n <PdfImage src={data.logo ?? \"/favicon.png\"} style={{ margin: 0 }} />\n }\n title={data.companyName}\n subtitle={data.subtitle}\n rightText={data.invoiceNumber}\n rightSubText={`Due: ${data.dueDate}`}\n style={{ marginBottom: 0 }}\n />\n <Section noWrap style={{ flexDirection: \"row\" }}>\n <View style={{ flex: 1, paddingRight: 15 }}>\n <Text\n style={{ fontSize: 9, fontWeight: \"bold\", marginBottom: 2 }}\n color=\"mutedForeground\"\n transform=\"uppercase\"\n noMargin\n >\n From\n </Text>\n <Text noMargin variant=\"xs\">\n {data.companyName}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.companyAddress}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.companyEmail}\n </Text>\n </View>\n <View style={{ flex: 1, paddingRight: 15 }}>\n <Text\n style={{ fontSize: 9, fontWeight: \"bold\", marginBottom: 2 }}\n color=\"mutedForeground\"\n transform=\"uppercase\"\n noMargin\n >\n Bill To\n </Text>\n <Text noMargin variant=\"xs\">\n {data.billTo.name}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.billTo.address}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.billTo.email}\n </Text>\n </View>\n <View style={{ flex: 1, paddingRight: 15 }}>\n <Text\n style={{ fontSize: 9, fontWeight: \"bold\", marginBottom: 2 }}\n color=\"mutedForeground\"\n transform=\"uppercase\"\n noMargin\n >\n Payment Terms\n </Text>\n <Text noMargin variant=\"xs\">\n {data.paymentTerms.method}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.paymentTerms.gst}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.paymentTerms.dueDate}\n </Text>\n </View>\n </Section>\n <Table variant=\"grid\" zebraStripe>\n <TableHeader>\n <TableRow header>\n <TableCell>Description</TableCell>\n <TableCell align=\"center\">QTY</TableCell>\n <TableCell align=\"center\">Rate</TableCell>\n <TableCell align=\"right\">Total</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: invoice items have no stable id\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"center\">{`$${item.unitPrice}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toFixed(2)}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={{ flexDirection: \"row\", marginTop: 16 }}>\n <View style={{ marginLeft: \"auto\", width: 220 }}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toFixed(2)}`,\n },\n { key: \"Tax\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Total\",\n keyStyle: { fontSize: 12, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: { fontSize: 12, fontWeight: \"bold\" },\n },\n ]}\n divided\n />\n </View>\n </Section>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </View></Page>\n </Document>\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/invoice-classic/invoice-classic.types.ts",
+ "content": "export interface InvoiceClassicData {\n invoiceNumber: string;\n invoiceDate: string;\n dueDate: string;\n companyName: string;\n subtitle: string;\n companyAddress: string;\n companyEmail: string;\n logo?: string;\n billTo: {\n name: string;\n address: string;\n email: string;\n phone: string;\n };\n items: {\n description: string;\n quantity: number;\n unitPrice: number;\n }[];\n summary: {\n subtotal: number;\n tax: number;\n total: number;\n };\n paymentTerms: {\n dueDate: string;\n method: string;\n gst: string;\n };\n notes?: string;\n}\n",
+ "type": "registry:block"
+ }
+ ],
+ "type": "registry:block"
+}
\ No newline at end of file
diff --git a/public/r/forme/invoice-consultant.json b/public/r/forme/invoice-consultant.json
new file mode 100644
index 0000000..7e0c1f9
--- /dev/null
+++ b/public/r/forme/invoice-consultant.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/invoice-consultant",
+ "title": "Invoice Consultant",
+ "description": "Invoice Consultant PDF block (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/invoice-consultant/invoice-consultant.tsx",
+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport type { InvoiceConsultantData } from \"./invoice-consultant.types\";\n\nconst sampleData: InvoiceConsultantData = {\n client: {\n address: \"500 Tech Park, Suite 200\",\n company: \"Acme Technologies\",\n email: \"[email protected]\",\n name: \"Sarah Johnson\",\n },\n companyAddress: \"City, Country · [email protected]\",\n companyName: \"Your Consulting\",\n consultant: {\n email: \"[email protected]\",\n name: \"John Smith\",\n title: \"Senior Technical Consultant\",\n },\n dueDate: \"March 28, 2026\",\n invoiceDate: \"February 26, 2026\",\n invoiceNumber: \"INV-2026-006\",\n notes:\n \"Services rendered for February 2026. All hours verified and approved by client.\",\n paymentTerms: {\n dueDate: \"March 28, 2026\",\n method: \"Bank Transfer / Check\",\n },\n projectRef: \"PROJ-2026-ACME-001\",\n services: [\n { description: \"Architecture Review & Planning\", hours: 16, rate: 175 },\n { description: \"Code Review & Optimization\", hours: 24, rate: 150 },\n { description: \"Technical Documentation\", hours: 12, rate: 125 },\n { description: \"Team Training & Knowledge Transfer\", hours: 8, rate: 200 },\n ],\n subtitle: \"Professional Consulting Services\",\n summary: {\n subtotal: 10300,\n tax: 515,\n total: 10815,\n totalHours: 60,\n },\n};\n\nexport function InvoiceConsultantDocument({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceConsultantData;\n}) {\n return (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceConsultantContent data={data} />\n </PdfcnThemeProvider>\n );\n}\n\nfunction InvoiceConsultantContent({ data }: { data: InvoiceConsultantData }) {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n calloutNote: {\n backgroundColor: theme.colors.muted,\n borderLeftColor: theme.colors.info,\n borderLeftStyle: \"solid\",\n borderLeftWidth: 3,\n marginTop: 16,\n paddingLeft: 12,\n paddingVertical: 8,\n },\n companyInfo: {\n flex: 1,\n },\n headerRow: {\n alignItems: \"flex-start\",\n borderBottomColor: theme.colors.primary,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 2,\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: theme.spacing.sectionGap,\n paddingBottom: theme.spacing.componentGap,\n },\n hoursBadge: {\n alignSelf: \"flex-start\",\n backgroundColor: theme.colors.primary,\n borderRadius: theme.primitives.borderRadius.sm,\n color: theme.colors.primaryForeground,\n paddingHorizontal: 12,\n paddingVertical: 8,\n },\n hoursBox: {\n flex: 1,\n paddingRight: 24,\n },\n invoiceInfo: {\n alignItems: \"flex-end\",\n },\n page: {\n backgroundColor: theme.colors.background,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n partiesRow: {\n flexDirection: \"row\",\n gap: 40,\n marginBottom: theme.spacing.sectionGap,\n },\n partyColumn: {\n flex: 1,\n },\n partyLabel: {\n borderBottomColor: theme.colors.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n color: theme.colors.primary,\n fontSize: 9,\n fontWeight: \"bold\",\n letterSpacing: 0.6,\n marginBottom: 6,\n paddingBottom: 4,\n textTransform: \"uppercase\",\n },\n projectRef: {\n alignItems: \"center\",\n backgroundColor: theme.colors.muted,\n borderRadius: theme.primitives.borderRadius.sm,\n flexDirection: \"row\",\n gap: 8,\n marginBottom: theme.spacing.sectionGap,\n paddingHorizontal: 10,\n paddingVertical: 6,\n },\n summaryRow: {\n flexDirection: \"row\",\n marginTop: 20,\n },\n totalsBox: {\n width: 250,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <View style={styles.headerRow}>\n <View style={styles.companyInfo}>\n <Text variant=\"xl\" weight=\"bold\" noMargin>\n {data.companyName}\n </Text>\n <Text variant=\"sm\" color=\"mutedForeground\" noMargin>\n {data.subtitle}\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n {data.companyAddress}\n </Text>\n </View>\n <View style={styles.invoiceInfo}>\n <Text\n variant=\"xs\"\n color=\"mutedForeground\"\n transform=\"uppercase\"\n noMargin\n >\n Invoice\n </Text>\n <Text variant=\"lg\" weight=\"bold\" noMargin>\n {data.invoiceNumber}\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n {data.invoiceDate}\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Due: {data.dueDate}\n </Text>\n </View>\n </View>\n {data.projectRef && (\n <View style={styles.projectRef}>\n <Text\n variant=\"xs\"\n weight=\"semibold\"\n color=\"mutedForeground\"\n noMargin\n >\n Project Reference:\n </Text>\n <Text variant=\"xs\" weight=\"bold\" noMargin>\n {data.projectRef}\n </Text>\n </View>\n )}\n <View style={styles.partiesRow}>\n <View style={styles.partyColumn}>\n <Text style={styles.partyLabel} noMargin>\n From (Consultant)\n </Text>\n <Text variant=\"sm\" weight=\"semibold\" noMargin>\n {data.consultant.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.consultant.title}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.consultant.email}\n </Text>\n </View>\n <View style={styles.partyColumn}>\n <Text style={styles.partyLabel} noMargin>\n Bill To (Client)\n </Text>\n <Text variant=\"sm\" weight=\"semibold\" noMargin>\n {data.client.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.client.company}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.client.address}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.client.email}\n </Text>\n </View>\n </View>\n <Table variant=\"line\">\n <TableHeader>\n <TableRow header>\n <TableCell>Service Description</TableCell>\n <TableCell align=\"center\">Hours</TableCell>\n <TableCell align=\"right\">Rate ($/hr)</TableCell>\n <TableCell align=\"right\">Amount</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.services.map((service, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF list, no reordering\n <TableRow key={index}>\n <TableCell>{service.description}</TableCell>\n <TableCell align=\"center\">{`${service.hours}`}</TableCell>\n <TableCell align=\"right\">{`$${service.rate}`}</TableCell>\n <TableCell align=\"right\">{`$${(service.hours * service.rate).toLocaleString()}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={styles.summaryRow}>\n <View style={styles.hoursBox}>\n <View style={styles.hoursBadge}>\n <Text\n style={{\n color: theme.colors.primaryForeground,\n fontSize: 9,\n fontWeight: \"bold\",\n }}\n noMargin\n >\n Total Hours: {data.summary.totalHours}\n </Text>\n </View>\n <Text variant=\"xs\" color=\"mutedForeground\" style={{ marginTop: 8 }}>\n Payment: {data.paymentTerms.method}\n </Text>\n </View>\n <View style={styles.totalsBox}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toLocaleString()}`,\n },\n { key: \"Tax (5%)\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Amount Due\",\n keyStyle: { fontSize: 13, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: {\n color: theme.colors.primary,\n fontSize: 14,\n fontWeight: \"bold\",\n },\n },\n ]}\n divided\n />\n </View>\n </Section>\n {data.notes && (\n <View style={styles.calloutNote}>\n <Text variant=\"xs\" color=\"mutedForeground\">\n {data.notes}\n </Text>\n </View>\n )}\n <PageFooter\n leftText=\"Professional services invoice – Please retain for records\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </View></Page>\n </Document>\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/invoice-consultant/invoice-consultant.types.ts",
+ "content": "export interface InvoiceConsultantData {\n invoiceNumber: string;\n invoiceDate: string;\n dueDate: string;\n companyName: string;\n subtitle: string;\n companyAddress: string;\n consultant: {\n name: string;\n title: string;\n email: string;\n };\n client: {\n name: string;\n company: string;\n address: string;\n email: string;\n };\n services: {\n description: string;\n hours: number;\n rate: number;\n }[];\n summary: {\n totalHours: number;\n subtotal: number;\n tax: number;\n total: number;\n };\n paymentTerms: {\n dueDate: string;\n method: string;\n };\n projectRef?: string;\n notes?: string;\n}\n",
+ "type": "registry:block"
+ }
+ ],
+ "type": "registry:block"
+}
\ No newline at end of file
diff --git a/public/r/forme/invoice-corporate.json b/public/r/forme/invoice-corporate.json
new file mode 100644
index 0000000..c565ed0
--- /dev/null
+++ b/public/r/forme/invoice-corporate.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/invoice-corporate",
+ "title": "Invoice Corporate",
+ "description": "Invoice Corporate PDF block (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/invoice-corporate/invoice-corporate.tsx",
+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfImage,\n PdfcnThemeProvider,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport type { InvoiceCorporateData } from \"./invoice-corporate.types\";\n\nconst sampleData: InvoiceCorporateData = {\n billTo: {\n address: \"100 Corporate Plaza, Tower B\",\n email: \"[email protected]\",\n name: \"Global Industries Ltd.\",\n phone: \"+1 (555) 888-9999\",\n },\n companyAddress: \"City, Country\",\n companyEmail: \"[email protected]\",\n companyName: \"Your Company\",\n dueDate: \"March 24, 2026\",\n invoiceDate: \"February 22, 2026\",\n invoiceNumber: \"INV-2026-004\",\n items: [\n {\n description: \"Enterprise Software License\",\n quantity: 5,\n unitPrice: 4500,\n },\n { description: \"Implementation Services\", quantity: 1, unitPrice: 18000 },\n { description: \"Training Workshop\", quantity: 3, unitPrice: 2500 },\n { description: \"Annual Support Package\", quantity: 1, unitPrice: 8500 },\n ],\n logo: \"/favicon.png\",\n notes: \"Corporate billing – Net 30 terms apply.\",\n paymentTerms: {\n dueDate: \"March 24, 2026\",\n gst: \"GSTIN 987654321\",\n method: \"Wire Transfer / Corporate Account\",\n },\n subtitle: \"Professional Services\",\n summary: {\n subtotal: 57000,\n tax: 4560,\n total: 61560,\n },\n};\n\nexport function InvoiceCorporateDocument({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceCorporateData;\n}) {\n return (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceCorporateContent data={data} />\n </PdfcnThemeProvider>\n );\n}\n\nfunction InvoiceCorporateContent({ data }: { data: InvoiceCorporateData }) {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n infoColumn: {\n flex: 1,\n },\n infoGrid: {\n flexDirection: \"row\",\n gap: 24,\n marginBottom: theme.spacing.sectionGap,\n },\n infoLabel: {\n color: theme.colors.mutedForeground,\n fontSize: 9,\n fontWeight: \"bold\",\n letterSpacing: 0.6,\n marginBottom: 6,\n textTransform: \"uppercase\",\n },\n page: {\n backgroundColor: theme.colors.background,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n summaryCard: {\n backgroundColor: theme.colors.muted,\n borderRadius: theme.primitives.borderRadius.md,\n marginTop: 20,\n padding: 16,\n },\n summaryRow: {\n flexDirection: \"row\",\n justifyContent: \"flex-end\",\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <PageHeader\n variant=\"logo-right\"\n logo={\n <PdfImage\n src={data.logo ?? \"/favicon.png\"}\n width={56}\n height={56}\n style={{ margin: 0 }}\n />\n }\n title={data.companyName}\n subtitle={`${data.subtitle} · ${data.companyAddress}`}\n style={{ marginBottom: theme.spacing.sectionGap }}\n />\n <View style={styles.infoGrid}>\n <View style={styles.infoColumn}>\n <Text style={styles.infoLabel} noMargin>\n Invoice Details\n </Text>\n <KeyValue\n size=\"sm\"\n items={[\n { key: \"Invoice #\", value: data.invoiceNumber },\n { key: \"Issue Date\", value: data.invoiceDate },\n { key: \"Due Date\", value: data.dueDate },\n { key: \"Payment\", value: data.paymentTerms.method },\n ]}\n />\n </View>\n <View style={styles.infoColumn}>\n <Text style={styles.infoLabel} noMargin>\n Bill To\n </Text>\n <Text variant=\"sm\" weight=\"semibold\" noMargin>\n {data.billTo.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.address}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.email}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.phone}\n </Text>\n </View>\n </View>\n <Table variant=\"bordered\">\n <TableHeader>\n <TableRow header>\n <TableCell>Description</TableCell>\n <TableCell align=\"center\">Qty</TableCell>\n <TableCell align=\"right\">Unit Price</TableCell>\n <TableCell align=\"right\">Amount</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF list, no reordering\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"right\">{`$${item.unitPrice.toLocaleString()}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toLocaleString()}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <View style={styles.summaryCard}>\n <View style={styles.summaryRow}>\n <View style={{ width: 260 }}>\n <KeyValue\n size=\"md\"\n dividerThickness={1}\n dividerColor=\"border\"\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toLocaleString()}`,\n },\n { key: \"Tax (8%)\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Total Due\",\n keyStyle: { fontSize: 13, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: {\n color: theme.colors.primary,\n fontSize: 14,\n fontWeight: \"bold\",\n },\n },\n ]}\n divided\n />\n </View>\n </View>\n </View>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </View></Page>\n </Document>\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/invoice-corporate/invoice-corporate.types.ts",
+ "content": "export interface InvoiceCorporateData {\n invoiceNumber: string;\n invoiceDate: string;\n dueDate: string;\n companyName: string;\n subtitle: string;\n companyAddress: string;\n companyEmail: string;\n logo?: string;\n billTo: {\n name: string;\n address: string;\n email: string;\n phone: string;\n };\n items: {\n description: string;\n quantity: number;\n unitPrice: number;\n }[];\n summary: {\n subtotal: number;\n tax: number;\n total: number;\n };\n paymentTerms: {\n dueDate: string;\n method: string;\n gst: string;\n };\n notes?: string;\n}\n",
+ "type": "registry:block"
+ }
+ ],
+ "type": "registry:block"
+}
\ No newline at end of file
diff --git a/public/r/forme/invoice-creative.json b/public/r/forme/invoice-creative.json
new file mode 100644
index 0000000..ba0acd9
--- /dev/null
+++ b/public/r/forme/invoice-creative.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/invoice-creative",
+ "title": "Invoice Creative",
+ "description": "Invoice Creative PDF block (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/invoice-creative/invoice-creative.tsx",
+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport type { InvoiceCreativeData } from \"./invoice-creative.types\";\n\nconst sampleData: InvoiceCreativeData = {\n billTo: {\n address: \"250 Design District, Loft 5\",\n email: \"[email protected]\",\n name: \"Creative Agency Co.\",\n phone: \"+1 (555) 321-7654\",\n },\n companyAddress: \"City, Country · [email protected]\",\n companyName: \"Your Agency\",\n dueDate: \"March 26, 2026\",\n invoiceDate: \"February 24, 2026\",\n invoiceNumber: \"INV-2026-005\",\n items: [\n { description: \"Brand Identity Design\", quantity: 1, unitPrice: 8500 },\n {\n description: \"Marketing Collateral Package\",\n quantity: 1,\n unitPrice: 4200,\n },\n {\n description: \"Social Media Assets (per set)\",\n quantity: 4,\n unitPrice: 750,\n },\n { description: \"Motion Graphics (30s)\", quantity: 2, unitPrice: 3500 },\n ],\n notes:\n \"Creative work is protected under copyright. Full usage rights transfer upon payment.\",\n paymentTerms: {\n dueDate: \"March 26, 2026\",\n gst: \"GSTIN 456789123\",\n method: \"Credit Card / PayPal / Stripe\",\n },\n subtitle: \"Creative Services\",\n summary: {\n subtotal: 22700,\n tax: 1475.5,\n total: 24175.5,\n },\n};\n\nexport function InvoiceCreativeDocument({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceCreativeData;\n}) {\n return (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceCreativeContent data={data} />\n </PdfcnThemeProvider>\n );\n}\n\nfunction InvoiceCreativeContent({ data }: { data: InvoiceCreativeData }) {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n accentBlock: {\n backgroundColor: theme.colors.muted,\n borderLeftColor: theme.colors.accent,\n borderLeftStyle: \"solid\",\n borderLeftWidth: 4,\n marginBottom: theme.spacing.sectionGap,\n paddingLeft: 14,\n paddingVertical: 10,\n },\n badgeLabel: {\n color: theme.colors.primaryForeground,\n fontSize: 8,\n fontWeight: \"bold\",\n letterSpacing: 1.2,\n marginBottom: 2,\n textTransform: \"uppercase\",\n },\n badgeNumber: {\n color: theme.colors.primaryForeground,\n fontSize: 16,\n fontWeight: \"bold\",\n },\n heroSection: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: theme.spacing.sectionGap,\n },\n infoColumn: {\n flex: 1,\n },\n infoGrid: {\n flexDirection: \"row\",\n gap: 32,\n },\n invoiceBadge: {\n alignItems: \"center\",\n backgroundColor: theme.colors.primary,\n borderRadius: theme.primitives.borderRadius.md,\n paddingHorizontal: 20,\n paddingVertical: 14,\n },\n page: {\n backgroundColor: theme.colors.background,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n sectionLabel: {\n color: theme.colors.accent,\n fontSize: 8,\n fontWeight: \"bold\",\n letterSpacing: 0.8,\n marginBottom: 6,\n textTransform: \"uppercase\",\n },\n summaryLeft: {\n flex: 1,\n paddingRight: 20,\n },\n summaryRight: {\n backgroundColor: theme.colors.muted,\n borderRadius: theme.primitives.borderRadius.sm,\n padding: 14,\n width: 240,\n },\n summarySection: {\n flexDirection: \"row\",\n marginTop: 24,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <View style={styles.heroSection}>\n <View style={{ flex: 1 }}>\n <PageHeader\n variant=\"centered\"\n title={data.companyName}\n subtitle={`${data.subtitle} · ${data.companyAddress}`}\n marginBottom={0}\n />\n </View>\n <View style={styles.invoiceBadge}>\n <Text style={styles.badgeLabel} noMargin>\n Invoice\n </Text>\n <Text style={styles.badgeNumber} noMargin>\n {data.invoiceNumber}\n </Text>\n </View>\n </View>\n <View style={styles.accentBlock}>\n <View style={styles.infoGrid}>\n <View style={styles.infoColumn}>\n <Text style={styles.sectionLabel} noMargin>\n Billed To\n </Text>\n <Text variant=\"sm\" weight=\"semibold\" noMargin>\n {data.billTo.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.address}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.email} · {data.billTo.phone}\n </Text>\n </View>\n <View style={styles.infoColumn}>\n <Text style={styles.sectionLabel} noMargin>\n Invoice Info\n </Text>\n <KeyValue\n size=\"sm\"\n items={[\n { key: \"Issue Date\", value: data.invoiceDate },\n { key: \"Due Date\", value: data.dueDate },\n { key: \"Payment\", value: data.paymentTerms.method },\n ]}\n />\n </View>\n </View>\n </View>\n <Table variant=\"striped\" zebraStripe>\n <TableHeader>\n <TableRow header>\n <TableCell>Deliverable</TableCell>\n <TableCell align=\"center\">Qty</TableCell>\n <TableCell align=\"right\">Rate</TableCell>\n <TableCell align=\"right\">Amount</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF list, no reordering\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"right\">{`$${item.unitPrice.toLocaleString()}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toLocaleString()}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={styles.summarySection}>\n <View style={styles.summaryLeft}>\n <Text style={styles.sectionLabel} noMargin>\n Notes & Terms\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\">\n {data.notes}\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" style={{ marginTop: 4 }}>\n GST: {data.paymentTerms.gst}\n </Text>\n </View>\n <View style={styles.summaryRight}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toLocaleString()}`,\n },\n { key: \"Tax (6.5%)\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Total\",\n keyStyle: { fontSize: 13, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: {\n color: theme.colors.accent,\n fontSize: 14,\n fontWeight: \"bold\",\n },\n },\n ]}\n divided\n />\n </View>\n </Section>\n <PageFooter\n variant=\"centered\"\n centerText=\"Thank you for choosing us for your creative needs!\"\n sticky\n pagePadding={25}\n />\n </View></Page>\n </Document>\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/invoice-creative/invoice-creative.types.ts",
+ "content": "export interface InvoiceCreativeData {\n invoiceNumber: string;\n invoiceDate: string;\n dueDate: string;\n companyName: string;\n subtitle: string;\n companyAddress: string;\n billTo: {\n name: string;\n address: string;\n email: string;\n phone: string;\n };\n items: {\n description: string;\n quantity: number;\n unitPrice: number;\n }[];\n summary: {\n subtotal: number;\n tax: number;\n total: number;\n };\n paymentTerms: {\n dueDate: string;\n method: string;\n gst: string;\n };\n notes?: string;\n}\n",
+ "type": "registry:block"
+ }
+ ],
+ "type": "registry:block"
+}
\ No newline at end of file
diff --git a/public/r/forme/invoice-minimal.json b/public/r/forme/invoice-minimal.json
new file mode 100644
index 0000000..43c06f1
--- /dev/null
+++ b/public/r/forme/invoice-minimal.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/invoice-minimal",
+ "title": "Invoice Minimal",
+ "description": "Invoice Minimal PDF block (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/invoice-minimal/invoice-minimal.tsx",
+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport type { InvoiceMinimalData } from \"./invoice-minimal.types\";\n\n// Sample data — replace with your own props or data source\nconst sampleData: InvoiceMinimalData = {\n billTo: {\n address: \"500 Enterprise Way, Building A\",\n email: \"[email protected]\",\n name: \"Enterprise Corp\",\n phone: \"+1 (555) 246-8135\",\n },\n companyAddress: \"City, Country\",\n companyEmail: \"[email protected]\",\n companyName: \"Your Company\",\n dueDate: \"March 22, 2026\",\n invoiceDate: \"February 20, 2026\",\n invoiceNumber: \"INV-2026-003\",\n items: [\n { description: \"Annual Licenselan\", quantity: 1, unitPrice: 25000 },\n { description: \"Support & Maintenance\", quantity: 12, unitPrice: 1500 },\n { description: \"Custom Integration\", quantity: 1, unitPrice: 12000 },\n ],\n notes:\n \"Invoice for annual enterprise subscription. Please retain for your records.\",\n paymentTerms: {\n dueDate: \"March 22, 2026\",\n gst: \"GSTIN 123456789\",\n method: \"ACH Transfer / Check\",\n },\n subtitle: \"Professional Services\",\n summary: {\n subtotal: 55000,\n tax: 3850,\n total: 58850,\n },\n};\n\nexport function InvoiceMinimalDocument({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceMinimalData;\n}) {\n return (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceMinimalContent data={data} />\n </PdfcnThemeProvider>\n );\n}\n\nfunction InvoiceMinimalContent({ data }: { data: InvoiceMinimalData }) {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n infoLabel: {\n color: theme.colors.primary,\n fontSize: 8,\n fontWeight: \"bold\",\n letterSpacing: 0.8,\n marginBottom: 4,\n textTransform: \"uppercase\",\n },\n infoRow: {\n flexDirection: \"row\",\n marginBottom: theme.spacing.sectionGap,\n },\n invoiceStamp: {\n alignSelf: \"flex-start\",\n borderColor: theme.colors.primary,\n borderRadius: theme.primitives.borderRadius.sm,\n borderStyle: \"solid\",\n borderWidth: 2,\n paddingHorizontal: 12,\n paddingVertical: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <Section\n noWrap\n style={{\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n marginBottom: theme.spacing.sectionGap,\n }}\n >\n <View style={{ flex: 1 }}>\n <PageHeader\n variant=\"minimal\"\n title={data.companyName}\n subtitle={`${data.companyAddress} · ${data.companyEmail}`}\n marginBottom={0}\n />\n </View>\n <View style={styles.invoiceStamp}>\n <Text\n style={{\n color: theme.colors.primary,\n fontSize: 7,\n fontWeight: \"bold\",\n textAlign: \"right\",\n }}\n noMargin\n transform=\"uppercase\"\n >\n Invoice\n </Text>\n <Text\n style={{\n color: theme.colors.foreground,\n fontSize: 14,\n fontWeight: \"bold\",\n textAlign: \"right\",\n }}\n noMargin\n >\n {data.invoiceNumber}\n </Text>\n <Text\n style={{\n color: theme.colors.mutedForeground,\n fontSize: 8,\n textAlign: \"right\",\n }}\n noMargin\n >\n {data.invoiceDate}\n </Text>\n </View>\n </Section>\n <View style={styles.infoRow}>\n <View style={{ flex: 1, paddingRight: 20 }}>\n <Text style={styles.infoLabel} noMargin>\n Bill To\n </Text>\n <Text variant=\"sm\" noMargin>\n {data.billTo.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.address}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.email}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.phone}\n </Text>\n </View>\n <View style={{ flex: 1 }}>\n <Text style={styles.infoLabel} noMargin>\n Invoice Details\n </Text>\n <KeyValue\n size=\"sm\"\n items={[\n { key: \"Due Date\", value: data.dueDate },\n { key: \"Payment\", value: data.paymentTerms.method },\n { key: \"GST\", value: data.paymentTerms.gst },\n ]}\n />\n </View>\n </View>\n <Table variant=\"compact\">\n <TableHeader>\n <TableRow header>\n <TableCell>Description</TableCell>\n <TableCell align=\"center\">Qty</TableCell>\n <TableCell align=\"right\">Rate</TableCell>\n <TableCell align=\"right\">Total</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: invoice items have no stable id\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"right\">{`$${item.unitPrice.toLocaleString()}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toFixed(2)}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={{ flexDirection: \"row\", marginTop: 20 }}>\n <View style={{ flex: 1 }} />\n <View style={{ width: 240 }}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toFixed(2)}`,\n },\n { key: \"Tax (7%)\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Balance Due\",\n keyStyle: { fontSize: 12, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: {\n color: theme.colors.primary,\n fontSize: 13,\n fontWeight: \"bold\",\n },\n },\n ]}\n divided\n />\n </View>\n </Section>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </View></Page>\n </Document>\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/invoice-minimal/invoice-minimal.types.ts",
+ "content": "export interface InvoiceMinimalData {\n invoiceNumber: string;\n invoiceDate: string;\n dueDate: string;\n companyName: string;\n subtitle: string;\n companyAddress: string;\n companyEmail: string;\n billTo: {\n name: string;\n address: string;\n email: string;\n phone: string;\n };\n items: {\n description: string;\n quantity: number;\n unitPrice: number;\n }[];\n summary: {\n subtotal: number;\n tax: number;\n total: number;\n };\n paymentTerms: {\n dueDate: string;\n method: string;\n gst: string;\n };\n notes?: string;\n}\n",
+ "type": "registry:block"
+ }
+ ],
+ "type": "registry:block"
+}
\ No newline at end of file
diff --git a/public/r/forme/invoice-modern.json b/public/r/forme/invoice-modern.json
new file mode 100644
index 0000000..a1e27f7
--- /dev/null
+++ b/public/r/forme/invoice-modern.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/invoice-modern",
+ "title": "Invoice Modern",
+ "description": "Invoice Modern PDF block (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/invoice-modern/invoice-modern.tsx",
+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport type { InvoiceModernData } from \"./invoice-modern.types\";\n\n// Sample data — replace with your own props or data source\nconst sampleData: InvoiceModernData = {\n billTo: {\n address: \"789 Innovation Blvd, Floor 3\",\n email: \"[email protected]\",\n name: \"TechStart Solutions\",\n phone: \"+1 (555) 987-6543\",\n },\n companyAddress: \"City, Country\",\n companyEmail: \"[email protected]\",\n companyName: \"Your Company\",\n dueDate: \"March 20, 2026\",\n invoiceDate: \"February 18, 2026\",\n invoiceNumber: \"INV-2026-002\",\n items: [\n { description: \"API Integration\", quantity: 1, unitPrice: 15000 },\n { description: \"SEO\", quantity: 2, unitPrice: 5500 },\n { description: \"Security Audit\", quantity: 1, unitPrice: 7200 },\n ],\n notes: \"Payment terms: Net 30 days. Thank you for your business!\",\n paymentTerms: {\n dueDate: \"March 20, 2026\",\n gst: \"GSTIN 123456789\",\n method: \"Wire Transfer / Bank Account\",\n },\n subtitle: \"Professional Services\",\n summary: {\n subtotal: 33200,\n tax: 2324,\n total: 35524,\n },\n};\n\nexport function InvoiceModernDocument({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceModernData;\n}) {\n return (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceModernContent data={data} />\n </PdfcnThemeProvider>\n );\n}\n\nfunction InvoiceModernContent({ data }: { data: InvoiceModernData }) {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n dividerCol: {\n backgroundColor: theme.colors.border,\n marginRight: 12,\n width: 1,\n },\n metaCol: {\n flex: 1,\n paddingRight: 12,\n },\n metaLabel: {\n color: theme.colors.mutedForeground,\n fontSize: 8,\n fontWeight: \"bold\",\n letterSpacing: 0.5,\n marginBottom: 3,\n textTransform: \"uppercase\",\n },\n metaRow: {\n flexDirection: \"row\",\n marginBottom: theme.spacing.sectionGap,\n },\n metaValue: {\n color: theme.colors.foreground,\n fontSize: 9,\n },\n page: {\n backgroundColor: theme.colors.background,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <PageHeader\n variant=\"branded\"\n title={data.companyName}\n subtitle={`${data.subtitle} · ${data.companyAddress} · ${data.companyEmail}`}\n />\n <View style={styles.metaRow}>\n <View style={styles.metaCol}>\n <Text style={styles.metaLabel} noMargin>\n Invoice Number\n </Text>\n <Text\n style={{ ...styles.metaValue, fontSize: 11, fontWeight: \"bold\" }}\n noMargin\n >\n {data.invoiceNumber}\n </Text>\n </View>\n <View style={styles.metaCol}>\n <Text style={styles.metaLabel} noMargin>\n Invoice Date\n </Text>\n <Text style={styles.metaValue} noMargin>\n {data.invoiceDate}\n </Text>\n </View>\n <View style={styles.metaCol}>\n <Text style={styles.metaLabel} noMargin>\n Due Date\n </Text>\n <Text style={styles.metaValue} noMargin>\n {data.dueDate}\n </Text>\n </View>\n <View style={styles.dividerCol} />\n <View style={{ flex: 2 }}>\n <Text style={styles.metaLabel} noMargin>\n Billed To\n </Text>\n <Text style={{ ...styles.metaValue, fontWeight: \"bold\" }} noMargin>\n {data.billTo.name}\n </Text>\n <Text\n style={{\n ...styles.metaValue,\n color: theme.colors.mutedForeground,\n }}\n noMargin\n >\n {data.billTo.address}\n </Text>\n <Text\n style={{\n ...styles.metaValue,\n color: theme.colors.mutedForeground,\n }}\n noMargin\n >\n {data.billTo.email}\n </Text>\n <Text\n style={{\n ...styles.metaValue,\n color: theme.colors.mutedForeground,\n }}\n noMargin\n >\n {data.billTo.phone}\n </Text>\n </View>\n </View>\n <Table variant=\"primary-header\">\n <TableHeader>\n <TableRow header>\n <TableCell>Description</TableCell>\n <TableCell align=\"center\">Qty</TableCell>\n <TableCell align=\"right\">Unit Price</TableCell>\n <TableCell align=\"right\">Amount</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: invoice items have no stable id\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"right\">{`$${item.unitPrice.toLocaleString()}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toFixed(2)}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={{ flexDirection: \"row\", marginTop: 16 }}>\n <View style={{ flex: 1, paddingRight: 20 }}>\n <Text style={styles.metaLabel} noMargin>\n Payment Method\n </Text>\n <Text variant=\"xs\" noMargin>\n {data.paymentTerms.method}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.paymentTerms.gst}\n </Text>\n </View>\n <View style={{ width: 220 }}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toFixed(2)}`,\n },\n { key: \"Tax (7%)\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Total Due\",\n keyStyle: { fontSize: 12, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: { fontSize: 12, fontWeight: \"bold\" },\n },\n ]}\n divided\n />\n </View>\n </Section>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </View></Page>\n </Document>\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/invoice-modern/invoice-modern.types.ts",
+ "content": "export interface InvoiceModernData {\n invoiceNumber: string;\n invoiceDate: string;\n dueDate: string;\n companyName: string;\n subtitle: string;\n companyAddress: string;\n companyEmail: string;\n billTo: {\n name: string;\n address: string;\n email: string;\n phone: string;\n };\n items: {\n description: string;\n quantity: number;\n unitPrice: number;\n }[];\n summary: {\n subtotal: number;\n tax: number;\n total: number;\n };\n paymentTerms: {\n dueDate: string;\n method: string;\n gst: string;\n };\n notes?: string;\n}\n",
+ "type": "registry:block"
+ }
+ ],
+ "type": "registry:block"
+}
\ No newline at end of file
diff --git a/public/r/forme/keep-together.json b/public/r/forme/keep-together.json
new file mode 100644
index 0000000..16f22d0
--- /dev/null
+++ b/public/r/forme/keep-together.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/keep-together",
+ "title": "Keep Together",
+ "description": "Keep Together PDF component (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/components/keep-together/keep-together.tsx",
+ "content": "import { View } from \"@formepdf/react\";\nimport type { ReactNode } from \"react\";\n\nimport type { Style } from \"@/registry/themes\";\n\nexport interface KeepTogetherProps {\n children?: ReactNode;\n minPresenceAhead?: number;\n style?: Style;\n}\n\nexport function KeepTogether({ children, style }: KeepTogetherProps) {\n return (\n <View wrap={false} style={style as never}>\n {children}\n </View>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/keep-together/index.ts",
+ "content": "export { KeepTogether, type KeepTogetherProps } from \"./keep-together\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/forme/key-value.json b/public/r/forme/key-value.json
new file mode 100644
index 0000000..28f0b9c
--- /dev/null
+++ b/public/r/forme/key-value.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/key-value",
+ "title": "Key Value",
+ "description": "Key Value PDF component (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/components/key-value/key-value.tsx",
+ "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type KeyValueDirection = \"horizontal\" | \"vertical\";\nexport type KeyValueSize = \"sm\" | \"md\" | \"lg\";\n\n/**\n * A single key-value row with optional per-item color and style overrides.\n * Props - `key` | `value` | `valueColor` | `valueStyle` | `keyStyle`\n * @see {@link KeyValueEntry}\n */\nexport interface KeyValueEntry {\n key: string;\n value: string;\n valueColor?: string;\n valueStyle?: Style;\n keyStyle?: Style;\n}\n\n/**\n * List of key-value pairs with layout and style options.\n * Props - `items` | `direction` | `divided` | `size` | `labelFlex` | `labelColor` | `valueColor` | `boldValue` | `noWrap` | `dividerColor` | `dividerThickness` | `dividerMargin` | `style`\n * @see {@link KeyValueProps}\n */\nexport interface KeyValueProps extends Omit<PDFComponentProps, \"children\"> {\n items: KeyValueEntry[];\n /**\n * @default 'horizontal'\n */\n direction?: KeyValueDirection;\n /**\n * @default false\n */\n divided?: boolean;\n /**\n * @default 'md'\n */\n size?: KeyValueSize;\n /**\n * @default 1\n */\n labelFlex?: number;\n labelColor?: string;\n valueColor?: string;\n /**\n * @default false\n */\n boldValue?: boolean;\n /**\n * @default false\n */\n noWrap?: boolean;\n dividerColor?: string;\n dividerThickness?: number;\n dividerMargin?: number;\n}\n\nfunction createKeyValueStyles(t: PdfcnTheme) {\n const { spacing, fontWeights } = t.primitives;\n const c = t.colors;\n const { body } = t.typography;\n const keyBase = {\n color: c.mutedForeground,\n fontFamily: body.fontFamily,\n fontWeight: fontWeights.medium,\n };\n const valueBase = {\n color: c.foreground,\n fontFamily: body.fontFamily,\n fontWeight: fontWeights.regular,\n };\n return StyleSheet.create({\n container: { flexDirection: \"column\" },\n divider: {\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n },\n keyLg: { ...keyBase, fontSize: t.primitives.typography.base },\n keyMd: { ...keyBase, fontSize: body.fontSize },\n keySm: { ...keyBase, fontSize: t.primitives.typography.xs },\n rowHorizontal: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n paddingVertical: spacing[1],\n },\n rowVertical: {\n flexDirection: \"column\",\n marginBottom: t.spacing.paragraphGap,\n },\n valueBold: { fontWeight: fontWeights.bold },\n valueLg: { ...valueBase, fontSize: t.primitives.typography.base },\n valueMd: { ...valueBase, fontSize: body.fontSize },\n valueSm: { ...valueBase, fontSize: t.primitives.typography.xs },\n });\n}\n\nexport function KeyValue({\n items,\n direction = \"horizontal\",\n divided = false,\n size = \"md\",\n labelFlex = 1,\n labelColor,\n valueColor,\n boldValue = false,\n noWrap = false,\n dividerColor,\n dividerThickness,\n dividerMargin,\n style,\n}: KeyValueProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createKeyValueStyles(theme), [theme]);\n const keyStyleMap = {\n lg: styles.keyLg,\n md: styles.keyMd,\n sm: styles.keySm,\n } as Record<KeyValueSize, Style>;\n const valueStyleMap = {\n lg: styles.valueLg,\n md: styles.valueMd,\n sm: styles.valueSm,\n } as Record<KeyValueSize, Style>;\n const containerStyles: Style[] = [styles.container];\n if (style) {containerStyles.push(...[style].flat());}\n\n return (\n <View wrap={!noWrap} style={containerStyles as never}>\n {items.map((item, index) => {\n const isLast = index === items.length - 1;\n const keyStyles: Style[] = [keyStyleMap[size]];\n if (labelColor)\n {keyStyles.push({ color: resolveColor(labelColor, theme.colors) });}\n if (item.keyStyle) {keyStyles.push(item.keyStyle);}\n const valStyles: Style[] = [valueStyleMap[size]];\n if (boldValue) {valStyles.push(styles.valueBold);}\n const resolvedValueColor = item.valueColor ?? valueColor;\n if (resolvedValueColor)\n {valStyles.push({\n color: resolveColor(resolvedValueColor, theme.colors),\n });}\n if (item.valueStyle) {valStyles.push(item.valueStyle);}\n\n if (direction === \"horizontal\") {\n const rowStyles: Style[] = [styles.rowHorizontal];\n if (divided && !isLast) {\n const dividerStyle: Style = {};\n if (dividerColor)\n {dividerStyle.borderBottomColor = resolveColor(\n dividerColor,\n theme.colors\n );}\n if (dividerThickness)\n {dividerStyle.borderBottomWidth = dividerThickness;}\n if (dividerMargin) {dividerStyle.marginBottom = dividerMargin;}\n rowStyles.push({ ...styles.divider, ...dividerStyle });\n }\n return (\n <View key={item.key} style={rowStyles as never}>\n <PDFText style={[...keyStyles, { flex: labelFlex }] as never}>\n {item.key}\n </PDFText>\n <PDFText\n style={[...valStyles, { flex: 1, textAlign: \"right\" }] as never}\n >\n {item.value}\n </PDFText>\n </View>\n );\n }\n\n const rowStyles: Style[] = [styles.rowVertical];\n if (divided && !isLast) {rowStyles.push(styles.divider);}\n return (\n <View key={item.key} style={rowStyles as never}>\n <PDFText style={keyStyles as never}>{item.key}</PDFText>\n <PDFText style={valStyles as never}>{item.value}</PDFText>\n </View>\n );\n })}\n </View>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/key-value/index.ts",
+ "content": "export {\n KeyValue,\n type KeyValueProps,\n type KeyValueEntry,\n type KeyValueDirection,\n type KeyValueSize,\n} from \"./key-value\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/forme/link.json b/public/r/forme/link.json
new file mode 100644
index 0000000..e4ac1fc
--- /dev/null
+++ b/public/r/forme/link.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/link",
+ "title": "Link",
+ "description": "Link PDF component (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/components/link/link.tsx",
+ "content": "import { Link as PDFLink, StyleSheet } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type LinkVariant = \"default\" | \"muted\" | \"primary\";\nexport type LinkUnderline = \"always\" | \"none\";\n\n/**\n * Clickable hyperlink for PDF documents.\n * Props - `href` | `children` | `align` | `color` | `variant` | `underline` | `style`\n * @see {@link LinkProps}\n */\nexport interface LinkProps extends PDFComponentProps {\n href: string;\n /**\n * @default 'left'\n */\n align?: \"left\" | \"center\" | \"right\";\n color?: string;\n /**\n * @default 'default'\n */\n variant?: LinkVariant;\n /**\n * @default 'always'\n */\n underline?: LinkUnderline;\n}\n\nfunction createLinkStyles(t: PdfcnTheme) {\n const { fontWeights } = t.primitives;\n const base = {\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n lineHeight: t.typography.body.lineHeight,\n marginBottom: t.spacing.paragraphGap,\n };\n return StyleSheet.create({\n default: {\n ...base,\n color: t.colors.accent,\n fontWeight: fontWeights.medium,\n textDecoration: \"underline\",\n },\n muted: {\n ...base,\n color: t.colors.mutedForeground,\n fontWeight: fontWeights.regular,\n textDecoration: \"underline\",\n },\n primary: {\n ...base,\n color: t.colors.primary,\n fontWeight: fontWeights.semibold,\n textDecoration: \"underline\",\n },\n underlineAlways: { textDecoration: \"underline\" },\n underlineNone: { textDecoration: \"none\" },\n });\n}\n\nexport function Link({\n href,\n align,\n color,\n variant = \"default\",\n underline,\n children,\n style,\n}: LinkProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createLinkStyles(theme), [theme]);\n const variantMap = {\n default: styles.default,\n muted: styles.muted,\n primary: styles.primary,\n };\n const underlineMap = {\n always: styles.underlineAlways,\n none: styles.underlineNone,\n };\n const styleArray: Style[] = [variantMap[variant]];\n if (underline && underline in underlineMap)\n {styleArray.push(underlineMap[underline]);}\n const semantic = {} as Style;\n if (align) {semantic.textAlign = align;}\n if (color) {semantic.color = resolveColor(color, theme.colors);}\n if (Object.keys(semantic).length > 0) {styleArray.push(semantic);}\n if (style) {styleArray.push(...[style].flat());}\n return (\n <PDFLink href={href} style={styleArray as never}>\n {children}\n </PDFLink>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/link/index.ts",
+ "content": "export {\n Link,\n type LinkProps,\n type LinkVariant,\n type LinkUnderline,\n} from \"./link\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/forme/list.json b/public/r/forme/list.json
new file mode 100644
index 0000000..b8148ee
--- /dev/null
+++ b/public/r/forme/list.json
@@ -0,0 +1,36 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/list",
+ "title": "List",
+ "description": "List PDF component (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/components/list/list.styles.ts",
+ "content": "import { StyleSheet } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\n/**\n * Creates all list styles derived from the active theme.\n * @param t - The resolved PdfcnTheme instance.\n */\nexport function createListStyles(t: PdfcnTheme) {\n const { borderRadius, spacing, fontWeights, typography } = t.primitives;\n\n return StyleSheet.create({\n checkBox: {\n alignItems: \"center\",\n backgroundColor: t.colors.background,\n borderColor: t.colors.border,\n borderRadius: 3,\n borderStyle: \"solid\",\n borderWidth: 1.5,\n height: spacing[4],\n justifyContent: \"center\",\n marginRight: spacing[2],\n width: spacing[4],\n },\n checkBoxChecked: {\n backgroundColor: t.colors.success,\n borderColor: t.colors.success,\n },\n checkMark: {\n color: t.colors.background,\n fontFamily: t.typography.body.fontFamily,\n fontSize: 8,\n fontWeight: fontWeights.bold,\n },\n childrenContainer: {\n display: \"flex\",\n flexDirection: \"column\",\n marginLeft: spacing[5],\n marginTop: spacing[1],\n },\n container: {\n display: \"flex\",\n flexDirection: \"column\",\n marginBottom: t.spacing.componentGap,\n width: \"100%\",\n },\n descriptiveAccent: {\n backgroundColor: t.colors.primary,\n borderRadius: borderRadius.sm,\n marginRight: spacing[3],\n minHeight: spacing[4],\n width: 3,\n },\n descriptiveContent: {\n flex: 1,\n },\n descriptiveDesc: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n lineHeight: t.typography.body.lineHeight,\n marginTop: 1,\n },\n descriptiveTitle: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: t.typography.body.lineHeight,\n },\n iconBox: {\n alignItems: \"center\",\n backgroundColor: t.colors.primary,\n borderRadius: borderRadius.md,\n height: spacing[5],\n justifyContent: \"center\",\n marginRight: spacing[2],\n width: spacing[5],\n },\n iconMark: {\n color: t.colors.primaryForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: 9,\n fontWeight: fontWeights.bold,\n },\n itemRow: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n },\n itemRowCenter: {\n alignItems: \"center\",\n flexDirection: \"row\",\n },\n itemRowGapMd: { marginBottom: spacing[3] },\n itemRowGapSm: { marginBottom: spacing[2] },\n itemRowGapXs: { marginBottom: spacing[1] },\n itemText: {\n // No flex here — Text nodes with flex shorthand get flexBasis:0, which causes\n // Yoga to under-measure multi-line text height → overlapping rows.\n // flex:1 must live on the wrapping View, not on the Text itself.\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n lineHeight: t.typography.body.lineHeight,\n },\n itemTextBold: {\n fontWeight: fontWeights.semibold,\n },\n itemTextSub: {\n // Same: no flex — see itemText comment.\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize - 0.5,\n lineHeight: t.typography.body.lineHeight,\n },\n itemTextWrap: {\n // Companion to itemText / itemTextSub. Apply this to the View that wraps\n // the Text so flex expansion happens at the View level, not the Text level.\n flex: 1,\n },\n markerBulletDot: {\n backgroundColor: t.colors.primary,\n borderRadius: 3,\n height: 5,\n width: 5,\n },\n markerBulletSubDot: {\n backgroundColor: \"transparent\",\n borderColor: t.colors.mutedForeground,\n borderRadius: 2,\n borderStyle: \"solid\",\n borderWidth: 1,\n height: 4,\n width: 4,\n },\n markerBulletSubWrap: {\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n marginTop: spacing[1],\n width: spacing[4],\n },\n markerBulletWrap: {\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n marginTop: spacing[1],\n width: spacing[4],\n },\n markerNumberBadge: {\n alignItems: \"center\",\n backgroundColor: t.colors.primary,\n borderRadius: spacing[5],\n height: spacing[5],\n justifyContent: \"center\",\n marginRight: spacing[2],\n width: spacing[5],\n },\n markerNumberText: {\n color: t.colors.primaryForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.bold,\n },\n });\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/list/list.tsx",
+ "content": "import { Text as PDFText, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport type React from 'react';\nimport { usePdfcnTheme, useSafeMemo } from '../../lib/pdfcn-theme-context';\nimport { createListStyles } from './list.styles';\nimport type { ListItem, ListVariant, PdfListProps } from './list.types';\n\ntype Styles = ReturnType<typeof createListStyles>;\ntype GapProp = 'xs' | 'sm' | 'md';\n\nfunction getGapStyle(gap: GapProp, styles: Styles): Style {\n if (gap === 'xs') return styles.itemRowGapXs;\n if (gap === 'md') return styles.itemRowGapMd;\n return styles.itemRowGapSm;\n}\n\nfunction buildRowStyles(\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles,\n align: 'start' | 'center' = 'start'\n): Style[] {\n const row: Style[] = [align === 'center' ? styles.itemRowCenter : styles.itemRow];\n if (index !== total - 1) row.push(getGapStyle(gap, styles));\n return row;\n}\n\n/** Bullet dot marker — solid filled for level 0, outline ring for nested levels. */\nfunction dotMarker(level: number, styles: Styles): React.ReactElement {\n return level === 0 ? (\n <View style={styles.markerBulletWrap}>\n <View style={styles.markerBulletDot} />\n </View>\n ) : (\n <View style={styles.markerBulletSubWrap}>\n <View style={styles.markerBulletSubDot} />\n </View>\n );\n}\n\nfunction renderBulletItem(\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles,\n level: number\n): React.ReactElement {\n return (\n <View key={index}>\n <View style={buildRowStyles(index, total, gap, styles) as never}>\n {dotMarker(level, styles)}\n {/* flex:1 on the View, NOT on the Text — avoids Yoga height underestimation\n for multi-line Text nodes that would cause overlapping rows. */}\n <View style={styles.itemTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n {item.children && item.children.length > 0\n ? renderItemList(item.children, 'bullet', gap, styles, level + 1)\n : null}\n </View>\n );\n}\n\nfunction renderNumberedItem(\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement {\n return (\n <View key={index} style={buildRowStyles(index, total, gap, styles, 'center') as never}>\n <View style={styles.markerNumberBadge}>\n <PDFText style={styles.markerNumberText}>{`${index + 1}`}</PDFText>\n </View>\n <View style={styles.itemTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n );\n}\n\nfunction renderChecklistItem(\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement {\n const isChecked = item.checked ?? true;\n return (\n <View key={index} style={buildRowStyles(index, total, gap, styles, 'center') as never}>\n <View style={[styles.checkBox, isChecked ? styles.checkBoxChecked : {}] as never}>\n {isChecked ? <PDFText style={styles.checkMark}>✓</PDFText> : null}\n </View>\n <View style={styles.itemTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n );\n}\n\nfunction renderIconItem(\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement {\n return (\n <View key={index} style={buildRowStyles(index, total, gap, styles, 'center') as never}>\n <View style={styles.iconBox}>\n <PDFText style={styles.iconMark}>★</PDFText>\n </View>\n <View style={styles.itemTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n );\n}\n\nfunction renderMultiLevelItem(\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles,\n level: number\n): React.ReactElement {\n return (\n <View key={index}>\n <View style={buildRowStyles(index, total, gap, styles) as never}>\n {dotMarker(level, styles)}\n <View style={styles.itemTextWrap}>\n <PDFText\n style={[\n level === 0 ? styles.itemText : styles.itemTextSub,\n level === 0 ? styles.itemTextBold : {},\n ] as never}\n >\n {item.text}\n </PDFText>\n </View>\n </View>\n {item.children && item.children.length > 0\n ? renderItemList(item.children, 'multi-level', gap, styles, level + 1)\n : null}\n </View>\n );\n}\n\nfunction renderDescriptiveItem(\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement {\n return (\n <View key={index} style={buildRowStyles(index, total, gap, styles) as never}>\n <View style={styles.descriptiveAccent} />\n <View style={styles.descriptiveContent}>\n <PDFText style={styles.descriptiveTitle}>{item.text}</PDFText>\n {item.description ? (\n <PDFText style={styles.descriptiveDesc}>{item.description}</PDFText>\n ) : null}\n </View>\n </View>\n );\n}\n\nfunction renderItem(\n item: ListItem,\n index: number,\n total: number,\n variant: ListVariant,\n gap: GapProp,\n styles: Styles,\n level: number\n): React.ReactElement | null {\n switch (variant) {\n case 'bullet':\n return renderBulletItem(item, index, total, gap, styles, level);\n case 'numbered':\n return renderNumberedItem(item, index, total, gap, styles);\n case 'checklist':\n return renderChecklistItem(item, index, total, gap, styles);\n case 'icon':\n return renderIconItem(item, index, total, gap, styles);\n case 'multi-level':\n return renderMultiLevelItem(item, index, total, gap, styles, level);\n case 'descriptive':\n return renderDescriptiveItem(item, index, total, gap, styles);\n }\n}\n\nfunction renderItemList(\n items: ListItem[],\n variant: ListVariant,\n gap: GapProp,\n styles: Styles,\n level: number\n): React.ReactElement {\n return (\n <View style={level > 0 ? styles.childrenContainer : undefined}>\n {items.map((item, index) =>\n renderItem(item, index, items.length, variant, gap, styles, level)\n )}\n </View>\n );\n}\n\nexport function PdfList({\n items,\n variant = 'bullet',\n gap = 'sm',\n style,\n noWrap = false,\n _level = 0,\n}: PdfListProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createListStyles(theme), [theme]);\n\n const containerStyles: Style[] = [styles.container];\n if (_level > 0) containerStyles.push(styles.childrenContainer);\n const styleArray = style ? [...containerStyles, style] : containerStyles;\n\n return (\n <View style={styleArray as never}>\n {items.map((item, index) =>\n renderItem(item, index, items.length, variant, gap, styles, _level)\n )}\n </View>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/list/list.types.ts",
+ "content": "import type { Style } from \"@formepdf/react\";\n\n/** List visual style variant. */\nexport type ListVariant =\n | \"bullet\"\n | \"numbered\"\n | \"checklist\"\n | \"icon\"\n | \"multi-level\"\n | \"descriptive\";\n\n/**\n * A single list item, optionally with nested children.\n * Props - `text` | `description` | `checked` | `children`\n * @see {@link ListItem}\n */\nexport interface ListItem {\n text: string;\n description?: string;\n checked?: boolean;\n children?: ListItem[];\n}\n\n/**\n * List of items with multiple style variants including bullet, numbered, checklist, and descriptive.\n * Props - `items` | `variant` | `gap` | `style` | `_level` | `noWrap`\n * @see {@link PdfListProps}\n */\nexport interface PdfListProps {\n items: ListItem[];\n /**\n * @default 'bullet'\n */\n variant?: ListVariant;\n /**\n * @default 'sm'\n */\n gap?: \"xs\" | \"sm\" | \"md\";\n style?: Style;\n _level?: number;\n /**\n * @default false\n */\n noWrap?: boolean;\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/list/index.ts",
+ "content": "export { PdfList } from \"./list\";\nexport type { PdfListProps, ListVariant, ListItem } from \"./list.types\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/forme/page-break.json b/public/r/forme/page-break.json
new file mode 100644
index 0000000..2226ab4
--- /dev/null
+++ b/public/r/forme/page-break.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/page-break",
+ "title": "Page Break",
+ "description": "Page Break PDF component (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/components/page-break/page-break.tsx",
+ "content": "import { PageBreak as FormePageBreak } from \"@formepdf/react\";\n\nimport type { PDFComponentProps } from \"@/registry/themes\";\n\nexport interface PageBreakProps extends Omit<PDFComponentProps, \"children\"> {\n children?: never;\n}\n\nexport function PageBreak(_props: PageBreakProps) {\n return <FormePageBreak />;\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/page-break/index.ts",
+ "content": "export { PageBreak } from \"./page-break\";\nexport type { PageBreakProps } from \"./page-break\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/forme/page-footer.json b/public/r/forme/page-footer.json
new file mode 100644
index 0000000..f2ec06a
--- /dev/null
+++ b/public/r/forme/page-footer.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/page-footer",
+ "title": "Page Footer",
+ "description": "Page Footer PDF component (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/components/page-footer/page-footer.tsx",
+ "content": "import { Text as PDFText, StyleSheet, View, Fixed } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport type React from \"react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nfunction wrapFixed(fixed: boolean | undefined, node: React.ReactElement) {\n if (!fixed) {return node;}\n return <Fixed position=\"footer\">{node}</Fixed>;\n}\nexport type PageFooterVariant =\n | \"simple\"\n | \"centered\"\n | \"branded\"\n | \"minimal\"\n | \"three-column\"\n | \"detailed\";\n\n/**\n * Footer row with layout variants, optional sticky or fixed positioning, and contact info support.\n * Props - `leftText` | `rightText` | `centerText` | `variant` | `background` | `textColor` | `marginTop` | `address` | `phone` | `email` | `website` | `fixed` | `sticky` | `pagePadding` | `noWrap` | `style`\n * @see {@link PageFooterProps}\n */\nexport interface PageFooterProps extends Omit<PDFComponentProps, \"children\"> {\n leftText?: string;\n rightText?: string;\n centerText?: string;\n /**\n * @default 'simple'\n */\n variant?: PageFooterVariant;\n background?: string;\n textColor?: string;\n marginTop?: number;\n address?: string;\n phone?: string;\n email?: string;\n website?: string;\n /**\n * @default false\n */\n fixed?: boolean;\n /**\n * @default false\n */\n sticky?: boolean;\n /**\n * @default 0\n */\n pagePadding?: number;\n /**\n * @default true\n */\n noWrap?: boolean;\n}\n\nfunction createPageFooterStyles(t: PdfcnTheme) {\n const { spacing, fontWeights } = t.primitives;\n const c = t.colors;\n const { body } = t.typography;\n\n const textBase = {\n color: c.mutedForeground,\n fontFamily: body.fontFamily,\n fontSize: t.primitives.typography.xs,\n lineHeight: body.lineHeight,\n };\n\n return StyleSheet.create({\n brandedContainer: {\n alignItems: \"center\",\n backgroundColor: c.primary,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingHorizontal: spacing[4],\n paddingVertical: spacing[3],\n },\n\n centeredContainer: {\n alignItems: \"center\",\n borderTopColor: c.border,\n borderTopStyle: \"solid\",\n borderTopWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"column\",\n paddingTop: spacing[3],\n },\n\n companyBold: {\n ...textBase,\n color: c.foreground,\n fontWeight: fontWeights.bold,\n },\n\n companyName: {\n ...textBase,\n color: c.foreground,\n fontWeight: fontWeights.medium,\n },\n\n contactInfoCenter: {\n ...textBase,\n fontSize: t.primitives.typography.xs - 1,\n marginTop: spacing[0.5],\n textAlign: \"center\",\n },\n detailedContainer: {\n borderTopColor: c.border,\n borderTopStyle: \"solid\",\n borderTopWidth: spacing[1],\n display: \"flex\",\n flexDirection: \"column\",\n paddingTop: spacing[3],\n },\n detailedLeft: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n detailedPageNumber: {\n ...textBase,\n borderTopColor: c.border,\n borderTopStyle: \"solid\",\n borderTopWidth: spacing[0.5],\n paddingTop: spacing[2],\n textAlign: \"center\",\n },\n detailedRight: {\n alignItems: \"flex-end\",\n display: \"flex\",\n flexDirection: \"column\",\n },\n detailedTopRow: {\n alignItems: \"flex-start\",\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: spacing[2],\n },\n\n minimalContainer: {\n alignItems: \"center\",\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingBottom: spacing[1],\n paddingTop: spacing[1],\n },\n simpleContainer: {\n alignItems: \"center\",\n borderTopColor: c.border,\n borderTopStyle: \"solid\",\n borderTopWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingTop: spacing[3],\n },\n textBranded: {\n ...textBase,\n color: c.primaryForeground,\n fontWeight: fontWeights.medium,\n },\n textBrandedRight: {\n ...textBase,\n color: c.primaryForeground,\n textAlign: \"right\",\n },\n textCenter: {\n ...textBase,\n flex: 1,\n textAlign: \"center\",\n },\n textCenteredVariant: {\n ...textBase,\n marginBottom: spacing[1],\n textAlign: \"center\",\n },\n\n textLeft: {\n ...textBase,\n flex: 1,\n },\n textRight: {\n ...textBase,\n textAlign: \"right\",\n },\n threeColumnCenter: {\n alignItems: \"center\",\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n threeColumnContainer: {\n alignItems: \"flex-start\",\n borderTopColor: c.border,\n borderTopStyle: \"solid\",\n borderTopWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingTop: spacing[3],\n },\n threeColumnLeft: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n threeColumnRight: {\n alignItems: \"flex-end\",\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n });\n}\n\nexport function PageFooter({\n leftText,\n rightText,\n centerText,\n variant = \"simple\",\n background,\n textColor,\n marginTop,\n address,\n phone,\n email,\n website,\n fixed = false,\n sticky = false,\n pagePadding = 0,\n noWrap = true,\n style,\n}: PageFooterProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createPageFooterStyles(theme), [theme]);\n // sticky implies fixed; marginTop is irrelevant with absolute positioning\n const isFixed = fixed || sticky;\n const mt = sticky ? 0 : (marginTop ?? theme.spacing.sectionGap);\n const resolvedTextColor = textColor\n ? resolveColor(textColor, theme.colors)\n : undefined;\n const stickyStyle: Style = sticky\n ? {\n bottom: pagePadding,\n left: pagePadding,\n position: \"absolute\",\n right: pagePadding,\n }\n : {};\n\n function applyOverrides(base: Style[]): Style[] {\n if (background)\n {base.push({ backgroundColor: resolveColor(background, theme.colors) });}\n if (style) {base.push(style);}\n if (sticky) {base.push(stickyStyle);}\n return base;\n }\n\n if (variant === \"branded\") {\n const containerStyles = applyOverrides([\n styles.brandedContainer,\n { marginTop: mt },\n ]);\n\n const lStyle: Style[] = [styles.textBranded];\n const rStyle: Style[] = [styles.textBrandedRight];\n if (resolvedTextColor) {\n lStyle.push({ color: resolvedTextColor });\n rStyle.push({ color: resolvedTextColor });\n }\n\n return wrapFixed(\n isFixed,\n <View wrap={!noWrap} style={containerStyles as never}>\n {leftText && <PDFText style={lStyle as never}>{leftText}</PDFText>}\n {rightText && <PDFText style={rStyle as never}>{rightText}</PDFText>}\n </View>\n );\n }\n\n if (variant === \"centered\") {\n const containerStyles = applyOverrides([\n styles.centeredContainer,\n { marginTop: mt },\n ]);\n\n const tStyle: Style[] = [styles.textCenteredVariant];\n if (resolvedTextColor) {tStyle.push({ color: resolvedTextColor });}\n\n return wrapFixed(\n isFixed,\n <View wrap={!noWrap} style={containerStyles as never}>\n {leftText && <PDFText style={tStyle as never}>{leftText}</PDFText>}\n {rightText && <PDFText style={tStyle as never}>{rightText}</PDFText>}\n </View>\n );\n }\n\n if (variant === \"three-column\") {\n const containerStyles = applyOverrides([\n styles.threeColumnContainer,\n { marginTop: mt },\n ]);\n\n const leftStyle: Style[] = [styles.companyName];\n const centerStyle: Style[] = [styles.contactInfoCenter];\n const rightStyle: Style[] = [styles.textRight];\n if (resolvedTextColor) {\n leftStyle.push({ color: resolvedTextColor });\n centerStyle.push({ color: resolvedTextColor });\n rightStyle.push({ color: resolvedTextColor });\n }\n\n return wrapFixed(\n isFixed,\n <View wrap={!noWrap} style={containerStyles as never}>\n <View style={styles.threeColumnLeft}>\n {leftText && <PDFText style={leftStyle as never}>{leftText}</PDFText>}\n {address && <PDFText style={styles.textLeft}>{address}</PDFText>}\n </View>\n <View style={styles.threeColumnCenter}>\n {phone && <PDFText style={centerStyle as never}>{phone}</PDFText>}\n {email && <PDFText style={centerStyle as never}>{email}</PDFText>}\n {website && <PDFText style={centerStyle as never}>{website}</PDFText>}\n </View>\n <View style={styles.threeColumnRight}>\n {rightText && <PDFText style={rightStyle as never}>{rightText}</PDFText>}\n </View>\n </View>\n );\n }\n\n if (variant === \"detailed\") {\n const containerStyles = applyOverrides([\n styles.detailedContainer,\n { marginTop: mt },\n ]);\n\n const companyStyle: Style[] = [styles.companyBold];\n const addrStyle: Style[] = [styles.textLeft];\n const contactStyle: Style[] = [styles.textRight];\n const pageNumStyle: Style[] = [styles.detailedPageNumber];\n if (resolvedTextColor) {\n companyStyle.push({ color: resolvedTextColor });\n addrStyle.push({ color: resolvedTextColor });\n contactStyle.push({ color: resolvedTextColor });\n pageNumStyle.push({ color: resolvedTextColor });\n }\n\n return wrapFixed(\n isFixed,\n <View wrap={!noWrap} style={containerStyles as never}>\n <View style={styles.detailedTopRow}>\n <View style={styles.detailedLeft}>\n {leftText && <PDFText style={companyStyle as never}>{leftText}</PDFText>}\n {address && <PDFText style={addrStyle as never}>{address}</PDFText>}\n </View>\n <View style={styles.detailedRight}>\n {phone && (\n <PDFText style={contactStyle as never}>{`Phone: ${phone}`}</PDFText>\n )}\n {email && (\n <PDFText style={contactStyle as never}>{`Email: ${email}`}</PDFText>\n )}\n {website && (\n <PDFText style={contactStyle as never}>{`Web: ${website}`}</PDFText>\n )}\n </View>\n </View>\n {rightText && <PDFText style={pageNumStyle as never}>{rightText}</PDFText>}\n </View>\n );\n }\n\n if (variant === \"minimal\") {\n const containerStyles = applyOverrides([\n styles.minimalContainer,\n { marginTop: mt },\n ]);\n\n const lStyle: Style[] = [styles.textLeft];\n const rStyle: Style[] = [styles.textRight];\n if (resolvedTextColor) {\n lStyle.push({ color: resolvedTextColor });\n rStyle.push({ color: resolvedTextColor });\n }\n\n return wrapFixed(\n isFixed,\n <View wrap={!noWrap} style={containerStyles as never}>\n {leftText && <PDFText style={lStyle as never}>{leftText}</PDFText>}\n {rightText && <PDFText style={rStyle as never}>{rightText}</PDFText>}\n </View>\n );\n }\n\n const containerStyles = applyOverrides([\n styles.simpleContainer,\n { marginTop: mt },\n ]);\n\n const lStyle: Style[] = [styles.textLeft];\n const cStyle: Style[] = [styles.textCenter];\n const rStyle: Style[] = [styles.textRight];\n if (resolvedTextColor) {\n lStyle.push({ color: resolvedTextColor });\n cStyle.push({ color: resolvedTextColor });\n rStyle.push({ color: resolvedTextColor });\n }\n\n return wrapFixed(\n isFixed,\n <View wrap={!noWrap} style={containerStyles as never}>\n {leftText && <PDFText style={lStyle as never}>{leftText}</PDFText>}\n {centerText && <PDFText style={cStyle as never}>{centerText}</PDFText>}\n {rightText && <PDFText style={rStyle as never}>{rightText}</PDFText>}\n </View>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/page-footer/index.ts",
+ "content": "export {\n PageFooter,\n type PageFooterProps,\n type PageFooterVariant,\n} from \"./page-footer\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/forme/page-header.json b/public/r/forme/page-header.json
new file mode 100644
index 0000000..2f837ca
--- /dev/null
+++ b/public/r/forme/page-header.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/page-header",
+ "title": "Page Header",
+ "description": "Page Header PDF component (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/components/page-header/page-header.tsx",
+ "content": "import { Text as PDFText, StyleSheet, View, Fixed } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport type React from \"react\";\nimport type { ReactNode } from \"react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nfunction wrapFixed(fixed: boolean | undefined, node: React.ReactElement) {\n if (!fixed) {return node;}\n return <Fixed position=\"header\">{node}</Fixed>;\n}\nexport type PageHeaderVariant =\n | \"simple\"\n | \"centered\"\n | \"minimal\"\n | \"branded\"\n | \"logo-left\"\n | \"logo-right\"\n | \"two-column\";\n\n/**\n * Header row with layout variants, logo support, and optional fixed positioning.\n * Props - `title` | `subtitle` | `rightText` | `rightSubText` | `variant` | `background` | `titleColor` | `marginBottom` | `address` | `phone` | `email` | `logo` | `fixed` | `noWrap` | `style`\n * @see {@link PageHeaderProps}\n */\nexport interface PageHeaderProps extends Omit<PDFComponentProps, \"children\"> {\n title: string;\n subtitle?: string;\n rightText?: string;\n rightSubText?: string;\n /**\n * @default 'simple'\n */\n variant?: PageHeaderVariant;\n background?: string;\n titleColor?: string;\n marginBottom?: number;\n address?: string;\n phone?: string;\n email?: string;\n logo?: ReactNode;\n /**\n * @default false\n */\n fixed?: boolean;\n /**\n * @default true\n */\n noWrap?: boolean;\n}\n\nfunction createPageHeaderStyles(t: PdfcnTheme) {\n const { spacing, borderRadius, fontWeights } = t.primitives;\n const c = t.colors;\n const { heading, body } = t.typography;\n\n return StyleSheet.create({\n brandedContainer: {\n alignItems: \"center\",\n backgroundColor: c.primary,\n borderRadius: borderRadius.sm,\n display: \"flex\",\n flexDirection: \"column\",\n padding: spacing[6],\n },\n centeredContainer: {\n alignItems: \"center\",\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"column\",\n paddingBottom: spacing[4],\n },\n contactInfo: {\n color: c.mutedForeground,\n fontFamily: body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginTop: spacing[0.5],\n textAlign: \"right\",\n },\n\n logoContainer: {\n height: 48,\n marginRight: spacing[4],\n width: 48,\n },\n\n logoContent: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n logoLeftContainer: {\n alignItems: \"center\",\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n paddingBottom: spacing[4],\n },\n logoRightContainer: {\n alignItems: \"center\",\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingBottom: spacing[4],\n },\n\n logoRightContent: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n\n logoRightLogoContainer: {\n height: 48,\n marginLeft: spacing[4],\n width: 48,\n },\n minimalContainer: {\n alignItems: \"center\",\n borderBottomColor: c.primary,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[1],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingBottom: spacing[3],\n },\n minimalLeft: {\n flex: 1,\n },\n minimalRight: {\n alignItems: \"flex-end\",\n },\n\n rightSubText: {\n color: c.mutedForeground,\n fontFamily: body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginTop: spacing[1],\n textAlign: \"right\",\n },\n rightText: {\n color: c.foreground,\n fontFamily: body.fontFamily,\n fontSize: body.fontSize,\n fontWeight: fontWeights.medium,\n textAlign: \"right\",\n },\n simpleContainer: {\n alignItems: \"flex-start\",\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingBottom: spacing[4],\n },\n\n simpleLeft: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n simpleRight: {\n alignItems: \"flex-end\",\n display: \"flex\",\n flexDirection: \"column\",\n },\n\n subtitle: {\n color: c.mutedForeground,\n fontFamily: body.fontFamily,\n fontSize: body.fontSize,\n lineHeight: body.lineHeight,\n marginTop: spacing[1],\n },\n subtitleBranded: {\n color: c.primaryForeground,\n marginTop: spacing[1],\n },\n subtitleCentered: {\n textAlign: \"center\",\n },\n\n title: {\n color: c.foreground,\n fontFamily: heading.fontFamily,\n fontSize: heading.fontSize.h3,\n fontWeight: fontWeights.bold,\n lineHeight: heading.lineHeight,\n marginBottom: 0,\n },\n titleBranded: {\n color: c.primaryForeground,\n },\n titleCentered: {\n textAlign: \"center\",\n },\n\n titleMinimal: {\n fontSize: heading.fontSize.h3,\n fontWeight: fontWeights.bold,\n },\n twoColumnContainer: {\n alignItems: \"flex-start\",\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingBottom: spacing[4],\n },\n twoColumnLeft: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n twoColumnRight: {\n alignItems: \"flex-end\",\n display: \"flex\",\n flexDirection: \"column\",\n },\n });\n}\n\nexport function PageHeader({\n title,\n subtitle,\n rightText,\n rightSubText,\n variant = \"simple\",\n background,\n titleColor,\n marginBottom,\n logo,\n address,\n phone,\n email,\n fixed = false,\n noWrap = true,\n style,\n}: PageHeaderProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createPageHeaderStyles(theme), [theme]);\n const mb = marginBottom ?? theme.spacing.sectionGap;\n\n if (variant === \"branded\") {\n const containerStyles: Style[] = [\n styles.brandedContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [\n styles.title,\n styles.titleBranded,\n styles.titleCentered,\n ];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return wrapFixed(\n fixed,\n <View wrap={!noWrap} style={containerStyles as never}>\n <PDFText style={titleStyles as never}>{title}</PDFText>\n {subtitle && (\n <PDFText style={[styles.subtitle, styles.subtitleBranded] as never}>\n {subtitle}\n </PDFText>\n )}\n </View>\n );\n }\n\n if (variant === \"centered\") {\n const containerStyles: Style[] = [\n styles.centeredContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [styles.title, styles.titleCentered];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return wrapFixed(\n fixed,\n <View wrap={!noWrap} style={containerStyles as never}>\n <PDFText style={titleStyles as never}>{title}</PDFText>\n {subtitle && (\n <PDFText style={[styles.subtitle, styles.subtitleCentered] as never}>\n {subtitle}\n </PDFText>\n )}\n </View>\n );\n }\n\n if (variant === \"logo-right\") {\n const containerStyles: Style[] = [\n styles.logoRightContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [styles.title];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return wrapFixed(\n fixed,\n <View wrap={!noWrap} style={containerStyles as never}>\n <View style={styles.logoRightContent}>\n <PDFText style={titleStyles as never}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {logo && <View style={styles.logoRightLogoContainer}>{logo}</View>}\n </View>\n );\n }\n\n if (variant === \"logo-left\") {\n const containerStyles: Style[] = [\n styles.logoLeftContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [styles.title];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return wrapFixed(\n fixed,\n <View wrap={!noWrap} style={containerStyles as never}>\n {logo && <View style={styles.logoContainer}>{logo}</View>}\n <View style={styles.logoContent}>\n <PDFText style={titleStyles as never}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {(rightText || rightSubText) && (\n <View style={styles.simpleRight}>\n {rightText && (\n <PDFText style={styles.rightText}>{rightText}</PDFText>\n )}\n {rightSubText && (\n <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>\n )}\n </View>\n )}\n </View>\n );\n }\n\n if (variant === \"two-column\") {\n const containerStyles: Style[] = [\n styles.twoColumnContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [styles.title];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return wrapFixed(\n fixed,\n <View wrap={!noWrap} style={containerStyles as never}>\n <View style={styles.twoColumnLeft}>\n <PDFText style={titleStyles as never}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {(address || phone || email) && (\n <View style={styles.twoColumnRight}>\n {address && <PDFText style={styles.contactInfo}>{address}</PDFText>}\n {phone && <PDFText style={styles.contactInfo}>{phone}</PDFText>}\n {email && <PDFText style={styles.contactInfo}>{email}</PDFText>}\n </View>\n )}\n </View>\n );\n }\n\n if (variant === \"minimal\") {\n const containerStyles: Style[] = [\n styles.minimalContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [styles.title, styles.titleMinimal];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return wrapFixed(\n fixed,\n <View wrap={!noWrap} style={containerStyles as never}>\n <View style={styles.minimalLeft}>\n <PDFText style={titleStyles as never}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {(rightText || rightSubText) && (\n <View style={styles.minimalRight}>\n {rightText && (\n <PDFText style={styles.rightText}>{rightText}</PDFText>\n )}\n {rightSubText && (\n <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>\n )}\n </View>\n )}\n </View>\n );\n }\n\n const containerStyles: Style[] = [\n styles.simpleContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [styles.title];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return wrapFixed(\n fixed,\n <View wrap={!noWrap} style={containerStyles as never}>\n <View style={styles.simpleLeft}>\n <PDFText style={titleStyles as never}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {(rightText || rightSubText) && (\n <View style={styles.simpleRight}>\n {rightText && <PDFText style={styles.rightText}>{rightText}</PDFText>}\n {rightSubText && (\n <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>\n )}\n </View>\n )}\n </View>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/page-header/index.ts",
+ "content": "export {\n PageHeader,\n type PageHeaderProps,\n type PageHeaderVariant,\n} from \"./page-header\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/forme/page-number.json b/public/r/forme/page-number.json
new file mode 100644
index 0000000..2b9b3f6
--- /dev/null
+++ b/public/r/forme/page-number.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/page-number",
+ "title": "Page Number",
+ "description": "Page Number PDF component (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/components/page-number/page-number.tsx",
+ "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\n\nexport type PageNumberAlign = \"left\" | \"center\" | \"right\";\nexport type PageNumberSize = \"xs\" | \"sm\" | \"md\";\n\n/**\n * Auto page number rendered with a configurable format string at a or inline position.\n * Props - `format` | `align` | `size` | `fixed` | `muted` | `style`\n * @see {@link PdfPageNumberProps}\n */\nexport interface PdfPageNumberProps extends Omit<\n PDFComponentProps,\n \"children\"\n> {\n /**\n * Format string — use `{page}` for current page and `{total}` for total page count.\n * @default 'Page {page} of {total}'\n */\n format?: string;\n /**\n * @default 'center'\n */\n align?: PageNumberAlign;\n /**\n * @default 'sm'\n */\n size?: PageNumberSize;\n /**\n * @default false\n */\n fixed?: boolean;\n /**\n * @default true\n */\n muted?: boolean;\n children?: never;\n}\n\nfunction createPageNumberStyles(t: PdfcnTheme) {\n const { typography, colors, primitives } = t;\n return StyleSheet.create({\n alignCenter: { textAlign: \"center\" },\n alignLeft: { textAlign: \"left\" },\n alignRight: { textAlign: \"right\" },\n colorForeground: { color: colors.foreground },\n colorMuted: { color: colors.mutedForeground },\n container: { width: \"100%\" },\n sizeMd: { fontSize: primitives.typography.base },\n sizeSm: { fontSize: primitives.typography.sm },\n sizeXs: { fontSize: primitives.typography.xs },\n text: { fontFamily: typography.body.fontFamily },\n });\n}\n\nfunction formatPageNumber(\n format: string,\n pageNumber: number,\n totalPages: number\n): string {\n return format\n .replace(\"{page}\", String(pageNumber))\n .replace(\"{total}\", String(totalPages));\n}\n\nexport function PdfPageNumber({\n format = \"Page {page} of {total}\",\n align = \"center\",\n size = \"sm\",\n fixed = false,\n muted = true,\n style,\n}: PdfPageNumberProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createPageNumberStyles(theme), [theme]);\n const alignMap = {\n center: styles.alignCenter,\n left: styles.alignLeft,\n right: styles.alignRight,\n } as Record<PageNumberAlign, Style>;\n const sizeMap = {\n md: styles.sizeMd,\n sm: styles.sizeSm,\n xs: styles.sizeXs,\n } as Record<PageNumberSize, Style>;\n const textStyles: Style[] = [\n styles.text,\n alignMap[align],\n sizeMap[size],\n muted ? styles.colorMuted : styles.colorForeground,\n ];\n if (style) {textStyles.push(...[style].flat());}\n return (\n <View style={styles.container}>\n <PDFText style={textStyles as never}>\n {format\n .replace(\"{page}\", \"{{pageNumber}}\")\n .replace(\"{total}\", \"{{totalPages}}\")}\n </PDFText>\n </View>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/page-number/index.ts",
+ "content": "export {\n PdfPageNumber,\n type PdfPageNumberProps,\n type PageNumberAlign,\n type PageNumberSize,\n} from \"./page-number\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/forme/pdf-image.json b/public/r/forme/pdf-image.json
new file mode 100644
index 0000000..1097aee
--- /dev/null
+++ b/public/r/forme/pdf-image.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/pdf-image",
+ "title": "Pdf Image",
+ "description": "Pdf Image PDF component (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/components/pdf-image/pdf-image.tsx",
+ "content": "import { Image, Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\n\n/** HTTP method used when fetching the image from a URL. */\nexport type PdfImageHTTPMethod =\n | \"GET\"\n | \"HEAD\"\n | \"POST\"\n | \"PUT\"\n | \"DELETE\"\n | \"PATCH\";\n\nexport type PdfImageSrc =\n | string\n | {\n uri: string;\n method?: PdfImageHTTPMethod;\n headers?: Record<string, string>;\n body?: string;\n };\n\nexport type PdfImageFit = \"cover\" | \"contain\" | \"fill\" | \"none\";\n\nexport type PdfImageVariant =\n | \"default\"\n | \"full-width\"\n | \"thumbnail\"\n | \"avatar\"\n | \"cover\"\n | \"bordered\"\n | \"rounded\";\n\n/**\n * Image element with layout presets, caption, and aspect ratio support.\n * Props - `src` | `variant` | `width` | `height` | `fit` | `position` | `caption` | `aspectRatio` | `borderRadius` | `noWrap` | `style`\n * @see {@link PdfImageProps}\n */\nexport interface PdfImageProps {\n src: PdfImageSrc;\n /**\n * @default 'default'\n */\n variant?: PdfImageVariant;\n width?: number | string;\n height?: number | string;\n fit?: PdfImageFit;\n /**\n * @default '50% 50%'\n */\n position?: string;\n caption?: string;\n aspectRatio?: number;\n borderRadius?: number;\n /**\n * @default true\n */\n noWrap?: boolean;\n style?: Style;\n}\n\ninterface VariantDefaults {\n width?: number | string;\n height?: number | string;\n fit: PdfImageFit;\n borderRadius?: number;\n}\n\nconst VARIANT_DEFAULTS: Record<PdfImageVariant, VariantDefaults> = {\n avatar: { borderRadius: 999, fit: \"cover\", height: 48, width: 48 },\n bordered: { fit: \"contain\", width: \"100%\" },\n cover: { fit: \"cover\", height: 160, width: \"100%\" },\n default: { fit: \"contain\" },\n \"full-width\": { fit: \"cover\", width: \"100%\" },\n rounded: { borderRadius: 8, fit: \"contain\", width: 200 },\n thumbnail: { fit: \"cover\", height: 80, width: 80 },\n};\n\nconst UNSUPPORTED_FORMATS = new Set([\"webp\", \"avif\", \"heic\", \"heif\", \"ico\"]);\n\nfunction detectFormat(src: PdfImageSrc): string | null {\n if (typeof src !== \"string\") return null;\n const dataMatch = src.match(/^data:image\\/([a-zA-Z0-9+.-]+)/);\n if (dataMatch) return dataMatch[1].toLowerCase();\n return src.split(\"?\")[0].split(\".\").pop()?.toLowerCase() ?? null;\n}\n\nfunction warnIfUnsupported(src: PdfImageSrc): void {\n const fmt = detectFormat(src);\n if (fmt && UNSUPPORTED_FORMATS.has(fmt)) {\n console.warn(\n `[PdfImage] Unsupported format \"${fmt}\" detected. react-pdf supports: JPEG, PNG, GIF (first frame), BMP, SVG. Convert to PNG or JPEG before use.`\n );\n }\n}\n\nfunction createImageStyles(t: PdfcnTheme) {\n const { spacing } = t.primitives;\n return StyleSheet.create({\n caption: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginTop: spacing[1],\n textAlign: \"center\",\n },\n container: { flexDirection: \"column\" },\n image: {},\n imageBordered: {\n borderColor: t.colors.border,\n borderStyle: \"solid\",\n borderWidth: 1,\n },\n });\n}\n\nexport function PdfImage({\n src,\n variant = \"default\",\n width,\n height,\n fit,\n position = \"50% 50%\",\n caption,\n aspectRatio,\n borderRadius,\n noWrap = true,\n style,\n}: PdfImageProps) {\n warnIfUnsupported(src);\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createImageStyles(theme), [theme]);\n const defaults = VARIANT_DEFAULTS[variant];\n\n const resolvedWidth = width ?? defaults.width;\n const resolvedHeight: number | string | undefined = (() => {\n if (height !== undefined) {return height;}\n if (defaults.height !== undefined) {return defaults.height;}\n if (aspectRatio !== undefined && typeof resolvedWidth === \"number\")\n {return resolvedWidth / aspectRatio;}\n return;\n })();\n\n const resolvedFit = fit ?? defaults.fit;\n const resolvedRadius = borderRadius ?? defaults.borderRadius;\n\n const imageStyles: Style[] = [styles.image];\n if (resolvedWidth !== undefined)\n {imageStyles.push({ width: resolvedWidth } as Style);}\n if (resolvedHeight !== undefined)\n {imageStyles.push({ height: resolvedHeight } as Style);}\n imageStyles.push({\n objectFit: resolvedFit,\n objectPosition: position,\n } as Style);\n if (resolvedRadius !== undefined)\n {imageStyles.push({ borderRadius: resolvedRadius } as Style);}\n if (variant === \"bordered\") {imageStyles.push(styles.imageBordered);}\n if (style) {imageStyles.push(style);}\n\n const content = (\n <View style={styles.container}>\n <Image src={src as never} style={imageStyles as never} />\n {caption ? <PDFText style={styles.caption}>{caption}</PDFText> : null}\n </View>\n );\n\n return noWrap ? <View wrap={false}>{content}</View> : content;\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/pdf-image/index.ts",
+ "content": "export {\n PdfImage,\n type PdfImageProps,\n type PdfImageSrc,\n type PdfImageVariant,\n type PdfImageFit,\n} from \"./pdf-image\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/forme/qrcode.json b/public/r/forme/qrcode.json
new file mode 100644
index 0000000..185a920
--- /dev/null
+++ b/public/r/forme/qrcode.json
@@ -0,0 +1,27 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/qrcode",
+ "title": "Qrcode",
+ "description": "Qrcode PDF component (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core",
+ "qrcode"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/components/qrcode/qrcode.tsx",
+ "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport QRCode from \"qrcode\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { Rect, Svg } from \"../../lib/forme-svg\";\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type QRCodeErrorLevel = \"L\" | \"M\" | \"Q\" | \"H\";\n\n/**\n * QR code rendered as an SVG grid for use in PDF documents.\n * Props - `value` | `size` | `color` | `backgroundColor` | `errorLevel` | `margin` | `caption` | `style`\n * @see {@link PdfQRCodeProps}\n */\nexport interface PdfQRCodeProps extends Omit<PDFComponentProps, \"children\"> {\n value: string;\n size?: number;\n color?: string;\n backgroundColor?: string;\n errorLevel?: QRCodeErrorLevel;\n margin?: number;\n caption?: string;\n children?: never;\n}\n\nfunction createQRCodeStyles(t: PdfcnTheme) {\n const { spacing } = t.primitives;\n return StyleSheet.create({\n caption: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginTop: spacing[1],\n textAlign: \"center\",\n },\n container: { alignItems: \"center\" },\n });\n}\n\nfunction generateQRMatrix(\n value: string,\n errorLevel: QRCodeErrorLevel,\n margin: number\n): boolean[][] {\n const qr = QRCode.create(value, { errorCorrectionLevel: errorLevel });\n const { size, data } = qr.modules;\n const totalSize = size + margin * 2;\n const matrix: boolean[][] = [];\n for (let row = 0; row < totalSize; row++) {\n const rowData: boolean[] = [];\n for (let col = 0; col < totalSize; col++) {\n const isInMargin =\n row < margin ||\n row >= size + margin ||\n col < margin ||\n col >= size + margin;\n if (isInMargin) {\n rowData.push(false);\n } else {\n rowData.push(data[(row - margin) * size + (col - margin)] === 1);\n }\n }\n matrix.push(rowData);\n }\n return matrix;\n}\n\nexport function PdfQRCode({\n value,\n size = 100,\n color = \"#000000\",\n backgroundColor = \"#ffffff\",\n errorLevel = \"M\",\n margin = 2,\n caption,\n style,\n}: PdfQRCodeProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createQRCodeStyles(theme), [theme]);\n const matrix = useSafeMemo(\n () => generateQRMatrix(value, errorLevel, margin),\n [value, errorLevel, margin]\n );\n const moduleSize = size / matrix.length;\n const resolvedColor = resolveColor(color, theme.colors);\n const resolvedBgColor =\n backgroundColor === \"transparent\"\n ? undefined\n : resolveColor(backgroundColor, theme.colors);\n const containerStyles: Style[] = [styles.container];\n if (style) {containerStyles.push(...[style].flat());}\n\n return (\n <View style={containerStyles as never}>\n <Svg width={size} height={size} viewBox={`0 0 ${size} ${size}`}>\n {resolvedBgColor !== undefined && (\n <Rect x={0} y={0} width={size} height={size} fill={resolvedBgColor} />\n )}\n {matrix\n .flatMap((row, y) =>\n row\n .map((isDark, x) => (isDark ? { x, y } : null))\n .filter((pos): pos is { x: number; y: number } => pos !== null)\n )\n .map((pos) => (\n <Rect\n key={`qr-${pos.y}-${pos.x}`}\n x={pos.x * moduleSize}\n y={pos.y * moduleSize}\n width={moduleSize}\n height={moduleSize}\n fill={resolvedColor}\n />\n ))}\n </Svg>\n {caption && <PDFText style={styles.caption}>{caption}</PDFText>}\n </View>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/qrcode/index.ts",
+ "content": "export {\n PdfQRCode,\n type PdfQRCodeProps,\n type QRCodeErrorLevel,\n} from \"./qrcode\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/forme/report-financial.json b/public/r/forme/report-financial.json
new file mode 100644
index 0000000..71aa009
--- /dev/null
+++ b/public/r/forme/report-financial.json
@@ -0,0 +1,31 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/report-financial",
+ "title": "Report Financial",
+ "description": "Report Financial PDF block (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/report-financial/report-financial.tsx",
+ "content": "import { ReportTemplateFrame } from './report-layout';\nimport type { ReportTemplateProps } from './report-layout';\nimport type { BaseReportData } from \"./report.types\";\n\nconst sampleFinancialData: BaseReportData = {\n author: \"Finance Ops\",\n generatedAt: \"February 23, 2026\",\n highlights: [\n \"Revenue accelerated after enterprise expansion campaign launch.\",\n \"Gross margin improved due to infrastructure cost renegotiation.\",\n \"Collections requires executive follow-up on two overdue accounts.\",\n ],\n period: \"Q1 2026\",\n rows: [\n {\n label: \"Enterprise Sales\",\n owner: \"A. Patel\",\n status: \"On Track\",\n progress: 88,\n risk: \"Low\",\n },\n {\n label: \"SMB Sales\",\n owner: \"L. Khan\",\n status: \"On Track\",\n progress: 79,\n risk: \"Medium\",\n },\n {\n label: \"Collections\",\n owner: \"J. Reyes\",\n status: \"At Risk\",\n progress: 63,\n risk: \"High\",\n },\n {\n label: \"Cost Optimization\",\n owner: \"K. Singh\",\n status: \"On Track\",\n progress: 82,\n risk: \"Low\",\n },\n ],\n series: [\n { label: \"W1\", value: 72 },\n { label: \"W2\", value: 74 },\n { label: \"W3\", value: 76 },\n { label: \"W4\", value: 77 },\n { label: \"W5\", value: 79 },\n { label: \"W6\", value: 80 },\n { label: \"W7\", value: 81 },\n { label: \"W8\", value: 83 },\n { label: \"W9\", value: 82 },\n { label: \"W10\", value: 84 },\n { label: \"W11\", value: 86 },\n { label: \"W12\", value: 88 },\n ],\n subtitle: \"Revenue, margin, and expense control overview\",\n summary: [\n { label: \"Revenue\", value: \"$2.48M\", trend: \"+14.2% QoQ\", tone: \"success\" },\n {\n label: \"Gross Margin\",\n value: \"61.8%\",\n trend: \"+2.1 pts\",\n tone: \"success\",\n },\n { label: \"Opex\", value: \"$0.93M\", trend: \"-3.4% QoQ\", tone: \"success\" },\n { label: \"Runway\", value: \"22 months\", trend: \"Stable\", tone: \"info\" },\n ],\n title: \"Quarterly Financial Report\",\n};\n\nexport function FinancialReportDocument({\n theme,\n data = sampleFinancialData,\n}: ReportTemplateProps) {\n return (\n <ReportTemplateFrame\n theme={theme}\n data={data}\n titlePrefix=\"Financial Report\"\n statusLabel=\"Finance: Healthy\"\n statusTone=\"success\"\n graphVariant=\"line\"\n graphTitle=\"Revenue trajectory\"\n graphSubtitle=\"Quarterly weighted revenue index\"\n graphLegend=\"none\"\n graphColors={[\"#0F172A\"]}\n />\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/report-financial/report-layout.tsx",
+ "content": "import {\n Badge,\n DataTable,\n Divider,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Stack,\n Text,\n usePdfcnTheme,\n} from '../../components';\nimport type { PdfcnTheme } from '@/registry/themes';\nimport { Document, Page, StyleSheet, View } from \"@formepdf/react\";\nimport type { BaseReportData } from './report.types';\n\nexport interface ReportTemplateProps {\n theme?: PdfcnTheme;\n data?: BaseReportData;\n}\n\ntype ReportGraphVariant = 'bar' | 'horizontal-bar' | 'line' | 'area' | 'pie' | 'donut';\n\ninterface ReportLayoutProps {\n data: BaseReportData;\n titlePrefix: string;\n statusLabel: string;\n statusTone: 'success' | 'warning' | 'destructive' | 'info';\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: 'bottom' | 'right' | 'none';\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: Array<{ label: string; value: number }>;\n}\n\nfunction toneColor(theme: PdfcnTheme, tone: 'success' | 'warning' | 'destructive' | 'info') {\n if (tone === 'success') return theme.colors.success;\n if (tone === 'warning') return theme.colors.warning;\n if (tone === 'destructive') return theme.colors.destructive;\n return theme.colors.info;\n}\n\nexport function ReportLayout({\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend = 'none',\n graphShowValues = false,\n graphColors,\n graphData,\n}: ReportLayoutProps) {\n const theme = usePdfcnTheme();\n const accent = toneColor(theme, statusTone);\n\n const styles = StyleSheet.create({\n page: {\n paddingTop: theme.spacing.page.marginTop,\n paddingLeft: theme.spacing.page.marginLeft,\n paddingRight: theme.spacing.page.marginRight,\n paddingBottom: theme.spacing.page.marginBottom,\n backgroundColor: theme.colors.background,\n },\n toolbar: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n marginBottom: 8,\n },\n metricsGrid: {\n flexDirection: 'row',\n flexWrap: 'wrap',\n gap: 8,\n },\n metricCard: {\n width: '48.6%',\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n padding: 8,\n backgroundColor: theme.colors.background,\n },\n metricLabel: {\n fontSize: 8,\n textTransform: 'uppercase',\n color: theme.colors.mutedForeground,\n marginBottom: 2,\n letterSpacing: 0.5,\n },\n metricValue: {\n fontSize: 14,\n color: theme.colors.foreground,\n fontWeight: theme.primitives.fontWeights.bold,\n marginBottom: 2,\n },\n metricTrend: {\n fontSize: 9,\n color: theme.colors.mutedForeground,\n },\n graphShell: {\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n padding: 12,\n backgroundColor: theme.colors.background,\n },\n twoColumn: {\n flexDirection: 'row',\n gap: 10,\n alignItems: 'flex-start',\n },\n col: {\n flex: 1,\n },\n });\n\n return (\n <Document title={`${titlePrefix} ${data.period}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <PageHeader\n variant=\"two-column\"\n title={data.title}\n subtitle={`${titlePrefix} · ${data.subtitle}`}\n rightText={data.period}\n rightSubText={`Generated ${data.generatedAt}`}\n marginBottom={14}\n />\n\n <View style={styles.toolbar}>\n <Badge label={statusLabel} variant={statusTone} size=\"sm\" />\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Author: {data.author}\n </Text>\n </View>\n\n <Section variant=\"card\" padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Executive Summary\n </Text>\n <View style={styles.metricsGrid}>\n {data.summary.map((metric) => (\n <View\n key={metric.label}\n style={[\n styles.metricCard,\n {\n borderLeftWidth: 3,\n borderLeftColor: metric.tone ? toneColor(theme, metric.tone) : accent,\n },\n ] as never}\n >\n <Text style={styles.metricLabel} noMargin>\n {metric.label}\n </Text>\n <Text style={styles.metricValue} noMargin>\n {metric.value}\n </Text>\n {metric.trend ? (\n <Badge label={metric.trend} size=\"sm\" variant={metric.tone ?? 'info'} />\n ) : null}\n </View>\n ))}\n </View>\n </Section>\n\n <Section padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View style={styles.graphShell}>\n <PdfGraph\n variant={graphVariant}\n data={graphData ?? data.series}\n title={graphTitle}\n subtitle={graphSubtitle}\n yLabel={undefined}\n xLabel={undefined}\n showGrid={graphVariant !== 'pie' && graphVariant !== 'donut'}\n showValues={graphShowValues}\n smooth={graphVariant === 'line' || graphVariant === 'area'}\n legend={graphLegend}\n height={200}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section padding=\"md\">\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Delivery Table\n </Text>\n <DataTable\n variant=\"compact\"\n size=\"compact\"\n stripe\n columns={[\n { key: 'label', header: 'Stream' },\n { key: 'owner', header: 'Owner' },\n { key: 'status', header: 'Status', align: 'center' },\n {\n key: 'progress',\n header: 'Progress',\n align: 'right',\n render: (value) => `${String(value)}%`,\n },\n { key: 'risk', header: 'Risk', align: 'right' },\n ]}\n data={data.rows}\n footer={{\n label: 'Totals',\n owner: '-',\n status: '-',\n progress: Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n ),\n risk: '-',\n }}\n />\n </Section>\n\n <Section padding=\"md\" variant=\"card\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Highlights & Risks\n </Text>\n <View style={styles.twoColumn}>\n <View style={styles.col}>\n <PdfList\n variant=\"checklist\"\n items={data.highlights.map((item) => ({ text: item, checked: true }))}\n gap=\"sm\"\n />\n </View>\n <View style={styles.col}>\n <KeyValue\n size=\"sm\"\n divided\n items={[\n {\n key: 'Open Risks',\n value: `${data.rows.filter((r) => r.risk !== 'Low').length}`,\n },\n {\n key: 'On-Track Streams',\n value: `${data.rows.filter((r) => r.status === 'On Track').length}/${data.rows.length}`,\n },\n {\n key: 'Average Progress',\n value: `${Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n )}%`,\n },\n ]}\n />\n </View>\n </View>\n <Divider />\n <Stack gap=\"sm\">\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: keep each section under one page using `noWrap` for concise blocks.\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: pass explicit row keys/owners to avoid ambiguous reporting handoffs.\n </Text>\n </Stack>\n </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with PDFx\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </View></Page>\n </Document>\n );\n}\n\nexport function ReportTemplateFrame({\n theme,\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend,\n graphShowValues,\n graphColors,\n graphData,\n}: ReportTemplateProps & {\n titlePrefix: string;\n statusLabel: string;\n statusTone: 'success' | 'warning' | 'destructive' | 'info';\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: 'bottom' | 'right' | 'none';\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: Array<{ label: string; value: number }>;\n}) {\n if (!data) return null;\n\n return (\n <PdfcnThemeProvider theme={theme}>\n <ReportLayout\n data={data}\n titlePrefix={titlePrefix}\n statusLabel={statusLabel}\n statusTone={statusTone}\n graphVariant={graphVariant}\n graphTitle={graphTitle}\n graphSubtitle={graphSubtitle}\n graphLegend={graphLegend}\n graphShowValues={graphShowValues}\n graphColors={graphColors}\n graphData={graphData}\n />\n </PdfcnThemeProvider>\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/report-financial/report.types.ts",
+ "content": "export interface SummaryMetric {\n label: string;\n value: string;\n trend?: string;\n tone?: \"success\" | \"warning\" | \"destructive\" | \"info\";\n}\n\nexport type ReportRow = Record<string, unknown> & {\n label: string;\n owner: string;\n status: string;\n progress: number;\n risk?: string;\n};\n\nexport interface ReportSeriesPoint {\n label: string;\n value: number;\n}\n\nexport interface BaseReportData {\n title: string;\n subtitle: string;\n generatedAt: string;\n period: string;\n author: string;\n summary: SummaryMetric[];\n rows: ReportRow[];\n series: ReportSeriesPoint[];\n highlights: string[];\n}\n",
+ "type": "registry:block"
+ }
+ ],
+ "type": "registry:block"
+}
\ No newline at end of file
diff --git a/public/r/forme/report-marketing.json b/public/r/forme/report-marketing.json
new file mode 100644
index 0000000..8e7d9a5
--- /dev/null
+++ b/public/r/forme/report-marketing.json
@@ -0,0 +1,31 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/report-marketing",
+ "title": "Report Marketing",
+ "description": "Report Marketing PDF block (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/report-marketing/report-layout.tsx",
+ "content": "import {\n Badge,\n DataTable,\n Divider,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Stack,\n Text,\n usePdfcnTheme,\n} from '../../components';\nimport type { PdfcnTheme } from '@/registry/themes';\nimport { Document, Page, StyleSheet, View } from \"@formepdf/react\";\nimport type { BaseReportData } from './report.types';\n\nexport interface ReportTemplateProps {\n theme?: PdfcnTheme;\n data?: BaseReportData;\n}\n\ntype ReportGraphVariant = 'bar' | 'horizontal-bar' | 'line' | 'area' | 'pie' | 'donut';\n\ninterface ReportLayoutProps {\n data: BaseReportData;\n titlePrefix: string;\n statusLabel: string;\n statusTone: 'success' | 'warning' | 'destructive' | 'info';\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: 'bottom' | 'right' | 'none';\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: Array<{ label: string; value: number }>;\n}\n\nfunction toneColor(theme: PdfcnTheme, tone: 'success' | 'warning' | 'destructive' | 'info') {\n if (tone === 'success') return theme.colors.success;\n if (tone === 'warning') return theme.colors.warning;\n if (tone === 'destructive') return theme.colors.destructive;\n return theme.colors.info;\n}\n\nexport function ReportLayout({\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend = 'none',\n graphShowValues = false,\n graphColors,\n graphData,\n}: ReportLayoutProps) {\n const theme = usePdfcnTheme();\n const accent = toneColor(theme, statusTone);\n\n const styles = StyleSheet.create({\n page: {\n paddingTop: theme.spacing.page.marginTop,\n paddingLeft: theme.spacing.page.marginLeft,\n paddingRight: theme.spacing.page.marginRight,\n paddingBottom: theme.spacing.page.marginBottom,\n backgroundColor: theme.colors.background,\n },\n toolbar: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n marginBottom: 8,\n },\n metricsGrid: {\n flexDirection: 'row',\n flexWrap: 'wrap',\n gap: 8,\n },\n metricCard: {\n width: '48.6%',\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n padding: 8,\n backgroundColor: theme.colors.background,\n },\n metricLabel: {\n fontSize: 8,\n textTransform: 'uppercase',\n color: theme.colors.mutedForeground,\n marginBottom: 2,\n letterSpacing: 0.5,\n },\n metricValue: {\n fontSize: 14,\n color: theme.colors.foreground,\n fontWeight: theme.primitives.fontWeights.bold,\n marginBottom: 2,\n },\n metricTrend: {\n fontSize: 9,\n color: theme.colors.mutedForeground,\n },\n graphShell: {\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n padding: 12,\n backgroundColor: theme.colors.background,\n },\n twoColumn: {\n flexDirection: 'row',\n gap: 10,\n alignItems: 'flex-start',\n },\n col: {\n flex: 1,\n },\n });\n\n return (\n <Document title={`${titlePrefix} ${data.period}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <PageHeader\n variant=\"two-column\"\n title={data.title}\n subtitle={`${titlePrefix} · ${data.subtitle}`}\n rightText={data.period}\n rightSubText={`Generated ${data.generatedAt}`}\n marginBottom={14}\n />\n\n <View style={styles.toolbar}>\n <Badge label={statusLabel} variant={statusTone} size=\"sm\" />\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Author: {data.author}\n </Text>\n </View>\n\n <Section variant=\"card\" padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Executive Summary\n </Text>\n <View style={styles.metricsGrid}>\n {data.summary.map((metric) => (\n <View\n key={metric.label}\n style={[\n styles.metricCard,\n {\n borderLeftWidth: 3,\n borderLeftColor: metric.tone ? toneColor(theme, metric.tone) : accent,\n },\n ] as never}\n >\n <Text style={styles.metricLabel} noMargin>\n {metric.label}\n </Text>\n <Text style={styles.metricValue} noMargin>\n {metric.value}\n </Text>\n {metric.trend ? (\n <Badge label={metric.trend} size=\"sm\" variant={metric.tone ?? 'info'} />\n ) : null}\n </View>\n ))}\n </View>\n </Section>\n\n <Section padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View style={styles.graphShell}>\n <PdfGraph\n variant={graphVariant}\n data={graphData ?? data.series}\n title={graphTitle}\n subtitle={graphSubtitle}\n yLabel={undefined}\n xLabel={undefined}\n showGrid={graphVariant !== 'pie' && graphVariant !== 'donut'}\n showValues={graphShowValues}\n smooth={graphVariant === 'line' || graphVariant === 'area'}\n legend={graphLegend}\n height={200}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section padding=\"md\">\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Delivery Table\n </Text>\n <DataTable\n variant=\"compact\"\n size=\"compact\"\n stripe\n columns={[\n { key: 'label', header: 'Stream' },\n { key: 'owner', header: 'Owner' },\n { key: 'status', header: 'Status', align: 'center' },\n {\n key: 'progress',\n header: 'Progress',\n align: 'right',\n render: (value) => `${String(value)}%`,\n },\n { key: 'risk', header: 'Risk', align: 'right' },\n ]}\n data={data.rows}\n footer={{\n label: 'Totals',\n owner: '-',\n status: '-',\n progress: Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n ),\n risk: '-',\n }}\n />\n </Section>\n\n <Section padding=\"md\" variant=\"card\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Highlights & Risks\n </Text>\n <View style={styles.twoColumn}>\n <View style={styles.col}>\n <PdfList\n variant=\"checklist\"\n items={data.highlights.map((item) => ({ text: item, checked: true }))}\n gap=\"sm\"\n />\n </View>\n <View style={styles.col}>\n <KeyValue\n size=\"sm\"\n divided\n items={[\n {\n key: 'Open Risks',\n value: `${data.rows.filter((r) => r.risk !== 'Low').length}`,\n },\n {\n key: 'On-Track Streams',\n value: `${data.rows.filter((r) => r.status === 'On Track').length}/${data.rows.length}`,\n },\n {\n key: 'Average Progress',\n value: `${Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n )}%`,\n },\n ]}\n />\n </View>\n </View>\n <Divider />\n <Stack gap=\"sm\">\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: keep each section under one page using `noWrap` for concise blocks.\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: pass explicit row keys/owners to avoid ambiguous reporting handoffs.\n </Text>\n </Stack>\n </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with PDFx\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </View></Page>\n </Document>\n );\n}\n\nexport function ReportTemplateFrame({\n theme,\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend,\n graphShowValues,\n graphColors,\n graphData,\n}: ReportTemplateProps & {\n titlePrefix: string;\n statusLabel: string;\n statusTone: 'success' | 'warning' | 'destructive' | 'info';\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: 'bottom' | 'right' | 'none';\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: Array<{ label: string; value: number }>;\n}) {\n if (!data) return null;\n\n return (\n <PdfcnThemeProvider theme={theme}>\n <ReportLayout\n data={data}\n titlePrefix={titlePrefix}\n statusLabel={statusLabel}\n statusTone={statusTone}\n graphVariant={graphVariant}\n graphTitle={graphTitle}\n graphSubtitle={graphSubtitle}\n graphLegend={graphLegend}\n graphShowValues={graphShowValues}\n graphColors={graphColors}\n graphData={graphData}\n />\n </PdfcnThemeProvider>\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/report-marketing/report-marketing.tsx",
+ "content": "import { ReportTemplateFrame } from './report-layout';\nimport type { ReportTemplateProps } from './report-layout';\nimport type { BaseReportData } from \"./report.types\";\n\nconst sampleMarketingData: BaseReportData = {\n author: \"Growth Team\",\n generatedAt: \"February 23, 2026\",\n highlights: [\n \"Channel mix improved CAC while maintaining lead quality.\",\n \"Lifecycle email workflow has deliverability issues under investigation.\",\n \"Referral program is producing higher-intent pipeline with lower cost.\",\n ],\n period: \"Campaign Cycle 2026-02\",\n rows: [\n {\n label: \"SEO\",\n owner: \"H. Evans\",\n status: \"On Track\",\n progress: 84,\n risk: \"Low\",\n },\n {\n label: \"Paid Search\",\n owner: \"K. Martin\",\n status: \"On Track\",\n progress: 80,\n risk: \"Low\",\n },\n {\n label: \"Lifecycle Email\",\n owner: \"V. Lee\",\n status: \"At Risk\",\n progress: 64,\n risk: \"Medium\",\n },\n {\n label: \"Partner Referrals\",\n owner: \"J. Gomez\",\n status: \"On Track\",\n progress: 75,\n risk: \"Medium\",\n },\n ],\n series: [\n { label: \"W1\", value: 55 },\n { label: \"W2\", value: 57 },\n { label: \"W3\", value: 59 },\n { label: \"W4\", value: 60 },\n { label: \"W5\", value: 62 },\n { label: \"W6\", value: 63 },\n { label: \"W7\", value: 65 },\n { label: \"W8\", value: 67 },\n { label: \"W9\", value: 66 },\n { label: \"W10\", value: 68 },\n { label: \"W11\", value: 70 },\n { label: \"W12\", value: 72 },\n ],\n subtitle: \"Pipeline, conversion efficiency, and channel performance\",\n summary: [\n { label: \"MQLs\", value: \"3,940\", trend: \"+22.1% cycle\", tone: \"success\" },\n { label: \"CAC\", value: \"$118\", trend: \"-7.4%\", tone: \"success\" },\n { label: \"Win Rate\", value: \"28.6%\", trend: \"+1.1 pts\", tone: \"info\" },\n { label: \"Churn Risk\", value: \"6.2%\", trend: \"+0.8 pts\", tone: \"warning\" },\n ],\n title: \"Growth & Marketing Report\",\n};\n\nexport function MarketingReportDocument({\n theme,\n data = sampleMarketingData,\n}: ReportTemplateProps) {\n return (\n <ReportTemplateFrame\n theme={theme}\n data={data}\n titlePrefix=\"Growth Report\"\n statusLabel=\"Growth: Strong\"\n statusTone=\"success\"\n graphVariant=\"bar\"\n graphTitle=\"Pipeline build by week\"\n graphSubtitle=\"Demand creation output trend\"\n graphLegend=\"none\"\n graphShowValues\n graphColors={[\"#0EA5E9\"]}\n />\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/report-marketing/report.types.ts",
+ "content": "export interface SummaryMetric {\n label: string;\n value: string;\n trend?: string;\n tone?: \"success\" | \"warning\" | \"destructive\" | \"info\";\n}\n\nexport type ReportRow = Record<string, unknown> & {\n label: string;\n owner: string;\n status: string;\n progress: number;\n risk?: string;\n};\n\nexport interface ReportSeriesPoint {\n label: string;\n value: number;\n}\n\nexport interface BaseReportData {\n title: string;\n subtitle: string;\n generatedAt: string;\n period: string;\n author: string;\n summary: SummaryMetric[];\n rows: ReportRow[];\n series: ReportSeriesPoint[];\n highlights: string[];\n}\n",
+ "type": "registry:block"
+ }
+ ],
+ "type": "registry:block"
+}
\ No newline at end of file
diff --git a/public/r/forme/report-operations.json b/public/r/forme/report-operations.json
new file mode 100644
index 0000000..8a063c5
--- /dev/null
+++ b/public/r/forme/report-operations.json
@@ -0,0 +1,31 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/report-operations",
+ "title": "Report Operations",
+ "description": "Report Operations PDF block (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/report-operations/report-layout.tsx",
+ "content": "import {\n Badge,\n DataTable,\n Divider,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Stack,\n Text,\n usePdfcnTheme,\n} from '../../components';\nimport type { PdfcnTheme } from '@/registry/themes';\nimport { Document, Page, StyleSheet, View } from \"@formepdf/react\";\nimport type { BaseReportData } from './report.types';\n\nexport interface ReportTemplateProps {\n theme?: PdfcnTheme;\n data?: BaseReportData;\n}\n\ntype ReportGraphVariant = 'bar' | 'horizontal-bar' | 'line' | 'area' | 'pie' | 'donut';\n\ninterface ReportLayoutProps {\n data: BaseReportData;\n titlePrefix: string;\n statusLabel: string;\n statusTone: 'success' | 'warning' | 'destructive' | 'info';\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: 'bottom' | 'right' | 'none';\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: Array<{ label: string; value: number }>;\n}\n\nfunction toneColor(theme: PdfcnTheme, tone: 'success' | 'warning' | 'destructive' | 'info') {\n if (tone === 'success') return theme.colors.success;\n if (tone === 'warning') return theme.colors.warning;\n if (tone === 'destructive') return theme.colors.destructive;\n return theme.colors.info;\n}\n\nexport function ReportLayout({\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend = 'none',\n graphShowValues = false,\n graphColors,\n graphData,\n}: ReportLayoutProps) {\n const theme = usePdfcnTheme();\n const accent = toneColor(theme, statusTone);\n\n const styles = StyleSheet.create({\n page: {\n paddingTop: theme.spacing.page.marginTop,\n paddingLeft: theme.spacing.page.marginLeft,\n paddingRight: theme.spacing.page.marginRight,\n paddingBottom: theme.spacing.page.marginBottom,\n backgroundColor: theme.colors.background,\n },\n toolbar: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n marginBottom: 8,\n },\n metricsGrid: {\n flexDirection: 'row',\n flexWrap: 'wrap',\n gap: 8,\n },\n metricCard: {\n width: '48.6%',\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n padding: 8,\n backgroundColor: theme.colors.background,\n },\n metricLabel: {\n fontSize: 8,\n textTransform: 'uppercase',\n color: theme.colors.mutedForeground,\n marginBottom: 2,\n letterSpacing: 0.5,\n },\n metricValue: {\n fontSize: 14,\n color: theme.colors.foreground,\n fontWeight: theme.primitives.fontWeights.bold,\n marginBottom: 2,\n },\n metricTrend: {\n fontSize: 9,\n color: theme.colors.mutedForeground,\n },\n graphShell: {\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n padding: 12,\n backgroundColor: theme.colors.background,\n },\n twoColumn: {\n flexDirection: 'row',\n gap: 10,\n alignItems: 'flex-start',\n },\n col: {\n flex: 1,\n },\n });\n\n return (\n <Document title={`${titlePrefix} ${data.period}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <PageHeader\n variant=\"two-column\"\n title={data.title}\n subtitle={`${titlePrefix} · ${data.subtitle}`}\n rightText={data.period}\n rightSubText={`Generated ${data.generatedAt}`}\n marginBottom={14}\n />\n\n <View style={styles.toolbar}>\n <Badge label={statusLabel} variant={statusTone} size=\"sm\" />\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Author: {data.author}\n </Text>\n </View>\n\n <Section variant=\"card\" padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Executive Summary\n </Text>\n <View style={styles.metricsGrid}>\n {data.summary.map((metric) => (\n <View\n key={metric.label}\n style={[\n styles.metricCard,\n {\n borderLeftWidth: 3,\n borderLeftColor: metric.tone ? toneColor(theme, metric.tone) : accent,\n },\n ] as never}\n >\n <Text style={styles.metricLabel} noMargin>\n {metric.label}\n </Text>\n <Text style={styles.metricValue} noMargin>\n {metric.value}\n </Text>\n {metric.trend ? (\n <Badge label={metric.trend} size=\"sm\" variant={metric.tone ?? 'info'} />\n ) : null}\n </View>\n ))}\n </View>\n </Section>\n\n <Section padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View style={styles.graphShell}>\n <PdfGraph\n variant={graphVariant}\n data={graphData ?? data.series}\n title={graphTitle}\n subtitle={graphSubtitle}\n yLabel={undefined}\n xLabel={undefined}\n showGrid={graphVariant !== 'pie' && graphVariant !== 'donut'}\n showValues={graphShowValues}\n smooth={graphVariant === 'line' || graphVariant === 'area'}\n legend={graphLegend}\n height={200}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section padding=\"md\">\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Delivery Table\n </Text>\n <DataTable\n variant=\"compact\"\n size=\"compact\"\n stripe\n columns={[\n { key: 'label', header: 'Stream' },\n { key: 'owner', header: 'Owner' },\n { key: 'status', header: 'Status', align: 'center' },\n {\n key: 'progress',\n header: 'Progress',\n align: 'right',\n render: (value) => `${String(value)}%`,\n },\n { key: 'risk', header: 'Risk', align: 'right' },\n ]}\n data={data.rows}\n footer={{\n label: 'Totals',\n owner: '-',\n status: '-',\n progress: Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n ),\n risk: '-',\n }}\n />\n </Section>\n\n <Section padding=\"md\" variant=\"card\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Highlights & Risks\n </Text>\n <View style={styles.twoColumn}>\n <View style={styles.col}>\n <PdfList\n variant=\"checklist\"\n items={data.highlights.map((item) => ({ text: item, checked: true }))}\n gap=\"sm\"\n />\n </View>\n <View style={styles.col}>\n <KeyValue\n size=\"sm\"\n divided\n items={[\n {\n key: 'Open Risks',\n value: `${data.rows.filter((r) => r.risk !== 'Low').length}`,\n },\n {\n key: 'On-Track Streams',\n value: `${data.rows.filter((r) => r.status === 'On Track').length}/${data.rows.length}`,\n },\n {\n key: 'Average Progress',\n value: `${Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n )}%`,\n },\n ]}\n />\n </View>\n </View>\n <Divider />\n <Stack gap=\"sm\">\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: keep each section under one page using `noWrap` for concise blocks.\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: pass explicit row keys/owners to avoid ambiguous reporting handoffs.\n </Text>\n </Stack>\n </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with PDFx\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </View></Page>\n </Document>\n );\n}\n\nexport function ReportTemplateFrame({\n theme,\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend,\n graphShowValues,\n graphColors,\n graphData,\n}: ReportTemplateProps & {\n titlePrefix: string;\n statusLabel: string;\n statusTone: 'success' | 'warning' | 'destructive' | 'info';\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: 'bottom' | 'right' | 'none';\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: Array<{ label: string; value: number }>;\n}) {\n if (!data) return null;\n\n return (\n <PdfcnThemeProvider theme={theme}>\n <ReportLayout\n data={data}\n titlePrefix={titlePrefix}\n statusLabel={statusLabel}\n statusTone={statusTone}\n graphVariant={graphVariant}\n graphTitle={graphTitle}\n graphSubtitle={graphSubtitle}\n graphLegend={graphLegend}\n graphShowValues={graphShowValues}\n graphColors={graphColors}\n graphData={graphData}\n />\n </PdfcnThemeProvider>\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/report-operations/report-operations.tsx",
+ "content": "import { ReportTemplateFrame } from './report-layout';\nimport type { ReportTemplateProps } from './report-layout';\nimport type { BaseReportData } from \"./report.types\";\n\nconst sampleOperationsData: BaseReportData = {\n author: \"Delivery Office\",\n generatedAt: \"February 23, 2026\",\n highlights: [\n \"SLA improved after shift rebalancing and incident triage changes.\",\n \"Backlog grew in week 4 due to release-related ticket surge.\",\n \"Incident queue remediation plan has executive sponsorship and budget.\",\n ],\n period: \"February 2026\",\n rows: [\n {\n label: \"L1 Support\",\n owner: \"N. Mehta\",\n status: \"On Track\",\n progress: 91,\n risk: \"Low\",\n },\n {\n label: \"L2 Support\",\n owner: \"D. Chen\",\n status: \"On Track\",\n progress: 85,\n risk: \"Low\",\n },\n {\n label: \"Incident Queue\",\n owner: \"R. Walker\",\n status: \"At Risk\",\n progress: 66,\n risk: \"High\",\n },\n {\n label: \"Automation Rollout\",\n owner: \"M. Roy\",\n status: \"On Track\",\n progress: 77,\n risk: \"Medium\",\n },\n ],\n series: [\n { label: \"W1\", value: 69 },\n { label: \"W2\", value: 71 },\n { label: \"W3\", value: 73 },\n { label: \"W4\", value: 74 },\n { label: \"W5\", value: 75 },\n { label: \"W6\", value: 76 },\n { label: \"W7\", value: 78 },\n { label: \"W8\", value: 79 },\n { label: \"W9\", value: 78 },\n { label: \"W10\", value: 80 },\n { label: \"W11\", value: 81 },\n { label: \"W12\", value: 83 },\n ],\n subtitle: \"Delivery throughput, SLA adherence, and backlog visibility\",\n summary: [\n {\n label: \"Tickets Closed\",\n value: \"1,284\",\n trend: \"+9.8% MoM\",\n tone: \"success\",\n },\n {\n label: \"SLA Hit Rate\",\n value: \"96.1%\",\n trend: \"+1.4 pts\",\n tone: \"success\",\n },\n { label: \"Backlog\", value: \"214\", trend: \"+6.0%\", tone: \"warning\" },\n { label: \"Escalations\", value: \"17\", trend: \"-18.5%\", tone: \"success\" },\n ],\n title: \"Monthly Operations Report\",\n};\n\nexport function OperationsReportDocument({\n theme,\n data = sampleOperationsData,\n}: ReportTemplateProps) {\n return (\n <ReportTemplateFrame\n theme={theme}\n data={data}\n titlePrefix=\"Operations Report\"\n statusLabel=\"Ops: Watch\"\n statusTone=\"warning\"\n graphVariant=\"horizontal-bar\"\n graphTitle=\"Throughput by week\"\n graphSubtitle=\"Resolved workload distribution\"\n graphLegend=\"none\"\n graphShowValues\n graphColors={[\"#2563EB\"]}\n graphData={[\n { label: \"Incident\", value: 66 },\n { label: \"Automation\", value: 77 },\n { label: \"L2 Support\", value: 85 },\n { label: \"L1 Support\", value: 91 },\n ]}\n />\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/report-operations/report.types.ts",
+ "content": "export interface SummaryMetric {\n label: string;\n value: string;\n trend?: string;\n tone?: \"success\" | \"warning\" | \"destructive\" | \"info\";\n}\n\nexport type ReportRow = Record<string, unknown> & {\n label: string;\n owner: string;\n status: string;\n progress: number;\n risk?: string;\n};\n\nexport interface ReportSeriesPoint {\n label: string;\n value: number;\n}\n\nexport interface BaseReportData {\n title: string;\n subtitle: string;\n generatedAt: string;\n period: string;\n author: string;\n summary: SummaryMetric[];\n rows: ReportRow[];\n series: ReportSeriesPoint[];\n highlights: string[];\n}\n",
+ "type": "registry:block"
+ }
+ ],
+ "type": "registry:block"
+}
\ No newline at end of file
diff --git a/public/r/forme/report-security.json b/public/r/forme/report-security.json
new file mode 100644
index 0000000..f029243
--- /dev/null
+++ b/public/r/forme/report-security.json
@@ -0,0 +1,31 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/report-security",
+ "title": "Report Security",
+ "description": "Report Security PDF block (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/report-security/report-layout.tsx",
+ "content": "import {\n Badge,\n DataTable,\n Divider,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Stack,\n Text,\n usePdfcnTheme,\n} from '../../components';\nimport type { PdfcnTheme } from '@/registry/themes';\nimport { Document, Page, StyleSheet, View } from \"@formepdf/react\";\nimport type { BaseReportData } from './report.types';\n\nexport interface ReportTemplateProps {\n theme?: PdfcnTheme;\n data?: BaseReportData;\n}\n\ntype ReportGraphVariant = 'bar' | 'horizontal-bar' | 'line' | 'area' | 'pie' | 'donut';\n\ninterface ReportLayoutProps {\n data: BaseReportData;\n titlePrefix: string;\n statusLabel: string;\n statusTone: 'success' | 'warning' | 'destructive' | 'info';\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: 'bottom' | 'right' | 'none';\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: Array<{ label: string; value: number }>;\n}\n\nfunction toneColor(theme: PdfcnTheme, tone: 'success' | 'warning' | 'destructive' | 'info') {\n if (tone === 'success') return theme.colors.success;\n if (tone === 'warning') return theme.colors.warning;\n if (tone === 'destructive') return theme.colors.destructive;\n return theme.colors.info;\n}\n\nexport function ReportLayout({\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend = 'none',\n graphShowValues = false,\n graphColors,\n graphData,\n}: ReportLayoutProps) {\n const theme = usePdfcnTheme();\n const accent = toneColor(theme, statusTone);\n\n const styles = StyleSheet.create({\n page: {\n paddingTop: theme.spacing.page.marginTop,\n paddingLeft: theme.spacing.page.marginLeft,\n paddingRight: theme.spacing.page.marginRight,\n paddingBottom: theme.spacing.page.marginBottom,\n backgroundColor: theme.colors.background,\n },\n toolbar: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n marginBottom: 8,\n },\n metricsGrid: {\n flexDirection: 'row',\n flexWrap: 'wrap',\n gap: 8,\n },\n metricCard: {\n width: '48.6%',\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n padding: 8,\n backgroundColor: theme.colors.background,\n },\n metricLabel: {\n fontSize: 8,\n textTransform: 'uppercase',\n color: theme.colors.mutedForeground,\n marginBottom: 2,\n letterSpacing: 0.5,\n },\n metricValue: {\n fontSize: 14,\n color: theme.colors.foreground,\n fontWeight: theme.primitives.fontWeights.bold,\n marginBottom: 2,\n },\n metricTrend: {\n fontSize: 9,\n color: theme.colors.mutedForeground,\n },\n graphShell: {\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n padding: 12,\n backgroundColor: theme.colors.background,\n },\n twoColumn: {\n flexDirection: 'row',\n gap: 10,\n alignItems: 'flex-start',\n },\n col: {\n flex: 1,\n },\n });\n\n return (\n <Document title={`${titlePrefix} ${data.period}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <PageHeader\n variant=\"two-column\"\n title={data.title}\n subtitle={`${titlePrefix} · ${data.subtitle}`}\n rightText={data.period}\n rightSubText={`Generated ${data.generatedAt}`}\n marginBottom={14}\n />\n\n <View style={styles.toolbar}>\n <Badge label={statusLabel} variant={statusTone} size=\"sm\" />\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Author: {data.author}\n </Text>\n </View>\n\n <Section variant=\"card\" padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Executive Summary\n </Text>\n <View style={styles.metricsGrid}>\n {data.summary.map((metric) => (\n <View\n key={metric.label}\n style={[\n styles.metricCard,\n {\n borderLeftWidth: 3,\n borderLeftColor: metric.tone ? toneColor(theme, metric.tone) : accent,\n },\n ] as never}\n >\n <Text style={styles.metricLabel} noMargin>\n {metric.label}\n </Text>\n <Text style={styles.metricValue} noMargin>\n {metric.value}\n </Text>\n {metric.trend ? (\n <Badge label={metric.trend} size=\"sm\" variant={metric.tone ?? 'info'} />\n ) : null}\n </View>\n ))}\n </View>\n </Section>\n\n <Section padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View style={styles.graphShell}>\n <PdfGraph\n variant={graphVariant}\n data={graphData ?? data.series}\n title={graphTitle}\n subtitle={graphSubtitle}\n yLabel={undefined}\n xLabel={undefined}\n showGrid={graphVariant !== 'pie' && graphVariant !== 'donut'}\n showValues={graphShowValues}\n smooth={graphVariant === 'line' || graphVariant === 'area'}\n legend={graphLegend}\n height={200}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section padding=\"md\">\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Delivery Table\n </Text>\n <DataTable\n variant=\"compact\"\n size=\"compact\"\n stripe\n columns={[\n { key: 'label', header: 'Stream' },\n { key: 'owner', header: 'Owner' },\n { key: 'status', header: 'Status', align: 'center' },\n {\n key: 'progress',\n header: 'Progress',\n align: 'right',\n render: (value) => `${String(value)}%`,\n },\n { key: 'risk', header: 'Risk', align: 'right' },\n ]}\n data={data.rows}\n footer={{\n label: 'Totals',\n owner: '-',\n status: '-',\n progress: Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n ),\n risk: '-',\n }}\n />\n </Section>\n\n <Section padding=\"md\" variant=\"card\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Highlights & Risks\n </Text>\n <View style={styles.twoColumn}>\n <View style={styles.col}>\n <PdfList\n variant=\"checklist\"\n items={data.highlights.map((item) => ({ text: item, checked: true }))}\n gap=\"sm\"\n />\n </View>\n <View style={styles.col}>\n <KeyValue\n size=\"sm\"\n divided\n items={[\n {\n key: 'Open Risks',\n value: `${data.rows.filter((r) => r.risk !== 'Low').length}`,\n },\n {\n key: 'On-Track Streams',\n value: `${data.rows.filter((r) => r.status === 'On Track').length}/${data.rows.length}`,\n },\n {\n key: 'Average Progress',\n value: `${Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n )}%`,\n },\n ]}\n />\n </View>\n </View>\n <Divider />\n <Stack gap=\"sm\">\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: keep each section under one page using `noWrap` for concise blocks.\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: pass explicit row keys/owners to avoid ambiguous reporting handoffs.\n </Text>\n </Stack>\n </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with PDFx\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </View></Page>\n </Document>\n );\n}\n\nexport function ReportTemplateFrame({\n theme,\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend,\n graphShowValues,\n graphColors,\n graphData,\n}: ReportTemplateProps & {\n titlePrefix: string;\n statusLabel: string;\n statusTone: 'success' | 'warning' | 'destructive' | 'info';\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: 'bottom' | 'right' | 'none';\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: Array<{ label: string; value: number }>;\n}) {\n if (!data) return null;\n\n return (\n <PdfcnThemeProvider theme={theme}>\n <ReportLayout\n data={data}\n titlePrefix={titlePrefix}\n statusLabel={statusLabel}\n statusTone={statusTone}\n graphVariant={graphVariant}\n graphTitle={graphTitle}\n graphSubtitle={graphSubtitle}\n graphLegend={graphLegend}\n graphShowValues={graphShowValues}\n graphColors={graphColors}\n graphData={graphData}\n />\n </PdfcnThemeProvider>\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/report-security/report-security.tsx",
+ "content": "import { ReportTemplateFrame } from './report-layout';\nimport type { ReportTemplateProps } from './report-layout';\nimport type { BaseReportData } from \"./report.types\";\n\nconst sampleSecurityData: BaseReportData = {\n author: \"Security Engineering\",\n generatedAt: \"February 23, 2026\",\n highlights: [\n \"Critical vulnerabilities reduced through mandatory patch windows.\",\n \"Secrets rotation remains the highest-risk stream and needs additional staffing.\",\n \"External penetration test scheduled for next sprint to validate fixes.\",\n ],\n period: \"Sprint 05, 2026\",\n rows: [\n {\n label: \"Identity Hardening\",\n owner: \"E. Brown\",\n status: \"On Track\",\n progress: 87,\n risk: \"Low\",\n },\n {\n label: \"Secrets Rotation\",\n owner: \"P. Nair\",\n status: \"At Risk\",\n progress: 58,\n risk: \"High\",\n },\n {\n label: \"Dependency Scanning\",\n owner: \"I. Shah\",\n status: \"On Track\",\n progress: 81,\n risk: \"Medium\",\n },\n {\n label: \"WAF Policy\",\n owner: \"S. Reed\",\n status: \"On Track\",\n progress: 76,\n risk: \"Low\",\n },\n ],\n series: [\n { label: \"W1\", value: 61 },\n { label: \"W2\", value: 63 },\n { label: \"W3\", value: 64 },\n { label: \"W4\", value: 66 },\n { label: \"W5\", value: 67 },\n { label: \"W6\", value: 68 },\n { label: \"W7\", value: 69 },\n { label: \"W8\", value: 71 },\n { label: \"W9\", value: 72 },\n { label: \"W10\", value: 74 },\n { label: \"W11\", value: 76 },\n { label: \"W12\", value: 78 },\n ],\n subtitle: \"Vulnerability trends, control maturity, and remediation health\",\n summary: [\n {\n label: \"Critical Vulns\",\n value: \"2\",\n trend: \"-3 from last sprint\",\n tone: \"success\",\n },\n { label: \"Patch SLA\", value: \"92.0%\", trend: \"+5.3 pts\", tone: \"success\" },\n { label: \"Open Findings\", value: \"41\", trend: \"+4\", tone: \"warning\" },\n { label: \"Control Score\", value: \"84/100\", trend: \"+2 pts\", tone: \"info\" },\n ],\n title: \"Security Posture Report\",\n};\n\nexport function SecurityReportDocument({\n theme,\n data = sampleSecurityData,\n}: ReportTemplateProps) {\n return (\n <ReportTemplateFrame\n theme={theme}\n data={data}\n titlePrefix=\"Security Report\"\n statusLabel=\"Security: Action Needed\"\n statusTone=\"destructive\"\n graphVariant=\"donut\"\n graphTitle=\"Open risk distribution\"\n graphSubtitle=\"High/Medium/Low workload share\"\n graphLegend=\"right\"\n graphShowValues\n graphColors={[\"#DC2626\", \"#F59E0B\", \"#16A34A\", \"#0EA5E9\"]}\n graphData={[\n { label: \"High Risk\", value: 14 },\n { label: \"Medium Risk\", value: 17 },\n { label: \"Low Risk\", value: 8 },\n { label: \"Info\", value: 4 },\n ]}\n />\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/report-security/report.types.ts",
+ "content": "export interface SummaryMetric {\n label: string;\n value: string;\n trend?: string;\n tone?: \"success\" | \"warning\" | \"destructive\" | \"info\";\n}\n\nexport type ReportRow = Record<string, unknown> & {\n label: string;\n owner: string;\n status: string;\n progress: number;\n risk?: string;\n};\n\nexport interface ReportSeriesPoint {\n label: string;\n value: number;\n}\n\nexport interface BaseReportData {\n title: string;\n subtitle: string;\n generatedAt: string;\n period: string;\n author: string;\n summary: SummaryMetric[];\n rows: ReportRow[];\n series: ReportSeriesPoint[];\n highlights: string[];\n}\n",
+ "type": "registry:block"
+ }
+ ],
+ "type": "registry:block"
+}
\ No newline at end of file
diff --git a/public/r/forme/section.json b/public/r/forme/section.json
new file mode 100644
index 0000000..a5f5c41
--- /dev/null
+++ b/public/r/forme/section.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/section",
+ "title": "Section",
+ "description": "Section PDF component (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/components/section/section.tsx",
+ "content": "import { StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type SectionSpacing = \"none\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\nexport type SectionPadding = \"none\" | \"sm\" | \"md\" | \"lg\";\nexport type SectionVariant = \"default\" | \"callout\" | \"highlight\" | \"card\";\n\n/**\n * Layout container with spacing, padding, and visual style variants.\n * Props - `spacing` | `padding` | `background` | `border` | `variant` | `accentColor` | `noWrap` | `children` | `style`\n * @see {@link SectionProps}\n */\nexport interface SectionProps extends PDFComponentProps {\n /**\n * @default 'md'\n */\n spacing?: SectionSpacing;\n padding?: SectionPadding;\n background?: string;\n /**\n * @default false\n */\n border?: boolean;\n /**\n * @default 'default'\n */\n variant?: SectionVariant;\n accentColor?: string;\n /**\n * @default false\n */\n noWrap?: boolean;\n}\n\nfunction createSectionStyles(t: PdfcnTheme) {\n const { spacing, borderRadius } = t.primitives;\n return StyleSheet.create({\n base: { flexDirection: \"column\" },\n border: {\n borderColor: t.colors.border,\n borderRadius: borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: spacing[0.5],\n },\n callout: {\n borderLeftColor: t.colors.primary,\n borderLeftStyle: \"solid\",\n borderLeftWidth: spacing[1],\n paddingLeft: spacing[4],\n paddingVertical: spacing[2],\n },\n card: {\n borderColor: t.colors.border,\n borderRadius: borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: spacing[0.5],\n padding: spacing[4],\n },\n highlight: {\n backgroundColor: t.colors.muted,\n borderLeftColor: t.colors.primary,\n borderLeftStyle: \"solid\",\n borderLeftWidth: spacing[1],\n padding: spacing[4],\n },\n paddingLg: { padding: spacing[6] },\n paddingMd: { padding: spacing[4] },\n paddingNone: { padding: spacing[0] },\n paddingSm: { padding: spacing[3] },\n spacingLg: { marginVertical: spacing[8] },\n spacingMd: { marginVertical: t.spacing.sectionGap },\n spacingNone: { marginVertical: spacing[0] },\n spacingSm: { marginVertical: spacing[4] },\n spacingXl: { marginVertical: spacing[12] },\n });\n}\n\nexport function Section({\n spacing = \"md\",\n padding,\n background,\n border,\n variant = \"default\",\n accentColor,\n noWrap = false,\n children,\n style,\n}: SectionProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createSectionStyles(theme), [theme]);\n const spacingMap = {\n lg: styles.spacingLg,\n md: styles.spacingMd,\n none: styles.spacingNone,\n sm: styles.spacingSm,\n xl: styles.spacingXl,\n };\n const paddingMap = {\n lg: styles.paddingLg,\n md: styles.paddingMd,\n none: styles.paddingNone,\n sm: styles.paddingSm,\n };\n const variantMap: Record<SectionVariant, Style | null> = {\n callout: styles.callout,\n card: styles.card,\n default: null,\n highlight: styles.highlight,\n };\n const styleArray: Style[] = [styles.base, spacingMap[spacing]];\n const variantStyle = variantMap[variant];\n if (variantStyle) {styleArray.push(variantStyle);}\n if (accentColor && (variant === \"callout\" || variant === \"highlight\")) {\n styleArray.push({\n borderLeftColor: resolveColor(accentColor, theme.colors),\n });\n }\n if (padding && padding in paddingMap) {styleArray.push(paddingMap[padding]);}\n if (border && variant === \"default\") {styleArray.push(styles.border);}\n if (background)\n {styleArray.push({\n backgroundColor: resolveColor(background, theme.colors),\n });}\n if (style) {styleArray.push(...[style].flat());}\n return (\n <View wrap={noWrap ? false : undefined} style={styleArray as never}>\n {children}\n </View>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/section/index.ts",
+ "content": "export {\n Section,\n type SectionProps,\n type SectionSpacing,\n type SectionPadding,\n type SectionVariant,\n} from \"./section\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/forme/signature.json b/public/r/forme/signature.json
new file mode 100644
index 0000000..0e20a93
--- /dev/null
+++ b/public/r/forme/signature.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/signature",
+ "title": "Signature",
+ "description": "Signature PDF component (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/components/signature/signature.tsx",
+ "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\n\nexport type SignatureVariant = \"single\" | \"double\" | \"inline\";\n\n/**\n * Signature signer properties.\n * Props - `label` | `name` | `title` | `date`\n * @see {@link SignatureSigner}\n */\nexport interface SignatureSigner {\n label?: string;\n name?: string;\n title?: string;\n date?: string;\n}\n\n/**\n * Signature block properties.\n * Props - `variant` | `label` | `name` | `title` | `date` | `signers` | `style`\n * @see {@link PdfSignatureBlockProps}\n */\nexport interface PdfSignatureBlockProps {\n /**\n * Layout variant: [single, double, inline]\n * @default 'single'\n */\n variant?: SignatureVariant;\n label?: string;\n name?: string;\n title?: string;\n date?: string;\n signers?: [SignatureSigner, SignatureSigner];\n style?: Style;\n}\n\nfunction createSignatureStyles(t: PdfcnTheme) {\n const { spacing, fontWeights, typography } = t.primitives;\n return StyleSheet.create({\n block: { flex: 1, minWidth: 140 },\n container: {\n marginBottom: t.spacing.componentGap,\n marginTop: t.spacing.sectionGap,\n },\n dateText: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n marginTop: 1,\n },\n doubleRow: {\n flexDirection: \"row\",\n gap: spacing[8],\n justifyContent: \"space-between\",\n },\n inlineLabel: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n },\n inlineLine: {\n borderBottomColor: t.colors.foreground,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n height: spacing[5],\n minWidth: 120,\n paddingHorizontal: spacing[2],\n },\n inlineName: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n },\n inlineRow: {\n alignItems: \"center\",\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: spacing[3],\n },\n label: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n marginBottom: spacing[1],\n },\n line: {\n borderBottomColor: t.colors.foreground,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n marginBottom: spacing[1],\n minHeight: spacing[6],\n },\n name: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n },\n titleText: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n },\n });\n}\n\nfunction renderSignerBlock(\n signer: SignatureSigner,\n styles: ReturnType<typeof createSignatureStyles>\n) {\n return (\n <View style={styles.block}>\n {signer.label ? (\n <PDFText style={styles.label}>{signer.label}</PDFText>\n ) : null}\n <View style={styles.line} />\n {signer.name ? (\n <PDFText style={styles.name}>{signer.name}</PDFText>\n ) : null}\n {signer.title ? (\n <PDFText style={styles.titleText}>{signer.title}</PDFText>\n ) : null}\n {signer.date ? (\n <PDFText style={styles.dateText}>{signer.date}</PDFText>\n ) : null}\n </View>\n );\n}\n\nexport function PdfSignatureBlock({\n variant = \"single\",\n label = \"Signature\",\n name,\n title,\n date,\n signers,\n style,\n}: PdfSignatureBlockProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createSignatureStyles(theme), [theme]);\n const containerStyles: Style[] = [styles.container];\n if (style) {containerStyles.push(style);}\n\n if (variant === \"inline\") {\n return (\n <View wrap={false} style={containerStyles as never}>\n <View style={styles.inlineRow}>\n <PDFText style={styles.inlineLabel}>{`${label}:`}</PDFText>\n <View style={styles.inlineLine} />\n {name ? <PDFText style={styles.inlineName}>{name}</PDFText> : null}\n </View>\n </View>\n );\n }\n\n if (variant === \"double\") {\n const [first, second] = signers ?? [\n { date: \"\", label: \"Authorized by\", name: \"\", title: \"\" },\n { date: \"\", label: \"Approved by\", name: \"\", title: \"\" },\n ];\n return (\n <View wrap={false} style={containerStyles as never}>\n <View style={styles.doubleRow}>\n {renderSignerBlock(first, styles)}\n {renderSignerBlock(second, styles)}\n </View>\n </View>\n );\n }\n\n return (\n <View wrap={false} style={containerStyles as never}>\n {renderSignerBlock({ date, label, name, title }, styles)}\n </View>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/signature/index.ts",
+ "content": "export {\n PdfSignatureBlock,\n type PdfSignatureBlockProps,\n type SignatureVariant,\n type SignatureSigner,\n} from \"./signature\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/forme/stack.json b/public/r/forme/stack.json
new file mode 100644
index 0000000..9fe322f
--- /dev/null
+++ b/public/r/forme/stack.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/stack",
+ "title": "Stack",
+ "description": "Stack PDF component (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/components/stack/stack.tsx",
+ "content": "import { StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\n\nexport type StackGap = \"none\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\nexport type StackDirection = \"vertical\" | \"horizontal\";\nexport type StackAlign = \"start\" | \"center\" | \"end\" | \"stretch\";\nexport type StackJustify = \"start\" | \"center\" | \"end\" | \"between\" | \"around\";\n\n/**\n * Flex layout container with gap and direction control.\n * Props - `gap` | `direction` | `align` | `justify` | `wrap` | `noWrap` | `children` | `style`\n * @see {@link StackProps}\n */\nexport interface StackProps extends PDFComponentProps {\n /**\n * @default 'md'\n */\n gap?: StackGap;\n /**\n * @default 'vertical'\n */\n direction?: StackDirection;\n /**\n * @default 'start'\n */\n align?: StackAlign;\n /**\n * @default 'start'\n */\n justify?: StackJustify;\n /**\n * @default false\n */\n wrap?: boolean;\n /**\n * @default false\n */\n noWrap?: boolean;\n}\n\nfunction createStackStyles(t: PdfcnTheme) {\n const { spacing } = t.primitives;\n return StyleSheet.create({\n alignCenter: { alignItems: \"center\" },\n alignEnd: { alignItems: \"flex-end\" },\n alignStart: { alignItems: \"flex-start\" },\n alignStretch: { alignItems: \"stretch\" },\n gapLg: { gap: spacing[6] },\n gapMd: { gap: spacing[4] },\n gapNone: { gap: spacing[0] },\n gapSm: { gap: spacing[2] },\n gapXl: { gap: spacing[8] },\n horizontal: { flexDirection: \"row\" },\n justifyAround: { justifyContent: \"space-around\" },\n justifyBetween: { justifyContent: \"space-between\" },\n justifyCenter: { justifyContent: \"center\" },\n justifyEnd: { justifyContent: \"flex-end\" },\n justifyStart: { justifyContent: \"flex-start\" },\n vertical: { flexDirection: \"column\" },\n wrap: { flexWrap: \"wrap\" },\n });\n}\n\nexport function Stack({\n gap = \"md\",\n direction = \"vertical\",\n align,\n justify,\n wrap,\n noWrap,\n children,\n style,\n}: StackProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createStackStyles(theme), [theme]);\n const gapMap = {\n lg: styles.gapLg,\n md: styles.gapMd,\n none: styles.gapNone,\n sm: styles.gapSm,\n xl: styles.gapXl,\n };\n const alignMap = {\n center: styles.alignCenter,\n end: styles.alignEnd,\n start: styles.alignStart,\n stretch: styles.alignStretch,\n };\n const justifyMap = {\n around: styles.justifyAround,\n between: styles.justifyBetween,\n center: styles.justifyCenter,\n end: styles.justifyEnd,\n start: styles.justifyStart,\n };\n const styleArray: Style[] = [\n direction === \"horizontal\" ? styles.horizontal : styles.vertical,\n gapMap[gap],\n ];\n if (align && align in alignMap) {styleArray.push(alignMap[align]);}\n if (justify && justify in justifyMap) {styleArray.push(justifyMap[justify]);}\n if (wrap) {styleArray.push(styles.wrap);}\n if (style) {styleArray.push(...[style].flat());}\n return (\n <View wrap={noWrap ? false : undefined} style={styleArray as never}>\n {children}\n </View>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/stack/index.ts",
+ "content": "export {\n Stack,\n type StackProps,\n type StackGap,\n type StackDirection,\n type StackAlign,\n type StackJustify,\n} from \"./stack\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/forme/table.json b/public/r/forme/table.json
new file mode 100644
index 0000000..a9bc412
--- /dev/null
+++ b/public/r/forme/table.json
@@ -0,0 +1,36 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/table",
+ "title": "Table",
+ "description": "Table PDF component (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/components/table/table.styles.ts",
+ "content": "import { StyleSheet } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\n/**\n * Creates all table styles derived from the active theme.\n * @param t - The resolved PdfcnTheme instance.\n */\nexport function createTableStyles(t: PdfcnTheme) {\n const { spacing, borderRadius, fontWeights, typography } = t.primitives;\n const borderColor = t.colors.border;\n\n const hairline = 0.5;\n const rule = 1;\n const thick = 1.5;\n\n const cellPadV = spacing[2] - 2;\n const cellPadH = spacing[2] + 2;\n const cellPadVCompact = spacing[0.5];\n const cellPadHCompact = spacing[2];\n\n const rowDivider = {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\" as const,\n borderBottomWidth: hairline,\n };\n\n return StyleSheet.create({\n cell: {\n flex: 1,\n justifyContent: \"center\",\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellBordered: {\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellBorderedBorder: {\n borderRightColor: borderColor,\n borderRightStyle: \"solid\",\n borderRightWidth: hairline,\n },\n\n cellCompact: {\n paddingHorizontal: cellPadHCompact,\n paddingVertical: cellPadVCompact,\n },\n\n cellFixed: {\n flexGrow: 0,\n flexShrink: 0,\n justifyContent: \"center\",\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellGridBorder: {\n borderRightColor: borderColor,\n borderRightStyle: \"solid\",\n borderRightWidth: hairline,\n },\n\n cellMinimal: {\n paddingHorizontal: spacing[2] - 2,\n paddingVertical: spacing[1] + 1,\n },\n\n cellPrimaryHeader: {\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellStriped: {\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellText: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n lineHeight: 1.2,\n },\n cellTextCompact: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n lineHeight: 1.2,\n },\n cellTextFooter: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: 1.2,\n },\n cellTextHeaderBordered: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.bold,\n lineHeight: 1.2,\n },\n cellTextHeaderCompact: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.semibold,\n letterSpacing: 0.6,\n lineHeight: 1.2,\n textTransform: \"uppercase\",\n },\n cellTextHeaderGrid: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: 1.2,\n },\n cellTextHeaderLine: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: 1.2,\n },\n\n cellTextHeaderMinimal: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.medium,\n lineHeight: 1.2,\n },\n cellTextHeaderPrimaryHeader: {\n color: t.colors.primaryForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.semibold,\n letterSpacing: 0.6,\n lineHeight: 1.2,\n textTransform: \"uppercase\",\n },\n cellTextHeaderStriped: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: 1.2,\n },\n row: {\n display: \"flex\",\n flexDirection: \"row\",\n },\n rowBordered: rowDivider,\n rowCompact: rowDivider,\n rowFooter: {\n borderTopColor: borderColor,\n borderTopStyle: \"solid\",\n borderTopWidth: rule,\n },\n\n rowFooterStriped: {\n backgroundColor: t.colors.muted,\n borderTopColor: borderColor,\n borderTopStyle: \"solid\",\n borderTopWidth: rule,\n },\n rowGrid: rowDivider,\n\n rowHeaderBordered: {\n backgroundColor: t.colors.muted,\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n },\n\n rowHeaderCompact: {\n backgroundColor: t.colors.muted,\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n rowHeaderGrid: {\n backgroundColor: t.colors.muted,\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n\n rowHeaderLine: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n rowHeaderMinimal: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n rowHeaderPrimaryHeader: {\n backgroundColor: t.colors.primary,\n },\n rowHeaderStriped: {\n backgroundColor: t.colors.muted,\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n rowLine: rowDivider,\n\n rowMinimal: rowDivider,\n rowPrimaryHeader: rowDivider,\n\n rowStripe: {\n backgroundColor: t.colors.muted,\n },\n\n rowStriped: {},\n table: {\n display: \"flex\",\n flexDirection: \"column\",\n marginBottom: t.spacing.componentGap,\n width: \"100%\",\n },\n tableBordered: {\n borderBottomLeftRadius: borderRadius.sm,\n borderBottomRightRadius: borderRadius.sm,\n borderColor: borderColor,\n borderStyle: \"solid\",\n borderTopLeftRadius: borderRadius.sm,\n borderTopRightRadius: borderRadius.sm,\n borderWidth: rule,\n overflow: \"hidden\" as const,\n },\n tableCompact: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n },\n tableGrid: {\n borderBottomLeftRadius: borderRadius.md,\n borderBottomRightRadius: borderRadius.md,\n borderColor: borderColor,\n borderStyle: \"solid\",\n borderTopLeftRadius: borderRadius.md,\n borderTopRightRadius: borderRadius.md,\n borderWidth: thick,\n overflow: \"hidden\" as const,\n },\n tableLine: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n },\n tableMinimal: {\n paddingVertical: spacing[2],\n },\n\n tablePrimaryHeader: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n },\n\n tableStriped: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n borderTopColor: borderColor,\n borderTopStyle: \"solid\",\n borderTopWidth: hairline,\n },\n });\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/table/table.tsx",
+ "content": "import { Text as PDFText, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport { Children, cloneElement, isValidElement } from 'react';\nimport type { ReactElement, ReactNode } from 'react';\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { createTableStyles } from \"./table.styles\";\nimport type {\n TableCellProps,\n TableProps,\n TableRowProps,\n TableSectionProps,\n TableVariant,\n} from \"./table.types\";\n\nfunction processTableChildren(\n children: ReactNode,\n variant: TableVariant,\n zebraStripe: boolean\n): ReactNode {\n let bodyRowIndex = 0;\n\n return Children.map(children, (child) => {\n if (!isValidElement(child)) {return child;}\n\n if (\n child.type === TableHeader ||\n child.type === TableBody ||\n child.type === TableFooter\n ) {\n const isBody = child.type === TableBody;\n const sectionChild = child as ReactElement<TableSectionProps>;\n const sectionChildren = Children.map(\n sectionChild.props.children,\n (rowChild) => {\n if (isValidElement(rowChild) && rowChild.type === TableRow) {\n const rowProps: Partial<TableRowProps> = { variant };\n\n if (isBody && zebraStripe) {\n const isStripe = bodyRowIndex % 2 === 1;\n bodyRowIndex++;\n if (isStripe) {\n rowProps.stripe = true;\n }\n }\n\n return cloneElement(\n rowChild as ReactElement<TableRowProps>,\n rowProps\n );\n }\n return rowChild;\n }\n );\n\n return cloneElement(child, {}, sectionChildren);\n }\n\n if (child.type === TableRow) {\n return cloneElement(child as ReactElement<TableRowProps>, { variant });\n }\n\n return child;\n });\n}\n\nexport function TableHeader({ children, style }: TableSectionProps) {\n return <View style={style}>{children}</View>;\n}\n\nexport function TableBody({ children, style }: TableSectionProps) {\n return <View style={style}>{children}</View>;\n}\n\nexport function TableFooter({ children, style }: TableSectionProps) {\n return <View style={style}>{children}</View>;\n}\n\nexport function Table({\n children,\n style,\n variant = \"line\",\n zebraStripe = false,\n noWrap = false,\n}: TableProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createTableStyles(theme), [theme]);\n const tableStyles: Style[] = [styles.table];\n const effectiveZebra = variant === \"striped\" ? true : zebraStripe;\n\n tableStyles.push(\n {\n bordered: styles.tableBordered,\n compact: styles.tableCompact,\n grid: styles.tableGrid,\n line: styles.tableLine,\n minimal: styles.tableMinimal,\n \"primary-header\": styles.tablePrimaryHeader,\n striped: styles.tableStriped,\n }[variant]\n );\n\n const styleArray = style ? [...tableStyles, style] : tableStyles;\n const processedChildren = processTableChildren(\n children,\n variant,\n effectiveZebra\n );\n\n const inner = <View style={styleArray as never}>{processedChildren}</View>;\n return noWrap ? <View wrap={false}>{inner}</View> : inner;\n}\n\nexport function TableRow({\n header,\n footer,\n stripe,\n children,\n style,\n variant = \"line\",\n}: TableRowProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createTableStyles(theme), [theme]);\n const rowStyles: Style[] = [styles.row];\n\n rowStyles.push(\n {\n bordered: styles.rowBordered,\n compact: styles.rowCompact,\n grid: styles.rowGrid,\n line: styles.rowLine,\n minimal: styles.rowMinimal,\n \"primary-header\": styles.rowPrimaryHeader,\n striped: styles.rowStriped,\n }[variant]\n );\n\n if (header) {\n rowStyles.push(\n {\n bordered: styles.rowHeaderBordered,\n compact: styles.rowHeaderCompact,\n grid: styles.rowHeaderGrid,\n line: styles.rowHeaderLine,\n minimal: styles.rowHeaderMinimal,\n \"primary-header\": styles.rowHeaderPrimaryHeader,\n striped: styles.rowHeaderStriped,\n }[variant]\n );\n }\n\n if (footer) {\n if (variant === \"striped\") {rowStyles.push(styles.rowFooterStriped);}\n else {rowStyles.push(styles.rowFooter);}\n }\n\n if (stripe && !header && !footer) {\n rowStyles.push(styles.rowStripe);\n }\n\n const styleArray = style ? [...rowStyles, style] : rowStyles;\n const childArray = Children.toArray(children);\n const processedChildren = childArray.map((child, i) => {\n if (isValidElement(child) && child.type === TableCell) {\n return cloneElement(child as ReactElement<TableCellProps>, {\n _last: i === childArray.length - 1,\n footer,\n header,\n variant,\n });\n }\n return child;\n });\n\n return (\n <View wrap={false} style={styleArray as never}>\n {processedChildren}\n </View>\n );\n}\n\nexport function TableCell({\n header,\n footer,\n align,\n width,\n children,\n style,\n variant = \"line\",\n _last,\n}: TableCellProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createTableStyles(theme), [theme]);\n const cellStyles: Style[] =\n width !== undefined\n ? [styles.cellFixed, { width } as Style]\n : [styles.cell];\n\n const cellVariantStyle = (\n {\n bordered: styles.cellBordered,\n compact: styles.cellCompact,\n minimal: styles.cellMinimal,\n \"primary-header\": styles.cellPrimaryHeader,\n striped: styles.cellStriped,\n } as Partial<Record<TableVariant, Style>>\n )[variant];\n if (cellVariantStyle) {cellStyles.push(cellVariantStyle);}\n\n if (variant === \"grid\" && !_last) {\n cellStyles.push(styles.cellGridBorder);\n } else if (variant === \"bordered\" && !_last) {\n cellStyles.push(styles.cellBorderedBorder);\n }\n\n if (align) {\n cellStyles.push({ textAlign: align } as Style);\n }\n\n const styleArray = style ? [...cellStyles, style] : cellStyles;\n\n let textStyle: Style = styles.cellText;\n if (header) {\n textStyle = {\n bordered: styles.cellTextHeaderBordered,\n compact: styles.cellTextHeaderCompact,\n grid: styles.cellTextHeaderGrid,\n line: styles.cellTextHeaderLine,\n minimal: styles.cellTextHeaderMinimal,\n \"primary-header\": styles.cellTextHeaderPrimaryHeader,\n striped: styles.cellTextHeaderStriped,\n }[variant];\n } else if (footer) {\n textStyle = styles.cellTextFooter;\n } else if (variant === \"compact\") {\n textStyle = styles.cellTextCompact;\n }\n\n const content =\n typeof children === \"string\" ? (\n <PDFText\n style={\n [\n textStyle,\n align ? { textAlign: align } : {},\n { margin: 0, padding: 0 },\n ] as never\n }\n >\n {children}\n </PDFText>\n ) : (\n children\n );\n\n return <View style={styleArray as never}>{content}</View>;\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/table/table.types.ts",
+ "content": "import type { PDFComponentProps } from \"@/registry/themes\";\n\n/** Table visual style variant. */\nexport type TableVariant =\n | \"line\"\n | \"grid\"\n | \"minimal\"\n | \"striped\"\n | \"compact\"\n | \"bordered\"\n | \"primary-header\";\n\n/**\n * Table container with visual style variants and optional zebra striping.\n * Props - `variant` | `zebraStripe` | `noWrap` | `children` | `style`\n * @see {@link TableProps}\n */\nexport interface TableProps extends PDFComponentProps {\n /**\n * @default 'line'\n */\n variant?: TableVariant;\n /**\n * @default false\n */\n zebraStripe?: boolean;\n /**\n * @default false\n */\n noWrap?: boolean;\n}\n\nexport type TableSectionProps = PDFComponentProps;\n\n/**\n * Table row with optional header, footer, and stripe states.\n * Props - `header` | `footer` | `stripe` | `variant` | `children` | `style`\n * @see {@link TableRowProps}\n */\nexport interface TableRowProps extends PDFComponentProps {\n header?: boolean;\n footer?: boolean;\n stripe?: boolean;\n variant?: TableVariant;\n}\n\n/**\n * Table cell with alignment, width, and header or footer text styling.\n * Props - `header` | `footer` | `align` | `width` | `variant` | `_last` | `children` | `style`\n * @see {@link TableCellProps}\n */\nexport interface TableCellProps extends PDFComponentProps {\n header?: boolean;\n footer?: boolean;\n align?: \"left\" | \"center\" | \"right\";\n width?: string | number;\n variant?: TableVariant;\n _last?: boolean;\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/table/index.ts",
+ "content": "export {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableRow,\n TableCell,\n} from \"./table\";\nexport type {\n TableProps,\n TableSectionProps,\n TableRowProps,\n TableCellProps,\n TableVariant,\n} from \"./table.types\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/forme/text.json b/public/r/forme/text.json
new file mode 100644
index 0000000..cd49f5f
--- /dev/null
+++ b/public/r/forme/text.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/text",
+ "title": "Text",
+ "description": "Text PDF component (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/components/text/text.tsx",
+ "content": "import { Text as PDFText, StyleSheet } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type TextVariant = \"xs\" | \"sm\" | \"base\" | \"lg\" | \"xl\" | \"2xl\" | \"3xl\";\nexport type TextWeight = \"normal\" | \"medium\" | \"semibold\" | \"bold\";\nexport type TextDecoration = \"underline\" | \"line-through\" | \"none\";\n\n/**\n * Body text with typography scale, alignment, and decoration options.\n * Props - `variant` | `align` | `color` | `weight` | `italic` | `decoration` | `transform` | `noMargin` | `children` | `style`\n * @see {@link TextProps}\n */\nexport interface TextProps extends PDFComponentProps {\n /**\n * @default 'base'\n */\n variant?: TextVariant;\n /**\n * @default 'left'\n */\n align?: \"left\" | \"center\" | \"right\" | \"justify\";\n color?: string;\n /**\n * @default 'normal'\n */\n weight?: TextWeight;\n /**\n * @default false\n */\n italic?: boolean;\n /**\n * @default 'none'\n */\n decoration?: TextDecoration;\n transform?: \"uppercase\" | \"lowercase\" | \"capitalize\";\n /**\n * @default false\n */\n noMargin?: boolean;\n}\n\nfunction createTextStyles(t: PdfcnTheme) {\n const { fontWeights, letterSpacing } = t.primitives;\n const base = {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n lineHeight: t.typography.body.lineHeight,\n marginBottom: t.spacing.paragraphGap,\n marginTop: 0,\n };\n return StyleSheet.create({\n \"2xl\": { ...base, fontSize: t.primitives.typography[\"2xl\"] },\n \"3xl\": { ...base, fontSize: t.primitives.typography[\"3xl\"] },\n base: { ...base, fontSize: t.primitives.typography.base },\n capitalize: { textTransform: \"capitalize\" },\n decorationNone: { textDecoration: \"none\" },\n italic: { fontStyle: \"italic\" },\n lg: { ...base, fontSize: t.primitives.typography.lg },\n lineThrough: { textDecoration: \"line-through\" },\n lowercase: { textTransform: \"lowercase\" },\n noMargin: { marginBottom: 0, marginTop: 0 },\n sm: { ...base, fontSize: t.primitives.typography.sm },\n text: { ...base, fontSize: t.typography.body.fontSize },\n underline: { textDecoration: \"underline\" },\n uppercase: {\n letterSpacing: letterSpacing.wider * 10,\n textTransform: \"uppercase\",\n },\n weightBold: { fontWeight: fontWeights.bold },\n weightMedium: { fontWeight: fontWeights.medium },\n weightNormal: { fontWeight: fontWeights.regular },\n weightSemibold: { fontWeight: fontWeights.semibold },\n xl: { ...base, fontSize: t.primitives.typography.xl },\n xs: { ...base, fontSize: t.primitives.typography.xs },\n });\n}\n\nexport function Text({\n variant,\n align,\n color,\n weight,\n italic,\n decoration,\n transform,\n noMargin,\n children,\n style,\n}: TextProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createTextStyles(theme), [theme]);\n const weightMap = {\n bold: styles.weightBold,\n medium: styles.weightMedium,\n normal: styles.weightNormal,\n semibold: styles.weightSemibold,\n };\n const decorationMap = {\n \"line-through\": styles.lineThrough,\n none: styles.decorationNone,\n underline: styles.underline,\n };\n const transformMap = {\n capitalize: styles.capitalize,\n lowercase: styles.lowercase,\n uppercase: styles.uppercase,\n };\n const styleArray: Style[] = [variant ? styles[variant] : styles.text];\n if (weight && weight in weightMap) {styleArray.push(weightMap[weight]);}\n if (italic) {styleArray.push(styles.italic);}\n if (decoration && decoration in decorationMap)\n {styleArray.push(decorationMap[decoration]);}\n if (transform && transform in transformMap)\n {styleArray.push(transformMap[transform]);}\n if (noMargin) {styleArray.push(styles.noMargin);}\n const semantic = {} as Style;\n if (align) {semantic.textAlign = align;}\n if (color) {semantic.color = resolveColor(color, theme.colors);}\n if (Object.keys(semantic).length > 0) {styleArray.push(semantic);}\n if (style) {styleArray.push(...[style].flat());}\n return <PDFText style={styleArray as never}>{children}</PDFText>;\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/text/index.ts",
+ "content": "export {\n Text,\n type TextProps,\n type TextVariant,\n type TextWeight,\n type TextDecoration,\n} from \"./text\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/forme/theme-blueprint.json b/public/r/forme/theme-blueprint.json
new file mode 100644
index 0000000..f364150
--- /dev/null
+++ b/public/r/forme/theme-blueprint.json
@@ -0,0 +1,37 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/theme-blueprint",
+ "title": "Blueprint Theme (forme)",
+ "description": "blueprint theme tokens for forme",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "files": [
+ {
+ "path": "registry/themes/blueprint.ts",
+ "content": "import { defaultPrimitives } from \"./primitives\";\nimport type { PdfcnTheme } from \"./theme-types\";\n\n/**\n * Blueprint theme preset.\n *\n * Character: Dark slate palette with cyan accent, JetBrains Mono headings,\n * Source Code Pro body — a technical, precision-first aesthetic.\n * Ideal for API docs, engineering specs, and developer-focused reports.\n */\nexport const blueprintTheme: PdfcnTheme = {\n colors: {\n accent: \"#0891b2\",\n background: \"#ffffff\",\n border: \"#cbd5e1\",\n destructive: \"#e11d48\",\n foreground: \"#0f172a\",\n info: \"#0284c7\",\n muted: \"#f1f5f9\",\n mutedForeground: \"#475569\",\n primary: \"#0f172a\",\n primaryForeground: \"#f0f9ff\",\n success: \"#059669\",\n warning: \"#d97706\",\n },\n name: \"blueprint\",\n page: {\n orientation: \"portrait\",\n size: \"A4\",\n },\n primitives: defaultPrimitives,\n spacing: {\n componentGap: 14,\n page: {\n marginBottom: 52,\n marginLeft: 48,\n marginRight: 48,\n marginTop: 52,\n },\n paragraphGap: 10,\n sectionGap: 26,\n },\n typography: {\n body: {\n fontFamily: \"Source Code Pro\",\n fontSize: 10,\n lineHeight: 1.75,\n },\n heading: {\n fontFamily: \"JetBrains Mono\",\n fontSize: {\n h1: 28,\n h2: 21,\n h3: 17,\n h4: 14,\n h5: 12,\n h6: 10,\n },\n fontWeight: 700,\n lineHeight: 1.2,\n },\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-blueprint.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "content": "import type { PrimitiveTokens } from \"./theme-types\";\n\n/**\n * Default primitive tokens shared by all theme presets.\n *\n * These define the raw design scales — the \"palette\" of values available.\n * Themes select from these scales when assigning semantic tokens.\n *\n * - Typography: Major Third (1.25) ratio, 12pt base\n * - Spacing: 4pt grid system\n * - Font weights: 400–700\n * - Line heights: 1.2–1.6\n * - Border radius: 0–8pt (plus full for pills)\n * - Letter spacing: -0.025 to 0.05 (em-like ratios for PDF points)\n */\nexport const defaultPrimitives: PrimitiveTokens = {\n borderRadius: {\n full: 9999,\n lg: 8,\n md: 4,\n none: 0,\n sm: 2,\n },\n fontWeights: {\n bold: 700,\n medium: 500,\n regular: 400,\n semibold: 600,\n },\n letterSpacing: {\n normal: 0,\n tight: -0.025,\n wide: 0.025,\n wider: 0.05,\n },\n lineHeights: {\n normal: 1.4,\n relaxed: 1.6,\n tight: 1.2,\n },\n spacing: {\n 0: 0,\n 0.5: 2,\n 1: 4,\n 10: 40,\n 12: 48,\n 16: 64,\n 2: 8,\n 3: 12,\n 4: 16,\n 5: 20,\n 6: 24,\n 8: 32,\n },\n typography: {\n \"2xl\": 28,\n \"3xl\": 36,\n base: 15,\n lg: 18,\n sm: 12,\n xl: 22,\n xs: 10,\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "content": "/**\n * pdfcn Theme System — Type Definitions\n *\n * Defines the complete type hierarchy for the pdfcn PDF theme system.\n * All PDF components consume these tokens instead of hardcoding style values.\n *\n * Architecture:\n * - PrimitiveTokens: Raw design scales (typography, spacing, weights, line heights)\n * - ColorTokens: Semantic color mappings (foreground/background pairs)\n * - TypographyTokens: Font family, size, weight, and line height decisions\n * - SpacingTokens: Page margins, section/paragraph/component gaps\n * - PageTokens: Default page size and orientation\n * - PdfcnTheme: The complete theme object combining all token layers\n *\n * @example\n * ```ts\n * import type { PdfcnTheme } from '@/registry/themes';\n *\n * const myTheme: PdfcnTheme = {\n * name: 'custom',\n * primitives: { ... },\n * colors: { foreground: '#1a1a1a', ... },\n * typography: { body: { ... }, heading: { ... } },\n * spacing: { page: { ... }, sectionGap: 24, ... },\n * page: { size: 'A4', orientation: 'portrait' },\n * };\n * ```\n */\n\n// ─── Primitive Tokens ───────────────────────────────────────────────────────\n// Raw design scales. These define WHAT values are available.\n// Themes choose from these when populating semantic tokens.\n\n/** Typography scale using a Major Third (1.25) ratio with 12pt base */\nexport interface TypographyScale {\n /** 10pt — Captions, footnotes */\n xs: number;\n /** 12pt — Body text (PDF standard) */\n sm: number;\n /** 15pt — Large body, small headings */\n base: number;\n /** 18pt — H4 equivalent */\n lg: number;\n /** 22pt — H3 equivalent */\n xl: number;\n /** 28pt — H2 equivalent */\n \"2xl\": number;\n /** 36pt — H1 equivalent */\n \"3xl\": number;\n}\n\n/** Spacing scale based on a 4pt grid system */\nexport interface SpacingScale {\n /** 0pt */\n 0: number;\n /** 2pt */\n 0.5: number;\n /** 4pt */\n 1: number;\n /** 8pt */\n 2: number;\n /** 12pt */\n 3: number;\n /** 16pt */\n 4: number;\n /** 20pt */\n 5: number;\n /** 24pt */\n 6: number;\n /** 32pt */\n 8: number;\n /** 40pt */\n 10: number;\n /** 48pt */\n 12: number;\n /** 64pt */\n 16: number;\n}\n\n/** Font weight scale */\nexport interface FontWeights {\n regular: number;\n medium: number;\n semibold: number;\n bold: number;\n}\n\n/** Line height scale */\nexport interface LineHeights {\n /** 1.2 — Tight, for headings */\n tight: number;\n /** 1.4 — Normal, for body text */\n normal: number;\n /** 1.6 — Relaxed, for reading-heavy content */\n relaxed: number;\n}\n\n/** Border radius scale for rounded corners */\nexport interface BorderRadiusScale {\n /** 0pt — Sharp corners */\n none: number;\n /** 2pt — Subtle rounding */\n sm: number;\n /** 4pt — Standard rounding */\n md: number;\n /** 8pt — Pronounced rounding */\n lg: number;\n /** 9999pt — Pill/circle shape */\n full: number;\n}\n\n/** Letter spacing scale for typography adjustments */\nexport interface LetterSpacingScale {\n /** -0.025em — Tighter spacing */\n tight: number;\n /** 0em — Normal spacing */\n normal: number;\n /** 0.025em — Slightly wider spacing */\n wide: number;\n /** 0.05em — Much wider spacing (for uppercase) */\n wider: number;\n}\n\n/** Raw design scales shared across themes */\nexport interface PrimitiveTokens {\n typography: TypographyScale;\n spacing: SpacingScale;\n fontWeights: FontWeights;\n lineHeights: LineHeights;\n borderRadius: BorderRadiusScale;\n letterSpacing: LetterSpacingScale;\n}\n\n// ─── Semantic Tokens ────────────────────────────────────────────────────────\n// These map primitives to design intent. Themes differ primarily here.\n\n/**\n * Semantic color tokens using the foreground/background pair convention.\n * All values must be hex strings (e.g., '#1a1a1a').\n * react-pdf supports hex, rgb(), and hsl() — but NOT oklch.\n */\nexport interface ColorTokens {\n /** Primary text and content color */\n foreground: string;\n /** Page background color */\n background: string;\n /** Subtle background for secondary areas (e.g., code blocks, table headers) */\n muted: string;\n /** Text on muted backgrounds (captions, footnotes, timestamps) */\n mutedForeground: string;\n /** Brand/accent color for emphasis and highlights */\n primary: string;\n /** Text on primary-colored backgrounds */\n primaryForeground: string;\n /** Table borders, dividers, rules */\n border: string;\n /** Secondary accent for call-to-action elements, badges */\n accent: string;\n /** Error text, warning indicators */\n destructive: string;\n /** Success states (e.g., badges, confirmations) */\n success: string;\n /** Warning states (e.g., badges, alerts) */\n warning: string;\n /** Info states (e.g., badges, informational alerts) */\n info: string;\n}\n\n/** Typography semantic tokens — what fonts and sizes to use where */\nexport interface TypographyTokens {\n /** Body text settings */\n body: {\n /** Font family for body text (e.g., 'Helvetica') */\n fontFamily: string;\n /** Base font size in points */\n fontSize: number;\n /** Line height multiplier */\n lineHeight: number;\n };\n /** Heading text settings */\n heading: {\n /** Font family for headings (e.g., 'Times-Roman', 'Courier') */\n fontFamily: string;\n /** Font weight as numeric value (400-700) */\n fontWeight: number;\n /** Line height multiplier for headings */\n lineHeight: number;\n /** Font sizes for each heading level in points */\n fontSize: {\n h1: number;\n h2: number;\n h3: number;\n h4: number;\n h5: number;\n h6: number;\n };\n };\n}\n\n/** Spacing semantic tokens — consistent spacing across the document */\nexport interface SpacingTokens {\n /** Page margin settings in points */\n page: {\n marginTop: number;\n marginRight: number;\n marginBottom: number;\n marginLeft: number;\n };\n /** Space between major document sections (after h2, before new sections) */\n sectionGap: number;\n /** Space between paragraphs and after text blocks */\n paragraphGap: number;\n /** Space between inline components, list items, table rows */\n componentGap: number;\n}\n\n/** Page layout defaults */\nexport interface PageTokens {\n /** Default page size */\n size: \"A4\" | \"LETTER\" | \"LEGAL\";\n /** Default page orientation */\n orientation: \"portrait\" | \"landscape\";\n}\n\n// ─── Full Theme ─────────────────────────────────────────────────────────────\n\n/**\n * The complete pdfcn theme object.\n *\n * Components import this and use its tokens for all style values.\n * Since React Context doesn't work in @react-pdf/renderer,\n * the theme is a plain TypeScript object imported directly by components.\n *\n * @example\n * ```tsx\n * // In a component:\n * import { theme } from '../lib/pdfx-theme';\n *\n * function createStyles(t: PdfcnTheme) {\n * return StyleSheet.create({\n * text: {\n * fontFamily: t.typography.body.fontFamily,\n * fontSize: t.typography.body.fontSize,\n * color: t.colors.foreground,\n * },\n * });\n * }\n *\n * const styles = createStyles(theme);\n * ```\n */\nexport interface PdfcnTheme {\n /** Theme name identifier */\n name: string;\n /** Raw design scales */\n primitives: PrimitiveTokens;\n /** Semantic color mappings */\n colors: ColorTokens;\n /** Typography settings for body and headings */\n typography: TypographyTokens;\n /** Spacing settings for page, sections, and components */\n spacing: SpacingTokens;\n /** Page layout defaults */\n page: PageTokens;\n}\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "content": "import { professionalTheme } from \"@/registry/themes\";\n\nexport const theme = professionalTheme;\n",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "type": "registry:theme"
+}
\ No newline at end of file
diff --git a/public/r/forme/theme-corporate.json b/public/r/forme/theme-corporate.json
new file mode 100644
index 0000000..3faf1e9
--- /dev/null
+++ b/public/r/forme/theme-corporate.json
@@ -0,0 +1,37 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/theme-corporate",
+ "title": "Corporate Theme (forme)",
+ "description": "corporate theme tokens for forme",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "files": [
+ {
+ "path": "registry/themes/corporate.ts",
+ "content": "import { defaultPrimitives } from \"./primitives\";\nimport type { PdfcnTheme } from \"./theme-types\";\n\n/**\n * Corporate theme preset.\n *\n * Character: Blue-gray palette, Lato sans-serif throughout, structured and\n * dependable. Sky-blue accent adds clarity without distraction.\n * Ideal for business proposals, project plans, and client-facing reports.\n */\nexport const corporateTheme: PdfcnTheme = {\n colors: {\n accent: \"#0ea5e9\",\n background: \"#ffffff\",\n border: \"#e2e8f0\",\n destructive: \"#ef4444\",\n foreground: \"#1e293b\",\n info: \"#3b82f6\",\n muted: \"#f8fafc\",\n mutedForeground: \"#64748b\",\n primary: \"#0f4c81\",\n primaryForeground: \"#ffffff\",\n success: \"#22c55e\",\n warning: \"#f59e0b\",\n },\n name: \"corporate\",\n page: {\n orientation: \"portrait\",\n size: \"A4\",\n },\n primitives: defaultPrimitives,\n spacing: {\n componentGap: 13,\n page: {\n marginBottom: 52,\n marginLeft: 44,\n marginRight: 44,\n marginTop: 52,\n },\n paragraphGap: 9,\n sectionGap: 24,\n },\n typography: {\n body: {\n fontFamily: \"Lato\",\n fontSize: 11,\n lineHeight: 1.55,\n },\n heading: {\n fontFamily: \"Lato\",\n fontSize: {\n h1: 30,\n h2: 22,\n h3: 18,\n h4: 15,\n h5: 13,\n h6: 11,\n },\n fontWeight: 700,\n lineHeight: 1.2,\n },\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-corporate.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "content": "import type { PrimitiveTokens } from \"./theme-types\";\n\n/**\n * Default primitive tokens shared by all theme presets.\n *\n * These define the raw design scales — the \"palette\" of values available.\n * Themes select from these scales when assigning semantic tokens.\n *\n * - Typography: Major Third (1.25) ratio, 12pt base\n * - Spacing: 4pt grid system\n * - Font weights: 400–700\n * - Line heights: 1.2–1.6\n * - Border radius: 0–8pt (plus full for pills)\n * - Letter spacing: -0.025 to 0.05 (em-like ratios for PDF points)\n */\nexport const defaultPrimitives: PrimitiveTokens = {\n borderRadius: {\n full: 9999,\n lg: 8,\n md: 4,\n none: 0,\n sm: 2,\n },\n fontWeights: {\n bold: 700,\n medium: 500,\n regular: 400,\n semibold: 600,\n },\n letterSpacing: {\n normal: 0,\n tight: -0.025,\n wide: 0.025,\n wider: 0.05,\n },\n lineHeights: {\n normal: 1.4,\n relaxed: 1.6,\n tight: 1.2,\n },\n spacing: {\n 0: 0,\n 0.5: 2,\n 1: 4,\n 10: 40,\n 12: 48,\n 16: 64,\n 2: 8,\n 3: 12,\n 4: 16,\n 5: 20,\n 6: 24,\n 8: 32,\n },\n typography: {\n \"2xl\": 28,\n \"3xl\": 36,\n base: 15,\n lg: 18,\n sm: 12,\n xl: 22,\n xs: 10,\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "content": "/**\n * pdfcn Theme System — Type Definitions\n *\n * Defines the complete type hierarchy for the pdfcn PDF theme system.\n * All PDF components consume these tokens instead of hardcoding style values.\n *\n * Architecture:\n * - PrimitiveTokens: Raw design scales (typography, spacing, weights, line heights)\n * - ColorTokens: Semantic color mappings (foreground/background pairs)\n * - TypographyTokens: Font family, size, weight, and line height decisions\n * - SpacingTokens: Page margins, section/paragraph/component gaps\n * - PageTokens: Default page size and orientation\n * - PdfcnTheme: The complete theme object combining all token layers\n *\n * @example\n * ```ts\n * import type { PdfcnTheme } from '@/registry/themes';\n *\n * const myTheme: PdfcnTheme = {\n * name: 'custom',\n * primitives: { ... },\n * colors: { foreground: '#1a1a1a', ... },\n * typography: { body: { ... }, heading: { ... } },\n * spacing: { page: { ... }, sectionGap: 24, ... },\n * page: { size: 'A4', orientation: 'portrait' },\n * };\n * ```\n */\n\n// ─── Primitive Tokens ───────────────────────────────────────────────────────\n// Raw design scales. These define WHAT values are available.\n// Themes choose from these when populating semantic tokens.\n\n/** Typography scale using a Major Third (1.25) ratio with 12pt base */\nexport interface TypographyScale {\n /** 10pt — Captions, footnotes */\n xs: number;\n /** 12pt — Body text (PDF standard) */\n sm: number;\n /** 15pt — Large body, small headings */\n base: number;\n /** 18pt — H4 equivalent */\n lg: number;\n /** 22pt — H3 equivalent */\n xl: number;\n /** 28pt — H2 equivalent */\n \"2xl\": number;\n /** 36pt — H1 equivalent */\n \"3xl\": number;\n}\n\n/** Spacing scale based on a 4pt grid system */\nexport interface SpacingScale {\n /** 0pt */\n 0: number;\n /** 2pt */\n 0.5: number;\n /** 4pt */\n 1: number;\n /** 8pt */\n 2: number;\n /** 12pt */\n 3: number;\n /** 16pt */\n 4: number;\n /** 20pt */\n 5: number;\n /** 24pt */\n 6: number;\n /** 32pt */\n 8: number;\n /** 40pt */\n 10: number;\n /** 48pt */\n 12: number;\n /** 64pt */\n 16: number;\n}\n\n/** Font weight scale */\nexport interface FontWeights {\n regular: number;\n medium: number;\n semibold: number;\n bold: number;\n}\n\n/** Line height scale */\nexport interface LineHeights {\n /** 1.2 — Tight, for headings */\n tight: number;\n /** 1.4 — Normal, for body text */\n normal: number;\n /** 1.6 — Relaxed, for reading-heavy content */\n relaxed: number;\n}\n\n/** Border radius scale for rounded corners */\nexport interface BorderRadiusScale {\n /** 0pt — Sharp corners */\n none: number;\n /** 2pt — Subtle rounding */\n sm: number;\n /** 4pt — Standard rounding */\n md: number;\n /** 8pt — Pronounced rounding */\n lg: number;\n /** 9999pt — Pill/circle shape */\n full: number;\n}\n\n/** Letter spacing scale for typography adjustments */\nexport interface LetterSpacingScale {\n /** -0.025em — Tighter spacing */\n tight: number;\n /** 0em — Normal spacing */\n normal: number;\n /** 0.025em — Slightly wider spacing */\n wide: number;\n /** 0.05em — Much wider spacing (for uppercase) */\n wider: number;\n}\n\n/** Raw design scales shared across themes */\nexport interface PrimitiveTokens {\n typography: TypographyScale;\n spacing: SpacingScale;\n fontWeights: FontWeights;\n lineHeights: LineHeights;\n borderRadius: BorderRadiusScale;\n letterSpacing: LetterSpacingScale;\n}\n\n// ─── Semantic Tokens ────────────────────────────────────────────────────────\n// These map primitives to design intent. Themes differ primarily here.\n\n/**\n * Semantic color tokens using the foreground/background pair convention.\n * All values must be hex strings (e.g., '#1a1a1a').\n * react-pdf supports hex, rgb(), and hsl() — but NOT oklch.\n */\nexport interface ColorTokens {\n /** Primary text and content color */\n foreground: string;\n /** Page background color */\n background: string;\n /** Subtle background for secondary areas (e.g., code blocks, table headers) */\n muted: string;\n /** Text on muted backgrounds (captions, footnotes, timestamps) */\n mutedForeground: string;\n /** Brand/accent color for emphasis and highlights */\n primary: string;\n /** Text on primary-colored backgrounds */\n primaryForeground: string;\n /** Table borders, dividers, rules */\n border: string;\n /** Secondary accent for call-to-action elements, badges */\n accent: string;\n /** Error text, warning indicators */\n destructive: string;\n /** Success states (e.g., badges, confirmations) */\n success: string;\n /** Warning states (e.g., badges, alerts) */\n warning: string;\n /** Info states (e.g., badges, informational alerts) */\n info: string;\n}\n\n/** Typography semantic tokens — what fonts and sizes to use where */\nexport interface TypographyTokens {\n /** Body text settings */\n body: {\n /** Font family for body text (e.g., 'Helvetica') */\n fontFamily: string;\n /** Base font size in points */\n fontSize: number;\n /** Line height multiplier */\n lineHeight: number;\n };\n /** Heading text settings */\n heading: {\n /** Font family for headings (e.g., 'Times-Roman', 'Courier') */\n fontFamily: string;\n /** Font weight as numeric value (400-700) */\n fontWeight: number;\n /** Line height multiplier for headings */\n lineHeight: number;\n /** Font sizes for each heading level in points */\n fontSize: {\n h1: number;\n h2: number;\n h3: number;\n h4: number;\n h5: number;\n h6: number;\n };\n };\n}\n\n/** Spacing semantic tokens — consistent spacing across the document */\nexport interface SpacingTokens {\n /** Page margin settings in points */\n page: {\n marginTop: number;\n marginRight: number;\n marginBottom: number;\n marginLeft: number;\n };\n /** Space between major document sections (after h2, before new sections) */\n sectionGap: number;\n /** Space between paragraphs and after text blocks */\n paragraphGap: number;\n /** Space between inline components, list items, table rows */\n componentGap: number;\n}\n\n/** Page layout defaults */\nexport interface PageTokens {\n /** Default page size */\n size: \"A4\" | \"LETTER\" | \"LEGAL\";\n /** Default page orientation */\n orientation: \"portrait\" | \"landscape\";\n}\n\n// ─── Full Theme ─────────────────────────────────────────────────────────────\n\n/**\n * The complete pdfcn theme object.\n *\n * Components import this and use its tokens for all style values.\n * Since React Context doesn't work in @react-pdf/renderer,\n * the theme is a plain TypeScript object imported directly by components.\n *\n * @example\n * ```tsx\n * // In a component:\n * import { theme } from '../lib/pdfx-theme';\n *\n * function createStyles(t: PdfcnTheme) {\n * return StyleSheet.create({\n * text: {\n * fontFamily: t.typography.body.fontFamily,\n * fontSize: t.typography.body.fontSize,\n * color: t.colors.foreground,\n * },\n * });\n * }\n *\n * const styles = createStyles(theme);\n * ```\n */\nexport interface PdfcnTheme {\n /** Theme name identifier */\n name: string;\n /** Raw design scales */\n primitives: PrimitiveTokens;\n /** Semantic color mappings */\n colors: ColorTokens;\n /** Typography settings for body and headings */\n typography: TypographyTokens;\n /** Spacing settings for page, sections, and components */\n spacing: SpacingTokens;\n /** Page layout defaults */\n page: PageTokens;\n}\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "content": "import { professionalTheme } from \"@/registry/themes\";\n\nexport const theme = professionalTheme;\n",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "type": "registry:theme"
+}
\ No newline at end of file
diff --git a/public/r/forme/theme-elegant.json b/public/r/forme/theme-elegant.json
new file mode 100644
index 0000000..1eec75c
--- /dev/null
+++ b/public/r/forme/theme-elegant.json
@@ -0,0 +1,37 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/theme-elegant",
+ "title": "Elegant Theme (forme)",
+ "description": "elegant theme tokens for forme",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "files": [
+ {
+ "path": "registry/themes/elegant.ts",
+ "content": "import { defaultPrimitives } from \"./primitives\";\nimport type { PdfcnTheme } from \"./theme-types\";\n\n/**\n * Elegant theme preset.\n *\n * Character: Warm cream-adjacent whites, amber/gold accent, Playfair Display\n * headings paired with Lora body — a classic editorial combination.\n * Ideal for design portfolios, luxury brands, and high-end editorial PDFs.\n */\nexport const elegantTheme: PdfcnTheme = {\n colors: {\n accent: \"#b45309\",\n background: \"#ffffff\",\n border: \"#d6d3d1\",\n destructive: \"#dc2626\",\n foreground: \"#1c1917\",\n info: \"#0ea5e9\",\n muted: \"#fafaf9\",\n mutedForeground: \"#78716c\",\n primary: \"#78350f\",\n primaryForeground: \"#fffbeb\",\n success: \"#16a34a\",\n warning: \"#d97706\",\n },\n name: \"elegant\",\n page: {\n orientation: \"portrait\",\n size: \"A4\",\n },\n primitives: defaultPrimitives,\n spacing: {\n componentGap: 16,\n page: {\n marginBottom: 60,\n marginLeft: 52,\n marginRight: 52,\n marginTop: 60,\n },\n paragraphGap: 12,\n sectionGap: 30,\n },\n typography: {\n body: {\n fontFamily: \"Lora\",\n fontSize: 11,\n lineHeight: 1.7,\n },\n heading: {\n fontFamily: \"Playfair Display\",\n fontSize: {\n h1: 36,\n h2: 26,\n h3: 20,\n h4: 16,\n h5: 14,\n h6: 12,\n },\n fontWeight: 700,\n lineHeight: 1.2,\n },\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-elegant.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "content": "import type { PrimitiveTokens } from \"./theme-types\";\n\n/**\n * Default primitive tokens shared by all theme presets.\n *\n * These define the raw design scales — the \"palette\" of values available.\n * Themes select from these scales when assigning semantic tokens.\n *\n * - Typography: Major Third (1.25) ratio, 12pt base\n * - Spacing: 4pt grid system\n * - Font weights: 400–700\n * - Line heights: 1.2–1.6\n * - Border radius: 0–8pt (plus full for pills)\n * - Letter spacing: -0.025 to 0.05 (em-like ratios for PDF points)\n */\nexport const defaultPrimitives: PrimitiveTokens = {\n borderRadius: {\n full: 9999,\n lg: 8,\n md: 4,\n none: 0,\n sm: 2,\n },\n fontWeights: {\n bold: 700,\n medium: 500,\n regular: 400,\n semibold: 600,\n },\n letterSpacing: {\n normal: 0,\n tight: -0.025,\n wide: 0.025,\n wider: 0.05,\n },\n lineHeights: {\n normal: 1.4,\n relaxed: 1.6,\n tight: 1.2,\n },\n spacing: {\n 0: 0,\n 0.5: 2,\n 1: 4,\n 10: 40,\n 12: 48,\n 16: 64,\n 2: 8,\n 3: 12,\n 4: 16,\n 5: 20,\n 6: 24,\n 8: 32,\n },\n typography: {\n \"2xl\": 28,\n \"3xl\": 36,\n base: 15,\n lg: 18,\n sm: 12,\n xl: 22,\n xs: 10,\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "content": "/**\n * pdfcn Theme System — Type Definitions\n *\n * Defines the complete type hierarchy for the pdfcn PDF theme system.\n * All PDF components consume these tokens instead of hardcoding style values.\n *\n * Architecture:\n * - PrimitiveTokens: Raw design scales (typography, spacing, weights, line heights)\n * - ColorTokens: Semantic color mappings (foreground/background pairs)\n * - TypographyTokens: Font family, size, weight, and line height decisions\n * - SpacingTokens: Page margins, section/paragraph/component gaps\n * - PageTokens: Default page size and orientation\n * - PdfcnTheme: The complete theme object combining all token layers\n *\n * @example\n * ```ts\n * import type { PdfcnTheme } from '@/registry/themes';\n *\n * const myTheme: PdfcnTheme = {\n * name: 'custom',\n * primitives: { ... },\n * colors: { foreground: '#1a1a1a', ... },\n * typography: { body: { ... }, heading: { ... } },\n * spacing: { page: { ... }, sectionGap: 24, ... },\n * page: { size: 'A4', orientation: 'portrait' },\n * };\n * ```\n */\n\n// ─── Primitive Tokens ───────────────────────────────────────────────────────\n// Raw design scales. These define WHAT values are available.\n// Themes choose from these when populating semantic tokens.\n\n/** Typography scale using a Major Third (1.25) ratio with 12pt base */\nexport interface TypographyScale {\n /** 10pt — Captions, footnotes */\n xs: number;\n /** 12pt — Body text (PDF standard) */\n sm: number;\n /** 15pt — Large body, small headings */\n base: number;\n /** 18pt — H4 equivalent */\n lg: number;\n /** 22pt — H3 equivalent */\n xl: number;\n /** 28pt — H2 equivalent */\n \"2xl\": number;\n /** 36pt — H1 equivalent */\n \"3xl\": number;\n}\n\n/** Spacing scale based on a 4pt grid system */\nexport interface SpacingScale {\n /** 0pt */\n 0: number;\n /** 2pt */\n 0.5: number;\n /** 4pt */\n 1: number;\n /** 8pt */\n 2: number;\n /** 12pt */\n 3: number;\n /** 16pt */\n 4: number;\n /** 20pt */\n 5: number;\n /** 24pt */\n 6: number;\n /** 32pt */\n 8: number;\n /** 40pt */\n 10: number;\n /** 48pt */\n 12: number;\n /** 64pt */\n 16: number;\n}\n\n/** Font weight scale */\nexport interface FontWeights {\n regular: number;\n medium: number;\n semibold: number;\n bold: number;\n}\n\n/** Line height scale */\nexport interface LineHeights {\n /** 1.2 — Tight, for headings */\n tight: number;\n /** 1.4 — Normal, for body text */\n normal: number;\n /** 1.6 — Relaxed, for reading-heavy content */\n relaxed: number;\n}\n\n/** Border radius scale for rounded corners */\nexport interface BorderRadiusScale {\n /** 0pt — Sharp corners */\n none: number;\n /** 2pt — Subtle rounding */\n sm: number;\n /** 4pt — Standard rounding */\n md: number;\n /** 8pt — Pronounced rounding */\n lg: number;\n /** 9999pt — Pill/circle shape */\n full: number;\n}\n\n/** Letter spacing scale for typography adjustments */\nexport interface LetterSpacingScale {\n /** -0.025em — Tighter spacing */\n tight: number;\n /** 0em — Normal spacing */\n normal: number;\n /** 0.025em — Slightly wider spacing */\n wide: number;\n /** 0.05em — Much wider spacing (for uppercase) */\n wider: number;\n}\n\n/** Raw design scales shared across themes */\nexport interface PrimitiveTokens {\n typography: TypographyScale;\n spacing: SpacingScale;\n fontWeights: FontWeights;\n lineHeights: LineHeights;\n borderRadius: BorderRadiusScale;\n letterSpacing: LetterSpacingScale;\n}\n\n// ─── Semantic Tokens ────────────────────────────────────────────────────────\n// These map primitives to design intent. Themes differ primarily here.\n\n/**\n * Semantic color tokens using the foreground/background pair convention.\n * All values must be hex strings (e.g., '#1a1a1a').\n * react-pdf supports hex, rgb(), and hsl() — but NOT oklch.\n */\nexport interface ColorTokens {\n /** Primary text and content color */\n foreground: string;\n /** Page background color */\n background: string;\n /** Subtle background for secondary areas (e.g., code blocks, table headers) */\n muted: string;\n /** Text on muted backgrounds (captions, footnotes, timestamps) */\n mutedForeground: string;\n /** Brand/accent color for emphasis and highlights */\n primary: string;\n /** Text on primary-colored backgrounds */\n primaryForeground: string;\n /** Table borders, dividers, rules */\n border: string;\n /** Secondary accent for call-to-action elements, badges */\n accent: string;\n /** Error text, warning indicators */\n destructive: string;\n /** Success states (e.g., badges, confirmations) */\n success: string;\n /** Warning states (e.g., badges, alerts) */\n warning: string;\n /** Info states (e.g., badges, informational alerts) */\n info: string;\n}\n\n/** Typography semantic tokens — what fonts and sizes to use where */\nexport interface TypographyTokens {\n /** Body text settings */\n body: {\n /** Font family for body text (e.g., 'Helvetica') */\n fontFamily: string;\n /** Base font size in points */\n fontSize: number;\n /** Line height multiplier */\n lineHeight: number;\n };\n /** Heading text settings */\n heading: {\n /** Font family for headings (e.g., 'Times-Roman', 'Courier') */\n fontFamily: string;\n /** Font weight as numeric value (400-700) */\n fontWeight: number;\n /** Line height multiplier for headings */\n lineHeight: number;\n /** Font sizes for each heading level in points */\n fontSize: {\n h1: number;\n h2: number;\n h3: number;\n h4: number;\n h5: number;\n h6: number;\n };\n };\n}\n\n/** Spacing semantic tokens — consistent spacing across the document */\nexport interface SpacingTokens {\n /** Page margin settings in points */\n page: {\n marginTop: number;\n marginRight: number;\n marginBottom: number;\n marginLeft: number;\n };\n /** Space between major document sections (after h2, before new sections) */\n sectionGap: number;\n /** Space between paragraphs and after text blocks */\n paragraphGap: number;\n /** Space between inline components, list items, table rows */\n componentGap: number;\n}\n\n/** Page layout defaults */\nexport interface PageTokens {\n /** Default page size */\n size: \"A4\" | \"LETTER\" | \"LEGAL\";\n /** Default page orientation */\n orientation: \"portrait\" | \"landscape\";\n}\n\n// ─── Full Theme ─────────────────────────────────────────────────────────────\n\n/**\n * The complete pdfcn theme object.\n *\n * Components import this and use its tokens for all style values.\n * Since React Context doesn't work in @react-pdf/renderer,\n * the theme is a plain TypeScript object imported directly by components.\n *\n * @example\n * ```tsx\n * // In a component:\n * import { theme } from '../lib/pdfx-theme';\n *\n * function createStyles(t: PdfcnTheme) {\n * return StyleSheet.create({\n * text: {\n * fontFamily: t.typography.body.fontFamily,\n * fontSize: t.typography.body.fontSize,\n * color: t.colors.foreground,\n * },\n * });\n * }\n *\n * const styles = createStyles(theme);\n * ```\n */\nexport interface PdfcnTheme {\n /** Theme name identifier */\n name: string;\n /** Raw design scales */\n primitives: PrimitiveTokens;\n /** Semantic color mappings */\n colors: ColorTokens;\n /** Typography settings for body and headings */\n typography: TypographyTokens;\n /** Spacing settings for page, sections, and components */\n spacing: SpacingTokens;\n /** Page layout defaults */\n page: PageTokens;\n}\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "content": "import { professionalTheme } from \"@/registry/themes\";\n\nexport const theme = professionalTheme;\n",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "type": "registry:theme"
+}
\ No newline at end of file
diff --git a/public/r/forme/theme-executive.json b/public/r/forme/theme-executive.json
new file mode 100644
index 0000000..468541e
--- /dev/null
+++ b/public/r/forme/theme-executive.json
@@ -0,0 +1,37 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/theme-executive",
+ "title": "Executive Theme (forme)",
+ "description": "executive theme tokens for forme",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "files": [
+ {
+ "path": "registry/themes/executive.ts",
+ "content": "import { defaultPrimitives } from \"./primitives\";\nimport type { PdfcnTheme } from \"./theme-types\";\n\n/**\n * Executive theme preset.\n *\n * Character: Deep navy palette, Merriweather serif headings, Open Sans body.\n * Generous margins, high contrast, premium boardroom aesthetic.\n * Ideal for board reports, executive briefs, and investor documents.\n */\nexport const executiveTheme: PdfcnTheme = {\n colors: {\n accent: \"#1e40af\",\n background: \"#ffffff\",\n border: \"#cbd5e1\",\n destructive: \"#dc2626\",\n foreground: \"#0f172a\",\n info: \"#0369a1\",\n muted: \"#f1f5f9\",\n mutedForeground: \"#64748b\",\n primary: \"#1e3a5f\",\n primaryForeground: \"#ffffff\",\n success: \"#15803d\",\n warning: \"#b45309\",\n },\n name: \"executive\",\n page: {\n orientation: \"portrait\",\n size: \"A4\",\n },\n primitives: defaultPrimitives,\n spacing: {\n componentGap: 16,\n page: {\n marginBottom: 64,\n marginLeft: 56,\n marginRight: 56,\n marginTop: 64,\n },\n paragraphGap: 10,\n sectionGap: 32,\n },\n typography: {\n body: {\n fontFamily: \"Open Sans\",\n fontSize: 11,\n lineHeight: 1.65,\n },\n heading: {\n fontFamily: \"Merriweather\",\n fontSize: {\n h1: 34,\n h2: 26,\n h3: 20,\n h4: 16,\n h5: 14,\n h6: 12,\n },\n fontWeight: 700,\n lineHeight: 1.25,\n },\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-executive.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "content": "import type { PrimitiveTokens } from \"./theme-types\";\n\n/**\n * Default primitive tokens shared by all theme presets.\n *\n * These define the raw design scales — the \"palette\" of values available.\n * Themes select from these scales when assigning semantic tokens.\n *\n * - Typography: Major Third (1.25) ratio, 12pt base\n * - Spacing: 4pt grid system\n * - Font weights: 400–700\n * - Line heights: 1.2–1.6\n * - Border radius: 0–8pt (plus full for pills)\n * - Letter spacing: -0.025 to 0.05 (em-like ratios for PDF points)\n */\nexport const defaultPrimitives: PrimitiveTokens = {\n borderRadius: {\n full: 9999,\n lg: 8,\n md: 4,\n none: 0,\n sm: 2,\n },\n fontWeights: {\n bold: 700,\n medium: 500,\n regular: 400,\n semibold: 600,\n },\n letterSpacing: {\n normal: 0,\n tight: -0.025,\n wide: 0.025,\n wider: 0.05,\n },\n lineHeights: {\n normal: 1.4,\n relaxed: 1.6,\n tight: 1.2,\n },\n spacing: {\n 0: 0,\n 0.5: 2,\n 1: 4,\n 10: 40,\n 12: 48,\n 16: 64,\n 2: 8,\n 3: 12,\n 4: 16,\n 5: 20,\n 6: 24,\n 8: 32,\n },\n typography: {\n \"2xl\": 28,\n \"3xl\": 36,\n base: 15,\n lg: 18,\n sm: 12,\n xl: 22,\n xs: 10,\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "content": "/**\n * pdfcn Theme System — Type Definitions\n *\n * Defines the complete type hierarchy for the pdfcn PDF theme system.\n * All PDF components consume these tokens instead of hardcoding style values.\n *\n * Architecture:\n * - PrimitiveTokens: Raw design scales (typography, spacing, weights, line heights)\n * - ColorTokens: Semantic color mappings (foreground/background pairs)\n * - TypographyTokens: Font family, size, weight, and line height decisions\n * - SpacingTokens: Page margins, section/paragraph/component gaps\n * - PageTokens: Default page size and orientation\n * - PdfcnTheme: The complete theme object combining all token layers\n *\n * @example\n * ```ts\n * import type { PdfcnTheme } from '@/registry/themes';\n *\n * const myTheme: PdfcnTheme = {\n * name: 'custom',\n * primitives: { ... },\n * colors: { foreground: '#1a1a1a', ... },\n * typography: { body: { ... }, heading: { ... } },\n * spacing: { page: { ... }, sectionGap: 24, ... },\n * page: { size: 'A4', orientation: 'portrait' },\n * };\n * ```\n */\n\n// ─── Primitive Tokens ───────────────────────────────────────────────────────\n// Raw design scales. These define WHAT values are available.\n// Themes choose from these when populating semantic tokens.\n\n/** Typography scale using a Major Third (1.25) ratio with 12pt base */\nexport interface TypographyScale {\n /** 10pt — Captions, footnotes */\n xs: number;\n /** 12pt — Body text (PDF standard) */\n sm: number;\n /** 15pt — Large body, small headings */\n base: number;\n /** 18pt — H4 equivalent */\n lg: number;\n /** 22pt — H3 equivalent */\n xl: number;\n /** 28pt — H2 equivalent */\n \"2xl\": number;\n /** 36pt — H1 equivalent */\n \"3xl\": number;\n}\n\n/** Spacing scale based on a 4pt grid system */\nexport interface SpacingScale {\n /** 0pt */\n 0: number;\n /** 2pt */\n 0.5: number;\n /** 4pt */\n 1: number;\n /** 8pt */\n 2: number;\n /** 12pt */\n 3: number;\n /** 16pt */\n 4: number;\n /** 20pt */\n 5: number;\n /** 24pt */\n 6: number;\n /** 32pt */\n 8: number;\n /** 40pt */\n 10: number;\n /** 48pt */\n 12: number;\n /** 64pt */\n 16: number;\n}\n\n/** Font weight scale */\nexport interface FontWeights {\n regular: number;\n medium: number;\n semibold: number;\n bold: number;\n}\n\n/** Line height scale */\nexport interface LineHeights {\n /** 1.2 — Tight, for headings */\n tight: number;\n /** 1.4 — Normal, for body text */\n normal: number;\n /** 1.6 — Relaxed, for reading-heavy content */\n relaxed: number;\n}\n\n/** Border radius scale for rounded corners */\nexport interface BorderRadiusScale {\n /** 0pt — Sharp corners */\n none: number;\n /** 2pt — Subtle rounding */\n sm: number;\n /** 4pt — Standard rounding */\n md: number;\n /** 8pt — Pronounced rounding */\n lg: number;\n /** 9999pt — Pill/circle shape */\n full: number;\n}\n\n/** Letter spacing scale for typography adjustments */\nexport interface LetterSpacingScale {\n /** -0.025em — Tighter spacing */\n tight: number;\n /** 0em — Normal spacing */\n normal: number;\n /** 0.025em — Slightly wider spacing */\n wide: number;\n /** 0.05em — Much wider spacing (for uppercase) */\n wider: number;\n}\n\n/** Raw design scales shared across themes */\nexport interface PrimitiveTokens {\n typography: TypographyScale;\n spacing: SpacingScale;\n fontWeights: FontWeights;\n lineHeights: LineHeights;\n borderRadius: BorderRadiusScale;\n letterSpacing: LetterSpacingScale;\n}\n\n// ─── Semantic Tokens ────────────────────────────────────────────────────────\n// These map primitives to design intent. Themes differ primarily here.\n\n/**\n * Semantic color tokens using the foreground/background pair convention.\n * All values must be hex strings (e.g., '#1a1a1a').\n * react-pdf supports hex, rgb(), and hsl() — but NOT oklch.\n */\nexport interface ColorTokens {\n /** Primary text and content color */\n foreground: string;\n /** Page background color */\n background: string;\n /** Subtle background for secondary areas (e.g., code blocks, table headers) */\n muted: string;\n /** Text on muted backgrounds (captions, footnotes, timestamps) */\n mutedForeground: string;\n /** Brand/accent color for emphasis and highlights */\n primary: string;\n /** Text on primary-colored backgrounds */\n primaryForeground: string;\n /** Table borders, dividers, rules */\n border: string;\n /** Secondary accent for call-to-action elements, badges */\n accent: string;\n /** Error text, warning indicators */\n destructive: string;\n /** Success states (e.g., badges, confirmations) */\n success: string;\n /** Warning states (e.g., badges, alerts) */\n warning: string;\n /** Info states (e.g., badges, informational alerts) */\n info: string;\n}\n\n/** Typography semantic tokens — what fonts and sizes to use where */\nexport interface TypographyTokens {\n /** Body text settings */\n body: {\n /** Font family for body text (e.g., 'Helvetica') */\n fontFamily: string;\n /** Base font size in points */\n fontSize: number;\n /** Line height multiplier */\n lineHeight: number;\n };\n /** Heading text settings */\n heading: {\n /** Font family for headings (e.g., 'Times-Roman', 'Courier') */\n fontFamily: string;\n /** Font weight as numeric value (400-700) */\n fontWeight: number;\n /** Line height multiplier for headings */\n lineHeight: number;\n /** Font sizes for each heading level in points */\n fontSize: {\n h1: number;\n h2: number;\n h3: number;\n h4: number;\n h5: number;\n h6: number;\n };\n };\n}\n\n/** Spacing semantic tokens — consistent spacing across the document */\nexport interface SpacingTokens {\n /** Page margin settings in points */\n page: {\n marginTop: number;\n marginRight: number;\n marginBottom: number;\n marginLeft: number;\n };\n /** Space between major document sections (after h2, before new sections) */\n sectionGap: number;\n /** Space between paragraphs and after text blocks */\n paragraphGap: number;\n /** Space between inline components, list items, table rows */\n componentGap: number;\n}\n\n/** Page layout defaults */\nexport interface PageTokens {\n /** Default page size */\n size: \"A4\" | \"LETTER\" | \"LEGAL\";\n /** Default page orientation */\n orientation: \"portrait\" | \"landscape\";\n}\n\n// ─── Full Theme ─────────────────────────────────────────────────────────────\n\n/**\n * The complete pdfcn theme object.\n *\n * Components import this and use its tokens for all style values.\n * Since React Context doesn't work in @react-pdf/renderer,\n * the theme is a plain TypeScript object imported directly by components.\n *\n * @example\n * ```tsx\n * // In a component:\n * import { theme } from '../lib/pdfx-theme';\n *\n * function createStyles(t: PdfcnTheme) {\n * return StyleSheet.create({\n * text: {\n * fontFamily: t.typography.body.fontFamily,\n * fontSize: t.typography.body.fontSize,\n * color: t.colors.foreground,\n * },\n * });\n * }\n *\n * const styles = createStyles(theme);\n * ```\n */\nexport interface PdfcnTheme {\n /** Theme name identifier */\n name: string;\n /** Raw design scales */\n primitives: PrimitiveTokens;\n /** Semantic color mappings */\n colors: ColorTokens;\n /** Typography settings for body and headings */\n typography: TypographyTokens;\n /** Spacing settings for page, sections, and components */\n spacing: SpacingTokens;\n /** Page layout defaults */\n page: PageTokens;\n}\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "content": "import { professionalTheme } from \"@/registry/themes\";\n\nexport const theme = professionalTheme;\n",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "type": "registry:theme"
+}
\ No newline at end of file
diff --git a/public/r/forme/theme-forest.json b/public/r/forme/theme-forest.json
new file mode 100644
index 0000000..28dfaec
--- /dev/null
+++ b/public/r/forme/theme-forest.json
@@ -0,0 +1,37 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/theme-forest",
+ "title": "Forest Theme (forme)",
+ "description": "forest theme tokens for forme",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "files": [
+ {
+ "path": "registry/themes/forest.ts",
+ "content": "import { defaultPrimitives } from \"./primitives\";\nimport type { PdfcnTheme } from \"./theme-types\";\n\n/**\n * Forest theme preset.\n *\n * Character: Natural deep greens, Merriweather headings for gravitas, Inter\n * body for readability. Earthy and trustworthy.\n * Ideal for sustainability reports, environmental docs, and wellness brands.\n */\nexport const forestTheme: PdfcnTheme = {\n colors: {\n accent: \"#16a34a\",\n background: \"#ffffff\",\n border: \"#bbf7d0\",\n destructive: \"#dc2626\",\n foreground: \"#14532d\",\n info: \"#0ea5e9\",\n muted: \"#f0fdf4\",\n mutedForeground: \"#4d7c5f\",\n primary: \"#15803d\",\n primaryForeground: \"#ffffff\",\n success: \"#15803d\",\n warning: \"#d97706\",\n },\n name: \"forest\",\n page: {\n orientation: \"portrait\",\n size: \"A4\",\n },\n primitives: defaultPrimitives,\n spacing: {\n componentGap: 14,\n page: {\n marginBottom: 56,\n marginLeft: 48,\n marginRight: 48,\n marginTop: 56,\n },\n paragraphGap: 10,\n sectionGap: 28,\n },\n typography: {\n body: {\n fontFamily: \"Inter\",\n fontSize: 11,\n lineHeight: 1.6,\n },\n heading: {\n fontFamily: \"Merriweather\",\n fontSize: {\n h1: 32,\n h2: 24,\n h3: 19,\n h4: 15,\n h5: 13,\n h6: 11,\n },\n fontWeight: 700,\n lineHeight: 1.25,\n },\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-forest.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "content": "import type { PrimitiveTokens } from \"./theme-types\";\n\n/**\n * Default primitive tokens shared by all theme presets.\n *\n * These define the raw design scales — the \"palette\" of values available.\n * Themes select from these scales when assigning semantic tokens.\n *\n * - Typography: Major Third (1.25) ratio, 12pt base\n * - Spacing: 4pt grid system\n * - Font weights: 400–700\n * - Line heights: 1.2–1.6\n * - Border radius: 0–8pt (plus full for pills)\n * - Letter spacing: -0.025 to 0.05 (em-like ratios for PDF points)\n */\nexport const defaultPrimitives: PrimitiveTokens = {\n borderRadius: {\n full: 9999,\n lg: 8,\n md: 4,\n none: 0,\n sm: 2,\n },\n fontWeights: {\n bold: 700,\n medium: 500,\n regular: 400,\n semibold: 600,\n },\n letterSpacing: {\n normal: 0,\n tight: -0.025,\n wide: 0.025,\n wider: 0.05,\n },\n lineHeights: {\n normal: 1.4,\n relaxed: 1.6,\n tight: 1.2,\n },\n spacing: {\n 0: 0,\n 0.5: 2,\n 1: 4,\n 10: 40,\n 12: 48,\n 16: 64,\n 2: 8,\n 3: 12,\n 4: 16,\n 5: 20,\n 6: 24,\n 8: 32,\n },\n typography: {\n \"2xl\": 28,\n \"3xl\": 36,\n base: 15,\n lg: 18,\n sm: 12,\n xl: 22,\n xs: 10,\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "content": "/**\n * pdfcn Theme System — Type Definitions\n *\n * Defines the complete type hierarchy for the pdfcn PDF theme system.\n * All PDF components consume these tokens instead of hardcoding style values.\n *\n * Architecture:\n * - PrimitiveTokens: Raw design scales (typography, spacing, weights, line heights)\n * - ColorTokens: Semantic color mappings (foreground/background pairs)\n * - TypographyTokens: Font family, size, weight, and line height decisions\n * - SpacingTokens: Page margins, section/paragraph/component gaps\n * - PageTokens: Default page size and orientation\n * - PdfcnTheme: The complete theme object combining all token layers\n *\n * @example\n * ```ts\n * import type { PdfcnTheme } from '@/registry/themes';\n *\n * const myTheme: PdfcnTheme = {\n * name: 'custom',\n * primitives: { ... },\n * colors: { foreground: '#1a1a1a', ... },\n * typography: { body: { ... }, heading: { ... } },\n * spacing: { page: { ... }, sectionGap: 24, ... },\n * page: { size: 'A4', orientation: 'portrait' },\n * };\n * ```\n */\n\n// ─── Primitive Tokens ───────────────────────────────────────────────────────\n// Raw design scales. These define WHAT values are available.\n// Themes choose from these when populating semantic tokens.\n\n/** Typography scale using a Major Third (1.25) ratio with 12pt base */\nexport interface TypographyScale {\n /** 10pt — Captions, footnotes */\n xs: number;\n /** 12pt — Body text (PDF standard) */\n sm: number;\n /** 15pt — Large body, small headings */\n base: number;\n /** 18pt — H4 equivalent */\n lg: number;\n /** 22pt — H3 equivalent */\n xl: number;\n /** 28pt — H2 equivalent */\n \"2xl\": number;\n /** 36pt — H1 equivalent */\n \"3xl\": number;\n}\n\n/** Spacing scale based on a 4pt grid system */\nexport interface SpacingScale {\n /** 0pt */\n 0: number;\n /** 2pt */\n 0.5: number;\n /** 4pt */\n 1: number;\n /** 8pt */\n 2: number;\n /** 12pt */\n 3: number;\n /** 16pt */\n 4: number;\n /** 20pt */\n 5: number;\n /** 24pt */\n 6: number;\n /** 32pt */\n 8: number;\n /** 40pt */\n 10: number;\n /** 48pt */\n 12: number;\n /** 64pt */\n 16: number;\n}\n\n/** Font weight scale */\nexport interface FontWeights {\n regular: number;\n medium: number;\n semibold: number;\n bold: number;\n}\n\n/** Line height scale */\nexport interface LineHeights {\n /** 1.2 — Tight, for headings */\n tight: number;\n /** 1.4 — Normal, for body text */\n normal: number;\n /** 1.6 — Relaxed, for reading-heavy content */\n relaxed: number;\n}\n\n/** Border radius scale for rounded corners */\nexport interface BorderRadiusScale {\n /** 0pt — Sharp corners */\n none: number;\n /** 2pt — Subtle rounding */\n sm: number;\n /** 4pt — Standard rounding */\n md: number;\n /** 8pt — Pronounced rounding */\n lg: number;\n /** 9999pt — Pill/circle shape */\n full: number;\n}\n\n/** Letter spacing scale for typography adjustments */\nexport interface LetterSpacingScale {\n /** -0.025em — Tighter spacing */\n tight: number;\n /** 0em — Normal spacing */\n normal: number;\n /** 0.025em — Slightly wider spacing */\n wide: number;\n /** 0.05em — Much wider spacing (for uppercase) */\n wider: number;\n}\n\n/** Raw design scales shared across themes */\nexport interface PrimitiveTokens {\n typography: TypographyScale;\n spacing: SpacingScale;\n fontWeights: FontWeights;\n lineHeights: LineHeights;\n borderRadius: BorderRadiusScale;\n letterSpacing: LetterSpacingScale;\n}\n\n// ─── Semantic Tokens ────────────────────────────────────────────────────────\n// These map primitives to design intent. Themes differ primarily here.\n\n/**\n * Semantic color tokens using the foreground/background pair convention.\n * All values must be hex strings (e.g., '#1a1a1a').\n * react-pdf supports hex, rgb(), and hsl() — but NOT oklch.\n */\nexport interface ColorTokens {\n /** Primary text and content color */\n foreground: string;\n /** Page background color */\n background: string;\n /** Subtle background for secondary areas (e.g., code blocks, table headers) */\n muted: string;\n /** Text on muted backgrounds (captions, footnotes, timestamps) */\n mutedForeground: string;\n /** Brand/accent color for emphasis and highlights */\n primary: string;\n /** Text on primary-colored backgrounds */\n primaryForeground: string;\n /** Table borders, dividers, rules */\n border: string;\n /** Secondary accent for call-to-action elements, badges */\n accent: string;\n /** Error text, warning indicators */\n destructive: string;\n /** Success states (e.g., badges, confirmations) */\n success: string;\n /** Warning states (e.g., badges, alerts) */\n warning: string;\n /** Info states (e.g., badges, informational alerts) */\n info: string;\n}\n\n/** Typography semantic tokens — what fonts and sizes to use where */\nexport interface TypographyTokens {\n /** Body text settings */\n body: {\n /** Font family for body text (e.g., 'Helvetica') */\n fontFamily: string;\n /** Base font size in points */\n fontSize: number;\n /** Line height multiplier */\n lineHeight: number;\n };\n /** Heading text settings */\n heading: {\n /** Font family for headings (e.g., 'Times-Roman', 'Courier') */\n fontFamily: string;\n /** Font weight as numeric value (400-700) */\n fontWeight: number;\n /** Line height multiplier for headings */\n lineHeight: number;\n /** Font sizes for each heading level in points */\n fontSize: {\n h1: number;\n h2: number;\n h3: number;\n h4: number;\n h5: number;\n h6: number;\n };\n };\n}\n\n/** Spacing semantic tokens — consistent spacing across the document */\nexport interface SpacingTokens {\n /** Page margin settings in points */\n page: {\n marginTop: number;\n marginRight: number;\n marginBottom: number;\n marginLeft: number;\n };\n /** Space between major document sections (after h2, before new sections) */\n sectionGap: number;\n /** Space between paragraphs and after text blocks */\n paragraphGap: number;\n /** Space between inline components, list items, table rows */\n componentGap: number;\n}\n\n/** Page layout defaults */\nexport interface PageTokens {\n /** Default page size */\n size: \"A4\" | \"LETTER\" | \"LEGAL\";\n /** Default page orientation */\n orientation: \"portrait\" | \"landscape\";\n}\n\n// ─── Full Theme ─────────────────────────────────────────────────────────────\n\n/**\n * The complete pdfcn theme object.\n *\n * Components import this and use its tokens for all style values.\n * Since React Context doesn't work in @react-pdf/renderer,\n * the theme is a plain TypeScript object imported directly by components.\n *\n * @example\n * ```tsx\n * // In a component:\n * import { theme } from '../lib/pdfx-theme';\n *\n * function createStyles(t: PdfcnTheme) {\n * return StyleSheet.create({\n * text: {\n * fontFamily: t.typography.body.fontFamily,\n * fontSize: t.typography.body.fontSize,\n * color: t.colors.foreground,\n * },\n * });\n * }\n *\n * const styles = createStyles(theme);\n * ```\n */\nexport interface PdfcnTheme {\n /** Theme name identifier */\n name: string;\n /** Raw design scales */\n primitives: PrimitiveTokens;\n /** Semantic color mappings */\n colors: ColorTokens;\n /** Typography settings for body and headings */\n typography: TypographyTokens;\n /** Spacing settings for page, sections, and components */\n spacing: SpacingTokens;\n /** Page layout defaults */\n page: PageTokens;\n}\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "content": "import { professionalTheme } from \"@/registry/themes\";\n\nexport const theme = professionalTheme;\n",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "type": "registry:theme"
+}
\ No newline at end of file
diff --git a/public/r/forme/theme-minimal.json b/public/r/forme/theme-minimal.json
new file mode 100644
index 0000000..b735d67
--- /dev/null
+++ b/public/r/forme/theme-minimal.json
@@ -0,0 +1,37 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/theme-minimal",
+ "title": "Minimal Theme (forme)",
+ "description": "minimal theme tokens for forme",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "files": [
+ {
+ "path": "registry/themes/minimal.ts",
+ "content": "import { defaultPrimitives } from \"./primitives\";\nimport type { PdfcnTheme } from \"./theme-types\";\n\n/**\n * Minimal theme preset.\n *\n * Character: Courier headings, zinc neutrals, maximum whitespace.\n * shadcn-inspired restrained palette. Ideal for clean documentation,\n * technical specs, and literary manuscripts.\n */\nexport const minimalTheme: PdfcnTheme = {\n colors: {\n accent: \"#71717a\",\n background: \"#ffffff\",\n border: \"#e4e4e7\",\n destructive: \"#b91c1c\",\n foreground: \"#18181b\",\n info: \"#0369a1\",\n muted: \"#fafafa\",\n mutedForeground: \"#a1a1aa\",\n primary: \"#18181b\",\n primaryForeground: \"#ffffff\",\n success: \"#15803d\",\n warning: \"#a16207\",\n },\n name: \"minimal\",\n page: {\n orientation: \"portrait\",\n size: \"A4\",\n },\n primitives: defaultPrimitives,\n spacing: {\n componentGap: 18,\n page: {\n marginBottom: 72,\n marginLeft: 56,\n marginRight: 56,\n marginTop: 72,\n },\n paragraphGap: 14,\n sectionGap: 36,\n },\n typography: {\n body: {\n fontFamily: \"Helvetica\",\n fontSize: 11,\n lineHeight: 1.65,\n },\n heading: {\n fontFamily: \"Courier\",\n fontSize: {\n h1: 24,\n h2: 20,\n h3: 16,\n h4: 14,\n h5: 12,\n h6: 10,\n },\n fontWeight: 600,\n lineHeight: 1.25,\n },\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-minimal.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "content": "import type { PrimitiveTokens } from \"./theme-types\";\n\n/**\n * Default primitive tokens shared by all theme presets.\n *\n * These define the raw design scales — the \"palette\" of values available.\n * Themes select from these scales when assigning semantic tokens.\n *\n * - Typography: Major Third (1.25) ratio, 12pt base\n * - Spacing: 4pt grid system\n * - Font weights: 400–700\n * - Line heights: 1.2–1.6\n * - Border radius: 0–8pt (plus full for pills)\n * - Letter spacing: -0.025 to 0.05 (em-like ratios for PDF points)\n */\nexport const defaultPrimitives: PrimitiveTokens = {\n borderRadius: {\n full: 9999,\n lg: 8,\n md: 4,\n none: 0,\n sm: 2,\n },\n fontWeights: {\n bold: 700,\n medium: 500,\n regular: 400,\n semibold: 600,\n },\n letterSpacing: {\n normal: 0,\n tight: -0.025,\n wide: 0.025,\n wider: 0.05,\n },\n lineHeights: {\n normal: 1.4,\n relaxed: 1.6,\n tight: 1.2,\n },\n spacing: {\n 0: 0,\n 0.5: 2,\n 1: 4,\n 10: 40,\n 12: 48,\n 16: 64,\n 2: 8,\n 3: 12,\n 4: 16,\n 5: 20,\n 6: 24,\n 8: 32,\n },\n typography: {\n \"2xl\": 28,\n \"3xl\": 36,\n base: 15,\n lg: 18,\n sm: 12,\n xl: 22,\n xs: 10,\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "content": "/**\n * pdfcn Theme System — Type Definitions\n *\n * Defines the complete type hierarchy for the pdfcn PDF theme system.\n * All PDF components consume these tokens instead of hardcoding style values.\n *\n * Architecture:\n * - PrimitiveTokens: Raw design scales (typography, spacing, weights, line heights)\n * - ColorTokens: Semantic color mappings (foreground/background pairs)\n * - TypographyTokens: Font family, size, weight, and line height decisions\n * - SpacingTokens: Page margins, section/paragraph/component gaps\n * - PageTokens: Default page size and orientation\n * - PdfcnTheme: The complete theme object combining all token layers\n *\n * @example\n * ```ts\n * import type { PdfcnTheme } from '@/registry/themes';\n *\n * const myTheme: PdfcnTheme = {\n * name: 'custom',\n * primitives: { ... },\n * colors: { foreground: '#1a1a1a', ... },\n * typography: { body: { ... }, heading: { ... } },\n * spacing: { page: { ... }, sectionGap: 24, ... },\n * page: { size: 'A4', orientation: 'portrait' },\n * };\n * ```\n */\n\n// ─── Primitive Tokens ───────────────────────────────────────────────────────\n// Raw design scales. These define WHAT values are available.\n// Themes choose from these when populating semantic tokens.\n\n/** Typography scale using a Major Third (1.25) ratio with 12pt base */\nexport interface TypographyScale {\n /** 10pt — Captions, footnotes */\n xs: number;\n /** 12pt — Body text (PDF standard) */\n sm: number;\n /** 15pt — Large body, small headings */\n base: number;\n /** 18pt — H4 equivalent */\n lg: number;\n /** 22pt — H3 equivalent */\n xl: number;\n /** 28pt — H2 equivalent */\n \"2xl\": number;\n /** 36pt — H1 equivalent */\n \"3xl\": number;\n}\n\n/** Spacing scale based on a 4pt grid system */\nexport interface SpacingScale {\n /** 0pt */\n 0: number;\n /** 2pt */\n 0.5: number;\n /** 4pt */\n 1: number;\n /** 8pt */\n 2: number;\n /** 12pt */\n 3: number;\n /** 16pt */\n 4: number;\n /** 20pt */\n 5: number;\n /** 24pt */\n 6: number;\n /** 32pt */\n 8: number;\n /** 40pt */\n 10: number;\n /** 48pt */\n 12: number;\n /** 64pt */\n 16: number;\n}\n\n/** Font weight scale */\nexport interface FontWeights {\n regular: number;\n medium: number;\n semibold: number;\n bold: number;\n}\n\n/** Line height scale */\nexport interface LineHeights {\n /** 1.2 — Tight, for headings */\n tight: number;\n /** 1.4 — Normal, for body text */\n normal: number;\n /** 1.6 — Relaxed, for reading-heavy content */\n relaxed: number;\n}\n\n/** Border radius scale for rounded corners */\nexport interface BorderRadiusScale {\n /** 0pt — Sharp corners */\n none: number;\n /** 2pt — Subtle rounding */\n sm: number;\n /** 4pt — Standard rounding */\n md: number;\n /** 8pt — Pronounced rounding */\n lg: number;\n /** 9999pt — Pill/circle shape */\n full: number;\n}\n\n/** Letter spacing scale for typography adjustments */\nexport interface LetterSpacingScale {\n /** -0.025em — Tighter spacing */\n tight: number;\n /** 0em — Normal spacing */\n normal: number;\n /** 0.025em — Slightly wider spacing */\n wide: number;\n /** 0.05em — Much wider spacing (for uppercase) */\n wider: number;\n}\n\n/** Raw design scales shared across themes */\nexport interface PrimitiveTokens {\n typography: TypographyScale;\n spacing: SpacingScale;\n fontWeights: FontWeights;\n lineHeights: LineHeights;\n borderRadius: BorderRadiusScale;\n letterSpacing: LetterSpacingScale;\n}\n\n// ─── Semantic Tokens ────────────────────────────────────────────────────────\n// These map primitives to design intent. Themes differ primarily here.\n\n/**\n * Semantic color tokens using the foreground/background pair convention.\n * All values must be hex strings (e.g., '#1a1a1a').\n * react-pdf supports hex, rgb(), and hsl() — but NOT oklch.\n */\nexport interface ColorTokens {\n /** Primary text and content color */\n foreground: string;\n /** Page background color */\n background: string;\n /** Subtle background for secondary areas (e.g., code blocks, table headers) */\n muted: string;\n /** Text on muted backgrounds (captions, footnotes, timestamps) */\n mutedForeground: string;\n /** Brand/accent color for emphasis and highlights */\n primary: string;\n /** Text on primary-colored backgrounds */\n primaryForeground: string;\n /** Table borders, dividers, rules */\n border: string;\n /** Secondary accent for call-to-action elements, badges */\n accent: string;\n /** Error text, warning indicators */\n destructive: string;\n /** Success states (e.g., badges, confirmations) */\n success: string;\n /** Warning states (e.g., badges, alerts) */\n warning: string;\n /** Info states (e.g., badges, informational alerts) */\n info: string;\n}\n\n/** Typography semantic tokens — what fonts and sizes to use where */\nexport interface TypographyTokens {\n /** Body text settings */\n body: {\n /** Font family for body text (e.g., 'Helvetica') */\n fontFamily: string;\n /** Base font size in points */\n fontSize: number;\n /** Line height multiplier */\n lineHeight: number;\n };\n /** Heading text settings */\n heading: {\n /** Font family for headings (e.g., 'Times-Roman', 'Courier') */\n fontFamily: string;\n /** Font weight as numeric value (400-700) */\n fontWeight: number;\n /** Line height multiplier for headings */\n lineHeight: number;\n /** Font sizes for each heading level in points */\n fontSize: {\n h1: number;\n h2: number;\n h3: number;\n h4: number;\n h5: number;\n h6: number;\n };\n };\n}\n\n/** Spacing semantic tokens — consistent spacing across the document */\nexport interface SpacingTokens {\n /** Page margin settings in points */\n page: {\n marginTop: number;\n marginRight: number;\n marginBottom: number;\n marginLeft: number;\n };\n /** Space between major document sections (after h2, before new sections) */\n sectionGap: number;\n /** Space between paragraphs and after text blocks */\n paragraphGap: number;\n /** Space between inline components, list items, table rows */\n componentGap: number;\n}\n\n/** Page layout defaults */\nexport interface PageTokens {\n /** Default page size */\n size: \"A4\" | \"LETTER\" | \"LEGAL\";\n /** Default page orientation */\n orientation: \"portrait\" | \"landscape\";\n}\n\n// ─── Full Theme ─────────────────────────────────────────────────────────────\n\n/**\n * The complete pdfcn theme object.\n *\n * Components import this and use its tokens for all style values.\n * Since React Context doesn't work in @react-pdf/renderer,\n * the theme is a plain TypeScript object imported directly by components.\n *\n * @example\n * ```tsx\n * // In a component:\n * import { theme } from '../lib/pdfx-theme';\n *\n * function createStyles(t: PdfcnTheme) {\n * return StyleSheet.create({\n * text: {\n * fontFamily: t.typography.body.fontFamily,\n * fontSize: t.typography.body.fontSize,\n * color: t.colors.foreground,\n * },\n * });\n * }\n *\n * const styles = createStyles(theme);\n * ```\n */\nexport interface PdfcnTheme {\n /** Theme name identifier */\n name: string;\n /** Raw design scales */\n primitives: PrimitiveTokens;\n /** Semantic color mappings */\n colors: ColorTokens;\n /** Typography settings for body and headings */\n typography: TypographyTokens;\n /** Spacing settings for page, sections, and components */\n spacing: SpacingTokens;\n /** Page layout defaults */\n page: PageTokens;\n}\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "content": "import { professionalTheme } from \"@/registry/themes\";\n\nexport const theme = professionalTheme;\n",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "type": "registry:theme"
+}
\ No newline at end of file
diff --git a/public/r/forme/theme-modern.json b/public/r/forme/theme-modern.json
new file mode 100644
index 0000000..53a311a
--- /dev/null
+++ b/public/r/forme/theme-modern.json
@@ -0,0 +1,37 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/theme-modern",
+ "title": "Modern Theme (forme)",
+ "description": "modern theme tokens for forme",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "files": [
+ {
+ "path": "registry/themes/modern.ts",
+ "content": "import { defaultPrimitives } from \"./primitives\";\nimport type { PdfcnTheme } from \"./theme-types\";\n\n/**\n * Modern theme preset.\n *\n * Character: All-Helvetica, slate-cool neutrals with subtle violet accent,\n * clean spacing. shadcn-inspired contemporary feel.\n * Ideal for startups, tech companies, and design-forward documents.\n */\nexport const modernTheme: PdfcnTheme = {\n colors: {\n accent: \"#6366f1\",\n background: \"#ffffff\",\n border: \"#e2e8f0\",\n destructive: \"#ef4444\",\n foreground: \"#0f172a\",\n info: \"#3b82f6\",\n muted: \"#f1f5f9\",\n mutedForeground: \"#64748b\",\n primary: \"#334155\",\n primaryForeground: \"#ffffff\",\n success: \"#22c55e\",\n warning: \"#f59e0b\",\n },\n name: \"modern\",\n page: {\n orientation: \"portrait\",\n size: \"A4\",\n },\n primitives: defaultPrimitives,\n spacing: {\n componentGap: 12,\n page: {\n marginBottom: 40,\n marginLeft: 40,\n marginRight: 40,\n marginTop: 40,\n },\n paragraphGap: 10,\n sectionGap: 24,\n },\n typography: {\n body: {\n fontFamily: \"Helvetica\",\n fontSize: 11,\n lineHeight: 1.6,\n },\n heading: {\n fontFamily: \"Helvetica\",\n fontSize: {\n h1: 28,\n h2: 22,\n h3: 18,\n h4: 16,\n h5: 14,\n h6: 12,\n },\n fontWeight: 600,\n lineHeight: 1.25,\n },\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-modern.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "content": "import type { PrimitiveTokens } from \"./theme-types\";\n\n/**\n * Default primitive tokens shared by all theme presets.\n *\n * These define the raw design scales — the \"palette\" of values available.\n * Themes select from these scales when assigning semantic tokens.\n *\n * - Typography: Major Third (1.25) ratio, 12pt base\n * - Spacing: 4pt grid system\n * - Font weights: 400–700\n * - Line heights: 1.2–1.6\n * - Border radius: 0–8pt (plus full for pills)\n * - Letter spacing: -0.025 to 0.05 (em-like ratios for PDF points)\n */\nexport const defaultPrimitives: PrimitiveTokens = {\n borderRadius: {\n full: 9999,\n lg: 8,\n md: 4,\n none: 0,\n sm: 2,\n },\n fontWeights: {\n bold: 700,\n medium: 500,\n regular: 400,\n semibold: 600,\n },\n letterSpacing: {\n normal: 0,\n tight: -0.025,\n wide: 0.025,\n wider: 0.05,\n },\n lineHeights: {\n normal: 1.4,\n relaxed: 1.6,\n tight: 1.2,\n },\n spacing: {\n 0: 0,\n 0.5: 2,\n 1: 4,\n 10: 40,\n 12: 48,\n 16: 64,\n 2: 8,\n 3: 12,\n 4: 16,\n 5: 20,\n 6: 24,\n 8: 32,\n },\n typography: {\n \"2xl\": 28,\n \"3xl\": 36,\n base: 15,\n lg: 18,\n sm: 12,\n xl: 22,\n xs: 10,\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "content": "/**\n * pdfcn Theme System — Type Definitions\n *\n * Defines the complete type hierarchy for the pdfcn PDF theme system.\n * All PDF components consume these tokens instead of hardcoding style values.\n *\n * Architecture:\n * - PrimitiveTokens: Raw design scales (typography, spacing, weights, line heights)\n * - ColorTokens: Semantic color mappings (foreground/background pairs)\n * - TypographyTokens: Font family, size, weight, and line height decisions\n * - SpacingTokens: Page margins, section/paragraph/component gaps\n * - PageTokens: Default page size and orientation\n * - PdfcnTheme: The complete theme object combining all token layers\n *\n * @example\n * ```ts\n * import type { PdfcnTheme } from '@/registry/themes';\n *\n * const myTheme: PdfcnTheme = {\n * name: 'custom',\n * primitives: { ... },\n * colors: { foreground: '#1a1a1a', ... },\n * typography: { body: { ... }, heading: { ... } },\n * spacing: { page: { ... }, sectionGap: 24, ... },\n * page: { size: 'A4', orientation: 'portrait' },\n * };\n * ```\n */\n\n// ─── Primitive Tokens ───────────────────────────────────────────────────────\n// Raw design scales. These define WHAT values are available.\n// Themes choose from these when populating semantic tokens.\n\n/** Typography scale using a Major Third (1.25) ratio with 12pt base */\nexport interface TypographyScale {\n /** 10pt — Captions, footnotes */\n xs: number;\n /** 12pt — Body text (PDF standard) */\n sm: number;\n /** 15pt — Large body, small headings */\n base: number;\n /** 18pt — H4 equivalent */\n lg: number;\n /** 22pt — H3 equivalent */\n xl: number;\n /** 28pt — H2 equivalent */\n \"2xl\": number;\n /** 36pt — H1 equivalent */\n \"3xl\": number;\n}\n\n/** Spacing scale based on a 4pt grid system */\nexport interface SpacingScale {\n /** 0pt */\n 0: number;\n /** 2pt */\n 0.5: number;\n /** 4pt */\n 1: number;\n /** 8pt */\n 2: number;\n /** 12pt */\n 3: number;\n /** 16pt */\n 4: number;\n /** 20pt */\n 5: number;\n /** 24pt */\n 6: number;\n /** 32pt */\n 8: number;\n /** 40pt */\n 10: number;\n /** 48pt */\n 12: number;\n /** 64pt */\n 16: number;\n}\n\n/** Font weight scale */\nexport interface FontWeights {\n regular: number;\n medium: number;\n semibold: number;\n bold: number;\n}\n\n/** Line height scale */\nexport interface LineHeights {\n /** 1.2 — Tight, for headings */\n tight: number;\n /** 1.4 — Normal, for body text */\n normal: number;\n /** 1.6 — Relaxed, for reading-heavy content */\n relaxed: number;\n}\n\n/** Border radius scale for rounded corners */\nexport interface BorderRadiusScale {\n /** 0pt — Sharp corners */\n none: number;\n /** 2pt — Subtle rounding */\n sm: number;\n /** 4pt — Standard rounding */\n md: number;\n /** 8pt — Pronounced rounding */\n lg: number;\n /** 9999pt — Pill/circle shape */\n full: number;\n}\n\n/** Letter spacing scale for typography adjustments */\nexport interface LetterSpacingScale {\n /** -0.025em — Tighter spacing */\n tight: number;\n /** 0em — Normal spacing */\n normal: number;\n /** 0.025em — Slightly wider spacing */\n wide: number;\n /** 0.05em — Much wider spacing (for uppercase) */\n wider: number;\n}\n\n/** Raw design scales shared across themes */\nexport interface PrimitiveTokens {\n typography: TypographyScale;\n spacing: SpacingScale;\n fontWeights: FontWeights;\n lineHeights: LineHeights;\n borderRadius: BorderRadiusScale;\n letterSpacing: LetterSpacingScale;\n}\n\n// ─── Semantic Tokens ────────────────────────────────────────────────────────\n// These map primitives to design intent. Themes differ primarily here.\n\n/**\n * Semantic color tokens using the foreground/background pair convention.\n * All values must be hex strings (e.g., '#1a1a1a').\n * react-pdf supports hex, rgb(), and hsl() — but NOT oklch.\n */\nexport interface ColorTokens {\n /** Primary text and content color */\n foreground: string;\n /** Page background color */\n background: string;\n /** Subtle background for secondary areas (e.g., code blocks, table headers) */\n muted: string;\n /** Text on muted backgrounds (captions, footnotes, timestamps) */\n mutedForeground: string;\n /** Brand/accent color for emphasis and highlights */\n primary: string;\n /** Text on primary-colored backgrounds */\n primaryForeground: string;\n /** Table borders, dividers, rules */\n border: string;\n /** Secondary accent for call-to-action elements, badges */\n accent: string;\n /** Error text, warning indicators */\n destructive: string;\n /** Success states (e.g., badges, confirmations) */\n success: string;\n /** Warning states (e.g., badges, alerts) */\n warning: string;\n /** Info states (e.g., badges, informational alerts) */\n info: string;\n}\n\n/** Typography semantic tokens — what fonts and sizes to use where */\nexport interface TypographyTokens {\n /** Body text settings */\n body: {\n /** Font family for body text (e.g., 'Helvetica') */\n fontFamily: string;\n /** Base font size in points */\n fontSize: number;\n /** Line height multiplier */\n lineHeight: number;\n };\n /** Heading text settings */\n heading: {\n /** Font family for headings (e.g., 'Times-Roman', 'Courier') */\n fontFamily: string;\n /** Font weight as numeric value (400-700) */\n fontWeight: number;\n /** Line height multiplier for headings */\n lineHeight: number;\n /** Font sizes for each heading level in points */\n fontSize: {\n h1: number;\n h2: number;\n h3: number;\n h4: number;\n h5: number;\n h6: number;\n };\n };\n}\n\n/** Spacing semantic tokens — consistent spacing across the document */\nexport interface SpacingTokens {\n /** Page margin settings in points */\n page: {\n marginTop: number;\n marginRight: number;\n marginBottom: number;\n marginLeft: number;\n };\n /** Space between major document sections (after h2, before new sections) */\n sectionGap: number;\n /** Space between paragraphs and after text blocks */\n paragraphGap: number;\n /** Space between inline components, list items, table rows */\n componentGap: number;\n}\n\n/** Page layout defaults */\nexport interface PageTokens {\n /** Default page size */\n size: \"A4\" | \"LETTER\" | \"LEGAL\";\n /** Default page orientation */\n orientation: \"portrait\" | \"landscape\";\n}\n\n// ─── Full Theme ─────────────────────────────────────────────────────────────\n\n/**\n * The complete pdfcn theme object.\n *\n * Components import this and use its tokens for all style values.\n * Since React Context doesn't work in @react-pdf/renderer,\n * the theme is a plain TypeScript object imported directly by components.\n *\n * @example\n * ```tsx\n * // In a component:\n * import { theme } from '../lib/pdfx-theme';\n *\n * function createStyles(t: PdfcnTheme) {\n * return StyleSheet.create({\n * text: {\n * fontFamily: t.typography.body.fontFamily,\n * fontSize: t.typography.body.fontSize,\n * color: t.colors.foreground,\n * },\n * });\n * }\n *\n * const styles = createStyles(theme);\n * ```\n */\nexport interface PdfcnTheme {\n /** Theme name identifier */\n name: string;\n /** Raw design scales */\n primitives: PrimitiveTokens;\n /** Semantic color mappings */\n colors: ColorTokens;\n /** Typography settings for body and headings */\n typography: TypographyTokens;\n /** Spacing settings for page, sections, and components */\n spacing: SpacingTokens;\n /** Page layout defaults */\n page: PageTokens;\n}\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "content": "import { professionalTheme } from \"@/registry/themes\";\n\nexport const theme = professionalTheme;\n",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "type": "registry:theme"
+}
\ No newline at end of file
diff --git a/public/r/forme/theme-professional.json b/public/r/forme/theme-professional.json
new file mode 100644
index 0000000..1c924e7
--- /dev/null
+++ b/public/r/forme/theme-professional.json
@@ -0,0 +1,37 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/theme-professional",
+ "title": "Professional Theme (forme)",
+ "description": "professional theme tokens for forme",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "files": [
+ {
+ "path": "registry/themes/professional.ts",
+ "content": "import { defaultPrimitives } from \"./primitives\";\nimport type { PdfcnTheme } from \"./theme-types\";\n\n/**\n * Professional theme preset.\n *\n * Character: Serif headings (Times-Roman), refined zinc/slate palette,\n * generous margins, formal document feel. shadcn-inspired minimal aesthetic.\n * Ideal for business documents, reports, and official correspondence.\n */\nexport const professionalTheme: PdfcnTheme = {\n colors: {\n accent: \"#3b82f6\",\n background: \"#ffffff\",\n border: \"#e4e4e7\",\n destructive: \"#dc2626\",\n foreground: \"#18181b\",\n info: \"#0ea5e9\",\n muted: \"#f4f4f5\",\n mutedForeground: \"#71717a\",\n primary: \"#18181b\",\n primaryForeground: \"#ffffff\",\n success: \"#16a34a\",\n warning: \"#d97706\",\n },\n name: \"professional\",\n page: {\n orientation: \"portrait\",\n size: \"A4\",\n },\n primitives: defaultPrimitives,\n spacing: {\n componentGap: 14,\n page: {\n marginBottom: 56,\n marginLeft: 48,\n marginRight: 48,\n marginTop: 56,\n },\n paragraphGap: 10,\n sectionGap: 28,\n },\n typography: {\n body: {\n fontFamily: \"Helvetica\",\n fontSize: 11,\n lineHeight: 1.6,\n },\n heading: {\n fontFamily: \"Times-Roman\",\n fontSize: {\n h1: 32,\n h2: 24,\n h3: 20,\n h4: 16,\n h5: 14,\n h6: 12,\n },\n fontWeight: 700,\n lineHeight: 1.25,\n },\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-professional.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "content": "import type { PrimitiveTokens } from \"./theme-types\";\n\n/**\n * Default primitive tokens shared by all theme presets.\n *\n * These define the raw design scales — the \"palette\" of values available.\n * Themes select from these scales when assigning semantic tokens.\n *\n * - Typography: Major Third (1.25) ratio, 12pt base\n * - Spacing: 4pt grid system\n * - Font weights: 400–700\n * - Line heights: 1.2–1.6\n * - Border radius: 0–8pt (plus full for pills)\n * - Letter spacing: -0.025 to 0.05 (em-like ratios for PDF points)\n */\nexport const defaultPrimitives: PrimitiveTokens = {\n borderRadius: {\n full: 9999,\n lg: 8,\n md: 4,\n none: 0,\n sm: 2,\n },\n fontWeights: {\n bold: 700,\n medium: 500,\n regular: 400,\n semibold: 600,\n },\n letterSpacing: {\n normal: 0,\n tight: -0.025,\n wide: 0.025,\n wider: 0.05,\n },\n lineHeights: {\n normal: 1.4,\n relaxed: 1.6,\n tight: 1.2,\n },\n spacing: {\n 0: 0,\n 0.5: 2,\n 1: 4,\n 10: 40,\n 12: 48,\n 16: 64,\n 2: 8,\n 3: 12,\n 4: 16,\n 5: 20,\n 6: 24,\n 8: 32,\n },\n typography: {\n \"2xl\": 28,\n \"3xl\": 36,\n base: 15,\n lg: 18,\n sm: 12,\n xl: 22,\n xs: 10,\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "content": "/**\n * pdfcn Theme System — Type Definitions\n *\n * Defines the complete type hierarchy for the pdfcn PDF theme system.\n * All PDF components consume these tokens instead of hardcoding style values.\n *\n * Architecture:\n * - PrimitiveTokens: Raw design scales (typography, spacing, weights, line heights)\n * - ColorTokens: Semantic color mappings (foreground/background pairs)\n * - TypographyTokens: Font family, size, weight, and line height decisions\n * - SpacingTokens: Page margins, section/paragraph/component gaps\n * - PageTokens: Default page size and orientation\n * - PdfcnTheme: The complete theme object combining all token layers\n *\n * @example\n * ```ts\n * import type { PdfcnTheme } from '@/registry/themes';\n *\n * const myTheme: PdfcnTheme = {\n * name: 'custom',\n * primitives: { ... },\n * colors: { foreground: '#1a1a1a', ... },\n * typography: { body: { ... }, heading: { ... } },\n * spacing: { page: { ... }, sectionGap: 24, ... },\n * page: { size: 'A4', orientation: 'portrait' },\n * };\n * ```\n */\n\n// ─── Primitive Tokens ───────────────────────────────────────────────────────\n// Raw design scales. These define WHAT values are available.\n// Themes choose from these when populating semantic tokens.\n\n/** Typography scale using a Major Third (1.25) ratio with 12pt base */\nexport interface TypographyScale {\n /** 10pt — Captions, footnotes */\n xs: number;\n /** 12pt — Body text (PDF standard) */\n sm: number;\n /** 15pt — Large body, small headings */\n base: number;\n /** 18pt — H4 equivalent */\n lg: number;\n /** 22pt — H3 equivalent */\n xl: number;\n /** 28pt — H2 equivalent */\n \"2xl\": number;\n /** 36pt — H1 equivalent */\n \"3xl\": number;\n}\n\n/** Spacing scale based on a 4pt grid system */\nexport interface SpacingScale {\n /** 0pt */\n 0: number;\n /** 2pt */\n 0.5: number;\n /** 4pt */\n 1: number;\n /** 8pt */\n 2: number;\n /** 12pt */\n 3: number;\n /** 16pt */\n 4: number;\n /** 20pt */\n 5: number;\n /** 24pt */\n 6: number;\n /** 32pt */\n 8: number;\n /** 40pt */\n 10: number;\n /** 48pt */\n 12: number;\n /** 64pt */\n 16: number;\n}\n\n/** Font weight scale */\nexport interface FontWeights {\n regular: number;\n medium: number;\n semibold: number;\n bold: number;\n}\n\n/** Line height scale */\nexport interface LineHeights {\n /** 1.2 — Tight, for headings */\n tight: number;\n /** 1.4 — Normal, for body text */\n normal: number;\n /** 1.6 — Relaxed, for reading-heavy content */\n relaxed: number;\n}\n\n/** Border radius scale for rounded corners */\nexport interface BorderRadiusScale {\n /** 0pt — Sharp corners */\n none: number;\n /** 2pt — Subtle rounding */\n sm: number;\n /** 4pt — Standard rounding */\n md: number;\n /** 8pt — Pronounced rounding */\n lg: number;\n /** 9999pt — Pill/circle shape */\n full: number;\n}\n\n/** Letter spacing scale for typography adjustments */\nexport interface LetterSpacingScale {\n /** -0.025em — Tighter spacing */\n tight: number;\n /** 0em — Normal spacing */\n normal: number;\n /** 0.025em — Slightly wider spacing */\n wide: number;\n /** 0.05em — Much wider spacing (for uppercase) */\n wider: number;\n}\n\n/** Raw design scales shared across themes */\nexport interface PrimitiveTokens {\n typography: TypographyScale;\n spacing: SpacingScale;\n fontWeights: FontWeights;\n lineHeights: LineHeights;\n borderRadius: BorderRadiusScale;\n letterSpacing: LetterSpacingScale;\n}\n\n// ─── Semantic Tokens ────────────────────────────────────────────────────────\n// These map primitives to design intent. Themes differ primarily here.\n\n/**\n * Semantic color tokens using the foreground/background pair convention.\n * All values must be hex strings (e.g., '#1a1a1a').\n * react-pdf supports hex, rgb(), and hsl() — but NOT oklch.\n */\nexport interface ColorTokens {\n /** Primary text and content color */\n foreground: string;\n /** Page background color */\n background: string;\n /** Subtle background for secondary areas (e.g., code blocks, table headers) */\n muted: string;\n /** Text on muted backgrounds (captions, footnotes, timestamps) */\n mutedForeground: string;\n /** Brand/accent color for emphasis and highlights */\n primary: string;\n /** Text on primary-colored backgrounds */\n primaryForeground: string;\n /** Table borders, dividers, rules */\n border: string;\n /** Secondary accent for call-to-action elements, badges */\n accent: string;\n /** Error text, warning indicators */\n destructive: string;\n /** Success states (e.g., badges, confirmations) */\n success: string;\n /** Warning states (e.g., badges, alerts) */\n warning: string;\n /** Info states (e.g., badges, informational alerts) */\n info: string;\n}\n\n/** Typography semantic tokens — what fonts and sizes to use where */\nexport interface TypographyTokens {\n /** Body text settings */\n body: {\n /** Font family for body text (e.g., 'Helvetica') */\n fontFamily: string;\n /** Base font size in points */\n fontSize: number;\n /** Line height multiplier */\n lineHeight: number;\n };\n /** Heading text settings */\n heading: {\n /** Font family for headings (e.g., 'Times-Roman', 'Courier') */\n fontFamily: string;\n /** Font weight as numeric value (400-700) */\n fontWeight: number;\n /** Line height multiplier for headings */\n lineHeight: number;\n /** Font sizes for each heading level in points */\n fontSize: {\n h1: number;\n h2: number;\n h3: number;\n h4: number;\n h5: number;\n h6: number;\n };\n };\n}\n\n/** Spacing semantic tokens — consistent spacing across the document */\nexport interface SpacingTokens {\n /** Page margin settings in points */\n page: {\n marginTop: number;\n marginRight: number;\n marginBottom: number;\n marginLeft: number;\n };\n /** Space between major document sections (after h2, before new sections) */\n sectionGap: number;\n /** Space between paragraphs and after text blocks */\n paragraphGap: number;\n /** Space between inline components, list items, table rows */\n componentGap: number;\n}\n\n/** Page layout defaults */\nexport interface PageTokens {\n /** Default page size */\n size: \"A4\" | \"LETTER\" | \"LEGAL\";\n /** Default page orientation */\n orientation: \"portrait\" | \"landscape\";\n}\n\n// ─── Full Theme ─────────────────────────────────────────────────────────────\n\n/**\n * The complete pdfcn theme object.\n *\n * Components import this and use its tokens for all style values.\n * Since React Context doesn't work in @react-pdf/renderer,\n * the theme is a plain TypeScript object imported directly by components.\n *\n * @example\n * ```tsx\n * // In a component:\n * import { theme } from '../lib/pdfx-theme';\n *\n * function createStyles(t: PdfcnTheme) {\n * return StyleSheet.create({\n * text: {\n * fontFamily: t.typography.body.fontFamily,\n * fontSize: t.typography.body.fontSize,\n * color: t.colors.foreground,\n * },\n * });\n * }\n *\n * const styles = createStyles(theme);\n * ```\n */\nexport interface PdfcnTheme {\n /** Theme name identifier */\n name: string;\n /** Raw design scales */\n primitives: PrimitiveTokens;\n /** Semantic color mappings */\n colors: ColorTokens;\n /** Typography settings for body and headings */\n typography: TypographyTokens;\n /** Spacing settings for page, sections, and components */\n spacing: SpacingTokens;\n /** Page layout defaults */\n page: PageTokens;\n}\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "content": "import { professionalTheme } from \"@/registry/themes\";\n\nexport const theme = professionalTheme;\n",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "type": "registry:theme"
+}
\ No newline at end of file
diff --git a/public/r/forme/theme-vivid.json b/public/r/forme/theme-vivid.json
new file mode 100644
index 0000000..2698a52
--- /dev/null
+++ b/public/r/forme/theme-vivid.json
@@ -0,0 +1,37 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/theme-vivid",
+ "title": "Vivid Theme (forme)",
+ "description": "vivid theme tokens for forme",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "files": [
+ {
+ "path": "registry/themes/vivid.ts",
+ "content": "import { defaultPrimitives } from \"./primitives\";\nimport type { PdfcnTheme } from \"./theme-types\";\n\n/**\n * Vivid theme preset.\n *\n * Character: Deep violet/purple palette, Nunito rounded sans-serif, playful\n * but still professional. High-energy creative accent.\n * Ideal for creative agencies, startups, marketing decks, and pitch docs.\n */\nexport const vividTheme: PdfcnTheme = {\n colors: {\n accent: \"#8b5cf6\",\n background: \"#ffffff\",\n border: \"#ddd6fe\",\n destructive: \"#dc2626\",\n foreground: \"#1e1b4b\",\n info: \"#0ea5e9\",\n muted: \"#f5f3ff\",\n mutedForeground: \"#7c3aed\",\n primary: \"#6d28d9\",\n primaryForeground: \"#ffffff\",\n success: \"#16a34a\",\n warning: \"#d97706\",\n },\n name: \"vivid\",\n page: {\n orientation: \"portrait\",\n size: \"A4\",\n },\n primitives: defaultPrimitives,\n spacing: {\n componentGap: 14,\n page: {\n marginBottom: 48,\n marginLeft: 44,\n marginRight: 44,\n marginTop: 48,\n },\n paragraphGap: 10,\n sectionGap: 26,\n },\n typography: {\n body: {\n fontFamily: \"Nunito\",\n fontSize: 11,\n lineHeight: 1.6,\n },\n heading: {\n fontFamily: \"Nunito\",\n fontSize: {\n h1: 32,\n h2: 24,\n h3: 19,\n h4: 16,\n h5: 14,\n h6: 12,\n },\n fontWeight: 700,\n lineHeight: 1.2,\n },\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-vivid.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "content": "import type { PrimitiveTokens } from \"./theme-types\";\n\n/**\n * Default primitive tokens shared by all theme presets.\n *\n * These define the raw design scales — the \"palette\" of values available.\n * Themes select from these scales when assigning semantic tokens.\n *\n * - Typography: Major Third (1.25) ratio, 12pt base\n * - Spacing: 4pt grid system\n * - Font weights: 400–700\n * - Line heights: 1.2–1.6\n * - Border radius: 0–8pt (plus full for pills)\n * - Letter spacing: -0.025 to 0.05 (em-like ratios for PDF points)\n */\nexport const defaultPrimitives: PrimitiveTokens = {\n borderRadius: {\n full: 9999,\n lg: 8,\n md: 4,\n none: 0,\n sm: 2,\n },\n fontWeights: {\n bold: 700,\n medium: 500,\n regular: 400,\n semibold: 600,\n },\n letterSpacing: {\n normal: 0,\n tight: -0.025,\n wide: 0.025,\n wider: 0.05,\n },\n lineHeights: {\n normal: 1.4,\n relaxed: 1.6,\n tight: 1.2,\n },\n spacing: {\n 0: 0,\n 0.5: 2,\n 1: 4,\n 10: 40,\n 12: 48,\n 16: 64,\n 2: 8,\n 3: 12,\n 4: 16,\n 5: 20,\n 6: 24,\n 8: 32,\n },\n typography: {\n \"2xl\": 28,\n \"3xl\": 36,\n base: 15,\n lg: 18,\n sm: 12,\n xl: 22,\n xs: 10,\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "content": "/**\n * pdfcn Theme System — Type Definitions\n *\n * Defines the complete type hierarchy for the pdfcn PDF theme system.\n * All PDF components consume these tokens instead of hardcoding style values.\n *\n * Architecture:\n * - PrimitiveTokens: Raw design scales (typography, spacing, weights, line heights)\n * - ColorTokens: Semantic color mappings (foreground/background pairs)\n * - TypographyTokens: Font family, size, weight, and line height decisions\n * - SpacingTokens: Page margins, section/paragraph/component gaps\n * - PageTokens: Default page size and orientation\n * - PdfcnTheme: The complete theme object combining all token layers\n *\n * @example\n * ```ts\n * import type { PdfcnTheme } from '@/registry/themes';\n *\n * const myTheme: PdfcnTheme = {\n * name: 'custom',\n * primitives: { ... },\n * colors: { foreground: '#1a1a1a', ... },\n * typography: { body: { ... }, heading: { ... } },\n * spacing: { page: { ... }, sectionGap: 24, ... },\n * page: { size: 'A4', orientation: 'portrait' },\n * };\n * ```\n */\n\n// ─── Primitive Tokens ───────────────────────────────────────────────────────\n// Raw design scales. These define WHAT values are available.\n// Themes choose from these when populating semantic tokens.\n\n/** Typography scale using a Major Third (1.25) ratio with 12pt base */\nexport interface TypographyScale {\n /** 10pt — Captions, footnotes */\n xs: number;\n /** 12pt — Body text (PDF standard) */\n sm: number;\n /** 15pt — Large body, small headings */\n base: number;\n /** 18pt — H4 equivalent */\n lg: number;\n /** 22pt — H3 equivalent */\n xl: number;\n /** 28pt — H2 equivalent */\n \"2xl\": number;\n /** 36pt — H1 equivalent */\n \"3xl\": number;\n}\n\n/** Spacing scale based on a 4pt grid system */\nexport interface SpacingScale {\n /** 0pt */\n 0: number;\n /** 2pt */\n 0.5: number;\n /** 4pt */\n 1: number;\n /** 8pt */\n 2: number;\n /** 12pt */\n 3: number;\n /** 16pt */\n 4: number;\n /** 20pt */\n 5: number;\n /** 24pt */\n 6: number;\n /** 32pt */\n 8: number;\n /** 40pt */\n 10: number;\n /** 48pt */\n 12: number;\n /** 64pt */\n 16: number;\n}\n\n/** Font weight scale */\nexport interface FontWeights {\n regular: number;\n medium: number;\n semibold: number;\n bold: number;\n}\n\n/** Line height scale */\nexport interface LineHeights {\n /** 1.2 — Tight, for headings */\n tight: number;\n /** 1.4 — Normal, for body text */\n normal: number;\n /** 1.6 — Relaxed, for reading-heavy content */\n relaxed: number;\n}\n\n/** Border radius scale for rounded corners */\nexport interface BorderRadiusScale {\n /** 0pt — Sharp corners */\n none: number;\n /** 2pt — Subtle rounding */\n sm: number;\n /** 4pt — Standard rounding */\n md: number;\n /** 8pt — Pronounced rounding */\n lg: number;\n /** 9999pt — Pill/circle shape */\n full: number;\n}\n\n/** Letter spacing scale for typography adjustments */\nexport interface LetterSpacingScale {\n /** -0.025em — Tighter spacing */\n tight: number;\n /** 0em — Normal spacing */\n normal: number;\n /** 0.025em — Slightly wider spacing */\n wide: number;\n /** 0.05em — Much wider spacing (for uppercase) */\n wider: number;\n}\n\n/** Raw design scales shared across themes */\nexport interface PrimitiveTokens {\n typography: TypographyScale;\n spacing: SpacingScale;\n fontWeights: FontWeights;\n lineHeights: LineHeights;\n borderRadius: BorderRadiusScale;\n letterSpacing: LetterSpacingScale;\n}\n\n// ─── Semantic Tokens ────────────────────────────────────────────────────────\n// These map primitives to design intent. Themes differ primarily here.\n\n/**\n * Semantic color tokens using the foreground/background pair convention.\n * All values must be hex strings (e.g., '#1a1a1a').\n * react-pdf supports hex, rgb(), and hsl() — but NOT oklch.\n */\nexport interface ColorTokens {\n /** Primary text and content color */\n foreground: string;\n /** Page background color */\n background: string;\n /** Subtle background for secondary areas (e.g., code blocks, table headers) */\n muted: string;\n /** Text on muted backgrounds (captions, footnotes, timestamps) */\n mutedForeground: string;\n /** Brand/accent color for emphasis and highlights */\n primary: string;\n /** Text on primary-colored backgrounds */\n primaryForeground: string;\n /** Table borders, dividers, rules */\n border: string;\n /** Secondary accent for call-to-action elements, badges */\n accent: string;\n /** Error text, warning indicators */\n destructive: string;\n /** Success states (e.g., badges, confirmations) */\n success: string;\n /** Warning states (e.g., badges, alerts) */\n warning: string;\n /** Info states (e.g., badges, informational alerts) */\n info: string;\n}\n\n/** Typography semantic tokens — what fonts and sizes to use where */\nexport interface TypographyTokens {\n /** Body text settings */\n body: {\n /** Font family for body text (e.g., 'Helvetica') */\n fontFamily: string;\n /** Base font size in points */\n fontSize: number;\n /** Line height multiplier */\n lineHeight: number;\n };\n /** Heading text settings */\n heading: {\n /** Font family for headings (e.g., 'Times-Roman', 'Courier') */\n fontFamily: string;\n /** Font weight as numeric value (400-700) */\n fontWeight: number;\n /** Line height multiplier for headings */\n lineHeight: number;\n /** Font sizes for each heading level in points */\n fontSize: {\n h1: number;\n h2: number;\n h3: number;\n h4: number;\n h5: number;\n h6: number;\n };\n };\n}\n\n/** Spacing semantic tokens — consistent spacing across the document */\nexport interface SpacingTokens {\n /** Page margin settings in points */\n page: {\n marginTop: number;\n marginRight: number;\n marginBottom: number;\n marginLeft: number;\n };\n /** Space between major document sections (after h2, before new sections) */\n sectionGap: number;\n /** Space between paragraphs and after text blocks */\n paragraphGap: number;\n /** Space between inline components, list items, table rows */\n componentGap: number;\n}\n\n/** Page layout defaults */\nexport interface PageTokens {\n /** Default page size */\n size: \"A4\" | \"LETTER\" | \"LEGAL\";\n /** Default page orientation */\n orientation: \"portrait\" | \"landscape\";\n}\n\n// ─── Full Theme ─────────────────────────────────────────────────────────────\n\n/**\n * The complete pdfcn theme object.\n *\n * Components import this and use its tokens for all style values.\n * Since React Context doesn't work in @react-pdf/renderer,\n * the theme is a plain TypeScript object imported directly by components.\n *\n * @example\n * ```tsx\n * // In a component:\n * import { theme } from '../lib/pdfx-theme';\n *\n * function createStyles(t: PdfcnTheme) {\n * return StyleSheet.create({\n * text: {\n * fontFamily: t.typography.body.fontFamily,\n * fontSize: t.typography.body.fontSize,\n * color: t.colors.foreground,\n * },\n * });\n * }\n *\n * const styles = createStyles(theme);\n * ```\n */\nexport interface PdfcnTheme {\n /** Theme name identifier */\n name: string;\n /** Raw design scales */\n primitives: PrimitiveTokens;\n /** Semantic color mappings */\n colors: ColorTokens;\n /** Typography settings for body and headings */\n typography: TypographyTokens;\n /** Spacing settings for page, sections, and components */\n spacing: SpacingTokens;\n /** Page layout defaults */\n page: PageTokens;\n}\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "content": "import { professionalTheme } from \"@/registry/themes\";\n\nexport const theme = professionalTheme;\n",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "type": "registry:theme"
+}
\ No newline at end of file
diff --git a/public/r/forme/utils.json b/public/r/forme/utils.json
new file mode 100644
index 0000000..e8369a0
--- /dev/null
+++ b/public/r/forme/utils.json
@@ -0,0 +1,38 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/utils",
+ "title": "Forme Utils",
+ "description": "Theme context and helpers for the forme base",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "content": "import { professionalTheme } from \"@/registry/themes\";\n\nexport const theme = professionalTheme;\n",
+ "type": "registry:lib"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme-context.tsx",
+ "content": "/* eslint-disable react-refresh/only-export-components */\n// Exports both a component (PdfcnThemeProvider) and hooks/context intentionally.\n// All PDF components import from a single file — splitting would break the public API.\n\nimport * as React from \"react\";\nimport { createContext, useContext, useMemo } from 'react';\nimport type { DependencyList, ReactNode } from 'react';\n\nimport { theme as defaultTheme } from \"./pdfcn-theme\";\n\nexport type PdfcnTheme = typeof defaultTheme;\n\nexport const PdfcnThemeContext = createContext<PdfcnTheme>(defaultTheme);\n\nexport interface PdfcnThemeProviderProps {\n theme?: PdfcnTheme;\n children: ReactNode;\n}\n\n/**\n * Detect whether React currently has an active dispatcher.\n * When components are invoked as plain functions in tests, dispatcher is null.\n */\nfunction hasActiveDispatcher(): boolean {\n const maybeInternals = React as unknown as {\n __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE?: {\n H?: unknown;\n };\n };\n\n const dispatcher =\n maybeInternals\n .__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE?.H;\n return dispatcher != null;\n}\n\nexport function PdfcnThemeProvider({\n theme,\n children,\n}: PdfcnThemeProviderProps) {\n const resolvedTheme = useMemo(() => theme ?? defaultTheme, [theme]);\n return (\n <PdfcnThemeContext.Provider value={resolvedTheme}>\n {children}\n </PdfcnThemeContext.Provider>\n );\n}\n\n/**\n * Regex patterns that indicate a hook was called outside a valid React render tree.\n * These errors are caught and suppressed so components fall back to safe defaults.\n */\nconst HOOK_ERROR_PATTERNS =\n /invalid hook call|useContext|useMemo|cannot read properties of null|dispatcher|renderWithHooks|resolveDispatcher|hooks can only be called|rendered fewer hooks/i;\n\n/**\n * Calls a React hook with a graceful fallback for non-render environments (e.g. unit tests).\n * Uses hasActiveDispatcher() as the primary guard; the try/catch is a safety net for edge\n * cases where the dispatcher check passes but the hook still cannot execute.\n */\nfunction callHook<T>(hook: () => T, fallback: T): T {\n if (!hasActiveDispatcher()) {return fallback;}\n try {\n return hook();\n } catch (error) {\n if (error instanceof Error && HOOK_ERROR_PATTERNS.test(error.message))\n {return fallback;}\n throw error;\n }\n}\n\n/**\n * Returns the active PdfcnTheme from context, or the default theme when called\n * outside a React render tree (e.g. unit tests).\n */\nexport function usePdfcnTheme(): PdfcnTheme {\n return callHook(() => useContext(PdfcnThemeContext), defaultTheme);\n}\n\n/**\n * Calls factory() and returns the result.\n * The deps parameter is accepted for API compatibility with existing callers.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function useSafeMemo<T>(factory: () => T, _deps: DependencyList): T {\n return factory();\n}\n",
+ "type": "registry:lib"
+ },
+ {
+ "path": "registry/bases/forme/lib/resolve-color.ts",
+ "content": "import type { ColorTokens } from \"@/registry/themes\";\n\n/** Theme color token keys that can be used for the color prop */\nexport const THEME_COLOR_KEYS = [\n \"foreground\",\n \"background\",\n \"muted\",\n \"mutedForeground\",\n \"primary\",\n \"primaryForeground\",\n \"border\",\n \"accent\",\n \"destructive\",\n \"success\",\n \"warning\",\n \"info\",\n] as const satisfies (keyof ColorTokens)[];\n\n/** Resolves a color value: theme token key → hex, or raw CSS color as-is. */\nexport function resolveColor(value: string, colors: ColorTokens): string {\n const key = value as (typeof THEME_COLOR_KEYS)[number];\n return THEME_COLOR_KEYS.includes(key) ? colors[key] : value;\n}\n",
+ "type": "registry:lib"
+ },
+ {
+ "path": "registry/bases/forme/lib/forme-svg.tsx",
+ "content": "import { Svg as FormeSvg } from \"@formepdf/react\";\nimport { createElement } from 'react';\nimport type { ReactNode, CSSProperties } from 'react';\n\ntype AnyProps = Record<string, unknown> & {\n children?: ReactNode;\n style?: CSSProperties;\n};\n\nexport function Svg({\n children,\n width,\n height,\n viewBox,\n style,\n ...rest\n}: AnyProps & { width?: number; height?: number; viewBox?: string }) {\n return (\n <FormeSvg\n width={width as number}\n height={height as number}\n viewBox={viewBox as string | undefined}\n style={style as never}\n {...rest}\n >\n {children}\n </FormeSvg>\n );\n}\n\nexport const Circle = (props: AnyProps) => createElement(\"circle\", props);\nexport const Rect = (props: AnyProps) => createElement(\"rect\", props);\nexport const G = (props: AnyProps) => createElement(\"g\", props);\nexport const Line = (props: AnyProps) => createElement(\"line\", props);\nexport const Path = (props: AnyProps) => createElement(\"path\", props);\nexport const SvgText = (props: AnyProps) => createElement(\"text\", props);\n",
+ "type": "registry:lib"
+ },
+ {
+ "path": "registry/bases/forme/lib/maybe-fixed.tsx",
+ "content": "import { Fixed, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport type { ReactNode } from \"react\";\n\nexport function MaybeFixed({\n fixed,\n position,\n wrap,\n style,\n children,\n}: {\n fixed?: boolean;\n position: \"header\" | \"footer\";\n wrap?: boolean;\n style?: Style | Style[];\n children?: ReactNode;\n}) {\n const view = (\n <View wrap={wrap} style={style as never}>\n {children}\n </View>\n );\n if (!fixed) {return view;}\n return <Fixed position={position}>{view}</Fixed>;\n}\n",
+ "type": "registry:lib"
+ }
+ ],
+ "type": "registry:lib"
+}
\ No newline at end of file
diff --git a/public/r/forme/watermark.json b/public/r/forme/watermark.json
new file mode 100644
index 0000000..6e20f3f
--- /dev/null
+++ b/public/r/forme/watermark.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "forme/watermark",
+ "title": "Watermark",
+ "description": "Watermark PDF component (forme)",
+ "dependencies": [
+ "@formepdf/react",
+ "@formepdf/core"
+ ],
+ "registryDependencies": [
+ "forme/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/forme/components/watermark/watermark.tsx",
+ "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type WatermarkPosition =\n | \"center\"\n | \"top-left\"\n | \"top-right\"\n | \"bottom-left\"\n | \"bottom-right\";\n\n/**\n * Diagonal watermark overlaid across the full page using absolute positioning.\n * Props - `text` | `opacity` | `fontSize` | `color` | `angle` | `position` | `fixed` | `style`\n * @see {@link PdfWatermarkProps}\n */\nexport interface PdfWatermarkProps extends Omit<PDFComponentProps, \"children\"> {\n text: string;\n opacity?: number;\n fontSize?: number;\n color?: string;\n angle?: number;\n position?: WatermarkPosition;\n /**\n * @default true\n */\n fixed?: boolean;\n children?: never;\n}\n\nfunction createWatermarkStyles(t: PdfcnTheme) {\n const { fontWeights } = t.primitives;\n // Use page margins as corner insets so watermark position adapts to the active theme.\n const { marginTop, marginBottom, marginLeft, marginRight } = t.spacing.page;\n return StyleSheet.create({\n container: {\n alignItems: \"center\",\n bottom: 0,\n justifyContent: \"center\",\n left: 0,\n pointerEvents: \"none\",\n position: \"absolute\",\n right: 0,\n top: 0,\n zIndex: -1,\n },\n positionBottomLeft: {\n alignItems: \"flex-start\",\n justifyContent: \"flex-end\",\n paddingBottom: marginBottom,\n paddingLeft: marginLeft,\n },\n positionBottomRight: {\n alignItems: \"flex-end\",\n justifyContent: \"flex-end\",\n paddingBottom: marginBottom,\n paddingRight: marginRight,\n },\n positionCenter: { alignItems: \"center\", justifyContent: \"center\" },\n positionTopLeft: {\n alignItems: \"flex-start\",\n justifyContent: \"flex-start\",\n paddingLeft: marginLeft,\n paddingTop: marginTop,\n },\n positionTopRight: {\n alignItems: \"flex-end\",\n justifyContent: \"flex-start\",\n paddingRight: marginRight,\n paddingTop: marginTop,\n },\n text: {\n fontFamily: t.typography.heading.fontFamily,\n fontWeight: fontWeights.bold,\n letterSpacing: 4,\n textTransform: \"uppercase\",\n },\n });\n}\n\nexport function PdfWatermark({\n text,\n opacity = 0.15,\n fontSize = 60,\n color = \"mutedForeground\",\n angle = -45,\n position = \"center\",\n fixed = true,\n style,\n}: PdfWatermarkProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createWatermarkStyles(theme), [theme]);\n const positionMap: Record<WatermarkPosition, Style> = {\n \"bottom-left\": styles.positionBottomLeft,\n \"bottom-right\": styles.positionBottomRight,\n center: styles.positionCenter,\n \"top-left\": styles.positionTopLeft,\n \"top-right\": styles.positionTopRight,\n };\n const containerStyles: Style[] = [styles.container, positionMap[position]];\n if (style) {containerStyles.push(...[style].flat());}\n const textStyles: Style[] = [\n styles.text,\n {\n color: resolveColor(color, theme.colors),\n fontSize,\n opacity,\n transform: `rotate(${angle}deg)`,\n },\n ];\n return (\n <View style={containerStyles as never}>\n <PDFText style={textStyles as never}>{text}</PDFText>\n </View>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/watermark/index.ts",
+ "content": "export {\n PdfWatermark,\n type PdfWatermarkProps,\n type WatermarkPosition,\n} from \"./watermark\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/registry.json b/public/r/registry.json
index 7359846..03d2aba 100644
--- a/public/r/registry.json
+++ b/public/r/registry.json
@@ -1,19 +1,1931 @@
{
- "name": "startercn",
- "homepage": "https://github.com/shadcn-labs/startercn",
+ "$schema": "https://ui.shadcn.com/schema/registry.json",
+ "name": "pdfcn",
+ "homepage": "https://pdfcn.vercel.app",
"items": [
{
- "name": "your-component",
+ "name": "takumi/utils",
+ "type": "registry:lib",
+ "title": "Takumi Utils",
+ "description": "Theme context and helpers for the takumi base",
+ "files": [
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "type": "registry:lib"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme-context.tsx",
+ "type": "registry:lib"
+ },
+ {
+ "path": "registry/bases/takumi/lib/resolve-color.ts",
+ "type": "registry:lib"
+ },
+ {
+ "path": "registry/bases/takumi/lib/takumi-primitives.tsx",
+ "type": "registry:lib"
+ },
+ {
+ "path": "registry/bases/takumi/lib/takumi-svg.tsx",
+ "type": "registry:lib"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]
+ },
+ {
+ "name": "takumi/alert",
+ "type": "registry:ui",
+ "title": "Alert",
+ "description": "Alert PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/alert/alert.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/alert/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/badge",
+ "type": "registry:ui",
+ "title": "Badge",
+ "description": "Badge PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/badge/badge.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/badge/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/card",
+ "type": "registry:ui",
+ "title": "Card",
+ "description": "Card PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/card/card.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/card/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/data-table",
+ "type": "registry:ui",
+ "title": "Data Table",
+ "description": "Data Table PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/data-table/data-table.styles.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/data-table/data-table.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/data-table/data-table.types.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/data-table/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils", "takumi/table"]
+ },
+ {
+ "name": "takumi/divider",
+ "type": "registry:ui",
+ "title": "Divider",
+ "description": "Divider PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/divider/divider.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/divider/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/form",
+ "type": "registry:ui",
+ "title": "Form",
+ "description": "Form PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/form/form.styles.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/form/form.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/form/form.types.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/form/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/graph",
+ "type": "registry:ui",
+ "title": "Graph",
+ "description": "Graph PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/graph/graph.styles.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/graph/graph.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/graph/graph.types.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/graph/graph.utils.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/graph/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/heading",
+ "type": "registry:ui",
+ "title": "Heading",
+ "description": "Heading PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/heading/heading.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/heading/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/keep-together",
+ "type": "registry:ui",
+ "title": "Keep Together",
+ "description": "Keep Together PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/keep-together/keep-together.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/keep-together/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/key-value",
+ "type": "registry:ui",
+ "title": "Key Value",
+ "description": "Key Value PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/key-value/key-value.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/key-value/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/link",
+ "type": "registry:ui",
+ "title": "Link",
+ "description": "Link PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/link/link.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/link/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/list",
+ "type": "registry:ui",
+ "title": "List",
+ "description": "List PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/list/list.styles.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/list/list.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/list/list.types.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/list/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/page-break",
+ "type": "registry:ui",
+ "title": "Page Break",
+ "description": "Page Break PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/page-break/page-break.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/page-break/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/page-footer",
+ "type": "registry:ui",
+ "title": "Page Footer",
+ "description": "Page Footer PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/page-footer/page-footer.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/page-footer/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/page-header",
+ "type": "registry:ui",
+ "title": "Page Header",
+ "description": "Page Header PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/page-header/page-header.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/page-header/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/page-number",
+ "type": "registry:ui",
+ "title": "Page Number",
+ "description": "Page Number PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/page-number/page-number.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/page-number/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/pdf-image",
+ "type": "registry:ui",
+ "title": "Pdf Image",
+ "description": "Pdf Image PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/pdf-image/pdf-image.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/pdf-image/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/qrcode",
+ "type": "registry:ui",
+ "title": "Qrcode",
+ "description": "Qrcode PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/qrcode/qrcode.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/qrcode/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers", "qrcode"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/section",
+ "type": "registry:ui",
+ "title": "Section",
+ "description": "Section PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/section/section.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/section/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/signature",
+ "type": "registry:ui",
+ "title": "Signature",
+ "description": "Signature PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/signature/signature.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/signature/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/stack",
+ "type": "registry:ui",
+ "title": "Stack",
+ "description": "Stack PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/stack/stack.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/stack/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/table",
+ "type": "registry:ui",
+ "title": "Table",
+ "description": "Table PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/table/table.styles.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/table/table.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/table/table.types.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/table/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/text",
+ "type": "registry:ui",
+ "title": "Text",
+ "description": "Text PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/text/text.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/text/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/watermark",
+ "type": "registry:ui",
+ "title": "Watermark",
+ "description": "Watermark PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/watermark/watermark.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/watermark/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/invoice-classic",
+ "type": "registry:block",
+ "title": "Invoice Classic",
+ "description": "Invoice Classic PDF block (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/invoice-classic/invoice-classic.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/invoice-classic/invoice-classic.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/invoice-consultant",
+ "type": "registry:block",
+ "title": "Invoice Consultant",
+ "description": "Invoice Consultant PDF block (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/invoice-corporate",
+ "type": "registry:block",
+ "title": "Invoice Corporate",
+ "description": "Invoice Corporate PDF block (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/invoice-creative",
+ "type": "registry:block",
+ "title": "Invoice Creative",
+ "description": "Invoice Creative PDF block (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/invoice-creative/invoice-creative.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/invoice-creative/invoice-creative.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/invoice-minimal",
+ "type": "registry:block",
+ "title": "Invoice Minimal",
+ "description": "Invoice Minimal PDF block (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/invoice-modern",
+ "type": "registry:block",
+ "title": "Invoice Modern",
+ "description": "Invoice Modern PDF block (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/invoice-modern/invoice-modern.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/invoice-modern/invoice-modern.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/report-financial",
+ "type": "registry:block",
+ "title": "Report Financial",
+ "description": "Report Financial PDF block (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/report-financial/report-financial.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/report-financial/report-layout.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/report-financial/report.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/report-marketing",
+ "type": "registry:block",
+ "title": "Report Marketing",
+ "description": "Report Marketing PDF block (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/report-marketing/report-layout.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/report-marketing/report-marketing.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/report-marketing/report.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/report-operations",
+ "type": "registry:block",
+ "title": "Report Operations",
+ "description": "Report Operations PDF block (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/report-operations/report-layout.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/report-operations/report-operations.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/report-operations/report.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/report-security",
+ "type": "registry:block",
+ "title": "Report Security",
+ "description": "Report Security PDF block (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/report-security/report-layout.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/report-security/report-security.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/report-security/report.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/theme-professional",
+ "type": "registry:theme",
+ "title": "Professional Theme (takumi)",
+ "description": "professional theme tokens for takumi",
+ "files": [
+ {
+ "path": "registry/themes/professional.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-professional.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]
+ },
+ {
+ "name": "takumi/theme-modern",
+ "type": "registry:theme",
+ "title": "Modern Theme (takumi)",
+ "description": "modern theme tokens for takumi",
+ "files": [
+ {
+ "path": "registry/themes/modern.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-modern.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]
+ },
+ {
+ "name": "takumi/theme-minimal",
+ "type": "registry:theme",
+ "title": "Minimal Theme (takumi)",
+ "description": "minimal theme tokens for takumi",
+ "files": [
+ {
+ "path": "registry/themes/minimal.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-minimal.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]
+ },
+ {
+ "name": "takumi/theme-executive",
+ "type": "registry:theme",
+ "title": "Executive Theme (takumi)",
+ "description": "executive theme tokens for takumi",
+ "files": [
+ {
+ "path": "registry/themes/executive.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-executive.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]
+ },
+ {
+ "name": "takumi/theme-corporate",
+ "type": "registry:theme",
+ "title": "Corporate Theme (takumi)",
+ "description": "corporate theme tokens for takumi",
+ "files": [
+ {
+ "path": "registry/themes/corporate.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-corporate.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]
+ },
+ {
+ "name": "takumi/theme-elegant",
+ "type": "registry:theme",
+ "title": "Elegant Theme (takumi)",
+ "description": "elegant theme tokens for takumi",
+ "files": [
+ {
+ "path": "registry/themes/elegant.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-elegant.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]
+ },
+ {
+ "name": "takumi/theme-vivid",
+ "type": "registry:theme",
+ "title": "Vivid Theme (takumi)",
+ "description": "vivid theme tokens for takumi",
+ "files": [
+ {
+ "path": "registry/themes/vivid.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-vivid.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]
+ },
+ {
+ "name": "takumi/theme-forest",
+ "type": "registry:theme",
+ "title": "Forest Theme (takumi)",
+ "description": "forest theme tokens for takumi",
+ "files": [
+ {
+ "path": "registry/themes/forest.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-forest.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]
+ },
+ {
+ "name": "takumi/theme-blueprint",
+ "type": "registry:theme",
+ "title": "Blueprint Theme (takumi)",
+ "description": "blueprint theme tokens for takumi",
+ "files": [
+ {
+ "path": "registry/themes/blueprint.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-blueprint.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]
+ },
+ {
+ "name": "forme/utils",
+ "type": "registry:lib",
+ "title": "Forme Utils",
+ "description": "Theme context and helpers for the forme base",
+ "files": [
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "type": "registry:lib"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme-context.tsx",
+ "type": "registry:lib"
+ },
+ {
+ "path": "registry/bases/forme/lib/resolve-color.ts",
+ "type": "registry:lib"
+ },
+ {
+ "path": "registry/bases/forme/lib/forme-svg.tsx",
+ "type": "registry:lib"
+ },
+ {
+ "path": "registry/bases/forme/lib/maybe-fixed.tsx",
+ "type": "registry:lib"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"]
+ },
+ {
+ "name": "forme/alert",
+ "type": "registry:ui",
+ "title": "Alert",
+ "description": "Alert PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/alert/alert.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/alert/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/badge",
+ "type": "registry:ui",
+ "title": "Badge",
+ "description": "Badge PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/badge/badge.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/badge/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/card",
+ "type": "registry:ui",
+ "title": "Card",
+ "description": "Card PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/card/card.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/card/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/data-table",
+ "type": "registry:ui",
+ "title": "Data Table",
+ "description": "Data Table PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/data-table/data-table.styles.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/data-table/data-table.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/data-table/data-table.types.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/data-table/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils", "forme/table"]
+ },
+ {
+ "name": "forme/divider",
+ "type": "registry:ui",
+ "title": "Divider",
+ "description": "Divider PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/divider/divider.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/divider/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/form",
+ "type": "registry:ui",
+ "title": "Form",
+ "description": "Form PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/form/form.styles.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/form/form.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/form/form.types.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/form/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/graph",
+ "type": "registry:ui",
+ "title": "Graph",
+ "description": "Graph PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/graph/graph.styles.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/graph/graph.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/graph/graph.types.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/graph/graph.utils.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/graph/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/heading",
+ "type": "registry:ui",
+ "title": "Heading",
+ "description": "Heading PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/heading/heading.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/heading/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/keep-together",
+ "type": "registry:ui",
+ "title": "Keep Together",
+ "description": "Keep Together PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/keep-together/keep-together.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/keep-together/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/key-value",
+ "type": "registry:ui",
+ "title": "Key Value",
+ "description": "Key Value PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/key-value/key-value.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/key-value/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/link",
+ "type": "registry:ui",
+ "title": "Link",
+ "description": "Link PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/link/link.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/link/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/list",
+ "type": "registry:ui",
+ "title": "List",
+ "description": "List PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/list/list.styles.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/list/list.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/list/list.types.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/list/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/page-break",
+ "type": "registry:ui",
+ "title": "Page Break",
+ "description": "Page Break PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/page-break/page-break.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/page-break/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/page-footer",
+ "type": "registry:ui",
+ "title": "Page Footer",
+ "description": "Page Footer PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/page-footer/page-footer.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/page-footer/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/page-header",
+ "type": "registry:ui",
+ "title": "Page Header",
+ "description": "Page Header PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/page-header/page-header.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/page-header/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/page-number",
+ "type": "registry:ui",
+ "title": "Page Number",
+ "description": "Page Number PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/page-number/page-number.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/page-number/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/pdf-image",
+ "type": "registry:ui",
+ "title": "Pdf Image",
+ "description": "Pdf Image PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/pdf-image/pdf-image.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/pdf-image/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/qrcode",
+ "type": "registry:ui",
+ "title": "Qrcode",
+ "description": "Qrcode PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/qrcode/qrcode.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/qrcode/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core", "qrcode"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/section",
+ "type": "registry:ui",
+ "title": "Section",
+ "description": "Section PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/section/section.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/section/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/signature",
+ "type": "registry:ui",
+ "title": "Signature",
+ "description": "Signature PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/signature/signature.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/signature/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/stack",
+ "type": "registry:ui",
+ "title": "Stack",
+ "description": "Stack PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/stack/stack.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/stack/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/table",
+ "type": "registry:ui",
+ "title": "Table",
+ "description": "Table PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/table/table.styles.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/table/table.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/table/table.types.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/table/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/text",
+ "type": "registry:ui",
+ "title": "Text",
+ "description": "Text PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/text/text.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/text/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/watermark",
"type": "registry:ui",
- "title": "Your Component",
- "description": "A placeholder component. Replace this with your custom shadcn component.",
+ "title": "Watermark",
+ "description": "Watermark PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/watermark/watermark.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/watermark/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/invoice-classic",
+ "type": "registry:block",
+ "title": "Invoice Classic",
+ "description": "Invoice Classic PDF block (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/invoice-classic/invoice-classic.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/invoice-classic/invoice-classic.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/invoice-consultant",
+ "type": "registry:block",
+ "title": "Invoice Consultant",
+ "description": "Invoice Consultant PDF block (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/invoice-consultant/invoice-consultant.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/invoice-consultant/invoice-consultant.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/invoice-corporate",
+ "type": "registry:block",
+ "title": "Invoice Corporate",
+ "description": "Invoice Corporate PDF block (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/invoice-corporate/invoice-corporate.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/invoice-corporate/invoice-corporate.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/invoice-creative",
+ "type": "registry:block",
+ "title": "Invoice Creative",
+ "description": "Invoice Creative PDF block (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/invoice-creative/invoice-creative.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/invoice-creative/invoice-creative.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/invoice-minimal",
+ "type": "registry:block",
+ "title": "Invoice Minimal",
+ "description": "Invoice Minimal PDF block (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/invoice-minimal/invoice-minimal.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/invoice-minimal/invoice-minimal.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/invoice-modern",
+ "type": "registry:block",
+ "title": "Invoice Modern",
+ "description": "Invoice Modern PDF block (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/invoice-modern/invoice-modern.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/invoice-modern/invoice-modern.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/report-financial",
+ "type": "registry:block",
+ "title": "Report Financial",
+ "description": "Report Financial PDF block (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/report-financial/report-financial.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/report-financial/report-layout.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/report-financial/report.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/report-marketing",
+ "type": "registry:block",
+ "title": "Report Marketing",
+ "description": "Report Marketing PDF block (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/report-marketing/report-layout.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/report-marketing/report-marketing.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/report-marketing/report.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/report-operations",
+ "type": "registry:block",
+ "title": "Report Operations",
+ "description": "Report Operations PDF block (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/report-operations/report-layout.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/report-operations/report-operations.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/report-operations/report.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/report-security",
+ "type": "registry:block",
+ "title": "Report Security",
+ "description": "Report Security PDF block (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/report-security/report-layout.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/report-security/report-security.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/report-security/report.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/theme-professional",
+ "type": "registry:theme",
+ "title": "Professional Theme (forme)",
+ "description": "professional theme tokens for forme",
+ "files": [
+ {
+ "path": "registry/themes/professional.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-professional.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"]
+ },
+ {
+ "name": "forme/theme-modern",
+ "type": "registry:theme",
+ "title": "Modern Theme (forme)",
+ "description": "modern theme tokens for forme",
+ "files": [
+ {
+ "path": "registry/themes/modern.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-modern.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"]
+ },
+ {
+ "name": "forme/theme-minimal",
+ "type": "registry:theme",
+ "title": "Minimal Theme (forme)",
+ "description": "minimal theme tokens for forme",
+ "files": [
+ {
+ "path": "registry/themes/minimal.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-minimal.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"]
+ },
+ {
+ "name": "forme/theme-executive",
+ "type": "registry:theme",
+ "title": "Executive Theme (forme)",
+ "description": "executive theme tokens for forme",
+ "files": [
+ {
+ "path": "registry/themes/executive.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-executive.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"]
+ },
+ {
+ "name": "forme/theme-corporate",
+ "type": "registry:theme",
+ "title": "Corporate Theme (forme)",
+ "description": "corporate theme tokens for forme",
+ "files": [
+ {
+ "path": "registry/themes/corporate.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-corporate.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"]
+ },
+ {
+ "name": "forme/theme-elegant",
+ "type": "registry:theme",
+ "title": "Elegant Theme (forme)",
+ "description": "elegant theme tokens for forme",
+ "files": [
+ {
+ "path": "registry/themes/elegant.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-elegant.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"]
+ },
+ {
+ "name": "forme/theme-vivid",
+ "type": "registry:theme",
+ "title": "Vivid Theme (forme)",
+ "description": "vivid theme tokens for forme",
+ "files": [
+ {
+ "path": "registry/themes/vivid.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-vivid.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"]
+ },
+ {
+ "name": "forme/theme-forest",
+ "type": "registry:theme",
+ "title": "Forest Theme (forme)",
+ "description": "forest theme tokens for forme",
+ "files": [
+ {
+ "path": "registry/themes/forest.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-forest.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"]
+ },
+ {
+ "name": "forme/theme-blueprint",
+ "type": "registry:theme",
+ "title": "Blueprint Theme (forme)",
+ "description": "blueprint theme tokens for forme",
"files": [
{
- "path": "registry/new-york/your-component.tsx",
- "type": "registry:ui",
- "target": "components/ui/your-component.tsx"
+ "path": "registry/themes/blueprint.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-blueprint.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
}
- ]
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"]
}
]
}
diff --git a/public/r/takumi/alert.json b/public/r/takumi/alert.json
new file mode 100644
index 0000000..e9aed97
--- /dev/null
+++ b/public/r/takumi/alert.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/alert",
+ "title": "Alert",
+ "description": "Alert PDF component (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/alert/alert.tsx",
+ "content": "import type { ReactNode } from \"react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\nimport { Circle, Line, Path, Svg } from \"../../lib/takumi-svg\";\n\nexport type AlertVariant = \"info\" | \"success\" | \"warning\" | \"error\";\n\n/**\n * Alert box with severity variants for info, success, warning, and error states.\n * Props - `variant` | `title` | `children` | `showIcon` | `showBorder` | `style`\n * @see {@link PdfAlertProps}\n */\nexport interface PdfAlertProps extends Omit<PDFComponentProps, \"children\"> {\n /**\n * @default 'info'\n */\n variant?: AlertVariant;\n title?: string;\n children?: ReactNode;\n /**\n * @default true\n */\n showIcon?: boolean;\n /**\n * @default true\n */\n showBorder?: boolean;\n}\n\n/** Stroke width for all alert SVG icons (SVG user units). */\nconst ICON_STROKE_WIDTH = 1.5;\n\nconst SvgWrap = ({ children }: { children: ReactNode }) => (\n <Svg width={16} height={16} viewBox=\"0 0 16 16\">\n {children}\n </Svg>\n);\n\nconst ICON_MAP = {\n error: ({ color }: { color: string }) => (\n <SvgWrap>\n <Circle\n cx={8}\n cy={8}\n r={7}\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n />\n <Line\n x1={5.5}\n y1={5.5}\n x2={10.5}\n y2={10.5}\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n />\n <Line\n x1={10.5}\n y1={5.5}\n x2={5.5}\n y2={10.5}\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n />\n </SvgWrap>\n ),\n info: ({ color }: { color: string }) => (\n <SvgWrap>\n <Circle\n cx={8}\n cy={8}\n r={7}\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n />\n <Circle cx={8} cy={4.5} r={1} fill={color} />\n <Line\n x1={8}\n y1={7}\n x2={8}\n y2={11.5}\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n />\n </SvgWrap>\n ),\n success: ({ color }: { color: string }) => (\n <SvgWrap>\n <Circle\n cx={8}\n cy={8}\n r={7}\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n />\n <Path\n d=\"M5 8 L7 10 L11 6\"\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </SvgWrap>\n ),\n warning: ({ color }: { color: string }) => (\n <SvgWrap>\n <Path\n d=\"M8 1.5 L15 14.5 L1 14.5 Z\"\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinejoin=\"round\"\n />\n <Line\n x1={8}\n y1={6}\n x2={8}\n y2={10}\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n />\n <Circle cx={8} cy={12.5} r={0.75} fill={color} />\n </SvgWrap>\n ),\n};\n\nfunction AlertIcon({\n variant,\n color,\n}: {\n variant: AlertVariant;\n color: string;\n}) {\n const Icon = ICON_MAP[variant];\n return <Icon color={color} />;\n}\n\nfunction createAlertStyles(theme: PdfcnTheme) {\n const { typography, colors, primitives } = theme;\n\n const variantColors = {\n error: colors.destructive ?? \"#EF4444\",\n info: colors.info ?? \"#3B82F6\",\n success: colors.success ?? \"#22C55E\",\n warning: colors.warning ?? \"#F59E0B\",\n } satisfies Record<AlertVariant, string>;\n\n const bl = (color: string) => ({\n borderLeftColor: color,\n borderLeftWidth: 4,\n });\n\n const sheet = StyleSheet.create({\n bg: {\n backgroundColor: colors.muted,\n },\n borderError: bl(variantColors.error),\n borderInfo: bl(variantColors.info),\n borderSuccess: bl(variantColors.success),\n borderWarning: bl(variantColors.warning),\n container: {\n borderRadius: 4,\n flexDirection: \"row\",\n marginBottom: theme.spacing.componentGap,\n padding: 12,\n },\n contentContainer: { flex: 1 },\n description: {\n color: colors.mutedForeground,\n fontFamily: typography.body.fontFamily,\n fontSize: primitives.typography.sm,\n lineHeight: typography.body.lineHeight,\n },\n iconContainer: {\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n marginRight: 10,\n paddingTop: 2,\n width: 20,\n },\n title: {\n color: colors.foreground,\n fontFamily: typography.heading.fontFamily,\n fontSize: primitives.typography.sm,\n fontWeight: primitives.fontWeights.semibold,\n marginBottom: 4,\n },\n });\n\n return {\n ...sheet,\n borderMap: {\n error: sheet.borderError,\n info: sheet.borderInfo,\n success: sheet.borderSuccess,\n warning: sheet.borderWarning,\n } as Record<AlertVariant, Style>,\n /** Resolved hex colors for each variant — used to tint the SVG icons. */\n variantColors,\n };\n}\n\nexport function PdfAlert({\n variant = \"info\",\n title,\n children,\n showIcon = true,\n showBorder = true,\n style,\n}: PdfAlertProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createAlertStyles(theme), [theme]);\n\n if (!title && !children) {return null;}\n\n const containerStyles: Style[] = [\n styles.container,\n styles.bg,\n ...(showBorder ? [styles.borderMap[variant]] : []),\n ...(style ? [style].flat() : []),\n ];\n\n return (\n <View\n style={[{ breakInside: \"avoid\" as const }, containerStyles]\n .flat()\n .filter(Boolean)}\n >\n {showIcon && (\n <View style={styles.iconContainer}>\n <AlertIcon variant={variant} color={styles.variantColors[variant]} />\n </View>\n )}\n <View style={styles.contentContainer}>\n {title && <PDFText style={styles.title}>{title}</PDFText>}\n {typeof children === \"string\" ? (\n <PDFText style={styles.description}>{children}</PDFText>\n ) : (\n children\n )}\n </View>\n </View>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/alert/index.ts",
+ "content": "export { PdfAlert, type PdfAlertProps, type AlertVariant } from \"./alert\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/takumi/badge.json b/public/r/takumi/badge.json
new file mode 100644
index 0000000..0a8d6a7
--- /dev/null
+++ b/public/r/takumi/badge.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/badge",
+ "title": "Badge",
+ "description": "Badge PDF component (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/badge/badge.tsx",
+ "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type BadgeVariant =\n | \"default\"\n | \"primary\"\n | \"success\"\n | \"warning\"\n | \"destructive\"\n | \"info\"\n | \"outline\";\nexport type BadgeSize = \"sm\" | \"md\" | \"lg\";\n\n/**\n * Inline label for status, tags, or categories.\n *\n * Accepts text via either `label` prop or `children` (string). `label` takes\n * precedence when both are provided. The children pattern (`<Badge>text</Badge>`)\n * is supported for compatibility with common React idioms, but note that\n * `Takumi PDF primitives` doesn't support JSX children the way HTML does — only\n * string children are accepted.\n *\n * Props - `label` | `children` | `variant` | `size` | `background` | `color` | `style`\n * @see {@link BadgeProps}\n */\nexport interface BadgeProps extends Omit<PDFComponentProps, \"children\"> {\n /** Text to display. Takes precedence over children when both are provided. */\n label?: string;\n /** String children as an alternative to the label prop. */\n children?: string;\n /**\n * @default 'default'\n */\n variant?: BadgeVariant;\n /**\n * @default 'md'\n */\n size?: BadgeSize;\n background?: string;\n color?: string;\n}\n\nfunction createBadgeStyles(t: PdfcnTheme) {\n const { spacing, borderRadius, fontWeights } = t.primitives;\n const c = t.colors;\n const textBase = {\n fontFamily: t.typography.body.fontFamily,\n fontWeight: fontWeights.semibold,\n letterSpacing: 0.3,\n };\n const variantBox = (borderColor: string, bgColor: string = c.muted) => ({\n backgroundColor: bgColor,\n borderColor,\n borderStyle: \"solid\" as const,\n borderWidth: spacing[0.5],\n });\n const sheet = StyleSheet.create({\n containerBase: {\n alignItems: \"center\" as const,\n alignSelf: \"flex-start\" as const,\n borderRadius: borderRadius.full,\n flexDirection: \"row\" as const,\n },\n sizeLg: { paddingHorizontal: spacing[4], paddingVertical: spacing[2] },\n sizeMd: { paddingHorizontal: spacing[3], paddingVertical: spacing[1] },\n sizeSm: { paddingHorizontal: spacing[2], paddingVertical: spacing[0.5] },\n textDefault: { ...textBase, color: c.mutedForeground },\n textDestructive: { ...textBase, color: c.destructive },\n textInfo: { ...textBase, color: c.info },\n textLg: { fontSize: t.primitives.typography.sm },\n textMd: { fontSize: t.primitives.typography.xs },\n textOutline: { ...textBase, color: c.foreground },\n textPrimary: { ...textBase, color: c.primaryForeground },\n textSm: { fontSize: t.primitives.typography.xs - 1 },\n textSuccess: { ...textBase, color: c.success },\n textWarning: { ...textBase, color: c.warning },\n variantDefault: variantBox(c.border),\n variantDestructive: variantBox(c.destructive),\n variantInfo: variantBox(c.info),\n variantOutline: variantBox(c.border, c.background),\n variantPrimary: variantBox(c.primary, c.primary),\n variantSuccess: variantBox(c.success),\n variantWarning: variantBox(c.warning),\n });\n return {\n ...sheet,\n containerSizeMap: {\n sm: sheet.sizeSm,\n md: sheet.sizeMd,\n lg: sheet.sizeLg,\n } as Record<BadgeSize, Style>,\n containerVariantMap: {\n default: sheet.variantDefault,\n primary: sheet.variantPrimary,\n success: sheet.variantSuccess,\n warning: sheet.variantWarning,\n destructive: sheet.variantDestructive,\n info: sheet.variantInfo,\n outline: sheet.variantOutline,\n } as Record<BadgeVariant, Style>,\n textSizeMap: {\n sm: sheet.textSm,\n md: sheet.textMd,\n lg: sheet.textLg,\n } as Record<BadgeSize, Style>,\n textVariantMap: {\n default: sheet.textDefault,\n primary: sheet.textPrimary,\n success: sheet.textSuccess,\n warning: sheet.textWarning,\n destructive: sheet.textDestructive,\n info: sheet.textInfo,\n outline: sheet.textOutline,\n } as Record<BadgeVariant, Style>,\n };\n}\n\nexport function Badge({\n label,\n children,\n variant = \"default\",\n size = \"md\",\n background,\n color,\n style,\n}: BadgeProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createBadgeStyles(theme), [theme]);\n // `label` takes precedence; fall back to string children for React idiom compatibility\n const text = label ?? children ?? \"\";\n const containerStyles: Style[] = [\n styles.containerBase,\n styles.containerVariantMap[variant],\n styles.containerSizeMap[size],\n ...(background\n ? [{ backgroundColor: resolveColor(background, theme.colors) }]\n : []),\n ...(style ? [style].flat() : []),\n ];\n const textStyles: Style[] = [\n styles.textVariantMap[variant],\n styles.textSizeMap[size],\n ...(color ? [{ color: resolveColor(color, theme.colors) }] : []),\n ];\n return (\n <View style={containerStyles}>\n <PDFText style={textStyles}>{text}</PDFText>\n </View>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/badge/index.ts",
+ "content": "export {\n Badge,\n type BadgeProps,\n type BadgeVariant,\n type BadgeSize,\n} from \"./badge\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/takumi/card.json b/public/r/takumi/card.json
new file mode 100644
index 0000000..4cbdc33
--- /dev/null
+++ b/public/r/takumi/card.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/card",
+ "title": "Card",
+ "description": "Card PDF component (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/card/card.tsx",
+ "content": "import type { ReactNode } from \"react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type CardVariant = \"default\" | \"bordered\" | \"muted\";\n\n/**\n * Bordered content card with optional title and padding presets.\n * Props - `title` | `children` | `variant` | `padding` | `wrap` | `style`\n * @see {@link PdfCardProps}\n */\nexport interface PdfCardProps extends Omit<PDFComponentProps, \"children\"> {\n title?: string;\n children?: ReactNode;\n /**\n * @default 'default'\n */\n variant?: CardVariant;\n /**\n * @default 'md'\n */\n padding?: \"sm\" | \"md\" | \"lg\";\n /**\n * When false, the card will not split across PDF pages.\n * @default false\n */\n wrap?: boolean;\n}\n\nfunction createCardStyles(t: PdfcnTheme) {\n const { spacing, borderRadius, fontWeights } = t.primitives;\n return StyleSheet.create({\n body: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n lineHeight: t.typography.body.lineHeight,\n },\n card: {\n backgroundColor: t.colors.background,\n borderColor: t.colors.border,\n borderRadius: borderRadius.sm,\n borderStyle: \"solid\",\n borderWidth: 1,\n marginBottom: t.spacing.componentGap,\n },\n cardBordered: { borderWidth: 2 },\n cardMuted: { backgroundColor: t.colors.muted },\n paddingLg: { padding: spacing[4] },\n paddingMd: { padding: spacing[3] },\n paddingSm: { padding: spacing[2] },\n title: {\n borderBottomColor: t.colors.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n color: t.colors.foreground,\n fontFamily: t.typography.heading.fontFamily,\n fontSize: t.primitives.typography.base,\n fontWeight: fontWeights.semibold,\n lineHeight: t.typography.heading.lineHeight,\n marginBottom: spacing[2],\n paddingBottom: spacing[1] + 2,\n },\n });\n}\n\nexport function PdfCard({\n title,\n children,\n variant = \"default\",\n padding = \"md\",\n wrap = false,\n style,\n}: PdfCardProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createCardStyles(theme), [theme]);\n const paddingMap = {\n lg: styles.paddingLg,\n md: styles.paddingMd,\n sm: styles.paddingSm,\n };\n const cardStyles: Style[] = [styles.card];\n if (variant === \"bordered\") {cardStyles.push(styles.cardBordered);}\n if (variant === \"muted\") {cardStyles.push(styles.cardMuted);}\n cardStyles.push(paddingMap[padding]);\n if (style) {cardStyles.push(style);}\n return (\n <View wrap={wrap} style={cardStyles}>\n {title ? <PDFText style={styles.title}>{title}</PDFText> : null}\n {typeof children === \"string\" ? (\n <PDFText style={styles.body}>{children}</PDFText>\n ) : (\n children\n )}\n </View>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/card/index.ts",
+ "content": "export { PdfCard, type PdfCardProps, type CardVariant } from \"./card\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/takumi/data-table.json b/public/r/takumi/data-table.json
new file mode 100644
index 0000000..9cf9749
--- /dev/null
+++ b/public/r/takumi/data-table.json
@@ -0,0 +1,37 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/data-table",
+ "title": "Data Table",
+ "description": "Data Table PDF component (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils",
+ "takumi/table"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/data-table/data-table.styles.ts",
+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { StyleSheet } from \"../../lib/takumi-primitives\";\n\n/**\n * Creates compact-mode cell and text styles for the DataTable component.\n * Used when `size=\"compact\"` to render denser rows with smaller font sizes.\n * @param t - The resolved PdfcnTheme instance.\n */\nexport function createCompactStyles(t: PdfcnTheme) {\n const { spacing, fontWeights, lineHeights } = t.primitives;\n return StyleSheet.create({\n cell: {\n paddingHorizontal: spacing[2],\n paddingVertical: spacing[0.5],\n },\n footerText: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n fontWeight: fontWeights.semibold,\n lineHeight: lineHeights.normal,\n },\n headerText: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n fontWeight: fontWeights.semibold,\n lineHeight: lineHeights.normal,\n },\n text: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n lineHeight: lineHeights.normal,\n },\n });\n}\n\n/**\n * Converts an arbitrary cell value to a display string.\n * Returns an empty string for null/undefined values.\n * @param value - The raw cell value to format.\n */\nexport function formatValue(value: unknown): string {\n if (value === null || value === undefined) {return \"\";}\n if (typeof value === \"number\") {return String(value);}\n return String(value);\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/data-table/data-table.tsx",
+ "content": "import { Fragment } from \"react\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { Text as PDFText } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\nimport {\n Table,\n TableBody,\n TableCell,\n TableFooter,\n TableHeader,\n TableRow,\n} from \"../table\";\nimport { createCompactStyles, formatValue } from \"./data-table.styles\";\nimport type { DataTableProps } from \"./data-table.types\";\n\nexport function DataTable<T extends Record<string, unknown>>({\n columns,\n data,\n variant = \"grid\",\n footer,\n stripe = false,\n size = \"default\",\n noWrap = false,\n style,\n}: DataTableProps<T>) {\n const theme = usePdfcnTheme();\n const compact = useSafeMemo(() => createCompactStyles(theme), [theme]);\n const isCompact = size === \"compact\";\n\n return (\n <Table variant={variant} zebraStripe={stripe} noWrap={noWrap} style={style}>\n <TableHeader>\n <TableRow header>\n {columns.map((col) => (\n <TableCell\n key={col.key}\n header\n align={col.align ?? \"left\"}\n width={col.width}\n style={isCompact ? compact.cell : undefined}\n >\n {isCompact ? (\n <PDFText\n style={[\n compact.headerText,\n col.align ? ({ textAlign: col.align } as Style) : {},\n ]}\n >\n {col.header}\n </PDFText>\n ) : (\n col.header\n )}\n </TableCell>\n ))}\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.map((row, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: DataTable has no row id; order is stable for static data\n <Fragment key={i}>\n <TableRow>\n {columns.map((col) => {\n const value = row[col.key];\n const rendered = col.render ? col.render(value, row) : null;\n const text = rendered === null ? formatValue(value) : null;\n return (\n <TableCell\n key={col.key}\n align={col.align ?? \"left\"}\n width={col.width}\n style={isCompact ? compact.cell : undefined}\n >\n {isCompact ? (\n rendered !== null ? (\n rendered\n ) : (\n <PDFText\n style={[\n compact.text,\n col.align\n ? ({ textAlign: col.align } as Style)\n : {},\n ]}\n >\n {text}\n </PDFText>\n )\n ) : (rendered !== null ? (\n rendered\n ) : (\n text\n ))}\n </TableCell>\n );\n })}\n </TableRow>\n </Fragment>\n ))}\n </TableBody>\n {footer && (\n <TableFooter>\n <TableRow footer>\n {columns.map((col) => {\n const value = col.key in footer ? footer[col.key] : \"\";\n const rendered = col.renderFooter\n ? col.renderFooter(value)\n : null;\n const text = rendered === null ? formatValue(value) : null;\n return (\n <TableCell\n key={col.key}\n footer={!!value}\n align={col.align ?? \"left\"}\n width={col.width}\n style={isCompact ? compact.cell : undefined}\n >\n {isCompact ? (\n rendered !== null ? (\n rendered\n ) : (\n <PDFText\n style={[\n value ? compact.footerText : compact.text,\n col.align ? ({ textAlign: col.align } as Style) : {},\n ]}\n >\n {text}\n </PDFText>\n )\n ) : (rendered !== null ? (\n rendered\n ) : (\n text\n ))}\n </TableCell>\n );\n })}\n </TableRow>\n </TableFooter>\n )}\n </Table>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/data-table/data-table.types.ts",
+ "content": "import type React from \"react\";\n\nimport type { PDFComponentProps } from \"@/registry/themes\";\n\nimport type { TableVariant } from \"../table/table.types\";\n\n/** DataTable row density size. */\nexport type DataTableSize = \"default\" | \"compact\";\n\n/**\n * Column definition for a DataTable.\n * Props - `key` | `header` | `align` | `width` | `render` | `renderFooter`\n * @see {@link DataTableColumn}\n */\nexport interface DataTableColumn<T = Record<string, unknown>> {\n key: keyof T & string;\n header: string;\n align?: \"left\" | \"center\" | \"right\";\n width?: string | number;\n /**\n * Custom cell renderer. Must return Takumi PDF primitives elements (Text, View,\n * Image, etc.) — NOT HTML DOM elements. TypeScript accepts ReactNode but DOM\n * nodes will crash at runtime in the PDF renderer.\n */\n render?: (value: unknown, row: T) => React.ReactNode;\n /**\n * Custom footer cell renderer. Same constraint: return Takumi PDF primitives\n * elements only — no HTML/DOM nodes.\n */\n renderFooter?: (value: unknown) => React.ReactNode;\n}\n\n/**\n * Data table for PDF rendering with column definitions, footer support, and stripe options.\n * Props - `columns` | `data` | `variant` | `footer` | `stripe` | `size` | `noWrap` | `style`\n * @see {@link DataTableProps}\n */\nexport interface DataTableProps<T = Record<string, unknown>> extends Omit<\n PDFComponentProps,\n \"children\"\n> {\n columns: DataTableColumn<T>[];\n data: T[];\n /**\n * @default 'grid'\n */\n variant?: TableVariant;\n footer?: Partial<Record<keyof T & string, string | number>>;\n stripe?: boolean;\n /**\n * @default 'default'\n */\n size?: DataTableSize;\n noWrap?: boolean;\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/data-table/index.ts",
+ "content": "export { DataTable } from \"./data-table\";\nexport type {\n DataTableProps,\n DataTableColumn,\n DataTableSize,\n} from \"./data-table.types\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/takumi/divider.json b/public/r/takumi/divider.json
new file mode 100644
index 0000000..a59775f
--- /dev/null
+++ b/public/r/takumi/divider.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/divider",
+ "title": "Divider",
+ "description": "Divider PDF component (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/divider/divider.tsx",
+ "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type DividerVariant = \"solid\" | \"dashed\" | \"dotted\";\nexport type DividerThickness = \"thin\" | \"medium\" | \"thick\";\nexport type DividerSpacing = \"none\" | \"sm\" | \"md\" | \"lg\";\n\n/**\n * Horizontal rule with optional label, style variants, and spacing presets.\n * Props - `spacing` | `variant` | `color` | `thickness` | `label` | `width` | `style`\n * @see {@link DividerProps}\n */\nexport interface DividerProps extends Omit<PDFComponentProps, \"children\"> {\n /**\n * @default 'md'\n */\n spacing?: DividerSpacing;\n /**\n * @default 'solid'\n */\n variant?: DividerVariant;\n color?: string;\n /**\n * @default 'thin'\n */\n thickness?: DividerThickness;\n label?: string;\n width?: string | number;\n}\n\nfunction createDividerStyles(t: PdfcnTheme) {\n const { spacing, fontWeights } = t.primitives;\n return StyleSheet.create({\n base: { borderBottomColor: t.colors.border, borderBottomStyle: \"solid\" },\n dashed: { borderBottomStyle: \"dashed\" },\n dotted: { borderBottomStyle: \"dotted\" },\n labelContainer: { alignItems: \"center\", flexDirection: \"row\" },\n labelLine: {\n borderBottomColor: t.colors.border,\n borderBottomStyle: \"solid\",\n flex: 1,\n },\n labelText: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n fontWeight: fontWeights.medium,\n letterSpacing: t.primitives.letterSpacing.wider * 10,\n paddingHorizontal: spacing[3],\n textTransform: \"uppercase\",\n },\n medium: { borderBottomWidth: spacing[1] },\n solid: { borderBottomStyle: \"solid\" },\n spacingLg: { marginVertical: t.spacing.sectionGap },\n spacingMd: { marginVertical: t.spacing.componentGap },\n spacingNone: { marginVertical: spacing[0] },\n spacingSm: { marginVertical: t.spacing.paragraphGap },\n thick: { borderBottomWidth: spacing[2] },\n thin: { borderBottomWidth: spacing[0.5] },\n });\n}\n\nexport function Divider({\n spacing = \"md\",\n variant = \"solid\",\n color,\n thickness = \"thin\",\n label,\n width,\n style,\n}: DividerProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createDividerStyles(theme), [theme]);\n const spacingMap = {\n lg: styles.spacingLg,\n md: styles.spacingMd,\n none: styles.spacingNone,\n sm: styles.spacingSm,\n };\n const variantMap = {\n dashed: styles.dashed,\n dotted: styles.dotted,\n solid: styles.solid,\n };\n const thicknessMap = {\n medium: styles.medium,\n thick: styles.thick,\n thin: styles.thin,\n };\n\n if (label) {\n const lineStyle: Style[] = [\n styles.labelLine,\n thicknessMap[thickness],\n variantMap[variant],\n ];\n if (color)\n {lineStyle.push({ borderBottomColor: resolveColor(color, theme.colors) });}\n const containerStyles: Style[] = [\n styles.labelContainer,\n spacingMap[spacing],\n ];\n if (width !== undefined) {containerStyles.push({ width } as Style);}\n if (style) {containerStyles.push(...[style].flat());}\n const labelTextStyle: Style[] = [styles.labelText];\n if (color)\n {labelTextStyle.push({ color: resolveColor(color, theme.colors) });}\n return (\n <View style={containerStyles}>\n <View style={lineStyle} />\n <PDFText style={labelTextStyle}>{label}</PDFText>\n <View style={lineStyle} />\n </View>\n );\n }\n\n const styleArray: Style[] = [\n styles.base,\n spacingMap[spacing],\n variantMap[variant],\n thicknessMap[thickness],\n ];\n if (color)\n {styleArray.push({ borderBottomColor: resolveColor(color, theme.colors) });}\n if (width !== undefined) {styleArray.push({ width } as Style);}\n if (style) {styleArray.push(...[style].flat());}\n return <View style={styleArray} />;\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/divider/index.ts",
+ "content": "export {\n Divider,\n type DividerProps,\n type DividerVariant,\n type DividerThickness,\n type DividerSpacing,\n} from \"./divider\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/takumi/form.json b/public/r/takumi/form.json
new file mode 100644
index 0000000..047e420
--- /dev/null
+++ b/public/r/takumi/form.json
@@ -0,0 +1,36 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/form",
+ "title": "Form",
+ "description": "Form PDF component (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/form/form.styles.ts",
+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { PdfFormVariant } from \"./form.types\";\n\n/** Style factory for fillable form layouts, derived from the active theme. */\nexport function createFormStyles(\n t: PdfcnTheme,\n variant: PdfFormVariant = \"underline\"\n) {\n const { spacing, borderRadius, fontWeights, typography } = t.primitives;\n const borderColor = t.colors.border;\n const hairline = 0.75; // lighter than spacing[0.5]=2pt — more refined\n const rule = 1; // group title rule\n\n const fieldAreaByVariant: Record<PdfFormVariant, object> = {\n box: {\n borderColor: borderColor,\n borderRadius: borderRadius.sm,\n borderStyle: \"solid\",\n borderWidth: hairline,\n },\n ghost: {\n backgroundColor: t.colors.muted,\n borderRadius: borderRadius.sm,\n },\n outlined: {\n borderColor: t.colors.foreground,\n borderRadius: borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: hairline,\n },\n underline: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n },\n };\n\n const hasPadding =\n variant === \"box\" || variant === \"outlined\" || variant === \"ghost\";\n\n return StyleSheet.create({\n column: {\n flex: 1,\n },\n\n columnsRow: {\n flexDirection: \"row\",\n gap: spacing[4],\n },\n fieldAbove: {\n marginBottom: spacing[3],\n width: \"100%\",\n },\n fieldArea: {\n width: \"100%\" as const,\n ...fieldAreaByVariant[variant],\n },\n\n fieldLeft: {\n alignItems: \"flex-end\",\n flexDirection: \"row\",\n gap: spacing[2],\n marginBottom: spacing[3],\n },\n fieldLeftArea: {\n flex: 1,\n },\n\n formDivider: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n marginBottom: spacing[4],\n },\n formSubtitle: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n lineHeight: t.typography.body.lineHeight,\n marginBottom: spacing[3],\n },\n\n formTitle: {\n color: t.colors.foreground,\n fontFamily: t.typography.heading.fontFamily,\n fontSize: typography.xl,\n fontWeight: fontWeights.bold,\n lineHeight: t.typography.heading.lineHeight,\n marginBottom: spacing[1],\n },\n group: {\n marginBottom: spacing[5],\n },\n\n groupTitle: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.semibold,\n letterSpacing: 0.8,\n lineHeight: 1.2,\n marginBottom: spacing[3],\n textTransform: \"uppercase\",\n },\n hint: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n opacity: 0.14,\n paddingBottom: hasPadding ? spacing[1] : 0,\n paddingHorizontal: hasPadding ? spacing[2] : 0,\n paddingTop: hasPadding ? spacing[1] : spacing[0.5],\n },\n labelAbove: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.medium,\n letterSpacing: 0.5,\n lineHeight: 1.2,\n marginBottom: spacing[1],\n textTransform: \"uppercase\",\n },\n\n labelLeft: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.medium,\n lineHeight: t.typography.body.lineHeight,\n paddingBottom: hasPadding ? spacing[1] : 0,\n width: 80,\n },\n\n root: {\n marginBottom: t.spacing.componentGap,\n width: \"100%\",\n },\n });\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/form/form.tsx",
+ "content": "import { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, Text as PDFText } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\nimport { createFormStyles } from \"./form.styles\";\nimport type {\n FormLayout,\n PdfFormField,\n PdfFormGroup,\n PdfFormProps,\n} from \"./form.types\";\n\nfunction renderFieldAbove(\n field: PdfFormField,\n idx: number,\n styles: ReturnType<typeof createFormStyles>\n) {\n const areaHeight = field.height ?? 18;\n const areaStyle: Style[] = [styles.fieldArea, { minHeight: areaHeight }];\n\n return (\n <View key={`${field.label}-${idx}`} style={styles.fieldAbove}>\n <PDFText style={styles.labelAbove}>{field.label}</PDFText>\n <View style={areaStyle}>\n {field.hint ? (\n <PDFText style={styles.hint}>{field.hint}</PDFText>\n ) : null}\n </View>\n </View>\n );\n}\n\nfunction renderFieldLeft(\n field: PdfFormField,\n idx: number,\n styles: ReturnType<typeof createFormStyles>\n) {\n const areaHeight = field.height ?? 18;\n const areaStyle: Style[] = [\n styles.fieldArea,\n styles.fieldLeftArea,\n { minHeight: areaHeight },\n ];\n\n return (\n <View key={`${field.label}-${idx}`} style={styles.fieldLeft}>\n <PDFText style={styles.labelLeft}>{field.label}</PDFText>\n <View style={areaStyle}>\n {field.hint ? (\n <PDFText style={styles.hint}>{field.hint}</PDFText>\n ) : null}\n </View>\n </View>\n );\n}\n\nfunction renderGroup(\n group: PdfFormGroup,\n gi: number,\n styles: ReturnType<typeof createFormStyles>,\n labelPosition: \"above\" | \"left\"\n) {\n const layout: FormLayout = group.layout ?? \"single\";\n const cols = layout === \"three-column\" ? 3 : (layout === \"two-column\" ? 2 : 1);\n\n const renderField = (field: PdfFormField, idx: number) =>\n labelPosition === \"left\"\n ? renderFieldLeft(field, idx, styles)\n : renderFieldAbove(field, idx, styles);\n\n if (cols === 1) {\n return (\n <View key={`group-${gi}`} style={styles.group}>\n {group.title ? (\n <PDFText style={styles.groupTitle}>{group.title}</PDFText>\n ) : null}\n {group.fields.map(renderField)}\n </View>\n );\n }\n\n const chunkSize = Math.ceil(group.fields.length / cols);\n const chunks: PdfFormField[][] = [];\n for (let i = 0; i < group.fields.length; i += chunkSize) {\n chunks.push(group.fields.slice(i, i + chunkSize));\n }\n while (chunks.length < cols) {\n chunks.push([]);\n }\n\n return (\n <View key={`group-${gi}`} style={styles.group}>\n {group.title ? (\n <PDFText style={styles.groupTitle}>{group.title}</PDFText>\n ) : null}\n <View style={styles.columnsRow}>\n {chunks.map((chunk, ci) => (\n <View\n key={`col-${gi}-${chunk[0]?.label ?? ci}`}\n style={styles.column}\n >\n {chunk.map(renderField)}\n </View>\n ))}\n </View>\n </View>\n );\n}\n\nexport function PdfForm({\n title,\n subtitle,\n groups,\n variant = \"underline\",\n labelPosition = \"above\",\n noWrap = false,\n style,\n}: PdfFormProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(\n () => createFormStyles(theme, variant),\n [theme, variant]\n );\n\n const rootStyles: Style[] = [styles.root];\n if (style) {rootStyles.push(style);}\n\n const inner = (\n <View style={rootStyles}>\n {title ? <PDFText style={styles.formTitle}>{title}</PDFText> : null}\n {subtitle ? (\n <PDFText style={styles.formSubtitle}>{subtitle}</PDFText>\n ) : null}\n {title || subtitle ? <View style={styles.formDivider} /> : null}\n {groups.map((group, gi) => renderGroup(group, gi, styles, labelPosition))}\n </View>\n );\n\n return noWrap ? (\n <View style={[{ breakInside: \"avoid\" as const }].filter(Boolean)}>\n {inner}\n </View>\n ) : (\n inner\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/form/form.types.ts",
+ "content": "import type { Style } from \"../../lib/takumi-primitives\";\n\n/** Visual style variant for the fillable form. */\nexport type PdfFormVariant = \"underline\" | \"box\" | \"outlined\" | \"ghost\";\n\n/** Column layout for a form section. */\nexport type FormLayout = \"single\" | \"two-column\" | \"three-column\";\n\n/** Label position relative to the field. */\nexport type FormLabelPosition = \"above\" | \"left\";\n\n/**\n * A single fillable field definition.\n * Props - `label` | `hint` | `height` | `width`\n * @see {@link PdfFormField}\n */\nexport interface PdfFormField {\n label: string;\n hint?: string;\n /**\n * Height of the blank field area in points.\n * @default 18\n */\n height?: number;\n width?: number | string;\n}\n\n/**\n * A logical group of fields with an optional section title.\n * Props - `title` | `fields` | `layout`\n * @see {@link PdfFormGroup}\n */\nexport interface PdfFormGroup {\n title?: string;\n fields: PdfFormField[];\n /**\n * @default 'single'\n */\n layout?: FormLayout;\n}\n\n/**\n * Fillable PDF form with grouped fields, layout variants, and label positioning options.\n * Props - `title` | `subtitle` | `groups` | `variant` | `labelPosition` | `noWrap` | `style`\n * @see {@link PdfFormProps}\n */\nexport interface PdfFormProps {\n title?: string;\n subtitle?: string;\n groups: PdfFormGroup[];\n /**\n * @default 'underline'\n */\n variant?: PdfFormVariant;\n /**\n * @default 'above'\n */\n labelPosition?: FormLabelPosition;\n noWrap?: boolean;\n style?: Style;\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/form/index.ts",
+ "content": "export { PdfForm } from \"./form\";\nexport type {\n PdfFormProps,\n PdfFormVariant,\n PdfFormField,\n PdfFormGroup,\n FormLayout,\n FormLabelPosition,\n} from \"./form.types\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/takumi/graph.json b/public/r/takumi/graph.json
new file mode 100644
index 0000000..3e53293
--- /dev/null
+++ b/public/r/takumi/graph.json
@@ -0,0 +1,41 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/graph",
+ "title": "Graph",
+ "description": "Graph PDF component (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/graph/graph.styles.ts",
+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { StyleSheet } from \"../../lib/takumi-primitives\";\n\nexport function createGraphStyles(t: PdfcnTheme) {\n return StyleSheet.create({\n chartWithRightLegend: {\n alignItems: \"flex-start\",\n display: \"flex\",\n flexDirection: \"row\",\n },\n container: {\n display: \"flex\",\n flexDirection: \"column\",\n marginBottom: t.spacing.componentGap,\n },\n legendColumn: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n marginLeft: 12,\n marginTop: 18,\n minWidth: 120,\n },\n legendItem: {\n alignItems: \"center\",\n display: \"flex\",\n flexDirection: \"row\",\n gap: 4,\n },\n legendRow: {\n display: \"flex\",\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: 12,\n marginTop: 6,\n },\n legendText: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n },\n subtitle: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginBottom: 6,\n },\n title: {\n color: t.colors.foreground,\n fontFamily: t.typography.heading.fontFamily,\n fontSize: t.primitives.typography.base,\n fontWeight: t.primitives.fontWeights.semibold,\n marginBottom: 2,\n },\n });\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/graph/graph.tsx",
+ "content": "import type React from \"react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, Text as PDFText } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\nimport {\n Circle,\n G,\n Line,\n Path,\n Rect,\n Svg,\n SvgText,\n} from \"../../lib/takumi-svg\";\nimport { createGraphStyles } from \"./graph.styles\";\nimport type { ChartLayout, GraphProps, GraphSeries } from \"./graph.types\";\nimport {\n GRAPH_SAFE_WIDTHS,\n arcPath,\n buildLayout,\n fmtNum,\n getDefaultPalette,\n getGraphWidth,\n normalizeData,\n polarToCartesian,\n smoothPath,\n truncate,\n} from \"./graph.utils\";\n\n/**\n * Shared Y-axis grid lines and tick labels for cartesian charts (bar, line, area).\n * Extracted to avoid duplicating the identical block across render functions.\n */\nfunction renderGridAndYAxis(\n ticks: number[],\n toY: (v: number) => number,\n chartX: number,\n chartW: number,\n showGrid: boolean,\n gridColor: string,\n textColor: string\n) {\n return (\n <>\n {ticks.map((tick) => {\n const ty = toY(tick);\n return (\n <G key={`grid-${tick}`}>\n {showGrid && (\n <Line\n x1={chartX}\n y1={ty}\n x2={chartX + chartW}\n y2={ty}\n stroke={gridColor}\n strokeWidth={0.5}\n strokeDasharray=\"3 3\"\n />\n )}\n <SvgText\n x={chartX - 4}\n y={ty + 3}\n fill={textColor}\n textAnchor=\"end\"\n style={{ fontSize: 7 }}\n >\n {fmtNum(tick)}\n </SvgText>\n </G>\n );\n })}\n </>\n );\n}\n\nfunction renderBarChart(\n series: GraphSeries[],\n layout: ChartLayout,\n palette: string[],\n showGrid: boolean,\n showValues: boolean,\n theme: PdfcnTheme\n) {\n const { chartX, chartY, chartW, chartH, yMin, yMax, yTicks, xLabels } =\n layout;\n const nCategories = xLabels.length;\n const nSeries = series.length;\n const groupGap = 0.25;\n const groupW = chartW / nCategories;\n const barW = (groupW * (1 - groupGap)) / nSeries;\n const textColor = theme.colors.mutedForeground;\n const gridColor = theme.colors.border;\n const axisColor = theme.colors.foreground;\n const range = yMax - yMin || 1;\n const toY = (v: number) => chartY + chartH - ((v - yMin) / range) * chartH;\n\n return (\n <>\n {renderGridAndYAxis(\n yTicks,\n toY,\n chartX,\n chartW,\n showGrid,\n gridColor,\n textColor\n )}\n\n <Line\n x1={chartX}\n y1={chartY + chartH}\n x2={chartX + chartW}\n y2={chartY + chartH}\n stroke={axisColor}\n strokeWidth={1}\n />\n\n {xLabels.map((label, ci) => {\n const groupLeft = chartX + ci * groupW + groupW * (groupGap / 2);\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <G key={`group-${ci}`}>\n {series.map((s, si) => {\n const val = s.data[ci]?.value ?? 0;\n const color =\n s.data[ci]?.color ?? s.color ?? palette[si % palette.length];\n const barH = ((val - yMin) / range) * chartH;\n const bx = groupLeft + si * barW;\n const by = chartY + chartH - barH;\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <G key={`bar-${ci}-${si}`}>\n <Rect\n x={bx}\n y={by}\n width={barW - 1}\n height={barH}\n fill={color}\n />\n {showValues && barH > 10 && (\n <SvgText\n x={bx + barW / 2 - 0.5}\n y={by - 2}\n fill={axisColor}\n textAnchor=\"middle\"\n style={{ fontSize: 6 }}\n >\n {fmtNum(val)}\n </SvgText>\n )}\n </G>\n );\n })}\n <SvgText\n x={groupLeft + (nSeries * barW) / 2}\n y={chartY + chartH + 10}\n fill={textColor}\n textAnchor=\"middle\"\n style={{ fontSize: 7 }}\n >\n {truncate(label, 10)}\n </SvgText>\n </G>\n );\n })}\n </>\n );\n}\n\nfunction renderHorizontalBarChart(\n series: GraphSeries[],\n layout: ChartLayout,\n palette: string[],\n showValues: boolean,\n theme: PdfcnTheme\n) {\n const { chartX, chartY, chartW, chartH, xLabels } = layout;\n const nCategories = xLabels.length;\n const allValues = series.flatMap((s) => s.data.map((d) => d.value));\n const maxVal = Math.max(...allValues, 1);\n const rowH = chartH / nCategories;\n const barH = rowH * 0.5;\n const textColor = theme.colors.mutedForeground;\n const axisColor = theme.colors.foreground;\n const labelW = 60;\n\n return (\n <>\n {xLabels.map((label, ci) => {\n const rowY = chartY + ci * rowH;\n const val = series[0]?.data[ci]?.value ?? 0;\n const color =\n series[0]?.data[ci]?.color ??\n series[0]?.color ??\n palette[ci % palette.length];\n const barW = (val / maxVal) * (chartW - labelW);\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <G key={`hbar-${ci}`}>\n <SvgText\n x={chartX + labelW - 4}\n y={rowY + rowH / 2 + 3}\n fill={textColor}\n textAnchor=\"end\"\n style={{ fontSize: 7 }}\n >\n {truncate(label, 14)}\n </SvgText>\n <Rect\n x={chartX + labelW}\n y={rowY + (rowH - barH) / 2}\n width={Math.max(barW, 1)}\n height={barH}\n fill={color}\n />\n {showValues && (\n <SvgText\n x={chartX + labelW + barW + 3}\n y={rowY + rowH / 2 + 3}\n fill={axisColor}\n textAnchor=\"start\"\n style={{ fontSize: 6 }}\n >\n {fmtNum(val)}\n </SvgText>\n )}\n </G>\n );\n })}\n <Line\n x1={chartX + labelW}\n y1={chartY}\n x2={chartX + labelW}\n y2={chartY + chartH}\n stroke={axisColor}\n strokeWidth={1}\n />\n </>\n );\n}\n\nfunction renderLineAreaChart(\n series: GraphSeries[],\n layout: ChartLayout,\n palette: string[],\n showGrid: boolean,\n showValues: boolean,\n showDots: boolean,\n smooth: boolean,\n isArea: boolean,\n theme: PdfcnTheme\n) {\n const { chartX, chartY, chartW, chartH, yMin, yMax, yTicks, xLabels } =\n layout;\n const range = yMax - yMin || 1;\n const textColor = theme.colors.mutedForeground;\n const gridColor = theme.colors.border;\n const axisColor = theme.colors.foreground;\n const nPoints = xLabels.length;\n\n const xFor = (i: number) => chartX + (i / Math.max(nPoints - 1, 1)) * chartW;\n const yFor = (v: number) => chartY + chartH - ((v - yMin) / range) * chartH;\n\n return (\n <>\n {renderGridAndYAxis(\n yTicks,\n yFor,\n chartX,\n chartW,\n showGrid,\n gridColor,\n textColor\n )}\n\n <Line\n x1={chartX}\n y1={chartY + chartH}\n x2={chartX + chartW}\n y2={chartY + chartH}\n stroke={axisColor}\n strokeWidth={1}\n />\n\n {series.map((s, si) => {\n const color = s.color ?? palette[si % palette.length];\n const points = s.data.map((d, i) => ({ x: xFor(i), y: yFor(d.value) }));\n\n const lineDStr = smooth\n ? smoothPath(points)\n : `M ${points.map((p) => `${p.x} ${p.y}`).join(\" L \")}`;\n\n const areaPath =\n isArea && points.length > 1\n ? `${lineDStr} L ${points.at(-1)!.x} ${chartY + chartH} L ${points[0]!.x} ${chartY + chartH} Z`\n : null;\n\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <G key={`series-${si}`}>\n {isArea && areaPath && (\n <Path d={areaPath} fill={color} fillOpacity={0.2} stroke=\"none\" />\n )}\n <Path d={lineDStr} stroke={color} strokeWidth={2} fill=\"none\" />\n {showDots &&\n points.map((p, pi) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <Circle\n key={`dot-${pi}`}\n cx={p.x}\n cy={p.y}\n r={3}\n fill={color}\n />\n ))}\n {showValues &&\n points.map((p, pi) => (\n <SvgText\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n key={`val-${pi}`}\n x={p.x}\n y={p.y - 5}\n fill={color}\n textAnchor=\"middle\"\n style={{ fontSize: 6 }}\n >\n {fmtNum(s.data[pi].value)}\n </SvgText>\n ))}\n </G>\n );\n })}\n\n {xLabels.map((label, i) => (\n <SvgText\n key={`xlabel-${label}`}\n x={xFor(i)}\n y={chartY + chartH + 10}\n fill={textColor}\n textAnchor=\"middle\"\n style={{ fontSize: 7 }}\n >\n {truncate(label, 8)}\n </SvgText>\n ))}\n </>\n );\n}\n\nfunction renderPieDonutChart(\n series: GraphSeries[],\n layout: ChartLayout,\n palette: string[],\n centerLabel: string | undefined,\n isDonut: boolean,\n theme: PdfcnTheme\n) {\n const { svgW, svgH } = layout;\n const cx = svgW / 2;\n const cy = svgH / 2;\n const r = Math.min(svgW, svgH) / 2 - 20;\n const innerR = isDonut ? r * 0.52 : 0;\n const textColor = theme.colors.mutedForeground;\n\n const data = series[0]?.data ?? [];\n const total = data.reduce((sum, d) => sum + d.value, 0) || 1;\n\n let currentAngle = 0;\n\n return (\n <>\n {data.map((d, i) => {\n const color = d.color ?? palette[i % palette.length];\n const sweep = (d.value / total) * 360;\n const midAngle = currentAngle + sweep / 2;\n const path = arcPath(\n cx,\n cy,\n r,\n currentAngle,\n currentAngle + sweep,\n innerR\n );\n currentAngle += sweep;\n\n const labelR = r * 1.18;\n const lp = polarToCartesian(cx, cy, labelR, midAngle);\n const anchor = lp.x > cx ? \"start\" : \"end\";\n\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <G key={`slice-${i}`}>\n <Path d={path} fill={color} stroke=\"white\" strokeWidth={1} />\n {/* Show label only if slice is large enough to label */}\n {sweep > 15 && (\n <SvgText\n x={lp.x}\n y={lp.y + 3}\n fill={textColor}\n textAnchor={anchor}\n style={{ fontSize: 7 }}\n >\n {truncate(d.label, 10)}\n </SvgText>\n )}\n </G>\n );\n })}\n\n {isDonut && centerLabel && (\n <>\n <Circle cx={cx} cy={cy} r={innerR} fill=\"white\" />\n <SvgText\n x={cx}\n y={cy + 4}\n fill={theme.colors.foreground}\n textAnchor=\"middle\"\n style={{ fontSize: 9, fontWeight: \"bold\" }}\n >\n {centerLabel}\n </SvgText>\n </>\n )}\n </>\n );\n}\n\nfunction Legend({\n series,\n palette,\n styles,\n position = \"bottom\",\n}: {\n series: GraphSeries[];\n palette: string[];\n styles: ReturnType<typeof createGraphStyles>;\n position?: \"bottom\" | \"right\";\n}) {\n const containerStyle =\n position === \"right\" ? styles.legendColumn : styles.legendRow;\n\n return (\n <View style={containerStyle}>\n {series.map((s, i) => (\n <View key={s.name} style={styles.legendItem}>\n <Svg width={10} height={10}>\n <Rect\n x={0}\n y={2}\n width={8}\n height={8}\n fill={s.color ?? palette[i % palette.length]}\n />\n </Svg>\n <PDFText style={styles.legendText}>{s.name}</PDFText>\n </View>\n ))}\n </View>\n );\n}\n\n/**\n * PdfGraph — renders bar, horizontal-bar, line, area, pie, and donut charts\n * natively inside react-pdf documents using SVG primitives.\n *\n * No external chart libraries are required or used — all rendering is done via\n * react-pdf's built-in SVG support (`<Svg>`, `<Rect>`, `<Path>`, `<Line>`, etc.).\n *\n * @example Bar chart\n * ```tsx\n * <PdfGraph\n * variant=\"bar\"\n * title=\"Monthly Revenue\"\n * data={[\n * { label: 'Jan', value: 42000 },\n * { label: 'Feb', value: 38000 },\n * { label: 'Mar', value: 55000 },\n * ]}\n * />\n * ```\n *\n * @example Donut chart with center label\n * ```tsx\n * <PdfGraph\n * variant=\"donut\"\n * data={[\n * { label: 'Product A', value: 45 },\n * { label: 'Product B', value: 30 },\n * { label: 'Other', value: 25 },\n * ]}\n * centerLabel=\"$1.2M\"\n * />\n * ```\n *\n * **Limitations (by design):**\n * - No interactivity (PDFs are static)\n * - No animations\n * - SVG Text inside charts uses SVG font attributes (not react-pdf StyleSheet fonts)\n * - For print PDFs use SVG-friendly fonts registered with Font.register()\n */\nexport function PdfGraph({\n variant = \"bar\",\n data,\n title,\n subtitle,\n xLabel,\n yLabel,\n width: explicitWidth,\n height = 260,\n fullWidth = false,\n containerPadding = 0,\n wrapperPadding = 0,\n colors,\n showValues = false,\n showGrid = true,\n legend = \"bottom\",\n centerLabel,\n showDots = true,\n smooth = false,\n yTicks: yTickCount = 5,\n noWrap = true,\n style,\n}: GraphProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createGraphStyles(theme), [theme]);\n const palette = colors ?? getDefaultPalette(theme);\n const series = normalizeData(data);\n\n const width = useSafeMemo(() => {\n if (fullWidth)\n {return getGraphWidth(theme, { containerPadding, wrapperPadding });}\n return explicitWidth ?? GRAPH_SAFE_WIDTHS.default;\n }, [fullWidth, explicitWidth, theme, containerPadding, wrapperPadding]);\n\n const isPieOrDonut = variant === \"pie\" || variant === \"donut\";\n const layout = buildLayout(series, width, height, isPieOrDonut, yTickCount);\n const { chartX, chartW } = layout;\n\n let chartContent: React.ReactNode = null;\n\n switch (variant) {\n case \"bar\": {\n chartContent = renderBarChart(\n series,\n layout,\n palette,\n showGrid,\n showValues,\n theme\n );\n break;\n }\n case \"horizontal-bar\": {\n chartContent = renderHorizontalBarChart(\n series,\n layout,\n palette,\n showValues,\n theme\n );\n break;\n }\n case \"line\":\n case \"area\": {\n chartContent = renderLineAreaChart(\n series,\n layout,\n palette,\n showGrid,\n showValues,\n showDots,\n smooth,\n variant === \"area\",\n theme\n );\n break;\n }\n case \"pie\": {\n chartContent = renderPieDonutChart(\n series,\n layout,\n palette,\n undefined,\n false,\n theme\n );\n break;\n }\n case \"donut\": {\n chartContent = renderPieDonutChart(\n series,\n layout,\n palette,\n centerLabel,\n true,\n theme\n );\n break;\n }\n }\n\n const showLegend = legend !== \"none\" && !isPieOrDonut;\n\n const containerStyles: Style[] = [styles.container];\n if (style) {containerStyles.push(style);}\n\n const content = (\n <View style={containerStyles}>\n {title && <PDFText style={styles.title}>{title}</PDFText>}\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n <View\n style={legend === \"right\" ? styles.chartWithRightLegend : undefined}\n >\n <Svg width={width} height={height}>\n {chartContent}\n {!isPieOrDonut && xLabel && (\n <SvgText\n x={chartX + chartW / 2}\n y={height - 2}\n fill={theme.colors.mutedForeground}\n textAnchor=\"middle\"\n style={{ fontSize: 8 }}\n >\n {xLabel}\n </SvgText>\n )}\n {!isPieOrDonut && yLabel && (\n <SvgText\n x={2}\n y={10}\n fill={theme.colors.mutedForeground}\n textAnchor=\"start\"\n style={{ fontSize: 8 }}\n >\n {yLabel}\n </SvgText>\n )}\n </Svg>\n {showLegend &&\n legend === \"right\" &&\n Legend({ palette, position: \"right\", series, styles })}\n </View>\n {showLegend &&\n legend === \"bottom\" &&\n Legend({ palette, position: \"bottom\", series, styles })}\n </View>\n );\n\n return noWrap ? (\n <View style={[{ breakInside: \"avoid\" as const }].filter(Boolean)}>\n {content}\n </View>\n ) : (\n content\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/graph/graph.types.ts",
+ "content": "import type { Style } from \"../../lib/takumi-primitives\";\n\n/**\n * Options for calculating graph width based on theme page margins and container context.\n * Props - `containerPadding` | `wrapperPadding` | `pageWidth`\n * @see {@link GraphWidthOptions}\n */\nexport interface GraphWidthOptions {\n containerPadding?: number;\n wrapperPadding?: number;\n pageWidth?: number;\n}\n\nexport type GraphVariant =\n | \"bar\"\n | \"horizontal-bar\"\n | \"line\"\n | \"area\"\n | \"pie\"\n | \"donut\";\n\nexport type GraphLegendPosition = \"bottom\" | \"right\" | \"none\";\n\n/**\n * A single data point with a label, numeric value, and optional color override.\n * Props - `label` | `value` | `color`\n * @see {@link GraphDataPoint}\n */\nexport interface GraphDataPoint {\n label: string;\n value: number;\n color?: string;\n}\n\n/**\n * A named data series containing multiple data points, used for multi-series charts.\n * Props - `name` | `data` | `color`\n * @see {@link GraphSeries}\n */\nexport interface GraphSeries {\n name: string;\n data: GraphDataPoint[];\n color?: string;\n}\n\n/**\n * Multi-variant PDF chart (bar, line, area, pie, donut) rendered with SVG primitives.\n * Props - `variant` | `data` | `title` | `subtitle` | `xLabel` | `yLabel` | `width` | `height` | `fullWidth` | `containerPadding` | `wrapperPadding` | `colors` | `showValues` | `showGrid` | `legend` | `centerLabel` | `showDots` | `smooth` | `yTicks` | `noWrap` | `style`\n * @see {@link GraphProps}\n */\nexport interface GraphProps {\n /**\n * @default 'bar'\n */\n variant?: GraphVariant;\n data: GraphDataPoint[] | GraphSeries[];\n title?: string;\n subtitle?: string;\n xLabel?: string;\n yLabel?: string;\n /**\n * @default 420\n */\n width?: number;\n /**\n * @default 260\n */\n height?: number;\n /**\n * @default false\n */\n fullWidth?: boolean;\n containerPadding?: number;\n wrapperPadding?: number;\n colors?: string[];\n /**\n * @default false\n */\n showValues?: boolean;\n /**\n * @default true\n */\n showGrid?: boolean;\n /**\n * @default 'bottom'\n */\n legend?: GraphLegendPosition;\n centerLabel?: string;\n /**\n * @default true\n */\n showDots?: boolean;\n /**\n * @default false\n */\n smooth?: boolean;\n /**\n * @default 5\n */\n yTicks?: number;\n /**\n * @default true\n */\n noWrap?: boolean;\n style?: Style;\n}\n\n/** Internal chart layout dimensions computed from props and data. */\nexport interface ChartLayout {\n svgW: number;\n svgH: number;\n chartX: number;\n chartY: number;\n chartW: number;\n chartH: number;\n yMin: number;\n yMax: number;\n yTicks: number[];\n xLabels: string[];\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/graph/graph.utils.ts",
+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport type {\n ChartLayout,\n GraphDataPoint,\n GraphSeries,\n GraphWidthOptions,\n} from \"./graph.types\";\n\n/** Standard A4 page width in PDF points. */\nexport const A4_WIDTH = 595;\n\n/**\n * Pre-calculated safe graph widths for common scenarios.\n * These values work with all built-in themes on A4 pages.\n */\nexport const GRAPH_SAFE_WIDTHS = {\n /** Safe width for graph directly in page content (no extra containers) */\n default: 420,\n /** Safe width for graph inside a Section with md padding */\n inSection: 400,\n /** Safe width for graph inside a Section + bordered wrapper (like graphShell) */\n inSectionWithWrapper: 380,\n} as const;\n\n/**\n * Calculate the safe graph width based on theme page margins and container context.\n *\n * This utility ensures graphs don't overflow their container by accounting for:\n * - Page margins (from theme)\n * - Container padding (e.g., Section component)\n * - Wrapper padding (e.g., a bordered graphShell View)\n *\n * @example\n * ```tsx\n * const width = getGraphWidth(theme);\n * // For a graph inside a Section with padding=\"md\" (12pt) and a graphShell (12pt):\n * const width = getGraphWidth(theme, { containerPadding: 12, wrapperPadding: 12 });\n * ```\n */\nexport function getGraphWidth(\n theme: PdfcnTheme,\n options: GraphWidthOptions = {}\n): number {\n const {\n containerPadding = 0,\n wrapperPadding = 0,\n pageWidth = A4_WIDTH,\n } = options;\n const { marginLeft, marginRight } = theme.spacing.page;\n const availableWidth =\n pageWidth -\n marginLeft -\n marginRight -\n containerPadding * 2 -\n wrapperPadding * 2;\n return Math.max(Math.floor(availableWidth), 100);\n}\n\nexport const CHART_MARGINS = {\n axisBottom: 24,\n axisLeft: 40,\n pieBottom: 10,\n pieLeft: 10,\n right: 10,\n top: 10,\n} as const;\n\n/** Normalize to always work with GraphSeries[]. */\nexport function normalizeData(\n data: GraphDataPoint[] | GraphSeries[]\n): GraphSeries[] {\n if (data.length === 0) {return [];}\n if (\"label\" in data[0] && \"value\" in data[0]) {\n return [{ data: data as GraphDataPoint[], name: \"Series 1\" }];\n }\n return data as GraphSeries[];\n}\n\n/** Compute nice Y-axis ticks for a given value range. */\nexport function computeYTicks(\n min: number,\n max: number,\n count: number\n): number[] {\n if (min === max) {return [0, max || 1];}\n const step = (max - min) / (count - 1);\n return Array.from({ length: count }, (_, i) => {\n const v = min + i * step;\n return Math.round(v * 100) / 100;\n });\n}\n\n/** Format a number for display on axis labels. */\nexport function fmtNum(v: number): string {\n if (Math.abs(v) >= 1_000_000) {return `${(v / 1_000_000).toFixed(1)}M`;}\n if (Math.abs(v) >= 1000) {return `${(v / 1_000).toFixed(1)}K`;}\n if (!Number.isInteger(v)) {return v.toFixed(1);}\n return String(v);\n}\n\n/** Truncate a label to at most maxLen characters. */\nexport function truncate(s: string, maxLen: number): string {\n return s.length > maxLen ? `${s.slice(0, maxLen - 1)}…` : s;\n}\n\n/** Polar to Cartesian coordinate conversion for pie/donut arcs. */\nexport function polarToCartesian(\n cx: number,\n cy: number,\n r: number,\n angleDeg: number\n) {\n const rad = ((angleDeg - 90) * Math.PI) / 180;\n return { x: cx + r * Math.cos(rad), y: cy + r * Math.sin(rad) };\n}\n\n/** Build an SVG arc path for a pie/donut slice. */\nexport function arcPath(\n cx: number,\n cy: number,\n r: number,\n startAngle: number,\n endAngle: number,\n innerR = 0\n): string {\n const safeEnd = Math.min(endAngle, startAngle + 359.999);\n const large = safeEnd - startAngle > 180 ? 1 : 0;\n const s = polarToCartesian(cx, cy, r, safeEnd);\n const e = polarToCartesian(cx, cy, r, startAngle);\n if (innerR === 0) {\n return `M ${cx} ${cy} L ${s.x} ${s.y} A ${r} ${r} 0 ${large} 0 ${e.x} ${e.y} Z`;\n }\n const si = polarToCartesian(cx, cy, innerR, safeEnd);\n const ei = polarToCartesian(cx, cy, innerR, startAngle);\n return [\n `M ${s.x} ${s.y}`,\n `A ${r} ${r} 0 ${large} 0 ${e.x} ${e.y}`,\n `L ${ei.x} ${ei.y}`,\n `A ${innerR} ${innerR} 0 ${large} 1 ${si.x} ${si.y}`,\n \"Z\",\n ].join(\" \");\n}\n\n/** Compute smooth bezier control points (Catmull-Rom → cubic bezier). */\nexport function smoothPath(\n points: { x: number; y: number }[],\n tension = 0.4\n): string {\n if (points.length < 2) {return \"\";}\n if (points.length === 2) {\n return `M ${points[0].x} ${points[0].y} L ${points[1].x} ${points[1].y}`;\n }\n const parts: string[] = [`M ${points[0].x} ${points[0].y}`];\n for (let i = 0; i < points.length - 1; i++) {\n const p0 = points[Math.max(i - 1, 0)];\n const p1 = points[i];\n const p2 = points[i + 1];\n const p3 = points[Math.min(i + 2, points.length - 1)];\n const cp1x = p1.x + (p2.x - p0.x) * tension;\n const cp1y = p1.y + (p2.y - p0.y) * tension;\n const cp2x = p2.x - (p3.x - p1.x) * tension;\n const cp2y = p2.y - (p3.y - p1.y) * tension;\n parts.push(`C ${cp1x} ${cp1y} ${cp2x} ${cp2y} ${p2.x} ${p2.y}`);\n }\n return parts.join(\" \");\n}\n\n/** Get the default chart color palette from the theme. */\nexport function getDefaultPalette(t: PdfcnTheme): string[] {\n return [\n t.colors.primary,\n t.colors.info ?? \"#3B82F6\",\n t.colors.success ?? \"#22C55E\",\n t.colors.warning ?? \"#F59E0B\",\n t.colors.destructive ?? \"#EF4444\",\n \"#8B5CF6\",\n \"#F97316\",\n \"#14B8A6\",\n ];\n}\n\n/** Derive ChartLayout from series data, SVG dimensions, and variant. */\nexport function buildLayout(\n series: GraphSeries[],\n width: number,\n height: number,\n isPieOrDonut: boolean,\n yTickCount: number\n): ChartLayout {\n const mL = isPieOrDonut ? CHART_MARGINS.pieLeft : CHART_MARGINS.axisLeft;\n const mB = isPieOrDonut ? CHART_MARGINS.pieBottom : CHART_MARGINS.axisBottom;\n const chartX = mL;\n const chartY = CHART_MARGINS.top;\n const chartW = width - mL - CHART_MARGINS.right;\n const chartH = height - CHART_MARGINS.top - mB;\n const allValues = series.flatMap((s) => s.data.map((d) => d.value));\n const rawMin = Math.min(...allValues, 0);\n const rawMax = Math.max(...allValues, 1);\n const yMin = Math.min(0, rawMin);\n const yMax = rawMax + (rawMax - yMin) * 0.08;\n return {\n chartH,\n chartW,\n chartX,\n chartY,\n svgH: height,\n svgW: width,\n xLabels: series[0]?.data.map((d) => d.label) ?? [],\n yMax,\n yMin,\n yTicks: computeYTicks(yMin, yMax, yTickCount),\n };\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/graph/index.ts",
+ "content": "export { PdfGraph } from \"./graph\";\nexport { A4_WIDTH, GRAPH_SAFE_WIDTHS, getGraphWidth } from \"./graph.utils\";\nexport type {\n GraphDataPoint,\n GraphLegendPosition,\n GraphProps,\n GraphSeries,\n GraphVariant,\n GraphWidthOptions,\n} from \"./graph.types\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/takumi/heading.json b/public/r/takumi/heading.json
new file mode 100644
index 0000000..10ef4a5
--- /dev/null
+++ b/public/r/takumi/heading.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/heading",
+ "title": "Heading",
+ "description": "Heading PDF component (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/heading/heading.tsx",
+ "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { Text, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type HeadingWeight = \"normal\" | \"medium\" | \"semibold\" | \"bold\";\nexport type HeadingTracking = \"tighter\" | \"tight\" | \"normal\" | \"wide\" | \"wider\";\n\n/**\n * PDF heading mapped to h1–h6 font sizes from the theme.\n * Props - `level` | `align` | `color` | `transform` | `weight` | `tracking` | `noMargin` | `keepWithNext` | `children` | `style`\n * @see {@link HeadingProps}\n */\nexport interface HeadingProps extends PDFComponentProps {\n /**\n * @default 1\n */\n level?: 1 | 2 | 3 | 4 | 5 | 6;\n /**\n * @default 'left'\n */\n align?: \"left\" | \"center\" | \"right\";\n color?: string;\n transform?: \"uppercase\" | \"lowercase\" | \"capitalize\";\n /**\n * @default 'bold'\n */\n weight?: HeadingWeight;\n /**\n * @default 'normal'\n */\n tracking?: HeadingTracking;\n /**\n * @default false\n */\n noMargin?: boolean;\n keepWithNext?: boolean;\n}\n\nfunction createHeadingStyles(t: PdfcnTheme) {\n const { heading } = t.typography;\n const { spacing, fontWeights, letterSpacing } = t.primitives;\n const { sectionGap, componentGap, paragraphGap } = t.spacing;\n const base = {\n color: t.colors.foreground,\n fontFamily: heading.fontFamily,\n fontWeight: fontWeights.bold,\n lineHeight: heading.lineHeight,\n };\n return StyleSheet.create({\n capitalize: { textTransform: \"capitalize\" },\n h1: {\n ...base,\n fontSize: heading.fontSize.h1,\n marginBottom: paragraphGap,\n marginTop: spacing[0],\n },\n h2: {\n ...base,\n fontSize: heading.fontSize.h2,\n marginBottom: paragraphGap,\n marginTop: sectionGap,\n },\n h3: {\n ...base,\n fontSize: heading.fontSize.h3,\n marginBottom: paragraphGap,\n marginTop: componentGap,\n },\n h4: {\n ...base,\n fontSize: heading.fontSize.h4,\n marginBottom: paragraphGap,\n marginTop: paragraphGap,\n },\n h5: {\n ...base,\n fontSize: heading.fontSize.h5,\n marginBottom: spacing[1],\n marginTop: paragraphGap,\n },\n h6: {\n ...base,\n fontSize: heading.fontSize.h6,\n marginBottom: spacing[1],\n marginTop: paragraphGap,\n },\n lowercase: { textTransform: \"lowercase\" },\n noMargin: { marginBottom: 0, marginTop: 0 },\n trackingNormal: { letterSpacing: letterSpacing.normal },\n trackingTight: { letterSpacing: letterSpacing.tight * 10 },\n trackingTighter: { letterSpacing: letterSpacing.tight * 15 },\n trackingWide: { letterSpacing: letterSpacing.wide * 10 },\n trackingWider: { letterSpacing: letterSpacing.wider * 10 },\n uppercase: {\n letterSpacing: letterSpacing.wider * 10,\n textTransform: \"uppercase\",\n },\n weightBold: { fontWeight: fontWeights.bold },\n weightMedium: { fontWeight: fontWeights.medium },\n weightNormal: { fontWeight: fontWeights.regular },\n weightSemibold: { fontWeight: fontWeights.semibold },\n });\n}\n\nexport function Heading({\n level = 1,\n align,\n color,\n transform,\n weight,\n tracking,\n noMargin,\n keepWithNext = true,\n children,\n style,\n}: HeadingProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createHeadingStyles(theme), [theme]);\n const safeLevel = Math.min(Math.max(Math.round(level), 1), 6) as\n | 1\n | 2\n | 3\n | 4\n | 5\n | 6;\n const weightMap = {\n bold: styles.weightBold,\n medium: styles.weightMedium,\n normal: styles.weightNormal,\n semibold: styles.weightSemibold,\n };\n const trackingMap = {\n normal: styles.trackingNormal,\n tight: styles.trackingTight,\n tighter: styles.trackingTighter,\n wide: styles.trackingWide,\n wider: styles.trackingWider,\n };\n const transformMap = {\n capitalize: styles.capitalize,\n lowercase: styles.lowercase,\n uppercase: styles.uppercase,\n };\n const styleArray: Style[] = [\n styles[`h${safeLevel}` as keyof typeof styles] as Style,\n ];\n if (weight && weight in weightMap) {styleArray.push(weightMap[weight]);}\n if (tracking && tracking in trackingMap)\n {styleArray.push(trackingMap[tracking]);}\n if (transform && transform in transformMap)\n {styleArray.push(transformMap[transform as keyof typeof transformMap]);}\n if (noMargin) {styleArray.push(styles.noMargin);}\n const semantic = {} as Style;\n if (align) {semantic.textAlign = align;}\n if (color) {semantic.color = resolveColor(color, theme.colors);}\n if (Object.keys(semantic).length > 0) {styleArray.push(semantic);}\n if (style) {styleArray.push(...[style].flat());}\n return <Text style={styleArray}>{children}</Text>;\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/heading/index.ts",
+ "content": "export {\n Heading,\n type HeadingProps,\n type HeadingWeight,\n type HeadingTracking,\n} from \"./heading\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/takumi/invoice-classic.json b/public/r/takumi/invoice-classic.json
new file mode 100644
index 0000000..aea8474
--- /dev/null
+++ b/public/r/takumi/invoice-classic.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/invoice-classic",
+ "title": "Invoice Classic",
+ "description": "Invoice Classic PDF block (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/invoice-classic/invoice-classic.tsx",
+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfImage,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { InvoiceClassicData } from \"./invoice-classic.types\";\n\n// Sample data — replace with your own props or data source\nconst sampleData: InvoiceClassicData = {\n billTo: {\n address: \"456 Client Ave, Suite 2\",\n email: \"[email protected]\",\n name: \"Client Corp.\",\n phone: \"+1 (555) 123-4567\",\n },\n companyAddress: \"City, Country\",\n companyEmail: \"[email protected]\",\n companyName: \"Your Company\",\n dueDate: \"March 17, 2026\",\n invoiceDate: \"February 17, 2026\",\n invoiceNumber: \"INV-2026-001\",\n items: [\n { description: \"Web Development\", quantity: 1, unitPrice: 12500 },\n { description: \"UI/UX Design\", quantity: 1, unitPrice: 8750 },\n { description: \"Consulting\", quantity: 10, unitPrice: 1500 },\n ],\n logo: \"/favicon.png\",\n notes: \"Thank you for your business!\",\n paymentTerms: {\n dueDate: \"March 17, 2026\",\n gst: \"GSTIN 123456789\",\n method: \"UPI / Card / Bank Transfer\",\n },\n subtitle: \"Professional Services\",\n summary: {\n subtotal: 36250,\n tax: 2537.5,\n total: 38787.5,\n },\n};\n\nexport function InvoiceClassicDocument({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceClassicData;\n}) {\n return (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceClassicContent data={data} />\n </PdfcnThemeProvider>\n );\n}\n\nfunction InvoiceClassicContent({ data }: { data: InvoiceClassicData }) {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n page: {\n backgroundColor: theme.colors.background,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" style={styles.page}>\n <PageHeader\n variant=\"logo-left\"\n logo={\n <PdfImage src={data.logo ?? \"/favicon.png\"} style={{ margin: 0 }} />\n }\n title={data.companyName}\n subtitle={data.subtitle}\n rightText={data.invoiceNumber}\n rightSubText={`Due: ${data.dueDate}`}\n style={{ marginBottom: 0 }}\n />\n <Section noWrap style={{ flexDirection: \"row\" }}>\n <View style={{ flex: 1, paddingRight: 15 }}>\n <Text\n style={{ fontSize: 9, fontWeight: \"bold\", marginBottom: 2 }}\n color=\"mutedForeground\"\n transform=\"uppercase\"\n noMargin\n >\n From\n </Text>\n <Text noMargin variant=\"xs\">\n {data.companyName}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.companyAddress}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.companyEmail}\n </Text>\n </View>\n <View style={{ flex: 1, paddingRight: 15 }}>\n <Text\n style={{ fontSize: 9, fontWeight: \"bold\", marginBottom: 2 }}\n color=\"mutedForeground\"\n transform=\"uppercase\"\n noMargin\n >\n Bill To\n </Text>\n <Text noMargin variant=\"xs\">\n {data.billTo.name}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.billTo.address}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.billTo.email}\n </Text>\n </View>\n <View style={{ flex: 1, paddingRight: 15 }}>\n <Text\n style={{ fontSize: 9, fontWeight: \"bold\", marginBottom: 2 }}\n color=\"mutedForeground\"\n transform=\"uppercase\"\n noMargin\n >\n Payment Terms\n </Text>\n <Text noMargin variant=\"xs\">\n {data.paymentTerms.method}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.paymentTerms.gst}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.paymentTerms.dueDate}\n </Text>\n </View>\n </Section>\n <Table variant=\"grid\" zebraStripe>\n <TableHeader>\n <TableRow header>\n <TableCell>Description</TableCell>\n <TableCell align=\"center\">QTY</TableCell>\n <TableCell align=\"center\">Rate</TableCell>\n <TableCell align=\"right\">Total</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: invoice items have no stable id\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"center\">{`$${item.unitPrice}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toFixed(2)}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={{ flexDirection: \"row\", marginTop: 16 }}>\n <View style={{ marginLeft: \"auto\", width: 220 }}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toFixed(2)}`,\n },\n { key: \"Tax\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Total\",\n keyStyle: { fontSize: 12, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: { fontSize: 12, fontWeight: \"bold\" },\n },\n ]}\n divided\n />\n </View>\n </Section>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </Page>\n </Document>\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/invoice-classic/invoice-classic.types.ts",
+ "content": "export interface InvoiceClassicData {\n invoiceNumber: string;\n invoiceDate: string;\n dueDate: string;\n companyName: string;\n subtitle: string;\n companyAddress: string;\n companyEmail: string;\n logo?: string;\n billTo: {\n name: string;\n address: string;\n email: string;\n phone: string;\n };\n items: {\n description: string;\n quantity: number;\n unitPrice: number;\n }[];\n summary: {\n subtotal: number;\n tax: number;\n total: number;\n };\n paymentTerms: {\n dueDate: string;\n method: string;\n gst: string;\n };\n notes?: string;\n}\n",
+ "type": "registry:block"
+ }
+ ],
+ "type": "registry:block"
+}
\ No newline at end of file
diff --git a/public/r/takumi/invoice-consultant.json b/public/r/takumi/invoice-consultant.json
new file mode 100644
index 0000000..a89ea0a
--- /dev/null
+++ b/public/r/takumi/invoice-consultant.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/invoice-consultant",
+ "title": "Invoice Consultant",
+ "description": "Invoice Consultant PDF block (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.tsx",
+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { InvoiceConsultantData } from \"./invoice-consultant.types\";\n\nconst sampleData: InvoiceConsultantData = {\n client: {\n address: \"500 Tech Park, Suite 200\",\n company: \"Acme Technologies\",\n email: \"[email protected]\",\n name: \"Sarah Johnson\",\n },\n companyAddress: \"City, Country · [email protected]\",\n companyName: \"Your Consulting\",\n consultant: {\n email: \"[email protected]\",\n name: \"John Smith\",\n title: \"Senior Technical Consultant\",\n },\n dueDate: \"March 28, 2026\",\n invoiceDate: \"February 26, 2026\",\n invoiceNumber: \"INV-2026-006\",\n notes:\n \"Services rendered for February 2026. All hours verified and approved by client.\",\n paymentTerms: {\n dueDate: \"March 28, 2026\",\n method: \"Bank Transfer / Check\",\n },\n projectRef: \"PROJ-2026-ACME-001\",\n services: [\n { description: \"Architecture Review & Planning\", hours: 16, rate: 175 },\n { description: \"Code Review & Optimization\", hours: 24, rate: 150 },\n { description: \"Technical Documentation\", hours: 12, rate: 125 },\n { description: \"Team Training & Knowledge Transfer\", hours: 8, rate: 200 },\n ],\n subtitle: \"Professional Consulting Services\",\n summary: {\n subtotal: 10300,\n tax: 515,\n total: 10815,\n totalHours: 60,\n },\n};\n\nexport function InvoiceConsultantDocument({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceConsultantData;\n}) {\n return (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceConsultantContent data={data} />\n </PdfcnThemeProvider>\n );\n}\n\nfunction InvoiceConsultantContent({ data }: { data: InvoiceConsultantData }) {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n calloutNote: {\n backgroundColor: theme.colors.muted,\n borderLeftColor: theme.colors.info,\n borderLeftStyle: \"solid\",\n borderLeftWidth: 3,\n marginTop: 16,\n paddingLeft: 12,\n paddingVertical: 8,\n },\n companyInfo: {\n flex: 1,\n },\n headerRow: {\n alignItems: \"flex-start\",\n borderBottomColor: theme.colors.primary,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 2,\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: theme.spacing.sectionGap,\n paddingBottom: theme.spacing.componentGap,\n },\n hoursBadge: {\n alignSelf: \"flex-start\",\n backgroundColor: theme.colors.primary,\n borderRadius: theme.primitives.borderRadius.sm,\n color: theme.colors.primaryForeground,\n paddingHorizontal: 12,\n paddingVertical: 8,\n },\n hoursBox: {\n flex: 1,\n paddingRight: 24,\n },\n invoiceInfo: {\n alignItems: \"flex-end\",\n },\n page: {\n backgroundColor: theme.colors.background,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n partiesRow: {\n flexDirection: \"row\",\n gap: 40,\n marginBottom: theme.spacing.sectionGap,\n },\n partyColumn: {\n flex: 1,\n },\n partyLabel: {\n borderBottomColor: theme.colors.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n color: theme.colors.primary,\n fontSize: 9,\n fontWeight: \"bold\",\n letterSpacing: 0.6,\n marginBottom: 6,\n paddingBottom: 4,\n textTransform: \"uppercase\",\n },\n projectRef: {\n alignItems: \"center\",\n backgroundColor: theme.colors.muted,\n borderRadius: theme.primitives.borderRadius.sm,\n flexDirection: \"row\",\n gap: 8,\n marginBottom: theme.spacing.sectionGap,\n paddingHorizontal: 10,\n paddingVertical: 6,\n },\n summaryRow: {\n flexDirection: \"row\",\n marginTop: 20,\n },\n totalsBox: {\n width: 250,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" style={styles.page}>\n <View style={styles.headerRow}>\n <View style={styles.companyInfo}>\n <Text variant=\"xl\" weight=\"bold\" noMargin>\n {data.companyName}\n </Text>\n <Text variant=\"sm\" color=\"mutedForeground\" noMargin>\n {data.subtitle}\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n {data.companyAddress}\n </Text>\n </View>\n <View style={styles.invoiceInfo}>\n <Text\n variant=\"xs\"\n color=\"mutedForeground\"\n transform=\"uppercase\"\n noMargin\n >\n Invoice\n </Text>\n <Text variant=\"lg\" weight=\"bold\" noMargin>\n {data.invoiceNumber}\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n {data.invoiceDate}\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Due: {data.dueDate}\n </Text>\n </View>\n </View>\n {data.projectRef && (\n <View style={styles.projectRef}>\n <Text\n variant=\"xs\"\n weight=\"semibold\"\n color=\"mutedForeground\"\n noMargin\n >\n Project Reference:\n </Text>\n <Text variant=\"xs\" weight=\"bold\" noMargin>\n {data.projectRef}\n </Text>\n </View>\n )}\n <View style={styles.partiesRow}>\n <View style={styles.partyColumn}>\n <Text style={styles.partyLabel} noMargin>\n From (Consultant)\n </Text>\n <Text variant=\"sm\" weight=\"semibold\" noMargin>\n {data.consultant.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.consultant.title}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.consultant.email}\n </Text>\n </View>\n <View style={styles.partyColumn}>\n <Text style={styles.partyLabel} noMargin>\n Bill To (Client)\n </Text>\n <Text variant=\"sm\" weight=\"semibold\" noMargin>\n {data.client.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.client.company}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.client.address}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.client.email}\n </Text>\n </View>\n </View>\n <Table variant=\"line\">\n <TableHeader>\n <TableRow header>\n <TableCell>Service Description</TableCell>\n <TableCell align=\"center\">Hours</TableCell>\n <TableCell align=\"right\">Rate ($/hr)</TableCell>\n <TableCell align=\"right\">Amount</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.services.map((service, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF list, no reordering\n <TableRow key={index}>\n <TableCell>{service.description}</TableCell>\n <TableCell align=\"center\">{`${service.hours}`}</TableCell>\n <TableCell align=\"right\">{`$${service.rate}`}</TableCell>\n <TableCell align=\"right\">{`$${(service.hours * service.rate).toLocaleString()}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={styles.summaryRow}>\n <View style={styles.hoursBox}>\n <View style={styles.hoursBadge}>\n <Text\n style={{\n color: theme.colors.primaryForeground,\n fontSize: 9,\n fontWeight: \"bold\",\n }}\n noMargin\n >\n Total Hours: {data.summary.totalHours}\n </Text>\n </View>\n <Text variant=\"xs\" color=\"mutedForeground\" style={{ marginTop: 8 }}>\n Payment: {data.paymentTerms.method}\n </Text>\n </View>\n <View style={styles.totalsBox}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toLocaleString()}`,\n },\n { key: \"Tax (5%)\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Amount Due\",\n keyStyle: { fontSize: 13, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: {\n color: theme.colors.primary,\n fontSize: 14,\n fontWeight: \"bold\",\n },\n },\n ]}\n divided\n />\n </View>\n </Section>\n {data.notes && (\n <View style={styles.calloutNote}>\n <Text variant=\"xs\" color=\"mutedForeground\">\n {data.notes}\n </Text>\n </View>\n )}\n <PageFooter\n leftText=\"Professional services invoice – Please retain for records\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </Page>\n </Document>\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.types.ts",
+ "content": "export interface InvoiceConsultantData {\n invoiceNumber: string;\n invoiceDate: string;\n dueDate: string;\n companyName: string;\n subtitle: string;\n companyAddress: string;\n consultant: {\n name: string;\n title: string;\n email: string;\n };\n client: {\n name: string;\n company: string;\n address: string;\n email: string;\n };\n services: {\n description: string;\n hours: number;\n rate: number;\n }[];\n summary: {\n totalHours: number;\n subtotal: number;\n tax: number;\n total: number;\n };\n paymentTerms: {\n dueDate: string;\n method: string;\n };\n projectRef?: string;\n notes?: string;\n}\n",
+ "type": "registry:block"
+ }
+ ],
+ "type": "registry:block"
+}
\ No newline at end of file
diff --git a/public/r/takumi/invoice-corporate.json b/public/r/takumi/invoice-corporate.json
new file mode 100644
index 0000000..c397978
--- /dev/null
+++ b/public/r/takumi/invoice-corporate.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/invoice-corporate",
+ "title": "Invoice Corporate",
+ "description": "Invoice Corporate PDF block (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.tsx",
+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfImage,\n PdfcnThemeProvider,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { InvoiceCorporateData } from \"./invoice-corporate.types\";\n\nconst sampleData: InvoiceCorporateData = {\n billTo: {\n address: \"100 Corporate Plaza, Tower B\",\n email: \"[email protected]\",\n name: \"Global Industries Ltd.\",\n phone: \"+1 (555) 888-9999\",\n },\n companyAddress: \"City, Country\",\n companyEmail: \"[email protected]\",\n companyName: \"Your Company\",\n dueDate: \"March 24, 2026\",\n invoiceDate: \"February 22, 2026\",\n invoiceNumber: \"INV-2026-004\",\n items: [\n {\n description: \"Enterprise Software License\",\n quantity: 5,\n unitPrice: 4500,\n },\n { description: \"Implementation Services\", quantity: 1, unitPrice: 18000 },\n { description: \"Training Workshop\", quantity: 3, unitPrice: 2500 },\n { description: \"Annual Support Package\", quantity: 1, unitPrice: 8500 },\n ],\n logo: \"/favicon.png\",\n notes: \"Corporate billing – Net 30 terms apply.\",\n paymentTerms: {\n dueDate: \"March 24, 2026\",\n gst: \"GSTIN 987654321\",\n method: \"Wire Transfer / Corporate Account\",\n },\n subtitle: \"Professional Services\",\n summary: {\n subtotal: 57000,\n tax: 4560,\n total: 61560,\n },\n};\n\nexport function InvoiceCorporateDocument({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceCorporateData;\n}) {\n return (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceCorporateContent data={data} />\n </PdfcnThemeProvider>\n );\n}\n\nfunction InvoiceCorporateContent({ data }: { data: InvoiceCorporateData }) {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n infoColumn: {\n flex: 1,\n },\n infoGrid: {\n flexDirection: \"row\",\n gap: 24,\n marginBottom: theme.spacing.sectionGap,\n },\n infoLabel: {\n color: theme.colors.mutedForeground,\n fontSize: 9,\n fontWeight: \"bold\",\n letterSpacing: 0.6,\n marginBottom: 6,\n textTransform: \"uppercase\",\n },\n page: {\n backgroundColor: theme.colors.background,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n summaryCard: {\n backgroundColor: theme.colors.muted,\n borderRadius: theme.primitives.borderRadius.md,\n marginTop: 20,\n padding: 16,\n },\n summaryRow: {\n flexDirection: \"row\",\n justifyContent: \"flex-end\",\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" style={styles.page}>\n <PageHeader\n variant=\"logo-right\"\n logo={\n <PdfImage\n src={data.logo ?? \"/favicon.png\"}\n width={56}\n height={56}\n style={{ margin: 0 }}\n />\n }\n title={data.companyName}\n subtitle={`${data.subtitle} · ${data.companyAddress}`}\n style={{ marginBottom: theme.spacing.sectionGap }}\n />\n <View style={styles.infoGrid}>\n <View style={styles.infoColumn}>\n <Text style={styles.infoLabel} noMargin>\n Invoice Details\n </Text>\n <KeyValue\n size=\"sm\"\n items={[\n { key: \"Invoice #\", value: data.invoiceNumber },\n { key: \"Issue Date\", value: data.invoiceDate },\n { key: \"Due Date\", value: data.dueDate },\n { key: \"Payment\", value: data.paymentTerms.method },\n ]}\n />\n </View>\n <View style={styles.infoColumn}>\n <Text style={styles.infoLabel} noMargin>\n Bill To\n </Text>\n <Text variant=\"sm\" weight=\"semibold\" noMargin>\n {data.billTo.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.address}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.email}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.phone}\n </Text>\n </View>\n </View>\n <Table variant=\"bordered\">\n <TableHeader>\n <TableRow header>\n <TableCell>Description</TableCell>\n <TableCell align=\"center\">Qty</TableCell>\n <TableCell align=\"right\">Unit Price</TableCell>\n <TableCell align=\"right\">Amount</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF list, no reordering\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"right\">{`$${item.unitPrice.toLocaleString()}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toLocaleString()}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <View style={styles.summaryCard}>\n <View style={styles.summaryRow}>\n <View style={{ width: 260 }}>\n <KeyValue\n size=\"md\"\n dividerThickness={1}\n dividerColor=\"border\"\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toLocaleString()}`,\n },\n { key: \"Tax (8%)\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Total Due\",\n keyStyle: { fontSize: 13, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: {\n color: theme.colors.primary,\n fontSize: 14,\n fontWeight: \"bold\",\n },\n },\n ]}\n divided\n />\n </View>\n </View>\n </View>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </Page>\n </Document>\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.types.ts",
+ "content": "export interface InvoiceCorporateData {\n invoiceNumber: string;\n invoiceDate: string;\n dueDate: string;\n companyName: string;\n subtitle: string;\n companyAddress: string;\n companyEmail: string;\n logo?: string;\n billTo: {\n name: string;\n address: string;\n email: string;\n phone: string;\n };\n items: {\n description: string;\n quantity: number;\n unitPrice: number;\n }[];\n summary: {\n subtotal: number;\n tax: number;\n total: number;\n };\n paymentTerms: {\n dueDate: string;\n method: string;\n gst: string;\n };\n notes?: string;\n}\n",
+ "type": "registry:block"
+ }
+ ],
+ "type": "registry:block"
+}
\ No newline at end of file
diff --git a/public/r/takumi/invoice-creative.json b/public/r/takumi/invoice-creative.json
new file mode 100644
index 0000000..e705c56
--- /dev/null
+++ b/public/r/takumi/invoice-creative.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/invoice-creative",
+ "title": "Invoice Creative",
+ "description": "Invoice Creative PDF block (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/invoice-creative/invoice-creative.tsx",
+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { InvoiceCreativeData } from \"./invoice-creative.types\";\n\nconst sampleData: InvoiceCreativeData = {\n billTo: {\n address: \"250 Design District, Loft 5\",\n email: \"[email protected]\",\n name: \"Creative Agency Co.\",\n phone: \"+1 (555) 321-7654\",\n },\n companyAddress: \"City, Country · [email protected]\",\n companyName: \"Your Agency\",\n dueDate: \"March 26, 2026\",\n invoiceDate: \"February 24, 2026\",\n invoiceNumber: \"INV-2026-005\",\n items: [\n { description: \"Brand Identity Design\", quantity: 1, unitPrice: 8500 },\n {\n description: \"Marketing Collateral Package\",\n quantity: 1,\n unitPrice: 4200,\n },\n {\n description: \"Social Media Assets (per set)\",\n quantity: 4,\n unitPrice: 750,\n },\n { description: \"Motion Graphics (30s)\", quantity: 2, unitPrice: 3500 },\n ],\n notes:\n \"Creative work is protected under copyright. Full usage rights transfer upon payment.\",\n paymentTerms: {\n dueDate: \"March 26, 2026\",\n gst: \"GSTIN 456789123\",\n method: \"Credit Card / PayPal / Stripe\",\n },\n subtitle: \"Creative Services\",\n summary: {\n subtotal: 22700,\n tax: 1475.5,\n total: 24175.5,\n },\n};\n\nexport function InvoiceCreativeDocument({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceCreativeData;\n}) {\n return (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceCreativeContent data={data} />\n </PdfcnThemeProvider>\n );\n}\n\nfunction InvoiceCreativeContent({ data }: { data: InvoiceCreativeData }) {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n accentBlock: {\n backgroundColor: theme.colors.muted,\n borderLeftColor: theme.colors.accent,\n borderLeftStyle: \"solid\",\n borderLeftWidth: 4,\n marginBottom: theme.spacing.sectionGap,\n paddingLeft: 14,\n paddingVertical: 10,\n },\n badgeLabel: {\n color: theme.colors.primaryForeground,\n fontSize: 8,\n fontWeight: \"bold\",\n letterSpacing: 1.2,\n marginBottom: 2,\n textTransform: \"uppercase\",\n },\n badgeNumber: {\n color: theme.colors.primaryForeground,\n fontSize: 16,\n fontWeight: \"bold\",\n },\n heroSection: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: theme.spacing.sectionGap,\n },\n infoColumn: {\n flex: 1,\n },\n infoGrid: {\n flexDirection: \"row\",\n gap: 32,\n },\n invoiceBadge: {\n alignItems: \"center\",\n backgroundColor: theme.colors.primary,\n borderRadius: theme.primitives.borderRadius.md,\n paddingHorizontal: 20,\n paddingVertical: 14,\n },\n page: {\n backgroundColor: theme.colors.background,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n sectionLabel: {\n color: theme.colors.accent,\n fontSize: 8,\n fontWeight: \"bold\",\n letterSpacing: 0.8,\n marginBottom: 6,\n textTransform: \"uppercase\",\n },\n summaryLeft: {\n flex: 1,\n paddingRight: 20,\n },\n summaryRight: {\n backgroundColor: theme.colors.muted,\n borderRadius: theme.primitives.borderRadius.sm,\n padding: 14,\n width: 240,\n },\n summarySection: {\n flexDirection: \"row\",\n marginTop: 24,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" style={styles.page}>\n <View style={styles.heroSection}>\n <View style={{ flex: 1 }}>\n <PageHeader\n variant=\"centered\"\n title={data.companyName}\n subtitle={`${data.subtitle} · ${data.companyAddress}`}\n marginBottom={0}\n />\n </View>\n <View style={styles.invoiceBadge}>\n <Text style={styles.badgeLabel} noMargin>\n Invoice\n </Text>\n <Text style={styles.badgeNumber} noMargin>\n {data.invoiceNumber}\n </Text>\n </View>\n </View>\n <View style={styles.accentBlock}>\n <View style={styles.infoGrid}>\n <View style={styles.infoColumn}>\n <Text style={styles.sectionLabel} noMargin>\n Billed To\n </Text>\n <Text variant=\"sm\" weight=\"semibold\" noMargin>\n {data.billTo.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.address}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.email} · {data.billTo.phone}\n </Text>\n </View>\n <View style={styles.infoColumn}>\n <Text style={styles.sectionLabel} noMargin>\n Invoice Info\n </Text>\n <KeyValue\n size=\"sm\"\n items={[\n { key: \"Issue Date\", value: data.invoiceDate },\n { key: \"Due Date\", value: data.dueDate },\n { key: \"Payment\", value: data.paymentTerms.method },\n ]}\n />\n </View>\n </View>\n </View>\n <Table variant=\"striped\" zebraStripe>\n <TableHeader>\n <TableRow header>\n <TableCell>Deliverable</TableCell>\n <TableCell align=\"center\">Qty</TableCell>\n <TableCell align=\"right\">Rate</TableCell>\n <TableCell align=\"right\">Amount</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF list, no reordering\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"right\">{`$${item.unitPrice.toLocaleString()}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toLocaleString()}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={styles.summarySection}>\n <View style={styles.summaryLeft}>\n <Text style={styles.sectionLabel} noMargin>\n Notes & Terms\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\">\n {data.notes}\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" style={{ marginTop: 4 }}>\n GST: {data.paymentTerms.gst}\n </Text>\n </View>\n <View style={styles.summaryRight}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toLocaleString()}`,\n },\n { key: \"Tax (6.5%)\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Total\",\n keyStyle: { fontSize: 13, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: {\n color: theme.colors.accent,\n fontSize: 14,\n fontWeight: \"bold\",\n },\n },\n ]}\n divided\n />\n </View>\n </Section>\n <PageFooter\n variant=\"centered\"\n centerText=\"Thank you for choosing us for your creative needs!\"\n sticky\n pagePadding={25}\n />\n </Page>\n </Document>\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/invoice-creative/invoice-creative.types.ts",
+ "content": "export interface InvoiceCreativeData {\n invoiceNumber: string;\n invoiceDate: string;\n dueDate: string;\n companyName: string;\n subtitle: string;\n companyAddress: string;\n billTo: {\n name: string;\n address: string;\n email: string;\n phone: string;\n };\n items: {\n description: string;\n quantity: number;\n unitPrice: number;\n }[];\n summary: {\n subtotal: number;\n tax: number;\n total: number;\n };\n paymentTerms: {\n dueDate: string;\n method: string;\n gst: string;\n };\n notes?: string;\n}\n",
+ "type": "registry:block"
+ }
+ ],
+ "type": "registry:block"
+}
\ No newline at end of file
diff --git a/public/r/takumi/invoice-minimal.json b/public/r/takumi/invoice-minimal.json
new file mode 100644
index 0000000..bff9aeb
--- /dev/null
+++ b/public/r/takumi/invoice-minimal.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/invoice-minimal",
+ "title": "Invoice Minimal",
+ "description": "Invoice Minimal PDF block (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.tsx",
+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { InvoiceMinimalData } from \"./invoice-minimal.types\";\n\n// Sample data — replace with your own props or data source\nconst sampleData: InvoiceMinimalData = {\n billTo: {\n address: \"500 Enterprise Way, Building A\",\n email: \"[email protected]\",\n name: \"Enterprise Corp\",\n phone: \"+1 (555) 246-8135\",\n },\n companyAddress: \"City, Country\",\n companyEmail: \"[email protected]\",\n companyName: \"Your Company\",\n dueDate: \"March 22, 2026\",\n invoiceDate: \"February 20, 2026\",\n invoiceNumber: \"INV-2026-003\",\n items: [\n { description: \"Annual Licenselan\", quantity: 1, unitPrice: 25000 },\n { description: \"Support & Maintenance\", quantity: 12, unitPrice: 1500 },\n { description: \"Custom Integration\", quantity: 1, unitPrice: 12000 },\n ],\n notes:\n \"Invoice for annual enterprise subscription. Please retain for your records.\",\n paymentTerms: {\n dueDate: \"March 22, 2026\",\n gst: \"GSTIN 123456789\",\n method: \"ACH Transfer / Check\",\n },\n subtitle: \"Professional Services\",\n summary: {\n subtotal: 55000,\n tax: 3850,\n total: 58850,\n },\n};\n\nexport function InvoiceMinimalDocument({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceMinimalData;\n}) {\n return (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceMinimalContent data={data} />\n </PdfcnThemeProvider>\n );\n}\n\nfunction InvoiceMinimalContent({ data }: { data: InvoiceMinimalData }) {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n infoLabel: {\n color: theme.colors.primary,\n fontSize: 8,\n fontWeight: \"bold\",\n letterSpacing: 0.8,\n marginBottom: 4,\n textTransform: \"uppercase\",\n },\n infoRow: {\n flexDirection: \"row\",\n marginBottom: theme.spacing.sectionGap,\n },\n invoiceStamp: {\n alignSelf: \"flex-start\",\n borderColor: theme.colors.primary,\n borderRadius: theme.primitives.borderRadius.sm,\n borderStyle: \"solid\",\n borderWidth: 2,\n paddingHorizontal: 12,\n paddingVertical: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" style={styles.page}>\n <Section\n noWrap\n style={{\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n marginBottom: theme.spacing.sectionGap,\n }}\n >\n <View style={{ flex: 1 }}>\n <PageHeader\n variant=\"minimal\"\n title={data.companyName}\n subtitle={`${data.companyAddress} · ${data.companyEmail}`}\n marginBottom={0}\n />\n </View>\n <View style={styles.invoiceStamp}>\n <Text\n style={{\n color: theme.colors.primary,\n fontSize: 7,\n fontWeight: \"bold\",\n textAlign: \"right\",\n }}\n noMargin\n transform=\"uppercase\"\n >\n Invoice\n </Text>\n <Text\n style={{\n color: theme.colors.foreground,\n fontSize: 14,\n fontWeight: \"bold\",\n textAlign: \"right\",\n }}\n noMargin\n >\n {data.invoiceNumber}\n </Text>\n <Text\n style={{\n color: theme.colors.mutedForeground,\n fontSize: 8,\n textAlign: \"right\",\n }}\n noMargin\n >\n {data.invoiceDate}\n </Text>\n </View>\n </Section>\n <View style={styles.infoRow}>\n <View style={{ flex: 1, paddingRight: 20 }}>\n <Text style={styles.infoLabel} noMargin>\n Bill To\n </Text>\n <Text variant=\"sm\" noMargin>\n {data.billTo.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.address}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.email}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.phone}\n </Text>\n </View>\n <View style={{ flex: 1 }}>\n <Text style={styles.infoLabel} noMargin>\n Invoice Details\n </Text>\n <KeyValue\n size=\"sm\"\n items={[\n { key: \"Due Date\", value: data.dueDate },\n { key: \"Payment\", value: data.paymentTerms.method },\n { key: \"GST\", value: data.paymentTerms.gst },\n ]}\n />\n </View>\n </View>\n <Table variant=\"compact\">\n <TableHeader>\n <TableRow header>\n <TableCell>Description</TableCell>\n <TableCell align=\"center\">Qty</TableCell>\n <TableCell align=\"right\">Rate</TableCell>\n <TableCell align=\"right\">Total</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: invoice items have no stable id\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"right\">{`$${item.unitPrice.toLocaleString()}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toFixed(2)}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={{ flexDirection: \"row\", marginTop: 20 }}>\n <View style={{ flex: 1 }} />\n <View style={{ width: 240 }}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toFixed(2)}`,\n },\n { key: \"Tax (7%)\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Balance Due\",\n keyStyle: { fontSize: 12, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: {\n color: theme.colors.primary,\n fontSize: 13,\n fontWeight: \"bold\",\n },\n },\n ]}\n divided\n />\n </View>\n </Section>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </Page>\n </Document>\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.types.ts",
+ "content": "export interface InvoiceMinimalData {\n invoiceNumber: string;\n invoiceDate: string;\n dueDate: string;\n companyName: string;\n subtitle: string;\n companyAddress: string;\n companyEmail: string;\n billTo: {\n name: string;\n address: string;\n email: string;\n phone: string;\n };\n items: {\n description: string;\n quantity: number;\n unitPrice: number;\n }[];\n summary: {\n subtotal: number;\n tax: number;\n total: number;\n };\n paymentTerms: {\n dueDate: string;\n method: string;\n gst: string;\n };\n notes?: string;\n}\n",
+ "type": "registry:block"
+ }
+ ],
+ "type": "registry:block"
+}
\ No newline at end of file
diff --git a/public/r/takumi/invoice-modern.json b/public/r/takumi/invoice-modern.json
new file mode 100644
index 0000000..4a0bf77
--- /dev/null
+++ b/public/r/takumi/invoice-modern.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/invoice-modern",
+ "title": "Invoice Modern",
+ "description": "Invoice Modern PDF block (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/invoice-modern/invoice-modern.tsx",
+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { InvoiceModernData } from \"./invoice-modern.types\";\n\n// Sample data — replace with your own props or data source\nconst sampleData: InvoiceModernData = {\n billTo: {\n address: \"789 Innovation Blvd, Floor 3\",\n email: \"[email protected]\",\n name: \"TechStart Solutions\",\n phone: \"+1 (555) 987-6543\",\n },\n companyAddress: \"City, Country\",\n companyEmail: \"[email protected]\",\n companyName: \"Your Company\",\n dueDate: \"March 20, 2026\",\n invoiceDate: \"February 18, 2026\",\n invoiceNumber: \"INV-2026-002\",\n items: [\n { description: \"API Integration\", quantity: 1, unitPrice: 15000 },\n { description: \"SEO\", quantity: 2, unitPrice: 5500 },\n { description: \"Security Audit\", quantity: 1, unitPrice: 7200 },\n ],\n notes: \"Payment terms: Net 30 days. Thank you for your business!\",\n paymentTerms: {\n dueDate: \"March 20, 2026\",\n gst: \"GSTIN 123456789\",\n method: \"Wire Transfer / Bank Account\",\n },\n subtitle: \"Professional Services\",\n summary: {\n subtotal: 33200,\n tax: 2324,\n total: 35524,\n },\n};\n\nexport function InvoiceModernDocument({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceModernData;\n}) {\n return (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceModernContent data={data} />\n </PdfcnThemeProvider>\n );\n}\n\nfunction InvoiceModernContent({ data }: { data: InvoiceModernData }) {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n dividerCol: {\n backgroundColor: theme.colors.border,\n marginRight: 12,\n width: 1,\n },\n metaCol: {\n flex: 1,\n paddingRight: 12,\n },\n metaLabel: {\n color: theme.colors.mutedForeground,\n fontSize: 8,\n fontWeight: \"bold\",\n letterSpacing: 0.5,\n marginBottom: 3,\n textTransform: \"uppercase\",\n },\n metaRow: {\n flexDirection: \"row\",\n marginBottom: theme.spacing.sectionGap,\n },\n metaValue: {\n color: theme.colors.foreground,\n fontSize: 9,\n },\n page: {\n backgroundColor: theme.colors.background,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" style={styles.page}>\n <PageHeader\n variant=\"branded\"\n title={data.companyName}\n subtitle={`${data.subtitle} · ${data.companyAddress} · ${data.companyEmail}`}\n />\n <View style={styles.metaRow}>\n <View style={styles.metaCol}>\n <Text style={styles.metaLabel} noMargin>\n Invoice Number\n </Text>\n <Text\n style={{ ...styles.metaValue, fontSize: 11, fontWeight: \"bold\" }}\n noMargin\n >\n {data.invoiceNumber}\n </Text>\n </View>\n <View style={styles.metaCol}>\n <Text style={styles.metaLabel} noMargin>\n Invoice Date\n </Text>\n <Text style={styles.metaValue} noMargin>\n {data.invoiceDate}\n </Text>\n </View>\n <View style={styles.metaCol}>\n <Text style={styles.metaLabel} noMargin>\n Due Date\n </Text>\n <Text style={styles.metaValue} noMargin>\n {data.dueDate}\n </Text>\n </View>\n <View style={styles.dividerCol} />\n <View style={{ flex: 2 }}>\n <Text style={styles.metaLabel} noMargin>\n Billed To\n </Text>\n <Text style={{ ...styles.metaValue, fontWeight: \"bold\" }} noMargin>\n {data.billTo.name}\n </Text>\n <Text\n style={{\n ...styles.metaValue,\n color: theme.colors.mutedForeground,\n }}\n noMargin\n >\n {data.billTo.address}\n </Text>\n <Text\n style={{\n ...styles.metaValue,\n color: theme.colors.mutedForeground,\n }}\n noMargin\n >\n {data.billTo.email}\n </Text>\n <Text\n style={{\n ...styles.metaValue,\n color: theme.colors.mutedForeground,\n }}\n noMargin\n >\n {data.billTo.phone}\n </Text>\n </View>\n </View>\n <Table variant=\"primary-header\">\n <TableHeader>\n <TableRow header>\n <TableCell>Description</TableCell>\n <TableCell align=\"center\">Qty</TableCell>\n <TableCell align=\"right\">Unit Price</TableCell>\n <TableCell align=\"right\">Amount</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: invoice items have no stable id\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"right\">{`$${item.unitPrice.toLocaleString()}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toFixed(2)}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={{ flexDirection: \"row\", marginTop: 16 }}>\n <View style={{ flex: 1, paddingRight: 20 }}>\n <Text style={styles.metaLabel} noMargin>\n Payment Method\n </Text>\n <Text variant=\"xs\" noMargin>\n {data.paymentTerms.method}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.paymentTerms.gst}\n </Text>\n </View>\n <View style={{ width: 220 }}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toFixed(2)}`,\n },\n { key: \"Tax (7%)\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Total Due\",\n keyStyle: { fontSize: 12, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: { fontSize: 12, fontWeight: \"bold\" },\n },\n ]}\n divided\n />\n </View>\n </Section>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </Page>\n </Document>\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/invoice-modern/invoice-modern.types.ts",
+ "content": "export interface InvoiceModernData {\n invoiceNumber: string;\n invoiceDate: string;\n dueDate: string;\n companyName: string;\n subtitle: string;\n companyAddress: string;\n companyEmail: string;\n billTo: {\n name: string;\n address: string;\n email: string;\n phone: string;\n };\n items: {\n description: string;\n quantity: number;\n unitPrice: number;\n }[];\n summary: {\n subtotal: number;\n tax: number;\n total: number;\n };\n paymentTerms: {\n dueDate: string;\n method: string;\n gst: string;\n };\n notes?: string;\n}\n",
+ "type": "registry:block"
+ }
+ ],
+ "type": "registry:block"
+}
\ No newline at end of file
diff --git a/public/r/takumi/keep-together.json b/public/r/takumi/keep-together.json
new file mode 100644
index 0000000..69f180a
--- /dev/null
+++ b/public/r/takumi/keep-together.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/keep-together",
+ "title": "Keep Together",
+ "description": "Keep Together PDF component (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/keep-together/keep-together.tsx",
+ "content": "import type { ReactNode } from \"react\";\n\nimport type { Style } from \"@/registry/themes\";\n\nimport { View } from \"../../lib/takumi-primitives\";\n\nexport interface KeepTogetherProps {\n children?: ReactNode;\n minPresenceAhead?: number;\n style?: Style;\n}\n\nexport function KeepTogether({ children, style }: KeepTogetherProps) {\n return (\n <View style={[{ breakInside: \"avoid\" }, style].filter(Boolean) as never}>\n {children}\n </View>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/keep-together/index.ts",
+ "content": "export { KeepTogether, type KeepTogetherProps } from \"./keep-together\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/takumi/key-value.json b/public/r/takumi/key-value.json
new file mode 100644
index 0000000..3415831
--- /dev/null
+++ b/public/r/takumi/key-value.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/key-value",
+ "title": "Key Value",
+ "description": "Key Value PDF component (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/key-value/key-value.tsx",
+ "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type KeyValueDirection = \"horizontal\" | \"vertical\";\nexport type KeyValueSize = \"sm\" | \"md\" | \"lg\";\n\n/**\n * A single key-value row with optional per-item color and style overrides.\n * Props - `key` | `value` | `valueColor` | `valueStyle` | `keyStyle`\n * @see {@link KeyValueEntry}\n */\nexport interface KeyValueEntry {\n key: string;\n value: string;\n valueColor?: string;\n valueStyle?: Style;\n keyStyle?: Style;\n}\n\n/**\n * List of key-value pairs with layout and style options.\n * Props - `items` | `direction` | `divided` | `size` | `labelFlex` | `labelColor` | `valueColor` | `boldValue` | `noWrap` | `dividerColor` | `dividerThickness` | `dividerMargin` | `style`\n * @see {@link KeyValueProps}\n */\nexport interface KeyValueProps extends Omit<PDFComponentProps, \"children\"> {\n items: KeyValueEntry[];\n /**\n * @default 'horizontal'\n */\n direction?: KeyValueDirection;\n /**\n * @default false\n */\n divided?: boolean;\n /**\n * @default 'md'\n */\n size?: KeyValueSize;\n /**\n * @default 1\n */\n labelFlex?: number;\n labelColor?: string;\n valueColor?: string;\n /**\n * @default false\n */\n boldValue?: boolean;\n /**\n * @default false\n */\n noWrap?: boolean;\n dividerColor?: string;\n dividerThickness?: number;\n dividerMargin?: number;\n}\n\nfunction createKeyValueStyles(t: PdfcnTheme) {\n const { spacing, fontWeights } = t.primitives;\n const c = t.colors;\n const { body } = t.typography;\n const keyBase = {\n color: c.mutedForeground,\n fontFamily: body.fontFamily,\n fontWeight: fontWeights.medium,\n };\n const valueBase = {\n color: c.foreground,\n fontFamily: body.fontFamily,\n fontWeight: fontWeights.regular,\n };\n return StyleSheet.create({\n container: { flexDirection: \"column\" },\n divider: {\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n },\n keyLg: { ...keyBase, fontSize: t.primitives.typography.base },\n keyMd: { ...keyBase, fontSize: body.fontSize },\n keySm: { ...keyBase, fontSize: t.primitives.typography.xs },\n rowHorizontal: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n paddingVertical: spacing[1],\n },\n rowVertical: {\n flexDirection: \"column\",\n marginBottom: t.spacing.paragraphGap,\n },\n valueBold: { fontWeight: fontWeights.bold },\n valueLg: { ...valueBase, fontSize: t.primitives.typography.base },\n valueMd: { ...valueBase, fontSize: body.fontSize },\n valueSm: { ...valueBase, fontSize: t.primitives.typography.xs },\n });\n}\n\nexport function KeyValue({\n items,\n direction = \"horizontal\",\n divided = false,\n size = \"md\",\n labelFlex = 1,\n labelColor,\n valueColor,\n boldValue = false,\n noWrap = false,\n dividerColor,\n dividerThickness,\n dividerMargin,\n style,\n}: KeyValueProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createKeyValueStyles(theme), [theme]);\n const keyStyleMap = {\n lg: styles.keyLg,\n md: styles.keyMd,\n sm: styles.keySm,\n } as Record<KeyValueSize, Style>;\n const valueStyleMap = {\n lg: styles.valueLg,\n md: styles.valueMd,\n sm: styles.valueSm,\n } as Record<KeyValueSize, Style>;\n const containerStyles: Style[] = [styles.container];\n if (style) {containerStyles.push(...[style].flat());}\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n {items.map((item, index) => {\n const isLast = index === items.length - 1;\n const keyStyles: Style[] = [keyStyleMap[size]];\n if (labelColor)\n {keyStyles.push({ color: resolveColor(labelColor, theme.colors) });}\n if (item.keyStyle) {keyStyles.push(item.keyStyle);}\n const valStyles: Style[] = [valueStyleMap[size]];\n if (boldValue) {valStyles.push(styles.valueBold);}\n const resolvedValueColor = item.valueColor ?? valueColor;\n if (resolvedValueColor)\n {valStyles.push({\n color: resolveColor(resolvedValueColor, theme.colors),\n });}\n if (item.valueStyle) {valStyles.push(item.valueStyle);}\n\n if (direction === \"horizontal\") {\n const rowStyles: Style[] = [styles.rowHorizontal];\n if (divided && !isLast) {\n const dividerStyle: Style = {};\n if (dividerColor)\n {dividerStyle.borderBottomColor = resolveColor(\n dividerColor,\n theme.colors\n );}\n if (dividerThickness)\n {dividerStyle.borderBottomWidth = dividerThickness;}\n if (dividerMargin) {dividerStyle.marginBottom = dividerMargin;}\n rowStyles.push({ ...styles.divider, ...dividerStyle });\n }\n return (\n <View key={item.key} style={rowStyles}>\n <PDFText style={[...keyStyles, { flex: labelFlex }]}>\n {item.key}\n </PDFText>\n <PDFText style={[...valStyles, { flex: 1, textAlign: \"right\" }]}>\n {item.value}\n </PDFText>\n </View>\n );\n }\n\n const rowStyles: Style[] = [styles.rowVertical];\n if (divided && !isLast) {rowStyles.push(styles.divider);}\n return (\n <View key={item.key} style={rowStyles}>\n <PDFText style={keyStyles}>{item.key}</PDFText>\n <PDFText style={valStyles}>{item.value}</PDFText>\n </View>\n );\n })}\n </View>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/key-value/index.ts",
+ "content": "export {\n KeyValue,\n type KeyValueProps,\n type KeyValueEntry,\n type KeyValueDirection,\n type KeyValueSize,\n} from \"./key-value\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/takumi/link.json b/public/r/takumi/link.json
new file mode 100644
index 0000000..879659f
--- /dev/null
+++ b/public/r/takumi/link.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/link",
+ "title": "Link",
+ "description": "Link PDF component (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/link/link.tsx",
+ "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { StyleSheet, Link as PDFLink } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type LinkVariant = \"default\" | \"muted\" | \"primary\";\nexport type LinkUnderline = \"always\" | \"none\";\n\n/**\n * Clickable hyperlink for PDF documents.\n * Props - `href` | `children` | `align` | `color` | `variant` | `underline` | `style`\n * @see {@link LinkProps}\n */\nexport interface LinkProps extends PDFComponentProps {\n href: string;\n /**\n * @default 'left'\n */\n align?: \"left\" | \"center\" | \"right\";\n color?: string;\n /**\n * @default 'default'\n */\n variant?: LinkVariant;\n /**\n * @default 'always'\n */\n underline?: LinkUnderline;\n}\n\nfunction createLinkStyles(t: PdfcnTheme) {\n const { fontWeights } = t.primitives;\n const base = {\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n lineHeight: t.typography.body.lineHeight,\n marginBottom: t.spacing.paragraphGap,\n };\n return StyleSheet.create({\n default: {\n ...base,\n color: t.colors.accent,\n fontWeight: fontWeights.medium,\n textDecoration: \"underline\",\n },\n muted: {\n ...base,\n color: t.colors.mutedForeground,\n fontWeight: fontWeights.regular,\n textDecoration: \"underline\",\n },\n primary: {\n ...base,\n color: t.colors.primary,\n fontWeight: fontWeights.semibold,\n textDecoration: \"underline\",\n },\n underlineAlways: { textDecoration: \"underline\" },\n underlineNone: { textDecoration: \"none\" },\n });\n}\n\nexport function Link({\n href,\n align,\n color,\n variant = \"default\",\n underline,\n children,\n style,\n}: LinkProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createLinkStyles(theme), [theme]);\n const variantMap = {\n default: styles.default,\n muted: styles.muted,\n primary: styles.primary,\n };\n const underlineMap = {\n always: styles.underlineAlways,\n none: styles.underlineNone,\n };\n const styleArray: Style[] = [variantMap[variant]];\n if (underline && underline in underlineMap)\n {styleArray.push(underlineMap[underline]);}\n const semantic = {} as Style;\n if (align) {semantic.textAlign = align;}\n if (color) {semantic.color = resolveColor(color, theme.colors);}\n if (Object.keys(semantic).length > 0) {styleArray.push(semantic);}\n if (style) {styleArray.push(...[style].flat());}\n return (\n <PDFLink src={href} style={styleArray}>\n {children}\n </PDFLink>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/link/index.ts",
+ "content": "export {\n Link,\n type LinkProps,\n type LinkVariant,\n type LinkUnderline,\n} from \"./link\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/takumi/list.json b/public/r/takumi/list.json
new file mode 100644
index 0000000..4356f8b
--- /dev/null
+++ b/public/r/takumi/list.json
@@ -0,0 +1,36 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/list",
+ "title": "List",
+ "description": "List PDF component (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/list/list.styles.ts",
+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { StyleSheet } from \"../../lib/takumi-primitives\";\n\n/**\n * Creates all list styles derived from the active theme.\n * @param t - The resolved PdfcnTheme instance.\n */\nexport function createListStyles(t: PdfcnTheme) {\n const { borderRadius, spacing, fontWeights, typography } = t.primitives;\n\n return StyleSheet.create({\n checkBox: {\n alignItems: \"center\",\n backgroundColor: t.colors.background,\n borderColor: t.colors.border,\n borderRadius: 3,\n borderStyle: \"solid\",\n borderWidth: 1.5,\n height: spacing[4],\n justifyContent: \"center\",\n marginRight: spacing[2],\n width: spacing[4],\n },\n checkBoxChecked: {\n backgroundColor: t.colors.success,\n borderColor: t.colors.success,\n },\n checkMark: {\n color: t.colors.background,\n fontFamily: t.typography.body.fontFamily,\n fontSize: 8,\n fontWeight: fontWeights.bold,\n },\n childrenContainer: {\n display: \"flex\",\n flexDirection: \"column\",\n marginLeft: spacing[5],\n marginTop: spacing[1],\n },\n container: {\n display: \"flex\",\n flexDirection: \"column\",\n marginBottom: t.spacing.componentGap,\n width: \"100%\",\n },\n descriptiveAccent: {\n backgroundColor: t.colors.primary,\n borderRadius: borderRadius.sm,\n marginRight: spacing[3],\n minHeight: spacing[4],\n width: 3,\n },\n descriptiveContent: {\n flex: 1,\n },\n descriptiveDesc: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n lineHeight: t.typography.body.lineHeight,\n marginTop: 1,\n },\n descriptiveTitle: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: t.typography.body.lineHeight,\n },\n iconBox: {\n alignItems: \"center\",\n backgroundColor: t.colors.primary,\n borderRadius: borderRadius.md,\n height: spacing[5],\n justifyContent: \"center\",\n marginRight: spacing[2],\n width: spacing[5],\n },\n iconMark: {\n color: t.colors.primaryForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: 9,\n fontWeight: fontWeights.bold,\n },\n itemRow: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n },\n itemRowCenter: {\n alignItems: \"center\",\n flexDirection: \"row\",\n },\n itemRowGapMd: { marginBottom: spacing[3] },\n itemRowGapSm: { marginBottom: spacing[2] },\n itemRowGapXs: { marginBottom: spacing[1] },\n itemText: {\n // No flex here — Text nodes with flex shorthand get flexBasis:0, which causes\n // Yoga to under-measure multi-line text height → overlapping rows.\n // flex:1 must live on the wrapping View, not on the Text itself.\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n lineHeight: t.typography.body.lineHeight,\n },\n itemTextBold: {\n fontWeight: fontWeights.semibold,\n },\n itemTextSub: {\n // Same: no flex — see itemText comment.\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize - 0.5,\n lineHeight: t.typography.body.lineHeight,\n },\n itemTextWrap: {\n // Companion to itemText / itemTextSub. Apply this to the View that wraps\n // the Text so flex expansion happens at the View level, not the Text level.\n flex: 1,\n },\n markerBulletDot: {\n backgroundColor: t.colors.primary,\n borderRadius: 3,\n height: 5,\n width: 5,\n },\n markerBulletSubDot: {\n backgroundColor: \"transparent\",\n borderColor: t.colors.mutedForeground,\n borderRadius: 2,\n borderStyle: \"solid\",\n borderWidth: 1,\n height: 4,\n width: 4,\n },\n markerBulletSubWrap: {\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n marginTop: spacing[1],\n width: spacing[4],\n },\n markerBulletWrap: {\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n marginTop: spacing[1],\n width: spacing[4],\n },\n markerNumberBadge: {\n alignItems: \"center\",\n backgroundColor: t.colors.primary,\n borderRadius: spacing[5],\n height: spacing[5],\n justifyContent: \"center\",\n marginRight: spacing[2],\n width: spacing[5],\n },\n markerNumberText: {\n color: t.colors.primaryForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.bold,\n },\n });\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/list/list.tsx",
+ "content": "import type React from \"react\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, Text as PDFText } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\nimport { createListStyles } from \"./list.styles\";\nimport type { ListItem, ListVariant, PdfListProps } from \"./list.types\";\n\ntype Styles = ReturnType<typeof createListStyles>;\ntype GapProp = \"xs\" | \"sm\" | \"md\";\n\nfunction getGapStyle(gap: GapProp, styles: Styles): Style {\n if (gap === \"xs\") {return styles.itemRowGapXs;}\n if (gap === \"md\") {return styles.itemRowGapMd;}\n return styles.itemRowGapSm;\n}\n\nfunction buildRowStyles(\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles,\n align: \"start\" | \"center\" = \"start\"\n): Style[] {\n const row: Style[] = [\n align === \"center\" ? styles.itemRowCenter : styles.itemRow,\n ];\n if (index !== total - 1) {row.push(getGapStyle(gap, styles));}\n return row;\n}\n\n/** Bullet dot marker — solid filled for level 0, outline ring for nested levels. */\nfunction dotMarker(level: number, styles: Styles): React.ReactElement {\n return level === 0 ? (\n <View style={styles.markerBulletWrap}>\n <View style={styles.markerBulletDot} />\n </View>\n ) : (\n <View style={styles.markerBulletSubWrap}>\n <View style={styles.markerBulletSubDot} />\n </View>\n );\n}\n\nfunction renderBulletItem(\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles,\n level: number\n): React.ReactElement {\n return (\n <View key={index}>\n <View style={buildRowStyles(index, total, gap, styles)}>\n {dotMarker(level, styles)}\n {/* flex:1 on the View, NOT on the Text — avoids Yoga height underestimation\n for multi-line Text nodes that would cause overlapping rows. */}\n <View style={styles.itemTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n {item.children && item.children.length > 0\n ? renderItemList(item.children, \"bullet\", gap, styles, level + 1)\n : null}\n </View>\n );\n}\n\nfunction renderNumberedItem(\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement {\n return (\n <View\n key={index}\n style={buildRowStyles(index, total, gap, styles, \"center\")}\n >\n <View style={styles.markerNumberBadge}>\n <PDFText style={styles.markerNumberText}>{`${index + 1}`}</PDFText>\n </View>\n <View style={styles.itemTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n );\n}\n\nfunction renderChecklistItem(\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement {\n const isChecked = item.checked ?? true;\n return (\n <View\n key={index}\n style={buildRowStyles(index, total, gap, styles, \"center\")}\n >\n <View style={[styles.checkBox, isChecked ? styles.checkBoxChecked : {}]}>\n {isChecked ? <PDFText style={styles.checkMark}>✓</PDFText> : null}\n </View>\n <View style={styles.itemTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n );\n}\n\nfunction renderIconItem(\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement {\n return (\n <View\n key={index}\n style={buildRowStyles(index, total, gap, styles, \"center\")}\n >\n <View style={styles.iconBox}>\n <PDFText style={styles.iconMark}>★</PDFText>\n </View>\n <View style={styles.itemTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n );\n}\n\nfunction renderMultiLevelItem(\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles,\n level: number\n): React.ReactElement {\n return (\n <View key={index}>\n <View style={buildRowStyles(index, total, gap, styles)}>\n {dotMarker(level, styles)}\n <View style={styles.itemTextWrap}>\n <PDFText\n style={[\n level === 0 ? styles.itemText : styles.itemTextSub,\n level === 0 ? styles.itemTextBold : {},\n ]}\n >\n {item.text}\n </PDFText>\n </View>\n </View>\n {item.children && item.children.length > 0\n ? renderItemList(item.children, \"multi-level\", gap, styles, level + 1)\n : null}\n </View>\n );\n}\n\nfunction renderDescriptiveItem(\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement {\n return (\n <View key={index} style={buildRowStyles(index, total, gap, styles)}>\n <View style={styles.descriptiveAccent} />\n <View style={styles.descriptiveContent}>\n <PDFText style={styles.descriptiveTitle}>{item.text}</PDFText>\n {item.description ? (\n <PDFText style={styles.descriptiveDesc}>{item.description}</PDFText>\n ) : null}\n </View>\n </View>\n );\n}\n\nfunction renderItem(\n item: ListItem,\n index: number,\n total: number,\n variant: ListVariant,\n gap: GapProp,\n styles: Styles,\n level: number\n): React.ReactElement | null {\n switch (variant) {\n case \"bullet\": {\n return renderBulletItem(item, index, total, gap, styles, level);\n }\n case \"numbered\": {\n return renderNumberedItem(item, index, total, gap, styles);\n }\n case \"checklist\": {\n return renderChecklistItem(item, index, total, gap, styles);\n }\n case \"icon\": {\n return renderIconItem(item, index, total, gap, styles);\n }\n case \"multi-level\": {\n return renderMultiLevelItem(item, index, total, gap, styles, level);\n }\n case \"descriptive\": {\n return renderDescriptiveItem(item, index, total, gap, styles);\n }\n }\n}\n\nfunction renderItemList(\n items: ListItem[],\n variant: ListVariant,\n gap: GapProp,\n styles: Styles,\n level: number\n): React.ReactElement {\n return (\n <View style={level > 0 ? styles.childrenContainer : undefined}>\n {items.map((item, index) =>\n renderItem(item, index, items.length, variant, gap, styles, level)\n )}\n </View>\n );\n}\n\nexport function PdfList({\n items,\n variant = \"bullet\",\n gap = \"sm\",\n style,\n noWrap = false,\n _level = 0,\n}: PdfListProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createListStyles(theme), [theme]);\n\n const containerStyles: Style[] = [styles.container];\n if (_level > 0) {containerStyles.push(styles.childrenContainer);}\n const styleArray = style ? [...containerStyles, style] : containerStyles;\n\n return (\n <View wrap={!noWrap} style={styleArray}>\n {items.map((item, index) =>\n renderItem(item, index, items.length, variant, gap, styles, _level)\n )}\n </View>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/list/list.types.ts",
+ "content": "import type { Style } from \"../../lib/takumi-primitives\";\n\n/** List visual style variant. */\nexport type ListVariant =\n | \"bullet\"\n | \"numbered\"\n | \"checklist\"\n | \"icon\"\n | \"multi-level\"\n | \"descriptive\";\n\n/**\n * A single list item, optionally with nested children.\n * Props - `text` | `description` | `checked` | `children`\n * @see {@link ListItem}\n */\nexport interface ListItem {\n text: string;\n description?: string;\n checked?: boolean;\n children?: ListItem[];\n}\n\n/**\n * List of items with multiple style variants including bullet, numbered, checklist, and descriptive.\n * Props - `items` | `variant` | `gap` | `style` | `_level` | `noWrap`\n * @see {@link PdfListProps}\n */\nexport interface PdfListProps {\n items: ListItem[];\n /**\n * @default 'bullet'\n */\n variant?: ListVariant;\n /**\n * @default 'sm'\n */\n gap?: \"xs\" | \"sm\" | \"md\";\n style?: Style;\n _level?: number;\n /**\n * @default false\n */\n noWrap?: boolean;\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/list/index.ts",
+ "content": "export { PdfList } from \"./list\";\nexport type { PdfListProps, ListVariant, ListItem } from \"./list.types\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/takumi/page-break.json b/public/r/takumi/page-break.json
new file mode 100644
index 0000000..4cfc92f
--- /dev/null
+++ b/public/r/takumi/page-break.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/page-break",
+ "title": "Page Break",
+ "description": "Page Break PDF component (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/page-break/page-break.tsx",
+ "content": "import type { PDFComponentProps } from \"@/registry/themes\";\n\nimport { View } from \"../../lib/takumi-primitives\";\n\nexport interface PageBreakProps extends Omit<PDFComponentProps, \"children\"> {\n children?: never;\n}\n\nexport function PageBreak({ style }: PageBreakProps) {\n return (\n <View style={[{ breakBefore: \"page\" }, style].filter(Boolean) as never} />\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/page-break/index.ts",
+ "content": "export { PageBreak } from \"./page-break\";\nexport type { PageBreakProps } from \"./page-break\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/takumi/page-footer.json b/public/r/takumi/page-footer.json
new file mode 100644
index 0000000..196e66a
--- /dev/null
+++ b/public/r/takumi/page-footer.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/page-footer",
+ "title": "Page Footer",
+ "description": "Page Footer PDF component (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/page-footer/page-footer.tsx",
+ "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { Text as PDFText, StyleSheet, View } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type PageFooterVariant =\n | \"simple\"\n | \"centered\"\n | \"branded\"\n | \"minimal\"\n | \"three-column\"\n | \"detailed\";\n\n/**\n * Footer row with layout variants, optional sticky or fixed positioning, and contact info support.\n * Props - `leftText` | `rightText` | `centerText` | `variant` | `background` | `textColor` | `marginTop` | `address` | `phone` | `email` | `website` | `fixed` | `sticky` | `pagePadding` | `noWrap` | `style`\n * @see {@link PageFooterProps}\n */\nexport interface PageFooterProps extends Omit<PDFComponentProps, \"children\"> {\n leftText?: string;\n rightText?: string;\n centerText?: string;\n /**\n * @default 'simple'\n */\n variant?: PageFooterVariant;\n background?: string;\n textColor?: string;\n marginTop?: number;\n address?: string;\n phone?: string;\n email?: string;\n website?: string;\n /**\n * @default false\n */\n fixed?: boolean;\n /**\n * @default false\n */\n sticky?: boolean;\n /**\n * @default 0\n */\n pagePadding?: number;\n /**\n * @default true\n */\n noWrap?: boolean;\n}\n\nfunction createPageFooterStyles(t: PdfcnTheme) {\n const { spacing, fontWeights } = t.primitives;\n const c = t.colors;\n const { body } = t.typography;\n\n const textBase = {\n color: c.mutedForeground,\n fontFamily: body.fontFamily,\n fontSize: t.primitives.typography.xs,\n lineHeight: body.lineHeight,\n };\n\n return StyleSheet.create({\n brandedContainer: {\n alignItems: \"center\",\n backgroundColor: c.primary,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingHorizontal: spacing[4],\n paddingVertical: spacing[3],\n },\n\n centeredContainer: {\n alignItems: \"center\",\n borderTopColor: c.border,\n borderTopStyle: \"solid\",\n borderTopWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"column\",\n paddingTop: spacing[3],\n },\n\n companyBold: {\n ...textBase,\n color: c.foreground,\n fontWeight: fontWeights.bold,\n },\n\n companyName: {\n ...textBase,\n color: c.foreground,\n fontWeight: fontWeights.medium,\n },\n\n contactInfoCenter: {\n ...textBase,\n fontSize: t.primitives.typography.xs - 1,\n marginTop: spacing[0.5],\n textAlign: \"center\",\n },\n detailedContainer: {\n borderTopColor: c.border,\n borderTopStyle: \"solid\",\n borderTopWidth: spacing[1],\n display: \"flex\",\n flexDirection: \"column\",\n paddingTop: spacing[3],\n },\n detailedLeft: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n detailedPageNumber: {\n ...textBase,\n borderTopColor: c.border,\n borderTopStyle: \"solid\",\n borderTopWidth: spacing[0.5],\n paddingTop: spacing[2],\n textAlign: \"center\",\n },\n detailedRight: {\n alignItems: \"flex-end\",\n display: \"flex\",\n flexDirection: \"column\",\n },\n detailedTopRow: {\n alignItems: \"flex-start\",\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: spacing[2],\n },\n\n minimalContainer: {\n alignItems: \"center\",\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingBottom: spacing[1],\n paddingTop: spacing[1],\n },\n simpleContainer: {\n alignItems: \"center\",\n borderTopColor: c.border,\n borderTopStyle: \"solid\",\n borderTopWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingTop: spacing[3],\n },\n textBranded: {\n ...textBase,\n color: c.primaryForeground,\n fontWeight: fontWeights.medium,\n },\n textBrandedRight: {\n ...textBase,\n color: c.primaryForeground,\n textAlign: \"right\",\n },\n textCenter: {\n ...textBase,\n flex: 1,\n textAlign: \"center\",\n },\n textCenteredVariant: {\n ...textBase,\n marginBottom: spacing[1],\n textAlign: \"center\",\n },\n\n textLeft: {\n ...textBase,\n flex: 1,\n },\n textRight: {\n ...textBase,\n textAlign: \"right\",\n },\n threeColumnCenter: {\n alignItems: \"center\",\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n threeColumnContainer: {\n alignItems: \"flex-start\",\n borderTopColor: c.border,\n borderTopStyle: \"solid\",\n borderTopWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingTop: spacing[3],\n },\n threeColumnLeft: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n threeColumnRight: {\n alignItems: \"flex-end\",\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n });\n}\n\nexport function PageFooter({\n leftText,\n rightText,\n centerText,\n variant = \"simple\",\n background,\n textColor,\n marginTop,\n address,\n phone,\n email,\n website,\n fixed = false,\n sticky = false,\n pagePadding = 0,\n noWrap = true,\n style,\n}: PageFooterProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createPageFooterStyles(theme), [theme]);\n // sticky implies fixed; marginTop is irrelevant with absolute positioning\n const isFixed = fixed || sticky;\n const mt = sticky ? 0 : (marginTop ?? theme.spacing.sectionGap);\n const resolvedTextColor = textColor\n ? resolveColor(textColor, theme.colors)\n : undefined;\n const stickyStyle: Style = sticky\n ? {\n bottom: pagePadding,\n left: pagePadding,\n position: \"absolute\",\n right: pagePadding,\n }\n : {};\n\n function applyOverrides(base: Style[]): Style[] {\n if (background)\n {base.push({ backgroundColor: resolveColor(background, theme.colors) });}\n if (style) {base.push(style);}\n if (sticky) {base.push(stickyStyle);}\n return base;\n }\n\n if (variant === \"branded\") {\n const containerStyles = applyOverrides([\n styles.brandedContainer,\n { marginTop: mt },\n ]);\n\n const lStyle: Style[] = [styles.textBranded];\n const rStyle: Style[] = [styles.textBrandedRight];\n if (resolvedTextColor) {\n lStyle.push({ color: resolvedTextColor });\n rStyle.push({ color: resolvedTextColor });\n }\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n {leftText && <PDFText style={lStyle}>{leftText}</PDFText>}\n {rightText && <PDFText style={rStyle}>{rightText}</PDFText>}\n </View>\n );\n }\n\n if (variant === \"centered\") {\n const containerStyles = applyOverrides([\n styles.centeredContainer,\n { marginTop: mt },\n ]);\n\n const tStyle: Style[] = [styles.textCenteredVariant];\n if (resolvedTextColor) {tStyle.push({ color: resolvedTextColor });}\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n {leftText && <PDFText style={tStyle}>{leftText}</PDFText>}\n {rightText && <PDFText style={tStyle}>{rightText}</PDFText>}\n </View>\n );\n }\n\n if (variant === \"three-column\") {\n const containerStyles = applyOverrides([\n styles.threeColumnContainer,\n { marginTop: mt },\n ]);\n\n const leftStyle: Style[] = [styles.companyName];\n const centerStyle: Style[] = [styles.contactInfoCenter];\n const rightStyle: Style[] = [styles.textRight];\n if (resolvedTextColor) {\n leftStyle.push({ color: resolvedTextColor });\n centerStyle.push({ color: resolvedTextColor });\n rightStyle.push({ color: resolvedTextColor });\n }\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n <View style={styles.threeColumnLeft}>\n {leftText && <PDFText style={leftStyle}>{leftText}</PDFText>}\n {address && <PDFText style={styles.textLeft}>{address}</PDFText>}\n </View>\n <View style={styles.threeColumnCenter}>\n {phone && <PDFText style={centerStyle}>{phone}</PDFText>}\n {email && <PDFText style={centerStyle}>{email}</PDFText>}\n {website && <PDFText style={centerStyle}>{website}</PDFText>}\n </View>\n <View style={styles.threeColumnRight}>\n {rightText && <PDFText style={rightStyle}>{rightText}</PDFText>}\n </View>\n </View>\n );\n }\n\n if (variant === \"detailed\") {\n const containerStyles = applyOverrides([\n styles.detailedContainer,\n { marginTop: mt },\n ]);\n\n const companyStyle: Style[] = [styles.companyBold];\n const addrStyle: Style[] = [styles.textLeft];\n const contactStyle: Style[] = [styles.textRight];\n const pageNumStyle: Style[] = [styles.detailedPageNumber];\n if (resolvedTextColor) {\n companyStyle.push({ color: resolvedTextColor });\n addrStyle.push({ color: resolvedTextColor });\n contactStyle.push({ color: resolvedTextColor });\n pageNumStyle.push({ color: resolvedTextColor });\n }\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n <View style={styles.detailedTopRow}>\n <View style={styles.detailedLeft}>\n {leftText && <PDFText style={companyStyle}>{leftText}</PDFText>}\n {address && <PDFText style={addrStyle}>{address}</PDFText>}\n </View>\n <View style={styles.detailedRight}>\n {phone && (\n <PDFText style={contactStyle}>{`Phone: ${phone}`}</PDFText>\n )}\n {email && (\n <PDFText style={contactStyle}>{`Email: ${email}`}</PDFText>\n )}\n {website && (\n <PDFText style={contactStyle}>{`Web: ${website}`}</PDFText>\n )}\n </View>\n </View>\n {rightText && <PDFText style={pageNumStyle}>{rightText}</PDFText>}\n </View>\n );\n }\n\n if (variant === \"minimal\") {\n const containerStyles = applyOverrides([\n styles.minimalContainer,\n { marginTop: mt },\n ]);\n\n const lStyle: Style[] = [styles.textLeft];\n const rStyle: Style[] = [styles.textRight];\n if (resolvedTextColor) {\n lStyle.push({ color: resolvedTextColor });\n rStyle.push({ color: resolvedTextColor });\n }\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n {leftText && <PDFText style={lStyle}>{leftText}</PDFText>}\n {rightText && <PDFText style={rStyle}>{rightText}</PDFText>}\n </View>\n );\n }\n\n const containerStyles = applyOverrides([\n styles.simpleContainer,\n { marginTop: mt },\n ]);\n\n const lStyle: Style[] = [styles.textLeft];\n const cStyle: Style[] = [styles.textCenter];\n const rStyle: Style[] = [styles.textRight];\n if (resolvedTextColor) {\n lStyle.push({ color: resolvedTextColor });\n cStyle.push({ color: resolvedTextColor });\n rStyle.push({ color: resolvedTextColor });\n }\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n {leftText && <PDFText style={lStyle}>{leftText}</PDFText>}\n {centerText && <PDFText style={cStyle}>{centerText}</PDFText>}\n {rightText && <PDFText style={rStyle}>{rightText}</PDFText>}\n </View>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/page-footer/index.ts",
+ "content": "export {\n PageFooter,\n type PageFooterProps,\n type PageFooterVariant,\n} from \"./page-footer\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/takumi/page-header.json b/public/r/takumi/page-header.json
new file mode 100644
index 0000000..1f25f23
--- /dev/null
+++ b/public/r/takumi/page-header.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/page-header",
+ "title": "Page Header",
+ "description": "Page Header PDF component (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/page-header/page-header.tsx",
+ "content": "import type { ReactNode } from \"react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { Text as PDFText, StyleSheet, View } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type PageHeaderVariant =\n | \"simple\"\n | \"centered\"\n | \"minimal\"\n | \"branded\"\n | \"logo-left\"\n | \"logo-right\"\n | \"two-column\";\n\n/**\n * Header row with layout variants, logo support, and optional fixed positioning.\n * Props - `title` | `subtitle` | `rightText` | `rightSubText` | `variant` | `background` | `titleColor` | `marginBottom` | `address` | `phone` | `email` | `logo` | `fixed` | `noWrap` | `style`\n * @see {@link PageHeaderProps}\n */\nexport interface PageHeaderProps extends Omit<PDFComponentProps, \"children\"> {\n title: string;\n subtitle?: string;\n rightText?: string;\n rightSubText?: string;\n /**\n * @default 'simple'\n */\n variant?: PageHeaderVariant;\n background?: string;\n titleColor?: string;\n marginBottom?: number;\n address?: string;\n phone?: string;\n email?: string;\n logo?: ReactNode;\n /**\n * @default false\n */\n fixed?: boolean;\n /**\n * @default true\n */\n noWrap?: boolean;\n}\n\nfunction createPageHeaderStyles(t: PdfcnTheme) {\n const { spacing, borderRadius, fontWeights } = t.primitives;\n const c = t.colors;\n const { heading, body } = t.typography;\n\n return StyleSheet.create({\n brandedContainer: {\n alignItems: \"center\",\n backgroundColor: c.primary,\n borderRadius: borderRadius.sm,\n display: \"flex\",\n flexDirection: \"column\",\n padding: spacing[6],\n },\n centeredContainer: {\n alignItems: \"center\",\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"column\",\n paddingBottom: spacing[4],\n },\n contactInfo: {\n color: c.mutedForeground,\n fontFamily: body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginTop: spacing[0.5],\n textAlign: \"right\",\n },\n\n logoContainer: {\n height: 48,\n marginRight: spacing[4],\n width: 48,\n },\n\n logoContent: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n logoLeftContainer: {\n alignItems: \"center\",\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n paddingBottom: spacing[4],\n },\n logoRightContainer: {\n alignItems: \"center\",\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingBottom: spacing[4],\n },\n\n logoRightContent: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n\n logoRightLogoContainer: {\n height: 48,\n marginLeft: spacing[4],\n width: 48,\n },\n minimalContainer: {\n alignItems: \"center\",\n borderBottomColor: c.primary,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[1],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingBottom: spacing[3],\n },\n minimalLeft: {\n flex: 1,\n },\n minimalRight: {\n alignItems: \"flex-end\",\n },\n\n rightSubText: {\n color: c.mutedForeground,\n fontFamily: body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginTop: spacing[1],\n textAlign: \"right\",\n },\n rightText: {\n color: c.foreground,\n fontFamily: body.fontFamily,\n fontSize: body.fontSize,\n fontWeight: fontWeights.medium,\n textAlign: \"right\",\n },\n simpleContainer: {\n alignItems: \"flex-start\",\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingBottom: spacing[4],\n },\n\n simpleLeft: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n simpleRight: {\n alignItems: \"flex-end\",\n display: \"flex\",\n flexDirection: \"column\",\n },\n\n subtitle: {\n color: c.mutedForeground,\n fontFamily: body.fontFamily,\n fontSize: body.fontSize,\n lineHeight: body.lineHeight,\n marginTop: spacing[1],\n },\n subtitleBranded: {\n color: c.primaryForeground,\n marginTop: spacing[1],\n },\n subtitleCentered: {\n textAlign: \"center\",\n },\n\n title: {\n color: c.foreground,\n fontFamily: heading.fontFamily,\n fontSize: heading.fontSize.h3,\n fontWeight: fontWeights.bold,\n lineHeight: heading.lineHeight,\n marginBottom: 0,\n },\n titleBranded: {\n color: c.primaryForeground,\n },\n titleCentered: {\n textAlign: \"center\",\n },\n\n titleMinimal: {\n fontSize: heading.fontSize.h3,\n fontWeight: fontWeights.bold,\n },\n twoColumnContainer: {\n alignItems: \"flex-start\",\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingBottom: spacing[4],\n },\n twoColumnLeft: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n twoColumnRight: {\n alignItems: \"flex-end\",\n display: \"flex\",\n flexDirection: \"column\",\n },\n });\n}\n\nexport function PageHeader({\n title,\n subtitle,\n rightText,\n rightSubText,\n variant = \"simple\",\n background,\n titleColor,\n marginBottom,\n logo,\n address,\n phone,\n email,\n fixed = false,\n noWrap = true,\n style,\n}: PageHeaderProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createPageHeaderStyles(theme), [theme]);\n const mb = marginBottom ?? theme.spacing.sectionGap;\n\n if (variant === \"branded\") {\n const containerStyles: Style[] = [\n styles.brandedContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [\n styles.title,\n styles.titleBranded,\n styles.titleCentered,\n ];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n <PDFText style={titleStyles}>{title}</PDFText>\n {subtitle && (\n <PDFText style={[styles.subtitle, styles.subtitleBranded]}>\n {subtitle}\n </PDFText>\n )}\n </View>\n );\n }\n\n if (variant === \"centered\") {\n const containerStyles: Style[] = [\n styles.centeredContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [styles.title, styles.titleCentered];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n <PDFText style={titleStyles}>{title}</PDFText>\n {subtitle && (\n <PDFText style={[styles.subtitle, styles.subtitleCentered]}>\n {subtitle}\n </PDFText>\n )}\n </View>\n );\n }\n\n if (variant === \"logo-right\") {\n const containerStyles: Style[] = [\n styles.logoRightContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [styles.title];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n <View style={styles.logoRightContent}>\n <PDFText style={titleStyles}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {logo && <View style={styles.logoRightLogoContainer}>{logo}</View>}\n </View>\n );\n }\n\n if (variant === \"logo-left\") {\n const containerStyles: Style[] = [\n styles.logoLeftContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [styles.title];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n {logo && <View style={styles.logoContainer}>{logo}</View>}\n <View style={styles.logoContent}>\n <PDFText style={titleStyles}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {(rightText || rightSubText) && (\n <View style={styles.simpleRight}>\n {rightText && (\n <PDFText style={styles.rightText}>{rightText}</PDFText>\n )}\n {rightSubText && (\n <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>\n )}\n </View>\n )}\n </View>\n );\n }\n\n if (variant === \"two-column\") {\n const containerStyles: Style[] = [\n styles.twoColumnContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [styles.title];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n <View style={styles.twoColumnLeft}>\n <PDFText style={titleStyles}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {(address || phone || email) && (\n <View style={styles.twoColumnRight}>\n {address && <PDFText style={styles.contactInfo}>{address}</PDFText>}\n {phone && <PDFText style={styles.contactInfo}>{phone}</PDFText>}\n {email && <PDFText style={styles.contactInfo}>{email}</PDFText>}\n </View>\n )}\n </View>\n );\n }\n\n if (variant === \"minimal\") {\n const containerStyles: Style[] = [\n styles.minimalContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [styles.title, styles.titleMinimal];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n <View style={styles.minimalLeft}>\n <PDFText style={titleStyles}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {(rightText || rightSubText) && (\n <View style={styles.minimalRight}>\n {rightText && (\n <PDFText style={styles.rightText}>{rightText}</PDFText>\n )}\n {rightSubText && (\n <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>\n )}\n </View>\n )}\n </View>\n );\n }\n\n const containerStyles: Style[] = [\n styles.simpleContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [styles.title];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n <View style={styles.simpleLeft}>\n <PDFText style={titleStyles}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {(rightText || rightSubText) && (\n <View style={styles.simpleRight}>\n {rightText && <PDFText style={styles.rightText}>{rightText}</PDFText>}\n {rightSubText && (\n <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>\n )}\n </View>\n )}\n </View>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/page-header/index.ts",
+ "content": "export {\n PageHeader,\n type PageHeaderProps,\n type PageHeaderVariant,\n} from \"./page-header\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/takumi/page-number.json b/public/r/takumi/page-number.json
new file mode 100644
index 0000000..0c2b94a
--- /dev/null
+++ b/public/r/takumi/page-number.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/page-number",
+ "title": "Page Number",
+ "description": "Page Number PDF component (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/page-number/page-number.tsx",
+ "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type PageNumberAlign = \"left\" | \"center\" | \"right\";\nexport type PageNumberSize = \"xs\" | \"sm\" | \"md\";\n\n/**\n * Auto page number rendered with a configurable format string at a or inline position.\n * Props - `format` | `align` | `size` | `fixed` | `muted` | `style`\n * @see {@link PdfPageNumberProps}\n */\nexport interface PdfPageNumberProps extends Omit<\n PDFComponentProps,\n \"children\"\n> {\n /**\n * Format string — use `{page}` for current page and `{total}` for total page count.\n * @default 'Page {page} of {total}'\n */\n format?: string;\n /**\n * @default 'center'\n */\n align?: PageNumberAlign;\n /**\n * @default 'sm'\n */\n size?: PageNumberSize;\n /**\n * @default false\n */\n fixed?: boolean;\n /**\n * @default true\n */\n muted?: boolean;\n children?: never;\n}\n\nfunction createPageNumberStyles(t: PdfcnTheme) {\n const { typography, colors, primitives } = t;\n return StyleSheet.create({\n alignCenter: { textAlign: \"center\" },\n alignLeft: { textAlign: \"left\" },\n alignRight: { textAlign: \"right\" },\n colorForeground: { color: colors.foreground },\n colorMuted: { color: colors.mutedForeground },\n container: { width: \"100%\" },\n sizeMd: { fontSize: primitives.typography.base },\n sizeSm: { fontSize: primitives.typography.sm },\n sizeXs: { fontSize: primitives.typography.xs },\n text: { fontFamily: typography.body.fontFamily },\n });\n}\n\nfunction formatPageNumber(\n format: string,\n pageNumber: number,\n totalPages: number\n): string {\n return format\n .replace(\"{page}\", String(pageNumber))\n .replace(\"{total}\", String(totalPages));\n}\n\nexport function PdfPageNumber({\n format = \"Page {page} of {total}\",\n align = \"center\",\n size = \"sm\",\n fixed = false,\n muted = true,\n style,\n}: PdfPageNumberProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createPageNumberStyles(theme), [theme]);\n const alignMap = {\n center: styles.alignCenter,\n left: styles.alignLeft,\n right: styles.alignRight,\n } as Record<PageNumberAlign, Style>;\n const sizeMap = {\n md: styles.sizeMd,\n sm: styles.sizeSm,\n xs: styles.sizeXs,\n } as Record<PageNumberSize, Style>;\n const textStyles: Style[] = [\n styles.text,\n alignMap[align],\n sizeMap[size],\n muted ? styles.colorMuted : styles.colorForeground,\n ];\n if (style) {textStyles.push(...[style].flat());}\n return (\n <View style={styles.container}>\n <PDFText style={textStyles}>\n {format.split(/({page}|{total})/).map((part, i) => {\n if (part === \"{page}\") {return <span key={i} className=\"pageNumber\" />;}\n if (part === \"{total}\")\n {return <span key={i} className=\"totalPages\" />;}\n return <span key={i}>{part}</span>;\n })}\n </PDFText>\n </View>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/page-number/index.ts",
+ "content": "export {\n PdfPageNumber,\n type PdfPageNumberProps,\n type PageNumberAlign,\n type PageNumberSize,\n} from \"./page-number\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/takumi/pdf-image.json b/public/r/takumi/pdf-image.json
new file mode 100644
index 0000000..5e031ea
--- /dev/null
+++ b/public/r/takumi/pdf-image.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/pdf-image",
+ "title": "Pdf Image",
+ "description": "Pdf Image PDF component (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/pdf-image/pdf-image.tsx",
+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n Image,\n} from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\n/** HTTP method used when fetching the image from a URL. */\nexport type PdfImageHTTPMethod =\n | \"GET\"\n | \"HEAD\"\n | \"POST\"\n | \"PUT\"\n | \"DELETE\"\n | \"PATCH\";\n\nexport type PdfImageSrc =\n | string\n | {\n uri: string;\n method?: PdfImageHTTPMethod;\n headers?: Record<string, string>;\n body?: string;\n };\n\nexport type PdfImageFit = \"cover\" | \"contain\" | \"fill\" | \"none\";\n\nexport type PdfImageVariant =\n | \"default\"\n | \"full-width\"\n | \"thumbnail\"\n | \"avatar\"\n | \"cover\"\n | \"bordered\"\n | \"rounded\";\n\n/**\n * Image element with layout presets, caption, and aspect ratio support.\n * Props - `src` | `variant` | `width` | `height` | `fit` | `position` | `caption` | `aspectRatio` | `borderRadius` | `noWrap` | `style`\n * @see {@link PdfImageProps}\n */\nexport interface PdfImageProps {\n src: PdfImageSrc;\n /**\n * @default 'default'\n */\n variant?: PdfImageVariant;\n width?: number | string;\n height?: number | string;\n fit?: PdfImageFit;\n /**\n * @default '50% 50%'\n */\n position?: string;\n caption?: string;\n aspectRatio?: number;\n borderRadius?: number;\n /**\n * @default true\n */\n noWrap?: boolean;\n style?: Style;\n}\n\ninterface VariantDefaults {\n width?: number | string;\n height?: number | string;\n fit: PdfImageFit;\n borderRadius?: number;\n}\n\nconst VARIANT_DEFAULTS: Record<PdfImageVariant, VariantDefaults> = {\n avatar: { borderRadius: 999, fit: \"cover\", height: 48, width: 48 },\n bordered: { fit: \"contain\", width: \"100%\" },\n cover: { fit: \"cover\", height: 160, width: \"100%\" },\n default: { fit: \"contain\" },\n \"full-width\": { fit: \"cover\", width: \"100%\" },\n rounded: { borderRadius: 8, fit: \"contain\", width: 200 },\n thumbnail: { fit: \"cover\", height: 80, width: 80 },\n};\n\nconst UNSUPPORTED_FORMATS = new Set([\"webp\", \"avif\", \"heic\", \"heif\", \"ico\"]);\n\nfunction detectFormat(src: PdfImageSrc): string | null {\n if (typeof src !== \"string\") return null;\n const dataMatch = src.match(/^data:image\\/([a-zA-Z0-9+.-]+)/);\n if (dataMatch) return dataMatch[1].toLowerCase();\n return src.split(\"?\")[0].split(\".\").pop()?.toLowerCase() ?? null;\n}\n\nfunction warnIfUnsupported(src: PdfImageSrc): void {\n const fmt = detectFormat(src);\n if (fmt && UNSUPPORTED_FORMATS.has(fmt)) {\n console.warn(\n `[PdfImage] Unsupported format \"${fmt}\" detected. react-pdf supports: JPEG, PNG, GIF (first frame), BMP, SVG. Convert to PNG or JPEG before use.`\n );\n }\n}\n\nfunction createImageStyles(t: PdfcnTheme) {\n const { spacing } = t.primitives;\n return StyleSheet.create({\n caption: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginTop: spacing[1],\n textAlign: \"center\",\n },\n container: { flexDirection: \"column\" },\n image: {},\n imageBordered: {\n borderColor: t.colors.border,\n borderStyle: \"solid\",\n borderWidth: 1,\n },\n });\n}\n\nexport function PdfImage({\n src,\n variant = \"default\",\n width,\n height,\n fit,\n position = \"50% 50%\",\n caption,\n aspectRatio,\n borderRadius,\n noWrap = true,\n style,\n}: PdfImageProps) {\n warnIfUnsupported(src);\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createImageStyles(theme), [theme]);\n const defaults = VARIANT_DEFAULTS[variant];\n\n const resolvedWidth = width ?? defaults.width;\n const resolvedHeight: number | string | undefined = (() => {\n if (height !== undefined) {return height;}\n if (defaults.height !== undefined) {return defaults.height;}\n if (aspectRatio !== undefined && typeof resolvedWidth === \"number\")\n {return resolvedWidth / aspectRatio;}\n return;\n })();\n\n const resolvedFit = fit ?? defaults.fit;\n const resolvedRadius = borderRadius ?? defaults.borderRadius;\n\n const imageStyles: Style[] = [styles.image];\n if (resolvedWidth !== undefined)\n {imageStyles.push({ width: resolvedWidth } as Style);}\n if (resolvedHeight !== undefined)\n {imageStyles.push({ height: resolvedHeight } as Style);}\n imageStyles.push({\n objectFit: resolvedFit,\n objectPosition: position,\n } as Style);\n if (resolvedRadius !== undefined)\n {imageStyles.push({ borderRadius: resolvedRadius } as Style);}\n if (variant === \"bordered\") {imageStyles.push(styles.imageBordered);}\n if (style) {imageStyles.push(style);}\n\n const content = (\n <View style={styles.container}>\n <Image src={src} style={imageStyles} />\n {caption ? <PDFText style={styles.caption}>{caption}</PDFText> : null}\n </View>\n );\n\n return noWrap ? (\n <View style={[{ breakInside: \"avoid\" as const }].filter(Boolean)}>\n {content}\n </View>\n ) : (\n content\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/pdf-image/index.ts",
+ "content": "export {\n PdfImage,\n type PdfImageProps,\n type PdfImageSrc,\n type PdfImageVariant,\n type PdfImageFit,\n} from \"./pdf-image\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/takumi/qrcode.json b/public/r/takumi/qrcode.json
new file mode 100644
index 0000000..ef1d5cd
--- /dev/null
+++ b/public/r/takumi/qrcode.json
@@ -0,0 +1,27 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/qrcode",
+ "title": "Qrcode",
+ "description": "Qrcode PDF component (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers",
+ "qrcode"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/qrcode/qrcode.tsx",
+ "content": "import QRCode from \"qrcode\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\nimport { Rect, Svg } from \"../../lib/takumi-svg\";\n\nexport type QRCodeErrorLevel = \"L\" | \"M\" | \"Q\" | \"H\";\n\n/**\n * QR code rendered as an SVG grid for use in PDF documents.\n * Props - `value` | `size` | `color` | `backgroundColor` | `errorLevel` | `margin` | `caption` | `style`\n * @see {@link PdfQRCodeProps}\n */\nexport interface PdfQRCodeProps extends Omit<PDFComponentProps, \"children\"> {\n value: string;\n size?: number;\n color?: string;\n backgroundColor?: string;\n errorLevel?: QRCodeErrorLevel;\n margin?: number;\n caption?: string;\n children?: never;\n}\n\nfunction createQRCodeStyles(t: PdfcnTheme) {\n const { spacing } = t.primitives;\n return StyleSheet.create({\n caption: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginTop: spacing[1],\n textAlign: \"center\",\n },\n container: { alignItems: \"center\" },\n });\n}\n\nfunction generateQRMatrix(\n value: string,\n errorLevel: QRCodeErrorLevel,\n margin: number\n): boolean[][] {\n const qr = QRCode.create(value, { errorCorrectionLevel: errorLevel });\n const { size, data } = qr.modules;\n const totalSize = size + margin * 2;\n const matrix: boolean[][] = [];\n for (let row = 0; row < totalSize; row++) {\n const rowData: boolean[] = [];\n for (let col = 0; col < totalSize; col++) {\n const isInMargin =\n row < margin ||\n row >= size + margin ||\n col < margin ||\n col >= size + margin;\n if (isInMargin) {\n rowData.push(false);\n } else {\n rowData.push(data[(row - margin) * size + (col - margin)] === 1);\n }\n }\n matrix.push(rowData);\n }\n return matrix;\n}\n\nexport function PdfQRCode({\n value,\n size = 100,\n color = \"#000000\",\n backgroundColor = \"#ffffff\",\n errorLevel = \"M\",\n margin = 2,\n caption,\n style,\n}: PdfQRCodeProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createQRCodeStyles(theme), [theme]);\n const matrix = useSafeMemo(\n () => generateQRMatrix(value, errorLevel, margin),\n [value, errorLevel, margin]\n );\n const moduleSize = size / matrix.length;\n const resolvedColor = resolveColor(color, theme.colors);\n const resolvedBgColor =\n backgroundColor === \"transparent\"\n ? undefined\n : resolveColor(backgroundColor, theme.colors);\n const containerStyles: Style[] = [styles.container];\n if (style) {containerStyles.push(...[style].flat());}\n\n return (\n <View style={containerStyles}>\n <Svg width={size} height={size} viewBox={`0 0 ${size} ${size}`}>\n {resolvedBgColor !== undefined && (\n <Rect x={0} y={0} width={size} height={size} fill={resolvedBgColor} />\n )}\n {matrix\n .flatMap((row, y) =>\n row\n .map((isDark, x) => (isDark ? { x, y } : null))\n .filter((pos): pos is { x: number; y: number } => pos !== null)\n )\n .map((pos) => (\n <Rect\n key={`qr-${pos.y}-${pos.x}`}\n x={pos.x * moduleSize}\n y={pos.y * moduleSize}\n width={moduleSize}\n height={moduleSize}\n fill={resolvedColor}\n />\n ))}\n </Svg>\n {caption && <PDFText style={styles.caption}>{caption}</PDFText>}\n </View>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/qrcode/index.ts",
+ "content": "export {\n PdfQRCode,\n type PdfQRCodeProps,\n type QRCodeErrorLevel,\n} from \"./qrcode\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/takumi/report-financial.json b/public/r/takumi/report-financial.json
new file mode 100644
index 0000000..2f15e01
--- /dev/null
+++ b/public/r/takumi/report-financial.json
@@ -0,0 +1,31 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/report-financial",
+ "title": "Report Financial",
+ "description": "Report Financial PDF block (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/report-financial/report-financial.tsx",
+ "content": "import { ReportTemplateFrame } from './report-layout';\nimport type { ReportTemplateProps } from './report-layout';\nimport type { BaseReportData } from \"./report.types\";\n\nconst sampleFinancialData: BaseReportData = {\n author: \"Finance Ops\",\n generatedAt: \"February 23, 2026\",\n highlights: [\n \"Revenue accelerated after enterprise expansion campaign launch.\",\n \"Gross margin improved due to infrastructure cost renegotiation.\",\n \"Collections requires executive follow-up on two overdue accounts.\",\n ],\n period: \"Q1 2026\",\n rows: [\n {\n label: \"Enterprise Sales\",\n owner: \"A. Patel\",\n status: \"On Track\",\n progress: 88,\n risk: \"Low\",\n },\n {\n label: \"SMB Sales\",\n owner: \"L. Khan\",\n status: \"On Track\",\n progress: 79,\n risk: \"Medium\",\n },\n {\n label: \"Collections\",\n owner: \"J. Reyes\",\n status: \"At Risk\",\n progress: 63,\n risk: \"High\",\n },\n {\n label: \"Cost Optimization\",\n owner: \"K. Singh\",\n status: \"On Track\",\n progress: 82,\n risk: \"Low\",\n },\n ],\n series: [\n { label: \"W1\", value: 72 },\n { label: \"W2\", value: 74 },\n { label: \"W3\", value: 76 },\n { label: \"W4\", value: 77 },\n { label: \"W5\", value: 79 },\n { label: \"W6\", value: 80 },\n { label: \"W7\", value: 81 },\n { label: \"W8\", value: 83 },\n { label: \"W9\", value: 82 },\n { label: \"W10\", value: 84 },\n { label: \"W11\", value: 86 },\n { label: \"W12\", value: 88 },\n ],\n subtitle: \"Revenue, margin, and expense control overview\",\n summary: [\n { label: \"Revenue\", value: \"$2.48M\", trend: \"+14.2% QoQ\", tone: \"success\" },\n {\n label: \"Gross Margin\",\n value: \"61.8%\",\n trend: \"+2.1 pts\",\n tone: \"success\",\n },\n { label: \"Opex\", value: \"$0.93M\", trend: \"-3.4% QoQ\", tone: \"success\" },\n { label: \"Runway\", value: \"22 months\", trend: \"Stable\", tone: \"info\" },\n ],\n title: \"Quarterly Financial Report\",\n};\n\nexport function FinancialReportDocument({\n theme,\n data = sampleFinancialData,\n}: ReportTemplateProps) {\n return (\n <ReportTemplateFrame\n theme={theme}\n data={data}\n titlePrefix=\"Financial Report\"\n statusLabel=\"Finance: Healthy\"\n statusTone=\"success\"\n graphVariant=\"line\"\n graphTitle=\"Revenue trajectory\"\n graphSubtitle=\"Quarterly weighted revenue index\"\n graphLegend=\"none\"\n graphColors={[\"#0F172A\"]}\n />\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/report-financial/report-layout.tsx",
+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n Badge,\n DataTable,\n Divider,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Stack,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { BaseReportData } from \"./report.types\";\n\nexport interface ReportTemplateProps {\n theme?: PdfcnTheme;\n data?: BaseReportData;\n}\n\ntype ReportGraphVariant =\n | \"bar\"\n | \"horizontal-bar\"\n | \"line\"\n | \"area\"\n | \"pie\"\n | \"donut\";\n\ninterface ReportLayoutProps {\n data: BaseReportData;\n titlePrefix: string;\n statusLabel: string;\n statusTone: \"success\" | \"warning\" | \"destructive\" | \"info\";\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: \"bottom\" | \"right\" | \"none\";\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: { label: string; value: number }[];\n}\n\nfunction toneColor(\n theme: PdfcnTheme,\n tone: \"success\" | \"warning\" | \"destructive\" | \"info\"\n) {\n if (tone === \"success\") {return theme.colors.success;}\n if (tone === \"warning\") {return theme.colors.warning;}\n if (tone === \"destructive\") {return theme.colors.destructive;}\n return theme.colors.info;\n}\n\nexport function ReportLayout({\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend = \"none\",\n graphShowValues = false,\n graphColors,\n graphData,\n}: ReportLayoutProps) {\n const theme = usePdfcnTheme();\n const accent = toneColor(theme, statusTone);\n\n const styles = StyleSheet.create({\n col: {\n flex: 1,\n },\n graphShell: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 12,\n },\n metricCard: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 8,\n width: \"48.6%\",\n },\n metricLabel: {\n color: theme.colors.mutedForeground,\n fontSize: 8,\n letterSpacing: 0.5,\n marginBottom: 2,\n textTransform: \"uppercase\",\n },\n metricTrend: {\n color: theme.colors.mutedForeground,\n fontSize: 9,\n },\n metricValue: {\n color: theme.colors.foreground,\n fontSize: 14,\n fontWeight: theme.primitives.fontWeights.bold,\n marginBottom: 2,\n },\n metricsGrid: {\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n paddingBottom: theme.spacing.page.marginBottom,\n paddingLeft: theme.spacing.page.marginLeft,\n paddingRight: theme.spacing.page.marginRight,\n paddingTop: theme.spacing.page.marginTop,\n },\n toolbar: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: 8,\n },\n twoColumn: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n gap: 10,\n },\n });\n\n return (\n <Document title={`${titlePrefix} ${data.period}`}>\n <Page size=\"A4\" style={styles.page}>\n <PageHeader\n variant=\"two-column\"\n title={data.title}\n subtitle={`${titlePrefix} · ${data.subtitle}`}\n rightText={data.period}\n rightSubText={`Generated ${data.generatedAt}`}\n marginBottom={14}\n />\n\n <View style={styles.toolbar}>\n <Badge label={statusLabel} variant={statusTone} size=\"sm\" />\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Author: {data.author}\n </Text>\n </View>\n\n <Section variant=\"card\" padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Executive Summary\n </Text>\n <View style={styles.metricsGrid}>\n {data.summary.map((metric) => (\n <View\n key={metric.label}\n style={[\n styles.metricCard,\n {\n borderLeftColor: metric.tone\n ? toneColor(theme, metric.tone)\n : accent,\n borderLeftWidth: 3,\n },\n ]}\n >\n <Text style={styles.metricLabel} noMargin>\n {metric.label}\n </Text>\n <Text style={styles.metricValue} noMargin>\n {metric.value}\n </Text>\n {metric.trend ? (\n <Badge\n label={metric.trend}\n size=\"sm\"\n variant={metric.tone ?? \"info\"}\n />\n ) : null}\n </View>\n ))}\n </View>\n </Section>\n\n <Section padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View style={styles.graphShell}>\n <PdfGraph\n variant={graphVariant}\n data={graphData ?? data.series}\n title={graphTitle}\n subtitle={graphSubtitle}\n yLabel={undefined}\n xLabel={undefined}\n showGrid={graphVariant !== \"pie\" && graphVariant !== \"donut\"}\n showValues={graphShowValues}\n smooth={graphVariant === \"line\" || graphVariant === \"area\"}\n legend={graphLegend}\n height={200}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section padding=\"md\">\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Delivery Table\n </Text>\n <DataTable\n variant=\"compact\"\n size=\"compact\"\n stripe\n columns={[\n { header: \"Stream\", key: \"label\" },\n { header: \"Owner\", key: \"owner\" },\n { align: \"center\", header: \"Status\", key: \"status\" },\n {\n align: \"right\",\n header: \"Progress\",\n key: \"progress\",\n render: (value) => `${String(value)}%`,\n },\n { align: \"right\", header: \"Risk\", key: \"risk\" },\n ]}\n data={data.rows}\n footer={{\n label: \"Totals\",\n owner: \"-\",\n progress: Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n ),\n risk: \"-\",\n status: \"-\",\n }}\n />\n </Section>\n\n <Section padding=\"md\" variant=\"card\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Highlights & Risks\n </Text>\n <View style={styles.twoColumn}>\n <View style={styles.col}>\n <PdfList\n variant=\"checklist\"\n items={data.highlights.map((item) => ({\n checked: true,\n text: item,\n }))}\n gap=\"sm\"\n />\n </View>\n <View style={styles.col}>\n <KeyValue\n size=\"sm\"\n divided\n items={[\n {\n key: \"Open Risks\",\n value: `${data.rows.filter((r) => r.risk !== \"Low\").length}`,\n },\n {\n key: \"On-Track Streams\",\n value: `${data.rows.filter((r) => r.status === \"On Track\").length}/${data.rows.length}`,\n },\n {\n key: \"Average Progress\",\n value: `${Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n )}%`,\n },\n ]}\n />\n </View>\n </View>\n <Divider />\n <Stack gap=\"sm\">\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: keep each section under one page using `noWrap` for\n concise blocks.\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: pass explicit row keys/owners to avoid ambiguous\n reporting handoffs.\n </Text>\n </Stack>\n </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with PDFx\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </Page>\n </Document>\n );\n}\n\nexport function ReportTemplateFrame({\n theme,\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend,\n graphShowValues,\n graphColors,\n graphData,\n}: ReportTemplateProps & {\n titlePrefix: string;\n statusLabel: string;\n statusTone: \"success\" | \"warning\" | \"destructive\" | \"info\";\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: \"bottom\" | \"right\" | \"none\";\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: { label: string; value: number }[];\n}) {\n if (!data) {return null;}\n\n return (\n <PdfcnThemeProvider theme={theme}>\n <ReportLayout\n data={data}\n titlePrefix={titlePrefix}\n statusLabel={statusLabel}\n statusTone={statusTone}\n graphVariant={graphVariant}\n graphTitle={graphTitle}\n graphSubtitle={graphSubtitle}\n graphLegend={graphLegend}\n graphShowValues={graphShowValues}\n graphColors={graphColors}\n graphData={graphData}\n />\n </PdfcnThemeProvider>\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/report-financial/report.types.ts",
+ "content": "export interface SummaryMetric {\n label: string;\n value: string;\n trend?: string;\n tone?: \"success\" | \"warning\" | \"destructive\" | \"info\";\n}\n\nexport type ReportRow = Record<string, unknown> & {\n label: string;\n owner: string;\n status: string;\n progress: number;\n risk?: string;\n};\n\nexport interface ReportSeriesPoint {\n label: string;\n value: number;\n}\n\nexport interface BaseReportData {\n title: string;\n subtitle: string;\n generatedAt: string;\n period: string;\n author: string;\n summary: SummaryMetric[];\n rows: ReportRow[];\n series: ReportSeriesPoint[];\n highlights: string[];\n}\n",
+ "type": "registry:block"
+ }
+ ],
+ "type": "registry:block"
+}
\ No newline at end of file
diff --git a/public/r/takumi/report-marketing.json b/public/r/takumi/report-marketing.json
new file mode 100644
index 0000000..ea918a5
--- /dev/null
+++ b/public/r/takumi/report-marketing.json
@@ -0,0 +1,31 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/report-marketing",
+ "title": "Report Marketing",
+ "description": "Report Marketing PDF block (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/report-marketing/report-layout.tsx",
+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n Badge,\n DataTable,\n Divider,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Stack,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { BaseReportData } from \"./report.types\";\n\nexport interface ReportTemplateProps {\n theme?: PdfcnTheme;\n data?: BaseReportData;\n}\n\ntype ReportGraphVariant =\n | \"bar\"\n | \"horizontal-bar\"\n | \"line\"\n | \"area\"\n | \"pie\"\n | \"donut\";\n\ninterface ReportLayoutProps {\n data: BaseReportData;\n titlePrefix: string;\n statusLabel: string;\n statusTone: \"success\" | \"warning\" | \"destructive\" | \"info\";\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: \"bottom\" | \"right\" | \"none\";\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: { label: string; value: number }[];\n}\n\nfunction toneColor(\n theme: PdfcnTheme,\n tone: \"success\" | \"warning\" | \"destructive\" | \"info\"\n) {\n if (tone === \"success\") {return theme.colors.success;}\n if (tone === \"warning\") {return theme.colors.warning;}\n if (tone === \"destructive\") {return theme.colors.destructive;}\n return theme.colors.info;\n}\n\nexport function ReportLayout({\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend = \"none\",\n graphShowValues = false,\n graphColors,\n graphData,\n}: ReportLayoutProps) {\n const theme = usePdfcnTheme();\n const accent = toneColor(theme, statusTone);\n\n const styles = StyleSheet.create({\n col: {\n flex: 1,\n },\n graphShell: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 12,\n },\n metricCard: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 8,\n width: \"48.6%\",\n },\n metricLabel: {\n color: theme.colors.mutedForeground,\n fontSize: 8,\n letterSpacing: 0.5,\n marginBottom: 2,\n textTransform: \"uppercase\",\n },\n metricTrend: {\n color: theme.colors.mutedForeground,\n fontSize: 9,\n },\n metricValue: {\n color: theme.colors.foreground,\n fontSize: 14,\n fontWeight: theme.primitives.fontWeights.bold,\n marginBottom: 2,\n },\n metricsGrid: {\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n paddingBottom: theme.spacing.page.marginBottom,\n paddingLeft: theme.spacing.page.marginLeft,\n paddingRight: theme.spacing.page.marginRight,\n paddingTop: theme.spacing.page.marginTop,\n },\n toolbar: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: 8,\n },\n twoColumn: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n gap: 10,\n },\n });\n\n return (\n <Document title={`${titlePrefix} ${data.period}`}>\n <Page size=\"A4\" style={styles.page}>\n <PageHeader\n variant=\"two-column\"\n title={data.title}\n subtitle={`${titlePrefix} · ${data.subtitle}`}\n rightText={data.period}\n rightSubText={`Generated ${data.generatedAt}`}\n marginBottom={14}\n />\n\n <View style={styles.toolbar}>\n <Badge label={statusLabel} variant={statusTone} size=\"sm\" />\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Author: {data.author}\n </Text>\n </View>\n\n <Section variant=\"card\" padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Executive Summary\n </Text>\n <View style={styles.metricsGrid}>\n {data.summary.map((metric) => (\n <View\n key={metric.label}\n style={[\n styles.metricCard,\n {\n borderLeftColor: metric.tone\n ? toneColor(theme, metric.tone)\n : accent,\n borderLeftWidth: 3,\n },\n ]}\n >\n <Text style={styles.metricLabel} noMargin>\n {metric.label}\n </Text>\n <Text style={styles.metricValue} noMargin>\n {metric.value}\n </Text>\n {metric.trend ? (\n <Badge\n label={metric.trend}\n size=\"sm\"\n variant={metric.tone ?? \"info\"}\n />\n ) : null}\n </View>\n ))}\n </View>\n </Section>\n\n <Section padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View style={styles.graphShell}>\n <PdfGraph\n variant={graphVariant}\n data={graphData ?? data.series}\n title={graphTitle}\n subtitle={graphSubtitle}\n yLabel={undefined}\n xLabel={undefined}\n showGrid={graphVariant !== \"pie\" && graphVariant !== \"donut\"}\n showValues={graphShowValues}\n smooth={graphVariant === \"line\" || graphVariant === \"area\"}\n legend={graphLegend}\n height={200}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section padding=\"md\">\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Delivery Table\n </Text>\n <DataTable\n variant=\"compact\"\n size=\"compact\"\n stripe\n columns={[\n { header: \"Stream\", key: \"label\" },\n { header: \"Owner\", key: \"owner\" },\n { align: \"center\", header: \"Status\", key: \"status\" },\n {\n align: \"right\",\n header: \"Progress\",\n key: \"progress\",\n render: (value) => `${String(value)}%`,\n },\n { align: \"right\", header: \"Risk\", key: \"risk\" },\n ]}\n data={data.rows}\n footer={{\n label: \"Totals\",\n owner: \"-\",\n progress: Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n ),\n risk: \"-\",\n status: \"-\",\n }}\n />\n </Section>\n\n <Section padding=\"md\" variant=\"card\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Highlights & Risks\n </Text>\n <View style={styles.twoColumn}>\n <View style={styles.col}>\n <PdfList\n variant=\"checklist\"\n items={data.highlights.map((item) => ({\n checked: true,\n text: item,\n }))}\n gap=\"sm\"\n />\n </View>\n <View style={styles.col}>\n <KeyValue\n size=\"sm\"\n divided\n items={[\n {\n key: \"Open Risks\",\n value: `${data.rows.filter((r) => r.risk !== \"Low\").length}`,\n },\n {\n key: \"On-Track Streams\",\n value: `${data.rows.filter((r) => r.status === \"On Track\").length}/${data.rows.length}`,\n },\n {\n key: \"Average Progress\",\n value: `${Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n )}%`,\n },\n ]}\n />\n </View>\n </View>\n <Divider />\n <Stack gap=\"sm\">\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: keep each section under one page using `noWrap` for\n concise blocks.\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: pass explicit row keys/owners to avoid ambiguous\n reporting handoffs.\n </Text>\n </Stack>\n </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with PDFx\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </Page>\n </Document>\n );\n}\n\nexport function ReportTemplateFrame({\n theme,\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend,\n graphShowValues,\n graphColors,\n graphData,\n}: ReportTemplateProps & {\n titlePrefix: string;\n statusLabel: string;\n statusTone: \"success\" | \"warning\" | \"destructive\" | \"info\";\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: \"bottom\" | \"right\" | \"none\";\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: { label: string; value: number }[];\n}) {\n if (!data) {return null;}\n\n return (\n <PdfcnThemeProvider theme={theme}>\n <ReportLayout\n data={data}\n titlePrefix={titlePrefix}\n statusLabel={statusLabel}\n statusTone={statusTone}\n graphVariant={graphVariant}\n graphTitle={graphTitle}\n graphSubtitle={graphSubtitle}\n graphLegend={graphLegend}\n graphShowValues={graphShowValues}\n graphColors={graphColors}\n graphData={graphData}\n />\n </PdfcnThemeProvider>\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/report-marketing/report-marketing.tsx",
+ "content": "import { ReportTemplateFrame } from './report-layout';\nimport type { ReportTemplateProps } from './report-layout';\nimport type { BaseReportData } from \"./report.types\";\n\nconst sampleMarketingData: BaseReportData = {\n author: \"Growth Team\",\n generatedAt: \"February 23, 2026\",\n highlights: [\n \"Channel mix improved CAC while maintaining lead quality.\",\n \"Lifecycle email workflow has deliverability issues under investigation.\",\n \"Referral program is producing higher-intent pipeline with lower cost.\",\n ],\n period: \"Campaign Cycle 2026-02\",\n rows: [\n {\n label: \"SEO\",\n owner: \"H. Evans\",\n status: \"On Track\",\n progress: 84,\n risk: \"Low\",\n },\n {\n label: \"Paid Search\",\n owner: \"K. Martin\",\n status: \"On Track\",\n progress: 80,\n risk: \"Low\",\n },\n {\n label: \"Lifecycle Email\",\n owner: \"V. Lee\",\n status: \"At Risk\",\n progress: 64,\n risk: \"Medium\",\n },\n {\n label: \"Partner Referrals\",\n owner: \"J. Gomez\",\n status: \"On Track\",\n progress: 75,\n risk: \"Medium\",\n },\n ],\n series: [\n { label: \"W1\", value: 55 },\n { label: \"W2\", value: 57 },\n { label: \"W3\", value: 59 },\n { label: \"W4\", value: 60 },\n { label: \"W5\", value: 62 },\n { label: \"W6\", value: 63 },\n { label: \"W7\", value: 65 },\n { label: \"W8\", value: 67 },\n { label: \"W9\", value: 66 },\n { label: \"W10\", value: 68 },\n { label: \"W11\", value: 70 },\n { label: \"W12\", value: 72 },\n ],\n subtitle: \"Pipeline, conversion efficiency, and channel performance\",\n summary: [\n { label: \"MQLs\", value: \"3,940\", trend: \"+22.1% cycle\", tone: \"success\" },\n { label: \"CAC\", value: \"$118\", trend: \"-7.4%\", tone: \"success\" },\n { label: \"Win Rate\", value: \"28.6%\", trend: \"+1.1 pts\", tone: \"info\" },\n { label: \"Churn Risk\", value: \"6.2%\", trend: \"+0.8 pts\", tone: \"warning\" },\n ],\n title: \"Growth & Marketing Report\",\n};\n\nexport function MarketingReportDocument({\n theme,\n data = sampleMarketingData,\n}: ReportTemplateProps) {\n return (\n <ReportTemplateFrame\n theme={theme}\n data={data}\n titlePrefix=\"Growth Report\"\n statusLabel=\"Growth: Strong\"\n statusTone=\"success\"\n graphVariant=\"bar\"\n graphTitle=\"Pipeline build by week\"\n graphSubtitle=\"Demand creation output trend\"\n graphLegend=\"none\"\n graphShowValues\n graphColors={[\"#0EA5E9\"]}\n />\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/report-marketing/report.types.ts",
+ "content": "export interface SummaryMetric {\n label: string;\n value: string;\n trend?: string;\n tone?: \"success\" | \"warning\" | \"destructive\" | \"info\";\n}\n\nexport type ReportRow = Record<string, unknown> & {\n label: string;\n owner: string;\n status: string;\n progress: number;\n risk?: string;\n};\n\nexport interface ReportSeriesPoint {\n label: string;\n value: number;\n}\n\nexport interface BaseReportData {\n title: string;\n subtitle: string;\n generatedAt: string;\n period: string;\n author: string;\n summary: SummaryMetric[];\n rows: ReportRow[];\n series: ReportSeriesPoint[];\n highlights: string[];\n}\n",
+ "type": "registry:block"
+ }
+ ],
+ "type": "registry:block"
+}
\ No newline at end of file
diff --git a/public/r/takumi/report-operations.json b/public/r/takumi/report-operations.json
new file mode 100644
index 0000000..64d3c18
--- /dev/null
+++ b/public/r/takumi/report-operations.json
@@ -0,0 +1,31 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/report-operations",
+ "title": "Report Operations",
+ "description": "Report Operations PDF block (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/report-operations/report-layout.tsx",
+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n Badge,\n DataTable,\n Divider,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Stack,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { BaseReportData } from \"./report.types\";\n\nexport interface ReportTemplateProps {\n theme?: PdfcnTheme;\n data?: BaseReportData;\n}\n\ntype ReportGraphVariant =\n | \"bar\"\n | \"horizontal-bar\"\n | \"line\"\n | \"area\"\n | \"pie\"\n | \"donut\";\n\ninterface ReportLayoutProps {\n data: BaseReportData;\n titlePrefix: string;\n statusLabel: string;\n statusTone: \"success\" | \"warning\" | \"destructive\" | \"info\";\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: \"bottom\" | \"right\" | \"none\";\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: { label: string; value: number }[];\n}\n\nfunction toneColor(\n theme: PdfcnTheme,\n tone: \"success\" | \"warning\" | \"destructive\" | \"info\"\n) {\n if (tone === \"success\") {return theme.colors.success;}\n if (tone === \"warning\") {return theme.colors.warning;}\n if (tone === \"destructive\") {return theme.colors.destructive;}\n return theme.colors.info;\n}\n\nexport function ReportLayout({\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend = \"none\",\n graphShowValues = false,\n graphColors,\n graphData,\n}: ReportLayoutProps) {\n const theme = usePdfcnTheme();\n const accent = toneColor(theme, statusTone);\n\n const styles = StyleSheet.create({\n col: {\n flex: 1,\n },\n graphShell: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 12,\n },\n metricCard: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 8,\n width: \"48.6%\",\n },\n metricLabel: {\n color: theme.colors.mutedForeground,\n fontSize: 8,\n letterSpacing: 0.5,\n marginBottom: 2,\n textTransform: \"uppercase\",\n },\n metricTrend: {\n color: theme.colors.mutedForeground,\n fontSize: 9,\n },\n metricValue: {\n color: theme.colors.foreground,\n fontSize: 14,\n fontWeight: theme.primitives.fontWeights.bold,\n marginBottom: 2,\n },\n metricsGrid: {\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n paddingBottom: theme.spacing.page.marginBottom,\n paddingLeft: theme.spacing.page.marginLeft,\n paddingRight: theme.spacing.page.marginRight,\n paddingTop: theme.spacing.page.marginTop,\n },\n toolbar: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: 8,\n },\n twoColumn: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n gap: 10,\n },\n });\n\n return (\n <Document title={`${titlePrefix} ${data.period}`}>\n <Page size=\"A4\" style={styles.page}>\n <PageHeader\n variant=\"two-column\"\n title={data.title}\n subtitle={`${titlePrefix} · ${data.subtitle}`}\n rightText={data.period}\n rightSubText={`Generated ${data.generatedAt}`}\n marginBottom={14}\n />\n\n <View style={styles.toolbar}>\n <Badge label={statusLabel} variant={statusTone} size=\"sm\" />\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Author: {data.author}\n </Text>\n </View>\n\n <Section variant=\"card\" padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Executive Summary\n </Text>\n <View style={styles.metricsGrid}>\n {data.summary.map((metric) => (\n <View\n key={metric.label}\n style={[\n styles.metricCard,\n {\n borderLeftColor: metric.tone\n ? toneColor(theme, metric.tone)\n : accent,\n borderLeftWidth: 3,\n },\n ]}\n >\n <Text style={styles.metricLabel} noMargin>\n {metric.label}\n </Text>\n <Text style={styles.metricValue} noMargin>\n {metric.value}\n </Text>\n {metric.trend ? (\n <Badge\n label={metric.trend}\n size=\"sm\"\n variant={metric.tone ?? \"info\"}\n />\n ) : null}\n </View>\n ))}\n </View>\n </Section>\n\n <Section padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View style={styles.graphShell}>\n <PdfGraph\n variant={graphVariant}\n data={graphData ?? data.series}\n title={graphTitle}\n subtitle={graphSubtitle}\n yLabel={undefined}\n xLabel={undefined}\n showGrid={graphVariant !== \"pie\" && graphVariant !== \"donut\"}\n showValues={graphShowValues}\n smooth={graphVariant === \"line\" || graphVariant === \"area\"}\n legend={graphLegend}\n height={200}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section padding=\"md\">\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Delivery Table\n </Text>\n <DataTable\n variant=\"compact\"\n size=\"compact\"\n stripe\n columns={[\n { header: \"Stream\", key: \"label\" },\n { header: \"Owner\", key: \"owner\" },\n { align: \"center\", header: \"Status\", key: \"status\" },\n {\n align: \"right\",\n header: \"Progress\",\n key: \"progress\",\n render: (value) => `${String(value)}%`,\n },\n { align: \"right\", header: \"Risk\", key: \"risk\" },\n ]}\n data={data.rows}\n footer={{\n label: \"Totals\",\n owner: \"-\",\n progress: Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n ),\n risk: \"-\",\n status: \"-\",\n }}\n />\n </Section>\n\n <Section padding=\"md\" variant=\"card\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Highlights & Risks\n </Text>\n <View style={styles.twoColumn}>\n <View style={styles.col}>\n <PdfList\n variant=\"checklist\"\n items={data.highlights.map((item) => ({\n checked: true,\n text: item,\n }))}\n gap=\"sm\"\n />\n </View>\n <View style={styles.col}>\n <KeyValue\n size=\"sm\"\n divided\n items={[\n {\n key: \"Open Risks\",\n value: `${data.rows.filter((r) => r.risk !== \"Low\").length}`,\n },\n {\n key: \"On-Track Streams\",\n value: `${data.rows.filter((r) => r.status === \"On Track\").length}/${data.rows.length}`,\n },\n {\n key: \"Average Progress\",\n value: `${Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n )}%`,\n },\n ]}\n />\n </View>\n </View>\n <Divider />\n <Stack gap=\"sm\">\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: keep each section under one page using `noWrap` for\n concise blocks.\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: pass explicit row keys/owners to avoid ambiguous\n reporting handoffs.\n </Text>\n </Stack>\n </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with PDFx\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </Page>\n </Document>\n );\n}\n\nexport function ReportTemplateFrame({\n theme,\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend,\n graphShowValues,\n graphColors,\n graphData,\n}: ReportTemplateProps & {\n titlePrefix: string;\n statusLabel: string;\n statusTone: \"success\" | \"warning\" | \"destructive\" | \"info\";\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: \"bottom\" | \"right\" | \"none\";\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: { label: string; value: number }[];\n}) {\n if (!data) {return null;}\n\n return (\n <PdfcnThemeProvider theme={theme}>\n <ReportLayout\n data={data}\n titlePrefix={titlePrefix}\n statusLabel={statusLabel}\n statusTone={statusTone}\n graphVariant={graphVariant}\n graphTitle={graphTitle}\n graphSubtitle={graphSubtitle}\n graphLegend={graphLegend}\n graphShowValues={graphShowValues}\n graphColors={graphColors}\n graphData={graphData}\n />\n </PdfcnThemeProvider>\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/report-operations/report-operations.tsx",
+ "content": "import { ReportTemplateFrame } from './report-layout';\nimport type { ReportTemplateProps } from './report-layout';\nimport type { BaseReportData } from \"./report.types\";\n\nconst sampleOperationsData: BaseReportData = {\n author: \"Delivery Office\",\n generatedAt: \"February 23, 2026\",\n highlights: [\n \"SLA improved after shift rebalancing and incident triage changes.\",\n \"Backlog grew in week 4 due to release-related ticket surge.\",\n \"Incident queue remediation plan has executive sponsorship and budget.\",\n ],\n period: \"February 2026\",\n rows: [\n {\n label: \"L1 Support\",\n owner: \"N. Mehta\",\n status: \"On Track\",\n progress: 91,\n risk: \"Low\",\n },\n {\n label: \"L2 Support\",\n owner: \"D. Chen\",\n status: \"On Track\",\n progress: 85,\n risk: \"Low\",\n },\n {\n label: \"Incident Queue\",\n owner: \"R. Walker\",\n status: \"At Risk\",\n progress: 66,\n risk: \"High\",\n },\n {\n label: \"Automation Rollout\",\n owner: \"M. Roy\",\n status: \"On Track\",\n progress: 77,\n risk: \"Medium\",\n },\n ],\n series: [\n { label: \"W1\", value: 69 },\n { label: \"W2\", value: 71 },\n { label: \"W3\", value: 73 },\n { label: \"W4\", value: 74 },\n { label: \"W5\", value: 75 },\n { label: \"W6\", value: 76 },\n { label: \"W7\", value: 78 },\n { label: \"W8\", value: 79 },\n { label: \"W9\", value: 78 },\n { label: \"W10\", value: 80 },\n { label: \"W11\", value: 81 },\n { label: \"W12\", value: 83 },\n ],\n subtitle: \"Delivery throughput, SLA adherence, and backlog visibility\",\n summary: [\n {\n label: \"Tickets Closed\",\n value: \"1,284\",\n trend: \"+9.8% MoM\",\n tone: \"success\",\n },\n {\n label: \"SLA Hit Rate\",\n value: \"96.1%\",\n trend: \"+1.4 pts\",\n tone: \"success\",\n },\n { label: \"Backlog\", value: \"214\", trend: \"+6.0%\", tone: \"warning\" },\n { label: \"Escalations\", value: \"17\", trend: \"-18.5%\", tone: \"success\" },\n ],\n title: \"Monthly Operations Report\",\n};\n\nexport function OperationsReportDocument({\n theme,\n data = sampleOperationsData,\n}: ReportTemplateProps) {\n return (\n <ReportTemplateFrame\n theme={theme}\n data={data}\n titlePrefix=\"Operations Report\"\n statusLabel=\"Ops: Watch\"\n statusTone=\"warning\"\n graphVariant=\"horizontal-bar\"\n graphTitle=\"Throughput by week\"\n graphSubtitle=\"Resolved workload distribution\"\n graphLegend=\"none\"\n graphShowValues\n graphColors={[\"#2563EB\"]}\n graphData={[\n { label: \"Incident\", value: 66 },\n { label: \"Automation\", value: 77 },\n { label: \"L2 Support\", value: 85 },\n { label: \"L1 Support\", value: 91 },\n ]}\n />\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/report-operations/report.types.ts",
+ "content": "export interface SummaryMetric {\n label: string;\n value: string;\n trend?: string;\n tone?: \"success\" | \"warning\" | \"destructive\" | \"info\";\n}\n\nexport type ReportRow = Record<string, unknown> & {\n label: string;\n owner: string;\n status: string;\n progress: number;\n risk?: string;\n};\n\nexport interface ReportSeriesPoint {\n label: string;\n value: number;\n}\n\nexport interface BaseReportData {\n title: string;\n subtitle: string;\n generatedAt: string;\n period: string;\n author: string;\n summary: SummaryMetric[];\n rows: ReportRow[];\n series: ReportSeriesPoint[];\n highlights: string[];\n}\n",
+ "type": "registry:block"
+ }
+ ],
+ "type": "registry:block"
+}
\ No newline at end of file
diff --git a/public/r/takumi/report-security.json b/public/r/takumi/report-security.json
new file mode 100644
index 0000000..98d5251
--- /dev/null
+++ b/public/r/takumi/report-security.json
@@ -0,0 +1,31 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/report-security",
+ "title": "Report Security",
+ "description": "Report Security PDF block (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/report-security/report-layout.tsx",
+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n Badge,\n DataTable,\n Divider,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Stack,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { BaseReportData } from \"./report.types\";\n\nexport interface ReportTemplateProps {\n theme?: PdfcnTheme;\n data?: BaseReportData;\n}\n\ntype ReportGraphVariant =\n | \"bar\"\n | \"horizontal-bar\"\n | \"line\"\n | \"area\"\n | \"pie\"\n | \"donut\";\n\ninterface ReportLayoutProps {\n data: BaseReportData;\n titlePrefix: string;\n statusLabel: string;\n statusTone: \"success\" | \"warning\" | \"destructive\" | \"info\";\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: \"bottom\" | \"right\" | \"none\";\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: { label: string; value: number }[];\n}\n\nfunction toneColor(\n theme: PdfcnTheme,\n tone: \"success\" | \"warning\" | \"destructive\" | \"info\"\n) {\n if (tone === \"success\") {return theme.colors.success;}\n if (tone === \"warning\") {return theme.colors.warning;}\n if (tone === \"destructive\") {return theme.colors.destructive;}\n return theme.colors.info;\n}\n\nexport function ReportLayout({\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend = \"none\",\n graphShowValues = false,\n graphColors,\n graphData,\n}: ReportLayoutProps) {\n const theme = usePdfcnTheme();\n const accent = toneColor(theme, statusTone);\n\n const styles = StyleSheet.create({\n col: {\n flex: 1,\n },\n graphShell: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 12,\n },\n metricCard: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 8,\n width: \"48.6%\",\n },\n metricLabel: {\n color: theme.colors.mutedForeground,\n fontSize: 8,\n letterSpacing: 0.5,\n marginBottom: 2,\n textTransform: \"uppercase\",\n },\n metricTrend: {\n color: theme.colors.mutedForeground,\n fontSize: 9,\n },\n metricValue: {\n color: theme.colors.foreground,\n fontSize: 14,\n fontWeight: theme.primitives.fontWeights.bold,\n marginBottom: 2,\n },\n metricsGrid: {\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n paddingBottom: theme.spacing.page.marginBottom,\n paddingLeft: theme.spacing.page.marginLeft,\n paddingRight: theme.spacing.page.marginRight,\n paddingTop: theme.spacing.page.marginTop,\n },\n toolbar: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: 8,\n },\n twoColumn: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n gap: 10,\n },\n });\n\n return (\n <Document title={`${titlePrefix} ${data.period}`}>\n <Page size=\"A4\" style={styles.page}>\n <PageHeader\n variant=\"two-column\"\n title={data.title}\n subtitle={`${titlePrefix} · ${data.subtitle}`}\n rightText={data.period}\n rightSubText={`Generated ${data.generatedAt}`}\n marginBottom={14}\n />\n\n <View style={styles.toolbar}>\n <Badge label={statusLabel} variant={statusTone} size=\"sm\" />\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Author: {data.author}\n </Text>\n </View>\n\n <Section variant=\"card\" padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Executive Summary\n </Text>\n <View style={styles.metricsGrid}>\n {data.summary.map((metric) => (\n <View\n key={metric.label}\n style={[\n styles.metricCard,\n {\n borderLeftColor: metric.tone\n ? toneColor(theme, metric.tone)\n : accent,\n borderLeftWidth: 3,\n },\n ]}\n >\n <Text style={styles.metricLabel} noMargin>\n {metric.label}\n </Text>\n <Text style={styles.metricValue} noMargin>\n {metric.value}\n </Text>\n {metric.trend ? (\n <Badge\n label={metric.trend}\n size=\"sm\"\n variant={metric.tone ?? \"info\"}\n />\n ) : null}\n </View>\n ))}\n </View>\n </Section>\n\n <Section padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View style={styles.graphShell}>\n <PdfGraph\n variant={graphVariant}\n data={graphData ?? data.series}\n title={graphTitle}\n subtitle={graphSubtitle}\n yLabel={undefined}\n xLabel={undefined}\n showGrid={graphVariant !== \"pie\" && graphVariant !== \"donut\"}\n showValues={graphShowValues}\n smooth={graphVariant === \"line\" || graphVariant === \"area\"}\n legend={graphLegend}\n height={200}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section padding=\"md\">\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Delivery Table\n </Text>\n <DataTable\n variant=\"compact\"\n size=\"compact\"\n stripe\n columns={[\n { header: \"Stream\", key: \"label\" },\n { header: \"Owner\", key: \"owner\" },\n { align: \"center\", header: \"Status\", key: \"status\" },\n {\n align: \"right\",\n header: \"Progress\",\n key: \"progress\",\n render: (value) => `${String(value)}%`,\n },\n { align: \"right\", header: \"Risk\", key: \"risk\" },\n ]}\n data={data.rows}\n footer={{\n label: \"Totals\",\n owner: \"-\",\n progress: Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n ),\n risk: \"-\",\n status: \"-\",\n }}\n />\n </Section>\n\n <Section padding=\"md\" variant=\"card\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Highlights & Risks\n </Text>\n <View style={styles.twoColumn}>\n <View style={styles.col}>\n <PdfList\n variant=\"checklist\"\n items={data.highlights.map((item) => ({\n checked: true,\n text: item,\n }))}\n gap=\"sm\"\n />\n </View>\n <View style={styles.col}>\n <KeyValue\n size=\"sm\"\n divided\n items={[\n {\n key: \"Open Risks\",\n value: `${data.rows.filter((r) => r.risk !== \"Low\").length}`,\n },\n {\n key: \"On-Track Streams\",\n value: `${data.rows.filter((r) => r.status === \"On Track\").length}/${data.rows.length}`,\n },\n {\n key: \"Average Progress\",\n value: `${Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n )}%`,\n },\n ]}\n />\n </View>\n </View>\n <Divider />\n <Stack gap=\"sm\">\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: keep each section under one page using `noWrap` for\n concise blocks.\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: pass explicit row keys/owners to avoid ambiguous\n reporting handoffs.\n </Text>\n </Stack>\n </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with PDFx\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </Page>\n </Document>\n );\n}\n\nexport function ReportTemplateFrame({\n theme,\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend,\n graphShowValues,\n graphColors,\n graphData,\n}: ReportTemplateProps & {\n titlePrefix: string;\n statusLabel: string;\n statusTone: \"success\" | \"warning\" | \"destructive\" | \"info\";\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: \"bottom\" | \"right\" | \"none\";\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: { label: string; value: number }[];\n}) {\n if (!data) {return null;}\n\n return (\n <PdfcnThemeProvider theme={theme}>\n <ReportLayout\n data={data}\n titlePrefix={titlePrefix}\n statusLabel={statusLabel}\n statusTone={statusTone}\n graphVariant={graphVariant}\n graphTitle={graphTitle}\n graphSubtitle={graphSubtitle}\n graphLegend={graphLegend}\n graphShowValues={graphShowValues}\n graphColors={graphColors}\n graphData={graphData}\n />\n </PdfcnThemeProvider>\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/report-security/report-security.tsx",
+ "content": "import { ReportTemplateFrame } from './report-layout';\nimport type { ReportTemplateProps } from './report-layout';\nimport type { BaseReportData } from \"./report.types\";\n\nconst sampleSecurityData: BaseReportData = {\n author: \"Security Engineering\",\n generatedAt: \"February 23, 2026\",\n highlights: [\n \"Critical vulnerabilities reduced through mandatory patch windows.\",\n \"Secrets rotation remains the highest-risk stream and needs additional staffing.\",\n \"External penetration test scheduled for next sprint to validate fixes.\",\n ],\n period: \"Sprint 05, 2026\",\n rows: [\n {\n label: \"Identity Hardening\",\n owner: \"E. Brown\",\n status: \"On Track\",\n progress: 87,\n risk: \"Low\",\n },\n {\n label: \"Secrets Rotation\",\n owner: \"P. Nair\",\n status: \"At Risk\",\n progress: 58,\n risk: \"High\",\n },\n {\n label: \"Dependency Scanning\",\n owner: \"I. Shah\",\n status: \"On Track\",\n progress: 81,\n risk: \"Medium\",\n },\n {\n label: \"WAF Policy\",\n owner: \"S. Reed\",\n status: \"On Track\",\n progress: 76,\n risk: \"Low\",\n },\n ],\n series: [\n { label: \"W1\", value: 61 },\n { label: \"W2\", value: 63 },\n { label: \"W3\", value: 64 },\n { label: \"W4\", value: 66 },\n { label: \"W5\", value: 67 },\n { label: \"W6\", value: 68 },\n { label: \"W7\", value: 69 },\n { label: \"W8\", value: 71 },\n { label: \"W9\", value: 72 },\n { label: \"W10\", value: 74 },\n { label: \"W11\", value: 76 },\n { label: \"W12\", value: 78 },\n ],\n subtitle: \"Vulnerability trends, control maturity, and remediation health\",\n summary: [\n {\n label: \"Critical Vulns\",\n value: \"2\",\n trend: \"-3 from last sprint\",\n tone: \"success\",\n },\n { label: \"Patch SLA\", value: \"92.0%\", trend: \"+5.3 pts\", tone: \"success\" },\n { label: \"Open Findings\", value: \"41\", trend: \"+4\", tone: \"warning\" },\n { label: \"Control Score\", value: \"84/100\", trend: \"+2 pts\", tone: \"info\" },\n ],\n title: \"Security Posture Report\",\n};\n\nexport function SecurityReportDocument({\n theme,\n data = sampleSecurityData,\n}: ReportTemplateProps) {\n return (\n <ReportTemplateFrame\n theme={theme}\n data={data}\n titlePrefix=\"Security Report\"\n statusLabel=\"Security: Action Needed\"\n statusTone=\"destructive\"\n graphVariant=\"donut\"\n graphTitle=\"Open risk distribution\"\n graphSubtitle=\"High/Medium/Low workload share\"\n graphLegend=\"right\"\n graphShowValues\n graphColors={[\"#DC2626\", \"#F59E0B\", \"#16A34A\", \"#0EA5E9\"]}\n graphData={[\n { label: \"High Risk\", value: 14 },\n { label: \"Medium Risk\", value: 17 },\n { label: \"Low Risk\", value: 8 },\n { label: \"Info\", value: 4 },\n ]}\n />\n );\n}\n",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/report-security/report.types.ts",
+ "content": "export interface SummaryMetric {\n label: string;\n value: string;\n trend?: string;\n tone?: \"success\" | \"warning\" | \"destructive\" | \"info\";\n}\n\nexport type ReportRow = Record<string, unknown> & {\n label: string;\n owner: string;\n status: string;\n progress: number;\n risk?: string;\n};\n\nexport interface ReportSeriesPoint {\n label: string;\n value: number;\n}\n\nexport interface BaseReportData {\n title: string;\n subtitle: string;\n generatedAt: string;\n period: string;\n author: string;\n summary: SummaryMetric[];\n rows: ReportRow[];\n series: ReportSeriesPoint[];\n highlights: string[];\n}\n",
+ "type": "registry:block"
+ }
+ ],
+ "type": "registry:block"
+}
\ No newline at end of file
diff --git a/public/r/takumi/section.json b/public/r/takumi/section.json
new file mode 100644
index 0000000..cf4bba0
--- /dev/null
+++ b/public/r/takumi/section.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/section",
+ "title": "Section",
+ "description": "Section PDF component (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/section/section.tsx",
+ "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { View, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type SectionSpacing = \"none\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\nexport type SectionPadding = \"none\" | \"sm\" | \"md\" | \"lg\";\nexport type SectionVariant = \"default\" | \"callout\" | \"highlight\" | \"card\";\n\n/**\n * Layout container with spacing, padding, and visual style variants.\n * Props - `spacing` | `padding` | `background` | `border` | `variant` | `accentColor` | `noWrap` | `children` | `style`\n * @see {@link SectionProps}\n */\nexport interface SectionProps extends PDFComponentProps {\n /**\n * @default 'md'\n */\n spacing?: SectionSpacing;\n padding?: SectionPadding;\n background?: string;\n /**\n * @default false\n */\n border?: boolean;\n /**\n * @default 'default'\n */\n variant?: SectionVariant;\n accentColor?: string;\n /**\n * @default false\n */\n noWrap?: boolean;\n}\n\nfunction createSectionStyles(t: PdfcnTheme) {\n const { spacing, borderRadius } = t.primitives;\n return StyleSheet.create({\n base: { flexDirection: \"column\" },\n border: {\n borderColor: t.colors.border,\n borderRadius: borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: spacing[0.5],\n },\n callout: {\n borderLeftColor: t.colors.primary,\n borderLeftStyle: \"solid\",\n borderLeftWidth: spacing[1],\n paddingLeft: spacing[4],\n paddingVertical: spacing[2],\n },\n card: {\n borderColor: t.colors.border,\n borderRadius: borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: spacing[0.5],\n padding: spacing[4],\n },\n highlight: {\n backgroundColor: t.colors.muted,\n borderLeftColor: t.colors.primary,\n borderLeftStyle: \"solid\",\n borderLeftWidth: spacing[1],\n padding: spacing[4],\n },\n paddingLg: { padding: spacing[6] },\n paddingMd: { padding: spacing[4] },\n paddingNone: { padding: spacing[0] },\n paddingSm: { padding: spacing[3] },\n spacingLg: { marginVertical: spacing[8] },\n spacingMd: { marginVertical: t.spacing.sectionGap },\n spacingNone: { marginVertical: spacing[0] },\n spacingSm: { marginVertical: spacing[4] },\n spacingXl: { marginVertical: spacing[12] },\n });\n}\n\nexport function Section({\n spacing = \"md\",\n padding,\n background,\n border,\n variant = \"default\",\n accentColor,\n noWrap = false,\n children,\n style,\n}: SectionProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createSectionStyles(theme), [theme]);\n const spacingMap = {\n lg: styles.spacingLg,\n md: styles.spacingMd,\n none: styles.spacingNone,\n sm: styles.spacingSm,\n xl: styles.spacingXl,\n };\n const paddingMap = {\n lg: styles.paddingLg,\n md: styles.paddingMd,\n none: styles.paddingNone,\n sm: styles.paddingSm,\n };\n const variantMap: Record<SectionVariant, Style | null> = {\n callout: styles.callout,\n card: styles.card,\n default: null,\n highlight: styles.highlight,\n };\n const styleArray: Style[] = [styles.base, spacingMap[spacing]];\n const variantStyle = variantMap[variant];\n if (variantStyle) {styleArray.push(variantStyle);}\n if (accentColor && (variant === \"callout\" || variant === \"highlight\")) {\n styleArray.push({\n borderLeftColor: resolveColor(accentColor, theme.colors),\n });\n }\n if (padding && padding in paddingMap) {styleArray.push(paddingMap[padding]);}\n if (border && variant === \"default\") {styleArray.push(styles.border);}\n if (background)\n {styleArray.push({\n backgroundColor: resolveColor(background, theme.colors),\n });}\n if (style) {styleArray.push(...[style].flat());}\n return <View style={styleArray}>{children}</View>;\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/section/index.ts",
+ "content": "export {\n Section,\n type SectionProps,\n type SectionSpacing,\n type SectionPadding,\n type SectionVariant,\n} from \"./section\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/takumi/signature.json b/public/r/takumi/signature.json
new file mode 100644
index 0000000..30466eb
--- /dev/null
+++ b/public/r/takumi/signature.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/signature",
+ "title": "Signature",
+ "description": "Signature PDF component (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/signature/signature.tsx",
+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type SignatureVariant = \"single\" | \"double\" | \"inline\";\n\n/**\n * Signature signer properties.\n * Props - `label` | `name` | `title` | `date`\n * @see {@link SignatureSigner}\n */\nexport interface SignatureSigner {\n label?: string;\n name?: string;\n title?: string;\n date?: string;\n}\n\n/**\n * Signature block properties.\n * Props - `variant` | `label` | `name` | `title` | `date` | `signers` | `style`\n * @see {@link PdfSignatureBlockProps}\n */\nexport interface PdfSignatureBlockProps {\n /**\n * Layout variant: [single, double, inline]\n * @default 'single'\n */\n variant?: SignatureVariant;\n label?: string;\n name?: string;\n title?: string;\n date?: string;\n signers?: [SignatureSigner, SignatureSigner];\n style?: Style;\n}\n\nfunction createSignatureStyles(t: PdfcnTheme) {\n const { spacing, fontWeights, typography } = t.primitives;\n return StyleSheet.create({\n block: { flex: 1, minWidth: 140 },\n container: {\n marginBottom: t.spacing.componentGap,\n marginTop: t.spacing.sectionGap,\n },\n dateText: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n marginTop: 1,\n },\n doubleRow: {\n flexDirection: \"row\",\n gap: spacing[8],\n justifyContent: \"space-between\",\n },\n inlineLabel: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n },\n inlineLine: {\n borderBottomColor: t.colors.foreground,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n height: spacing[5],\n minWidth: 120,\n paddingHorizontal: spacing[2],\n },\n inlineName: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n },\n inlineRow: {\n alignItems: \"center\",\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: spacing[3],\n },\n label: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n marginBottom: spacing[1],\n },\n line: {\n borderBottomColor: t.colors.foreground,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n marginBottom: spacing[1],\n minHeight: spacing[6],\n },\n name: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n },\n titleText: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n },\n });\n}\n\nfunction renderSignerBlock(\n signer: SignatureSigner,\n styles: ReturnType<typeof createSignatureStyles>\n) {\n return (\n <View style={styles.block}>\n {signer.label ? (\n <PDFText style={styles.label}>{signer.label}</PDFText>\n ) : null}\n <View style={styles.line} />\n {signer.name ? (\n <PDFText style={styles.name}>{signer.name}</PDFText>\n ) : null}\n {signer.title ? (\n <PDFText style={styles.titleText}>{signer.title}</PDFText>\n ) : null}\n {signer.date ? (\n <PDFText style={styles.dateText}>{signer.date}</PDFText>\n ) : null}\n </View>\n );\n}\n\nexport function PdfSignatureBlock({\n variant = \"single\",\n label = \"Signature\",\n name,\n title,\n date,\n signers,\n style,\n}: PdfSignatureBlockProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createSignatureStyles(theme), [theme]);\n const containerStyles: Style[] = [styles.container];\n if (style) {containerStyles.push(style);}\n\n if (variant === \"inline\") {\n return (\n <View\n style={[{ breakInside: \"avoid\" as const }, containerStyles]\n .flat()\n .filter(Boolean)}\n >\n <View style={styles.inlineRow}>\n <PDFText style={styles.inlineLabel}>{`${label}:`}</PDFText>\n <View style={styles.inlineLine} />\n {name ? <PDFText style={styles.inlineName}>{name}</PDFText> : null}\n </View>\n </View>\n );\n }\n\n if (variant === \"double\") {\n const [first, second] = signers ?? [\n { date: \"\", label: \"Authorized by\", name: \"\", title: \"\" },\n { date: \"\", label: \"Approved by\", name: \"\", title: \"\" },\n ];\n return (\n <View\n style={[{ breakInside: \"avoid\" as const }, containerStyles]\n .flat()\n .filter(Boolean)}\n >\n <View style={styles.doubleRow}>\n {renderSignerBlock(first, styles)}\n {renderSignerBlock(second, styles)}\n </View>\n </View>\n );\n }\n\n return (\n <View\n style={[{ breakInside: \"avoid\" as const }, containerStyles]\n .flat()\n .filter(Boolean)}\n >\n {renderSignerBlock({ date, label, name, title }, styles)}\n </View>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/signature/index.ts",
+ "content": "export {\n PdfSignatureBlock,\n type PdfSignatureBlockProps,\n type SignatureVariant,\n type SignatureSigner,\n} from \"./signature\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/takumi/stack.json b/public/r/takumi/stack.json
new file mode 100644
index 0000000..15f5ed0
--- /dev/null
+++ b/public/r/takumi/stack.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/stack",
+ "title": "Stack",
+ "description": "Stack PDF component (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/stack/stack.tsx",
+ "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type StackGap = \"none\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\nexport type StackDirection = \"vertical\" | \"horizontal\";\nexport type StackAlign = \"start\" | \"center\" | \"end\" | \"stretch\";\nexport type StackJustify = \"start\" | \"center\" | \"end\" | \"between\" | \"around\";\n\n/**\n * Flex layout container with gap and direction control.\n * Props - `gap` | `direction` | `align` | `justify` | `wrap` | `noWrap` | `children` | `style`\n * @see {@link StackProps}\n */\nexport interface StackProps extends PDFComponentProps {\n /**\n * @default 'md'\n */\n gap?: StackGap;\n /**\n * @default 'vertical'\n */\n direction?: StackDirection;\n /**\n * @default 'start'\n */\n align?: StackAlign;\n /**\n * @default 'start'\n */\n justify?: StackJustify;\n /**\n * @default false\n */\n wrap?: boolean;\n /**\n * @default false\n */\n noWrap?: boolean;\n}\n\nfunction createStackStyles(t: PdfcnTheme) {\n const { spacing } = t.primitives;\n return StyleSheet.create({\n alignCenter: { alignItems: \"center\" },\n alignEnd: { alignItems: \"flex-end\" },\n alignStart: { alignItems: \"flex-start\" },\n alignStretch: { alignItems: \"stretch\" },\n gapLg: { gap: spacing[6] },\n gapMd: { gap: spacing[4] },\n gapNone: { gap: spacing[0] },\n gapSm: { gap: spacing[2] },\n gapXl: { gap: spacing[8] },\n horizontal: { flexDirection: \"row\" },\n justifyAround: { justifyContent: \"space-around\" },\n justifyBetween: { justifyContent: \"space-between\" },\n justifyCenter: { justifyContent: \"center\" },\n justifyEnd: { justifyContent: \"flex-end\" },\n justifyStart: { justifyContent: \"flex-start\" },\n vertical: { flexDirection: \"column\" },\n wrap: { flexWrap: \"wrap\" },\n });\n}\n\nexport function Stack({\n gap = \"md\",\n direction = \"vertical\",\n align,\n justify,\n wrap,\n noWrap,\n children,\n style,\n}: StackProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createStackStyles(theme), [theme]);\n const gapMap = {\n lg: styles.gapLg,\n md: styles.gapMd,\n none: styles.gapNone,\n sm: styles.gapSm,\n xl: styles.gapXl,\n };\n const alignMap = {\n center: styles.alignCenter,\n end: styles.alignEnd,\n start: styles.alignStart,\n stretch: styles.alignStretch,\n };\n const justifyMap = {\n around: styles.justifyAround,\n between: styles.justifyBetween,\n center: styles.justifyCenter,\n end: styles.justifyEnd,\n start: styles.justifyStart,\n };\n const styleArray: Style[] = [\n direction === \"horizontal\" ? styles.horizontal : styles.vertical,\n gapMap[gap],\n ];\n if (align && align in alignMap) {styleArray.push(alignMap[align]);}\n if (justify && justify in justifyMap) {styleArray.push(justifyMap[justify]);}\n if (wrap) {styleArray.push(styles.wrap);}\n if (style) {styleArray.push(...[style].flat());}\n return <View style={styleArray}>{children}</View>;\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/stack/index.ts",
+ "content": "export {\n Stack,\n type StackProps,\n type StackGap,\n type StackDirection,\n type StackAlign,\n type StackJustify,\n} from \"./stack\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/takumi/table.json b/public/r/takumi/table.json
new file mode 100644
index 0000000..5370e19
--- /dev/null
+++ b/public/r/takumi/table.json
@@ -0,0 +1,36 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/table",
+ "title": "Table",
+ "description": "Table PDF component (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/table/table.styles.ts",
+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { StyleSheet } from \"../../lib/takumi-primitives\";\n\n/**\n * Creates all table styles derived from the active theme.\n * @param t - The resolved PdfcnTheme instance.\n */\nexport function createTableStyles(t: PdfcnTheme) {\n const { spacing, borderRadius, fontWeights, typography } = t.primitives;\n const borderColor = t.colors.border;\n\n const hairline = 0.5;\n const rule = 1;\n const thick = 1.5;\n\n const cellPadV = spacing[2] - 2;\n const cellPadH = spacing[2] + 2;\n const cellPadVCompact = spacing[0.5];\n const cellPadHCompact = spacing[2];\n\n const rowDivider = {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\" as const,\n borderBottomWidth: hairline,\n };\n\n return StyleSheet.create({\n cell: {\n flex: 1,\n justifyContent: \"center\",\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellBordered: {\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellBorderedBorder: {\n borderRightColor: borderColor,\n borderRightStyle: \"solid\",\n borderRightWidth: hairline,\n },\n\n cellCompact: {\n paddingHorizontal: cellPadHCompact,\n paddingVertical: cellPadVCompact,\n },\n\n cellFixed: {\n flexGrow: 0,\n flexShrink: 0,\n justifyContent: \"center\",\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellGridBorder: {\n borderRightColor: borderColor,\n borderRightStyle: \"solid\",\n borderRightWidth: hairline,\n },\n\n cellMinimal: {\n paddingHorizontal: spacing[2] - 2,\n paddingVertical: spacing[1] + 1,\n },\n\n cellPrimaryHeader: {\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellStriped: {\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellText: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n lineHeight: 1.2,\n },\n cellTextCompact: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n lineHeight: 1.2,\n },\n cellTextFooter: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: 1.2,\n },\n cellTextHeaderBordered: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.bold,\n lineHeight: 1.2,\n },\n cellTextHeaderCompact: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.semibold,\n letterSpacing: 0.6,\n lineHeight: 1.2,\n textTransform: \"uppercase\",\n },\n cellTextHeaderGrid: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: 1.2,\n },\n cellTextHeaderLine: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: 1.2,\n },\n\n cellTextHeaderMinimal: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.medium,\n lineHeight: 1.2,\n },\n cellTextHeaderPrimaryHeader: {\n color: t.colors.primaryForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.semibold,\n letterSpacing: 0.6,\n lineHeight: 1.2,\n textTransform: \"uppercase\",\n },\n cellTextHeaderStriped: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: 1.2,\n },\n row: {\n display: \"flex\",\n flexDirection: \"row\",\n },\n rowBordered: rowDivider,\n rowCompact: rowDivider,\n rowFooter: {\n borderTopColor: borderColor,\n borderTopStyle: \"solid\",\n borderTopWidth: rule,\n },\n\n rowFooterStriped: {\n backgroundColor: t.colors.muted,\n borderTopColor: borderColor,\n borderTopStyle: \"solid\",\n borderTopWidth: rule,\n },\n rowGrid: rowDivider,\n\n rowHeaderBordered: {\n backgroundColor: t.colors.muted,\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n },\n\n rowHeaderCompact: {\n backgroundColor: t.colors.muted,\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n rowHeaderGrid: {\n backgroundColor: t.colors.muted,\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n\n rowHeaderLine: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n rowHeaderMinimal: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n rowHeaderPrimaryHeader: {\n backgroundColor: t.colors.primary,\n },\n rowHeaderStriped: {\n backgroundColor: t.colors.muted,\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n rowLine: rowDivider,\n\n rowMinimal: rowDivider,\n rowPrimaryHeader: rowDivider,\n\n rowStripe: {\n backgroundColor: t.colors.muted,\n },\n\n rowStriped: {},\n table: {\n display: \"flex\",\n flexDirection: \"column\",\n marginBottom: t.spacing.componentGap,\n width: \"100%\",\n },\n tableBordered: {\n borderBottomLeftRadius: borderRadius.sm,\n borderBottomRightRadius: borderRadius.sm,\n borderColor: borderColor,\n borderStyle: \"solid\",\n borderTopLeftRadius: borderRadius.sm,\n borderTopRightRadius: borderRadius.sm,\n borderWidth: rule,\n overflow: \"hidden\" as const,\n },\n tableCompact: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n },\n tableGrid: {\n borderBottomLeftRadius: borderRadius.md,\n borderBottomRightRadius: borderRadius.md,\n borderColor: borderColor,\n borderStyle: \"solid\",\n borderTopLeftRadius: borderRadius.md,\n borderTopRightRadius: borderRadius.md,\n borderWidth: thick,\n overflow: \"hidden\" as const,\n },\n tableLine: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n },\n tableMinimal: {\n paddingVertical: spacing[2],\n },\n\n tablePrimaryHeader: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n },\n\n tableStriped: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n borderTopColor: borderColor,\n borderTopStyle: \"solid\",\n borderTopWidth: hairline,\n },\n });\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/table/table.tsx",
+ "content": "import { Children, cloneElement, isValidElement } from 'react';\nimport type { ReactElement, ReactNode } from 'react';\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, Text as PDFText } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\nimport { createTableStyles } from \"./table.styles\";\nimport type {\n TableCellProps,\n TableProps,\n TableRowProps,\n TableSectionProps,\n TableVariant,\n} from \"./table.types\";\n\nfunction processTableChildren(\n children: ReactNode,\n variant: TableVariant,\n zebraStripe: boolean\n): ReactNode {\n let bodyRowIndex = 0;\n\n return Children.map(children, (child) => {\n if (!isValidElement(child)) {return child;}\n\n if (\n child.type === TableHeader ||\n child.type === TableBody ||\n child.type === TableFooter\n ) {\n const isBody = child.type === TableBody;\n const sectionChild = child as ReactElement<TableSectionProps>;\n const sectionChildren = Children.map(\n sectionChild.props.children,\n (rowChild) => {\n if (isValidElement(rowChild) && rowChild.type === TableRow) {\n const rowProps: Partial<TableRowProps> = { variant };\n\n if (isBody && zebraStripe) {\n const isStripe = bodyRowIndex % 2 === 1;\n bodyRowIndex++;\n if (isStripe) {\n rowProps.stripe = true;\n }\n }\n\n return cloneElement(\n rowChild as ReactElement<TableRowProps>,\n rowProps\n );\n }\n return rowChild;\n }\n );\n\n return cloneElement(child, {}, sectionChildren);\n }\n\n if (child.type === TableRow) {\n return cloneElement(child as ReactElement<TableRowProps>, { variant });\n }\n\n return child;\n });\n}\n\nexport function TableHeader({ children, style }: TableSectionProps) {\n return <View style={style}>{children}</View>;\n}\n\nexport function TableBody({ children, style }: TableSectionProps) {\n return <View style={style}>{children}</View>;\n}\n\nexport function TableFooter({ children, style }: TableSectionProps) {\n return <View style={style}>{children}</View>;\n}\n\nexport function Table({\n children,\n style,\n variant = \"line\",\n zebraStripe = false,\n noWrap = false,\n}: TableProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createTableStyles(theme), [theme]);\n const tableStyles: Style[] = [styles.table];\n const effectiveZebra = variant === \"striped\" ? true : zebraStripe;\n\n tableStyles.push(\n {\n bordered: styles.tableBordered,\n compact: styles.tableCompact,\n grid: styles.tableGrid,\n line: styles.tableLine,\n minimal: styles.tableMinimal,\n \"primary-header\": styles.tablePrimaryHeader,\n striped: styles.tableStriped,\n }[variant]\n );\n\n const styleArray = style ? [...tableStyles, style] : tableStyles;\n const processedChildren = processTableChildren(\n children,\n variant,\n effectiveZebra\n );\n\n const inner = <View style={styleArray}>{processedChildren}</View>;\n return noWrap ? (\n <View style={[{ breakInside: \"avoid\" as const }].filter(Boolean)}>\n {inner}\n </View>\n ) : (\n inner\n );\n}\n\nexport function TableRow({\n header,\n footer,\n stripe,\n children,\n style,\n variant = \"line\",\n}: TableRowProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createTableStyles(theme), [theme]);\n const rowStyles: Style[] = [styles.row];\n\n rowStyles.push(\n {\n bordered: styles.rowBordered,\n compact: styles.rowCompact,\n grid: styles.rowGrid,\n line: styles.rowLine,\n minimal: styles.rowMinimal,\n \"primary-header\": styles.rowPrimaryHeader,\n striped: styles.rowStriped,\n }[variant]\n );\n\n if (header) {\n rowStyles.push(\n {\n bordered: styles.rowHeaderBordered,\n compact: styles.rowHeaderCompact,\n grid: styles.rowHeaderGrid,\n line: styles.rowHeaderLine,\n minimal: styles.rowHeaderMinimal,\n \"primary-header\": styles.rowHeaderPrimaryHeader,\n striped: styles.rowHeaderStriped,\n }[variant]\n );\n }\n\n if (footer) {\n if (variant === \"striped\") {rowStyles.push(styles.rowFooterStriped);}\n else {rowStyles.push(styles.rowFooter);}\n }\n\n if (stripe && !header && !footer) {\n rowStyles.push(styles.rowStripe);\n }\n\n const styleArray = style ? [...rowStyles, style] : rowStyles;\n const childArray = Children.toArray(children);\n const processedChildren = childArray.map((child, i) => {\n if (isValidElement(child) && child.type === TableCell) {\n return cloneElement(child as ReactElement<TableCellProps>, {\n _last: i === childArray.length - 1,\n footer,\n header,\n variant,\n });\n }\n return child;\n });\n\n return (\n <View\n style={[{ breakInside: \"avoid\" as const }, styleArray]\n .flat()\n .filter(Boolean)}\n >\n {processedChildren}\n </View>\n );\n}\n\nexport function TableCell({\n header,\n footer,\n align,\n width,\n children,\n style,\n variant = \"line\",\n _last,\n}: TableCellProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createTableStyles(theme), [theme]);\n const cellStyles: Style[] =\n width !== undefined\n ? [styles.cellFixed, { width } as Style]\n : [styles.cell];\n\n const cellVariantStyle = (\n {\n bordered: styles.cellBordered,\n compact: styles.cellCompact,\n minimal: styles.cellMinimal,\n \"primary-header\": styles.cellPrimaryHeader,\n striped: styles.cellStriped,\n } as Partial<Record<TableVariant, Style>>\n )[variant];\n if (cellVariantStyle) {cellStyles.push(cellVariantStyle);}\n\n if (variant === \"grid\" && !_last) {\n cellStyles.push(styles.cellGridBorder);\n } else if (variant === \"bordered\" && !_last) {\n cellStyles.push(styles.cellBorderedBorder);\n }\n\n if (align) {\n cellStyles.push({ textAlign: align } as Style);\n }\n\n const styleArray = style ? [...cellStyles, style] : cellStyles;\n\n let textStyle: Style = styles.cellText;\n if (header) {\n textStyle = {\n bordered: styles.cellTextHeaderBordered,\n compact: styles.cellTextHeaderCompact,\n grid: styles.cellTextHeaderGrid,\n line: styles.cellTextHeaderLine,\n minimal: styles.cellTextHeaderMinimal,\n \"primary-header\": styles.cellTextHeaderPrimaryHeader,\n striped: styles.cellTextHeaderStriped,\n }[variant];\n } else if (footer) {\n textStyle = styles.cellTextFooter;\n } else if (variant === \"compact\") {\n textStyle = styles.cellTextCompact;\n }\n\n const content =\n typeof children === \"string\" ? (\n <PDFText\n style={[\n textStyle,\n align ? { textAlign: align } : {},\n { margin: 0, padding: 0 },\n ]}\n >\n {children}\n </PDFText>\n ) : (\n children\n );\n\n return <View style={styleArray}>{content}</View>;\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/table/table.types.ts",
+ "content": "import type { PDFComponentProps } from \"@/registry/themes\";\n\n/** Table visual style variant. */\nexport type TableVariant =\n | \"line\"\n | \"grid\"\n | \"minimal\"\n | \"striped\"\n | \"compact\"\n | \"bordered\"\n | \"primary-header\";\n\n/**\n * Table container with visual style variants and optional zebra striping.\n * Props - `variant` | `zebraStripe` | `noWrap` | `children` | `style`\n * @see {@link TableProps}\n */\nexport interface TableProps extends PDFComponentProps {\n /**\n * @default 'line'\n */\n variant?: TableVariant;\n /**\n * @default false\n */\n zebraStripe?: boolean;\n /**\n * @default false\n */\n noWrap?: boolean;\n}\n\nexport type TableSectionProps = PDFComponentProps;\n\n/**\n * Table row with optional header, footer, and stripe states.\n * Props - `header` | `footer` | `stripe` | `variant` | `children` | `style`\n * @see {@link TableRowProps}\n */\nexport interface TableRowProps extends PDFComponentProps {\n header?: boolean;\n footer?: boolean;\n stripe?: boolean;\n variant?: TableVariant;\n}\n\n/**\n * Table cell with alignment, width, and header or footer text styling.\n * Props - `header` | `footer` | `align` | `width` | `variant` | `_last` | `children` | `style`\n * @see {@link TableCellProps}\n */\nexport interface TableCellProps extends PDFComponentProps {\n header?: boolean;\n footer?: boolean;\n align?: \"left\" | \"center\" | \"right\";\n width?: string | number;\n variant?: TableVariant;\n _last?: boolean;\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/table/index.ts",
+ "content": "export {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableRow,\n TableCell,\n} from \"./table\";\nexport type {\n TableProps,\n TableSectionProps,\n TableRowProps,\n TableCellProps,\n TableVariant,\n} from \"./table.types\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/takumi/text.json b/public/r/takumi/text.json
new file mode 100644
index 0000000..0fc9935
--- /dev/null
+++ b/public/r/takumi/text.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/text",
+ "title": "Text",
+ "description": "Text PDF component (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/text/text.tsx",
+ "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type TextVariant = \"xs\" | \"sm\" | \"base\" | \"lg\" | \"xl\" | \"2xl\" | \"3xl\";\nexport type TextWeight = \"normal\" | \"medium\" | \"semibold\" | \"bold\";\nexport type TextDecoration = \"underline\" | \"line-through\" | \"none\";\n\n/**\n * Body text with typography scale, alignment, and decoration options.\n * Props - `variant` | `align` | `color` | `weight` | `italic` | `decoration` | `transform` | `noMargin` | `children` | `style`\n * @see {@link TextProps}\n */\nexport interface TextProps extends PDFComponentProps {\n /**\n * @default 'base'\n */\n variant?: TextVariant;\n /**\n * @default 'left'\n */\n align?: \"left\" | \"center\" | \"right\" | \"justify\";\n color?: string;\n /**\n * @default 'normal'\n */\n weight?: TextWeight;\n /**\n * @default false\n */\n italic?: boolean;\n /**\n * @default 'none'\n */\n decoration?: TextDecoration;\n transform?: \"uppercase\" | \"lowercase\" | \"capitalize\";\n /**\n * @default false\n */\n noMargin?: boolean;\n}\n\nfunction createTextStyles(t: PdfcnTheme) {\n const { fontWeights, letterSpacing } = t.primitives;\n const base = {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n lineHeight: t.typography.body.lineHeight,\n marginBottom: t.spacing.paragraphGap,\n marginTop: 0,\n };\n return StyleSheet.create({\n \"2xl\": { ...base, fontSize: t.primitives.typography[\"2xl\"] },\n \"3xl\": { ...base, fontSize: t.primitives.typography[\"3xl\"] },\n base: { ...base, fontSize: t.primitives.typography.base },\n capitalize: { textTransform: \"capitalize\" },\n decorationNone: { textDecoration: \"none\" },\n italic: { fontStyle: \"italic\" },\n lg: { ...base, fontSize: t.primitives.typography.lg },\n lineThrough: { textDecoration: \"line-through\" },\n lowercase: { textTransform: \"lowercase\" },\n noMargin: { marginBottom: 0, marginTop: 0 },\n sm: { ...base, fontSize: t.primitives.typography.sm },\n text: { ...base, fontSize: t.typography.body.fontSize },\n underline: { textDecoration: \"underline\" },\n uppercase: {\n letterSpacing: letterSpacing.wider * 10,\n textTransform: \"uppercase\",\n },\n weightBold: { fontWeight: fontWeights.bold },\n weightMedium: { fontWeight: fontWeights.medium },\n weightNormal: { fontWeight: fontWeights.regular },\n weightSemibold: { fontWeight: fontWeights.semibold },\n xl: { ...base, fontSize: t.primitives.typography.xl },\n xs: { ...base, fontSize: t.primitives.typography.xs },\n });\n}\n\nexport function Text({\n variant,\n align,\n color,\n weight,\n italic,\n decoration,\n transform,\n noMargin,\n children,\n style,\n}: TextProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createTextStyles(theme), [theme]);\n const weightMap = {\n bold: styles.weightBold,\n medium: styles.weightMedium,\n normal: styles.weightNormal,\n semibold: styles.weightSemibold,\n };\n const decorationMap = {\n \"line-through\": styles.lineThrough,\n none: styles.decorationNone,\n underline: styles.underline,\n };\n const transformMap = {\n capitalize: styles.capitalize,\n lowercase: styles.lowercase,\n uppercase: styles.uppercase,\n };\n const styleArray: Style[] = [variant ? styles[variant] : styles.text];\n if (weight && weight in weightMap) {styleArray.push(weightMap[weight]);}\n if (italic) {styleArray.push(styles.italic);}\n if (decoration && decoration in decorationMap)\n {styleArray.push(decorationMap[decoration]);}\n if (transform && transform in transformMap)\n {styleArray.push(transformMap[transform]);}\n if (noMargin) {styleArray.push(styles.noMargin);}\n const semantic = {} as Style;\n if (align) {semantic.textAlign = align;}\n if (color) {semantic.color = resolveColor(color, theme.colors);}\n if (Object.keys(semantic).length > 0) {styleArray.push(semantic);}\n if (style) {styleArray.push(...[style].flat());}\n return <PDFText style={styleArray}>{children}</PDFText>;\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/text/index.ts",
+ "content": "export {\n Text,\n type TextProps,\n type TextVariant,\n type TextWeight,\n type TextDecoration,\n} from \"./text\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/takumi/theme-blueprint.json b/public/r/takumi/theme-blueprint.json
new file mode 100644
index 0000000..01d6a4b
--- /dev/null
+++ b/public/r/takumi/theme-blueprint.json
@@ -0,0 +1,37 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/theme-blueprint",
+ "title": "Blueprint Theme (takumi)",
+ "description": "blueprint theme tokens for takumi",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "files": [
+ {
+ "path": "registry/themes/blueprint.ts",
+ "content": "import { defaultPrimitives } from \"./primitives\";\nimport type { PdfcnTheme } from \"./theme-types\";\n\n/**\n * Blueprint theme preset.\n *\n * Character: Dark slate palette with cyan accent, JetBrains Mono headings,\n * Source Code Pro body — a technical, precision-first aesthetic.\n * Ideal for API docs, engineering specs, and developer-focused reports.\n */\nexport const blueprintTheme: PdfcnTheme = {\n colors: {\n accent: \"#0891b2\",\n background: \"#ffffff\",\n border: \"#cbd5e1\",\n destructive: \"#e11d48\",\n foreground: \"#0f172a\",\n info: \"#0284c7\",\n muted: \"#f1f5f9\",\n mutedForeground: \"#475569\",\n primary: \"#0f172a\",\n primaryForeground: \"#f0f9ff\",\n success: \"#059669\",\n warning: \"#d97706\",\n },\n name: \"blueprint\",\n page: {\n orientation: \"portrait\",\n size: \"A4\",\n },\n primitives: defaultPrimitives,\n spacing: {\n componentGap: 14,\n page: {\n marginBottom: 52,\n marginLeft: 48,\n marginRight: 48,\n marginTop: 52,\n },\n paragraphGap: 10,\n sectionGap: 26,\n },\n typography: {\n body: {\n fontFamily: \"Source Code Pro\",\n fontSize: 10,\n lineHeight: 1.75,\n },\n heading: {\n fontFamily: \"JetBrains Mono\",\n fontSize: {\n h1: 28,\n h2: 21,\n h3: 17,\n h4: 14,\n h5: 12,\n h6: 10,\n },\n fontWeight: 700,\n lineHeight: 1.2,\n },\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-blueprint.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "content": "import type { PrimitiveTokens } from \"./theme-types\";\n\n/**\n * Default primitive tokens shared by all theme presets.\n *\n * These define the raw design scales — the \"palette\" of values available.\n * Themes select from these scales when assigning semantic tokens.\n *\n * - Typography: Major Third (1.25) ratio, 12pt base\n * - Spacing: 4pt grid system\n * - Font weights: 400–700\n * - Line heights: 1.2–1.6\n * - Border radius: 0–8pt (plus full for pills)\n * - Letter spacing: -0.025 to 0.05 (em-like ratios for PDF points)\n */\nexport const defaultPrimitives: PrimitiveTokens = {\n borderRadius: {\n full: 9999,\n lg: 8,\n md: 4,\n none: 0,\n sm: 2,\n },\n fontWeights: {\n bold: 700,\n medium: 500,\n regular: 400,\n semibold: 600,\n },\n letterSpacing: {\n normal: 0,\n tight: -0.025,\n wide: 0.025,\n wider: 0.05,\n },\n lineHeights: {\n normal: 1.4,\n relaxed: 1.6,\n tight: 1.2,\n },\n spacing: {\n 0: 0,\n 0.5: 2,\n 1: 4,\n 10: 40,\n 12: 48,\n 16: 64,\n 2: 8,\n 3: 12,\n 4: 16,\n 5: 20,\n 6: 24,\n 8: 32,\n },\n typography: {\n \"2xl\": 28,\n \"3xl\": 36,\n base: 15,\n lg: 18,\n sm: 12,\n xl: 22,\n xs: 10,\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "content": "/**\n * pdfcn Theme System — Type Definitions\n *\n * Defines the complete type hierarchy for the pdfcn PDF theme system.\n * All PDF components consume these tokens instead of hardcoding style values.\n *\n * Architecture:\n * - PrimitiveTokens: Raw design scales (typography, spacing, weights, line heights)\n * - ColorTokens: Semantic color mappings (foreground/background pairs)\n * - TypographyTokens: Font family, size, weight, and line height decisions\n * - SpacingTokens: Page margins, section/paragraph/component gaps\n * - PageTokens: Default page size and orientation\n * - PdfcnTheme: The complete theme object combining all token layers\n *\n * @example\n * ```ts\n * import type { PdfcnTheme } from '@/registry/themes';\n *\n * const myTheme: PdfcnTheme = {\n * name: 'custom',\n * primitives: { ... },\n * colors: { foreground: '#1a1a1a', ... },\n * typography: { body: { ... }, heading: { ... } },\n * spacing: { page: { ... }, sectionGap: 24, ... },\n * page: { size: 'A4', orientation: 'portrait' },\n * };\n * ```\n */\n\n// ─── Primitive Tokens ───────────────────────────────────────────────────────\n// Raw design scales. These define WHAT values are available.\n// Themes choose from these when populating semantic tokens.\n\n/** Typography scale using a Major Third (1.25) ratio with 12pt base */\nexport interface TypographyScale {\n /** 10pt — Captions, footnotes */\n xs: number;\n /** 12pt — Body text (PDF standard) */\n sm: number;\n /** 15pt — Large body, small headings */\n base: number;\n /** 18pt — H4 equivalent */\n lg: number;\n /** 22pt — H3 equivalent */\n xl: number;\n /** 28pt — H2 equivalent */\n \"2xl\": number;\n /** 36pt — H1 equivalent */\n \"3xl\": number;\n}\n\n/** Spacing scale based on a 4pt grid system */\nexport interface SpacingScale {\n /** 0pt */\n 0: number;\n /** 2pt */\n 0.5: number;\n /** 4pt */\n 1: number;\n /** 8pt */\n 2: number;\n /** 12pt */\n 3: number;\n /** 16pt */\n 4: number;\n /** 20pt */\n 5: number;\n /** 24pt */\n 6: number;\n /** 32pt */\n 8: number;\n /** 40pt */\n 10: number;\n /** 48pt */\n 12: number;\n /** 64pt */\n 16: number;\n}\n\n/** Font weight scale */\nexport interface FontWeights {\n regular: number;\n medium: number;\n semibold: number;\n bold: number;\n}\n\n/** Line height scale */\nexport interface LineHeights {\n /** 1.2 — Tight, for headings */\n tight: number;\n /** 1.4 — Normal, for body text */\n normal: number;\n /** 1.6 — Relaxed, for reading-heavy content */\n relaxed: number;\n}\n\n/** Border radius scale for rounded corners */\nexport interface BorderRadiusScale {\n /** 0pt — Sharp corners */\n none: number;\n /** 2pt — Subtle rounding */\n sm: number;\n /** 4pt — Standard rounding */\n md: number;\n /** 8pt — Pronounced rounding */\n lg: number;\n /** 9999pt — Pill/circle shape */\n full: number;\n}\n\n/** Letter spacing scale for typography adjustments */\nexport interface LetterSpacingScale {\n /** -0.025em — Tighter spacing */\n tight: number;\n /** 0em — Normal spacing */\n normal: number;\n /** 0.025em — Slightly wider spacing */\n wide: number;\n /** 0.05em — Much wider spacing (for uppercase) */\n wider: number;\n}\n\n/** Raw design scales shared across themes */\nexport interface PrimitiveTokens {\n typography: TypographyScale;\n spacing: SpacingScale;\n fontWeights: FontWeights;\n lineHeights: LineHeights;\n borderRadius: BorderRadiusScale;\n letterSpacing: LetterSpacingScale;\n}\n\n// ─── Semantic Tokens ────────────────────────────────────────────────────────\n// These map primitives to design intent. Themes differ primarily here.\n\n/**\n * Semantic color tokens using the foreground/background pair convention.\n * All values must be hex strings (e.g., '#1a1a1a').\n * react-pdf supports hex, rgb(), and hsl() — but NOT oklch.\n */\nexport interface ColorTokens {\n /** Primary text and content color */\n foreground: string;\n /** Page background color */\n background: string;\n /** Subtle background for secondary areas (e.g., code blocks, table headers) */\n muted: string;\n /** Text on muted backgrounds (captions, footnotes, timestamps) */\n mutedForeground: string;\n /** Brand/accent color for emphasis and highlights */\n primary: string;\n /** Text on primary-colored backgrounds */\n primaryForeground: string;\n /** Table borders, dividers, rules */\n border: string;\n /** Secondary accent for call-to-action elements, badges */\n accent: string;\n /** Error text, warning indicators */\n destructive: string;\n /** Success states (e.g., badges, confirmations) */\n success: string;\n /** Warning states (e.g., badges, alerts) */\n warning: string;\n /** Info states (e.g., badges, informational alerts) */\n info: string;\n}\n\n/** Typography semantic tokens — what fonts and sizes to use where */\nexport interface TypographyTokens {\n /** Body text settings */\n body: {\n /** Font family for body text (e.g., 'Helvetica') */\n fontFamily: string;\n /** Base font size in points */\n fontSize: number;\n /** Line height multiplier */\n lineHeight: number;\n };\n /** Heading text settings */\n heading: {\n /** Font family for headings (e.g., 'Times-Roman', 'Courier') */\n fontFamily: string;\n /** Font weight as numeric value (400-700) */\n fontWeight: number;\n /** Line height multiplier for headings */\n lineHeight: number;\n /** Font sizes for each heading level in points */\n fontSize: {\n h1: number;\n h2: number;\n h3: number;\n h4: number;\n h5: number;\n h6: number;\n };\n };\n}\n\n/** Spacing semantic tokens — consistent spacing across the document */\nexport interface SpacingTokens {\n /** Page margin settings in points */\n page: {\n marginTop: number;\n marginRight: number;\n marginBottom: number;\n marginLeft: number;\n };\n /** Space between major document sections (after h2, before new sections) */\n sectionGap: number;\n /** Space between paragraphs and after text blocks */\n paragraphGap: number;\n /** Space between inline components, list items, table rows */\n componentGap: number;\n}\n\n/** Page layout defaults */\nexport interface PageTokens {\n /** Default page size */\n size: \"A4\" | \"LETTER\" | \"LEGAL\";\n /** Default page orientation */\n orientation: \"portrait\" | \"landscape\";\n}\n\n// ─── Full Theme ─────────────────────────────────────────────────────────────\n\n/**\n * The complete pdfcn theme object.\n *\n * Components import this and use its tokens for all style values.\n * Since React Context doesn't work in @react-pdf/renderer,\n * the theme is a plain TypeScript object imported directly by components.\n *\n * @example\n * ```tsx\n * // In a component:\n * import { theme } from '../lib/pdfx-theme';\n *\n * function createStyles(t: PdfcnTheme) {\n * return StyleSheet.create({\n * text: {\n * fontFamily: t.typography.body.fontFamily,\n * fontSize: t.typography.body.fontSize,\n * color: t.colors.foreground,\n * },\n * });\n * }\n *\n * const styles = createStyles(theme);\n * ```\n */\nexport interface PdfcnTheme {\n /** Theme name identifier */\n name: string;\n /** Raw design scales */\n primitives: PrimitiveTokens;\n /** Semantic color mappings */\n colors: ColorTokens;\n /** Typography settings for body and headings */\n typography: TypographyTokens;\n /** Spacing settings for page, sections, and components */\n spacing: SpacingTokens;\n /** Page layout defaults */\n page: PageTokens;\n}\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "content": "import { professionalTheme } from \"@/registry/themes\";\n\nexport const theme = professionalTheme;\n",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "type": "registry:theme"
+}
\ No newline at end of file
diff --git a/public/r/takumi/theme-corporate.json b/public/r/takumi/theme-corporate.json
new file mode 100644
index 0000000..a34b2dc
--- /dev/null
+++ b/public/r/takumi/theme-corporate.json
@@ -0,0 +1,37 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/theme-corporate",
+ "title": "Corporate Theme (takumi)",
+ "description": "corporate theme tokens for takumi",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "files": [
+ {
+ "path": "registry/themes/corporate.ts",
+ "content": "import { defaultPrimitives } from \"./primitives\";\nimport type { PdfcnTheme } from \"./theme-types\";\n\n/**\n * Corporate theme preset.\n *\n * Character: Blue-gray palette, Lato sans-serif throughout, structured and\n * dependable. Sky-blue accent adds clarity without distraction.\n * Ideal for business proposals, project plans, and client-facing reports.\n */\nexport const corporateTheme: PdfcnTheme = {\n colors: {\n accent: \"#0ea5e9\",\n background: \"#ffffff\",\n border: \"#e2e8f0\",\n destructive: \"#ef4444\",\n foreground: \"#1e293b\",\n info: \"#3b82f6\",\n muted: \"#f8fafc\",\n mutedForeground: \"#64748b\",\n primary: \"#0f4c81\",\n primaryForeground: \"#ffffff\",\n success: \"#22c55e\",\n warning: \"#f59e0b\",\n },\n name: \"corporate\",\n page: {\n orientation: \"portrait\",\n size: \"A4\",\n },\n primitives: defaultPrimitives,\n spacing: {\n componentGap: 13,\n page: {\n marginBottom: 52,\n marginLeft: 44,\n marginRight: 44,\n marginTop: 52,\n },\n paragraphGap: 9,\n sectionGap: 24,\n },\n typography: {\n body: {\n fontFamily: \"Lato\",\n fontSize: 11,\n lineHeight: 1.55,\n },\n heading: {\n fontFamily: \"Lato\",\n fontSize: {\n h1: 30,\n h2: 22,\n h3: 18,\n h4: 15,\n h5: 13,\n h6: 11,\n },\n fontWeight: 700,\n lineHeight: 1.2,\n },\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-corporate.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "content": "import type { PrimitiveTokens } from \"./theme-types\";\n\n/**\n * Default primitive tokens shared by all theme presets.\n *\n * These define the raw design scales — the \"palette\" of values available.\n * Themes select from these scales when assigning semantic tokens.\n *\n * - Typography: Major Third (1.25) ratio, 12pt base\n * - Spacing: 4pt grid system\n * - Font weights: 400–700\n * - Line heights: 1.2–1.6\n * - Border radius: 0–8pt (plus full for pills)\n * - Letter spacing: -0.025 to 0.05 (em-like ratios for PDF points)\n */\nexport const defaultPrimitives: PrimitiveTokens = {\n borderRadius: {\n full: 9999,\n lg: 8,\n md: 4,\n none: 0,\n sm: 2,\n },\n fontWeights: {\n bold: 700,\n medium: 500,\n regular: 400,\n semibold: 600,\n },\n letterSpacing: {\n normal: 0,\n tight: -0.025,\n wide: 0.025,\n wider: 0.05,\n },\n lineHeights: {\n normal: 1.4,\n relaxed: 1.6,\n tight: 1.2,\n },\n spacing: {\n 0: 0,\n 0.5: 2,\n 1: 4,\n 10: 40,\n 12: 48,\n 16: 64,\n 2: 8,\n 3: 12,\n 4: 16,\n 5: 20,\n 6: 24,\n 8: 32,\n },\n typography: {\n \"2xl\": 28,\n \"3xl\": 36,\n base: 15,\n lg: 18,\n sm: 12,\n xl: 22,\n xs: 10,\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "content": "/**\n * pdfcn Theme System — Type Definitions\n *\n * Defines the complete type hierarchy for the pdfcn PDF theme system.\n * All PDF components consume these tokens instead of hardcoding style values.\n *\n * Architecture:\n * - PrimitiveTokens: Raw design scales (typography, spacing, weights, line heights)\n * - ColorTokens: Semantic color mappings (foreground/background pairs)\n * - TypographyTokens: Font family, size, weight, and line height decisions\n * - SpacingTokens: Page margins, section/paragraph/component gaps\n * - PageTokens: Default page size and orientation\n * - PdfcnTheme: The complete theme object combining all token layers\n *\n * @example\n * ```ts\n * import type { PdfcnTheme } from '@/registry/themes';\n *\n * const myTheme: PdfcnTheme = {\n * name: 'custom',\n * primitives: { ... },\n * colors: { foreground: '#1a1a1a', ... },\n * typography: { body: { ... }, heading: { ... } },\n * spacing: { page: { ... }, sectionGap: 24, ... },\n * page: { size: 'A4', orientation: 'portrait' },\n * };\n * ```\n */\n\n// ─── Primitive Tokens ───────────────────────────────────────────────────────\n// Raw design scales. These define WHAT values are available.\n// Themes choose from these when populating semantic tokens.\n\n/** Typography scale using a Major Third (1.25) ratio with 12pt base */\nexport interface TypographyScale {\n /** 10pt — Captions, footnotes */\n xs: number;\n /** 12pt — Body text (PDF standard) */\n sm: number;\n /** 15pt — Large body, small headings */\n base: number;\n /** 18pt — H4 equivalent */\n lg: number;\n /** 22pt — H3 equivalent */\n xl: number;\n /** 28pt — H2 equivalent */\n \"2xl\": number;\n /** 36pt — H1 equivalent */\n \"3xl\": number;\n}\n\n/** Spacing scale based on a 4pt grid system */\nexport interface SpacingScale {\n /** 0pt */\n 0: number;\n /** 2pt */\n 0.5: number;\n /** 4pt */\n 1: number;\n /** 8pt */\n 2: number;\n /** 12pt */\n 3: number;\n /** 16pt */\n 4: number;\n /** 20pt */\n 5: number;\n /** 24pt */\n 6: number;\n /** 32pt */\n 8: number;\n /** 40pt */\n 10: number;\n /** 48pt */\n 12: number;\n /** 64pt */\n 16: number;\n}\n\n/** Font weight scale */\nexport interface FontWeights {\n regular: number;\n medium: number;\n semibold: number;\n bold: number;\n}\n\n/** Line height scale */\nexport interface LineHeights {\n /** 1.2 — Tight, for headings */\n tight: number;\n /** 1.4 — Normal, for body text */\n normal: number;\n /** 1.6 — Relaxed, for reading-heavy content */\n relaxed: number;\n}\n\n/** Border radius scale for rounded corners */\nexport interface BorderRadiusScale {\n /** 0pt — Sharp corners */\n none: number;\n /** 2pt — Subtle rounding */\n sm: number;\n /** 4pt — Standard rounding */\n md: number;\n /** 8pt — Pronounced rounding */\n lg: number;\n /** 9999pt — Pill/circle shape */\n full: number;\n}\n\n/** Letter spacing scale for typography adjustments */\nexport interface LetterSpacingScale {\n /** -0.025em — Tighter spacing */\n tight: number;\n /** 0em — Normal spacing */\n normal: number;\n /** 0.025em — Slightly wider spacing */\n wide: number;\n /** 0.05em — Much wider spacing (for uppercase) */\n wider: number;\n}\n\n/** Raw design scales shared across themes */\nexport interface PrimitiveTokens {\n typography: TypographyScale;\n spacing: SpacingScale;\n fontWeights: FontWeights;\n lineHeights: LineHeights;\n borderRadius: BorderRadiusScale;\n letterSpacing: LetterSpacingScale;\n}\n\n// ─── Semantic Tokens ────────────────────────────────────────────────────────\n// These map primitives to design intent. Themes differ primarily here.\n\n/**\n * Semantic color tokens using the foreground/background pair convention.\n * All values must be hex strings (e.g., '#1a1a1a').\n * react-pdf supports hex, rgb(), and hsl() — but NOT oklch.\n */\nexport interface ColorTokens {\n /** Primary text and content color */\n foreground: string;\n /** Page background color */\n background: string;\n /** Subtle background for secondary areas (e.g., code blocks, table headers) */\n muted: string;\n /** Text on muted backgrounds (captions, footnotes, timestamps) */\n mutedForeground: string;\n /** Brand/accent color for emphasis and highlights */\n primary: string;\n /** Text on primary-colored backgrounds */\n primaryForeground: string;\n /** Table borders, dividers, rules */\n border: string;\n /** Secondary accent for call-to-action elements, badges */\n accent: string;\n /** Error text, warning indicators */\n destructive: string;\n /** Success states (e.g., badges, confirmations) */\n success: string;\n /** Warning states (e.g., badges, alerts) */\n warning: string;\n /** Info states (e.g., badges, informational alerts) */\n info: string;\n}\n\n/** Typography semantic tokens — what fonts and sizes to use where */\nexport interface TypographyTokens {\n /** Body text settings */\n body: {\n /** Font family for body text (e.g., 'Helvetica') */\n fontFamily: string;\n /** Base font size in points */\n fontSize: number;\n /** Line height multiplier */\n lineHeight: number;\n };\n /** Heading text settings */\n heading: {\n /** Font family for headings (e.g., 'Times-Roman', 'Courier') */\n fontFamily: string;\n /** Font weight as numeric value (400-700) */\n fontWeight: number;\n /** Line height multiplier for headings */\n lineHeight: number;\n /** Font sizes for each heading level in points */\n fontSize: {\n h1: number;\n h2: number;\n h3: number;\n h4: number;\n h5: number;\n h6: number;\n };\n };\n}\n\n/** Spacing semantic tokens — consistent spacing across the document */\nexport interface SpacingTokens {\n /** Page margin settings in points */\n page: {\n marginTop: number;\n marginRight: number;\n marginBottom: number;\n marginLeft: number;\n };\n /** Space between major document sections (after h2, before new sections) */\n sectionGap: number;\n /** Space between paragraphs and after text blocks */\n paragraphGap: number;\n /** Space between inline components, list items, table rows */\n componentGap: number;\n}\n\n/** Page layout defaults */\nexport interface PageTokens {\n /** Default page size */\n size: \"A4\" | \"LETTER\" | \"LEGAL\";\n /** Default page orientation */\n orientation: \"portrait\" | \"landscape\";\n}\n\n// ─── Full Theme ─────────────────────────────────────────────────────────────\n\n/**\n * The complete pdfcn theme object.\n *\n * Components import this and use its tokens for all style values.\n * Since React Context doesn't work in @react-pdf/renderer,\n * the theme is a plain TypeScript object imported directly by components.\n *\n * @example\n * ```tsx\n * // In a component:\n * import { theme } from '../lib/pdfx-theme';\n *\n * function createStyles(t: PdfcnTheme) {\n * return StyleSheet.create({\n * text: {\n * fontFamily: t.typography.body.fontFamily,\n * fontSize: t.typography.body.fontSize,\n * color: t.colors.foreground,\n * },\n * });\n * }\n *\n * const styles = createStyles(theme);\n * ```\n */\nexport interface PdfcnTheme {\n /** Theme name identifier */\n name: string;\n /** Raw design scales */\n primitives: PrimitiveTokens;\n /** Semantic color mappings */\n colors: ColorTokens;\n /** Typography settings for body and headings */\n typography: TypographyTokens;\n /** Spacing settings for page, sections, and components */\n spacing: SpacingTokens;\n /** Page layout defaults */\n page: PageTokens;\n}\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "content": "import { professionalTheme } from \"@/registry/themes\";\n\nexport const theme = professionalTheme;\n",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "type": "registry:theme"
+}
\ No newline at end of file
diff --git a/public/r/takumi/theme-elegant.json b/public/r/takumi/theme-elegant.json
new file mode 100644
index 0000000..dd11180
--- /dev/null
+++ b/public/r/takumi/theme-elegant.json
@@ -0,0 +1,37 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/theme-elegant",
+ "title": "Elegant Theme (takumi)",
+ "description": "elegant theme tokens for takumi",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "files": [
+ {
+ "path": "registry/themes/elegant.ts",
+ "content": "import { defaultPrimitives } from \"./primitives\";\nimport type { PdfcnTheme } from \"./theme-types\";\n\n/**\n * Elegant theme preset.\n *\n * Character: Warm cream-adjacent whites, amber/gold accent, Playfair Display\n * headings paired with Lora body — a classic editorial combination.\n * Ideal for design portfolios, luxury brands, and high-end editorial PDFs.\n */\nexport const elegantTheme: PdfcnTheme = {\n colors: {\n accent: \"#b45309\",\n background: \"#ffffff\",\n border: \"#d6d3d1\",\n destructive: \"#dc2626\",\n foreground: \"#1c1917\",\n info: \"#0ea5e9\",\n muted: \"#fafaf9\",\n mutedForeground: \"#78716c\",\n primary: \"#78350f\",\n primaryForeground: \"#fffbeb\",\n success: \"#16a34a\",\n warning: \"#d97706\",\n },\n name: \"elegant\",\n page: {\n orientation: \"portrait\",\n size: \"A4\",\n },\n primitives: defaultPrimitives,\n spacing: {\n componentGap: 16,\n page: {\n marginBottom: 60,\n marginLeft: 52,\n marginRight: 52,\n marginTop: 60,\n },\n paragraphGap: 12,\n sectionGap: 30,\n },\n typography: {\n body: {\n fontFamily: \"Lora\",\n fontSize: 11,\n lineHeight: 1.7,\n },\n heading: {\n fontFamily: \"Playfair Display\",\n fontSize: {\n h1: 36,\n h2: 26,\n h3: 20,\n h4: 16,\n h5: 14,\n h6: 12,\n },\n fontWeight: 700,\n lineHeight: 1.2,\n },\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-elegant.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "content": "import type { PrimitiveTokens } from \"./theme-types\";\n\n/**\n * Default primitive tokens shared by all theme presets.\n *\n * These define the raw design scales — the \"palette\" of values available.\n * Themes select from these scales when assigning semantic tokens.\n *\n * - Typography: Major Third (1.25) ratio, 12pt base\n * - Spacing: 4pt grid system\n * - Font weights: 400–700\n * - Line heights: 1.2–1.6\n * - Border radius: 0–8pt (plus full for pills)\n * - Letter spacing: -0.025 to 0.05 (em-like ratios for PDF points)\n */\nexport const defaultPrimitives: PrimitiveTokens = {\n borderRadius: {\n full: 9999,\n lg: 8,\n md: 4,\n none: 0,\n sm: 2,\n },\n fontWeights: {\n bold: 700,\n medium: 500,\n regular: 400,\n semibold: 600,\n },\n letterSpacing: {\n normal: 0,\n tight: -0.025,\n wide: 0.025,\n wider: 0.05,\n },\n lineHeights: {\n normal: 1.4,\n relaxed: 1.6,\n tight: 1.2,\n },\n spacing: {\n 0: 0,\n 0.5: 2,\n 1: 4,\n 10: 40,\n 12: 48,\n 16: 64,\n 2: 8,\n 3: 12,\n 4: 16,\n 5: 20,\n 6: 24,\n 8: 32,\n },\n typography: {\n \"2xl\": 28,\n \"3xl\": 36,\n base: 15,\n lg: 18,\n sm: 12,\n xl: 22,\n xs: 10,\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "content": "/**\n * pdfcn Theme System — Type Definitions\n *\n * Defines the complete type hierarchy for the pdfcn PDF theme system.\n * All PDF components consume these tokens instead of hardcoding style values.\n *\n * Architecture:\n * - PrimitiveTokens: Raw design scales (typography, spacing, weights, line heights)\n * - ColorTokens: Semantic color mappings (foreground/background pairs)\n * - TypographyTokens: Font family, size, weight, and line height decisions\n * - SpacingTokens: Page margins, section/paragraph/component gaps\n * - PageTokens: Default page size and orientation\n * - PdfcnTheme: The complete theme object combining all token layers\n *\n * @example\n * ```ts\n * import type { PdfcnTheme } from '@/registry/themes';\n *\n * const myTheme: PdfcnTheme = {\n * name: 'custom',\n * primitives: { ... },\n * colors: { foreground: '#1a1a1a', ... },\n * typography: { body: { ... }, heading: { ... } },\n * spacing: { page: { ... }, sectionGap: 24, ... },\n * page: { size: 'A4', orientation: 'portrait' },\n * };\n * ```\n */\n\n// ─── Primitive Tokens ───────────────────────────────────────────────────────\n// Raw design scales. These define WHAT values are available.\n// Themes choose from these when populating semantic tokens.\n\n/** Typography scale using a Major Third (1.25) ratio with 12pt base */\nexport interface TypographyScale {\n /** 10pt — Captions, footnotes */\n xs: number;\n /** 12pt — Body text (PDF standard) */\n sm: number;\n /** 15pt — Large body, small headings */\n base: number;\n /** 18pt — H4 equivalent */\n lg: number;\n /** 22pt — H3 equivalent */\n xl: number;\n /** 28pt — H2 equivalent */\n \"2xl\": number;\n /** 36pt — H1 equivalent */\n \"3xl\": number;\n}\n\n/** Spacing scale based on a 4pt grid system */\nexport interface SpacingScale {\n /** 0pt */\n 0: number;\n /** 2pt */\n 0.5: number;\n /** 4pt */\n 1: number;\n /** 8pt */\n 2: number;\n /** 12pt */\n 3: number;\n /** 16pt */\n 4: number;\n /** 20pt */\n 5: number;\n /** 24pt */\n 6: number;\n /** 32pt */\n 8: number;\n /** 40pt */\n 10: number;\n /** 48pt */\n 12: number;\n /** 64pt */\n 16: number;\n}\n\n/** Font weight scale */\nexport interface FontWeights {\n regular: number;\n medium: number;\n semibold: number;\n bold: number;\n}\n\n/** Line height scale */\nexport interface LineHeights {\n /** 1.2 — Tight, for headings */\n tight: number;\n /** 1.4 — Normal, for body text */\n normal: number;\n /** 1.6 — Relaxed, for reading-heavy content */\n relaxed: number;\n}\n\n/** Border radius scale for rounded corners */\nexport interface BorderRadiusScale {\n /** 0pt — Sharp corners */\n none: number;\n /** 2pt — Subtle rounding */\n sm: number;\n /** 4pt — Standard rounding */\n md: number;\n /** 8pt — Pronounced rounding */\n lg: number;\n /** 9999pt — Pill/circle shape */\n full: number;\n}\n\n/** Letter spacing scale for typography adjustments */\nexport interface LetterSpacingScale {\n /** -0.025em — Tighter spacing */\n tight: number;\n /** 0em — Normal spacing */\n normal: number;\n /** 0.025em — Slightly wider spacing */\n wide: number;\n /** 0.05em — Much wider spacing (for uppercase) */\n wider: number;\n}\n\n/** Raw design scales shared across themes */\nexport interface PrimitiveTokens {\n typography: TypographyScale;\n spacing: SpacingScale;\n fontWeights: FontWeights;\n lineHeights: LineHeights;\n borderRadius: BorderRadiusScale;\n letterSpacing: LetterSpacingScale;\n}\n\n// ─── Semantic Tokens ────────────────────────────────────────────────────────\n// These map primitives to design intent. Themes differ primarily here.\n\n/**\n * Semantic color tokens using the foreground/background pair convention.\n * All values must be hex strings (e.g., '#1a1a1a').\n * react-pdf supports hex, rgb(), and hsl() — but NOT oklch.\n */\nexport interface ColorTokens {\n /** Primary text and content color */\n foreground: string;\n /** Page background color */\n background: string;\n /** Subtle background for secondary areas (e.g., code blocks, table headers) */\n muted: string;\n /** Text on muted backgrounds (captions, footnotes, timestamps) */\n mutedForeground: string;\n /** Brand/accent color for emphasis and highlights */\n primary: string;\n /** Text on primary-colored backgrounds */\n primaryForeground: string;\n /** Table borders, dividers, rules */\n border: string;\n /** Secondary accent for call-to-action elements, badges */\n accent: string;\n /** Error text, warning indicators */\n destructive: string;\n /** Success states (e.g., badges, confirmations) */\n success: string;\n /** Warning states (e.g., badges, alerts) */\n warning: string;\n /** Info states (e.g., badges, informational alerts) */\n info: string;\n}\n\n/** Typography semantic tokens — what fonts and sizes to use where */\nexport interface TypographyTokens {\n /** Body text settings */\n body: {\n /** Font family for body text (e.g., 'Helvetica') */\n fontFamily: string;\n /** Base font size in points */\n fontSize: number;\n /** Line height multiplier */\n lineHeight: number;\n };\n /** Heading text settings */\n heading: {\n /** Font family for headings (e.g., 'Times-Roman', 'Courier') */\n fontFamily: string;\n /** Font weight as numeric value (400-700) */\n fontWeight: number;\n /** Line height multiplier for headings */\n lineHeight: number;\n /** Font sizes for each heading level in points */\n fontSize: {\n h1: number;\n h2: number;\n h3: number;\n h4: number;\n h5: number;\n h6: number;\n };\n };\n}\n\n/** Spacing semantic tokens — consistent spacing across the document */\nexport interface SpacingTokens {\n /** Page margin settings in points */\n page: {\n marginTop: number;\n marginRight: number;\n marginBottom: number;\n marginLeft: number;\n };\n /** Space between major document sections (after h2, before new sections) */\n sectionGap: number;\n /** Space between paragraphs and after text blocks */\n paragraphGap: number;\n /** Space between inline components, list items, table rows */\n componentGap: number;\n}\n\n/** Page layout defaults */\nexport interface PageTokens {\n /** Default page size */\n size: \"A4\" | \"LETTER\" | \"LEGAL\";\n /** Default page orientation */\n orientation: \"portrait\" | \"landscape\";\n}\n\n// ─── Full Theme ─────────────────────────────────────────────────────────────\n\n/**\n * The complete pdfcn theme object.\n *\n * Components import this and use its tokens for all style values.\n * Since React Context doesn't work in @react-pdf/renderer,\n * the theme is a plain TypeScript object imported directly by components.\n *\n * @example\n * ```tsx\n * // In a component:\n * import { theme } from '../lib/pdfx-theme';\n *\n * function createStyles(t: PdfcnTheme) {\n * return StyleSheet.create({\n * text: {\n * fontFamily: t.typography.body.fontFamily,\n * fontSize: t.typography.body.fontSize,\n * color: t.colors.foreground,\n * },\n * });\n * }\n *\n * const styles = createStyles(theme);\n * ```\n */\nexport interface PdfcnTheme {\n /** Theme name identifier */\n name: string;\n /** Raw design scales */\n primitives: PrimitiveTokens;\n /** Semantic color mappings */\n colors: ColorTokens;\n /** Typography settings for body and headings */\n typography: TypographyTokens;\n /** Spacing settings for page, sections, and components */\n spacing: SpacingTokens;\n /** Page layout defaults */\n page: PageTokens;\n}\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "content": "import { professionalTheme } from \"@/registry/themes\";\n\nexport const theme = professionalTheme;\n",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "type": "registry:theme"
+}
\ No newline at end of file
diff --git a/public/r/takumi/theme-executive.json b/public/r/takumi/theme-executive.json
new file mode 100644
index 0000000..b1c8387
--- /dev/null
+++ b/public/r/takumi/theme-executive.json
@@ -0,0 +1,37 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/theme-executive",
+ "title": "Executive Theme (takumi)",
+ "description": "executive theme tokens for takumi",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "files": [
+ {
+ "path": "registry/themes/executive.ts",
+ "content": "import { defaultPrimitives } from \"./primitives\";\nimport type { PdfcnTheme } from \"./theme-types\";\n\n/**\n * Executive theme preset.\n *\n * Character: Deep navy palette, Merriweather serif headings, Open Sans body.\n * Generous margins, high contrast, premium boardroom aesthetic.\n * Ideal for board reports, executive briefs, and investor documents.\n */\nexport const executiveTheme: PdfcnTheme = {\n colors: {\n accent: \"#1e40af\",\n background: \"#ffffff\",\n border: \"#cbd5e1\",\n destructive: \"#dc2626\",\n foreground: \"#0f172a\",\n info: \"#0369a1\",\n muted: \"#f1f5f9\",\n mutedForeground: \"#64748b\",\n primary: \"#1e3a5f\",\n primaryForeground: \"#ffffff\",\n success: \"#15803d\",\n warning: \"#b45309\",\n },\n name: \"executive\",\n page: {\n orientation: \"portrait\",\n size: \"A4\",\n },\n primitives: defaultPrimitives,\n spacing: {\n componentGap: 16,\n page: {\n marginBottom: 64,\n marginLeft: 56,\n marginRight: 56,\n marginTop: 64,\n },\n paragraphGap: 10,\n sectionGap: 32,\n },\n typography: {\n body: {\n fontFamily: \"Open Sans\",\n fontSize: 11,\n lineHeight: 1.65,\n },\n heading: {\n fontFamily: \"Merriweather\",\n fontSize: {\n h1: 34,\n h2: 26,\n h3: 20,\n h4: 16,\n h5: 14,\n h6: 12,\n },\n fontWeight: 700,\n lineHeight: 1.25,\n },\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-executive.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "content": "import type { PrimitiveTokens } from \"./theme-types\";\n\n/**\n * Default primitive tokens shared by all theme presets.\n *\n * These define the raw design scales — the \"palette\" of values available.\n * Themes select from these scales when assigning semantic tokens.\n *\n * - Typography: Major Third (1.25) ratio, 12pt base\n * - Spacing: 4pt grid system\n * - Font weights: 400–700\n * - Line heights: 1.2–1.6\n * - Border radius: 0–8pt (plus full for pills)\n * - Letter spacing: -0.025 to 0.05 (em-like ratios for PDF points)\n */\nexport const defaultPrimitives: PrimitiveTokens = {\n borderRadius: {\n full: 9999,\n lg: 8,\n md: 4,\n none: 0,\n sm: 2,\n },\n fontWeights: {\n bold: 700,\n medium: 500,\n regular: 400,\n semibold: 600,\n },\n letterSpacing: {\n normal: 0,\n tight: -0.025,\n wide: 0.025,\n wider: 0.05,\n },\n lineHeights: {\n normal: 1.4,\n relaxed: 1.6,\n tight: 1.2,\n },\n spacing: {\n 0: 0,\n 0.5: 2,\n 1: 4,\n 10: 40,\n 12: 48,\n 16: 64,\n 2: 8,\n 3: 12,\n 4: 16,\n 5: 20,\n 6: 24,\n 8: 32,\n },\n typography: {\n \"2xl\": 28,\n \"3xl\": 36,\n base: 15,\n lg: 18,\n sm: 12,\n xl: 22,\n xs: 10,\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "content": "/**\n * pdfcn Theme System — Type Definitions\n *\n * Defines the complete type hierarchy for the pdfcn PDF theme system.\n * All PDF components consume these tokens instead of hardcoding style values.\n *\n * Architecture:\n * - PrimitiveTokens: Raw design scales (typography, spacing, weights, line heights)\n * - ColorTokens: Semantic color mappings (foreground/background pairs)\n * - TypographyTokens: Font family, size, weight, and line height decisions\n * - SpacingTokens: Page margins, section/paragraph/component gaps\n * - PageTokens: Default page size and orientation\n * - PdfcnTheme: The complete theme object combining all token layers\n *\n * @example\n * ```ts\n * import type { PdfcnTheme } from '@/registry/themes';\n *\n * const myTheme: PdfcnTheme = {\n * name: 'custom',\n * primitives: { ... },\n * colors: { foreground: '#1a1a1a', ... },\n * typography: { body: { ... }, heading: { ... } },\n * spacing: { page: { ... }, sectionGap: 24, ... },\n * page: { size: 'A4', orientation: 'portrait' },\n * };\n * ```\n */\n\n// ─── Primitive Tokens ───────────────────────────────────────────────────────\n// Raw design scales. These define WHAT values are available.\n// Themes choose from these when populating semantic tokens.\n\n/** Typography scale using a Major Third (1.25) ratio with 12pt base */\nexport interface TypographyScale {\n /** 10pt — Captions, footnotes */\n xs: number;\n /** 12pt — Body text (PDF standard) */\n sm: number;\n /** 15pt — Large body, small headings */\n base: number;\n /** 18pt — H4 equivalent */\n lg: number;\n /** 22pt — H3 equivalent */\n xl: number;\n /** 28pt — H2 equivalent */\n \"2xl\": number;\n /** 36pt — H1 equivalent */\n \"3xl\": number;\n}\n\n/** Spacing scale based on a 4pt grid system */\nexport interface SpacingScale {\n /** 0pt */\n 0: number;\n /** 2pt */\n 0.5: number;\n /** 4pt */\n 1: number;\n /** 8pt */\n 2: number;\n /** 12pt */\n 3: number;\n /** 16pt */\n 4: number;\n /** 20pt */\n 5: number;\n /** 24pt */\n 6: number;\n /** 32pt */\n 8: number;\n /** 40pt */\n 10: number;\n /** 48pt */\n 12: number;\n /** 64pt */\n 16: number;\n}\n\n/** Font weight scale */\nexport interface FontWeights {\n regular: number;\n medium: number;\n semibold: number;\n bold: number;\n}\n\n/** Line height scale */\nexport interface LineHeights {\n /** 1.2 — Tight, for headings */\n tight: number;\n /** 1.4 — Normal, for body text */\n normal: number;\n /** 1.6 — Relaxed, for reading-heavy content */\n relaxed: number;\n}\n\n/** Border radius scale for rounded corners */\nexport interface BorderRadiusScale {\n /** 0pt — Sharp corners */\n none: number;\n /** 2pt — Subtle rounding */\n sm: number;\n /** 4pt — Standard rounding */\n md: number;\n /** 8pt — Pronounced rounding */\n lg: number;\n /** 9999pt — Pill/circle shape */\n full: number;\n}\n\n/** Letter spacing scale for typography adjustments */\nexport interface LetterSpacingScale {\n /** -0.025em — Tighter spacing */\n tight: number;\n /** 0em — Normal spacing */\n normal: number;\n /** 0.025em — Slightly wider spacing */\n wide: number;\n /** 0.05em — Much wider spacing (for uppercase) */\n wider: number;\n}\n\n/** Raw design scales shared across themes */\nexport interface PrimitiveTokens {\n typography: TypographyScale;\n spacing: SpacingScale;\n fontWeights: FontWeights;\n lineHeights: LineHeights;\n borderRadius: BorderRadiusScale;\n letterSpacing: LetterSpacingScale;\n}\n\n// ─── Semantic Tokens ────────────────────────────────────────────────────────\n// These map primitives to design intent. Themes differ primarily here.\n\n/**\n * Semantic color tokens using the foreground/background pair convention.\n * All values must be hex strings (e.g., '#1a1a1a').\n * react-pdf supports hex, rgb(), and hsl() — but NOT oklch.\n */\nexport interface ColorTokens {\n /** Primary text and content color */\n foreground: string;\n /** Page background color */\n background: string;\n /** Subtle background for secondary areas (e.g., code blocks, table headers) */\n muted: string;\n /** Text on muted backgrounds (captions, footnotes, timestamps) */\n mutedForeground: string;\n /** Brand/accent color for emphasis and highlights */\n primary: string;\n /** Text on primary-colored backgrounds */\n primaryForeground: string;\n /** Table borders, dividers, rules */\n border: string;\n /** Secondary accent for call-to-action elements, badges */\n accent: string;\n /** Error text, warning indicators */\n destructive: string;\n /** Success states (e.g., badges, confirmations) */\n success: string;\n /** Warning states (e.g., badges, alerts) */\n warning: string;\n /** Info states (e.g., badges, informational alerts) */\n info: string;\n}\n\n/** Typography semantic tokens — what fonts and sizes to use where */\nexport interface TypographyTokens {\n /** Body text settings */\n body: {\n /** Font family for body text (e.g., 'Helvetica') */\n fontFamily: string;\n /** Base font size in points */\n fontSize: number;\n /** Line height multiplier */\n lineHeight: number;\n };\n /** Heading text settings */\n heading: {\n /** Font family for headings (e.g., 'Times-Roman', 'Courier') */\n fontFamily: string;\n /** Font weight as numeric value (400-700) */\n fontWeight: number;\n /** Line height multiplier for headings */\n lineHeight: number;\n /** Font sizes for each heading level in points */\n fontSize: {\n h1: number;\n h2: number;\n h3: number;\n h4: number;\n h5: number;\n h6: number;\n };\n };\n}\n\n/** Spacing semantic tokens — consistent spacing across the document */\nexport interface SpacingTokens {\n /** Page margin settings in points */\n page: {\n marginTop: number;\n marginRight: number;\n marginBottom: number;\n marginLeft: number;\n };\n /** Space between major document sections (after h2, before new sections) */\n sectionGap: number;\n /** Space between paragraphs and after text blocks */\n paragraphGap: number;\n /** Space between inline components, list items, table rows */\n componentGap: number;\n}\n\n/** Page layout defaults */\nexport interface PageTokens {\n /** Default page size */\n size: \"A4\" | \"LETTER\" | \"LEGAL\";\n /** Default page orientation */\n orientation: \"portrait\" | \"landscape\";\n}\n\n// ─── Full Theme ─────────────────────────────────────────────────────────────\n\n/**\n * The complete pdfcn theme object.\n *\n * Components import this and use its tokens for all style values.\n * Since React Context doesn't work in @react-pdf/renderer,\n * the theme is a plain TypeScript object imported directly by components.\n *\n * @example\n * ```tsx\n * // In a component:\n * import { theme } from '../lib/pdfx-theme';\n *\n * function createStyles(t: PdfcnTheme) {\n * return StyleSheet.create({\n * text: {\n * fontFamily: t.typography.body.fontFamily,\n * fontSize: t.typography.body.fontSize,\n * color: t.colors.foreground,\n * },\n * });\n * }\n *\n * const styles = createStyles(theme);\n * ```\n */\nexport interface PdfcnTheme {\n /** Theme name identifier */\n name: string;\n /** Raw design scales */\n primitives: PrimitiveTokens;\n /** Semantic color mappings */\n colors: ColorTokens;\n /** Typography settings for body and headings */\n typography: TypographyTokens;\n /** Spacing settings for page, sections, and components */\n spacing: SpacingTokens;\n /** Page layout defaults */\n page: PageTokens;\n}\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "content": "import { professionalTheme } from \"@/registry/themes\";\n\nexport const theme = professionalTheme;\n",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "type": "registry:theme"
+}
\ No newline at end of file
diff --git a/public/r/takumi/theme-forest.json b/public/r/takumi/theme-forest.json
new file mode 100644
index 0000000..a005289
--- /dev/null
+++ b/public/r/takumi/theme-forest.json
@@ -0,0 +1,37 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/theme-forest",
+ "title": "Forest Theme (takumi)",
+ "description": "forest theme tokens for takumi",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "files": [
+ {
+ "path": "registry/themes/forest.ts",
+ "content": "import { defaultPrimitives } from \"./primitives\";\nimport type { PdfcnTheme } from \"./theme-types\";\n\n/**\n * Forest theme preset.\n *\n * Character: Natural deep greens, Merriweather headings for gravitas, Inter\n * body for readability. Earthy and trustworthy.\n * Ideal for sustainability reports, environmental docs, and wellness brands.\n */\nexport const forestTheme: PdfcnTheme = {\n colors: {\n accent: \"#16a34a\",\n background: \"#ffffff\",\n border: \"#bbf7d0\",\n destructive: \"#dc2626\",\n foreground: \"#14532d\",\n info: \"#0ea5e9\",\n muted: \"#f0fdf4\",\n mutedForeground: \"#4d7c5f\",\n primary: \"#15803d\",\n primaryForeground: \"#ffffff\",\n success: \"#15803d\",\n warning: \"#d97706\",\n },\n name: \"forest\",\n page: {\n orientation: \"portrait\",\n size: \"A4\",\n },\n primitives: defaultPrimitives,\n spacing: {\n componentGap: 14,\n page: {\n marginBottom: 56,\n marginLeft: 48,\n marginRight: 48,\n marginTop: 56,\n },\n paragraphGap: 10,\n sectionGap: 28,\n },\n typography: {\n body: {\n fontFamily: \"Inter\",\n fontSize: 11,\n lineHeight: 1.6,\n },\n heading: {\n fontFamily: \"Merriweather\",\n fontSize: {\n h1: 32,\n h2: 24,\n h3: 19,\n h4: 15,\n h5: 13,\n h6: 11,\n },\n fontWeight: 700,\n lineHeight: 1.25,\n },\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-forest.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "content": "import type { PrimitiveTokens } from \"./theme-types\";\n\n/**\n * Default primitive tokens shared by all theme presets.\n *\n * These define the raw design scales — the \"palette\" of values available.\n * Themes select from these scales when assigning semantic tokens.\n *\n * - Typography: Major Third (1.25) ratio, 12pt base\n * - Spacing: 4pt grid system\n * - Font weights: 400–700\n * - Line heights: 1.2–1.6\n * - Border radius: 0–8pt (plus full for pills)\n * - Letter spacing: -0.025 to 0.05 (em-like ratios for PDF points)\n */\nexport const defaultPrimitives: PrimitiveTokens = {\n borderRadius: {\n full: 9999,\n lg: 8,\n md: 4,\n none: 0,\n sm: 2,\n },\n fontWeights: {\n bold: 700,\n medium: 500,\n regular: 400,\n semibold: 600,\n },\n letterSpacing: {\n normal: 0,\n tight: -0.025,\n wide: 0.025,\n wider: 0.05,\n },\n lineHeights: {\n normal: 1.4,\n relaxed: 1.6,\n tight: 1.2,\n },\n spacing: {\n 0: 0,\n 0.5: 2,\n 1: 4,\n 10: 40,\n 12: 48,\n 16: 64,\n 2: 8,\n 3: 12,\n 4: 16,\n 5: 20,\n 6: 24,\n 8: 32,\n },\n typography: {\n \"2xl\": 28,\n \"3xl\": 36,\n base: 15,\n lg: 18,\n sm: 12,\n xl: 22,\n xs: 10,\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "content": "/**\n * pdfcn Theme System — Type Definitions\n *\n * Defines the complete type hierarchy for the pdfcn PDF theme system.\n * All PDF components consume these tokens instead of hardcoding style values.\n *\n * Architecture:\n * - PrimitiveTokens: Raw design scales (typography, spacing, weights, line heights)\n * - ColorTokens: Semantic color mappings (foreground/background pairs)\n * - TypographyTokens: Font family, size, weight, and line height decisions\n * - SpacingTokens: Page margins, section/paragraph/component gaps\n * - PageTokens: Default page size and orientation\n * - PdfcnTheme: The complete theme object combining all token layers\n *\n * @example\n * ```ts\n * import type { PdfcnTheme } from '@/registry/themes';\n *\n * const myTheme: PdfcnTheme = {\n * name: 'custom',\n * primitives: { ... },\n * colors: { foreground: '#1a1a1a', ... },\n * typography: { body: { ... }, heading: { ... } },\n * spacing: { page: { ... }, sectionGap: 24, ... },\n * page: { size: 'A4', orientation: 'portrait' },\n * };\n * ```\n */\n\n// ─── Primitive Tokens ───────────────────────────────────────────────────────\n// Raw design scales. These define WHAT values are available.\n// Themes choose from these when populating semantic tokens.\n\n/** Typography scale using a Major Third (1.25) ratio with 12pt base */\nexport interface TypographyScale {\n /** 10pt — Captions, footnotes */\n xs: number;\n /** 12pt — Body text (PDF standard) */\n sm: number;\n /** 15pt — Large body, small headings */\n base: number;\n /** 18pt — H4 equivalent */\n lg: number;\n /** 22pt — H3 equivalent */\n xl: number;\n /** 28pt — H2 equivalent */\n \"2xl\": number;\n /** 36pt — H1 equivalent */\n \"3xl\": number;\n}\n\n/** Spacing scale based on a 4pt grid system */\nexport interface SpacingScale {\n /** 0pt */\n 0: number;\n /** 2pt */\n 0.5: number;\n /** 4pt */\n 1: number;\n /** 8pt */\n 2: number;\n /** 12pt */\n 3: number;\n /** 16pt */\n 4: number;\n /** 20pt */\n 5: number;\n /** 24pt */\n 6: number;\n /** 32pt */\n 8: number;\n /** 40pt */\n 10: number;\n /** 48pt */\n 12: number;\n /** 64pt */\n 16: number;\n}\n\n/** Font weight scale */\nexport interface FontWeights {\n regular: number;\n medium: number;\n semibold: number;\n bold: number;\n}\n\n/** Line height scale */\nexport interface LineHeights {\n /** 1.2 — Tight, for headings */\n tight: number;\n /** 1.4 — Normal, for body text */\n normal: number;\n /** 1.6 — Relaxed, for reading-heavy content */\n relaxed: number;\n}\n\n/** Border radius scale for rounded corners */\nexport interface BorderRadiusScale {\n /** 0pt — Sharp corners */\n none: number;\n /** 2pt — Subtle rounding */\n sm: number;\n /** 4pt — Standard rounding */\n md: number;\n /** 8pt — Pronounced rounding */\n lg: number;\n /** 9999pt — Pill/circle shape */\n full: number;\n}\n\n/** Letter spacing scale for typography adjustments */\nexport interface LetterSpacingScale {\n /** -0.025em — Tighter spacing */\n tight: number;\n /** 0em — Normal spacing */\n normal: number;\n /** 0.025em — Slightly wider spacing */\n wide: number;\n /** 0.05em — Much wider spacing (for uppercase) */\n wider: number;\n}\n\n/** Raw design scales shared across themes */\nexport interface PrimitiveTokens {\n typography: TypographyScale;\n spacing: SpacingScale;\n fontWeights: FontWeights;\n lineHeights: LineHeights;\n borderRadius: BorderRadiusScale;\n letterSpacing: LetterSpacingScale;\n}\n\n// ─── Semantic Tokens ────────────────────────────────────────────────────────\n// These map primitives to design intent. Themes differ primarily here.\n\n/**\n * Semantic color tokens using the foreground/background pair convention.\n * All values must be hex strings (e.g., '#1a1a1a').\n * react-pdf supports hex, rgb(), and hsl() — but NOT oklch.\n */\nexport interface ColorTokens {\n /** Primary text and content color */\n foreground: string;\n /** Page background color */\n background: string;\n /** Subtle background for secondary areas (e.g., code blocks, table headers) */\n muted: string;\n /** Text on muted backgrounds (captions, footnotes, timestamps) */\n mutedForeground: string;\n /** Brand/accent color for emphasis and highlights */\n primary: string;\n /** Text on primary-colored backgrounds */\n primaryForeground: string;\n /** Table borders, dividers, rules */\n border: string;\n /** Secondary accent for call-to-action elements, badges */\n accent: string;\n /** Error text, warning indicators */\n destructive: string;\n /** Success states (e.g., badges, confirmations) */\n success: string;\n /** Warning states (e.g., badges, alerts) */\n warning: string;\n /** Info states (e.g., badges, informational alerts) */\n info: string;\n}\n\n/** Typography semantic tokens — what fonts and sizes to use where */\nexport interface TypographyTokens {\n /** Body text settings */\n body: {\n /** Font family for body text (e.g., 'Helvetica') */\n fontFamily: string;\n /** Base font size in points */\n fontSize: number;\n /** Line height multiplier */\n lineHeight: number;\n };\n /** Heading text settings */\n heading: {\n /** Font family for headings (e.g., 'Times-Roman', 'Courier') */\n fontFamily: string;\n /** Font weight as numeric value (400-700) */\n fontWeight: number;\n /** Line height multiplier for headings */\n lineHeight: number;\n /** Font sizes for each heading level in points */\n fontSize: {\n h1: number;\n h2: number;\n h3: number;\n h4: number;\n h5: number;\n h6: number;\n };\n };\n}\n\n/** Spacing semantic tokens — consistent spacing across the document */\nexport interface SpacingTokens {\n /** Page margin settings in points */\n page: {\n marginTop: number;\n marginRight: number;\n marginBottom: number;\n marginLeft: number;\n };\n /** Space between major document sections (after h2, before new sections) */\n sectionGap: number;\n /** Space between paragraphs and after text blocks */\n paragraphGap: number;\n /** Space between inline components, list items, table rows */\n componentGap: number;\n}\n\n/** Page layout defaults */\nexport interface PageTokens {\n /** Default page size */\n size: \"A4\" | \"LETTER\" | \"LEGAL\";\n /** Default page orientation */\n orientation: \"portrait\" | \"landscape\";\n}\n\n// ─── Full Theme ─────────────────────────────────────────────────────────────\n\n/**\n * The complete pdfcn theme object.\n *\n * Components import this and use its tokens for all style values.\n * Since React Context doesn't work in @react-pdf/renderer,\n * the theme is a plain TypeScript object imported directly by components.\n *\n * @example\n * ```tsx\n * // In a component:\n * import { theme } from '../lib/pdfx-theme';\n *\n * function createStyles(t: PdfcnTheme) {\n * return StyleSheet.create({\n * text: {\n * fontFamily: t.typography.body.fontFamily,\n * fontSize: t.typography.body.fontSize,\n * color: t.colors.foreground,\n * },\n * });\n * }\n *\n * const styles = createStyles(theme);\n * ```\n */\nexport interface PdfcnTheme {\n /** Theme name identifier */\n name: string;\n /** Raw design scales */\n primitives: PrimitiveTokens;\n /** Semantic color mappings */\n colors: ColorTokens;\n /** Typography settings for body and headings */\n typography: TypographyTokens;\n /** Spacing settings for page, sections, and components */\n spacing: SpacingTokens;\n /** Page layout defaults */\n page: PageTokens;\n}\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "content": "import { professionalTheme } from \"@/registry/themes\";\n\nexport const theme = professionalTheme;\n",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "type": "registry:theme"
+}
\ No newline at end of file
diff --git a/public/r/takumi/theme-minimal.json b/public/r/takumi/theme-minimal.json
new file mode 100644
index 0000000..30ea127
--- /dev/null
+++ b/public/r/takumi/theme-minimal.json
@@ -0,0 +1,37 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/theme-minimal",
+ "title": "Minimal Theme (takumi)",
+ "description": "minimal theme tokens for takumi",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "files": [
+ {
+ "path": "registry/themes/minimal.ts",
+ "content": "import { defaultPrimitives } from \"./primitives\";\nimport type { PdfcnTheme } from \"./theme-types\";\n\n/**\n * Minimal theme preset.\n *\n * Character: Courier headings, zinc neutrals, maximum whitespace.\n * shadcn-inspired restrained palette. Ideal for clean documentation,\n * technical specs, and literary manuscripts.\n */\nexport const minimalTheme: PdfcnTheme = {\n colors: {\n accent: \"#71717a\",\n background: \"#ffffff\",\n border: \"#e4e4e7\",\n destructive: \"#b91c1c\",\n foreground: \"#18181b\",\n info: \"#0369a1\",\n muted: \"#fafafa\",\n mutedForeground: \"#a1a1aa\",\n primary: \"#18181b\",\n primaryForeground: \"#ffffff\",\n success: \"#15803d\",\n warning: \"#a16207\",\n },\n name: \"minimal\",\n page: {\n orientation: \"portrait\",\n size: \"A4\",\n },\n primitives: defaultPrimitives,\n spacing: {\n componentGap: 18,\n page: {\n marginBottom: 72,\n marginLeft: 56,\n marginRight: 56,\n marginTop: 72,\n },\n paragraphGap: 14,\n sectionGap: 36,\n },\n typography: {\n body: {\n fontFamily: \"Helvetica\",\n fontSize: 11,\n lineHeight: 1.65,\n },\n heading: {\n fontFamily: \"Courier\",\n fontSize: {\n h1: 24,\n h2: 20,\n h3: 16,\n h4: 14,\n h5: 12,\n h6: 10,\n },\n fontWeight: 600,\n lineHeight: 1.25,\n },\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-minimal.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "content": "import type { PrimitiveTokens } from \"./theme-types\";\n\n/**\n * Default primitive tokens shared by all theme presets.\n *\n * These define the raw design scales — the \"palette\" of values available.\n * Themes select from these scales when assigning semantic tokens.\n *\n * - Typography: Major Third (1.25) ratio, 12pt base\n * - Spacing: 4pt grid system\n * - Font weights: 400–700\n * - Line heights: 1.2–1.6\n * - Border radius: 0–8pt (plus full for pills)\n * - Letter spacing: -0.025 to 0.05 (em-like ratios for PDF points)\n */\nexport const defaultPrimitives: PrimitiveTokens = {\n borderRadius: {\n full: 9999,\n lg: 8,\n md: 4,\n none: 0,\n sm: 2,\n },\n fontWeights: {\n bold: 700,\n medium: 500,\n regular: 400,\n semibold: 600,\n },\n letterSpacing: {\n normal: 0,\n tight: -0.025,\n wide: 0.025,\n wider: 0.05,\n },\n lineHeights: {\n normal: 1.4,\n relaxed: 1.6,\n tight: 1.2,\n },\n spacing: {\n 0: 0,\n 0.5: 2,\n 1: 4,\n 10: 40,\n 12: 48,\n 16: 64,\n 2: 8,\n 3: 12,\n 4: 16,\n 5: 20,\n 6: 24,\n 8: 32,\n },\n typography: {\n \"2xl\": 28,\n \"3xl\": 36,\n base: 15,\n lg: 18,\n sm: 12,\n xl: 22,\n xs: 10,\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "content": "/**\n * pdfcn Theme System — Type Definitions\n *\n * Defines the complete type hierarchy for the pdfcn PDF theme system.\n * All PDF components consume these tokens instead of hardcoding style values.\n *\n * Architecture:\n * - PrimitiveTokens: Raw design scales (typography, spacing, weights, line heights)\n * - ColorTokens: Semantic color mappings (foreground/background pairs)\n * - TypographyTokens: Font family, size, weight, and line height decisions\n * - SpacingTokens: Page margins, section/paragraph/component gaps\n * - PageTokens: Default page size and orientation\n * - PdfcnTheme: The complete theme object combining all token layers\n *\n * @example\n * ```ts\n * import type { PdfcnTheme } from '@/registry/themes';\n *\n * const myTheme: PdfcnTheme = {\n * name: 'custom',\n * primitives: { ... },\n * colors: { foreground: '#1a1a1a', ... },\n * typography: { body: { ... }, heading: { ... } },\n * spacing: { page: { ... }, sectionGap: 24, ... },\n * page: { size: 'A4', orientation: 'portrait' },\n * };\n * ```\n */\n\n// ─── Primitive Tokens ───────────────────────────────────────────────────────\n// Raw design scales. These define WHAT values are available.\n// Themes choose from these when populating semantic tokens.\n\n/** Typography scale using a Major Third (1.25) ratio with 12pt base */\nexport interface TypographyScale {\n /** 10pt — Captions, footnotes */\n xs: number;\n /** 12pt — Body text (PDF standard) */\n sm: number;\n /** 15pt — Large body, small headings */\n base: number;\n /** 18pt — H4 equivalent */\n lg: number;\n /** 22pt — H3 equivalent */\n xl: number;\n /** 28pt — H2 equivalent */\n \"2xl\": number;\n /** 36pt — H1 equivalent */\n \"3xl\": number;\n}\n\n/** Spacing scale based on a 4pt grid system */\nexport interface SpacingScale {\n /** 0pt */\n 0: number;\n /** 2pt */\n 0.5: number;\n /** 4pt */\n 1: number;\n /** 8pt */\n 2: number;\n /** 12pt */\n 3: number;\n /** 16pt */\n 4: number;\n /** 20pt */\n 5: number;\n /** 24pt */\n 6: number;\n /** 32pt */\n 8: number;\n /** 40pt */\n 10: number;\n /** 48pt */\n 12: number;\n /** 64pt */\n 16: number;\n}\n\n/** Font weight scale */\nexport interface FontWeights {\n regular: number;\n medium: number;\n semibold: number;\n bold: number;\n}\n\n/** Line height scale */\nexport interface LineHeights {\n /** 1.2 — Tight, for headings */\n tight: number;\n /** 1.4 — Normal, for body text */\n normal: number;\n /** 1.6 — Relaxed, for reading-heavy content */\n relaxed: number;\n}\n\n/** Border radius scale for rounded corners */\nexport interface BorderRadiusScale {\n /** 0pt — Sharp corners */\n none: number;\n /** 2pt — Subtle rounding */\n sm: number;\n /** 4pt — Standard rounding */\n md: number;\n /** 8pt — Pronounced rounding */\n lg: number;\n /** 9999pt — Pill/circle shape */\n full: number;\n}\n\n/** Letter spacing scale for typography adjustments */\nexport interface LetterSpacingScale {\n /** -0.025em — Tighter spacing */\n tight: number;\n /** 0em — Normal spacing */\n normal: number;\n /** 0.025em — Slightly wider spacing */\n wide: number;\n /** 0.05em — Much wider spacing (for uppercase) */\n wider: number;\n}\n\n/** Raw design scales shared across themes */\nexport interface PrimitiveTokens {\n typography: TypographyScale;\n spacing: SpacingScale;\n fontWeights: FontWeights;\n lineHeights: LineHeights;\n borderRadius: BorderRadiusScale;\n letterSpacing: LetterSpacingScale;\n}\n\n// ─── Semantic Tokens ────────────────────────────────────────────────────────\n// These map primitives to design intent. Themes differ primarily here.\n\n/**\n * Semantic color tokens using the foreground/background pair convention.\n * All values must be hex strings (e.g., '#1a1a1a').\n * react-pdf supports hex, rgb(), and hsl() — but NOT oklch.\n */\nexport interface ColorTokens {\n /** Primary text and content color */\n foreground: string;\n /** Page background color */\n background: string;\n /** Subtle background for secondary areas (e.g., code blocks, table headers) */\n muted: string;\n /** Text on muted backgrounds (captions, footnotes, timestamps) */\n mutedForeground: string;\n /** Brand/accent color for emphasis and highlights */\n primary: string;\n /** Text on primary-colored backgrounds */\n primaryForeground: string;\n /** Table borders, dividers, rules */\n border: string;\n /** Secondary accent for call-to-action elements, badges */\n accent: string;\n /** Error text, warning indicators */\n destructive: string;\n /** Success states (e.g., badges, confirmations) */\n success: string;\n /** Warning states (e.g., badges, alerts) */\n warning: string;\n /** Info states (e.g., badges, informational alerts) */\n info: string;\n}\n\n/** Typography semantic tokens — what fonts and sizes to use where */\nexport interface TypographyTokens {\n /** Body text settings */\n body: {\n /** Font family for body text (e.g., 'Helvetica') */\n fontFamily: string;\n /** Base font size in points */\n fontSize: number;\n /** Line height multiplier */\n lineHeight: number;\n };\n /** Heading text settings */\n heading: {\n /** Font family for headings (e.g., 'Times-Roman', 'Courier') */\n fontFamily: string;\n /** Font weight as numeric value (400-700) */\n fontWeight: number;\n /** Line height multiplier for headings */\n lineHeight: number;\n /** Font sizes for each heading level in points */\n fontSize: {\n h1: number;\n h2: number;\n h3: number;\n h4: number;\n h5: number;\n h6: number;\n };\n };\n}\n\n/** Spacing semantic tokens — consistent spacing across the document */\nexport interface SpacingTokens {\n /** Page margin settings in points */\n page: {\n marginTop: number;\n marginRight: number;\n marginBottom: number;\n marginLeft: number;\n };\n /** Space between major document sections (after h2, before new sections) */\n sectionGap: number;\n /** Space between paragraphs and after text blocks */\n paragraphGap: number;\n /** Space between inline components, list items, table rows */\n componentGap: number;\n}\n\n/** Page layout defaults */\nexport interface PageTokens {\n /** Default page size */\n size: \"A4\" | \"LETTER\" | \"LEGAL\";\n /** Default page orientation */\n orientation: \"portrait\" | \"landscape\";\n}\n\n// ─── Full Theme ─────────────────────────────────────────────────────────────\n\n/**\n * The complete pdfcn theme object.\n *\n * Components import this and use its tokens for all style values.\n * Since React Context doesn't work in @react-pdf/renderer,\n * the theme is a plain TypeScript object imported directly by components.\n *\n * @example\n * ```tsx\n * // In a component:\n * import { theme } from '../lib/pdfx-theme';\n *\n * function createStyles(t: PdfcnTheme) {\n * return StyleSheet.create({\n * text: {\n * fontFamily: t.typography.body.fontFamily,\n * fontSize: t.typography.body.fontSize,\n * color: t.colors.foreground,\n * },\n * });\n * }\n *\n * const styles = createStyles(theme);\n * ```\n */\nexport interface PdfcnTheme {\n /** Theme name identifier */\n name: string;\n /** Raw design scales */\n primitives: PrimitiveTokens;\n /** Semantic color mappings */\n colors: ColorTokens;\n /** Typography settings for body and headings */\n typography: TypographyTokens;\n /** Spacing settings for page, sections, and components */\n spacing: SpacingTokens;\n /** Page layout defaults */\n page: PageTokens;\n}\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "content": "import { professionalTheme } from \"@/registry/themes\";\n\nexport const theme = professionalTheme;\n",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "type": "registry:theme"
+}
\ No newline at end of file
diff --git a/public/r/takumi/theme-modern.json b/public/r/takumi/theme-modern.json
new file mode 100644
index 0000000..f49bcfc
--- /dev/null
+++ b/public/r/takumi/theme-modern.json
@@ -0,0 +1,37 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/theme-modern",
+ "title": "Modern Theme (takumi)",
+ "description": "modern theme tokens for takumi",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "files": [
+ {
+ "path": "registry/themes/modern.ts",
+ "content": "import { defaultPrimitives } from \"./primitives\";\nimport type { PdfcnTheme } from \"./theme-types\";\n\n/**\n * Modern theme preset.\n *\n * Character: All-Helvetica, slate-cool neutrals with subtle violet accent,\n * clean spacing. shadcn-inspired contemporary feel.\n * Ideal for startups, tech companies, and design-forward documents.\n */\nexport const modernTheme: PdfcnTheme = {\n colors: {\n accent: \"#6366f1\",\n background: \"#ffffff\",\n border: \"#e2e8f0\",\n destructive: \"#ef4444\",\n foreground: \"#0f172a\",\n info: \"#3b82f6\",\n muted: \"#f1f5f9\",\n mutedForeground: \"#64748b\",\n primary: \"#334155\",\n primaryForeground: \"#ffffff\",\n success: \"#22c55e\",\n warning: \"#f59e0b\",\n },\n name: \"modern\",\n page: {\n orientation: \"portrait\",\n size: \"A4\",\n },\n primitives: defaultPrimitives,\n spacing: {\n componentGap: 12,\n page: {\n marginBottom: 40,\n marginLeft: 40,\n marginRight: 40,\n marginTop: 40,\n },\n paragraphGap: 10,\n sectionGap: 24,\n },\n typography: {\n body: {\n fontFamily: \"Helvetica\",\n fontSize: 11,\n lineHeight: 1.6,\n },\n heading: {\n fontFamily: \"Helvetica\",\n fontSize: {\n h1: 28,\n h2: 22,\n h3: 18,\n h4: 16,\n h5: 14,\n h6: 12,\n },\n fontWeight: 600,\n lineHeight: 1.25,\n },\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-modern.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "content": "import type { PrimitiveTokens } from \"./theme-types\";\n\n/**\n * Default primitive tokens shared by all theme presets.\n *\n * These define the raw design scales — the \"palette\" of values available.\n * Themes select from these scales when assigning semantic tokens.\n *\n * - Typography: Major Third (1.25) ratio, 12pt base\n * - Spacing: 4pt grid system\n * - Font weights: 400–700\n * - Line heights: 1.2–1.6\n * - Border radius: 0–8pt (plus full for pills)\n * - Letter spacing: -0.025 to 0.05 (em-like ratios for PDF points)\n */\nexport const defaultPrimitives: PrimitiveTokens = {\n borderRadius: {\n full: 9999,\n lg: 8,\n md: 4,\n none: 0,\n sm: 2,\n },\n fontWeights: {\n bold: 700,\n medium: 500,\n regular: 400,\n semibold: 600,\n },\n letterSpacing: {\n normal: 0,\n tight: -0.025,\n wide: 0.025,\n wider: 0.05,\n },\n lineHeights: {\n normal: 1.4,\n relaxed: 1.6,\n tight: 1.2,\n },\n spacing: {\n 0: 0,\n 0.5: 2,\n 1: 4,\n 10: 40,\n 12: 48,\n 16: 64,\n 2: 8,\n 3: 12,\n 4: 16,\n 5: 20,\n 6: 24,\n 8: 32,\n },\n typography: {\n \"2xl\": 28,\n \"3xl\": 36,\n base: 15,\n lg: 18,\n sm: 12,\n xl: 22,\n xs: 10,\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "content": "/**\n * pdfcn Theme System — Type Definitions\n *\n * Defines the complete type hierarchy for the pdfcn PDF theme system.\n * All PDF components consume these tokens instead of hardcoding style values.\n *\n * Architecture:\n * - PrimitiveTokens: Raw design scales (typography, spacing, weights, line heights)\n * - ColorTokens: Semantic color mappings (foreground/background pairs)\n * - TypographyTokens: Font family, size, weight, and line height decisions\n * - SpacingTokens: Page margins, section/paragraph/component gaps\n * - PageTokens: Default page size and orientation\n * - PdfcnTheme: The complete theme object combining all token layers\n *\n * @example\n * ```ts\n * import type { PdfcnTheme } from '@/registry/themes';\n *\n * const myTheme: PdfcnTheme = {\n * name: 'custom',\n * primitives: { ... },\n * colors: { foreground: '#1a1a1a', ... },\n * typography: { body: { ... }, heading: { ... } },\n * spacing: { page: { ... }, sectionGap: 24, ... },\n * page: { size: 'A4', orientation: 'portrait' },\n * };\n * ```\n */\n\n// ─── Primitive Tokens ───────────────────────────────────────────────────────\n// Raw design scales. These define WHAT values are available.\n// Themes choose from these when populating semantic tokens.\n\n/** Typography scale using a Major Third (1.25) ratio with 12pt base */\nexport interface TypographyScale {\n /** 10pt — Captions, footnotes */\n xs: number;\n /** 12pt — Body text (PDF standard) */\n sm: number;\n /** 15pt — Large body, small headings */\n base: number;\n /** 18pt — H4 equivalent */\n lg: number;\n /** 22pt — H3 equivalent */\n xl: number;\n /** 28pt — H2 equivalent */\n \"2xl\": number;\n /** 36pt — H1 equivalent */\n \"3xl\": number;\n}\n\n/** Spacing scale based on a 4pt grid system */\nexport interface SpacingScale {\n /** 0pt */\n 0: number;\n /** 2pt */\n 0.5: number;\n /** 4pt */\n 1: number;\n /** 8pt */\n 2: number;\n /** 12pt */\n 3: number;\n /** 16pt */\n 4: number;\n /** 20pt */\n 5: number;\n /** 24pt */\n 6: number;\n /** 32pt */\n 8: number;\n /** 40pt */\n 10: number;\n /** 48pt */\n 12: number;\n /** 64pt */\n 16: number;\n}\n\n/** Font weight scale */\nexport interface FontWeights {\n regular: number;\n medium: number;\n semibold: number;\n bold: number;\n}\n\n/** Line height scale */\nexport interface LineHeights {\n /** 1.2 — Tight, for headings */\n tight: number;\n /** 1.4 — Normal, for body text */\n normal: number;\n /** 1.6 — Relaxed, for reading-heavy content */\n relaxed: number;\n}\n\n/** Border radius scale for rounded corners */\nexport interface BorderRadiusScale {\n /** 0pt — Sharp corners */\n none: number;\n /** 2pt — Subtle rounding */\n sm: number;\n /** 4pt — Standard rounding */\n md: number;\n /** 8pt — Pronounced rounding */\n lg: number;\n /** 9999pt — Pill/circle shape */\n full: number;\n}\n\n/** Letter spacing scale for typography adjustments */\nexport interface LetterSpacingScale {\n /** -0.025em — Tighter spacing */\n tight: number;\n /** 0em — Normal spacing */\n normal: number;\n /** 0.025em — Slightly wider spacing */\n wide: number;\n /** 0.05em — Much wider spacing (for uppercase) */\n wider: number;\n}\n\n/** Raw design scales shared across themes */\nexport interface PrimitiveTokens {\n typography: TypographyScale;\n spacing: SpacingScale;\n fontWeights: FontWeights;\n lineHeights: LineHeights;\n borderRadius: BorderRadiusScale;\n letterSpacing: LetterSpacingScale;\n}\n\n// ─── Semantic Tokens ────────────────────────────────────────────────────────\n// These map primitives to design intent. Themes differ primarily here.\n\n/**\n * Semantic color tokens using the foreground/background pair convention.\n * All values must be hex strings (e.g., '#1a1a1a').\n * react-pdf supports hex, rgb(), and hsl() — but NOT oklch.\n */\nexport interface ColorTokens {\n /** Primary text and content color */\n foreground: string;\n /** Page background color */\n background: string;\n /** Subtle background for secondary areas (e.g., code blocks, table headers) */\n muted: string;\n /** Text on muted backgrounds (captions, footnotes, timestamps) */\n mutedForeground: string;\n /** Brand/accent color for emphasis and highlights */\n primary: string;\n /** Text on primary-colored backgrounds */\n primaryForeground: string;\n /** Table borders, dividers, rules */\n border: string;\n /** Secondary accent for call-to-action elements, badges */\n accent: string;\n /** Error text, warning indicators */\n destructive: string;\n /** Success states (e.g., badges, confirmations) */\n success: string;\n /** Warning states (e.g., badges, alerts) */\n warning: string;\n /** Info states (e.g., badges, informational alerts) */\n info: string;\n}\n\n/** Typography semantic tokens — what fonts and sizes to use where */\nexport interface TypographyTokens {\n /** Body text settings */\n body: {\n /** Font family for body text (e.g., 'Helvetica') */\n fontFamily: string;\n /** Base font size in points */\n fontSize: number;\n /** Line height multiplier */\n lineHeight: number;\n };\n /** Heading text settings */\n heading: {\n /** Font family for headings (e.g., 'Times-Roman', 'Courier') */\n fontFamily: string;\n /** Font weight as numeric value (400-700) */\n fontWeight: number;\n /** Line height multiplier for headings */\n lineHeight: number;\n /** Font sizes for each heading level in points */\n fontSize: {\n h1: number;\n h2: number;\n h3: number;\n h4: number;\n h5: number;\n h6: number;\n };\n };\n}\n\n/** Spacing semantic tokens — consistent spacing across the document */\nexport interface SpacingTokens {\n /** Page margin settings in points */\n page: {\n marginTop: number;\n marginRight: number;\n marginBottom: number;\n marginLeft: number;\n };\n /** Space between major document sections (after h2, before new sections) */\n sectionGap: number;\n /** Space between paragraphs and after text blocks */\n paragraphGap: number;\n /** Space between inline components, list items, table rows */\n componentGap: number;\n}\n\n/** Page layout defaults */\nexport interface PageTokens {\n /** Default page size */\n size: \"A4\" | \"LETTER\" | \"LEGAL\";\n /** Default page orientation */\n orientation: \"portrait\" | \"landscape\";\n}\n\n// ─── Full Theme ─────────────────────────────────────────────────────────────\n\n/**\n * The complete pdfcn theme object.\n *\n * Components import this and use its tokens for all style values.\n * Since React Context doesn't work in @react-pdf/renderer,\n * the theme is a plain TypeScript object imported directly by components.\n *\n * @example\n * ```tsx\n * // In a component:\n * import { theme } from '../lib/pdfx-theme';\n *\n * function createStyles(t: PdfcnTheme) {\n * return StyleSheet.create({\n * text: {\n * fontFamily: t.typography.body.fontFamily,\n * fontSize: t.typography.body.fontSize,\n * color: t.colors.foreground,\n * },\n * });\n * }\n *\n * const styles = createStyles(theme);\n * ```\n */\nexport interface PdfcnTheme {\n /** Theme name identifier */\n name: string;\n /** Raw design scales */\n primitives: PrimitiveTokens;\n /** Semantic color mappings */\n colors: ColorTokens;\n /** Typography settings for body and headings */\n typography: TypographyTokens;\n /** Spacing settings for page, sections, and components */\n spacing: SpacingTokens;\n /** Page layout defaults */\n page: PageTokens;\n}\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "content": "import { professionalTheme } from \"@/registry/themes\";\n\nexport const theme = professionalTheme;\n",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "type": "registry:theme"
+}
\ No newline at end of file
diff --git a/public/r/takumi/theme-professional.json b/public/r/takumi/theme-professional.json
new file mode 100644
index 0000000..b364f21
--- /dev/null
+++ b/public/r/takumi/theme-professional.json
@@ -0,0 +1,37 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/theme-professional",
+ "title": "Professional Theme (takumi)",
+ "description": "professional theme tokens for takumi",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "files": [
+ {
+ "path": "registry/themes/professional.ts",
+ "content": "import { defaultPrimitives } from \"./primitives\";\nimport type { PdfcnTheme } from \"./theme-types\";\n\n/**\n * Professional theme preset.\n *\n * Character: Serif headings (Times-Roman), refined zinc/slate palette,\n * generous margins, formal document feel. shadcn-inspired minimal aesthetic.\n * Ideal for business documents, reports, and official correspondence.\n */\nexport const professionalTheme: PdfcnTheme = {\n colors: {\n accent: \"#3b82f6\",\n background: \"#ffffff\",\n border: \"#e4e4e7\",\n destructive: \"#dc2626\",\n foreground: \"#18181b\",\n info: \"#0ea5e9\",\n muted: \"#f4f4f5\",\n mutedForeground: \"#71717a\",\n primary: \"#18181b\",\n primaryForeground: \"#ffffff\",\n success: \"#16a34a\",\n warning: \"#d97706\",\n },\n name: \"professional\",\n page: {\n orientation: \"portrait\",\n size: \"A4\",\n },\n primitives: defaultPrimitives,\n spacing: {\n componentGap: 14,\n page: {\n marginBottom: 56,\n marginLeft: 48,\n marginRight: 48,\n marginTop: 56,\n },\n paragraphGap: 10,\n sectionGap: 28,\n },\n typography: {\n body: {\n fontFamily: \"Helvetica\",\n fontSize: 11,\n lineHeight: 1.6,\n },\n heading: {\n fontFamily: \"Times-Roman\",\n fontSize: {\n h1: 32,\n h2: 24,\n h3: 20,\n h4: 16,\n h5: 14,\n h6: 12,\n },\n fontWeight: 700,\n lineHeight: 1.25,\n },\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-professional.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "content": "import type { PrimitiveTokens } from \"./theme-types\";\n\n/**\n * Default primitive tokens shared by all theme presets.\n *\n * These define the raw design scales — the \"palette\" of values available.\n * Themes select from these scales when assigning semantic tokens.\n *\n * - Typography: Major Third (1.25) ratio, 12pt base\n * - Spacing: 4pt grid system\n * - Font weights: 400–700\n * - Line heights: 1.2–1.6\n * - Border radius: 0–8pt (plus full for pills)\n * - Letter spacing: -0.025 to 0.05 (em-like ratios for PDF points)\n */\nexport const defaultPrimitives: PrimitiveTokens = {\n borderRadius: {\n full: 9999,\n lg: 8,\n md: 4,\n none: 0,\n sm: 2,\n },\n fontWeights: {\n bold: 700,\n medium: 500,\n regular: 400,\n semibold: 600,\n },\n letterSpacing: {\n normal: 0,\n tight: -0.025,\n wide: 0.025,\n wider: 0.05,\n },\n lineHeights: {\n normal: 1.4,\n relaxed: 1.6,\n tight: 1.2,\n },\n spacing: {\n 0: 0,\n 0.5: 2,\n 1: 4,\n 10: 40,\n 12: 48,\n 16: 64,\n 2: 8,\n 3: 12,\n 4: 16,\n 5: 20,\n 6: 24,\n 8: 32,\n },\n typography: {\n \"2xl\": 28,\n \"3xl\": 36,\n base: 15,\n lg: 18,\n sm: 12,\n xl: 22,\n xs: 10,\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "content": "/**\n * pdfcn Theme System — Type Definitions\n *\n * Defines the complete type hierarchy for the pdfcn PDF theme system.\n * All PDF components consume these tokens instead of hardcoding style values.\n *\n * Architecture:\n * - PrimitiveTokens: Raw design scales (typography, spacing, weights, line heights)\n * - ColorTokens: Semantic color mappings (foreground/background pairs)\n * - TypographyTokens: Font family, size, weight, and line height decisions\n * - SpacingTokens: Page margins, section/paragraph/component gaps\n * - PageTokens: Default page size and orientation\n * - PdfcnTheme: The complete theme object combining all token layers\n *\n * @example\n * ```ts\n * import type { PdfcnTheme } from '@/registry/themes';\n *\n * const myTheme: PdfcnTheme = {\n * name: 'custom',\n * primitives: { ... },\n * colors: { foreground: '#1a1a1a', ... },\n * typography: { body: { ... }, heading: { ... } },\n * spacing: { page: { ... }, sectionGap: 24, ... },\n * page: { size: 'A4', orientation: 'portrait' },\n * };\n * ```\n */\n\n// ─── Primitive Tokens ───────────────────────────────────────────────────────\n// Raw design scales. These define WHAT values are available.\n// Themes choose from these when populating semantic tokens.\n\n/** Typography scale using a Major Third (1.25) ratio with 12pt base */\nexport interface TypographyScale {\n /** 10pt — Captions, footnotes */\n xs: number;\n /** 12pt — Body text (PDF standard) */\n sm: number;\n /** 15pt — Large body, small headings */\n base: number;\n /** 18pt — H4 equivalent */\n lg: number;\n /** 22pt — H3 equivalent */\n xl: number;\n /** 28pt — H2 equivalent */\n \"2xl\": number;\n /** 36pt — H1 equivalent */\n \"3xl\": number;\n}\n\n/** Spacing scale based on a 4pt grid system */\nexport interface SpacingScale {\n /** 0pt */\n 0: number;\n /** 2pt */\n 0.5: number;\n /** 4pt */\n 1: number;\n /** 8pt */\n 2: number;\n /** 12pt */\n 3: number;\n /** 16pt */\n 4: number;\n /** 20pt */\n 5: number;\n /** 24pt */\n 6: number;\n /** 32pt */\n 8: number;\n /** 40pt */\n 10: number;\n /** 48pt */\n 12: number;\n /** 64pt */\n 16: number;\n}\n\n/** Font weight scale */\nexport interface FontWeights {\n regular: number;\n medium: number;\n semibold: number;\n bold: number;\n}\n\n/** Line height scale */\nexport interface LineHeights {\n /** 1.2 — Tight, for headings */\n tight: number;\n /** 1.4 — Normal, for body text */\n normal: number;\n /** 1.6 — Relaxed, for reading-heavy content */\n relaxed: number;\n}\n\n/** Border radius scale for rounded corners */\nexport interface BorderRadiusScale {\n /** 0pt — Sharp corners */\n none: number;\n /** 2pt — Subtle rounding */\n sm: number;\n /** 4pt — Standard rounding */\n md: number;\n /** 8pt — Pronounced rounding */\n lg: number;\n /** 9999pt — Pill/circle shape */\n full: number;\n}\n\n/** Letter spacing scale for typography adjustments */\nexport interface LetterSpacingScale {\n /** -0.025em — Tighter spacing */\n tight: number;\n /** 0em — Normal spacing */\n normal: number;\n /** 0.025em — Slightly wider spacing */\n wide: number;\n /** 0.05em — Much wider spacing (for uppercase) */\n wider: number;\n}\n\n/** Raw design scales shared across themes */\nexport interface PrimitiveTokens {\n typography: TypographyScale;\n spacing: SpacingScale;\n fontWeights: FontWeights;\n lineHeights: LineHeights;\n borderRadius: BorderRadiusScale;\n letterSpacing: LetterSpacingScale;\n}\n\n// ─── Semantic Tokens ────────────────────────────────────────────────────────\n// These map primitives to design intent. Themes differ primarily here.\n\n/**\n * Semantic color tokens using the foreground/background pair convention.\n * All values must be hex strings (e.g., '#1a1a1a').\n * react-pdf supports hex, rgb(), and hsl() — but NOT oklch.\n */\nexport interface ColorTokens {\n /** Primary text and content color */\n foreground: string;\n /** Page background color */\n background: string;\n /** Subtle background for secondary areas (e.g., code blocks, table headers) */\n muted: string;\n /** Text on muted backgrounds (captions, footnotes, timestamps) */\n mutedForeground: string;\n /** Brand/accent color for emphasis and highlights */\n primary: string;\n /** Text on primary-colored backgrounds */\n primaryForeground: string;\n /** Table borders, dividers, rules */\n border: string;\n /** Secondary accent for call-to-action elements, badges */\n accent: string;\n /** Error text, warning indicators */\n destructive: string;\n /** Success states (e.g., badges, confirmations) */\n success: string;\n /** Warning states (e.g., badges, alerts) */\n warning: string;\n /** Info states (e.g., badges, informational alerts) */\n info: string;\n}\n\n/** Typography semantic tokens — what fonts and sizes to use where */\nexport interface TypographyTokens {\n /** Body text settings */\n body: {\n /** Font family for body text (e.g., 'Helvetica') */\n fontFamily: string;\n /** Base font size in points */\n fontSize: number;\n /** Line height multiplier */\n lineHeight: number;\n };\n /** Heading text settings */\n heading: {\n /** Font family for headings (e.g., 'Times-Roman', 'Courier') */\n fontFamily: string;\n /** Font weight as numeric value (400-700) */\n fontWeight: number;\n /** Line height multiplier for headings */\n lineHeight: number;\n /** Font sizes for each heading level in points */\n fontSize: {\n h1: number;\n h2: number;\n h3: number;\n h4: number;\n h5: number;\n h6: number;\n };\n };\n}\n\n/** Spacing semantic tokens — consistent spacing across the document */\nexport interface SpacingTokens {\n /** Page margin settings in points */\n page: {\n marginTop: number;\n marginRight: number;\n marginBottom: number;\n marginLeft: number;\n };\n /** Space between major document sections (after h2, before new sections) */\n sectionGap: number;\n /** Space between paragraphs and after text blocks */\n paragraphGap: number;\n /** Space between inline components, list items, table rows */\n componentGap: number;\n}\n\n/** Page layout defaults */\nexport interface PageTokens {\n /** Default page size */\n size: \"A4\" | \"LETTER\" | \"LEGAL\";\n /** Default page orientation */\n orientation: \"portrait\" | \"landscape\";\n}\n\n// ─── Full Theme ─────────────────────────────────────────────────────────────\n\n/**\n * The complete pdfcn theme object.\n *\n * Components import this and use its tokens for all style values.\n * Since React Context doesn't work in @react-pdf/renderer,\n * the theme is a plain TypeScript object imported directly by components.\n *\n * @example\n * ```tsx\n * // In a component:\n * import { theme } from '../lib/pdfx-theme';\n *\n * function createStyles(t: PdfcnTheme) {\n * return StyleSheet.create({\n * text: {\n * fontFamily: t.typography.body.fontFamily,\n * fontSize: t.typography.body.fontSize,\n * color: t.colors.foreground,\n * },\n * });\n * }\n *\n * const styles = createStyles(theme);\n * ```\n */\nexport interface PdfcnTheme {\n /** Theme name identifier */\n name: string;\n /** Raw design scales */\n primitives: PrimitiveTokens;\n /** Semantic color mappings */\n colors: ColorTokens;\n /** Typography settings for body and headings */\n typography: TypographyTokens;\n /** Spacing settings for page, sections, and components */\n spacing: SpacingTokens;\n /** Page layout defaults */\n page: PageTokens;\n}\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "content": "import { professionalTheme } from \"@/registry/themes\";\n\nexport const theme = professionalTheme;\n",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "type": "registry:theme"
+}
\ No newline at end of file
diff --git a/public/r/takumi/theme-vivid.json b/public/r/takumi/theme-vivid.json
new file mode 100644
index 0000000..5e37b15
--- /dev/null
+++ b/public/r/takumi/theme-vivid.json
@@ -0,0 +1,37 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/theme-vivid",
+ "title": "Vivid Theme (takumi)",
+ "description": "vivid theme tokens for takumi",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "files": [
+ {
+ "path": "registry/themes/vivid.ts",
+ "content": "import { defaultPrimitives } from \"./primitives\";\nimport type { PdfcnTheme } from \"./theme-types\";\n\n/**\n * Vivid theme preset.\n *\n * Character: Deep violet/purple palette, Nunito rounded sans-serif, playful\n * but still professional. High-energy creative accent.\n * Ideal for creative agencies, startups, marketing decks, and pitch docs.\n */\nexport const vividTheme: PdfcnTheme = {\n colors: {\n accent: \"#8b5cf6\",\n background: \"#ffffff\",\n border: \"#ddd6fe\",\n destructive: \"#dc2626\",\n foreground: \"#1e1b4b\",\n info: \"#0ea5e9\",\n muted: \"#f5f3ff\",\n mutedForeground: \"#7c3aed\",\n primary: \"#6d28d9\",\n primaryForeground: \"#ffffff\",\n success: \"#16a34a\",\n warning: \"#d97706\",\n },\n name: \"vivid\",\n page: {\n orientation: \"portrait\",\n size: \"A4\",\n },\n primitives: defaultPrimitives,\n spacing: {\n componentGap: 14,\n page: {\n marginBottom: 48,\n marginLeft: 44,\n marginRight: 44,\n marginTop: 48,\n },\n paragraphGap: 10,\n sectionGap: 26,\n },\n typography: {\n body: {\n fontFamily: \"Nunito\",\n fontSize: 11,\n lineHeight: 1.6,\n },\n heading: {\n fontFamily: \"Nunito\",\n fontSize: {\n h1: 32,\n h2: 24,\n h3: 19,\n h4: 16,\n h5: 14,\n h6: 12,\n },\n fontWeight: 700,\n lineHeight: 1.2,\n },\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-vivid.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "content": "import type { PrimitiveTokens } from \"./theme-types\";\n\n/**\n * Default primitive tokens shared by all theme presets.\n *\n * These define the raw design scales — the \"palette\" of values available.\n * Themes select from these scales when assigning semantic tokens.\n *\n * - Typography: Major Third (1.25) ratio, 12pt base\n * - Spacing: 4pt grid system\n * - Font weights: 400–700\n * - Line heights: 1.2–1.6\n * - Border radius: 0–8pt (plus full for pills)\n * - Letter spacing: -0.025 to 0.05 (em-like ratios for PDF points)\n */\nexport const defaultPrimitives: PrimitiveTokens = {\n borderRadius: {\n full: 9999,\n lg: 8,\n md: 4,\n none: 0,\n sm: 2,\n },\n fontWeights: {\n bold: 700,\n medium: 500,\n regular: 400,\n semibold: 600,\n },\n letterSpacing: {\n normal: 0,\n tight: -0.025,\n wide: 0.025,\n wider: 0.05,\n },\n lineHeights: {\n normal: 1.4,\n relaxed: 1.6,\n tight: 1.2,\n },\n spacing: {\n 0: 0,\n 0.5: 2,\n 1: 4,\n 10: 40,\n 12: 48,\n 16: 64,\n 2: 8,\n 3: 12,\n 4: 16,\n 5: 20,\n 6: 24,\n 8: 32,\n },\n typography: {\n \"2xl\": 28,\n \"3xl\": 36,\n base: 15,\n lg: 18,\n sm: 12,\n xl: 22,\n xs: 10,\n },\n};\n",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "content": "/**\n * pdfcn Theme System — Type Definitions\n *\n * Defines the complete type hierarchy for the pdfcn PDF theme system.\n * All PDF components consume these tokens instead of hardcoding style values.\n *\n * Architecture:\n * - PrimitiveTokens: Raw design scales (typography, spacing, weights, line heights)\n * - ColorTokens: Semantic color mappings (foreground/background pairs)\n * - TypographyTokens: Font family, size, weight, and line height decisions\n * - SpacingTokens: Page margins, section/paragraph/component gaps\n * - PageTokens: Default page size and orientation\n * - PdfcnTheme: The complete theme object combining all token layers\n *\n * @example\n * ```ts\n * import type { PdfcnTheme } from '@/registry/themes';\n *\n * const myTheme: PdfcnTheme = {\n * name: 'custom',\n * primitives: { ... },\n * colors: { foreground: '#1a1a1a', ... },\n * typography: { body: { ... }, heading: { ... } },\n * spacing: { page: { ... }, sectionGap: 24, ... },\n * page: { size: 'A4', orientation: 'portrait' },\n * };\n * ```\n */\n\n// ─── Primitive Tokens ───────────────────────────────────────────────────────\n// Raw design scales. These define WHAT values are available.\n// Themes choose from these when populating semantic tokens.\n\n/** Typography scale using a Major Third (1.25) ratio with 12pt base */\nexport interface TypographyScale {\n /** 10pt — Captions, footnotes */\n xs: number;\n /** 12pt — Body text (PDF standard) */\n sm: number;\n /** 15pt — Large body, small headings */\n base: number;\n /** 18pt — H4 equivalent */\n lg: number;\n /** 22pt — H3 equivalent */\n xl: number;\n /** 28pt — H2 equivalent */\n \"2xl\": number;\n /** 36pt — H1 equivalent */\n \"3xl\": number;\n}\n\n/** Spacing scale based on a 4pt grid system */\nexport interface SpacingScale {\n /** 0pt */\n 0: number;\n /** 2pt */\n 0.5: number;\n /** 4pt */\n 1: number;\n /** 8pt */\n 2: number;\n /** 12pt */\n 3: number;\n /** 16pt */\n 4: number;\n /** 20pt */\n 5: number;\n /** 24pt */\n 6: number;\n /** 32pt */\n 8: number;\n /** 40pt */\n 10: number;\n /** 48pt */\n 12: number;\n /** 64pt */\n 16: number;\n}\n\n/** Font weight scale */\nexport interface FontWeights {\n regular: number;\n medium: number;\n semibold: number;\n bold: number;\n}\n\n/** Line height scale */\nexport interface LineHeights {\n /** 1.2 — Tight, for headings */\n tight: number;\n /** 1.4 — Normal, for body text */\n normal: number;\n /** 1.6 — Relaxed, for reading-heavy content */\n relaxed: number;\n}\n\n/** Border radius scale for rounded corners */\nexport interface BorderRadiusScale {\n /** 0pt — Sharp corners */\n none: number;\n /** 2pt — Subtle rounding */\n sm: number;\n /** 4pt — Standard rounding */\n md: number;\n /** 8pt — Pronounced rounding */\n lg: number;\n /** 9999pt — Pill/circle shape */\n full: number;\n}\n\n/** Letter spacing scale for typography adjustments */\nexport interface LetterSpacingScale {\n /** -0.025em — Tighter spacing */\n tight: number;\n /** 0em — Normal spacing */\n normal: number;\n /** 0.025em — Slightly wider spacing */\n wide: number;\n /** 0.05em — Much wider spacing (for uppercase) */\n wider: number;\n}\n\n/** Raw design scales shared across themes */\nexport interface PrimitiveTokens {\n typography: TypographyScale;\n spacing: SpacingScale;\n fontWeights: FontWeights;\n lineHeights: LineHeights;\n borderRadius: BorderRadiusScale;\n letterSpacing: LetterSpacingScale;\n}\n\n// ─── Semantic Tokens ────────────────────────────────────────────────────────\n// These map primitives to design intent. Themes differ primarily here.\n\n/**\n * Semantic color tokens using the foreground/background pair convention.\n * All values must be hex strings (e.g., '#1a1a1a').\n * react-pdf supports hex, rgb(), and hsl() — but NOT oklch.\n */\nexport interface ColorTokens {\n /** Primary text and content color */\n foreground: string;\n /** Page background color */\n background: string;\n /** Subtle background for secondary areas (e.g., code blocks, table headers) */\n muted: string;\n /** Text on muted backgrounds (captions, footnotes, timestamps) */\n mutedForeground: string;\n /** Brand/accent color for emphasis and highlights */\n primary: string;\n /** Text on primary-colored backgrounds */\n primaryForeground: string;\n /** Table borders, dividers, rules */\n border: string;\n /** Secondary accent for call-to-action elements, badges */\n accent: string;\n /** Error text, warning indicators */\n destructive: string;\n /** Success states (e.g., badges, confirmations) */\n success: string;\n /** Warning states (e.g., badges, alerts) */\n warning: string;\n /** Info states (e.g., badges, informational alerts) */\n info: string;\n}\n\n/** Typography semantic tokens — what fonts and sizes to use where */\nexport interface TypographyTokens {\n /** Body text settings */\n body: {\n /** Font family for body text (e.g., 'Helvetica') */\n fontFamily: string;\n /** Base font size in points */\n fontSize: number;\n /** Line height multiplier */\n lineHeight: number;\n };\n /** Heading text settings */\n heading: {\n /** Font family for headings (e.g., 'Times-Roman', 'Courier') */\n fontFamily: string;\n /** Font weight as numeric value (400-700) */\n fontWeight: number;\n /** Line height multiplier for headings */\n lineHeight: number;\n /** Font sizes for each heading level in points */\n fontSize: {\n h1: number;\n h2: number;\n h3: number;\n h4: number;\n h5: number;\n h6: number;\n };\n };\n}\n\n/** Spacing semantic tokens — consistent spacing across the document */\nexport interface SpacingTokens {\n /** Page margin settings in points */\n page: {\n marginTop: number;\n marginRight: number;\n marginBottom: number;\n marginLeft: number;\n };\n /** Space between major document sections (after h2, before new sections) */\n sectionGap: number;\n /** Space between paragraphs and after text blocks */\n paragraphGap: number;\n /** Space between inline components, list items, table rows */\n componentGap: number;\n}\n\n/** Page layout defaults */\nexport interface PageTokens {\n /** Default page size */\n size: \"A4\" | \"LETTER\" | \"LEGAL\";\n /** Default page orientation */\n orientation: \"portrait\" | \"landscape\";\n}\n\n// ─── Full Theme ─────────────────────────────────────────────────────────────\n\n/**\n * The complete pdfcn theme object.\n *\n * Components import this and use its tokens for all style values.\n * Since React Context doesn't work in @react-pdf/renderer,\n * the theme is a plain TypeScript object imported directly by components.\n *\n * @example\n * ```tsx\n * // In a component:\n * import { theme } from '../lib/pdfx-theme';\n *\n * function createStyles(t: PdfcnTheme) {\n * return StyleSheet.create({\n * text: {\n * fontFamily: t.typography.body.fontFamily,\n * fontSize: t.typography.body.fontSize,\n * color: t.colors.foreground,\n * },\n * });\n * }\n *\n * const styles = createStyles(theme);\n * ```\n */\nexport interface PdfcnTheme {\n /** Theme name identifier */\n name: string;\n /** Raw design scales */\n primitives: PrimitiveTokens;\n /** Semantic color mappings */\n colors: ColorTokens;\n /** Typography settings for body and headings */\n typography: TypographyTokens;\n /** Spacing settings for page, sections, and components */\n spacing: SpacingTokens;\n /** Page layout defaults */\n page: PageTokens;\n}\n",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "content": "import { professionalTheme } from \"@/registry/themes\";\n\nexport const theme = professionalTheme;\n",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "type": "registry:theme"
+}
\ No newline at end of file
diff --git a/public/r/takumi/utils.json b/public/r/takumi/utils.json
new file mode 100644
index 0000000..680a835
--- /dev/null
+++ b/public/r/takumi/utils.json
@@ -0,0 +1,38 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/utils",
+ "title": "Takumi Utils",
+ "description": "Theme context and helpers for the takumi base",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "content": "import { professionalTheme } from \"@/registry/themes\";\n\nexport const theme = professionalTheme;\n",
+ "type": "registry:lib"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme-context.tsx",
+ "content": "/* eslint-disable react-refresh/only-export-components */\n// Exports both a component (PdfcnThemeProvider) and hooks/context intentionally.\n// All PDF components import from a single file — splitting would break the public API.\n\nimport * as React from \"react\";\nimport { createContext, useContext, useMemo } from 'react';\nimport type { DependencyList, ReactNode } from 'react';\n\nimport { theme as defaultTheme } from \"./pdfcn-theme\";\n\nexport type PdfcnTheme = typeof defaultTheme;\n\nexport const PdfcnThemeContext = createContext<PdfcnTheme>(defaultTheme);\n\nexport interface PdfcnThemeProviderProps {\n theme?: PdfcnTheme;\n children: ReactNode;\n}\n\n/**\n * Detect whether React currently has an active dispatcher.\n * When components are invoked as plain functions in tests, dispatcher is null.\n */\nfunction hasActiveDispatcher(): boolean {\n const maybeInternals = React as unknown as {\n __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE?: {\n H?: unknown;\n };\n };\n\n const dispatcher =\n maybeInternals\n .__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE?.H;\n return dispatcher != null;\n}\n\nexport function PdfcnThemeProvider({\n theme,\n children,\n}: PdfcnThemeProviderProps) {\n const resolvedTheme = useMemo(() => theme ?? defaultTheme, [theme]);\n return (\n <PdfcnThemeContext.Provider value={resolvedTheme}>\n {children}\n </PdfcnThemeContext.Provider>\n );\n}\n\n/**\n * Regex patterns that indicate a hook was called outside a valid React render tree.\n * These errors are caught and suppressed so components fall back to safe defaults.\n */\nconst HOOK_ERROR_PATTERNS =\n /invalid hook call|useContext|useMemo|cannot read properties of null|dispatcher|renderWithHooks|resolveDispatcher|hooks can only be called|rendered fewer hooks/i;\n\n/**\n * Calls a React hook with a graceful fallback for non-render environments (e.g. unit tests).\n * Uses hasActiveDispatcher() as the primary guard; the try/catch is a safety net for edge\n * cases where the dispatcher check passes but the hook still cannot execute.\n */\nfunction callHook<T>(hook: () => T, fallback: T): T {\n if (!hasActiveDispatcher()) {return fallback;}\n try {\n return hook();\n } catch (error) {\n if (error instanceof Error && HOOK_ERROR_PATTERNS.test(error.message))\n {return fallback;}\n throw error;\n }\n}\n\n/**\n * Returns the active PdfcnTheme from context, or the default theme when called\n * outside a React render tree (e.g. unit tests).\n */\nexport function usePdfcnTheme(): PdfcnTheme {\n return callHook(() => useContext(PdfcnThemeContext), defaultTheme);\n}\n\n/**\n * Calls factory() and returns the result.\n * The deps parameter is accepted for API compatibility with existing callers.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function useSafeMemo<T>(factory: () => T, _deps: DependencyList): T {\n return factory();\n}\n",
+ "type": "registry:lib"
+ },
+ {
+ "path": "registry/bases/takumi/lib/resolve-color.ts",
+ "content": "import type { ColorTokens } from \"@/registry/themes\";\n\n/** Theme color token keys that can be used for the color prop */\nexport const THEME_COLOR_KEYS = [\n \"foreground\",\n \"background\",\n \"muted\",\n \"mutedForeground\",\n \"primary\",\n \"primaryForeground\",\n \"border\",\n \"accent\",\n \"destructive\",\n \"success\",\n \"warning\",\n \"info\",\n] as const satisfies (keyof ColorTokens)[];\n\n/** Resolves a color value: theme token key → hex, or raw CSS color as-is. */\nexport function resolveColor(value: string, colors: ColorTokens): string {\n const key = value as (typeof THEME_COLOR_KEYS)[number];\n return THEME_COLOR_KEYS.includes(key) ? colors[key] : value;\n}\n",
+ "type": "registry:lib"
+ },
+ {
+ "path": "registry/bases/takumi/lib/takumi-primitives.tsx",
+ "content": "import type { ReactNode, ImgHTMLAttributes, AnchorHTMLAttributes } from \"react\";\n\nexport type Style = Record<string, unknown>;\n\nexport const StyleSheet = {\n create<T extends Record<string, Style>>(styles: T): T {\n return styles;\n },\n};\n\ntype StyleInput = Style | Style[] | false | null | undefined;\n\ninterface ViewProps {\n children?: ReactNode;\n style?: StyleInput;\n className?: string;\n wrap?: boolean;\n fixed?: boolean;\n break?: boolean;\n minPresenceAhead?: number;\n}\n\nfunction flatten(style?: StyleInput): Record<string, unknown> | undefined {\n if (!style) {return undefined;}\n if (Array.isArray(style)) {\n return Object.assign({}, ...style.filter(Boolean));\n }\n return style;\n}\n\nexport function View({ children, style, className, ...rest }: ViewProps) {\n const {\n wrap: _w,\n fixed: _f,\n break: br,\n minPresenceAhead: _m,\n ...dom\n } = rest as ViewProps & Record<string, unknown>;\n const merged = flatten(style) ?? {};\n if (br) {Object.assign(merged, { breakBefore: \"page\" });}\n return (\n <div\n className={className}\n style={merged as React.CSSProperties}\n {...(dom as object)}\n >\n {children}\n </div>\n );\n}\n\ninterface TextProps {\n children?: ReactNode;\n style?: StyleInput;\n className?: string;\n render?: (info: { pageNumber: number; totalPages: number }) => ReactNode;\n fixed?: boolean;\n href?: string;\n src?: string;\n}\n\nexport function Text({\n children,\n style,\n className,\n render: _render,\n href,\n src,\n ...rest\n}: TextProps) {\n const merged = flatten(style) as React.CSSProperties | undefined;\n const link = href ?? src;\n if (link) {\n return (\n <a href={link} className={className} style={merged} {...(rest as object)}>\n {children}\n </a>\n );\n }\n return (\n <span className={className} style={merged} {...(rest as object)}>\n {children}\n </span>\n );\n}\n\nexport function Image({\n src,\n style,\n ...rest\n}: {\n src: string | { uri: string };\n style?: StyleInput;\n} & Omit<ImgHTMLAttributes<HTMLImageElement>, \"src\" | \"style\">) {\n const resolved = typeof src === \"string\" ? src : src.uri;\n return (\n <img\n src={resolved}\n style={flatten(style) as React.CSSProperties}\n alt=\"\"\n {...rest}\n />\n );\n}\n\nexport function Link({\n src,\n children,\n style,\n ...rest\n}: {\n src: string;\n children?: ReactNode;\n style?: StyleInput;\n} & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, \"href\" | \"style\">) {\n return (\n <a href={src} style={flatten(style) as React.CSSProperties} {...rest}>\n {children}\n </a>\n );\n}\n\nexport function Document({\n children,\n title,\n style,\n}: {\n children?: ReactNode;\n title?: string;\n style?: StyleInput;\n}) {\n return (\n <div\n data-pdf-document={title}\n style={flatten(style) as React.CSSProperties}\n >\n {children}\n </div>\n );\n}\n\nexport function Page({\n children,\n size: _size,\n style,\n}: {\n children?: ReactNode;\n size?: string | { width: number; height: number };\n style?: StyleInput;\n}) {\n return (\n <div data-pdf-page style={flatten(style) as React.CSSProperties}>\n {children}\n </div>\n );\n}\n",
+ "type": "registry:lib"
+ },
+ {
+ "path": "registry/bases/takumi/lib/takumi-svg.tsx",
+ "content": "import type { CSSProperties, ReactNode, SVGProps } from \"react\";\n\nexport function Svg({\n children,\n style,\n ...rest\n}: SVGProps<SVGSVGElement> & { style?: CSSProperties }) {\n return (\n <svg style={style} {...rest}>\n {children}\n </svg>\n );\n}\n\nexport function Rect(props: SVGProps<SVGRectElement>) {\n return <rect {...props} />;\n}\nexport function Circle(props: SVGProps<SVGCircleElement>) {\n return <circle {...props} />;\n}\nexport function G(props: SVGProps<SVGGElement>) {\n return <g {...props} />;\n}\nexport function Line(props: SVGProps<SVGLineElement>) {\n return <line {...props} />;\n}\nexport function Path(props: SVGProps<SVGPathElement>) {\n return <path {...props} />;\n}\nexport function SvgText({\n children,\n style,\n ...rest\n}: SVGProps<SVGTextElement> & { children?: ReactNode; style?: CSSProperties }) {\n return (\n <text style={style} {...rest}>\n {children}\n </text>\n );\n}\n",
+ "type": "registry:lib"
+ }
+ ],
+ "type": "registry:lib"
+}
\ No newline at end of file
diff --git a/public/r/takumi/watermark.json b/public/r/takumi/watermark.json
new file mode 100644
index 0000000..22e15a9
--- /dev/null
+++ b/public/r/takumi/watermark.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "takumi/watermark",
+ "title": "Watermark",
+ "description": "Watermark PDF component (takumi)",
+ "dependencies": [
+ "takumi-pdf",
+ "@takumi-rs/helpers"
+ ],
+ "registryDependencies": [
+ "takumi/utils"
+ ],
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/watermark/watermark.tsx",
+ "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type WatermarkPosition =\n | \"center\"\n | \"top-left\"\n | \"top-right\"\n | \"bottom-left\"\n | \"bottom-right\";\n\n/**\n * Diagonal watermark overlaid across the full page using absolute positioning.\n * Props - `text` | `opacity` | `fontSize` | `color` | `angle` | `position` | `fixed` | `style`\n * @see {@link PdfWatermarkProps}\n */\nexport interface PdfWatermarkProps extends Omit<PDFComponentProps, \"children\"> {\n text: string;\n opacity?: number;\n fontSize?: number;\n color?: string;\n angle?: number;\n position?: WatermarkPosition;\n /**\n * @default true\n */\n fixed?: boolean;\n children?: never;\n}\n\nfunction createWatermarkStyles(t: PdfcnTheme) {\n const { fontWeights } = t.primitives;\n // Use page margins as corner insets so watermark position adapts to the active theme.\n const { marginTop, marginBottom, marginLeft, marginRight } = t.spacing.page;\n return StyleSheet.create({\n container: {\n alignItems: \"center\",\n bottom: 0,\n justifyContent: \"center\",\n left: 0,\n pointerEvents: \"none\",\n position: \"absolute\",\n right: 0,\n top: 0,\n zIndex: -1,\n },\n positionBottomLeft: {\n alignItems: \"flex-start\",\n justifyContent: \"flex-end\",\n paddingBottom: marginBottom,\n paddingLeft: marginLeft,\n },\n positionBottomRight: {\n alignItems: \"flex-end\",\n justifyContent: \"flex-end\",\n paddingBottom: marginBottom,\n paddingRight: marginRight,\n },\n positionCenter: { alignItems: \"center\", justifyContent: \"center\" },\n positionTopLeft: {\n alignItems: \"flex-start\",\n justifyContent: \"flex-start\",\n paddingLeft: marginLeft,\n paddingTop: marginTop,\n },\n positionTopRight: {\n alignItems: \"flex-end\",\n justifyContent: \"flex-start\",\n paddingRight: marginRight,\n paddingTop: marginTop,\n },\n text: {\n fontFamily: t.typography.heading.fontFamily,\n fontWeight: fontWeights.bold,\n letterSpacing: 4,\n textTransform: \"uppercase\",\n },\n });\n}\n\nexport function PdfWatermark({\n text,\n opacity = 0.15,\n fontSize = 60,\n color = \"mutedForeground\",\n angle = -45,\n position = \"center\",\n fixed = true,\n style,\n}: PdfWatermarkProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createWatermarkStyles(theme), [theme]);\n const positionMap: Record<WatermarkPosition, Style> = {\n \"bottom-left\": styles.positionBottomLeft,\n \"bottom-right\": styles.positionBottomRight,\n center: styles.positionCenter,\n \"top-left\": styles.positionTopLeft,\n \"top-right\": styles.positionTopRight,\n };\n const containerStyles: Style[] = [styles.container, positionMap[position]];\n if (style) {containerStyles.push(...[style].flat());}\n const textStyles: Style[] = [\n styles.text,\n {\n color: resolveColor(color, theme.colors),\n fontSize,\n opacity,\n transform: `rotate(${angle}deg)`,\n },\n ];\n return (\n <View style={containerStyles}>\n <PDFText style={textStyles}>{text}</PDFText>\n </View>\n );\n}\n",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/watermark/index.ts",
+ "content": "export {\n PdfWatermark,\n type PdfWatermarkProps,\n type WatermarkPosition,\n} from \"./watermark\";\n",
+ "type": "registry:component"
+ }
+ ],
+ "type": "registry:ui"
+}
\ No newline at end of file
diff --git a/public/r/your-component.json b/public/r/your-component.json
deleted file mode 100644
index a8ce6af..0000000
--- a/public/r/your-component.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "$schema": "https://ui.shadcn.com/schema/registry-item.json",
- "name": "your-component",
- "title": "Your Component",
- "description": "A placeholder component. Replace this with your custom shadcn component.",
- "files": [
- {
- "path": "registry/new-york/your-component.tsx",
- "content": "import type { HTMLAttributes } from \"react\";\nimport { forwardRef } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nexport type YourComponentProps = HTMLAttributes<HTMLDivElement>;\n\n/**\n * 🚀 YOUR COMPONENT TEMPLATE\n *\n * This is a placeholder component. Replace this with your actual component implementation.\n *\n * Steps to customize:\n * 1. Rename this file to match your component name (e.g., my-button.tsx)\n * 2. Update the component logic and props\n * 3. Update registry.json with your component details\n * 4. Run `pnpm registry:build` to rebuild the registry\n *\n * For more information, visit the documentation.\n */\nconst YourComponent = forwardRef<HTMLDivElement, YourComponentProps>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n \"p-4 rounded-md text-center bg-muted/20 space-y-2 border border-muted h-48 flex items-center flex-col justify-center\",\n className\n )}\n {...props}\n >\n <p className=\"text-sm text-muted-foreground/70\">\n Replace this placeholder with your custom shadcn component\n </p>\n <p className=\"text-muted-foreground text-center text-xs\">\n Edit{\" \"}\n <code className=\"bg-muted rounded px-1.5 py-0.5 text-xs\">\n registry/new-york/your-component.tsx\n </code>{\" \"}\n to get started\n </p>\n </div>\n )\n);\n\nYourComponent.displayName = \"YourComponent\";\n\nexport { YourComponent };\n",
- "type": "registry:ui",
- "target": "components/ui/your-component.tsx"
- }
- ],
- "type": "registry:ui"
-}
\ No newline at end of file
diff --git a/registry.json b/registry.json
index 7359846..03d2aba 100644
--- a/registry.json
+++ b/registry.json
@@ -1,19 +1,1931 @@
{
- "name": "startercn",
- "homepage": "https://github.com/shadcn-labs/startercn",
+ "$schema": "https://ui.shadcn.com/schema/registry.json",
+ "name": "pdfcn",
+ "homepage": "https://pdfcn.vercel.app",
"items": [
{
- "name": "your-component",
+ "name": "takumi/utils",
+ "type": "registry:lib",
+ "title": "Takumi Utils",
+ "description": "Theme context and helpers for the takumi base",
+ "files": [
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "type": "registry:lib"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme-context.tsx",
+ "type": "registry:lib"
+ },
+ {
+ "path": "registry/bases/takumi/lib/resolve-color.ts",
+ "type": "registry:lib"
+ },
+ {
+ "path": "registry/bases/takumi/lib/takumi-primitives.tsx",
+ "type": "registry:lib"
+ },
+ {
+ "path": "registry/bases/takumi/lib/takumi-svg.tsx",
+ "type": "registry:lib"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]
+ },
+ {
+ "name": "takumi/alert",
+ "type": "registry:ui",
+ "title": "Alert",
+ "description": "Alert PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/alert/alert.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/alert/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/badge",
+ "type": "registry:ui",
+ "title": "Badge",
+ "description": "Badge PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/badge/badge.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/badge/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/card",
+ "type": "registry:ui",
+ "title": "Card",
+ "description": "Card PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/card/card.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/card/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/data-table",
+ "type": "registry:ui",
+ "title": "Data Table",
+ "description": "Data Table PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/data-table/data-table.styles.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/data-table/data-table.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/data-table/data-table.types.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/data-table/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils", "takumi/table"]
+ },
+ {
+ "name": "takumi/divider",
+ "type": "registry:ui",
+ "title": "Divider",
+ "description": "Divider PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/divider/divider.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/divider/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/form",
+ "type": "registry:ui",
+ "title": "Form",
+ "description": "Form PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/form/form.styles.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/form/form.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/form/form.types.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/form/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/graph",
+ "type": "registry:ui",
+ "title": "Graph",
+ "description": "Graph PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/graph/graph.styles.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/graph/graph.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/graph/graph.types.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/graph/graph.utils.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/graph/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/heading",
+ "type": "registry:ui",
+ "title": "Heading",
+ "description": "Heading PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/heading/heading.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/heading/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/keep-together",
+ "type": "registry:ui",
+ "title": "Keep Together",
+ "description": "Keep Together PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/keep-together/keep-together.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/keep-together/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/key-value",
+ "type": "registry:ui",
+ "title": "Key Value",
+ "description": "Key Value PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/key-value/key-value.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/key-value/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/link",
+ "type": "registry:ui",
+ "title": "Link",
+ "description": "Link PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/link/link.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/link/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/list",
+ "type": "registry:ui",
+ "title": "List",
+ "description": "List PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/list/list.styles.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/list/list.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/list/list.types.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/list/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/page-break",
+ "type": "registry:ui",
+ "title": "Page Break",
+ "description": "Page Break PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/page-break/page-break.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/page-break/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/page-footer",
+ "type": "registry:ui",
+ "title": "Page Footer",
+ "description": "Page Footer PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/page-footer/page-footer.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/page-footer/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/page-header",
+ "type": "registry:ui",
+ "title": "Page Header",
+ "description": "Page Header PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/page-header/page-header.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/page-header/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/page-number",
+ "type": "registry:ui",
+ "title": "Page Number",
+ "description": "Page Number PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/page-number/page-number.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/page-number/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/pdf-image",
+ "type": "registry:ui",
+ "title": "Pdf Image",
+ "description": "Pdf Image PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/pdf-image/pdf-image.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/pdf-image/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/qrcode",
+ "type": "registry:ui",
+ "title": "Qrcode",
+ "description": "Qrcode PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/qrcode/qrcode.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/qrcode/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers", "qrcode"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/section",
+ "type": "registry:ui",
+ "title": "Section",
+ "description": "Section PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/section/section.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/section/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/signature",
+ "type": "registry:ui",
+ "title": "Signature",
+ "description": "Signature PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/signature/signature.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/signature/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/stack",
+ "type": "registry:ui",
+ "title": "Stack",
+ "description": "Stack PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/stack/stack.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/stack/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/table",
+ "type": "registry:ui",
+ "title": "Table",
+ "description": "Table PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/table/table.styles.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/table/table.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/table/table.types.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/table/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/text",
+ "type": "registry:ui",
+ "title": "Text",
+ "description": "Text PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/text/text.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/text/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/watermark",
+ "type": "registry:ui",
+ "title": "Watermark",
+ "description": "Watermark PDF component (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/components/watermark/watermark.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/takumi/components/watermark/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/invoice-classic",
+ "type": "registry:block",
+ "title": "Invoice Classic",
+ "description": "Invoice Classic PDF block (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/invoice-classic/invoice-classic.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/invoice-classic/invoice-classic.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/invoice-consultant",
+ "type": "registry:block",
+ "title": "Invoice Consultant",
+ "description": "Invoice Consultant PDF block (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/invoice-corporate",
+ "type": "registry:block",
+ "title": "Invoice Corporate",
+ "description": "Invoice Corporate PDF block (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/invoice-creative",
+ "type": "registry:block",
+ "title": "Invoice Creative",
+ "description": "Invoice Creative PDF block (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/invoice-creative/invoice-creative.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/invoice-creative/invoice-creative.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/invoice-minimal",
+ "type": "registry:block",
+ "title": "Invoice Minimal",
+ "description": "Invoice Minimal PDF block (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/invoice-modern",
+ "type": "registry:block",
+ "title": "Invoice Modern",
+ "description": "Invoice Modern PDF block (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/invoice-modern/invoice-modern.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/invoice-modern/invoice-modern.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/report-financial",
+ "type": "registry:block",
+ "title": "Report Financial",
+ "description": "Report Financial PDF block (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/report-financial/report-financial.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/report-financial/report-layout.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/report-financial/report.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/report-marketing",
+ "type": "registry:block",
+ "title": "Report Marketing",
+ "description": "Report Marketing PDF block (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/report-marketing/report-layout.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/report-marketing/report-marketing.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/report-marketing/report.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/report-operations",
+ "type": "registry:block",
+ "title": "Report Operations",
+ "description": "Report Operations PDF block (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/report-operations/report-layout.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/report-operations/report-operations.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/report-operations/report.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/report-security",
+ "type": "registry:block",
+ "title": "Report Security",
+ "description": "Report Security PDF block (takumi)",
+ "files": [
+ {
+ "path": "registry/bases/takumi/blocks/report-security/report-layout.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/report-security/report-security.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/takumi/blocks/report-security/report.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
+ "registryDependencies": ["takumi/utils"]
+ },
+ {
+ "name": "takumi/theme-professional",
+ "type": "registry:theme",
+ "title": "Professional Theme (takumi)",
+ "description": "professional theme tokens for takumi",
+ "files": [
+ {
+ "path": "registry/themes/professional.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-professional.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]
+ },
+ {
+ "name": "takumi/theme-modern",
+ "type": "registry:theme",
+ "title": "Modern Theme (takumi)",
+ "description": "modern theme tokens for takumi",
+ "files": [
+ {
+ "path": "registry/themes/modern.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-modern.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]
+ },
+ {
+ "name": "takumi/theme-minimal",
+ "type": "registry:theme",
+ "title": "Minimal Theme (takumi)",
+ "description": "minimal theme tokens for takumi",
+ "files": [
+ {
+ "path": "registry/themes/minimal.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-minimal.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]
+ },
+ {
+ "name": "takumi/theme-executive",
+ "type": "registry:theme",
+ "title": "Executive Theme (takumi)",
+ "description": "executive theme tokens for takumi",
+ "files": [
+ {
+ "path": "registry/themes/executive.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-executive.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]
+ },
+ {
+ "name": "takumi/theme-corporate",
+ "type": "registry:theme",
+ "title": "Corporate Theme (takumi)",
+ "description": "corporate theme tokens for takumi",
+ "files": [
+ {
+ "path": "registry/themes/corporate.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-corporate.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]
+ },
+ {
+ "name": "takumi/theme-elegant",
+ "type": "registry:theme",
+ "title": "Elegant Theme (takumi)",
+ "description": "elegant theme tokens for takumi",
+ "files": [
+ {
+ "path": "registry/themes/elegant.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-elegant.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]
+ },
+ {
+ "name": "takumi/theme-vivid",
+ "type": "registry:theme",
+ "title": "Vivid Theme (takumi)",
+ "description": "vivid theme tokens for takumi",
+ "files": [
+ {
+ "path": "registry/themes/vivid.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-vivid.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]
+ },
+ {
+ "name": "takumi/theme-forest",
+ "type": "registry:theme",
+ "title": "Forest Theme (takumi)",
+ "description": "forest theme tokens for takumi",
+ "files": [
+ {
+ "path": "registry/themes/forest.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-forest.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]
+ },
+ {
+ "name": "takumi/theme-blueprint",
+ "type": "registry:theme",
+ "title": "Blueprint Theme (takumi)",
+ "description": "blueprint theme tokens for takumi",
+ "files": [
+ {
+ "path": "registry/themes/blueprint.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-blueprint.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/takumi/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]
+ },
+ {
+ "name": "forme/utils",
+ "type": "registry:lib",
+ "title": "Forme Utils",
+ "description": "Theme context and helpers for the forme base",
+ "files": [
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "type": "registry:lib"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme-context.tsx",
+ "type": "registry:lib"
+ },
+ {
+ "path": "registry/bases/forme/lib/resolve-color.ts",
+ "type": "registry:lib"
+ },
+ {
+ "path": "registry/bases/forme/lib/forme-svg.tsx",
+ "type": "registry:lib"
+ },
+ {
+ "path": "registry/bases/forme/lib/maybe-fixed.tsx",
+ "type": "registry:lib"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"]
+ },
+ {
+ "name": "forme/alert",
+ "type": "registry:ui",
+ "title": "Alert",
+ "description": "Alert PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/alert/alert.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/alert/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/badge",
+ "type": "registry:ui",
+ "title": "Badge",
+ "description": "Badge PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/badge/badge.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/badge/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/card",
+ "type": "registry:ui",
+ "title": "Card",
+ "description": "Card PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/card/card.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/card/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/data-table",
+ "type": "registry:ui",
+ "title": "Data Table",
+ "description": "Data Table PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/data-table/data-table.styles.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/data-table/data-table.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/data-table/data-table.types.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/data-table/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils", "forme/table"]
+ },
+ {
+ "name": "forme/divider",
+ "type": "registry:ui",
+ "title": "Divider",
+ "description": "Divider PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/divider/divider.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/divider/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/form",
+ "type": "registry:ui",
+ "title": "Form",
+ "description": "Form PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/form/form.styles.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/form/form.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/form/form.types.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/form/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/graph",
+ "type": "registry:ui",
+ "title": "Graph",
+ "description": "Graph PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/graph/graph.styles.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/graph/graph.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/graph/graph.types.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/graph/graph.utils.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/graph/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/heading",
+ "type": "registry:ui",
+ "title": "Heading",
+ "description": "Heading PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/heading/heading.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/heading/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/keep-together",
+ "type": "registry:ui",
+ "title": "Keep Together",
+ "description": "Keep Together PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/keep-together/keep-together.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/keep-together/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/key-value",
+ "type": "registry:ui",
+ "title": "Key Value",
+ "description": "Key Value PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/key-value/key-value.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/key-value/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/link",
+ "type": "registry:ui",
+ "title": "Link",
+ "description": "Link PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/link/link.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/link/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/list",
+ "type": "registry:ui",
+ "title": "List",
+ "description": "List PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/list/list.styles.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/list/list.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/list/list.types.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/list/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/page-break",
+ "type": "registry:ui",
+ "title": "Page Break",
+ "description": "Page Break PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/page-break/page-break.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/page-break/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/page-footer",
+ "type": "registry:ui",
+ "title": "Page Footer",
+ "description": "Page Footer PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/page-footer/page-footer.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/page-footer/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/page-header",
+ "type": "registry:ui",
+ "title": "Page Header",
+ "description": "Page Header PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/page-header/page-header.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/page-header/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/page-number",
+ "type": "registry:ui",
+ "title": "Page Number",
+ "description": "Page Number PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/page-number/page-number.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/page-number/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/pdf-image",
+ "type": "registry:ui",
+ "title": "Pdf Image",
+ "description": "Pdf Image PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/pdf-image/pdf-image.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/pdf-image/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/qrcode",
+ "type": "registry:ui",
+ "title": "Qrcode",
+ "description": "Qrcode PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/qrcode/qrcode.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/qrcode/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core", "qrcode"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/section",
+ "type": "registry:ui",
+ "title": "Section",
+ "description": "Section PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/section/section.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/section/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/signature",
+ "type": "registry:ui",
+ "title": "Signature",
+ "description": "Signature PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/signature/signature.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/signature/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/stack",
+ "type": "registry:ui",
+ "title": "Stack",
+ "description": "Stack PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/stack/stack.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/stack/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/table",
+ "type": "registry:ui",
+ "title": "Table",
+ "description": "Table PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/table/table.styles.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/table/table.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/table/table.types.ts",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/table/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/text",
+ "type": "registry:ui",
+ "title": "Text",
+ "description": "Text PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/text/text.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/text/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/watermark",
"type": "registry:ui",
- "title": "Your Component",
- "description": "A placeholder component. Replace this with your custom shadcn component.",
+ "title": "Watermark",
+ "description": "Watermark PDF component (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/components/watermark/watermark.tsx",
+ "type": "registry:component"
+ },
+ {
+ "path": "registry/bases/forme/components/watermark/index.ts",
+ "type": "registry:component"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/invoice-classic",
+ "type": "registry:block",
+ "title": "Invoice Classic",
+ "description": "Invoice Classic PDF block (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/invoice-classic/invoice-classic.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/invoice-classic/invoice-classic.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/invoice-consultant",
+ "type": "registry:block",
+ "title": "Invoice Consultant",
+ "description": "Invoice Consultant PDF block (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/invoice-consultant/invoice-consultant.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/invoice-consultant/invoice-consultant.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/invoice-corporate",
+ "type": "registry:block",
+ "title": "Invoice Corporate",
+ "description": "Invoice Corporate PDF block (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/invoice-corporate/invoice-corporate.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/invoice-corporate/invoice-corporate.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/invoice-creative",
+ "type": "registry:block",
+ "title": "Invoice Creative",
+ "description": "Invoice Creative PDF block (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/invoice-creative/invoice-creative.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/invoice-creative/invoice-creative.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/invoice-minimal",
+ "type": "registry:block",
+ "title": "Invoice Minimal",
+ "description": "Invoice Minimal PDF block (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/invoice-minimal/invoice-minimal.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/invoice-minimal/invoice-minimal.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/invoice-modern",
+ "type": "registry:block",
+ "title": "Invoice Modern",
+ "description": "Invoice Modern PDF block (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/invoice-modern/invoice-modern.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/invoice-modern/invoice-modern.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/report-financial",
+ "type": "registry:block",
+ "title": "Report Financial",
+ "description": "Report Financial PDF block (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/report-financial/report-financial.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/report-financial/report-layout.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/report-financial/report.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/report-marketing",
+ "type": "registry:block",
+ "title": "Report Marketing",
+ "description": "Report Marketing PDF block (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/report-marketing/report-layout.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/report-marketing/report-marketing.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/report-marketing/report.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/report-operations",
+ "type": "registry:block",
+ "title": "Report Operations",
+ "description": "Report Operations PDF block (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/report-operations/report-layout.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/report-operations/report-operations.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/report-operations/report.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/report-security",
+ "type": "registry:block",
+ "title": "Report Security",
+ "description": "Report Security PDF block (forme)",
+ "files": [
+ {
+ "path": "registry/bases/forme/blocks/report-security/report-layout.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/report-security/report-security.tsx",
+ "type": "registry:block"
+ },
+ {
+ "path": "registry/bases/forme/blocks/report-security/report.types.ts",
+ "type": "registry:block"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
+ "registryDependencies": ["forme/utils"]
+ },
+ {
+ "name": "forme/theme-professional",
+ "type": "registry:theme",
+ "title": "Professional Theme (forme)",
+ "description": "professional theme tokens for forme",
+ "files": [
+ {
+ "path": "registry/themes/professional.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-professional.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"]
+ },
+ {
+ "name": "forme/theme-modern",
+ "type": "registry:theme",
+ "title": "Modern Theme (forme)",
+ "description": "modern theme tokens for forme",
+ "files": [
+ {
+ "path": "registry/themes/modern.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-modern.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"]
+ },
+ {
+ "name": "forme/theme-minimal",
+ "type": "registry:theme",
+ "title": "Minimal Theme (forme)",
+ "description": "minimal theme tokens for forme",
+ "files": [
+ {
+ "path": "registry/themes/minimal.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-minimal.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"]
+ },
+ {
+ "name": "forme/theme-executive",
+ "type": "registry:theme",
+ "title": "Executive Theme (forme)",
+ "description": "executive theme tokens for forme",
+ "files": [
+ {
+ "path": "registry/themes/executive.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-executive.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"]
+ },
+ {
+ "name": "forme/theme-corporate",
+ "type": "registry:theme",
+ "title": "Corporate Theme (forme)",
+ "description": "corporate theme tokens for forme",
+ "files": [
+ {
+ "path": "registry/themes/corporate.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-corporate.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"]
+ },
+ {
+ "name": "forme/theme-elegant",
+ "type": "registry:theme",
+ "title": "Elegant Theme (forme)",
+ "description": "elegant theme tokens for forme",
+ "files": [
+ {
+ "path": "registry/themes/elegant.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-elegant.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"]
+ },
+ {
+ "name": "forme/theme-vivid",
+ "type": "registry:theme",
+ "title": "Vivid Theme (forme)",
+ "description": "vivid theme tokens for forme",
+ "files": [
+ {
+ "path": "registry/themes/vivid.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-vivid.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"]
+ },
+ {
+ "name": "forme/theme-forest",
+ "type": "registry:theme",
+ "title": "Forest Theme (forme)",
+ "description": "forest theme tokens for forme",
+ "files": [
+ {
+ "path": "registry/themes/forest.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-forest.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
+ }
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"]
+ },
+ {
+ "name": "forme/theme-blueprint",
+ "type": "registry:theme",
+ "title": "Blueprint Theme (forme)",
+ "description": "blueprint theme tokens for forme",
"files": [
{
- "path": "registry/new-york/your-component.tsx",
- "type": "registry:ui",
- "target": "components/ui/your-component.tsx"
+ "path": "registry/themes/blueprint.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-blueprint.ts"
+ },
+ {
+ "path": "registry/themes/primitives.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/primitives.ts"
+ },
+ {
+ "path": "registry/themes/theme-types.ts",
+ "type": "registry:theme",
+ "target": "components/pdf/theme-types.ts"
+ },
+ {
+ "path": "registry/bases/forme/lib/pdfcn-theme.ts",
+ "type": "registry:lib",
+ "target": "components/pdf/pdfcn-theme.ts"
}
- ]
+ ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"]
}
]
}
diff --git a/registry/bases.ts b/registry/bases.ts
new file mode 100644
index 0000000..9328d66
--- /dev/null
+++ b/registry/bases.ts
@@ -0,0 +1,34 @@
+import { formeRegistryBase } from "@/registry/bases/forme/registry";
+import { takumiRegistryBase } from "@/registry/bases/takumi/registry";
+
+export const BASES = [
+ {
+ ...takumiRegistryBase,
+ dependencies: ["takumi-pdf", "@takumi-rs/helpers"],
+ description:
+ "Paged selectable-text PDF from JSX/Tailwind via Takumi WASM — preview with react-pdf.",
+ title: "Takumi PDF",
+ type: "registry:style" as const,
+ },
+ {
+ ...formeRegistryBase,
+ dependencies: ["@formepdf/react", "@formepdf/core"],
+ description:
+ "React PDF components rendered with Forme’s WASM layout engine — browser and server.",
+ title: "Forme PDF",
+ type: "registry:style" as const,
+ },
+] as const;
+
+export type Base = (typeof BASES)[number];
+export type BaseName = Base["name"];
+
+export const DEFAULT_BASE = BASES[0].name;
+
+export const BASE_NAMES = BASES.map((base) => base.name) as [
+ BaseName,
+ ...BaseName[],
+];
+
+export const getBase = (name: BaseName) =>
+ BASES.find((base) => base.name === name);
diff --git a/registry/bases/forme/blocks/invoice-classic/invoice-classic.tsx b/registry/bases/forme/blocks/invoice-classic/invoice-classic.tsx
new file mode 100644
index 0000000..9c150b5
--- /dev/null
+++ b/registry/bases/forme/blocks/invoice-classic/invoice-classic.tsx
@@ -0,0 +1,211 @@
+import { Document, Page, StyleSheet, View } from "@formepdf/react";
+
+import type { PdfcnTheme } from "@/registry/themes";
+
+import {
+ KeyValue,
+ PageFooter,
+ PageHeader,
+ PdfImage,
+ PdfcnThemeProvider,
+ Section,
+ Table,
+ TableBody,
+ TableCell,
+ TableHeader,
+ TableRow,
+ Text,
+ usePdfcnTheme,
+} from "../../components";
+import type { InvoiceClassicData } from "./invoice-classic.types";
+
+// Sample data — replace with your own props or data source
+const sampleData: InvoiceClassicData = {
+ billTo: {
+ address: "456 Client Ave, Suite 2",
+ email: "[email protected]",
+ name: "Client Corp.",
+ phone: "+1 (555) 123-4567",
+ },
+ companyAddress: "City, Country",
+ companyEmail: "[email protected]",
+ companyName: "Your Company",
+ dueDate: "March 17, 2026",
+ invoiceDate: "February 17, 2026",
+ invoiceNumber: "INV-2026-001",
+ items: [
+ { description: "Web Development", quantity: 1, unitPrice: 12_500 },
+ { description: "UI/UX Design", quantity: 1, unitPrice: 8750 },
+ { description: "Consulting", quantity: 10, unitPrice: 1500 },
+ ],
+ logo: "/favicon.png",
+ notes: "Thank you for your business!",
+ paymentTerms: {
+ dueDate: "March 17, 2026",
+ gst: "GSTIN 123456789",
+ method: "UPI / Card / Bank Transfer",
+ },
+ subtitle: "Professional Services",
+ summary: {
+ subtotal: 36_250,
+ tax: 2537.5,
+ total: 38_787.5,
+ },
+};
+
+export function InvoiceClassicDocument({
+ theme,
+ data = sampleData,
+}: {
+ theme?: PdfcnTheme;
+ data?: InvoiceClassicData;
+}) {
+ return (
+ <PdfcnThemeProvider theme={theme}>
+ <InvoiceClassicContent data={data} />
+ </PdfcnThemeProvider>
+ );
+}
+
+function InvoiceClassicContent({ data }: { data: InvoiceClassicData }) {
+ const theme = usePdfcnTheme();
+
+ const styles = StyleSheet.create({
+ page: {
+ backgroundColor: theme.colors.background,
+ padding: theme.spacing.page.marginTop,
+ paddingBottom: theme.spacing.page.marginBottom,
+ },
+ });
+
+ return (
+ <Document title={`Invoice ${data.invoiceNumber}`}>
+ <Page size="A4" margin={48}>
+ <View style={styles.page as never}>
+ <PageHeader
+ variant="logo-left"
+ logo={
+ <PdfImage
+ src={data.logo ?? "/favicon.png"}
+ style={{ margin: 0 }}
+ />
+ }
+ title={data.companyName}
+ subtitle={data.subtitle}
+ rightText={data.invoiceNumber}
+ rightSubText={`Due: ${data.dueDate}`}
+ style={{ marginBottom: 0 }}
+ />
+ <Section noWrap style={{ flexDirection: "row" }}>
+ <View style={{ flex: 1, paddingRight: 15 }}>
+ <Text
+ style={{ fontSize: 9, fontWeight: "bold", marginBottom: 2 }}
+ color="mutedForeground"
+ transform="uppercase"
+ noMargin
+ >
+ From
+ </Text>
+ <Text noMargin variant="xs">
+ {data.companyName}
+ </Text>
+ <Text noMargin variant="xs">
+ {data.companyAddress}
+ </Text>
+ <Text noMargin variant="xs">
+ {data.companyEmail}
+ </Text>
+ </View>
+ <View style={{ flex: 1, paddingRight: 15 }}>
+ <Text
+ style={{ fontSize: 9, fontWeight: "bold", marginBottom: 2 }}
+ color="mutedForeground"
+ transform="uppercase"
+ noMargin
+ >
+ Bill To
+ </Text>
+ <Text noMargin variant="xs">
+ {data.billTo.name}
+ </Text>
+ <Text noMargin variant="xs">
+ {data.billTo.address}
+ </Text>
+ <Text noMargin variant="xs">
+ {data.billTo.email}
+ </Text>
+ </View>
+ <View style={{ flex: 1, paddingRight: 15 }}>
+ <Text
+ style={{ fontSize: 9, fontWeight: "bold", marginBottom: 2 }}
+ color="mutedForeground"
+ transform="uppercase"
+ noMargin
+ >
+ Payment Terms
+ </Text>
+ <Text noMargin variant="xs">
+ {data.paymentTerms.method}
+ </Text>
+ <Text noMargin variant="xs">
+ {data.paymentTerms.gst}
+ </Text>
+ <Text noMargin variant="xs">
+ {data.paymentTerms.dueDate}
+ </Text>
+ </View>
+ </Section>
+ <Table variant="grid" zebraStripe>
+ <TableHeader>
+ <TableRow header>
+ <TableCell>Description</TableCell>
+ <TableCell align="center">QTY</TableCell>
+ <TableCell align="center">Rate</TableCell>
+ <TableCell align="right">Total</TableCell>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {data.items.map((item, index) => (
+ // biome-ignore lint/suspicious/noArrayIndexKey: invoice items have no stable id
+ <TableRow key={index}>
+ <TableCell>{item.description}</TableCell>
+ <TableCell align="center">{`${item.quantity}`}</TableCell>
+ <TableCell align="center">{`$${item.unitPrice}`}</TableCell>
+ <TableCell align="right">{`$${(item.quantity * item.unitPrice).toFixed(2)}`}</TableCell>
+ </TableRow>
+ ))}
+ </TableBody>
+ </Table>
+ <Section noWrap style={{ flexDirection: "row", marginTop: 16 }}>
+ <View style={{ marginLeft: "auto", width: 220 }}>
+ <KeyValue
+ size="sm"
+ dividerThickness={1}
+ items={[
+ {
+ key: "Subtotal",
+ value: `$${data.summary.subtotal.toFixed(2)}`,
+ },
+ { key: "Tax", value: `$${data.summary.tax.toFixed(2)}` },
+ {
+ key: "Total",
+ keyStyle: { fontSize: 12, fontWeight: "bold" },
+ value: `$${data.summary.total.toFixed(2)}`,
+ valueStyle: { fontSize: 12, fontWeight: "bold" },
+ },
+ ]}
+ divided
+ />
+ </View>
+ </Section>
+ <PageFooter
+ leftText={data.notes}
+ rightText="Page 1 of 1"
+ sticky
+ pagePadding={25}
+ />
+ </View>
+ </Page>
+ </Document>
+ );
+}
diff --git a/registry/bases/forme/blocks/invoice-classic/invoice-classic.types.ts b/registry/bases/forme/blocks/invoice-classic/invoice-classic.types.ts
new file mode 100644
index 0000000..64ce56e
--- /dev/null
+++ b/registry/bases/forme/blocks/invoice-classic/invoice-classic.types.ts
@@ -0,0 +1,32 @@
+export interface InvoiceClassicData {
+ invoiceNumber: string;
+ invoiceDate: string;
+ dueDate: string;
+ companyName: string;
+ subtitle: string;
+ companyAddress: string;
+ companyEmail: string;
+ logo?: string;
+ billTo: {
+ name: string;
+ address: string;
+ email: string;
+ phone: string;
+ };
+ items: {
+ description: string;
+ quantity: number;
+ unitPrice: number;
+ }[];
+ summary: {
+ subtotal: number;
+ tax: number;
+ total: number;
+ };
+ paymentTerms: {
+ dueDate: string;
+ method: string;
+ gst: string;
+ };
+ notes?: string;
+}
diff --git a/registry/bases/forme/blocks/invoice-consultant/invoice-consultant.tsx b/registry/bases/forme/blocks/invoice-consultant/invoice-consultant.tsx
new file mode 100644
index 0000000..d7bcbc7
--- /dev/null
+++ b/registry/bases/forme/blocks/invoice-consultant/invoice-consultant.tsx
@@ -0,0 +1,327 @@
+import { Document, Page, StyleSheet, View } from "@formepdf/react";
+
+import type { PdfcnTheme } from "@/registry/themes";
+
+import {
+ KeyValue,
+ PageFooter,
+ PdfcnThemeProvider,
+ Section,
+ Table,
+ TableBody,
+ TableCell,
+ TableHeader,
+ TableRow,
+ Text,
+ usePdfcnTheme,
+} from "../../components";
+import type { InvoiceConsultantData } from "./invoice-consultant.types";
+
+const sampleData: InvoiceConsultantData = {
+ client: {
+ address: "500 Tech Park, Suite 200",
+ company: "Acme Technologies",
+ email: "[email protected]",
+ name: "Sarah Johnson",
+ },
+ companyAddress: "City, Country · [email protected]",
+ companyName: "Your Consulting",
+ consultant: {
+ email: "[email protected]",
+ name: "John Smith",
+ title: "Senior Technical Consultant",
+ },
+ dueDate: "March 28, 2026",
+ invoiceDate: "February 26, 2026",
+ invoiceNumber: "INV-2026-006",
+ notes:
+ "Services rendered for February 2026. All hours verified and approved by client.",
+ paymentTerms: {
+ dueDate: "March 28, 2026",
+ method: "Bank Transfer / Check",
+ },
+ projectRef: "PROJ-2026-ACME-001",
+ services: [
+ { description: "Architecture Review & Planning", hours: 16, rate: 175 },
+ { description: "Code Review & Optimization", hours: 24, rate: 150 },
+ { description: "Technical Documentation", hours: 12, rate: 125 },
+ { description: "Team Training & Knowledge Transfer", hours: 8, rate: 200 },
+ ],
+ subtitle: "Professional Consulting Services",
+ summary: {
+ subtotal: 10_300,
+ tax: 515,
+ total: 10_815,
+ totalHours: 60,
+ },
+};
+
+export function InvoiceConsultantDocument({
+ theme,
+ data = sampleData,
+}: {
+ theme?: PdfcnTheme;
+ data?: InvoiceConsultantData;
+}) {
+ return (
+ <PdfcnThemeProvider theme={theme}>
+ <InvoiceConsultantContent data={data} />
+ </PdfcnThemeProvider>
+ );
+}
+
+function InvoiceConsultantContent({ data }: { data: InvoiceConsultantData }) {
+ const theme = usePdfcnTheme();
+
+ const styles = StyleSheet.create({
+ calloutNote: {
+ backgroundColor: theme.colors.muted,
+ borderLeftColor: theme.colors.info,
+ borderLeftStyle: "solid",
+ borderLeftWidth: 3,
+ marginTop: 16,
+ paddingLeft: 12,
+ paddingVertical: 8,
+ },
+ companyInfo: {
+ flex: 1,
+ },
+ headerRow: {
+ alignItems: "flex-start",
+ borderBottomColor: theme.colors.primary,
+ borderBottomStyle: "solid",
+ borderBottomWidth: 2,
+ flexDirection: "row",
+ justifyContent: "space-between",
+ marginBottom: theme.spacing.sectionGap,
+ paddingBottom: theme.spacing.componentGap,
+ },
+ hoursBadge: {
+ alignSelf: "flex-start",
+ backgroundColor: theme.colors.primary,
+ borderRadius: theme.primitives.borderRadius.sm,
+ color: theme.colors.primaryForeground,
+ paddingHorizontal: 12,
+ paddingVertical: 8,
+ },
+ hoursBox: {
+ flex: 1,
+ paddingRight: 24,
+ },
+ invoiceInfo: {
+ alignItems: "flex-end",
+ },
+ page: {
+ backgroundColor: theme.colors.background,
+ padding: theme.spacing.page.marginTop,
+ paddingBottom: theme.spacing.page.marginBottom,
+ },
+ partiesRow: {
+ flexDirection: "row",
+ gap: 40,
+ marginBottom: theme.spacing.sectionGap,
+ },
+ partyColumn: {
+ flex: 1,
+ },
+ partyLabel: {
+ borderBottomColor: theme.colors.border,
+ borderBottomStyle: "solid",
+ borderBottomWidth: 1,
+ color: theme.colors.primary,
+ fontSize: 9,
+ fontWeight: "bold",
+ letterSpacing: 0.6,
+ marginBottom: 6,
+ paddingBottom: 4,
+ textTransform: "uppercase",
+ },
+ projectRef: {
+ alignItems: "center",
+ backgroundColor: theme.colors.muted,
+ borderRadius: theme.primitives.borderRadius.sm,
+ flexDirection: "row",
+ gap: 8,
+ marginBottom: theme.spacing.sectionGap,
+ paddingHorizontal: 10,
+ paddingVertical: 6,
+ },
+ summaryRow: {
+ flexDirection: "row",
+ marginTop: 20,
+ },
+ totalsBox: {
+ width: 250,
+ },
+ });
+
+ return (
+ <Document title={`Invoice ${data.invoiceNumber}`}>
+ <Page size="A4" margin={48}>
+ <View style={styles.page as never}>
+ <View style={styles.headerRow}>
+ <View style={styles.companyInfo}>
+ <Text variant="xl" weight="bold" noMargin>
+ {data.companyName}
+ </Text>
+ <Text variant="sm" color="mutedForeground" noMargin>
+ {data.subtitle}
+ </Text>
+ <Text variant="xs" color="mutedForeground" noMargin>
+ {data.companyAddress}
+ </Text>
+ </View>
+ <View style={styles.invoiceInfo}>
+ <Text
+ variant="xs"
+ color="mutedForeground"
+ transform="uppercase"
+ noMargin
+ >
+ Invoice
+ </Text>
+ <Text variant="lg" weight="bold" noMargin>
+ {data.invoiceNumber}
+ </Text>
+ <Text variant="xs" color="mutedForeground" noMargin>
+ {data.invoiceDate}
+ </Text>
+ <Text variant="xs" color="mutedForeground" noMargin>
+ Due: {data.dueDate}
+ </Text>
+ </View>
+ </View>
+ {data.projectRef && (
+ <View style={styles.projectRef}>
+ <Text
+ variant="xs"
+ weight="semibold"
+ color="mutedForeground"
+ noMargin
+ >
+ Project Reference:
+ </Text>
+ <Text variant="xs" weight="bold" noMargin>
+ {data.projectRef}
+ </Text>
+ </View>
+ )}
+ <View style={styles.partiesRow}>
+ <View style={styles.partyColumn}>
+ <Text style={styles.partyLabel} noMargin>
+ From (Consultant)
+ </Text>
+ <Text variant="sm" weight="semibold" noMargin>
+ {data.consultant.name}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.consultant.title}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.consultant.email}
+ </Text>
+ </View>
+ <View style={styles.partyColumn}>
+ <Text style={styles.partyLabel} noMargin>
+ Bill To (Client)
+ </Text>
+ <Text variant="sm" weight="semibold" noMargin>
+ {data.client.name}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.client.company}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.client.address}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.client.email}
+ </Text>
+ </View>
+ </View>
+ <Table variant="line">
+ <TableHeader>
+ <TableRow header>
+ <TableCell>Service Description</TableCell>
+ <TableCell align="center">Hours</TableCell>
+ <TableCell align="right">Rate ($/hr)</TableCell>
+ <TableCell align="right">Amount</TableCell>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {data.services.map((service, index) => (
+ // biome-ignore lint/suspicious/noArrayIndexKey: static PDF list, no reordering
+ <TableRow key={index}>
+ <TableCell>{service.description}</TableCell>
+ <TableCell align="center">{`${service.hours}`}</TableCell>
+ <TableCell align="right">{`$${service.rate}`}</TableCell>
+ <TableCell align="right">{`$${(service.hours * service.rate).toLocaleString()}`}</TableCell>
+ </TableRow>
+ ))}
+ </TableBody>
+ </Table>
+ <Section noWrap style={styles.summaryRow}>
+ <View style={styles.hoursBox}>
+ <View style={styles.hoursBadge}>
+ <Text
+ style={{
+ color: theme.colors.primaryForeground,
+ fontSize: 9,
+ fontWeight: "bold",
+ }}
+ noMargin
+ >
+ Total Hours: {data.summary.totalHours}
+ </Text>
+ </View>
+ <Text
+ variant="xs"
+ color="mutedForeground"
+ style={{ marginTop: 8 }}
+ >
+ Payment: {data.paymentTerms.method}
+ </Text>
+ </View>
+ <View style={styles.totalsBox}>
+ <KeyValue
+ size="sm"
+ dividerThickness={1}
+ items={[
+ {
+ key: "Subtotal",
+ value: `$${data.summary.subtotal.toLocaleString()}`,
+ },
+ { key: "Tax (5%)", value: `$${data.summary.tax.toFixed(2)}` },
+ {
+ key: "Amount Due",
+ keyStyle: { fontSize: 13, fontWeight: "bold" },
+ value: `$${data.summary.total.toFixed(2)}`,
+ valueStyle: {
+ color: theme.colors.primary,
+ fontSize: 14,
+ fontWeight: "bold",
+ },
+ },
+ ]}
+ divided
+ />
+ </View>
+ </Section>
+ {data.notes && (
+ <View style={styles.calloutNote}>
+ <Text variant="xs" color="mutedForeground">
+ {data.notes}
+ </Text>
+ </View>
+ )}
+ <PageFooter
+ leftText="Professional services invoice – Please retain for records"
+ rightText="Page 1 of 1"
+ sticky
+ pagePadding={25}
+ />
+ </View>
+ </Page>
+ </Document>
+ );
+}
diff --git a/registry/bases/forme/blocks/invoice-consultant/invoice-consultant.types.ts b/registry/bases/forme/blocks/invoice-consultant/invoice-consultant.types.ts
new file mode 100644
index 0000000..bfdda36
--- /dev/null
+++ b/registry/bases/forme/blocks/invoice-consultant/invoice-consultant.types.ts
@@ -0,0 +1,36 @@
+export interface InvoiceConsultantData {
+ invoiceNumber: string;
+ invoiceDate: string;
+ dueDate: string;
+ companyName: string;
+ subtitle: string;
+ companyAddress: string;
+ consultant: {
+ name: string;
+ title: string;
+ email: string;
+ };
+ client: {
+ name: string;
+ company: string;
+ address: string;
+ email: string;
+ };
+ services: {
+ description: string;
+ hours: number;
+ rate: number;
+ }[];
+ summary: {
+ totalHours: number;
+ subtotal: number;
+ tax: number;
+ total: number;
+ };
+ paymentTerms: {
+ dueDate: string;
+ method: string;
+ };
+ projectRef?: string;
+ notes?: string;
+}
diff --git a/registry/bases/forme/blocks/invoice-corporate/invoice-corporate.tsx b/registry/bases/forme/blocks/invoice-corporate/invoice-corporate.tsx
new file mode 100644
index 0000000..65b924c
--- /dev/null
+++ b/registry/bases/forme/blocks/invoice-corporate/invoice-corporate.tsx
@@ -0,0 +1,224 @@
+import { Document, Page, StyleSheet, View } from "@formepdf/react";
+
+import type { PdfcnTheme } from "@/registry/themes";
+
+import {
+ KeyValue,
+ PageFooter,
+ PageHeader,
+ PdfImage,
+ PdfcnThemeProvider,
+ Table,
+ TableBody,
+ TableCell,
+ TableHeader,
+ TableRow,
+ Text,
+ usePdfcnTheme,
+} from "../../components";
+import type { InvoiceCorporateData } from "./invoice-corporate.types";
+
+const sampleData: InvoiceCorporateData = {
+ billTo: {
+ address: "100 Corporate Plaza, Tower B",
+ email: "[email protected]",
+ name: "Global Industries Ltd.",
+ phone: "+1 (555) 888-9999",
+ },
+ companyAddress: "City, Country",
+ companyEmail: "[email protected]",
+ companyName: "Your Company",
+ dueDate: "March 24, 2026",
+ invoiceDate: "February 22, 2026",
+ invoiceNumber: "INV-2026-004",
+ items: [
+ {
+ description: "Enterprise Software License",
+ quantity: 5,
+ unitPrice: 4500,
+ },
+ { description: "Implementation Services", quantity: 1, unitPrice: 18_000 },
+ { description: "Training Workshop", quantity: 3, unitPrice: 2500 },
+ { description: "Annual Support Package", quantity: 1, unitPrice: 8500 },
+ ],
+ logo: "/favicon.png",
+ notes: "Corporate billing – Net 30 terms apply.",
+ paymentTerms: {
+ dueDate: "March 24, 2026",
+ gst: "GSTIN 987654321",
+ method: "Wire Transfer / Corporate Account",
+ },
+ subtitle: "Professional Services",
+ summary: {
+ subtotal: 57_000,
+ tax: 4560,
+ total: 61_560,
+ },
+};
+
+export function InvoiceCorporateDocument({
+ theme,
+ data = sampleData,
+}: {
+ theme?: PdfcnTheme;
+ data?: InvoiceCorporateData;
+}) {
+ return (
+ <PdfcnThemeProvider theme={theme}>
+ <InvoiceCorporateContent data={data} />
+ </PdfcnThemeProvider>
+ );
+}
+
+function InvoiceCorporateContent({ data }: { data: InvoiceCorporateData }) {
+ const theme = usePdfcnTheme();
+
+ const styles = StyleSheet.create({
+ infoColumn: {
+ flex: 1,
+ },
+ infoGrid: {
+ flexDirection: "row",
+ gap: 24,
+ marginBottom: theme.spacing.sectionGap,
+ },
+ infoLabel: {
+ color: theme.colors.mutedForeground,
+ fontSize: 9,
+ fontWeight: "bold",
+ letterSpacing: 0.6,
+ marginBottom: 6,
+ textTransform: "uppercase",
+ },
+ page: {
+ backgroundColor: theme.colors.background,
+ padding: theme.spacing.page.marginTop,
+ paddingBottom: theme.spacing.page.marginBottom,
+ },
+ summaryCard: {
+ backgroundColor: theme.colors.muted,
+ borderRadius: theme.primitives.borderRadius.md,
+ marginTop: 20,
+ padding: 16,
+ },
+ summaryRow: {
+ flexDirection: "row",
+ justifyContent: "flex-end",
+ },
+ });
+
+ return (
+ <Document title={`Invoice ${data.invoiceNumber}`}>
+ <Page size="A4" margin={48}>
+ <View style={styles.page as never}>
+ <PageHeader
+ variant="logo-right"
+ logo={
+ <PdfImage
+ src={data.logo ?? "/favicon.png"}
+ width={56}
+ height={56}
+ style={{ margin: 0 }}
+ />
+ }
+ title={data.companyName}
+ subtitle={`${data.subtitle} · ${data.companyAddress}`}
+ style={{ marginBottom: theme.spacing.sectionGap }}
+ />
+ <View style={styles.infoGrid}>
+ <View style={styles.infoColumn}>
+ <Text style={styles.infoLabel} noMargin>
+ Invoice Details
+ </Text>
+ <KeyValue
+ size="sm"
+ items={[
+ { key: "Invoice #", value: data.invoiceNumber },
+ { key: "Issue Date", value: data.invoiceDate },
+ { key: "Due Date", value: data.dueDate },
+ { key: "Payment", value: data.paymentTerms.method },
+ ]}
+ />
+ </View>
+ <View style={styles.infoColumn}>
+ <Text style={styles.infoLabel} noMargin>
+ Bill To
+ </Text>
+ <Text variant="sm" weight="semibold" noMargin>
+ {data.billTo.name}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.billTo.address}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.billTo.email}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.billTo.phone}
+ </Text>
+ </View>
+ </View>
+ <Table variant="bordered">
+ <TableHeader>
+ <TableRow header>
+ <TableCell>Description</TableCell>
+ <TableCell align="center">Qty</TableCell>
+ <TableCell align="right">Unit Price</TableCell>
+ <TableCell align="right">Amount</TableCell>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {data.items.map((item, index) => (
+ // biome-ignore lint/suspicious/noArrayIndexKey: static PDF list, no reordering
+ <TableRow key={index}>
+ <TableCell>{item.description}</TableCell>
+ <TableCell align="center">{`${item.quantity}`}</TableCell>
+ <TableCell align="right">{`$${item.unitPrice.toLocaleString()}`}</TableCell>
+ <TableCell align="right">{`$${(item.quantity * item.unitPrice).toLocaleString()}`}</TableCell>
+ </TableRow>
+ ))}
+ </TableBody>
+ </Table>
+ <View style={styles.summaryCard}>
+ <View style={styles.summaryRow}>
+ <View style={{ width: 260 }}>
+ <KeyValue
+ size="md"
+ dividerThickness={1}
+ dividerColor="border"
+ items={[
+ {
+ key: "Subtotal",
+ value: `$${data.summary.subtotal.toLocaleString()}`,
+ },
+ {
+ key: "Tax (8%)",
+ value: `$${data.summary.tax.toFixed(2)}`,
+ },
+ {
+ key: "Total Due",
+ keyStyle: { fontSize: 13, fontWeight: "bold" },
+ value: `$${data.summary.total.toFixed(2)}`,
+ valueStyle: {
+ color: theme.colors.primary,
+ fontSize: 14,
+ fontWeight: "bold",
+ },
+ },
+ ]}
+ divided
+ />
+ </View>
+ </View>
+ </View>
+ <PageFooter
+ leftText={data.notes}
+ rightText="Page 1 of 1"
+ sticky
+ pagePadding={25}
+ />
+ </View>
+ </Page>
+ </Document>
+ );
+}
diff --git a/registry/bases/forme/blocks/invoice-corporate/invoice-corporate.types.ts b/registry/bases/forme/blocks/invoice-corporate/invoice-corporate.types.ts
new file mode 100644
index 0000000..46ee4d1
--- /dev/null
+++ b/registry/bases/forme/blocks/invoice-corporate/invoice-corporate.types.ts
@@ -0,0 +1,32 @@
+export interface InvoiceCorporateData {
+ invoiceNumber: string;
+ invoiceDate: string;
+ dueDate: string;
+ companyName: string;
+ subtitle: string;
+ companyAddress: string;
+ companyEmail: string;
+ logo?: string;
+ billTo: {
+ name: string;
+ address: string;
+ email: string;
+ phone: string;
+ };
+ items: {
+ description: string;
+ quantity: number;
+ unitPrice: number;
+ }[];
+ summary: {
+ subtotal: number;
+ tax: number;
+ total: number;
+ };
+ paymentTerms: {
+ dueDate: string;
+ method: string;
+ gst: string;
+ };
+ notes?: string;
+}
diff --git a/registry/bases/forme/blocks/invoice-creative/invoice-creative.tsx b/registry/bases/forme/blocks/invoice-creative/invoice-creative.tsx
new file mode 100644
index 0000000..844c516
--- /dev/null
+++ b/registry/bases/forme/blocks/invoice-creative/invoice-creative.tsx
@@ -0,0 +1,279 @@
+import { Document, Page, StyleSheet, View } from "@formepdf/react";
+
+import type { PdfcnTheme } from "@/registry/themes";
+
+import {
+ KeyValue,
+ PageFooter,
+ PageHeader,
+ PdfcnThemeProvider,
+ Section,
+ Table,
+ TableBody,
+ TableCell,
+ TableHeader,
+ TableRow,
+ Text,
+ usePdfcnTheme,
+} from "../../components";
+import type { InvoiceCreativeData } from "./invoice-creative.types";
+
+const sampleData: InvoiceCreativeData = {
+ billTo: {
+ address: "250 Design District, Loft 5",
+ email: "[email protected]",
+ name: "Creative Agency Co.",
+ phone: "+1 (555) 321-7654",
+ },
+ companyAddress: "City, Country · [email protected]",
+ companyName: "Your Agency",
+ dueDate: "March 26, 2026",
+ invoiceDate: "February 24, 2026",
+ invoiceNumber: "INV-2026-005",
+ items: [
+ { description: "Brand Identity Design", quantity: 1, unitPrice: 8500 },
+ {
+ description: "Marketing Collateral Package",
+ quantity: 1,
+ unitPrice: 4200,
+ },
+ {
+ description: "Social Media Assets (per set)",
+ quantity: 4,
+ unitPrice: 750,
+ },
+ { description: "Motion Graphics (30s)", quantity: 2, unitPrice: 3500 },
+ ],
+ notes:
+ "Creative work is protected under copyright. Full usage rights transfer upon payment.",
+ paymentTerms: {
+ dueDate: "March 26, 2026",
+ gst: "GSTIN 456789123",
+ method: "Credit Card / PayPal / Stripe",
+ },
+ subtitle: "Creative Services",
+ summary: {
+ subtotal: 22_700,
+ tax: 1475.5,
+ total: 24_175.5,
+ },
+};
+
+export function InvoiceCreativeDocument({
+ theme,
+ data = sampleData,
+}: {
+ theme?: PdfcnTheme;
+ data?: InvoiceCreativeData;
+}) {
+ return (
+ <PdfcnThemeProvider theme={theme}>
+ <InvoiceCreativeContent data={data} />
+ </PdfcnThemeProvider>
+ );
+}
+
+function InvoiceCreativeContent({ data }: { data: InvoiceCreativeData }) {
+ const theme = usePdfcnTheme();
+
+ const styles = StyleSheet.create({
+ accentBlock: {
+ backgroundColor: theme.colors.muted,
+ borderLeftColor: theme.colors.accent,
+ borderLeftStyle: "solid",
+ borderLeftWidth: 4,
+ marginBottom: theme.spacing.sectionGap,
+ paddingLeft: 14,
+ paddingVertical: 10,
+ },
+ badgeLabel: {
+ color: theme.colors.primaryForeground,
+ fontSize: 8,
+ fontWeight: "bold",
+ letterSpacing: 1.2,
+ marginBottom: 2,
+ textTransform: "uppercase",
+ },
+ badgeNumber: {
+ color: theme.colors.primaryForeground,
+ fontSize: 16,
+ fontWeight: "bold",
+ },
+ heroSection: {
+ alignItems: "center",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ marginBottom: theme.spacing.sectionGap,
+ },
+ infoColumn: {
+ flex: 1,
+ },
+ infoGrid: {
+ flexDirection: "row",
+ gap: 32,
+ },
+ invoiceBadge: {
+ alignItems: "center",
+ backgroundColor: theme.colors.primary,
+ borderRadius: theme.primitives.borderRadius.md,
+ paddingHorizontal: 20,
+ paddingVertical: 14,
+ },
+ page: {
+ backgroundColor: theme.colors.background,
+ padding: theme.spacing.page.marginTop,
+ paddingBottom: theme.spacing.page.marginBottom,
+ },
+ sectionLabel: {
+ color: theme.colors.accent,
+ fontSize: 8,
+ fontWeight: "bold",
+ letterSpacing: 0.8,
+ marginBottom: 6,
+ textTransform: "uppercase",
+ },
+ summaryLeft: {
+ flex: 1,
+ paddingRight: 20,
+ },
+ summaryRight: {
+ backgroundColor: theme.colors.muted,
+ borderRadius: theme.primitives.borderRadius.sm,
+ padding: 14,
+ width: 240,
+ },
+ summarySection: {
+ flexDirection: "row",
+ marginTop: 24,
+ },
+ });
+
+ return (
+ <Document title={`Invoice ${data.invoiceNumber}`}>
+ <Page size="A4" margin={48}>
+ <View style={styles.page as never}>
+ <View style={styles.heroSection}>
+ <View style={{ flex: 1 }}>
+ <PageHeader
+ variant="centered"
+ title={data.companyName}
+ subtitle={`${data.subtitle} · ${data.companyAddress}`}
+ marginBottom={0}
+ />
+ </View>
+ <View style={styles.invoiceBadge}>
+ <Text style={styles.badgeLabel} noMargin>
+ Invoice
+ </Text>
+ <Text style={styles.badgeNumber} noMargin>
+ {data.invoiceNumber}
+ </Text>
+ </View>
+ </View>
+ <View style={styles.accentBlock}>
+ <View style={styles.infoGrid}>
+ <View style={styles.infoColumn}>
+ <Text style={styles.sectionLabel} noMargin>
+ Billed To
+ </Text>
+ <Text variant="sm" weight="semibold" noMargin>
+ {data.billTo.name}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.billTo.address}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.billTo.email} · {data.billTo.phone}
+ </Text>
+ </View>
+ <View style={styles.infoColumn}>
+ <Text style={styles.sectionLabel} noMargin>
+ Invoice Info
+ </Text>
+ <KeyValue
+ size="sm"
+ items={[
+ { key: "Issue Date", value: data.invoiceDate },
+ { key: "Due Date", value: data.dueDate },
+ { key: "Payment", value: data.paymentTerms.method },
+ ]}
+ />
+ </View>
+ </View>
+ </View>
+ <Table variant="striped" zebraStripe>
+ <TableHeader>
+ <TableRow header>
+ <TableCell>Deliverable</TableCell>
+ <TableCell align="center">Qty</TableCell>
+ <TableCell align="right">Rate</TableCell>
+ <TableCell align="right">Amount</TableCell>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {data.items.map((item, index) => (
+ // biome-ignore lint/suspicious/noArrayIndexKey: static PDF list, no reordering
+ <TableRow key={index}>
+ <TableCell>{item.description}</TableCell>
+ <TableCell align="center">{`${item.quantity}`}</TableCell>
+ <TableCell align="right">{`$${item.unitPrice.toLocaleString()}`}</TableCell>
+ <TableCell align="right">{`$${(item.quantity * item.unitPrice).toLocaleString()}`}</TableCell>
+ </TableRow>
+ ))}
+ </TableBody>
+ </Table>
+ <Section noWrap style={styles.summarySection}>
+ <View style={styles.summaryLeft}>
+ <Text style={styles.sectionLabel} noMargin>
+ Notes & Terms
+ </Text>
+ <Text variant="xs" color="mutedForeground">
+ {data.notes}
+ </Text>
+ <Text
+ variant="xs"
+ color="mutedForeground"
+ style={{ marginTop: 4 }}
+ >
+ GST: {data.paymentTerms.gst}
+ </Text>
+ </View>
+ <View style={styles.summaryRight}>
+ <KeyValue
+ size="sm"
+ dividerThickness={1}
+ items={[
+ {
+ key: "Subtotal",
+ value: `$${data.summary.subtotal.toLocaleString()}`,
+ },
+ {
+ key: "Tax (6.5%)",
+ value: `$${data.summary.tax.toFixed(2)}`,
+ },
+ {
+ key: "Total",
+ keyStyle: { fontSize: 13, fontWeight: "bold" },
+ value: `$${data.summary.total.toFixed(2)}`,
+ valueStyle: {
+ color: theme.colors.accent,
+ fontSize: 14,
+ fontWeight: "bold",
+ },
+ },
+ ]}
+ divided
+ />
+ </View>
+ </Section>
+ <PageFooter
+ variant="centered"
+ centerText="Thank you for choosing us for your creative needs!"
+ sticky
+ pagePadding={25}
+ />
+ </View>
+ </Page>
+ </Document>
+ );
+}
diff --git a/registry/bases/forme/blocks/invoice-creative/invoice-creative.types.ts b/registry/bases/forme/blocks/invoice-creative/invoice-creative.types.ts
new file mode 100644
index 0000000..58345d6
--- /dev/null
+++ b/registry/bases/forme/blocks/invoice-creative/invoice-creative.types.ts
@@ -0,0 +1,30 @@
+export interface InvoiceCreativeData {
+ invoiceNumber: string;
+ invoiceDate: string;
+ dueDate: string;
+ companyName: string;
+ subtitle: string;
+ companyAddress: string;
+ billTo: {
+ name: string;
+ address: string;
+ email: string;
+ phone: string;
+ };
+ items: {
+ description: string;
+ quantity: number;
+ unitPrice: number;
+ }[];
+ summary: {
+ subtotal: number;
+ tax: number;
+ total: number;
+ };
+ paymentTerms: {
+ dueDate: string;
+ method: string;
+ gst: string;
+ };
+ notes?: string;
+}
diff --git a/registry/bases/forme/blocks/invoice-minimal/invoice-minimal.tsx b/registry/bases/forme/blocks/invoice-minimal/invoice-minimal.tsx
new file mode 100644
index 0000000..ab3ed41
--- /dev/null
+++ b/registry/bases/forme/blocks/invoice-minimal/invoice-minimal.tsx
@@ -0,0 +1,247 @@
+import { Document, Page, StyleSheet, View } from "@formepdf/react";
+
+import type { PdfcnTheme } from "@/registry/themes";
+
+import {
+ KeyValue,
+ PageFooter,
+ PageHeader,
+ PdfcnThemeProvider,
+ Section,
+ Table,
+ TableBody,
+ TableCell,
+ TableHeader,
+ TableRow,
+ Text,
+ usePdfcnTheme,
+} from "../../components";
+import type { InvoiceMinimalData } from "./invoice-minimal.types";
+
+// Sample data — replace with your own props or data source
+const sampleData: InvoiceMinimalData = {
+ billTo: {
+ address: "500 Enterprise Way, Building A",
+ email: "[email protected]",
+ name: "Enterprise Corp",
+ phone: "+1 (555) 246-8135",
+ },
+ companyAddress: "City, Country",
+ companyEmail: "[email protected]",
+ companyName: "Your Company",
+ dueDate: "March 22, 2026",
+ invoiceDate: "February 20, 2026",
+ invoiceNumber: "INV-2026-003",
+ items: [
+ { description: "Annual Licenselan", quantity: 1, unitPrice: 25_000 },
+ { description: "Support & Maintenance", quantity: 12, unitPrice: 1500 },
+ { description: "Custom Integration", quantity: 1, unitPrice: 12_000 },
+ ],
+ notes:
+ "Invoice for annual enterprise subscription. Please retain for your records.",
+ paymentTerms: {
+ dueDate: "March 22, 2026",
+ gst: "GSTIN 123456789",
+ method: "ACH Transfer / Check",
+ },
+ subtitle: "Professional Services",
+ summary: {
+ subtotal: 55_000,
+ tax: 3850,
+ total: 58_850,
+ },
+};
+
+export function InvoiceMinimalDocument({
+ theme,
+ data = sampleData,
+}: {
+ theme?: PdfcnTheme;
+ data?: InvoiceMinimalData;
+}) {
+ return (
+ <PdfcnThemeProvider theme={theme}>
+ <InvoiceMinimalContent data={data} />
+ </PdfcnThemeProvider>
+ );
+}
+
+function InvoiceMinimalContent({ data }: { data: InvoiceMinimalData }) {
+ const theme = usePdfcnTheme();
+
+ const styles = StyleSheet.create({
+ infoLabel: {
+ color: theme.colors.primary,
+ fontSize: 8,
+ fontWeight: "bold",
+ letterSpacing: 0.8,
+ marginBottom: 4,
+ textTransform: "uppercase",
+ },
+ infoRow: {
+ flexDirection: "row",
+ marginBottom: theme.spacing.sectionGap,
+ },
+ invoiceStamp: {
+ alignSelf: "flex-start",
+ borderColor: theme.colors.primary,
+ borderRadius: theme.primitives.borderRadius.sm,
+ borderStyle: "solid",
+ borderWidth: 2,
+ paddingHorizontal: 12,
+ paddingVertical: 8,
+ },
+ page: {
+ backgroundColor: theme.colors.background,
+ padding: theme.spacing.page.marginTop,
+ paddingBottom: theme.spacing.page.marginBottom,
+ },
+ });
+
+ return (
+ <Document title={`Invoice ${data.invoiceNumber}`}>
+ <Page size="A4" margin={48}>
+ <View style={styles.page as never}>
+ <Section
+ noWrap
+ style={{
+ alignItems: "flex-start",
+ flexDirection: "row",
+ marginBottom: theme.spacing.sectionGap,
+ }}
+ >
+ <View style={{ flex: 1 }}>
+ <PageHeader
+ variant="minimal"
+ title={data.companyName}
+ subtitle={`${data.companyAddress} · ${data.companyEmail}`}
+ marginBottom={0}
+ />
+ </View>
+ <View style={styles.invoiceStamp}>
+ <Text
+ style={{
+ color: theme.colors.primary,
+ fontSize: 7,
+ fontWeight: "bold",
+ textAlign: "right",
+ }}
+ noMargin
+ transform="uppercase"
+ >
+ Invoice
+ </Text>
+ <Text
+ style={{
+ color: theme.colors.foreground,
+ fontSize: 14,
+ fontWeight: "bold",
+ textAlign: "right",
+ }}
+ noMargin
+ >
+ {data.invoiceNumber}
+ </Text>
+ <Text
+ style={{
+ color: theme.colors.mutedForeground,
+ fontSize: 8,
+ textAlign: "right",
+ }}
+ noMargin
+ >
+ {data.invoiceDate}
+ </Text>
+ </View>
+ </Section>
+ <View style={styles.infoRow}>
+ <View style={{ flex: 1, paddingRight: 20 }}>
+ <Text style={styles.infoLabel} noMargin>
+ Bill To
+ </Text>
+ <Text variant="sm" noMargin>
+ {data.billTo.name}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.billTo.address}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.billTo.email}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.billTo.phone}
+ </Text>
+ </View>
+ <View style={{ flex: 1 }}>
+ <Text style={styles.infoLabel} noMargin>
+ Invoice Details
+ </Text>
+ <KeyValue
+ size="sm"
+ items={[
+ { key: "Due Date", value: data.dueDate },
+ { key: "Payment", value: data.paymentTerms.method },
+ { key: "GST", value: data.paymentTerms.gst },
+ ]}
+ />
+ </View>
+ </View>
+ <Table variant="compact">
+ <TableHeader>
+ <TableRow header>
+ <TableCell>Description</TableCell>
+ <TableCell align="center">Qty</TableCell>
+ <TableCell align="right">Rate</TableCell>
+ <TableCell align="right">Total</TableCell>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {data.items.map((item, index) => (
+ // biome-ignore lint/suspicious/noArrayIndexKey: invoice items have no stable id
+ <TableRow key={index}>
+ <TableCell>{item.description}</TableCell>
+ <TableCell align="center">{`${item.quantity}`}</TableCell>
+ <TableCell align="right">{`$${item.unitPrice.toLocaleString()}`}</TableCell>
+ <TableCell align="right">{`$${(item.quantity * item.unitPrice).toFixed(2)}`}</TableCell>
+ </TableRow>
+ ))}
+ </TableBody>
+ </Table>
+ <Section noWrap style={{ flexDirection: "row", marginTop: 20 }}>
+ <View style={{ flex: 1 }} />
+ <View style={{ width: 240 }}>
+ <KeyValue
+ size="sm"
+ dividerThickness={1}
+ items={[
+ {
+ key: "Subtotal",
+ value: `$${data.summary.subtotal.toFixed(2)}`,
+ },
+ { key: "Tax (7%)", value: `$${data.summary.tax.toFixed(2)}` },
+ {
+ key: "Balance Due",
+ keyStyle: { fontSize: 12, fontWeight: "bold" },
+ value: `$${data.summary.total.toFixed(2)}`,
+ valueStyle: {
+ color: theme.colors.primary,
+ fontSize: 13,
+ fontWeight: "bold",
+ },
+ },
+ ]}
+ divided
+ />
+ </View>
+ </Section>
+ <PageFooter
+ leftText={data.notes}
+ rightText="Page 1 of 1"
+ sticky
+ pagePadding={25}
+ />
+ </View>
+ </Page>
+ </Document>
+ );
+}
diff --git a/registry/bases/forme/blocks/invoice-minimal/invoice-minimal.types.ts b/registry/bases/forme/blocks/invoice-minimal/invoice-minimal.types.ts
new file mode 100644
index 0000000..3397f19
--- /dev/null
+++ b/registry/bases/forme/blocks/invoice-minimal/invoice-minimal.types.ts
@@ -0,0 +1,31 @@
+export interface InvoiceMinimalData {
+ invoiceNumber: string;
+ invoiceDate: string;
+ dueDate: string;
+ companyName: string;
+ subtitle: string;
+ companyAddress: string;
+ companyEmail: string;
+ billTo: {
+ name: string;
+ address: string;
+ email: string;
+ phone: string;
+ };
+ items: {
+ description: string;
+ quantity: number;
+ unitPrice: number;
+ }[];
+ summary: {
+ subtotal: number;
+ tax: number;
+ total: number;
+ };
+ paymentTerms: {
+ dueDate: string;
+ method: string;
+ gst: string;
+ };
+ notes?: string;
+}
diff --git a/registry/bases/forme/blocks/invoice-modern/invoice-modern.tsx b/registry/bases/forme/blocks/invoice-modern/invoice-modern.tsx
new file mode 100644
index 0000000..d1e74f5
--- /dev/null
+++ b/registry/bases/forme/blocks/invoice-modern/invoice-modern.tsx
@@ -0,0 +1,249 @@
+import { Document, Page, StyleSheet, View } from "@formepdf/react";
+
+import type { PdfcnTheme } from "@/registry/themes";
+
+import {
+ KeyValue,
+ PageFooter,
+ PageHeader,
+ PdfcnThemeProvider,
+ Section,
+ Table,
+ TableBody,
+ TableCell,
+ TableHeader,
+ TableRow,
+ Text,
+ usePdfcnTheme,
+} from "../../components";
+import type { InvoiceModernData } from "./invoice-modern.types";
+
+// Sample data — replace with your own props or data source
+const sampleData: InvoiceModernData = {
+ billTo: {
+ address: "789 Innovation Blvd, Floor 3",
+ email: "[email protected]",
+ name: "TechStart Solutions",
+ phone: "+1 (555) 987-6543",
+ },
+ companyAddress: "City, Country",
+ companyEmail: "[email protected]",
+ companyName: "Your Company",
+ dueDate: "March 20, 2026",
+ invoiceDate: "February 18, 2026",
+ invoiceNumber: "INV-2026-002",
+ items: [
+ { description: "API Integration", quantity: 1, unitPrice: 15_000 },
+ { description: "SEO", quantity: 2, unitPrice: 5500 },
+ { description: "Security Audit", quantity: 1, unitPrice: 7200 },
+ ],
+ notes: "Payment terms: Net 30 days. Thank you for your business!",
+ paymentTerms: {
+ dueDate: "March 20, 2026",
+ gst: "GSTIN 123456789",
+ method: "Wire Transfer / Bank Account",
+ },
+ subtitle: "Professional Services",
+ summary: {
+ subtotal: 33_200,
+ tax: 2324,
+ total: 35_524,
+ },
+};
+
+export function InvoiceModernDocument({
+ theme,
+ data = sampleData,
+}: {
+ theme?: PdfcnTheme;
+ data?: InvoiceModernData;
+}) {
+ return (
+ <PdfcnThemeProvider theme={theme}>
+ <InvoiceModernContent data={data} />
+ </PdfcnThemeProvider>
+ );
+}
+
+function InvoiceModernContent({ data }: { data: InvoiceModernData }) {
+ const theme = usePdfcnTheme();
+
+ const styles = StyleSheet.create({
+ dividerCol: {
+ backgroundColor: theme.colors.border,
+ marginRight: 12,
+ width: 1,
+ },
+ metaCol: {
+ flex: 1,
+ paddingRight: 12,
+ },
+ metaLabel: {
+ color: theme.colors.mutedForeground,
+ fontSize: 8,
+ fontWeight: "bold",
+ letterSpacing: 0.5,
+ marginBottom: 3,
+ textTransform: "uppercase",
+ },
+ metaRow: {
+ flexDirection: "row",
+ marginBottom: theme.spacing.sectionGap,
+ },
+ metaValue: {
+ color: theme.colors.foreground,
+ fontSize: 9,
+ },
+ page: {
+ backgroundColor: theme.colors.background,
+ padding: theme.spacing.page.marginTop,
+ paddingBottom: theme.spacing.page.marginBottom,
+ },
+ });
+
+ return (
+ <Document title={`Invoice ${data.invoiceNumber}`}>
+ <Page size="A4" margin={48}>
+ <View style={styles.page as never}>
+ <PageHeader
+ variant="branded"
+ title={data.companyName}
+ subtitle={`${data.subtitle} · ${data.companyAddress} · ${data.companyEmail}`}
+ />
+ <View style={styles.metaRow}>
+ <View style={styles.metaCol}>
+ <Text style={styles.metaLabel} noMargin>
+ Invoice Number
+ </Text>
+ <Text
+ style={{
+ ...styles.metaValue,
+ fontSize: 11,
+ fontWeight: "bold",
+ }}
+ noMargin
+ >
+ {data.invoiceNumber}
+ </Text>
+ </View>
+ <View style={styles.metaCol}>
+ <Text style={styles.metaLabel} noMargin>
+ Invoice Date
+ </Text>
+ <Text style={styles.metaValue} noMargin>
+ {data.invoiceDate}
+ </Text>
+ </View>
+ <View style={styles.metaCol}>
+ <Text style={styles.metaLabel} noMargin>
+ Due Date
+ </Text>
+ <Text style={styles.metaValue} noMargin>
+ {data.dueDate}
+ </Text>
+ </View>
+ <View style={styles.dividerCol} />
+ <View style={{ flex: 2 }}>
+ <Text style={styles.metaLabel} noMargin>
+ Billed To
+ </Text>
+ <Text
+ style={{ ...styles.metaValue, fontWeight: "bold" }}
+ noMargin
+ >
+ {data.billTo.name}
+ </Text>
+ <Text
+ style={{
+ ...styles.metaValue,
+ color: theme.colors.mutedForeground,
+ }}
+ noMargin
+ >
+ {data.billTo.address}
+ </Text>
+ <Text
+ style={{
+ ...styles.metaValue,
+ color: theme.colors.mutedForeground,
+ }}
+ noMargin
+ >
+ {data.billTo.email}
+ </Text>
+ <Text
+ style={{
+ ...styles.metaValue,
+ color: theme.colors.mutedForeground,
+ }}
+ noMargin
+ >
+ {data.billTo.phone}
+ </Text>
+ </View>
+ </View>
+ <Table variant="primary-header">
+ <TableHeader>
+ <TableRow header>
+ <TableCell>Description</TableCell>
+ <TableCell align="center">Qty</TableCell>
+ <TableCell align="right">Unit Price</TableCell>
+ <TableCell align="right">Amount</TableCell>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {data.items.map((item, index) => (
+ // biome-ignore lint/suspicious/noArrayIndexKey: invoice items have no stable id
+ <TableRow key={index}>
+ <TableCell>{item.description}</TableCell>
+ <TableCell align="center">{`${item.quantity}`}</TableCell>
+ <TableCell align="right">{`$${item.unitPrice.toLocaleString()}`}</TableCell>
+ <TableCell align="right">{`$${(item.quantity * item.unitPrice).toFixed(2)}`}</TableCell>
+ </TableRow>
+ ))}
+ </TableBody>
+ </Table>
+ <Section noWrap style={{ flexDirection: "row", marginTop: 16 }}>
+ <View style={{ flex: 1, paddingRight: 20 }}>
+ <Text style={styles.metaLabel} noMargin>
+ Payment Method
+ </Text>
+ <Text variant="xs" noMargin>
+ {data.paymentTerms.method}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.paymentTerms.gst}
+ </Text>
+ </View>
+ <View style={{ width: 220 }}>
+ <KeyValue
+ size="sm"
+ dividerThickness={1}
+ items={[
+ {
+ key: "Subtotal",
+ value: `$${data.summary.subtotal.toFixed(2)}`,
+ },
+ { key: "Tax (7%)", value: `$${data.summary.tax.toFixed(2)}` },
+ {
+ key: "Total Due",
+ keyStyle: { fontSize: 12, fontWeight: "bold" },
+ value: `$${data.summary.total.toFixed(2)}`,
+ valueStyle: { fontSize: 12, fontWeight: "bold" },
+ },
+ ]}
+ divided
+ />
+ </View>
+ </Section>
+ <PageFooter
+ leftText={data.notes}
+ rightText="Page 1 of 1"
+ sticky
+ pagePadding={25}
+ />
+ </View>
+ </Page>
+ </Document>
+ );
+}
diff --git a/registry/bases/forme/blocks/invoice-modern/invoice-modern.types.ts b/registry/bases/forme/blocks/invoice-modern/invoice-modern.types.ts
new file mode 100644
index 0000000..94d0875
--- /dev/null
+++ b/registry/bases/forme/blocks/invoice-modern/invoice-modern.types.ts
@@ -0,0 +1,31 @@
+export interface InvoiceModernData {
+ invoiceNumber: string;
+ invoiceDate: string;
+ dueDate: string;
+ companyName: string;
+ subtitle: string;
+ companyAddress: string;
+ companyEmail: string;
+ billTo: {
+ name: string;
+ address: string;
+ email: string;
+ phone: string;
+ };
+ items: {
+ description: string;
+ quantity: number;
+ unitPrice: number;
+ }[];
+ summary: {
+ subtotal: number;
+ tax: number;
+ total: number;
+ };
+ paymentTerms: {
+ dueDate: string;
+ method: string;
+ gst: string;
+ };
+ notes?: string;
+}
diff --git a/registry/bases/forme/blocks/report-financial/report-financial.tsx b/registry/bases/forme/blocks/report-financial/report-financial.tsx
new file mode 100644
index 0000000..f856e3f
--- /dev/null
+++ b/registry/bases/forme/blocks/report-financial/report-financial.tsx
@@ -0,0 +1,91 @@
+import { ReportTemplateFrame } from "./report-layout";
+import type { ReportTemplateProps } from "./report-layout";
+import type { BaseReportData } from "./report.types";
+
+const sampleFinancialData: BaseReportData = {
+ author: "Finance Ops",
+ generatedAt: "February 23, 2026",
+ highlights: [
+ "Revenue accelerated after enterprise expansion campaign launch.",
+ "Gross margin improved due to infrastructure cost renegotiation.",
+ "Collections requires executive follow-up on two overdue accounts.",
+ ],
+ period: "Q1 2026",
+ rows: [
+ {
+ label: "Enterprise Sales",
+ owner: "A. Patel",
+ progress: 88,
+ risk: "Low",
+ status: "On Track",
+ },
+ {
+ label: "SMB Sales",
+ owner: "L. Khan",
+ progress: 79,
+ risk: "Medium",
+ status: "On Track",
+ },
+ {
+ label: "Collections",
+ owner: "J. Reyes",
+ progress: 63,
+ risk: "High",
+ status: "At Risk",
+ },
+ {
+ label: "Cost Optimization",
+ owner: "K. Singh",
+ progress: 82,
+ risk: "Low",
+ status: "On Track",
+ },
+ ],
+ series: [
+ { label: "W1", value: 72 },
+ { label: "W2", value: 74 },
+ { label: "W3", value: 76 },
+ { label: "W4", value: 77 },
+ { label: "W5", value: 79 },
+ { label: "W6", value: 80 },
+ { label: "W7", value: 81 },
+ { label: "W8", value: 83 },
+ { label: "W9", value: 82 },
+ { label: "W10", value: 84 },
+ { label: "W11", value: 86 },
+ { label: "W12", value: 88 },
+ ],
+ subtitle: "Revenue, margin, and expense control overview",
+ summary: [
+ { label: "Revenue", tone: "success", trend: "+14.2% QoQ", value: "$2.48M" },
+ {
+ label: "Gross Margin",
+ tone: "success",
+ trend: "+2.1 pts",
+ value: "61.8%",
+ },
+ { label: "Opex", tone: "success", trend: "-3.4% QoQ", value: "$0.93M" },
+ { label: "Runway", tone: "info", trend: "Stable", value: "22 months" },
+ ],
+ title: "Quarterly Financial Report",
+};
+
+export function FinancialReportDocument({
+ theme,
+ data = sampleFinancialData,
+}: ReportTemplateProps) {
+ return (
+ <ReportTemplateFrame
+ theme={theme}
+ data={data}
+ titlePrefix="Financial Report"
+ statusLabel="Finance: Healthy"
+ statusTone="success"
+ graphVariant="line"
+ graphTitle="Revenue trajectory"
+ graphSubtitle="Quarterly weighted revenue index"
+ graphLegend="none"
+ graphColors={["#0F172A"]}
+ />
+ );
+}
diff --git a/registry/bases/forme/blocks/report-financial/report-layout.tsx b/registry/bases/forme/blocks/report-financial/report-layout.tsx
new file mode 100644
index 0000000..9413dad
--- /dev/null
+++ b/registry/bases/forme/blocks/report-financial/report-layout.tsx
@@ -0,0 +1,366 @@
+import { Document, Page, StyleSheet, View } from "@formepdf/react";
+
+import type { PdfcnTheme } from "@/registry/themes";
+
+import {
+ Badge,
+ DataTable,
+ Divider,
+ KeyValue,
+ PageFooter,
+ PageHeader,
+ PdfGraph,
+ PdfList,
+ PdfcnThemeProvider,
+ Section,
+ Stack,
+ Text,
+ usePdfcnTheme,
+} from "../../components";
+import type { BaseReportData } from "./report.types";
+
+export interface ReportTemplateProps {
+ theme?: PdfcnTheme;
+ data?: BaseReportData;
+}
+
+type ReportGraphVariant =
+ | "bar"
+ | "horizontal-bar"
+ | "line"
+ | "area"
+ | "pie"
+ | "donut";
+
+interface ReportLayoutProps {
+ data: BaseReportData;
+ titlePrefix: string;
+ statusLabel: string;
+ statusTone: "success" | "warning" | "destructive" | "info";
+ graphVariant: ReportGraphVariant;
+ graphTitle: string;
+ graphSubtitle: string;
+ graphLegend?: "bottom" | "right" | "none";
+ graphShowValues?: boolean;
+ graphColors?: string[];
+ graphData?: { label: string; value: number }[];
+}
+
+function toneColor(
+ theme: PdfcnTheme,
+ tone: "success" | "warning" | "destructive" | "info"
+) {
+ if (tone === "success") {return theme.colors.success;}
+ if (tone === "warning") {return theme.colors.warning;}
+ if (tone === "destructive") {return theme.colors.destructive;}
+ return theme.colors.info;
+}
+
+export function ReportLayout({
+ data,
+ titlePrefix,
+ statusLabel,
+ statusTone,
+ graphVariant,
+ graphTitle,
+ graphSubtitle,
+ graphLegend = "none",
+ graphShowValues = false,
+ graphColors,
+ graphData,
+}: ReportLayoutProps) {
+ const theme = usePdfcnTheme();
+ const accent = toneColor(theme, statusTone);
+
+ const styles = StyleSheet.create({
+ col: {
+ flex: 1,
+ },
+ graphShell: {
+ backgroundColor: theme.colors.background,
+ borderColor: theme.colors.border,
+ borderRadius: theme.primitives.borderRadius.md,
+ borderStyle: "solid",
+ borderWidth: 1,
+ padding: 12,
+ },
+ metricCard: {
+ backgroundColor: theme.colors.background,
+ borderColor: theme.colors.border,
+ borderRadius: theme.primitives.borderRadius.md,
+ borderStyle: "solid",
+ borderWidth: 1,
+ padding: 8,
+ width: "48.6%",
+ },
+ metricLabel: {
+ color: theme.colors.mutedForeground,
+ fontSize: 8,
+ letterSpacing: 0.5,
+ marginBottom: 2,
+ textTransform: "uppercase",
+ },
+ metricTrend: {
+ color: theme.colors.mutedForeground,
+ fontSize: 9,
+ },
+ metricValue: {
+ color: theme.colors.foreground,
+ fontSize: 14,
+ fontWeight: theme.primitives.fontWeights.bold,
+ marginBottom: 2,
+ },
+ metricsGrid: {
+ flexDirection: "row",
+ flexWrap: "wrap",
+ gap: 8,
+ },
+ page: {
+ backgroundColor: theme.colors.background,
+ paddingBottom: theme.spacing.page.marginBottom,
+ paddingLeft: theme.spacing.page.marginLeft,
+ paddingRight: theme.spacing.page.marginRight,
+ paddingTop: theme.spacing.page.marginTop,
+ },
+ toolbar: {
+ alignItems: "center",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ marginBottom: 8,
+ },
+ twoColumn: {
+ alignItems: "flex-start",
+ flexDirection: "row",
+ gap: 10,
+ },
+ });
+
+ return (
+ <Document title={`${titlePrefix} ${data.period}`}>
+ <Page size="A4" margin={48}>
+ <View style={styles.page as never}>
+ <PageHeader
+ variant="two-column"
+ title={data.title}
+ subtitle={`${titlePrefix} · ${data.subtitle}`}
+ rightText={data.period}
+ rightSubText={`Generated ${data.generatedAt}`}
+ marginBottom={14}
+ />
+
+ <View style={styles.toolbar}>
+ <Badge label={statusLabel} variant={statusTone} size="sm" />
+ <Text variant="xs" color="mutedForeground" noMargin>
+ Author: {data.author}
+ </Text>
+ </View>
+
+ <Section variant="card" padding="md" noWrap>
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Executive Summary
+ </Text>
+ <View style={styles.metricsGrid}>
+ {data.summary.map((metric) => (
+ <View
+ key={metric.label}
+ style={
+ [
+ styles.metricCard,
+ {
+ borderLeftColor: metric.tone
+ ? toneColor(theme, metric.tone)
+ : accent,
+ borderLeftWidth: 3,
+ },
+ ] as never
+ }
+ >
+ <Text style={styles.metricLabel} noMargin>
+ {metric.label}
+ </Text>
+ <Text style={styles.metricValue} noMargin>
+ {metric.value}
+ </Text>
+ {metric.trend ? (
+ <Badge
+ label={metric.trend}
+ size="sm"
+ variant={metric.tone ?? "info"}
+ />
+ ) : null}
+ </View>
+ ))}
+ </View>
+ </Section>
+
+ <Section padding="md" noWrap>
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Performance Trend
+ </Text>
+ <View style={styles.graphShell}>
+ <PdfGraph
+ variant={graphVariant}
+ data={graphData ?? data.series}
+ title={graphTitle}
+ subtitle={graphSubtitle}
+ yLabel={undefined}
+ xLabel={undefined}
+ showGrid={graphVariant !== "pie" && graphVariant !== "donut"}
+ showValues={graphShowValues}
+ smooth={graphVariant === "line" || graphVariant === "area"}
+ legend={graphLegend}
+ height={200}
+ colors={graphColors}
+ fullWidth
+ containerPadding={12}
+ wrapperPadding={12}
+ style={{ marginBottom: 0 }}
+ />
+ </View>
+ </Section>
+
+ <Section padding="md">
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Delivery Table
+ </Text>
+ <DataTable
+ variant="compact"
+ size="compact"
+ stripe
+ columns={[
+ { header: "Stream", key: "label" },
+ { header: "Owner", key: "owner" },
+ { align: "center", header: "Status", key: "status" },
+ {
+ align: "right",
+ header: "Progress",
+ key: "progress",
+ render: (value) => `${String(value)}%`,
+ },
+ { align: "right", header: "Risk", key: "risk" },
+ ]}
+ data={data.rows}
+ footer={{
+ label: "Totals",
+ owner: "-",
+ progress: Math.round(
+ data.rows.reduce((sum, row) => sum + row.progress, 0) /
+ Math.max(data.rows.length, 1)
+ ),
+ risk: "-",
+ status: "-",
+ }}
+ />
+ </Section>
+
+ <Section padding="md" variant="card" noWrap>
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Highlights & Risks
+ </Text>
+ <View style={styles.twoColumn}>
+ <View style={styles.col}>
+ <PdfList
+ variant="checklist"
+ items={data.highlights.map((item) => ({
+ checked: true,
+ text: item,
+ }))}
+ gap="sm"
+ />
+ </View>
+ <View style={styles.col}>
+ <KeyValue
+ size="sm"
+ divided
+ items={[
+ {
+ key: "Open Risks",
+ value: `${data.rows.filter((r) => r.risk !== "Low").length}`,
+ },
+ {
+ key: "On-Track Streams",
+ value: `${data.rows.filter((r) => r.status === "On Track").length}/${data.rows.length}`,
+ },
+ {
+ key: "Average Progress",
+ value: `${Math.round(
+ data.rows.reduce((sum, row) => sum + row.progress, 0) /
+ Math.max(data.rows.length, 1)
+ )}%`,
+ },
+ ]}
+ />
+ </View>
+ </View>
+ <Divider />
+ <Stack gap="sm">
+ <Text variant="xs" color="mutedForeground" noMargin>
+ Best practice: keep each section under one page using `noWrap`
+ for concise blocks.
+ </Text>
+ <Text variant="xs" color="mutedForeground" noMargin>
+ Best practice: pass explicit row keys/owners to avoid ambiguous
+ reporting handoffs.
+ </Text>
+ </Stack>
+ </Section>
+
+ <PageFooter
+ variant="three-column"
+ leftText="Confidential — Internal Use"
+ centerText="Generated with PDFx"
+ rightText="Page 1 of 1"
+ sticky
+ pagePadding={theme.spacing.page.marginLeft}
+ />
+ </View>
+ </Page>
+ </Document>
+ );
+}
+
+export function ReportTemplateFrame({
+ theme,
+ data,
+ titlePrefix,
+ statusLabel,
+ statusTone,
+ graphVariant,
+ graphTitle,
+ graphSubtitle,
+ graphLegend,
+ graphShowValues,
+ graphColors,
+ graphData,
+}: ReportTemplateProps & {
+ titlePrefix: string;
+ statusLabel: string;
+ statusTone: "success" | "warning" | "destructive" | "info";
+ graphVariant: ReportGraphVariant;
+ graphTitle: string;
+ graphSubtitle: string;
+ graphLegend?: "bottom" | "right" | "none";
+ graphShowValues?: boolean;
+ graphColors?: string[];
+ graphData?: { label: string; value: number }[];
+}) {
+ if (!data) {return null;}
+
+ return (
+ <PdfcnThemeProvider theme={theme}>
+ <ReportLayout
+ data={data}
+ titlePrefix={titlePrefix}
+ statusLabel={statusLabel}
+ statusTone={statusTone}
+ graphVariant={graphVariant}
+ graphTitle={graphTitle}
+ graphSubtitle={graphSubtitle}
+ graphLegend={graphLegend}
+ graphShowValues={graphShowValues}
+ graphColors={graphColors}
+ graphData={graphData}
+ />
+ </PdfcnThemeProvider>
+ );
+}
diff --git a/registry/bases/forme/blocks/report-financial/report.types.ts b/registry/bases/forme/blocks/report-financial/report.types.ts
new file mode 100644
index 0000000..0a80a7b
--- /dev/null
+++ b/registry/bases/forme/blocks/report-financial/report.types.ts
@@ -0,0 +1,31 @@
+export interface SummaryMetric {
+ label: string;
+ value: string;
+ trend?: string;
+ tone?: "success" | "warning" | "destructive" | "info";
+}
+
+export type ReportRow = Record<string, unknown> & {
+ label: string;
+ owner: string;
+ status: string;
+ progress: number;
+ risk?: string;
+};
+
+export interface ReportSeriesPoint {
+ label: string;
+ value: number;
+}
+
+export interface BaseReportData {
+ title: string;
+ subtitle: string;
+ generatedAt: string;
+ period: string;
+ author: string;
+ summary: SummaryMetric[];
+ rows: ReportRow[];
+ series: ReportSeriesPoint[];
+ highlights: string[];
+}
diff --git a/registry/bases/forme/blocks/report-marketing/report-layout.tsx b/registry/bases/forme/blocks/report-marketing/report-layout.tsx
new file mode 100644
index 0000000..9413dad
--- /dev/null
+++ b/registry/bases/forme/blocks/report-marketing/report-layout.tsx
@@ -0,0 +1,366 @@
+import { Document, Page, StyleSheet, View } from "@formepdf/react";
+
+import type { PdfcnTheme } from "@/registry/themes";
+
+import {
+ Badge,
+ DataTable,
+ Divider,
+ KeyValue,
+ PageFooter,
+ PageHeader,
+ PdfGraph,
+ PdfList,
+ PdfcnThemeProvider,
+ Section,
+ Stack,
+ Text,
+ usePdfcnTheme,
+} from "../../components";
+import type { BaseReportData } from "./report.types";
+
+export interface ReportTemplateProps {
+ theme?: PdfcnTheme;
+ data?: BaseReportData;
+}
+
+type ReportGraphVariant =
+ | "bar"
+ | "horizontal-bar"
+ | "line"
+ | "area"
+ | "pie"
+ | "donut";
+
+interface ReportLayoutProps {
+ data: BaseReportData;
+ titlePrefix: string;
+ statusLabel: string;
+ statusTone: "success" | "warning" | "destructive" | "info";
+ graphVariant: ReportGraphVariant;
+ graphTitle: string;
+ graphSubtitle: string;
+ graphLegend?: "bottom" | "right" | "none";
+ graphShowValues?: boolean;
+ graphColors?: string[];
+ graphData?: { label: string; value: number }[];
+}
+
+function toneColor(
+ theme: PdfcnTheme,
+ tone: "success" | "warning" | "destructive" | "info"
+) {
+ if (tone === "success") {return theme.colors.success;}
+ if (tone === "warning") {return theme.colors.warning;}
+ if (tone === "destructive") {return theme.colors.destructive;}
+ return theme.colors.info;
+}
+
+export function ReportLayout({
+ data,
+ titlePrefix,
+ statusLabel,
+ statusTone,
+ graphVariant,
+ graphTitle,
+ graphSubtitle,
+ graphLegend = "none",
+ graphShowValues = false,
+ graphColors,
+ graphData,
+}: ReportLayoutProps) {
+ const theme = usePdfcnTheme();
+ const accent = toneColor(theme, statusTone);
+
+ const styles = StyleSheet.create({
+ col: {
+ flex: 1,
+ },
+ graphShell: {
+ backgroundColor: theme.colors.background,
+ borderColor: theme.colors.border,
+ borderRadius: theme.primitives.borderRadius.md,
+ borderStyle: "solid",
+ borderWidth: 1,
+ padding: 12,
+ },
+ metricCard: {
+ backgroundColor: theme.colors.background,
+ borderColor: theme.colors.border,
+ borderRadius: theme.primitives.borderRadius.md,
+ borderStyle: "solid",
+ borderWidth: 1,
+ padding: 8,
+ width: "48.6%",
+ },
+ metricLabel: {
+ color: theme.colors.mutedForeground,
+ fontSize: 8,
+ letterSpacing: 0.5,
+ marginBottom: 2,
+ textTransform: "uppercase",
+ },
+ metricTrend: {
+ color: theme.colors.mutedForeground,
+ fontSize: 9,
+ },
+ metricValue: {
+ color: theme.colors.foreground,
+ fontSize: 14,
+ fontWeight: theme.primitives.fontWeights.bold,
+ marginBottom: 2,
+ },
+ metricsGrid: {
+ flexDirection: "row",
+ flexWrap: "wrap",
+ gap: 8,
+ },
+ page: {
+ backgroundColor: theme.colors.background,
+ paddingBottom: theme.spacing.page.marginBottom,
+ paddingLeft: theme.spacing.page.marginLeft,
+ paddingRight: theme.spacing.page.marginRight,
+ paddingTop: theme.spacing.page.marginTop,
+ },
+ toolbar: {
+ alignItems: "center",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ marginBottom: 8,
+ },
+ twoColumn: {
+ alignItems: "flex-start",
+ flexDirection: "row",
+ gap: 10,
+ },
+ });
+
+ return (
+ <Document title={`${titlePrefix} ${data.period}`}>
+ <Page size="A4" margin={48}>
+ <View style={styles.page as never}>
+ <PageHeader
+ variant="two-column"
+ title={data.title}
+ subtitle={`${titlePrefix} · ${data.subtitle}`}
+ rightText={data.period}
+ rightSubText={`Generated ${data.generatedAt}`}
+ marginBottom={14}
+ />
+
+ <View style={styles.toolbar}>
+ <Badge label={statusLabel} variant={statusTone} size="sm" />
+ <Text variant="xs" color="mutedForeground" noMargin>
+ Author: {data.author}
+ </Text>
+ </View>
+
+ <Section variant="card" padding="md" noWrap>
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Executive Summary
+ </Text>
+ <View style={styles.metricsGrid}>
+ {data.summary.map((metric) => (
+ <View
+ key={metric.label}
+ style={
+ [
+ styles.metricCard,
+ {
+ borderLeftColor: metric.tone
+ ? toneColor(theme, metric.tone)
+ : accent,
+ borderLeftWidth: 3,
+ },
+ ] as never
+ }
+ >
+ <Text style={styles.metricLabel} noMargin>
+ {metric.label}
+ </Text>
+ <Text style={styles.metricValue} noMargin>
+ {metric.value}
+ </Text>
+ {metric.trend ? (
+ <Badge
+ label={metric.trend}
+ size="sm"
+ variant={metric.tone ?? "info"}
+ />
+ ) : null}
+ </View>
+ ))}
+ </View>
+ </Section>
+
+ <Section padding="md" noWrap>
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Performance Trend
+ </Text>
+ <View style={styles.graphShell}>
+ <PdfGraph
+ variant={graphVariant}
+ data={graphData ?? data.series}
+ title={graphTitle}
+ subtitle={graphSubtitle}
+ yLabel={undefined}
+ xLabel={undefined}
+ showGrid={graphVariant !== "pie" && graphVariant !== "donut"}
+ showValues={graphShowValues}
+ smooth={graphVariant === "line" || graphVariant === "area"}
+ legend={graphLegend}
+ height={200}
+ colors={graphColors}
+ fullWidth
+ containerPadding={12}
+ wrapperPadding={12}
+ style={{ marginBottom: 0 }}
+ />
+ </View>
+ </Section>
+
+ <Section padding="md">
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Delivery Table
+ </Text>
+ <DataTable
+ variant="compact"
+ size="compact"
+ stripe
+ columns={[
+ { header: "Stream", key: "label" },
+ { header: "Owner", key: "owner" },
+ { align: "center", header: "Status", key: "status" },
+ {
+ align: "right",
+ header: "Progress",
+ key: "progress",
+ render: (value) => `${String(value)}%`,
+ },
+ { align: "right", header: "Risk", key: "risk" },
+ ]}
+ data={data.rows}
+ footer={{
+ label: "Totals",
+ owner: "-",
+ progress: Math.round(
+ data.rows.reduce((sum, row) => sum + row.progress, 0) /
+ Math.max(data.rows.length, 1)
+ ),
+ risk: "-",
+ status: "-",
+ }}
+ />
+ </Section>
+
+ <Section padding="md" variant="card" noWrap>
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Highlights & Risks
+ </Text>
+ <View style={styles.twoColumn}>
+ <View style={styles.col}>
+ <PdfList
+ variant="checklist"
+ items={data.highlights.map((item) => ({
+ checked: true,
+ text: item,
+ }))}
+ gap="sm"
+ />
+ </View>
+ <View style={styles.col}>
+ <KeyValue
+ size="sm"
+ divided
+ items={[
+ {
+ key: "Open Risks",
+ value: `${data.rows.filter((r) => r.risk !== "Low").length}`,
+ },
+ {
+ key: "On-Track Streams",
+ value: `${data.rows.filter((r) => r.status === "On Track").length}/${data.rows.length}`,
+ },
+ {
+ key: "Average Progress",
+ value: `${Math.round(
+ data.rows.reduce((sum, row) => sum + row.progress, 0) /
+ Math.max(data.rows.length, 1)
+ )}%`,
+ },
+ ]}
+ />
+ </View>
+ </View>
+ <Divider />
+ <Stack gap="sm">
+ <Text variant="xs" color="mutedForeground" noMargin>
+ Best practice: keep each section under one page using `noWrap`
+ for concise blocks.
+ </Text>
+ <Text variant="xs" color="mutedForeground" noMargin>
+ Best practice: pass explicit row keys/owners to avoid ambiguous
+ reporting handoffs.
+ </Text>
+ </Stack>
+ </Section>
+
+ <PageFooter
+ variant="three-column"
+ leftText="Confidential — Internal Use"
+ centerText="Generated with PDFx"
+ rightText="Page 1 of 1"
+ sticky
+ pagePadding={theme.spacing.page.marginLeft}
+ />
+ </View>
+ </Page>
+ </Document>
+ );
+}
+
+export function ReportTemplateFrame({
+ theme,
+ data,
+ titlePrefix,
+ statusLabel,
+ statusTone,
+ graphVariant,
+ graphTitle,
+ graphSubtitle,
+ graphLegend,
+ graphShowValues,
+ graphColors,
+ graphData,
+}: ReportTemplateProps & {
+ titlePrefix: string;
+ statusLabel: string;
+ statusTone: "success" | "warning" | "destructive" | "info";
+ graphVariant: ReportGraphVariant;
+ graphTitle: string;
+ graphSubtitle: string;
+ graphLegend?: "bottom" | "right" | "none";
+ graphShowValues?: boolean;
+ graphColors?: string[];
+ graphData?: { label: string; value: number }[];
+}) {
+ if (!data) {return null;}
+
+ return (
+ <PdfcnThemeProvider theme={theme}>
+ <ReportLayout
+ data={data}
+ titlePrefix={titlePrefix}
+ statusLabel={statusLabel}
+ statusTone={statusTone}
+ graphVariant={graphVariant}
+ graphTitle={graphTitle}
+ graphSubtitle={graphSubtitle}
+ graphLegend={graphLegend}
+ graphShowValues={graphShowValues}
+ graphColors={graphColors}
+ graphData={graphData}
+ />
+ </PdfcnThemeProvider>
+ );
+}
diff --git a/registry/bases/forme/blocks/report-marketing/report-marketing.tsx b/registry/bases/forme/blocks/report-marketing/report-marketing.tsx
new file mode 100644
index 0000000..928ea15
--- /dev/null
+++ b/registry/bases/forme/blocks/report-marketing/report-marketing.tsx
@@ -0,0 +1,87 @@
+import { ReportTemplateFrame } from "./report-layout";
+import type { ReportTemplateProps } from "./report-layout";
+import type { BaseReportData } from "./report.types";
+
+const sampleMarketingData: BaseReportData = {
+ author: "Growth Team",
+ generatedAt: "February 23, 2026",
+ highlights: [
+ "Channel mix improved CAC while maintaining lead quality.",
+ "Lifecycle email workflow has deliverability issues under investigation.",
+ "Referral program is producing higher-intent pipeline with lower cost.",
+ ],
+ period: "Campaign Cycle 2026-02",
+ rows: [
+ {
+ label: "SEO",
+ owner: "H. Evans",
+ progress: 84,
+ risk: "Low",
+ status: "On Track",
+ },
+ {
+ label: "Paid Search",
+ owner: "K. Martin",
+ progress: 80,
+ risk: "Low",
+ status: "On Track",
+ },
+ {
+ label: "Lifecycle Email",
+ owner: "V. Lee",
+ progress: 64,
+ risk: "Medium",
+ status: "At Risk",
+ },
+ {
+ label: "Partner Referrals",
+ owner: "J. Gomez",
+ progress: 75,
+ risk: "Medium",
+ status: "On Track",
+ },
+ ],
+ series: [
+ { label: "W1", value: 55 },
+ { label: "W2", value: 57 },
+ { label: "W3", value: 59 },
+ { label: "W4", value: 60 },
+ { label: "W5", value: 62 },
+ { label: "W6", value: 63 },
+ { label: "W7", value: 65 },
+ { label: "W8", value: 67 },
+ { label: "W9", value: 66 },
+ { label: "W10", value: 68 },
+ { label: "W11", value: 70 },
+ { label: "W12", value: 72 },
+ ],
+ subtitle: "Pipeline, conversion efficiency, and channel performance",
+ summary: [
+ { label: "MQLs", tone: "success", trend: "+22.1% cycle", value: "3,940" },
+ { label: "CAC", tone: "success", trend: "-7.4%", value: "$118" },
+ { label: "Win Rate", tone: "info", trend: "+1.1 pts", value: "28.6%" },
+ { label: "Churn Risk", tone: "warning", trend: "+0.8 pts", value: "6.2%" },
+ ],
+ title: "Growth & Marketing Report",
+};
+
+export function MarketingReportDocument({
+ theme,
+ data = sampleMarketingData,
+}: ReportTemplateProps) {
+ return (
+ <ReportTemplateFrame
+ theme={theme}
+ data={data}
+ titlePrefix="Growth Report"
+ statusLabel="Growth: Strong"
+ statusTone="success"
+ graphVariant="bar"
+ graphTitle="Pipeline build by week"
+ graphSubtitle="Demand creation output trend"
+ graphLegend="none"
+ graphShowValues
+ graphColors={["#0EA5E9"]}
+ />
+ );
+}
diff --git a/registry/bases/forme/blocks/report-marketing/report.types.ts b/registry/bases/forme/blocks/report-marketing/report.types.ts
new file mode 100644
index 0000000..0a80a7b
--- /dev/null
+++ b/registry/bases/forme/blocks/report-marketing/report.types.ts
@@ -0,0 +1,31 @@
+export interface SummaryMetric {
+ label: string;
+ value: string;
+ trend?: string;
+ tone?: "success" | "warning" | "destructive" | "info";
+}
+
+export type ReportRow = Record<string, unknown> & {
+ label: string;
+ owner: string;
+ status: string;
+ progress: number;
+ risk?: string;
+};
+
+export interface ReportSeriesPoint {
+ label: string;
+ value: number;
+}
+
+export interface BaseReportData {
+ title: string;
+ subtitle: string;
+ generatedAt: string;
+ period: string;
+ author: string;
+ summary: SummaryMetric[];
+ rows: ReportRow[];
+ series: ReportSeriesPoint[];
+ highlights: string[];
+}
diff --git a/registry/bases/forme/blocks/report-operations/report-layout.tsx b/registry/bases/forme/blocks/report-operations/report-layout.tsx
new file mode 100644
index 0000000..9413dad
--- /dev/null
+++ b/registry/bases/forme/blocks/report-operations/report-layout.tsx
@@ -0,0 +1,366 @@
+import { Document, Page, StyleSheet, View } from "@formepdf/react";
+
+import type { PdfcnTheme } from "@/registry/themes";
+
+import {
+ Badge,
+ DataTable,
+ Divider,
+ KeyValue,
+ PageFooter,
+ PageHeader,
+ PdfGraph,
+ PdfList,
+ PdfcnThemeProvider,
+ Section,
+ Stack,
+ Text,
+ usePdfcnTheme,
+} from "../../components";
+import type { BaseReportData } from "./report.types";
+
+export interface ReportTemplateProps {
+ theme?: PdfcnTheme;
+ data?: BaseReportData;
+}
+
+type ReportGraphVariant =
+ | "bar"
+ | "horizontal-bar"
+ | "line"
+ | "area"
+ | "pie"
+ | "donut";
+
+interface ReportLayoutProps {
+ data: BaseReportData;
+ titlePrefix: string;
+ statusLabel: string;
+ statusTone: "success" | "warning" | "destructive" | "info";
+ graphVariant: ReportGraphVariant;
+ graphTitle: string;
+ graphSubtitle: string;
+ graphLegend?: "bottom" | "right" | "none";
+ graphShowValues?: boolean;
+ graphColors?: string[];
+ graphData?: { label: string; value: number }[];
+}
+
+function toneColor(
+ theme: PdfcnTheme,
+ tone: "success" | "warning" | "destructive" | "info"
+) {
+ if (tone === "success") {return theme.colors.success;}
+ if (tone === "warning") {return theme.colors.warning;}
+ if (tone === "destructive") {return theme.colors.destructive;}
+ return theme.colors.info;
+}
+
+export function ReportLayout({
+ data,
+ titlePrefix,
+ statusLabel,
+ statusTone,
+ graphVariant,
+ graphTitle,
+ graphSubtitle,
+ graphLegend = "none",
+ graphShowValues = false,
+ graphColors,
+ graphData,
+}: ReportLayoutProps) {
+ const theme = usePdfcnTheme();
+ const accent = toneColor(theme, statusTone);
+
+ const styles = StyleSheet.create({
+ col: {
+ flex: 1,
+ },
+ graphShell: {
+ backgroundColor: theme.colors.background,
+ borderColor: theme.colors.border,
+ borderRadius: theme.primitives.borderRadius.md,
+ borderStyle: "solid",
+ borderWidth: 1,
+ padding: 12,
+ },
+ metricCard: {
+ backgroundColor: theme.colors.background,
+ borderColor: theme.colors.border,
+ borderRadius: theme.primitives.borderRadius.md,
+ borderStyle: "solid",
+ borderWidth: 1,
+ padding: 8,
+ width: "48.6%",
+ },
+ metricLabel: {
+ color: theme.colors.mutedForeground,
+ fontSize: 8,
+ letterSpacing: 0.5,
+ marginBottom: 2,
+ textTransform: "uppercase",
+ },
+ metricTrend: {
+ color: theme.colors.mutedForeground,
+ fontSize: 9,
+ },
+ metricValue: {
+ color: theme.colors.foreground,
+ fontSize: 14,
+ fontWeight: theme.primitives.fontWeights.bold,
+ marginBottom: 2,
+ },
+ metricsGrid: {
+ flexDirection: "row",
+ flexWrap: "wrap",
+ gap: 8,
+ },
+ page: {
+ backgroundColor: theme.colors.background,
+ paddingBottom: theme.spacing.page.marginBottom,
+ paddingLeft: theme.spacing.page.marginLeft,
+ paddingRight: theme.spacing.page.marginRight,
+ paddingTop: theme.spacing.page.marginTop,
+ },
+ toolbar: {
+ alignItems: "center",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ marginBottom: 8,
+ },
+ twoColumn: {
+ alignItems: "flex-start",
+ flexDirection: "row",
+ gap: 10,
+ },
+ });
+
+ return (
+ <Document title={`${titlePrefix} ${data.period}`}>
+ <Page size="A4" margin={48}>
+ <View style={styles.page as never}>
+ <PageHeader
+ variant="two-column"
+ title={data.title}
+ subtitle={`${titlePrefix} · ${data.subtitle}`}
+ rightText={data.period}
+ rightSubText={`Generated ${data.generatedAt}`}
+ marginBottom={14}
+ />
+
+ <View style={styles.toolbar}>
+ <Badge label={statusLabel} variant={statusTone} size="sm" />
+ <Text variant="xs" color="mutedForeground" noMargin>
+ Author: {data.author}
+ </Text>
+ </View>
+
+ <Section variant="card" padding="md" noWrap>
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Executive Summary
+ </Text>
+ <View style={styles.metricsGrid}>
+ {data.summary.map((metric) => (
+ <View
+ key={metric.label}
+ style={
+ [
+ styles.metricCard,
+ {
+ borderLeftColor: metric.tone
+ ? toneColor(theme, metric.tone)
+ : accent,
+ borderLeftWidth: 3,
+ },
+ ] as never
+ }
+ >
+ <Text style={styles.metricLabel} noMargin>
+ {metric.label}
+ </Text>
+ <Text style={styles.metricValue} noMargin>
+ {metric.value}
+ </Text>
+ {metric.trend ? (
+ <Badge
+ label={metric.trend}
+ size="sm"
+ variant={metric.tone ?? "info"}
+ />
+ ) : null}
+ </View>
+ ))}
+ </View>
+ </Section>
+
+ <Section padding="md" noWrap>
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Performance Trend
+ </Text>
+ <View style={styles.graphShell}>
+ <PdfGraph
+ variant={graphVariant}
+ data={graphData ?? data.series}
+ title={graphTitle}
+ subtitle={graphSubtitle}
+ yLabel={undefined}
+ xLabel={undefined}
+ showGrid={graphVariant !== "pie" && graphVariant !== "donut"}
+ showValues={graphShowValues}
+ smooth={graphVariant === "line" || graphVariant === "area"}
+ legend={graphLegend}
+ height={200}
+ colors={graphColors}
+ fullWidth
+ containerPadding={12}
+ wrapperPadding={12}
+ style={{ marginBottom: 0 }}
+ />
+ </View>
+ </Section>
+
+ <Section padding="md">
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Delivery Table
+ </Text>
+ <DataTable
+ variant="compact"
+ size="compact"
+ stripe
+ columns={[
+ { header: "Stream", key: "label" },
+ { header: "Owner", key: "owner" },
+ { align: "center", header: "Status", key: "status" },
+ {
+ align: "right",
+ header: "Progress",
+ key: "progress",
+ render: (value) => `${String(value)}%`,
+ },
+ { align: "right", header: "Risk", key: "risk" },
+ ]}
+ data={data.rows}
+ footer={{
+ label: "Totals",
+ owner: "-",
+ progress: Math.round(
+ data.rows.reduce((sum, row) => sum + row.progress, 0) /
+ Math.max(data.rows.length, 1)
+ ),
+ risk: "-",
+ status: "-",
+ }}
+ />
+ </Section>
+
+ <Section padding="md" variant="card" noWrap>
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Highlights & Risks
+ </Text>
+ <View style={styles.twoColumn}>
+ <View style={styles.col}>
+ <PdfList
+ variant="checklist"
+ items={data.highlights.map((item) => ({
+ checked: true,
+ text: item,
+ }))}
+ gap="sm"
+ />
+ </View>
+ <View style={styles.col}>
+ <KeyValue
+ size="sm"
+ divided
+ items={[
+ {
+ key: "Open Risks",
+ value: `${data.rows.filter((r) => r.risk !== "Low").length}`,
+ },
+ {
+ key: "On-Track Streams",
+ value: `${data.rows.filter((r) => r.status === "On Track").length}/${data.rows.length}`,
+ },
+ {
+ key: "Average Progress",
+ value: `${Math.round(
+ data.rows.reduce((sum, row) => sum + row.progress, 0) /
+ Math.max(data.rows.length, 1)
+ )}%`,
+ },
+ ]}
+ />
+ </View>
+ </View>
+ <Divider />
+ <Stack gap="sm">
+ <Text variant="xs" color="mutedForeground" noMargin>
+ Best practice: keep each section under one page using `noWrap`
+ for concise blocks.
+ </Text>
+ <Text variant="xs" color="mutedForeground" noMargin>
+ Best practice: pass explicit row keys/owners to avoid ambiguous
+ reporting handoffs.
+ </Text>
+ </Stack>
+ </Section>
+
+ <PageFooter
+ variant="three-column"
+ leftText="Confidential — Internal Use"
+ centerText="Generated with PDFx"
+ rightText="Page 1 of 1"
+ sticky
+ pagePadding={theme.spacing.page.marginLeft}
+ />
+ </View>
+ </Page>
+ </Document>
+ );
+}
+
+export function ReportTemplateFrame({
+ theme,
+ data,
+ titlePrefix,
+ statusLabel,
+ statusTone,
+ graphVariant,
+ graphTitle,
+ graphSubtitle,
+ graphLegend,
+ graphShowValues,
+ graphColors,
+ graphData,
+}: ReportTemplateProps & {
+ titlePrefix: string;
+ statusLabel: string;
+ statusTone: "success" | "warning" | "destructive" | "info";
+ graphVariant: ReportGraphVariant;
+ graphTitle: string;
+ graphSubtitle: string;
+ graphLegend?: "bottom" | "right" | "none";
+ graphShowValues?: boolean;
+ graphColors?: string[];
+ graphData?: { label: string; value: number }[];
+}) {
+ if (!data) {return null;}
+
+ return (
+ <PdfcnThemeProvider theme={theme}>
+ <ReportLayout
+ data={data}
+ titlePrefix={titlePrefix}
+ statusLabel={statusLabel}
+ statusTone={statusTone}
+ graphVariant={graphVariant}
+ graphTitle={graphTitle}
+ graphSubtitle={graphSubtitle}
+ graphLegend={graphLegend}
+ graphShowValues={graphShowValues}
+ graphColors={graphColors}
+ graphData={graphData}
+ />
+ </PdfcnThemeProvider>
+ );
+}
diff --git a/registry/bases/forme/blocks/report-operations/report-operations.tsx b/registry/bases/forme/blocks/report-operations/report-operations.tsx
new file mode 100644
index 0000000..bffef43
--- /dev/null
+++ b/registry/bases/forme/blocks/report-operations/report-operations.tsx
@@ -0,0 +1,103 @@
+import { ReportTemplateFrame } from "./report-layout";
+import type { ReportTemplateProps } from "./report-layout";
+import type { BaseReportData } from "./report.types";
+
+const sampleOperationsData: BaseReportData = {
+ author: "Delivery Office",
+ generatedAt: "February 23, 2026",
+ highlights: [
+ "SLA improved after shift rebalancing and incident triage changes.",
+ "Backlog grew in week 4 due to release-related ticket surge.",
+ "Incident queue remediation plan has executive sponsorship and budget.",
+ ],
+ period: "February 2026",
+ rows: [
+ {
+ label: "L1 Support",
+ owner: "N. Mehta",
+ progress: 91,
+ risk: "Low",
+ status: "On Track",
+ },
+ {
+ label: "L2 Support",
+ owner: "D. Chen",
+ progress: 85,
+ risk: "Low",
+ status: "On Track",
+ },
+ {
+ label: "Incident Queue",
+ owner: "R. Walker",
+ progress: 66,
+ risk: "High",
+ status: "At Risk",
+ },
+ {
+ label: "Automation Rollout",
+ owner: "M. Roy",
+ progress: 77,
+ risk: "Medium",
+ status: "On Track",
+ },
+ ],
+ series: [
+ { label: "W1", value: 69 },
+ { label: "W2", value: 71 },
+ { label: "W3", value: 73 },
+ { label: "W4", value: 74 },
+ { label: "W5", value: 75 },
+ { label: "W6", value: 76 },
+ { label: "W7", value: 78 },
+ { label: "W8", value: 79 },
+ { label: "W9", value: 78 },
+ { label: "W10", value: 80 },
+ { label: "W11", value: 81 },
+ { label: "W12", value: 83 },
+ ],
+ subtitle: "Delivery throughput, SLA adherence, and backlog visibility",
+ summary: [
+ {
+ label: "Tickets Closed",
+ tone: "success",
+ trend: "+9.8% MoM",
+ value: "1,284",
+ },
+ {
+ label: "SLA Hit Rate",
+ tone: "success",
+ trend: "+1.4 pts",
+ value: "96.1%",
+ },
+ { label: "Backlog", tone: "warning", trend: "+6.0%", value: "214" },
+ { label: "Escalations", tone: "success", trend: "-18.5%", value: "17" },
+ ],
+ title: "Monthly Operations Report",
+};
+
+export function OperationsReportDocument({
+ theme,
+ data = sampleOperationsData,
+}: ReportTemplateProps) {
+ return (
+ <ReportTemplateFrame
+ theme={theme}
+ data={data}
+ titlePrefix="Operations Report"
+ statusLabel="Ops: Watch"
+ statusTone="warning"
+ graphVariant="horizontal-bar"
+ graphTitle="Throughput by week"
+ graphSubtitle="Resolved workload distribution"
+ graphLegend="none"
+ graphShowValues
+ graphColors={["#2563EB"]}
+ graphData={[
+ { label: "Incident", value: 66 },
+ { label: "Automation", value: 77 },
+ { label: "L2 Support", value: 85 },
+ { label: "L1 Support", value: 91 },
+ ]}
+ />
+ );
+}
diff --git a/registry/bases/forme/blocks/report-operations/report.types.ts b/registry/bases/forme/blocks/report-operations/report.types.ts
new file mode 100644
index 0000000..0a80a7b
--- /dev/null
+++ b/registry/bases/forme/blocks/report-operations/report.types.ts
@@ -0,0 +1,31 @@
+export interface SummaryMetric {
+ label: string;
+ value: string;
+ trend?: string;
+ tone?: "success" | "warning" | "destructive" | "info";
+}
+
+export type ReportRow = Record<string, unknown> & {
+ label: string;
+ owner: string;
+ status: string;
+ progress: number;
+ risk?: string;
+};
+
+export interface ReportSeriesPoint {
+ label: string;
+ value: number;
+}
+
+export interface BaseReportData {
+ title: string;
+ subtitle: string;
+ generatedAt: string;
+ period: string;
+ author: string;
+ summary: SummaryMetric[];
+ rows: ReportRow[];
+ series: ReportSeriesPoint[];
+ highlights: string[];
+}
diff --git a/registry/bases/forme/blocks/report-security/report-layout.tsx b/registry/bases/forme/blocks/report-security/report-layout.tsx
new file mode 100644
index 0000000..9413dad
--- /dev/null
+++ b/registry/bases/forme/blocks/report-security/report-layout.tsx
@@ -0,0 +1,366 @@
+import { Document, Page, StyleSheet, View } from "@formepdf/react";
+
+import type { PdfcnTheme } from "@/registry/themes";
+
+import {
+ Badge,
+ DataTable,
+ Divider,
+ KeyValue,
+ PageFooter,
+ PageHeader,
+ PdfGraph,
+ PdfList,
+ PdfcnThemeProvider,
+ Section,
+ Stack,
+ Text,
+ usePdfcnTheme,
+} from "../../components";
+import type { BaseReportData } from "./report.types";
+
+export interface ReportTemplateProps {
+ theme?: PdfcnTheme;
+ data?: BaseReportData;
+}
+
+type ReportGraphVariant =
+ | "bar"
+ | "horizontal-bar"
+ | "line"
+ | "area"
+ | "pie"
+ | "donut";
+
+interface ReportLayoutProps {
+ data: BaseReportData;
+ titlePrefix: string;
+ statusLabel: string;
+ statusTone: "success" | "warning" | "destructive" | "info";
+ graphVariant: ReportGraphVariant;
+ graphTitle: string;
+ graphSubtitle: string;
+ graphLegend?: "bottom" | "right" | "none";
+ graphShowValues?: boolean;
+ graphColors?: string[];
+ graphData?: { label: string; value: number }[];
+}
+
+function toneColor(
+ theme: PdfcnTheme,
+ tone: "success" | "warning" | "destructive" | "info"
+) {
+ if (tone === "success") {return theme.colors.success;}
+ if (tone === "warning") {return theme.colors.warning;}
+ if (tone === "destructive") {return theme.colors.destructive;}
+ return theme.colors.info;
+}
+
+export function ReportLayout({
+ data,
+ titlePrefix,
+ statusLabel,
+ statusTone,
+ graphVariant,
+ graphTitle,
+ graphSubtitle,
+ graphLegend = "none",
+ graphShowValues = false,
+ graphColors,
+ graphData,
+}: ReportLayoutProps) {
+ const theme = usePdfcnTheme();
+ const accent = toneColor(theme, statusTone);
+
+ const styles = StyleSheet.create({
+ col: {
+ flex: 1,
+ },
+ graphShell: {
+ backgroundColor: theme.colors.background,
+ borderColor: theme.colors.border,
+ borderRadius: theme.primitives.borderRadius.md,
+ borderStyle: "solid",
+ borderWidth: 1,
+ padding: 12,
+ },
+ metricCard: {
+ backgroundColor: theme.colors.background,
+ borderColor: theme.colors.border,
+ borderRadius: theme.primitives.borderRadius.md,
+ borderStyle: "solid",
+ borderWidth: 1,
+ padding: 8,
+ width: "48.6%",
+ },
+ metricLabel: {
+ color: theme.colors.mutedForeground,
+ fontSize: 8,
+ letterSpacing: 0.5,
+ marginBottom: 2,
+ textTransform: "uppercase",
+ },
+ metricTrend: {
+ color: theme.colors.mutedForeground,
+ fontSize: 9,
+ },
+ metricValue: {
+ color: theme.colors.foreground,
+ fontSize: 14,
+ fontWeight: theme.primitives.fontWeights.bold,
+ marginBottom: 2,
+ },
+ metricsGrid: {
+ flexDirection: "row",
+ flexWrap: "wrap",
+ gap: 8,
+ },
+ page: {
+ backgroundColor: theme.colors.background,
+ paddingBottom: theme.spacing.page.marginBottom,
+ paddingLeft: theme.spacing.page.marginLeft,
+ paddingRight: theme.spacing.page.marginRight,
+ paddingTop: theme.spacing.page.marginTop,
+ },
+ toolbar: {
+ alignItems: "center",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ marginBottom: 8,
+ },
+ twoColumn: {
+ alignItems: "flex-start",
+ flexDirection: "row",
+ gap: 10,
+ },
+ });
+
+ return (
+ <Document title={`${titlePrefix} ${data.period}`}>
+ <Page size="A4" margin={48}>
+ <View style={styles.page as never}>
+ <PageHeader
+ variant="two-column"
+ title={data.title}
+ subtitle={`${titlePrefix} · ${data.subtitle}`}
+ rightText={data.period}
+ rightSubText={`Generated ${data.generatedAt}`}
+ marginBottom={14}
+ />
+
+ <View style={styles.toolbar}>
+ <Badge label={statusLabel} variant={statusTone} size="sm" />
+ <Text variant="xs" color="mutedForeground" noMargin>
+ Author: {data.author}
+ </Text>
+ </View>
+
+ <Section variant="card" padding="md" noWrap>
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Executive Summary
+ </Text>
+ <View style={styles.metricsGrid}>
+ {data.summary.map((metric) => (
+ <View
+ key={metric.label}
+ style={
+ [
+ styles.metricCard,
+ {
+ borderLeftColor: metric.tone
+ ? toneColor(theme, metric.tone)
+ : accent,
+ borderLeftWidth: 3,
+ },
+ ] as never
+ }
+ >
+ <Text style={styles.metricLabel} noMargin>
+ {metric.label}
+ </Text>
+ <Text style={styles.metricValue} noMargin>
+ {metric.value}
+ </Text>
+ {metric.trend ? (
+ <Badge
+ label={metric.trend}
+ size="sm"
+ variant={metric.tone ?? "info"}
+ />
+ ) : null}
+ </View>
+ ))}
+ </View>
+ </Section>
+
+ <Section padding="md" noWrap>
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Performance Trend
+ </Text>
+ <View style={styles.graphShell}>
+ <PdfGraph
+ variant={graphVariant}
+ data={graphData ?? data.series}
+ title={graphTitle}
+ subtitle={graphSubtitle}
+ yLabel={undefined}
+ xLabel={undefined}
+ showGrid={graphVariant !== "pie" && graphVariant !== "donut"}
+ showValues={graphShowValues}
+ smooth={graphVariant === "line" || graphVariant === "area"}
+ legend={graphLegend}
+ height={200}
+ colors={graphColors}
+ fullWidth
+ containerPadding={12}
+ wrapperPadding={12}
+ style={{ marginBottom: 0 }}
+ />
+ </View>
+ </Section>
+
+ <Section padding="md">
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Delivery Table
+ </Text>
+ <DataTable
+ variant="compact"
+ size="compact"
+ stripe
+ columns={[
+ { header: "Stream", key: "label" },
+ { header: "Owner", key: "owner" },
+ { align: "center", header: "Status", key: "status" },
+ {
+ align: "right",
+ header: "Progress",
+ key: "progress",
+ render: (value) => `${String(value)}%`,
+ },
+ { align: "right", header: "Risk", key: "risk" },
+ ]}
+ data={data.rows}
+ footer={{
+ label: "Totals",
+ owner: "-",
+ progress: Math.round(
+ data.rows.reduce((sum, row) => sum + row.progress, 0) /
+ Math.max(data.rows.length, 1)
+ ),
+ risk: "-",
+ status: "-",
+ }}
+ />
+ </Section>
+
+ <Section padding="md" variant="card" noWrap>
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Highlights & Risks
+ </Text>
+ <View style={styles.twoColumn}>
+ <View style={styles.col}>
+ <PdfList
+ variant="checklist"
+ items={data.highlights.map((item) => ({
+ checked: true,
+ text: item,
+ }))}
+ gap="sm"
+ />
+ </View>
+ <View style={styles.col}>
+ <KeyValue
+ size="sm"
+ divided
+ items={[
+ {
+ key: "Open Risks",
+ value: `${data.rows.filter((r) => r.risk !== "Low").length}`,
+ },
+ {
+ key: "On-Track Streams",
+ value: `${data.rows.filter((r) => r.status === "On Track").length}/${data.rows.length}`,
+ },
+ {
+ key: "Average Progress",
+ value: `${Math.round(
+ data.rows.reduce((sum, row) => sum + row.progress, 0) /
+ Math.max(data.rows.length, 1)
+ )}%`,
+ },
+ ]}
+ />
+ </View>
+ </View>
+ <Divider />
+ <Stack gap="sm">
+ <Text variant="xs" color="mutedForeground" noMargin>
+ Best practice: keep each section under one page using `noWrap`
+ for concise blocks.
+ </Text>
+ <Text variant="xs" color="mutedForeground" noMargin>
+ Best practice: pass explicit row keys/owners to avoid ambiguous
+ reporting handoffs.
+ </Text>
+ </Stack>
+ </Section>
+
+ <PageFooter
+ variant="three-column"
+ leftText="Confidential — Internal Use"
+ centerText="Generated with PDFx"
+ rightText="Page 1 of 1"
+ sticky
+ pagePadding={theme.spacing.page.marginLeft}
+ />
+ </View>
+ </Page>
+ </Document>
+ );
+}
+
+export function ReportTemplateFrame({
+ theme,
+ data,
+ titlePrefix,
+ statusLabel,
+ statusTone,
+ graphVariant,
+ graphTitle,
+ graphSubtitle,
+ graphLegend,
+ graphShowValues,
+ graphColors,
+ graphData,
+}: ReportTemplateProps & {
+ titlePrefix: string;
+ statusLabel: string;
+ statusTone: "success" | "warning" | "destructive" | "info";
+ graphVariant: ReportGraphVariant;
+ graphTitle: string;
+ graphSubtitle: string;
+ graphLegend?: "bottom" | "right" | "none";
+ graphShowValues?: boolean;
+ graphColors?: string[];
+ graphData?: { label: string; value: number }[];
+}) {
+ if (!data) {return null;}
+
+ return (
+ <PdfcnThemeProvider theme={theme}>
+ <ReportLayout
+ data={data}
+ titlePrefix={titlePrefix}
+ statusLabel={statusLabel}
+ statusTone={statusTone}
+ graphVariant={graphVariant}
+ graphTitle={graphTitle}
+ graphSubtitle={graphSubtitle}
+ graphLegend={graphLegend}
+ graphShowValues={graphShowValues}
+ graphColors={graphColors}
+ graphData={graphData}
+ />
+ </PdfcnThemeProvider>
+ );
+}
diff --git a/registry/bases/forme/blocks/report-security/report-security.tsx b/registry/bases/forme/blocks/report-security/report-security.tsx
new file mode 100644
index 0000000..dbf8b52
--- /dev/null
+++ b/registry/bases/forme/blocks/report-security/report-security.tsx
@@ -0,0 +1,98 @@
+import { ReportTemplateFrame } from "./report-layout";
+import type { ReportTemplateProps } from "./report-layout";
+import type { BaseReportData } from "./report.types";
+
+const sampleSecurityData: BaseReportData = {
+ author: "Security Engineering",
+ generatedAt: "February 23, 2026",
+ highlights: [
+ "Critical vulnerabilities reduced through mandatory patch windows.",
+ "Secrets rotation remains the highest-risk stream and needs additional staffing.",
+ "External penetration test scheduled for next sprint to validate fixes.",
+ ],
+ period: "Sprint 05, 2026",
+ rows: [
+ {
+ label: "Identity Hardening",
+ owner: "E. Brown",
+ progress: 87,
+ risk: "Low",
+ status: "On Track",
+ },
+ {
+ label: "Secrets Rotation",
+ owner: "P. Nair",
+ progress: 58,
+ risk: "High",
+ status: "At Risk",
+ },
+ {
+ label: "Dependency Scanning",
+ owner: "I. Shah",
+ progress: 81,
+ risk: "Medium",
+ status: "On Track",
+ },
+ {
+ label: "WAF Policy",
+ owner: "S. Reed",
+ progress: 76,
+ risk: "Low",
+ status: "On Track",
+ },
+ ],
+ series: [
+ { label: "W1", value: 61 },
+ { label: "W2", value: 63 },
+ { label: "W3", value: 64 },
+ { label: "W4", value: 66 },
+ { label: "W5", value: 67 },
+ { label: "W6", value: 68 },
+ { label: "W7", value: 69 },
+ { label: "W8", value: 71 },
+ { label: "W9", value: 72 },
+ { label: "W10", value: 74 },
+ { label: "W11", value: 76 },
+ { label: "W12", value: 78 },
+ ],
+ subtitle: "Vulnerability trends, control maturity, and remediation health",
+ summary: [
+ {
+ label: "Critical Vulns",
+ tone: "success",
+ trend: "-3 from last sprint",
+ value: "2",
+ },
+ { label: "Patch SLA", tone: "success", trend: "+5.3 pts", value: "92.0%" },
+ { label: "Open Findings", tone: "warning", trend: "+4", value: "41" },
+ { label: "Control Score", tone: "info", trend: "+2 pts", value: "84/100" },
+ ],
+ title: "Security Posture Report",
+};
+
+export function SecurityReportDocument({
+ theme,
+ data = sampleSecurityData,
+}: ReportTemplateProps) {
+ return (
+ <ReportTemplateFrame
+ theme={theme}
+ data={data}
+ titlePrefix="Security Report"
+ statusLabel="Security: Action Needed"
+ statusTone="destructive"
+ graphVariant="donut"
+ graphTitle="Open risk distribution"
+ graphSubtitle="High/Medium/Low workload share"
+ graphLegend="right"
+ graphShowValues
+ graphColors={["#DC2626", "#F59E0B", "#16A34A", "#0EA5E9"]}
+ graphData={[
+ { label: "High Risk", value: 14 },
+ { label: "Medium Risk", value: 17 },
+ { label: "Low Risk", value: 8 },
+ { label: "Info", value: 4 },
+ ]}
+ />
+ );
+}
diff --git a/registry/bases/forme/blocks/report-security/report.types.ts b/registry/bases/forme/blocks/report-security/report.types.ts
new file mode 100644
index 0000000..0a80a7b
--- /dev/null
+++ b/registry/bases/forme/blocks/report-security/report.types.ts
@@ -0,0 +1,31 @@
+export interface SummaryMetric {
+ label: string;
+ value: string;
+ trend?: string;
+ tone?: "success" | "warning" | "destructive" | "info";
+}
+
+export type ReportRow = Record<string, unknown> & {
+ label: string;
+ owner: string;
+ status: string;
+ progress: number;
+ risk?: string;
+};
+
+export interface ReportSeriesPoint {
+ label: string;
+ value: number;
+}
+
+export interface BaseReportData {
+ title: string;
+ subtitle: string;
+ generatedAt: string;
+ period: string;
+ author: string;
+ summary: SummaryMetric[];
+ rows: ReportRow[];
+ series: ReportSeriesPoint[];
+ highlights: string[];
+}
diff --git a/registry/bases/forme/components/alert/alert.tsx b/registry/bases/forme/components/alert/alert.tsx
new file mode 100644
index 0000000..9735920
--- /dev/null
+++ b/registry/bases/forme/components/alert/alert.tsx
@@ -0,0 +1,254 @@
+import { Text as PDFText, StyleSheet, View } from "@formepdf/react";
+import type { Style } from "@formepdf/react";
+import type { ReactNode } from "react";
+
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { Circle, Line, Path, Svg } from "../../lib/forme-svg";
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+
+export type AlertVariant = "info" | "success" | "warning" | "error";
+
+/**
+ * Alert box with severity variants for info, success, warning, and error states.
+ * Props - `variant` | `title` | `children` | `showIcon` | `showBorder` | `style`
+ * @see {@link PdfAlertProps}
+ */
+export interface PdfAlertProps extends Omit<PDFComponentProps, "children"> {
+ /**
+ * @default 'info'
+ */
+ variant?: AlertVariant;
+ title?: string;
+ children?: ReactNode;
+ /**
+ * @default true
+ */
+ showIcon?: boolean;
+ /**
+ * @default true
+ */
+ showBorder?: boolean;
+}
+
+/** Stroke width for all alert SVG icons (SVG user units). */
+const ICON_STROKE_WIDTH = 1.5;
+
+const SvgWrap = ({ children }: { children: ReactNode }) => (
+ <Svg width={16} height={16} viewBox="0 0 16 16">
+ {children}
+ </Svg>
+);
+
+const ICON_MAP = {
+ error: ({ color }: { color: string }) => (
+ <SvgWrap>
+ <Circle
+ cx={8}
+ cy={8}
+ r={7}
+ fill="none"
+ stroke={color}
+ strokeWidth={ICON_STROKE_WIDTH}
+ />
+ <Line
+ x1={5.5}
+ y1={5.5}
+ x2={10.5}
+ y2={10.5}
+ stroke={color}
+ strokeWidth={ICON_STROKE_WIDTH}
+ strokeLinecap="round"
+ />
+ <Line
+ x1={10.5}
+ y1={5.5}
+ x2={5.5}
+ y2={10.5}
+ stroke={color}
+ strokeWidth={ICON_STROKE_WIDTH}
+ strokeLinecap="round"
+ />
+ </SvgWrap>
+ ),
+ info: ({ color }: { color: string }) => (
+ <SvgWrap>
+ <Circle
+ cx={8}
+ cy={8}
+ r={7}
+ fill="none"
+ stroke={color}
+ strokeWidth={ICON_STROKE_WIDTH}
+ />
+ <Circle cx={8} cy={4.5} r={1} fill={color} />
+ <Line
+ x1={8}
+ y1={7}
+ x2={8}
+ y2={11.5}
+ stroke={color}
+ strokeWidth={ICON_STROKE_WIDTH}
+ strokeLinecap="round"
+ />
+ </SvgWrap>
+ ),
+ success: ({ color }: { color: string }) => (
+ <SvgWrap>
+ <Circle
+ cx={8}
+ cy={8}
+ r={7}
+ fill="none"
+ stroke={color}
+ strokeWidth={ICON_STROKE_WIDTH}
+ />
+ <Path
+ d="M5 8 L7 10 L11 6"
+ fill="none"
+ stroke={color}
+ strokeWidth={ICON_STROKE_WIDTH}
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </SvgWrap>
+ ),
+ warning: ({ color }: { color: string }) => (
+ <SvgWrap>
+ <Path
+ d="M8 1.5 L15 14.5 L1 14.5 Z"
+ fill="none"
+ stroke={color}
+ strokeWidth={ICON_STROKE_WIDTH}
+ strokeLinejoin="round"
+ />
+ <Line
+ x1={8}
+ y1={6}
+ x2={8}
+ y2={10}
+ stroke={color}
+ strokeWidth={ICON_STROKE_WIDTH}
+ strokeLinecap="round"
+ />
+ <Circle cx={8} cy={12.5} r={0.75} fill={color} />
+ </SvgWrap>
+ ),
+};
+
+function AlertIcon({
+ variant,
+ color,
+}: {
+ variant: AlertVariant;
+ color: string;
+}) {
+ const Icon = ICON_MAP[variant];
+ return <Icon color={color} />;
+}
+
+function createAlertStyles(theme: PdfcnTheme) {
+ const { typography, colors, primitives } = theme;
+
+ const variantColors = {
+ error: colors.destructive ?? "#EF4444",
+ info: colors.info ?? "#3B82F6",
+ success: colors.success ?? "#22C55E",
+ warning: colors.warning ?? "#F59E0B",
+ } satisfies Record<AlertVariant, string>;
+
+ const bl = (color: string) => ({
+ borderLeftColor: color,
+ borderLeftWidth: 4,
+ });
+
+ const sheet = StyleSheet.create({
+ bg: {
+ backgroundColor: colors.muted,
+ },
+ borderError: bl(variantColors.error),
+ borderInfo: bl(variantColors.info),
+ borderSuccess: bl(variantColors.success),
+ borderWarning: bl(variantColors.warning),
+ container: {
+ borderRadius: 4,
+ flexDirection: "row",
+ marginBottom: theme.spacing.componentGap,
+ padding: 12,
+ },
+ contentContainer: { flex: 1 },
+ description: {
+ color: colors.mutedForeground,
+ fontFamily: typography.body.fontFamily,
+ fontSize: primitives.typography.sm,
+ lineHeight: typography.body.lineHeight,
+ },
+ iconContainer: {
+ alignItems: "center",
+ justifyContent: "flex-start",
+ marginRight: 10,
+ paddingTop: 2,
+ width: 20,
+ },
+ title: {
+ color: colors.foreground,
+ fontFamily: typography.heading.fontFamily,
+ fontSize: primitives.typography.sm,
+ fontWeight: primitives.fontWeights.semibold,
+ marginBottom: 4,
+ },
+ });
+
+ return {
+ ...sheet,
+ borderMap: {
+ error: sheet.borderError,
+ info: sheet.borderInfo,
+ success: sheet.borderSuccess,
+ warning: sheet.borderWarning,
+ } as Record<AlertVariant, Style>,
+ /** Resolved hex colors for each variant — used to tint the SVG icons. */
+ variantColors,
+ };
+}
+
+export function PdfAlert({
+ variant = "info",
+ title,
+ children,
+ showIcon = true,
+ showBorder = true,
+ style,
+}: PdfAlertProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createAlertStyles(theme), [theme]);
+
+ if (!title && !children) {
+ return null;
+ }
+
+ const containerStyles: Style[] = [
+ styles.container,
+ styles.bg,
+ ...(showBorder ? [styles.borderMap[variant]] : []),
+ ...(style ? [style].flat() : []),
+ ];
+
+ return (
+ <View wrap={false} style={containerStyles as never}>
+ {showIcon && (
+ <View style={styles.iconContainer}>
+ <AlertIcon variant={variant} color={styles.variantColors[variant]} />
+ </View>
+ )}
+ <View style={styles.contentContainer}>
+ {title && <PDFText style={styles.title}>{title}</PDFText>}
+ {typeof children === "string" ? (
+ <PDFText style={styles.description}>{children}</PDFText>
+ ) : (
+ children
+ )}
+ </View>
+ </View>
+ );
+}
diff --git a/registry/bases/forme/components/alert/index.ts b/registry/bases/forme/components/alert/index.ts
new file mode 100644
index 0000000..9961c94
--- /dev/null
+++ b/registry/bases/forme/components/alert/index.ts
@@ -0,0 +1 @@
+export { PdfAlert, type PdfAlertProps, type AlertVariant } from "./alert";
diff --git a/registry/bases/forme/components/badge/badge.tsx b/registry/bases/forme/components/badge/badge.tsx
new file mode 100644
index 0000000..746bc72
--- /dev/null
+++ b/registry/bases/forme/components/badge/badge.tsx
@@ -0,0 +1,155 @@
+import { Text as PDFText, StyleSheet, View } from "@formepdf/react";
+import type { Style } from "@formepdf/react";
+
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { resolveColor } from "../../lib/resolve-color";
+
+export type BadgeVariant =
+ | "default"
+ | "primary"
+ | "success"
+ | "warning"
+ | "destructive"
+ | "info"
+ | "outline";
+export type BadgeSize = "sm" | "md" | "lg";
+
+/**
+ * Inline label for status, tags, or categories.
+ *
+ * Accepts text via either `label` prop or `children` (string). `label` takes
+ * precedence when both are provided. The children pattern (`<Badge>text</Badge>`)
+ * is supported for compatibility with common React idioms, but note that
+ * `@formepdf/react` doesn't support JSX children the way HTML does — only
+ * string children are accepted.
+ *
+ * Props - `label` | `children` | `variant` | `size` | `background` | `color` | `style`
+ * @see {@link BadgeProps}
+ */
+export interface BadgeProps extends Omit<PDFComponentProps, "children"> {
+ /** Text to display. Takes precedence over children when both are provided. */
+ label?: string;
+ /** String children as an alternative to the label prop. */
+ children?: string;
+ /**
+ * @default 'default'
+ */
+ variant?: BadgeVariant;
+ /**
+ * @default 'md'
+ */
+ size?: BadgeSize;
+ background?: string;
+ color?: string;
+}
+
+function createBadgeStyles(t: PdfcnTheme) {
+ const { spacing, borderRadius, fontWeights } = t.primitives;
+ const c = t.colors;
+ const textBase = {
+ fontFamily: t.typography.body.fontFamily,
+ fontWeight: fontWeights.semibold,
+ letterSpacing: 0.3,
+ };
+ const variantBox = (borderColor: string, bgColor: string = c.muted) => ({
+ backgroundColor: bgColor,
+ borderColor,
+ borderStyle: "solid" as const,
+ borderWidth: spacing[0.5],
+ });
+ const sheet = StyleSheet.create({
+ containerBase: {
+ alignItems: "center" as const,
+ alignSelf: "flex-start" as const,
+ borderRadius: borderRadius.full,
+ flexDirection: "row" as const,
+ },
+ sizeLg: { paddingHorizontal: spacing[4], paddingVertical: spacing[2] },
+ sizeMd: { paddingHorizontal: spacing[3], paddingVertical: spacing[1] },
+ sizeSm: { paddingHorizontal: spacing[2], paddingVertical: spacing[0.5] },
+ textDefault: { ...textBase, color: c.mutedForeground },
+ textDestructive: { ...textBase, color: c.destructive },
+ textInfo: { ...textBase, color: c.info },
+ textLg: { fontSize: t.primitives.typography.sm },
+ textMd: { fontSize: t.primitives.typography.xs },
+ textOutline: { ...textBase, color: c.foreground },
+ textPrimary: { ...textBase, color: c.primaryForeground },
+ textSm: { fontSize: t.primitives.typography.xs - 1 },
+ textSuccess: { ...textBase, color: c.success },
+ textWarning: { ...textBase, color: c.warning },
+ variantDefault: variantBox(c.border),
+ variantDestructive: variantBox(c.destructive),
+ variantInfo: variantBox(c.info),
+ variantOutline: variantBox(c.border, c.background),
+ variantPrimary: variantBox(c.primary, c.primary),
+ variantSuccess: variantBox(c.success),
+ variantWarning: variantBox(c.warning),
+ });
+ return {
+ ...sheet,
+ containerSizeMap: {
+ lg: sheet.sizeLg,
+ md: sheet.sizeMd,
+ sm: sheet.sizeSm,
+ } as Record<BadgeSize, Style>,
+ containerVariantMap: {
+ default: sheet.variantDefault,
+ destructive: sheet.variantDestructive,
+ info: sheet.variantInfo,
+ outline: sheet.variantOutline,
+ primary: sheet.variantPrimary,
+ success: sheet.variantSuccess,
+ warning: sheet.variantWarning,
+ } as Record<BadgeVariant, Style>,
+ textSizeMap: {
+ lg: sheet.textLg,
+ md: sheet.textMd,
+ sm: sheet.textSm,
+ } as Record<BadgeSize, Style>,
+ textVariantMap: {
+ default: sheet.textDefault,
+ destructive: sheet.textDestructive,
+ info: sheet.textInfo,
+ outline: sheet.textOutline,
+ primary: sheet.textPrimary,
+ success: sheet.textSuccess,
+ warning: sheet.textWarning,
+ } as Record<BadgeVariant, Style>,
+ };
+}
+
+export function Badge({
+ label,
+ children,
+ variant = "default",
+ size = "md",
+ background,
+ color,
+ style,
+}: BadgeProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createBadgeStyles(theme), [theme]);
+ // `label` takes precedence; fall back to string children for React idiom compatibility
+ const text = label ?? children ?? "";
+ const containerStyles: Style[] = [
+ styles.containerBase,
+ styles.containerVariantMap[variant],
+ styles.containerSizeMap[size],
+ ...(background
+ ? [{ backgroundColor: resolveColor(background, theme.colors) }]
+ : []),
+ ...(style ? [style].flat() : []),
+ ];
+ const textStyles: Style[] = [
+ styles.textVariantMap[variant],
+ styles.textSizeMap[size],
+ ...(color ? [{ color: resolveColor(color, theme.colors) }] : []),
+ ];
+ return (
+ <View style={containerStyles as never}>
+ <PDFText style={textStyles as never}>{text}</PDFText>
+ </View>
+ );
+}
diff --git a/registry/bases/forme/components/badge/index.ts b/registry/bases/forme/components/badge/index.ts
new file mode 100644
index 0000000..2ae6ef6
--- /dev/null
+++ b/registry/bases/forme/components/badge/index.ts
@@ -0,0 +1,6 @@
+export {
+ Badge,
+ type BadgeProps,
+ type BadgeVariant,
+ type BadgeSize,
+} from "./badge";
diff --git a/registry/bases/forme/components/card/card.tsx b/registry/bases/forme/components/card/card.tsx
new file mode 100644
index 0000000..3cade02
--- /dev/null
+++ b/registry/bases/forme/components/card/card.tsx
@@ -0,0 +1,107 @@
+import { Text as PDFText, StyleSheet, View } from "@formepdf/react";
+import type { Style } from "@formepdf/react";
+import type { ReactNode } from "react";
+
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+
+export type CardVariant = "default" | "bordered" | "muted";
+
+/**
+ * Bordered content card with optional title and padding presets.
+ * Props - `title` | `children` | `variant` | `padding` | `wrap` | `style`
+ * @see {@link PdfCardProps}
+ */
+export interface PdfCardProps extends Omit<PDFComponentProps, "children"> {
+ title?: string;
+ children?: ReactNode;
+ /**
+ * @default 'default'
+ */
+ variant?: CardVariant;
+ /**
+ * @default 'md'
+ */
+ padding?: "sm" | "md" | "lg";
+ /**
+ * When false, the card will not split across PDF pages.
+ * @default false
+ */
+ wrap?: boolean;
+}
+
+function createCardStyles(t: PdfcnTheme) {
+ const { spacing, borderRadius, fontWeights } = t.primitives;
+ return StyleSheet.create({
+ body: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ lineHeight: t.typography.body.lineHeight,
+ },
+ card: {
+ backgroundColor: t.colors.background,
+ borderColor: t.colors.border,
+ borderRadius: borderRadius.sm,
+ borderStyle: "solid",
+ borderWidth: 1,
+ marginBottom: t.spacing.componentGap,
+ },
+ cardBordered: { borderWidth: 2 },
+ cardMuted: { backgroundColor: t.colors.muted },
+ paddingLg: { padding: spacing[4] },
+ paddingMd: { padding: spacing[3] },
+ paddingSm: { padding: spacing[2] },
+ title: {
+ borderBottomColor: t.colors.border,
+ borderBottomStyle: "solid",
+ borderBottomWidth: 1,
+ color: t.colors.foreground,
+ fontFamily: t.typography.heading.fontFamily,
+ fontSize: t.primitives.typography.base,
+ fontWeight: fontWeights.semibold,
+ lineHeight: t.typography.heading.lineHeight,
+ marginBottom: spacing[2],
+ paddingBottom: spacing[1] + 2,
+ },
+ });
+}
+
+export function PdfCard({
+ title,
+ children,
+ variant = "default",
+ padding = "md",
+ wrap = false,
+ style,
+}: PdfCardProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createCardStyles(theme), [theme]);
+ const paddingMap = {
+ lg: styles.paddingLg,
+ md: styles.paddingMd,
+ sm: styles.paddingSm,
+ };
+ const cardStyles: Style[] = [styles.card];
+ if (variant === "bordered") {
+ cardStyles.push(styles.cardBordered);
+ }
+ if (variant === "muted") {
+ cardStyles.push(styles.cardMuted);
+ }
+ cardStyles.push(paddingMap[padding]);
+ if (style) {
+ cardStyles.push(style);
+ }
+ return (
+ <View wrap={wrap} style={cardStyles as never}>
+ {title ? <PDFText style={styles.title}>{title}</PDFText> : null}
+ {typeof children === "string" ? (
+ <PDFText style={styles.body}>{children}</PDFText>
+ ) : (
+ children
+ )}
+ </View>
+ );
+}
diff --git a/registry/bases/forme/components/card/index.ts b/registry/bases/forme/components/card/index.ts
new file mode 100644
index 0000000..17f5fea
--- /dev/null
+++ b/registry/bases/forme/components/card/index.ts
@@ -0,0 +1 @@
+export { PdfCard, type PdfCardProps, type CardVariant } from "./card";
diff --git a/registry/bases/forme/components/data-table/data-table.styles.ts b/registry/bases/forme/components/data-table/data-table.styles.ts
new file mode 100644
index 0000000..7117097
--- /dev/null
+++ b/registry/bases/forme/components/data-table/data-table.styles.ts
@@ -0,0 +1,53 @@
+import { StyleSheet } from "@formepdf/react";
+
+import type { PdfcnTheme } from "@/registry/themes";
+
+/**
+ * Creates compact-mode cell and text styles for the DataTable component.
+ * Used when `size="compact"` to render denser rows with smaller font sizes.
+ * @param t - The resolved PdfcnTheme instance.
+ */
+export function createCompactStyles(t: PdfcnTheme) {
+ const { spacing, fontWeights, lineHeights } = t.primitives;
+ return StyleSheet.create({
+ cell: {
+ paddingHorizontal: spacing[2],
+ paddingVertical: spacing[0.5],
+ },
+ footerText: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.primitives.typography.xs,
+ fontWeight: fontWeights.semibold,
+ lineHeight: lineHeights.normal,
+ },
+ headerText: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.primitives.typography.xs,
+ fontWeight: fontWeights.semibold,
+ lineHeight: lineHeights.normal,
+ },
+ text: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.primitives.typography.xs,
+ lineHeight: lineHeights.normal,
+ },
+ });
+}
+
+/**
+ * Converts an arbitrary cell value to a display string.
+ * Returns an empty string for null/undefined values.
+ * @param value - The raw cell value to format.
+ */
+export function formatValue(value: unknown): string {
+ if (value === null || value === undefined) {
+ return "";
+ }
+ if (typeof value === "number") {
+ return String(value);
+ }
+ return String(value);
+}
diff --git a/registry/bases/forme/components/data-table/data-table.tsx b/registry/bases/forme/components/data-table/data-table.tsx
new file mode 100644
index 0000000..6f28b42
--- /dev/null
+++ b/registry/bases/forme/components/data-table/data-table.tsx
@@ -0,0 +1,153 @@
+import { Text as PDFText } from "@formepdf/react";
+import type { Style } from "@formepdf/react";
+import { Fragment } from "react";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import {
+ Table,
+ TableBody,
+ TableCell,
+ TableFooter,
+ TableHeader,
+ TableRow,
+} from "../table";
+import { createCompactStyles, formatValue } from "./data-table.styles";
+import type { DataTableProps } from "./data-table.types";
+
+export function DataTable<T extends Record<string, unknown>>({
+ columns,
+ data,
+ variant = "grid",
+ footer,
+ stripe = false,
+ size = "default",
+ noWrap = false,
+ style,
+}: DataTableProps<T>) {
+ const theme = usePdfcnTheme();
+ const compact = useSafeMemo(() => createCompactStyles(theme), [theme]);
+ const isCompact = size === "compact";
+
+ return (
+ <Table variant={variant} zebraStripe={stripe} noWrap={noWrap} style={style}>
+ <TableHeader>
+ <TableRow header>
+ {columns.map((col) => (
+ <TableCell
+ key={col.key}
+ header
+ align={col.align ?? "left"}
+ width={col.width}
+ style={isCompact ? compact.cell : undefined}
+ >
+ {isCompact ? (
+ <PDFText
+ style={
+ [
+ compact.headerText,
+ col.align ? ({ textAlign: col.align } as Style) : {},
+ ] as never
+ }
+ >
+ {col.header}
+ </PDFText>
+ ) : (
+ col.header
+ )}
+ </TableCell>
+ ))}
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {data.map((row, i) => (
+ // biome-ignore lint/suspicious/noArrayIndexKey: DataTable has no row id; order is stable for static data
+ <Fragment key={i}>
+ <TableRow>
+ {columns.map((col) => {
+ const value = row[col.key];
+ const rendered = col.render ? col.render(value, row) : null;
+ const text = rendered === null ? formatValue(value) : null;
+ return (
+ <TableCell
+ key={col.key}
+ align={col.align ?? "left"}
+ width={col.width}
+ style={isCompact ? compact.cell : undefined}
+ >
+ {isCompact ? (
+ rendered !== null ? (
+ rendered
+ ) : (
+ <PDFText
+ style={
+ [
+ compact.text,
+ col.align
+ ? ({ textAlign: col.align } as Style)
+ : {},
+ ] as never
+ }
+ >
+ {text}
+ </PDFText>
+ )
+ ) : (rendered !== null ? (
+ rendered
+ ) : (
+ text
+ ))}
+ </TableCell>
+ );
+ })}
+ </TableRow>
+ </Fragment>
+ ))}
+ </TableBody>
+ {footer && (
+ <TableFooter>
+ <TableRow footer>
+ {columns.map((col) => {
+ const value = col.key in footer ? footer[col.key] : "";
+ const rendered = col.renderFooter
+ ? col.renderFooter(value)
+ : null;
+ const text = rendered === null ? formatValue(value) : null;
+ return (
+ <TableCell
+ key={col.key}
+ footer={!!value}
+ align={col.align ?? "left"}
+ width={col.width}
+ style={isCompact ? compact.cell : undefined}
+ >
+ {isCompact ? (
+ rendered !== null ? (
+ rendered
+ ) : (
+ <PDFText
+ style={
+ [
+ value ? compact.footerText : compact.text,
+ col.align
+ ? ({ textAlign: col.align } as Style)
+ : {},
+ ] as never
+ }
+ >
+ {text}
+ </PDFText>
+ )
+ ) : (rendered !== null ? (
+ rendered
+ ) : (
+ text
+ ))}
+ </TableCell>
+ );
+ })}
+ </TableRow>
+ </TableFooter>
+ )}
+ </Table>
+ );
+}
diff --git a/registry/bases/forme/components/data-table/data-table.types.ts b/registry/bases/forme/components/data-table/data-table.types.ts
new file mode 100644
index 0000000..11a5994
--- /dev/null
+++ b/registry/bases/forme/components/data-table/data-table.types.ts
@@ -0,0 +1,55 @@
+import type React from "react";
+
+import type { PDFComponentProps } from "@/registry/themes";
+
+import type { TableVariant } from "../table/table.types";
+
+/** DataTable row density size. */
+export type DataTableSize = "default" | "compact";
+
+/**
+ * Column definition for a DataTable.
+ * Props - `key` | `header` | `align` | `width` | `render` | `renderFooter`
+ * @see {@link DataTableColumn}
+ */
+export interface DataTableColumn<T = Record<string, unknown>> {
+ key: keyof T & string;
+ header: string;
+ align?: "left" | "center" | "right";
+ width?: string | number;
+ /**
+ * Custom cell renderer. Must return @formepdf/react elements (Text, View,
+ * Image, etc.) — NOT HTML DOM elements. TypeScript accepts ReactNode but DOM
+ * nodes will crash at runtime in the PDF renderer.
+ */
+ render?: (value: unknown, row: T) => React.ReactNode;
+ /**
+ * Custom footer cell renderer. Same constraint: return @formepdf/react
+ * elements only — no HTML/DOM nodes.
+ */
+ renderFooter?: (value: unknown) => React.ReactNode;
+}
+
+/**
+ * Data table for PDF rendering with column definitions, footer support, and stripe options.
+ * Props - `columns` | `data` | `variant` | `footer` | `stripe` | `size` | `noWrap` | `style`
+ * @see {@link DataTableProps}
+ */
+export interface DataTableProps<T = Record<string, unknown>> extends Omit<
+ PDFComponentProps,
+ "children"
+> {
+ columns: DataTableColumn<T>[];
+ data: T[];
+ /**
+ * @default 'grid'
+ */
+ variant?: TableVariant;
+ footer?: Partial<Record<keyof T & string, string | number>>;
+ stripe?: boolean;
+ /**
+ * @default 'default'
+ */
+ size?: DataTableSize;
+ noWrap?: boolean;
+}
diff --git a/registry/bases/forme/components/data-table/index.ts b/registry/bases/forme/components/data-table/index.ts
new file mode 100644
index 0000000..e34f14d
--- /dev/null
+++ b/registry/bases/forme/components/data-table/index.ts
@@ -0,0 +1,6 @@
+export { DataTable } from "./data-table";
+export type {
+ DataTableProps,
+ DataTableColumn,
+ DataTableSize,
+} from "./data-table.types";
diff --git a/registry/bases/forme/components/divider/divider.tsx b/registry/bases/forme/components/divider/divider.tsx
new file mode 100644
index 0000000..138fe47
--- /dev/null
+++ b/registry/bases/forme/components/divider/divider.tsx
@@ -0,0 +1,146 @@
+import { Text as PDFText, StyleSheet, View } from "@formepdf/react";
+import type { Style } from "@formepdf/react";
+
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { resolveColor } from "../../lib/resolve-color";
+
+export type DividerVariant = "solid" | "dashed" | "dotted";
+export type DividerThickness = "thin" | "medium" | "thick";
+export type DividerSpacing = "none" | "sm" | "md" | "lg";
+
+/**
+ * Horizontal rule with optional label, style variants, and spacing presets.
+ * Props - `spacing` | `variant` | `color` | `thickness` | `label` | `width` | `style`
+ * @see {@link DividerProps}
+ */
+export interface DividerProps extends Omit<PDFComponentProps, "children"> {
+ /**
+ * @default 'md'
+ */
+ spacing?: DividerSpacing;
+ /**
+ * @default 'solid'
+ */
+ variant?: DividerVariant;
+ color?: string;
+ /**
+ * @default 'thin'
+ */
+ thickness?: DividerThickness;
+ label?: string;
+ width?: string | number;
+}
+
+function createDividerStyles(t: PdfcnTheme) {
+ const { spacing, fontWeights } = t.primitives;
+ return StyleSheet.create({
+ base: { borderBottomColor: t.colors.border, borderBottomStyle: "solid" },
+ dashed: { borderBottomStyle: "dashed" },
+ dotted: { borderBottomStyle: "dotted" },
+ labelContainer: { alignItems: "center", flexDirection: "row" },
+ labelLine: {
+ borderBottomColor: t.colors.border,
+ borderBottomStyle: "solid",
+ flex: 1,
+ },
+ labelText: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.primitives.typography.xs,
+ fontWeight: fontWeights.medium,
+ letterSpacing: t.primitives.letterSpacing.wider * 10,
+ paddingHorizontal: spacing[3],
+ textTransform: "uppercase",
+ },
+ medium: { borderBottomWidth: spacing[1] },
+ solid: { borderBottomStyle: "solid" },
+ spacingLg: { marginVertical: t.spacing.sectionGap },
+ spacingMd: { marginVertical: t.spacing.componentGap },
+ spacingNone: { marginVertical: spacing[0] },
+ spacingSm: { marginVertical: t.spacing.paragraphGap },
+ thick: { borderBottomWidth: spacing[2] },
+ thin: { borderBottomWidth: spacing[0.5] },
+ } as any);
+}
+
+export function Divider({
+ spacing = "md",
+ variant = "solid",
+ color,
+ thickness = "thin",
+ label,
+ width,
+ style,
+}: DividerProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createDividerStyles(theme), [theme]);
+ const spacingMap = {
+ lg: styles.spacingLg,
+ md: styles.spacingMd,
+ none: styles.spacingNone,
+ sm: styles.spacingSm,
+ };
+ const variantMap = {
+ dashed: styles.dashed,
+ dotted: styles.dotted,
+ solid: styles.solid,
+ };
+ const thicknessMap = {
+ medium: styles.medium,
+ thick: styles.thick,
+ thin: styles.thin,
+ };
+
+ if (label) {
+ const lineStyle: Style[] = [
+ styles.labelLine,
+ thicknessMap[thickness],
+ variantMap[variant],
+ ];
+ if (color) {
+ lineStyle.push({
+ borderBottomColor: resolveColor(color, theme.colors),
+ } as any);
+ }
+ const containerStyles: Style[] = [
+ styles.labelContainer,
+ spacingMap[spacing],
+ ];
+ if (width !== undefined) {
+ containerStyles.push({ width } as Style);
+ }
+ if (style) {
+ containerStyles.push(...[style].flat());
+ }
+ const labelTextStyle: Style[] = [styles.labelText];
+ if (color) {
+ labelTextStyle.push({ color: resolveColor(color, theme.colors) });
+ }
+ return (
+ <View style={containerStyles as never}>
+ <View style={lineStyle as never} />
+ <PDFText style={labelTextStyle as never}>{label}</PDFText>
+ <View style={lineStyle as never} />
+ </View>
+ );
+ }
+
+ const styleArray: Style[] = [
+ styles.base,
+ spacingMap[spacing],
+ variantMap[variant],
+ thicknessMap[thickness],
+ ];
+ if (color) {
+ styleArray.push({ borderBottomColor: resolveColor(color, theme.colors) });
+ }
+ if (width !== undefined) {
+ styleArray.push({ width } as Style);
+ }
+ if (style) {
+ styleArray.push(...[style].flat());
+ }
+ return <View style={styleArray as never} />;
+}
diff --git a/registry/bases/forme/components/divider/index.ts b/registry/bases/forme/components/divider/index.ts
new file mode 100644
index 0000000..6a4d5ec
--- /dev/null
+++ b/registry/bases/forme/components/divider/index.ts
@@ -0,0 +1,7 @@
+export {
+ Divider,
+ type DividerProps,
+ type DividerVariant,
+ type DividerThickness,
+ type DividerSpacing,
+} from "./divider";
diff --git a/registry/bases/forme/components/form/form.styles.ts b/registry/bases/forme/components/form/form.styles.ts
new file mode 100644
index 0000000..b1be7df
--- /dev/null
+++ b/registry/bases/forme/components/form/form.styles.ts
@@ -0,0 +1,143 @@
+import { StyleSheet } from "@formepdf/react";
+
+import type { PdfcnTheme } from "@/registry/themes";
+
+import type { PdfFormVariant } from "./form.types";
+
+/** Style factory for fillable form layouts, derived from the active theme. */
+export function createFormStyles(
+ t: PdfcnTheme,
+ variant: PdfFormVariant = "underline"
+) {
+ const { spacing, borderRadius, fontWeights, typography } = t.primitives;
+ const borderColor = t.colors.border;
+ const hairline = 0.75; // lighter than spacing[0.5]=2pt — more refined
+ const rule = 1; // group title rule
+
+ const fieldAreaByVariant: Record<PdfFormVariant, object> = {
+ box: {
+ borderColor,
+ borderRadius: borderRadius.sm,
+ borderStyle: "solid",
+ borderWidth: hairline,
+ },
+ ghost: {
+ backgroundColor: t.colors.muted,
+ borderRadius: borderRadius.sm,
+ },
+ outlined: {
+ borderColor: t.colors.foreground,
+ borderRadius: borderRadius.md,
+ borderStyle: "solid",
+ borderWidth: hairline,
+ },
+ underline: {
+ borderBottomColor: borderColor,
+ borderBottomStyle: "solid",
+ borderBottomWidth: 1,
+ },
+ };
+
+ const hasPadding =
+ variant === "box" || variant === "outlined" || variant === "ghost";
+
+ return StyleSheet.create({
+ column: {
+ flex: 1,
+ },
+
+ columnsRow: {
+ flexDirection: "row",
+ gap: spacing[4],
+ },
+ fieldAbove: {
+ marginBottom: spacing[3],
+ width: "100%",
+ },
+ fieldArea: {
+ width: "100%" as const,
+ ...fieldAreaByVariant[variant],
+ },
+
+ fieldLeft: {
+ alignItems: "flex-end",
+ flexDirection: "row",
+ gap: spacing[2],
+ marginBottom: spacing[3],
+ },
+ fieldLeftArea: {
+ flex: 1,
+ },
+
+ formDivider: {
+ borderBottomColor: borderColor,
+ borderBottomStyle: "solid",
+ borderBottomWidth: rule,
+ marginBottom: spacing[4],
+ },
+ formSubtitle: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: typography.sm,
+ lineHeight: t.typography.body.lineHeight,
+ marginBottom: spacing[3],
+ },
+
+ formTitle: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.heading.fontFamily,
+ fontSize: typography.xl,
+ fontWeight: fontWeights.bold,
+ lineHeight: t.typography.heading.lineHeight,
+ marginBottom: spacing[1],
+ },
+ group: {
+ marginBottom: spacing[5],
+ },
+
+ groupTitle: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: typography.xs,
+ fontWeight: fontWeights.semibold,
+ letterSpacing: 0.8,
+ lineHeight: 1.2,
+ marginBottom: spacing[3],
+ textTransform: "uppercase",
+ },
+ hint: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: typography.xs,
+ opacity: 0.14,
+ paddingBottom: hasPadding ? spacing[1] : 0,
+ paddingHorizontal: hasPadding ? spacing[2] : 0,
+ paddingTop: hasPadding ? spacing[1] : spacing[0.5],
+ },
+ labelAbove: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: typography.xs,
+ fontWeight: fontWeights.medium,
+ letterSpacing: 0.5,
+ lineHeight: 1.2,
+ marginBottom: spacing[1],
+ textTransform: "uppercase",
+ },
+
+ labelLeft: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ fontWeight: fontWeights.medium,
+ lineHeight: t.typography.body.lineHeight,
+ paddingBottom: hasPadding ? spacing[1] : 0,
+ width: 80,
+ },
+
+ root: {
+ marginBottom: t.spacing.componentGap,
+ width: "100%",
+ },
+ });
+}
diff --git a/registry/bases/forme/components/form/form.tsx b/registry/bases/forme/components/form/form.tsx
new file mode 100644
index 0000000..09140d3
--- /dev/null
+++ b/registry/bases/forme/components/form/form.tsx
@@ -0,0 +1,142 @@
+import { Text as PDFText, View } from "@formepdf/react";
+import type { Style } from "@formepdf/react";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { createFormStyles } from "./form.styles";
+import type {
+ FormLayout,
+ PdfFormField,
+ PdfFormGroup,
+ PdfFormProps,
+} from "./form.types";
+
+function renderFieldAbove(
+ field: PdfFormField,
+ idx: number,
+ styles: ReturnType<typeof createFormStyles>
+) {
+ const areaHeight = field.height ?? 18;
+ const areaStyle: Style[] = [styles.fieldArea, { minHeight: areaHeight }];
+
+ return (
+ <View key={`${field.label}-${idx}`} style={styles.fieldAbove}>
+ <PDFText style={styles.labelAbove}>{field.label}</PDFText>
+ <View style={areaStyle as never}>
+ {field.hint ? (
+ <PDFText style={styles.hint}>{field.hint}</PDFText>
+ ) : null}
+ </View>
+ </View>
+ );
+}
+
+function renderFieldLeft(
+ field: PdfFormField,
+ idx: number,
+ styles: ReturnType<typeof createFormStyles>
+) {
+ const areaHeight = field.height ?? 18;
+ const areaStyle: Style[] = [
+ styles.fieldArea,
+ styles.fieldLeftArea,
+ { minHeight: areaHeight },
+ ];
+
+ return (
+ <View key={`${field.label}-${idx}`} style={styles.fieldLeft}>
+ <PDFText style={styles.labelLeft}>{field.label}</PDFText>
+ <View style={areaStyle as never}>
+ {field.hint ? (
+ <PDFText style={styles.hint}>{field.hint}</PDFText>
+ ) : null}
+ </View>
+ </View>
+ );
+}
+
+function renderGroup(
+ group: PdfFormGroup,
+ gi: number,
+ styles: ReturnType<typeof createFormStyles>,
+ labelPosition: "above" | "left"
+) {
+ const layout: FormLayout = group.layout ?? "single";
+ const cols = layout === "three-column" ? 3 : (layout === "two-column" ? 2 : 1);
+
+ const renderField = (field: PdfFormField, idx: number) =>
+ labelPosition === "left"
+ ? renderFieldLeft(field, idx, styles)
+ : renderFieldAbove(field, idx, styles);
+
+ if (cols === 1) {
+ return (
+ <View key={`group-${gi}`} style={styles.group}>
+ {group.title ? (
+ <PDFText style={styles.groupTitle}>{group.title}</PDFText>
+ ) : null}
+ {group.fields.map(renderField)}
+ </View>
+ );
+ }
+
+ const chunkSize = Math.ceil(group.fields.length / cols);
+ const chunks: PdfFormField[][] = [];
+ for (let i = 0; i < group.fields.length; i += chunkSize) {
+ chunks.push(group.fields.slice(i, i + chunkSize));
+ }
+ while (chunks.length < cols) {
+ chunks.push([]);
+ }
+
+ return (
+ <View key={`group-${gi}`} style={styles.group}>
+ {group.title ? (
+ <PDFText style={styles.groupTitle}>{group.title}</PDFText>
+ ) : null}
+ <View style={styles.columnsRow}>
+ {chunks.map((chunk, ci) => (
+ <View
+ key={`col-${gi}-${chunk[0]?.label ?? ci}`}
+ style={styles.column}
+ >
+ {chunk.map(renderField)}
+ </View>
+ ))}
+ </View>
+ </View>
+ );
+}
+
+export function PdfForm({
+ title,
+ subtitle,
+ groups,
+ variant = "underline",
+ labelPosition = "above",
+ noWrap = false,
+ style,
+}: PdfFormProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(
+ () => createFormStyles(theme, variant),
+ [theme, variant]
+ );
+
+ const rootStyles: Style[] = [styles.root];
+ if (style) {
+ rootStyles.push(style);
+ }
+
+ const inner = (
+ <View style={rootStyles as never}>
+ {title ? <PDFText style={styles.formTitle}>{title}</PDFText> : null}
+ {subtitle ? (
+ <PDFText style={styles.formSubtitle}>{subtitle}</PDFText>
+ ) : null}
+ {title || subtitle ? <View style={styles.formDivider} /> : null}
+ {groups.map((group, gi) => renderGroup(group, gi, styles, labelPosition))}
+ </View>
+ );
+
+ return noWrap ? <View wrap={false}>{inner}</View> : inner;
+}
diff --git a/registry/bases/forme/components/form/form.types.ts b/registry/bases/forme/components/form/form.types.ts
new file mode 100644
index 0000000..f64c990
--- /dev/null
+++ b/registry/bases/forme/components/form/form.types.ts
@@ -0,0 +1,61 @@
+import type { Style } from "@formepdf/react";
+
+/** Visual style variant for the fillable form. */
+export type PdfFormVariant = "underline" | "box" | "outlined" | "ghost";
+
+/** Column layout for a form section. */
+export type FormLayout = "single" | "two-column" | "three-column";
+
+/** Label position relative to the field. */
+export type FormLabelPosition = "above" | "left";
+
+/**
+ * A single fillable field definition.
+ * Props - `label` | `hint` | `height` | `width`
+ * @see {@link PdfFormField}
+ */
+export interface PdfFormField {
+ label: string;
+ hint?: string;
+ /**
+ * Height of the blank field area in points.
+ * @default 18
+ */
+ height?: number;
+ width?: number | string;
+}
+
+/**
+ * A logical group of fields with an optional section title.
+ * Props - `title` | `fields` | `layout`
+ * @see {@link PdfFormGroup}
+ */
+export interface PdfFormGroup {
+ title?: string;
+ fields: PdfFormField[];
+ /**
+ * @default 'single'
+ */
+ layout?: FormLayout;
+}
+
+/**
+ * Fillable PDF form with grouped fields, layout variants, and label positioning options.
+ * Props - `title` | `subtitle` | `groups` | `variant` | `labelPosition` | `noWrap` | `style`
+ * @see {@link PdfFormProps}
+ */
+export interface PdfFormProps {
+ title?: string;
+ subtitle?: string;
+ groups: PdfFormGroup[];
+ /**
+ * @default 'underline'
+ */
+ variant?: PdfFormVariant;
+ /**
+ * @default 'above'
+ */
+ labelPosition?: FormLabelPosition;
+ noWrap?: boolean;
+ style?: Style;
+}
diff --git a/registry/bases/forme/components/form/index.ts b/registry/bases/forme/components/form/index.ts
new file mode 100644
index 0000000..e968b85
--- /dev/null
+++ b/registry/bases/forme/components/form/index.ts
@@ -0,0 +1,9 @@
+export { PdfForm } from "./form";
+export type {
+ PdfFormProps,
+ PdfFormVariant,
+ PdfFormField,
+ PdfFormGroup,
+ FormLayout,
+ FormLabelPosition,
+} from "./form.types";
diff --git a/registry/bases/forme/components/graph/graph.styles.ts b/registry/bases/forme/components/graph/graph.styles.ts
new file mode 100644
index 0000000..2dc5b42
--- /dev/null
+++ b/registry/bases/forme/components/graph/graph.styles.ts
@@ -0,0 +1,57 @@
+import { StyleSheet } from "@formepdf/react";
+
+import type { PdfcnTheme } from "@/registry/themes";
+
+export function createGraphStyles(t: PdfcnTheme) {
+ return StyleSheet.create({
+ chartWithRightLegend: {
+ alignItems: "flex-start",
+ display: "flex",
+ flexDirection: "row",
+ },
+ container: {
+ display: "flex",
+ flexDirection: "column",
+ marginBottom: t.spacing.componentGap,
+ },
+ legendColumn: {
+ display: "flex",
+ flexDirection: "column",
+ gap: 8,
+ marginLeft: 12,
+ marginTop: 18,
+ minWidth: 120,
+ },
+ legendItem: {
+ alignItems: "center",
+ display: "flex",
+ flexDirection: "row",
+ gap: 4,
+ },
+ legendRow: {
+ display: "flex",
+ flexDirection: "row",
+ flexWrap: "wrap",
+ gap: 12,
+ marginTop: 6,
+ },
+ legendText: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.primitives.typography.xs,
+ },
+ subtitle: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.primitives.typography.xs,
+ marginBottom: 6,
+ },
+ title: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.heading.fontFamily,
+ fontSize: t.primitives.typography.base,
+ fontWeight: t.primitives.fontWeights.semibold,
+ marginBottom: 2,
+ },
+ });
+}
diff --git a/registry/bases/forme/components/graph/graph.tsx b/registry/bases/forme/components/graph/graph.tsx
new file mode 100644
index 0000000..094ef88
--- /dev/null
+++ b/registry/bases/forme/components/graph/graph.tsx
@@ -0,0 +1,647 @@
+import { Text as PDFText, View } from "@formepdf/react";
+import type { Style } from "@formepdf/react";
+import type React from "react";
+
+import type { PdfcnTheme } from "@/registry/themes";
+
+import { Circle, G, Line, Path, Rect, Svg, SvgText } from "../../lib/forme-svg";
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { createGraphStyles } from "./graph.styles";
+import type { ChartLayout, GraphProps, GraphSeries } from "./graph.types";
+import {
+ GRAPH_SAFE_WIDTHS,
+ arcPath,
+ buildLayout,
+ fmtNum,
+ getDefaultPalette,
+ getGraphWidth,
+ normalizeData,
+ polarToCartesian,
+ smoothPath,
+ truncate,
+} from "./graph.utils";
+
+/**
+ * Shared Y-axis grid lines and tick labels for cartesian charts (bar, line, area).
+ * Extracted to avoid duplicating the identical block across render functions.
+ */
+function renderGridAndYAxis(
+ ticks: number[],
+ toY: (v: number) => number,
+ chartX: number,
+ chartW: number,
+ showGrid: boolean,
+ gridColor: string,
+ textColor: string
+) {
+ return (
+ <>
+ {ticks.map((tick) => {
+ const ty = toY(tick);
+ return (
+ <G key={`grid-${tick}`}>
+ {showGrid && (
+ <Line
+ x1={chartX}
+ y1={ty}
+ x2={chartX + chartW}
+ y2={ty}
+ stroke={gridColor}
+ strokeWidth={0.5}
+ strokeDasharray="3 3"
+ />
+ )}
+ <SvgText
+ x={chartX - 4}
+ y={ty + 3}
+ fill={textColor}
+ textAnchor="end"
+ style={{ fontSize: 7 }}
+ >
+ {fmtNum(tick)}
+ </SvgText>
+ </G>
+ );
+ })}
+ </>
+ );
+}
+
+function renderBarChart(
+ series: GraphSeries[],
+ layout: ChartLayout,
+ palette: string[],
+ showGrid: boolean,
+ showValues: boolean,
+ theme: PdfcnTheme
+) {
+ const { chartX, chartY, chartW, chartH, yMin, yMax, yTicks, xLabels } =
+ layout;
+ const nCategories = xLabels.length;
+ const nSeries = series.length;
+ const groupGap = 0.25;
+ const groupW = chartW / nCategories;
+ const barW = (groupW * (1 - groupGap)) / nSeries;
+ const textColor = theme.colors.mutedForeground;
+ const gridColor = theme.colors.border;
+ const axisColor = theme.colors.foreground;
+ const range = yMax - yMin || 1;
+ const toY = (v: number) => chartY + chartH - ((v - yMin) / range) * chartH;
+
+ return (
+ <>
+ {renderGridAndYAxis(
+ yTicks,
+ toY,
+ chartX,
+ chartW,
+ showGrid,
+ gridColor,
+ textColor
+ )}
+
+ <Line
+ x1={chartX}
+ y1={chartY + chartH}
+ x2={chartX + chartW}
+ y2={chartY + chartH}
+ stroke={axisColor}
+ strokeWidth={1}
+ />
+
+ {xLabels.map((label, ci) => {
+ const groupLeft = chartX + ci * groupW + groupW * (groupGap / 2);
+ return (
+ // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity
+ <G key={`group-${ci}`}>
+ {series.map((s, si) => {
+ const val = s.data[ci]?.value ?? 0;
+ const color =
+ s.data[ci]?.color ?? s.color ?? palette[si % palette.length];
+ const barH = ((val - yMin) / range) * chartH;
+ const bx = groupLeft + si * barW;
+ const by = chartY + chartH - barH;
+ return (
+ // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity
+ <G key={`bar-${ci}-${si}`}>
+ <Rect
+ x={bx}
+ y={by}
+ width={barW - 1}
+ height={barH}
+ fill={color}
+ />
+ {showValues && barH > 10 && (
+ <SvgText
+ x={bx + barW / 2 - 0.5}
+ y={by - 2}
+ fill={axisColor}
+ textAnchor="middle"
+ style={{ fontSize: 6 }}
+ >
+ {fmtNum(val)}
+ </SvgText>
+ )}
+ </G>
+ );
+ })}
+ <SvgText
+ x={groupLeft + (nSeries * barW) / 2}
+ y={chartY + chartH + 10}
+ fill={textColor}
+ textAnchor="middle"
+ style={{ fontSize: 7 }}
+ >
+ {truncate(label, 10)}
+ </SvgText>
+ </G>
+ );
+ })}
+ </>
+ );
+}
+
+function renderHorizontalBarChart(
+ series: GraphSeries[],
+ layout: ChartLayout,
+ palette: string[],
+ showValues: boolean,
+ theme: PdfcnTheme
+) {
+ const { chartX, chartY, chartW, chartH, xLabels } = layout;
+ const nCategories = xLabels.length;
+ const allValues = series.flatMap((s) => s.data.map((d) => d.value));
+ const maxVal = Math.max(...allValues, 1);
+ const rowH = chartH / nCategories;
+ const barH = rowH * 0.5;
+ const textColor = theme.colors.mutedForeground;
+ const axisColor = theme.colors.foreground;
+ const labelW = 60;
+
+ return (
+ <>
+ {xLabels.map((label, ci) => {
+ const rowY = chartY + ci * rowH;
+ const val = series[0]?.data[ci]?.value ?? 0;
+ const color =
+ series[0]?.data[ci]?.color ??
+ series[0]?.color ??
+ palette[ci % palette.length];
+ const barW = (val / maxVal) * (chartW - labelW);
+ return (
+ // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity
+ <G key={`hbar-${ci}`}>
+ <SvgText
+ x={chartX + labelW - 4}
+ y={rowY + rowH / 2 + 3}
+ fill={textColor}
+ textAnchor="end"
+ style={{ fontSize: 7 }}
+ >
+ {truncate(label, 14)}
+ </SvgText>
+ <Rect
+ x={chartX + labelW}
+ y={rowY + (rowH - barH) / 2}
+ width={Math.max(barW, 1)}
+ height={barH}
+ fill={color}
+ />
+ {showValues && (
+ <SvgText
+ x={chartX + labelW + barW + 3}
+ y={rowY + rowH / 2 + 3}
+ fill={axisColor}
+ textAnchor="start"
+ style={{ fontSize: 6 }}
+ >
+ {fmtNum(val)}
+ </SvgText>
+ )}
+ </G>
+ );
+ })}
+ <Line
+ x1={chartX + labelW}
+ y1={chartY}
+ x2={chartX + labelW}
+ y2={chartY + chartH}
+ stroke={axisColor}
+ strokeWidth={1}
+ />
+ </>
+ );
+}
+
+function renderLineAreaChart(
+ series: GraphSeries[],
+ layout: ChartLayout,
+ palette: string[],
+ showGrid: boolean,
+ showValues: boolean,
+ showDots: boolean,
+ smooth: boolean,
+ isArea: boolean,
+ theme: PdfcnTheme
+) {
+ const { chartX, chartY, chartW, chartH, yMin, yMax, yTicks, xLabels } =
+ layout;
+ const range = yMax - yMin || 1;
+ const textColor = theme.colors.mutedForeground;
+ const gridColor = theme.colors.border;
+ const axisColor = theme.colors.foreground;
+ const nPoints = xLabels.length;
+
+ const xFor = (i: number) => chartX + (i / Math.max(nPoints - 1, 1)) * chartW;
+ const yFor = (v: number) => chartY + chartH - ((v - yMin) / range) * chartH;
+
+ return (
+ <>
+ {renderGridAndYAxis(
+ yTicks,
+ yFor,
+ chartX,
+ chartW,
+ showGrid,
+ gridColor,
+ textColor
+ )}
+
+ <Line
+ x1={chartX}
+ y1={chartY + chartH}
+ x2={chartX + chartW}
+ y2={chartY + chartH}
+ stroke={axisColor}
+ strokeWidth={1}
+ />
+
+ {series.map((s, si) => {
+ const color = s.color ?? palette[si % palette.length];
+ const points = s.data.map((d, i) => ({ x: xFor(i), y: yFor(d.value) }));
+
+ const lineDStr = smooth
+ ? smoothPath(points)
+ : `M ${points.map((p) => `${p.x} ${p.y}`).join(" L ")}`;
+
+ const areaPath =
+ isArea && points.length > 1
+ ? `${lineDStr} L ${points.at(-1)!.x} ${chartY + chartH} L ${points[0]!.x} ${chartY + chartH} Z`
+ : null;
+
+ return (
+ // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity
+ <G key={`series-${si}`}>
+ {isArea && areaPath && (
+ <Path d={areaPath} fill={color} fillOpacity={0.2} stroke="none" />
+ )}
+ <Path d={lineDStr} stroke={color} strokeWidth={2} fill="none" />
+ {showDots &&
+ points.map((p, pi) => (
+ // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity
+ <Circle
+ key={`dot-${pi}`}
+ cx={p.x}
+ cy={p.y}
+ r={3}
+ fill={color}
+ />
+ ))}
+ {showValues &&
+ points.map((p, pi) => (
+ <SvgText
+ // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity
+ key={`val-${pi}`}
+ x={p.x}
+ y={p.y - 5}
+ fill={color}
+ textAnchor="middle"
+ style={{ fontSize: 6 }}
+ >
+ {fmtNum(s.data[pi].value)}
+ </SvgText>
+ ))}
+ </G>
+ );
+ })}
+
+ {xLabels.map((label, i) => (
+ <SvgText
+ key={`xlabel-${label}`}
+ x={xFor(i)}
+ y={chartY + chartH + 10}
+ fill={textColor}
+ textAnchor="middle"
+ style={{ fontSize: 7 }}
+ >
+ {truncate(label, 8)}
+ </SvgText>
+ ))}
+ </>
+ );
+}
+
+function renderPieDonutChart(
+ series: GraphSeries[],
+ layout: ChartLayout,
+ palette: string[],
+ centerLabel: string | undefined,
+ isDonut: boolean,
+ theme: PdfcnTheme
+) {
+ const { svgW, svgH } = layout;
+ const cx = svgW / 2;
+ const cy = svgH / 2;
+ const r = Math.min(svgW, svgH) / 2 - 20;
+ const innerR = isDonut ? r * 0.52 : 0;
+ const textColor = theme.colors.mutedForeground;
+
+ const data = series[0]?.data ?? [];
+ const total = data.reduce((sum, d) => sum + d.value, 0) || 1;
+
+ let currentAngle = 0;
+
+ return (
+ <>
+ {data.map((d, i) => {
+ const color = d.color ?? palette[i % palette.length];
+ const sweep = (d.value / total) * 360;
+ const midAngle = currentAngle + sweep / 2;
+ const path = arcPath(
+ cx,
+ cy,
+ r,
+ currentAngle,
+ currentAngle + sweep,
+ innerR
+ );
+ currentAngle += sweep;
+
+ const labelR = r * 1.18;
+ const lp = polarToCartesian(cx, cy, labelR, midAngle);
+ const anchor = lp.x > cx ? "start" : "end";
+
+ return (
+ // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity
+ <G key={`slice-${i}`}>
+ <Path d={path} fill={color} stroke="white" strokeWidth={1} />
+ {/* Show label only if slice is large enough to label */}
+ {sweep > 15 && (
+ <SvgText
+ x={lp.x}
+ y={lp.y + 3}
+ fill={textColor}
+ textAnchor={anchor}
+ style={{ fontSize: 7 }}
+ >
+ {truncate(d.label, 10)}
+ </SvgText>
+ )}
+ </G>
+ );
+ })}
+
+ {isDonut && centerLabel && (
+ <>
+ <Circle cx={cx} cy={cy} r={innerR} fill="white" />
+ <SvgText
+ x={cx}
+ y={cy + 4}
+ fill={theme.colors.foreground}
+ textAnchor="middle"
+ style={{ fontSize: 9, fontWeight: "bold" }}
+ >
+ {centerLabel}
+ </SvgText>
+ </>
+ )}
+ </>
+ );
+}
+
+function Legend({
+ series,
+ palette,
+ styles,
+ position = "bottom",
+}: {
+ series: GraphSeries[];
+ palette: string[];
+ styles: ReturnType<typeof createGraphStyles>;
+ position?: "bottom" | "right";
+}) {
+ const containerStyle =
+ position === "right" ? styles.legendColumn : styles.legendRow;
+
+ return (
+ <View style={containerStyle as never}>
+ {series.map((s, i) => (
+ <View key={s.name} style={styles.legendItem}>
+ <Svg width={10} height={10}>
+ <Rect
+ x={0}
+ y={2}
+ width={8}
+ height={8}
+ fill={s.color ?? palette[i % palette.length]}
+ />
+ </Svg>
+ <PDFText style={styles.legendText}>{s.name}</PDFText>
+ </View>
+ ))}
+ </View>
+ );
+}
+
+/**
+ * PdfGraph — renders bar, horizontal-bar, line, area, pie, and donut charts
+ * natively inside react-pdf documents using SVG primitives.
+ *
+ * No external chart libraries are required or used — all rendering is done via
+ * react-pdf's built-in SVG support (`<Svg>`, `<Rect>`, `<Path>`, `<Line>`, etc.).
+ *
+ * @example Bar chart
+ * ```tsx
+ * <PdfGraph
+ * variant="bar"
+ * title="Monthly Revenue"
+ * data={[
+ * { label: 'Jan', value: 42000 },
+ * { label: 'Feb', value: 38000 },
+ * { label: 'Mar', value: 55000 },
+ * ]}
+ * />
+ * ```
+ *
+ * @example Donut chart with center label
+ * ```tsx
+ * <PdfGraph
+ * variant="donut"
+ * data={[
+ * { label: 'Product A', value: 45 },
+ * { label: 'Product B', value: 30 },
+ * { label: 'Other', value: 25 },
+ * ]}
+ * centerLabel="$1.2M"
+ * />
+ * ```
+ *
+ * **Limitations (by design):**
+ * - No interactivity (PDFs are static)
+ * - No animations
+ * - SVG Text inside charts uses SVG font attributes (not react-pdf StyleSheet fonts)
+ * - For print PDFs use SVG-friendly fonts registered with Font.register()
+ */
+export function PdfGraph({
+ variant = "bar",
+ data,
+ title,
+ subtitle,
+ xLabel,
+ yLabel,
+ width: explicitWidth,
+ height = 260,
+ fullWidth = false,
+ containerPadding = 0,
+ wrapperPadding = 0,
+ colors,
+ showValues = false,
+ showGrid = true,
+ legend = "bottom",
+ centerLabel,
+ showDots = true,
+ smooth = false,
+ yTicks: yTickCount = 5,
+ noWrap = true,
+ style,
+}: GraphProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createGraphStyles(theme), [theme]);
+ const palette = colors ?? getDefaultPalette(theme);
+ const series = normalizeData(data);
+
+ const width = useSafeMemo(() => {
+ if (fullWidth) {
+ return getGraphWidth(theme, { containerPadding, wrapperPadding });
+ }
+ return explicitWidth ?? GRAPH_SAFE_WIDTHS.default;
+ }, [fullWidth, explicitWidth, theme, containerPadding, wrapperPadding]);
+
+ const isPieOrDonut = variant === "pie" || variant === "donut";
+ const layout = buildLayout(series, width, height, isPieOrDonut, yTickCount);
+ const { chartX, chartW } = layout;
+
+ let chartContent: React.ReactNode = null;
+
+ switch (variant) {
+ case "bar": {
+ chartContent = renderBarChart(
+ series,
+ layout,
+ palette,
+ showGrid,
+ showValues,
+ theme
+ );
+ break;
+ }
+ case "horizontal-bar": {
+ chartContent = renderHorizontalBarChart(
+ series,
+ layout,
+ palette,
+ showValues,
+ theme
+ );
+ break;
+ }
+ case "line":
+ case "area": {
+ chartContent = renderLineAreaChart(
+ series,
+ layout,
+ palette,
+ showGrid,
+ showValues,
+ showDots,
+ smooth,
+ variant === "area",
+ theme
+ );
+ break;
+ }
+ case "pie": {
+ chartContent = renderPieDonutChart(
+ series,
+ layout,
+ palette,
+ undefined,
+ false,
+ theme
+ );
+ break;
+ }
+ case "donut": {
+ chartContent = renderPieDonutChart(
+ series,
+ layout,
+ palette,
+ centerLabel,
+ true,
+ theme
+ );
+ break;
+ }
+ }
+
+ const showLegend = legend !== "none" && !isPieOrDonut;
+
+ const containerStyles: Style[] = [styles.container];
+ if (style) {
+ containerStyles.push(style);
+ }
+
+ const content = (
+ <View style={containerStyles as never}>
+ {title && <PDFText style={styles.title}>{title}</PDFText>}
+ {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}
+ <View
+ style={legend === "right" ? styles.chartWithRightLegend : undefined}
+ >
+ <Svg width={width} height={height}>
+ {chartContent}
+ {!isPieOrDonut && xLabel && (
+ <SvgText
+ x={chartX + chartW / 2}
+ y={height - 2}
+ fill={theme.colors.mutedForeground}
+ textAnchor="middle"
+ style={{ fontSize: 8 }}
+ >
+ {xLabel}
+ </SvgText>
+ )}
+ {!isPieOrDonut && yLabel && (
+ <SvgText
+ x={2}
+ y={10}
+ fill={theme.colors.mutedForeground}
+ textAnchor="start"
+ style={{ fontSize: 8 }}
+ >
+ {yLabel}
+ </SvgText>
+ )}
+ </Svg>
+ {showLegend &&
+ legend === "right" &&
+ Legend({ palette, position: "right", series, styles })}
+ </View>
+ {showLegend &&
+ legend === "bottom" &&
+ Legend({ palette, position: "bottom", series, styles })}
+ </View>
+ );
+
+ return noWrap ? <View wrap={false}>{content}</View> : content;
+}
diff --git a/registry/bases/forme/components/graph/graph.types.ts b/registry/bases/forme/components/graph/graph.types.ts
new file mode 100644
index 0000000..54f1bd1
--- /dev/null
+++ b/registry/bases/forme/components/graph/graph.types.ts
@@ -0,0 +1,120 @@
+import type { Style } from "@formepdf/react";
+
+/**
+ * Options for calculating graph width based on theme page margins and container context.
+ * Props - `containerPadding` | `wrapperPadding` | `pageWidth`
+ * @see {@link GraphWidthOptions}
+ */
+export interface GraphWidthOptions {
+ containerPadding?: number;
+ wrapperPadding?: number;
+ pageWidth?: number;
+}
+
+export type GraphVariant =
+ | "bar"
+ | "horizontal-bar"
+ | "line"
+ | "area"
+ | "pie"
+ | "donut";
+
+export type GraphLegendPosition = "bottom" | "right" | "none";
+
+/**
+ * A single data point with a label, numeric value, and optional color override.
+ * Props - `label` | `value` | `color`
+ * @see {@link GraphDataPoint}
+ */
+export interface GraphDataPoint {
+ label: string;
+ value: number;
+ color?: string;
+}
+
+/**
+ * A named data series containing multiple data points, used for multi-series charts.
+ * Props - `name` | `data` | `color`
+ * @see {@link GraphSeries}
+ */
+export interface GraphSeries {
+ name: string;
+ data: GraphDataPoint[];
+ color?: string;
+}
+
+/**
+ * Multi-variant PDF chart (bar, line, area, pie, donut) rendered with SVG primitives.
+ * Props - `variant` | `data` | `title` | `subtitle` | `xLabel` | `yLabel` | `width` | `height` | `fullWidth` | `containerPadding` | `wrapperPadding` | `colors` | `showValues` | `showGrid` | `legend` | `centerLabel` | `showDots` | `smooth` | `yTicks` | `noWrap` | `style`
+ * @see {@link GraphProps}
+ */
+export interface GraphProps {
+ /**
+ * @default 'bar'
+ */
+ variant?: GraphVariant;
+ data: GraphDataPoint[] | GraphSeries[];
+ title?: string;
+ subtitle?: string;
+ xLabel?: string;
+ yLabel?: string;
+ /**
+ * @default 420
+ */
+ width?: number;
+ /**
+ * @default 260
+ */
+ height?: number;
+ /**
+ * @default false
+ */
+ fullWidth?: boolean;
+ containerPadding?: number;
+ wrapperPadding?: number;
+ colors?: string[];
+ /**
+ * @default false
+ */
+ showValues?: boolean;
+ /**
+ * @default true
+ */
+ showGrid?: boolean;
+ /**
+ * @default 'bottom'
+ */
+ legend?: GraphLegendPosition;
+ centerLabel?: string;
+ /**
+ * @default true
+ */
+ showDots?: boolean;
+ /**
+ * @default false
+ */
+ smooth?: boolean;
+ /**
+ * @default 5
+ */
+ yTicks?: number;
+ /**
+ * @default true
+ */
+ noWrap?: boolean;
+ style?: Style;
+}
+
+/** Internal chart layout dimensions computed from props and data. */
+export interface ChartLayout {
+ svgW: number;
+ svgH: number;
+ chartX: number;
+ chartY: number;
+ chartW: number;
+ chartH: number;
+ yMin: number;
+ yMax: number;
+ yTicks: number[];
+ xLabels: string[];
+}
diff --git a/registry/bases/forme/components/graph/graph.utils.ts b/registry/bases/forme/components/graph/graph.utils.ts
new file mode 100644
index 0000000..6a1fc12
--- /dev/null
+++ b/registry/bases/forme/components/graph/graph.utils.ts
@@ -0,0 +1,226 @@
+import type { PdfcnTheme } from "@/registry/themes";
+
+import type {
+ ChartLayout,
+ GraphDataPoint,
+ GraphSeries,
+ GraphWidthOptions,
+} from "./graph.types";
+
+/** Standard A4 page width in PDF points. */
+export const A4_WIDTH = 595;
+
+/**
+ * Pre-calculated safe graph widths for common scenarios.
+ * These values work with all built-in themes on A4 pages.
+ */
+export const GRAPH_SAFE_WIDTHS = {
+ /** Safe width for graph directly in page content (no extra containers) */
+ default: 420,
+ /** Safe width for graph inside a Section with md padding */
+ inSection: 400,
+ /** Safe width for graph inside a Section + bordered wrapper (like graphShell) */
+ inSectionWithWrapper: 380,
+} as const;
+
+/**
+ * Calculate the safe graph width based on theme page margins and container context.
+ *
+ * This utility ensures graphs don't overflow their container by accounting for:
+ * - Page margins (from theme)
+ * - Container padding (e.g., Section component)
+ * - Wrapper padding (e.g., a bordered graphShell View)
+ *
+ * @example
+ * ```tsx
+ * const width = getGraphWidth(theme);
+ * // For a graph inside a Section with padding="md" (12pt) and a graphShell (12pt):
+ * const width = getGraphWidth(theme, { containerPadding: 12, wrapperPadding: 12 });
+ * ```
+ */
+export function getGraphWidth(
+ theme: PdfcnTheme,
+ options: GraphWidthOptions = {}
+): number {
+ const {
+ containerPadding = 0,
+ wrapperPadding = 0,
+ pageWidth = A4_WIDTH,
+ } = options;
+ const { marginLeft, marginRight } = theme.spacing.page;
+ const availableWidth =
+ pageWidth -
+ marginLeft -
+ marginRight -
+ containerPadding * 2 -
+ wrapperPadding * 2;
+ return Math.max(Math.floor(availableWidth), 100);
+}
+
+export const CHART_MARGINS = {
+ axisBottom: 24,
+ axisLeft: 40,
+ pieBottom: 10,
+ pieLeft: 10,
+ right: 10,
+ top: 10,
+} as const;
+
+/** Normalize to always work with GraphSeries[]. */
+export function normalizeData(
+ data: GraphDataPoint[] | GraphSeries[]
+): GraphSeries[] {
+ if (data.length === 0) {
+ return [];
+ }
+ if ("label" in data[0] && "value" in data[0]) {
+ return [{ data: data as GraphDataPoint[], name: "Series 1" }];
+ }
+ return data as GraphSeries[];
+}
+
+/** Compute nice Y-axis ticks for a given value range. */
+export function computeYTicks(
+ min: number,
+ max: number,
+ count: number
+): number[] {
+ if (min === max) {
+ return [0, max || 1];
+ }
+ const step = (max - min) / (count - 1);
+ return Array.from({ length: count }, (_, i) => {
+ const v = min + i * step;
+ return Math.round(v * 100) / 100;
+ });
+}
+
+/** Format a number for display on axis labels. */
+export function fmtNum(v: number): string {
+ if (Math.abs(v) >= 1_000_000) {
+ return `${(v / 1_000_000).toFixed(1)}M`;
+ }
+ if (Math.abs(v) >= 1000) {
+ return `${(v / 1000).toFixed(1)}K`;
+ }
+ if (!Number.isInteger(v)) {
+ return v.toFixed(1);
+ }
+ return String(v);
+}
+
+/** Truncate a label to at most maxLen characters. */
+export function truncate(s: string, maxLen: number): string {
+ return s.length > maxLen ? `${s.slice(0, maxLen - 1)}…` : s;
+}
+
+/** Polar to Cartesian coordinate conversion for pie/donut arcs. */
+export function polarToCartesian(
+ cx: number,
+ cy: number,
+ r: number,
+ angleDeg: number
+) {
+ const rad = ((angleDeg - 90) * Math.PI) / 180;
+ return { x: cx + r * Math.cos(rad), y: cy + r * Math.sin(rad) };
+}
+
+/** Build an SVG arc path for a pie/donut slice. */
+export function arcPath(
+ cx: number,
+ cy: number,
+ r: number,
+ startAngle: number,
+ endAngle: number,
+ innerR = 0
+): string {
+ const safeEnd = Math.min(endAngle, startAngle + 359.999);
+ const large = safeEnd - startAngle > 180 ? 1 : 0;
+ const s = polarToCartesian(cx, cy, r, safeEnd);
+ const e = polarToCartesian(cx, cy, r, startAngle);
+ if (innerR === 0) {
+ return `M ${cx} ${cy} L ${s.x} ${s.y} A ${r} ${r} 0 ${large} 0 ${e.x} ${e.y} Z`;
+ }
+ const si = polarToCartesian(cx, cy, innerR, safeEnd);
+ const ei = polarToCartesian(cx, cy, innerR, startAngle);
+ return [
+ `M ${s.x} ${s.y}`,
+ `A ${r} ${r} 0 ${large} 0 ${e.x} ${e.y}`,
+ `L ${ei.x} ${ei.y}`,
+ `A ${innerR} ${innerR} 0 ${large} 1 ${si.x} ${si.y}`,
+ "Z",
+ ].join(" ");
+}
+
+/** Compute smooth bezier control points (Catmull-Rom → cubic bezier). */
+export function smoothPath(
+ points: { x: number; y: number }[],
+ tension = 0.4
+): string {
+ if (points.length < 2) {
+ return "";
+ }
+ if (points.length === 2) {
+ return `M ${points[0].x} ${points[0].y} L ${points[1].x} ${points[1].y}`;
+ }
+ const parts: string[] = [`M ${points[0].x} ${points[0].y}`];
+ for (let i = 0; i < points.length - 1; i++) {
+ const p0 = points[Math.max(i - 1, 0)];
+ const p1 = points[i];
+ const p2 = points[i + 1];
+ const p3 = points[Math.min(i + 2, points.length - 1)];
+ const cp1x = p1.x + (p2.x - p0.x) * tension;
+ const cp1y = p1.y + (p2.y - p0.y) * tension;
+ const cp2x = p2.x - (p3.x - p1.x) * tension;
+ const cp2y = p2.y - (p3.y - p1.y) * tension;
+ parts.push(`C ${cp1x} ${cp1y} ${cp2x} ${cp2y} ${p2.x} ${p2.y}`);
+ }
+ return parts.join(" ");
+}
+
+/** Get the default chart color palette from the theme. */
+export function getDefaultPalette(t: PdfcnTheme): string[] {
+ return [
+ t.colors.primary,
+ t.colors.info ?? "#3B82F6",
+ t.colors.success ?? "#22C55E",
+ t.colors.warning ?? "#F59E0B",
+ t.colors.destructive ?? "#EF4444",
+ "#8B5CF6",
+ "#F97316",
+ "#14B8A6",
+ ];
+}
+
+/** Derive ChartLayout from series data, SVG dimensions, and variant. */
+export function buildLayout(
+ series: GraphSeries[],
+ width: number,
+ height: number,
+ isPieOrDonut: boolean,
+ yTickCount: number
+): ChartLayout {
+ const mL = isPieOrDonut ? CHART_MARGINS.pieLeft : CHART_MARGINS.axisLeft;
+ const mB = isPieOrDonut ? CHART_MARGINS.pieBottom : CHART_MARGINS.axisBottom;
+ const chartX = mL;
+ const chartY = CHART_MARGINS.top;
+ const chartW = width - mL - CHART_MARGINS.right;
+ const chartH = height - CHART_MARGINS.top - mB;
+ const allValues = series.flatMap((s) => s.data.map((d) => d.value));
+ const rawMin = Math.min(...allValues, 0);
+ const rawMax = Math.max(...allValues, 1);
+ const yMin = Math.min(0, rawMin);
+ const yMax = rawMax + (rawMax - yMin) * 0.08;
+ return {
+ chartH,
+ chartW,
+ chartX,
+ chartY,
+ svgH: height,
+ svgW: width,
+ xLabels: series[0]?.data.map((d) => d.label) ?? [],
+ yMax,
+ yMin,
+ yTicks: computeYTicks(yMin, yMax, yTickCount),
+ };
+}
diff --git a/registry/bases/forme/components/graph/index.ts b/registry/bases/forme/components/graph/index.ts
new file mode 100644
index 0000000..a9dd44f
--- /dev/null
+++ b/registry/bases/forme/components/graph/index.ts
@@ -0,0 +1,10 @@
+export { PdfGraph } from "./graph";
+export { A4_WIDTH, GRAPH_SAFE_WIDTHS, getGraphWidth } from "./graph.utils";
+export type {
+ GraphDataPoint,
+ GraphLegendPosition,
+ GraphProps,
+ GraphSeries,
+ GraphVariant,
+ GraphWidthOptions,
+} from "./graph.types";
diff --git a/registry/bases/forme/components/heading/heading.tsx b/registry/bases/forme/components/heading/heading.tsx
new file mode 100644
index 0000000..f60e4ad
--- /dev/null
+++ b/registry/bases/forme/components/heading/heading.tsx
@@ -0,0 +1,177 @@
+import { StyleSheet, Text } from "@formepdf/react";
+import type { Style } from "@formepdf/react";
+
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { resolveColor } from "../../lib/resolve-color";
+
+export type HeadingWeight = "normal" | "medium" | "semibold" | "bold";
+export type HeadingTracking = "tighter" | "tight" | "normal" | "wide" | "wider";
+
+/**
+ * PDF heading mapped to h1–h6 font sizes from the theme.
+ * Props - `level` | `align` | `color` | `transform` | `weight` | `tracking` | `noMargin` | `keepWithNext` | `children` | `style`
+ * @see {@link HeadingProps}
+ */
+export interface HeadingProps extends PDFComponentProps {
+ /**
+ * @default 1
+ */
+ level?: 1 | 2 | 3 | 4 | 5 | 6;
+ /**
+ * @default 'left'
+ */
+ align?: "left" | "center" | "right";
+ color?: string;
+ transform?: "uppercase" | "lowercase" | "capitalize";
+ /**
+ * @default 'bold'
+ */
+ weight?: HeadingWeight;
+ /**
+ * @default 'normal'
+ */
+ tracking?: HeadingTracking;
+ /**
+ * @default false
+ */
+ noMargin?: boolean;
+ keepWithNext?: boolean;
+}
+
+function createHeadingStyles(t: PdfcnTheme) {
+ const { heading } = t.typography;
+ const { spacing, fontWeights, letterSpacing } = t.primitives;
+ const { sectionGap, componentGap, paragraphGap } = t.spacing;
+ const base = {
+ color: t.colors.foreground,
+ fontFamily: heading.fontFamily,
+ fontWeight: fontWeights.bold,
+ lineHeight: heading.lineHeight,
+ };
+ return StyleSheet.create({
+ capitalize: { textTransform: "capitalize" },
+ h1: {
+ ...base,
+ fontSize: heading.fontSize.h1,
+ marginBottom: paragraphGap,
+ marginTop: spacing[0],
+ },
+ h2: {
+ ...base,
+ fontSize: heading.fontSize.h2,
+ marginBottom: paragraphGap,
+ marginTop: sectionGap,
+ },
+ h3: {
+ ...base,
+ fontSize: heading.fontSize.h3,
+ marginBottom: paragraphGap,
+ marginTop: componentGap,
+ },
+ h4: {
+ ...base,
+ fontSize: heading.fontSize.h4,
+ marginBottom: paragraphGap,
+ marginTop: paragraphGap,
+ },
+ h5: {
+ ...base,
+ fontSize: heading.fontSize.h5,
+ marginBottom: spacing[1],
+ marginTop: paragraphGap,
+ },
+ h6: {
+ ...base,
+ fontSize: heading.fontSize.h6,
+ marginBottom: spacing[1],
+ marginTop: paragraphGap,
+ },
+ lowercase: { textTransform: "lowercase" },
+ noMargin: { marginBottom: 0, marginTop: 0 },
+ trackingNormal: { letterSpacing: letterSpacing.normal },
+ trackingTight: { letterSpacing: letterSpacing.tight * 10 },
+ trackingTighter: { letterSpacing: letterSpacing.tight * 15 },
+ trackingWide: { letterSpacing: letterSpacing.wide * 10 },
+ trackingWider: { letterSpacing: letterSpacing.wider * 10 },
+ uppercase: {
+ letterSpacing: letterSpacing.wider * 10,
+ textTransform: "uppercase",
+ },
+ weightBold: { fontWeight: fontWeights.bold },
+ weightMedium: { fontWeight: fontWeights.medium },
+ weightNormal: { fontWeight: fontWeights.regular },
+ weightSemibold: { fontWeight: fontWeights.semibold },
+ });
+}
+
+export function Heading({
+ level = 1,
+ align,
+ color,
+ transform,
+ weight,
+ tracking,
+ noMargin,
+ keepWithNext = true,
+ children,
+ style,
+}: HeadingProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createHeadingStyles(theme), [theme]);
+ const safeLevel = Math.min(Math.max(Math.round(level), 1), 6) as
+ | 1
+ | 2
+ | 3
+ | 4
+ | 5
+ | 6;
+ const weightMap = {
+ bold: styles.weightBold,
+ medium: styles.weightMedium,
+ normal: styles.weightNormal,
+ semibold: styles.weightSemibold,
+ };
+ const trackingMap = {
+ normal: styles.trackingNormal,
+ tight: styles.trackingTight,
+ tighter: styles.trackingTighter,
+ wide: styles.trackingWide,
+ wider: styles.trackingWider,
+ };
+ const transformMap = {
+ capitalize: styles.capitalize,
+ lowercase: styles.lowercase,
+ uppercase: styles.uppercase,
+ };
+ const styleArray: Style[] = [
+ styles[`h${safeLevel}` as keyof typeof styles] as Style,
+ ];
+ if (weight && weight in weightMap) {
+ styleArray.push(weightMap[weight]);
+ }
+ if (tracking && tracking in trackingMap) {
+ styleArray.push(trackingMap[tracking]);
+ }
+ if (transform && transform in transformMap) {
+ styleArray.push(transformMap[transform as keyof typeof transformMap]);
+ }
+ if (noMargin) {
+ styleArray.push(styles.noMargin);
+ }
+ const semantic = {} as Style;
+ if (align) {
+ semantic.textAlign = align;
+ }
+ if (color) {
+ semantic.color = resolveColor(color, theme.colors);
+ }
+ if (Object.keys(semantic).length > 0) {
+ styleArray.push(semantic);
+ }
+ if (style) {
+ styleArray.push(...[style].flat());
+ }
+ return <Text style={styleArray as never}>{children}</Text>;
+}
diff --git a/registry/bases/forme/components/heading/index.ts b/registry/bases/forme/components/heading/index.ts
new file mode 100644
index 0000000..b31d254
--- /dev/null
+++ b/registry/bases/forme/components/heading/index.ts
@@ -0,0 +1,6 @@
+export {
+ Heading,
+ type HeadingProps,
+ type HeadingWeight,
+ type HeadingTracking,
+} from "./heading";
diff --git a/registry/bases/forme/components/index.ts b/registry/bases/forme/components/index.ts
new file mode 100644
index 0000000..1fd47a4
--- /dev/null
+++ b/registry/bases/forme/components/index.ts
@@ -0,0 +1,151 @@
+export type { PDFComponentProps } from "@/registry/themes";
+export {
+ Heading,
+ type HeadingProps,
+ type HeadingWeight,
+ type HeadingTracking,
+} from "./heading";
+export {
+ Divider,
+ type DividerProps,
+ type DividerVariant,
+ type DividerThickness,
+ type DividerSpacing,
+} from "./divider";
+export { PageBreak, type PageBreakProps } from "./page-break";
+export {
+ PdfPageNumber,
+ type PdfPageNumberProps,
+ type PageNumberAlign,
+ type PageNumberSize,
+} from "./page-number";
+export {
+ PdfWatermark,
+ type PdfWatermarkProps,
+ type WatermarkPosition,
+} from "./watermark";
+export {
+ PdfQRCode,
+ type PdfQRCodeProps,
+ type QRCodeErrorLevel,
+} from "./qrcode";
+export { PdfAlert, type PdfAlertProps, type AlertVariant } from "./alert";
+export {
+ Link,
+ type LinkProps,
+ type LinkVariant,
+ type LinkUnderline,
+} from "./link";
+export {
+ Text,
+ type TextProps,
+ type TextVariant,
+ type TextWeight,
+ type TextDecoration,
+} from "./text";
+export {
+ Stack,
+ type StackProps,
+ type StackGap,
+ type StackDirection,
+ type StackAlign,
+ type StackJustify,
+} from "./stack";
+export {
+ Section,
+ type SectionProps,
+ type SectionSpacing,
+ type SectionPadding,
+ type SectionVariant,
+} from "./section";
+export {
+ Table,
+ TableHeader,
+ TableBody,
+ TableFooter,
+ TableRow,
+ TableCell,
+ type TableProps,
+ type TableSectionProps,
+ type TableRowProps,
+ type TableCellProps,
+ type TableVariant,
+} from "./table";
+export {
+ DataTable,
+ type DataTableProps,
+ type DataTableColumn,
+ type DataTableSize,
+} from "./data-table";
+export {
+ Badge,
+ type BadgeProps,
+ type BadgeVariant,
+ type BadgeSize,
+} from "./badge";
+export {
+ KeyValue,
+ type KeyValueProps,
+ type KeyValueEntry,
+ type KeyValueDirection,
+ type KeyValueSize,
+} from "./key-value";
+export {
+ PageHeader,
+ type PageHeaderProps,
+ type PageHeaderVariant,
+} from "./page-header";
+export {
+ PageFooter,
+ type PageFooterProps,
+ type PageFooterVariant,
+} from "./page-footer";
+export {
+ PdfList,
+ type PdfListProps,
+ type ListVariant,
+ type ListItem,
+} from "./list";
+export { PdfCard, type PdfCardProps, type CardVariant } from "./card";
+export {
+ PdfForm,
+ type PdfFormProps,
+ type PdfFormVariant,
+ type PdfFormField,
+ type PdfFormGroup,
+ type FormLayout,
+ type FormLabelPosition,
+} from "./form";
+export {
+ PdfSignatureBlock,
+ type PdfSignatureBlockProps,
+ type SignatureVariant,
+ type SignatureSigner,
+} from "./signature";
+export { KeepTogether, type KeepTogetherProps } from "./keep-together";
+export {
+ PdfImage,
+ type PdfImageProps,
+ type PdfImageSrc,
+ type PdfImageVariant,
+ type PdfImageFit,
+} from "./pdf-image";
+export {
+ PdfGraph,
+ getGraphWidth,
+ A4_WIDTH,
+ GRAPH_SAFE_WIDTHS,
+ type GraphProps,
+ type GraphVariant,
+ type GraphDataPoint,
+ type GraphSeries,
+ type GraphLegendPosition,
+ type GraphWidthOptions,
+} from "./graph";
+
+export {
+ PdfcnThemeProvider,
+ usePdfcnTheme,
+ useSafeMemo,
+} from "../lib/pdfcn-theme-context";
+export type { PdfcnTheme } from "@/registry/themes";
diff --git a/registry/bases/forme/components/keep-together/index.ts b/registry/bases/forme/components/keep-together/index.ts
new file mode 100644
index 0000000..b111cfb
--- /dev/null
+++ b/registry/bases/forme/components/keep-together/index.ts
@@ -0,0 +1 @@
+export { KeepTogether, type KeepTogetherProps } from "./keep-together";
diff --git a/registry/bases/forme/components/keep-together/keep-together.tsx b/registry/bases/forme/components/keep-together/keep-together.tsx
new file mode 100644
index 0000000..a3b8c55
--- /dev/null
+++ b/registry/bases/forme/components/keep-together/keep-together.tsx
@@ -0,0 +1,18 @@
+import { View } from "@formepdf/react";
+import type { ReactNode } from "react";
+
+import type { Style } from "@/registry/themes";
+
+export interface KeepTogetherProps {
+ children?: ReactNode;
+ minPresenceAhead?: number;
+ style?: Style;
+}
+
+export function KeepTogether({ children, style }: KeepTogetherProps) {
+ return (
+ <View wrap={false} style={style as never}>
+ {children}
+ </View>
+ );
+}
diff --git a/registry/bases/forme/components/key-value/index.ts b/registry/bases/forme/components/key-value/index.ts
new file mode 100644
index 0000000..59d9c39
--- /dev/null
+++ b/registry/bases/forme/components/key-value/index.ts
@@ -0,0 +1,7 @@
+export {
+ KeyValue,
+ type KeyValueProps,
+ type KeyValueEntry,
+ type KeyValueDirection,
+ type KeyValueSize,
+} from "./key-value";
diff --git a/registry/bases/forme/components/key-value/key-value.tsx b/registry/bases/forme/components/key-value/key-value.tsx
new file mode 100644
index 0000000..5220ec6
--- /dev/null
+++ b/registry/bases/forme/components/key-value/key-value.tsx
@@ -0,0 +1,205 @@
+import { Text as PDFText, StyleSheet, View } from "@formepdf/react";
+import type { Style } from "@formepdf/react";
+
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { resolveColor } from "../../lib/resolve-color";
+
+export type KeyValueDirection = "horizontal" | "vertical";
+export type KeyValueSize = "sm" | "md" | "lg";
+
+/**
+ * A single key-value row with optional per-item color and style overrides.
+ * Props - `key` | `value` | `valueColor` | `valueStyle` | `keyStyle`
+ * @see {@link KeyValueEntry}
+ */
+export interface KeyValueEntry {
+ key: string;
+ value: string;
+ valueColor?: string;
+ valueStyle?: Style;
+ keyStyle?: Style;
+}
+
+/**
+ * List of key-value pairs with layout and style options.
+ * Props - `items` | `direction` | `divided` | `size` | `labelFlex` | `labelColor` | `valueColor` | `boldValue` | `noWrap` | `dividerColor` | `dividerThickness` | `dividerMargin` | `style`
+ * @see {@link KeyValueProps}
+ */
+export interface KeyValueProps extends Omit<PDFComponentProps, "children"> {
+ items: KeyValueEntry[];
+ /**
+ * @default 'horizontal'
+ */
+ direction?: KeyValueDirection;
+ /**
+ * @default false
+ */
+ divided?: boolean;
+ /**
+ * @default 'md'
+ */
+ size?: KeyValueSize;
+ /**
+ * @default 1
+ */
+ labelFlex?: number;
+ labelColor?: string;
+ valueColor?: string;
+ /**
+ * @default false
+ */
+ boldValue?: boolean;
+ /**
+ * @default false
+ */
+ noWrap?: boolean;
+ dividerColor?: string;
+ dividerThickness?: number;
+ dividerMargin?: number;
+}
+
+function createKeyValueStyles(t: PdfcnTheme) {
+ const { spacing, fontWeights } = t.primitives;
+ const c = t.colors;
+ const { body } = t.typography;
+ const keyBase = {
+ color: c.mutedForeground,
+ fontFamily: body.fontFamily,
+ fontWeight: fontWeights.medium,
+ };
+ const valueBase = {
+ color: c.foreground,
+ fontFamily: body.fontFamily,
+ fontWeight: fontWeights.regular,
+ };
+ return StyleSheet.create({
+ container: { flexDirection: "column" },
+ divider: {
+ borderBottomColor: c.border,
+ borderBottomStyle: "solid",
+ borderBottomWidth: spacing[0.5],
+ },
+ keyLg: { ...keyBase, fontSize: t.primitives.typography.base },
+ keyMd: { ...keyBase, fontSize: body.fontSize },
+ keySm: { ...keyBase, fontSize: t.primitives.typography.xs },
+ rowHorizontal: {
+ alignItems: "flex-start",
+ flexDirection: "row",
+ paddingVertical: spacing[1],
+ },
+ rowVertical: {
+ flexDirection: "column",
+ marginBottom: t.spacing.paragraphGap,
+ },
+ valueBold: { fontWeight: fontWeights.bold },
+ valueLg: { ...valueBase, fontSize: t.primitives.typography.base },
+ valueMd: { ...valueBase, fontSize: body.fontSize },
+ valueSm: { ...valueBase, fontSize: t.primitives.typography.xs },
+ });
+}
+
+export function KeyValue({
+ items,
+ direction = "horizontal",
+ divided = false,
+ size = "md",
+ labelFlex = 1,
+ labelColor,
+ valueColor,
+ boldValue = false,
+ noWrap = false,
+ dividerColor,
+ dividerThickness,
+ dividerMargin,
+ style,
+}: KeyValueProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createKeyValueStyles(theme), [theme]);
+ const keyStyleMap = {
+ lg: styles.keyLg,
+ md: styles.keyMd,
+ sm: styles.keySm,
+ } as Record<KeyValueSize, Style>;
+ const valueStyleMap = {
+ lg: styles.valueLg,
+ md: styles.valueMd,
+ sm: styles.valueSm,
+ } as Record<KeyValueSize, Style>;
+ const containerStyles: Style[] = [styles.container];
+ if (style) {
+ containerStyles.push(...[style].flat());
+ }
+
+ return (
+ <View wrap={!noWrap} style={containerStyles as never}>
+ {items.map((item, index) => {
+ const isLast = index === items.length - 1;
+ const keyStyles: Style[] = [keyStyleMap[size]];
+ if (labelColor) {
+ keyStyles.push({ color: resolveColor(labelColor, theme.colors) });
+ }
+ if (item.keyStyle) {
+ keyStyles.push(item.keyStyle);
+ }
+ const valStyles: Style[] = [valueStyleMap[size]];
+ if (boldValue) {
+ valStyles.push(styles.valueBold);
+ }
+ const resolvedValueColor = item.valueColor ?? valueColor;
+ if (resolvedValueColor) {
+ valStyles.push({
+ color: resolveColor(resolvedValueColor, theme.colors),
+ });
+ }
+ if (item.valueStyle) {
+ valStyles.push(item.valueStyle);
+ }
+
+ if (direction === "horizontal") {
+ const rowStyles: Style[] = [styles.rowHorizontal];
+ if (divided && !isLast) {
+ const dividerStyle: Style = {};
+ if (dividerColor) {
+ dividerStyle.borderBottomColor = resolveColor(
+ dividerColor,
+ theme.colors
+ );
+ }
+ if (dividerThickness) {
+ dividerStyle.borderBottomWidth = dividerThickness;
+ }
+ if (dividerMargin) {
+ dividerStyle.marginBottom = dividerMargin;
+ }
+ rowStyles.push({ ...styles.divider, ...dividerStyle });
+ }
+ return (
+ <View key={item.key} style={rowStyles as never}>
+ <PDFText style={[...keyStyles, { flex: labelFlex }] as never}>
+ {item.key}
+ </PDFText>
+ <PDFText
+ style={[...valStyles, { flex: 1, textAlign: "right" }] as never}
+ >
+ {item.value}
+ </PDFText>
+ </View>
+ );
+ }
+
+ const rowStyles: Style[] = [styles.rowVertical];
+ if (divided && !isLast) {
+ rowStyles.push(styles.divider);
+ }
+ return (
+ <View key={item.key} style={rowStyles as never}>
+ <PDFText style={keyStyles as never}>{item.key}</PDFText>
+ <PDFText style={valStyles as never}>{item.value}</PDFText>
+ </View>
+ );
+ })}
+ </View>
+ );
+}
diff --git a/registry/bases/forme/components/link/index.ts b/registry/bases/forme/components/link/index.ts
new file mode 100644
index 0000000..22bf1b6
--- /dev/null
+++ b/registry/bases/forme/components/link/index.ts
@@ -0,0 +1,6 @@
+export {
+ Link,
+ type LinkProps,
+ type LinkVariant,
+ type LinkUnderline,
+} from "./link";
diff --git a/registry/bases/forme/components/link/link.tsx b/registry/bases/forme/components/link/link.tsx
new file mode 100644
index 0000000..d091885
--- /dev/null
+++ b/registry/bases/forme/components/link/link.tsx
@@ -0,0 +1,108 @@
+import { Link as PDFLink, StyleSheet } from "@formepdf/react";
+import type { Style } from "@formepdf/react";
+
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { resolveColor } from "../../lib/resolve-color";
+
+export type LinkVariant = "default" | "muted" | "primary";
+export type LinkUnderline = "always" | "none";
+
+/**
+ * Clickable hyperlink for PDF documents.
+ * Props - `href` | `children` | `align` | `color` | `variant` | `underline` | `style`
+ * @see {@link LinkProps}
+ */
+export interface LinkProps extends PDFComponentProps {
+ href: string;
+ /**
+ * @default 'left'
+ */
+ align?: "left" | "center" | "right";
+ color?: string;
+ /**
+ * @default 'default'
+ */
+ variant?: LinkVariant;
+ /**
+ * @default 'always'
+ */
+ underline?: LinkUnderline;
+}
+
+function createLinkStyles(t: PdfcnTheme) {
+ const { fontWeights } = t.primitives;
+ const base = {
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ lineHeight: t.typography.body.lineHeight,
+ marginBottom: t.spacing.paragraphGap,
+ };
+ return StyleSheet.create({
+ default: {
+ ...base,
+ color: t.colors.accent,
+ fontWeight: fontWeights.medium,
+ textDecoration: "underline",
+ },
+ muted: {
+ ...base,
+ color: t.colors.mutedForeground,
+ fontWeight: fontWeights.regular,
+ textDecoration: "underline",
+ },
+ primary: {
+ ...base,
+ color: t.colors.primary,
+ fontWeight: fontWeights.semibold,
+ textDecoration: "underline",
+ },
+ underlineAlways: { textDecoration: "underline" },
+ underlineNone: { textDecoration: "none" },
+ });
+}
+
+export function Link({
+ href,
+ align,
+ color,
+ variant = "default",
+ underline,
+ children,
+ style,
+}: LinkProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createLinkStyles(theme), [theme]);
+ const variantMap = {
+ default: styles.default,
+ muted: styles.muted,
+ primary: styles.primary,
+ };
+ const underlineMap = {
+ always: styles.underlineAlways,
+ none: styles.underlineNone,
+ };
+ const styleArray: Style[] = [variantMap[variant]];
+ if (underline && underline in underlineMap) {
+ styleArray.push(underlineMap[underline]);
+ }
+ const semantic = {} as Style;
+ if (align) {
+ semantic.textAlign = align;
+ }
+ if (color) {
+ semantic.color = resolveColor(color, theme.colors);
+ }
+ if (Object.keys(semantic).length > 0) {
+ styleArray.push(semantic);
+ }
+ if (style) {
+ styleArray.push(...[style].flat());
+ }
+ return (
+ <PDFLink href={href} style={styleArray as never}>
+ {children}
+ </PDFLink>
+ );
+}
diff --git a/registry/bases/forme/components/list/index.ts b/registry/bases/forme/components/list/index.ts
new file mode 100644
index 0000000..5535351
--- /dev/null
+++ b/registry/bases/forme/components/list/index.ts
@@ -0,0 +1,2 @@
+export { PdfList } from "./list";
+export type { PdfListProps, ListVariant, ListItem } from "./list.types";
diff --git a/registry/bases/forme/components/list/list.styles.ts b/registry/bases/forme/components/list/list.styles.ts
new file mode 100644
index 0000000..3ce710a
--- /dev/null
+++ b/registry/bases/forme/components/list/list.styles.ts
@@ -0,0 +1,164 @@
+import { StyleSheet } from "@formepdf/react";
+
+import type { PdfcnTheme } from "@/registry/themes";
+
+/**
+ * Creates all list styles derived from the active theme.
+ * @param t - The resolved PdfcnTheme instance.
+ */
+export function createListStyles(t: PdfcnTheme) {
+ const { borderRadius, spacing, fontWeights, typography } = t.primitives;
+
+ return StyleSheet.create({
+ checkBox: {
+ alignItems: "center",
+ backgroundColor: t.colors.background,
+ borderColor: t.colors.border,
+ borderRadius: 3,
+ borderStyle: "solid",
+ borderWidth: 1.5,
+ height: spacing[4],
+ justifyContent: "center",
+ marginRight: spacing[2],
+ width: spacing[4],
+ },
+ checkBoxChecked: {
+ backgroundColor: t.colors.success,
+ borderColor: t.colors.success,
+ },
+ checkMark: {
+ color: t.colors.background,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: 8,
+ fontWeight: fontWeights.bold,
+ },
+ childrenContainer: {
+ display: "flex",
+ flexDirection: "column",
+ marginLeft: spacing[5],
+ marginTop: spacing[1],
+ },
+ container: {
+ display: "flex",
+ flexDirection: "column",
+ marginBottom: t.spacing.componentGap,
+ width: "100%",
+ },
+ descriptiveAccent: {
+ backgroundColor: t.colors.primary,
+ borderRadius: borderRadius.sm,
+ marginRight: spacing[3],
+ minHeight: spacing[4],
+ width: 3,
+ },
+ descriptiveContent: {
+ flex: 1,
+ },
+ descriptiveDesc: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: typography.sm,
+ lineHeight: t.typography.body.lineHeight,
+ marginTop: 1,
+ },
+ descriptiveTitle: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ fontWeight: fontWeights.semibold,
+ lineHeight: t.typography.body.lineHeight,
+ },
+ iconBox: {
+ alignItems: "center",
+ backgroundColor: t.colors.primary,
+ borderRadius: borderRadius.md,
+ height: spacing[5],
+ justifyContent: "center",
+ marginRight: spacing[2],
+ width: spacing[5],
+ },
+ iconMark: {
+ color: t.colors.primaryForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: 9,
+ fontWeight: fontWeights.bold,
+ },
+ itemRow: {
+ alignItems: "flex-start",
+ flexDirection: "row",
+ },
+ itemRowCenter: {
+ alignItems: "center",
+ flexDirection: "row",
+ },
+ itemRowGapMd: { marginBottom: spacing[3] },
+ itemRowGapSm: { marginBottom: spacing[2] },
+ itemRowGapXs: { marginBottom: spacing[1] },
+ itemText: {
+ // No flex here — Text nodes with flex shorthand get flexBasis:0, which causes
+ // Yoga to under-measure multi-line text height → overlapping rows.
+ // flex:1 must live on the wrapping View, not on the Text itself.
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ lineHeight: t.typography.body.lineHeight,
+ },
+ itemTextBold: {
+ fontWeight: fontWeights.semibold,
+ },
+ itemTextSub: {
+ // Same: no flex — see itemText comment.
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize - 0.5,
+ lineHeight: t.typography.body.lineHeight,
+ },
+ itemTextWrap: {
+ // Companion to itemText / itemTextSub. Apply this to the View that wraps
+ // the Text so flex expansion happens at the View level, not the Text level.
+ flex: 1,
+ },
+ markerBulletDot: {
+ backgroundColor: t.colors.primary,
+ borderRadius: 3,
+ height: 5,
+ width: 5,
+ },
+ markerBulletSubDot: {
+ backgroundColor: "transparent",
+ borderColor: t.colors.mutedForeground,
+ borderRadius: 2,
+ borderStyle: "solid",
+ borderWidth: 1,
+ height: 4,
+ width: 4,
+ },
+ markerBulletSubWrap: {
+ alignItems: "center",
+ justifyContent: "flex-start",
+ marginTop: spacing[1],
+ width: spacing[4],
+ },
+ markerBulletWrap: {
+ alignItems: "center",
+ justifyContent: "flex-start",
+ marginTop: spacing[1],
+ width: spacing[4],
+ },
+ markerNumberBadge: {
+ alignItems: "center",
+ backgroundColor: t.colors.primary,
+ borderRadius: spacing[5],
+ height: spacing[5],
+ justifyContent: "center",
+ marginRight: spacing[2],
+ width: spacing[5],
+ },
+ markerNumberText: {
+ color: t.colors.primaryForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: typography.xs,
+ fontWeight: fontWeights.bold,
+ },
+ });
+}
diff --git a/registry/bases/forme/components/list/list.tsx b/registry/bases/forme/components/list/list.tsx
new file mode 100644
index 0000000..b39914c
--- /dev/null
+++ b/registry/bases/forme/components/list/list.tsx
@@ -0,0 +1,265 @@
+import { Text as PDFText, View } from "@formepdf/react";
+import type { Style } from "@formepdf/react";
+import type React from "react";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { createListStyles } from "./list.styles";
+import type { ListItem, ListVariant, PdfListProps } from "./list.types";
+
+type Styles = ReturnType<typeof createListStyles>;
+type GapProp = "xs" | "sm" | "md";
+
+function getGapStyle(gap: GapProp, styles: Styles): Style {
+ if (gap === "xs") {return styles.itemRowGapXs;}
+ if (gap === "md") {return styles.itemRowGapMd;}
+ return styles.itemRowGapSm;
+}
+
+function buildRowStyles(
+ index: number,
+ total: number,
+ gap: GapProp,
+ styles: Styles,
+ align: "start" | "center" = "start"
+): Style[] {
+ const row: Style[] = [
+ align === "center" ? styles.itemRowCenter : styles.itemRow,
+ ];
+ if (index !== total - 1) {row.push(getGapStyle(gap, styles));}
+ return row;
+}
+
+/** Bullet dot marker — solid filled for level 0, outline ring for nested levels. */
+function dotMarker(level: number, styles: Styles): React.ReactElement {
+ return level === 0 ? (
+ <View style={styles.markerBulletWrap}>
+ <View style={styles.markerBulletDot} />
+ </View>
+ ) : (
+ <View style={styles.markerBulletSubWrap}>
+ <View style={styles.markerBulletSubDot} />
+ </View>
+ );
+}
+
+function renderBulletItem(
+ item: ListItem,
+ index: number,
+ total: number,
+ gap: GapProp,
+ styles: Styles,
+ level: number
+): React.ReactElement {
+ return (
+ <View key={index}>
+ <View style={buildRowStyles(index, total, gap, styles) as never}>
+ {dotMarker(level, styles)}
+ {/* flex:1 on the View, NOT on the Text — avoids Yoga height underestimation
+ for multi-line Text nodes that would cause overlapping rows. */}
+ <View style={styles.itemTextWrap}>
+ <PDFText style={styles.itemText}>{item.text}</PDFText>
+ </View>
+ </View>
+ {item.children && item.children.length > 0
+ ? renderItemList(item.children, "bullet", gap, styles, level + 1)
+ : null}
+ </View>
+ );
+}
+
+function renderNumberedItem(
+ item: ListItem,
+ index: number,
+ total: number,
+ gap: GapProp,
+ styles: Styles
+): React.ReactElement {
+ return (
+ <View
+ key={index}
+ style={buildRowStyles(index, total, gap, styles, "center") as never}
+ >
+ <View style={styles.markerNumberBadge}>
+ <PDFText style={styles.markerNumberText}>{`${index + 1}`}</PDFText>
+ </View>
+ <View style={styles.itemTextWrap}>
+ <PDFText style={styles.itemText}>{item.text}</PDFText>
+ </View>
+ </View>
+ );
+}
+
+function renderChecklistItem(
+ item: ListItem,
+ index: number,
+ total: number,
+ gap: GapProp,
+ styles: Styles
+): React.ReactElement {
+ const isChecked = item.checked ?? true;
+ return (
+ <View
+ key={index}
+ style={buildRowStyles(index, total, gap, styles, "center") as never}
+ >
+ <View
+ style={
+ [styles.checkBox, isChecked ? styles.checkBoxChecked : {}] as never
+ }
+ >
+ {isChecked ? <PDFText style={styles.checkMark}>✓</PDFText> : null}
+ </View>
+ <View style={styles.itemTextWrap}>
+ <PDFText style={styles.itemText}>{item.text}</PDFText>
+ </View>
+ </View>
+ );
+}
+
+function renderIconItem(
+ item: ListItem,
+ index: number,
+ total: number,
+ gap: GapProp,
+ styles: Styles
+): React.ReactElement {
+ return (
+ <View
+ key={index}
+ style={buildRowStyles(index, total, gap, styles, "center") as never}
+ >
+ <View style={styles.iconBox}>
+ <PDFText style={styles.iconMark}>★</PDFText>
+ </View>
+ <View style={styles.itemTextWrap}>
+ <PDFText style={styles.itemText}>{item.text}</PDFText>
+ </View>
+ </View>
+ );
+}
+
+function renderMultiLevelItem(
+ item: ListItem,
+ index: number,
+ total: number,
+ gap: GapProp,
+ styles: Styles,
+ level: number
+): React.ReactElement {
+ return (
+ <View key={index}>
+ <View style={buildRowStyles(index, total, gap, styles) as never}>
+ {dotMarker(level, styles)}
+ <View style={styles.itemTextWrap}>
+ <PDFText
+ style={
+ [
+ level === 0 ? styles.itemText : styles.itemTextSub,
+ level === 0 ? styles.itemTextBold : {},
+ ] as never
+ }
+ >
+ {item.text}
+ </PDFText>
+ </View>
+ </View>
+ {item.children && item.children.length > 0
+ ? renderItemList(item.children, "multi-level", gap, styles, level + 1)
+ : null}
+ </View>
+ );
+}
+
+function renderDescriptiveItem(
+ item: ListItem,
+ index: number,
+ total: number,
+ gap: GapProp,
+ styles: Styles
+): React.ReactElement {
+ return (
+ <View
+ key={index}
+ style={buildRowStyles(index, total, gap, styles) as never}
+ >
+ <View style={styles.descriptiveAccent} />
+ <View style={styles.descriptiveContent}>
+ <PDFText style={styles.descriptiveTitle}>{item.text}</PDFText>
+ {item.description ? (
+ <PDFText style={styles.descriptiveDesc}>{item.description}</PDFText>
+ ) : null}
+ </View>
+ </View>
+ );
+}
+
+function renderItem(
+ item: ListItem,
+ index: number,
+ total: number,
+ variant: ListVariant,
+ gap: GapProp,
+ styles: Styles,
+ level: number
+): React.ReactElement | null {
+ switch (variant) {
+ case "bullet": {
+ return renderBulletItem(item, index, total, gap, styles, level);
+ }
+ case "numbered": {
+ return renderNumberedItem(item, index, total, gap, styles);
+ }
+ case "checklist": {
+ return renderChecklistItem(item, index, total, gap, styles);
+ }
+ case "icon": {
+ return renderIconItem(item, index, total, gap, styles);
+ }
+ case "multi-level": {
+ return renderMultiLevelItem(item, index, total, gap, styles, level);
+ }
+ case "descriptive": {
+ return renderDescriptiveItem(item, index, total, gap, styles);
+ }
+ }
+}
+
+function renderItemList(
+ items: ListItem[],
+ variant: ListVariant,
+ gap: GapProp,
+ styles: Styles,
+ level: number
+): React.ReactElement {
+ return (
+ <View style={level > 0 ? styles.childrenContainer : undefined}>
+ {items.map((item, index) =>
+ renderItem(item, index, items.length, variant, gap, styles, level)
+ )}
+ </View>
+ );
+}
+
+export function PdfList({
+ items,
+ variant = "bullet",
+ gap = "sm",
+ style,
+ noWrap = false,
+ _level = 0,
+}: PdfListProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createListStyles(theme), [theme]);
+
+ const containerStyles: Style[] = [styles.container];
+ if (_level > 0) {containerStyles.push(styles.childrenContainer);}
+ const styleArray = style ? [...containerStyles, style] : containerStyles;
+
+ return (
+ <View style={styleArray as never}>
+ {items.map((item, index) =>
+ renderItem(item, index, items.length, variant, gap, styles, _level)
+ )}
+ </View>
+ );
+}
diff --git a/registry/bases/forme/components/list/list.types.ts b/registry/bases/forme/components/list/list.types.ts
new file mode 100644
index 0000000..fa260d0
--- /dev/null
+++ b/registry/bases/forme/components/list/list.types.ts
@@ -0,0 +1,45 @@
+import type { Style } from "@formepdf/react";
+
+/** List visual style variant. */
+export type ListVariant =
+ | "bullet"
+ | "numbered"
+ | "checklist"
+ | "icon"
+ | "multi-level"
+ | "descriptive";
+
+/**
+ * A single list item, optionally with nested children.
+ * Props - `text` | `description` | `checked` | `children`
+ * @see {@link ListItem}
+ */
+export interface ListItem {
+ text: string;
+ description?: string;
+ checked?: boolean;
+ children?: ListItem[];
+}
+
+/**
+ * List of items with multiple style variants including bullet, numbered, checklist, and descriptive.
+ * Props - `items` | `variant` | `gap` | `style` | `_level` | `noWrap`
+ * @see {@link PdfListProps}
+ */
+export interface PdfListProps {
+ items: ListItem[];
+ /**
+ * @default 'bullet'
+ */
+ variant?: ListVariant;
+ /**
+ * @default 'sm'
+ */
+ gap?: "xs" | "sm" | "md";
+ style?: Style;
+ _level?: number;
+ /**
+ * @default false
+ */
+ noWrap?: boolean;
+}
diff --git a/registry/bases/forme/components/page-break/index.ts b/registry/bases/forme/components/page-break/index.ts
new file mode 100644
index 0000000..174a541
--- /dev/null
+++ b/registry/bases/forme/components/page-break/index.ts
@@ -0,0 +1,2 @@
+export { PageBreak } from "./page-break";
+export type { PageBreakProps } from "./page-break";
diff --git a/registry/bases/forme/components/page-break/page-break.tsx b/registry/bases/forme/components/page-break/page-break.tsx
new file mode 100644
index 0000000..e2b6ddf
--- /dev/null
+++ b/registry/bases/forme/components/page-break/page-break.tsx
@@ -0,0 +1,11 @@
+import { PageBreak as FormePageBreak } from "@formepdf/react";
+
+import type { PDFComponentProps } from "@/registry/themes";
+
+export interface PageBreakProps extends Omit<PDFComponentProps, "children"> {
+ children?: never;
+}
+
+export function PageBreak(_props: PageBreakProps) {
+ return <FormePageBreak />;
+}
diff --git a/registry/bases/forme/components/page-footer/index.ts b/registry/bases/forme/components/page-footer/index.ts
new file mode 100644
index 0000000..f02d612
--- /dev/null
+++ b/registry/bases/forme/components/page-footer/index.ts
@@ -0,0 +1,5 @@
+export {
+ PageFooter,
+ type PageFooterProps,
+ type PageFooterVariant,
+} from "./page-footer";
diff --git a/registry/bases/forme/components/page-footer/page-footer.tsx b/registry/bases/forme/components/page-footer/page-footer.tsx
new file mode 100644
index 0000000..4bdf3c9
--- /dev/null
+++ b/registry/bases/forme/components/page-footer/page-footer.tsx
@@ -0,0 +1,446 @@
+import { Text as PDFText, StyleSheet, View, Fixed } from "@formepdf/react";
+import type { Style } from "@formepdf/react";
+import type React from "react";
+
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { resolveColor } from "../../lib/resolve-color";
+
+function wrapFixed(fixed: boolean | undefined, node: React.ReactElement) {
+ if (!fixed) {
+ return node;
+ }
+ return <Fixed position="footer">{node}</Fixed>;
+}
+export type PageFooterVariant =
+ | "simple"
+ | "centered"
+ | "branded"
+ | "minimal"
+ | "three-column"
+ | "detailed";
+
+/**
+ * Footer row with layout variants, optional sticky or fixed positioning, and contact info support.
+ * Props - `leftText` | `rightText` | `centerText` | `variant` | `background` | `textColor` | `marginTop` | `address` | `phone` | `email` | `website` | `fixed` | `sticky` | `pagePadding` | `noWrap` | `style`
+ * @see {@link PageFooterProps}
+ */
+export interface PageFooterProps extends Omit<PDFComponentProps, "children"> {
+ leftText?: string;
+ rightText?: string;
+ centerText?: string;
+ /**
+ * @default 'simple'
+ */
+ variant?: PageFooterVariant;
+ background?: string;
+ textColor?: string;
+ marginTop?: number;
+ address?: string;
+ phone?: string;
+ email?: string;
+ website?: string;
+ /**
+ * @default false
+ */
+ fixed?: boolean;
+ /**
+ * @default false
+ */
+ sticky?: boolean;
+ /**
+ * @default 0
+ */
+ pagePadding?: number;
+ /**
+ * @default true
+ */
+ noWrap?: boolean;
+}
+
+function createPageFooterStyles(t: PdfcnTheme) {
+ const { spacing, fontWeights } = t.primitives;
+ const c = t.colors;
+ const { body } = t.typography;
+
+ const textBase = {
+ color: c.mutedForeground,
+ fontFamily: body.fontFamily,
+ fontSize: t.primitives.typography.xs,
+ lineHeight: body.lineHeight,
+ };
+
+ return StyleSheet.create({
+ brandedContainer: {
+ alignItems: "center",
+ backgroundColor: c.primary,
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ paddingHorizontal: spacing[4],
+ paddingVertical: spacing[3],
+ },
+
+ centeredContainer: {
+ alignItems: "center",
+ borderTopColor: c.border,
+ borderTopStyle: "solid",
+ borderTopWidth: spacing[0.5],
+ display: "flex",
+ flexDirection: "column",
+ paddingTop: spacing[3],
+ },
+
+ companyBold: {
+ ...textBase,
+ color: c.foreground,
+ fontWeight: fontWeights.bold,
+ },
+
+ companyName: {
+ ...textBase,
+ color: c.foreground,
+ fontWeight: fontWeights.medium,
+ },
+
+ contactInfoCenter: {
+ ...textBase,
+ fontSize: t.primitives.typography.xs - 1,
+ marginTop: spacing[0.5],
+ textAlign: "center",
+ },
+ detailedContainer: {
+ borderTopColor: c.border,
+ borderTopStyle: "solid",
+ borderTopWidth: spacing[1],
+ display: "flex",
+ flexDirection: "column",
+ paddingTop: spacing[3],
+ },
+ detailedLeft: {
+ display: "flex",
+ flex: 1,
+ flexDirection: "column",
+ },
+ detailedPageNumber: {
+ ...textBase,
+ borderTopColor: c.border,
+ borderTopStyle: "solid",
+ borderTopWidth: spacing[0.5],
+ paddingTop: spacing[2],
+ textAlign: "center",
+ },
+ detailedRight: {
+ alignItems: "flex-end",
+ display: "flex",
+ flexDirection: "column",
+ },
+ detailedTopRow: {
+ alignItems: "flex-start",
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ marginBottom: spacing[2],
+ },
+
+ minimalContainer: {
+ alignItems: "center",
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ paddingBottom: spacing[1],
+ paddingTop: spacing[1],
+ },
+ simpleContainer: {
+ alignItems: "center",
+ borderTopColor: c.border,
+ borderTopStyle: "solid",
+ borderTopWidth: spacing[0.5],
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ paddingTop: spacing[3],
+ },
+ textBranded: {
+ ...textBase,
+ color: c.primaryForeground,
+ fontWeight: fontWeights.medium,
+ },
+ textBrandedRight: {
+ ...textBase,
+ color: c.primaryForeground,
+ textAlign: "right",
+ },
+ textCenter: {
+ ...textBase,
+ flex: 1,
+ textAlign: "center",
+ },
+ textCenteredVariant: {
+ ...textBase,
+ marginBottom: spacing[1],
+ textAlign: "center",
+ },
+
+ textLeft: {
+ ...textBase,
+ flex: 1,
+ },
+ textRight: {
+ ...textBase,
+ textAlign: "right",
+ },
+ threeColumnCenter: {
+ alignItems: "center",
+ display: "flex",
+ flex: 1,
+ flexDirection: "column",
+ },
+ threeColumnContainer: {
+ alignItems: "flex-start",
+ borderTopColor: c.border,
+ borderTopStyle: "solid",
+ borderTopWidth: spacing[0.5],
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ paddingTop: spacing[3],
+ },
+ threeColumnLeft: {
+ display: "flex",
+ flex: 1,
+ flexDirection: "column",
+ },
+ threeColumnRight: {
+ alignItems: "flex-end",
+ display: "flex",
+ flex: 1,
+ flexDirection: "column",
+ },
+ });
+}
+
+export function PageFooter({
+ leftText,
+ rightText,
+ centerText,
+ variant = "simple",
+ background,
+ textColor,
+ marginTop,
+ address,
+ phone,
+ email,
+ website,
+ fixed = false,
+ sticky = false,
+ pagePadding = 0,
+ noWrap = true,
+ style,
+}: PageFooterProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createPageFooterStyles(theme), [theme]);
+ // sticky implies fixed; marginTop is irrelevant with absolute positioning
+ const isFixed = fixed || sticky;
+ const mt = sticky ? 0 : (marginTop ?? theme.spacing.sectionGap);
+ const resolvedTextColor = textColor
+ ? resolveColor(textColor, theme.colors)
+ : undefined;
+ const stickyStyle: Style = sticky
+ ? {
+ bottom: pagePadding,
+ left: pagePadding,
+ position: "absolute",
+ right: pagePadding,
+ }
+ : {};
+
+ function applyOverrides(base: Style[]): Style[] {
+ if (background) {
+ base.push({ backgroundColor: resolveColor(background, theme.colors) });
+ }
+ if (style) {
+ base.push(style);
+ }
+ if (sticky) {
+ base.push(stickyStyle);
+ }
+ return base;
+ }
+
+ if (variant === "branded") {
+ const containerStyles = applyOverrides([
+ styles.brandedContainer,
+ { marginTop: mt },
+ ]);
+
+ const lStyle: Style[] = [styles.textBranded];
+ const rStyle: Style[] = [styles.textBrandedRight];
+ if (resolvedTextColor) {
+ lStyle.push({ color: resolvedTextColor });
+ rStyle.push({ color: resolvedTextColor });
+ }
+
+ return wrapFixed(
+ isFixed,
+ <View wrap={!noWrap} style={containerStyles as never}>
+ {leftText && <PDFText style={lStyle as never}>{leftText}</PDFText>}
+ {rightText && <PDFText style={rStyle as never}>{rightText}</PDFText>}
+ </View>
+ );
+ }
+
+ if (variant === "centered") {
+ const containerStyles = applyOverrides([
+ styles.centeredContainer,
+ { marginTop: mt },
+ ]);
+
+ const tStyle: Style[] = [styles.textCenteredVariant];
+ if (resolvedTextColor) {
+ tStyle.push({ color: resolvedTextColor });
+ }
+
+ return wrapFixed(
+ isFixed,
+ <View wrap={!noWrap} style={containerStyles as never}>
+ {leftText && <PDFText style={tStyle as never}>{leftText}</PDFText>}
+ {rightText && <PDFText style={tStyle as never}>{rightText}</PDFText>}
+ </View>
+ );
+ }
+
+ if (variant === "three-column") {
+ const containerStyles = applyOverrides([
+ styles.threeColumnContainer,
+ { marginTop: mt },
+ ]);
+
+ const leftStyle: Style[] = [styles.companyName];
+ const centerStyle: Style[] = [styles.contactInfoCenter];
+ const rightStyle: Style[] = [styles.textRight];
+ if (resolvedTextColor) {
+ leftStyle.push({ color: resolvedTextColor });
+ centerStyle.push({ color: resolvedTextColor });
+ rightStyle.push({ color: resolvedTextColor });
+ }
+
+ return wrapFixed(
+ isFixed,
+ <View wrap={!noWrap} style={containerStyles as never}>
+ <View style={styles.threeColumnLeft}>
+ {leftText && <PDFText style={leftStyle as never}>{leftText}</PDFText>}
+ {address && <PDFText style={styles.textLeft}>{address}</PDFText>}
+ </View>
+ <View style={styles.threeColumnCenter}>
+ {phone && <PDFText style={centerStyle as never}>{phone}</PDFText>}
+ {email && <PDFText style={centerStyle as never}>{email}</PDFText>}
+ {website && <PDFText style={centerStyle as never}>{website}</PDFText>}
+ </View>
+ <View style={styles.threeColumnRight}>
+ {rightText && (
+ <PDFText style={rightStyle as never}>{rightText}</PDFText>
+ )}
+ </View>
+ </View>
+ );
+ }
+
+ if (variant === "detailed") {
+ const containerStyles = applyOverrides([
+ styles.detailedContainer,
+ { marginTop: mt },
+ ]);
+
+ const companyStyle: Style[] = [styles.companyBold];
+ const addrStyle: Style[] = [styles.textLeft];
+ const contactStyle: Style[] = [styles.textRight];
+ const pageNumStyle: Style[] = [styles.detailedPageNumber];
+ if (resolvedTextColor) {
+ companyStyle.push({ color: resolvedTextColor });
+ addrStyle.push({ color: resolvedTextColor });
+ contactStyle.push({ color: resolvedTextColor });
+ pageNumStyle.push({ color: resolvedTextColor });
+ }
+
+ return wrapFixed(
+ isFixed,
+ <View wrap={!noWrap} style={containerStyles as never}>
+ <View style={styles.detailedTopRow}>
+ <View style={styles.detailedLeft}>
+ {leftText && (
+ <PDFText style={companyStyle as never}>{leftText}</PDFText>
+ )}
+ {address && <PDFText style={addrStyle as never}>{address}</PDFText>}
+ </View>
+ <View style={styles.detailedRight}>
+ {phone && (
+ <PDFText
+ style={contactStyle as never}
+ >{`Phone: ${phone}`}</PDFText>
+ )}
+ {email && (
+ <PDFText
+ style={contactStyle as never}
+ >{`Email: ${email}`}</PDFText>
+ )}
+ {website && (
+ <PDFText
+ style={contactStyle as never}
+ >{`Web: ${website}`}</PDFText>
+ )}
+ </View>
+ </View>
+ {rightText && (
+ <PDFText style={pageNumStyle as never}>{rightText}</PDFText>
+ )}
+ </View>
+ );
+ }
+
+ if (variant === "minimal") {
+ const containerStyles = applyOverrides([
+ styles.minimalContainer,
+ { marginTop: mt },
+ ]);
+
+ const lStyle: Style[] = [styles.textLeft];
+ const rStyle: Style[] = [styles.textRight];
+ if (resolvedTextColor) {
+ lStyle.push({ color: resolvedTextColor });
+ rStyle.push({ color: resolvedTextColor });
+ }
+
+ return wrapFixed(
+ isFixed,
+ <View wrap={!noWrap} style={containerStyles as never}>
+ {leftText && <PDFText style={lStyle as never}>{leftText}</PDFText>}
+ {rightText && <PDFText style={rStyle as never}>{rightText}</PDFText>}
+ </View>
+ );
+ }
+
+ const containerStyles = applyOverrides([
+ styles.simpleContainer,
+ { marginTop: mt },
+ ]);
+
+ const lStyle: Style[] = [styles.textLeft];
+ const cStyle: Style[] = [styles.textCenter];
+ const rStyle: Style[] = [styles.textRight];
+ if (resolvedTextColor) {
+ lStyle.push({ color: resolvedTextColor });
+ cStyle.push({ color: resolvedTextColor });
+ rStyle.push({ color: resolvedTextColor });
+ }
+
+ return wrapFixed(
+ isFixed,
+ <View wrap={!noWrap} style={containerStyles as never}>
+ {leftText && <PDFText style={lStyle as never}>{leftText}</PDFText>}
+ {centerText && <PDFText style={cStyle as never}>{centerText}</PDFText>}
+ {rightText && <PDFText style={rStyle as never}>{rightText}</PDFText>}
+ </View>
+ );
+}
diff --git a/registry/bases/forme/components/page-header/index.ts b/registry/bases/forme/components/page-header/index.ts
new file mode 100644
index 0000000..91eaac3
--- /dev/null
+++ b/registry/bases/forme/components/page-header/index.ts
@@ -0,0 +1,5 @@
+export {
+ PageHeader,
+ type PageHeaderProps,
+ type PageHeaderVariant,
+} from "./page-header";
diff --git a/registry/bases/forme/components/page-header/page-header.tsx b/registry/bases/forme/components/page-header/page-header.tsx
new file mode 100644
index 0000000..892b7e4
--- /dev/null
+++ b/registry/bases/forme/components/page-header/page-header.tsx
@@ -0,0 +1,513 @@
+import { Text as PDFText, StyleSheet, View, Fixed } from "@formepdf/react";
+import type { Style } from "@formepdf/react";
+import type React from "react";
+import type { ReactNode } from "react";
+
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { resolveColor } from "../../lib/resolve-color";
+
+function wrapFixed(fixed: boolean | undefined, node: React.ReactElement) {
+ if (!fixed) {
+ return node;
+ }
+ return <Fixed position="header">{node}</Fixed>;
+}
+export type PageHeaderVariant =
+ | "simple"
+ | "centered"
+ | "minimal"
+ | "branded"
+ | "logo-left"
+ | "logo-right"
+ | "two-column";
+
+/**
+ * Header row with layout variants, logo support, and optional fixed positioning.
+ * Props - `title` | `subtitle` | `rightText` | `rightSubText` | `variant` | `background` | `titleColor` | `marginBottom` | `address` | `phone` | `email` | `logo` | `fixed` | `noWrap` | `style`
+ * @see {@link PageHeaderProps}
+ */
+export interface PageHeaderProps extends Omit<PDFComponentProps, "children"> {
+ title: string;
+ subtitle?: string;
+ rightText?: string;
+ rightSubText?: string;
+ /**
+ * @default 'simple'
+ */
+ variant?: PageHeaderVariant;
+ background?: string;
+ titleColor?: string;
+ marginBottom?: number;
+ address?: string;
+ phone?: string;
+ email?: string;
+ logo?: ReactNode;
+ /**
+ * @default false
+ */
+ fixed?: boolean;
+ /**
+ * @default true
+ */
+ noWrap?: boolean;
+}
+
+function createPageHeaderStyles(t: PdfcnTheme) {
+ const { spacing, borderRadius, fontWeights } = t.primitives;
+ const c = t.colors;
+ const { heading, body } = t.typography;
+
+ return StyleSheet.create({
+ brandedContainer: {
+ alignItems: "center",
+ backgroundColor: c.primary,
+ borderRadius: borderRadius.sm,
+ display: "flex",
+ flexDirection: "column",
+ padding: spacing[6],
+ },
+ centeredContainer: {
+ alignItems: "center",
+ borderBottomColor: c.border,
+ borderBottomStyle: "solid",
+ borderBottomWidth: spacing[0.5],
+ display: "flex",
+ flexDirection: "column",
+ paddingBottom: spacing[4],
+ },
+ contactInfo: {
+ color: c.mutedForeground,
+ fontFamily: body.fontFamily,
+ fontSize: t.primitives.typography.xs,
+ marginTop: spacing[0.5],
+ textAlign: "right",
+ },
+
+ logoContainer: {
+ height: 48,
+ marginRight: spacing[4],
+ width: 48,
+ },
+
+ logoContent: {
+ display: "flex",
+ flex: 1,
+ flexDirection: "column",
+ },
+ logoLeftContainer: {
+ alignItems: "center",
+ borderBottomColor: c.border,
+ borderBottomStyle: "solid",
+ borderBottomWidth: spacing[0.5],
+ display: "flex",
+ flexDirection: "row",
+ paddingBottom: spacing[4],
+ },
+ logoRightContainer: {
+ alignItems: "center",
+ borderBottomColor: c.border,
+ borderBottomStyle: "solid",
+ borderBottomWidth: spacing[0.5],
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ paddingBottom: spacing[4],
+ },
+
+ logoRightContent: {
+ display: "flex",
+ flex: 1,
+ flexDirection: "column",
+ },
+
+ logoRightLogoContainer: {
+ height: 48,
+ marginLeft: spacing[4],
+ width: 48,
+ },
+ minimalContainer: {
+ alignItems: "center",
+ borderBottomColor: c.primary,
+ borderBottomStyle: "solid",
+ borderBottomWidth: spacing[1],
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ paddingBottom: spacing[3],
+ },
+ minimalLeft: {
+ flex: 1,
+ },
+ minimalRight: {
+ alignItems: "flex-end",
+ },
+
+ rightSubText: {
+ color: c.mutedForeground,
+ fontFamily: body.fontFamily,
+ fontSize: t.primitives.typography.xs,
+ marginTop: spacing[1],
+ textAlign: "right",
+ },
+ rightText: {
+ color: c.foreground,
+ fontFamily: body.fontFamily,
+ fontSize: body.fontSize,
+ fontWeight: fontWeights.medium,
+ textAlign: "right",
+ },
+ simpleContainer: {
+ alignItems: "flex-start",
+ borderBottomColor: c.border,
+ borderBottomStyle: "solid",
+ borderBottomWidth: spacing[0.5],
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ paddingBottom: spacing[4],
+ },
+
+ simpleLeft: {
+ display: "flex",
+ flex: 1,
+ flexDirection: "column",
+ },
+ simpleRight: {
+ alignItems: "flex-end",
+ display: "flex",
+ flexDirection: "column",
+ },
+
+ subtitle: {
+ color: c.mutedForeground,
+ fontFamily: body.fontFamily,
+ fontSize: body.fontSize,
+ lineHeight: body.lineHeight,
+ marginTop: spacing[1],
+ },
+ subtitleBranded: {
+ color: c.primaryForeground,
+ marginTop: spacing[1],
+ },
+ subtitleCentered: {
+ textAlign: "center",
+ },
+
+ title: {
+ color: c.foreground,
+ fontFamily: heading.fontFamily,
+ fontSize: heading.fontSize.h3,
+ fontWeight: fontWeights.bold,
+ lineHeight: heading.lineHeight,
+ marginBottom: 0,
+ },
+ titleBranded: {
+ color: c.primaryForeground,
+ },
+ titleCentered: {
+ textAlign: "center",
+ },
+
+ titleMinimal: {
+ fontSize: heading.fontSize.h3,
+ fontWeight: fontWeights.bold,
+ },
+ twoColumnContainer: {
+ alignItems: "flex-start",
+ borderBottomColor: c.border,
+ borderBottomStyle: "solid",
+ borderBottomWidth: spacing[0.5],
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ paddingBottom: spacing[4],
+ },
+ twoColumnLeft: {
+ display: "flex",
+ flex: 1,
+ flexDirection: "column",
+ },
+ twoColumnRight: {
+ alignItems: "flex-end",
+ display: "flex",
+ flexDirection: "column",
+ },
+ });
+}
+
+export function PageHeader({
+ title,
+ subtitle,
+ rightText,
+ rightSubText,
+ variant = "simple",
+ background,
+ titleColor,
+ marginBottom,
+ logo,
+ address,
+ phone,
+ email,
+ fixed = false,
+ noWrap = true,
+ style,
+}: PageHeaderProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createPageHeaderStyles(theme), [theme]);
+ const mb = marginBottom ?? theme.spacing.sectionGap;
+
+ if (variant === "branded") {
+ const containerStyles: Style[] = [
+ styles.brandedContainer,
+ { marginBottom: mb },
+ ];
+ if (background) {
+ containerStyles.push({
+ backgroundColor: resolveColor(background, theme.colors),
+ });
+ }
+ if (style) {
+ containerStyles.push(style);
+ }
+
+ const titleStyles: Style[] = [
+ styles.title,
+ styles.titleBranded,
+ styles.titleCentered,
+ ];
+ if (titleColor) {
+ titleStyles.push({ color: resolveColor(titleColor, theme.colors) });
+ }
+
+ return wrapFixed(
+ fixed,
+ <View wrap={!noWrap} style={containerStyles as never}>
+ <PDFText style={titleStyles as never}>{title}</PDFText>
+ {subtitle && (
+ <PDFText style={[styles.subtitle, styles.subtitleBranded] as never}>
+ {subtitle}
+ </PDFText>
+ )}
+ </View>
+ );
+ }
+
+ if (variant === "centered") {
+ const containerStyles: Style[] = [
+ styles.centeredContainer,
+ { marginBottom: mb },
+ ];
+ if (background) {
+ containerStyles.push({
+ backgroundColor: resolveColor(background, theme.colors),
+ });
+ }
+ if (style) {
+ containerStyles.push(style);
+ }
+
+ const titleStyles: Style[] = [styles.title, styles.titleCentered];
+ if (titleColor) {
+ titleStyles.push({ color: resolveColor(titleColor, theme.colors) });
+ }
+
+ return wrapFixed(
+ fixed,
+ <View wrap={!noWrap} style={containerStyles as never}>
+ <PDFText style={titleStyles as never}>{title}</PDFText>
+ {subtitle && (
+ <PDFText style={[styles.subtitle, styles.subtitleCentered] as never}>
+ {subtitle}
+ </PDFText>
+ )}
+ </View>
+ );
+ }
+
+ if (variant === "logo-right") {
+ const containerStyles: Style[] = [
+ styles.logoRightContainer,
+ { marginBottom: mb },
+ ];
+ if (background) {
+ containerStyles.push({
+ backgroundColor: resolveColor(background, theme.colors),
+ });
+ }
+ if (style) {
+ containerStyles.push(style);
+ }
+
+ const titleStyles: Style[] = [styles.title];
+ if (titleColor) {
+ titleStyles.push({ color: resolveColor(titleColor, theme.colors) });
+ }
+
+ return wrapFixed(
+ fixed,
+ <View wrap={!noWrap} style={containerStyles as never}>
+ <View style={styles.logoRightContent}>
+ <PDFText style={titleStyles as never}>{title}</PDFText>
+ {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}
+ </View>
+ {logo && <View style={styles.logoRightLogoContainer}>{logo}</View>}
+ </View>
+ );
+ }
+
+ if (variant === "logo-left") {
+ const containerStyles: Style[] = [
+ styles.logoLeftContainer,
+ { marginBottom: mb },
+ ];
+ if (background) {
+ containerStyles.push({
+ backgroundColor: resolveColor(background, theme.colors),
+ });
+ }
+ if (style) {
+ containerStyles.push(style);
+ }
+
+ const titleStyles: Style[] = [styles.title];
+ if (titleColor) {
+ titleStyles.push({ color: resolveColor(titleColor, theme.colors) });
+ }
+
+ return wrapFixed(
+ fixed,
+ <View wrap={!noWrap} style={containerStyles as never}>
+ {logo && <View style={styles.logoContainer}>{logo}</View>}
+ <View style={styles.logoContent}>
+ <PDFText style={titleStyles as never}>{title}</PDFText>
+ {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}
+ </View>
+ {(rightText || rightSubText) && (
+ <View style={styles.simpleRight}>
+ {rightText && (
+ <PDFText style={styles.rightText}>{rightText}</PDFText>
+ )}
+ {rightSubText && (
+ <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>
+ )}
+ </View>
+ )}
+ </View>
+ );
+ }
+
+ if (variant === "two-column") {
+ const containerStyles: Style[] = [
+ styles.twoColumnContainer,
+ { marginBottom: mb },
+ ];
+ if (background) {
+ containerStyles.push({
+ backgroundColor: resolveColor(background, theme.colors),
+ });
+ }
+ if (style) {
+ containerStyles.push(style);
+ }
+
+ const titleStyles: Style[] = [styles.title];
+ if (titleColor) {
+ titleStyles.push({ color: resolveColor(titleColor, theme.colors) });
+ }
+
+ return wrapFixed(
+ fixed,
+ <View wrap={!noWrap} style={containerStyles as never}>
+ <View style={styles.twoColumnLeft}>
+ <PDFText style={titleStyles as never}>{title}</PDFText>
+ {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}
+ </View>
+ {(address || phone || email) && (
+ <View style={styles.twoColumnRight}>
+ {address && <PDFText style={styles.contactInfo}>{address}</PDFText>}
+ {phone && <PDFText style={styles.contactInfo}>{phone}</PDFText>}
+ {email && <PDFText style={styles.contactInfo}>{email}</PDFText>}
+ </View>
+ )}
+ </View>
+ );
+ }
+
+ if (variant === "minimal") {
+ const containerStyles: Style[] = [
+ styles.minimalContainer,
+ { marginBottom: mb },
+ ];
+ if (background) {
+ containerStyles.push({
+ backgroundColor: resolveColor(background, theme.colors),
+ });
+ }
+ if (style) {
+ containerStyles.push(style);
+ }
+
+ const titleStyles: Style[] = [styles.title, styles.titleMinimal];
+ if (titleColor) {
+ titleStyles.push({ color: resolveColor(titleColor, theme.colors) });
+ }
+
+ return wrapFixed(
+ fixed,
+ <View wrap={!noWrap} style={containerStyles as never}>
+ <View style={styles.minimalLeft}>
+ <PDFText style={titleStyles as never}>{title}</PDFText>
+ {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}
+ </View>
+ {(rightText || rightSubText) && (
+ <View style={styles.minimalRight}>
+ {rightText && (
+ <PDFText style={styles.rightText}>{rightText}</PDFText>
+ )}
+ {rightSubText && (
+ <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>
+ )}
+ </View>
+ )}
+ </View>
+ );
+ }
+
+ const containerStyles: Style[] = [
+ styles.simpleContainer,
+ { marginBottom: mb },
+ ];
+ if (background) {
+ containerStyles.push({
+ backgroundColor: resolveColor(background, theme.colors),
+ });
+ }
+ if (style) {
+ containerStyles.push(style);
+ }
+
+ const titleStyles: Style[] = [styles.title];
+ if (titleColor) {
+ titleStyles.push({ color: resolveColor(titleColor, theme.colors) });
+ }
+
+ return wrapFixed(
+ fixed,
+ <View wrap={!noWrap} style={containerStyles as never}>
+ <View style={styles.simpleLeft}>
+ <PDFText style={titleStyles as never}>{title}</PDFText>
+ {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}
+ </View>
+ {(rightText || rightSubText) && (
+ <View style={styles.simpleRight}>
+ {rightText && <PDFText style={styles.rightText}>{rightText}</PDFText>}
+ {rightSubText && (
+ <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>
+ )}
+ </View>
+ )}
+ </View>
+ );
+}
diff --git a/registry/bases/forme/components/page-number/index.ts b/registry/bases/forme/components/page-number/index.ts
new file mode 100644
index 0000000..bef083e
--- /dev/null
+++ b/registry/bases/forme/components/page-number/index.ts
@@ -0,0 +1,6 @@
+export {
+ PdfPageNumber,
+ type PdfPageNumberProps,
+ type PageNumberAlign,
+ type PageNumberSize,
+} from "./page-number";
diff --git a/registry/bases/forme/components/page-number/page-number.tsx b/registry/bases/forme/components/page-number/page-number.tsx
new file mode 100644
index 0000000..9fcd5e1
--- /dev/null
+++ b/registry/bases/forme/components/page-number/page-number.tsx
@@ -0,0 +1,108 @@
+import { Text as PDFText, StyleSheet, View } from "@formepdf/react";
+import type { Style } from "@formepdf/react";
+
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+
+export type PageNumberAlign = "left" | "center" | "right";
+export type PageNumberSize = "xs" | "sm" | "md";
+
+/**
+ * Auto page number rendered with a configurable format string at a or inline position.
+ * Props - `format` | `align` | `size` | `fixed` | `muted` | `style`
+ * @see {@link PdfPageNumberProps}
+ */
+export interface PdfPageNumberProps extends Omit<
+ PDFComponentProps,
+ "children"
+> {
+ /**
+ * Format string — use `{page}` for current page and `{total}` for total page count.
+ * @default 'Page {page} of {total}'
+ */
+ format?: string;
+ /**
+ * @default 'center'
+ */
+ align?: PageNumberAlign;
+ /**
+ * @default 'sm'
+ */
+ size?: PageNumberSize;
+ /**
+ * @default false
+ */
+ fixed?: boolean;
+ /**
+ * @default true
+ */
+ muted?: boolean;
+ children?: never;
+}
+
+function createPageNumberStyles(t: PdfcnTheme) {
+ const { typography, colors, primitives } = t;
+ return StyleSheet.create({
+ alignCenter: { textAlign: "center" },
+ alignLeft: { textAlign: "left" },
+ alignRight: { textAlign: "right" },
+ colorForeground: { color: colors.foreground },
+ colorMuted: { color: colors.mutedForeground },
+ container: { width: "100%" },
+ sizeMd: { fontSize: primitives.typography.base },
+ sizeSm: { fontSize: primitives.typography.sm },
+ sizeXs: { fontSize: primitives.typography.xs },
+ text: { fontFamily: typography.body.fontFamily },
+ });
+}
+
+function formatPageNumber(
+ format: string,
+ pageNumber: number,
+ totalPages: number
+): string {
+ return format
+ .replace("{page}", String(pageNumber))
+ .replace("{total}", String(totalPages));
+}
+
+export function PdfPageNumber({
+ format = "Page {page} of {total}",
+ align = "center",
+ size = "sm",
+ fixed = false,
+ muted = true,
+ style,
+}: PdfPageNumberProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createPageNumberStyles(theme), [theme]);
+ const alignMap = {
+ center: styles.alignCenter,
+ left: styles.alignLeft,
+ right: styles.alignRight,
+ } as Record<PageNumberAlign, Style>;
+ const sizeMap = {
+ md: styles.sizeMd,
+ sm: styles.sizeSm,
+ xs: styles.sizeXs,
+ } as Record<PageNumberSize, Style>;
+ const textStyles: Style[] = [
+ styles.text,
+ alignMap[align],
+ sizeMap[size],
+ muted ? styles.colorMuted : styles.colorForeground,
+ ];
+ if (style) {
+ textStyles.push(...[style].flat());
+ }
+ return (
+ <View style={styles.container}>
+ <PDFText style={textStyles as never}>
+ {format
+ .replace("{page}", "{{pageNumber}}")
+ .replace("{total}", "{{totalPages}}")}
+ </PDFText>
+ </View>
+ );
+}
diff --git a/registry/bases/forme/components/pdf-image/index.ts b/registry/bases/forme/components/pdf-image/index.ts
new file mode 100644
index 0000000..826f276
--- /dev/null
+++ b/registry/bases/forme/components/pdf-image/index.ts
@@ -0,0 +1,7 @@
+export {
+ PdfImage,
+ type PdfImageProps,
+ type PdfImageSrc,
+ type PdfImageVariant,
+ type PdfImageFit,
+} from "./pdf-image";
diff --git a/registry/bases/forme/components/pdf-image/pdf-image.tsx b/registry/bases/forme/components/pdf-image/pdf-image.tsx
new file mode 100644
index 0000000..46e7089
--- /dev/null
+++ b/registry/bases/forme/components/pdf-image/pdf-image.tsx
@@ -0,0 +1,184 @@
+import { Image, Text as PDFText, StyleSheet, View } from "@formepdf/react";
+import type { Style } from "@formepdf/react";
+
+import type { PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+
+/** HTTP method used when fetching the image from a URL. */
+export type PdfImageHTTPMethod =
+ | "GET"
+ | "HEAD"
+ | "POST"
+ | "PUT"
+ | "DELETE"
+ | "PATCH";
+
+export type PdfImageSrc =
+ | string
+ | {
+ uri: string;
+ method?: PdfImageHTTPMethod;
+ headers?: Record<string, string>;
+ body?: string;
+ };
+
+export type PdfImageFit = "cover" | "contain" | "fill" | "none";
+
+export type PdfImageVariant =
+ | "default"
+ | "full-width"
+ | "thumbnail"
+ | "avatar"
+ | "cover"
+ | "bordered"
+ | "rounded";
+
+/**
+ * Image element with layout presets, caption, and aspect ratio support.
+ * Props - `src` | `variant` | `width` | `height` | `fit` | `position` | `caption` | `aspectRatio` | `borderRadius` | `noWrap` | `style`
+ * @see {@link PdfImageProps}
+ */
+export interface PdfImageProps {
+ src: PdfImageSrc;
+ /**
+ * @default 'default'
+ */
+ variant?: PdfImageVariant;
+ width?: number | string;
+ height?: number | string;
+ fit?: PdfImageFit;
+ /**
+ * @default '50% 50%'
+ */
+ position?: string;
+ caption?: string;
+ aspectRatio?: number;
+ borderRadius?: number;
+ /**
+ * @default true
+ */
+ noWrap?: boolean;
+ style?: Style;
+}
+
+interface VariantDefaults {
+ width?: number | string;
+ height?: number | string;
+ fit: PdfImageFit;
+ borderRadius?: number;
+}
+
+const VARIANT_DEFAULTS: Record<PdfImageVariant, VariantDefaults> = {
+ avatar: { borderRadius: 999, fit: "cover", height: 48, width: 48 },
+ bordered: { fit: "contain", width: "100%" },
+ cover: { fit: "cover", height: 160, width: "100%" },
+ default: { fit: "contain" },
+ "full-width": { fit: "cover", width: "100%" },
+ rounded: { borderRadius: 8, fit: "contain", width: 200 },
+ thumbnail: { fit: "cover", height: 80, width: 80 },
+};
+
+const UNSUPPORTED_FORMATS = new Set(["webp", "avif", "heic", "heif", "ico"]);
+
+function detectFormat(src: PdfImageSrc): string | null {
+ if (typeof src !== "string") {return null;}
+ const dataMatch = src.match(/^data:image\/([a-zA-Z0-9+.-]+)/);
+ if (dataMatch) {return dataMatch[1].toLowerCase();}
+ return src.split("?")[0].split(".").pop()?.toLowerCase() ?? null;
+}
+
+function warnIfUnsupported(src: PdfImageSrc): void {
+ const fmt = detectFormat(src);
+ if (fmt && UNSUPPORTED_FORMATS.has(fmt)) {
+ console.warn(
+ `[PdfImage] Unsupported format "${fmt}" detected. react-pdf supports: JPEG, PNG, GIF (first frame), BMP, SVG. Convert to PNG or JPEG before use.`
+ );
+ }
+}
+
+function createImageStyles(t: PdfcnTheme) {
+ const { spacing } = t.primitives;
+ return StyleSheet.create({
+ caption: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.primitives.typography.xs,
+ marginTop: spacing[1],
+ textAlign: "center",
+ },
+ container: { flexDirection: "column" },
+ image: {},
+ imageBordered: {
+ borderColor: t.colors.border,
+ borderStyle: "solid",
+ borderWidth: 1,
+ },
+ });
+}
+
+export function PdfImage({
+ src,
+ variant = "default",
+ width,
+ height,
+ fit,
+ position = "50% 50%",
+ caption,
+ aspectRatio,
+ borderRadius,
+ noWrap = true,
+ style,
+}: PdfImageProps) {
+ warnIfUnsupported(src);
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createImageStyles(theme), [theme]);
+ const defaults = VARIANT_DEFAULTS[variant];
+
+ const resolvedWidth = width ?? defaults.width;
+ const resolvedHeight: number | string | undefined = (() => {
+ if (height !== undefined) {
+ return height;
+ }
+ if (defaults.height !== undefined) {
+ return defaults.height;
+ }
+ if (aspectRatio !== undefined && typeof resolvedWidth === "number") {
+ return resolvedWidth / aspectRatio;
+ }
+ return;
+ })();
+
+ const resolvedFit = fit ?? defaults.fit;
+ const resolvedRadius = borderRadius ?? defaults.borderRadius;
+
+ const imageStyles: Style[] = [styles.image];
+ if (resolvedWidth !== undefined) {
+ imageStyles.push({ width: resolvedWidth } as Style);
+ }
+ if (resolvedHeight !== undefined) {
+ imageStyles.push({ height: resolvedHeight } as Style);
+ }
+ imageStyles.push({
+ objectFit: resolvedFit,
+ objectPosition: position,
+ } as Style);
+ if (resolvedRadius !== undefined) {
+ imageStyles.push({ borderRadius: resolvedRadius } as Style);
+ }
+ if (variant === "bordered") {
+ imageStyles.push(styles.imageBordered);
+ }
+ if (style) {
+ imageStyles.push(style);
+ }
+
+ const content = (
+ <View style={styles.container}>
+ <Image src={src as never} style={imageStyles as never} />
+ {caption ? <PDFText style={styles.caption}>{caption}</PDFText> : null}
+ </View>
+ );
+
+ return noWrap ? <View wrap={false}>{content}</View> : content;
+}
diff --git a/registry/bases/forme/components/qrcode/index.ts b/registry/bases/forme/components/qrcode/index.ts
new file mode 100644
index 0000000..b0fac4d
--- /dev/null
+++ b/registry/bases/forme/components/qrcode/index.ts
@@ -0,0 +1,5 @@
+export {
+ PdfQRCode,
+ type PdfQRCodeProps,
+ type QRCodeErrorLevel,
+} from "./qrcode";
diff --git a/registry/bases/forme/components/qrcode/qrcode.tsx b/registry/bases/forme/components/qrcode/qrcode.tsx
new file mode 100644
index 0000000..50a11e2
--- /dev/null
+++ b/registry/bases/forme/components/qrcode/qrcode.tsx
@@ -0,0 +1,124 @@
+import { Text as PDFText, StyleSheet, View } from "@formepdf/react";
+import type { Style } from "@formepdf/react";
+import QRCode from "qrcode";
+
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { Rect, Svg } from "../../lib/forme-svg";
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { resolveColor } from "../../lib/resolve-color";
+
+export type QRCodeErrorLevel = "L" | "M" | "Q" | "H";
+
+/**
+ * QR code rendered as an SVG grid for use in PDF documents.
+ * Props - `value` | `size` | `color` | `backgroundColor` | `errorLevel` | `margin` | `caption` | `style`
+ * @see {@link PdfQRCodeProps}
+ */
+export interface PdfQRCodeProps extends Omit<PDFComponentProps, "children"> {
+ value: string;
+ size?: number;
+ color?: string;
+ backgroundColor?: string;
+ errorLevel?: QRCodeErrorLevel;
+ margin?: number;
+ caption?: string;
+ children?: never;
+}
+
+function createQRCodeStyles(t: PdfcnTheme) {
+ const { spacing } = t.primitives;
+ return StyleSheet.create({
+ caption: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.primitives.typography.xs,
+ marginTop: spacing[1],
+ textAlign: "center",
+ },
+ container: { alignItems: "center" },
+ });
+}
+
+function generateQRMatrix(
+ value: string,
+ errorLevel: QRCodeErrorLevel,
+ margin: number
+): boolean[][] {
+ const qr = QRCode.create(value, { errorCorrectionLevel: errorLevel });
+ const { size, data } = qr.modules;
+ const totalSize = size + margin * 2;
+ const matrix: boolean[][] = [];
+ for (let row = 0; row < totalSize; row++) {
+ const rowData: boolean[] = [];
+ for (let col = 0; col < totalSize; col++) {
+ const isInMargin =
+ row < margin ||
+ row >= size + margin ||
+ col < margin ||
+ col >= size + margin;
+ if (isInMargin) {
+ rowData.push(false);
+ } else {
+ rowData.push(data[(row - margin) * size + (col - margin)] === 1);
+ }
+ }
+ matrix.push(rowData);
+ }
+ return matrix;
+}
+
+export function PdfQRCode({
+ value,
+ size = 100,
+ color = "#000000",
+ backgroundColor = "#ffffff",
+ errorLevel = "M",
+ margin = 2,
+ caption,
+ style,
+}: PdfQRCodeProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createQRCodeStyles(theme), [theme]);
+ const matrix = useSafeMemo(
+ () => generateQRMatrix(value, errorLevel, margin),
+ [value, errorLevel, margin]
+ );
+ const moduleSize = size / matrix.length;
+ const resolvedColor = resolveColor(color, theme.colors);
+ const resolvedBgColor =
+ backgroundColor === "transparent"
+ ? undefined
+ : resolveColor(backgroundColor, theme.colors);
+ const containerStyles: Style[] = [styles.container];
+ if (style) {
+ containerStyles.push(...[style].flat());
+ }
+
+ return (
+ <View style={containerStyles as never}>
+ <Svg width={size} height={size} viewBox={`0 0 ${size} ${size}`}>
+ {resolvedBgColor !== undefined && (
+ <Rect x={0} y={0} width={size} height={size} fill={resolvedBgColor} />
+ )}
+ {matrix
+ .flatMap((row, y) =>
+ row
+ .map((isDark, x) => (isDark ? { x, y } : null))
+ .filter((pos): pos is { x: number; y: number } => pos !== null)
+ )
+ .map((pos) => (
+ <Rect
+ key={`qr-${pos.y}-${pos.x}`}
+ x={pos.x * moduleSize}
+ y={pos.y * moduleSize}
+ width={moduleSize}
+ height={moduleSize}
+ fill={resolvedColor}
+ />
+ ))}
+ </Svg>
+ {caption && <PDFText style={styles.caption}>{caption}</PDFText>}
+ </View>
+ );
+}
diff --git a/registry/bases/forme/components/section/index.ts b/registry/bases/forme/components/section/index.ts
new file mode 100644
index 0000000..18c2e0f
--- /dev/null
+++ b/registry/bases/forme/components/section/index.ts
@@ -0,0 +1,7 @@
+export {
+ Section,
+ type SectionProps,
+ type SectionSpacing,
+ type SectionPadding,
+ type SectionVariant,
+} from "./section";
diff --git a/registry/bases/forme/components/section/section.tsx b/registry/bases/forme/components/section/section.tsx
new file mode 100644
index 0000000..cfa2df4
--- /dev/null
+++ b/registry/bases/forme/components/section/section.tsx
@@ -0,0 +1,144 @@
+import { StyleSheet, View } from "@formepdf/react";
+import type { Style } from "@formepdf/react";
+
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { resolveColor } from "../../lib/resolve-color";
+
+export type SectionSpacing = "none" | "sm" | "md" | "lg" | "xl";
+export type SectionPadding = "none" | "sm" | "md" | "lg";
+export type SectionVariant = "default" | "callout" | "highlight" | "card";
+
+/**
+ * Layout container with spacing, padding, and visual style variants.
+ * Props - `spacing` | `padding` | `background` | `border` | `variant` | `accentColor` | `noWrap` | `children` | `style`
+ * @see {@link SectionProps}
+ */
+export interface SectionProps extends PDFComponentProps {
+ /**
+ * @default 'md'
+ */
+ spacing?: SectionSpacing;
+ padding?: SectionPadding;
+ background?: string;
+ /**
+ * @default false
+ */
+ border?: boolean;
+ /**
+ * @default 'default'
+ */
+ variant?: SectionVariant;
+ accentColor?: string;
+ /**
+ * @default false
+ */
+ noWrap?: boolean;
+}
+
+function createSectionStyles(t: PdfcnTheme) {
+ const { spacing, borderRadius } = t.primitives;
+ return StyleSheet.create({
+ base: { flexDirection: "column" },
+ border: {
+ borderColor: t.colors.border,
+ borderRadius: borderRadius.md,
+ borderStyle: "solid",
+ borderWidth: spacing[0.5],
+ },
+ callout: {
+ borderLeftColor: t.colors.primary,
+ borderLeftStyle: "solid",
+ borderLeftWidth: spacing[1],
+ paddingLeft: spacing[4],
+ paddingVertical: spacing[2],
+ },
+ card: {
+ borderColor: t.colors.border,
+ borderRadius: borderRadius.md,
+ borderStyle: "solid",
+ borderWidth: spacing[0.5],
+ padding: spacing[4],
+ },
+ highlight: {
+ backgroundColor: t.colors.muted,
+ borderLeftColor: t.colors.primary,
+ borderLeftStyle: "solid",
+ borderLeftWidth: spacing[1],
+ padding: spacing[4],
+ },
+ paddingLg: { padding: spacing[6] },
+ paddingMd: { padding: spacing[4] },
+ paddingNone: { padding: spacing[0] },
+ paddingSm: { padding: spacing[3] },
+ spacingLg: { marginVertical: spacing[8] },
+ spacingMd: { marginVertical: t.spacing.sectionGap },
+ spacingNone: { marginVertical: spacing[0] },
+ spacingSm: { marginVertical: spacing[4] },
+ spacingXl: { marginVertical: spacing[12] },
+ });
+}
+
+export function Section({
+ spacing = "md",
+ padding,
+ background,
+ border,
+ variant = "default",
+ accentColor,
+ noWrap = false,
+ children,
+ style,
+}: SectionProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createSectionStyles(theme), [theme]);
+ const spacingMap = {
+ lg: styles.spacingLg,
+ md: styles.spacingMd,
+ none: styles.spacingNone,
+ sm: styles.spacingSm,
+ xl: styles.spacingXl,
+ };
+ const paddingMap = {
+ lg: styles.paddingLg,
+ md: styles.paddingMd,
+ none: styles.paddingNone,
+ sm: styles.paddingSm,
+ };
+ const variantMap: Record<SectionVariant, Style | null> = {
+ callout: styles.callout,
+ card: styles.card,
+ default: null,
+ highlight: styles.highlight,
+ };
+ const styleArray: Style[] = [styles.base, spacingMap[spacing]];
+ const variantStyle = variantMap[variant];
+ if (variantStyle) {
+ styleArray.push(variantStyle);
+ }
+ if (accentColor && (variant === "callout" || variant === "highlight")) {
+ styleArray.push({
+ borderLeftColor: resolveColor(accentColor, theme.colors),
+ });
+ }
+ if (padding && padding in paddingMap) {
+ styleArray.push(paddingMap[padding]);
+ }
+ if (border && variant === "default") {
+ styleArray.push(styles.border);
+ }
+ if (background) {
+ styleArray.push({
+ backgroundColor: resolveColor(background, theme.colors),
+ });
+ }
+ if (style) {
+ styleArray.push(...[style].flat());
+ }
+ return (
+ <View wrap={noWrap ? false : undefined} style={styleArray as never}>
+ {children}
+ </View>
+ );
+}
diff --git a/registry/bases/forme/components/signature/index.ts b/registry/bases/forme/components/signature/index.ts
new file mode 100644
index 0000000..fe7589d
--- /dev/null
+++ b/registry/bases/forme/components/signature/index.ts
@@ -0,0 +1,6 @@
+export {
+ PdfSignatureBlock,
+ type PdfSignatureBlockProps,
+ type SignatureVariant,
+ type SignatureSigner,
+} from "./signature";
diff --git a/registry/bases/forme/components/signature/signature.tsx b/registry/bases/forme/components/signature/signature.tsx
new file mode 100644
index 0000000..c02db98
--- /dev/null
+++ b/registry/bases/forme/components/signature/signature.tsx
@@ -0,0 +1,182 @@
+import { Text as PDFText, StyleSheet, View } from "@formepdf/react";
+import type { Style } from "@formepdf/react";
+
+import type { PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+
+export type SignatureVariant = "single" | "double" | "inline";
+
+/**
+ * Signature signer properties.
+ * Props - `label` | `name` | `title` | `date`
+ * @see {@link SignatureSigner}
+ */
+export interface SignatureSigner {
+ label?: string;
+ name?: string;
+ title?: string;
+ date?: string;
+}
+
+/**
+ * Signature block properties.
+ * Props - `variant` | `label` | `name` | `title` | `date` | `signers` | `style`
+ * @see {@link PdfSignatureBlockProps}
+ */
+export interface PdfSignatureBlockProps {
+ /**
+ * Layout variant: [single, double, inline]
+ * @default 'single'
+ */
+ variant?: SignatureVariant;
+ label?: string;
+ name?: string;
+ title?: string;
+ date?: string;
+ signers?: [SignatureSigner, SignatureSigner];
+ style?: Style;
+}
+
+function createSignatureStyles(t: PdfcnTheme) {
+ const { spacing, fontWeights, typography } = t.primitives;
+ return StyleSheet.create({
+ block: { flex: 1, minWidth: 140 },
+ container: {
+ marginBottom: t.spacing.componentGap,
+ marginTop: t.spacing.sectionGap,
+ },
+ dateText: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: typography.xs,
+ marginTop: 1,
+ },
+ doubleRow: {
+ flexDirection: "row",
+ gap: spacing[8],
+ justifyContent: "space-between",
+ },
+ inlineLabel: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: typography.sm,
+ },
+ inlineLine: {
+ borderBottomColor: t.colors.foreground,
+ borderBottomStyle: "solid",
+ borderBottomWidth: 1,
+ height: spacing[5],
+ minWidth: 120,
+ paddingHorizontal: spacing[2],
+ },
+ inlineName: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ },
+ inlineRow: {
+ alignItems: "center",
+ flexDirection: "row",
+ flexWrap: "wrap",
+ gap: spacing[3],
+ },
+ label: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: typography.sm,
+ marginBottom: spacing[1],
+ },
+ line: {
+ borderBottomColor: t.colors.foreground,
+ borderBottomStyle: "solid",
+ borderBottomWidth: 1,
+ marginBottom: spacing[1],
+ minHeight: spacing[6],
+ },
+ name: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ fontWeight: fontWeights.semibold,
+ },
+ titleText: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: typography.sm,
+ },
+ });
+}
+
+function renderSignerBlock(
+ signer: SignatureSigner,
+ styles: ReturnType<typeof createSignatureStyles>
+) {
+ return (
+ <View style={styles.block}>
+ {signer.label ? (
+ <PDFText style={styles.label}>{signer.label}</PDFText>
+ ) : null}
+ <View style={styles.line} />
+ {signer.name ? (
+ <PDFText style={styles.name}>{signer.name}</PDFText>
+ ) : null}
+ {signer.title ? (
+ <PDFText style={styles.titleText}>{signer.title}</PDFText>
+ ) : null}
+ {signer.date ? (
+ <PDFText style={styles.dateText}>{signer.date}</PDFText>
+ ) : null}
+ </View>
+ );
+}
+
+export function PdfSignatureBlock({
+ variant = "single",
+ label = "Signature",
+ name,
+ title,
+ date,
+ signers,
+ style,
+}: PdfSignatureBlockProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createSignatureStyles(theme), [theme]);
+ const containerStyles: Style[] = [styles.container];
+ if (style) {
+ containerStyles.push(style);
+ }
+
+ if (variant === "inline") {
+ return (
+ <View wrap={false} style={containerStyles as never}>
+ <View style={styles.inlineRow}>
+ <PDFText style={styles.inlineLabel}>{`${label}:`}</PDFText>
+ <View style={styles.inlineLine} />
+ {name ? <PDFText style={styles.inlineName}>{name}</PDFText> : null}
+ </View>
+ </View>
+ );
+ }
+
+ if (variant === "double") {
+ const [first, second] = signers ?? [
+ { date: "", label: "Authorized by", name: "", title: "" },
+ { date: "", label: "Approved by", name: "", title: "" },
+ ];
+ return (
+ <View wrap={false} style={containerStyles as never}>
+ <View style={styles.doubleRow}>
+ {renderSignerBlock(first, styles)}
+ {renderSignerBlock(second, styles)}
+ </View>
+ </View>
+ );
+ }
+
+ return (
+ <View wrap={false} style={containerStyles as never}>
+ {renderSignerBlock({ date, label, name, title }, styles)}
+ </View>
+ );
+}
diff --git a/registry/bases/forme/components/stack/index.ts b/registry/bases/forme/components/stack/index.ts
new file mode 100644
index 0000000..159aa8e
--- /dev/null
+++ b/registry/bases/forme/components/stack/index.ts
@@ -0,0 +1,8 @@
+export {
+ Stack,
+ type StackProps,
+ type StackGap,
+ type StackDirection,
+ type StackAlign,
+ type StackJustify,
+} from "./stack";
diff --git a/registry/bases/forme/components/stack/stack.tsx b/registry/bases/forme/components/stack/stack.tsx
new file mode 100644
index 0000000..a2d6804
--- /dev/null
+++ b/registry/bases/forme/components/stack/stack.tsx
@@ -0,0 +1,121 @@
+import { StyleSheet, View } from "@formepdf/react";
+import type { Style } from "@formepdf/react";
+
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+
+export type StackGap = "none" | "sm" | "md" | "lg" | "xl";
+export type StackDirection = "vertical" | "horizontal";
+export type StackAlign = "start" | "center" | "end" | "stretch";
+export type StackJustify = "start" | "center" | "end" | "between" | "around";
+
+/**
+ * Flex layout container with gap and direction control.
+ * Props - `gap` | `direction` | `align` | `justify` | `wrap` | `noWrap` | `children` | `style`
+ * @see {@link StackProps}
+ */
+export interface StackProps extends PDFComponentProps {
+ /**
+ * @default 'md'
+ */
+ gap?: StackGap;
+ /**
+ * @default 'vertical'
+ */
+ direction?: StackDirection;
+ /**
+ * @default 'start'
+ */
+ align?: StackAlign;
+ /**
+ * @default 'start'
+ */
+ justify?: StackJustify;
+ /**
+ * @default false
+ */
+ wrap?: boolean;
+ /**
+ * @default false
+ */
+ noWrap?: boolean;
+}
+
+function createStackStyles(t: PdfcnTheme) {
+ const { spacing } = t.primitives;
+ return StyleSheet.create({
+ alignCenter: { alignItems: "center" },
+ alignEnd: { alignItems: "flex-end" },
+ alignStart: { alignItems: "flex-start" },
+ alignStretch: { alignItems: "stretch" },
+ gapLg: { gap: spacing[6] },
+ gapMd: { gap: spacing[4] },
+ gapNone: { gap: spacing[0] },
+ gapSm: { gap: spacing[2] },
+ gapXl: { gap: spacing[8] },
+ horizontal: { flexDirection: "row" },
+ justifyAround: { justifyContent: "space-around" },
+ justifyBetween: { justifyContent: "space-between" },
+ justifyCenter: { justifyContent: "center" },
+ justifyEnd: { justifyContent: "flex-end" },
+ justifyStart: { justifyContent: "flex-start" },
+ vertical: { flexDirection: "column" },
+ wrap: { flexWrap: "wrap" },
+ });
+}
+
+export function Stack({
+ gap = "md",
+ direction = "vertical",
+ align,
+ justify,
+ wrap,
+ noWrap,
+ children,
+ style,
+}: StackProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createStackStyles(theme), [theme]);
+ const gapMap = {
+ lg: styles.gapLg,
+ md: styles.gapMd,
+ none: styles.gapNone,
+ sm: styles.gapSm,
+ xl: styles.gapXl,
+ };
+ const alignMap = {
+ center: styles.alignCenter,
+ end: styles.alignEnd,
+ start: styles.alignStart,
+ stretch: styles.alignStretch,
+ };
+ const justifyMap = {
+ around: styles.justifyAround,
+ between: styles.justifyBetween,
+ center: styles.justifyCenter,
+ end: styles.justifyEnd,
+ start: styles.justifyStart,
+ };
+ const styleArray: Style[] = [
+ direction === "horizontal" ? styles.horizontal : styles.vertical,
+ gapMap[gap],
+ ];
+ if (align && align in alignMap) {
+ styleArray.push(alignMap[align]);
+ }
+ if (justify && justify in justifyMap) {
+ styleArray.push(justifyMap[justify]);
+ }
+ if (wrap) {
+ styleArray.push(styles.wrap);
+ }
+ if (style) {
+ styleArray.push(...[style].flat());
+ }
+ return (
+ <View wrap={noWrap ? false : undefined} style={styleArray as never}>
+ {children}
+ </View>
+ );
+}
diff --git a/registry/bases/forme/components/table/index.ts b/registry/bases/forme/components/table/index.ts
new file mode 100644
index 0000000..edd8ab6
--- /dev/null
+++ b/registry/bases/forme/components/table/index.ts
@@ -0,0 +1,15 @@
+export {
+ Table,
+ TableHeader,
+ TableBody,
+ TableFooter,
+ TableRow,
+ TableCell,
+} from "./table";
+export type {
+ TableProps,
+ TableSectionProps,
+ TableRowProps,
+ TableCellProps,
+ TableVariant,
+} from "./table.types";
diff --git a/registry/bases/forme/components/table/table.styles.ts b/registry/bases/forme/components/table/table.styles.ts
new file mode 100644
index 0000000..5c16b47
--- /dev/null
+++ b/registry/bases/forme/components/table/table.styles.ts
@@ -0,0 +1,278 @@
+import { StyleSheet } from "@formepdf/react";
+
+import type { PdfcnTheme } from "@/registry/themes";
+
+/**
+ * Creates all table styles derived from the active theme.
+ * @param t - The resolved PdfcnTheme instance.
+ */
+export function createTableStyles(t: PdfcnTheme) {
+ const { spacing, borderRadius, fontWeights, typography } = t.primitives;
+ const borderColor = t.colors.border;
+
+ const hairline = 0.5;
+ const rule = 1;
+ const thick = 1.5;
+
+ const cellPadV = spacing[2] - 2;
+ const cellPadH = spacing[2] + 2;
+ const cellPadVCompact = spacing[0.5];
+ const cellPadHCompact = spacing[2];
+
+ const rowDivider = {
+ borderBottomColor: borderColor,
+ borderBottomStyle: "solid" as const,
+ borderBottomWidth: hairline,
+ };
+
+ return StyleSheet.create({
+ cell: {
+ flex: 1,
+ justifyContent: "center",
+ paddingHorizontal: cellPadH,
+ paddingVertical: cellPadV,
+ },
+
+ cellBordered: {
+ paddingHorizontal: cellPadH,
+ paddingVertical: cellPadV,
+ },
+
+ cellBorderedBorder: {
+ borderRightColor: borderColor,
+ borderRightStyle: "solid",
+ borderRightWidth: hairline,
+ },
+
+ cellCompact: {
+ paddingHorizontal: cellPadHCompact,
+ paddingVertical: cellPadVCompact,
+ },
+
+ cellFixed: {
+ flexGrow: 0,
+ flexShrink: 0,
+ justifyContent: "center",
+ paddingHorizontal: cellPadH,
+ paddingVertical: cellPadV,
+ },
+
+ cellGridBorder: {
+ borderRightColor: borderColor,
+ borderRightStyle: "solid",
+ borderRightWidth: hairline,
+ },
+
+ cellMinimal: {
+ paddingHorizontal: spacing[2] - 2,
+ paddingVertical: spacing[1] + 1,
+ },
+
+ cellPrimaryHeader: {
+ paddingHorizontal: cellPadH,
+ paddingVertical: cellPadV,
+ },
+
+ cellStriped: {
+ paddingHorizontal: cellPadH,
+ paddingVertical: cellPadV,
+ },
+
+ cellText: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ lineHeight: 1.2,
+ },
+ cellTextCompact: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: typography.xs,
+ lineHeight: 1.2,
+ },
+ cellTextFooter: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ fontWeight: fontWeights.semibold,
+ lineHeight: 1.2,
+ },
+ cellTextHeaderBordered: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ fontWeight: fontWeights.bold,
+ lineHeight: 1.2,
+ },
+ cellTextHeaderCompact: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: typography.xs,
+ fontWeight: fontWeights.semibold,
+ letterSpacing: 0.6,
+ lineHeight: 1.2,
+ textTransform: "uppercase",
+ },
+ cellTextHeaderGrid: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ fontWeight: fontWeights.semibold,
+ lineHeight: 1.2,
+ },
+ cellTextHeaderLine: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ fontWeight: fontWeights.semibold,
+ lineHeight: 1.2,
+ },
+
+ cellTextHeaderMinimal: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ fontWeight: fontWeights.medium,
+ lineHeight: 1.2,
+ },
+ cellTextHeaderPrimaryHeader: {
+ color: t.colors.primaryForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: typography.xs,
+ fontWeight: fontWeights.semibold,
+ letterSpacing: 0.6,
+ lineHeight: 1.2,
+ textTransform: "uppercase",
+ },
+ cellTextHeaderStriped: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ fontWeight: fontWeights.semibold,
+ lineHeight: 1.2,
+ },
+ row: {
+ display: "flex",
+ flexDirection: "row",
+ },
+ rowBordered: rowDivider,
+ rowCompact: rowDivider,
+ rowFooter: {
+ borderTopColor: borderColor,
+ borderTopStyle: "solid",
+ borderTopWidth: rule,
+ },
+
+ rowFooterStriped: {
+ backgroundColor: t.colors.muted,
+ borderTopColor: borderColor,
+ borderTopStyle: "solid",
+ borderTopWidth: rule,
+ },
+ rowGrid: rowDivider,
+
+ rowHeaderBordered: {
+ backgroundColor: t.colors.muted,
+ borderBottomColor: borderColor,
+ borderBottomStyle: "solid",
+ borderBottomWidth: hairline,
+ },
+
+ rowHeaderCompact: {
+ backgroundColor: t.colors.muted,
+ borderBottomColor: borderColor,
+ borderBottomStyle: "solid",
+ borderBottomWidth: rule,
+ },
+ rowHeaderGrid: {
+ backgroundColor: t.colors.muted,
+ borderBottomColor: borderColor,
+ borderBottomStyle: "solid",
+ borderBottomWidth: rule,
+ },
+
+ rowHeaderLine: {
+ borderBottomColor: borderColor,
+ borderBottomStyle: "solid",
+ borderBottomWidth: rule,
+ },
+ rowHeaderMinimal: {
+ borderBottomColor: borderColor,
+ borderBottomStyle: "solid",
+ borderBottomWidth: rule,
+ },
+ rowHeaderPrimaryHeader: {
+ backgroundColor: t.colors.primary,
+ },
+ rowHeaderStriped: {
+ backgroundColor: t.colors.muted,
+ borderBottomColor: borderColor,
+ borderBottomStyle: "solid",
+ borderBottomWidth: rule,
+ },
+ rowLine: rowDivider,
+
+ rowMinimal: rowDivider,
+ rowPrimaryHeader: rowDivider,
+
+ rowStripe: {
+ backgroundColor: t.colors.muted,
+ },
+
+ rowStriped: {},
+ table: {
+ display: "flex",
+ flexDirection: "column",
+ marginBottom: t.spacing.componentGap,
+ width: "100%",
+ },
+ tableBordered: {
+ borderBottomLeftRadius: borderRadius.sm,
+ borderBottomRightRadius: borderRadius.sm,
+ borderColor,
+ borderStyle: "solid",
+ borderTopLeftRadius: borderRadius.sm,
+ borderTopRightRadius: borderRadius.sm,
+ borderWidth: rule,
+ overflow: "hidden" as const,
+ },
+ tableCompact: {
+ borderBottomColor: borderColor,
+ borderBottomStyle: "solid",
+ borderBottomWidth: hairline,
+ },
+ tableGrid: {
+ borderBottomLeftRadius: borderRadius.md,
+ borderBottomRightRadius: borderRadius.md,
+ borderColor,
+ borderStyle: "solid",
+ borderTopLeftRadius: borderRadius.md,
+ borderTopRightRadius: borderRadius.md,
+ borderWidth: thick,
+ overflow: "hidden" as const,
+ },
+ tableLine: {
+ borderBottomColor: borderColor,
+ borderBottomStyle: "solid",
+ borderBottomWidth: hairline,
+ },
+ tableMinimal: {
+ paddingVertical: spacing[2],
+ },
+
+ tablePrimaryHeader: {
+ borderBottomColor: borderColor,
+ borderBottomStyle: "solid",
+ borderBottomWidth: hairline,
+ },
+
+ tableStriped: {
+ borderBottomColor: borderColor,
+ borderBottomStyle: "solid",
+ borderBottomWidth: hairline,
+ borderTopColor: borderColor,
+ borderTopStyle: "solid",
+ borderTopWidth: hairline,
+ },
+ });
+}
diff --git a/registry/bases/forme/components/table/table.tsx b/registry/bases/forme/components/table/table.tsx
new file mode 100644
index 0000000..18309b6
--- /dev/null
+++ b/registry/bases/forme/components/table/table.tsx
@@ -0,0 +1,264 @@
+import { Text as PDFText, View } from "@formepdf/react";
+import type { Style } from "@formepdf/react";
+import { Children, cloneElement, isValidElement } from "react";
+import type { ReactElement, ReactNode } from "react";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { createTableStyles } from "./table.styles";
+import type {
+ TableCellProps,
+ TableProps,
+ TableRowProps,
+ TableSectionProps,
+ TableVariant,
+} from "./table.types";
+
+function processTableChildren(
+ children: ReactNode,
+ variant: TableVariant,
+ zebraStripe: boolean
+): ReactNode {
+ let bodyRowIndex = 0;
+
+ return Children.map(children, (child) => {
+ if (!isValidElement(child)) {
+ return child;
+ }
+
+ if (
+ child.type === TableHeader ||
+ child.type === TableBody ||
+ child.type === TableFooter
+ ) {
+ const isBody = child.type === TableBody;
+ const sectionChild = child as ReactElement<TableSectionProps>;
+ const sectionChildren = Children.map(
+ sectionChild.props.children,
+ (rowChild) => {
+ if (isValidElement(rowChild) && rowChild.type === TableRow) {
+ const rowProps: Partial<TableRowProps> = { variant };
+
+ if (isBody && zebraStripe) {
+ const isStripe = bodyRowIndex % 2 === 1;
+ bodyRowIndex++;
+ if (isStripe) {
+ rowProps.stripe = true;
+ }
+ }
+
+ return cloneElement(
+ rowChild as ReactElement<TableRowProps>,
+ rowProps
+ );
+ }
+ return rowChild;
+ }
+ );
+
+ return cloneElement(child, {}, sectionChildren);
+ }
+
+ if (child.type === TableRow) {
+ return cloneElement(child as ReactElement<TableRowProps>, { variant });
+ }
+
+ return child;
+ });
+}
+
+export function TableHeader({ children, style }: TableSectionProps) {
+ return <View style={style}>{children}</View>;
+}
+
+export function TableBody({ children, style }: TableSectionProps) {
+ return <View style={style}>{children}</View>;
+}
+
+export function TableFooter({ children, style }: TableSectionProps) {
+ return <View style={style}>{children}</View>;
+}
+
+export function Table({
+ children,
+ style,
+ variant = "line",
+ zebraStripe = false,
+ noWrap = false,
+}: TableProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createTableStyles(theme), [theme]);
+ const tableStyles: Style[] = [styles.table];
+ const effectiveZebra = variant === "striped" ? true : zebraStripe;
+
+ tableStyles.push(
+ {
+ bordered: styles.tableBordered,
+ compact: styles.tableCompact,
+ grid: styles.tableGrid,
+ line: styles.tableLine,
+ minimal: styles.tableMinimal,
+ "primary-header": styles.tablePrimaryHeader,
+ striped: styles.tableStriped,
+ }[variant]
+ );
+
+ const styleArray = style ? [...tableStyles, style] : tableStyles;
+ const processedChildren = processTableChildren(
+ children,
+ variant,
+ effectiveZebra
+ );
+
+ const inner = <View style={styleArray as never}>{processedChildren}</View>;
+ return noWrap ? <View wrap={false}>{inner}</View> : inner;
+}
+
+export function TableRow({
+ header,
+ footer,
+ stripe,
+ children,
+ style,
+ variant = "line",
+}: TableRowProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createTableStyles(theme), [theme]);
+ const rowStyles: Style[] = [styles.row];
+
+ rowStyles.push(
+ {
+ bordered: styles.rowBordered,
+ compact: styles.rowCompact,
+ grid: styles.rowGrid,
+ line: styles.rowLine,
+ minimal: styles.rowMinimal,
+ "primary-header": styles.rowPrimaryHeader,
+ striped: styles.rowStriped,
+ }[variant]
+ );
+
+ if (header) {
+ rowStyles.push(
+ {
+ bordered: styles.rowHeaderBordered,
+ compact: styles.rowHeaderCompact,
+ grid: styles.rowHeaderGrid,
+ line: styles.rowHeaderLine,
+ minimal: styles.rowHeaderMinimal,
+ "primary-header": styles.rowHeaderPrimaryHeader,
+ striped: styles.rowHeaderStriped,
+ }[variant]
+ );
+ }
+
+ if (footer) {
+ if (variant === "striped") {
+ rowStyles.push(styles.rowFooterStriped);
+ } else {
+ rowStyles.push(styles.rowFooter);
+ }
+ }
+
+ if (stripe && !header && !footer) {
+ rowStyles.push(styles.rowStripe);
+ }
+
+ const styleArray = style ? [...rowStyles, style] : rowStyles;
+ const childArray = Children.toArray(children);
+ const processedChildren = childArray.map((child, i) => {
+ if (isValidElement(child) && child.type === TableCell) {
+ return cloneElement(child as ReactElement<TableCellProps>, {
+ _last: i === childArray.length - 1,
+ footer,
+ header,
+ variant,
+ });
+ }
+ return child;
+ });
+
+ return (
+ <View wrap={false} style={styleArray as never}>
+ {processedChildren}
+ </View>
+ );
+}
+
+export function TableCell({
+ header,
+ footer,
+ align,
+ width,
+ children,
+ style,
+ variant = "line",
+ _last,
+}: TableCellProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createTableStyles(theme), [theme]);
+ const cellStyles: Style[] =
+ width !== undefined
+ ? [styles.cellFixed, { width } as Style]
+ : [styles.cell];
+
+ const cellVariantStyle = (
+ {
+ bordered: styles.cellBordered,
+ compact: styles.cellCompact,
+ minimal: styles.cellMinimal,
+ "primary-header": styles.cellPrimaryHeader,
+ striped: styles.cellStriped,
+ } as Partial<Record<TableVariant, Style>>
+ )[variant];
+ if (cellVariantStyle) {
+ cellStyles.push(cellVariantStyle);
+ }
+
+ if (variant === "grid" && !_last) {
+ cellStyles.push(styles.cellGridBorder);
+ } else if (variant === "bordered" && !_last) {
+ cellStyles.push(styles.cellBorderedBorder);
+ }
+
+ if (align) {
+ cellStyles.push({ textAlign: align } as Style);
+ }
+
+ const styleArray = style ? [...cellStyles, style] : cellStyles;
+
+ let textStyle: Style = styles.cellText;
+ if (header) {
+ textStyle = {
+ bordered: styles.cellTextHeaderBordered,
+ compact: styles.cellTextHeaderCompact,
+ grid: styles.cellTextHeaderGrid,
+ line: styles.cellTextHeaderLine,
+ minimal: styles.cellTextHeaderMinimal,
+ "primary-header": styles.cellTextHeaderPrimaryHeader,
+ striped: styles.cellTextHeaderStriped,
+ }[variant];
+ } else if (footer) {
+ textStyle = styles.cellTextFooter;
+ } else if (variant === "compact") {
+ textStyle = styles.cellTextCompact;
+ }
+
+ const content =
+ typeof children === "string" ? (
+ <PDFText
+ style={
+ [
+ textStyle,
+ align ? { textAlign: align } : {},
+ { margin: 0, padding: 0 },
+ ] as never
+ }
+ >
+ {children}
+ </PDFText>
+ ) : (
+ children
+ );
+
+ return <View style={styleArray as never}>{content}</View>;
+}
diff --git a/registry/bases/forme/components/table/table.types.ts b/registry/bases/forme/components/table/table.types.ts
new file mode 100644
index 0000000..2de199e
--- /dev/null
+++ b/registry/bases/forme/components/table/table.types.ts
@@ -0,0 +1,59 @@
+import type { PDFComponentProps } from "@/registry/themes";
+
+/** Table visual style variant. */
+export type TableVariant =
+ | "line"
+ | "grid"
+ | "minimal"
+ | "striped"
+ | "compact"
+ | "bordered"
+ | "primary-header";
+
+/**
+ * Table container with visual style variants and optional zebra striping.
+ * Props - `variant` | `zebraStripe` | `noWrap` | `children` | `style`
+ * @see {@link TableProps}
+ */
+export interface TableProps extends PDFComponentProps {
+ /**
+ * @default 'line'
+ */
+ variant?: TableVariant;
+ /**
+ * @default false
+ */
+ zebraStripe?: boolean;
+ /**
+ * @default false
+ */
+ noWrap?: boolean;
+}
+
+export type TableSectionProps = PDFComponentProps;
+
+/**
+ * Table row with optional header, footer, and stripe states.
+ * Props - `header` | `footer` | `stripe` | `variant` | `children` | `style`
+ * @see {@link TableRowProps}
+ */
+export interface TableRowProps extends PDFComponentProps {
+ header?: boolean;
+ footer?: boolean;
+ stripe?: boolean;
+ variant?: TableVariant;
+}
+
+/**
+ * Table cell with alignment, width, and header or footer text styling.
+ * Props - `header` | `footer` | `align` | `width` | `variant` | `_last` | `children` | `style`
+ * @see {@link TableCellProps}
+ */
+export interface TableCellProps extends PDFComponentProps {
+ header?: boolean;
+ footer?: boolean;
+ align?: "left" | "center" | "right";
+ width?: string | number;
+ variant?: TableVariant;
+ _last?: boolean;
+}
diff --git a/registry/bases/forme/components/text/index.ts b/registry/bases/forme/components/text/index.ts
new file mode 100644
index 0000000..25d1338
--- /dev/null
+++ b/registry/bases/forme/components/text/index.ts
@@ -0,0 +1,7 @@
+export {
+ Text,
+ type TextProps,
+ type TextVariant,
+ type TextWeight,
+ type TextDecoration,
+} from "./text";
diff --git a/registry/bases/forme/components/text/text.tsx b/registry/bases/forme/components/text/text.tsx
new file mode 100644
index 0000000..99edd21
--- /dev/null
+++ b/registry/bases/forme/components/text/text.tsx
@@ -0,0 +1,143 @@
+import { Text as PDFText, StyleSheet } from "@formepdf/react";
+import type { Style } from "@formepdf/react";
+
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { resolveColor } from "../../lib/resolve-color";
+
+export type TextVariant = "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl";
+export type TextWeight = "normal" | "medium" | "semibold" | "bold";
+export type TextDecoration = "underline" | "line-through" | "none";
+
+/**
+ * Body text with typography scale, alignment, and decoration options.
+ * Props - `variant` | `align` | `color` | `weight` | `italic` | `decoration` | `transform` | `noMargin` | `children` | `style`
+ * @see {@link TextProps}
+ */
+export interface TextProps extends PDFComponentProps {
+ /**
+ * @default 'base'
+ */
+ variant?: TextVariant;
+ /**
+ * @default 'left'
+ */
+ align?: "left" | "center" | "right" | "justify";
+ color?: string;
+ /**
+ * @default 'normal'
+ */
+ weight?: TextWeight;
+ /**
+ * @default false
+ */
+ italic?: boolean;
+ /**
+ * @default 'none'
+ */
+ decoration?: TextDecoration;
+ transform?: "uppercase" | "lowercase" | "capitalize";
+ /**
+ * @default false
+ */
+ noMargin?: boolean;
+}
+
+function createTextStyles(t: PdfcnTheme) {
+ const { fontWeights, letterSpacing } = t.primitives;
+ const base = {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ lineHeight: t.typography.body.lineHeight,
+ marginBottom: t.spacing.paragraphGap,
+ marginTop: 0,
+ };
+ return StyleSheet.create({
+ "2xl": { ...base, fontSize: t.primitives.typography["2xl"] },
+ "3xl": { ...base, fontSize: t.primitives.typography["3xl"] },
+ base: { ...base, fontSize: t.primitives.typography.base },
+ capitalize: { textTransform: "capitalize" },
+ decorationNone: { textDecoration: "none" },
+ italic: { fontStyle: "italic" },
+ lg: { ...base, fontSize: t.primitives.typography.lg },
+ lineThrough: { textDecoration: "line-through" },
+ lowercase: { textTransform: "lowercase" },
+ noMargin: { marginBottom: 0, marginTop: 0 },
+ sm: { ...base, fontSize: t.primitives.typography.sm },
+ text: { ...base, fontSize: t.typography.body.fontSize },
+ underline: { textDecoration: "underline" },
+ uppercase: {
+ letterSpacing: letterSpacing.wider * 10,
+ textTransform: "uppercase",
+ },
+ weightBold: { fontWeight: fontWeights.bold },
+ weightMedium: { fontWeight: fontWeights.medium },
+ weightNormal: { fontWeight: fontWeights.regular },
+ weightSemibold: { fontWeight: fontWeights.semibold },
+ xl: { ...base, fontSize: t.primitives.typography.xl },
+ xs: { ...base, fontSize: t.primitives.typography.xs },
+ });
+}
+
+export function Text({
+ variant,
+ align,
+ color,
+ weight,
+ italic,
+ decoration,
+ transform,
+ noMargin,
+ children,
+ style,
+}: TextProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createTextStyles(theme), [theme]);
+ const weightMap = {
+ bold: styles.weightBold,
+ medium: styles.weightMedium,
+ normal: styles.weightNormal,
+ semibold: styles.weightSemibold,
+ };
+ const decorationMap = {
+ "line-through": styles.lineThrough,
+ none: styles.decorationNone,
+ underline: styles.underline,
+ };
+ const transformMap = {
+ capitalize: styles.capitalize,
+ lowercase: styles.lowercase,
+ uppercase: styles.uppercase,
+ };
+ const styleArray: Style[] = [variant ? styles[variant] : styles.text];
+ if (weight && weight in weightMap) {
+ styleArray.push(weightMap[weight]);
+ }
+ if (italic) {
+ styleArray.push(styles.italic);
+ }
+ if (decoration && decoration in decorationMap) {
+ styleArray.push(decorationMap[decoration]);
+ }
+ if (transform && transform in transformMap) {
+ styleArray.push(transformMap[transform]);
+ }
+ if (noMargin) {
+ styleArray.push(styles.noMargin);
+ }
+ const semantic = {} as Style;
+ if (align) {
+ semantic.textAlign = align;
+ }
+ if (color) {
+ semantic.color = resolveColor(color, theme.colors);
+ }
+ if (Object.keys(semantic).length > 0) {
+ styleArray.push(semantic);
+ }
+ if (style) {
+ styleArray.push(...[style].flat());
+ }
+ return <PDFText style={styleArray as never}>{children}</PDFText>;
+}
diff --git a/registry/bases/forme/components/watermark/index.ts b/registry/bases/forme/components/watermark/index.ts
new file mode 100644
index 0000000..f30a740
--- /dev/null
+++ b/registry/bases/forme/components/watermark/index.ts
@@ -0,0 +1,5 @@
+export {
+ PdfWatermark,
+ type PdfWatermarkProps,
+ type WatermarkPosition,
+} from "./watermark";
diff --git a/registry/bases/forme/components/watermark/watermark.tsx b/registry/bases/forme/components/watermark/watermark.tsx
new file mode 100644
index 0000000..04a36d1
--- /dev/null
+++ b/registry/bases/forme/components/watermark/watermark.tsx
@@ -0,0 +1,122 @@
+import { Text as PDFText, StyleSheet, View } from "@formepdf/react";
+import type { Style } from "@formepdf/react";
+
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { resolveColor } from "../../lib/resolve-color";
+
+export type WatermarkPosition =
+ | "center"
+ | "top-left"
+ | "top-right"
+ | "bottom-left"
+ | "bottom-right";
+
+/**
+ * Diagonal watermark overlaid across the full page using absolute positioning.
+ * Props - `text` | `opacity` | `fontSize` | `color` | `angle` | `position` | `fixed` | `style`
+ * @see {@link PdfWatermarkProps}
+ */
+export interface PdfWatermarkProps extends Omit<PDFComponentProps, "children"> {
+ text: string;
+ opacity?: number;
+ fontSize?: number;
+ color?: string;
+ angle?: number;
+ position?: WatermarkPosition;
+ /**
+ * @default true
+ */
+ fixed?: boolean;
+ children?: never;
+}
+
+function createWatermarkStyles(t: PdfcnTheme) {
+ const { fontWeights } = t.primitives;
+ // Use page margins as corner insets so watermark position adapts to the active theme.
+ const { marginTop, marginBottom, marginLeft, marginRight } = t.spacing.page;
+ return StyleSheet.create({
+ container: {
+ alignItems: "center",
+ bottom: 0,
+ justifyContent: "center",
+ left: 0,
+ pointerEvents: "none",
+ position: "absolute",
+ right: 0,
+ top: 0,
+ zIndex: -1,
+ },
+ positionBottomLeft: {
+ alignItems: "flex-start",
+ justifyContent: "flex-end",
+ paddingBottom: marginBottom,
+ paddingLeft: marginLeft,
+ },
+ positionBottomRight: {
+ alignItems: "flex-end",
+ justifyContent: "flex-end",
+ paddingBottom: marginBottom,
+ paddingRight: marginRight,
+ },
+ positionCenter: { alignItems: "center", justifyContent: "center" },
+ positionTopLeft: {
+ alignItems: "flex-start",
+ justifyContent: "flex-start",
+ paddingLeft: marginLeft,
+ paddingTop: marginTop,
+ },
+ positionTopRight: {
+ alignItems: "flex-end",
+ justifyContent: "flex-start",
+ paddingRight: marginRight,
+ paddingTop: marginTop,
+ },
+ text: {
+ fontFamily: t.typography.heading.fontFamily,
+ fontWeight: fontWeights.bold,
+ letterSpacing: 4,
+ textTransform: "uppercase",
+ },
+ });
+}
+
+export function PdfWatermark({
+ text,
+ opacity = 0.15,
+ fontSize = 60,
+ color = "mutedForeground",
+ angle = -45,
+ position = "center",
+ fixed = true,
+ style,
+}: PdfWatermarkProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createWatermarkStyles(theme), [theme]);
+ const positionMap: Record<WatermarkPosition, Style> = {
+ "bottom-left": styles.positionBottomLeft,
+ "bottom-right": styles.positionBottomRight,
+ center: styles.positionCenter,
+ "top-left": styles.positionTopLeft,
+ "top-right": styles.positionTopRight,
+ };
+ const containerStyles: Style[] = [styles.container, positionMap[position]];
+ if (style) {
+ containerStyles.push(...[style].flat());
+ }
+ const textStyles: Style[] = [
+ styles.text,
+ {
+ color: resolveColor(color, theme.colors),
+ fontSize,
+ opacity,
+ transform: `rotate(${angle}deg)`,
+ },
+ ];
+ return (
+ <View style={containerStyles as never}>
+ <PDFText style={textStyles as never}>{text}</PDFText>
+ </View>
+ );
+}
diff --git a/registry/bases/forme/lib/forme-svg.tsx b/registry/bases/forme/lib/forme-svg.tsx
new file mode 100644
index 0000000..8fc32a1
--- /dev/null
+++ b/registry/bases/forme/lib/forme-svg.tsx
@@ -0,0 +1,36 @@
+import { Svg as FormeSvg } from "@formepdf/react";
+import { createElement } from "react";
+import type { ReactNode, CSSProperties } from "react";
+
+type AnyProps = Record<string, unknown> & {
+ children?: ReactNode;
+ style?: CSSProperties;
+};
+
+export function Svg({
+ children,
+ width,
+ height,
+ viewBox,
+ style,
+ ...rest
+}: AnyProps & { width?: number; height?: number; viewBox?: string }) {
+ return (
+ <FormeSvg
+ width={width as number}
+ height={height as number}
+ viewBox={viewBox as string | undefined}
+ style={style as never}
+ {...rest}
+ >
+ {children}
+ </FormeSvg>
+ );
+}
+
+export const Circle = (props: AnyProps) => createElement("circle", props);
+export const Rect = (props: AnyProps) => createElement("rect", props);
+export const G = (props: AnyProps) => createElement("g", props);
+export const Line = (props: AnyProps) => createElement("line", props);
+export const Path = (props: AnyProps) => createElement("path", props);
+export const SvgText = (props: AnyProps) => createElement("text", props);
diff --git a/registry/bases/forme/lib/maybe-fixed.tsx b/registry/bases/forme/lib/maybe-fixed.tsx
new file mode 100644
index 0000000..ac22c37
--- /dev/null
+++ b/registry/bases/forme/lib/maybe-fixed.tsx
@@ -0,0 +1,27 @@
+import { Fixed, View } from "@formepdf/react";
+import type { Style } from "@formepdf/react";
+import type { ReactNode } from "react";
+
+export function MaybeFixed({
+ fixed,
+ position,
+ wrap,
+ style,
+ children,
+}: {
+ fixed?: boolean;
+ position: "header" | "footer";
+ wrap?: boolean;
+ style?: Style | Style[];
+ children?: ReactNode;
+}) {
+ const view = (
+ <View wrap={wrap} style={style as never}>
+ {children}
+ </View>
+ );
+ if (!fixed) {
+ return view;
+ }
+ return <Fixed position={position}>{view}</Fixed>;
+}
diff --git a/registry/bases/forme/lib/pdfcn-theme-context.tsx b/registry/bases/forme/lib/pdfcn-theme-context.tsx
new file mode 100644
index 0000000..1f7885d
--- /dev/null
+++ b/registry/bases/forme/lib/pdfcn-theme-context.tsx
@@ -0,0 +1,90 @@
+/* eslint-disable react-refresh/only-export-components */
+// Exports both a component (PdfcnThemeProvider) and hooks/context intentionally.
+// All PDF components import from a single file — splitting would break the public API.
+
+import * as React from "react";
+import { createContext, useContext, useMemo } from "react";
+import type { DependencyList, ReactNode } from "react";
+
+import { theme as defaultTheme } from "./pdfcn-theme";
+
+export type PdfcnTheme = typeof defaultTheme;
+
+export const PdfcnThemeContext = createContext<PdfcnTheme>(defaultTheme);
+
+export interface PdfcnThemeProviderProps {
+ theme?: PdfcnTheme;
+ children: ReactNode;
+}
+
+/**
+ * Detect whether React currently has an active dispatcher.
+ * When components are invoked as plain functions in tests, dispatcher is null.
+ */
+function hasActiveDispatcher(): boolean {
+ const maybeInternals = React as unknown as {
+ __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE?: {
+ H?: unknown;
+ };
+ };
+
+ const dispatcher =
+ maybeInternals
+ .__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE?.H;
+ return dispatcher != null;
+}
+
+export function PdfcnThemeProvider({
+ theme,
+ children,
+}: PdfcnThemeProviderProps) {
+ const resolvedTheme = useMemo(() => theme ?? defaultTheme, [theme]);
+ return (
+ <PdfcnThemeContext.Provider value={resolvedTheme}>
+ {children}
+ </PdfcnThemeContext.Provider>
+ );
+}
+
+/**
+ * Regex patterns that indicate a hook was called outside a valid React render tree.
+ * These errors are caught and suppressed so components fall back to safe defaults.
+ */
+const HOOK_ERROR_PATTERNS =
+ /invalid hook call|useContext|useMemo|cannot read properties of null|dispatcher|renderWithHooks|resolveDispatcher|hooks can only be called|rendered fewer hooks/i;
+
+/**
+ * Calls a React hook with a graceful fallback for non-render environments (e.g. unit tests).
+ * Uses hasActiveDispatcher() as the primary guard; the try/catch is a safety net for edge
+ * cases where the dispatcher check passes but the hook still cannot execute.
+ */
+function callHook<T>(hook: () => T, fallback: T): T {
+ if (!hasActiveDispatcher()) {
+ return fallback;
+ }
+ try {
+ return hook();
+ } catch (error) {
+ if (error instanceof Error && HOOK_ERROR_PATTERNS.test(error.message)) {
+ return fallback;
+ }
+ throw error;
+ }
+}
+
+/**
+ * Returns the active PdfcnTheme from context, or the default theme when called
+ * outside a React render tree (e.g. unit tests).
+ */
+export function usePdfcnTheme(): PdfcnTheme {
+ return callHook(() => useContext(PdfcnThemeContext), defaultTheme);
+}
+
+/**
+ * Calls factory() and returns the result.
+ * The deps parameter is accepted for API compatibility with existing callers.
+ */
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
+export function useSafeMemo<T>(factory: () => T, _deps: DependencyList): T {
+ return factory();
+}
diff --git a/registry/bases/forme/lib/pdfcn-theme.ts b/registry/bases/forme/lib/pdfcn-theme.ts
new file mode 100644
index 0000000..6e9f81d
--- /dev/null
+++ b/registry/bases/forme/lib/pdfcn-theme.ts
@@ -0,0 +1,3 @@
+import { professionalTheme } from "@/registry/themes";
+
+export const theme = professionalTheme;
diff --git a/registry/bases/forme/lib/resolve-color.ts b/registry/bases/forme/lib/resolve-color.ts
new file mode 100644
index 0000000..0d8029b
--- /dev/null
+++ b/registry/bases/forme/lib/resolve-color.ts
@@ -0,0 +1,23 @@
+import type { ColorTokens } from "@/registry/themes";
+
+/** Theme color token keys that can be used for the color prop */
+export const THEME_COLOR_KEYS = [
+ "foreground",
+ "background",
+ "muted",
+ "mutedForeground",
+ "primary",
+ "primaryForeground",
+ "border",
+ "accent",
+ "destructive",
+ "success",
+ "warning",
+ "info",
+] as const satisfies (keyof ColorTokens)[];
+
+/** Resolves a color value: theme token key → hex, or raw CSS color as-is. */
+export function resolveColor(value: string, colors: ColorTokens): string {
+ const key = value as (typeof THEME_COLOR_KEYS)[number];
+ return THEME_COLOR_KEYS.includes(key) ? colors[key] : value;
+}
diff --git a/registry/bases/forme/registry.ts b/registry/bases/forme/registry.ts
new file mode 100644
index 0000000..cbe15d5
--- /dev/null
+++ b/registry/bases/forme/registry.ts
@@ -0,0 +1,6 @@
+export const formeRegistryBase = {
+ examplesDir: "examples/forme",
+ name: "forme",
+ publicRegistryDir: null,
+ sourceDir: "registry/bases/forme",
+} as const;
diff --git a/registry/bases/takumi/blocks/invoice-classic/invoice-classic.tsx b/registry/bases/takumi/blocks/invoice-classic/invoice-classic.tsx
new file mode 100644
index 0000000..f8c2133
--- /dev/null
+++ b/registry/bases/takumi/blocks/invoice-classic/invoice-classic.tsx
@@ -0,0 +1,205 @@
+import type { PdfcnTheme } from "@/registry/themes";
+
+import {
+ KeyValue,
+ PageFooter,
+ PageHeader,
+ PdfImage,
+ PdfcnThemeProvider,
+ Section,
+ Table,
+ TableBody,
+ TableCell,
+ TableHeader,
+ TableRow,
+ Text,
+ usePdfcnTheme,
+} from "../../components";
+import { View, StyleSheet, Document, Page } from "../../lib/takumi-primitives";
+import type { InvoiceClassicData } from "./invoice-classic.types";
+
+// Sample data — replace with your own props or data source
+const sampleData: InvoiceClassicData = {
+ billTo: {
+ address: "456 Client Ave, Suite 2",
+ email: "[email protected]",
+ name: "Client Corp.",
+ phone: "+1 (555) 123-4567",
+ },
+ companyAddress: "City, Country",
+ companyEmail: "[email protected]",
+ companyName: "Your Company",
+ dueDate: "March 17, 2026",
+ invoiceDate: "February 17, 2026",
+ invoiceNumber: "INV-2026-001",
+ items: [
+ { description: "Web Development", quantity: 1, unitPrice: 12_500 },
+ { description: "UI/UX Design", quantity: 1, unitPrice: 8750 },
+ { description: "Consulting", quantity: 10, unitPrice: 1500 },
+ ],
+ logo: "/favicon.png",
+ notes: "Thank you for your business!",
+ paymentTerms: {
+ dueDate: "March 17, 2026",
+ gst: "GSTIN 123456789",
+ method: "UPI / Card / Bank Transfer",
+ },
+ subtitle: "Professional Services",
+ summary: {
+ subtotal: 36_250,
+ tax: 2537.5,
+ total: 38_787.5,
+ },
+};
+
+export function InvoiceClassicDocument({
+ theme,
+ data = sampleData,
+}: {
+ theme?: PdfcnTheme;
+ data?: InvoiceClassicData;
+}) {
+ return (
+ <PdfcnThemeProvider theme={theme}>
+ <InvoiceClassicContent data={data} />
+ </PdfcnThemeProvider>
+ );
+}
+
+function InvoiceClassicContent({ data }: { data: InvoiceClassicData }) {
+ const theme = usePdfcnTheme();
+
+ const styles = StyleSheet.create({
+ page: {
+ backgroundColor: theme.colors.background,
+ padding: theme.spacing.page.marginTop,
+ paddingBottom: theme.spacing.page.marginBottom,
+ },
+ });
+
+ return (
+ <Document title={`Invoice ${data.invoiceNumber}`}>
+ <Page size="A4" style={styles.page}>
+ <PageHeader
+ variant="logo-left"
+ logo={
+ <PdfImage src={data.logo ?? "/favicon.png"} style={{ margin: 0 }} />
+ }
+ title={data.companyName}
+ subtitle={data.subtitle}
+ rightText={data.invoiceNumber}
+ rightSubText={`Due: ${data.dueDate}`}
+ style={{ marginBottom: 0 }}
+ />
+ <Section noWrap style={{ flexDirection: "row" }}>
+ <View style={{ flex: 1, paddingRight: 15 }}>
+ <Text
+ style={{ fontSize: 9, fontWeight: "bold", marginBottom: 2 }}
+ color="mutedForeground"
+ transform="uppercase"
+ noMargin
+ >
+ From
+ </Text>
+ <Text noMargin variant="xs">
+ {data.companyName}
+ </Text>
+ <Text noMargin variant="xs">
+ {data.companyAddress}
+ </Text>
+ <Text noMargin variant="xs">
+ {data.companyEmail}
+ </Text>
+ </View>
+ <View style={{ flex: 1, paddingRight: 15 }}>
+ <Text
+ style={{ fontSize: 9, fontWeight: "bold", marginBottom: 2 }}
+ color="mutedForeground"
+ transform="uppercase"
+ noMargin
+ >
+ Bill To
+ </Text>
+ <Text noMargin variant="xs">
+ {data.billTo.name}
+ </Text>
+ <Text noMargin variant="xs">
+ {data.billTo.address}
+ </Text>
+ <Text noMargin variant="xs">
+ {data.billTo.email}
+ </Text>
+ </View>
+ <View style={{ flex: 1, paddingRight: 15 }}>
+ <Text
+ style={{ fontSize: 9, fontWeight: "bold", marginBottom: 2 }}
+ color="mutedForeground"
+ transform="uppercase"
+ noMargin
+ >
+ Payment Terms
+ </Text>
+ <Text noMargin variant="xs">
+ {data.paymentTerms.method}
+ </Text>
+ <Text noMargin variant="xs">
+ {data.paymentTerms.gst}
+ </Text>
+ <Text noMargin variant="xs">
+ {data.paymentTerms.dueDate}
+ </Text>
+ </View>
+ </Section>
+ <Table variant="grid" zebraStripe>
+ <TableHeader>
+ <TableRow header>
+ <TableCell>Description</TableCell>
+ <TableCell align="center">QTY</TableCell>
+ <TableCell align="center">Rate</TableCell>
+ <TableCell align="right">Total</TableCell>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {data.items.map((item, index) => (
+ // biome-ignore lint/suspicious/noArrayIndexKey: invoice items have no stable id
+ <TableRow key={index}>
+ <TableCell>{item.description}</TableCell>
+ <TableCell align="center">{`${item.quantity}`}</TableCell>
+ <TableCell align="center">{`$${item.unitPrice}`}</TableCell>
+ <TableCell align="right">{`$${(item.quantity * item.unitPrice).toFixed(2)}`}</TableCell>
+ </TableRow>
+ ))}
+ </TableBody>
+ </Table>
+ <Section noWrap style={{ flexDirection: "row", marginTop: 16 }}>
+ <View style={{ marginLeft: "auto", width: 220 }}>
+ <KeyValue
+ size="sm"
+ dividerThickness={1}
+ items={[
+ {
+ key: "Subtotal",
+ value: `$${data.summary.subtotal.toFixed(2)}`,
+ },
+ { key: "Tax", value: `$${data.summary.tax.toFixed(2)}` },
+ {
+ key: "Total",
+ keyStyle: { fontSize: 12, fontWeight: "bold" },
+ value: `$${data.summary.total.toFixed(2)}`,
+ valueStyle: { fontSize: 12, fontWeight: "bold" },
+ },
+ ]}
+ divided
+ />
+ </View>
+ </Section>
+ <PageFooter
+ leftText={data.notes}
+ rightText="Page 1 of 1"
+ sticky
+ pagePadding={25}
+ />
+ </Page>
+ </Document>
+ );
+}
diff --git a/registry/bases/takumi/blocks/invoice-classic/invoice-classic.types.ts b/registry/bases/takumi/blocks/invoice-classic/invoice-classic.types.ts
new file mode 100644
index 0000000..64ce56e
--- /dev/null
+++ b/registry/bases/takumi/blocks/invoice-classic/invoice-classic.types.ts
@@ -0,0 +1,32 @@
+export interface InvoiceClassicData {
+ invoiceNumber: string;
+ invoiceDate: string;
+ dueDate: string;
+ companyName: string;
+ subtitle: string;
+ companyAddress: string;
+ companyEmail: string;
+ logo?: string;
+ billTo: {
+ name: string;
+ address: string;
+ email: string;
+ phone: string;
+ };
+ items: {
+ description: string;
+ quantity: number;
+ unitPrice: number;
+ }[];
+ summary: {
+ subtotal: number;
+ tax: number;
+ total: number;
+ };
+ paymentTerms: {
+ dueDate: string;
+ method: string;
+ gst: string;
+ };
+ notes?: string;
+}
diff --git a/registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.tsx b/registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.tsx
new file mode 100644
index 0000000..1acd73c
--- /dev/null
+++ b/registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.tsx
@@ -0,0 +1,320 @@
+import type { PdfcnTheme } from "@/registry/themes";
+
+import {
+ KeyValue,
+ PageFooter,
+ PdfcnThemeProvider,
+ Section,
+ Table,
+ TableBody,
+ TableCell,
+ TableHeader,
+ TableRow,
+ Text,
+ usePdfcnTheme,
+} from "../../components";
+import { View, StyleSheet, Document, Page } from "../../lib/takumi-primitives";
+import type { InvoiceConsultantData } from "./invoice-consultant.types";
+
+const sampleData: InvoiceConsultantData = {
+ client: {
+ address: "500 Tech Park, Suite 200",
+ company: "Acme Technologies",
+ email: "[email protected]",
+ name: "Sarah Johnson",
+ },
+ companyAddress: "City, Country · [email protected]",
+ companyName: "Your Consulting",
+ consultant: {
+ email: "[email protected]",
+ name: "John Smith",
+ title: "Senior Technical Consultant",
+ },
+ dueDate: "March 28, 2026",
+ invoiceDate: "February 26, 2026",
+ invoiceNumber: "INV-2026-006",
+ notes:
+ "Services rendered for February 2026. All hours verified and approved by client.",
+ paymentTerms: {
+ dueDate: "March 28, 2026",
+ method: "Bank Transfer / Check",
+ },
+ projectRef: "PROJ-2026-ACME-001",
+ services: [
+ { description: "Architecture Review & Planning", hours: 16, rate: 175 },
+ { description: "Code Review & Optimization", hours: 24, rate: 150 },
+ { description: "Technical Documentation", hours: 12, rate: 125 },
+ { description: "Team Training & Knowledge Transfer", hours: 8, rate: 200 },
+ ],
+ subtitle: "Professional Consulting Services",
+ summary: {
+ subtotal: 10_300,
+ tax: 515,
+ total: 10_815,
+ totalHours: 60,
+ },
+};
+
+export function InvoiceConsultantDocument({
+ theme,
+ data = sampleData,
+}: {
+ theme?: PdfcnTheme;
+ data?: InvoiceConsultantData;
+}) {
+ return (
+ <PdfcnThemeProvider theme={theme}>
+ <InvoiceConsultantContent data={data} />
+ </PdfcnThemeProvider>
+ );
+}
+
+function InvoiceConsultantContent({ data }: { data: InvoiceConsultantData }) {
+ const theme = usePdfcnTheme();
+
+ const styles = StyleSheet.create({
+ calloutNote: {
+ backgroundColor: theme.colors.muted,
+ borderLeftColor: theme.colors.info,
+ borderLeftStyle: "solid",
+ borderLeftWidth: 3,
+ marginTop: 16,
+ paddingLeft: 12,
+ paddingVertical: 8,
+ },
+ companyInfo: {
+ flex: 1,
+ },
+ headerRow: {
+ alignItems: "flex-start",
+ borderBottomColor: theme.colors.primary,
+ borderBottomStyle: "solid",
+ borderBottomWidth: 2,
+ flexDirection: "row",
+ justifyContent: "space-between",
+ marginBottom: theme.spacing.sectionGap,
+ paddingBottom: theme.spacing.componentGap,
+ },
+ hoursBadge: {
+ alignSelf: "flex-start",
+ backgroundColor: theme.colors.primary,
+ borderRadius: theme.primitives.borderRadius.sm,
+ color: theme.colors.primaryForeground,
+ paddingHorizontal: 12,
+ paddingVertical: 8,
+ },
+ hoursBox: {
+ flex: 1,
+ paddingRight: 24,
+ },
+ invoiceInfo: {
+ alignItems: "flex-end",
+ },
+ page: {
+ backgroundColor: theme.colors.background,
+ padding: theme.spacing.page.marginTop,
+ paddingBottom: theme.spacing.page.marginBottom,
+ },
+ partiesRow: {
+ flexDirection: "row",
+ gap: 40,
+ marginBottom: theme.spacing.sectionGap,
+ },
+ partyColumn: {
+ flex: 1,
+ },
+ partyLabel: {
+ borderBottomColor: theme.colors.border,
+ borderBottomStyle: "solid",
+ borderBottomWidth: 1,
+ color: theme.colors.primary,
+ fontSize: 9,
+ fontWeight: "bold",
+ letterSpacing: 0.6,
+ marginBottom: 6,
+ paddingBottom: 4,
+ textTransform: "uppercase",
+ },
+ projectRef: {
+ alignItems: "center",
+ backgroundColor: theme.colors.muted,
+ borderRadius: theme.primitives.borderRadius.sm,
+ flexDirection: "row",
+ gap: 8,
+ marginBottom: theme.spacing.sectionGap,
+ paddingHorizontal: 10,
+ paddingVertical: 6,
+ },
+ summaryRow: {
+ flexDirection: "row",
+ marginTop: 20,
+ },
+ totalsBox: {
+ width: 250,
+ },
+ });
+
+ return (
+ <Document title={`Invoice ${data.invoiceNumber}`}>
+ <Page size="A4" style={styles.page}>
+ <View style={styles.headerRow}>
+ <View style={styles.companyInfo}>
+ <Text variant="xl" weight="bold" noMargin>
+ {data.companyName}
+ </Text>
+ <Text variant="sm" color="mutedForeground" noMargin>
+ {data.subtitle}
+ </Text>
+ <Text variant="xs" color="mutedForeground" noMargin>
+ {data.companyAddress}
+ </Text>
+ </View>
+ <View style={styles.invoiceInfo}>
+ <Text
+ variant="xs"
+ color="mutedForeground"
+ transform="uppercase"
+ noMargin
+ >
+ Invoice
+ </Text>
+ <Text variant="lg" weight="bold" noMargin>
+ {data.invoiceNumber}
+ </Text>
+ <Text variant="xs" color="mutedForeground" noMargin>
+ {data.invoiceDate}
+ </Text>
+ <Text variant="xs" color="mutedForeground" noMargin>
+ Due: {data.dueDate}
+ </Text>
+ </View>
+ </View>
+ {data.projectRef && (
+ <View style={styles.projectRef}>
+ <Text
+ variant="xs"
+ weight="semibold"
+ color="mutedForeground"
+ noMargin
+ >
+ Project Reference:
+ </Text>
+ <Text variant="xs" weight="bold" noMargin>
+ {data.projectRef}
+ </Text>
+ </View>
+ )}
+ <View style={styles.partiesRow}>
+ <View style={styles.partyColumn}>
+ <Text style={styles.partyLabel} noMargin>
+ From (Consultant)
+ </Text>
+ <Text variant="sm" weight="semibold" noMargin>
+ {data.consultant.name}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.consultant.title}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.consultant.email}
+ </Text>
+ </View>
+ <View style={styles.partyColumn}>
+ <Text style={styles.partyLabel} noMargin>
+ Bill To (Client)
+ </Text>
+ <Text variant="sm" weight="semibold" noMargin>
+ {data.client.name}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.client.company}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.client.address}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.client.email}
+ </Text>
+ </View>
+ </View>
+ <Table variant="line">
+ <TableHeader>
+ <TableRow header>
+ <TableCell>Service Description</TableCell>
+ <TableCell align="center">Hours</TableCell>
+ <TableCell align="right">Rate ($/hr)</TableCell>
+ <TableCell align="right">Amount</TableCell>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {data.services.map((service, index) => (
+ // biome-ignore lint/suspicious/noArrayIndexKey: static PDF list, no reordering
+ <TableRow key={index}>
+ <TableCell>{service.description}</TableCell>
+ <TableCell align="center">{`${service.hours}`}</TableCell>
+ <TableCell align="right">{`$${service.rate}`}</TableCell>
+ <TableCell align="right">{`$${(service.hours * service.rate).toLocaleString()}`}</TableCell>
+ </TableRow>
+ ))}
+ </TableBody>
+ </Table>
+ <Section noWrap style={styles.summaryRow}>
+ <View style={styles.hoursBox}>
+ <View style={styles.hoursBadge}>
+ <Text
+ style={{
+ color: theme.colors.primaryForeground,
+ fontSize: 9,
+ fontWeight: "bold",
+ }}
+ noMargin
+ >
+ Total Hours: {data.summary.totalHours}
+ </Text>
+ </View>
+ <Text variant="xs" color="mutedForeground" style={{ marginTop: 8 }}>
+ Payment: {data.paymentTerms.method}
+ </Text>
+ </View>
+ <View style={styles.totalsBox}>
+ <KeyValue
+ size="sm"
+ dividerThickness={1}
+ items={[
+ {
+ key: "Subtotal",
+ value: `$${data.summary.subtotal.toLocaleString()}`,
+ },
+ { key: "Tax (5%)", value: `$${data.summary.tax.toFixed(2)}` },
+ {
+ key: "Amount Due",
+ keyStyle: { fontSize: 13, fontWeight: "bold" },
+ value: `$${data.summary.total.toFixed(2)}`,
+ valueStyle: {
+ color: theme.colors.primary,
+ fontSize: 14,
+ fontWeight: "bold",
+ },
+ },
+ ]}
+ divided
+ />
+ </View>
+ </Section>
+ {data.notes && (
+ <View style={styles.calloutNote}>
+ <Text variant="xs" color="mutedForeground">
+ {data.notes}
+ </Text>
+ </View>
+ )}
+ <PageFooter
+ leftText="Professional services invoice – Please retain for records"
+ rightText="Page 1 of 1"
+ sticky
+ pagePadding={25}
+ />
+ </Page>
+ </Document>
+ );
+}
diff --git a/registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.types.ts b/registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.types.ts
new file mode 100644
index 0000000..bfdda36
--- /dev/null
+++ b/registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.types.ts
@@ -0,0 +1,36 @@
+export interface InvoiceConsultantData {
+ invoiceNumber: string;
+ invoiceDate: string;
+ dueDate: string;
+ companyName: string;
+ subtitle: string;
+ companyAddress: string;
+ consultant: {
+ name: string;
+ title: string;
+ email: string;
+ };
+ client: {
+ name: string;
+ company: string;
+ address: string;
+ email: string;
+ };
+ services: {
+ description: string;
+ hours: number;
+ rate: number;
+ }[];
+ summary: {
+ totalHours: number;
+ subtotal: number;
+ tax: number;
+ total: number;
+ };
+ paymentTerms: {
+ dueDate: string;
+ method: string;
+ };
+ projectRef?: string;
+ notes?: string;
+}
diff --git a/registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.tsx b/registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.tsx
new file mode 100644
index 0000000..6fc772e
--- /dev/null
+++ b/registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.tsx
@@ -0,0 +1,218 @@
+import type { PdfcnTheme } from "@/registry/themes";
+
+import {
+ KeyValue,
+ PageFooter,
+ PageHeader,
+ PdfImage,
+ PdfcnThemeProvider,
+ Table,
+ TableBody,
+ TableCell,
+ TableHeader,
+ TableRow,
+ Text,
+ usePdfcnTheme,
+} from "../../components";
+import { View, StyleSheet, Document, Page } from "../../lib/takumi-primitives";
+import type { InvoiceCorporateData } from "./invoice-corporate.types";
+
+const sampleData: InvoiceCorporateData = {
+ billTo: {
+ address: "100 Corporate Plaza, Tower B",
+ email: "[email protected]",
+ name: "Global Industries Ltd.",
+ phone: "+1 (555) 888-9999",
+ },
+ companyAddress: "City, Country",
+ companyEmail: "[email protected]",
+ companyName: "Your Company",
+ dueDate: "March 24, 2026",
+ invoiceDate: "February 22, 2026",
+ invoiceNumber: "INV-2026-004",
+ items: [
+ {
+ description: "Enterprise Software License",
+ quantity: 5,
+ unitPrice: 4500,
+ },
+ { description: "Implementation Services", quantity: 1, unitPrice: 18_000 },
+ { description: "Training Workshop", quantity: 3, unitPrice: 2500 },
+ { description: "Annual Support Package", quantity: 1, unitPrice: 8500 },
+ ],
+ logo: "/favicon.png",
+ notes: "Corporate billing – Net 30 terms apply.",
+ paymentTerms: {
+ dueDate: "March 24, 2026",
+ gst: "GSTIN 987654321",
+ method: "Wire Transfer / Corporate Account",
+ },
+ subtitle: "Professional Services",
+ summary: {
+ subtotal: 57_000,
+ tax: 4560,
+ total: 61_560,
+ },
+};
+
+export function InvoiceCorporateDocument({
+ theme,
+ data = sampleData,
+}: {
+ theme?: PdfcnTheme;
+ data?: InvoiceCorporateData;
+}) {
+ return (
+ <PdfcnThemeProvider theme={theme}>
+ <InvoiceCorporateContent data={data} />
+ </PdfcnThemeProvider>
+ );
+}
+
+function InvoiceCorporateContent({ data }: { data: InvoiceCorporateData }) {
+ const theme = usePdfcnTheme();
+
+ const styles = StyleSheet.create({
+ infoColumn: {
+ flex: 1,
+ },
+ infoGrid: {
+ flexDirection: "row",
+ gap: 24,
+ marginBottom: theme.spacing.sectionGap,
+ },
+ infoLabel: {
+ color: theme.colors.mutedForeground,
+ fontSize: 9,
+ fontWeight: "bold",
+ letterSpacing: 0.6,
+ marginBottom: 6,
+ textTransform: "uppercase",
+ },
+ page: {
+ backgroundColor: theme.colors.background,
+ padding: theme.spacing.page.marginTop,
+ paddingBottom: theme.spacing.page.marginBottom,
+ },
+ summaryCard: {
+ backgroundColor: theme.colors.muted,
+ borderRadius: theme.primitives.borderRadius.md,
+ marginTop: 20,
+ padding: 16,
+ },
+ summaryRow: {
+ flexDirection: "row",
+ justifyContent: "flex-end",
+ },
+ });
+
+ return (
+ <Document title={`Invoice ${data.invoiceNumber}`}>
+ <Page size="A4" style={styles.page}>
+ <PageHeader
+ variant="logo-right"
+ logo={
+ <PdfImage
+ src={data.logo ?? "/favicon.png"}
+ width={56}
+ height={56}
+ style={{ margin: 0 }}
+ />
+ }
+ title={data.companyName}
+ subtitle={`${data.subtitle} · ${data.companyAddress}`}
+ style={{ marginBottom: theme.spacing.sectionGap }}
+ />
+ <View style={styles.infoGrid}>
+ <View style={styles.infoColumn}>
+ <Text style={styles.infoLabel} noMargin>
+ Invoice Details
+ </Text>
+ <KeyValue
+ size="sm"
+ items={[
+ { key: "Invoice #", value: data.invoiceNumber },
+ { key: "Issue Date", value: data.invoiceDate },
+ { key: "Due Date", value: data.dueDate },
+ { key: "Payment", value: data.paymentTerms.method },
+ ]}
+ />
+ </View>
+ <View style={styles.infoColumn}>
+ <Text style={styles.infoLabel} noMargin>
+ Bill To
+ </Text>
+ <Text variant="sm" weight="semibold" noMargin>
+ {data.billTo.name}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.billTo.address}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.billTo.email}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.billTo.phone}
+ </Text>
+ </View>
+ </View>
+ <Table variant="bordered">
+ <TableHeader>
+ <TableRow header>
+ <TableCell>Description</TableCell>
+ <TableCell align="center">Qty</TableCell>
+ <TableCell align="right">Unit Price</TableCell>
+ <TableCell align="right">Amount</TableCell>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {data.items.map((item, index) => (
+ // biome-ignore lint/suspicious/noArrayIndexKey: static PDF list, no reordering
+ <TableRow key={index}>
+ <TableCell>{item.description}</TableCell>
+ <TableCell align="center">{`${item.quantity}`}</TableCell>
+ <TableCell align="right">{`$${item.unitPrice.toLocaleString()}`}</TableCell>
+ <TableCell align="right">{`$${(item.quantity * item.unitPrice).toLocaleString()}`}</TableCell>
+ </TableRow>
+ ))}
+ </TableBody>
+ </Table>
+ <View style={styles.summaryCard}>
+ <View style={styles.summaryRow}>
+ <View style={{ width: 260 }}>
+ <KeyValue
+ size="md"
+ dividerThickness={1}
+ dividerColor="border"
+ items={[
+ {
+ key: "Subtotal",
+ value: `$${data.summary.subtotal.toLocaleString()}`,
+ },
+ { key: "Tax (8%)", value: `$${data.summary.tax.toFixed(2)}` },
+ {
+ key: "Total Due",
+ keyStyle: { fontSize: 13, fontWeight: "bold" },
+ value: `$${data.summary.total.toFixed(2)}`,
+ valueStyle: {
+ color: theme.colors.primary,
+ fontSize: 14,
+ fontWeight: "bold",
+ },
+ },
+ ]}
+ divided
+ />
+ </View>
+ </View>
+ </View>
+ <PageFooter
+ leftText={data.notes}
+ rightText="Page 1 of 1"
+ sticky
+ pagePadding={25}
+ />
+ </Page>
+ </Document>
+ );
+}
diff --git a/registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.types.ts b/registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.types.ts
new file mode 100644
index 0000000..46ee4d1
--- /dev/null
+++ b/registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.types.ts
@@ -0,0 +1,32 @@
+export interface InvoiceCorporateData {
+ invoiceNumber: string;
+ invoiceDate: string;
+ dueDate: string;
+ companyName: string;
+ subtitle: string;
+ companyAddress: string;
+ companyEmail: string;
+ logo?: string;
+ billTo: {
+ name: string;
+ address: string;
+ email: string;
+ phone: string;
+ };
+ items: {
+ description: string;
+ quantity: number;
+ unitPrice: number;
+ }[];
+ summary: {
+ subtotal: number;
+ tax: number;
+ total: number;
+ };
+ paymentTerms: {
+ dueDate: string;
+ method: string;
+ gst: string;
+ };
+ notes?: string;
+}
diff --git a/registry/bases/takumi/blocks/invoice-creative/invoice-creative.tsx b/registry/bases/takumi/blocks/invoice-creative/invoice-creative.tsx
new file mode 100644
index 0000000..4a0524d
--- /dev/null
+++ b/registry/bases/takumi/blocks/invoice-creative/invoice-creative.tsx
@@ -0,0 +1,269 @@
+import type { PdfcnTheme } from "@/registry/themes";
+
+import {
+ KeyValue,
+ PageFooter,
+ PageHeader,
+ PdfcnThemeProvider,
+ Section,
+ Table,
+ TableBody,
+ TableCell,
+ TableHeader,
+ TableRow,
+ Text,
+ usePdfcnTheme,
+} from "../../components";
+import { View, StyleSheet, Document, Page } from "../../lib/takumi-primitives";
+import type { InvoiceCreativeData } from "./invoice-creative.types";
+
+const sampleData: InvoiceCreativeData = {
+ billTo: {
+ address: "250 Design District, Loft 5",
+ email: "[email protected]",
+ name: "Creative Agency Co.",
+ phone: "+1 (555) 321-7654",
+ },
+ companyAddress: "City, Country · [email protected]",
+ companyName: "Your Agency",
+ dueDate: "March 26, 2026",
+ invoiceDate: "February 24, 2026",
+ invoiceNumber: "INV-2026-005",
+ items: [
+ { description: "Brand Identity Design", quantity: 1, unitPrice: 8500 },
+ {
+ description: "Marketing Collateral Package",
+ quantity: 1,
+ unitPrice: 4200,
+ },
+ {
+ description: "Social Media Assets (per set)",
+ quantity: 4,
+ unitPrice: 750,
+ },
+ { description: "Motion Graphics (30s)", quantity: 2, unitPrice: 3500 },
+ ],
+ notes:
+ "Creative work is protected under copyright. Full usage rights transfer upon payment.",
+ paymentTerms: {
+ dueDate: "March 26, 2026",
+ gst: "GSTIN 456789123",
+ method: "Credit Card / PayPal / Stripe",
+ },
+ subtitle: "Creative Services",
+ summary: {
+ subtotal: 22_700,
+ tax: 1475.5,
+ total: 24_175.5,
+ },
+};
+
+export function InvoiceCreativeDocument({
+ theme,
+ data = sampleData,
+}: {
+ theme?: PdfcnTheme;
+ data?: InvoiceCreativeData;
+}) {
+ return (
+ <PdfcnThemeProvider theme={theme}>
+ <InvoiceCreativeContent data={data} />
+ </PdfcnThemeProvider>
+ );
+}
+
+function InvoiceCreativeContent({ data }: { data: InvoiceCreativeData }) {
+ const theme = usePdfcnTheme();
+
+ const styles = StyleSheet.create({
+ accentBlock: {
+ backgroundColor: theme.colors.muted,
+ borderLeftColor: theme.colors.accent,
+ borderLeftStyle: "solid",
+ borderLeftWidth: 4,
+ marginBottom: theme.spacing.sectionGap,
+ paddingLeft: 14,
+ paddingVertical: 10,
+ },
+ badgeLabel: {
+ color: theme.colors.primaryForeground,
+ fontSize: 8,
+ fontWeight: "bold",
+ letterSpacing: 1.2,
+ marginBottom: 2,
+ textTransform: "uppercase",
+ },
+ badgeNumber: {
+ color: theme.colors.primaryForeground,
+ fontSize: 16,
+ fontWeight: "bold",
+ },
+ heroSection: {
+ alignItems: "center",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ marginBottom: theme.spacing.sectionGap,
+ },
+ infoColumn: {
+ flex: 1,
+ },
+ infoGrid: {
+ flexDirection: "row",
+ gap: 32,
+ },
+ invoiceBadge: {
+ alignItems: "center",
+ backgroundColor: theme.colors.primary,
+ borderRadius: theme.primitives.borderRadius.md,
+ paddingHorizontal: 20,
+ paddingVertical: 14,
+ },
+ page: {
+ backgroundColor: theme.colors.background,
+ padding: theme.spacing.page.marginTop,
+ paddingBottom: theme.spacing.page.marginBottom,
+ },
+ sectionLabel: {
+ color: theme.colors.accent,
+ fontSize: 8,
+ fontWeight: "bold",
+ letterSpacing: 0.8,
+ marginBottom: 6,
+ textTransform: "uppercase",
+ },
+ summaryLeft: {
+ flex: 1,
+ paddingRight: 20,
+ },
+ summaryRight: {
+ backgroundColor: theme.colors.muted,
+ borderRadius: theme.primitives.borderRadius.sm,
+ padding: 14,
+ width: 240,
+ },
+ summarySection: {
+ flexDirection: "row",
+ marginTop: 24,
+ },
+ });
+
+ return (
+ <Document title={`Invoice ${data.invoiceNumber}`}>
+ <Page size="A4" style={styles.page}>
+ <View style={styles.heroSection}>
+ <View style={{ flex: 1 }}>
+ <PageHeader
+ variant="centered"
+ title={data.companyName}
+ subtitle={`${data.subtitle} · ${data.companyAddress}`}
+ marginBottom={0}
+ />
+ </View>
+ <View style={styles.invoiceBadge}>
+ <Text style={styles.badgeLabel} noMargin>
+ Invoice
+ </Text>
+ <Text style={styles.badgeNumber} noMargin>
+ {data.invoiceNumber}
+ </Text>
+ </View>
+ </View>
+ <View style={styles.accentBlock}>
+ <View style={styles.infoGrid}>
+ <View style={styles.infoColumn}>
+ <Text style={styles.sectionLabel} noMargin>
+ Billed To
+ </Text>
+ <Text variant="sm" weight="semibold" noMargin>
+ {data.billTo.name}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.billTo.address}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.billTo.email} · {data.billTo.phone}
+ </Text>
+ </View>
+ <View style={styles.infoColumn}>
+ <Text style={styles.sectionLabel} noMargin>
+ Invoice Info
+ </Text>
+ <KeyValue
+ size="sm"
+ items={[
+ { key: "Issue Date", value: data.invoiceDate },
+ { key: "Due Date", value: data.dueDate },
+ { key: "Payment", value: data.paymentTerms.method },
+ ]}
+ />
+ </View>
+ </View>
+ </View>
+ <Table variant="striped" zebraStripe>
+ <TableHeader>
+ <TableRow header>
+ <TableCell>Deliverable</TableCell>
+ <TableCell align="center">Qty</TableCell>
+ <TableCell align="right">Rate</TableCell>
+ <TableCell align="right">Amount</TableCell>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {data.items.map((item, index) => (
+ // biome-ignore lint/suspicious/noArrayIndexKey: static PDF list, no reordering
+ <TableRow key={index}>
+ <TableCell>{item.description}</TableCell>
+ <TableCell align="center">{`${item.quantity}`}</TableCell>
+ <TableCell align="right">{`$${item.unitPrice.toLocaleString()}`}</TableCell>
+ <TableCell align="right">{`$${(item.quantity * item.unitPrice).toLocaleString()}`}</TableCell>
+ </TableRow>
+ ))}
+ </TableBody>
+ </Table>
+ <Section noWrap style={styles.summarySection}>
+ <View style={styles.summaryLeft}>
+ <Text style={styles.sectionLabel} noMargin>
+ Notes & Terms
+ </Text>
+ <Text variant="xs" color="mutedForeground">
+ {data.notes}
+ </Text>
+ <Text variant="xs" color="mutedForeground" style={{ marginTop: 4 }}>
+ GST: {data.paymentTerms.gst}
+ </Text>
+ </View>
+ <View style={styles.summaryRight}>
+ <KeyValue
+ size="sm"
+ dividerThickness={1}
+ items={[
+ {
+ key: "Subtotal",
+ value: `$${data.summary.subtotal.toLocaleString()}`,
+ },
+ { key: "Tax (6.5%)", value: `$${data.summary.tax.toFixed(2)}` },
+ {
+ key: "Total",
+ keyStyle: { fontSize: 13, fontWeight: "bold" },
+ value: `$${data.summary.total.toFixed(2)}`,
+ valueStyle: {
+ color: theme.colors.accent,
+ fontSize: 14,
+ fontWeight: "bold",
+ },
+ },
+ ]}
+ divided
+ />
+ </View>
+ </Section>
+ <PageFooter
+ variant="centered"
+ centerText="Thank you for choosing us for your creative needs!"
+ sticky
+ pagePadding={25}
+ />
+ </Page>
+ </Document>
+ );
+}
diff --git a/registry/bases/takumi/blocks/invoice-creative/invoice-creative.types.ts b/registry/bases/takumi/blocks/invoice-creative/invoice-creative.types.ts
new file mode 100644
index 0000000..58345d6
--- /dev/null
+++ b/registry/bases/takumi/blocks/invoice-creative/invoice-creative.types.ts
@@ -0,0 +1,30 @@
+export interface InvoiceCreativeData {
+ invoiceNumber: string;
+ invoiceDate: string;
+ dueDate: string;
+ companyName: string;
+ subtitle: string;
+ companyAddress: string;
+ billTo: {
+ name: string;
+ address: string;
+ email: string;
+ phone: string;
+ };
+ items: {
+ description: string;
+ quantity: number;
+ unitPrice: number;
+ }[];
+ summary: {
+ subtotal: number;
+ tax: number;
+ total: number;
+ };
+ paymentTerms: {
+ dueDate: string;
+ method: string;
+ gst: string;
+ };
+ notes?: string;
+}
diff --git a/registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.tsx b/registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.tsx
new file mode 100644
index 0000000..dfb7ff9
--- /dev/null
+++ b/registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.tsx
@@ -0,0 +1,244 @@
+import type { PdfcnTheme } from "@/registry/themes";
+
+import {
+ KeyValue,
+ PageFooter,
+ PageHeader,
+ PdfcnThemeProvider,
+ Section,
+ Table,
+ TableBody,
+ TableCell,
+ TableHeader,
+ TableRow,
+ Text,
+ usePdfcnTheme,
+} from "../../components";
+import { View, StyleSheet, Document, Page } from "../../lib/takumi-primitives";
+import type { InvoiceMinimalData } from "./invoice-minimal.types";
+
+// Sample data — replace with your own props or data source
+const sampleData: InvoiceMinimalData = {
+ billTo: {
+ address: "500 Enterprise Way, Building A",
+ email: "[email protected]",
+ name: "Enterprise Corp",
+ phone: "+1 (555) 246-8135",
+ },
+ companyAddress: "City, Country",
+ companyEmail: "[email protected]",
+ companyName: "Your Company",
+ dueDate: "March 22, 2026",
+ invoiceDate: "February 20, 2026",
+ invoiceNumber: "INV-2026-003",
+ items: [
+ { description: "Annual Licenselan", quantity: 1, unitPrice: 25_000 },
+ { description: "Support & Maintenance", quantity: 12, unitPrice: 1500 },
+ { description: "Custom Integration", quantity: 1, unitPrice: 12_000 },
+ ],
+ notes:
+ "Invoice for annual enterprise subscription. Please retain for your records.",
+ paymentTerms: {
+ dueDate: "March 22, 2026",
+ gst: "GSTIN 123456789",
+ method: "ACH Transfer / Check",
+ },
+ subtitle: "Professional Services",
+ summary: {
+ subtotal: 55_000,
+ tax: 3850,
+ total: 58_850,
+ },
+};
+
+export function InvoiceMinimalDocument({
+ theme,
+ data = sampleData,
+}: {
+ theme?: PdfcnTheme;
+ data?: InvoiceMinimalData;
+}) {
+ return (
+ <PdfcnThemeProvider theme={theme}>
+ <InvoiceMinimalContent data={data} />
+ </PdfcnThemeProvider>
+ );
+}
+
+function InvoiceMinimalContent({ data }: { data: InvoiceMinimalData }) {
+ const theme = usePdfcnTheme();
+
+ const styles = StyleSheet.create({
+ infoLabel: {
+ color: theme.colors.primary,
+ fontSize: 8,
+ fontWeight: "bold",
+ letterSpacing: 0.8,
+ marginBottom: 4,
+ textTransform: "uppercase",
+ },
+ infoRow: {
+ flexDirection: "row",
+ marginBottom: theme.spacing.sectionGap,
+ },
+ invoiceStamp: {
+ alignSelf: "flex-start",
+ borderColor: theme.colors.primary,
+ borderRadius: theme.primitives.borderRadius.sm,
+ borderStyle: "solid",
+ borderWidth: 2,
+ paddingHorizontal: 12,
+ paddingVertical: 8,
+ },
+ page: {
+ backgroundColor: theme.colors.background,
+ padding: theme.spacing.page.marginTop,
+ paddingBottom: theme.spacing.page.marginBottom,
+ },
+ });
+
+ return (
+ <Document title={`Invoice ${data.invoiceNumber}`}>
+ <Page size="A4" style={styles.page}>
+ <Section
+ noWrap
+ style={{
+ alignItems: "flex-start",
+ flexDirection: "row",
+ marginBottom: theme.spacing.sectionGap,
+ }}
+ >
+ <View style={{ flex: 1 }}>
+ <PageHeader
+ variant="minimal"
+ title={data.companyName}
+ subtitle={`${data.companyAddress} · ${data.companyEmail}`}
+ marginBottom={0}
+ />
+ </View>
+ <View style={styles.invoiceStamp}>
+ <Text
+ style={{
+ color: theme.colors.primary,
+ fontSize: 7,
+ fontWeight: "bold",
+ textAlign: "right",
+ }}
+ noMargin
+ transform="uppercase"
+ >
+ Invoice
+ </Text>
+ <Text
+ style={{
+ color: theme.colors.foreground,
+ fontSize: 14,
+ fontWeight: "bold",
+ textAlign: "right",
+ }}
+ noMargin
+ >
+ {data.invoiceNumber}
+ </Text>
+ <Text
+ style={{
+ color: theme.colors.mutedForeground,
+ fontSize: 8,
+ textAlign: "right",
+ }}
+ noMargin
+ >
+ {data.invoiceDate}
+ </Text>
+ </View>
+ </Section>
+ <View style={styles.infoRow}>
+ <View style={{ flex: 1, paddingRight: 20 }}>
+ <Text style={styles.infoLabel} noMargin>
+ Bill To
+ </Text>
+ <Text variant="sm" noMargin>
+ {data.billTo.name}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.billTo.address}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.billTo.email}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.billTo.phone}
+ </Text>
+ </View>
+ <View style={{ flex: 1 }}>
+ <Text style={styles.infoLabel} noMargin>
+ Invoice Details
+ </Text>
+ <KeyValue
+ size="sm"
+ items={[
+ { key: "Due Date", value: data.dueDate },
+ { key: "Payment", value: data.paymentTerms.method },
+ { key: "GST", value: data.paymentTerms.gst },
+ ]}
+ />
+ </View>
+ </View>
+ <Table variant="compact">
+ <TableHeader>
+ <TableRow header>
+ <TableCell>Description</TableCell>
+ <TableCell align="center">Qty</TableCell>
+ <TableCell align="right">Rate</TableCell>
+ <TableCell align="right">Total</TableCell>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {data.items.map((item, index) => (
+ // biome-ignore lint/suspicious/noArrayIndexKey: invoice items have no stable id
+ <TableRow key={index}>
+ <TableCell>{item.description}</TableCell>
+ <TableCell align="center">{`${item.quantity}`}</TableCell>
+ <TableCell align="right">{`$${item.unitPrice.toLocaleString()}`}</TableCell>
+ <TableCell align="right">{`$${(item.quantity * item.unitPrice).toFixed(2)}`}</TableCell>
+ </TableRow>
+ ))}
+ </TableBody>
+ </Table>
+ <Section noWrap style={{ flexDirection: "row", marginTop: 20 }}>
+ <View style={{ flex: 1 }} />
+ <View style={{ width: 240 }}>
+ <KeyValue
+ size="sm"
+ dividerThickness={1}
+ items={[
+ {
+ key: "Subtotal",
+ value: `$${data.summary.subtotal.toFixed(2)}`,
+ },
+ { key: "Tax (7%)", value: `$${data.summary.tax.toFixed(2)}` },
+ {
+ key: "Balance Due",
+ keyStyle: { fontSize: 12, fontWeight: "bold" },
+ value: `$${data.summary.total.toFixed(2)}`,
+ valueStyle: {
+ color: theme.colors.primary,
+ fontSize: 13,
+ fontWeight: "bold",
+ },
+ },
+ ]}
+ divided
+ />
+ </View>
+ </Section>
+ <PageFooter
+ leftText={data.notes}
+ rightText="Page 1 of 1"
+ sticky
+ pagePadding={25}
+ />
+ </Page>
+ </Document>
+ );
+}
diff --git a/registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.types.ts b/registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.types.ts
new file mode 100644
index 0000000..3397f19
--- /dev/null
+++ b/registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.types.ts
@@ -0,0 +1,31 @@
+export interface InvoiceMinimalData {
+ invoiceNumber: string;
+ invoiceDate: string;
+ dueDate: string;
+ companyName: string;
+ subtitle: string;
+ companyAddress: string;
+ companyEmail: string;
+ billTo: {
+ name: string;
+ address: string;
+ email: string;
+ phone: string;
+ };
+ items: {
+ description: string;
+ quantity: number;
+ unitPrice: number;
+ }[];
+ summary: {
+ subtotal: number;
+ tax: number;
+ total: number;
+ };
+ paymentTerms: {
+ dueDate: string;
+ method: string;
+ gst: string;
+ };
+ notes?: string;
+}
diff --git a/registry/bases/takumi/blocks/invoice-modern/invoice-modern.tsx b/registry/bases/takumi/blocks/invoice-modern/invoice-modern.tsx
new file mode 100644
index 0000000..67d9394
--- /dev/null
+++ b/registry/bases/takumi/blocks/invoice-modern/invoice-modern.tsx
@@ -0,0 +1,239 @@
+import type { PdfcnTheme } from "@/registry/themes";
+
+import {
+ KeyValue,
+ PageFooter,
+ PageHeader,
+ PdfcnThemeProvider,
+ Section,
+ Table,
+ TableBody,
+ TableCell,
+ TableHeader,
+ TableRow,
+ Text,
+ usePdfcnTheme,
+} from "../../components";
+import { View, StyleSheet, Document, Page } from "../../lib/takumi-primitives";
+import type { InvoiceModernData } from "./invoice-modern.types";
+
+// Sample data — replace with your own props or data source
+const sampleData: InvoiceModernData = {
+ billTo: {
+ address: "789 Innovation Blvd, Floor 3",
+ email: "[email protected]",
+ name: "TechStart Solutions",
+ phone: "+1 (555) 987-6543",
+ },
+ companyAddress: "City, Country",
+ companyEmail: "[email protected]",
+ companyName: "Your Company",
+ dueDate: "March 20, 2026",
+ invoiceDate: "February 18, 2026",
+ invoiceNumber: "INV-2026-002",
+ items: [
+ { description: "API Integration", quantity: 1, unitPrice: 15_000 },
+ { description: "SEO", quantity: 2, unitPrice: 5500 },
+ { description: "Security Audit", quantity: 1, unitPrice: 7200 },
+ ],
+ notes: "Payment terms: Net 30 days. Thank you for your business!",
+ paymentTerms: {
+ dueDate: "March 20, 2026",
+ gst: "GSTIN 123456789",
+ method: "Wire Transfer / Bank Account",
+ },
+ subtitle: "Professional Services",
+ summary: {
+ subtotal: 33_200,
+ tax: 2324,
+ total: 35_524,
+ },
+};
+
+export function InvoiceModernDocument({
+ theme,
+ data = sampleData,
+}: {
+ theme?: PdfcnTheme;
+ data?: InvoiceModernData;
+}) {
+ return (
+ <PdfcnThemeProvider theme={theme}>
+ <InvoiceModernContent data={data} />
+ </PdfcnThemeProvider>
+ );
+}
+
+function InvoiceModernContent({ data }: { data: InvoiceModernData }) {
+ const theme = usePdfcnTheme();
+
+ const styles = StyleSheet.create({
+ dividerCol: {
+ backgroundColor: theme.colors.border,
+ marginRight: 12,
+ width: 1,
+ },
+ metaCol: {
+ flex: 1,
+ paddingRight: 12,
+ },
+ metaLabel: {
+ color: theme.colors.mutedForeground,
+ fontSize: 8,
+ fontWeight: "bold",
+ letterSpacing: 0.5,
+ marginBottom: 3,
+ textTransform: "uppercase",
+ },
+ metaRow: {
+ flexDirection: "row",
+ marginBottom: theme.spacing.sectionGap,
+ },
+ metaValue: {
+ color: theme.colors.foreground,
+ fontSize: 9,
+ },
+ page: {
+ backgroundColor: theme.colors.background,
+ padding: theme.spacing.page.marginTop,
+ paddingBottom: theme.spacing.page.marginBottom,
+ },
+ });
+
+ return (
+ <Document title={`Invoice ${data.invoiceNumber}`}>
+ <Page size="A4" style={styles.page}>
+ <PageHeader
+ variant="branded"
+ title={data.companyName}
+ subtitle={`${data.subtitle} · ${data.companyAddress} · ${data.companyEmail}`}
+ />
+ <View style={styles.metaRow}>
+ <View style={styles.metaCol}>
+ <Text style={styles.metaLabel} noMargin>
+ Invoice Number
+ </Text>
+ <Text
+ style={{ ...styles.metaValue, fontSize: 11, fontWeight: "bold" }}
+ noMargin
+ >
+ {data.invoiceNumber}
+ </Text>
+ </View>
+ <View style={styles.metaCol}>
+ <Text style={styles.metaLabel} noMargin>
+ Invoice Date
+ </Text>
+ <Text style={styles.metaValue} noMargin>
+ {data.invoiceDate}
+ </Text>
+ </View>
+ <View style={styles.metaCol}>
+ <Text style={styles.metaLabel} noMargin>
+ Due Date
+ </Text>
+ <Text style={styles.metaValue} noMargin>
+ {data.dueDate}
+ </Text>
+ </View>
+ <View style={styles.dividerCol} />
+ <View style={{ flex: 2 }}>
+ <Text style={styles.metaLabel} noMargin>
+ Billed To
+ </Text>
+ <Text style={{ ...styles.metaValue, fontWeight: "bold" }} noMargin>
+ {data.billTo.name}
+ </Text>
+ <Text
+ style={{
+ ...styles.metaValue,
+ color: theme.colors.mutedForeground,
+ }}
+ noMargin
+ >
+ {data.billTo.address}
+ </Text>
+ <Text
+ style={{
+ ...styles.metaValue,
+ color: theme.colors.mutedForeground,
+ }}
+ noMargin
+ >
+ {data.billTo.email}
+ </Text>
+ <Text
+ style={{
+ ...styles.metaValue,
+ color: theme.colors.mutedForeground,
+ }}
+ noMargin
+ >
+ {data.billTo.phone}
+ </Text>
+ </View>
+ </View>
+ <Table variant="primary-header">
+ <TableHeader>
+ <TableRow header>
+ <TableCell>Description</TableCell>
+ <TableCell align="center">Qty</TableCell>
+ <TableCell align="right">Unit Price</TableCell>
+ <TableCell align="right">Amount</TableCell>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {data.items.map((item, index) => (
+ // biome-ignore lint/suspicious/noArrayIndexKey: invoice items have no stable id
+ <TableRow key={index}>
+ <TableCell>{item.description}</TableCell>
+ <TableCell align="center">{`${item.quantity}`}</TableCell>
+ <TableCell align="right">{`$${item.unitPrice.toLocaleString()}`}</TableCell>
+ <TableCell align="right">{`$${(item.quantity * item.unitPrice).toFixed(2)}`}</TableCell>
+ </TableRow>
+ ))}
+ </TableBody>
+ </Table>
+ <Section noWrap style={{ flexDirection: "row", marginTop: 16 }}>
+ <View style={{ flex: 1, paddingRight: 20 }}>
+ <Text style={styles.metaLabel} noMargin>
+ Payment Method
+ </Text>
+ <Text variant="xs" noMargin>
+ {data.paymentTerms.method}
+ </Text>
+ <Text variant="xs" noMargin color="mutedForeground">
+ {data.paymentTerms.gst}
+ </Text>
+ </View>
+ <View style={{ width: 220 }}>
+ <KeyValue
+ size="sm"
+ dividerThickness={1}
+ items={[
+ {
+ key: "Subtotal",
+ value: `$${data.summary.subtotal.toFixed(2)}`,
+ },
+ { key: "Tax (7%)", value: `$${data.summary.tax.toFixed(2)}` },
+ {
+ key: "Total Due",
+ keyStyle: { fontSize: 12, fontWeight: "bold" },
+ value: `$${data.summary.total.toFixed(2)}`,
+ valueStyle: { fontSize: 12, fontWeight: "bold" },
+ },
+ ]}
+ divided
+ />
+ </View>
+ </Section>
+ <PageFooter
+ leftText={data.notes}
+ rightText="Page 1 of 1"
+ sticky
+ pagePadding={25}
+ />
+ </Page>
+ </Document>
+ );
+}
diff --git a/registry/bases/takumi/blocks/invoice-modern/invoice-modern.types.ts b/registry/bases/takumi/blocks/invoice-modern/invoice-modern.types.ts
new file mode 100644
index 0000000..94d0875
--- /dev/null
+++ b/registry/bases/takumi/blocks/invoice-modern/invoice-modern.types.ts
@@ -0,0 +1,31 @@
+export interface InvoiceModernData {
+ invoiceNumber: string;
+ invoiceDate: string;
+ dueDate: string;
+ companyName: string;
+ subtitle: string;
+ companyAddress: string;
+ companyEmail: string;
+ billTo: {
+ name: string;
+ address: string;
+ email: string;
+ phone: string;
+ };
+ items: {
+ description: string;
+ quantity: number;
+ unitPrice: number;
+ }[];
+ summary: {
+ subtotal: number;
+ tax: number;
+ total: number;
+ };
+ paymentTerms: {
+ dueDate: string;
+ method: string;
+ gst: string;
+ };
+ notes?: string;
+}
diff --git a/registry/bases/takumi/blocks/report-financial/report-financial.tsx b/registry/bases/takumi/blocks/report-financial/report-financial.tsx
new file mode 100644
index 0000000..f856e3f
--- /dev/null
+++ b/registry/bases/takumi/blocks/report-financial/report-financial.tsx
@@ -0,0 +1,91 @@
+import { ReportTemplateFrame } from "./report-layout";
+import type { ReportTemplateProps } from "./report-layout";
+import type { BaseReportData } from "./report.types";
+
+const sampleFinancialData: BaseReportData = {
+ author: "Finance Ops",
+ generatedAt: "February 23, 2026",
+ highlights: [
+ "Revenue accelerated after enterprise expansion campaign launch.",
+ "Gross margin improved due to infrastructure cost renegotiation.",
+ "Collections requires executive follow-up on two overdue accounts.",
+ ],
+ period: "Q1 2026",
+ rows: [
+ {
+ label: "Enterprise Sales",
+ owner: "A. Patel",
+ progress: 88,
+ risk: "Low",
+ status: "On Track",
+ },
+ {
+ label: "SMB Sales",
+ owner: "L. Khan",
+ progress: 79,
+ risk: "Medium",
+ status: "On Track",
+ },
+ {
+ label: "Collections",
+ owner: "J. Reyes",
+ progress: 63,
+ risk: "High",
+ status: "At Risk",
+ },
+ {
+ label: "Cost Optimization",
+ owner: "K. Singh",
+ progress: 82,
+ risk: "Low",
+ status: "On Track",
+ },
+ ],
+ series: [
+ { label: "W1", value: 72 },
+ { label: "W2", value: 74 },
+ { label: "W3", value: 76 },
+ { label: "W4", value: 77 },
+ { label: "W5", value: 79 },
+ { label: "W6", value: 80 },
+ { label: "W7", value: 81 },
+ { label: "W8", value: 83 },
+ { label: "W9", value: 82 },
+ { label: "W10", value: 84 },
+ { label: "W11", value: 86 },
+ { label: "W12", value: 88 },
+ ],
+ subtitle: "Revenue, margin, and expense control overview",
+ summary: [
+ { label: "Revenue", tone: "success", trend: "+14.2% QoQ", value: "$2.48M" },
+ {
+ label: "Gross Margin",
+ tone: "success",
+ trend: "+2.1 pts",
+ value: "61.8%",
+ },
+ { label: "Opex", tone: "success", trend: "-3.4% QoQ", value: "$0.93M" },
+ { label: "Runway", tone: "info", trend: "Stable", value: "22 months" },
+ ],
+ title: "Quarterly Financial Report",
+};
+
+export function FinancialReportDocument({
+ theme,
+ data = sampleFinancialData,
+}: ReportTemplateProps) {
+ return (
+ <ReportTemplateFrame
+ theme={theme}
+ data={data}
+ titlePrefix="Financial Report"
+ statusLabel="Finance: Healthy"
+ statusTone="success"
+ graphVariant="line"
+ graphTitle="Revenue trajectory"
+ graphSubtitle="Quarterly weighted revenue index"
+ graphLegend="none"
+ graphColors={["#0F172A"]}
+ />
+ );
+}
diff --git a/registry/bases/takumi/blocks/report-financial/report-layout.tsx b/registry/bases/takumi/blocks/report-financial/report-layout.tsx
new file mode 100644
index 0000000..dc73747
--- /dev/null
+++ b/registry/bases/takumi/blocks/report-financial/report-layout.tsx
@@ -0,0 +1,369 @@
+import type { PdfcnTheme } from "@/registry/themes";
+
+import {
+ Badge,
+ DataTable,
+ Divider,
+ KeyValue,
+ PageFooter,
+ PageHeader,
+ PdfGraph,
+ PdfList,
+ PdfcnThemeProvider,
+ Section,
+ Stack,
+ Text,
+ usePdfcnTheme,
+} from "../../components";
+import { View, StyleSheet, Document, Page } from "../../lib/takumi-primitives";
+import type { BaseReportData } from "./report.types";
+
+export interface ReportTemplateProps {
+ theme?: PdfcnTheme;
+ data?: BaseReportData;
+}
+
+type ReportGraphVariant =
+ | "bar"
+ | "horizontal-bar"
+ | "line"
+ | "area"
+ | "pie"
+ | "donut";
+
+interface ReportLayoutProps {
+ data: BaseReportData;
+ titlePrefix: string;
+ statusLabel: string;
+ statusTone: "success" | "warning" | "destructive" | "info";
+ graphVariant: ReportGraphVariant;
+ graphTitle: string;
+ graphSubtitle: string;
+ graphLegend?: "bottom" | "right" | "none";
+ graphShowValues?: boolean;
+ graphColors?: string[];
+ graphData?: { label: string; value: number }[];
+}
+
+function toneColor(
+ theme: PdfcnTheme,
+ tone: "success" | "warning" | "destructive" | "info"
+) {
+ if (tone === "success") {
+ return theme.colors.success;
+ }
+ if (tone === "warning") {
+ return theme.colors.warning;
+ }
+ if (tone === "destructive") {
+ return theme.colors.destructive;
+ }
+ return theme.colors.info;
+}
+
+export function ReportLayout({
+ data,
+ titlePrefix,
+ statusLabel,
+ statusTone,
+ graphVariant,
+ graphTitle,
+ graphSubtitle,
+ graphLegend = "none",
+ graphShowValues = false,
+ graphColors,
+ graphData,
+}: ReportLayoutProps) {
+ const theme = usePdfcnTheme();
+ const accent = toneColor(theme, statusTone);
+
+ const styles = StyleSheet.create({
+ col: {
+ flex: 1,
+ },
+ graphShell: {
+ backgroundColor: theme.colors.background,
+ borderColor: theme.colors.border,
+ borderRadius: theme.primitives.borderRadius.md,
+ borderStyle: "solid",
+ borderWidth: 1,
+ padding: 12,
+ },
+ metricCard: {
+ backgroundColor: theme.colors.background,
+ borderColor: theme.colors.border,
+ borderRadius: theme.primitives.borderRadius.md,
+ borderStyle: "solid",
+ borderWidth: 1,
+ padding: 8,
+ width: "48.6%",
+ },
+ metricLabel: {
+ color: theme.colors.mutedForeground,
+ fontSize: 8,
+ letterSpacing: 0.5,
+ marginBottom: 2,
+ textTransform: "uppercase",
+ },
+ metricTrend: {
+ color: theme.colors.mutedForeground,
+ fontSize: 9,
+ },
+ metricValue: {
+ color: theme.colors.foreground,
+ fontSize: 14,
+ fontWeight: theme.primitives.fontWeights.bold,
+ marginBottom: 2,
+ },
+ metricsGrid: {
+ flexDirection: "row",
+ flexWrap: "wrap",
+ gap: 8,
+ },
+ page: {
+ backgroundColor: theme.colors.background,
+ paddingBottom: theme.spacing.page.marginBottom,
+ paddingLeft: theme.spacing.page.marginLeft,
+ paddingRight: theme.spacing.page.marginRight,
+ paddingTop: theme.spacing.page.marginTop,
+ },
+ toolbar: {
+ alignItems: "center",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ marginBottom: 8,
+ },
+ twoColumn: {
+ alignItems: "flex-start",
+ flexDirection: "row",
+ gap: 10,
+ },
+ });
+
+ return (
+ <Document title={`${titlePrefix} ${data.period}`}>
+ <Page size="A4" style={styles.page}>
+ <PageHeader
+ variant="two-column"
+ title={data.title}
+ subtitle={`${titlePrefix} · ${data.subtitle}`}
+ rightText={data.period}
+ rightSubText={`Generated ${data.generatedAt}`}
+ marginBottom={14}
+ />
+
+ <View style={styles.toolbar}>
+ <Badge label={statusLabel} variant={statusTone} size="sm" />
+ <Text variant="xs" color="mutedForeground" noMargin>
+ Author: {data.author}
+ </Text>
+ </View>
+
+ <Section variant="card" padding="md" noWrap>
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Executive Summary
+ </Text>
+ <View style={styles.metricsGrid}>
+ {data.summary.map((metric) => (
+ <View
+ key={metric.label}
+ style={[
+ styles.metricCard,
+ {
+ borderLeftColor: metric.tone
+ ? toneColor(theme, metric.tone)
+ : accent,
+ borderLeftWidth: 3,
+ },
+ ]}
+ >
+ <Text style={styles.metricLabel} noMargin>
+ {metric.label}
+ </Text>
+ <Text style={styles.metricValue} noMargin>
+ {metric.value}
+ </Text>
+ {metric.trend ? (
+ <Badge
+ label={metric.trend}
+ size="sm"
+ variant={metric.tone ?? "info"}
+ />
+ ) : null}
+ </View>
+ ))}
+ </View>
+ </Section>
+
+ <Section padding="md" noWrap>
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Performance Trend
+ </Text>
+ <View style={styles.graphShell}>
+ <PdfGraph
+ variant={graphVariant}
+ data={graphData ?? data.series}
+ title={graphTitle}
+ subtitle={graphSubtitle}
+ yLabel={undefined}
+ xLabel={undefined}
+ showGrid={graphVariant !== "pie" && graphVariant !== "donut"}
+ showValues={graphShowValues}
+ smooth={graphVariant === "line" || graphVariant === "area"}
+ legend={graphLegend}
+ height={200}
+ colors={graphColors}
+ fullWidth
+ containerPadding={12}
+ wrapperPadding={12}
+ style={{ marginBottom: 0 }}
+ />
+ </View>
+ </Section>
+
+ <Section padding="md">
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Delivery Table
+ </Text>
+ <DataTable
+ variant="compact"
+ size="compact"
+ stripe
+ columns={[
+ { header: "Stream", key: "label" },
+ { header: "Owner", key: "owner" },
+ { align: "center", header: "Status", key: "status" },
+ {
+ align: "right",
+ header: "Progress",
+ key: "progress",
+ render: (value) => `${String(value)}%`,
+ },
+ { align: "right", header: "Risk", key: "risk" },
+ ]}
+ data={data.rows}
+ footer={{
+ label: "Totals",
+ owner: "-",
+ progress: Math.round(
+ data.rows.reduce((sum, row) => sum + row.progress, 0) /
+ Math.max(data.rows.length, 1)
+ ),
+ risk: "-",
+ status: "-",
+ }}
+ />
+ </Section>
+
+ <Section padding="md" variant="card" noWrap>
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Highlights & Risks
+ </Text>
+ <View style={styles.twoColumn}>
+ <View style={styles.col}>
+ <PdfList
+ variant="checklist"
+ items={data.highlights.map((item) => ({
+ checked: true,
+ text: item,
+ }))}
+ gap="sm"
+ />
+ </View>
+ <View style={styles.col}>
+ <KeyValue
+ size="sm"
+ divided
+ items={[
+ {
+ key: "Open Risks",
+ value: `${data.rows.filter((r) => r.risk !== "Low").length}`,
+ },
+ {
+ key: "On-Track Streams",
+ value: `${data.rows.filter((r) => r.status === "On Track").length}/${data.rows.length}`,
+ },
+ {
+ key: "Average Progress",
+ value: `${Math.round(
+ data.rows.reduce((sum, row) => sum + row.progress, 0) /
+ Math.max(data.rows.length, 1)
+ )}%`,
+ },
+ ]}
+ />
+ </View>
+ </View>
+ <Divider />
+ <Stack gap="sm">
+ <Text variant="xs" color="mutedForeground" noMargin>
+ Best practice: keep each section under one page using `noWrap` for
+ concise blocks.
+ </Text>
+ <Text variant="xs" color="mutedForeground" noMargin>
+ Best practice: pass explicit row keys/owners to avoid ambiguous
+ reporting handoffs.
+ </Text>
+ </Stack>
+ </Section>
+
+ <PageFooter
+ variant="three-column"
+ leftText="Confidential — Internal Use"
+ centerText="Generated with PDFx"
+ rightText="Page 1 of 1"
+ sticky
+ pagePadding={theme.spacing.page.marginLeft}
+ />
+ </Page>
+ </Document>
+ );
+}
+
+export function ReportTemplateFrame({
+ theme,
+ data,
+ titlePrefix,
+ statusLabel,
+ statusTone,
+ graphVariant,
+ graphTitle,
+ graphSubtitle,
+ graphLegend,
+ graphShowValues,
+ graphColors,
+ graphData,
+}: ReportTemplateProps & {
+ titlePrefix: string;
+ statusLabel: string;
+ statusTone: "success" | "warning" | "destructive" | "info";
+ graphVariant: ReportGraphVariant;
+ graphTitle: string;
+ graphSubtitle: string;
+ graphLegend?: "bottom" | "right" | "none";
+ graphShowValues?: boolean;
+ graphColors?: string[];
+ graphData?: { label: string; value: number }[];
+}) {
+ if (!data) {
+ return null;
+ }
+
+ return (
+ <PdfcnThemeProvider theme={theme}>
+ <ReportLayout
+ data={data}
+ titlePrefix={titlePrefix}
+ statusLabel={statusLabel}
+ statusTone={statusTone}
+ graphVariant={graphVariant}
+ graphTitle={graphTitle}
+ graphSubtitle={graphSubtitle}
+ graphLegend={graphLegend}
+ graphShowValues={graphShowValues}
+ graphColors={graphColors}
+ graphData={graphData}
+ />
+ </PdfcnThemeProvider>
+ );
+}
diff --git a/registry/bases/takumi/blocks/report-financial/report.types.ts b/registry/bases/takumi/blocks/report-financial/report.types.ts
new file mode 100644
index 0000000..0a80a7b
--- /dev/null
+++ b/registry/bases/takumi/blocks/report-financial/report.types.ts
@@ -0,0 +1,31 @@
+export interface SummaryMetric {
+ label: string;
+ value: string;
+ trend?: string;
+ tone?: "success" | "warning" | "destructive" | "info";
+}
+
+export type ReportRow = Record<string, unknown> & {
+ label: string;
+ owner: string;
+ status: string;
+ progress: number;
+ risk?: string;
+};
+
+export interface ReportSeriesPoint {
+ label: string;
+ value: number;
+}
+
+export interface BaseReportData {
+ title: string;
+ subtitle: string;
+ generatedAt: string;
+ period: string;
+ author: string;
+ summary: SummaryMetric[];
+ rows: ReportRow[];
+ series: ReportSeriesPoint[];
+ highlights: string[];
+}
diff --git a/registry/bases/takumi/blocks/report-marketing/report-layout.tsx b/registry/bases/takumi/blocks/report-marketing/report-layout.tsx
new file mode 100644
index 0000000..dc73747
--- /dev/null
+++ b/registry/bases/takumi/blocks/report-marketing/report-layout.tsx
@@ -0,0 +1,369 @@
+import type { PdfcnTheme } from "@/registry/themes";
+
+import {
+ Badge,
+ DataTable,
+ Divider,
+ KeyValue,
+ PageFooter,
+ PageHeader,
+ PdfGraph,
+ PdfList,
+ PdfcnThemeProvider,
+ Section,
+ Stack,
+ Text,
+ usePdfcnTheme,
+} from "../../components";
+import { View, StyleSheet, Document, Page } from "../../lib/takumi-primitives";
+import type { BaseReportData } from "./report.types";
+
+export interface ReportTemplateProps {
+ theme?: PdfcnTheme;
+ data?: BaseReportData;
+}
+
+type ReportGraphVariant =
+ | "bar"
+ | "horizontal-bar"
+ | "line"
+ | "area"
+ | "pie"
+ | "donut";
+
+interface ReportLayoutProps {
+ data: BaseReportData;
+ titlePrefix: string;
+ statusLabel: string;
+ statusTone: "success" | "warning" | "destructive" | "info";
+ graphVariant: ReportGraphVariant;
+ graphTitle: string;
+ graphSubtitle: string;
+ graphLegend?: "bottom" | "right" | "none";
+ graphShowValues?: boolean;
+ graphColors?: string[];
+ graphData?: { label: string; value: number }[];
+}
+
+function toneColor(
+ theme: PdfcnTheme,
+ tone: "success" | "warning" | "destructive" | "info"
+) {
+ if (tone === "success") {
+ return theme.colors.success;
+ }
+ if (tone === "warning") {
+ return theme.colors.warning;
+ }
+ if (tone === "destructive") {
+ return theme.colors.destructive;
+ }
+ return theme.colors.info;
+}
+
+export function ReportLayout({
+ data,
+ titlePrefix,
+ statusLabel,
+ statusTone,
+ graphVariant,
+ graphTitle,
+ graphSubtitle,
+ graphLegend = "none",
+ graphShowValues = false,
+ graphColors,
+ graphData,
+}: ReportLayoutProps) {
+ const theme = usePdfcnTheme();
+ const accent = toneColor(theme, statusTone);
+
+ const styles = StyleSheet.create({
+ col: {
+ flex: 1,
+ },
+ graphShell: {
+ backgroundColor: theme.colors.background,
+ borderColor: theme.colors.border,
+ borderRadius: theme.primitives.borderRadius.md,
+ borderStyle: "solid",
+ borderWidth: 1,
+ padding: 12,
+ },
+ metricCard: {
+ backgroundColor: theme.colors.background,
+ borderColor: theme.colors.border,
+ borderRadius: theme.primitives.borderRadius.md,
+ borderStyle: "solid",
+ borderWidth: 1,
+ padding: 8,
+ width: "48.6%",
+ },
+ metricLabel: {
+ color: theme.colors.mutedForeground,
+ fontSize: 8,
+ letterSpacing: 0.5,
+ marginBottom: 2,
+ textTransform: "uppercase",
+ },
+ metricTrend: {
+ color: theme.colors.mutedForeground,
+ fontSize: 9,
+ },
+ metricValue: {
+ color: theme.colors.foreground,
+ fontSize: 14,
+ fontWeight: theme.primitives.fontWeights.bold,
+ marginBottom: 2,
+ },
+ metricsGrid: {
+ flexDirection: "row",
+ flexWrap: "wrap",
+ gap: 8,
+ },
+ page: {
+ backgroundColor: theme.colors.background,
+ paddingBottom: theme.spacing.page.marginBottom,
+ paddingLeft: theme.spacing.page.marginLeft,
+ paddingRight: theme.spacing.page.marginRight,
+ paddingTop: theme.spacing.page.marginTop,
+ },
+ toolbar: {
+ alignItems: "center",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ marginBottom: 8,
+ },
+ twoColumn: {
+ alignItems: "flex-start",
+ flexDirection: "row",
+ gap: 10,
+ },
+ });
+
+ return (
+ <Document title={`${titlePrefix} ${data.period}`}>
+ <Page size="A4" style={styles.page}>
+ <PageHeader
+ variant="two-column"
+ title={data.title}
+ subtitle={`${titlePrefix} · ${data.subtitle}`}
+ rightText={data.period}
+ rightSubText={`Generated ${data.generatedAt}`}
+ marginBottom={14}
+ />
+
+ <View style={styles.toolbar}>
+ <Badge label={statusLabel} variant={statusTone} size="sm" />
+ <Text variant="xs" color="mutedForeground" noMargin>
+ Author: {data.author}
+ </Text>
+ </View>
+
+ <Section variant="card" padding="md" noWrap>
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Executive Summary
+ </Text>
+ <View style={styles.metricsGrid}>
+ {data.summary.map((metric) => (
+ <View
+ key={metric.label}
+ style={[
+ styles.metricCard,
+ {
+ borderLeftColor: metric.tone
+ ? toneColor(theme, metric.tone)
+ : accent,
+ borderLeftWidth: 3,
+ },
+ ]}
+ >
+ <Text style={styles.metricLabel} noMargin>
+ {metric.label}
+ </Text>
+ <Text style={styles.metricValue} noMargin>
+ {metric.value}
+ </Text>
+ {metric.trend ? (
+ <Badge
+ label={metric.trend}
+ size="sm"
+ variant={metric.tone ?? "info"}
+ />
+ ) : null}
+ </View>
+ ))}
+ </View>
+ </Section>
+
+ <Section padding="md" noWrap>
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Performance Trend
+ </Text>
+ <View style={styles.graphShell}>
+ <PdfGraph
+ variant={graphVariant}
+ data={graphData ?? data.series}
+ title={graphTitle}
+ subtitle={graphSubtitle}
+ yLabel={undefined}
+ xLabel={undefined}
+ showGrid={graphVariant !== "pie" && graphVariant !== "donut"}
+ showValues={graphShowValues}
+ smooth={graphVariant === "line" || graphVariant === "area"}
+ legend={graphLegend}
+ height={200}
+ colors={graphColors}
+ fullWidth
+ containerPadding={12}
+ wrapperPadding={12}
+ style={{ marginBottom: 0 }}
+ />
+ </View>
+ </Section>
+
+ <Section padding="md">
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Delivery Table
+ </Text>
+ <DataTable
+ variant="compact"
+ size="compact"
+ stripe
+ columns={[
+ { header: "Stream", key: "label" },
+ { header: "Owner", key: "owner" },
+ { align: "center", header: "Status", key: "status" },
+ {
+ align: "right",
+ header: "Progress",
+ key: "progress",
+ render: (value) => `${String(value)}%`,
+ },
+ { align: "right", header: "Risk", key: "risk" },
+ ]}
+ data={data.rows}
+ footer={{
+ label: "Totals",
+ owner: "-",
+ progress: Math.round(
+ data.rows.reduce((sum, row) => sum + row.progress, 0) /
+ Math.max(data.rows.length, 1)
+ ),
+ risk: "-",
+ status: "-",
+ }}
+ />
+ </Section>
+
+ <Section padding="md" variant="card" noWrap>
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Highlights & Risks
+ </Text>
+ <View style={styles.twoColumn}>
+ <View style={styles.col}>
+ <PdfList
+ variant="checklist"
+ items={data.highlights.map((item) => ({
+ checked: true,
+ text: item,
+ }))}
+ gap="sm"
+ />
+ </View>
+ <View style={styles.col}>
+ <KeyValue
+ size="sm"
+ divided
+ items={[
+ {
+ key: "Open Risks",
+ value: `${data.rows.filter((r) => r.risk !== "Low").length}`,
+ },
+ {
+ key: "On-Track Streams",
+ value: `${data.rows.filter((r) => r.status === "On Track").length}/${data.rows.length}`,
+ },
+ {
+ key: "Average Progress",
+ value: `${Math.round(
+ data.rows.reduce((sum, row) => sum + row.progress, 0) /
+ Math.max(data.rows.length, 1)
+ )}%`,
+ },
+ ]}
+ />
+ </View>
+ </View>
+ <Divider />
+ <Stack gap="sm">
+ <Text variant="xs" color="mutedForeground" noMargin>
+ Best practice: keep each section under one page using `noWrap` for
+ concise blocks.
+ </Text>
+ <Text variant="xs" color="mutedForeground" noMargin>
+ Best practice: pass explicit row keys/owners to avoid ambiguous
+ reporting handoffs.
+ </Text>
+ </Stack>
+ </Section>
+
+ <PageFooter
+ variant="three-column"
+ leftText="Confidential — Internal Use"
+ centerText="Generated with PDFx"
+ rightText="Page 1 of 1"
+ sticky
+ pagePadding={theme.spacing.page.marginLeft}
+ />
+ </Page>
+ </Document>
+ );
+}
+
+export function ReportTemplateFrame({
+ theme,
+ data,
+ titlePrefix,
+ statusLabel,
+ statusTone,
+ graphVariant,
+ graphTitle,
+ graphSubtitle,
+ graphLegend,
+ graphShowValues,
+ graphColors,
+ graphData,
+}: ReportTemplateProps & {
+ titlePrefix: string;
+ statusLabel: string;
+ statusTone: "success" | "warning" | "destructive" | "info";
+ graphVariant: ReportGraphVariant;
+ graphTitle: string;
+ graphSubtitle: string;
+ graphLegend?: "bottom" | "right" | "none";
+ graphShowValues?: boolean;
+ graphColors?: string[];
+ graphData?: { label: string; value: number }[];
+}) {
+ if (!data) {
+ return null;
+ }
+
+ return (
+ <PdfcnThemeProvider theme={theme}>
+ <ReportLayout
+ data={data}
+ titlePrefix={titlePrefix}
+ statusLabel={statusLabel}
+ statusTone={statusTone}
+ graphVariant={graphVariant}
+ graphTitle={graphTitle}
+ graphSubtitle={graphSubtitle}
+ graphLegend={graphLegend}
+ graphShowValues={graphShowValues}
+ graphColors={graphColors}
+ graphData={graphData}
+ />
+ </PdfcnThemeProvider>
+ );
+}
diff --git a/registry/bases/takumi/blocks/report-marketing/report-marketing.tsx b/registry/bases/takumi/blocks/report-marketing/report-marketing.tsx
new file mode 100644
index 0000000..928ea15
--- /dev/null
+++ b/registry/bases/takumi/blocks/report-marketing/report-marketing.tsx
@@ -0,0 +1,87 @@
+import { ReportTemplateFrame } from "./report-layout";
+import type { ReportTemplateProps } from "./report-layout";
+import type { BaseReportData } from "./report.types";
+
+const sampleMarketingData: BaseReportData = {
+ author: "Growth Team",
+ generatedAt: "February 23, 2026",
+ highlights: [
+ "Channel mix improved CAC while maintaining lead quality.",
+ "Lifecycle email workflow has deliverability issues under investigation.",
+ "Referral program is producing higher-intent pipeline with lower cost.",
+ ],
+ period: "Campaign Cycle 2026-02",
+ rows: [
+ {
+ label: "SEO",
+ owner: "H. Evans",
+ progress: 84,
+ risk: "Low",
+ status: "On Track",
+ },
+ {
+ label: "Paid Search",
+ owner: "K. Martin",
+ progress: 80,
+ risk: "Low",
+ status: "On Track",
+ },
+ {
+ label: "Lifecycle Email",
+ owner: "V. Lee",
+ progress: 64,
+ risk: "Medium",
+ status: "At Risk",
+ },
+ {
+ label: "Partner Referrals",
+ owner: "J. Gomez",
+ progress: 75,
+ risk: "Medium",
+ status: "On Track",
+ },
+ ],
+ series: [
+ { label: "W1", value: 55 },
+ { label: "W2", value: 57 },
+ { label: "W3", value: 59 },
+ { label: "W4", value: 60 },
+ { label: "W5", value: 62 },
+ { label: "W6", value: 63 },
+ { label: "W7", value: 65 },
+ { label: "W8", value: 67 },
+ { label: "W9", value: 66 },
+ { label: "W10", value: 68 },
+ { label: "W11", value: 70 },
+ { label: "W12", value: 72 },
+ ],
+ subtitle: "Pipeline, conversion efficiency, and channel performance",
+ summary: [
+ { label: "MQLs", tone: "success", trend: "+22.1% cycle", value: "3,940" },
+ { label: "CAC", tone: "success", trend: "-7.4%", value: "$118" },
+ { label: "Win Rate", tone: "info", trend: "+1.1 pts", value: "28.6%" },
+ { label: "Churn Risk", tone: "warning", trend: "+0.8 pts", value: "6.2%" },
+ ],
+ title: "Growth & Marketing Report",
+};
+
+export function MarketingReportDocument({
+ theme,
+ data = sampleMarketingData,
+}: ReportTemplateProps) {
+ return (
+ <ReportTemplateFrame
+ theme={theme}
+ data={data}
+ titlePrefix="Growth Report"
+ statusLabel="Growth: Strong"
+ statusTone="success"
+ graphVariant="bar"
+ graphTitle="Pipeline build by week"
+ graphSubtitle="Demand creation output trend"
+ graphLegend="none"
+ graphShowValues
+ graphColors={["#0EA5E9"]}
+ />
+ );
+}
diff --git a/registry/bases/takumi/blocks/report-marketing/report.types.ts b/registry/bases/takumi/blocks/report-marketing/report.types.ts
new file mode 100644
index 0000000..0a80a7b
--- /dev/null
+++ b/registry/bases/takumi/blocks/report-marketing/report.types.ts
@@ -0,0 +1,31 @@
+export interface SummaryMetric {
+ label: string;
+ value: string;
+ trend?: string;
+ tone?: "success" | "warning" | "destructive" | "info";
+}
+
+export type ReportRow = Record<string, unknown> & {
+ label: string;
+ owner: string;
+ status: string;
+ progress: number;
+ risk?: string;
+};
+
+export interface ReportSeriesPoint {
+ label: string;
+ value: number;
+}
+
+export interface BaseReportData {
+ title: string;
+ subtitle: string;
+ generatedAt: string;
+ period: string;
+ author: string;
+ summary: SummaryMetric[];
+ rows: ReportRow[];
+ series: ReportSeriesPoint[];
+ highlights: string[];
+}
diff --git a/registry/bases/takumi/blocks/report-operations/report-layout.tsx b/registry/bases/takumi/blocks/report-operations/report-layout.tsx
new file mode 100644
index 0000000..dc73747
--- /dev/null
+++ b/registry/bases/takumi/blocks/report-operations/report-layout.tsx
@@ -0,0 +1,369 @@
+import type { PdfcnTheme } from "@/registry/themes";
+
+import {
+ Badge,
+ DataTable,
+ Divider,
+ KeyValue,
+ PageFooter,
+ PageHeader,
+ PdfGraph,
+ PdfList,
+ PdfcnThemeProvider,
+ Section,
+ Stack,
+ Text,
+ usePdfcnTheme,
+} from "../../components";
+import { View, StyleSheet, Document, Page } from "../../lib/takumi-primitives";
+import type { BaseReportData } from "./report.types";
+
+export interface ReportTemplateProps {
+ theme?: PdfcnTheme;
+ data?: BaseReportData;
+}
+
+type ReportGraphVariant =
+ | "bar"
+ | "horizontal-bar"
+ | "line"
+ | "area"
+ | "pie"
+ | "donut";
+
+interface ReportLayoutProps {
+ data: BaseReportData;
+ titlePrefix: string;
+ statusLabel: string;
+ statusTone: "success" | "warning" | "destructive" | "info";
+ graphVariant: ReportGraphVariant;
+ graphTitle: string;
+ graphSubtitle: string;
+ graphLegend?: "bottom" | "right" | "none";
+ graphShowValues?: boolean;
+ graphColors?: string[];
+ graphData?: { label: string; value: number }[];
+}
+
+function toneColor(
+ theme: PdfcnTheme,
+ tone: "success" | "warning" | "destructive" | "info"
+) {
+ if (tone === "success") {
+ return theme.colors.success;
+ }
+ if (tone === "warning") {
+ return theme.colors.warning;
+ }
+ if (tone === "destructive") {
+ return theme.colors.destructive;
+ }
+ return theme.colors.info;
+}
+
+export function ReportLayout({
+ data,
+ titlePrefix,
+ statusLabel,
+ statusTone,
+ graphVariant,
+ graphTitle,
+ graphSubtitle,
+ graphLegend = "none",
+ graphShowValues = false,
+ graphColors,
+ graphData,
+}: ReportLayoutProps) {
+ const theme = usePdfcnTheme();
+ const accent = toneColor(theme, statusTone);
+
+ const styles = StyleSheet.create({
+ col: {
+ flex: 1,
+ },
+ graphShell: {
+ backgroundColor: theme.colors.background,
+ borderColor: theme.colors.border,
+ borderRadius: theme.primitives.borderRadius.md,
+ borderStyle: "solid",
+ borderWidth: 1,
+ padding: 12,
+ },
+ metricCard: {
+ backgroundColor: theme.colors.background,
+ borderColor: theme.colors.border,
+ borderRadius: theme.primitives.borderRadius.md,
+ borderStyle: "solid",
+ borderWidth: 1,
+ padding: 8,
+ width: "48.6%",
+ },
+ metricLabel: {
+ color: theme.colors.mutedForeground,
+ fontSize: 8,
+ letterSpacing: 0.5,
+ marginBottom: 2,
+ textTransform: "uppercase",
+ },
+ metricTrend: {
+ color: theme.colors.mutedForeground,
+ fontSize: 9,
+ },
+ metricValue: {
+ color: theme.colors.foreground,
+ fontSize: 14,
+ fontWeight: theme.primitives.fontWeights.bold,
+ marginBottom: 2,
+ },
+ metricsGrid: {
+ flexDirection: "row",
+ flexWrap: "wrap",
+ gap: 8,
+ },
+ page: {
+ backgroundColor: theme.colors.background,
+ paddingBottom: theme.spacing.page.marginBottom,
+ paddingLeft: theme.spacing.page.marginLeft,
+ paddingRight: theme.spacing.page.marginRight,
+ paddingTop: theme.spacing.page.marginTop,
+ },
+ toolbar: {
+ alignItems: "center",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ marginBottom: 8,
+ },
+ twoColumn: {
+ alignItems: "flex-start",
+ flexDirection: "row",
+ gap: 10,
+ },
+ });
+
+ return (
+ <Document title={`${titlePrefix} ${data.period}`}>
+ <Page size="A4" style={styles.page}>
+ <PageHeader
+ variant="two-column"
+ title={data.title}
+ subtitle={`${titlePrefix} · ${data.subtitle}`}
+ rightText={data.period}
+ rightSubText={`Generated ${data.generatedAt}`}
+ marginBottom={14}
+ />
+
+ <View style={styles.toolbar}>
+ <Badge label={statusLabel} variant={statusTone} size="sm" />
+ <Text variant="xs" color="mutedForeground" noMargin>
+ Author: {data.author}
+ </Text>
+ </View>
+
+ <Section variant="card" padding="md" noWrap>
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Executive Summary
+ </Text>
+ <View style={styles.metricsGrid}>
+ {data.summary.map((metric) => (
+ <View
+ key={metric.label}
+ style={[
+ styles.metricCard,
+ {
+ borderLeftColor: metric.tone
+ ? toneColor(theme, metric.tone)
+ : accent,
+ borderLeftWidth: 3,
+ },
+ ]}
+ >
+ <Text style={styles.metricLabel} noMargin>
+ {metric.label}
+ </Text>
+ <Text style={styles.metricValue} noMargin>
+ {metric.value}
+ </Text>
+ {metric.trend ? (
+ <Badge
+ label={metric.trend}
+ size="sm"
+ variant={metric.tone ?? "info"}
+ />
+ ) : null}
+ </View>
+ ))}
+ </View>
+ </Section>
+
+ <Section padding="md" noWrap>
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Performance Trend
+ </Text>
+ <View style={styles.graphShell}>
+ <PdfGraph
+ variant={graphVariant}
+ data={graphData ?? data.series}
+ title={graphTitle}
+ subtitle={graphSubtitle}
+ yLabel={undefined}
+ xLabel={undefined}
+ showGrid={graphVariant !== "pie" && graphVariant !== "donut"}
+ showValues={graphShowValues}
+ smooth={graphVariant === "line" || graphVariant === "area"}
+ legend={graphLegend}
+ height={200}
+ colors={graphColors}
+ fullWidth
+ containerPadding={12}
+ wrapperPadding={12}
+ style={{ marginBottom: 0 }}
+ />
+ </View>
+ </Section>
+
+ <Section padding="md">
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Delivery Table
+ </Text>
+ <DataTable
+ variant="compact"
+ size="compact"
+ stripe
+ columns={[
+ { header: "Stream", key: "label" },
+ { header: "Owner", key: "owner" },
+ { align: "center", header: "Status", key: "status" },
+ {
+ align: "right",
+ header: "Progress",
+ key: "progress",
+ render: (value) => `${String(value)}%`,
+ },
+ { align: "right", header: "Risk", key: "risk" },
+ ]}
+ data={data.rows}
+ footer={{
+ label: "Totals",
+ owner: "-",
+ progress: Math.round(
+ data.rows.reduce((sum, row) => sum + row.progress, 0) /
+ Math.max(data.rows.length, 1)
+ ),
+ risk: "-",
+ status: "-",
+ }}
+ />
+ </Section>
+
+ <Section padding="md" variant="card" noWrap>
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Highlights & Risks
+ </Text>
+ <View style={styles.twoColumn}>
+ <View style={styles.col}>
+ <PdfList
+ variant="checklist"
+ items={data.highlights.map((item) => ({
+ checked: true,
+ text: item,
+ }))}
+ gap="sm"
+ />
+ </View>
+ <View style={styles.col}>
+ <KeyValue
+ size="sm"
+ divided
+ items={[
+ {
+ key: "Open Risks",
+ value: `${data.rows.filter((r) => r.risk !== "Low").length}`,
+ },
+ {
+ key: "On-Track Streams",
+ value: `${data.rows.filter((r) => r.status === "On Track").length}/${data.rows.length}`,
+ },
+ {
+ key: "Average Progress",
+ value: `${Math.round(
+ data.rows.reduce((sum, row) => sum + row.progress, 0) /
+ Math.max(data.rows.length, 1)
+ )}%`,
+ },
+ ]}
+ />
+ </View>
+ </View>
+ <Divider />
+ <Stack gap="sm">
+ <Text variant="xs" color="mutedForeground" noMargin>
+ Best practice: keep each section under one page using `noWrap` for
+ concise blocks.
+ </Text>
+ <Text variant="xs" color="mutedForeground" noMargin>
+ Best practice: pass explicit row keys/owners to avoid ambiguous
+ reporting handoffs.
+ </Text>
+ </Stack>
+ </Section>
+
+ <PageFooter
+ variant="three-column"
+ leftText="Confidential — Internal Use"
+ centerText="Generated with PDFx"
+ rightText="Page 1 of 1"
+ sticky
+ pagePadding={theme.spacing.page.marginLeft}
+ />
+ </Page>
+ </Document>
+ );
+}
+
+export function ReportTemplateFrame({
+ theme,
+ data,
+ titlePrefix,
+ statusLabel,
+ statusTone,
+ graphVariant,
+ graphTitle,
+ graphSubtitle,
+ graphLegend,
+ graphShowValues,
+ graphColors,
+ graphData,
+}: ReportTemplateProps & {
+ titlePrefix: string;
+ statusLabel: string;
+ statusTone: "success" | "warning" | "destructive" | "info";
+ graphVariant: ReportGraphVariant;
+ graphTitle: string;
+ graphSubtitle: string;
+ graphLegend?: "bottom" | "right" | "none";
+ graphShowValues?: boolean;
+ graphColors?: string[];
+ graphData?: { label: string; value: number }[];
+}) {
+ if (!data) {
+ return null;
+ }
+
+ return (
+ <PdfcnThemeProvider theme={theme}>
+ <ReportLayout
+ data={data}
+ titlePrefix={titlePrefix}
+ statusLabel={statusLabel}
+ statusTone={statusTone}
+ graphVariant={graphVariant}
+ graphTitle={graphTitle}
+ graphSubtitle={graphSubtitle}
+ graphLegend={graphLegend}
+ graphShowValues={graphShowValues}
+ graphColors={graphColors}
+ graphData={graphData}
+ />
+ </PdfcnThemeProvider>
+ );
+}
diff --git a/registry/bases/takumi/blocks/report-operations/report-operations.tsx b/registry/bases/takumi/blocks/report-operations/report-operations.tsx
new file mode 100644
index 0000000..bffef43
--- /dev/null
+++ b/registry/bases/takumi/blocks/report-operations/report-operations.tsx
@@ -0,0 +1,103 @@
+import { ReportTemplateFrame } from "./report-layout";
+import type { ReportTemplateProps } from "./report-layout";
+import type { BaseReportData } from "./report.types";
+
+const sampleOperationsData: BaseReportData = {
+ author: "Delivery Office",
+ generatedAt: "February 23, 2026",
+ highlights: [
+ "SLA improved after shift rebalancing and incident triage changes.",
+ "Backlog grew in week 4 due to release-related ticket surge.",
+ "Incident queue remediation plan has executive sponsorship and budget.",
+ ],
+ period: "February 2026",
+ rows: [
+ {
+ label: "L1 Support",
+ owner: "N. Mehta",
+ progress: 91,
+ risk: "Low",
+ status: "On Track",
+ },
+ {
+ label: "L2 Support",
+ owner: "D. Chen",
+ progress: 85,
+ risk: "Low",
+ status: "On Track",
+ },
+ {
+ label: "Incident Queue",
+ owner: "R. Walker",
+ progress: 66,
+ risk: "High",
+ status: "At Risk",
+ },
+ {
+ label: "Automation Rollout",
+ owner: "M. Roy",
+ progress: 77,
+ risk: "Medium",
+ status: "On Track",
+ },
+ ],
+ series: [
+ { label: "W1", value: 69 },
+ { label: "W2", value: 71 },
+ { label: "W3", value: 73 },
+ { label: "W4", value: 74 },
+ { label: "W5", value: 75 },
+ { label: "W6", value: 76 },
+ { label: "W7", value: 78 },
+ { label: "W8", value: 79 },
+ { label: "W9", value: 78 },
+ { label: "W10", value: 80 },
+ { label: "W11", value: 81 },
+ { label: "W12", value: 83 },
+ ],
+ subtitle: "Delivery throughput, SLA adherence, and backlog visibility",
+ summary: [
+ {
+ label: "Tickets Closed",
+ tone: "success",
+ trend: "+9.8% MoM",
+ value: "1,284",
+ },
+ {
+ label: "SLA Hit Rate",
+ tone: "success",
+ trend: "+1.4 pts",
+ value: "96.1%",
+ },
+ { label: "Backlog", tone: "warning", trend: "+6.0%", value: "214" },
+ { label: "Escalations", tone: "success", trend: "-18.5%", value: "17" },
+ ],
+ title: "Monthly Operations Report",
+};
+
+export function OperationsReportDocument({
+ theme,
+ data = sampleOperationsData,
+}: ReportTemplateProps) {
+ return (
+ <ReportTemplateFrame
+ theme={theme}
+ data={data}
+ titlePrefix="Operations Report"
+ statusLabel="Ops: Watch"
+ statusTone="warning"
+ graphVariant="horizontal-bar"
+ graphTitle="Throughput by week"
+ graphSubtitle="Resolved workload distribution"
+ graphLegend="none"
+ graphShowValues
+ graphColors={["#2563EB"]}
+ graphData={[
+ { label: "Incident", value: 66 },
+ { label: "Automation", value: 77 },
+ { label: "L2 Support", value: 85 },
+ { label: "L1 Support", value: 91 },
+ ]}
+ />
+ );
+}
diff --git a/registry/bases/takumi/blocks/report-operations/report.types.ts b/registry/bases/takumi/blocks/report-operations/report.types.ts
new file mode 100644
index 0000000..0a80a7b
--- /dev/null
+++ b/registry/bases/takumi/blocks/report-operations/report.types.ts
@@ -0,0 +1,31 @@
+export interface SummaryMetric {
+ label: string;
+ value: string;
+ trend?: string;
+ tone?: "success" | "warning" | "destructive" | "info";
+}
+
+export type ReportRow = Record<string, unknown> & {
+ label: string;
+ owner: string;
+ status: string;
+ progress: number;
+ risk?: string;
+};
+
+export interface ReportSeriesPoint {
+ label: string;
+ value: number;
+}
+
+export interface BaseReportData {
+ title: string;
+ subtitle: string;
+ generatedAt: string;
+ period: string;
+ author: string;
+ summary: SummaryMetric[];
+ rows: ReportRow[];
+ series: ReportSeriesPoint[];
+ highlights: string[];
+}
diff --git a/registry/bases/takumi/blocks/report-security/report-layout.tsx b/registry/bases/takumi/blocks/report-security/report-layout.tsx
new file mode 100644
index 0000000..dc73747
--- /dev/null
+++ b/registry/bases/takumi/blocks/report-security/report-layout.tsx
@@ -0,0 +1,369 @@
+import type { PdfcnTheme } from "@/registry/themes";
+
+import {
+ Badge,
+ DataTable,
+ Divider,
+ KeyValue,
+ PageFooter,
+ PageHeader,
+ PdfGraph,
+ PdfList,
+ PdfcnThemeProvider,
+ Section,
+ Stack,
+ Text,
+ usePdfcnTheme,
+} from "../../components";
+import { View, StyleSheet, Document, Page } from "../../lib/takumi-primitives";
+import type { BaseReportData } from "./report.types";
+
+export interface ReportTemplateProps {
+ theme?: PdfcnTheme;
+ data?: BaseReportData;
+}
+
+type ReportGraphVariant =
+ | "bar"
+ | "horizontal-bar"
+ | "line"
+ | "area"
+ | "pie"
+ | "donut";
+
+interface ReportLayoutProps {
+ data: BaseReportData;
+ titlePrefix: string;
+ statusLabel: string;
+ statusTone: "success" | "warning" | "destructive" | "info";
+ graphVariant: ReportGraphVariant;
+ graphTitle: string;
+ graphSubtitle: string;
+ graphLegend?: "bottom" | "right" | "none";
+ graphShowValues?: boolean;
+ graphColors?: string[];
+ graphData?: { label: string; value: number }[];
+}
+
+function toneColor(
+ theme: PdfcnTheme,
+ tone: "success" | "warning" | "destructive" | "info"
+) {
+ if (tone === "success") {
+ return theme.colors.success;
+ }
+ if (tone === "warning") {
+ return theme.colors.warning;
+ }
+ if (tone === "destructive") {
+ return theme.colors.destructive;
+ }
+ return theme.colors.info;
+}
+
+export function ReportLayout({
+ data,
+ titlePrefix,
+ statusLabel,
+ statusTone,
+ graphVariant,
+ graphTitle,
+ graphSubtitle,
+ graphLegend = "none",
+ graphShowValues = false,
+ graphColors,
+ graphData,
+}: ReportLayoutProps) {
+ const theme = usePdfcnTheme();
+ const accent = toneColor(theme, statusTone);
+
+ const styles = StyleSheet.create({
+ col: {
+ flex: 1,
+ },
+ graphShell: {
+ backgroundColor: theme.colors.background,
+ borderColor: theme.colors.border,
+ borderRadius: theme.primitives.borderRadius.md,
+ borderStyle: "solid",
+ borderWidth: 1,
+ padding: 12,
+ },
+ metricCard: {
+ backgroundColor: theme.colors.background,
+ borderColor: theme.colors.border,
+ borderRadius: theme.primitives.borderRadius.md,
+ borderStyle: "solid",
+ borderWidth: 1,
+ padding: 8,
+ width: "48.6%",
+ },
+ metricLabel: {
+ color: theme.colors.mutedForeground,
+ fontSize: 8,
+ letterSpacing: 0.5,
+ marginBottom: 2,
+ textTransform: "uppercase",
+ },
+ metricTrend: {
+ color: theme.colors.mutedForeground,
+ fontSize: 9,
+ },
+ metricValue: {
+ color: theme.colors.foreground,
+ fontSize: 14,
+ fontWeight: theme.primitives.fontWeights.bold,
+ marginBottom: 2,
+ },
+ metricsGrid: {
+ flexDirection: "row",
+ flexWrap: "wrap",
+ gap: 8,
+ },
+ page: {
+ backgroundColor: theme.colors.background,
+ paddingBottom: theme.spacing.page.marginBottom,
+ paddingLeft: theme.spacing.page.marginLeft,
+ paddingRight: theme.spacing.page.marginRight,
+ paddingTop: theme.spacing.page.marginTop,
+ },
+ toolbar: {
+ alignItems: "center",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ marginBottom: 8,
+ },
+ twoColumn: {
+ alignItems: "flex-start",
+ flexDirection: "row",
+ gap: 10,
+ },
+ });
+
+ return (
+ <Document title={`${titlePrefix} ${data.period}`}>
+ <Page size="A4" style={styles.page}>
+ <PageHeader
+ variant="two-column"
+ title={data.title}
+ subtitle={`${titlePrefix} · ${data.subtitle}`}
+ rightText={data.period}
+ rightSubText={`Generated ${data.generatedAt}`}
+ marginBottom={14}
+ />
+
+ <View style={styles.toolbar}>
+ <Badge label={statusLabel} variant={statusTone} size="sm" />
+ <Text variant="xs" color="mutedForeground" noMargin>
+ Author: {data.author}
+ </Text>
+ </View>
+
+ <Section variant="card" padding="md" noWrap>
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Executive Summary
+ </Text>
+ <View style={styles.metricsGrid}>
+ {data.summary.map((metric) => (
+ <View
+ key={metric.label}
+ style={[
+ styles.metricCard,
+ {
+ borderLeftColor: metric.tone
+ ? toneColor(theme, metric.tone)
+ : accent,
+ borderLeftWidth: 3,
+ },
+ ]}
+ >
+ <Text style={styles.metricLabel} noMargin>
+ {metric.label}
+ </Text>
+ <Text style={styles.metricValue} noMargin>
+ {metric.value}
+ </Text>
+ {metric.trend ? (
+ <Badge
+ label={metric.trend}
+ size="sm"
+ variant={metric.tone ?? "info"}
+ />
+ ) : null}
+ </View>
+ ))}
+ </View>
+ </Section>
+
+ <Section padding="md" noWrap>
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Performance Trend
+ </Text>
+ <View style={styles.graphShell}>
+ <PdfGraph
+ variant={graphVariant}
+ data={graphData ?? data.series}
+ title={graphTitle}
+ subtitle={graphSubtitle}
+ yLabel={undefined}
+ xLabel={undefined}
+ showGrid={graphVariant !== "pie" && graphVariant !== "donut"}
+ showValues={graphShowValues}
+ smooth={graphVariant === "line" || graphVariant === "area"}
+ legend={graphLegend}
+ height={200}
+ colors={graphColors}
+ fullWidth
+ containerPadding={12}
+ wrapperPadding={12}
+ style={{ marginBottom: 0 }}
+ />
+ </View>
+ </Section>
+
+ <Section padding="md">
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Delivery Table
+ </Text>
+ <DataTable
+ variant="compact"
+ size="compact"
+ stripe
+ columns={[
+ { header: "Stream", key: "label" },
+ { header: "Owner", key: "owner" },
+ { align: "center", header: "Status", key: "status" },
+ {
+ align: "right",
+ header: "Progress",
+ key: "progress",
+ render: (value) => `${String(value)}%`,
+ },
+ { align: "right", header: "Risk", key: "risk" },
+ ]}
+ data={data.rows}
+ footer={{
+ label: "Totals",
+ owner: "-",
+ progress: Math.round(
+ data.rows.reduce((sum, row) => sum + row.progress, 0) /
+ Math.max(data.rows.length, 1)
+ ),
+ risk: "-",
+ status: "-",
+ }}
+ />
+ </Section>
+
+ <Section padding="md" variant="card" noWrap>
+ <Text variant="sm" transform="uppercase" color="mutedForeground">
+ Highlights & Risks
+ </Text>
+ <View style={styles.twoColumn}>
+ <View style={styles.col}>
+ <PdfList
+ variant="checklist"
+ items={data.highlights.map((item) => ({
+ checked: true,
+ text: item,
+ }))}
+ gap="sm"
+ />
+ </View>
+ <View style={styles.col}>
+ <KeyValue
+ size="sm"
+ divided
+ items={[
+ {
+ key: "Open Risks",
+ value: `${data.rows.filter((r) => r.risk !== "Low").length}`,
+ },
+ {
+ key: "On-Track Streams",
+ value: `${data.rows.filter((r) => r.status === "On Track").length}/${data.rows.length}`,
+ },
+ {
+ key: "Average Progress",
+ value: `${Math.round(
+ data.rows.reduce((sum, row) => sum + row.progress, 0) /
+ Math.max(data.rows.length, 1)
+ )}%`,
+ },
+ ]}
+ />
+ </View>
+ </View>
+ <Divider />
+ <Stack gap="sm">
+ <Text variant="xs" color="mutedForeground" noMargin>
+ Best practice: keep each section under one page using `noWrap` for
+ concise blocks.
+ </Text>
+ <Text variant="xs" color="mutedForeground" noMargin>
+ Best practice: pass explicit row keys/owners to avoid ambiguous
+ reporting handoffs.
+ </Text>
+ </Stack>
+ </Section>
+
+ <PageFooter
+ variant="three-column"
+ leftText="Confidential — Internal Use"
+ centerText="Generated with PDFx"
+ rightText="Page 1 of 1"
+ sticky
+ pagePadding={theme.spacing.page.marginLeft}
+ />
+ </Page>
+ </Document>
+ );
+}
+
+export function ReportTemplateFrame({
+ theme,
+ data,
+ titlePrefix,
+ statusLabel,
+ statusTone,
+ graphVariant,
+ graphTitle,
+ graphSubtitle,
+ graphLegend,
+ graphShowValues,
+ graphColors,
+ graphData,
+}: ReportTemplateProps & {
+ titlePrefix: string;
+ statusLabel: string;
+ statusTone: "success" | "warning" | "destructive" | "info";
+ graphVariant: ReportGraphVariant;
+ graphTitle: string;
+ graphSubtitle: string;
+ graphLegend?: "bottom" | "right" | "none";
+ graphShowValues?: boolean;
+ graphColors?: string[];
+ graphData?: { label: string; value: number }[];
+}) {
+ if (!data) {
+ return null;
+ }
+
+ return (
+ <PdfcnThemeProvider theme={theme}>
+ <ReportLayout
+ data={data}
+ titlePrefix={titlePrefix}
+ statusLabel={statusLabel}
+ statusTone={statusTone}
+ graphVariant={graphVariant}
+ graphTitle={graphTitle}
+ graphSubtitle={graphSubtitle}
+ graphLegend={graphLegend}
+ graphShowValues={graphShowValues}
+ graphColors={graphColors}
+ graphData={graphData}
+ />
+ </PdfcnThemeProvider>
+ );
+}
diff --git a/registry/bases/takumi/blocks/report-security/report-security.tsx b/registry/bases/takumi/blocks/report-security/report-security.tsx
new file mode 100644
index 0000000..dbf8b52
--- /dev/null
+++ b/registry/bases/takumi/blocks/report-security/report-security.tsx
@@ -0,0 +1,98 @@
+import { ReportTemplateFrame } from "./report-layout";
+import type { ReportTemplateProps } from "./report-layout";
+import type { BaseReportData } from "./report.types";
+
+const sampleSecurityData: BaseReportData = {
+ author: "Security Engineering",
+ generatedAt: "February 23, 2026",
+ highlights: [
+ "Critical vulnerabilities reduced through mandatory patch windows.",
+ "Secrets rotation remains the highest-risk stream and needs additional staffing.",
+ "External penetration test scheduled for next sprint to validate fixes.",
+ ],
+ period: "Sprint 05, 2026",
+ rows: [
+ {
+ label: "Identity Hardening",
+ owner: "E. Brown",
+ progress: 87,
+ risk: "Low",
+ status: "On Track",
+ },
+ {
+ label: "Secrets Rotation",
+ owner: "P. Nair",
+ progress: 58,
+ risk: "High",
+ status: "At Risk",
+ },
+ {
+ label: "Dependency Scanning",
+ owner: "I. Shah",
+ progress: 81,
+ risk: "Medium",
+ status: "On Track",
+ },
+ {
+ label: "WAF Policy",
+ owner: "S. Reed",
+ progress: 76,
+ risk: "Low",
+ status: "On Track",
+ },
+ ],
+ series: [
+ { label: "W1", value: 61 },
+ { label: "W2", value: 63 },
+ { label: "W3", value: 64 },
+ { label: "W4", value: 66 },
+ { label: "W5", value: 67 },
+ { label: "W6", value: 68 },
+ { label: "W7", value: 69 },
+ { label: "W8", value: 71 },
+ { label: "W9", value: 72 },
+ { label: "W10", value: 74 },
+ { label: "W11", value: 76 },
+ { label: "W12", value: 78 },
+ ],
+ subtitle: "Vulnerability trends, control maturity, and remediation health",
+ summary: [
+ {
+ label: "Critical Vulns",
+ tone: "success",
+ trend: "-3 from last sprint",
+ value: "2",
+ },
+ { label: "Patch SLA", tone: "success", trend: "+5.3 pts", value: "92.0%" },
+ { label: "Open Findings", tone: "warning", trend: "+4", value: "41" },
+ { label: "Control Score", tone: "info", trend: "+2 pts", value: "84/100" },
+ ],
+ title: "Security Posture Report",
+};
+
+export function SecurityReportDocument({
+ theme,
+ data = sampleSecurityData,
+}: ReportTemplateProps) {
+ return (
+ <ReportTemplateFrame
+ theme={theme}
+ data={data}
+ titlePrefix="Security Report"
+ statusLabel="Security: Action Needed"
+ statusTone="destructive"
+ graphVariant="donut"
+ graphTitle="Open risk distribution"
+ graphSubtitle="High/Medium/Low workload share"
+ graphLegend="right"
+ graphShowValues
+ graphColors={["#DC2626", "#F59E0B", "#16A34A", "#0EA5E9"]}
+ graphData={[
+ { label: "High Risk", value: 14 },
+ { label: "Medium Risk", value: 17 },
+ { label: "Low Risk", value: 8 },
+ { label: "Info", value: 4 },
+ ]}
+ />
+ );
+}
diff --git a/registry/bases/takumi/blocks/report-security/report.types.ts b/registry/bases/takumi/blocks/report-security/report.types.ts
new file mode 100644
index 0000000..0a80a7b
--- /dev/null
+++ b/registry/bases/takumi/blocks/report-security/report.types.ts
@@ -0,0 +1,31 @@
+export interface SummaryMetric {
+ label: string;
+ value: string;
+ trend?: string;
+ tone?: "success" | "warning" | "destructive" | "info";
+}
+
+export type ReportRow = Record<string, unknown> & {
+ label: string;
+ owner: string;
+ status: string;
+ progress: number;
+ risk?: string;
+};
+
+export interface ReportSeriesPoint {
+ label: string;
+ value: number;
+}
+
+export interface BaseReportData {
+ title: string;
+ subtitle: string;
+ generatedAt: string;
+ period: string;
+ author: string;
+ summary: SummaryMetric[];
+ rows: ReportRow[];
+ series: ReportSeriesPoint[];
+ highlights: string[];
+}
diff --git a/registry/bases/takumi/components/alert/alert.tsx b/registry/bases/takumi/components/alert/alert.tsx
new file mode 100644
index 0000000..2a3e0f2
--- /dev/null
+++ b/registry/bases/takumi/components/alert/alert.tsx
@@ -0,0 +1,258 @@
+import type { ReactNode } from "react";
+
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { View, Text as PDFText, StyleSheet } from "../../lib/takumi-primitives";
+import type { Style } from "../../lib/takumi-primitives";
+import { Circle, Line, Path, Svg } from "../../lib/takumi-svg";
+
+export type AlertVariant = "info" | "success" | "warning" | "error";
+
+/**
+ * Alert box with severity variants for info, success, warning, and error states.
+ * Props - `variant` | `title` | `children` | `showIcon` | `showBorder` | `style`
+ * @see {@link PdfAlertProps}
+ */
+export interface PdfAlertProps extends Omit<PDFComponentProps, "children"> {
+ /**
+ * @default 'info'
+ */
+ variant?: AlertVariant;
+ title?: string;
+ children?: ReactNode;
+ /**
+ * @default true
+ */
+ showIcon?: boolean;
+ /**
+ * @default true
+ */
+ showBorder?: boolean;
+}
+
+/** Stroke width for all alert SVG icons (SVG user units). */
+const ICON_STROKE_WIDTH = 1.5;
+
+const SvgWrap = ({ children }: { children: ReactNode }) => (
+ <Svg width={16} height={16} viewBox="0 0 16 16">
+ {children}
+ </Svg>
+);
+
+const ICON_MAP = {
+ error: ({ color }: { color: string }) => (
+ <SvgWrap>
+ <Circle
+ cx={8}
+ cy={8}
+ r={7}
+ fill="none"
+ stroke={color}
+ strokeWidth={ICON_STROKE_WIDTH}
+ />
+ <Line
+ x1={5.5}
+ y1={5.5}
+ x2={10.5}
+ y2={10.5}
+ stroke={color}
+ strokeWidth={ICON_STROKE_WIDTH}
+ strokeLinecap="round"
+ />
+ <Line
+ x1={10.5}
+ y1={5.5}
+ x2={5.5}
+ y2={10.5}
+ stroke={color}
+ strokeWidth={ICON_STROKE_WIDTH}
+ strokeLinecap="round"
+ />
+ </SvgWrap>
+ ),
+ info: ({ color }: { color: string }) => (
+ <SvgWrap>
+ <Circle
+ cx={8}
+ cy={8}
+ r={7}
+ fill="none"
+ stroke={color}
+ strokeWidth={ICON_STROKE_WIDTH}
+ />
+ <Circle cx={8} cy={4.5} r={1} fill={color} />
+ <Line
+ x1={8}
+ y1={7}
+ x2={8}
+ y2={11.5}
+ stroke={color}
+ strokeWidth={ICON_STROKE_WIDTH}
+ strokeLinecap="round"
+ />
+ </SvgWrap>
+ ),
+ success: ({ color }: { color: string }) => (
+ <SvgWrap>
+ <Circle
+ cx={8}
+ cy={8}
+ r={7}
+ fill="none"
+ stroke={color}
+ strokeWidth={ICON_STROKE_WIDTH}
+ />
+ <Path
+ d="M5 8 L7 10 L11 6"
+ fill="none"
+ stroke={color}
+ strokeWidth={ICON_STROKE_WIDTH}
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </SvgWrap>
+ ),
+ warning: ({ color }: { color: string }) => (
+ <SvgWrap>
+ <Path
+ d="M8 1.5 L15 14.5 L1 14.5 Z"
+ fill="none"
+ stroke={color}
+ strokeWidth={ICON_STROKE_WIDTH}
+ strokeLinejoin="round"
+ />
+ <Line
+ x1={8}
+ y1={6}
+ x2={8}
+ y2={10}
+ stroke={color}
+ strokeWidth={ICON_STROKE_WIDTH}
+ strokeLinecap="round"
+ />
+ <Circle cx={8} cy={12.5} r={0.75} fill={color} />
+ </SvgWrap>
+ ),
+};
+
+function AlertIcon({
+ variant,
+ color,
+}: {
+ variant: AlertVariant;
+ color: string;
+}) {
+ const Icon = ICON_MAP[variant];
+ return <Icon color={color} />;
+}
+
+function createAlertStyles(theme: PdfcnTheme) {
+ const { typography, colors, primitives } = theme;
+
+ const variantColors = {
+ error: colors.destructive ?? "#EF4444",
+ info: colors.info ?? "#3B82F6",
+ success: colors.success ?? "#22C55E",
+ warning: colors.warning ?? "#F59E0B",
+ } satisfies Record<AlertVariant, string>;
+
+ const bl = (color: string) => ({
+ borderLeftColor: color,
+ borderLeftWidth: 4,
+ });
+
+ const sheet = StyleSheet.create({
+ bg: {
+ backgroundColor: colors.muted,
+ },
+ borderError: bl(variantColors.error),
+ borderInfo: bl(variantColors.info),
+ borderSuccess: bl(variantColors.success),
+ borderWarning: bl(variantColors.warning),
+ container: {
+ borderRadius: 4,
+ flexDirection: "row",
+ marginBottom: theme.spacing.componentGap,
+ padding: 12,
+ },
+ contentContainer: { flex: 1 },
+ description: {
+ color: colors.mutedForeground,
+ fontFamily: typography.body.fontFamily,
+ fontSize: primitives.typography.sm,
+ lineHeight: typography.body.lineHeight,
+ },
+ iconContainer: {
+ alignItems: "center",
+ justifyContent: "flex-start",
+ marginRight: 10,
+ paddingTop: 2,
+ width: 20,
+ },
+ title: {
+ color: colors.foreground,
+ fontFamily: typography.heading.fontFamily,
+ fontSize: primitives.typography.sm,
+ fontWeight: primitives.fontWeights.semibold,
+ marginBottom: 4,
+ },
+ });
+
+ return {
+ ...sheet,
+ borderMap: {
+ error: sheet.borderError,
+ info: sheet.borderInfo,
+ success: sheet.borderSuccess,
+ warning: sheet.borderWarning,
+ } as Record<AlertVariant, Style>,
+ /** Resolved hex colors for each variant — used to tint the SVG icons. */
+ variantColors,
+ };
+}
+
+export function PdfAlert({
+ variant = "info",
+ title,
+ children,
+ showIcon = true,
+ showBorder = true,
+ style,
+}: PdfAlertProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createAlertStyles(theme), [theme]);
+
+ if (!title && !children) {
+ return null;
+ }
+
+ const containerStyles: Style[] = [
+ styles.container,
+ styles.bg,
+ ...(showBorder ? [styles.borderMap[variant]] : []),
+ ...(style ? [style].flat() : []),
+ ];
+
+ return (
+ <View
+ style={[{ breakInside: "avoid" as const }, containerStyles]
+ .flat()
+ .filter(Boolean)}
+ >
+ {showIcon && (
+ <View style={styles.iconContainer}>
+ <AlertIcon variant={variant} color={styles.variantColors[variant]} />
+ </View>
+ )}
+ <View style={styles.contentContainer}>
+ {title && <PDFText style={styles.title}>{title}</PDFText>}
+ {typeof children === "string" ? (
+ <PDFText style={styles.description}>{children}</PDFText>
+ ) : (
+ children
+ )}
+ </View>
+ </View>
+ );
+}
diff --git a/registry/bases/takumi/components/alert/index.ts b/registry/bases/takumi/components/alert/index.ts
new file mode 100644
index 0000000..9961c94
--- /dev/null
+++ b/registry/bases/takumi/components/alert/index.ts
@@ -0,0 +1 @@
+export { PdfAlert, type PdfAlertProps, type AlertVariant } from "./alert";
diff --git a/registry/bases/takumi/components/badge/badge.tsx b/registry/bases/takumi/components/badge/badge.tsx
new file mode 100644
index 0000000..9221f3c
--- /dev/null
+++ b/registry/bases/takumi/components/badge/badge.tsx
@@ -0,0 +1,154 @@
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { resolveColor } from "../../lib/resolve-color";
+import { View, Text as PDFText, StyleSheet } from "../../lib/takumi-primitives";
+import type { Style } from "../../lib/takumi-primitives";
+
+export type BadgeVariant =
+ | "default"
+ | "primary"
+ | "success"
+ | "warning"
+ | "destructive"
+ | "info"
+ | "outline";
+export type BadgeSize = "sm" | "md" | "lg";
+
+/**
+ * Inline label for status, tags, or categories.
+ *
+ * Accepts text via either `label` prop or `children` (string). `label` takes
+ * precedence when both are provided. The children pattern (`<Badge>text</Badge>`)
+ * is supported for compatibility with common React idioms, but note that
+ * `Takumi PDF primitives` doesn't support JSX children the way HTML does — only
+ * string children are accepted.
+ *
+ * Props - `label` | `children` | `variant` | `size` | `background` | `color` | `style`
+ * @see {@link BadgeProps}
+ */
+export interface BadgeProps extends Omit<PDFComponentProps, "children"> {
+ /** Text to display. Takes precedence over children when both are provided. */
+ label?: string;
+ /** String children as an alternative to the label prop. */
+ children?: string;
+ /**
+ * @default 'default'
+ */
+ variant?: BadgeVariant;
+ /**
+ * @default 'md'
+ */
+ size?: BadgeSize;
+ background?: string;
+ color?: string;
+}
+
+function createBadgeStyles(t: PdfcnTheme) {
+ const { spacing, borderRadius, fontWeights } = t.primitives;
+ const c = t.colors;
+ const textBase = {
+ fontFamily: t.typography.body.fontFamily,
+ fontWeight: fontWeights.semibold,
+ letterSpacing: 0.3,
+ };
+ const variantBox = (borderColor: string, bgColor: string = c.muted) => ({
+ backgroundColor: bgColor,
+ borderColor,
+ borderStyle: "solid" as const,
+ borderWidth: spacing[0.5],
+ });
+ const sheet = StyleSheet.create({
+ containerBase: {
+ alignItems: "center" as const,
+ alignSelf: "flex-start" as const,
+ borderRadius: borderRadius.full,
+ flexDirection: "row" as const,
+ },
+ sizeLg: { paddingHorizontal: spacing[4], paddingVertical: spacing[2] },
+ sizeMd: { paddingHorizontal: spacing[3], paddingVertical: spacing[1] },
+ sizeSm: { paddingHorizontal: spacing[2], paddingVertical: spacing[0.5] },
+ textDefault: { ...textBase, color: c.mutedForeground },
+ textDestructive: { ...textBase, color: c.destructive },
+ textInfo: { ...textBase, color: c.info },
+ textLg: { fontSize: t.primitives.typography.sm },
+ textMd: { fontSize: t.primitives.typography.xs },
+ textOutline: { ...textBase, color: c.foreground },
+ textPrimary: { ...textBase, color: c.primaryForeground },
+ textSm: { fontSize: t.primitives.typography.xs - 1 },
+ textSuccess: { ...textBase, color: c.success },
+ textWarning: { ...textBase, color: c.warning },
+ variantDefault: variantBox(c.border),
+ variantDestructive: variantBox(c.destructive),
+ variantInfo: variantBox(c.info),
+ variantOutline: variantBox(c.border, c.background),
+ variantPrimary: variantBox(c.primary, c.primary),
+ variantSuccess: variantBox(c.success),
+ variantWarning: variantBox(c.warning),
+ });
+ return {
+ ...sheet,
+ containerSizeMap: {
+ lg: sheet.sizeLg,
+ md: sheet.sizeMd,
+ sm: sheet.sizeSm,
+ } as Record<BadgeSize, Style>,
+ containerVariantMap: {
+ default: sheet.variantDefault,
+ destructive: sheet.variantDestructive,
+ info: sheet.variantInfo,
+ outline: sheet.variantOutline,
+ primary: sheet.variantPrimary,
+ success: sheet.variantSuccess,
+ warning: sheet.variantWarning,
+ } as Record<BadgeVariant, Style>,
+ textSizeMap: {
+ lg: sheet.textLg,
+ md: sheet.textMd,
+ sm: sheet.textSm,
+ } as Record<BadgeSize, Style>,
+ textVariantMap: {
+ default: sheet.textDefault,
+ destructive: sheet.textDestructive,
+ info: sheet.textInfo,
+ outline: sheet.textOutline,
+ primary: sheet.textPrimary,
+ success: sheet.textSuccess,
+ warning: sheet.textWarning,
+ } as Record<BadgeVariant, Style>,
+ };
+}
+
+export function Badge({
+ label,
+ children,
+ variant = "default",
+ size = "md",
+ background,
+ color,
+ style,
+}: BadgeProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createBadgeStyles(theme), [theme]);
+ // `label` takes precedence; fall back to string children for React idiom compatibility
+ const text = label ?? children ?? "";
+ const containerStyles: Style[] = [
+ styles.containerBase,
+ styles.containerVariantMap[variant],
+ styles.containerSizeMap[size],
+ ...(background
+ ? [{ backgroundColor: resolveColor(background, theme.colors) }]
+ : []),
+ ...(style ? [style].flat() : []),
+ ];
+ const textStyles: Style[] = [
+ styles.textVariantMap[variant],
+ styles.textSizeMap[size],
+ ...(color ? [{ color: resolveColor(color, theme.colors) }] : []),
+ ];
+ return (
+ <View style={containerStyles}>
+ <PDFText style={textStyles}>{text}</PDFText>
+ </View>
+ );
+}
diff --git a/registry/bases/takumi/components/badge/index.ts b/registry/bases/takumi/components/badge/index.ts
new file mode 100644
index 0000000..2ae6ef6
--- /dev/null
+++ b/registry/bases/takumi/components/badge/index.ts
@@ -0,0 +1,6 @@
+export {
+ Badge,
+ type BadgeProps,
+ type BadgeVariant,
+ type BadgeSize,
+} from "./badge";
diff --git a/registry/bases/takumi/components/card/card.tsx b/registry/bases/takumi/components/card/card.tsx
new file mode 100644
index 0000000..d9a8738
--- /dev/null
+++ b/registry/bases/takumi/components/card/card.tsx
@@ -0,0 +1,107 @@
+import type { ReactNode } from "react";
+
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { View, Text as PDFText, StyleSheet } from "../../lib/takumi-primitives";
+import type { Style } from "../../lib/takumi-primitives";
+
+export type CardVariant = "default" | "bordered" | "muted";
+
+/**
+ * Bordered content card with optional title and padding presets.
+ * Props - `title` | `children` | `variant` | `padding` | `wrap` | `style`
+ * @see {@link PdfCardProps}
+ */
+export interface PdfCardProps extends Omit<PDFComponentProps, "children"> {
+ title?: string;
+ children?: ReactNode;
+ /**
+ * @default 'default'
+ */
+ variant?: CardVariant;
+ /**
+ * @default 'md'
+ */
+ padding?: "sm" | "md" | "lg";
+ /**
+ * When false, the card will not split across PDF pages.
+ * @default false
+ */
+ wrap?: boolean;
+}
+
+function createCardStyles(t: PdfcnTheme) {
+ const { spacing, borderRadius, fontWeights } = t.primitives;
+ return StyleSheet.create({
+ body: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ lineHeight: t.typography.body.lineHeight,
+ },
+ card: {
+ backgroundColor: t.colors.background,
+ borderColor: t.colors.border,
+ borderRadius: borderRadius.sm,
+ borderStyle: "solid",
+ borderWidth: 1,
+ marginBottom: t.spacing.componentGap,
+ },
+ cardBordered: { borderWidth: 2 },
+ cardMuted: { backgroundColor: t.colors.muted },
+ paddingLg: { padding: spacing[4] },
+ paddingMd: { padding: spacing[3] },
+ paddingSm: { padding: spacing[2] },
+ title: {
+ borderBottomColor: t.colors.border,
+ borderBottomStyle: "solid",
+ borderBottomWidth: 1,
+ color: t.colors.foreground,
+ fontFamily: t.typography.heading.fontFamily,
+ fontSize: t.primitives.typography.base,
+ fontWeight: fontWeights.semibold,
+ lineHeight: t.typography.heading.lineHeight,
+ marginBottom: spacing[2],
+ paddingBottom: spacing[1] + 2,
+ },
+ });
+}
+
+export function PdfCard({
+ title,
+ children,
+ variant = "default",
+ padding = "md",
+ wrap = false,
+ style,
+}: PdfCardProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createCardStyles(theme), [theme]);
+ const paddingMap = {
+ lg: styles.paddingLg,
+ md: styles.paddingMd,
+ sm: styles.paddingSm,
+ };
+ const cardStyles: Style[] = [styles.card];
+ if (variant === "bordered") {
+ cardStyles.push(styles.cardBordered);
+ }
+ if (variant === "muted") {
+ cardStyles.push(styles.cardMuted);
+ }
+ cardStyles.push(paddingMap[padding]);
+ if (style) {
+ cardStyles.push(style);
+ }
+ return (
+ <View wrap={wrap} style={cardStyles}>
+ {title ? <PDFText style={styles.title}>{title}</PDFText> : null}
+ {typeof children === "string" ? (
+ <PDFText style={styles.body}>{children}</PDFText>
+ ) : (
+ children
+ )}
+ </View>
+ );
+}
diff --git a/registry/bases/takumi/components/card/index.ts b/registry/bases/takumi/components/card/index.ts
new file mode 100644
index 0000000..17f5fea
--- /dev/null
+++ b/registry/bases/takumi/components/card/index.ts
@@ -0,0 +1 @@
+export { PdfCard, type PdfCardProps, type CardVariant } from "./card";
diff --git a/registry/bases/takumi/components/data-table/data-table.styles.ts b/registry/bases/takumi/components/data-table/data-table.styles.ts
new file mode 100644
index 0000000..39bd368
--- /dev/null
+++ b/registry/bases/takumi/components/data-table/data-table.styles.ts
@@ -0,0 +1,53 @@
+import type { PdfcnTheme } from "@/registry/themes";
+
+import { StyleSheet } from "../../lib/takumi-primitives";
+
+/**
+ * Creates compact-mode cell and text styles for the DataTable component.
+ * Used when `size="compact"` to render denser rows with smaller font sizes.
+ * @param t - The resolved PdfcnTheme instance.
+ */
+export function createCompactStyles(t: PdfcnTheme) {
+ const { spacing, fontWeights, lineHeights } = t.primitives;
+ return StyleSheet.create({
+ cell: {
+ paddingHorizontal: spacing[2],
+ paddingVertical: spacing[0.5],
+ },
+ footerText: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.primitives.typography.xs,
+ fontWeight: fontWeights.semibold,
+ lineHeight: lineHeights.normal,
+ },
+ headerText: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.primitives.typography.xs,
+ fontWeight: fontWeights.semibold,
+ lineHeight: lineHeights.normal,
+ },
+ text: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.primitives.typography.xs,
+ lineHeight: lineHeights.normal,
+ },
+ });
+}
+
+/**
+ * Converts an arbitrary cell value to a display string.
+ * Returns an empty string for null/undefined values.
+ * @param value - The raw cell value to format.
+ */
+export function formatValue(value: unknown): string {
+ if (value === null || value === undefined) {
+ return "";
+ }
+ if (typeof value === "number") {
+ return String(value);
+ }
+ return String(value);
+}
diff --git a/registry/bases/takumi/components/data-table/data-table.tsx b/registry/bases/takumi/components/data-table/data-table.tsx
new file mode 100644
index 0000000..0b0acf0
--- /dev/null
+++ b/registry/bases/takumi/components/data-table/data-table.tsx
@@ -0,0 +1,145 @@
+import { Fragment } from "react";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { Text as PDFText } from "../../lib/takumi-primitives";
+import type { Style } from "../../lib/takumi-primitives";
+import {
+ Table,
+ TableBody,
+ TableCell,
+ TableFooter,
+ TableHeader,
+ TableRow,
+} from "../table";
+import { createCompactStyles, formatValue } from "./data-table.styles";
+import type { DataTableProps } from "./data-table.types";
+
+export function DataTable<T extends Record<string, unknown>>({
+ columns,
+ data,
+ variant = "grid",
+ footer,
+ stripe = false,
+ size = "default",
+ noWrap = false,
+ style,
+}: DataTableProps<T>) {
+ const theme = usePdfcnTheme();
+ const compact = useSafeMemo(() => createCompactStyles(theme), [theme]);
+ const isCompact = size === "compact";
+
+ return (
+ <Table variant={variant} zebraStripe={stripe} noWrap={noWrap} style={style}>
+ <TableHeader>
+ <TableRow header>
+ {columns.map((col) => (
+ <TableCell
+ key={col.key}
+ header
+ align={col.align ?? "left"}
+ width={col.width}
+ style={isCompact ? compact.cell : undefined}
+ >
+ {isCompact ? (
+ <PDFText
+ style={[
+ compact.headerText,
+ col.align ? ({ textAlign: col.align } as Style) : {},
+ ]}
+ >
+ {col.header}
+ </PDFText>
+ ) : (
+ col.header
+ )}
+ </TableCell>
+ ))}
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {data.map((row, i) => (
+ // biome-ignore lint/suspicious/noArrayIndexKey: DataTable has no row id; order is stable for static data
+ <Fragment key={i}>
+ <TableRow>
+ {columns.map((col) => {
+ const value = row[col.key];
+ const rendered = col.render ? col.render(value, row) : null;
+ const text = rendered === null ? formatValue(value) : null;
+ return (
+ <TableCell
+ key={col.key}
+ align={col.align ?? "left"}
+ width={col.width}
+ style={isCompact ? compact.cell : undefined}
+ >
+ {isCompact ? (
+ rendered !== null ? (
+ rendered
+ ) : (
+ <PDFText
+ style={[
+ compact.text,
+ col.align
+ ? ({ textAlign: col.align } as Style)
+ : {},
+ ]}
+ >
+ {text}
+ </PDFText>
+ )
+ ) : (rendered !== null ? (
+ rendered
+ ) : (
+ text
+ ))}
+ </TableCell>
+ );
+ })}
+ </TableRow>
+ </Fragment>
+ ))}
+ </TableBody>
+ {footer && (
+ <TableFooter>
+ <TableRow footer>
+ {columns.map((col) => {
+ const value = col.key in footer ? footer[col.key] : "";
+ const rendered = col.renderFooter
+ ? col.renderFooter(value)
+ : null;
+ const text = rendered === null ? formatValue(value) : null;
+ return (
+ <TableCell
+ key={col.key}
+ footer={!!value}
+ align={col.align ?? "left"}
+ width={col.width}
+ style={isCompact ? compact.cell : undefined}
+ >
+ {isCompact ? (
+ rendered !== null ? (
+ rendered
+ ) : (
+ <PDFText
+ style={[
+ value ? compact.footerText : compact.text,
+ col.align ? ({ textAlign: col.align } as Style) : {},
+ ]}
+ >
+ {text}
+ </PDFText>
+ )
+ ) : (rendered !== null ? (
+ rendered
+ ) : (
+ text
+ ))}
+ </TableCell>
+ );
+ })}
+ </TableRow>
+ </TableFooter>
+ )}
+ </Table>
+ );
+}
diff --git a/registry/bases/takumi/components/data-table/data-table.types.ts b/registry/bases/takumi/components/data-table/data-table.types.ts
new file mode 100644
index 0000000..ea3bb1a
--- /dev/null
+++ b/registry/bases/takumi/components/data-table/data-table.types.ts
@@ -0,0 +1,55 @@
+import type React from "react";
+
+import type { PDFComponentProps } from "@/registry/themes";
+
+import type { TableVariant } from "../table/table.types";
+
+/** DataTable row density size. */
+export type DataTableSize = "default" | "compact";
+
+/**
+ * Column definition for a DataTable.
+ * Props - `key` | `header` | `align` | `width` | `render` | `renderFooter`
+ * @see {@link DataTableColumn}
+ */
+export interface DataTableColumn<T = Record<string, unknown>> {
+ key: keyof T & string;
+ header: string;
+ align?: "left" | "center" | "right";
+ width?: string | number;
+ /**
+ * Custom cell renderer. Must return Takumi PDF primitives elements (Text, View,
+ * Image, etc.) — NOT HTML DOM elements. TypeScript accepts ReactNode but DOM
+ * nodes will crash at runtime in the PDF renderer.
+ */
+ render?: (value: unknown, row: T) => React.ReactNode;
+ /**
+ * Custom footer cell renderer. Same constraint: return Takumi PDF primitives
+ * elements only — no HTML/DOM nodes.
+ */
+ renderFooter?: (value: unknown) => React.ReactNode;
+}
+
+/**
+ * Data table for PDF rendering with column definitions, footer support, and stripe options.
+ * Props - `columns` | `data` | `variant` | `footer` | `stripe` | `size` | `noWrap` | `style`
+ * @see {@link DataTableProps}
+ */
+export interface DataTableProps<T = Record<string, unknown>> extends Omit<
+ PDFComponentProps,
+ "children"
+> {
+ columns: DataTableColumn<T>[];
+ data: T[];
+ /**
+ * @default 'grid'
+ */
+ variant?: TableVariant;
+ footer?: Partial<Record<keyof T & string, string | number>>;
+ stripe?: boolean;
+ /**
+ * @default 'default'
+ */
+ size?: DataTableSize;
+ noWrap?: boolean;
+}
diff --git a/registry/bases/takumi/components/data-table/index.ts b/registry/bases/takumi/components/data-table/index.ts
new file mode 100644
index 0000000..e34f14d
--- /dev/null
+++ b/registry/bases/takumi/components/data-table/index.ts
@@ -0,0 +1,6 @@
+export { DataTable } from "./data-table";
+export type {
+ DataTableProps,
+ DataTableColumn,
+ DataTableSize,
+} from "./data-table.types";
diff --git a/registry/bases/takumi/components/divider/divider.tsx b/registry/bases/takumi/components/divider/divider.tsx
new file mode 100644
index 0000000..8507cd8
--- /dev/null
+++ b/registry/bases/takumi/components/divider/divider.tsx
@@ -0,0 +1,143 @@
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { resolveColor } from "../../lib/resolve-color";
+import { View, Text as PDFText, StyleSheet } from "../../lib/takumi-primitives";
+import type { Style } from "../../lib/takumi-primitives";
+
+export type DividerVariant = "solid" | "dashed" | "dotted";
+export type DividerThickness = "thin" | "medium" | "thick";
+export type DividerSpacing = "none" | "sm" | "md" | "lg";
+
+/**
+ * Horizontal rule with optional label, style variants, and spacing presets.
+ * Props - `spacing` | `variant` | `color` | `thickness` | `label` | `width` | `style`
+ * @see {@link DividerProps}
+ */
+export interface DividerProps extends Omit<PDFComponentProps, "children"> {
+ /**
+ * @default 'md'
+ */
+ spacing?: DividerSpacing;
+ /**
+ * @default 'solid'
+ */
+ variant?: DividerVariant;
+ color?: string;
+ /**
+ * @default 'thin'
+ */
+ thickness?: DividerThickness;
+ label?: string;
+ width?: string | number;
+}
+
+function createDividerStyles(t: PdfcnTheme) {
+ const { spacing, fontWeights } = t.primitives;
+ return StyleSheet.create({
+ base: { borderBottomColor: t.colors.border, borderBottomStyle: "solid" },
+ dashed: { borderBottomStyle: "dashed" },
+ dotted: { borderBottomStyle: "dotted" },
+ labelContainer: { alignItems: "center", flexDirection: "row" },
+ labelLine: {
+ borderBottomColor: t.colors.border,
+ borderBottomStyle: "solid",
+ flex: 1,
+ },
+ labelText: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.primitives.typography.xs,
+ fontWeight: fontWeights.medium,
+ letterSpacing: t.primitives.letterSpacing.wider * 10,
+ paddingHorizontal: spacing[3],
+ textTransform: "uppercase",
+ },
+ medium: { borderBottomWidth: spacing[1] },
+ solid: { borderBottomStyle: "solid" },
+ spacingLg: { marginVertical: t.spacing.sectionGap },
+ spacingMd: { marginVertical: t.spacing.componentGap },
+ spacingNone: { marginVertical: spacing[0] },
+ spacingSm: { marginVertical: t.spacing.paragraphGap },
+ thick: { borderBottomWidth: spacing[2] },
+ thin: { borderBottomWidth: spacing[0.5] },
+ });
+}
+
+export function Divider({
+ spacing = "md",
+ variant = "solid",
+ color,
+ thickness = "thin",
+ label,
+ width,
+ style,
+}: DividerProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createDividerStyles(theme), [theme]);
+ const spacingMap = {
+ lg: styles.spacingLg,
+ md: styles.spacingMd,
+ none: styles.spacingNone,
+ sm: styles.spacingSm,
+ };
+ const variantMap = {
+ dashed: styles.dashed,
+ dotted: styles.dotted,
+ solid: styles.solid,
+ };
+ const thicknessMap = {
+ medium: styles.medium,
+ thick: styles.thick,
+ thin: styles.thin,
+ };
+
+ if (label) {
+ const lineStyle: Style[] = [
+ styles.labelLine,
+ thicknessMap[thickness],
+ variantMap[variant],
+ ];
+ if (color) {
+ lineStyle.push({ borderBottomColor: resolveColor(color, theme.colors) });
+ }
+ const containerStyles: Style[] = [
+ styles.labelContainer,
+ spacingMap[spacing],
+ ];
+ if (width !== undefined) {
+ containerStyles.push({ width } as Style);
+ }
+ if (style) {
+ containerStyles.push(...[style].flat());
+ }
+ const labelTextStyle: Style[] = [styles.labelText];
+ if (color) {
+ labelTextStyle.push({ color: resolveColor(color, theme.colors) });
+ }
+ return (
+ <View style={containerStyles}>
+ <View style={lineStyle} />
+ <PDFText style={labelTextStyle}>{label}</PDFText>
+ <View style={lineStyle} />
+ </View>
+ );
+ }
+
+ const styleArray: Style[] = [
+ styles.base,
+ spacingMap[spacing],
+ variantMap[variant],
+ thicknessMap[thickness],
+ ];
+ if (color) {
+ styleArray.push({ borderBottomColor: resolveColor(color, theme.colors) });
+ }
+ if (width !== undefined) {
+ styleArray.push({ width } as Style);
+ }
+ if (style) {
+ styleArray.push(...[style].flat());
+ }
+ return <View style={styleArray} />;
+}
diff --git a/registry/bases/takumi/components/divider/index.ts b/registry/bases/takumi/components/divider/index.ts
new file mode 100644
index 0000000..6a4d5ec
--- /dev/null
+++ b/registry/bases/takumi/components/divider/index.ts
@@ -0,0 +1,7 @@
+export {
+ Divider,
+ type DividerProps,
+ type DividerVariant,
+ type DividerThickness,
+ type DividerSpacing,
+} from "./divider";
diff --git a/registry/bases/takumi/components/form/form.styles.ts b/registry/bases/takumi/components/form/form.styles.ts
new file mode 100644
index 0000000..800a9c4
--- /dev/null
+++ b/registry/bases/takumi/components/form/form.styles.ts
@@ -0,0 +1,142 @@
+import type { PdfcnTheme } from "@/registry/themes";
+
+import { StyleSheet } from "../../lib/takumi-primitives";
+import type { PdfFormVariant } from "./form.types";
+
+/** Style factory for fillable form layouts, derived from the active theme. */
+export function createFormStyles(
+ t: PdfcnTheme,
+ variant: PdfFormVariant = "underline"
+) {
+ const { spacing, borderRadius, fontWeights, typography } = t.primitives;
+ const borderColor = t.colors.border;
+ const hairline = 0.75; // lighter than spacing[0.5]=2pt — more refined
+ const rule = 1; // group title rule
+
+ const fieldAreaByVariant: Record<PdfFormVariant, object> = {
+ box: {
+ borderColor,
+ borderRadius: borderRadius.sm,
+ borderStyle: "solid",
+ borderWidth: hairline,
+ },
+ ghost: {
+ backgroundColor: t.colors.muted,
+ borderRadius: borderRadius.sm,
+ },
+ outlined: {
+ borderColor: t.colors.foreground,
+ borderRadius: borderRadius.md,
+ borderStyle: "solid",
+ borderWidth: hairline,
+ },
+ underline: {
+ borderBottomColor: borderColor,
+ borderBottomStyle: "solid",
+ borderBottomWidth: 1,
+ },
+ };
+
+ const hasPadding =
+ variant === "box" || variant === "outlined" || variant === "ghost";
+
+ return StyleSheet.create({
+ column: {
+ flex: 1,
+ },
+
+ columnsRow: {
+ flexDirection: "row",
+ gap: spacing[4],
+ },
+ fieldAbove: {
+ marginBottom: spacing[3],
+ width: "100%",
+ },
+ fieldArea: {
+ width: "100%" as const,
+ ...fieldAreaByVariant[variant],
+ },
+
+ fieldLeft: {
+ alignItems: "flex-end",
+ flexDirection: "row",
+ gap: spacing[2],
+ marginBottom: spacing[3],
+ },
+ fieldLeftArea: {
+ flex: 1,
+ },
+
+ formDivider: {
+ borderBottomColor: borderColor,
+ borderBottomStyle: "solid",
+ borderBottomWidth: rule,
+ marginBottom: spacing[4],
+ },
+ formSubtitle: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: typography.sm,
+ lineHeight: t.typography.body.lineHeight,
+ marginBottom: spacing[3],
+ },
+
+ formTitle: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.heading.fontFamily,
+ fontSize: typography.xl,
+ fontWeight: fontWeights.bold,
+ lineHeight: t.typography.heading.lineHeight,
+ marginBottom: spacing[1],
+ },
+ group: {
+ marginBottom: spacing[5],
+ },
+
+ groupTitle: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: typography.xs,
+ fontWeight: fontWeights.semibold,
+ letterSpacing: 0.8,
+ lineHeight: 1.2,
+ marginBottom: spacing[3],
+ textTransform: "uppercase",
+ },
+ hint: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: typography.xs,
+ opacity: 0.14,
+ paddingBottom: hasPadding ? spacing[1] : 0,
+ paddingHorizontal: hasPadding ? spacing[2] : 0,
+ paddingTop: hasPadding ? spacing[1] : spacing[0.5],
+ },
+ labelAbove: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: typography.xs,
+ fontWeight: fontWeights.medium,
+ letterSpacing: 0.5,
+ lineHeight: 1.2,
+ marginBottom: spacing[1],
+ textTransform: "uppercase",
+ },
+
+ labelLeft: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ fontWeight: fontWeights.medium,
+ lineHeight: t.typography.body.lineHeight,
+ paddingBottom: hasPadding ? spacing[1] : 0,
+ width: 80,
+ },
+
+ root: {
+ marginBottom: t.spacing.componentGap,
+ width: "100%",
+ },
+ });
+}
diff --git a/registry/bases/takumi/components/form/form.tsx b/registry/bases/takumi/components/form/form.tsx
new file mode 100644
index 0000000..e5da966
--- /dev/null
+++ b/registry/bases/takumi/components/form/form.tsx
@@ -0,0 +1,147 @@
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { View, Text as PDFText } from "../../lib/takumi-primitives";
+import type { Style } from "../../lib/takumi-primitives";
+import { createFormStyles } from "./form.styles";
+import type {
+ FormLayout,
+ PdfFormField,
+ PdfFormGroup,
+ PdfFormProps,
+} from "./form.types";
+
+function renderFieldAbove(
+ field: PdfFormField,
+ idx: number,
+ styles: ReturnType<typeof createFormStyles>
+) {
+ const areaHeight = field.height ?? 18;
+ const areaStyle: Style[] = [styles.fieldArea, { minHeight: areaHeight }];
+
+ return (
+ <View key={`${field.label}-${idx}`} style={styles.fieldAbove}>
+ <PDFText style={styles.labelAbove}>{field.label}</PDFText>
+ <View style={areaStyle}>
+ {field.hint ? (
+ <PDFText style={styles.hint}>{field.hint}</PDFText>
+ ) : null}
+ </View>
+ </View>
+ );
+}
+
+function renderFieldLeft(
+ field: PdfFormField,
+ idx: number,
+ styles: ReturnType<typeof createFormStyles>
+) {
+ const areaHeight = field.height ?? 18;
+ const areaStyle: Style[] = [
+ styles.fieldArea,
+ styles.fieldLeftArea,
+ { minHeight: areaHeight },
+ ];
+
+ return (
+ <View key={`${field.label}-${idx}`} style={styles.fieldLeft}>
+ <PDFText style={styles.labelLeft}>{field.label}</PDFText>
+ <View style={areaStyle}>
+ {field.hint ? (
+ <PDFText style={styles.hint}>{field.hint}</PDFText>
+ ) : null}
+ </View>
+ </View>
+ );
+}
+
+function renderGroup(
+ group: PdfFormGroup,
+ gi: number,
+ styles: ReturnType<typeof createFormStyles>,
+ labelPosition: "above" | "left"
+) {
+ const layout: FormLayout = group.layout ?? "single";
+ const cols = layout === "three-column" ? 3 : (layout === "two-column" ? 2 : 1);
+
+ const renderField = (field: PdfFormField, idx: number) =>
+ labelPosition === "left"
+ ? renderFieldLeft(field, idx, styles)
+ : renderFieldAbove(field, idx, styles);
+
+ if (cols === 1) {
+ return (
+ <View key={`group-${gi}`} style={styles.group}>
+ {group.title ? (
+ <PDFText style={styles.groupTitle}>{group.title}</PDFText>
+ ) : null}
+ {group.fields.map(renderField)}
+ </View>
+ );
+ }
+
+ const chunkSize = Math.ceil(group.fields.length / cols);
+ const chunks: PdfFormField[][] = [];
+ for (let i = 0; i < group.fields.length; i += chunkSize) {
+ chunks.push(group.fields.slice(i, i + chunkSize));
+ }
+ while (chunks.length < cols) {
+ chunks.push([]);
+ }
+
+ return (
+ <View key={`group-${gi}`} style={styles.group}>
+ {group.title ? (
+ <PDFText style={styles.groupTitle}>{group.title}</PDFText>
+ ) : null}
+ <View style={styles.columnsRow}>
+ {chunks.map((chunk, ci) => (
+ <View
+ key={`col-${gi}-${chunk[0]?.label ?? ci}`}
+ style={styles.column}
+ >
+ {chunk.map(renderField)}
+ </View>
+ ))}
+ </View>
+ </View>
+ );
+}
+
+export function PdfForm({
+ title,
+ subtitle,
+ groups,
+ variant = "underline",
+ labelPosition = "above",
+ noWrap = false,
+ style,
+}: PdfFormProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(
+ () => createFormStyles(theme, variant),
+ [theme, variant]
+ );
+
+ const rootStyles: Style[] = [styles.root];
+ if (style) {
+ rootStyles.push(style);
+ }
+
+ const inner = (
+ <View style={rootStyles}>
+ {title ? <PDFText style={styles.formTitle}>{title}</PDFText> : null}
+ {subtitle ? (
+ <PDFText style={styles.formSubtitle}>{subtitle}</PDFText>
+ ) : null}
+ {title || subtitle ? <View style={styles.formDivider} /> : null}
+ {groups.map((group, gi) => renderGroup(group, gi, styles, labelPosition))}
+ </View>
+ );
+
+ return noWrap ? (
+ <View style={[{ breakInside: "avoid" as const }].filter(Boolean)}>
+ {inner}
+ </View>
+ ) : (
+ inner
+ );
+}
diff --git a/registry/bases/takumi/components/form/form.types.ts b/registry/bases/takumi/components/form/form.types.ts
new file mode 100644
index 0000000..8bbb401
--- /dev/null
+++ b/registry/bases/takumi/components/form/form.types.ts
@@ -0,0 +1,61 @@
+import type { Style } from "../../lib/takumi-primitives";
+
+/** Visual style variant for the fillable form. */
+export type PdfFormVariant = "underline" | "box" | "outlined" | "ghost";
+
+/** Column layout for a form section. */
+export type FormLayout = "single" | "two-column" | "three-column";
+
+/** Label position relative to the field. */
+export type FormLabelPosition = "above" | "left";
+
+/**
+ * A single fillable field definition.
+ * Props - `label` | `hint` | `height` | `width`
+ * @see {@link PdfFormField}
+ */
+export interface PdfFormField {
+ label: string;
+ hint?: string;
+ /**
+ * Height of the blank field area in points.
+ * @default 18
+ */
+ height?: number;
+ width?: number | string;
+}
+
+/**
+ * A logical group of fields with an optional section title.
+ * Props - `title` | `fields` | `layout`
+ * @see {@link PdfFormGroup}
+ */
+export interface PdfFormGroup {
+ title?: string;
+ fields: PdfFormField[];
+ /**
+ * @default 'single'
+ */
+ layout?: FormLayout;
+}
+
+/**
+ * Fillable PDF form with grouped fields, layout variants, and label positioning options.
+ * Props - `title` | `subtitle` | `groups` | `variant` | `labelPosition` | `noWrap` | `style`
+ * @see {@link PdfFormProps}
+ */
+export interface PdfFormProps {
+ title?: string;
+ subtitle?: string;
+ groups: PdfFormGroup[];
+ /**
+ * @default 'underline'
+ */
+ variant?: PdfFormVariant;
+ /**
+ * @default 'above'
+ */
+ labelPosition?: FormLabelPosition;
+ noWrap?: boolean;
+ style?: Style;
+}
diff --git a/registry/bases/takumi/components/form/index.ts b/registry/bases/takumi/components/form/index.ts
new file mode 100644
index 0000000..e968b85
--- /dev/null
+++ b/registry/bases/takumi/components/form/index.ts
@@ -0,0 +1,9 @@
+export { PdfForm } from "./form";
+export type {
+ PdfFormProps,
+ PdfFormVariant,
+ PdfFormField,
+ PdfFormGroup,
+ FormLayout,
+ FormLabelPosition,
+} from "./form.types";
diff --git a/registry/bases/takumi/components/graph/graph.styles.ts b/registry/bases/takumi/components/graph/graph.styles.ts
new file mode 100644
index 0000000..671cf8a
--- /dev/null
+++ b/registry/bases/takumi/components/graph/graph.styles.ts
@@ -0,0 +1,57 @@
+import type { PdfcnTheme } from "@/registry/themes";
+
+import { StyleSheet } from "../../lib/takumi-primitives";
+
+export function createGraphStyles(t: PdfcnTheme) {
+ return StyleSheet.create({
+ chartWithRightLegend: {
+ alignItems: "flex-start",
+ display: "flex",
+ flexDirection: "row",
+ },
+ container: {
+ display: "flex",
+ flexDirection: "column",
+ marginBottom: t.spacing.componentGap,
+ },
+ legendColumn: {
+ display: "flex",
+ flexDirection: "column",
+ gap: 8,
+ marginLeft: 12,
+ marginTop: 18,
+ minWidth: 120,
+ },
+ legendItem: {
+ alignItems: "center",
+ display: "flex",
+ flexDirection: "row",
+ gap: 4,
+ },
+ legendRow: {
+ display: "flex",
+ flexDirection: "row",
+ flexWrap: "wrap",
+ gap: 12,
+ marginTop: 6,
+ },
+ legendText: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.primitives.typography.xs,
+ },
+ subtitle: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.primitives.typography.xs,
+ marginBottom: 6,
+ },
+ title: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.heading.fontFamily,
+ fontSize: t.primitives.typography.base,
+ fontWeight: t.primitives.fontWeights.semibold,
+ marginBottom: 2,
+ },
+ });
+}
diff --git a/registry/bases/takumi/components/graph/graph.tsx b/registry/bases/takumi/components/graph/graph.tsx
new file mode 100644
index 0000000..68f43af
--- /dev/null
+++ b/registry/bases/takumi/components/graph/graph.tsx
@@ -0,0 +1,661 @@
+import type React from "react";
+
+import type { PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { View, Text as PDFText } from "../../lib/takumi-primitives";
+import type { Style } from "../../lib/takumi-primitives";
+import {
+ Circle,
+ G,
+ Line,
+ Path,
+ Rect,
+ Svg,
+ SvgText,
+} from "../../lib/takumi-svg";
+import { createGraphStyles } from "./graph.styles";
+import type { ChartLayout, GraphProps, GraphSeries } from "./graph.types";
+import {
+ GRAPH_SAFE_WIDTHS,
+ arcPath,
+ buildLayout,
+ fmtNum,
+ getDefaultPalette,
+ getGraphWidth,
+ normalizeData,
+ polarToCartesian,
+ smoothPath,
+ truncate,
+} from "./graph.utils";
+
+/**
+ * Shared Y-axis grid lines and tick labels for cartesian charts (bar, line, area).
+ * Extracted to avoid duplicating the identical block across render functions.
+ */
+function renderGridAndYAxis(
+ ticks: number[],
+ toY: (v: number) => number,
+ chartX: number,
+ chartW: number,
+ showGrid: boolean,
+ gridColor: string,
+ textColor: string
+) {
+ return (
+ <>
+ {ticks.map((tick) => {
+ const ty = toY(tick);
+ return (
+ <G key={`grid-${tick}`}>
+ {showGrid && (
+ <Line
+ x1={chartX}
+ y1={ty}
+ x2={chartX + chartW}
+ y2={ty}
+ stroke={gridColor}
+ strokeWidth={0.5}
+ strokeDasharray="3 3"
+ />
+ )}
+ <SvgText
+ x={chartX - 4}
+ y={ty + 3}
+ fill={textColor}
+ textAnchor="end"
+ style={{ fontSize: 7 }}
+ >
+ {fmtNum(tick)}
+ </SvgText>
+ </G>
+ );
+ })}
+ </>
+ );
+}
+
+function renderBarChart(
+ series: GraphSeries[],
+ layout: ChartLayout,
+ palette: string[],
+ showGrid: boolean,
+ showValues: boolean,
+ theme: PdfcnTheme
+) {
+ const { chartX, chartY, chartW, chartH, yMin, yMax, yTicks, xLabels } =
+ layout;
+ const nCategories = xLabels.length;
+ const nSeries = series.length;
+ const groupGap = 0.25;
+ const groupW = chartW / nCategories;
+ const barW = (groupW * (1 - groupGap)) / nSeries;
+ const textColor = theme.colors.mutedForeground;
+ const gridColor = theme.colors.border;
+ const axisColor = theme.colors.foreground;
+ const range = yMax - yMin || 1;
+ const toY = (v: number) => chartY + chartH - ((v - yMin) / range) * chartH;
+
+ return (
+ <>
+ {renderGridAndYAxis(
+ yTicks,
+ toY,
+ chartX,
+ chartW,
+ showGrid,
+ gridColor,
+ textColor
+ )}
+
+ <Line
+ x1={chartX}
+ y1={chartY + chartH}
+ x2={chartX + chartW}
+ y2={chartY + chartH}
+ stroke={axisColor}
+ strokeWidth={1}
+ />
+
+ {xLabels.map((label, ci) => {
+ const groupLeft = chartX + ci * groupW + groupW * (groupGap / 2);
+ return (
+ // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity
+ <G key={`group-${ci}`}>
+ {series.map((s, si) => {
+ const val = s.data[ci]?.value ?? 0;
+ const color =
+ s.data[ci]?.color ?? s.color ?? palette[si % palette.length];
+ const barH = ((val - yMin) / range) * chartH;
+ const bx = groupLeft + si * barW;
+ const by = chartY + chartH - barH;
+ return (
+ // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity
+ <G key={`bar-${ci}-${si}`}>
+ <Rect
+ x={bx}
+ y={by}
+ width={barW - 1}
+ height={barH}
+ fill={color}
+ />
+ {showValues && barH > 10 && (
+ <SvgText
+ x={bx + barW / 2 - 0.5}
+ y={by - 2}
+ fill={axisColor}
+ textAnchor="middle"
+ style={{ fontSize: 6 }}
+ >
+ {fmtNum(val)}
+ </SvgText>
+ )}
+ </G>
+ );
+ })}
+ <SvgText
+ x={groupLeft + (nSeries * barW) / 2}
+ y={chartY + chartH + 10}
+ fill={textColor}
+ textAnchor="middle"
+ style={{ fontSize: 7 }}
+ >
+ {truncate(label, 10)}
+ </SvgText>
+ </G>
+ );
+ })}
+ </>
+ );
+}
+
+function renderHorizontalBarChart(
+ series: GraphSeries[],
+ layout: ChartLayout,
+ palette: string[],
+ showValues: boolean,
+ theme: PdfcnTheme
+) {
+ const { chartX, chartY, chartW, chartH, xLabels } = layout;
+ const nCategories = xLabels.length;
+ const allValues = series.flatMap((s) => s.data.map((d) => d.value));
+ const maxVal = Math.max(...allValues, 1);
+ const rowH = chartH / nCategories;
+ const barH = rowH * 0.5;
+ const textColor = theme.colors.mutedForeground;
+ const axisColor = theme.colors.foreground;
+ const labelW = 60;
+
+ return (
+ <>
+ {xLabels.map((label, ci) => {
+ const rowY = chartY + ci * rowH;
+ const val = series[0]?.data[ci]?.value ?? 0;
+ const color =
+ series[0]?.data[ci]?.color ??
+ series[0]?.color ??
+ palette[ci % palette.length];
+ const barW = (val / maxVal) * (chartW - labelW);
+ return (
+ // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity
+ <G key={`hbar-${ci}`}>
+ <SvgText
+ x={chartX + labelW - 4}
+ y={rowY + rowH / 2 + 3}
+ fill={textColor}
+ textAnchor="end"
+ style={{ fontSize: 7 }}
+ >
+ {truncate(label, 14)}
+ </SvgText>
+ <Rect
+ x={chartX + labelW}
+ y={rowY + (rowH - barH) / 2}
+ width={Math.max(barW, 1)}
+ height={barH}
+ fill={color}
+ />
+ {showValues && (
+ <SvgText
+ x={chartX + labelW + barW + 3}
+ y={rowY + rowH / 2 + 3}
+ fill={axisColor}
+ textAnchor="start"
+ style={{ fontSize: 6 }}
+ >
+ {fmtNum(val)}
+ </SvgText>
+ )}
+ </G>
+ );
+ })}
+ <Line
+ x1={chartX + labelW}
+ y1={chartY}
+ x2={chartX + labelW}
+ y2={chartY + chartH}
+ stroke={axisColor}
+ strokeWidth={1}
+ />
+ </>
+ );
+}
+
+function renderLineAreaChart(
+ series: GraphSeries[],
+ layout: ChartLayout,
+ palette: string[],
+ showGrid: boolean,
+ showValues: boolean,
+ showDots: boolean,
+ smooth: boolean,
+ isArea: boolean,
+ theme: PdfcnTheme
+) {
+ const { chartX, chartY, chartW, chartH, yMin, yMax, yTicks, xLabels } =
+ layout;
+ const range = yMax - yMin || 1;
+ const textColor = theme.colors.mutedForeground;
+ const gridColor = theme.colors.border;
+ const axisColor = theme.colors.foreground;
+ const nPoints = xLabels.length;
+
+ const xFor = (i: number) => chartX + (i / Math.max(nPoints - 1, 1)) * chartW;
+ const yFor = (v: number) => chartY + chartH - ((v - yMin) / range) * chartH;
+
+ return (
+ <>
+ {renderGridAndYAxis(
+ yTicks,
+ yFor,
+ chartX,
+ chartW,
+ showGrid,
+ gridColor,
+ textColor
+ )}
+
+ <Line
+ x1={chartX}
+ y1={chartY + chartH}
+ x2={chartX + chartW}
+ y2={chartY + chartH}
+ stroke={axisColor}
+ strokeWidth={1}
+ />
+
+ {series.map((s, si) => {
+ const color = s.color ?? palette[si % palette.length];
+ const points = s.data.map((d, i) => ({ x: xFor(i), y: yFor(d.value) }));
+
+ const lineDStr = smooth
+ ? smoothPath(points)
+ : `M ${points.map((p) => `${p.x} ${p.y}`).join(" L ")}`;
+
+ const areaPath =
+ isArea && points.length > 1
+ ? `${lineDStr} L ${points.at(-1)!.x} ${chartY + chartH} L ${points[0]!.x} ${chartY + chartH} Z`
+ : null;
+
+ return (
+ // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity
+ <G key={`series-${si}`}>
+ {isArea && areaPath && (
+ <Path d={areaPath} fill={color} fillOpacity={0.2} stroke="none" />
+ )}
+ <Path d={lineDStr} stroke={color} strokeWidth={2} fill="none" />
+ {showDots &&
+ points.map((p, pi) => (
+ // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity
+ <Circle
+ key={`dot-${pi}`}
+ cx={p.x}
+ cy={p.y}
+ r={3}
+ fill={color}
+ />
+ ))}
+ {showValues &&
+ points.map((p, pi) => (
+ <SvgText
+ // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity
+ key={`val-${pi}`}
+ x={p.x}
+ y={p.y - 5}
+ fill={color}
+ textAnchor="middle"
+ style={{ fontSize: 6 }}
+ >
+ {fmtNum(s.data[pi].value)}
+ </SvgText>
+ ))}
+ </G>
+ );
+ })}
+
+ {xLabels.map((label, i) => (
+ <SvgText
+ key={`xlabel-${label}`}
+ x={xFor(i)}
+ y={chartY + chartH + 10}
+ fill={textColor}
+ textAnchor="middle"
+ style={{ fontSize: 7 }}
+ >
+ {truncate(label, 8)}
+ </SvgText>
+ ))}
+ </>
+ );
+}
+
+function renderPieDonutChart(
+ series: GraphSeries[],
+ layout: ChartLayout,
+ palette: string[],
+ centerLabel: string | undefined,
+ isDonut: boolean,
+ theme: PdfcnTheme
+) {
+ const { svgW, svgH } = layout;
+ const cx = svgW / 2;
+ const cy = svgH / 2;
+ const r = Math.min(svgW, svgH) / 2 - 20;
+ const innerR = isDonut ? r * 0.52 : 0;
+ const textColor = theme.colors.mutedForeground;
+
+ const data = series[0]?.data ?? [];
+ const total = data.reduce((sum, d) => sum + d.value, 0) || 1;
+
+ let currentAngle = 0;
+
+ return (
+ <>
+ {data.map((d, i) => {
+ const color = d.color ?? palette[i % palette.length];
+ const sweep = (d.value / total) * 360;
+ const midAngle = currentAngle + sweep / 2;
+ const path = arcPath(
+ cx,
+ cy,
+ r,
+ currentAngle,
+ currentAngle + sweep,
+ innerR
+ );
+ currentAngle += sweep;
+
+ const labelR = r * 1.18;
+ const lp = polarToCartesian(cx, cy, labelR, midAngle);
+ const anchor = lp.x > cx ? "start" : "end";
+
+ return (
+ // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity
+ <G key={`slice-${i}`}>
+ <Path d={path} fill={color} stroke="white" strokeWidth={1} />
+ {/* Show label only if slice is large enough to label */}
+ {sweep > 15 && (
+ <SvgText
+ x={lp.x}
+ y={lp.y + 3}
+ fill={textColor}
+ textAnchor={anchor}
+ style={{ fontSize: 7 }}
+ >
+ {truncate(d.label, 10)}
+ </SvgText>
+ )}
+ </G>
+ );
+ })}
+
+ {isDonut && centerLabel && (
+ <>
+ <Circle cx={cx} cy={cy} r={innerR} fill="white" />
+ <SvgText
+ x={cx}
+ y={cy + 4}
+ fill={theme.colors.foreground}
+ textAnchor="middle"
+ style={{ fontSize: 9, fontWeight: "bold" }}
+ >
+ {centerLabel}
+ </SvgText>
+ </>
+ )}
+ </>
+ );
+}
+
+function Legend({
+ series,
+ palette,
+ styles,
+ position = "bottom",
+}: {
+ series: GraphSeries[];
+ palette: string[];
+ styles: ReturnType<typeof createGraphStyles>;
+ position?: "bottom" | "right";
+}) {
+ const containerStyle =
+ position === "right" ? styles.legendColumn : styles.legendRow;
+
+ return (
+ <View style={containerStyle}>
+ {series.map((s, i) => (
+ <View key={s.name} style={styles.legendItem}>
+ <Svg width={10} height={10}>
+ <Rect
+ x={0}
+ y={2}
+ width={8}
+ height={8}
+ fill={s.color ?? palette[i % palette.length]}
+ />
+ </Svg>
+ <PDFText style={styles.legendText}>{s.name}</PDFText>
+ </View>
+ ))}
+ </View>
+ );
+}
+
+/**
+ * PdfGraph — renders bar, horizontal-bar, line, area, pie, and donut charts
+ * natively inside react-pdf documents using SVG primitives.
+ *
+ * No external chart libraries are required or used — all rendering is done via
+ * react-pdf's built-in SVG support (`<Svg>`, `<Rect>`, `<Path>`, `<Line>`, etc.).
+ *
+ * @example Bar chart
+ * ```tsx
+ * <PdfGraph
+ * variant="bar"
+ * title="Monthly Revenue"
+ * data={[
+ * { label: 'Jan', value: 42000 },
+ * { label: 'Feb', value: 38000 },
+ * { label: 'Mar', value: 55000 },
+ * ]}
+ * />
+ * ```
+ *
+ * @example Donut chart with center label
+ * ```tsx
+ * <PdfGraph
+ * variant="donut"
+ * data={[
+ * { label: 'Product A', value: 45 },
+ * { label: 'Product B', value: 30 },
+ * { label: 'Other', value: 25 },
+ * ]}
+ * centerLabel="$1.2M"
+ * />
+ * ```
+ *
+ * **Limitations (by design):**
+ * - No interactivity (PDFs are static)
+ * - No animations
+ * - SVG Text inside charts uses SVG font attributes (not react-pdf StyleSheet fonts)
+ * - For print PDFs use SVG-friendly fonts registered with Font.register()
+ */
+export function PdfGraph({
+ variant = "bar",
+ data,
+ title,
+ subtitle,
+ xLabel,
+ yLabel,
+ width: explicitWidth,
+ height = 260,
+ fullWidth = false,
+ containerPadding = 0,
+ wrapperPadding = 0,
+ colors,
+ showValues = false,
+ showGrid = true,
+ legend = "bottom",
+ centerLabel,
+ showDots = true,
+ smooth = false,
+ yTicks: yTickCount = 5,
+ noWrap = true,
+ style,
+}: GraphProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createGraphStyles(theme), [theme]);
+ const palette = colors ?? getDefaultPalette(theme);
+ const series = normalizeData(data);
+
+ const width = useSafeMemo(() => {
+ if (fullWidth) {
+ return getGraphWidth(theme, { containerPadding, wrapperPadding });
+ }
+ return explicitWidth ?? GRAPH_SAFE_WIDTHS.default;
+ }, [fullWidth, explicitWidth, theme, containerPadding, wrapperPadding]);
+
+ const isPieOrDonut = variant === "pie" || variant === "donut";
+ const layout = buildLayout(series, width, height, isPieOrDonut, yTickCount);
+ const { chartX, chartW } = layout;
+
+ let chartContent: React.ReactNode = null;
+
+ switch (variant) {
+ case "bar": {
+ chartContent = renderBarChart(
+ series,
+ layout,
+ palette,
+ showGrid,
+ showValues,
+ theme
+ );
+ break;
+ }
+ case "horizontal-bar": {
+ chartContent = renderHorizontalBarChart(
+ series,
+ layout,
+ palette,
+ showValues,
+ theme
+ );
+ break;
+ }
+ case "line":
+ case "area": {
+ chartContent = renderLineAreaChart(
+ series,
+ layout,
+ palette,
+ showGrid,
+ showValues,
+ showDots,
+ smooth,
+ variant === "area",
+ theme
+ );
+ break;
+ }
+ case "pie": {
+ chartContent = renderPieDonutChart(
+ series,
+ layout,
+ palette,
+ undefined,
+ false,
+ theme
+ );
+ break;
+ }
+ case "donut": {
+ chartContent = renderPieDonutChart(
+ series,
+ layout,
+ palette,
+ centerLabel,
+ true,
+ theme
+ );
+ break;
+ }
+ }
+
+ const showLegend = legend !== "none" && !isPieOrDonut;
+
+ const containerStyles: Style[] = [styles.container];
+ if (style) {
+ containerStyles.push(style);
+ }
+
+ const content = (
+ <View style={containerStyles}>
+ {title && <PDFText style={styles.title}>{title}</PDFText>}
+ {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}
+ <View
+ style={legend === "right" ? styles.chartWithRightLegend : undefined}
+ >
+ <Svg width={width} height={height}>
+ {chartContent}
+ {!isPieOrDonut && xLabel && (
+ <SvgText
+ x={chartX + chartW / 2}
+ y={height - 2}
+ fill={theme.colors.mutedForeground}
+ textAnchor="middle"
+ style={{ fontSize: 8 }}
+ >
+ {xLabel}
+ </SvgText>
+ )}
+ {!isPieOrDonut && yLabel && (
+ <SvgText
+ x={2}
+ y={10}
+ fill={theme.colors.mutedForeground}
+ textAnchor="start"
+ style={{ fontSize: 8 }}
+ >
+ {yLabel}
+ </SvgText>
+ )}
+ </Svg>
+ {showLegend &&
+ legend === "right" &&
+ Legend({ palette, position: "right", series, styles })}
+ </View>
+ {showLegend &&
+ legend === "bottom" &&
+ Legend({ palette, position: "bottom", series, styles })}
+ </View>
+ );
+
+ return noWrap ? (
+ <View style={[{ breakInside: "avoid" as const }].filter(Boolean)}>
+ {content}
+ </View>
+ ) : (
+ content
+ );
+}
diff --git a/registry/bases/takumi/components/graph/graph.types.ts b/registry/bases/takumi/components/graph/graph.types.ts
new file mode 100644
index 0000000..f6027dd
--- /dev/null
+++ b/registry/bases/takumi/components/graph/graph.types.ts
@@ -0,0 +1,120 @@
+import type { Style } from "../../lib/takumi-primitives";
+
+/**
+ * Options for calculating graph width based on theme page margins and container context.
+ * Props - `containerPadding` | `wrapperPadding` | `pageWidth`
+ * @see {@link GraphWidthOptions}
+ */
+export interface GraphWidthOptions {
+ containerPadding?: number;
+ wrapperPadding?: number;
+ pageWidth?: number;
+}
+
+export type GraphVariant =
+ | "bar"
+ | "horizontal-bar"
+ | "line"
+ | "area"
+ | "pie"
+ | "donut";
+
+export type GraphLegendPosition = "bottom" | "right" | "none";
+
+/**
+ * A single data point with a label, numeric value, and optional color override.
+ * Props - `label` | `value` | `color`
+ * @see {@link GraphDataPoint}
+ */
+export interface GraphDataPoint {
+ label: string;
+ value: number;
+ color?: string;
+}
+
+/**
+ * A named data series containing multiple data points, used for multi-series charts.
+ * Props - `name` | `data` | `color`
+ * @see {@link GraphSeries}
+ */
+export interface GraphSeries {
+ name: string;
+ data: GraphDataPoint[];
+ color?: string;
+}
+
+/**
+ * Multi-variant PDF chart (bar, line, area, pie, donut) rendered with SVG primitives.
+ * Props - `variant` | `data` | `title` | `subtitle` | `xLabel` | `yLabel` | `width` | `height` | `fullWidth` | `containerPadding` | `wrapperPadding` | `colors` | `showValues` | `showGrid` | `legend` | `centerLabel` | `showDots` | `smooth` | `yTicks` | `noWrap` | `style`
+ * @see {@link GraphProps}
+ */
+export interface GraphProps {
+ /**
+ * @default 'bar'
+ */
+ variant?: GraphVariant;
+ data: GraphDataPoint[] | GraphSeries[];
+ title?: string;
+ subtitle?: string;
+ xLabel?: string;
+ yLabel?: string;
+ /**
+ * @default 420
+ */
+ width?: number;
+ /**
+ * @default 260
+ */
+ height?: number;
+ /**
+ * @default false
+ */
+ fullWidth?: boolean;
+ containerPadding?: number;
+ wrapperPadding?: number;
+ colors?: string[];
+ /**
+ * @default false
+ */
+ showValues?: boolean;
+ /**
+ * @default true
+ */
+ showGrid?: boolean;
+ /**
+ * @default 'bottom'
+ */
+ legend?: GraphLegendPosition;
+ centerLabel?: string;
+ /**
+ * @default true
+ */
+ showDots?: boolean;
+ /**
+ * @default false
+ */
+ smooth?: boolean;
+ /**
+ * @default 5
+ */
+ yTicks?: number;
+ /**
+ * @default true
+ */
+ noWrap?: boolean;
+ style?: Style;
+}
+
+/** Internal chart layout dimensions computed from props and data. */
+export interface ChartLayout {
+ svgW: number;
+ svgH: number;
+ chartX: number;
+ chartY: number;
+ chartW: number;
+ chartH: number;
+ yMin: number;
+ yMax: number;
+ yTicks: number[];
+ xLabels: string[];
+}
diff --git a/registry/bases/takumi/components/graph/graph.utils.ts b/registry/bases/takumi/components/graph/graph.utils.ts
new file mode 100644
index 0000000..6a1fc12
--- /dev/null
+++ b/registry/bases/takumi/components/graph/graph.utils.ts
@@ -0,0 +1,226 @@
+import type { PdfcnTheme } from "@/registry/themes";
+
+import type {
+ ChartLayout,
+ GraphDataPoint,
+ GraphSeries,
+ GraphWidthOptions,
+} from "./graph.types";
+
+/** Standard A4 page width in PDF points. */
+export const A4_WIDTH = 595;
+
+/**
+ * Pre-calculated safe graph widths for common scenarios.
+ * These values work with all built-in themes on A4 pages.
+ */
+export const GRAPH_SAFE_WIDTHS = {
+ /** Safe width for graph directly in page content (no extra containers) */
+ default: 420,
+ /** Safe width for graph inside a Section with md padding */
+ inSection: 400,
+ /** Safe width for graph inside a Section + bordered wrapper (like graphShell) */
+ inSectionWithWrapper: 380,
+} as const;
+
+/**
+ * Calculate the safe graph width based on theme page margins and container context.
+ *
+ * This utility ensures graphs don't overflow their container by accounting for:
+ * - Page margins (from theme)
+ * - Container padding (e.g., Section component)
+ * - Wrapper padding (e.g., a bordered graphShell View)
+ *
+ * @example
+ * ```tsx
+ * const width = getGraphWidth(theme);
+ * // For a graph inside a Section with padding="md" (12pt) and a graphShell (12pt):
+ * const width = getGraphWidth(theme, { containerPadding: 12, wrapperPadding: 12 });
+ * ```
+ */
+export function getGraphWidth(
+ theme: PdfcnTheme,
+ options: GraphWidthOptions = {}
+): number {
+ const {
+ containerPadding = 0,
+ wrapperPadding = 0,
+ pageWidth = A4_WIDTH,
+ } = options;
+ const { marginLeft, marginRight } = theme.spacing.page;
+ const availableWidth =
+ pageWidth -
+ marginLeft -
+ marginRight -
+ containerPadding * 2 -
+ wrapperPadding * 2;
+ return Math.max(Math.floor(availableWidth), 100);
+}
+
+export const CHART_MARGINS = {
+ axisBottom: 24,
+ axisLeft: 40,
+ pieBottom: 10,
+ pieLeft: 10,
+ right: 10,
+ top: 10,
+} as const;
+
+/** Normalize to always work with GraphSeries[]. */
+export function normalizeData(
+ data: GraphDataPoint[] | GraphSeries[]
+): GraphSeries[] {
+ if (data.length === 0) {
+ return [];
+ }
+ if ("label" in data[0] && "value" in data[0]) {
+ return [{ data: data as GraphDataPoint[], name: "Series 1" }];
+ }
+ return data as GraphSeries[];
+}
+
+/** Compute nice Y-axis ticks for a given value range. */
+export function computeYTicks(
+ min: number,
+ max: number,
+ count: number
+): number[] {
+ if (min === max) {
+ return [0, max || 1];
+ }
+ const step = (max - min) / (count - 1);
+ return Array.from({ length: count }, (_, i) => {
+ const v = min + i * step;
+ return Math.round(v * 100) / 100;
+ });
+}
+
+/** Format a number for display on axis labels. */
+export function fmtNum(v: number): string {
+ if (Math.abs(v) >= 1_000_000) {
+ return `${(v / 1_000_000).toFixed(1)}M`;
+ }
+ if (Math.abs(v) >= 1000) {
+ return `${(v / 1000).toFixed(1)}K`;
+ }
+ if (!Number.isInteger(v)) {
+ return v.toFixed(1);
+ }
+ return String(v);
+}
+
+/** Truncate a label to at most maxLen characters. */
+export function truncate(s: string, maxLen: number): string {
+ return s.length > maxLen ? `${s.slice(0, maxLen - 1)}…` : s;
+}
+
+/** Polar to Cartesian coordinate conversion for pie/donut arcs. */
+export function polarToCartesian(
+ cx: number,
+ cy: number,
+ r: number,
+ angleDeg: number
+) {
+ const rad = ((angleDeg - 90) * Math.PI) / 180;
+ return { x: cx + r * Math.cos(rad), y: cy + r * Math.sin(rad) };
+}
+
+/** Build an SVG arc path for a pie/donut slice. */
+export function arcPath(
+ cx: number,
+ cy: number,
+ r: number,
+ startAngle: number,
+ endAngle: number,
+ innerR = 0
+): string {
+ const safeEnd = Math.min(endAngle, startAngle + 359.999);
+ const large = safeEnd - startAngle > 180 ? 1 : 0;
+ const s = polarToCartesian(cx, cy, r, safeEnd);
+ const e = polarToCartesian(cx, cy, r, startAngle);
+ if (innerR === 0) {
+ return `M ${cx} ${cy} L ${s.x} ${s.y} A ${r} ${r} 0 ${large} 0 ${e.x} ${e.y} Z`;
+ }
+ const si = polarToCartesian(cx, cy, innerR, safeEnd);
+ const ei = polarToCartesian(cx, cy, innerR, startAngle);
+ return [
+ `M ${s.x} ${s.y}`,
+ `A ${r} ${r} 0 ${large} 0 ${e.x} ${e.y}`,
+ `L ${ei.x} ${ei.y}`,
+ `A ${innerR} ${innerR} 0 ${large} 1 ${si.x} ${si.y}`,
+ "Z",
+ ].join(" ");
+}
+
+/** Compute smooth bezier control points (Catmull-Rom → cubic bezier). */
+export function smoothPath(
+ points: { x: number; y: number }[],
+ tension = 0.4
+): string {
+ if (points.length < 2) {
+ return "";
+ }
+ if (points.length === 2) {
+ return `M ${points[0].x} ${points[0].y} L ${points[1].x} ${points[1].y}`;
+ }
+ const parts: string[] = [`M ${points[0].x} ${points[0].y}`];
+ for (let i = 0; i < points.length - 1; i++) {
+ const p0 = points[Math.max(i - 1, 0)];
+ const p1 = points[i];
+ const p2 = points[i + 1];
+ const p3 = points[Math.min(i + 2, points.length - 1)];
+ const cp1x = p1.x + (p2.x - p0.x) * tension;
+ const cp1y = p1.y + (p2.y - p0.y) * tension;
+ const cp2x = p2.x - (p3.x - p1.x) * tension;
+ const cp2y = p2.y - (p3.y - p1.y) * tension;
+ parts.push(`C ${cp1x} ${cp1y} ${cp2x} ${cp2y} ${p2.x} ${p2.y}`);
+ }
+ return parts.join(" ");
+}
+
+/** Get the default chart color palette from the theme. */
+export function getDefaultPalette(t: PdfcnTheme): string[] {
+ return [
+ t.colors.primary,
+ t.colors.info ?? "#3B82F6",
+ t.colors.success ?? "#22C55E",
+ t.colors.warning ?? "#F59E0B",
+ t.colors.destructive ?? "#EF4444",
+ "#8B5CF6",
+ "#F97316",
+ "#14B8A6",
+ ];
+}
+
+/** Derive ChartLayout from series data, SVG dimensions, and variant. */
+export function buildLayout(
+ series: GraphSeries[],
+ width: number,
+ height: number,
+ isPieOrDonut: boolean,
+ yTickCount: number
+): ChartLayout {
+ const mL = isPieOrDonut ? CHART_MARGINS.pieLeft : CHART_MARGINS.axisLeft;
+ const mB = isPieOrDonut ? CHART_MARGINS.pieBottom : CHART_MARGINS.axisBottom;
+ const chartX = mL;
+ const chartY = CHART_MARGINS.top;
+ const chartW = width - mL - CHART_MARGINS.right;
+ const chartH = height - CHART_MARGINS.top - mB;
+ const allValues = series.flatMap((s) => s.data.map((d) => d.value));
+ const rawMin = Math.min(...allValues, 0);
+ const rawMax = Math.max(...allValues, 1);
+ const yMin = Math.min(0, rawMin);
+ const yMax = rawMax + (rawMax - yMin) * 0.08;
+ return {
+ chartH,
+ chartW,
+ chartX,
+ chartY,
+ svgH: height,
+ svgW: width,
+ xLabels: series[0]?.data.map((d) => d.label) ?? [],
+ yMax,
+ yMin,
+ yTicks: computeYTicks(yMin, yMax, yTickCount),
+ };
+}
diff --git a/registry/bases/takumi/components/graph/index.ts b/registry/bases/takumi/components/graph/index.ts
new file mode 100644
index 0000000..a9dd44f
--- /dev/null
+++ b/registry/bases/takumi/components/graph/index.ts
@@ -0,0 +1,10 @@
+export { PdfGraph } from "./graph";
+export { A4_WIDTH, GRAPH_SAFE_WIDTHS, getGraphWidth } from "./graph.utils";
+export type {
+ GraphDataPoint,
+ GraphLegendPosition,
+ GraphProps,
+ GraphSeries,
+ GraphVariant,
+ GraphWidthOptions,
+} from "./graph.types";
diff --git a/registry/bases/takumi/components/heading/heading.tsx b/registry/bases/takumi/components/heading/heading.tsx
new file mode 100644
index 0000000..3ca9081
--- /dev/null
+++ b/registry/bases/takumi/components/heading/heading.tsx
@@ -0,0 +1,176 @@
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { resolveColor } from "../../lib/resolve-color";
+import { Text, StyleSheet } from "../../lib/takumi-primitives";
+import type { Style } from "../../lib/takumi-primitives";
+
+export type HeadingWeight = "normal" | "medium" | "semibold" | "bold";
+export type HeadingTracking = "tighter" | "tight" | "normal" | "wide" | "wider";
+
+/**
+ * PDF heading mapped to h1–h6 font sizes from the theme.
+ * Props - `level` | `align` | `color` | `transform` | `weight` | `tracking` | `noMargin` | `keepWithNext` | `children` | `style`
+ * @see {@link HeadingProps}
+ */
+export interface HeadingProps extends PDFComponentProps {
+ /**
+ * @default 1
+ */
+ level?: 1 | 2 | 3 | 4 | 5 | 6;
+ /**
+ * @default 'left'
+ */
+ align?: "left" | "center" | "right";
+ color?: string;
+ transform?: "uppercase" | "lowercase" | "capitalize";
+ /**
+ * @default 'bold'
+ */
+ weight?: HeadingWeight;
+ /**
+ * @default 'normal'
+ */
+ tracking?: HeadingTracking;
+ /**
+ * @default false
+ */
+ noMargin?: boolean;
+ keepWithNext?: boolean;
+}
+
+function createHeadingStyles(t: PdfcnTheme) {
+ const { heading } = t.typography;
+ const { spacing, fontWeights, letterSpacing } = t.primitives;
+ const { sectionGap, componentGap, paragraphGap } = t.spacing;
+ const base = {
+ color: t.colors.foreground,
+ fontFamily: heading.fontFamily,
+ fontWeight: fontWeights.bold,
+ lineHeight: heading.lineHeight,
+ };
+ return StyleSheet.create({
+ capitalize: { textTransform: "capitalize" },
+ h1: {
+ ...base,
+ fontSize: heading.fontSize.h1,
+ marginBottom: paragraphGap,
+ marginTop: spacing[0],
+ },
+ h2: {
+ ...base,
+ fontSize: heading.fontSize.h2,
+ marginBottom: paragraphGap,
+ marginTop: sectionGap,
+ },
+ h3: {
+ ...base,
+ fontSize: heading.fontSize.h3,
+ marginBottom: paragraphGap,
+ marginTop: componentGap,
+ },
+ h4: {
+ ...base,
+ fontSize: heading.fontSize.h4,
+ marginBottom: paragraphGap,
+ marginTop: paragraphGap,
+ },
+ h5: {
+ ...base,
+ fontSize: heading.fontSize.h5,
+ marginBottom: spacing[1],
+ marginTop: paragraphGap,
+ },
+ h6: {
+ ...base,
+ fontSize: heading.fontSize.h6,
+ marginBottom: spacing[1],
+ marginTop: paragraphGap,
+ },
+ lowercase: { textTransform: "lowercase" },
+ noMargin: { marginBottom: 0, marginTop: 0 },
+ trackingNormal: { letterSpacing: letterSpacing.normal },
+ trackingTight: { letterSpacing: letterSpacing.tight * 10 },
+ trackingTighter: { letterSpacing: letterSpacing.tight * 15 },
+ trackingWide: { letterSpacing: letterSpacing.wide * 10 },
+ trackingWider: { letterSpacing: letterSpacing.wider * 10 },
+ uppercase: {
+ letterSpacing: letterSpacing.wider * 10,
+ textTransform: "uppercase",
+ },
+ weightBold: { fontWeight: fontWeights.bold },
+ weightMedium: { fontWeight: fontWeights.medium },
+ weightNormal: { fontWeight: fontWeights.regular },
+ weightSemibold: { fontWeight: fontWeights.semibold },
+ });
+}
+
+export function Heading({
+ level = 1,
+ align,
+ color,
+ transform,
+ weight,
+ tracking,
+ noMargin,
+ keepWithNext = true,
+ children,
+ style,
+}: HeadingProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createHeadingStyles(theme), [theme]);
+ const safeLevel = Math.min(Math.max(Math.round(level), 1), 6) as
+ | 1
+ | 2
+ | 3
+ | 4
+ | 5
+ | 6;
+ const weightMap = {
+ bold: styles.weightBold,
+ medium: styles.weightMedium,
+ normal: styles.weightNormal,
+ semibold: styles.weightSemibold,
+ };
+ const trackingMap = {
+ normal: styles.trackingNormal,
+ tight: styles.trackingTight,
+ tighter: styles.trackingTighter,
+ wide: styles.trackingWide,
+ wider: styles.trackingWider,
+ };
+ const transformMap = {
+ capitalize: styles.capitalize,
+ lowercase: styles.lowercase,
+ uppercase: styles.uppercase,
+ };
+ const styleArray: Style[] = [
+ styles[`h${safeLevel}` as keyof typeof styles] as Style,
+ ];
+ if (weight && weight in weightMap) {
+ styleArray.push(weightMap[weight]);
+ }
+ if (tracking && tracking in trackingMap) {
+ styleArray.push(trackingMap[tracking]);
+ }
+ if (transform && transform in transformMap) {
+ styleArray.push(transformMap[transform as keyof typeof transformMap]);
+ }
+ if (noMargin) {
+ styleArray.push(styles.noMargin);
+ }
+ const semantic = {} as Style;
+ if (align) {
+ semantic.textAlign = align;
+ }
+ if (color) {
+ semantic.color = resolveColor(color, theme.colors);
+ }
+ if (Object.keys(semantic).length > 0) {
+ styleArray.push(semantic);
+ }
+ if (style) {
+ styleArray.push(...[style].flat());
+ }
+ return <Text style={styleArray}>{children}</Text>;
+}
diff --git a/registry/bases/takumi/components/heading/index.ts b/registry/bases/takumi/components/heading/index.ts
new file mode 100644
index 0000000..b31d254
--- /dev/null
+++ b/registry/bases/takumi/components/heading/index.ts
@@ -0,0 +1,6 @@
+export {
+ Heading,
+ type HeadingProps,
+ type HeadingWeight,
+ type HeadingTracking,
+} from "./heading";
diff --git a/registry/bases/takumi/components/index.ts b/registry/bases/takumi/components/index.ts
new file mode 100644
index 0000000..1fd47a4
--- /dev/null
+++ b/registry/bases/takumi/components/index.ts
@@ -0,0 +1,151 @@
+export type { PDFComponentProps } from "@/registry/themes";
+export {
+ Heading,
+ type HeadingProps,
+ type HeadingWeight,
+ type HeadingTracking,
+} from "./heading";
+export {
+ Divider,
+ type DividerProps,
+ type DividerVariant,
+ type DividerThickness,
+ type DividerSpacing,
+} from "./divider";
+export { PageBreak, type PageBreakProps } from "./page-break";
+export {
+ PdfPageNumber,
+ type PdfPageNumberProps,
+ type PageNumberAlign,
+ type PageNumberSize,
+} from "./page-number";
+export {
+ PdfWatermark,
+ type PdfWatermarkProps,
+ type WatermarkPosition,
+} from "./watermark";
+export {
+ PdfQRCode,
+ type PdfQRCodeProps,
+ type QRCodeErrorLevel,
+} from "./qrcode";
+export { PdfAlert, type PdfAlertProps, type AlertVariant } from "./alert";
+export {
+ Link,
+ type LinkProps,
+ type LinkVariant,
+ type LinkUnderline,
+} from "./link";
+export {
+ Text,
+ type TextProps,
+ type TextVariant,
+ type TextWeight,
+ type TextDecoration,
+} from "./text";
+export {
+ Stack,
+ type StackProps,
+ type StackGap,
+ type StackDirection,
+ type StackAlign,
+ type StackJustify,
+} from "./stack";
+export {
+ Section,
+ type SectionProps,
+ type SectionSpacing,
+ type SectionPadding,
+ type SectionVariant,
+} from "./section";
+export {
+ Table,
+ TableHeader,
+ TableBody,
+ TableFooter,
+ TableRow,
+ TableCell,
+ type TableProps,
+ type TableSectionProps,
+ type TableRowProps,
+ type TableCellProps,
+ type TableVariant,
+} from "./table";
+export {
+ DataTable,
+ type DataTableProps,
+ type DataTableColumn,
+ type DataTableSize,
+} from "./data-table";
+export {
+ Badge,
+ type BadgeProps,
+ type BadgeVariant,
+ type BadgeSize,
+} from "./badge";
+export {
+ KeyValue,
+ type KeyValueProps,
+ type KeyValueEntry,
+ type KeyValueDirection,
+ type KeyValueSize,
+} from "./key-value";
+export {
+ PageHeader,
+ type PageHeaderProps,
+ type PageHeaderVariant,
+} from "./page-header";
+export {
+ PageFooter,
+ type PageFooterProps,
+ type PageFooterVariant,
+} from "./page-footer";
+export {
+ PdfList,
+ type PdfListProps,
+ type ListVariant,
+ type ListItem,
+} from "./list";
+export { PdfCard, type PdfCardProps, type CardVariant } from "./card";
+export {
+ PdfForm,
+ type PdfFormProps,
+ type PdfFormVariant,
+ type PdfFormField,
+ type PdfFormGroup,
+ type FormLayout,
+ type FormLabelPosition,
+} from "./form";
+export {
+ PdfSignatureBlock,
+ type PdfSignatureBlockProps,
+ type SignatureVariant,
+ type SignatureSigner,
+} from "./signature";
+export { KeepTogether, type KeepTogetherProps } from "./keep-together";
+export {
+ PdfImage,
+ type PdfImageProps,
+ type PdfImageSrc,
+ type PdfImageVariant,
+ type PdfImageFit,
+} from "./pdf-image";
+export {
+ PdfGraph,
+ getGraphWidth,
+ A4_WIDTH,
+ GRAPH_SAFE_WIDTHS,
+ type GraphProps,
+ type GraphVariant,
+ type GraphDataPoint,
+ type GraphSeries,
+ type GraphLegendPosition,
+ type GraphWidthOptions,
+} from "./graph";
+
+export {
+ PdfcnThemeProvider,
+ usePdfcnTheme,
+ useSafeMemo,
+} from "../lib/pdfcn-theme-context";
+export type { PdfcnTheme } from "@/registry/themes";
diff --git a/registry/bases/takumi/components/keep-together/index.ts b/registry/bases/takumi/components/keep-together/index.ts
new file mode 100644
index 0000000..b111cfb
--- /dev/null
+++ b/registry/bases/takumi/components/keep-together/index.ts
@@ -0,0 +1 @@
+export { KeepTogether, type KeepTogetherProps } from "./keep-together";
diff --git a/registry/bases/takumi/components/keep-together/keep-together.tsx b/registry/bases/takumi/components/keep-together/keep-together.tsx
new file mode 100644
index 0000000..d8f686a
--- /dev/null
+++ b/registry/bases/takumi/components/keep-together/keep-together.tsx
@@ -0,0 +1,19 @@
+import type { ReactNode } from "react";
+
+import type { Style } from "@/registry/themes";
+
+import { View } from "../../lib/takumi-primitives";
+
+export interface KeepTogetherProps {
+ children?: ReactNode;
+ minPresenceAhead?: number;
+ style?: Style;
+}
+
+export function KeepTogether({ children, style }: KeepTogetherProps) {
+ return (
+ <View style={[{ breakInside: "avoid" }, style].filter(Boolean) as never}>
+ {children}
+ </View>
+ );
+}
diff --git a/registry/bases/takumi/components/key-value/index.ts b/registry/bases/takumi/components/key-value/index.ts
new file mode 100644
index 0000000..59d9c39
--- /dev/null
+++ b/registry/bases/takumi/components/key-value/index.ts
@@ -0,0 +1,7 @@
+export {
+ KeyValue,
+ type KeyValueProps,
+ type KeyValueEntry,
+ type KeyValueDirection,
+ type KeyValueSize,
+} from "./key-value";
diff --git a/registry/bases/takumi/components/key-value/key-value.tsx b/registry/bases/takumi/components/key-value/key-value.tsx
new file mode 100644
index 0000000..baae25c
--- /dev/null
+++ b/registry/bases/takumi/components/key-value/key-value.tsx
@@ -0,0 +1,202 @@
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { resolveColor } from "../../lib/resolve-color";
+import { View, Text as PDFText, StyleSheet } from "../../lib/takumi-primitives";
+import type { Style } from "../../lib/takumi-primitives";
+
+export type KeyValueDirection = "horizontal" | "vertical";
+export type KeyValueSize = "sm" | "md" | "lg";
+
+/**
+ * A single key-value row with optional per-item color and style overrides.
+ * Props - `key` | `value` | `valueColor` | `valueStyle` | `keyStyle`
+ * @see {@link KeyValueEntry}
+ */
+export interface KeyValueEntry {
+ key: string;
+ value: string;
+ valueColor?: string;
+ valueStyle?: Style;
+ keyStyle?: Style;
+}
+
+/**
+ * List of key-value pairs with layout and style options.
+ * Props - `items` | `direction` | `divided` | `size` | `labelFlex` | `labelColor` | `valueColor` | `boldValue` | `noWrap` | `dividerColor` | `dividerThickness` | `dividerMargin` | `style`
+ * @see {@link KeyValueProps}
+ */
+export interface KeyValueProps extends Omit<PDFComponentProps, "children"> {
+ items: KeyValueEntry[];
+ /**
+ * @default 'horizontal'
+ */
+ direction?: KeyValueDirection;
+ /**
+ * @default false
+ */
+ divided?: boolean;
+ /**
+ * @default 'md'
+ */
+ size?: KeyValueSize;
+ /**
+ * @default 1
+ */
+ labelFlex?: number;
+ labelColor?: string;
+ valueColor?: string;
+ /**
+ * @default false
+ */
+ boldValue?: boolean;
+ /**
+ * @default false
+ */
+ noWrap?: boolean;
+ dividerColor?: string;
+ dividerThickness?: number;
+ dividerMargin?: number;
+}
+
+function createKeyValueStyles(t: PdfcnTheme) {
+ const { spacing, fontWeights } = t.primitives;
+ const c = t.colors;
+ const { body } = t.typography;
+ const keyBase = {
+ color: c.mutedForeground,
+ fontFamily: body.fontFamily,
+ fontWeight: fontWeights.medium,
+ };
+ const valueBase = {
+ color: c.foreground,
+ fontFamily: body.fontFamily,
+ fontWeight: fontWeights.regular,
+ };
+ return StyleSheet.create({
+ container: { flexDirection: "column" },
+ divider: {
+ borderBottomColor: c.border,
+ borderBottomStyle: "solid",
+ borderBottomWidth: spacing[0.5],
+ },
+ keyLg: { ...keyBase, fontSize: t.primitives.typography.base },
+ keyMd: { ...keyBase, fontSize: body.fontSize },
+ keySm: { ...keyBase, fontSize: t.primitives.typography.xs },
+ rowHorizontal: {
+ alignItems: "flex-start",
+ flexDirection: "row",
+ paddingVertical: spacing[1],
+ },
+ rowVertical: {
+ flexDirection: "column",
+ marginBottom: t.spacing.paragraphGap,
+ },
+ valueBold: { fontWeight: fontWeights.bold },
+ valueLg: { ...valueBase, fontSize: t.primitives.typography.base },
+ valueMd: { ...valueBase, fontSize: body.fontSize },
+ valueSm: { ...valueBase, fontSize: t.primitives.typography.xs },
+ });
+}
+
+export function KeyValue({
+ items,
+ direction = "horizontal",
+ divided = false,
+ size = "md",
+ labelFlex = 1,
+ labelColor,
+ valueColor,
+ boldValue = false,
+ noWrap = false,
+ dividerColor,
+ dividerThickness,
+ dividerMargin,
+ style,
+}: KeyValueProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createKeyValueStyles(theme), [theme]);
+ const keyStyleMap = {
+ lg: styles.keyLg,
+ md: styles.keyMd,
+ sm: styles.keySm,
+ } as Record<KeyValueSize, Style>;
+ const valueStyleMap = {
+ lg: styles.valueLg,
+ md: styles.valueMd,
+ sm: styles.valueSm,
+ } as Record<KeyValueSize, Style>;
+ const containerStyles: Style[] = [styles.container];
+ if (style) {
+ containerStyles.push(...[style].flat());
+ }
+
+ return (
+ <View wrap={!noWrap} style={containerStyles}>
+ {items.map((item, index) => {
+ const isLast = index === items.length - 1;
+ const keyStyles: Style[] = [keyStyleMap[size]];
+ if (labelColor) {
+ keyStyles.push({ color: resolveColor(labelColor, theme.colors) });
+ }
+ if (item.keyStyle) {
+ keyStyles.push(item.keyStyle);
+ }
+ const valStyles: Style[] = [valueStyleMap[size]];
+ if (boldValue) {
+ valStyles.push(styles.valueBold);
+ }
+ const resolvedValueColor = item.valueColor ?? valueColor;
+ if (resolvedValueColor) {
+ valStyles.push({
+ color: resolveColor(resolvedValueColor, theme.colors),
+ });
+ }
+ if (item.valueStyle) {
+ valStyles.push(item.valueStyle);
+ }
+
+ if (direction === "horizontal") {
+ const rowStyles: Style[] = [styles.rowHorizontal];
+ if (divided && !isLast) {
+ const dividerStyle: Style = {};
+ if (dividerColor) {
+ dividerStyle.borderBottomColor = resolveColor(
+ dividerColor,
+ theme.colors
+ );
+ }
+ if (dividerThickness) {
+ dividerStyle.borderBottomWidth = dividerThickness;
+ }
+ if (dividerMargin) {
+ dividerStyle.marginBottom = dividerMargin;
+ }
+ rowStyles.push({ ...styles.divider, ...dividerStyle });
+ }
+ return (
+ <View key={item.key} style={rowStyles}>
+ <PDFText style={[...keyStyles, { flex: labelFlex }]}>
+ {item.key}
+ </PDFText>
+ <PDFText style={[...valStyles, { flex: 1, textAlign: "right" }]}>
+ {item.value}
+ </PDFText>
+ </View>
+ );
+ }
+
+ const rowStyles: Style[] = [styles.rowVertical];
+ if (divided && !isLast) {
+ rowStyles.push(styles.divider);
+ }
+ return (
+ <View key={item.key} style={rowStyles}>
+ <PDFText style={keyStyles}>{item.key}</PDFText>
+ <PDFText style={valStyles}>{item.value}</PDFText>
+ </View>
+ );
+ })}
+ </View>
+ );
+}
diff --git a/registry/bases/takumi/components/link/index.ts b/registry/bases/takumi/components/link/index.ts
new file mode 100644
index 0000000..22bf1b6
--- /dev/null
+++ b/registry/bases/takumi/components/link/index.ts
@@ -0,0 +1,6 @@
+export {
+ Link,
+ type LinkProps,
+ type LinkVariant,
+ type LinkUnderline,
+} from "./link";
diff --git a/registry/bases/takumi/components/link/link.tsx b/registry/bases/takumi/components/link/link.tsx
new file mode 100644
index 0000000..f7c7ea1
--- /dev/null
+++ b/registry/bases/takumi/components/link/link.tsx
@@ -0,0 +1,107 @@
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { resolveColor } from "../../lib/resolve-color";
+import { StyleSheet, Link as PDFLink } from "../../lib/takumi-primitives";
+import type { Style } from "../../lib/takumi-primitives";
+
+export type LinkVariant = "default" | "muted" | "primary";
+export type LinkUnderline = "always" | "none";
+
+/**
+ * Clickable hyperlink for PDF documents.
+ * Props - `href` | `children` | `align` | `color` | `variant` | `underline` | `style`
+ * @see {@link LinkProps}
+ */
+export interface LinkProps extends PDFComponentProps {
+ href: string;
+ /**
+ * @default 'left'
+ */
+ align?: "left" | "center" | "right";
+ color?: string;
+ /**
+ * @default 'default'
+ */
+ variant?: LinkVariant;
+ /**
+ * @default 'always'
+ */
+ underline?: LinkUnderline;
+}
+
+function createLinkStyles(t: PdfcnTheme) {
+ const { fontWeights } = t.primitives;
+ const base = {
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ lineHeight: t.typography.body.lineHeight,
+ marginBottom: t.spacing.paragraphGap,
+ };
+ return StyleSheet.create({
+ default: {
+ ...base,
+ color: t.colors.accent,
+ fontWeight: fontWeights.medium,
+ textDecoration: "underline",
+ },
+ muted: {
+ ...base,
+ color: t.colors.mutedForeground,
+ fontWeight: fontWeights.regular,
+ textDecoration: "underline",
+ },
+ primary: {
+ ...base,
+ color: t.colors.primary,
+ fontWeight: fontWeights.semibold,
+ textDecoration: "underline",
+ },
+ underlineAlways: { textDecoration: "underline" },
+ underlineNone: { textDecoration: "none" },
+ });
+}
+
+export function Link({
+ href,
+ align,
+ color,
+ variant = "default",
+ underline,
+ children,
+ style,
+}: LinkProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createLinkStyles(theme), [theme]);
+ const variantMap = {
+ default: styles.default,
+ muted: styles.muted,
+ primary: styles.primary,
+ };
+ const underlineMap = {
+ always: styles.underlineAlways,
+ none: styles.underlineNone,
+ };
+ const styleArray: Style[] = [variantMap[variant]];
+ if (underline && underline in underlineMap) {
+ styleArray.push(underlineMap[underline]);
+ }
+ const semantic = {} as Style;
+ if (align) {
+ semantic.textAlign = align;
+ }
+ if (color) {
+ semantic.color = resolveColor(color, theme.colors);
+ }
+ if (Object.keys(semantic).length > 0) {
+ styleArray.push(semantic);
+ }
+ if (style) {
+ styleArray.push(...[style].flat());
+ }
+ return (
+ <PDFLink src={href} style={styleArray}>
+ {children}
+ </PDFLink>
+ );
+}
diff --git a/registry/bases/takumi/components/list/index.ts b/registry/bases/takumi/components/list/index.ts
new file mode 100644
index 0000000..5535351
--- /dev/null
+++ b/registry/bases/takumi/components/list/index.ts
@@ -0,0 +1,2 @@
+export { PdfList } from "./list";
+export type { PdfListProps, ListVariant, ListItem } from "./list.types";
diff --git a/registry/bases/takumi/components/list/list.styles.ts b/registry/bases/takumi/components/list/list.styles.ts
new file mode 100644
index 0000000..6ec6053
--- /dev/null
+++ b/registry/bases/takumi/components/list/list.styles.ts
@@ -0,0 +1,164 @@
+import type { PdfcnTheme } from "@/registry/themes";
+
+import { StyleSheet } from "../../lib/takumi-primitives";
+
+/**
+ * Creates all list styles derived from the active theme.
+ * @param t - The resolved PdfcnTheme instance.
+ */
+export function createListStyles(t: PdfcnTheme) {
+ const { borderRadius, spacing, fontWeights, typography } = t.primitives;
+
+ return StyleSheet.create({
+ checkBox: {
+ alignItems: "center",
+ backgroundColor: t.colors.background,
+ borderColor: t.colors.border,
+ borderRadius: 3,
+ borderStyle: "solid",
+ borderWidth: 1.5,
+ height: spacing[4],
+ justifyContent: "center",
+ marginRight: spacing[2],
+ width: spacing[4],
+ },
+ checkBoxChecked: {
+ backgroundColor: t.colors.success,
+ borderColor: t.colors.success,
+ },
+ checkMark: {
+ color: t.colors.background,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: 8,
+ fontWeight: fontWeights.bold,
+ },
+ childrenContainer: {
+ display: "flex",
+ flexDirection: "column",
+ marginLeft: spacing[5],
+ marginTop: spacing[1],
+ },
+ container: {
+ display: "flex",
+ flexDirection: "column",
+ marginBottom: t.spacing.componentGap,
+ width: "100%",
+ },
+ descriptiveAccent: {
+ backgroundColor: t.colors.primary,
+ borderRadius: borderRadius.sm,
+ marginRight: spacing[3],
+ minHeight: spacing[4],
+ width: 3,
+ },
+ descriptiveContent: {
+ flex: 1,
+ },
+ descriptiveDesc: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: typography.sm,
+ lineHeight: t.typography.body.lineHeight,
+ marginTop: 1,
+ },
+ descriptiveTitle: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ fontWeight: fontWeights.semibold,
+ lineHeight: t.typography.body.lineHeight,
+ },
+ iconBox: {
+ alignItems: "center",
+ backgroundColor: t.colors.primary,
+ borderRadius: borderRadius.md,
+ height: spacing[5],
+ justifyContent: "center",
+ marginRight: spacing[2],
+ width: spacing[5],
+ },
+ iconMark: {
+ color: t.colors.primaryForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: 9,
+ fontWeight: fontWeights.bold,
+ },
+ itemRow: {
+ alignItems: "flex-start",
+ flexDirection: "row",
+ },
+ itemRowCenter: {
+ alignItems: "center",
+ flexDirection: "row",
+ },
+ itemRowGapMd: { marginBottom: spacing[3] },
+ itemRowGapSm: { marginBottom: spacing[2] },
+ itemRowGapXs: { marginBottom: spacing[1] },
+ itemText: {
+ // No flex here — Text nodes with flex shorthand get flexBasis:0, which causes
+ // Yoga to under-measure multi-line text height → overlapping rows.
+ // flex:1 must live on the wrapping View, not on the Text itself.
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ lineHeight: t.typography.body.lineHeight,
+ },
+ itemTextBold: {
+ fontWeight: fontWeights.semibold,
+ },
+ itemTextSub: {
+ // Same: no flex — see itemText comment.
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize - 0.5,
+ lineHeight: t.typography.body.lineHeight,
+ },
+ itemTextWrap: {
+ // Companion to itemText / itemTextSub. Apply this to the View that wraps
+ // the Text so flex expansion happens at the View level, not the Text level.
+ flex: 1,
+ },
+ markerBulletDot: {
+ backgroundColor: t.colors.primary,
+ borderRadius: 3,
+ height: 5,
+ width: 5,
+ },
+ markerBulletSubDot: {
+ backgroundColor: "transparent",
+ borderColor: t.colors.mutedForeground,
+ borderRadius: 2,
+ borderStyle: "solid",
+ borderWidth: 1,
+ height: 4,
+ width: 4,
+ },
+ markerBulletSubWrap: {
+ alignItems: "center",
+ justifyContent: "flex-start",
+ marginTop: spacing[1],
+ width: spacing[4],
+ },
+ markerBulletWrap: {
+ alignItems: "center",
+ justifyContent: "flex-start",
+ marginTop: spacing[1],
+ width: spacing[4],
+ },
+ markerNumberBadge: {
+ alignItems: "center",
+ backgroundColor: t.colors.primary,
+ borderRadius: spacing[5],
+ height: spacing[5],
+ justifyContent: "center",
+ marginRight: spacing[2],
+ width: spacing[5],
+ },
+ markerNumberText: {
+ color: t.colors.primaryForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: typography.xs,
+ fontWeight: fontWeights.bold,
+ },
+ });
+}
diff --git a/registry/bases/takumi/components/list/list.tsx b/registry/bases/takumi/components/list/list.tsx
new file mode 100644
index 0000000..a0196c5
--- /dev/null
+++ b/registry/bases/takumi/components/list/list.tsx
@@ -0,0 +1,264 @@
+import type React from "react";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { View, Text as PDFText } from "../../lib/takumi-primitives";
+import type { Style } from "../../lib/takumi-primitives";
+import { createListStyles } from "./list.styles";
+import type { ListItem, ListVariant, PdfListProps } from "./list.types";
+
+type Styles = ReturnType<typeof createListStyles>;
+type GapProp = "xs" | "sm" | "md";
+
+function getGapStyle(gap: GapProp, styles: Styles): Style {
+ if (gap === "xs") {
+ return styles.itemRowGapXs;
+ }
+ if (gap === "md") {
+ return styles.itemRowGapMd;
+ }
+ return styles.itemRowGapSm;
+}
+
+function buildRowStyles(
+ index: number,
+ total: number,
+ gap: GapProp,
+ styles: Styles,
+ align: "start" | "center" = "start"
+): Style[] {
+ const row: Style[] = [
+ align === "center" ? styles.itemRowCenter : styles.itemRow,
+ ];
+ if (index !== total - 1) {
+ row.push(getGapStyle(gap, styles));
+ }
+ return row;
+}
+
+/** Bullet dot marker — solid filled for level 0, outline ring for nested levels. */
+function dotMarker(level: number, styles: Styles): React.ReactElement {
+ return level === 0 ? (
+ <View style={styles.markerBulletWrap}>
+ <View style={styles.markerBulletDot} />
+ </View>
+ ) : (
+ <View style={styles.markerBulletSubWrap}>
+ <View style={styles.markerBulletSubDot} />
+ </View>
+ );
+}
+
+function renderBulletItem(
+ item: ListItem,
+ index: number,
+ total: number,
+ gap: GapProp,
+ styles: Styles,
+ level: number
+): React.ReactElement {
+ return (
+ <View key={index}>
+ <View style={buildRowStyles(index, total, gap, styles)}>
+ {dotMarker(level, styles)}
+ {/* flex:1 on the View, NOT on the Text — avoids Yoga height underestimation
+ for multi-line Text nodes that would cause overlapping rows. */}
+ <View style={styles.itemTextWrap}>
+ <PDFText style={styles.itemText}>{item.text}</PDFText>
+ </View>
+ </View>
+ {item.children && item.children.length > 0
+ ? renderItemList(item.children, "bullet", gap, styles, level + 1)
+ : null}
+ </View>
+ );
+}
+
+function renderNumberedItem(
+ item: ListItem,
+ index: number,
+ total: number,
+ gap: GapProp,
+ styles: Styles
+): React.ReactElement {
+ return (
+ <View
+ key={index}
+ style={buildRowStyles(index, total, gap, styles, "center")}
+ >
+ <View style={styles.markerNumberBadge}>
+ <PDFText style={styles.markerNumberText}>{`${index + 1}`}</PDFText>
+ </View>
+ <View style={styles.itemTextWrap}>
+ <PDFText style={styles.itemText}>{item.text}</PDFText>
+ </View>
+ </View>
+ );
+}
+
+function renderChecklistItem(
+ item: ListItem,
+ index: number,
+ total: number,
+ gap: GapProp,
+ styles: Styles
+): React.ReactElement {
+ const isChecked = item.checked ?? true;
+ return (
+ <View
+ key={index}
+ style={buildRowStyles(index, total, gap, styles, "center")}
+ >
+ <View style={[styles.checkBox, isChecked ? styles.checkBoxChecked : {}]}>
+ {isChecked ? <PDFText style={styles.checkMark}>✓</PDFText> : null}
+ </View>
+ <View style={styles.itemTextWrap}>
+ <PDFText style={styles.itemText}>{item.text}</PDFText>
+ </View>
+ </View>
+ );
+}
+
+function renderIconItem(
+ item: ListItem,
+ index: number,
+ total: number,
+ gap: GapProp,
+ styles: Styles
+): React.ReactElement {
+ return (
+ <View
+ key={index}
+ style={buildRowStyles(index, total, gap, styles, "center")}
+ >
+ <View style={styles.iconBox}>
+ <PDFText style={styles.iconMark}>★</PDFText>
+ </View>
+ <View style={styles.itemTextWrap}>
+ <PDFText style={styles.itemText}>{item.text}</PDFText>
+ </View>
+ </View>
+ );
+}
+
+function renderMultiLevelItem(
+ item: ListItem,
+ index: number,
+ total: number,
+ gap: GapProp,
+ styles: Styles,
+ level: number
+): React.ReactElement {
+ return (
+ <View key={index}>
+ <View style={buildRowStyles(index, total, gap, styles)}>
+ {dotMarker(level, styles)}
+ <View style={styles.itemTextWrap}>
+ <PDFText
+ style={[
+ level === 0 ? styles.itemText : styles.itemTextSub,
+ level === 0 ? styles.itemTextBold : {},
+ ]}
+ >
+ {item.text}
+ </PDFText>
+ </View>
+ </View>
+ {item.children && item.children.length > 0
+ ? renderItemList(item.children, "multi-level", gap, styles, level + 1)
+ : null}
+ </View>
+ );
+}
+
+function renderDescriptiveItem(
+ item: ListItem,
+ index: number,
+ total: number,
+ gap: GapProp,
+ styles: Styles
+): React.ReactElement {
+ return (
+ <View key={index} style={buildRowStyles(index, total, gap, styles)}>
+ <View style={styles.descriptiveAccent} />
+ <View style={styles.descriptiveContent}>
+ <PDFText style={styles.descriptiveTitle}>{item.text}</PDFText>
+ {item.description ? (
+ <PDFText style={styles.descriptiveDesc}>{item.description}</PDFText>
+ ) : null}
+ </View>
+ </View>
+ );
+}
+
+function renderItem(
+ item: ListItem,
+ index: number,
+ total: number,
+ variant: ListVariant,
+ gap: GapProp,
+ styles: Styles,
+ level: number
+): React.ReactElement | null {
+ switch (variant) {
+ case "bullet": {
+ return renderBulletItem(item, index, total, gap, styles, level);
+ }
+ case "numbered": {
+ return renderNumberedItem(item, index, total, gap, styles);
+ }
+ case "checklist": {
+ return renderChecklistItem(item, index, total, gap, styles);
+ }
+ case "icon": {
+ return renderIconItem(item, index, total, gap, styles);
+ }
+ case "multi-level": {
+ return renderMultiLevelItem(item, index, total, gap, styles, level);
+ }
+ case "descriptive": {
+ return renderDescriptiveItem(item, index, total, gap, styles);
+ }
+ }
+}
+
+function renderItemList(
+ items: ListItem[],
+ variant: ListVariant,
+ gap: GapProp,
+ styles: Styles,
+ level: number
+): React.ReactElement {
+ return (
+ <View style={level > 0 ? styles.childrenContainer : undefined}>
+ {items.map((item, index) =>
+ renderItem(item, index, items.length, variant, gap, styles, level)
+ )}
+ </View>
+ );
+}
+
+export function PdfList({
+ items,
+ variant = "bullet",
+ gap = "sm",
+ style,
+ noWrap = false,
+ _level = 0,
+}: PdfListProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createListStyles(theme), [theme]);
+
+ const containerStyles: Style[] = [styles.container];
+ if (_level > 0) {
+ containerStyles.push(styles.childrenContainer);
+ }
+ const styleArray = style ? [...containerStyles, style] : containerStyles;
+
+ return (
+ <View wrap={!noWrap} style={styleArray}>
+ {items.map((item, index) =>
+ renderItem(item, index, items.length, variant, gap, styles, _level)
+ )}
+ </View>
+ );
+}
diff --git a/registry/bases/takumi/components/list/list.types.ts b/registry/bases/takumi/components/list/list.types.ts
new file mode 100644
index 0000000..2a3558d
--- /dev/null
+++ b/registry/bases/takumi/components/list/list.types.ts
@@ -0,0 +1,45 @@
+import type { Style } from "../../lib/takumi-primitives";
+
+/** List visual style variant. */
+export type ListVariant =
+ | "bullet"
+ | "numbered"
+ | "checklist"
+ | "icon"
+ | "multi-level"
+ | "descriptive";
+
+/**
+ * A single list item, optionally with nested children.
+ * Props - `text` | `description` | `checked` | `children`
+ * @see {@link ListItem}
+ */
+export interface ListItem {
+ text: string;
+ description?: string;
+ checked?: boolean;
+ children?: ListItem[];
+}
+
+/**
+ * List of items with multiple style variants including bullet, numbered, checklist, and descriptive.
+ * Props - `items` | `variant` | `gap` | `style` | `_level` | `noWrap`
+ * @see {@link PdfListProps}
+ */
+export interface PdfListProps {
+ items: ListItem[];
+ /**
+ * @default 'bullet'
+ */
+ variant?: ListVariant;
+ /**
+ * @default 'sm'
+ */
+ gap?: "xs" | "sm" | "md";
+ style?: Style;
+ _level?: number;
+ /**
+ * @default false
+ */
+ noWrap?: boolean;
+}
diff --git a/registry/bases/takumi/components/page-break/index.ts b/registry/bases/takumi/components/page-break/index.ts
new file mode 100644
index 0000000..174a541
--- /dev/null
+++ b/registry/bases/takumi/components/page-break/index.ts
@@ -0,0 +1,2 @@
+export { PageBreak } from "./page-break";
+export type { PageBreakProps } from "./page-break";
diff --git a/registry/bases/takumi/components/page-break/page-break.tsx b/registry/bases/takumi/components/page-break/page-break.tsx
new file mode 100644
index 0000000..e3f6ec6
--- /dev/null
+++ b/registry/bases/takumi/components/page-break/page-break.tsx
@@ -0,0 +1,13 @@
+import type { PDFComponentProps } from "@/registry/themes";
+
+import { View } from "../../lib/takumi-primitives";
+
+export interface PageBreakProps extends Omit<PDFComponentProps, "children"> {
+ children?: never;
+}
+
+export function PageBreak({ style }: PageBreakProps) {
+ return (
+ <View style={[{ breakBefore: "page" }, style].filter(Boolean) as never} />
+ );
+}
diff --git a/registry/bases/takumi/components/page-footer/index.ts b/registry/bases/takumi/components/page-footer/index.ts
new file mode 100644
index 0000000..f02d612
--- /dev/null
+++ b/registry/bases/takumi/components/page-footer/index.ts
@@ -0,0 +1,5 @@
+export {
+ PageFooter,
+ type PageFooterProps,
+ type PageFooterVariant,
+} from "./page-footer";
diff --git a/registry/bases/takumi/components/page-footer/page-footer.tsx b/registry/bases/takumi/components/page-footer/page-footer.tsx
new file mode 100644
index 0000000..6538cc4
--- /dev/null
+++ b/registry/bases/takumi/components/page-footer/page-footer.tsx
@@ -0,0 +1,420 @@
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { resolveColor } from "../../lib/resolve-color";
+import { Text as PDFText, StyleSheet, View } from "../../lib/takumi-primitives";
+import type { Style } from "../../lib/takumi-primitives";
+
+export type PageFooterVariant =
+ | "simple"
+ | "centered"
+ | "branded"
+ | "minimal"
+ | "three-column"
+ | "detailed";
+
+/**
+ * Footer row with layout variants, optional sticky or fixed positioning, and contact info support.
+ * Props - `leftText` | `rightText` | `centerText` | `variant` | `background` | `textColor` | `marginTop` | `address` | `phone` | `email` | `website` | `fixed` | `sticky` | `pagePadding` | `noWrap` | `style`
+ * @see {@link PageFooterProps}
+ */
+export interface PageFooterProps extends Omit<PDFComponentProps, "children"> {
+ leftText?: string;
+ rightText?: string;
+ centerText?: string;
+ /**
+ * @default 'simple'
+ */
+ variant?: PageFooterVariant;
+ background?: string;
+ textColor?: string;
+ marginTop?: number;
+ address?: string;
+ phone?: string;
+ email?: string;
+ website?: string;
+ /**
+ * @default false
+ */
+ fixed?: boolean;
+ /**
+ * @default false
+ */
+ sticky?: boolean;
+ /**
+ * @default 0
+ */
+ pagePadding?: number;
+ /**
+ * @default true
+ */
+ noWrap?: boolean;
+}
+
+function createPageFooterStyles(t: PdfcnTheme) {
+ const { spacing, fontWeights } = t.primitives;
+ const c = t.colors;
+ const { body } = t.typography;
+
+ const textBase = {
+ color: c.mutedForeground,
+ fontFamily: body.fontFamily,
+ fontSize: t.primitives.typography.xs,
+ lineHeight: body.lineHeight,
+ };
+
+ return StyleSheet.create({
+ brandedContainer: {
+ alignItems: "center",
+ backgroundColor: c.primary,
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ paddingHorizontal: spacing[4],
+ paddingVertical: spacing[3],
+ },
+
+ centeredContainer: {
+ alignItems: "center",
+ borderTopColor: c.border,
+ borderTopStyle: "solid",
+ borderTopWidth: spacing[0.5],
+ display: "flex",
+ flexDirection: "column",
+ paddingTop: spacing[3],
+ },
+
+ companyBold: {
+ ...textBase,
+ color: c.foreground,
+ fontWeight: fontWeights.bold,
+ },
+
+ companyName: {
+ ...textBase,
+ color: c.foreground,
+ fontWeight: fontWeights.medium,
+ },
+
+ contactInfoCenter: {
+ ...textBase,
+ fontSize: t.primitives.typography.xs - 1,
+ marginTop: spacing[0.5],
+ textAlign: "center",
+ },
+ detailedContainer: {
+ borderTopColor: c.border,
+ borderTopStyle: "solid",
+ borderTopWidth: spacing[1],
+ display: "flex",
+ flexDirection: "column",
+ paddingTop: spacing[3],
+ },
+ detailedLeft: {
+ display: "flex",
+ flex: 1,
+ flexDirection: "column",
+ },
+ detailedPageNumber: {
+ ...textBase,
+ borderTopColor: c.border,
+ borderTopStyle: "solid",
+ borderTopWidth: spacing[0.5],
+ paddingTop: spacing[2],
+ textAlign: "center",
+ },
+ detailedRight: {
+ alignItems: "flex-end",
+ display: "flex",
+ flexDirection: "column",
+ },
+ detailedTopRow: {
+ alignItems: "flex-start",
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ marginBottom: spacing[2],
+ },
+
+ minimalContainer: {
+ alignItems: "center",
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ paddingBottom: spacing[1],
+ paddingTop: spacing[1],
+ },
+ simpleContainer: {
+ alignItems: "center",
+ borderTopColor: c.border,
+ borderTopStyle: "solid",
+ borderTopWidth: spacing[0.5],
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ paddingTop: spacing[3],
+ },
+ textBranded: {
+ ...textBase,
+ color: c.primaryForeground,
+ fontWeight: fontWeights.medium,
+ },
+ textBrandedRight: {
+ ...textBase,
+ color: c.primaryForeground,
+ textAlign: "right",
+ },
+ textCenter: {
+ ...textBase,
+ flex: 1,
+ textAlign: "center",
+ },
+ textCenteredVariant: {
+ ...textBase,
+ marginBottom: spacing[1],
+ textAlign: "center",
+ },
+
+ textLeft: {
+ ...textBase,
+ flex: 1,
+ },
+ textRight: {
+ ...textBase,
+ textAlign: "right",
+ },
+ threeColumnCenter: {
+ alignItems: "center",
+ display: "flex",
+ flex: 1,
+ flexDirection: "column",
+ },
+ threeColumnContainer: {
+ alignItems: "flex-start",
+ borderTopColor: c.border,
+ borderTopStyle: "solid",
+ borderTopWidth: spacing[0.5],
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ paddingTop: spacing[3],
+ },
+ threeColumnLeft: {
+ display: "flex",
+ flex: 1,
+ flexDirection: "column",
+ },
+ threeColumnRight: {
+ alignItems: "flex-end",
+ display: "flex",
+ flex: 1,
+ flexDirection: "column",
+ },
+ });
+}
+
+export function PageFooter({
+ leftText,
+ rightText,
+ centerText,
+ variant = "simple",
+ background,
+ textColor,
+ marginTop,
+ address,
+ phone,
+ email,
+ website,
+ fixed = false,
+ sticky = false,
+ pagePadding = 0,
+ noWrap = true,
+ style,
+}: PageFooterProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createPageFooterStyles(theme), [theme]);
+ // sticky implies fixed; marginTop is irrelevant with absolute positioning
+ const isFixed = fixed || sticky;
+ const mt = sticky ? 0 : (marginTop ?? theme.spacing.sectionGap);
+ const resolvedTextColor = textColor
+ ? resolveColor(textColor, theme.colors)
+ : undefined;
+ const stickyStyle: Style = sticky
+ ? {
+ bottom: pagePadding,
+ left: pagePadding,
+ position: "absolute",
+ right: pagePadding,
+ }
+ : {};
+
+ function applyOverrides(base: Style[]): Style[] {
+ if (background) {
+ base.push({ backgroundColor: resolveColor(background, theme.colors) });
+ }
+ if (style) {
+ base.push(style);
+ }
+ if (sticky) {
+ base.push(stickyStyle);
+ }
+ return base;
+ }
+
+ if (variant === "branded") {
+ const containerStyles = applyOverrides([
+ styles.brandedContainer,
+ { marginTop: mt },
+ ]);
+
+ const lStyle: Style[] = [styles.textBranded];
+ const rStyle: Style[] = [styles.textBrandedRight];
+ if (resolvedTextColor) {
+ lStyle.push({ color: resolvedTextColor });
+ rStyle.push({ color: resolvedTextColor });
+ }
+
+ return (
+ <View wrap={!noWrap} style={containerStyles}>
+ {leftText && <PDFText style={lStyle}>{leftText}</PDFText>}
+ {rightText && <PDFText style={rStyle}>{rightText}</PDFText>}
+ </View>
+ );
+ }
+
+ if (variant === "centered") {
+ const containerStyles = applyOverrides([
+ styles.centeredContainer,
+ { marginTop: mt },
+ ]);
+
+ const tStyle: Style[] = [styles.textCenteredVariant];
+ if (resolvedTextColor) {
+ tStyle.push({ color: resolvedTextColor });
+ }
+
+ return (
+ <View wrap={!noWrap} style={containerStyles}>
+ {leftText && <PDFText style={tStyle}>{leftText}</PDFText>}
+ {rightText && <PDFText style={tStyle}>{rightText}</PDFText>}
+ </View>
+ );
+ }
+
+ if (variant === "three-column") {
+ const containerStyles = applyOverrides([
+ styles.threeColumnContainer,
+ { marginTop: mt },
+ ]);
+
+ const leftStyle: Style[] = [styles.companyName];
+ const centerStyle: Style[] = [styles.contactInfoCenter];
+ const rightStyle: Style[] = [styles.textRight];
+ if (resolvedTextColor) {
+ leftStyle.push({ color: resolvedTextColor });
+ centerStyle.push({ color: resolvedTextColor });
+ rightStyle.push({ color: resolvedTextColor });
+ }
+
+ return (
+ <View wrap={!noWrap} style={containerStyles}>
+ <View style={styles.threeColumnLeft}>
+ {leftText && <PDFText style={leftStyle}>{leftText}</PDFText>}
+ {address && <PDFText style={styles.textLeft}>{address}</PDFText>}
+ </View>
+ <View style={styles.threeColumnCenter}>
+ {phone && <PDFText style={centerStyle}>{phone}</PDFText>}
+ {email && <PDFText style={centerStyle}>{email}</PDFText>}
+ {website && <PDFText style={centerStyle}>{website}</PDFText>}
+ </View>
+ <View style={styles.threeColumnRight}>
+ {rightText && <PDFText style={rightStyle}>{rightText}</PDFText>}
+ </View>
+ </View>
+ );
+ }
+
+ if (variant === "detailed") {
+ const containerStyles = applyOverrides([
+ styles.detailedContainer,
+ { marginTop: mt },
+ ]);
+
+ const companyStyle: Style[] = [styles.companyBold];
+ const addrStyle: Style[] = [styles.textLeft];
+ const contactStyle: Style[] = [styles.textRight];
+ const pageNumStyle: Style[] = [styles.detailedPageNumber];
+ if (resolvedTextColor) {
+ companyStyle.push({ color: resolvedTextColor });
+ addrStyle.push({ color: resolvedTextColor });
+ contactStyle.push({ color: resolvedTextColor });
+ pageNumStyle.push({ color: resolvedTextColor });
+ }
+
+ return (
+ <View wrap={!noWrap} style={containerStyles}>
+ <View style={styles.detailedTopRow}>
+ <View style={styles.detailedLeft}>
+ {leftText && <PDFText style={companyStyle}>{leftText}</PDFText>}
+ {address && <PDFText style={addrStyle}>{address}</PDFText>}
+ </View>
+ <View style={styles.detailedRight}>
+ {phone && (
+ <PDFText style={contactStyle}>{`Phone: ${phone}`}</PDFText>
+ )}
+ {email && (
+ <PDFText style={contactStyle}>{`Email: ${email}`}</PDFText>
+ )}
+ {website && (
+ <PDFText style={contactStyle}>{`Web: ${website}`}</PDFText>
+ )}
+ </View>
+ </View>
+ {rightText && <PDFText style={pageNumStyle}>{rightText}</PDFText>}
+ </View>
+ );
+ }
+
+ if (variant === "minimal") {
+ const containerStyles = applyOverrides([
+ styles.minimalContainer,
+ { marginTop: mt },
+ ]);
+
+ const lStyle: Style[] = [styles.textLeft];
+ const rStyle: Style[] = [styles.textRight];
+ if (resolvedTextColor) {
+ lStyle.push({ color: resolvedTextColor });
+ rStyle.push({ color: resolvedTextColor });
+ }
+
+ return (
+ <View wrap={!noWrap} style={containerStyles}>
+ {leftText && <PDFText style={lStyle}>{leftText}</PDFText>}
+ {rightText && <PDFText style={rStyle}>{rightText}</PDFText>}
+ </View>
+ );
+ }
+
+ const containerStyles = applyOverrides([
+ styles.simpleContainer,
+ { marginTop: mt },
+ ]);
+
+ const lStyle: Style[] = [styles.textLeft];
+ const cStyle: Style[] = [styles.textCenter];
+ const rStyle: Style[] = [styles.textRight];
+ if (resolvedTextColor) {
+ lStyle.push({ color: resolvedTextColor });
+ cStyle.push({ color: resolvedTextColor });
+ rStyle.push({ color: resolvedTextColor });
+ }
+
+ return (
+ <View wrap={!noWrap} style={containerStyles}>
+ {leftText && <PDFText style={lStyle}>{leftText}</PDFText>}
+ {centerText && <PDFText style={cStyle}>{centerText}</PDFText>}
+ {rightText && <PDFText style={rStyle}>{rightText}</PDFText>}
+ </View>
+ );
+}
diff --git a/registry/bases/takumi/components/page-header/index.ts b/registry/bases/takumi/components/page-header/index.ts
new file mode 100644
index 0000000..91eaac3
--- /dev/null
+++ b/registry/bases/takumi/components/page-header/index.ts
@@ -0,0 +1,5 @@
+export {
+ PageHeader,
+ type PageHeaderProps,
+ type PageHeaderVariant,
+} from "./page-header";
diff --git a/registry/bases/takumi/components/page-header/page-header.tsx b/registry/bases/takumi/components/page-header/page-header.tsx
new file mode 100644
index 0000000..4698d38
--- /dev/null
+++ b/registry/bases/takumi/components/page-header/page-header.tsx
@@ -0,0 +1,499 @@
+import type { ReactNode } from "react";
+
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { resolveColor } from "../../lib/resolve-color";
+import { Text as PDFText, StyleSheet, View } from "../../lib/takumi-primitives";
+import type { Style } from "../../lib/takumi-primitives";
+
+export type PageHeaderVariant =
+ | "simple"
+ | "centered"
+ | "minimal"
+ | "branded"
+ | "logo-left"
+ | "logo-right"
+ | "two-column";
+
+/**
+ * Header row with layout variants, logo support, and optional fixed positioning.
+ * Props - `title` | `subtitle` | `rightText` | `rightSubText` | `variant` | `background` | `titleColor` | `marginBottom` | `address` | `phone` | `email` | `logo` | `fixed` | `noWrap` | `style`
+ * @see {@link PageHeaderProps}
+ */
+export interface PageHeaderProps extends Omit<PDFComponentProps, "children"> {
+ title: string;
+ subtitle?: string;
+ rightText?: string;
+ rightSubText?: string;
+ /**
+ * @default 'simple'
+ */
+ variant?: PageHeaderVariant;
+ background?: string;
+ titleColor?: string;
+ marginBottom?: number;
+ address?: string;
+ phone?: string;
+ email?: string;
+ logo?: ReactNode;
+ /**
+ * @default false
+ */
+ fixed?: boolean;
+ /**
+ * @default true
+ */
+ noWrap?: boolean;
+}
+
+function createPageHeaderStyles(t: PdfcnTheme) {
+ const { spacing, borderRadius, fontWeights } = t.primitives;
+ const c = t.colors;
+ const { heading, body } = t.typography;
+
+ return StyleSheet.create({
+ brandedContainer: {
+ alignItems: "center",
+ backgroundColor: c.primary,
+ borderRadius: borderRadius.sm,
+ display: "flex",
+ flexDirection: "column",
+ padding: spacing[6],
+ },
+ centeredContainer: {
+ alignItems: "center",
+ borderBottomColor: c.border,
+ borderBottomStyle: "solid",
+ borderBottomWidth: spacing[0.5],
+ display: "flex",
+ flexDirection: "column",
+ paddingBottom: spacing[4],
+ },
+ contactInfo: {
+ color: c.mutedForeground,
+ fontFamily: body.fontFamily,
+ fontSize: t.primitives.typography.xs,
+ marginTop: spacing[0.5],
+ textAlign: "right",
+ },
+
+ logoContainer: {
+ height: 48,
+ marginRight: spacing[4],
+ width: 48,
+ },
+
+ logoContent: {
+ display: "flex",
+ flex: 1,
+ flexDirection: "column",
+ },
+ logoLeftContainer: {
+ alignItems: "center",
+ borderBottomColor: c.border,
+ borderBottomStyle: "solid",
+ borderBottomWidth: spacing[0.5],
+ display: "flex",
+ flexDirection: "row",
+ paddingBottom: spacing[4],
+ },
+ logoRightContainer: {
+ alignItems: "center",
+ borderBottomColor: c.border,
+ borderBottomStyle: "solid",
+ borderBottomWidth: spacing[0.5],
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ paddingBottom: spacing[4],
+ },
+
+ logoRightContent: {
+ display: "flex",
+ flex: 1,
+ flexDirection: "column",
+ },
+
+ logoRightLogoContainer: {
+ height: 48,
+ marginLeft: spacing[4],
+ width: 48,
+ },
+ minimalContainer: {
+ alignItems: "center",
+ borderBottomColor: c.primary,
+ borderBottomStyle: "solid",
+ borderBottomWidth: spacing[1],
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ paddingBottom: spacing[3],
+ },
+ minimalLeft: {
+ flex: 1,
+ },
+ minimalRight: {
+ alignItems: "flex-end",
+ },
+
+ rightSubText: {
+ color: c.mutedForeground,
+ fontFamily: body.fontFamily,
+ fontSize: t.primitives.typography.xs,
+ marginTop: spacing[1],
+ textAlign: "right",
+ },
+ rightText: {
+ color: c.foreground,
+ fontFamily: body.fontFamily,
+ fontSize: body.fontSize,
+ fontWeight: fontWeights.medium,
+ textAlign: "right",
+ },
+ simpleContainer: {
+ alignItems: "flex-start",
+ borderBottomColor: c.border,
+ borderBottomStyle: "solid",
+ borderBottomWidth: spacing[0.5],
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ paddingBottom: spacing[4],
+ },
+
+ simpleLeft: {
+ display: "flex",
+ flex: 1,
+ flexDirection: "column",
+ },
+ simpleRight: {
+ alignItems: "flex-end",
+ display: "flex",
+ flexDirection: "column",
+ },
+
+ subtitle: {
+ color: c.mutedForeground,
+ fontFamily: body.fontFamily,
+ fontSize: body.fontSize,
+ lineHeight: body.lineHeight,
+ marginTop: spacing[1],
+ },
+ subtitleBranded: {
+ color: c.primaryForeground,
+ marginTop: spacing[1],
+ },
+ subtitleCentered: {
+ textAlign: "center",
+ },
+
+ title: {
+ color: c.foreground,
+ fontFamily: heading.fontFamily,
+ fontSize: heading.fontSize.h3,
+ fontWeight: fontWeights.bold,
+ lineHeight: heading.lineHeight,
+ marginBottom: 0,
+ },
+ titleBranded: {
+ color: c.primaryForeground,
+ },
+ titleCentered: {
+ textAlign: "center",
+ },
+
+ titleMinimal: {
+ fontSize: heading.fontSize.h3,
+ fontWeight: fontWeights.bold,
+ },
+ twoColumnContainer: {
+ alignItems: "flex-start",
+ borderBottomColor: c.border,
+ borderBottomStyle: "solid",
+ borderBottomWidth: spacing[0.5],
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ paddingBottom: spacing[4],
+ },
+ twoColumnLeft: {
+ display: "flex",
+ flex: 1,
+ flexDirection: "column",
+ },
+ twoColumnRight: {
+ alignItems: "flex-end",
+ display: "flex",
+ flexDirection: "column",
+ },
+ });
+}
+
+export function PageHeader({
+ title,
+ subtitle,
+ rightText,
+ rightSubText,
+ variant = "simple",
+ background,
+ titleColor,
+ marginBottom,
+ logo,
+ address,
+ phone,
+ email,
+ fixed = false,
+ noWrap = true,
+ style,
+}: PageHeaderProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createPageHeaderStyles(theme), [theme]);
+ const mb = marginBottom ?? theme.spacing.sectionGap;
+
+ if (variant === "branded") {
+ const containerStyles: Style[] = [
+ styles.brandedContainer,
+ { marginBottom: mb },
+ ];
+ if (background) {
+ containerStyles.push({
+ backgroundColor: resolveColor(background, theme.colors),
+ });
+ }
+ if (style) {
+ containerStyles.push(style);
+ }
+
+ const titleStyles: Style[] = [
+ styles.title,
+ styles.titleBranded,
+ styles.titleCentered,
+ ];
+ if (titleColor) {
+ titleStyles.push({ color: resolveColor(titleColor, theme.colors) });
+ }
+
+ return (
+ <View wrap={!noWrap} style={containerStyles}>
+ <PDFText style={titleStyles}>{title}</PDFText>
+ {subtitle && (
+ <PDFText style={[styles.subtitle, styles.subtitleBranded]}>
+ {subtitle}
+ </PDFText>
+ )}
+ </View>
+ );
+ }
+
+ if (variant === "centered") {
+ const containerStyles: Style[] = [
+ styles.centeredContainer,
+ { marginBottom: mb },
+ ];
+ if (background) {
+ containerStyles.push({
+ backgroundColor: resolveColor(background, theme.colors),
+ });
+ }
+ if (style) {
+ containerStyles.push(style);
+ }
+
+ const titleStyles: Style[] = [styles.title, styles.titleCentered];
+ if (titleColor) {
+ titleStyles.push({ color: resolveColor(titleColor, theme.colors) });
+ }
+
+ return (
+ <View wrap={!noWrap} style={containerStyles}>
+ <PDFText style={titleStyles}>{title}</PDFText>
+ {subtitle && (
+ <PDFText style={[styles.subtitle, styles.subtitleCentered]}>
+ {subtitle}
+ </PDFText>
+ )}
+ </View>
+ );
+ }
+
+ if (variant === "logo-right") {
+ const containerStyles: Style[] = [
+ styles.logoRightContainer,
+ { marginBottom: mb },
+ ];
+ if (background) {
+ containerStyles.push({
+ backgroundColor: resolveColor(background, theme.colors),
+ });
+ }
+ if (style) {
+ containerStyles.push(style);
+ }
+
+ const titleStyles: Style[] = [styles.title];
+ if (titleColor) {
+ titleStyles.push({ color: resolveColor(titleColor, theme.colors) });
+ }
+
+ return (
+ <View wrap={!noWrap} style={containerStyles}>
+ <View style={styles.logoRightContent}>
+ <PDFText style={titleStyles}>{title}</PDFText>
+ {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}
+ </View>
+ {logo && <View style={styles.logoRightLogoContainer}>{logo}</View>}
+ </View>
+ );
+ }
+
+ if (variant === "logo-left") {
+ const containerStyles: Style[] = [
+ styles.logoLeftContainer,
+ { marginBottom: mb },
+ ];
+ if (background) {
+ containerStyles.push({
+ backgroundColor: resolveColor(background, theme.colors),
+ });
+ }
+ if (style) {
+ containerStyles.push(style);
+ }
+
+ const titleStyles: Style[] = [styles.title];
+ if (titleColor) {
+ titleStyles.push({ color: resolveColor(titleColor, theme.colors) });
+ }
+
+ return (
+ <View wrap={!noWrap} style={containerStyles}>
+ {logo && <View style={styles.logoContainer}>{logo}</View>}
+ <View style={styles.logoContent}>
+ <PDFText style={titleStyles}>{title}</PDFText>
+ {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}
+ </View>
+ {(rightText || rightSubText) && (
+ <View style={styles.simpleRight}>
+ {rightText && (
+ <PDFText style={styles.rightText}>{rightText}</PDFText>
+ )}
+ {rightSubText && (
+ <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>
+ )}
+ </View>
+ )}
+ </View>
+ );
+ }
+
+ if (variant === "two-column") {
+ const containerStyles: Style[] = [
+ styles.twoColumnContainer,
+ { marginBottom: mb },
+ ];
+ if (background) {
+ containerStyles.push({
+ backgroundColor: resolveColor(background, theme.colors),
+ });
+ }
+ if (style) {
+ containerStyles.push(style);
+ }
+
+ const titleStyles: Style[] = [styles.title];
+ if (titleColor) {
+ titleStyles.push({ color: resolveColor(titleColor, theme.colors) });
+ }
+
+ return (
+ <View wrap={!noWrap} style={containerStyles}>
+ <View style={styles.twoColumnLeft}>
+ <PDFText style={titleStyles}>{title}</PDFText>
+ {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}
+ </View>
+ {(address || phone || email) && (
+ <View style={styles.twoColumnRight}>
+ {address && <PDFText style={styles.contactInfo}>{address}</PDFText>}
+ {phone && <PDFText style={styles.contactInfo}>{phone}</PDFText>}
+ {email && <PDFText style={styles.contactInfo}>{email}</PDFText>}
+ </View>
+ )}
+ </View>
+ );
+ }
+
+ if (variant === "minimal") {
+ const containerStyles: Style[] = [
+ styles.minimalContainer,
+ { marginBottom: mb },
+ ];
+ if (background) {
+ containerStyles.push({
+ backgroundColor: resolveColor(background, theme.colors),
+ });
+ }
+ if (style) {
+ containerStyles.push(style);
+ }
+
+ const titleStyles: Style[] = [styles.title, styles.titleMinimal];
+ if (titleColor) {
+ titleStyles.push({ color: resolveColor(titleColor, theme.colors) });
+ }
+
+ return (
+ <View wrap={!noWrap} style={containerStyles}>
+ <View style={styles.minimalLeft}>
+ <PDFText style={titleStyles}>{title}</PDFText>
+ {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}
+ </View>
+ {(rightText || rightSubText) && (
+ <View style={styles.minimalRight}>
+ {rightText && (
+ <PDFText style={styles.rightText}>{rightText}</PDFText>
+ )}
+ {rightSubText && (
+ <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>
+ )}
+ </View>
+ )}
+ </View>
+ );
+ }
+
+ const containerStyles: Style[] = [
+ styles.simpleContainer,
+ { marginBottom: mb },
+ ];
+ if (background) {
+ containerStyles.push({
+ backgroundColor: resolveColor(background, theme.colors),
+ });
+ }
+ if (style) {
+ containerStyles.push(style);
+ }
+
+ const titleStyles: Style[] = [styles.title];
+ if (titleColor) {
+ titleStyles.push({ color: resolveColor(titleColor, theme.colors) });
+ }
+
+ return (
+ <View wrap={!noWrap} style={containerStyles}>
+ <View style={styles.simpleLeft}>
+ <PDFText style={titleStyles}>{title}</PDFText>
+ {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}
+ </View>
+ {(rightText || rightSubText) && (
+ <View style={styles.simpleRight}>
+ {rightText && <PDFText style={styles.rightText}>{rightText}</PDFText>}
+ {rightSubText && (
+ <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>
+ )}
+ </View>
+ )}
+ </View>
+ );
+}
diff --git a/registry/bases/takumi/components/page-number/index.ts b/registry/bases/takumi/components/page-number/index.ts
new file mode 100644
index 0000000..bef083e
--- /dev/null
+++ b/registry/bases/takumi/components/page-number/index.ts
@@ -0,0 +1,6 @@
+export {
+ PdfPageNumber,
+ type PdfPageNumberProps,
+ type PageNumberAlign,
+ type PageNumberSize,
+} from "./page-number";
diff --git a/registry/bases/takumi/components/page-number/page-number.tsx b/registry/bases/takumi/components/page-number/page-number.tsx
new file mode 100644
index 0000000..9473443
--- /dev/null
+++ b/registry/bases/takumi/components/page-number/page-number.tsx
@@ -0,0 +1,113 @@
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { View, Text as PDFText, StyleSheet } from "../../lib/takumi-primitives";
+import type { Style } from "../../lib/takumi-primitives";
+
+export type PageNumberAlign = "left" | "center" | "right";
+export type PageNumberSize = "xs" | "sm" | "md";
+
+/**
+ * Auto page number rendered with a configurable format string at a or inline position.
+ * Props - `format` | `align` | `size` | `fixed` | `muted` | `style`
+ * @see {@link PdfPageNumberProps}
+ */
+export interface PdfPageNumberProps extends Omit<
+ PDFComponentProps,
+ "children"
+> {
+ /**
+ * Format string — use `{page}` for current page and `{total}` for total page count.
+ * @default 'Page {page} of {total}'
+ */
+ format?: string;
+ /**
+ * @default 'center'
+ */
+ align?: PageNumberAlign;
+ /**
+ * @default 'sm'
+ */
+ size?: PageNumberSize;
+ /**
+ * @default false
+ */
+ fixed?: boolean;
+ /**
+ * @default true
+ */
+ muted?: boolean;
+ children?: never;
+}
+
+function createPageNumberStyles(t: PdfcnTheme) {
+ const { typography, colors, primitives } = t;
+ return StyleSheet.create({
+ alignCenter: { textAlign: "center" },
+ alignLeft: { textAlign: "left" },
+ alignRight: { textAlign: "right" },
+ colorForeground: { color: colors.foreground },
+ colorMuted: { color: colors.mutedForeground },
+ container: { width: "100%" },
+ sizeMd: { fontSize: primitives.typography.base },
+ sizeSm: { fontSize: primitives.typography.sm },
+ sizeXs: { fontSize: primitives.typography.xs },
+ text: { fontFamily: typography.body.fontFamily },
+ });
+}
+
+function formatPageNumber(
+ format: string,
+ pageNumber: number,
+ totalPages: number
+): string {
+ return format
+ .replace("{page}", String(pageNumber))
+ .replace("{total}", String(totalPages));
+}
+
+export function PdfPageNumber({
+ format = "Page {page} of {total}",
+ align = "center",
+ size = "sm",
+ fixed = false,
+ muted = true,
+ style,
+}: PdfPageNumberProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createPageNumberStyles(theme), [theme]);
+ const alignMap = {
+ center: styles.alignCenter,
+ left: styles.alignLeft,
+ right: styles.alignRight,
+ } as Record<PageNumberAlign, Style>;
+ const sizeMap = {
+ md: styles.sizeMd,
+ sm: styles.sizeSm,
+ xs: styles.sizeXs,
+ } as Record<PageNumberSize, Style>;
+ const textStyles: Style[] = [
+ styles.text,
+ alignMap[align],
+ sizeMap[size],
+ muted ? styles.colorMuted : styles.colorForeground,
+ ];
+ if (style) {
+ textStyles.push(...[style].flat());
+ }
+ return (
+ <View style={styles.container}>
+ <PDFText style={textStyles}>
+ {format.split(/({page}|{total})/).map((part, i) => {
+ if (part === "{page}") {
+ return <span key={i} className="pageNumber" />;
+ }
+ if (part === "{total}") {
+ return <span key={i} className="totalPages" />;
+ }
+ return <span key={i}>{part}</span>;
+ })}
+ </PDFText>
+ </View>
+ );
+}
diff --git a/registry/bases/takumi/components/pdf-image/index.ts b/registry/bases/takumi/components/pdf-image/index.ts
new file mode 100644
index 0000000..826f276
--- /dev/null
+++ b/registry/bases/takumi/components/pdf-image/index.ts
@@ -0,0 +1,7 @@
+export {
+ PdfImage,
+ type PdfImageProps,
+ type PdfImageSrc,
+ type PdfImageVariant,
+ type PdfImageFit,
+} from "./pdf-image";
diff --git a/registry/bases/takumi/components/pdf-image/pdf-image.tsx b/registry/bases/takumi/components/pdf-image/pdf-image.tsx
new file mode 100644
index 0000000..a6b21d7
--- /dev/null
+++ b/registry/bases/takumi/components/pdf-image/pdf-image.tsx
@@ -0,0 +1,194 @@
+import type { PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import {
+ View,
+ Text as PDFText,
+ StyleSheet,
+ Image,
+} from "../../lib/takumi-primitives";
+import type { Style } from "../../lib/takumi-primitives";
+
+/** HTTP method used when fetching the image from a URL. */
+export type PdfImageHTTPMethod =
+ | "GET"
+ | "HEAD"
+ | "POST"
+ | "PUT"
+ | "DELETE"
+ | "PATCH";
+
+export type PdfImageSrc =
+ | string
+ | {
+ uri: string;
+ method?: PdfImageHTTPMethod;
+ headers?: Record<string, string>;
+ body?: string;
+ };
+
+export type PdfImageFit = "cover" | "contain" | "fill" | "none";
+
+export type PdfImageVariant =
+ | "default"
+ | "full-width"
+ | "thumbnail"
+ | "avatar"
+ | "cover"
+ | "bordered"
+ | "rounded";
+
+/**
+ * Image element with layout presets, caption, and aspect ratio support.
+ * Props - `src` | `variant` | `width` | `height` | `fit` | `position` | `caption` | `aspectRatio` | `borderRadius` | `noWrap` | `style`
+ * @see {@link PdfImageProps}
+ */
+export interface PdfImageProps {
+ src: PdfImageSrc;
+ /**
+ * @default 'default'
+ */
+ variant?: PdfImageVariant;
+ width?: number | string;
+ height?: number | string;
+ fit?: PdfImageFit;
+ /**
+ * @default '50% 50%'
+ */
+ position?: string;
+ caption?: string;
+ aspectRatio?: number;
+ borderRadius?: number;
+ /**
+ * @default true
+ */
+ noWrap?: boolean;
+ style?: Style;
+}
+
+interface VariantDefaults {
+ width?: number | string;
+ height?: number | string;
+ fit: PdfImageFit;
+ borderRadius?: number;
+}
+
+const VARIANT_DEFAULTS: Record<PdfImageVariant, VariantDefaults> = {
+ avatar: { borderRadius: 999, fit: "cover", height: 48, width: 48 },
+ bordered: { fit: "contain", width: "100%" },
+ cover: { fit: "cover", height: 160, width: "100%" },
+ default: { fit: "contain" },
+ "full-width": { fit: "cover", width: "100%" },
+ rounded: { borderRadius: 8, fit: "contain", width: 200 },
+ thumbnail: { fit: "cover", height: 80, width: 80 },
+};
+
+const UNSUPPORTED_FORMATS = new Set(["webp", "avif", "heic", "heif", "ico"]);
+
+function detectFormat(src: PdfImageSrc): string | null {
+ if (typeof src !== "string") {return null;}
+ const dataMatch = src.match(/^data:image\/([a-zA-Z0-9+.-]+)/);
+ if (dataMatch) {return dataMatch[1].toLowerCase();}
+ return src.split("?")[0].split(".").pop()?.toLowerCase() ?? null;
+}
+
+function warnIfUnsupported(src: PdfImageSrc): void {
+ const fmt = detectFormat(src);
+ if (fmt && UNSUPPORTED_FORMATS.has(fmt)) {
+ console.warn(
+ `[PdfImage] Unsupported format "${fmt}" detected. react-pdf supports: JPEG, PNG, GIF (first frame), BMP, SVG. Convert to PNG or JPEG before use.`
+ );
+ }
+}
+
+function createImageStyles(t: PdfcnTheme) {
+ const { spacing } = t.primitives;
+ return StyleSheet.create({
+ caption: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.primitives.typography.xs,
+ marginTop: spacing[1],
+ textAlign: "center",
+ },
+ container: { flexDirection: "column" },
+ image: {},
+ imageBordered: {
+ borderColor: t.colors.border,
+ borderStyle: "solid",
+ borderWidth: 1,
+ },
+ });
+}
+
+export function PdfImage({
+ src,
+ variant = "default",
+ width,
+ height,
+ fit,
+ position = "50% 50%",
+ caption,
+ aspectRatio,
+ borderRadius,
+ noWrap = true,
+ style,
+}: PdfImageProps) {
+ warnIfUnsupported(src);
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createImageStyles(theme), [theme]);
+ const defaults = VARIANT_DEFAULTS[variant];
+
+ const resolvedWidth = width ?? defaults.width;
+ const resolvedHeight: number | string | undefined = (() => {
+ if (height !== undefined) {
+ return height;
+ }
+ if (defaults.height !== undefined) {
+ return defaults.height;
+ }
+ if (aspectRatio !== undefined && typeof resolvedWidth === "number") {
+ return resolvedWidth / aspectRatio;
+ }
+ return;
+ })();
+
+ const resolvedFit = fit ?? defaults.fit;
+ const resolvedRadius = borderRadius ?? defaults.borderRadius;
+
+ const imageStyles: Style[] = [styles.image];
+ if (resolvedWidth !== undefined) {
+ imageStyles.push({ width: resolvedWidth } as Style);
+ }
+ if (resolvedHeight !== undefined) {
+ imageStyles.push({ height: resolvedHeight } as Style);
+ }
+ imageStyles.push({
+ objectFit: resolvedFit,
+ objectPosition: position,
+ } as Style);
+ if (resolvedRadius !== undefined) {
+ imageStyles.push({ borderRadius: resolvedRadius } as Style);
+ }
+ if (variant === "bordered") {
+ imageStyles.push(styles.imageBordered);
+ }
+ if (style) {
+ imageStyles.push(style);
+ }
+
+ const content = (
+ <View style={styles.container}>
+ <Image src={src} style={imageStyles} />
+ {caption ? <PDFText style={styles.caption}>{caption}</PDFText> : null}
+ </View>
+ );
+
+ return noWrap ? (
+ <View style={[{ breakInside: "avoid" as const }].filter(Boolean)}>
+ {content}
+ </View>
+ ) : (
+ content
+ );
+}
diff --git a/registry/bases/takumi/components/qrcode/index.ts b/registry/bases/takumi/components/qrcode/index.ts
new file mode 100644
index 0000000..b0fac4d
--- /dev/null
+++ b/registry/bases/takumi/components/qrcode/index.ts
@@ -0,0 +1,5 @@
+export {
+ PdfQRCode,
+ type PdfQRCodeProps,
+ type QRCodeErrorLevel,
+} from "./qrcode";
diff --git a/registry/bases/takumi/components/qrcode/qrcode.tsx b/registry/bases/takumi/components/qrcode/qrcode.tsx
new file mode 100644
index 0000000..6f169a5
--- /dev/null
+++ b/registry/bases/takumi/components/qrcode/qrcode.tsx
@@ -0,0 +1,124 @@
+import QRCode from "qrcode";
+
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { resolveColor } from "../../lib/resolve-color";
+import { View, Text as PDFText, StyleSheet } from "../../lib/takumi-primitives";
+import type { Style } from "../../lib/takumi-primitives";
+import { Rect, Svg } from "../../lib/takumi-svg";
+
+export type QRCodeErrorLevel = "L" | "M" | "Q" | "H";
+
+/**
+ * QR code rendered as an SVG grid for use in PDF documents.
+ * Props - `value` | `size` | `color` | `backgroundColor` | `errorLevel` | `margin` | `caption` | `style`
+ * @see {@link PdfQRCodeProps}
+ */
+export interface PdfQRCodeProps extends Omit<PDFComponentProps, "children"> {
+ value: string;
+ size?: number;
+ color?: string;
+ backgroundColor?: string;
+ errorLevel?: QRCodeErrorLevel;
+ margin?: number;
+ caption?: string;
+ children?: never;
+}
+
+function createQRCodeStyles(t: PdfcnTheme) {
+ const { spacing } = t.primitives;
+ return StyleSheet.create({
+ caption: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.primitives.typography.xs,
+ marginTop: spacing[1],
+ textAlign: "center",
+ },
+ container: { alignItems: "center" },
+ });
+}
+
+function generateQRMatrix(
+ value: string,
+ errorLevel: QRCodeErrorLevel,
+ margin: number
+): boolean[][] {
+ const qr = QRCode.create(value, { errorCorrectionLevel: errorLevel });
+ const { size, data } = qr.modules;
+ const totalSize = size + margin * 2;
+ const matrix: boolean[][] = [];
+ for (let row = 0; row < totalSize; row++) {
+ const rowData: boolean[] = [];
+ for (let col = 0; col < totalSize; col++) {
+ const isInMargin =
+ row < margin ||
+ row >= size + margin ||
+ col < margin ||
+ col >= size + margin;
+ if (isInMargin) {
+ rowData.push(false);
+ } else {
+ rowData.push(data[(row - margin) * size + (col - margin)] === 1);
+ }
+ }
+ matrix.push(rowData);
+ }
+ return matrix;
+}
+
+export function PdfQRCode({
+ value,
+ size = 100,
+ color = "#000000",
+ backgroundColor = "#ffffff",
+ errorLevel = "M",
+ margin = 2,
+ caption,
+ style,
+}: PdfQRCodeProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createQRCodeStyles(theme), [theme]);
+ const matrix = useSafeMemo(
+ () => generateQRMatrix(value, errorLevel, margin),
+ [value, errorLevel, margin]
+ );
+ const moduleSize = size / matrix.length;
+ const resolvedColor = resolveColor(color, theme.colors);
+ const resolvedBgColor =
+ backgroundColor === "transparent"
+ ? undefined
+ : resolveColor(backgroundColor, theme.colors);
+ const containerStyles: Style[] = [styles.container];
+ if (style) {
+ containerStyles.push(...[style].flat());
+ }
+
+ return (
+ <View style={containerStyles}>
+ <Svg width={size} height={size} viewBox={`0 0 ${size} ${size}`}>
+ {resolvedBgColor !== undefined && (
+ <Rect x={0} y={0} width={size} height={size} fill={resolvedBgColor} />
+ )}
+ {matrix
+ .flatMap((row, y) =>
+ row
+ .map((isDark, x) => (isDark ? { x, y } : null))
+ .filter((pos): pos is { x: number; y: number } => pos !== null)
+ )
+ .map((pos) => (
+ <Rect
+ key={`qr-${pos.y}-${pos.x}`}
+ x={pos.x * moduleSize}
+ y={pos.y * moduleSize}
+ width={moduleSize}
+ height={moduleSize}
+ fill={resolvedColor}
+ />
+ ))}
+ </Svg>
+ {caption && <PDFText style={styles.caption}>{caption}</PDFText>}
+ </View>
+ );
+}
diff --git a/registry/bases/takumi/components/section/index.ts b/registry/bases/takumi/components/section/index.ts
new file mode 100644
index 0000000..18c2e0f
--- /dev/null
+++ b/registry/bases/takumi/components/section/index.ts
@@ -0,0 +1,7 @@
+export {
+ Section,
+ type SectionProps,
+ type SectionSpacing,
+ type SectionPadding,
+ type SectionVariant,
+} from "./section";
diff --git a/registry/bases/takumi/components/section/section.tsx b/registry/bases/takumi/components/section/section.tsx
new file mode 100644
index 0000000..de5643c
--- /dev/null
+++ b/registry/bases/takumi/components/section/section.tsx
@@ -0,0 +1,139 @@
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { resolveColor } from "../../lib/resolve-color";
+import { View, StyleSheet } from "../../lib/takumi-primitives";
+import type { Style } from "../../lib/takumi-primitives";
+
+export type SectionSpacing = "none" | "sm" | "md" | "lg" | "xl";
+export type SectionPadding = "none" | "sm" | "md" | "lg";
+export type SectionVariant = "default" | "callout" | "highlight" | "card";
+
+/**
+ * Layout container with spacing, padding, and visual style variants.
+ * Props - `spacing` | `padding` | `background` | `border` | `variant` | `accentColor` | `noWrap` | `children` | `style`
+ * @see {@link SectionProps}
+ */
+export interface SectionProps extends PDFComponentProps {
+ /**
+ * @default 'md'
+ */
+ spacing?: SectionSpacing;
+ padding?: SectionPadding;
+ background?: string;
+ /**
+ * @default false
+ */
+ border?: boolean;
+ /**
+ * @default 'default'
+ */
+ variant?: SectionVariant;
+ accentColor?: string;
+ /**
+ * @default false
+ */
+ noWrap?: boolean;
+}
+
+function createSectionStyles(t: PdfcnTheme) {
+ const { spacing, borderRadius } = t.primitives;
+ return StyleSheet.create({
+ base: { flexDirection: "column" },
+ border: {
+ borderColor: t.colors.border,
+ borderRadius: borderRadius.md,
+ borderStyle: "solid",
+ borderWidth: spacing[0.5],
+ },
+ callout: {
+ borderLeftColor: t.colors.primary,
+ borderLeftStyle: "solid",
+ borderLeftWidth: spacing[1],
+ paddingLeft: spacing[4],
+ paddingVertical: spacing[2],
+ },
+ card: {
+ borderColor: t.colors.border,
+ borderRadius: borderRadius.md,
+ borderStyle: "solid",
+ borderWidth: spacing[0.5],
+ padding: spacing[4],
+ },
+ highlight: {
+ backgroundColor: t.colors.muted,
+ borderLeftColor: t.colors.primary,
+ borderLeftStyle: "solid",
+ borderLeftWidth: spacing[1],
+ padding: spacing[4],
+ },
+ paddingLg: { padding: spacing[6] },
+ paddingMd: { padding: spacing[4] },
+ paddingNone: { padding: spacing[0] },
+ paddingSm: { padding: spacing[3] },
+ spacingLg: { marginVertical: spacing[8] },
+ spacingMd: { marginVertical: t.spacing.sectionGap },
+ spacingNone: { marginVertical: spacing[0] },
+ spacingSm: { marginVertical: spacing[4] },
+ spacingXl: { marginVertical: spacing[12] },
+ });
+}
+
+export function Section({
+ spacing = "md",
+ padding,
+ background,
+ border,
+ variant = "default",
+ accentColor,
+ noWrap = false,
+ children,
+ style,
+}: SectionProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createSectionStyles(theme), [theme]);
+ const spacingMap = {
+ lg: styles.spacingLg,
+ md: styles.spacingMd,
+ none: styles.spacingNone,
+ sm: styles.spacingSm,
+ xl: styles.spacingXl,
+ };
+ const paddingMap = {
+ lg: styles.paddingLg,
+ md: styles.paddingMd,
+ none: styles.paddingNone,
+ sm: styles.paddingSm,
+ };
+ const variantMap: Record<SectionVariant, Style | null> = {
+ callout: styles.callout,
+ card: styles.card,
+ default: null,
+ highlight: styles.highlight,
+ };
+ const styleArray: Style[] = [styles.base, spacingMap[spacing]];
+ const variantStyle = variantMap[variant];
+ if (variantStyle) {
+ styleArray.push(variantStyle);
+ }
+ if (accentColor && (variant === "callout" || variant === "highlight")) {
+ styleArray.push({
+ borderLeftColor: resolveColor(accentColor, theme.colors),
+ });
+ }
+ if (padding && padding in paddingMap) {
+ styleArray.push(paddingMap[padding]);
+ }
+ if (border && variant === "default") {
+ styleArray.push(styles.border);
+ }
+ if (background) {
+ styleArray.push({
+ backgroundColor: resolveColor(background, theme.colors),
+ });
+ }
+ if (style) {
+ styleArray.push(...[style].flat());
+ }
+ return <View style={styleArray}>{children}</View>;
+}
diff --git a/registry/bases/takumi/components/signature/index.ts b/registry/bases/takumi/components/signature/index.ts
new file mode 100644
index 0000000..fe7589d
--- /dev/null
+++ b/registry/bases/takumi/components/signature/index.ts
@@ -0,0 +1,6 @@
+export {
+ PdfSignatureBlock,
+ type PdfSignatureBlockProps,
+ type SignatureVariant,
+ type SignatureSigner,
+} from "./signature";
diff --git a/registry/bases/takumi/components/signature/signature.tsx b/registry/bases/takumi/components/signature/signature.tsx
new file mode 100644
index 0000000..555a34b
--- /dev/null
+++ b/registry/bases/takumi/components/signature/signature.tsx
@@ -0,0 +1,193 @@
+import type { PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { View, Text as PDFText, StyleSheet } from "../../lib/takumi-primitives";
+import type { Style } from "../../lib/takumi-primitives";
+
+export type SignatureVariant = "single" | "double" | "inline";
+
+/**
+ * Signature signer properties.
+ * Props - `label` | `name` | `title` | `date`
+ * @see {@link SignatureSigner}
+ */
+export interface SignatureSigner {
+ label?: string;
+ name?: string;
+ title?: string;
+ date?: string;
+}
+
+/**
+ * Signature block properties.
+ * Props - `variant` | `label` | `name` | `title` | `date` | `signers` | `style`
+ * @see {@link PdfSignatureBlockProps}
+ */
+export interface PdfSignatureBlockProps {
+ /**
+ * Layout variant: [single, double, inline]
+ * @default 'single'
+ */
+ variant?: SignatureVariant;
+ label?: string;
+ name?: string;
+ title?: string;
+ date?: string;
+ signers?: [SignatureSigner, SignatureSigner];
+ style?: Style;
+}
+
+function createSignatureStyles(t: PdfcnTheme) {
+ const { spacing, fontWeights, typography } = t.primitives;
+ return StyleSheet.create({
+ block: { flex: 1, minWidth: 140 },
+ container: {
+ marginBottom: t.spacing.componentGap,
+ marginTop: t.spacing.sectionGap,
+ },
+ dateText: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: typography.xs,
+ marginTop: 1,
+ },
+ doubleRow: {
+ flexDirection: "row",
+ gap: spacing[8],
+ justifyContent: "space-between",
+ },
+ inlineLabel: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: typography.sm,
+ },
+ inlineLine: {
+ borderBottomColor: t.colors.foreground,
+ borderBottomStyle: "solid",
+ borderBottomWidth: 1,
+ height: spacing[5],
+ minWidth: 120,
+ paddingHorizontal: spacing[2],
+ },
+ inlineName: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ },
+ inlineRow: {
+ alignItems: "center",
+ flexDirection: "row",
+ flexWrap: "wrap",
+ gap: spacing[3],
+ },
+ label: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: typography.sm,
+ marginBottom: spacing[1],
+ },
+ line: {
+ borderBottomColor: t.colors.foreground,
+ borderBottomStyle: "solid",
+ borderBottomWidth: 1,
+ marginBottom: spacing[1],
+ minHeight: spacing[6],
+ },
+ name: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ fontWeight: fontWeights.semibold,
+ },
+ titleText: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: typography.sm,
+ },
+ });
+}
+
+function renderSignerBlock(
+ signer: SignatureSigner,
+ styles: ReturnType<typeof createSignatureStyles>
+) {
+ return (
+ <View style={styles.block}>
+ {signer.label ? (
+ <PDFText style={styles.label}>{signer.label}</PDFText>
+ ) : null}
+ <View style={styles.line} />
+ {signer.name ? (
+ <PDFText style={styles.name}>{signer.name}</PDFText>
+ ) : null}
+ {signer.title ? (
+ <PDFText style={styles.titleText}>{signer.title}</PDFText>
+ ) : null}
+ {signer.date ? (
+ <PDFText style={styles.dateText}>{signer.date}</PDFText>
+ ) : null}
+ </View>
+ );
+}
+
+export function PdfSignatureBlock({
+ variant = "single",
+ label = "Signature",
+ name,
+ title,
+ date,
+ signers,
+ style,
+}: PdfSignatureBlockProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createSignatureStyles(theme), [theme]);
+ const containerStyles: Style[] = [styles.container];
+ if (style) {
+ containerStyles.push(style);
+ }
+
+ if (variant === "inline") {
+ return (
+ <View
+ style={[{ breakInside: "avoid" as const }, containerStyles]
+ .flat()
+ .filter(Boolean)}
+ >
+ <View style={styles.inlineRow}>
+ <PDFText style={styles.inlineLabel}>{`${label}:`}</PDFText>
+ <View style={styles.inlineLine} />
+ {name ? <PDFText style={styles.inlineName}>{name}</PDFText> : null}
+ </View>
+ </View>
+ );
+ }
+
+ if (variant === "double") {
+ const [first, second] = signers ?? [
+ { date: "", label: "Authorized by", name: "", title: "" },
+ { date: "", label: "Approved by", name: "", title: "" },
+ ];
+ return (
+ <View
+ style={[{ breakInside: "avoid" as const }, containerStyles]
+ .flat()
+ .filter(Boolean)}
+ >
+ <View style={styles.doubleRow}>
+ {renderSignerBlock(first, styles)}
+ {renderSignerBlock(second, styles)}
+ </View>
+ </View>
+ );
+ }
+
+ return (
+ <View
+ style={[{ breakInside: "avoid" as const }, containerStyles]
+ .flat()
+ .filter(Boolean)}
+ >
+ {renderSignerBlock({ date, label, name, title }, styles)}
+ </View>
+ );
+}
diff --git a/registry/bases/takumi/components/stack/index.ts b/registry/bases/takumi/components/stack/index.ts
new file mode 100644
index 0000000..159aa8e
--- /dev/null
+++ b/registry/bases/takumi/components/stack/index.ts
@@ -0,0 +1,8 @@
+export {
+ Stack,
+ type StackProps,
+ type StackGap,
+ type StackDirection,
+ type StackAlign,
+ type StackJustify,
+} from "./stack";
diff --git a/registry/bases/takumi/components/stack/stack.tsx b/registry/bases/takumi/components/stack/stack.tsx
new file mode 100644
index 0000000..0a214d6
--- /dev/null
+++ b/registry/bases/takumi/components/stack/stack.tsx
@@ -0,0 +1,116 @@
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { View, StyleSheet } from "../../lib/takumi-primitives";
+import type { Style } from "../../lib/takumi-primitives";
+
+export type StackGap = "none" | "sm" | "md" | "lg" | "xl";
+export type StackDirection = "vertical" | "horizontal";
+export type StackAlign = "start" | "center" | "end" | "stretch";
+export type StackJustify = "start" | "center" | "end" | "between" | "around";
+
+/**
+ * Flex layout container with gap and direction control.
+ * Props - `gap` | `direction` | `align` | `justify` | `wrap` | `noWrap` | `children` | `style`
+ * @see {@link StackProps}
+ */
+export interface StackProps extends PDFComponentProps {
+ /**
+ * @default 'md'
+ */
+ gap?: StackGap;
+ /**
+ * @default 'vertical'
+ */
+ direction?: StackDirection;
+ /**
+ * @default 'start'
+ */
+ align?: StackAlign;
+ /**
+ * @default 'start'
+ */
+ justify?: StackJustify;
+ /**
+ * @default false
+ */
+ wrap?: boolean;
+ /**
+ * @default false
+ */
+ noWrap?: boolean;
+}
+
+function createStackStyles(t: PdfcnTheme) {
+ const { spacing } = t.primitives;
+ return StyleSheet.create({
+ alignCenter: { alignItems: "center" },
+ alignEnd: { alignItems: "flex-end" },
+ alignStart: { alignItems: "flex-start" },
+ alignStretch: { alignItems: "stretch" },
+ gapLg: { gap: spacing[6] },
+ gapMd: { gap: spacing[4] },
+ gapNone: { gap: spacing[0] },
+ gapSm: { gap: spacing[2] },
+ gapXl: { gap: spacing[8] },
+ horizontal: { flexDirection: "row" },
+ justifyAround: { justifyContent: "space-around" },
+ justifyBetween: { justifyContent: "space-between" },
+ justifyCenter: { justifyContent: "center" },
+ justifyEnd: { justifyContent: "flex-end" },
+ justifyStart: { justifyContent: "flex-start" },
+ vertical: { flexDirection: "column" },
+ wrap: { flexWrap: "wrap" },
+ });
+}
+
+export function Stack({
+ gap = "md",
+ direction = "vertical",
+ align,
+ justify,
+ wrap,
+ noWrap,
+ children,
+ style,
+}: StackProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createStackStyles(theme), [theme]);
+ const gapMap = {
+ lg: styles.gapLg,
+ md: styles.gapMd,
+ none: styles.gapNone,
+ sm: styles.gapSm,
+ xl: styles.gapXl,
+ };
+ const alignMap = {
+ center: styles.alignCenter,
+ end: styles.alignEnd,
+ start: styles.alignStart,
+ stretch: styles.alignStretch,
+ };
+ const justifyMap = {
+ around: styles.justifyAround,
+ between: styles.justifyBetween,
+ center: styles.justifyCenter,
+ end: styles.justifyEnd,
+ start: styles.justifyStart,
+ };
+ const styleArray: Style[] = [
+ direction === "horizontal" ? styles.horizontal : styles.vertical,
+ gapMap[gap],
+ ];
+ if (align && align in alignMap) {
+ styleArray.push(alignMap[align]);
+ }
+ if (justify && justify in justifyMap) {
+ styleArray.push(justifyMap[justify]);
+ }
+ if (wrap) {
+ styleArray.push(styles.wrap);
+ }
+ if (style) {
+ styleArray.push(...[style].flat());
+ }
+ return <View style={styleArray}>{children}</View>;
+}
diff --git a/registry/bases/takumi/components/table/index.ts b/registry/bases/takumi/components/table/index.ts
new file mode 100644
index 0000000..edd8ab6
--- /dev/null
+++ b/registry/bases/takumi/components/table/index.ts
@@ -0,0 +1,15 @@
+export {
+ Table,
+ TableHeader,
+ TableBody,
+ TableFooter,
+ TableRow,
+ TableCell,
+} from "./table";
+export type {
+ TableProps,
+ TableSectionProps,
+ TableRowProps,
+ TableCellProps,
+ TableVariant,
+} from "./table.types";
diff --git a/registry/bases/takumi/components/table/table.styles.ts b/registry/bases/takumi/components/table/table.styles.ts
new file mode 100644
index 0000000..61ef87e
--- /dev/null
+++ b/registry/bases/takumi/components/table/table.styles.ts
@@ -0,0 +1,278 @@
+import type { PdfcnTheme } from "@/registry/themes";
+
+import { StyleSheet } from "../../lib/takumi-primitives";
+
+/**
+ * Creates all table styles derived from the active theme.
+ * @param t - The resolved PdfcnTheme instance.
+ */
+export function createTableStyles(t: PdfcnTheme) {
+ const { spacing, borderRadius, fontWeights, typography } = t.primitives;
+ const borderColor = t.colors.border;
+
+ const hairline = 0.5;
+ const rule = 1;
+ const thick = 1.5;
+
+ const cellPadV = spacing[2] - 2;
+ const cellPadH = spacing[2] + 2;
+ const cellPadVCompact = spacing[0.5];
+ const cellPadHCompact = spacing[2];
+
+ const rowDivider = {
+ borderBottomColor: borderColor,
+ borderBottomStyle: "solid" as const,
+ borderBottomWidth: hairline,
+ };
+
+ return StyleSheet.create({
+ cell: {
+ flex: 1,
+ justifyContent: "center",
+ paddingHorizontal: cellPadH,
+ paddingVertical: cellPadV,
+ },
+
+ cellBordered: {
+ paddingHorizontal: cellPadH,
+ paddingVertical: cellPadV,
+ },
+
+ cellBorderedBorder: {
+ borderRightColor: borderColor,
+ borderRightStyle: "solid",
+ borderRightWidth: hairline,
+ },
+
+ cellCompact: {
+ paddingHorizontal: cellPadHCompact,
+ paddingVertical: cellPadVCompact,
+ },
+
+ cellFixed: {
+ flexGrow: 0,
+ flexShrink: 0,
+ justifyContent: "center",
+ paddingHorizontal: cellPadH,
+ paddingVertical: cellPadV,
+ },
+
+ cellGridBorder: {
+ borderRightColor: borderColor,
+ borderRightStyle: "solid",
+ borderRightWidth: hairline,
+ },
+
+ cellMinimal: {
+ paddingHorizontal: spacing[2] - 2,
+ paddingVertical: spacing[1] + 1,
+ },
+
+ cellPrimaryHeader: {
+ paddingHorizontal: cellPadH,
+ paddingVertical: cellPadV,
+ },
+
+ cellStriped: {
+ paddingHorizontal: cellPadH,
+ paddingVertical: cellPadV,
+ },
+
+ cellText: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ lineHeight: 1.2,
+ },
+ cellTextCompact: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: typography.xs,
+ lineHeight: 1.2,
+ },
+ cellTextFooter: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ fontWeight: fontWeights.semibold,
+ lineHeight: 1.2,
+ },
+ cellTextHeaderBordered: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ fontWeight: fontWeights.bold,
+ lineHeight: 1.2,
+ },
+ cellTextHeaderCompact: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: typography.xs,
+ fontWeight: fontWeights.semibold,
+ letterSpacing: 0.6,
+ lineHeight: 1.2,
+ textTransform: "uppercase",
+ },
+ cellTextHeaderGrid: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ fontWeight: fontWeights.semibold,
+ lineHeight: 1.2,
+ },
+ cellTextHeaderLine: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ fontWeight: fontWeights.semibold,
+ lineHeight: 1.2,
+ },
+
+ cellTextHeaderMinimal: {
+ color: t.colors.mutedForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ fontWeight: fontWeights.medium,
+ lineHeight: 1.2,
+ },
+ cellTextHeaderPrimaryHeader: {
+ color: t.colors.primaryForeground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: typography.xs,
+ fontWeight: fontWeights.semibold,
+ letterSpacing: 0.6,
+ lineHeight: 1.2,
+ textTransform: "uppercase",
+ },
+ cellTextHeaderStriped: {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ fontSize: t.typography.body.fontSize,
+ fontWeight: fontWeights.semibold,
+ lineHeight: 1.2,
+ },
+ row: {
+ display: "flex",
+ flexDirection: "row",
+ },
+ rowBordered: rowDivider,
+ rowCompact: rowDivider,
+ rowFooter: {
+ borderTopColor: borderColor,
+ borderTopStyle: "solid",
+ borderTopWidth: rule,
+ },
+
+ rowFooterStriped: {
+ backgroundColor: t.colors.muted,
+ borderTopColor: borderColor,
+ borderTopStyle: "solid",
+ borderTopWidth: rule,
+ },
+ rowGrid: rowDivider,
+
+ rowHeaderBordered: {
+ backgroundColor: t.colors.muted,
+ borderBottomColor: borderColor,
+ borderBottomStyle: "solid",
+ borderBottomWidth: hairline,
+ },
+
+ rowHeaderCompact: {
+ backgroundColor: t.colors.muted,
+ borderBottomColor: borderColor,
+ borderBottomStyle: "solid",
+ borderBottomWidth: rule,
+ },
+ rowHeaderGrid: {
+ backgroundColor: t.colors.muted,
+ borderBottomColor: borderColor,
+ borderBottomStyle: "solid",
+ borderBottomWidth: rule,
+ },
+
+ rowHeaderLine: {
+ borderBottomColor: borderColor,
+ borderBottomStyle: "solid",
+ borderBottomWidth: rule,
+ },
+ rowHeaderMinimal: {
+ borderBottomColor: borderColor,
+ borderBottomStyle: "solid",
+ borderBottomWidth: rule,
+ },
+ rowHeaderPrimaryHeader: {
+ backgroundColor: t.colors.primary,
+ },
+ rowHeaderStriped: {
+ backgroundColor: t.colors.muted,
+ borderBottomColor: borderColor,
+ borderBottomStyle: "solid",
+ borderBottomWidth: rule,
+ },
+ rowLine: rowDivider,
+
+ rowMinimal: rowDivider,
+ rowPrimaryHeader: rowDivider,
+
+ rowStripe: {
+ backgroundColor: t.colors.muted,
+ },
+
+ rowStriped: {},
+ table: {
+ display: "flex",
+ flexDirection: "column",
+ marginBottom: t.spacing.componentGap,
+ width: "100%",
+ },
+ tableBordered: {
+ borderBottomLeftRadius: borderRadius.sm,
+ borderBottomRightRadius: borderRadius.sm,
+ borderColor,
+ borderStyle: "solid",
+ borderTopLeftRadius: borderRadius.sm,
+ borderTopRightRadius: borderRadius.sm,
+ borderWidth: rule,
+ overflow: "hidden" as const,
+ },
+ tableCompact: {
+ borderBottomColor: borderColor,
+ borderBottomStyle: "solid",
+ borderBottomWidth: hairline,
+ },
+ tableGrid: {
+ borderBottomLeftRadius: borderRadius.md,
+ borderBottomRightRadius: borderRadius.md,
+ borderColor,
+ borderStyle: "solid",
+ borderTopLeftRadius: borderRadius.md,
+ borderTopRightRadius: borderRadius.md,
+ borderWidth: thick,
+ overflow: "hidden" as const,
+ },
+ tableLine: {
+ borderBottomColor: borderColor,
+ borderBottomStyle: "solid",
+ borderBottomWidth: hairline,
+ },
+ tableMinimal: {
+ paddingVertical: spacing[2],
+ },
+
+ tablePrimaryHeader: {
+ borderBottomColor: borderColor,
+ borderBottomStyle: "solid",
+ borderBottomWidth: hairline,
+ },
+
+ tableStriped: {
+ borderBottomColor: borderColor,
+ borderBottomStyle: "solid",
+ borderBottomWidth: hairline,
+ borderTopColor: borderColor,
+ borderTopStyle: "solid",
+ borderTopWidth: hairline,
+ },
+ });
+}
diff --git a/registry/bases/takumi/components/table/table.tsx b/registry/bases/takumi/components/table/table.tsx
new file mode 100644
index 0000000..9d2f189
--- /dev/null
+++ b/registry/bases/takumi/components/table/table.tsx
@@ -0,0 +1,272 @@
+import { Children, cloneElement, isValidElement } from "react";
+import type { ReactElement, ReactNode } from "react";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { View, Text as PDFText } from "../../lib/takumi-primitives";
+import type { Style } from "../../lib/takumi-primitives";
+import { createTableStyles } from "./table.styles";
+import type {
+ TableCellProps,
+ TableProps,
+ TableRowProps,
+ TableSectionProps,
+ TableVariant,
+} from "./table.types";
+
+function processTableChildren(
+ children: ReactNode,
+ variant: TableVariant,
+ zebraStripe: boolean
+): ReactNode {
+ let bodyRowIndex = 0;
+
+ return Children.map(children, (child) => {
+ if (!isValidElement(child)) {
+ return child;
+ }
+
+ if (
+ child.type === TableHeader ||
+ child.type === TableBody ||
+ child.type === TableFooter
+ ) {
+ const isBody = child.type === TableBody;
+ const sectionChild = child as ReactElement<TableSectionProps>;
+ const sectionChildren = Children.map(
+ sectionChild.props.children,
+ (rowChild) => {
+ if (isValidElement(rowChild) && rowChild.type === TableRow) {
+ const rowProps: Partial<TableRowProps> = { variant };
+
+ if (isBody && zebraStripe) {
+ const isStripe = bodyRowIndex % 2 === 1;
+ bodyRowIndex++;
+ if (isStripe) {
+ rowProps.stripe = true;
+ }
+ }
+
+ return cloneElement(
+ rowChild as ReactElement<TableRowProps>,
+ rowProps
+ );
+ }
+ return rowChild;
+ }
+ );
+
+ return cloneElement(child, {}, sectionChildren);
+ }
+
+ if (child.type === TableRow) {
+ return cloneElement(child as ReactElement<TableRowProps>, { variant });
+ }
+
+ return child;
+ });
+}
+
+export function TableHeader({ children, style }: TableSectionProps) {
+ return <View style={style}>{children}</View>;
+}
+
+export function TableBody({ children, style }: TableSectionProps) {
+ return <View style={style}>{children}</View>;
+}
+
+export function TableFooter({ children, style }: TableSectionProps) {
+ return <View style={style}>{children}</View>;
+}
+
+export function Table({
+ children,
+ style,
+ variant = "line",
+ zebraStripe = false,
+ noWrap = false,
+}: TableProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createTableStyles(theme), [theme]);
+ const tableStyles: Style[] = [styles.table];
+ const effectiveZebra = variant === "striped" ? true : zebraStripe;
+
+ tableStyles.push(
+ {
+ bordered: styles.tableBordered,
+ compact: styles.tableCompact,
+ grid: styles.tableGrid,
+ line: styles.tableLine,
+ minimal: styles.tableMinimal,
+ "primary-header": styles.tablePrimaryHeader,
+ striped: styles.tableStriped,
+ }[variant]
+ );
+
+ const styleArray = style ? [...tableStyles, style] : tableStyles;
+ const processedChildren = processTableChildren(
+ children,
+ variant,
+ effectiveZebra
+ );
+
+ const inner = <View style={styleArray}>{processedChildren}</View>;
+ return noWrap ? (
+ <View style={[{ breakInside: "avoid" as const }].filter(Boolean)}>
+ {inner}
+ </View>
+ ) : (
+ inner
+ );
+}
+
+export function TableRow({
+ header,
+ footer,
+ stripe,
+ children,
+ style,
+ variant = "line",
+}: TableRowProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createTableStyles(theme), [theme]);
+ const rowStyles: Style[] = [styles.row];
+
+ rowStyles.push(
+ {
+ bordered: styles.rowBordered,
+ compact: styles.rowCompact,
+ grid: styles.rowGrid,
+ line: styles.rowLine,
+ minimal: styles.rowMinimal,
+ "primary-header": styles.rowPrimaryHeader,
+ striped: styles.rowStriped,
+ }[variant]
+ );
+
+ if (header) {
+ rowStyles.push(
+ {
+ bordered: styles.rowHeaderBordered,
+ compact: styles.rowHeaderCompact,
+ grid: styles.rowHeaderGrid,
+ line: styles.rowHeaderLine,
+ minimal: styles.rowHeaderMinimal,
+ "primary-header": styles.rowHeaderPrimaryHeader,
+ striped: styles.rowHeaderStriped,
+ }[variant]
+ );
+ }
+
+ if (footer) {
+ if (variant === "striped") {
+ rowStyles.push(styles.rowFooterStriped);
+ } else {
+ rowStyles.push(styles.rowFooter);
+ }
+ }
+
+ if (stripe && !header && !footer) {
+ rowStyles.push(styles.rowStripe);
+ }
+
+ const styleArray = style ? [...rowStyles, style] : rowStyles;
+ const childArray = Children.toArray(children);
+ const processedChildren = childArray.map((child, i) => {
+ if (isValidElement(child) && child.type === TableCell) {
+ return cloneElement(child as ReactElement<TableCellProps>, {
+ _last: i === childArray.length - 1,
+ footer,
+ header,
+ variant,
+ });
+ }
+ return child;
+ });
+
+ return (
+ <View
+ style={[{ breakInside: "avoid" as const }, styleArray]
+ .flat()
+ .filter(Boolean)}
+ >
+ {processedChildren}
+ </View>
+ );
+}
+
+export function TableCell({
+ header,
+ footer,
+ align,
+ width,
+ children,
+ style,
+ variant = "line",
+ _last,
+}: TableCellProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createTableStyles(theme), [theme]);
+ const cellStyles: Style[] =
+ width !== undefined
+ ? [styles.cellFixed, { width } as Style]
+ : [styles.cell];
+
+ const cellVariantStyle = (
+ {
+ bordered: styles.cellBordered,
+ compact: styles.cellCompact,
+ minimal: styles.cellMinimal,
+ "primary-header": styles.cellPrimaryHeader,
+ striped: styles.cellStriped,
+ } as Partial<Record<TableVariant, Style>>
+ )[variant];
+ if (cellVariantStyle) {
+ cellStyles.push(cellVariantStyle);
+ }
+
+ if (variant === "grid" && !_last) {
+ cellStyles.push(styles.cellGridBorder);
+ } else if (variant === "bordered" && !_last) {
+ cellStyles.push(styles.cellBorderedBorder);
+ }
+
+ if (align) {
+ cellStyles.push({ textAlign: align } as Style);
+ }
+
+ const styleArray = style ? [...cellStyles, style] : cellStyles;
+
+ let textStyle: Style = styles.cellText;
+ if (header) {
+ textStyle = {
+ bordered: styles.cellTextHeaderBordered,
+ compact: styles.cellTextHeaderCompact,
+ grid: styles.cellTextHeaderGrid,
+ line: styles.cellTextHeaderLine,
+ minimal: styles.cellTextHeaderMinimal,
+ "primary-header": styles.cellTextHeaderPrimaryHeader,
+ striped: styles.cellTextHeaderStriped,
+ }[variant];
+ } else if (footer) {
+ textStyle = styles.cellTextFooter;
+ } else if (variant === "compact") {
+ textStyle = styles.cellTextCompact;
+ }
+
+ const content =
+ typeof children === "string" ? (
+ <PDFText
+ style={[
+ textStyle,
+ align ? { textAlign: align } : {},
+ { margin: 0, padding: 0 },
+ ]}
+ >
+ {children}
+ </PDFText>
+ ) : (
+ children
+ );
+
+ return <View style={styleArray}>{content}</View>;
+}
diff --git a/registry/bases/takumi/components/table/table.types.ts b/registry/bases/takumi/components/table/table.types.ts
new file mode 100644
index 0000000..2de199e
--- /dev/null
+++ b/registry/bases/takumi/components/table/table.types.ts
@@ -0,0 +1,59 @@
+import type { PDFComponentProps } from "@/registry/themes";
+
+/** Table visual style variant. */
+export type TableVariant =
+ | "line"
+ | "grid"
+ | "minimal"
+ | "striped"
+ | "compact"
+ | "bordered"
+ | "primary-header";
+
+/**
+ * Table container with visual style variants and optional zebra striping.
+ * Props - `variant` | `zebraStripe` | `noWrap` | `children` | `style`
+ * @see {@link TableProps}
+ */
+export interface TableProps extends PDFComponentProps {
+ /**
+ * @default 'line'
+ */
+ variant?: TableVariant;
+ /**
+ * @default false
+ */
+ zebraStripe?: boolean;
+ /**
+ * @default false
+ */
+ noWrap?: boolean;
+}
+
+export type TableSectionProps = PDFComponentProps;
+
+/**
+ * Table row with optional header, footer, and stripe states.
+ * Props - `header` | `footer` | `stripe` | `variant` | `children` | `style`
+ * @see {@link TableRowProps}
+ */
+export interface TableRowProps extends PDFComponentProps {
+ header?: boolean;
+ footer?: boolean;
+ stripe?: boolean;
+ variant?: TableVariant;
+}
+
+/**
+ * Table cell with alignment, width, and header or footer text styling.
+ * Props - `header` | `footer` | `align` | `width` | `variant` | `_last` | `children` | `style`
+ * @see {@link TableCellProps}
+ */
+export interface TableCellProps extends PDFComponentProps {
+ header?: boolean;
+ footer?: boolean;
+ align?: "left" | "center" | "right";
+ width?: string | number;
+ variant?: TableVariant;
+ _last?: boolean;
+}
diff --git a/registry/bases/takumi/components/text/index.ts b/registry/bases/takumi/components/text/index.ts
new file mode 100644
index 0000000..25d1338
--- /dev/null
+++ b/registry/bases/takumi/components/text/index.ts
@@ -0,0 +1,7 @@
+export {
+ Text,
+ type TextProps,
+ type TextVariant,
+ type TextWeight,
+ type TextDecoration,
+} from "./text";
diff --git a/registry/bases/takumi/components/text/text.tsx b/registry/bases/takumi/components/text/text.tsx
new file mode 100644
index 0000000..1e20a0d
--- /dev/null
+++ b/registry/bases/takumi/components/text/text.tsx
@@ -0,0 +1,142 @@
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { resolveColor } from "../../lib/resolve-color";
+import { Text as PDFText, StyleSheet } from "../../lib/takumi-primitives";
+import type { Style } from "../../lib/takumi-primitives";
+
+export type TextVariant = "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl";
+export type TextWeight = "normal" | "medium" | "semibold" | "bold";
+export type TextDecoration = "underline" | "line-through" | "none";
+
+/**
+ * Body text with typography scale, alignment, and decoration options.
+ * Props - `variant` | `align` | `color` | `weight` | `italic` | `decoration` | `transform` | `noMargin` | `children` | `style`
+ * @see {@link TextProps}
+ */
+export interface TextProps extends PDFComponentProps {
+ /**
+ * @default 'base'
+ */
+ variant?: TextVariant;
+ /**
+ * @default 'left'
+ */
+ align?: "left" | "center" | "right" | "justify";
+ color?: string;
+ /**
+ * @default 'normal'
+ */
+ weight?: TextWeight;
+ /**
+ * @default false
+ */
+ italic?: boolean;
+ /**
+ * @default 'none'
+ */
+ decoration?: TextDecoration;
+ transform?: "uppercase" | "lowercase" | "capitalize";
+ /**
+ * @default false
+ */
+ noMargin?: boolean;
+}
+
+function createTextStyles(t: PdfcnTheme) {
+ const { fontWeights, letterSpacing } = t.primitives;
+ const base = {
+ color: t.colors.foreground,
+ fontFamily: t.typography.body.fontFamily,
+ lineHeight: t.typography.body.lineHeight,
+ marginBottom: t.spacing.paragraphGap,
+ marginTop: 0,
+ };
+ return StyleSheet.create({
+ "2xl": { ...base, fontSize: t.primitives.typography["2xl"] },
+ "3xl": { ...base, fontSize: t.primitives.typography["3xl"] },
+ base: { ...base, fontSize: t.primitives.typography.base },
+ capitalize: { textTransform: "capitalize" },
+ decorationNone: { textDecoration: "none" },
+ italic: { fontStyle: "italic" },
+ lg: { ...base, fontSize: t.primitives.typography.lg },
+ lineThrough: { textDecoration: "line-through" },
+ lowercase: { textTransform: "lowercase" },
+ noMargin: { marginBottom: 0, marginTop: 0 },
+ sm: { ...base, fontSize: t.primitives.typography.sm },
+ text: { ...base, fontSize: t.typography.body.fontSize },
+ underline: { textDecoration: "underline" },
+ uppercase: {
+ letterSpacing: letterSpacing.wider * 10,
+ textTransform: "uppercase",
+ },
+ weightBold: { fontWeight: fontWeights.bold },
+ weightMedium: { fontWeight: fontWeights.medium },
+ weightNormal: { fontWeight: fontWeights.regular },
+ weightSemibold: { fontWeight: fontWeights.semibold },
+ xl: { ...base, fontSize: t.primitives.typography.xl },
+ xs: { ...base, fontSize: t.primitives.typography.xs },
+ });
+}
+
+export function Text({
+ variant,
+ align,
+ color,
+ weight,
+ italic,
+ decoration,
+ transform,
+ noMargin,
+ children,
+ style,
+}: TextProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createTextStyles(theme), [theme]);
+ const weightMap = {
+ bold: styles.weightBold,
+ medium: styles.weightMedium,
+ normal: styles.weightNormal,
+ semibold: styles.weightSemibold,
+ };
+ const decorationMap = {
+ "line-through": styles.lineThrough,
+ none: styles.decorationNone,
+ underline: styles.underline,
+ };
+ const transformMap = {
+ capitalize: styles.capitalize,
+ lowercase: styles.lowercase,
+ uppercase: styles.uppercase,
+ };
+ const styleArray: Style[] = [variant ? styles[variant] : styles.text];
+ if (weight && weight in weightMap) {
+ styleArray.push(weightMap[weight]);
+ }
+ if (italic) {
+ styleArray.push(styles.italic);
+ }
+ if (decoration && decoration in decorationMap) {
+ styleArray.push(decorationMap[decoration]);
+ }
+ if (transform && transform in transformMap) {
+ styleArray.push(transformMap[transform]);
+ }
+ if (noMargin) {
+ styleArray.push(styles.noMargin);
+ }
+ const semantic = {} as Style;
+ if (align) {
+ semantic.textAlign = align;
+ }
+ if (color) {
+ semantic.color = resolveColor(color, theme.colors);
+ }
+ if (Object.keys(semantic).length > 0) {
+ styleArray.push(semantic);
+ }
+ if (style) {
+ styleArray.push(...[style].flat());
+ }
+ return <PDFText style={styleArray}>{children}</PDFText>;
+}
diff --git a/registry/bases/takumi/components/watermark/index.ts b/registry/bases/takumi/components/watermark/index.ts
new file mode 100644
index 0000000..f30a740
--- /dev/null
+++ b/registry/bases/takumi/components/watermark/index.ts
@@ -0,0 +1,5 @@
+export {
+ PdfWatermark,
+ type PdfWatermarkProps,
+ type WatermarkPosition,
+} from "./watermark";
diff --git a/registry/bases/takumi/components/watermark/watermark.tsx b/registry/bases/takumi/components/watermark/watermark.tsx
new file mode 100644
index 0000000..1383121
--- /dev/null
+++ b/registry/bases/takumi/components/watermark/watermark.tsx
@@ -0,0 +1,121 @@
+import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";
+
+import { usePdfcnTheme, useSafeMemo } from "../../lib/pdfcn-theme-context";
+import { resolveColor } from "../../lib/resolve-color";
+import { View, Text as PDFText, StyleSheet } from "../../lib/takumi-primitives";
+import type { Style } from "../../lib/takumi-primitives";
+
+export type WatermarkPosition =
+ | "center"
+ | "top-left"
+ | "top-right"
+ | "bottom-left"
+ | "bottom-right";
+
+/**
+ * Diagonal watermark overlaid across the full page using absolute positioning.
+ * Props - `text` | `opacity` | `fontSize` | `color` | `angle` | `position` | `fixed` | `style`
+ * @see {@link PdfWatermarkProps}
+ */
+export interface PdfWatermarkProps extends Omit<PDFComponentProps, "children"> {
+ text: string;
+ opacity?: number;
+ fontSize?: number;
+ color?: string;
+ angle?: number;
+ position?: WatermarkPosition;
+ /**
+ * @default true
+ */
+ fixed?: boolean;
+ children?: never;
+}
+
+function createWatermarkStyles(t: PdfcnTheme) {
+ const { fontWeights } = t.primitives;
+ // Use page margins as corner insets so watermark position adapts to the active theme.
+ const { marginTop, marginBottom, marginLeft, marginRight } = t.spacing.page;
+ return StyleSheet.create({
+ container: {
+ alignItems: "center",
+ bottom: 0,
+ justifyContent: "center",
+ left: 0,
+ pointerEvents: "none",
+ position: "absolute",
+ right: 0,
+ top: 0,
+ zIndex: -1,
+ },
+ positionBottomLeft: {
+ alignItems: "flex-start",
+ justifyContent: "flex-end",
+ paddingBottom: marginBottom,
+ paddingLeft: marginLeft,
+ },
+ positionBottomRight: {
+ alignItems: "flex-end",
+ justifyContent: "flex-end",
+ paddingBottom: marginBottom,
+ paddingRight: marginRight,
+ },
+ positionCenter: { alignItems: "center", justifyContent: "center" },
+ positionTopLeft: {
+ alignItems: "flex-start",
+ justifyContent: "flex-start",
+ paddingLeft: marginLeft,
+ paddingTop: marginTop,
+ },
+ positionTopRight: {
+ alignItems: "flex-end",
+ justifyContent: "flex-start",
+ paddingRight: marginRight,
+ paddingTop: marginTop,
+ },
+ text: {
+ fontFamily: t.typography.heading.fontFamily,
+ fontWeight: fontWeights.bold,
+ letterSpacing: 4,
+ textTransform: "uppercase",
+ },
+ });
+}
+
+export function PdfWatermark({
+ text,
+ opacity = 0.15,
+ fontSize = 60,
+ color = "mutedForeground",
+ angle = -45,
+ position = "center",
+ fixed = true,
+ style,
+}: PdfWatermarkProps) {
+ const theme = usePdfcnTheme();
+ const styles = useSafeMemo(() => createWatermarkStyles(theme), [theme]);
+ const positionMap: Record<WatermarkPosition, Style> = {
+ "bottom-left": styles.positionBottomLeft,
+ "bottom-right": styles.positionBottomRight,
+ center: styles.positionCenter,
+ "top-left": styles.positionTopLeft,
+ "top-right": styles.positionTopRight,
+ };
+ const containerStyles: Style[] = [styles.container, positionMap[position]];
+ if (style) {
+ containerStyles.push(...[style].flat());
+ }
+ const textStyles: Style[] = [
+ styles.text,
+ {
+ color: resolveColor(color, theme.colors),
+ fontSize,
+ opacity,
+ transform: `rotate(${angle}deg)`,
+ },
+ ];
+ return (
+ <View style={containerStyles}>
+ <PDFText style={textStyles}>{text}</PDFText>
+ </View>
+ );
+}
diff --git a/registry/bases/takumi/lib/pdfcn-theme-context.tsx b/registry/bases/takumi/lib/pdfcn-theme-context.tsx
new file mode 100644
index 0000000..1f7885d
--- /dev/null
+++ b/registry/bases/takumi/lib/pdfcn-theme-context.tsx
@@ -0,0 +1,90 @@
+/* eslint-disable react-refresh/only-export-components */
+// Exports both a component (PdfcnThemeProvider) and hooks/context intentionally.
+// All PDF components import from a single file — splitting would break the public API.
+
+import * as React from "react";
+import { createContext, useContext, useMemo } from "react";
+import type { DependencyList, ReactNode } from "react";
+
+import { theme as defaultTheme } from "./pdfcn-theme";
+
+export type PdfcnTheme = typeof defaultTheme;
+
+export const PdfcnThemeContext = createContext<PdfcnTheme>(defaultTheme);
+
+export interface PdfcnThemeProviderProps {
+ theme?: PdfcnTheme;
+ children: ReactNode;
+}
+
+/**
+ * Detect whether React currently has an active dispatcher.
+ * When components are invoked as plain functions in tests, dispatcher is null.
+ */
+function hasActiveDispatcher(): boolean {
+ const maybeInternals = React as unknown as {
+ __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE?: {
+ H?: unknown;
+ };
+ };
+
+ const dispatcher =
+ maybeInternals
+ .__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE?.H;
+ return dispatcher != null;
+}
+
+export function PdfcnThemeProvider({
+ theme,
+ children,
+}: PdfcnThemeProviderProps) {
+ const resolvedTheme = useMemo(() => theme ?? defaultTheme, [theme]);
+ return (
+ <PdfcnThemeContext.Provider value={resolvedTheme}>
+ {children}
+ </PdfcnThemeContext.Provider>
+ );
+}
+
+/**
+ * Regex patterns that indicate a hook was called outside a valid React render tree.
+ * These errors are caught and suppressed so components fall back to safe defaults.
+ */
+const HOOK_ERROR_PATTERNS =
+ /invalid hook call|useContext|useMemo|cannot read properties of null|dispatcher|renderWithHooks|resolveDispatcher|hooks can only be called|rendered fewer hooks/i;
+
+/**
+ * Calls a React hook with a graceful fallback for non-render environments (e.g. unit tests).
+ * Uses hasActiveDispatcher() as the primary guard; the try/catch is a safety net for edge
+ * cases where the dispatcher check passes but the hook still cannot execute.
+ */
+function callHook<T>(hook: () => T, fallback: T): T {
+ if (!hasActiveDispatcher()) {
+ return fallback;
+ }
+ try {
+ return hook();
+ } catch (error) {
+ if (error instanceof Error && HOOK_ERROR_PATTERNS.test(error.message)) {
+ return fallback;
+ }
+ throw error;
+ }
+}
+
+/**
+ * Returns the active PdfcnTheme from context, or the default theme when called
+ * outside a React render tree (e.g. unit tests).
+ */
+export function usePdfcnTheme(): PdfcnTheme {
+ return callHook(() => useContext(PdfcnThemeContext), defaultTheme);
+}
+
+/**
+ * Calls factory() and returns the result.
+ * The deps parameter is accepted for API compatibility with existing callers.
+ */
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
+export function useSafeMemo<T>(factory: () => T, _deps: DependencyList): T {
+ return factory();
+}
diff --git a/registry/bases/takumi/lib/pdfcn-theme.ts b/registry/bases/takumi/lib/pdfcn-theme.ts
new file mode 100644
index 0000000..6e9f81d
--- /dev/null
+++ b/registry/bases/takumi/lib/pdfcn-theme.ts
@@ -0,0 +1,3 @@
+import { professionalTheme } from "@/registry/themes";
+
+export const theme = professionalTheme;
diff --git a/registry/bases/takumi/lib/resolve-color.ts b/registry/bases/takumi/lib/resolve-color.ts
new file mode 100644
index 0000000..0d8029b
--- /dev/null
+++ b/registry/bases/takumi/lib/resolve-color.ts
@@ -0,0 +1,23 @@
+import type { ColorTokens } from "@/registry/themes";
+
+/** Theme color token keys that can be used for the color prop */
+export const THEME_COLOR_KEYS = [
+ "foreground",
+ "background",
+ "muted",
+ "mutedForeground",
+ "primary",
+ "primaryForeground",
+ "border",
+ "accent",
+ "destructive",
+ "success",
+ "warning",
+ "info",
+] as const satisfies (keyof ColorTokens)[];
+
+/** Resolves a color value: theme token key → hex, or raw CSS color as-is. */
+export function resolveColor(value: string, colors: ColorTokens): string {
+ const key = value as (typeof THEME_COLOR_KEYS)[number];
+ return THEME_COLOR_KEYS.includes(key) ? colors[key] : value;
+}
diff --git a/registry/bases/takumi/lib/takumi-primitives.tsx b/registry/bases/takumi/lib/takumi-primitives.tsx
new file mode 100644
index 0000000..4e18121
--- /dev/null
+++ b/registry/bases/takumi/lib/takumi-primitives.tsx
@@ -0,0 +1,160 @@
+import type { ReactNode, ImgHTMLAttributes, AnchorHTMLAttributes } from "react";
+
+export type Style = Record<string, unknown>;
+
+export const StyleSheet = {
+ create<T extends Record<string, Style>>(styles: T): T {
+ return styles;
+ },
+};
+
+type StyleInput = Style | Style[] | false | null | undefined;
+
+interface ViewProps {
+ children?: ReactNode;
+ style?: StyleInput;
+ className?: string;
+ wrap?: boolean;
+ fixed?: boolean;
+ break?: boolean;
+ minPresenceAhead?: number;
+}
+
+function flatten(style?: StyleInput): Record<string, unknown> | undefined {
+ if (!style) {
+ return undefined;
+ }
+ if (Array.isArray(style)) {
+ return Object.assign({}, ...style.filter(Boolean));
+ }
+ return style;
+}
+
+export function View({ children, style, className, ...rest }: ViewProps) {
+ const {
+ wrap: _w,
+ fixed: _f,
+ break: br,
+ minPresenceAhead: _m,
+ ...dom
+ } = rest as ViewProps & Record<string, unknown>;
+ const merged = flatten(style) ?? {};
+ if (br) {
+ Object.assign(merged, { breakBefore: "page" });
+ }
+ return (
+ <div
+ className={className}
+ style={merged as React.CSSProperties}
+ {...(dom as object)}
+ >
+ {children}
+ </div>
+ );
+}
+
+interface TextProps {
+ children?: ReactNode;
+ style?: StyleInput;
+ className?: string;
+ render?: (info: { pageNumber: number; totalPages: number }) => ReactNode;
+ fixed?: boolean;
+ href?: string;
+ src?: string;
+}
+
+export function Text({
+ children,
+ style,
+ className,
+ render: _render,
+ href,
+ src,
+ ...rest
+}: TextProps) {
+ const merged = flatten(style) as React.CSSProperties | undefined;
+ const link = href ?? src;
+ if (link) {
+ return (
+ <a href={link} className={className} style={merged} {...(rest as object)}>
+ {children}
+ </a>
+ );
+ }
+ return (
+ <span className={className} style={merged} {...(rest as object)}>
+ {children}
+ </span>
+ );
+}
+
+export function Image({
+ src,
+ style,
+ ...rest
+}: {
+ src: string | { uri: string };
+ style?: StyleInput;
+} & Omit<ImgHTMLAttributes<HTMLImageElement>, "src" | "style">) {
+ const resolved = typeof src === "string" ? src : src.uri;
+ return (
+ <img
+ src={resolved}
+ style={flatten(style) as React.CSSProperties}
+ alt=""
+ {...rest}
+ />
+ );
+}
+
+export function Link({
+ src,
+ children,
+ style,
+ ...rest
+}: {
+ src: string;
+ children?: ReactNode;
+ style?: StyleInput;
+} & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href" | "style">) {
+ return (
+ <a href={src} style={flatten(style) as React.CSSProperties} {...rest}>
+ {children}
+ </a>
+ );
+}
+
+export function Document({
+ children,
+ title,
+ style,
+}: {
+ children?: ReactNode;
+ title?: string;
+ style?: StyleInput;
+}) {
+ return (
+ <div
+ data-pdf-document={title}
+ style={flatten(style) as React.CSSProperties}
+ >
+ {children}
+ </div>
+ );
+}
+
+export function Page({
+ children,
+ size: _size,
+ style,
+}: {
+ children?: ReactNode;
+ size?: string | { width: number; height: number };
+ style?: StyleInput;
+}) {
+ return (
+ <div data-pdf-page style={flatten(style) as React.CSSProperties}>
+ {children}
+ </div>
+ );
+}
diff --git a/registry/bases/takumi/lib/takumi-svg.tsx b/registry/bases/takumi/lib/takumi-svg.tsx
new file mode 100644
index 0000000..04206b0
--- /dev/null
+++ b/registry/bases/takumi/lib/takumi-svg.tsx
@@ -0,0 +1,40 @@
+import type { CSSProperties, ReactNode, SVGProps } from "react";
+
+export function Svg({
+ children,
+ style,
+ ...rest
+}: SVGProps<SVGSVGElement> & { style?: CSSProperties }) {
+ return (
+ <svg style={style} {...rest}>
+ {children}
+ </svg>
+ );
+}
+
+export function Rect(props: SVGProps<SVGRectElement>) {
+ return <rect {...props} />;
+}
+export function Circle(props: SVGProps<SVGCircleElement>) {
+ return <circle {...props} />;
+}
+export function G(props: SVGProps<SVGGElement>) {
+ return <g {...props} />;
+}
+export function Line(props: SVGProps<SVGLineElement>) {
+ return <line {...props} />;
+}
+export function Path(props: SVGProps<SVGPathElement>) {
+ return <path {...props} />;
+}
+export function SvgText({
+ children,
+ style,
+ ...rest
+}: SVGProps<SVGTextElement> & { children?: ReactNode; style?: CSSProperties }) {
+ return (
+ <text style={style} {...rest}>
+ {children}
+ </text>
+ );
+}
diff --git a/registry/bases/takumi/registry.ts b/registry/bases/takumi/registry.ts
new file mode 100644
index 0000000..05d4988
--- /dev/null
+++ b/registry/bases/takumi/registry.ts
@@ -0,0 +1,6 @@
+export const takumiRegistryBase = {
+ examplesDir: "examples/takumi",
+ name: "takumi",
+ publicRegistryDir: null,
+ sourceDir: "registry/bases/takumi",
+} as const;
diff --git a/registry/config.ts b/registry/config.ts
new file mode 100644
index 0000000..9a6dae5
--- /dev/null
+++ b/registry/config.ts
@@ -0,0 +1,27 @@
+import { z } from "zod";
+
+import { BASE_NAMES, BASES, DEFAULT_BASE } from "@/registry/bases";
+import type { Base, BaseName } from "@/registry/bases";
+import { THEME_NAMES, THEMES } from "@/registry/themes-registry";
+import type {
+ RegistryTheme,
+ RegistryThemeName,
+} from "@/registry/themes-registry";
+
+export { BASES, type Base, type BaseName, DEFAULT_BASE };
+export { THEMES, type RegistryTheme, type RegistryThemeName };
+
+export const registryConfigSchema = z.object({
+ base: z.enum(BASE_NAMES).default(DEFAULT_BASE),
+ theme: z.enum(THEME_NAMES).default("professional"),
+});
+
+export type RegistryConfig = z.infer<typeof registryConfigSchema>;
+
+export const DEFAULT_REGISTRY_CONFIG: RegistryConfig = {
+ base: DEFAULT_BASE,
+ theme: "professional",
+};
+
+export const getRegistryConfig = (config?: Partial<RegistryConfig>) =>
+ registryConfigSchema.parse(config ?? {});
diff --git a/registry/new-york/your-component.tsx b/registry/new-york/your-component.tsx
deleted file mode 100644
index c861fa3..0000000
--- a/registry/new-york/your-component.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import type { HTMLAttributes } from "react";
-import { forwardRef } from "react";
-
-import { cn } from "@/lib/utils";
-
-export type YourComponentProps = HTMLAttributes<HTMLDivElement>;
-
-/**
- * 🚀 YOUR COMPONENT TEMPLATE
- *
- * This is a placeholder component. Replace this with your actual component implementation.
- *
- * Steps to customize:
- * 1. Rename this file to match your component name (e.g., my-button.tsx)
- * 2. Update the component logic and props
- * 3. Update registry.json with your component details
- * 4. Run `pnpm registry:build` to rebuild the registry
- *
- * For more information, visit the documentation.
- */
-const YourComponent = forwardRef<HTMLDivElement, YourComponentProps>(
- ({ className, ...props }, ref) => (
- <div
- ref={ref}
- className={cn(
- "p-4 rounded-md text-center bg-muted/20 space-y-2 border border-muted h-48 flex items-center flex-col justify-center",
- className
- )}
- {...props}
- >
- <p className="text-sm text-muted-foreground/70">
- Replace this placeholder with your custom shadcn component
- </p>
- <p className="text-muted-foreground text-center text-xs">
- Edit{" "}
- <code className="bg-muted rounded px-1.5 py-0.5 text-xs">
- registry/new-york/your-component.tsx
- </code>{" "}
- to get started
- </p>
- </div>
- )
-);
-
-YourComponent.displayName = "YourComponent";
-
-export { YourComponent };
diff --git a/registry/themes-registry.ts b/registry/themes-registry.ts
new file mode 100644
index 0000000..4277168
--- /dev/null
+++ b/registry/themes-registry.ts
@@ -0,0 +1,19 @@
+import { themePresets } from "@/registry/themes";
+import type { ThemePresetName } from "@/registry/themes";
+
+export const THEMES = Object.entries(themePresets).map(([name, theme]) => ({
+ name: name as ThemePresetName,
+ theme,
+ title: name.charAt(0).toUpperCase() + name.slice(1),
+}));
+
+export type RegistryTheme = (typeof THEMES)[number];
+export type RegistryThemeName = RegistryTheme["name"];
+
+export const THEME_NAMES = THEMES.map((t) => t.name) as [
+ RegistryThemeName,
+ ...RegistryThemeName[],
+];
+
+export const getTheme = (name: RegistryThemeName) =>
+ THEMES.find((t) => t.name === name);
diff --git a/registry/themes/blueprint.ts b/registry/themes/blueprint.ts
new file mode 100644
index 0000000..a7912af
--- /dev/null
+++ b/registry/themes/blueprint.ts
@@ -0,0 +1,63 @@
+import { defaultPrimitives } from "./primitives";
+import type { PdfcnTheme } from "./theme-types";
+
+/**
+ * Blueprint theme preset.
+ *
+ * Character: Dark slate palette with cyan accent, JetBrains Mono headings,
+ * Source Code Pro body — a technical, precision-first aesthetic.
+ * Ideal for API docs, engineering specs, and developer-focused reports.
+ */
+export const blueprintTheme: PdfcnTheme = {
+ colors: {
+ accent: "#0891b2",
+ background: "#ffffff",
+ border: "#cbd5e1",
+ destructive: "#e11d48",
+ foreground: "#0f172a",
+ info: "#0284c7",
+ muted: "#f1f5f9",
+ mutedForeground: "#475569",
+ primary: "#0f172a",
+ primaryForeground: "#f0f9ff",
+ success: "#059669",
+ warning: "#d97706",
+ },
+ name: "blueprint",
+ page: {
+ orientation: "portrait",
+ size: "A4",
+ },
+ primitives: defaultPrimitives,
+ spacing: {
+ componentGap: 14,
+ page: {
+ marginBottom: 52,
+ marginLeft: 48,
+ marginRight: 48,
+ marginTop: 52,
+ },
+ paragraphGap: 10,
+ sectionGap: 26,
+ },
+ typography: {
+ body: {
+ fontFamily: "Source Code Pro",
+ fontSize: 10,
+ lineHeight: 1.75,
+ },
+ heading: {
+ fontFamily: "JetBrains Mono",
+ fontSize: {
+ h1: 28,
+ h2: 21,
+ h3: 17,
+ h4: 14,
+ h5: 12,
+ h6: 10,
+ },
+ fontWeight: 700,
+ lineHeight: 1.2,
+ },
+ },
+};
diff --git a/registry/themes/component-types.ts b/registry/themes/component-types.ts
new file mode 100644
index 0000000..4563240
--- /dev/null
+++ b/registry/themes/component-types.ts
@@ -0,0 +1,12 @@
+import type { ReactNode } from "react";
+
+/** CSS-like style object compatible with both Takumi and Forme */
+export type Style = Record<string, unknown>;
+
+/**
+ * Base props shared by all pdfcn PDF components.
+ */
+export interface PDFComponentProps {
+ style?: Style;
+ children: ReactNode;
+}
diff --git a/registry/themes/corporate.ts b/registry/themes/corporate.ts
new file mode 100644
index 0000000..b77d45c
--- /dev/null
+++ b/registry/themes/corporate.ts
@@ -0,0 +1,63 @@
+import { defaultPrimitives } from "./primitives";
+import type { PdfcnTheme } from "./theme-types";
+
+/**
+ * Corporate theme preset.
+ *
+ * Character: Blue-gray palette, Lato sans-serif throughout, structured and
+ * dependable. Sky-blue accent adds clarity without distraction.
+ * Ideal for business proposals, project plans, and client-facing reports.
+ */
+export const corporateTheme: PdfcnTheme = {
+ colors: {
+ accent: "#0ea5e9",
+ background: "#ffffff",
+ border: "#e2e8f0",
+ destructive: "#ef4444",
+ foreground: "#1e293b",
+ info: "#3b82f6",
+ muted: "#f8fafc",
+ mutedForeground: "#64748b",
+ primary: "#0f4c81",
+ primaryForeground: "#ffffff",
+ success: "#22c55e",
+ warning: "#f59e0b",
+ },
+ name: "corporate",
+ page: {
+ orientation: "portrait",
+ size: "A4",
+ },
+ primitives: defaultPrimitives,
+ spacing: {
+ componentGap: 13,
+ page: {
+ marginBottom: 52,
+ marginLeft: 44,
+ marginRight: 44,
+ marginTop: 52,
+ },
+ paragraphGap: 9,
+ sectionGap: 24,
+ },
+ typography: {
+ body: {
+ fontFamily: "Lato",
+ fontSize: 11,
+ lineHeight: 1.55,
+ },
+ heading: {
+ fontFamily: "Lato",
+ fontSize: {
+ h1: 30,
+ h2: 22,
+ h3: 18,
+ h4: 15,
+ h5: 13,
+ h6: 11,
+ },
+ fontWeight: 700,
+ lineHeight: 1.2,
+ },
+ },
+};
diff --git a/registry/themes/elegant.ts b/registry/themes/elegant.ts
new file mode 100644
index 0000000..2f7a84f
--- /dev/null
+++ b/registry/themes/elegant.ts
@@ -0,0 +1,63 @@
+import { defaultPrimitives } from "./primitives";
+import type { PdfcnTheme } from "./theme-types";
+
+/**
+ * Elegant theme preset.
+ *
+ * Character: Warm cream-adjacent whites, amber/gold accent, Playfair Display
+ * headings paired with Lora body — a classic editorial combination.
+ * Ideal for design portfolios, luxury brands, and high-end editorial PDFs.
+ */
+export const elegantTheme: PdfcnTheme = {
+ colors: {
+ accent: "#b45309",
+ background: "#ffffff",
+ border: "#d6d3d1",
+ destructive: "#dc2626",
+ foreground: "#1c1917",
+ info: "#0ea5e9",
+ muted: "#fafaf9",
+ mutedForeground: "#78716c",
+ primary: "#78350f",
+ primaryForeground: "#fffbeb",
+ success: "#16a34a",
+ warning: "#d97706",
+ },
+ name: "elegant",
+ page: {
+ orientation: "portrait",
+ size: "A4",
+ },
+ primitives: defaultPrimitives,
+ spacing: {
+ componentGap: 16,
+ page: {
+ marginBottom: 60,
+ marginLeft: 52,
+ marginRight: 52,
+ marginTop: 60,
+ },
+ paragraphGap: 12,
+ sectionGap: 30,
+ },
+ typography: {
+ body: {
+ fontFamily: "Lora",
+ fontSize: 11,
+ lineHeight: 1.7,
+ },
+ heading: {
+ fontFamily: "Playfair Display",
+ fontSize: {
+ h1: 36,
+ h2: 26,
+ h3: 20,
+ h4: 16,
+ h5: 14,
+ h6: 12,
+ },
+ fontWeight: 700,
+ lineHeight: 1.2,
+ },
+ },
+};
diff --git a/registry/themes/executive.ts b/registry/themes/executive.ts
new file mode 100644
index 0000000..228a735
--- /dev/null
+++ b/registry/themes/executive.ts
@@ -0,0 +1,63 @@
+import { defaultPrimitives } from "./primitives";
+import type { PdfcnTheme } from "./theme-types";
+
+/**
+ * Executive theme preset.
+ *
+ * Character: Deep navy palette, Merriweather serif headings, Open Sans body.
+ * Generous margins, high contrast, premium boardroom aesthetic.
+ * Ideal for board reports, executive briefs, and investor documents.
+ */
+export const executiveTheme: PdfcnTheme = {
+ colors: {
+ accent: "#1e40af",
+ background: "#ffffff",
+ border: "#cbd5e1",
+ destructive: "#dc2626",
+ foreground: "#0f172a",
+ info: "#0369a1",
+ muted: "#f1f5f9",
+ mutedForeground: "#64748b",
+ primary: "#1e3a5f",
+ primaryForeground: "#ffffff",
+ success: "#15803d",
+ warning: "#b45309",
+ },
+ name: "executive",
+ page: {
+ orientation: "portrait",
+ size: "A4",
+ },
+ primitives: defaultPrimitives,
+ spacing: {
+ componentGap: 16,
+ page: {
+ marginBottom: 64,
+ marginLeft: 56,
+ marginRight: 56,
+ marginTop: 64,
+ },
+ paragraphGap: 10,
+ sectionGap: 32,
+ },
+ typography: {
+ body: {
+ fontFamily: "Open Sans",
+ fontSize: 11,
+ lineHeight: 1.65,
+ },
+ heading: {
+ fontFamily: "Merriweather",
+ fontSize: {
+ h1: 34,
+ h2: 26,
+ h3: 20,
+ h4: 16,
+ h5: 14,
+ h6: 12,
+ },
+ fontWeight: 700,
+ lineHeight: 1.25,
+ },
+ },
+};
diff --git a/registry/themes/forest.ts b/registry/themes/forest.ts
new file mode 100644
index 0000000..3df89f2
--- /dev/null
+++ b/registry/themes/forest.ts
@@ -0,0 +1,63 @@
+import { defaultPrimitives } from "./primitives";
+import type { PdfcnTheme } from "./theme-types";
+
+/**
+ * Forest theme preset.
+ *
+ * Character: Natural deep greens, Merriweather headings for gravitas, Inter
+ * body for readability. Earthy and trustworthy.
+ * Ideal for sustainability reports, environmental docs, and wellness brands.
+ */
+export const forestTheme: PdfcnTheme = {
+ colors: {
+ accent: "#16a34a",
+ background: "#ffffff",
+ border: "#bbf7d0",
+ destructive: "#dc2626",
+ foreground: "#14532d",
+ info: "#0ea5e9",
+ muted: "#f0fdf4",
+ mutedForeground: "#4d7c5f",
+ primary: "#15803d",
+ primaryForeground: "#ffffff",
+ success: "#15803d",
+ warning: "#d97706",
+ },
+ name: "forest",
+ page: {
+ orientation: "portrait",
+ size: "A4",
+ },
+ primitives: defaultPrimitives,
+ spacing: {
+ componentGap: 14,
+ page: {
+ marginBottom: 56,
+ marginLeft: 48,
+ marginRight: 48,
+ marginTop: 56,
+ },
+ paragraphGap: 10,
+ sectionGap: 28,
+ },
+ typography: {
+ body: {
+ fontFamily: "Inter",
+ fontSize: 11,
+ lineHeight: 1.6,
+ },
+ heading: {
+ fontFamily: "Merriweather",
+ fontSize: {
+ h1: 32,
+ h2: 24,
+ h3: 19,
+ h4: 15,
+ h5: 13,
+ h6: 11,
+ },
+ fontWeight: 700,
+ lineHeight: 1.25,
+ },
+ },
+};
diff --git a/registry/themes/index.ts b/registry/themes/index.ts
new file mode 100644
index 0000000..490ccd2
--- /dev/null
+++ b/registry/themes/index.ts
@@ -0,0 +1,30 @@
+export type { PDFComponentProps, Style } from "./component-types";
+export type {
+ PdfcnTheme,
+ PrimitiveTokens,
+ ColorTokens,
+ TypographyTokens,
+ SpacingTokens,
+ PageTokens,
+ TypographyScale,
+ SpacingScale,
+ FontWeights,
+ LineHeights,
+ BorderRadiusScale,
+ LetterSpacingScale,
+} from "./theme-types";
+
+export {
+ defaultPrimitives,
+ professionalTheme,
+ modernTheme,
+ minimalTheme,
+ executiveTheme,
+ corporateTheme,
+ elegantTheme,
+ vividTheme,
+ forestTheme,
+ blueprintTheme,
+ themePresets,
+ type ThemePresetName,
+} from "./themes-barrel";
diff --git a/registry/themes/minimal.ts b/registry/themes/minimal.ts
new file mode 100644
index 0000000..719bc63
--- /dev/null
+++ b/registry/themes/minimal.ts
@@ -0,0 +1,63 @@
+import { defaultPrimitives } from "./primitives";
+import type { PdfcnTheme } from "./theme-types";
+
+/**
+ * Minimal theme preset.
+ *
+ * Character: Courier headings, zinc neutrals, maximum whitespace.
+ * shadcn-inspired restrained palette. Ideal for clean documentation,
+ * technical specs, and literary manuscripts.
+ */
+export const minimalTheme: PdfcnTheme = {
+ colors: {
+ accent: "#71717a",
+ background: "#ffffff",
+ border: "#e4e4e7",
+ destructive: "#b91c1c",
+ foreground: "#18181b",
+ info: "#0369a1",
+ muted: "#fafafa",
+ mutedForeground: "#a1a1aa",
+ primary: "#18181b",
+ primaryForeground: "#ffffff",
+ success: "#15803d",
+ warning: "#a16207",
+ },
+ name: "minimal",
+ page: {
+ orientation: "portrait",
+ size: "A4",
+ },
+ primitives: defaultPrimitives,
+ spacing: {
+ componentGap: 18,
+ page: {
+ marginBottom: 72,
+ marginLeft: 56,
+ marginRight: 56,
+ marginTop: 72,
+ },
+ paragraphGap: 14,
+ sectionGap: 36,
+ },
+ typography: {
+ body: {
+ fontFamily: "Helvetica",
+ fontSize: 11,
+ lineHeight: 1.65,
+ },
+ heading: {
+ fontFamily: "Courier",
+ fontSize: {
+ h1: 24,
+ h2: 20,
+ h3: 16,
+ h4: 14,
+ h5: 12,
+ h6: 10,
+ },
+ fontWeight: 600,
+ lineHeight: 1.25,
+ },
+ },
+};
diff --git a/registry/themes/modern.ts b/registry/themes/modern.ts
new file mode 100644
index 0000000..7c89a7e
--- /dev/null
+++ b/registry/themes/modern.ts
@@ -0,0 +1,63 @@
+import { defaultPrimitives } from "./primitives";
+import type { PdfcnTheme } from "./theme-types";
+
+/**
+ * Modern theme preset.
+ *
+ * Character: All-Helvetica, slate-cool neutrals with subtle violet accent,
+ * clean spacing. shadcn-inspired contemporary feel.
+ * Ideal for startups, tech companies, and design-forward documents.
+ */
+export const modernTheme: PdfcnTheme = {
+ colors: {
+ accent: "#6366f1",
+ background: "#ffffff",
+ border: "#e2e8f0",
+ destructive: "#ef4444",
+ foreground: "#0f172a",
+ info: "#3b82f6",
+ muted: "#f1f5f9",
+ mutedForeground: "#64748b",
+ primary: "#334155",
+ primaryForeground: "#ffffff",
+ success: "#22c55e",
+ warning: "#f59e0b",
+ },
+ name: "modern",
+ page: {
+ orientation: "portrait",
+ size: "A4",
+ },
+ primitives: defaultPrimitives,
+ spacing: {
+ componentGap: 12,
+ page: {
+ marginBottom: 40,
+ marginLeft: 40,
+ marginRight: 40,
+ marginTop: 40,
+ },
+ paragraphGap: 10,
+ sectionGap: 24,
+ },
+ typography: {
+ body: {
+ fontFamily: "Helvetica",
+ fontSize: 11,
+ lineHeight: 1.6,
+ },
+ heading: {
+ fontFamily: "Helvetica",
+ fontSize: {
+ h1: 28,
+ h2: 22,
+ h3: 18,
+ h4: 16,
+ h5: 14,
+ h6: 12,
+ },
+ fontWeight: 600,
+ lineHeight: 1.25,
+ },
+ },
+};
diff --git a/registry/themes/primitives.ts b/registry/themes/primitives.ts
new file mode 100644
index 0000000..16da458
--- /dev/null
+++ b/registry/themes/primitives.ts
@@ -0,0 +1,64 @@
+import type { PrimitiveTokens } from "./theme-types";
+
+/**
+ * Default primitive tokens shared by all theme presets.
+ *
+ * These define the raw design scales — the "palette" of values available.
+ * Themes select from these scales when assigning semantic tokens.
+ *
+ * - Typography: Major Third (1.25) ratio, 12pt base
+ * - Spacing: 4pt grid system
+ * - Font weights: 400–700
+ * - Line heights: 1.2–1.6
+ * - Border radius: 0–8pt (plus full for pills)
+ * - Letter spacing: -0.025 to 0.05 (em-like ratios for PDF points)
+ */
+export const defaultPrimitives: PrimitiveTokens = {
+ borderRadius: {
+ full: 9999,
+ lg: 8,
+ md: 4,
+ none: 0,
+ sm: 2,
+ },
+ fontWeights: {
+ bold: 700,
+ medium: 500,
+ regular: 400,
+ semibold: 600,
+ },
+ letterSpacing: {
+ normal: 0,
+ tight: -0.025,
+ wide: 0.025,
+ wider: 0.05,
+ },
+ lineHeights: {
+ normal: 1.4,
+ relaxed: 1.6,
+ tight: 1.2,
+ },
+ spacing: {
+ 0: 0,
+ 0.5: 2,
+ 1: 4,
+ 10: 40,
+ 12: 48,
+ 16: 64,
+ 2: 8,
+ 3: 12,
+ 4: 16,
+ 5: 20,
+ 6: 24,
+ 8: 32,
+ },
+ typography: {
+ "2xl": 28,
+ "3xl": 36,
+ base: 15,
+ lg: 18,
+ sm: 12,
+ xl: 22,
+ xs: 10,
+ },
+};
diff --git a/registry/themes/professional.ts b/registry/themes/professional.ts
new file mode 100644
index 0000000..d9fbe52
--- /dev/null
+++ b/registry/themes/professional.ts
@@ -0,0 +1,63 @@
+import { defaultPrimitives } from "./primitives";
+import type { PdfcnTheme } from "./theme-types";
+
+/**
+ * Professional theme preset.
+ *
+ * Character: Serif headings (Times-Roman), refined zinc/slate palette,
+ * generous margins, formal document feel. shadcn-inspired minimal aesthetic.
+ * Ideal for business documents, reports, and official correspondence.
+ */
+export const professionalTheme: PdfcnTheme = {
+ colors: {
+ accent: "#3b82f6",
+ background: "#ffffff",
+ border: "#e4e4e7",
+ destructive: "#dc2626",
+ foreground: "#18181b",
+ info: "#0ea5e9",
+ muted: "#f4f4f5",
+ mutedForeground: "#71717a",
+ primary: "#18181b",
+ primaryForeground: "#ffffff",
+ success: "#16a34a",
+ warning: "#d97706",
+ },
+ name: "professional",
+ page: {
+ orientation: "portrait",
+ size: "A4",
+ },
+ primitives: defaultPrimitives,
+ spacing: {
+ componentGap: 14,
+ page: {
+ marginBottom: 56,
+ marginLeft: 48,
+ marginRight: 48,
+ marginTop: 56,
+ },
+ paragraphGap: 10,
+ sectionGap: 28,
+ },
+ typography: {
+ body: {
+ fontFamily: "Helvetica",
+ fontSize: 11,
+ lineHeight: 1.6,
+ },
+ heading: {
+ fontFamily: "Times-Roman",
+ fontSize: {
+ h1: 32,
+ h2: 24,
+ h3: 20,
+ h4: 16,
+ h5: 14,
+ h6: 12,
+ },
+ fontWeight: 700,
+ lineHeight: 1.25,
+ },
+ },
+};
diff --git a/registry/themes/theme-types.ts b/registry/themes/theme-types.ts
new file mode 100644
index 0000000..0c366e6
--- /dev/null
+++ b/registry/themes/theme-types.ts
@@ -0,0 +1,265 @@
+/**
+ * pdfcn Theme System — Type Definitions
+ *
+ * Defines the complete type hierarchy for the pdfcn PDF theme system.
+ * All PDF components consume these tokens instead of hardcoding style values.
+ *
+ * Architecture:
+ * - PrimitiveTokens: Raw design scales (typography, spacing, weights, line heights)
+ * - ColorTokens: Semantic color mappings (foreground/background pairs)
+ * - TypographyTokens: Font family, size, weight, and line height decisions
+ * - SpacingTokens: Page margins, section/paragraph/component gaps
+ * - PageTokens: Default page size and orientation
+ * - PdfcnTheme: The complete theme object combining all token layers
+ *
+ * @example
+ * ```ts
+ * import type { PdfcnTheme } from '@/registry/themes';
+ *
+ * const myTheme: PdfcnTheme = {
+ * name: 'custom',
+ * primitives: { ... },
+ * colors: { foreground: '#1a1a1a', ... },
+ * typography: { body: { ... }, heading: { ... } },
+ * spacing: { page: { ... }, sectionGap: 24, ... },
+ * page: { size: 'A4', orientation: 'portrait' },
+ * };
+ * ```
+ */
+
+// ─── Primitive Tokens ───────────────────────────────────────────────────────
+// Raw design scales. These define WHAT values are available.
+// Themes choose from these when populating semantic tokens.
+
+/** Typography scale using a Major Third (1.25) ratio with 12pt base */
+export interface TypographyScale {
+ /** 10pt — Captions, footnotes */
+ xs: number;
+ /** 12pt — Body text (PDF standard) */
+ sm: number;
+ /** 15pt — Large body, small headings */
+ base: number;
+ /** 18pt — H4 equivalent */
+ lg: number;
+ /** 22pt — H3 equivalent */
+ xl: number;
+ /** 28pt — H2 equivalent */
+ "2xl": number;
+ /** 36pt — H1 equivalent */
+ "3xl": number;
+}
+
+/** Spacing scale based on a 4pt grid system */
+export interface SpacingScale {
+ /** 0pt */
+ 0: number;
+ /** 2pt */
+ 0.5: number;
+ /** 4pt */
+ 1: number;
+ /** 8pt */
+ 2: number;
+ /** 12pt */
+ 3: number;
+ /** 16pt */
+ 4: number;
+ /** 20pt */
+ 5: number;
+ /** 24pt */
+ 6: number;
+ /** 32pt */
+ 8: number;
+ /** 40pt */
+ 10: number;
+ /** 48pt */
+ 12: number;
+ /** 64pt */
+ 16: number;
+}
+
+/** Font weight scale */
+export interface FontWeights {
+ regular: number;
+ medium: number;
+ semibold: number;
+ bold: number;
+}
+
+/** Line height scale */
+export interface LineHeights {
+ /** 1.2 — Tight, for headings */
+ tight: number;
+ /** 1.4 — Normal, for body text */
+ normal: number;
+ /** 1.6 — Relaxed, for reading-heavy content */
+ relaxed: number;
+}
+
+/** Border radius scale for rounded corners */
+export interface BorderRadiusScale {
+ /** 0pt — Sharp corners */
+ none: number;
+ /** 2pt — Subtle rounding */
+ sm: number;
+ /** 4pt — Standard rounding */
+ md: number;
+ /** 8pt — Pronounced rounding */
+ lg: number;
+ /** 9999pt — Pill/circle shape */
+ full: number;
+}
+
+/** Letter spacing scale for typography adjustments */
+export interface LetterSpacingScale {
+ /** -0.025em — Tighter spacing */
+ tight: number;
+ /** 0em — Normal spacing */
+ normal: number;
+ /** 0.025em — Slightly wider spacing */
+ wide: number;
+ /** 0.05em — Much wider spacing (for uppercase) */
+ wider: number;
+}
+
+/** Raw design scales shared across themes */
+export interface PrimitiveTokens {
+ typography: TypographyScale;
+ spacing: SpacingScale;
+ fontWeights: FontWeights;
+ lineHeights: LineHeights;
+ borderRadius: BorderRadiusScale;
+ letterSpacing: LetterSpacingScale;
+}
+
+// ─── Semantic Tokens ────────────────────────────────────────────────────────
+// These map primitives to design intent. Themes differ primarily here.
+
+/**
+ * Semantic color tokens using the foreground/background pair convention.
+ * All values must be hex strings (e.g., '#1a1a1a').
+ * react-pdf supports hex, rgb(), and hsl() — but NOT oklch.
+ */
+export interface ColorTokens {
+ /** Primary text and content color */
+ foreground: string;
+ /** Page background color */
+ background: string;
+ /** Subtle background for secondary areas (e.g., code blocks, table headers) */
+ muted: string;
+ /** Text on muted backgrounds (captions, footnotes, timestamps) */
+ mutedForeground: string;
+ /** Brand/accent color for emphasis and highlights */
+ primary: string;
+ /** Text on primary-colored backgrounds */
+ primaryForeground: string;
+ /** Table borders, dividers, rules */
+ border: string;
+ /** Secondary accent for call-to-action elements, badges */
+ accent: string;
+ /** Error text, warning indicators */
+ destructive: string;
+ /** Success states (e.g., badges, confirmations) */
+ success: string;
+ /** Warning states (e.g., badges, alerts) */
+ warning: string;
+ /** Info states (e.g., badges, informational alerts) */
+ info: string;
+}
+
+/** Typography semantic tokens — what fonts and sizes to use where */
+export interface TypographyTokens {
+ /** Body text settings */
+ body: {
+ /** Font family for body text (e.g., 'Helvetica') */
+ fontFamily: string;
+ /** Base font size in points */
+ fontSize: number;
+ /** Line height multiplier */
+ lineHeight: number;
+ };
+ /** Heading text settings */
+ heading: {
+ /** Font family for headings (e.g., 'Times-Roman', 'Courier') */
+ fontFamily: string;
+ /** Font weight as numeric value (400-700) */
+ fontWeight: number;
+ /** Line height multiplier for headings */
+ lineHeight: number;
+ /** Font sizes for each heading level in points */
+ fontSize: {
+ h1: number;
+ h2: number;
+ h3: number;
+ h4: number;
+ h5: number;
+ h6: number;
+ };
+ };
+}
+
+/** Spacing semantic tokens — consistent spacing across the document */
+export interface SpacingTokens {
+ /** Page margin settings in points */
+ page: {
+ marginTop: number;
+ marginRight: number;
+ marginBottom: number;
+ marginLeft: number;
+ };
+ /** Space between major document sections (after h2, before new sections) */
+ sectionGap: number;
+ /** Space between paragraphs and after text blocks */
+ paragraphGap: number;
+ /** Space between inline components, list items, table rows */
+ componentGap: number;
+}
+
+/** Page layout defaults */
+export interface PageTokens {
+ /** Default page size */
+ size: "A4" | "LETTER" | "LEGAL";
+ /** Default page orientation */
+ orientation: "portrait" | "landscape";
+}
+
+// ─── Full Theme ─────────────────────────────────────────────────────────────
+
+/**
+ * The complete pdfcn theme object.
+ *
+ * Components import this and use its tokens for all style values.
+ * Since React Context doesn't work in @react-pdf/renderer,
+ * the theme is a plain TypeScript object imported directly by components.
+ *
+ * @example
+ * ```tsx
+ * // In a component:
+ * import { theme } from '../lib/pdfx-theme';
+ *
+ * function createStyles(t: PdfcnTheme) {
+ * return StyleSheet.create({
+ * text: {
+ * fontFamily: t.typography.body.fontFamily,
+ * fontSize: t.typography.body.fontSize,
+ * color: t.colors.foreground,
+ * },
+ * });
+ * }
+ *
+ * const styles = createStyles(theme);
+ * ```
+ */
+export interface PdfcnTheme {
+ /** Theme name identifier */
+ name: string;
+ /** Raw design scales */
+ primitives: PrimitiveTokens;
+ /** Semantic color mappings */
+ colors: ColorTokens;
+ /** Typography settings for body and headings */
+ typography: TypographyTokens;
+ /** Spacing settings for page, sections, and components */
+ spacing: SpacingTokens;
+ /** Page layout defaults */
+ page: PageTokens;
+}
diff --git a/registry/themes/themes-barrel.ts b/registry/themes/themes-barrel.ts
new file mode 100644
index 0000000..a2da774
--- /dev/null
+++ b/registry/themes/themes-barrel.ts
@@ -0,0 +1,36 @@
+export { defaultPrimitives } from "./primitives";
+export { professionalTheme } from "./professional";
+export { modernTheme } from "./modern";
+export { minimalTheme } from "./minimal";
+export { executiveTheme } from "./executive";
+export { corporateTheme } from "./corporate";
+export { elegantTheme } from "./elegant";
+export { vividTheme } from "./vivid";
+export { forestTheme } from "./forest";
+export { blueprintTheme } from "./blueprint";
+
+import { blueprintTheme } from "./blueprint";
+import { corporateTheme } from "./corporate";
+import { elegantTheme } from "./elegant";
+import { executiveTheme } from "./executive";
+import { forestTheme } from "./forest";
+import { minimalTheme } from "./minimal";
+import { modernTheme } from "./modern";
+import { professionalTheme } from "./professional";
+import { vividTheme } from "./vivid";
+
+/** Map of all built-in theme presets */
+export const themePresets = {
+ blueprint: blueprintTheme,
+ corporate: corporateTheme,
+ elegant: elegantTheme,
+ executive: executiveTheme,
+ forest: forestTheme,
+ minimal: minimalTheme,
+ modern: modernTheme,
+ professional: professionalTheme,
+ vivid: vividTheme,
+} as const;
+
+/** Valid theme preset names */
+export type ThemePresetName = keyof typeof themePresets;
diff --git a/registry/themes/vivid.ts b/registry/themes/vivid.ts
new file mode 100644
index 0000000..06f8f9f
--- /dev/null
+++ b/registry/themes/vivid.ts
@@ -0,0 +1,63 @@
+import { defaultPrimitives } from "./primitives";
+import type { PdfcnTheme } from "./theme-types";
+
+/**
+ * Vivid theme preset.
+ *
+ * Character: Deep violet/purple palette, Nunito rounded sans-serif, playful
+ * but still professional. High-energy creative accent.
+ * Ideal for creative agencies, startups, marketing decks, and pitch docs.
+ */
+export const vividTheme: PdfcnTheme = {
+ colors: {
+ accent: "#8b5cf6",
+ background: "#ffffff",
+ border: "#ddd6fe",
+ destructive: "#dc2626",
+ foreground: "#1e1b4b",
+ info: "#0ea5e9",
+ muted: "#f5f3ff",
+ mutedForeground: "#7c3aed",
+ primary: "#6d28d9",
+ primaryForeground: "#ffffff",
+ success: "#16a34a",
+ warning: "#d97706",
+ },
+ name: "vivid",
+ page: {
+ orientation: "portrait",
+ size: "A4",
+ },
+ primitives: defaultPrimitives,
+ spacing: {
+ componentGap: 14,
+ page: {
+ marginBottom: 48,
+ marginLeft: 44,
+ marginRight: 44,
+ marginTop: 48,
+ },
+ paragraphGap: 10,
+ sectionGap: 26,
+ },
+ typography: {
+ body: {
+ fontFamily: "Nunito",
+ fontSize: 11,
+ lineHeight: 1.6,
+ },
+ heading: {
+ fontFamily: "Nunito",
+ fontSize: {
+ h1: 32,
+ h2: 24,
+ h3: 19,
+ h4: 16,
+ h5: 14,
+ h6: 12,
+ },
+ fontWeight: 700,
+ lineHeight: 1.2,
+ },
+ },
+};
diff --git a/scripts/build-registry.mjs b/scripts/build-registry.mjs
new file mode 100644
index 0000000..dcbb7a0
--- /dev/null
+++ b/scripts/build-registry.mjs
@@ -0,0 +1,53 @@
+import { spawnSync } from "node:child_process";
+import { mkdir, readFile, rm } from "node:fs/promises";
+import { dirname, posix, resolve } from "node:path";
+
+const PROJECT_DIRECTORY = process.cwd();
+const REGISTRY_PATH = resolve(PROJECT_DIRECTORY, "registry.json");
+const OUTPUT_DIRECTORY = resolve(PROJECT_DIRECTORY, "public/r");
+
+const parseRegistry = async () => {
+ const registry = JSON.parse(await readFile(REGISTRY_PATH, "utf-8"));
+ if (!Array.isArray(registry.items)) {
+ throw new TypeError("registry.json must contain an items array.");
+ }
+ return registry;
+};
+
+const prepareOutputDirectory = async (registry) => {
+ await rm(OUTPUT_DIRECTORY, { force: true, recursive: true });
+ await mkdir(OUTPUT_DIRECTORY, { recursive: true });
+
+ for (const item of registry.items) {
+ const itemName = posix.normalize(item.name);
+ if (posix.isAbsolute(itemName) || itemName.startsWith("../")) {
+ throw new Error(`Registry item name "${item.name}" is not safe.`);
+ }
+ await mkdir(dirname(resolve(OUTPUT_DIRECTORY, `${itemName}.json`)), {
+ recursive: true,
+ });
+ }
+};
+
+const runShadcnBuild = () => {
+ const result = spawnSync(
+ "pnpm",
+ ["exec", "shadcn", "build", "registry.json", "--output", "./public/r"],
+ { cwd: PROJECT_DIRECTORY, stdio: "inherit" }
+ );
+ if (result.status !== 0) {
+ process.exit(result.status ?? 1);
+ }
+};
+
+const main = async () => {
+ const registry = await parseRegistry();
+ await prepareOutputDirectory(registry);
+ runShadcnBuild();
+ console.log(`Built ${registry.items.length} registry items → public/r`);
+};
+
+main().catch((error) => {
+ console.error(error);
+ process.exit(1);
+});
diff --git a/scripts/fix-port.mjs b/scripts/fix-port.mjs
new file mode 100644
index 0000000..13336be
--- /dev/null
+++ b/scripts/fix-port.mjs
@@ -0,0 +1,247 @@
+import fs from "node:fs";
+import path from "node:path";
+
+const ROOT = process.cwd();
+
+function walk(dir, out = []) {
+ if (!fs.existsSync(dir)) {
+ return out;
+ }
+ for (const e of fs.readdirSync(dir, { withFileTypes: true })) {
+ const full = path.join(dir, e.name);
+ if (e.isDirectory()) {
+ walk(full, out);
+ } else if (/\.(tsx|ts)$/.test(e.name)) {
+ out.push(full);
+ }
+ }
+ return out;
+}
+
+function fixContent(content, base) {
+ let c = content;
+ c = c.replaceAll(/,\s*=\s*false,/g, ", fixed = false,");
+ c = c.replaceAll(/,\s*=\s*true,/g, ", fixed = true,");
+ c = c.replaceAll(
+ /\s*\/\*\s*handled by Fixed wrapper when needed\s*\*\//g,
+ ""
+ );
+ c = c.replaceAll(
+ '@react-pdf/renderer',
+ base === "forme" ? "@formepdf/react" : "Takumi PDF primitives"
+ );
+ c = c.replaceAll('pdfx-theme', "pdfcn-theme");
+
+ if (base === "takumi") {
+ // style={[{ breakInside: "avoid" as const } style={foo}].filter(Boolean)}
+ c = c.replaceAll(
+ /style=\{\[\{\s*breakInside:\s*"avoid"\s*as\s*const\s*\}\s*style=\{([^}]+)\}\]\.filter\(Boolean\)\}/g,
+ 'style={[{ breakInside: "avoid" as const }, $1].flat().filter(Boolean)}'
+ );
+ }
+ return c;
+}
+
+for (const base of ["takumi", "forme"]) {
+ const baseDir = path.join(ROOT, `registry/bases/${base}`);
+ for (const file of walk(baseDir)) {
+ const before = fs.readFileSync(file, "utf-8");
+ const after = fixContent(before, base);
+ if (after !== before) {
+ fs.writeFileSync(file, after);
+ }
+ }
+}
+
+// Forme SVG shim
+fs.writeFileSync(
+ path.join(ROOT, "registry/bases/forme/lib/forme-svg.tsx"),
+ `import { createElement, type ReactNode, type CSSProperties } from "react";
+import { Svg as FormeSvg } from "@formepdf/react";
+
+type AnyProps = Record<string, unknown> & { children?: ReactNode; style?: CSSProperties };
+
+export function Svg({
+ children,
+ width,
+ height,
+ viewBox,
+ style,
+ ...rest
+}: AnyProps & { width?: number; height?: number; viewBox?: string }) {
+ return (
+ <FormeSvg
+ width={width as number}
+ height={height as number}
+ viewBox={viewBox as string | undefined}
+ style={style as never}
+ {...rest}
+ >
+ {children}
+ </FormeSvg>
+ );
+}
+
+export const Circle = (props: AnyProps) => createElement("circle", props);
+export const Rect = (props: AnyProps) => createElement("rect", props);
+export const G = (props: AnyProps) => createElement("g", props);
+export const Line = (props: AnyProps) => createElement("line", props);
+export const Path = (props: AnyProps) => createElement("path", props);
+export const SvgText = (props: AnyProps) => createElement("text", props);
+`
+);
+
+// Fix takumi graph imports
+const graphTakumi = path.join(
+ ROOT,
+ "registry/bases/takumi/components/graph/graph.tsx"
+);
+const g = fs.readFileSync(graphTakumi, "utf-8");
+const lines = g.split("\n");
+const cleaned = [];
+let sawPrimitives = false;
+let sawSvg = false;
+for (const line of lines) {
+ if (line.includes('from "../../lib/takumi-primitives"')) {
+ if (sawPrimitives) {
+ continue;
+ }
+ sawPrimitives = true;
+ cleaned.push(
+ 'import { View, Text as PDFText } from "../../lib/takumi-primitives";'
+ );
+ cleaned.push('import type { Style } from "../../lib/takumi-primitives";');
+ continue;
+ }
+ if (line.includes('from "../../lib/takumi-svg"')) {
+ if (sawSvg) {
+ continue;
+ }
+ sawSvg = true;
+ cleaned.push(
+ 'import { Circle, G, Line, Path, Rect, Svg, SvgText } from "../../lib/takumi-svg";'
+ );
+ continue;
+ }
+ if (line.includes("import type { Style }") && sawPrimitives) {
+ continue;
+ }
+ if (line.includes("Text as SvgText")) {
+ continue;
+ }
+ cleaned.push(line);
+}
+fs.writeFileSync(graphTakumi, cleaned.join("\n"));
+
+// Fix forme graph
+const graphForme = path.join(
+ ROOT,
+ "registry/bases/forme/components/graph/graph.tsx"
+);
+let gf = fs.readFileSync(graphForme, "utf-8");
+gf = gf.replace(
+ /import \{ Circle, G, Line, Path, Rect, Svg, Text as SvgText \} from "@formepdf\/react";\nimport \{ Text as PDFText, View \} from "@formepdf\/react";/,
+ `import { Text as PDFText, View } from "@formepdf/react";
+import { Circle, G, Line, Path, Rect, Svg, SvgText } from "../../lib/forme-svg";`
+);
+fs.writeFileSync(graphForme, gf);
+
+// Fix forme qrcode
+const qrForme = path.join(
+ ROOT,
+ "registry/bases/forme/components/qrcode/qrcode.tsx"
+);
+let qr = fs.readFileSync(qrForme, "utf-8");
+qr = qr.replace(
+ /import \{([^}]+)\} from "@formepdf\/react";/,
+ (_m, imports) => {
+ const list = imports
+ .split(",")
+ .map((s) => s.trim())
+ .filter(Boolean);
+ const fromForme = [];
+ const fromSvg = [];
+ for (const i of list) {
+ if (["Svg", "Rect", "Circle", "G", "Line", "Path"].includes(i)) {
+ fromSvg.push(i);
+ } else if (i === "Text as SvgText") {
+ fromSvg.push("SvgText");
+ } else {
+ fromForme.push(i);
+ }
+ }
+ const linesOut = [];
+ if (fromForme.length) {
+ linesOut.push(
+ `import { ${fromForme.join(", ")} } from "@formepdf/react";`
+ );
+ }
+ if (fromSvg.length) {
+ linesOut.push(
+ `import { ${[...new Set(fromSvg)].join(", ")} } from "../../lib/forme-svg";`
+ );
+ }
+ return linesOut.join("\n");
+ }
+);
+fs.writeFileSync(qrForme, qr);
+
+// Fix takumi qrcode if needed
+const qrTakumi = path.join(
+ ROOT,
+ "registry/bases/takumi/components/qrcode/qrcode.tsx"
+);
+let qrt = fs.readFileSync(qrTakumi, "utf-8");
+if (qrt.includes("@react-pdf") || qrt.includes("takumi-primitives")) {
+ // ensure Svg/Rect from takumi-svg
+ if (qrt.includes("Svg") && !qrt.includes("takumi-svg")) {
+ qrt = qrt.replace(
+ /import \{([^}]+)\} from "\.\.\/\.\.\/lib\/takumi-primitives";/,
+ (_m, imports) => {
+ const list = imports
+ .split(",")
+ .map((s) => s.trim())
+ .filter(Boolean);
+ const fromPrim = [];
+ const fromSvg = [];
+ for (const i of list) {
+ if (["Svg", "Rect", "Circle", "G", "Line", "Path"].includes(i)) {
+ fromSvg.push(i);
+ } else if (i === "Text as SvgText") {
+ fromSvg.push("SvgText");
+ } else {
+ fromPrim.push(i);
+ }
+ }
+ const linesOut = [];
+ if (fromPrim.length) {
+ linesOut.push(
+ `import { ${fromPrim.join(", ")} } from "../../lib/takumi-primitives";`
+ );
+ }
+ if (fromSvg.length) {
+ linesOut.push(
+ `import { ${[...new Set(fromSvg)].join(", ")} } from "../../lib/takumi-svg";`
+ );
+ }
+ return linesOut.join("\n");
+ }
+ );
+ fs.writeFileSync(qrTakumi, qrt);
+ }
+}
+
+const leftover = [];
+for (const base of ["takumi", "forme"]) {
+ for (const file of walk(path.join(ROOT, `registry/bases/${base}`))) {
+ const c = fs.readFileSync(file, "utf-8");
+ if (
+ /,\s*=\s*(false|true)/.test(c) ||
+ /breakInside: "avoid" as const \} style=/.test(c)
+ ) {
+ leftover.push(path.relative(ROOT, file));
+ }
+ }
+}
+console.log("leftover mangled:", leftover);
+console.log("done");
diff --git a/scripts/generate-registry.mjs b/scripts/generate-registry.mjs
new file mode 100644
index 0000000..3b53457
--- /dev/null
+++ b/scripts/generate-registry.mjs
@@ -0,0 +1,535 @@
+/**
+ * Generates examples + registry.json for all pdfcn components/blocks on both bases.
+ */
+import fs from "node:fs";
+import path from "node:path";
+
+const ROOT = process.cwd();
+const COMPONENTS = [
+ "alert",
+ "badge",
+ "card",
+ "data-table",
+ "divider",
+ "form",
+ "graph",
+ "heading",
+ "keep-together",
+ "key-value",
+ "link",
+ "list",
+ "page-break",
+ "page-footer",
+ "page-header",
+ "page-number",
+ "pdf-image",
+ "qrcode",
+ "section",
+ "signature",
+ "stack",
+ "table",
+ "text",
+ "watermark",
+];
+
+const BLOCKS = [
+ "invoice-classic",
+ "invoice-consultant",
+ "invoice-corporate",
+ "invoice-creative",
+ "invoice-minimal",
+ "invoice-modern",
+ "report-financial",
+ "report-marketing",
+ "report-operations",
+ "report-security",
+];
+
+const COMPONENT_EXPORTS = {
+ alert: "PdfAlert",
+ badge: "Badge",
+ card: "PdfCard",
+ "data-table": "DataTable",
+ divider: "Divider",
+ form: "PdfForm",
+ graph: "PdfGraph",
+ heading: "Heading",
+ "keep-together": "KeepTogether",
+ "key-value": "KeyValue",
+ link: "Link",
+ list: "PdfList",
+ "page-break": "PageBreak",
+ "page-footer": "PageFooter",
+ "page-header": "PageHeader",
+ "page-number": "PdfPageNumber",
+ "pdf-image": "PdfImage",
+ qrcode: "PdfQRCode",
+ section: "Section",
+ signature: "PdfSignatureBlock",
+ stack: "Stack",
+ table: "Table",
+ text: "Text",
+ watermark: "PdfWatermark",
+};
+
+function titleCase(slug) {
+ return slug
+ .split("-")
+ .map((p) => p.charAt(0).toUpperCase() + p.slice(1))
+ .join(" ");
+}
+
+function demoForComponent(base, name) {
+ const exportName =
+ COMPONENT_EXPORTS[name] ?? titleCase(name).replaceAll(' ', "");
+ const isForme = base === "forme";
+
+ const wrappers = isForme
+ ? `import { Document, Page } from "@formepdf/react";
+import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";
+import { ${exportName} } from "@/registry/bases/forme/components/${name}";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4" margin={48}>
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+`
+ : `import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";
+import { ${exportName} } from "@/registry/bases/takumi/components/${name}";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4">
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+`;
+
+ const bodies = {
+ alert: `function DemoBody() {
+ return <PdfAlert variant="info" title="Info">Alert body</PdfAlert>;
+}`,
+ badge: `function DemoBody() {
+ return <Badge>Badge</Badge>;
+}`,
+ card: `function DemoBody() {
+ return <PdfCard title="Card">Card body</PdfCard>;
+}`,
+ "data-table": `function DemoBody() {
+ return (
+ <DataTable
+ columns={[
+ { key: "name", header: "Name" },
+ { key: "price", header: "Price" },
+ ]}
+ data={[
+ { name: "Widget", price: "$10" },
+ { name: "Gadget", price: "$20" },
+ ]}
+ />
+ );
+}`,
+ divider: `function DemoBody() {
+ return <Divider />;
+}`,
+ form: `function DemoBody() {
+ return (
+ <PdfForm
+ title="Contact"
+ groups={[{ fields: [{ label: "Email" }, { label: "Phone" }] }]}
+ />
+ );
+}`,
+ graph: `function DemoBody() {
+ return (
+ <PdfGraph
+ variant="bar"
+ data={[
+ { label: "Q1", value: 30 },
+ { label: "Q2", value: 45 },
+ { label: "Q3", value: 28 },
+ ]}
+ />
+ );
+}`,
+ heading: `function DemoBody() {
+ return <Heading level={1}>Heading</Heading>;
+}`,
+ "keep-together": `function DemoBody() {
+ return (
+ <KeepTogether>
+ <Text>Keep these lines together on one page.</Text>
+ </KeepTogether>
+ );
+}`,
+ "key-value": `function DemoBody() {
+ return <KeyValue items={[{ key: "Name", value: "Ada" }]} />;
+}`,
+ link: `function DemoBody() {
+ return <Link href="https://example.com">Example</Link>;
+}`,
+ list: `function DemoBody() {
+ return <PdfList items={[{ text: "Alpha" }, { text: "Beta" }, { text: "Gamma" }]} />;
+}`,
+ "page-break": `function DemoBody() {
+ return (
+ <>
+ <Text>Before</Text>
+ <PageBreak />
+ <Text>After</Text>
+ </>
+ );
+}`,
+ "page-footer": `function DemoBody() {
+ return <PageFooter leftText="pdfcn" rightText="Confidential" />;
+}`,
+ "page-header": `function DemoBody() {
+ return <PageHeader title="Company" subtitle="Invoice" />;
+}`,
+ "page-number": `function DemoBody() {
+ return <PdfPageNumber />;
+}`,
+ "pdf-image": `function DemoBody() {
+ return <Text>PdfImage demo — pass src in your document.</Text>;
+}`,
+ qrcode: `function DemoBody() {
+ return <PdfQRCode value="https://pdfcn.dev" />;
+}`,
+ section: `function DemoBody() {
+ return <Section><Text>Section body</Text></Section>;
+}`,
+ signature: `function DemoBody() {
+ return <PdfSignatureBlock name="Jane Doe" label="Authorized Signature" />;
+}`,
+ stack: `function DemoBody() {
+ return (
+ <Stack gap="md">
+ <Text>One</Text>
+ <Text>Two</Text>
+ </Stack>
+ );
+}`,
+ table: `function DemoBody() {
+ return <Text>See table demo composition in docs.</Text>;
+}`,
+ text: `function DemoBody() {
+ return <Text>Hello from pdfcn ${base}</Text>;
+}`,
+ watermark: `function DemoBody() {
+ return (
+ <>
+ <PdfWatermark text="DRAFT" />
+ <Text>Document content</Text>
+ </>
+ );
+}`,
+ };
+
+ const body =
+ bodies[name] ?? `function DemoBody() {\n return <${exportName} />;\n}`;
+
+ // table demo has its own imports - prepend carefully
+ if (name === "table") {
+ return `${
+ isForme
+ ? `import { Document, Page } from "@formepdf/react";
+import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";
+import { Table } from "@/registry/bases/forme/components/table";
+`
+ : `import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";
+import { Table } from "@/registry/bases/takumi/components/table";
+`
+ }import { TableBody, TableCell, TableHeader, TableRow, Text } from "@/registry/bases/${base}/components";
+
+export default function Demo() {
+ return (
+ <Document>
+ <Page size="A4"${isForme ? " margin={48}" : ""}>
+ <PdfcnThemeProvider>
+ <DemoBody />
+ </PdfcnThemeProvider>
+ </Page>
+ </Document>
+ );
+}
+
+function DemoBody() {
+ return (
+ <Table>
+ <TableHeader>
+ <TableRow>
+ <TableCell><Text>Item</Text></TableCell>
+ <TableCell><Text>Qty</Text></TableCell>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ <TableRow>
+ <TableCell><Text>Widget</Text></TableCell>
+ <TableCell><Text>2</Text></TableCell>
+ </TableRow>
+ </TableBody>
+ </Table>
+ );
+}
+`;
+ }
+
+ // For stack/section demos need Text import
+ const needsText = [
+ "stack",
+ "page-break",
+ "keep-together",
+ "watermark",
+ ].includes(name);
+ const textImport = needsText
+ ? `import { Text } from "@/registry/bases/${base}/components/text";\n`
+ : "";
+
+ return `${wrappers.replace(
+ `import { ${exportName} } from "@/registry/bases/${base}/components/${name}";`,
+ `import { ${exportName} } from "@/registry/bases/${base}/components/${name}";\n${textImport}`
+ )}\n${body}\n`;
+}
+
+function demoForBlock(base, name) {
+ const exportMap = {
+ "invoice-classic": "InvoiceClassicDocument",
+ "invoice-consultant": "InvoiceConsultantDocument",
+ "invoice-corporate": "InvoiceCorporateDocument",
+ "invoice-creative": "InvoiceCreativeDocument",
+ "invoice-minimal": "InvoiceMinimalDocument",
+ "invoice-modern": "InvoiceModernDocument",
+ "report-financial": "ReportFinancialDocument",
+ "report-marketing": "ReportMarketingDocument",
+ "report-operations": "ReportOperationsDocument",
+ "report-security": "ReportSecurityDocument",
+ };
+ const exp = exportMap[name];
+ // Check actual export from file
+ const file = path.join(
+ ROOT,
+ `registry/bases/${base}/blocks/${name}/${name}.tsx`
+ );
+ const src = fs.readFileSync(file, "utf-8");
+ const match = src.match(/export function (\w+)/);
+ const fn = match?.[1] ?? exp;
+
+ return `import { ${fn} } from "@/registry/bases/${base}/blocks/${name}/${name}";
+
+export default function Demo() {
+ return <${fn} />;
+}
+`;
+}
+
+function collectFiles(base, kind, name) {
+ const dir = path.join(
+ ROOT,
+ `registry/bases/${base}/${kind === "block" ? "blocks" : "components"}/${name}`
+ );
+ if (!fs.existsSync(dir)) {
+ return [];
+ }
+ return fs
+ .readdirSync(dir)
+ .filter((f) => f.endsWith(".ts") || f.endsWith(".tsx"))
+ .filter((f) => !f.endsWith(".test.tsx") && f !== "index.ts")
+ .map((f) => ({
+ path: `registry/bases/${base}/${kind === "block" ? "blocks" : "components"}/${name}/${f}`,
+ type: kind === "block" ? "registry:block" : "registry:component",
+ }));
+}
+
+function libFiles(base) {
+ const files = [
+ "pdfcn-theme.ts",
+ "pdfcn-theme-context.tsx",
+ "resolve-color.ts",
+ ];
+ if (base === "takumi") {
+ files.push("takumi-primitives.tsx", "takumi-svg.tsx");
+ } else {
+ files.push("forme-svg.tsx", "maybe-fixed.tsx");
+ }
+ return files
+ .filter((f) =>
+ fs.existsSync(path.join(ROOT, `registry/bases/${base}/lib/${f}`))
+ )
+ .map((f) => ({
+ path: `registry/bases/${base}/lib/${f}`,
+ type: "registry:lib",
+ }));
+}
+
+function main() {
+ const items = [];
+ const demoImports = { forme: [], takumi: [] };
+
+ for (const base of ["takumi", "forme"]) {
+ const deps =
+ base === "takumi"
+ ? ["takumi-pdf", "@takumi-rs/helpers"]
+ : ["@formepdf/react", "@formepdf/core"];
+
+ // lib item
+ items.push({
+ dependencies: deps,
+ description: `Theme context and helpers for the ${base} base`,
+ files: libFiles(base),
+ name: `${base}/utils`,
+ title: `${titleCase(base)} Utils`,
+ type: "registry:lib",
+ });
+
+ for (const name of COMPONENTS) {
+ const files = collectFiles(base, "component", name);
+ // always include index if present
+ const indexPath = `registry/bases/${base}/components/${name}/index.ts`;
+ if (fs.existsSync(path.join(ROOT, indexPath))) {
+ files.push({ path: indexPath, type: "registry:component" });
+ }
+
+ const registryDeps = [`${base}/utils`];
+ if (name === "data-table") {
+ registryDeps.push(`${base}/table`);
+ }
+
+ items.push({
+ dependencies: [...deps, ...(name === "qrcode" ? ["qrcode"] : [])],
+ description: `${titleCase(name)} PDF component (${base})`,
+ files,
+ name: `${base}/${name}`,
+ registryDependencies: registryDeps,
+ title: titleCase(name),
+ type: "registry:ui",
+ });
+
+ const demoPath = path.join(ROOT, `examples/${base}/${name}.tsx`);
+ fs.mkdirSync(path.dirname(demoPath), { recursive: true });
+ fs.writeFileSync(demoPath, demoForComponent(base, name));
+ demoImports[base].push(name);
+ }
+
+ for (const name of BLOCKS) {
+ const files = collectFiles(base, "block", name);
+ items.push({
+ dependencies: deps,
+ description: `${titleCase(name)} PDF block (${base})`,
+ files,
+ name: `${base}/${name}`,
+ registryDependencies: [`${base}/utils`],
+ title: titleCase(name),
+ type: "registry:block",
+ });
+
+ const demoPath = path.join(ROOT, `examples/${base}/${name}.tsx`);
+ fs.writeFileSync(demoPath, demoForBlock(base, name));
+ demoImports[base].push(name);
+ }
+
+ // themes
+ for (const theme of [
+ "professional",
+ "modern",
+ "minimal",
+ "executive",
+ "corporate",
+ "elegant",
+ "vivid",
+ "forest",
+ "blueprint",
+ ]) {
+ items.push({
+ dependencies: deps,
+ description: `${theme} theme tokens for ${base}`,
+ files: [
+ {
+ path: `registry/themes/${theme}.ts`,
+ target: `components/pdf/theme-${theme}.ts`,
+ type: "registry:theme",
+ },
+ {
+ path: `registry/themes/primitives.ts`,
+ target: `components/pdf/primitives.ts`,
+ type: "registry:theme",
+ },
+ {
+ path: `registry/themes/theme-types.ts`,
+ target: `components/pdf/theme-types.ts`,
+ type: "registry:theme",
+ },
+ {
+ path: `registry/bases/${base}/lib/pdfcn-theme.ts`,
+ target: `components/pdf/pdfcn-theme.ts`,
+ type: "registry:lib",
+ },
+ ],
+ name: `${base}/theme-${theme}`,
+ title: `${titleCase(theme)} Theme (${base})`,
+ type: "registry:theme",
+ });
+ }
+ }
+
+ const registry = {
+ $schema: "https://ui.shadcn.com/schema/registry.json",
+ homepage: "https://pdfcn.vercel.app",
+ items,
+ name: "pdfcn",
+ };
+
+ for (const item of items) {
+ for (const file of item.files ?? []) {
+ if (!file.target) {
+ file.target = file.path
+ .replace(/^registry\/bases\/(takumi|forme)\//, "components/pdf/")
+ .replace(/^registry\/themes\//, "components/pdf/theme/");
+ }
+ }
+ }
+
+ fs.writeFileSync(
+ path.join(ROOT, "registry.json"),
+ `${JSON.stringify(registry, null, 2)}\n`
+ );
+
+ // examples index
+ let indexSrc = `import type { ComponentType } from "react";\nimport type { BaseName } from "@/registry/bases";\n\n`;
+ for (const base of ["takumi", "forme"]) {
+ for (const name of demoImports[base]) {
+ const ident = `${base}_${name.replaceAll('-', "_")}`;
+ indexSrc += `import ${ident} from "@/examples/${base}/${name}";\n`;
+ }
+ }
+ indexSrc += `\ntype DemoMap = Record<string, ComponentType>;\n\nexport const demos: Record<BaseName, DemoMap> = {\n`;
+ for (const base of ["takumi", "forme"]) {
+ indexSrc += ` ${base}: {\n`;
+ for (const name of demoImports[base]) {
+ const ident = `${base}_${name.replaceAll('-', "_")}`;
+ indexSrc += ` "${name}": ${ident},\n`;
+ }
+ indexSrc += ` },\n`;
+ }
+ indexSrc += `};\n\nexport type DemoName = string;\n`;
+ fs.writeFileSync(path.join(ROOT, "examples/__index__.ts"), indexSrc);
+
+ console.log("items:", items.length);
+ console.log("demos takumi:", demoImports.takumi.length);
+ console.log("demos forme:", demoImports.forme.length);
+}
+
+main();
diff --git a/scripts/port-pdfx.mts b/scripts/port-pdfx.mts
new file mode 100644
index 0000000..fd5bb10
--- /dev/null
+++ b/scripts/port-pdfx.mts
@@ -0,0 +1,764 @@
+/**
+ * Ports pdfx registry sources into pdfcn takumi + forme bases.
+ * Run: pnpm exec tsx scripts/port-pdfx.mts
+ */
+import fs from "node:fs";
+import path from "node:path";
+
+const ROOT = path.resolve(import.meta.dirname, "..");
+const SRC = path.join(ROOT, ".pdfx-ref/apps/www/src/registry");
+const SHARED = path.join(ROOT, ".pdfx-ref/packages/shared/src");
+
+function ensureDir(dir: string) {
+ fs.mkdirSync(dir, { recursive: true });
+}
+
+function write(file: string, content: string) {
+ ensureDir(path.dirname(file));
+ fs.writeFileSync(file, content, "utf-8");
+}
+
+function read(file: string) {
+ return fs.readFileSync(file, "utf-8");
+}
+
+function walk(dir: string, out: string[] = []): string[] {
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
+ const full = path.join(dir, entry.name);
+ if (entry.isDirectory()) {
+ walk(full, out);
+ } else if (!entry.name.includes(".test.")) {
+ out.push(full);
+ }
+ }
+ return out;
+}
+
+function renameShared(content: string) {
+ return content
+ .replaceAll("PdfxTheme", "PdfcnTheme")
+ .replaceAll("PDFx", "pdfcn")
+ .replaceAll("@pdfx/shared", "@/registry/themes")
+ .replaceAll("../theme.js", "./theme-types")
+ .replaceAll("./theme.js", "./theme-types")
+ .replaceAll("./themes/index.js", "./index")
+ .replaceAll("./primitives.js", "./primitives")
+ .replaceAll("./professional.js", "./professional")
+ .replaceAll("./modern.js", "./modern")
+ .replaceAll("./minimal.js", "./minimal")
+ .replaceAll("./executive.js", "./executive")
+ .replaceAll("./corporate.js", "./corporate")
+ .replaceAll("./elegant.js", "./elegant")
+ .replaceAll("./vivid.js", "./vivid")
+ .replaceAll("./forest.js", "./forest")
+ .replaceAll("./blueprint.js", "./blueprint")
+ .replaceAll("from './types.js'", "from './component-types'")
+ .replaceAll('from "./types.js"', 'from "./component-types"');
+}
+
+function transformCommon(content: string) {
+ return content
+ .replaceAll("@pdfx/shared", "@/registry/themes")
+ .replaceAll("PdfxTheme", "PdfcnTheme")
+ .replaceAll("usePdfxTheme", "usePdfcnTheme")
+ .replaceAll("PdfxThemeProvider", "PdfcnThemeProvider")
+ .replaceAll("PdfxThemeContext", "PdfcnThemeContext")
+ .replaceAll("pdfx-theme-context", "pdfcn-theme-context")
+ .replaceAll("pdfx-theme", "pdfcn-theme")
+ .replaceAll("@pdfx/components", "@/registry/bases/PLACEHOLDER/components")
+ .replaceAll(
+ /from ['"]\.\.\/\.\.\/lib\/resolve-color\.js['"]/g,
+ 'from "../../lib/resolve-color"'
+ )
+ .replaceAll(/from ['"]\.\/pdfx-theme['"]/g, 'from "./pdfcn-theme"')
+ .replaceAll(
+ /from ['"]\.\/pdfx-theme-context['"]/g,
+ 'from "./pdfcn-theme-context"'
+ );
+}
+
+function transformForme(content: string) {
+ let out = transformCommon(content);
+ out = out.replaceAll(
+ "@/registry/bases/PLACEHOLDER/components",
+ "@/registry/bases/forme/components"
+ );
+
+ // Imports from @react-pdf/renderer → @formepdf/react
+ out = out.replaceAll(
+ /import\s+\{([^}]+)\}\s+from\s+['"]@react-pdf\/renderer['"];?/g,
+ (_m, imports: string) => {
+ let list = imports
+ .split(",")
+ .map((s) => s.trim())
+ .filter(Boolean);
+
+ // Map react-pdf SVG primitives — Forme Svg accepts JSX children for basic shapes
+ // Keep Svg; drop Circle/G/Line/Path/Rect/Text-as-SvgText and import from react for HTML-in-Svg if needed
+ // Forme supports Svg with children path/rect/circle — keep as-is where possible
+ const rename: Record<string, string> = {
+ "Text as PDFText": "Text as PDFText",
+ "Text as SvgText": "Text as SvgText",
+ };
+ list = list.map((item) => rename[item] ?? item);
+
+ // Document/Page stay; StyleSheet stays; View/Text/Image/Link stay
+ // `break` prop on View → use PageBreak component (handled in source transforms below)
+ return `import { ${list.join(", ")} } from "@formepdf/react";`;
+ }
+ );
+
+ out = out.replaceAll(
+ /import\s+type\s+\{([^}]+)\}\s+from\s+['"]@react-pdf\/types['"];?/g,
+ 'import type { Style } from "@formepdf/react";'
+ );
+
+ // PageBreak: <View break .../> → <PageBreak />
+ if (out.includes("break") && out.includes("PageBreak")) {
+ out = out.replace(
+ /import\s+\{\s*View\s*\}\s+from\s+["']@formepdf\/react["'];/,
+ 'import { PageBreak as FormePageBreak } from "@formepdf/react";'
+ );
+ out = out.replace(
+ /return\s+<\s*View\s+break\s+style=\{style\}\s*\/>;/,
+ "return <FormePageBreak />;"
+ );
+ }
+
+ // Text render callback → Forme page number placeholders
+ out = out.replaceAll(
+ /<PDFText\s+style=\{textStyles\}\s+render=\{\(\{\s*pageNumber,\s*totalPages\s*\}\)\s*=>\s*formatPageNumber\(format,\s*pageNumber,\s*totalPages\)\}\s*\/>/g,
+ `<PDFText style={textStyles}>{format.replace("{page}", "{{pageNumber}}").replace("{total}", "{{totalPages}}")}</PDFText>`
+ );
+
+ // fixed={fixed} on View → wrap with Fixed when fixed
+ // Keep fixed prop; Forme View doesn't support it — wrap in Fixed for headers/footers in component files manually if needed
+ // For now strip unknown props that Forme rejects at typecheck: minPresenceAhead, break
+ out = out.replaceAll(/\s+minPresenceAhead=\{[^}]+\}/g, "");
+ out = out.replaceAll(/\s+minPresenceAhead=\{minPresenceAhead\}/g, "");
+
+ // View fixed={fixed} — Forme uses <Fixed position="header|footer">
+ // Keep as data attribute style passthrough: convert fixed={true} containers later in specific files
+ out = out.replaceAll(
+ /\s+fixed=\{fixed\}/g,
+ " /* fixed handled by Fixed wrapper when needed */ "
+ );
+ out = out.replaceAll(/\s+fixed=\{true\}/g, "");
+ out = out.replaceAll(/\s+fixed\b(?!=)/g, "");
+
+ // Clean broken comments from fixed replacement
+ out = out.replaceAll(
+ /\s*\/\*\s*fixed handled by Fixed wrapper when needed\s*\*\//g,
+ ""
+ );
+
+ return out;
+}
+
+function transformTakumi(content: string) {
+ let out = transformCommon(content);
+ out = out.replaceAll(
+ "@/registry/bases/PLACEHOLDER/components",
+ "@/registry/bases/takumi/components"
+ );
+
+ // Replace react-pdf imports with local primitives + react
+ out = out.replaceAll(
+ /import\s+\{([^}]+)\}\s+from\s+['"]@react-pdf\/renderer['"];?/g,
+ (_m, imports: string) => {
+ const list = imports
+ .split(",")
+ .map((s) => s.trim())
+ .filter(Boolean);
+ const needs = {
+ document: list.includes("Document"),
+ image: list.includes("Image"),
+ link: list.includes("Link"),
+ page: list.includes("Page"),
+ stylesheet: list.includes("StyleSheet"),
+ svg: list.some((i) =>
+ [
+ "Svg",
+ "Rect",
+ "Circle",
+ "G",
+ "Line",
+ "Path",
+ "Text as SvgText",
+ ].includes(i)
+ ),
+ text: list.some((i) => i === "Text" || i.startsWith("Text as")),
+ view: list.some((i) => i === "View"),
+ };
+
+ const lines: string[] = [];
+ const fromPrim: string[] = [];
+ if (needs.view) {
+ fromPrim.push("View");
+ }
+ if (needs.text) {
+ for (const i of list) {
+ if (i === "Text" || i.startsWith("Text as")) {
+ fromPrim.push(i === "Text" ? "Text" : i);
+ }
+ }
+ }
+ if (needs.stylesheet) {
+ fromPrim.push("StyleSheet");
+ }
+ if (needs.image) {
+ fromPrim.push("Image");
+ }
+ if (needs.link) {
+ fromPrim.push("Link");
+ }
+ if (needs.document) {
+ fromPrim.push("Document");
+ }
+ if (needs.page) {
+ fromPrim.push("Page");
+ }
+ if (fromPrim.length) {
+ lines.push(
+ `import { ${[...new Set(fromPrim)].join(", ")} } from "../../lib/takumi-primitives";`
+ );
+ }
+ if (needs.svg) {
+ // Use react for SVG elements in Takumi
+ const svgImports = list.filter((i) =>
+ ["Svg", "Rect", "Circle", "G", "Line", "Path"].includes(i)
+ );
+ // Text as SvgText → text as SVG text element - import as SvgText from primitives
+ if (list.includes("Text as SvgText")) {
+ lines.push(
+ `import { ${[...svgImports, "SvgText"].join(", ")} } from "../../lib/takumi-svg";`
+ );
+ } else if (svgImports.length) {
+ lines.push(
+ `import { ${svgImports.join(", ")} } from "../../lib/takumi-svg";`
+ );
+ }
+ }
+ return lines.join("\n");
+ }
+ );
+
+ out = out.replaceAll(
+ /import\s+type\s+\{([^}]+)\}\s+from\s+['"]@react-pdf\/types['"];?/g,
+ 'import type { Style } from "../../lib/takumi-primitives";'
+ );
+
+ // Page break
+ out = out.replace(
+ /return\s+<\s*View\s+break\s+style=\{style\}\s*\/>;/,
+ 'return <View style={[{ breakBefore: "page" as const }, style].filter(Boolean)} />;'
+ );
+
+ // Page number render callback → Takumi pageNumber/totalPages spans
+ out = out.replaceAll(
+ /<PDFText\s+style=\{textStyles\}\s+render=\{\(\{\s*pageNumber,\s*totalPages\s*\}\)\s*=>\s*formatPageNumber\(format,\s*pageNumber,\s*totalPages\)\}\s*\/>/g,
+ `<PDFText style={textStyles}>
+ {format.split(/({page}|{total})/).map((part, i) => {
+ if (part === "{page}") return <span key={i} className="pageNumber" />;
+ if (part === "{total}") return <span key={i} className="totalPages" />;
+ return <span key={i}>{part}</span>;
+ })}
+ </PDFText>`
+ );
+
+ // keep-together / wrap={false} → breakInside avoid
+ out = out.replaceAll(
+ /<View\s+wrap=\{false\}\s+minPresenceAhead=\{minPresenceAhead\}\s+style=\{style\}>/g,
+ '<View style={[{ breakInside: "avoid" as const }, style].filter(Boolean)}>'
+ );
+ out = out.replaceAll(
+ /<View\s+wrap=\{false\}(\s+style=\{[^}]+\})?>/g,
+ '<View style={[{ breakInside: "avoid" as const }$1].filter(Boolean)}>'
+ );
+ out = out.replaceAll("wrap={noWrap ? false : undefined}", "");
+ out = out.replaceAll("wrap={false}", "");
+ out = out.replaceAll(/\s+minPresenceAhead=\{[^}]+\}/g, "");
+ out = out.replaceAll(/\s+fixed=\{fixed\}/g, "");
+ out = out.replaceAll(/\s+fixed=\{true\}/g, "");
+ out = out.replaceAll(/\s+fixed\b(?!=)/g, "");
+
+ return out;
+}
+
+function portLib(base: "takumi" | "forme") {
+ const libDir = path.join(ROOT, `registry/bases/${base}/lib`);
+ ensureDir(libDir);
+
+ // theme default
+ write(
+ path.join(libDir, "pdfcn-theme.ts"),
+ `import { professionalTheme } from "@/registry/themes";\n\nexport const theme = professionalTheme;\n`
+ );
+
+ // context
+ let ctx = read(path.join(SRC, "lib/pdfx-theme-context.tsx"));
+ ctx = transformCommon(ctx).replaceAll("pdfx-theme", "pdfcn-theme");
+ write(path.join(libDir, "pdfcn-theme-context.tsx"), ctx);
+
+ // resolve-color
+ let resolve = read(path.join(SRC, "lib/resolve-color.ts"));
+ resolve = transformCommon(resolve);
+ write(path.join(libDir, "resolve-color.ts"), resolve);
+
+ if (base === "takumi") {
+ write(
+ path.join(libDir, "takumi-primitives.tsx"),
+ `import type { CSSProperties, ReactNode, ImgHTMLAttributes, AnchorHTMLAttributes } from "react";
+
+export type Style = CSSProperties;
+
+export const StyleSheet = {
+ create<T extends Record<string, Style>>(styles: T): T {
+ return styles;
+ },
+};
+
+type ViewProps = {
+ children?: ReactNode;
+ style?: Style | Style[] | false | null | undefined;
+ className?: string;
+ wrap?: boolean;
+ fixed?: boolean;
+ break?: boolean;
+ minPresenceAhead?: number;
+};
+
+function flatten(style?: ViewProps["style"]): CSSProperties | undefined {
+ if (!style) return undefined;
+ if (Array.isArray(style)) {
+ return Object.assign({}, ...style.filter(Boolean));
+ }
+ return style;
+}
+
+export function View({ children, style, className, ...rest }: ViewProps) {
+ const { wrap: _w, fixed: _f, break: br, minPresenceAhead: _m, ...dom } = rest as ViewProps & Record<string, unknown>;
+ const merged = flatten(style) ?? {};
+ if (br) Object.assign(merged, { breakBefore: "page" });
+ return (
+ <div className={className} style={merged} {...(dom as object)}>
+ {children}
+ </div>
+ );
+}
+
+type TextProps = {
+ children?: ReactNode;
+ style?: Style | Style[] | false | null | undefined;
+ className?: string;
+ render?: (info: { pageNumber: number; totalPages: number }) => ReactNode;
+ fixed?: boolean;
+ href?: string;
+};
+
+export function Text({ children, style, className, render: _render, href, ...rest }: TextProps) {
+ const merged = flatten(style);
+ if (href) {
+ return (
+ <a href={href} className={className} style={merged} {...(rest as object)}>
+ {children}
+ </a>
+ );
+ }
+ return (
+ <span className={className} style={merged} {...(rest as object)}>
+ {children}
+ </span>
+ );
+}
+
+export function Image({
+ src,
+ style,
+ ...rest
+}: { src: string; style?: Style | Style[] } & ImgHTMLAttributes<HTMLImageElement>) {
+ return <img src={src} style={flatten(style)} alt="" {...rest} />;
+}
+
+export function Link({
+ src,
+ children,
+ style,
+ ...rest
+}: {
+ src: string;
+ children?: ReactNode;
+ style?: Style | Style[];
+} & AnchorHTMLAttributes<HTMLAnchorElement>) {
+ return (
+ <a href={src} style={flatten(style)} {...rest}>
+ {children}
+ </a>
+ );
+}
+
+export function Document({
+ children,
+ title,
+ style,
+}: {
+ children?: ReactNode;
+ title?: string;
+ style?: Style | Style[];
+}) {
+ return (
+ <div data-pdf-document={title} style={flatten(style)}>
+ {children}
+ </div>
+ );
+}
+
+export function Page({
+ children,
+ size: _size,
+ style,
+}: {
+ children?: ReactNode;
+ size?: string | { width: number; height: number };
+ style?: Style | Style[];
+}) {
+ return (
+ <div data-pdf-page style={flatten(style)}>
+ {children}
+ </div>
+ );
+}
+`
+ );
+
+ write(
+ path.join(libDir, "takumi-svg.tsx"),
+ `import type { CSSProperties, ReactNode, SVGProps } from "react";
+
+export function Svg({
+ children,
+ style,
+ ...rest
+}: SVGProps<SVGSVGElement> & { style?: CSSProperties }) {
+ return (
+ <svg style={style} {...rest}>
+ {children}
+ </svg>
+ );
+}
+
+export function Rect(props: SVGProps<SVGRectElement>) {
+ return <rect {...props} />;
+}
+export function Circle(props: SVGProps<SVGCircleElement>) {
+ return <circle {...props} />;
+}
+export function G(props: SVGProps<SVGGElement>) {
+ return <g {...props} />;
+}
+export function Line(props: SVGProps<SVGLineElement>) {
+ return <line {...props} />;
+}
+export function Path(props: SVGProps<SVGPathElement>) {
+ return <path {...props} />;
+}
+export function SvgText({
+ children,
+ style,
+ ...rest
+}: SVGProps<SVGTextElement> & { children?: ReactNode; style?: CSSProperties }) {
+ return (
+ <text style={style} {...rest}>
+ {children}
+ </text>
+ );
+}
+`
+ );
+ }
+}
+
+function portFile(rel: string, base: "takumi" | "forme") {
+ const srcFile = path.join(SRC, rel);
+ if (!fs.existsSync(srcFile)) {
+ return;
+ }
+ const raw = read(srcFile);
+ const transformed =
+ base === "forme" ? transformForme(raw) : transformTakumi(raw);
+ const destRel = rel
+ .replaceAll("pdfx-theme", "pdfcn-theme")
+ .replaceAll("pdfx-theme-context", "pdfcn-theme-context");
+ write(path.join(ROOT, `registry/bases/${base}`, destRel), transformed);
+}
+
+function main() {
+ // Shared themes
+ const themesDir = path.join(ROOT, "registry/themes");
+ ensureDir(themesDir);
+
+ // theme-types
+ write(
+ path.join(themesDir, "theme-types.ts"),
+ renameShared(read(path.join(SHARED, "theme.ts"))).replaceAll(
+ "PdfxTheme",
+ "PdfcnTheme"
+ )
+ );
+
+ // component-types — Style from a local alias
+ write(
+ path.join(themesDir, "component-types.ts"),
+ `import type { ReactNode } from "react";
+
+/** CSS-like style object compatible with both Takumi and Forme */
+export type Style = Record<string, string | number | undefined | Style | Style[]>;
+
+/**
+ * Base props shared by all pdfcn PDF components.
+ */
+export interface PDFComponentProps {
+ style?: Style;
+ children: ReactNode;
+}
+`
+ );
+
+ // Copy theme presets
+ for (const file of fs.readdirSync(path.join(SHARED, "themes"))) {
+ if (!file.endsWith(".ts")) {
+ continue;
+ }
+ let content = read(path.join(SHARED, "themes", file));
+ content = renameShared(content).replaceAll("PdfxTheme", "PdfcnTheme");
+ content = content.replaceAll("from '../theme.js'", 'from "../theme-types"');
+ content = content.replaceAll(
+ "from './primitives.js'",
+ 'from "./primitives"'
+ );
+ content = content.replaceAll(/from '\.\/(\w+)\.js'/g, 'from "./$1"');
+ write(path.join(themesDir, file), content);
+ }
+
+ // themes barrel + re-exports
+ write(
+ path.join(themesDir, "index.ts"),
+ `export type { PDFComponentProps, Style } from "./component-types";
+export type {
+ PdfcnTheme,
+ PrimitiveTokens,
+ ColorTokens,
+ TypographyTokens,
+ SpacingTokens,
+ PageTokens,
+ TypographyScale,
+ SpacingScale,
+ FontWeights,
+ LineHeights,
+ BorderRadiusScale,
+ LetterSpacingScale,
+} from "./theme-types";
+
+export {
+ defaultPrimitives,
+ professionalTheme,
+ modernTheme,
+ minimalTheme,
+ executiveTheme,
+ corporateTheme,
+ elegantTheme,
+ vividTheme,
+ forestTheme,
+ blueprintTheme,
+ themePresets,
+ type ThemePresetName,
+} from "./themes-barrel";
+`
+ );
+
+ // Fix themes index from pdfx → themes-barrel
+ let themesIndex = read(path.join(SHARED, "themes/index.ts"));
+ themesIndex = renameShared(themesIndex);
+ themesIndex = themesIndex.replaceAll(/from '\.\/(\w+)\.js'/g, 'from "./$1"');
+ write(path.join(themesDir, "themes-barrel.ts"), themesIndex);
+
+ // Fix theme-types PdfcnTheme name
+ let themeTypes = read(path.join(themesDir, "theme-types.ts"));
+ themeTypes = themeTypes.replaceAll("PdfxTheme", "PdfcnTheme");
+ write(path.join(themesDir, "theme-types.ts"), themeTypes);
+
+ for (const base of ["takumi", "forme"] as const) {
+ portLib(base);
+
+ // components + blocks
+ for (const file of walk(path.join(SRC, "components"))) {
+ const rel = path.relative(SRC, file);
+ portFile(rel, base);
+ }
+ for (const file of walk(path.join(SRC, "blocks"))) {
+ const rel = path.relative(SRC, file);
+ portFile(rel, base);
+ }
+
+ // Fix block imports that referenced @pdfx/components
+ // And relative component imports in blocks
+ const blockFiles = walk(path.join(ROOT, `registry/bases/${base}/blocks`));
+ for (const file of blockFiles) {
+ let c = read(file);
+ c = c.replaceAll(
+ `@/registry/bases/${base}/components`,
+ `../../components`
+ );
+ // Blocks import from barrel — create relative imports
+ c = c.replaceAll(
+ /from ['"]@pdfx\/components['"]/g,
+ `from "../../components"`
+ );
+ c = c.replaceAll(
+ /from ['"]@\/registry\/bases\/PLACEHOLDER\/components['"]/g,
+ `from "../../components"`
+ );
+ write(file, c);
+ }
+
+ // registry.ts for base
+ write(
+ path.join(ROOT, `registry/bases/${base}/registry.ts`),
+ `export const ${base === "takumi" ? "takumi" : "forme"}RegistryBase = {
+ examplesDir: "examples/${base}",
+ name: "${base}",
+ publicRegistryDir: null,
+ sourceDir: "registry/bases/${base}",
+} as const;
+`
+ );
+ }
+
+ // Fix forme page-break specifically
+ for (const base of ["forme"] as const) {
+ const pb = path.join(
+ ROOT,
+ `registry/bases/${base}/components/page-break/page-break.tsx`
+ );
+ write(
+ pb,
+ `import type { PDFComponentProps } from "@/registry/themes";
+import { PageBreak as FormePageBreak } from "@formepdf/react";
+
+export interface PageBreakProps extends Omit<PDFComponentProps, "children"> {
+ children?: never;
+}
+
+export function PageBreak(_props: PageBreakProps) {
+ return <FormePageBreak />;
+}
+`
+ );
+
+ const pn = path.join(
+ ROOT,
+ `registry/bases/${base}/components/page-number/page-number.tsx`
+ );
+ let pageNum = read(pn);
+ // Ensure Forme placeholders
+ if (!pageNum.includes("{{pageNumber}}")) {
+ pageNum = pageNum.replace(
+ /<PDFText([^>]*)\/>/,
+ `<PDFText$1>{format.replace("{page}", "{{pageNumber}}").replace("{total}", "{{totalPages}}")}</PDFText>`
+ );
+ // remove render prop versions if still present
+ pageNum = pageNum.replaceAll(/\s+render=\{[^}]+\}/g, "");
+ write(pn, pageNum);
+ }
+
+ const kt = path.join(
+ ROOT,
+ `registry/bases/${base}/components/keep-together/keep-together.tsx`
+ );
+ write(
+ kt,
+ `import type { Style } from "@/registry/themes";
+import { View } from "@formepdf/react";
+import type { ReactNode } from "react";
+
+export interface KeepTogetherProps {
+ children?: ReactNode;
+ minPresenceAhead?: number;
+ style?: Style;
+}
+
+export function KeepTogether({ children, style }: KeepTogetherProps) {
+ return (
+ <View wrap={false} style={style as never}>
+ {children}
+ </View>
+ );
+}
+`
+ );
+ }
+
+ // Fix takumi keep-together / page-break / page-number
+ write(
+ path.join(
+ ROOT,
+ "registry/bases/takumi/components/keep-together/keep-together.tsx"
+ ),
+ `import type { Style } from "@/registry/themes";
+import type { ReactNode } from "react";
+import { View } from "../../lib/takumi-primitives";
+
+export interface KeepTogetherProps {
+ children?: ReactNode;
+ minPresenceAhead?: number;
+ style?: Style;
+}
+
+export function KeepTogether({ children, style }: KeepTogetherProps) {
+ return (
+ <View style={[{ breakInside: "avoid" }, style as never].filter(Boolean)}>
+ {children}
+ </View>
+ );
+}
+`
+ );
+
+ write(
+ path.join(
+ ROOT,
+ "registry/bases/takumi/components/page-break/page-break.tsx"
+ ),
+ `import type { PDFComponentProps } from "@/registry/themes";
+import { View } from "../../lib/takumi-primitives";
+
+export interface PageBreakProps extends Omit<PDFComponentProps, "children"> {
+ children?: never;
+}
+
+export function PageBreak({ style }: PageBreakProps) {
+ return <View style={[{ breakBefore: "page" }, style as never].filter(Boolean)} />;
+}
+`
+ );
+
+ console.log("Port complete.");
+ console.log(
+ "takumi components:",
+ fs.readdirSync(path.join(ROOT, "registry/bases/takumi/components")).length
+ );
+ console.log(
+ "forme components:",
+ fs.readdirSync(path.join(ROOT, "registry/bases/forme/components")).length
+ );
+ console.log(
+ "takumi blocks:",
+ fs.readdirSync(path.join(ROOT, "registry/bases/takumi/blocks")).length
+ );
+ console.log(
+ "forme blocks:",
+ fs.readdirSync(path.join(ROOT, "registry/bases/forme/blocks")).length
+ );
+}
+
+main();
diff --git a/tsconfig.json b/tsconfig.json
index 91b4042..3ce6db0 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -34,5 +34,5 @@
"next.config.mjs",
".next/dev/types/**/*.ts"
],
- "exclude": ["node_modules"]
+ "exclude": ["node_modules", ".pdfx-ref", ".registry-build"]
}