Beautiful pdf components, built on Takumi and Forme. 100% Free, Zero config, one command setup.
refactor: update theme context imports and file paths for consistency across components
Aniket-5086b871e5b4b33
diff --git a/.gitignore b/.gitignoreindex c4cd3fa..a35437c 100644--- a/.gitignore+++ b/.gitignore@@ -47,4 +47,3 @@ next-env.d.ts.contentlayer.content-collections.source-.pdfx-ref/diff --git a/content/docs/(root)/index.mdx b/content/docs/(root)/index.mdxindex 73dd470..20545a9 100644--- a/content/docs/(root)/index.mdx+++ b/content/docs/(root)/index.mdx@@ -28,7 +28,7 @@ Every component and block ships in two implementations:- [Takumi](https://takumi.kane.tw/docs/pdf) — JSX and Tailwind-style classes rendered to paged, selectable-text PDFs with WebAssembly.- [Forme](https://docs.formepdf.com) — React PDF primitives rendered with a page-native layout engine and first-class browser support.-The public props and variants follow [pdfx](https://github.com/akii09/pdfx); only the renderer-specific primitives differ.+The public props and variants follow pdfcn; only the renderer-specific primitives differ.## Featuresdiff --git a/content/docs/(root)/installation.mdx b/content/docs/(root)/installation.mdxindex 082f19b..21ef059 100644--- a/content/docs/(root)/installation.mdx+++ b/content/docs/(root)/installation.mdx@@ -28,8 +28,8 @@ The registry installs the matching renderer dependencies and the shared theme utImport the installed component and use it inside your renderer's document primitives:```tsx-import { Document, Page } from "@/components/pdf/takumi-primitives";-import { PdfcnThemeProvider } from "@/components/pdf/pdfcn-theme-context";+import { Document, Page } from "@/components/pdf/pdfcn-primitives";+import { PdfcnThemeProvider } from "@/components/pdf/theme-provider";import { Text } from "@/components/pdf/text";export function Invoice() {diff --git a/content/docs/blocks/forme/invoice-classic.mdx b/content/docs/blocks/forme/invoice-classic.mdxindex 84d3c2f..8c147ee 100644--- a/content/docs/blocks/forme/invoice-classic.mdx+++ b/content/docs/blocks/forme/invoice-classic.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/blocks/forme/invoice-consultant.mdx b/content/docs/blocks/forme/invoice-consultant.mdxindex a0c5d4e..771eb2a 100644--- a/content/docs/blocks/forme/invoice-consultant.mdx+++ b/content/docs/blocks/forme/invoice-consultant.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/blocks/forme/invoice-corporate.mdx b/content/docs/blocks/forme/invoice-corporate.mdxindex 433417d..2105ae5 100644--- a/content/docs/blocks/forme/invoice-corporate.mdx+++ b/content/docs/blocks/forme/invoice-corporate.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/blocks/forme/invoice-creative.mdx b/content/docs/blocks/forme/invoice-creative.mdxindex 5250845..b25bcbc 100644--- a/content/docs/blocks/forme/invoice-creative.mdx+++ b/content/docs/blocks/forme/invoice-creative.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/blocks/forme/invoice-minimal.mdx b/content/docs/blocks/forme/invoice-minimal.mdxindex c6bb0d0..dcbd56e 100644--- a/content/docs/blocks/forme/invoice-minimal.mdx+++ b/content/docs/blocks/forme/invoice-minimal.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/blocks/forme/invoice-modern.mdx b/content/docs/blocks/forme/invoice-modern.mdxindex b31ed70..0556c95 100644--- a/content/docs/blocks/forme/invoice-modern.mdx+++ b/content/docs/blocks/forme/invoice-modern.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/blocks/forme/report-financial.mdx b/content/docs/blocks/forme/report-financial.mdxindex 5d3a14b..cd703fc 100644--- a/content/docs/blocks/forme/report-financial.mdx+++ b/content/docs/blocks/forme/report-financial.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/blocks/forme/report-marketing.mdx b/content/docs/blocks/forme/report-marketing.mdxindex ab09e2f..ae0f4ea 100644--- a/content/docs/blocks/forme/report-marketing.mdx+++ b/content/docs/blocks/forme/report-marketing.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/blocks/forme/report-operations.mdx b/content/docs/blocks/forme/report-operations.mdxindex c88506f..8177164 100644--- a/content/docs/blocks/forme/report-operations.mdx+++ b/content/docs/blocks/forme/report-operations.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/blocks/forme/report-security.mdx b/content/docs/blocks/forme/report-security.mdxindex fb3fd95..b56b557 100644--- a/content/docs/blocks/forme/report-security.mdx+++ b/content/docs/blocks/forme/report-security.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/blocks/takumi/invoice-classic.mdx b/content/docs/blocks/takumi/invoice-classic.mdxindex 839c447..781f19e 100644--- a/content/docs/blocks/takumi/invoice-classic.mdx+++ b/content/docs/blocks/takumi/invoice-classic.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/blocks/takumi/invoice-consultant.mdx b/content/docs/blocks/takumi/invoice-consultant.mdxindex e179cd8..dc955de 100644--- a/content/docs/blocks/takumi/invoice-consultant.mdx+++ b/content/docs/blocks/takumi/invoice-consultant.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/blocks/takumi/invoice-corporate.mdx b/content/docs/blocks/takumi/invoice-corporate.mdxindex 1a4b9fd..c917e10 100644--- a/content/docs/blocks/takumi/invoice-corporate.mdx+++ b/content/docs/blocks/takumi/invoice-corporate.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/blocks/takumi/invoice-creative.mdx b/content/docs/blocks/takumi/invoice-creative.mdxindex f01ffe3..040f8b1 100644--- a/content/docs/blocks/takumi/invoice-creative.mdx+++ b/content/docs/blocks/takumi/invoice-creative.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/blocks/takumi/invoice-minimal.mdx b/content/docs/blocks/takumi/invoice-minimal.mdxindex 797fd7e..2a5d09f 100644--- a/content/docs/blocks/takumi/invoice-minimal.mdx+++ b/content/docs/blocks/takumi/invoice-minimal.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/blocks/takumi/invoice-modern.mdx b/content/docs/blocks/takumi/invoice-modern.mdxindex 2a00105..e74068e 100644--- a/content/docs/blocks/takumi/invoice-modern.mdx+++ b/content/docs/blocks/takumi/invoice-modern.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/blocks/takumi/report-financial.mdx b/content/docs/blocks/takumi/report-financial.mdxindex 51090b5..b27b95c 100644--- a/content/docs/blocks/takumi/report-financial.mdx+++ b/content/docs/blocks/takumi/report-financial.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/blocks/takumi/report-marketing.mdx b/content/docs/blocks/takumi/report-marketing.mdxindex 5c933aa..a340636 100644--- a/content/docs/blocks/takumi/report-marketing.mdx+++ b/content/docs/blocks/takumi/report-marketing.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/blocks/takumi/report-operations.mdx b/content/docs/blocks/takumi/report-operations.mdxindex ff462e7..39d70bc 100644--- a/content/docs/blocks/takumi/report-operations.mdx+++ b/content/docs/blocks/takumi/report-operations.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/blocks/takumi/report-security.mdx b/content/docs/blocks/takumi/report-security.mdxindex 412a8bd..b5bb665 100644--- a/content/docs/blocks/takumi/report-security.mdx+++ b/content/docs/blocks/takumi/report-security.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/components/forme/alert.mdx b/content/docs/components/forme/alert.mdxindex 05c6a81..f6b3c0f 100644--- a/content/docs/components/forme/alert.mdx+++ b/content/docs/components/forme/alert.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/components/forme/badge.mdx b/content/docs/components/forme/badge.mdxindex 9e459cc..dea0ca1 100644--- a/content/docs/components/forme/badge.mdx+++ b/content/docs/components/forme/badge.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/components/forme/card.mdx b/content/docs/components/forme/card.mdxindex cd8759b..f852a46 100644--- a/content/docs/components/forme/card.mdx+++ b/content/docs/components/forme/card.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/components/forme/data-table.mdx b/content/docs/components/forme/data-table.mdxindex 24fe123..4f683ca 100644--- a/content/docs/components/forme/data-table.mdx+++ b/content/docs/components/forme/data-table.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/components/forme/divider.mdx b/content/docs/components/forme/divider.mdxindex 8a23554..90b7360 100644--- a/content/docs/components/forme/divider.mdx+++ b/content/docs/components/forme/divider.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/components/forme/form.mdx b/content/docs/components/forme/form.mdxindex c224e19..e09e4bc 100644--- a/content/docs/components/forme/form.mdx+++ b/content/docs/components/forme/form.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/components/forme/graph.mdx b/content/docs/components/forme/graph.mdxindex e439be6..9e4a0f9 100644--- a/content/docs/components/forme/graph.mdx+++ b/content/docs/components/forme/graph.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/components/forme/heading.mdx b/content/docs/components/forme/heading.mdxindex 568422d..577531a 100644--- a/content/docs/components/forme/heading.mdx+++ b/content/docs/components/forme/heading.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/components/forme/keep-together.mdx b/content/docs/components/forme/keep-together.mdxindex 410cfb8..87bf58a 100644--- a/content/docs/components/forme/keep-together.mdx+++ b/content/docs/components/forme/keep-together.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/components/forme/key-value.mdx b/content/docs/components/forme/key-value.mdxindex 49792c7..f9e78e4 100644--- a/content/docs/components/forme/key-value.mdx+++ b/content/docs/components/forme/key-value.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/components/forme/link.mdx b/content/docs/components/forme/link.mdxindex d0f64e7..84f0a86 100644--- a/content/docs/components/forme/link.mdx+++ b/content/docs/components/forme/link.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/components/forme/list.mdx b/content/docs/components/forme/list.mdxindex 23ea207..9f12446 100644--- a/content/docs/components/forme/list.mdx+++ b/content/docs/components/forme/list.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/components/forme/page-break.mdx b/content/docs/components/forme/page-break.mdxindex ac99902..7947813 100644--- a/content/docs/components/forme/page-break.mdx+++ b/content/docs/components/forme/page-break.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/components/forme/page-footer.mdx b/content/docs/components/forme/page-footer.mdxindex 23b82f0..e773751 100644--- a/content/docs/components/forme/page-footer.mdx+++ b/content/docs/components/forme/page-footer.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/components/forme/page-header.mdx b/content/docs/components/forme/page-header.mdxindex b3c4b72..eb5b275 100644--- a/content/docs/components/forme/page-header.mdx+++ b/content/docs/components/forme/page-header.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/components/forme/page-number.mdx b/content/docs/components/forme/page-number.mdxindex ac0a795..f047a88 100644--- a/content/docs/components/forme/page-number.mdx+++ b/content/docs/components/forme/page-number.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/components/forme/pdf-image.mdx b/content/docs/components/forme/pdf-image.mdxindex fa0a1ab..7b77f3c 100644--- a/content/docs/components/forme/pdf-image.mdx+++ b/content/docs/components/forme/pdf-image.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/components/forme/qrcode.mdx b/content/docs/components/forme/qrcode.mdxindex 25f4635..3cae3d8 100644--- a/content/docs/components/forme/qrcode.mdx+++ b/content/docs/components/forme/qrcode.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/components/forme/section.mdx b/content/docs/components/forme/section.mdxindex c1581d0..bb657d6 100644--- a/content/docs/components/forme/section.mdx+++ b/content/docs/components/forme/section.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/components/forme/signature.mdx b/content/docs/components/forme/signature.mdxindex 1fd653d..ebe9b9d 100644--- a/content/docs/components/forme/signature.mdx+++ b/content/docs/components/forme/signature.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/components/forme/stack.mdx b/content/docs/components/forme/stack.mdxindex 138a840..e5b889a 100644--- a/content/docs/components/forme/stack.mdx+++ b/content/docs/components/forme/stack.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/components/forme/table.mdx b/content/docs/components/forme/table.mdxindex ef9e522..2710c06 100644--- a/content/docs/components/forme/table.mdx+++ b/content/docs/components/forme/table.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/components/forme/text.mdx b/content/docs/components/forme/text.mdxindex acbbe6e..512850f 100644--- a/content/docs/components/forme/text.mdx+++ b/content/docs/components/forme/text.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/components/forme/watermark.mdx b/content/docs/components/forme/watermark.mdxindex 59a25dc..6911bbb 100644--- a/content/docs/components/forme/watermark.mdx+++ b/content/docs/components/forme/watermark.mdx@@ -41,9 +41,9 @@ npm install @formepdf/react @formepdf/core/><ComponentSource- src="registry/bases/forme/lib/pdfcn-theme-context.tsx"+ src="registry/bases/forme/lib/theme-provider.tsx"base="forme"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSourcediff --git a/content/docs/components/takumi/alert.mdx b/content/docs/components/takumi/alert.mdxindex be129ee..7a5d6de 100644--- a/content/docs/components/takumi/alert.mdx+++ b/content/docs/components/takumi/alert.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/components/takumi/badge.mdx b/content/docs/components/takumi/badge.mdxindex 70e8f82..1988c79 100644--- a/content/docs/components/takumi/badge.mdx+++ b/content/docs/components/takumi/badge.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/components/takumi/card.mdx b/content/docs/components/takumi/card.mdxindex 7853c00..46a0c7f 100644--- a/content/docs/components/takumi/card.mdx+++ b/content/docs/components/takumi/card.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/components/takumi/data-table.mdx b/content/docs/components/takumi/data-table.mdxindex e269f32..9e2de6a 100644--- a/content/docs/components/takumi/data-table.mdx+++ b/content/docs/components/takumi/data-table.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/components/takumi/divider.mdx b/content/docs/components/takumi/divider.mdxindex ce90788..ddbbb34 100644--- a/content/docs/components/takumi/divider.mdx+++ b/content/docs/components/takumi/divider.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/components/takumi/form.mdx b/content/docs/components/takumi/form.mdxindex 426b8ca..6cdeafb 100644--- a/content/docs/components/takumi/form.mdx+++ b/content/docs/components/takumi/form.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/components/takumi/graph.mdx b/content/docs/components/takumi/graph.mdxindex f70c8e0..eb72c35 100644--- a/content/docs/components/takumi/graph.mdx+++ b/content/docs/components/takumi/graph.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/components/takumi/heading.mdx b/content/docs/components/takumi/heading.mdxindex 0a989fa..9b6ff87 100644--- a/content/docs/components/takumi/heading.mdx+++ b/content/docs/components/takumi/heading.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/components/takumi/keep-together.mdx b/content/docs/components/takumi/keep-together.mdxindex d3d787b..894d54c 100644--- a/content/docs/components/takumi/keep-together.mdx+++ b/content/docs/components/takumi/keep-together.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/components/takumi/key-value.mdx b/content/docs/components/takumi/key-value.mdxindex c1bf546..0095971 100644--- a/content/docs/components/takumi/key-value.mdx+++ b/content/docs/components/takumi/key-value.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/components/takumi/link.mdx b/content/docs/components/takumi/link.mdxindex 0c84977..fbaae2f 100644--- a/content/docs/components/takumi/link.mdx+++ b/content/docs/components/takumi/link.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/components/takumi/list.mdx b/content/docs/components/takumi/list.mdxindex 3fb1a55..6144a53 100644--- a/content/docs/components/takumi/list.mdx+++ b/content/docs/components/takumi/list.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/components/takumi/page-break.mdx b/content/docs/components/takumi/page-break.mdxindex 445ad8d..d9cd5a7 100644--- a/content/docs/components/takumi/page-break.mdx+++ b/content/docs/components/takumi/page-break.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/components/takumi/page-footer.mdx b/content/docs/components/takumi/page-footer.mdxindex a9ce478..0bdd3c1 100644--- a/content/docs/components/takumi/page-footer.mdx+++ b/content/docs/components/takumi/page-footer.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/components/takumi/page-header.mdx b/content/docs/components/takumi/page-header.mdxindex 202b03f..d91ad5d 100644--- a/content/docs/components/takumi/page-header.mdx+++ b/content/docs/components/takumi/page-header.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/components/takumi/page-number.mdx b/content/docs/components/takumi/page-number.mdxindex 6972855..2dc2fba 100644--- a/content/docs/components/takumi/page-number.mdx+++ b/content/docs/components/takumi/page-number.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/components/takumi/pdf-image.mdx b/content/docs/components/takumi/pdf-image.mdxindex a77ed3d..ea1ac0b 100644--- a/content/docs/components/takumi/pdf-image.mdx+++ b/content/docs/components/takumi/pdf-image.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/components/takumi/qrcode.mdx b/content/docs/components/takumi/qrcode.mdxindex 1dee734..392d52a 100644--- a/content/docs/components/takumi/qrcode.mdx+++ b/content/docs/components/takumi/qrcode.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/components/takumi/section.mdx b/content/docs/components/takumi/section.mdxindex 32bb754..d911387 100644--- a/content/docs/components/takumi/section.mdx+++ b/content/docs/components/takumi/section.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/components/takumi/signature.mdx b/content/docs/components/takumi/signature.mdxindex a07d23f..2519a49 100644--- a/content/docs/components/takumi/signature.mdx+++ b/content/docs/components/takumi/signature.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/components/takumi/stack.mdx b/content/docs/components/takumi/stack.mdxindex 21dcfe6..25ecb7c 100644--- a/content/docs/components/takumi/stack.mdx+++ b/content/docs/components/takumi/stack.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/components/takumi/table.mdx b/content/docs/components/takumi/table.mdxindex c55a4fb..5385da9 100644--- a/content/docs/components/takumi/table.mdx+++ b/content/docs/components/takumi/table.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/components/takumi/text.mdx b/content/docs/components/takumi/text.mdxindex caa47b1..d7f58da 100644--- a/content/docs/components/takumi/text.mdx+++ b/content/docs/components/takumi/text.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/content/docs/components/takumi/watermark.mdx b/content/docs/components/takumi/watermark.mdxindex a9f3ff6..1404370 100644--- a/content/docs/components/takumi/watermark.mdx+++ b/content/docs/components/takumi/watermark.mdx@@ -41,9 +41,9 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/pdfcn-theme-context.tsx"+ src="registry/bases/takumi/lib/theme-provider.tsx"base="takumi"- title="components/pdf/pdfcn-theme-context.tsx"+ title="components/pdf/theme-provider.tsx"/><ComponentSource@@ -59,15 +59,15 @@ npm install takumi-pdf @takumi-rs/helpers/><ComponentSource- src="registry/bases/takumi/lib/takumi-primitives.tsx"+ src="registry/bases/takumi/lib/pdfcn-primitives.tsx"base="takumi"- title="components/pdf/takumi-primitives.tsx"+ title="components/pdf/pdfcn-primitives.tsx"/><ComponentSource- src="registry/bases/takumi/lib/takumi-svg.tsx"+ src="registry/bases/takumi/lib/pdfcn-svg.tsx"base="takumi"- title="components/pdf/takumi-svg.tsx"+ title="components/pdf/pdfcn-svg.tsx"/><Step>Update the import paths to match your project setup.</Step>diff --git a/examples/__index__.ts b/examples/__index__.tsindex 86c0b75..dabfcd9 100644--- a/examples/__index__.ts+++ b/examples/__index__.ts@@ -146,3 +146,5 @@ export const demos: Record<BaseName, DemoMap> = {watermark: forme_watermark,},};++export type DemoName = string;diff --git a/examples/forme/invoice-classic.tsx b/examples/forme/invoice-classic.tsxindex 733ef60..f2d6c98 100644--- a/examples/forme/invoice-classic.tsx+++ b/examples/forme/invoice-classic.tsx@@ -3,5 +3,4 @@ import { InvoiceClassicDocument } from "@/registry/bases/forme/blocks/invoice-clconst Demo = () => {return <InvoiceClassicDocument />;};-export default Demo;diff --git a/examples/forme/invoice-consultant.tsx b/examples/forme/invoice-consultant.tsxindex ecb3d4b..4a1fd6b 100644--- a/examples/forme/invoice-consultant.tsx+++ b/examples/forme/invoice-consultant.tsx@@ -3,5 +3,4 @@ import { InvoiceConsultantDocument } from "@/registry/bases/forme/blocks/invoiceconst Demo = () => {return <InvoiceConsultantDocument />;};-export default Demo;diff --git a/examples/forme/invoice-corporate.tsx b/examples/forme/invoice-corporate.tsxindex c702cd1..5120dab 100644--- a/examples/forme/invoice-corporate.tsx+++ b/examples/forme/invoice-corporate.tsx@@ -3,5 +3,4 @@ import { InvoiceCorporateDocument } from "@/registry/bases/forme/blocks/invoice-const Demo = () => {return <InvoiceCorporateDocument />;};-export default Demo;diff --git a/examples/forme/invoice-creative.tsx b/examples/forme/invoice-creative.tsxindex ffbbad4..20aee85 100644--- a/examples/forme/invoice-creative.tsx+++ b/examples/forme/invoice-creative.tsx@@ -3,5 +3,4 @@ import { InvoiceCreativeDocument } from "@/registry/bases/forme/blocks/invoice-cconst Demo = () => {return <InvoiceCreativeDocument />;};-export default Demo;diff --git a/examples/forme/invoice-minimal.tsx b/examples/forme/invoice-minimal.tsxindex 9d3a16e..72dfd8a 100644--- a/examples/forme/invoice-minimal.tsx+++ b/examples/forme/invoice-minimal.tsx@@ -3,5 +3,4 @@ import { InvoiceMinimalDocument } from "@/registry/bases/forme/blocks/invoice-miconst Demo = () => {return <InvoiceMinimalDocument />;};-export default Demo;diff --git a/examples/forme/invoice-modern.tsx b/examples/forme/invoice-modern.tsxindex f664564..0c9638e 100644--- a/examples/forme/invoice-modern.tsx+++ b/examples/forme/invoice-modern.tsx@@ -3,5 +3,4 @@ import { InvoiceModernDocument } from "@/registry/bases/forme/blocks/invoice-modconst Demo = () => {return <InvoiceModernDocument />;};-export default Demo;diff --git a/examples/forme/report-financial.tsx b/examples/forme/report-financial.tsxindex 751c3b5..5c3957d 100644--- a/examples/forme/report-financial.tsx+++ b/examples/forme/report-financial.tsx@@ -3,5 +3,4 @@ import { FinancialReportDocument } from "@/registry/bases/forme/blocks/report-ficonst Demo = () => {return <FinancialReportDocument />;};-export default Demo;diff --git a/examples/forme/report-marketing.tsx b/examples/forme/report-marketing.tsxindex 2d6232f..1b8ae5a 100644--- a/examples/forme/report-marketing.tsx+++ b/examples/forme/report-marketing.tsx@@ -3,5 +3,4 @@ import { MarketingReportDocument } from "@/registry/bases/forme/blocks/report-maconst Demo = () => {return <MarketingReportDocument />;};-export default Demo;diff --git a/examples/forme/report-operations.tsx b/examples/forme/report-operations.tsxindex 292e62e..c6089e6 100644--- a/examples/forme/report-operations.tsx+++ b/examples/forme/report-operations.tsx@@ -3,5 +3,4 @@ import { OperationsReportDocument } from "@/registry/bases/forme/blocks/report-oconst Demo = () => {return <OperationsReportDocument />;};-export default Demo;diff --git a/examples/forme/report-security.tsx b/examples/forme/report-security.tsxindex c651f5f..576f133 100644--- a/examples/forme/report-security.tsx+++ b/examples/forme/report-security.tsx@@ -3,5 +3,4 @@ import { SecurityReportDocument } from "@/registry/bases/forme/blocks/report-secconst Demo = () => {return <SecurityReportDocument />;};-export default Demo;diff --git a/examples/preview-config.ts b/examples/preview-config.tsindex 4bc5166..61a8c5b 100644--- a/examples/preview-config.ts+++ b/examples/preview-config.ts@@ -1,6 +1,6 @@import type { RenderOptions } from "takumi-pdf";-import { pointToCssPixel } from "@/registry/bases/takumi/lib/takumi-primitives";+import { pointToCssPixel } from "@/registry/bases/takumi/lib/pdfcn-primitives";const DEFAULT_MARGIN = 40;diff --git a/examples/takumi/alert.tsx b/examples/takumi/alert.tsxindex 43bc211..60b0203 100644--- a/examples/takumi/alert.tsx+++ b/examples/takumi/alert.tsx@@ -4,8 +4,8 @@ import {Section,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";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/theme-provider";+import { Document, Page } from "@/registry/bases/takumi/lib/pdfcn-primitives";const DemoBody = () => (<Section spacing="none">diff --git a/examples/takumi/badge.tsx b/examples/takumi/badge.tsxindex debb38d..5e7dbd8 100644--- a/examples/takumi/badge.tsx+++ b/examples/takumi/badge.tsx@@ -1,10 +1,10 @@import { Badge } from "@/registry/bases/takumi/components";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/theme-provider";import {Document,Page,View,-} from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";const DemoBody = () => (<Viewdiff --git a/examples/takumi/card.tsx b/examples/takumi/card.tsxindex 524d380..2405d18 100644--- a/examples/takumi/card.tsx+++ b/examples/takumi/card.tsx@@ -1,6 +1,6 @@import { PdfCard, 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";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/theme-provider";+import { Document, Page } from "@/registry/bases/takumi/lib/pdfcn-primitives";const DemoBody = () => (<PdfCard title="Project Summary" variant="default" padding="md">diff --git a/examples/takumi/data-table.tsx b/examples/takumi/data-table.tsxindex 59b88b8..da0e37f 100644--- a/examples/takumi/data-table.tsx+++ b/examples/takumi/data-table.tsx@@ -3,8 +3,8 @@ import {Heading,Section,} 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";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/theme-provider";+import { Document, Page } from "@/registry/bases/takumi/lib/pdfcn-primitives";const DemoBody = () => (<Section spacing="none">diff --git a/examples/takumi/divider.tsx b/examples/takumi/divider.tsxindex 42650c6..145079f 100644--- a/examples/takumi/divider.tsx+++ b/examples/takumi/divider.tsx@@ -1,10 +1,10 @@import { Divider, Heading, Text } from "@/registry/bases/takumi/components";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/theme-provider";import {Document,Page,View,-} from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";const DemoBody = () => (<View>diff --git a/examples/takumi/form.tsx b/examples/takumi/form.tsxindex c0aea1d..b6a82f2 100644--- a/examples/takumi/form.tsx+++ b/examples/takumi/form.tsx@@ -1,6 +1,6 @@import { PdfForm } 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";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/theme-provider";+import { Document, Page } from "@/registry/bases/takumi/lib/pdfcn-primitives";const DemoBody = () => (<PdfFormdiff --git a/examples/takumi/graph.tsx b/examples/takumi/graph.tsxindex 4273a5a..dabb955 100644--- a/examples/takumi/graph.tsx+++ b/examples/takumi/graph.tsx@@ -1,6 +1,6 @@import { PdfGraph } 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";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/theme-provider";+import { Document, Page } from "@/registry/bases/takumi/lib/pdfcn-primitives";const DemoBody = () => (<PdfGraphdiff --git a/examples/takumi/heading.tsx b/examples/takumi/heading.tsxindex 141292a..cb9eb1c 100644--- a/examples/takumi/heading.tsx+++ b/examples/takumi/heading.tsx@@ -1,6 +1,6 @@import { Heading, Section } 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";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/theme-provider";+import { Document, Page } from "@/registry/bases/takumi/lib/pdfcn-primitives";const DemoBody = () => (<Section spacing="none">diff --git a/examples/takumi/invoice-classic.tsx b/examples/takumi/invoice-classic.tsxindex 0bb6fa0..671f578 100644--- a/examples/takumi/invoice-classic.tsx+++ b/examples/takumi/invoice-classic.tsx@@ -3,5 +3,4 @@ import { InvoiceClassicDocument } from "@/registry/bases/takumi/blocks/invoice-cconst Demo = () => {return <InvoiceClassicDocument />;};-export default Demo;diff --git a/examples/takumi/invoice-consultant.tsx b/examples/takumi/invoice-consultant.tsxindex c832a88..2479407 100644--- a/examples/takumi/invoice-consultant.tsx+++ b/examples/takumi/invoice-consultant.tsx@@ -3,5 +3,4 @@ import { InvoiceConsultantDocument } from "@/registry/bases/takumi/blocks/invoicconst Demo = () => {return <InvoiceConsultantDocument />;};-export default Demo;diff --git a/examples/takumi/invoice-corporate.tsx b/examples/takumi/invoice-corporate.tsxindex 1288a83..ecc865c 100644--- a/examples/takumi/invoice-corporate.tsx+++ b/examples/takumi/invoice-corporate.tsx@@ -3,5 +3,4 @@ import { InvoiceCorporateDocument } from "@/registry/bases/takumi/blocks/invoiceconst Demo = () => {return <InvoiceCorporateDocument />;};-export default Demo;diff --git a/examples/takumi/invoice-creative.tsx b/examples/takumi/invoice-creative.tsxindex c6a8c6e..dcb89c1 100644--- a/examples/takumi/invoice-creative.tsx+++ b/examples/takumi/invoice-creative.tsx@@ -3,5 +3,4 @@ import { InvoiceCreativeDocument } from "@/registry/bases/takumi/blocks/invoice-const Demo = () => {return <InvoiceCreativeDocument />;};-export default Demo;diff --git a/examples/takumi/invoice-minimal.tsx b/examples/takumi/invoice-minimal.tsxindex 2227a47..5ad55af 100644--- a/examples/takumi/invoice-minimal.tsx+++ b/examples/takumi/invoice-minimal.tsx@@ -3,5 +3,4 @@ import { InvoiceMinimalDocument } from "@/registry/bases/takumi/blocks/invoice-mconst Demo = () => {return <InvoiceMinimalDocument />;};-export default Demo;diff --git a/examples/takumi/invoice-modern.tsx b/examples/takumi/invoice-modern.tsxindex f110426..78c778d 100644--- a/examples/takumi/invoice-modern.tsx+++ b/examples/takumi/invoice-modern.tsx@@ -3,5 +3,4 @@ import { InvoiceModernDocument } from "@/registry/bases/takumi/blocks/invoice-moconst Demo = () => {return <InvoiceModernDocument />;};-export default Demo;diff --git a/examples/takumi/keep-together.tsx b/examples/takumi/keep-together.tsxindex 9772107..f38240e 100644--- a/examples/takumi/keep-together.tsx+++ b/examples/takumi/keep-together.tsx@@ -4,8 +4,8 @@ import {Section,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";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/theme-provider";+import { Document, Page } from "@/registry/bases/takumi/lib/pdfcn-primitives";const DemoBody = () => (<Section spacing="none">diff --git a/examples/takumi/key-value.tsx b/examples/takumi/key-value.tsxindex 4d600ac..3e56a8a 100644--- a/examples/takumi/key-value.tsx+++ b/examples/takumi/key-value.tsx@@ -1,6 +1,6 @@import { KeyValue } 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";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/theme-provider";+import { Document, Page } from "@/registry/bases/takumi/lib/pdfcn-primitives";const DemoBody = () => (<KeyValuediff --git a/examples/takumi/link.tsx b/examples/takumi/link.tsxindex d8f43b1..4e6a438 100644--- a/examples/takumi/link.tsx+++ b/examples/takumi/link.tsx@@ -1,6 +1,6 @@import { Link, Section } 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";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/theme-provider";+import { Document, Page } from "@/registry/bases/takumi/lib/pdfcn-primitives";const DemoBody = () => (<Section spacing="none">diff --git a/examples/takumi/list.tsx b/examples/takumi/list.tsxindex a80a369..823228e 100644--- a/examples/takumi/list.tsx+++ b/examples/takumi/list.tsx@@ -1,6 +1,6 @@import { PdfList } 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";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/theme-provider";+import { Document, Page } from "@/registry/bases/takumi/lib/pdfcn-primitives";const DemoBody = () => (<PdfListdiff --git a/examples/takumi/page-break.tsx b/examples/takumi/page-break.tsxindex 9ef1ea1..b90cf41 100644--- a/examples/takumi/page-break.tsx+++ b/examples/takumi/page-break.tsx@@ -1,10 +1,10 @@import { Heading, PageBreak, Text } from "@/registry/bases/takumi/components";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/theme-provider";import {Document,Page,View,-} from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";const DemoBody = () => (<View>diff --git a/examples/takumi/page-footer.tsx b/examples/takumi/page-footer.tsxindex e07b1e0..b981b24 100644--- a/examples/takumi/page-footer.tsx+++ b/examples/takumi/page-footer.tsx@@ -1,10 +1,10 @@import { PageFooter, Text } from "@/registry/bases/takumi/components";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/theme-provider";import {Document,Page,View,-} from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";const DemoBody = () => (<View style={{ display: "flex", flexDirection: "column", minHeight: 220 }}>diff --git a/examples/takumi/page-header.tsx b/examples/takumi/page-header.tsxindex ad3a984..2a9bfa6 100644--- a/examples/takumi/page-header.tsx+++ b/examples/takumi/page-header.tsx@@ -1,10 +1,10 @@import { PageHeader, Text } from "@/registry/bases/takumi/components";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/theme-provider";import {Document,Page,View,-} from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";const DemoBody = () => (<View>diff --git a/examples/takumi/page-number.tsx b/examples/takumi/page-number.tsxindex 38fde04..819d7f8 100644--- a/examples/takumi/page-number.tsx+++ b/examples/takumi/page-number.tsx@@ -3,12 +3,12 @@ import {PdfPageNumber,Text,} from "@/registry/bases/takumi/components";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/theme-provider";import {Document,Page,View,-} from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";const DemoBody = () => (<View style={{ minHeight: 680, position: "relative" }}>diff --git a/examples/takumi/pdf-image.tsx b/examples/takumi/pdf-image.tsxindex f6d0ac0..ed5e3c9 100644--- a/examples/takumi/pdf-image.tsx+++ b/examples/takumi/pdf-image.tsx@@ -1,7 +1,7 @@import { PREVIEW_IMAGE_DATA_URI } from "@/examples/preview-assets";import { PdfImage } 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";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/theme-provider";+import { Document, Page } from "@/registry/bases/takumi/lib/pdfcn-primitives";const DemoBody = () => (<PdfImagediff --git a/examples/takumi/qrcode.tsx b/examples/takumi/qrcode.tsxindex 0cd19e5..db3dc93 100644--- a/examples/takumi/qrcode.tsx+++ b/examples/takumi/qrcode.tsx@@ -5,8 +5,8 @@ import {Stack,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";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/theme-provider";+import { Document, Page } from "@/registry/bases/takumi/lib/pdfcn-primitives";const DemoBody = () => (<Section spacing="none">diff --git a/examples/takumi/report-financial.tsx b/examples/takumi/report-financial.tsxindex 8093c41..f3919d0 100644--- a/examples/takumi/report-financial.tsx+++ b/examples/takumi/report-financial.tsx@@ -3,5 +3,4 @@ import { FinancialReportDocument } from "@/registry/bases/takumi/blocks/report-fconst Demo = () => {return <FinancialReportDocument />;};-export default Demo;diff --git a/examples/takumi/report-marketing.tsx b/examples/takumi/report-marketing.tsxindex 1f8feef..9876dfb 100644--- a/examples/takumi/report-marketing.tsx+++ b/examples/takumi/report-marketing.tsx@@ -3,5 +3,4 @@ import { MarketingReportDocument } from "@/registry/bases/takumi/blocks/report-mconst Demo = () => {return <MarketingReportDocument />;};-export default Demo;diff --git a/examples/takumi/report-operations.tsx b/examples/takumi/report-operations.tsxindex ae5bfaa..d2f190a 100644--- a/examples/takumi/report-operations.tsx+++ b/examples/takumi/report-operations.tsx@@ -3,5 +3,4 @@ import { OperationsReportDocument } from "@/registry/bases/takumi/blocks/report-const Demo = () => {return <OperationsReportDocument />;};-export default Demo;diff --git a/examples/takumi/report-security.tsx b/examples/takumi/report-security.tsxindex c948f16..83e955d 100644--- a/examples/takumi/report-security.tsx+++ b/examples/takumi/report-security.tsx@@ -3,5 +3,4 @@ import { SecurityReportDocument } from "@/registry/bases/takumi/blocks/report-seconst Demo = () => {return <SecurityReportDocument />;};-export default Demo;diff --git a/examples/takumi/section.tsx b/examples/takumi/section.tsxindex 6c1b013..ad79c2a 100644--- a/examples/takumi/section.tsx+++ b/examples/takumi/section.tsx@@ -1,6 +1,6 @@import { Heading, Section, 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";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/theme-provider";+import { Document, Page } from "@/registry/bases/takumi/lib/pdfcn-primitives";const DemoBody = () => (<Section spacing="none">diff --git a/examples/takumi/signature.tsx b/examples/takumi/signature.tsxindex 6764fb4..3d13334 100644--- a/examples/takumi/signature.tsx+++ b/examples/takumi/signature.tsx@@ -1,6 +1,6 @@import { PdfSignatureBlock } 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";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/theme-provider";+import { Document, Page } from "@/registry/bases/takumi/lib/pdfcn-primitives";const DemoBody = () => (<PdfSignatureBlockdiff --git a/examples/takumi/stack.tsx b/examples/takumi/stack.tsxindex 1e67e78..8c1feac 100644--- a/examples/takumi/stack.tsx+++ b/examples/takumi/stack.tsx@@ -4,8 +4,8 @@ import {Stack,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";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/theme-provider";+import { Document, Page } from "@/registry/bases/takumi/lib/pdfcn-primitives";const DemoBody = () => (<Stack gap="md">diff --git a/examples/takumi/table.tsx b/examples/takumi/table.tsxindex c9612f6..19698d2 100644--- a/examples/takumi/table.tsx+++ b/examples/takumi/table.tsx@@ -6,8 +6,8 @@ import {TableHeader,TableRow,} 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";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/theme-provider";+import { Document, Page } from "@/registry/bases/takumi/lib/pdfcn-primitives";const DemoBody = () => (<Table variant="line" zebraStripe={false}>diff --git a/examples/takumi/text.tsx b/examples/takumi/text.tsxindex 72bc022..6c81f3d 100644--- a/examples/takumi/text.tsx+++ b/examples/takumi/text.tsx@@ -1,6 +1,6 @@import { Section, 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";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/theme-provider";+import { Document, Page } from "@/registry/bases/takumi/lib/pdfcn-primitives";const DemoBody = () => (<Section spacing="none">diff --git a/examples/takumi/watermark.tsx b/examples/takumi/watermark.tsxindex 44a5c95..5c2fb95 100644--- a/examples/takumi/watermark.tsx+++ b/examples/takumi/watermark.tsx@@ -3,12 +3,12 @@ import {PdfWatermark,Text,} from "@/registry/bases/takumi/components";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/theme-provider";import {Document,Page,View,-} from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";const DemoBody = () => (<View style={{ minHeight: 680, position: "relative" }}>diff --git a/lib/format-code.ts b/lib/format-code.tsindex 45a2a6c..1b50562 100644--- a/lib/format-code.ts+++ b/lib/format-code.ts@@ -50,33 +50,38 @@ export const formatCode = async (code: string) => {);formattedCode = formattedCode.replaceAll(- "@/registry/themes",- "@/components/pdf/lib/themes"+ "@/registry/bases/forme/lib/",+ "@/components/pdf/");formattedCode = formattedCode.replaceAll(- '"../../lib/',- '"@/components/pdf/lib/'+ "@/registry/bases/forme/components/",+ "@/components/pdf/");formattedCode = formattedCode.replaceAll(- '"../../components"',- '"@/components/pdf/components"'+ "@/registry/bases/takumi/lib/",+ "@/components/pdf/");formattedCode = formattedCode.replaceAll(- '"../table"',- '"@/components/pdf/components/table"'+ "@/registry/bases/takumi/components/",+ "@/components/pdf/");formattedCode = formattedCode.replaceAll(- '"../table/',- '"@/components/pdf/components/table/'+ "@/registry/bases/takumi/blocks/",+ "@/components/pdf/blocks/");formattedCode = formattedCode.replaceAll(- '"../lib/',- '"@/components/pdf/lib/'+ "@/registry/bases/forme/blocks/",+ "@/components/pdf/blocks/"+ );++ formattedCode = formattedCode.replaceAll(+ "@/registry/themes",+ "@/components/pdf/themes");formattedCode = formattedCode.replaceAll("export default", "export");diff --git a/package.json b/package.jsonindex b4380e7..8d8a275 100644--- a/package.json+++ b/package.json@@ -7,12 +7,11 @@"build": "pnpm registry:build && next build","start": "next start","typecheck": "tsc --noEmit",- "registry:build": "pnpm registry:generate && node scripts/build-registry.mjs",+ "registry:build": "shadcn build","postinstall": "fumadocs-mdx","check": "ultracite check","fix": "ultracite fix",- "prepare": "lefthook install",- "registry:generate": "node scripts/generate-registry.mjs && oxfmt examples registry.json"+ "prepare": "lefthook install"},"dependencies": {"@formepdf/core": "^0.10.5",diff --git a/public/r/forme/alert.json b/public/r/forme/alert.jsonindex 0c7cf57..2297b38 100644--- a/public/r/forme/alert.json+++ b/public/r/forme/alert.json@@ -13,7 +13,7 @@"files": [{"path": "registry/bases/forme/components/alert/alert.tsx",- "content": "import type { ReactNode } from \"react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { Text as PDFText, StyleSheet, View } from \"../../lib/forme-primitives\";\nimport type { Style } from \"../../lib/forme-primitives\";\nimport { Circle, Line, Path, Svg } from \"../../lib/forme-svg\";\nimport {\n mergePdfStyles,\n usePdfcnTheme,\n useSafeMemo,\n} 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\nconst 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\nconst borderLeft = (color: string) => ({\n borderLeftColor: color,\n borderLeftWidth: 4,\n});\n\nconst 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 sheet = StyleSheet.create({\n bg: {\n backgroundColor: colors.muted,\n },\n borderError: borderLeft(variantColors.error),\n borderInfo: borderLeft(variantColors.info),\n borderSuccess: borderLeft(variantColors.success),\n borderWarning: borderLeft(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 const 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) {\n return null;\n }\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={mergePdfStyles(containerStyles)}>\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",+ "content": "import type { ReactNode } from \"react\";\n\nimport {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport { Circle, Line, Path, Svg } from \"@/registry/bases/forme/lib/pdfcn-svg\";\nimport {\n mergePdfStyles,\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/lib/theme-provider\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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\nconst 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\nconst borderLeft = (color: string) => ({\n borderLeftColor: color,\n borderLeftWidth: 4,\n});\n\nconst 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 sheet = StyleSheet.create({\n bg: {\n backgroundColor: colors.muted,\n },\n borderError: borderLeft(variantColors.error),\n borderInfo: borderLeft(variantColors.info),\n borderSuccess: borderLeft(variantColors.success),\n borderWarning: borderLeft(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 const 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) {\n return null;\n }\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={mergePdfStyles(containerStyles)}>\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","target": "components/pdf/components/alert/alert.tsx"},diff --git a/public/r/forme/badge.json b/public/r/forme/badge.jsonindex 9ad8a6f..8981ab1 100644--- a/public/r/forme/badge.json+++ b/public/r/forme/badge.json@@ -13,7 +13,7 @@"files": [{"path": "registry/bases/forme/components/badge/badge.tsx",- "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { Text as PDFText, StyleSheet, View } from \"../../lib/forme-primitives\";\nimport type { Style } from \"../../lib/forme-primitives\";\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\nconst 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 lg: sheet.sizeLg,\n md: sheet.sizeMd,\n sm: sheet.sizeSm,\n } as Record<BadgeSize, Style>,\n containerVariantMap: {\n default: sheet.variantDefault,\n destructive: sheet.variantDestructive,\n info: sheet.variantInfo,\n outline: sheet.variantOutline,\n primary: sheet.variantPrimary,\n success: sheet.variantSuccess,\n warning: sheet.variantWarning,\n } as Record<BadgeVariant, Style>,\n textSizeMap: {\n lg: sheet.textLg,\n md: sheet.textMd,\n sm: sheet.textSm,\n } as Record<BadgeSize, Style>,\n textVariantMap: {\n default: sheet.textDefault,\n destructive: sheet.textDestructive,\n info: sheet.textInfo,\n outline: sheet.textOutline,\n primary: sheet.textPrimary,\n success: sheet.textSuccess,\n warning: sheet.textWarning,\n } as Record<BadgeVariant, Style>,\n };\n};\n\nexport const 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",+ "content": "import {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/lib/theme-provider\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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\nconst 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 lg: sheet.sizeLg,\n md: sheet.sizeMd,\n sm: sheet.sizeSm,\n } as Record<BadgeSize, Style>,\n containerVariantMap: {\n default: sheet.variantDefault,\n destructive: sheet.variantDestructive,\n info: sheet.variantInfo,\n outline: sheet.variantOutline,\n primary: sheet.variantPrimary,\n success: sheet.variantSuccess,\n warning: sheet.variantWarning,\n } as Record<BadgeVariant, Style>,\n textSizeMap: {\n lg: sheet.textLg,\n md: sheet.textMd,\n sm: sheet.textSm,\n } as Record<BadgeSize, Style>,\n textVariantMap: {\n default: sheet.textDefault,\n destructive: sheet.textDestructive,\n info: sheet.textInfo,\n outline: sheet.textOutline,\n primary: sheet.textPrimary,\n success: sheet.textSuccess,\n warning: sheet.textWarning,\n } as Record<BadgeVariant, Style>,\n };\n};\n\nexport const 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","target": "components/pdf/components/badge/badge.tsx"},diff --git a/public/r/forme/card.json b/public/r/forme/card.jsonindex ab463ac..9d0774c 100644--- a/public/r/forme/card.json+++ b/public/r/forme/card.json@@ -13,7 +13,7 @@"files": [{"path": "registry/bases/forme/components/card/card.tsx",- "content": "import type { ReactNode } from \"react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { Text as PDFText, StyleSheet, View } from \"../../lib/forme-primitives\";\nimport type { Style } from \"../../lib/forme-primitives\";\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\nconst 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 const 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\") {\n cardStyles.push(styles.cardBordered);\n }\n if (variant === \"muted\") {\n cardStyles.push(styles.cardMuted);\n }\n cardStyles.push(paddingMap[padding]);\n if (style) {\n cardStyles.push(style);\n }\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",+ "content": "import type { ReactNode } from \"react\";\n\nimport {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/lib/theme-provider\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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\nconst 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 const 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\") {\n cardStyles.push(styles.cardBordered);\n }\n if (variant === \"muted\") {\n cardStyles.push(styles.cardMuted);\n }\n cardStyles.push(paddingMap[padding]);\n if (style) {\n cardStyles.push(style);\n }\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","target": "components/pdf/components/card/card.tsx"},diff --git a/public/r/forme/data-table.json b/public/r/forme/data-table.jsonindex aa047be..19e4ba5 100644--- a/public/r/forme/data-table.json+++ b/public/r/forme/data-table.json@@ -20,13 +20,13 @@},{"path": "registry/bases/forme/components/data-table/data-table.tsx",- "content": "import { Fragment } from \"react\";\n\nimport { Text as PDFText } from \"../../lib/forme-primitives\";\nimport type { Style } from \"../../lib/forme-primitives\";\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 const 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 ?? (\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 ?? text)}\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 ?? (\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 ?? text)}\n </TableCell>\n );\n })}\n </TableRow>\n </TableFooter>\n )}\n </Table>\n );\n};\n",+ "content": "import { Fragment } from \"react\";\n\nimport {\n Table,\n TableBody,\n TableCell,\n TableFooter,\n TableHeader,\n TableRow,\n} from \"@/registry/bases/forme/components/table\";\nimport { Text as PDFText } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/lib/theme-provider\";\n\nimport { createCompactStyles, formatValue } from \"./data-table.styles\";\nimport type { DataTableProps } from \"./data-table.types\";\n\nexport const 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 ?? (\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 ?? text)}\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 ?? (\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 ?? text)}\n </TableCell>\n );\n })}\n </TableRow>\n </TableFooter>\n )}\n </Table>\n );\n};\n","type": "registry:component","target": "components/pdf/components/data-table/data-table.tsx"},{"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",+ "content": "import type React from \"react\";\n\nimport type { TableVariant } from \"@/registry/bases/forme/components/table/table.types\";\nimport type { PDFComponentProps } from \"@/registry/themes\";\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","target": "components/pdf/components/data-table/data-table.types.ts"},diff --git a/public/r/forme/divider.json b/public/r/forme/divider.jsonindex 176332f..b8ba859 100644--- a/public/r/forme/divider.json+++ b/public/r/forme/divider.json@@ -13,7 +13,7 @@"files": [{"path": "registry/bases/forme/components/divider/divider.tsx",- "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { Text as PDFText, StyleSheet, View } from \"../../lib/forme-primitives\";\nimport type { Style } from \"../../lib/forme-primitives\";\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\nconst 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 Record<string, Style>);\n};\n\nexport const 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({\n borderBottomColor: resolveColor(color, theme.colors),\n } as Style);\n }\n const containerStyles: Style[] = [\n styles.labelContainer,\n spacingMap[spacing],\n ];\n if (width !== undefined) {\n containerStyles.push({ width } as Style);\n }\n if (style) {\n containerStyles.push(...[style].flat());\n }\n const labelTextStyle: Style[] = [styles.labelText];\n if (color) {\n labelTextStyle.push({ color: resolveColor(color, theme.colors) });\n }\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 }\n if (width !== undefined) {\n styleArray.push({ width } as Style);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return <View style={styleArray as never} />;\n};\n",+ "content": "import {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/lib/theme-provider\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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\nconst 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 Record<string, Style>);\n};\n\nexport const 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({\n borderBottomColor: resolveColor(color, theme.colors),\n } as Style);\n }\n const containerStyles: Style[] = [\n styles.labelContainer,\n spacingMap[spacing],\n ];\n if (width !== undefined) {\n containerStyles.push({ width } as Style);\n }\n if (style) {\n containerStyles.push(...[style].flat());\n }\n const labelTextStyle: Style[] = [styles.labelText];\n if (color) {\n labelTextStyle.push({ color: resolveColor(color, theme.colors) });\n }\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 }\n if (width !== undefined) {\n styleArray.push({ width } as Style);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return <View style={styleArray as never} />;\n};\n","type": "registry:component","target": "components/pdf/components/divider/divider.tsx"},diff --git a/public/r/forme/form.json b/public/r/forme/form.jsonindex 8f5ba83..15096af 100644--- a/public/r/forme/form.json+++ b/public/r/forme/form.json@@ -19,7 +19,7 @@},{"path": "registry/bases/forme/components/form/form.tsx",- "content": "import { Text as PDFText, View } from \"../../lib/forme-primitives\";\nimport type { Style } from \"../../lib/forme-primitives\";\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\nconst 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\nconst 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\nconst 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 let cols: number;\n if (layout === \"three-column\") {\n cols = 3;\n } else if (layout === \"two-column\") {\n cols = 2;\n } else {\n cols = 1;\n }\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 const 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) {\n rootStyles.push(style);\n }\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",+ "content": "import {\n Text as PDFText,\n View,\n} from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/lib/theme-provider\";\n\nimport { createFormStyles } from \"./form.styles\";\nimport type {\n FormLayout,\n PdfFormField,\n PdfFormGroup,\n PdfFormProps,\n} from \"./form.types\";\n\nconst 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\nconst 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\nconst 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 let cols: number;\n if (layout === \"three-column\") {\n cols = 3;\n } else if (layout === \"two-column\") {\n cols = 2;\n } else {\n cols = 1;\n }\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 const 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) {\n rootStyles.push(style);\n }\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","target": "components/pdf/components/form/form.tsx"},diff --git a/public/r/forme/graph.json b/public/r/forme/graph.jsonindex fde4690..6928580 100644--- a/public/r/forme/graph.json+++ b/public/r/forme/graph.json@@ -19,7 +19,7 @@},{"path": "registry/bases/forme/components/graph/graph.tsx",- "content": "import type React from \"react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { Text as PDFText, View } from \"../../lib/forme-primitives\";\nimport type { Style } from \"../../lib/forme-primitives\";\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 */\nconst 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 <>\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\nconst 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\nconst 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\nconst 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 lastPoint = points.at(-1);\n const firstPoint = points.at(0);\n const areaPath =\n isArea && points.length > 1 && lastPoint && firstPoint\n ? `${lineDStr} L ${lastPoint.x} ${chartY + chartH} L ${firstPoint.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\nconst 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\nconst 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\nconst renderChartContent = (\n variant: string,\n series: GraphSeries[],\n layout: ChartLayout,\n palette: string[],\n showGrid: boolean,\n showValues: boolean,\n showDots: boolean,\n smooth: boolean,\n centerLabel: string | undefined,\n theme: PdfcnTheme\n): React.ReactNode => {\n switch (variant) {\n case \"bar\": {\n return renderBarChart(\n series,\n layout,\n palette,\n showGrid,\n showValues,\n theme\n );\n }\n case \"horizontal-bar\": {\n return renderHorizontalBarChart(\n series,\n layout,\n palette,\n showValues,\n theme\n );\n }\n case \"line\":\n case \"area\": {\n return renderLineAreaChart(\n series,\n layout,\n palette,\n showGrid,\n showValues,\n showDots,\n smooth,\n variant === \"area\",\n theme\n );\n }\n case \"pie\": {\n return renderPieDonutChart(\n series,\n layout,\n palette,\n undefined,\n false,\n theme\n );\n }\n case \"donut\": {\n return renderPieDonutChart(\n series,\n layout,\n palette,\n centerLabel,\n true,\n theme\n );\n }\n default: {\n return null;\n }\n }\n};\n\nconst renderAxisLabels = (\n isPieOrDonut: boolean,\n xLabel: string | undefined,\n yLabel: string | undefined,\n chartX: number,\n chartW: number,\n height: number,\n mutedForeground: string\n) => (\n <>\n {!isPieOrDonut && xLabel && (\n <SvgText\n x={chartX + chartW / 2}\n y={height - 2}\n fill={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={mutedForeground}\n textAnchor=\"start\"\n style={{ fontSize: 8 }}\n >\n {yLabel}\n </SvgText>\n )}\n </>\n);\n\nconst renderTextFallback = (\n variant: GraphProps[\"variant\"],\n series: GraphSeries[],\n layout: ChartLayout,\n showValues: boolean,\n textColor: string\n) => {\n if (variant === \"pie\" || variant === \"donut\") {\n const data = series[0]?.data ?? [];\n const total = data.reduce((sum, point) => sum + point.value, 0) || 1;\n const cx = layout.svgW / 2;\n const cy = layout.svgH / 2;\n const radius = Math.min(layout.svgW, layout.svgH) / 2 - 20;\n const labelRadius = radius * 1.18;\n let currentAngle = 0;\n\n return (\n <View\n style={{\n height: layout.svgH,\n left: 0,\n position: \"absolute\",\n top: 0,\n width: layout.svgW,\n }}\n >\n {data.map((point, index) => {\n const sweep = (point.value / total) * 360;\n const midAngle = currentAngle + sweep / 2;\n currentAngle += sweep;\n if (sweep <= 15) {\n return null;\n }\n const labelPoint = polarToCartesian(cx, cy, labelRadius, midAngle);\n const onRight = labelPoint.x > cx;\n return (\n <PDFText\n key={`fallback-pie-${point.label}-${index}`}\n style={{\n color: textColor,\n fontSize: 7,\n left: onRight ? labelPoint.x : labelPoint.x - 60,\n lineHeight: 1,\n position: \"absolute\",\n textAlign: onRight ? \"left\" : \"right\",\n top: labelPoint.y - 4,\n width: 60,\n }}\n >\n {truncate(point.label, 10)}\n </PDFText>\n );\n })}\n </View>\n );\n }\n\n const {\n chartH,\n chartW,\n chartX,\n chartY,\n svgH,\n svgW,\n xLabels,\n yMax,\n yMin,\n yTicks,\n } = layout;\n const range = yMax - yMin || 1;\n const toY = (value: number) =>\n chartY + chartH - ((value - yMin) / range) * chartH;\n const labelStyle = {\n color: textColor,\n fontSize: 7,\n lineHeight: 1,\n position: \"absolute\" as const,\n };\n\n if (variant === \"horizontal-bar\") {\n const labelWidth = 60;\n const rowHeight = chartH / Math.max(xLabels.length, 1);\n const maxValue = Math.max(\n ...series.flatMap((item) => item.data.map((point) => point.value)),\n 1\n );\n\n return (\n <View\n style={{\n height: svgH,\n left: 0,\n position: \"absolute\",\n top: 0,\n width: svgW,\n }}\n >\n {xLabels.map((label, index) => {\n const value = series[0]?.data[index]?.value ?? 0;\n const barWidth = (value / maxValue) * (chartW - labelWidth);\n return (\n <View key={`fallback-horizontal-${label}`}>\n <PDFText\n style={{\n ...labelStyle,\n left: chartX,\n textAlign: \"right\",\n top: chartY + index * rowHeight + rowHeight / 2 - 4,\n width: labelWidth - 4,\n }}\n >\n {truncate(label, 14)}\n </PDFText>\n {showValues ? (\n <PDFText\n style={{\n ...labelStyle,\n color: textColor,\n fontSize: 6,\n left: chartX + labelWidth + barWidth + 3,\n top: chartY + index * rowHeight + rowHeight / 2 - 4,\n width: 28,\n }}\n >\n {fmtNum(value)}\n </PDFText>\n ) : null}\n </View>\n );\n })}\n </View>\n );\n }\n\n const pointX = (index: number) =>\n chartX + (index / Math.max(xLabels.length - 1, 1)) * chartW;\n const groupWidth = chartW / Math.max(xLabels.length, 1);\n const barGap = 2;\n const barWidth = Math.max(\n (groupWidth - barGap * (series.length + 1)) / Math.max(series.length, 1),\n 1\n );\n\n return (\n <View\n style={{\n height: svgH,\n left: 0,\n position: \"absolute\",\n top: 0,\n width: svgW,\n }}\n >\n {yTicks.map((tick) => (\n <PDFText\n key={`fallback-y-${tick}`}\n style={{\n ...labelStyle,\n left: 0,\n textAlign: \"right\",\n top: toY(tick) - 4,\n width: chartX - 4,\n }}\n >\n {fmtNum(tick)}\n </PDFText>\n ))}\n {(variant === \"line\" || variant === \"area\") &&\n xLabels.map((label, index) => (\n <PDFText\n key={`fallback-x-${label}`}\n style={{\n ...labelStyle,\n left: pointX(index) - 12,\n textAlign: \"center\",\n top: chartY + chartH + 3,\n width: 24,\n }}\n >\n {truncate(label, 8)}\n </PDFText>\n ))}\n {variant === \"bar\" &&\n showValues &&\n xLabels.flatMap((label, categoryIndex) =>\n series.map((item, seriesIndex) => {\n const value = item.data[categoryIndex]?.value ?? 0;\n const left =\n chartX +\n categoryIndex * groupWidth +\n barGap +\n seriesIndex * (barWidth + barGap);\n return (\n <PDFText\n key={`fallback-bar-${label}-${item.name}-${seriesIndex}`}\n style={{\n ...labelStyle,\n fontSize: 6,\n left,\n textAlign: \"center\",\n top: toY(value) - 8,\n width: barWidth,\n }}\n >\n {fmtNum(value)}\n </PDFText>\n );\n })\n )}\n </View>\n );\n};\n\nconst renderGraphContent = (\n title: string | undefined,\n subtitle: string | undefined,\n chartContent: React.ReactNode,\n chartLabels: React.ReactNode,\n axisLabels: React.ReactNode,\n textFallback: React.ReactNode,\n width: number,\n height: number,\n legend: string,\n showLegend: boolean,\n isPieOrDonut: boolean,\n series: GraphSeries[],\n palette: string[],\n styles: ReturnType<typeof createGraphStyles>\n) => (\n <>\n {title && <PDFText style={styles.title}>{title}</PDFText>}\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n <View style={legend === \"right\" ? styles.chartWithRightLegend : undefined}>\n <View style={{ height, position: \"relative\", width }}>\n <Svg width={width} height={height}>\n {chartContent}\n {axisLabels}\n </Svg>\n {textFallback}\n </View>\n {showLegend &&\n legend === \"right\" &&\n Legend({ palette, position: \"right\", series, styles })}\n </View>\n {chartLabels}\n {showLegend &&\n legend === \"bottom\" &&\n Legend({ palette, position: \"bottom\", series, styles })}\n </>\n);\n\nconst renderBarLabels = (\n variant: GraphProps[\"variant\"],\n series: GraphSeries[],\n chartX: number,\n chartW: number\n) => {\n if (variant !== \"bar\") {\n return null;\n }\n\n return (\n <View\n style={{\n display: \"flex\",\n flexDirection: \"row\",\n marginLeft: chartX,\n width: chartW,\n }}\n >\n {(series[0]?.data ?? []).map((point) => (\n <View key={point.label} style={{ alignItems: \"center\", flex: 1 }}>\n <PDFText style={{ fontSize: 7 }}>{truncate(point.label, 10)}</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 const 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 }\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 const chartContent = renderChartContent(\n variant,\n series,\n layout,\n palette,\n showGrid,\n showValues,\n showDots,\n smooth,\n centerLabel,\n theme\n );\n\n const showLegend = legend !== \"none\" && !isPieOrDonut;\n const chartLabels = renderBarLabels(variant, series, chartX, chartW);\n\n const containerStyles: Style[] = [styles.container];\n if (style) {\n containerStyles.push(style);\n }\n\n const content = (\n <View style={containerStyles as never}>\n {renderGraphContent(\n title,\n subtitle,\n chartContent,\n chartLabels,\n renderAxisLabels(\n isPieOrDonut,\n xLabel,\n yLabel,\n chartX,\n chartW,\n height,\n theme.colors.mutedForeground\n ),\n renderTextFallback(\n variant,\n series,\n layout,\n showValues,\n theme.colors.mutedForeground\n ),\n width,\n height,\n legend,\n showLegend,\n isPieOrDonut,\n series,\n palette,\n styles\n )}\n </View>\n );\n\n return noWrap ? <View wrap={false}>{content}</View> : content;\n};\n",+ "content": "import type React from \"react\";\n\nimport {\n Text as PDFText,\n View,\n} from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport {\n Circle,\n G,\n Line,\n Path,\n Rect,\n Svg,\n SvgText,\n} from \"@/registry/bases/forme/lib/pdfcn-svg\";\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/lib/theme-provider\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\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 */\nconst 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 <>\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\nconst 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\nconst 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\nconst 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 lastPoint = points.at(-1);\n const firstPoint = points.at(0);\n const areaPath =\n isArea && points.length > 1 && lastPoint && firstPoint\n ? `${lineDStr} L ${lastPoint.x} ${chartY + chartH} L ${firstPoint.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\nconst 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\nconst 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\nconst renderChartContent = (\n variant: string,\n series: GraphSeries[],\n layout: ChartLayout,\n palette: string[],\n showGrid: boolean,\n showValues: boolean,\n showDots: boolean,\n smooth: boolean,\n centerLabel: string | undefined,\n theme: PdfcnTheme\n): React.ReactNode => {\n switch (variant) {\n case \"bar\": {\n return renderBarChart(\n series,\n layout,\n palette,\n showGrid,\n showValues,\n theme\n );\n }\n case \"horizontal-bar\": {\n return renderHorizontalBarChart(\n series,\n layout,\n palette,\n showValues,\n theme\n );\n }\n case \"line\":\n case \"area\": {\n return renderLineAreaChart(\n series,\n layout,\n palette,\n showGrid,\n showValues,\n showDots,\n smooth,\n variant === \"area\",\n theme\n );\n }\n case \"pie\": {\n return renderPieDonutChart(\n series,\n layout,\n palette,\n undefined,\n false,\n theme\n );\n }\n case \"donut\": {\n return renderPieDonutChart(\n series,\n layout,\n palette,\n centerLabel,\n true,\n theme\n );\n }\n default: {\n return null;\n }\n }\n};\n\nconst renderAxisLabels = (\n isPieOrDonut: boolean,\n xLabel: string | undefined,\n yLabel: string | undefined,\n chartX: number,\n chartW: number,\n height: number,\n mutedForeground: string\n) => (\n <>\n {!isPieOrDonut && xLabel && (\n <SvgText\n x={chartX + chartW / 2}\n y={height - 2}\n fill={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={mutedForeground}\n textAnchor=\"start\"\n style={{ fontSize: 8 }}\n >\n {yLabel}\n </SvgText>\n )}\n </>\n);\n\nconst renderTextFallback = (\n variant: GraphProps[\"variant\"],\n series: GraphSeries[],\n layout: ChartLayout,\n showValues: boolean,\n textColor: string\n) => {\n if (variant === \"pie\" || variant === \"donut\") {\n const data = series[0]?.data ?? [];\n const total = data.reduce((sum, point) => sum + point.value, 0) || 1;\n const cx = layout.svgW / 2;\n const cy = layout.svgH / 2;\n const radius = Math.min(layout.svgW, layout.svgH) / 2 - 20;\n const labelRadius = radius * 1.18;\n let currentAngle = 0;\n\n return (\n <View\n style={{\n height: layout.svgH,\n left: 0,\n position: \"absolute\",\n top: 0,\n width: layout.svgW,\n }}\n >\n {data.map((point, index) => {\n const sweep = (point.value / total) * 360;\n const midAngle = currentAngle + sweep / 2;\n currentAngle += sweep;\n if (sweep <= 15) {\n return null;\n }\n const labelPoint = polarToCartesian(cx, cy, labelRadius, midAngle);\n const onRight = labelPoint.x > cx;\n return (\n <PDFText\n key={`fallback-pie-${point.label}-${index}`}\n style={{\n color: textColor,\n fontSize: 7,\n left: onRight ? labelPoint.x : labelPoint.x - 60,\n lineHeight: 1,\n position: \"absolute\",\n textAlign: onRight ? \"left\" : \"right\",\n top: labelPoint.y - 4,\n width: 60,\n }}\n >\n {truncate(point.label, 10)}\n </PDFText>\n );\n })}\n </View>\n );\n }\n\n const {\n chartH,\n chartW,\n chartX,\n chartY,\n svgH,\n svgW,\n xLabels,\n yMax,\n yMin,\n yTicks,\n } = layout;\n const range = yMax - yMin || 1;\n const toY = (value: number) =>\n chartY + chartH - ((value - yMin) / range) * chartH;\n const labelStyle = {\n color: textColor,\n fontSize: 7,\n lineHeight: 1,\n position: \"absolute\" as const,\n };\n\n if (variant === \"horizontal-bar\") {\n const labelWidth = 60;\n const rowHeight = chartH / Math.max(xLabels.length, 1);\n const maxValue = Math.max(\n ...series.flatMap((item) => item.data.map((point) => point.value)),\n 1\n );\n\n return (\n <View\n style={{\n height: svgH,\n left: 0,\n position: \"absolute\",\n top: 0,\n width: svgW,\n }}\n >\n {xLabels.map((label, index) => {\n const value = series[0]?.data[index]?.value ?? 0;\n const barWidth = (value / maxValue) * (chartW - labelWidth);\n return (\n <View key={`fallback-horizontal-${label}`}>\n <PDFText\n style={{\n ...labelStyle,\n left: chartX,\n textAlign: \"right\",\n top: chartY + index * rowHeight + rowHeight / 2 - 4,\n width: labelWidth - 4,\n }}\n >\n {truncate(label, 14)}\n </PDFText>\n {showValues ? (\n <PDFText\n style={{\n ...labelStyle,\n color: textColor,\n fontSize: 6,\n left: chartX + labelWidth + barWidth + 3,\n top: chartY + index * rowHeight + rowHeight / 2 - 4,\n width: 28,\n }}\n >\n {fmtNum(value)}\n </PDFText>\n ) : null}\n </View>\n );\n })}\n </View>\n );\n }\n\n const pointX = (index: number) =>\n chartX + (index / Math.max(xLabels.length - 1, 1)) * chartW;\n const groupWidth = chartW / Math.max(xLabels.length, 1);\n const barGap = 2;\n const barWidth = Math.max(\n (groupWidth - barGap * (series.length + 1)) / Math.max(series.length, 1),\n 1\n );\n\n return (\n <View\n style={{\n height: svgH,\n left: 0,\n position: \"absolute\",\n top: 0,\n width: svgW,\n }}\n >\n {yTicks.map((tick) => (\n <PDFText\n key={`fallback-y-${tick}`}\n style={{\n ...labelStyle,\n left: 0,\n textAlign: \"right\",\n top: toY(tick) - 4,\n width: chartX - 4,\n }}\n >\n {fmtNum(tick)}\n </PDFText>\n ))}\n {(variant === \"line\" || variant === \"area\") &&\n xLabels.map((label, index) => (\n <PDFText\n key={`fallback-x-${label}`}\n style={{\n ...labelStyle,\n left: pointX(index) - 12,\n textAlign: \"center\",\n top: chartY + chartH + 3,\n width: 24,\n }}\n >\n {truncate(label, 8)}\n </PDFText>\n ))}\n {variant === \"bar\" &&\n showValues &&\n xLabels.flatMap((label, categoryIndex) =>\n series.map((item, seriesIndex) => {\n const value = item.data[categoryIndex]?.value ?? 0;\n const left =\n chartX +\n categoryIndex * groupWidth +\n barGap +\n seriesIndex * (barWidth + barGap);\n return (\n <PDFText\n key={`fallback-bar-${label}-${item.name}-${seriesIndex}`}\n style={{\n ...labelStyle,\n fontSize: 6,\n left,\n textAlign: \"center\",\n top: toY(value) - 8,\n width: barWidth,\n }}\n >\n {fmtNum(value)}\n </PDFText>\n );\n })\n )}\n </View>\n );\n};\n\nconst renderGraphContent = (\n title: string | undefined,\n subtitle: string | undefined,\n chartContent: React.ReactNode,\n chartLabels: React.ReactNode,\n axisLabels: React.ReactNode,\n textFallback: React.ReactNode,\n width: number,\n height: number,\n legend: string,\n showLegend: boolean,\n isPieOrDonut: boolean,\n series: GraphSeries[],\n palette: string[],\n styles: ReturnType<typeof createGraphStyles>\n) => (\n <>\n {title && <PDFText style={styles.title}>{title}</PDFText>}\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n <View style={legend === \"right\" ? styles.chartWithRightLegend : undefined}>\n <View style={{ height, position: \"relative\", width }}>\n <Svg width={width} height={height}>\n {chartContent}\n {axisLabels}\n </Svg>\n {textFallback}\n </View>\n {showLegend &&\n legend === \"right\" &&\n Legend({ palette, position: \"right\", series, styles })}\n </View>\n {chartLabels}\n {showLegend &&\n legend === \"bottom\" &&\n Legend({ palette, position: \"bottom\", series, styles })}\n </>\n);\n\nconst renderBarLabels = (\n variant: GraphProps[\"variant\"],\n series: GraphSeries[],\n chartX: number,\n chartW: number\n) => {\n if (variant !== \"bar\") {\n return null;\n }\n\n return (\n <View\n style={{\n display: \"flex\",\n flexDirection: \"row\",\n marginLeft: chartX,\n width: chartW,\n }}\n >\n {(series[0]?.data ?? []).map((point) => (\n <View key={point.label} style={{ alignItems: \"center\", flex: 1 }}>\n <PDFText style={{ fontSize: 7 }}>{truncate(point.label, 10)}</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 const 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 }\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 const chartContent = renderChartContent(\n variant,\n series,\n layout,\n palette,\n showGrid,\n showValues,\n showDots,\n smooth,\n centerLabel,\n theme\n );\n\n const showLegend = legend !== \"none\" && !isPieOrDonut;\n const chartLabels = renderBarLabels(variant, series, chartX, chartW);\n\n const containerStyles: Style[] = [styles.container];\n if (style) {\n containerStyles.push(style);\n }\n\n const content = (\n <View style={containerStyles as never}>\n {renderGraphContent(\n title,\n subtitle,\n chartContent,\n chartLabels,\n renderAxisLabels(\n isPieOrDonut,\n xLabel,\n yLabel,\n chartX,\n chartW,\n height,\n theme.colors.mutedForeground\n ),\n renderTextFallback(\n variant,\n series,\n layout,\n showValues,\n theme.colors.mutedForeground\n ),\n width,\n height,\n legend,\n showLegend,\n isPieOrDonut,\n series,\n palette,\n styles\n )}\n </View>\n );\n\n return noWrap ? <View wrap={false}>{content}</View> : content;\n};\n","type": "registry:component","target": "components/pdf/components/graph/graph.tsx"},diff --git a/public/r/forme/heading.json b/public/r/forme/heading.jsonindex c62691d..41c6216 100644--- a/public/r/forme/heading.json+++ b/public/r/forme/heading.json@@ -13,7 +13,7 @@"files": [{"path": "registry/bases/forme/components/heading/heading.tsx",- "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { StyleSheet, Text } from \"../../lib/forme-primitives\";\nimport type { Style } from \"../../lib/forme-primitives\";\nimport {\n mergePdfStyles,\n usePdfcnTheme,\n useSafeMemo,\n} 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\nconst 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 const Heading = ({\n level = 1,\n align,\n color,\n transform,\n weight,\n tracking,\n noMargin,\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) {\n styleArray.push(weightMap[weight]);\n }\n if (tracking && tracking in trackingMap) {\n styleArray.push(trackingMap[tracking]);\n }\n if (transform && transform in transformMap) {\n styleArray.push(transformMap[transform as keyof typeof transformMap]);\n }\n if (noMargin) {\n styleArray.push(styles.noMargin);\n }\n const semantic = {} as Style;\n if (align) {\n semantic.textAlign = align;\n }\n if (color) {\n semantic.color = resolveColor(color, theme.colors);\n }\n if (Object.keys(semantic).length > 0) {\n styleArray.push(semantic);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return <Text style={mergePdfStyles(styleArray)}>{children}</Text>;\n};\n",+ "content": "import { StyleSheet, Text } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport {\n mergePdfStyles,\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/lib/theme-provider\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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\nconst 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 const Heading = ({\n level = 1,\n align,\n color,\n transform,\n weight,\n tracking,\n noMargin,\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) {\n styleArray.push(weightMap[weight]);\n }\n if (tracking && tracking in trackingMap) {\n styleArray.push(trackingMap[tracking]);\n }\n if (transform && transform in transformMap) {\n styleArray.push(transformMap[transform as keyof typeof transformMap]);\n }\n if (noMargin) {\n styleArray.push(styles.noMargin);\n }\n const semantic = {} as Style;\n if (align) {\n semantic.textAlign = align;\n }\n if (color) {\n semantic.color = resolveColor(color, theme.colors);\n }\n if (Object.keys(semantic).length > 0) {\n styleArray.push(semantic);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return <Text style={mergePdfStyles(styleArray)}>{children}</Text>;\n};\n","type": "registry:component","target": "components/pdf/components/heading/heading.tsx"},diff --git a/public/r/forme/invoice-classic.json b/public/r/forme/invoice-classic.jsonindex 1f78417..b4761f3 100644--- a/public/r/forme/invoice-classic.json+++ b/public/r/forme/invoice-classic.json@@ -13,7 +13,7 @@"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: \"Nagpur, IN\",\n companyEmail: \"[email protected]\",\n companyName: \"PDFx Inc.\",\n dueDate: \"March 17, 2026\",\n invoiceDate: \"February 17, 2026\",\n invoiceNumber: \"INV-2026-001\",\n items: [\n { description: \"Web Development\", quantity: 1, unitPrice: 12_500 },\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: \"Innovative PDF Solutions\",\n summary: {\n subtotal: 36_250,\n tax: 2537.5,\n total: 38_787.5,\n },\n};\n\nconst InvoiceClassicContent = ({ data }: { data: InvoiceClassicData }) => {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n page: {\n backgroundColor: theme.colors.background,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" margin={{ bottom: 25, left: 56, right: 56, top: 56 }}>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n <View style={styles.page as never}>\n <PageHeader\n variant=\"logo-left\"\n logo={\n <PdfImage\n src={data.logo ?? \"/favicon.png\"}\n style={{ margin: 0 }}\n />\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\n noWrap\n style={{\n flexDirection: \"row\",\n justifyContent: \"flex-end\",\n marginTop: 16,\n }}\n >\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\", 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 </View>\n </Page>\n </Document>\n );\n};\n\nexport const InvoiceClassicDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceClassicData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceClassicContent data={data} />\n </PdfcnThemeProvider>\n);\n",+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\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 \"@/registry/bases/forme/components\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\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: \"Nagpur, IN\",\n companyEmail: \"[email protected]\",\n companyName: \"pdfcn\",\n dueDate: \"March 17, 2026\",\n invoiceDate: \"February 17, 2026\",\n invoiceNumber: \"INV-2026-001\",\n items: [\n { description: \"Web Development\", quantity: 1, unitPrice: 12_500 },\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: \"Innovative PDF Solutions\",\n summary: {\n subtotal: 36_250,\n tax: 2537.5,\n total: 38_787.5,\n },\n};\n\nconst InvoiceClassicContent = ({ data }: { data: InvoiceClassicData }) => {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n page: {\n backgroundColor: theme.colors.background,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" margin={{ bottom: 25, left: 56, right: 56, top: 56 }}>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n <View style={styles.page as never}>\n <PageHeader\n variant=\"logo-left\"\n logo={\n <PdfImage\n src={data.logo ?? \"/favicon.png\"}\n style={{ margin: 0 }}\n />\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\n noWrap\n style={{\n flexDirection: \"row\",\n justifyContent: \"flex-end\",\n marginTop: 16,\n }}\n >\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\", 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 </View>\n </Page>\n </Document>\n );\n};\n\nexport const InvoiceClassicDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceClassicData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceClassicContent data={data} />\n </PdfcnThemeProvider>\n);\n","type": "registry:block","target": "components/pdf/blocks/invoice-classic/invoice-classic.tsx"},diff --git a/public/r/forme/invoice-consultant.json b/public/r/forme/invoice-consultant.jsonindex 2259861..48f9268 100644--- a/public/r/forme/invoice-consultant.json+++ b/public/r/forme/invoice-consultant.json@@ -13,7 +13,7 @@"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: \"Nagpur, IN · [email protected]\",\n companyName: \"PDFx Inc.\",\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: 9500,\n tax: 475,\n total: 9975,\n totalHours: 60,\n },\n};\n\nconst InvoiceConsultantContent = ({\n data,\n}: {\n data: InvoiceConsultantData;\n}) => {\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 },\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={{ bottom: 25, left: 56, right: 56, top: 56 }}>\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 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\n variant=\"xs\"\n color=\"mutedForeground\"\n style={{ marginTop: 8 }}\n >\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 </View>\n </Page>\n </Document>\n );\n};\n\nexport const InvoiceConsultantDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceConsultantData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceConsultantContent data={data} />\n </PdfcnThemeProvider>\n);\n",+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\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 \"@/registry/bases/forme/components\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\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: \"Nagpur, IN · [email protected]\",\n companyName: \"pdfcn\",\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: 9500,\n tax: 475,\n total: 9975,\n totalHours: 60,\n },\n};\n\nconst InvoiceConsultantContent = ({\n data,\n}: {\n data: InvoiceConsultantData;\n}) => {\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 },\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={{ bottom: 25, left: 56, right: 56, top: 56 }}>\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 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\n variant=\"xs\"\n color=\"mutedForeground\"\n style={{ marginTop: 8 }}\n >\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 </View>\n </Page>\n </Document>\n );\n};\n\nexport const InvoiceConsultantDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceConsultantData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceConsultantContent data={data} />\n </PdfcnThemeProvider>\n);\n","type": "registry:block","target": "components/pdf/blocks/invoice-consultant/invoice-consultant.tsx"},diff --git a/public/r/forme/invoice-corporate.json b/public/r/forme/invoice-corporate.jsonindex 537ac79..b2f574b 100644--- a/public/r/forme/invoice-corporate.json+++ b/public/r/forme/invoice-corporate.json@@ -13,7 +13,7 @@"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: \"Nagpur, IN\",\n companyEmail: \"[email protected]\",\n companyName: \"PDFx Inc.\",\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: 18_000 },\n {\n description: \"Training Workshop (per session)\",\n quantity: 3,\n unitPrice: 2500,\n },\n { description: \"Annual Support Package\", quantity: 1, unitPrice: 8500 },\n ],\n logo: \"/favicon.png\",\n notes:\n \"Corporate billing – Net 30 terms apply. For inquiries, contact [email protected]\",\n paymentTerms: {\n dueDate: \"March 24, 2026\",\n gst: \"GSTIN 987654321\",\n method: \"Wire Transfer / Corporate Account\",\n },\n subtitle: \"Innovative PDF Solutions\",\n summary: {\n subtotal: 56_500,\n tax: 4520,\n total: 61_020,\n },\n};\n\nconst 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 },\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={{ bottom: 25, left: 56, right: 56, top: 56 }}>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\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 {\n key: \"Tax (8%)\",\n value: `$${data.summary.tax.toFixed(2)}`,\n },\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 </View>\n </Page>\n </Document>\n );\n};\n\nexport const InvoiceCorporateDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceCorporateData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceCorporateContent data={data} />\n </PdfcnThemeProvider>\n);\n",+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\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 \"@/registry/bases/forme/components\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\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: \"Nagpur, IN\",\n companyEmail: \"[email protected]\",\n companyName: \"pdfcn\",\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: 18_000 },\n {\n description: \"Training Workshop (per session)\",\n quantity: 3,\n unitPrice: 2500,\n },\n { description: \"Annual Support Package\", quantity: 1, unitPrice: 8500 },\n ],\n logo: \"/favicon.png\",\n notes:\n \"Corporate billing – Net 30 terms apply. For inquiries, contact [email protected]\",\n paymentTerms: {\n dueDate: \"March 24, 2026\",\n gst: \"GSTIN 987654321\",\n method: \"Wire Transfer / Corporate Account\",\n },\n subtitle: \"Innovative PDF Solutions\",\n summary: {\n subtotal: 56_500,\n tax: 4520,\n total: 61_020,\n },\n};\n\nconst 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 },\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={{ bottom: 25, left: 56, right: 56, top: 56 }}>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\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 {\n key: \"Tax (8%)\",\n value: `$${data.summary.tax.toFixed(2)}`,\n },\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 </View>\n </Page>\n </Document>\n );\n};\n\nexport const InvoiceCorporateDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceCorporateData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceCorporateContent data={data} />\n </PdfcnThemeProvider>\n);\n","type": "registry:block","target": "components/pdf/blocks/invoice-corporate/invoice-corporate.tsx"},diff --git a/public/r/forme/invoice-creative.json b/public/r/forme/invoice-creative.jsonindex 91ad56e..b5604f0 100644--- a/public/r/forme/invoice-creative.json+++ b/public/r/forme/invoice-creative.json@@ -13,7 +13,7 @@"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: \"Nagpur, IN · [email protected]\",\n companyName: \"PDFx Inc.\",\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: \"Innovative PDF Solutions\",\n summary: {\n subtotal: 22_700,\n tax: 1475.5,\n total: 24_175.5,\n },\n};\n\nconst 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 },\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={{ bottom: 25, left: 56, right: 56, top: 56 }}>\n <PageFooter\n variant=\"centered\"\n centerText=\"Thank you for choosing us for your creative needs!\"\n sticky\n pagePadding={25}\n />\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\n variant=\"xs\"\n color=\"mutedForeground\"\n style={{ marginTop: 4 }}\n >\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 {\n key: \"Tax (6.5%)\",\n value: `$${data.summary.tax.toFixed(2)}`,\n },\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 </View>\n </Page>\n </Document>\n );\n};\n\nexport const InvoiceCreativeDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceCreativeData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceCreativeContent data={data} />\n </PdfcnThemeProvider>\n);\n",+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\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 \"@/registry/bases/forme/components\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\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: \"Nagpur, IN · [email protected]\",\n companyName: \"pdfcn\",\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: \"Innovative PDF Solutions\",\n summary: {\n subtotal: 22_700,\n tax: 1475.5,\n total: 24_175.5,\n },\n};\n\nconst 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 },\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={{ bottom: 25, left: 56, right: 56, top: 56 }}>\n <PageFooter\n variant=\"centered\"\n centerText=\"Thank you for choosing us for your creative needs!\"\n sticky\n pagePadding={25}\n />\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\n variant=\"xs\"\n color=\"mutedForeground\"\n style={{ marginTop: 4 }}\n >\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 {\n key: \"Tax (6.5%)\",\n value: `$${data.summary.tax.toFixed(2)}`,\n },\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 </View>\n </Page>\n </Document>\n );\n};\n\nexport const InvoiceCreativeDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceCreativeData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceCreativeContent data={data} />\n </PdfcnThemeProvider>\n);\n","type": "registry:block","target": "components/pdf/blocks/invoice-creative/invoice-creative.tsx"},diff --git a/public/r/forme/invoice-minimal.json b/public/r/forme/invoice-minimal.jsonindex bca8079..c880c39 100644--- a/public/r/forme/invoice-minimal.json+++ b/public/r/forme/invoice-minimal.json@@ -13,7 +13,7 @@"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: \"Nagpur, IN\",\n companyEmail: \"[email protected]\",\n companyName: \"PDFx Inc.\",\n dueDate: \"March 22, 2026\",\n invoiceDate: \"February 20, 2026\",\n invoiceNumber: \"INV-2026-003\",\n items: [\n { description: \"Annual License Plan\", quantity: 1, unitPrice: 25_000 },\n { description: \"Support & Maintenance\", quantity: 12, unitPrice: 1500 },\n { description: \"Custom Integration\", quantity: 1, unitPrice: 12_000 },\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: \"Innovative PDF Solutions\",\n summary: {\n subtotal: 55_000,\n tax: 3850,\n total: 58_850,\n },\n};\n\nconst 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: 28,\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 },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" margin={{ bottom: 25, left: 56, right: 56, top: 56 }}>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\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={{ paddingRight: 20, width: 251 }}>\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={{ width: 232 }}>\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 </View>\n </Page>\n </Document>\n );\n};\n\nexport const InvoiceMinimalDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceMinimalData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceMinimalContent data={data} />\n </PdfcnThemeProvider>\n);\n",+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\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 \"@/registry/bases/forme/components\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\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: \"Nagpur, IN\",\n companyEmail: \"[email protected]\",\n companyName: \"pdfcn\",\n dueDate: \"March 22, 2026\",\n invoiceDate: \"February 20, 2026\",\n invoiceNumber: \"INV-2026-003\",\n items: [\n { description: \"Annual License Plan\", quantity: 1, unitPrice: 25_000 },\n { description: \"Support & Maintenance\", quantity: 12, unitPrice: 1500 },\n { description: \"Custom Integration\", quantity: 1, unitPrice: 12_000 },\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: \"Innovative PDF Solutions\",\n summary: {\n subtotal: 55_000,\n tax: 3850,\n total: 58_850,\n },\n};\n\nconst 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: 28,\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 },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" margin={{ bottom: 25, left: 56, right: 56, top: 56 }}>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\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={{ paddingRight: 20, width: 251 }}>\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={{ width: 232 }}>\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 </View>\n </Page>\n </Document>\n );\n};\n\nexport const InvoiceMinimalDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceMinimalData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceMinimalContent data={data} />\n </PdfcnThemeProvider>\n);\n","type": "registry:block","target": "components/pdf/blocks/invoice-minimal/invoice-minimal.tsx"},diff --git a/public/r/forme/invoice-modern.json b/public/r/forme/invoice-modern.jsonindex bbd75b6..5394958 100644--- a/public/r/forme/invoice-modern.json+++ b/public/r/forme/invoice-modern.json@@ -13,7 +13,7 @@"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: \"Nagpur, IN\",\n companyEmail: \"[email protected]\",\n companyName: \"PDFx Inc.\",\n dueDate: \"March 20, 2026\",\n invoiceDate: \"February 18, 2026\",\n invoiceNumber: \"INV-2026-002\",\n items: [\n { description: \"API Integration\", quantity: 1, unitPrice: 15_000 },\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: \"Innovative PDF Solutions\",\n summary: {\n subtotal: 33_200,\n tax: 2324,\n total: 35_524,\n },\n};\n\nconst 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 },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" margin={{ bottom: 25, left: 56, right: 56, top: 56 }}>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\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={{\n ...styles.metaValue,\n fontSize: 11,\n fontWeight: \"bold\",\n }}\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\n style={{ ...styles.metaValue, fontWeight: \"bold\" }}\n noMargin\n >\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 </View>\n </Page>\n </Document>\n );\n};\n\nexport const InvoiceModernDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceModernData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceModernContent data={data} />\n </PdfcnThemeProvider>\n);\n",+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\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 \"@/registry/bases/forme/components\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\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: \"Nagpur, IN\",\n companyEmail: \"[email protected]\",\n companyName: \"pdfcn\",\n dueDate: \"March 20, 2026\",\n invoiceDate: \"February 18, 2026\",\n invoiceNumber: \"INV-2026-002\",\n items: [\n { description: \"API Integration\", quantity: 1, unitPrice: 15_000 },\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: \"Innovative PDF Solutions\",\n summary: {\n subtotal: 33_200,\n tax: 2324,\n total: 35_524,\n },\n};\n\nconst 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 },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" margin={{ bottom: 25, left: 56, right: 56, top: 56 }}>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\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={{\n ...styles.metaValue,\n fontSize: 11,\n fontWeight: \"bold\",\n }}\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\n style={{ ...styles.metaValue, fontWeight: \"bold\" }}\n noMargin\n >\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 </View>\n </Page>\n </Document>\n );\n};\n\nexport const InvoiceModernDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceModernData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceModernContent data={data} />\n </PdfcnThemeProvider>\n);\n","type": "registry:block","target": "components/pdf/blocks/invoice-modern/invoice-modern.tsx"},diff --git a/public/r/forme/keep-together.json b/public/r/forme/keep-together.jsonindex 71e2fde..7adad77 100644--- a/public/r/forme/keep-together.json+++ b/public/r/forme/keep-together.json@@ -13,7 +13,7 @@"files": [{"path": "registry/bases/forme/components/keep-together/keep-together.tsx",- "content": "import type { ReactNode } from \"react\";\n\nimport type { Style } from \"@/registry/themes\";\n\nimport { View } from \"../../lib/forme-primitives\";\n\nexport interface KeepTogetherProps {\n children?: ReactNode;\n minPresenceAhead?: number;\n style?: Style;\n}\n\nexport const KeepTogether = ({ children, style }: KeepTogetherProps) => (\n <View wrap={false} style={style as never}>\n {children}\n </View>\n);\n",+ "content": "import type { ReactNode } from \"react\";\n\nimport { View } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/themes\";\n\nexport interface KeepTogetherProps {\n children?: ReactNode;\n minPresenceAhead?: number;\n style?: Style;\n}\n\nexport const KeepTogether = ({ children, style }: KeepTogetherProps) => (\n <View wrap={false} style={style as never}>\n {children}\n </View>\n);\n","type": "registry:component","target": "components/pdf/components/keep-together/keep-together.tsx"},diff --git a/public/r/forme/key-value.json b/public/r/forme/key-value.jsonindex c96f4ee..221438f 100644--- a/public/r/forme/key-value.json+++ b/public/r/forme/key-value.json@@ -13,7 +13,7 @@"files": [{"path": "registry/bases/forme/components/key-value/key-value.tsx",- "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { Text as PDFText, StyleSheet, View } from \"../../lib/forme-primitives\";\nimport type { Style } from \"../../lib/forme-primitives\";\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\nconst 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\", width: \"100%\" },\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 lastRowStretch: {\n borderBottomColor: \"#ffffff\",\n borderBottomStyle: \"solid\",\n borderBottomWidth: 0.01,\n },\n rowHorizontal: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n paddingVertical: spacing[1],\n width: \"100%\",\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 const 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) {\n containerStyles.push(...[style].flat());\n }\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 }\n if (item.keyStyle) {\n keyStyles.push(item.keyStyle);\n }\n const valStyles: Style[] = [valueStyleMap[size]];\n if (boldValue) {\n valStyles.push(styles.valueBold);\n }\n const resolvedValueColor = item.valueColor ?? valueColor;\n if (resolvedValueColor) {\n valStyles.push({\n color: resolveColor(resolvedValueColor, theme.colors),\n });\n }\n if (item.valueStyle) {\n valStyles.push(item.valueStyle);\n }\n\n if (direction === \"horizontal\") {\n const rowStyles: Style[] = [styles.rowHorizontal];\n if (divided) {\n if (isLast) {\n rowStyles.push(styles.lastRowStretch);\n } else {\n const dividerStyle: Style = {};\n if (dividerColor) {\n dividerStyle.borderBottomColor = resolveColor(\n dividerColor,\n theme.colors\n );\n }\n if (dividerThickness) {\n dividerStyle.borderBottomWidth = dividerThickness;\n }\n if (dividerMargin) {\n dividerStyle.marginBottom = dividerMargin;\n }\n rowStyles.push({ ...styles.divider, ...dividerStyle });\n }\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) {\n rowStyles.push(styles.divider);\n }\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",+ "content": "import {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/lib/theme-provider\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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\nconst 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\", width: \"100%\" },\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 lastRowStretch: {\n borderBottomColor: \"#ffffff\",\n borderBottomStyle: \"solid\",\n borderBottomWidth: 0.01,\n },\n rowHorizontal: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n paddingVertical: spacing[1],\n width: \"100%\",\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 const 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) {\n containerStyles.push(...[style].flat());\n }\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 }\n if (item.keyStyle) {\n keyStyles.push(item.keyStyle);\n }\n const valStyles: Style[] = [valueStyleMap[size]];\n if (boldValue) {\n valStyles.push(styles.valueBold);\n }\n const resolvedValueColor = item.valueColor ?? valueColor;\n if (resolvedValueColor) {\n valStyles.push({\n color: resolveColor(resolvedValueColor, theme.colors),\n });\n }\n if (item.valueStyle) {\n valStyles.push(item.valueStyle);\n }\n\n if (direction === \"horizontal\") {\n const rowStyles: Style[] = [styles.rowHorizontal];\n if (divided) {\n if (isLast) {\n rowStyles.push(styles.lastRowStretch);\n } else {\n const dividerStyle: Style = {};\n if (dividerColor) {\n dividerStyle.borderBottomColor = resolveColor(\n dividerColor,\n theme.colors\n );\n }\n if (dividerThickness) {\n dividerStyle.borderBottomWidth = dividerThickness;\n }\n if (dividerMargin) {\n dividerStyle.marginBottom = dividerMargin;\n }\n rowStyles.push({ ...styles.divider, ...dividerStyle });\n }\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) {\n rowStyles.push(styles.divider);\n }\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","target": "components/pdf/components/key-value/key-value.tsx"},diff --git a/public/r/forme/link.json b/public/r/forme/link.jsonindex 5368361..e432490 100644--- a/public/r/forme/link.json+++ b/public/r/forme/link.json@@ -13,7 +13,7 @@"files": [{"path": "registry/bases/forme/components/link/link.tsx",- "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n Link as PDFLink,\n StyleSheet,\n Text as PDFText,\n} from \"../../lib/forme-primitives\";\nimport type { Style } from \"../../lib/forme-primitives\";\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\nconst 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 const 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 }\n const semantic = {} as Style;\n if (align) {\n semantic.textAlign = align;\n }\n if (color) {\n semantic.color = resolveColor(color, theme.colors);\n }\n if (Object.keys(semantic).length > 0) {\n styleArray.push(semantic);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return (\n <PDFText style={styleArray as never}>\n <PDFLink href={href} style={styleArray as never}>\n {children}\n </PDFLink>\n </PDFText>\n );\n};\n",+ "content": "import {\n Link as PDFLink,\n StyleSheet,\n Text as PDFText,\n} from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/lib/theme-provider\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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\nconst 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 const 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 }\n const semantic = {} as Style;\n if (align) {\n semantic.textAlign = align;\n }\n if (color) {\n semantic.color = resolveColor(color, theme.colors);\n }\n if (Object.keys(semantic).length > 0) {\n styleArray.push(semantic);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return (\n <PDFText style={styleArray as never}>\n <PDFLink href={href} style={styleArray as never}>\n {children}\n </PDFLink>\n </PDFText>\n );\n};\n","type": "registry:component","target": "components/pdf/components/link/link.tsx"},diff --git a/public/r/forme/list.json b/public/r/forme/list.jsonindex dba4684..565a067 100644--- a/public/r/forme/list.json+++ b/public/r/forme/list.json@@ -19,7 +19,7 @@},{"path": "registry/bases/forme/components/list/list.tsx",- "content": "import type React from \"react\";\n\nimport { Text as PDFText, View } from \"../../lib/forme-primitives\";\nimport type { Style } from \"../../lib/forme-primitives\";\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\nconst getGapStyle = (gap: GapProp, styles: Styles): Style => {\n if (gap === \"xs\") {\n return styles.itemRowGapXs;\n }\n if (gap === \"md\") {\n return styles.itemRowGapMd;\n }\n return styles.itemRowGapSm;\n};\n\nconst 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) {\n row.push(getGapStyle(gap, styles));\n }\n return row;\n};\n\n/** Bullet dot marker — solid filled for level 0, outline ring for nested levels. */\nconst dotMarker = (level: number, styles: Styles): React.ReactElement =>\n 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// eslint-disable-next-line no-use-before-define, prefer-const\nlet renderBulletItem: (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles,\n level: number\n) => React.ReactElement;\n// eslint-disable-next-line no-use-before-define, prefer-const\nlet renderMultiLevelItem: (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles,\n level: number\n) => React.ReactElement;\n\nconst renderNumberedItem = (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement => (\n <View\n key={index}\n style={buildRowStyles(index, total, gap, styles, \"center\") as never}\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\nconst 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\") as never}\n >\n <View\n style={\n [styles.checkBox, isChecked ? styles.checkBoxChecked : {}] as never\n }\n ></View>\n <View style={styles.checklistTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n );\n};\n\nconst renderIconItem = (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement => (\n <View\n key={index}\n style={buildRowStyles(index, total, gap, styles, \"center\") as never}\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\nconst renderDescriptiveItem = (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement => (\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\nconst 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 default: {\n break;\n }\n }\n return null;\n};\n\nconst renderItemList = (\n items: ListItem[],\n variant: ListVariant,\n gap: GapProp,\n styles: Styles,\n level: number\n): React.ReactElement => (\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\nrenderBulletItem = (item, index, total, gap, styles, level) => (\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 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\nrenderMultiLevelItem = (item, index, total, gap, styles, level) => (\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 [\n level === 0 ? styles.itemText : styles.itemTextSub,\n level === 0 ? styles.itemTextBold : {},\n ] as never\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\nexport const PdfList = ({\n items,\n variant = \"bullet\",\n gap = \"sm\",\n style,\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) {\n containerStyles.push(styles.childrenContainer);\n }\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",+ "content": "import type React from \"react\";\n\nimport {\n Text as PDFText,\n View,\n} from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/lib/theme-provider\";\n\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\nconst getGapStyle = (gap: GapProp, styles: Styles): Style => {\n if (gap === \"xs\") {\n return styles.itemRowGapXs;\n }\n if (gap === \"md\") {\n return styles.itemRowGapMd;\n }\n return styles.itemRowGapSm;\n};\n\nconst 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) {\n row.push(getGapStyle(gap, styles));\n }\n return row;\n};\n\n/** Bullet dot marker — solid filled for level 0, outline ring for nested levels. */\nconst dotMarker = (level: number, styles: Styles): React.ReactElement =>\n 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// eslint-disable-next-line no-use-before-define, prefer-const\nlet renderBulletItem: (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles,\n level: number\n) => React.ReactElement;\n// eslint-disable-next-line no-use-before-define, prefer-const\nlet renderMultiLevelItem: (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles,\n level: number\n) => React.ReactElement;\n\nconst renderNumberedItem = (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement => (\n <View\n key={index}\n style={buildRowStyles(index, total, gap, styles, \"center\") as never}\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\nconst 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\") as never}\n >\n <View\n style={\n [styles.checkBox, isChecked ? styles.checkBoxChecked : {}] as never\n }\n ></View>\n <View style={styles.checklistTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n );\n};\n\nconst renderIconItem = (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement => (\n <View\n key={index}\n style={buildRowStyles(index, total, gap, styles, \"center\") as never}\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\nconst renderDescriptiveItem = (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement => (\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\nconst 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 default: {\n break;\n }\n }\n return null;\n};\n\nconst renderItemList = (\n items: ListItem[],\n variant: ListVariant,\n gap: GapProp,\n styles: Styles,\n level: number\n): React.ReactElement => (\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\nrenderBulletItem = (item, index, total, gap, styles, level) => (\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 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\nrenderMultiLevelItem = (item, index, total, gap, styles, level) => (\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 [\n level === 0 ? styles.itemText : styles.itemTextSub,\n level === 0 ? styles.itemTextBold : {},\n ] as never\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\nexport const PdfList = ({\n items,\n variant = \"bullet\",\n gap = \"sm\",\n style,\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) {\n containerStyles.push(styles.childrenContainer);\n }\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","target": "components/pdf/components/list/list.tsx"},diff --git a/public/r/forme/page-footer.json b/public/r/forme/page-footer.jsonindex 2e89f94..f445e4d 100644--- a/public/r/forme/page-footer.json+++ b/public/r/forme/page-footer.json@@ -13,7 +13,7 @@"files": [{"path": "registry/bases/forme/components/page-footer/page-footer.tsx",- "content": "import type React from \"react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n Fixed,\n Text as PDFText,\n StyleSheet,\n View,\n} from \"../../lib/forme-primitives\";\nimport type { Style } from \"../../lib/forme-primitives\";\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nconst wrapFixed = (\n fixed: boolean | undefined,\n node: React.ReactElement,\n footerOffset = 0\n) => {\n if (!fixed) {\n return node;\n }\n const nodeProps = node.props as {\n children?: React.ReactNode;\n style?: Style;\n };\n return (\n <Fixed\n position=\"footer\"\n style={[\n nodeProps.style,\n footerOffset ? { marginBottom: -footerOffset } : undefined,\n ]}\n >\n {nodeProps.children}\n </Fixed>\n );\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\nconst 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 simpleTextCenter: {\n ...textBase,\n textAlign: \"center\",\n },\n simpleTextLeft: {\n ...textBase,\n },\n simpleTextRight: {\n ...textBase,\n textAlign: \"right\",\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\ntype Styles = ReturnType<typeof createPageFooterStyles>;\n\nconst applyTextColor = (\n styles: Style[],\n color: string | undefined\n): Style[] => {\n if (!color) {\n return styles;\n }\n return [...styles, { color }];\n};\n\nconst renderBranded = (\n styles: Styles,\n containerStyles: Style[],\n leftStyle: Style[],\n rightStyle: Style[],\n leftText: string | undefined,\n rightText: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles as never}>\n {leftText && <PDFText style={leftStyle as never}>{leftText}</PDFText>}\n {rightText && <PDFText style={rightStyle as never}>{rightText}</PDFText>}\n </View>\n);\n\nconst renderCentered = (\n styles: Styles,\n containerStyles: Style[],\n textStyle: Style[],\n leftText: string | undefined,\n rightText: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles as never}>\n {leftText && <PDFText style={textStyle as never}>{leftText}</PDFText>}\n {rightText && <PDFText style={textStyle as never}>{rightText}</PDFText>}\n </View>\n);\n\nconst renderThreeColumn = (\n styles: Styles,\n containerStyles: Style[],\n leftStyle: Style[],\n centerStyle: Style[],\n rightStyle: Style[],\n leftText: string | undefined,\n rightText: string | undefined,\n address: string | undefined,\n phone: string | undefined,\n email: string | undefined,\n website: string | undefined,\n noWrap: boolean\n) => (\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\nconst renderDetailed = (\n styles: Styles,\n containerStyles: Style[],\n companyStyle: Style[],\n addrStyle: Style[],\n contactStyle: Style[],\n pageNumStyle: Style[],\n leftText: string | undefined,\n rightText: string | undefined,\n address: string | undefined,\n phone: string | undefined,\n email: string | undefined,\n website: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles as never}>\n <View style={styles.detailedTopRow}>\n <View style={styles.detailedLeft}>\n {leftText && (\n <PDFText style={companyStyle as never}>{leftText}</PDFText>\n )}\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\nconst renderMinimal = (\n styles: Styles,\n containerStyles: Style[],\n leftStyle: Style[],\n rightStyle: Style[],\n leftText: string | undefined,\n rightText: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles as never}>\n {leftText && <PDFText style={leftStyle as never}>{leftText}</PDFText>}\n {rightText && <PDFText style={rightStyle as never}>{rightText}</PDFText>}\n </View>\n);\n\nconst renderSimple = (\n styles: Styles,\n containerStyles: Style[],\n leftStyle: Style[],\n centerStyle: Style[],\n rightStyle: Style[],\n leftText: string | undefined,\n centerText: string | undefined,\n rightText: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles as never}>\n {leftText && <PDFText style={leftStyle as never}>{leftText}</PDFText>}\n {centerText && <PDFText style={centerStyle as never}>{centerText}</PDFText>}\n {rightText && <PDFText style={rightStyle as never}>{rightText}</PDFText>}\n </View>\n);\n\nexport const 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 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 = {};\n\n const applyOverrides = (base: Style[]): Style[] => {\n if (background) {\n base.push({ backgroundColor: resolveColor(background, theme.colors) });\n }\n if (style) {\n base.push(style);\n }\n if (sticky) {\n base.push(stickyStyle);\n }\n return base;\n };\n\n const variantRenderers: Record<PageFooterVariant, () => React.ReactNode> = {\n branded: () =>\n renderBranded(\n styles,\n applyOverrides([styles.brandedContainer, { marginTop: mt }]),\n applyTextColor([styles.textBranded], resolvedTextColor),\n applyTextColor([styles.textBrandedRight], resolvedTextColor),\n leftText,\n rightText,\n noWrap\n ),\n centered: () =>\n renderCentered(\n styles,\n applyOverrides([styles.centeredContainer, { marginTop: mt }]),\n applyTextColor([styles.textCenteredVariant], resolvedTextColor),\n leftText,\n rightText,\n noWrap\n ),\n detailed: () =>\n renderDetailed(\n styles,\n applyOverrides([styles.detailedContainer, { marginTop: mt }]),\n applyTextColor([styles.companyBold], resolvedTextColor),\n applyTextColor([styles.textLeft], resolvedTextColor),\n applyTextColor([styles.textRight], resolvedTextColor),\n applyTextColor([styles.detailedPageNumber], resolvedTextColor),\n leftText,\n rightText,\n address,\n phone,\n email,\n website,\n noWrap\n ),\n minimal: () =>\n renderMinimal(\n styles,\n applyOverrides([styles.minimalContainer, { marginTop: mt }]),\n applyTextColor([styles.textLeft], resolvedTextColor),\n applyTextColor([styles.textRight], resolvedTextColor),\n leftText,\n rightText,\n noWrap\n ),\n simple: () =>\n renderSimple(\n styles,\n applyOverrides([styles.simpleContainer, { marginTop: mt }]),\n applyTextColor(\n [styles.simpleTextLeft, { width: centerText ? 160 : 360 }],\n resolvedTextColor\n ),\n applyTextColor(\n [styles.simpleTextCenter, { width: 160 }],\n resolvedTextColor\n ),\n applyTextColor(\n [styles.simpleTextRight, { width: centerText ? 160 : 120 }],\n resolvedTextColor\n ),\n leftText,\n centerText,\n rightText,\n noWrap\n ),\n \"three-column\": () =>\n renderThreeColumn(\n styles,\n applyOverrides([styles.threeColumnContainer, { marginTop: mt }]),\n applyTextColor([styles.companyName], resolvedTextColor),\n applyTextColor([styles.contactInfoCenter], resolvedTextColor),\n applyTextColor([styles.textRight], resolvedTextColor),\n leftText,\n rightText,\n address,\n phone,\n email,\n website,\n noWrap\n ),\n };\n\n return wrapFixed(\n _isFixed,\n variantRenderers[variant]() as React.ReactElement,\n sticky ? Math.max(theme.spacing.page.marginBottom - pagePadding, 0) : 0\n );\n};\n",+ "content": "import type React from \"react\";\n\nimport {\n Fixed,\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/lib/theme-provider\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nconst wrapFixed = (\n fixed: boolean | undefined,\n node: React.ReactElement,\n footerOffset = 0\n) => {\n if (!fixed) {\n return node;\n }\n const nodeProps = node.props as {\n children?: React.ReactNode;\n style?: Style;\n };\n return (\n <Fixed\n position=\"footer\"\n style={[\n nodeProps.style,\n footerOffset ? { marginBottom: -footerOffset } : undefined,\n ]}\n >\n {nodeProps.children}\n </Fixed>\n );\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\nconst 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 simpleTextCenter: {\n ...textBase,\n textAlign: \"center\",\n },\n simpleTextLeft: {\n ...textBase,\n },\n simpleTextRight: {\n ...textBase,\n textAlign: \"right\",\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\ntype Styles = ReturnType<typeof createPageFooterStyles>;\n\nconst applyTextColor = (\n styles: Style[],\n color: string | undefined\n): Style[] => {\n if (!color) {\n return styles;\n }\n return [...styles, { color }];\n};\n\nconst renderBranded = (\n styles: Styles,\n containerStyles: Style[],\n leftStyle: Style[],\n rightStyle: Style[],\n leftText: string | undefined,\n rightText: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles as never}>\n {leftText && <PDFText style={leftStyle as never}>{leftText}</PDFText>}\n {rightText && <PDFText style={rightStyle as never}>{rightText}</PDFText>}\n </View>\n);\n\nconst renderCentered = (\n styles: Styles,\n containerStyles: Style[],\n textStyle: Style[],\n leftText: string | undefined,\n rightText: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles as never}>\n {leftText && <PDFText style={textStyle as never}>{leftText}</PDFText>}\n {rightText && <PDFText style={textStyle as never}>{rightText}</PDFText>}\n </View>\n);\n\nconst renderThreeColumn = (\n styles: Styles,\n containerStyles: Style[],\n leftStyle: Style[],\n centerStyle: Style[],\n rightStyle: Style[],\n leftText: string | undefined,\n rightText: string | undefined,\n address: string | undefined,\n phone: string | undefined,\n email: string | undefined,\n website: string | undefined,\n noWrap: boolean\n) => (\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\nconst renderDetailed = (\n styles: Styles,\n containerStyles: Style[],\n companyStyle: Style[],\n addrStyle: Style[],\n contactStyle: Style[],\n pageNumStyle: Style[],\n leftText: string | undefined,\n rightText: string | undefined,\n address: string | undefined,\n phone: string | undefined,\n email: string | undefined,\n website: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles as never}>\n <View style={styles.detailedTopRow}>\n <View style={styles.detailedLeft}>\n {leftText && (\n <PDFText style={companyStyle as never}>{leftText}</PDFText>\n )}\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\nconst renderMinimal = (\n styles: Styles,\n containerStyles: Style[],\n leftStyle: Style[],\n rightStyle: Style[],\n leftText: string | undefined,\n rightText: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles as never}>\n {leftText && <PDFText style={leftStyle as never}>{leftText}</PDFText>}\n {rightText && <PDFText style={rightStyle as never}>{rightText}</PDFText>}\n </View>\n);\n\nconst renderSimple = (\n styles: Styles,\n containerStyles: Style[],\n leftStyle: Style[],\n centerStyle: Style[],\n rightStyle: Style[],\n leftText: string | undefined,\n centerText: string | undefined,\n rightText: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles as never}>\n {leftText && <PDFText style={leftStyle as never}>{leftText}</PDFText>}\n {centerText && <PDFText style={centerStyle as never}>{centerText}</PDFText>}\n {rightText && <PDFText style={rightStyle as never}>{rightText}</PDFText>}\n </View>\n);\n\nexport const 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 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 = {};\n\n const applyOverrides = (base: Style[]): Style[] => {\n if (background) {\n base.push({ backgroundColor: resolveColor(background, theme.colors) });\n }\n if (style) {\n base.push(style);\n }\n if (sticky) {\n base.push(stickyStyle);\n }\n return base;\n };\n\n const variantRenderers: Record<PageFooterVariant, () => React.ReactNode> = {\n branded: () =>\n renderBranded(\n styles,\n applyOverrides([styles.brandedContainer, { marginTop: mt }]),\n applyTextColor([styles.textBranded], resolvedTextColor),\n applyTextColor([styles.textBrandedRight], resolvedTextColor),\n leftText,\n rightText,\n noWrap\n ),\n centered: () =>\n renderCentered(\n styles,\n applyOverrides([styles.centeredContainer, { marginTop: mt }]),\n applyTextColor([styles.textCenteredVariant], resolvedTextColor),\n leftText,\n rightText,\n noWrap\n ),\n detailed: () =>\n renderDetailed(\n styles,\n applyOverrides([styles.detailedContainer, { marginTop: mt }]),\n applyTextColor([styles.companyBold], resolvedTextColor),\n applyTextColor([styles.textLeft], resolvedTextColor),\n applyTextColor([styles.textRight], resolvedTextColor),\n applyTextColor([styles.detailedPageNumber], resolvedTextColor),\n leftText,\n rightText,\n address,\n phone,\n email,\n website,\n noWrap\n ),\n minimal: () =>\n renderMinimal(\n styles,\n applyOverrides([styles.minimalContainer, { marginTop: mt }]),\n applyTextColor([styles.textLeft], resolvedTextColor),\n applyTextColor([styles.textRight], resolvedTextColor),\n leftText,\n rightText,\n noWrap\n ),\n simple: () =>\n renderSimple(\n styles,\n applyOverrides([styles.simpleContainer, { marginTop: mt }]),\n applyTextColor(\n [styles.simpleTextLeft, { width: centerText ? 160 : 360 }],\n resolvedTextColor\n ),\n applyTextColor(\n [styles.simpleTextCenter, { width: 160 }],\n resolvedTextColor\n ),\n applyTextColor(\n [styles.simpleTextRight, { width: centerText ? 160 : 120 }],\n resolvedTextColor\n ),\n leftText,\n centerText,\n rightText,\n noWrap\n ),\n \"three-column\": () =>\n renderThreeColumn(\n styles,\n applyOverrides([styles.threeColumnContainer, { marginTop: mt }]),\n applyTextColor([styles.companyName], resolvedTextColor),\n applyTextColor([styles.contactInfoCenter], resolvedTextColor),\n applyTextColor([styles.textRight], resolvedTextColor),\n leftText,\n rightText,\n address,\n phone,\n email,\n website,\n noWrap\n ),\n };\n\n return wrapFixed(\n _isFixed,\n variantRenderers[variant]() as React.ReactElement,\n sticky ? Math.max(theme.spacing.page.marginBottom - pagePadding, 0) : 0\n );\n};\n","type": "registry:component","target": "components/pdf/components/page-footer/page-footer.tsx"},diff --git a/public/r/forme/page-header.json b/public/r/forme/page-header.jsonindex 98e7d6f..a71d62e 100644--- a/public/r/forme/page-header.json+++ b/public/r/forme/page-header.json@@ -13,7 +13,7 @@"files": [{"path": "registry/bases/forme/components/page-header/page-header.tsx",- "content": "import type React from \"react\";\nimport type { ReactNode } from \"react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n Fixed,\n Text as PDFText,\n StyleSheet,\n View,\n} from \"../../lib/forme-primitives\";\nimport type { Style } from \"../../lib/forme-primitives\";\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nconst wrapFixed = (fixed: boolean | undefined, node: React.ReactElement) => {\n if (!fixed) {\n return node;\n }\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\nconst 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 flexShrink: 0,\n height: 48,\n marginRight: spacing[4],\n width: 48,\n },\n\n logoContent: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n paddingLeft: spacing[4],\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 flexShrink: 0,\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\ntype Styles = ReturnType<typeof createPageHeaderStyles>;\n\nconst buildContainerStyles = (\n base: Style,\n mb: number,\n background: string | undefined,\n theme: PdfcnTheme,\n style: Style | undefined,\n ...extras: Style[]\n): Style[] => {\n const result: Style[] = [base, { marginBottom: mb }, ...extras];\n if (background) {\n result.push({ backgroundColor: resolveColor(background, theme.colors) });\n }\n if (style) {\n result.push(style);\n }\n return result;\n};\n\nconst buildTitleStyles = (\n base: Style[],\n titleColor: string | undefined,\n theme: PdfcnTheme\n): Style[] => {\n if (!titleColor) {\n return base;\n }\n return [...base, { color: resolveColor(titleColor, theme.colors) }];\n};\n\nconst renderBranded = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n noWrap: boolean\n) => (\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\nconst renderCentered = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n noWrap: boolean\n) => (\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\nconst renderLogoRight = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n logo: ReactNode | undefined,\n noWrap: boolean\n) => (\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\nconst renderLogoLeft = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n logo: ReactNode | undefined,\n rightText: string | undefined,\n rightSubText: string | undefined,\n noWrap: boolean\n) => (\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 && <PDFText style={styles.rightText}>{rightText}</PDFText>}\n {rightSubText && (\n <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>\n )}\n </View>\n )}\n </View>\n);\n\nconst renderTwoColumn = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n address: string | undefined,\n phone: string | undefined,\n email: string | undefined,\n noWrap: boolean\n) => (\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\nconst renderMinimal = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n rightText: string | undefined,\n rightSubText: string | undefined,\n noWrap: boolean\n) => (\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 && <PDFText style={styles.rightText}>{rightText}</PDFText>}\n {rightSubText && (\n <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>\n )}\n </View>\n )}\n </View>\n);\n\nconst renderSimple = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n rightText: string | undefined,\n rightSubText: string | undefined,\n noWrap: boolean\n) => (\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\nexport const 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 const variantRenderers: Record<PageHeaderVariant, () => React.ReactNode> = {\n branded: () =>\n renderBranded(\n styles,\n buildContainerStyles(\n styles.brandedContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles(\n [styles.title, styles.titleBranded, styles.titleCentered],\n titleColor,\n theme\n ),\n title,\n subtitle,\n noWrap\n ),\n centered: () =>\n renderCentered(\n styles,\n buildContainerStyles(\n styles.centeredContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles(\n [styles.title, styles.titleCentered],\n titleColor,\n theme\n ),\n title,\n subtitle,\n noWrap\n ),\n \"logo-left\": () =>\n renderLogoLeft(\n styles,\n buildContainerStyles(\n styles.logoLeftContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles([styles.title], titleColor, theme),\n title,\n subtitle,\n logo,\n rightText,\n rightSubText,\n noWrap\n ),\n \"logo-right\": () =>\n renderLogoRight(\n styles,\n buildContainerStyles(\n styles.logoRightContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles([styles.title], titleColor, theme),\n title,\n subtitle,\n logo,\n noWrap\n ),\n minimal: () =>\n renderMinimal(\n styles,\n buildContainerStyles(\n styles.minimalContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles(\n [styles.title, styles.titleMinimal],\n titleColor,\n theme\n ),\n title,\n subtitle,\n rightText,\n rightSubText,\n noWrap\n ),\n simple: () =>\n renderSimple(\n styles,\n buildContainerStyles(\n styles.simpleContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles([styles.title], titleColor, theme),\n title,\n subtitle,\n rightText,\n rightSubText,\n noWrap\n ),\n \"two-column\": () =>\n renderTwoColumn(\n styles,\n buildContainerStyles(\n styles.twoColumnContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles([styles.title], titleColor, theme),\n title,\n subtitle,\n address,\n phone,\n email,\n noWrap\n ),\n };\n\n return wrapFixed(fixed, variantRenderers[variant]() as React.ReactElement);\n};\n",+ "content": "import type React from \"react\";\nimport type { ReactNode } from \"react\";\n\nimport {\n Fixed,\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/lib/theme-provider\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nconst wrapFixed = (fixed: boolean | undefined, node: React.ReactElement) => {\n if (!fixed) {\n return node;\n }\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\nconst 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 flexShrink: 0,\n height: 48,\n marginRight: spacing[4],\n width: 48,\n },\n\n logoContent: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n paddingLeft: spacing[4],\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 flexShrink: 0,\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\ntype Styles = ReturnType<typeof createPageHeaderStyles>;\n\nconst buildContainerStyles = (\n base: Style,\n mb: number,\n background: string | undefined,\n theme: PdfcnTheme,\n style: Style | undefined,\n ...extras: Style[]\n): Style[] => {\n const result: Style[] = [base, { marginBottom: mb }, ...extras];\n if (background) {\n result.push({ backgroundColor: resolveColor(background, theme.colors) });\n }\n if (style) {\n result.push(style);\n }\n return result;\n};\n\nconst buildTitleStyles = (\n base: Style[],\n titleColor: string | undefined,\n theme: PdfcnTheme\n): Style[] => {\n if (!titleColor) {\n return base;\n }\n return [...base, { color: resolveColor(titleColor, theme.colors) }];\n};\n\nconst renderBranded = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n noWrap: boolean\n) => (\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\nconst renderCentered = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n noWrap: boolean\n) => (\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\nconst renderLogoRight = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n logo: ReactNode | undefined,\n noWrap: boolean\n) => (\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\nconst renderLogoLeft = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n logo: ReactNode | undefined,\n rightText: string | undefined,\n rightSubText: string | undefined,\n noWrap: boolean\n) => (\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 && <PDFText style={styles.rightText}>{rightText}</PDFText>}\n {rightSubText && (\n <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>\n )}\n </View>\n )}\n </View>\n);\n\nconst renderTwoColumn = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n address: string | undefined,\n phone: string | undefined,\n email: string | undefined,\n noWrap: boolean\n) => (\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\nconst renderMinimal = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n rightText: string | undefined,\n rightSubText: string | undefined,\n noWrap: boolean\n) => (\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 && <PDFText style={styles.rightText}>{rightText}</PDFText>}\n {rightSubText && (\n <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>\n )}\n </View>\n )}\n </View>\n);\n\nconst renderSimple = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n rightText: string | undefined,\n rightSubText: string | undefined,\n noWrap: boolean\n) => (\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\nexport const 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 const variantRenderers: Record<PageHeaderVariant, () => React.ReactNode> = {\n branded: () =>\n renderBranded(\n styles,\n buildContainerStyles(\n styles.brandedContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles(\n [styles.title, styles.titleBranded, styles.titleCentered],\n titleColor,\n theme\n ),\n title,\n subtitle,\n noWrap\n ),\n centered: () =>\n renderCentered(\n styles,\n buildContainerStyles(\n styles.centeredContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles(\n [styles.title, styles.titleCentered],\n titleColor,\n theme\n ),\n title,\n subtitle,\n noWrap\n ),\n \"logo-left\": () =>\n renderLogoLeft(\n styles,\n buildContainerStyles(\n styles.logoLeftContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles([styles.title], titleColor, theme),\n title,\n subtitle,\n logo,\n rightText,\n rightSubText,\n noWrap\n ),\n \"logo-right\": () =>\n renderLogoRight(\n styles,\n buildContainerStyles(\n styles.logoRightContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles([styles.title], titleColor, theme),\n title,\n subtitle,\n logo,\n noWrap\n ),\n minimal: () =>\n renderMinimal(\n styles,\n buildContainerStyles(\n styles.minimalContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles(\n [styles.title, styles.titleMinimal],\n titleColor,\n theme\n ),\n title,\n subtitle,\n rightText,\n rightSubText,\n noWrap\n ),\n simple: () =>\n renderSimple(\n styles,\n buildContainerStyles(\n styles.simpleContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles([styles.title], titleColor, theme),\n title,\n subtitle,\n rightText,\n rightSubText,\n noWrap\n ),\n \"two-column\": () =>\n renderTwoColumn(\n styles,\n buildContainerStyles(\n styles.twoColumnContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles([styles.title], titleColor, theme),\n title,\n subtitle,\n address,\n phone,\n email,\n noWrap\n ),\n };\n\n return wrapFixed(fixed, variantRenderers[variant]() as React.ReactElement);\n};\n","type": "registry:component","target": "components/pdf/components/page-header/page-header.tsx"},diff --git a/public/r/forme/page-number.json b/public/r/forme/page-number.jsonindex deebe6e..8a735dc 100644--- a/public/r/forme/page-number.json+++ b/public/r/forme/page-number.json@@ -13,7 +13,7 @@"files": [{"path": "registry/bases/forme/components/page-number/page-number.tsx",- "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { Text as PDFText, StyleSheet, View } from \"../../lib/forme-primitives\";\nimport type { Style } from \"../../lib/forme-primitives\";\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\nconst 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\nconst _formatPageNumber = (\n format: string,\n pageNumber: number,\n totalPages: number\n): string =>\n format\n .replace(\"{page}\", String(pageNumber))\n .replace(\"{total}\", String(totalPages));\n\nexport const PdfPageNumber = ({\n format = \"Page {page} of {total}\",\n align = \"center\",\n size = \"sm\",\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) {\n textStyles.push(...[style].flat());\n }\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",+ "content": "import {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/lib/theme-provider\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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\nconst 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\nconst _formatPageNumber = (\n format: string,\n pageNumber: number,\n totalPages: number\n): string =>\n format\n .replace(\"{page}\", String(pageNumber))\n .replace(\"{total}\", String(totalPages));\n\nexport const PdfPageNumber = ({\n format = \"Page {page} of {total}\",\n align = \"center\",\n size = \"sm\",\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) {\n textStyles.push(...[style].flat());\n }\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","target": "components/pdf/components/page-number/page-number.tsx"},diff --git a/public/r/forme/pdf-image.json b/public/r/forme/pdf-image.jsonindex c351752..6a7a582 100644--- a/public/r/forme/pdf-image.json+++ b/public/r/forme/pdf-image.json@@ -13,7 +13,7 @@"files": [{"path": "registry/bases/forme/components/pdf-image/pdf-image.tsx",- "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n Image,\n Text as PDFText,\n StyleSheet,\n View,\n} from \"../../lib/forme-primitives\";\nimport type { Style } from \"../../lib/forme-primitives\";\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\nconst detectFormat = (src: PdfImageSrc): string | null => {\n if (typeof src !== \"string\") {\n return null;\n }\n const dataMatch = src.match(/^data:image\\/([a-zA-Z0-9+.-]+)/);\n if (dataMatch) {\n return dataMatch[1].toLowerCase();\n }\n return src.split(\"?\")[0].split(\".\").pop()?.toLowerCase() ?? null;\n};\n\nconst 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\nconst 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 const 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) {\n return height;\n }\n if (defaults.height !== undefined) {\n return defaults.height;\n }\n if (aspectRatio !== undefined && typeof resolvedWidth === \"number\") {\n return resolvedWidth / aspectRatio;\n }\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 }\n if (resolvedHeight !== undefined) {\n imageStyles.push({ height: resolvedHeight } as Style);\n }\n imageStyles.push({\n objectFit: resolvedFit,\n objectPosition: position,\n } as Style);\n if (resolvedRadius !== undefined) {\n imageStyles.push({ borderRadius: resolvedRadius } as Style);\n }\n if (variant === \"bordered\") {\n imageStyles.push(styles.imageBordered);\n }\n if (style) {\n imageStyles.push(style);\n }\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",+ "content": "import {\n Image,\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/lib/theme-provider\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\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\nconst detectFormat = (src: PdfImageSrc): string | null => {\n if (typeof src !== \"string\") {\n return null;\n }\n const dataMatch = src.match(/^data:image\\/([a-zA-Z0-9+.-]+)/);\n if (dataMatch) {\n return dataMatch[1].toLowerCase();\n }\n return src.split(\"?\")[0].split(\".\").pop()?.toLowerCase() ?? null;\n};\n\nconst 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\nconst 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 const 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) {\n return height;\n }\n if (defaults.height !== undefined) {\n return defaults.height;\n }\n if (aspectRatio !== undefined && typeof resolvedWidth === \"number\") {\n return resolvedWidth / aspectRatio;\n }\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 }\n if (resolvedHeight !== undefined) {\n imageStyles.push({ height: resolvedHeight } as Style);\n }\n imageStyles.push({\n objectFit: resolvedFit,\n objectPosition: position,\n } as Style);\n if (resolvedRadius !== undefined) {\n imageStyles.push({ borderRadius: resolvedRadius } as Style);\n }\n if (variant === \"bordered\") {\n imageStyles.push(styles.imageBordered);\n }\n if (style) {\n imageStyles.push(style);\n }\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","target": "components/pdf/components/pdf-image/pdf-image.tsx"},diff --git a/public/r/forme/qrcode.json b/public/r/forme/qrcode.jsonindex 44e4bd2..cd89561 100644--- a/public/r/forme/qrcode.json+++ b/public/r/forme/qrcode.json@@ -14,7 +14,7 @@"files": [{"path": "registry/bases/forme/components/qrcode/qrcode.tsx",- "content": "import QRCode from \"qrcode\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { Text as PDFText, StyleSheet, View } from \"../../lib/forme-primitives\";\nimport type { Style } from \"../../lib/forme-primitives\";\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\nconst 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\nconst 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 += 1) {\n const rowData: boolean[] = [];\n for (let col = 0; col < totalSize; col += 1) {\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 const 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) {\n containerStyles.push(...[style].flat());\n }\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",+ "content": "import QRCode from \"qrcode\";\n\nimport {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport { Rect, Svg } from \"@/registry/bases/forme/lib/pdfcn-svg\";\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/lib/theme-provider\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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\nconst 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\nconst 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 += 1) {\n const rowData: boolean[] = [];\n for (let col = 0; col < totalSize; col += 1) {\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 const 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) {\n containerStyles.push(...[style].flat());\n }\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","target": "components/pdf/components/qrcode/qrcode.tsx"},diff --git a/public/r/forme/report-financial.json b/public/r/forme/report-financial.jsonindex fd38a3a..9e81e7a 100644--- a/public/r/forme/report-financial.json+++ b/public/r/forme/report-financial.json@@ -19,7 +19,7 @@},{"path": "registry/bases/forme/blocks/report-financial/report-layout.tsx",- "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n Badge,\n DataTable,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\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\nconst toneColor = (\n theme: PdfcnTheme,\n tone: \"success\" | \"warning\" | \"destructive\" | \"info\"\n) => {\n if (tone === \"success\") {\n return theme.colors.success;\n }\n if (tone === \"warning\") {\n return theme.colors.warning;\n }\n if (tone === \"destructive\") {\n return theme.colors.destructive;\n }\n return theme.colors.info;\n};\n\nexport const 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 const graphHeight: Record<ReportGraphVariant, number> = {\n area: 191,\n bar: 181,\n donut: 191,\n \"horizontal-bar\": 148,\n line: 191,\n pie: 191,\n };\n const deliveryOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 59,\n donut: -3,\n \"horizontal-bar\": -4,\n line: -30,\n pie: 0,\n };\n const sectionOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 32,\n donut: 0,\n \"horizontal-bar\": 0,\n line: 0,\n pie: 0,\n };\n const titleOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 0,\n donut: 0,\n \"horizontal-bar\": 0,\n line: 0,\n pie: 0,\n };\n\n const styles = StyleSheet.create({\n col: {\n width: 225,\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 alignItems: \"flex-start\",\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n height: 75,\n padding: 8,\n width: 225,\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: \"column\",\n gap: 8,\n },\n metricsRow: {\n flexDirection: \"row\",\n gap: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n },\n toolbar: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: 8,\n width: 499,\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\" margin={{ bottom: 48, left: 48, right: 48, top: 56 }}>\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 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 {[0, 2].map((startIndex) => (\n <View key={startIndex} style={styles.metricsRow}>\n {data.summary\n .slice(startIndex, startIndex + 2)\n .map((metric) => (\n <View\n key={metric.label}\n style={\n {\n ...styles.metricCard,\n borderLeftColor: metric.tone\n ? toneColor(theme, metric.tone)\n : accent,\n borderLeftWidth: 3,\n } as never\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 style={{\n height: 16,\n width: metric.trend.endsWith(\"QoQ\")\n ? metric.trend.length * 6.5 + 10\n : metric.trend.length * 5 + 18,\n }}\n />\n ) : null}\n </View>\n ))}\n </View>\n ))}\n </View>\n </Section>\n </View>\n </Page>\n\n <Page size=\"A4\" margin={{ bottom: 48, left: 48, right: 48, top: 56 }}>\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 style={styles.page as never}>\n <Section\n padding=\"md\"\n noWrap\n style={{\n position: \"relative\",\n top: sectionOffset[graphVariant],\n }}\n >\n <Text\n variant=\"sm\"\n transform=\"uppercase\"\n color=\"mutedForeground\"\n style={{\n position: \"relative\",\n top: titleOffset[graphVariant],\n }}\n >\n Performance Trend\n </Text>\n <View\n style={\n {\n ...styles.graphShell,\n paddingBottom: graphVariant === \"horizontal-bar\" ? 56 : 12,\n } as never\n }\n >\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={graphHeight[graphVariant]}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section\n padding=\"md\"\n style={{\n position: \"relative\",\n top: deliveryOffset[graphVariant],\n }}\n >\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 </View>\n </Page>\n\n <Page size=\"A4\" margin={{ bottom: 48, left: 48, right: 48, top: 56 }}>\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 style={styles.page as never}>\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: \"Avg 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 </Section>\n </View>\n </Page>\n </Document>\n );\n};\n\nexport const 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) {\n return null;\n }\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",+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport {\n Badge,\n DataTable,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Text,\n usePdfcnTheme,\n} from \"@/registry/bases/forme/components\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\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\nconst toneColor = (\n theme: PdfcnTheme,\n tone: \"success\" | \"warning\" | \"destructive\" | \"info\"\n) => {\n if (tone === \"success\") {\n return theme.colors.success;\n }\n if (tone === \"warning\") {\n return theme.colors.warning;\n }\n if (tone === \"destructive\") {\n return theme.colors.destructive;\n }\n return theme.colors.info;\n};\n\nexport const 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 const graphHeight: Record<ReportGraphVariant, number> = {\n area: 191,\n bar: 181,\n donut: 191,\n \"horizontal-bar\": 148,\n line: 191,\n pie: 191,\n };\n const deliveryOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 59,\n donut: -3,\n \"horizontal-bar\": -4,\n line: -30,\n pie: 0,\n };\n const sectionOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 32,\n donut: 0,\n \"horizontal-bar\": 0,\n line: 0,\n pie: 0,\n };\n const titleOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 0,\n donut: 0,\n \"horizontal-bar\": 0,\n line: 0,\n pie: 0,\n };\n\n const styles = StyleSheet.create({\n col: {\n width: 225,\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 alignItems: \"flex-start\",\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n height: 75,\n padding: 8,\n width: 225,\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: \"column\",\n gap: 8,\n },\n metricsRow: {\n flexDirection: \"row\",\n gap: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n },\n toolbar: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: 8,\n width: 499,\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\" margin={{ bottom: 48, left: 48, right: 48, top: 56 }}>\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with pdfcn\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\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 {[0, 2].map((startIndex) => (\n <View key={startIndex} style={styles.metricsRow}>\n {data.summary\n .slice(startIndex, startIndex + 2)\n .map((metric) => (\n <View\n key={metric.label}\n style={\n {\n ...styles.metricCard,\n borderLeftColor: metric.tone\n ? toneColor(theme, metric.tone)\n : accent,\n borderLeftWidth: 3,\n } as never\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 style={{\n height: 16,\n width: metric.trend.endsWith(\"QoQ\")\n ? metric.trend.length * 6.5 + 10\n : metric.trend.length * 5 + 18,\n }}\n />\n ) : null}\n </View>\n ))}\n </View>\n ))}\n </View>\n </Section>\n </View>\n </Page>\n\n <Page size=\"A4\" margin={{ bottom: 48, left: 48, right: 48, top: 56 }}>\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with pdfcn\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n <View style={styles.page as never}>\n <Section\n padding=\"md\"\n noWrap\n style={{\n position: \"relative\",\n top: sectionOffset[graphVariant],\n }}\n >\n <Text\n variant=\"sm\"\n transform=\"uppercase\"\n color=\"mutedForeground\"\n style={{\n position: \"relative\",\n top: titleOffset[graphVariant],\n }}\n >\n Performance Trend\n </Text>\n <View\n style={\n {\n ...styles.graphShell,\n paddingBottom: graphVariant === \"horizontal-bar\" ? 56 : 12,\n } as never\n }\n >\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={graphHeight[graphVariant]}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section\n padding=\"md\"\n style={{\n position: \"relative\",\n top: deliveryOffset[graphVariant],\n }}\n >\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 </View>\n </Page>\n\n <Page size=\"A4\" margin={{ bottom: 48, left: 48, right: 48, top: 56 }}>\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with pdfcn\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n <View style={styles.page as never}>\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: \"Avg 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 </Section>\n </View>\n </Page>\n </Document>\n );\n};\n\nexport const 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) {\n return null;\n }\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","target": "components/pdf/blocks/report-financial/report-layout.tsx"},diff --git a/public/r/forme/report-marketing.json b/public/r/forme/report-marketing.jsonindex af0056c..d89c1d1 100644--- a/public/r/forme/report-marketing.json+++ b/public/r/forme/report-marketing.json@@ -13,7 +13,7 @@"files": [{"path": "registry/bases/forme/blocks/report-marketing/report-layout.tsx",- "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n Badge,\n DataTable,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\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\nconst toneColor = (\n theme: PdfcnTheme,\n tone: \"success\" | \"warning\" | \"destructive\" | \"info\"\n) => {\n if (tone === \"success\") {\n return theme.colors.success;\n }\n if (tone === \"warning\") {\n return theme.colors.warning;\n }\n if (tone === \"destructive\") {\n return theme.colors.destructive;\n }\n return theme.colors.info;\n};\n\nexport const 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 const graphHeight: Record<ReportGraphVariant, number> = {\n area: 191,\n bar: 181,\n donut: 191,\n \"horizontal-bar\": 148,\n line: 191,\n pie: 191,\n };\n const deliveryOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 59,\n donut: -3,\n \"horizontal-bar\": -4,\n line: -30,\n pie: 0,\n };\n const sectionOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 32,\n donut: 0,\n \"horizontal-bar\": 0,\n line: 0,\n pie: 0,\n };\n const titleOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 0,\n donut: 0,\n \"horizontal-bar\": 0,\n line: 0,\n pie: 0,\n };\n\n const styles = StyleSheet.create({\n col: {\n width: 225,\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 alignItems: \"flex-start\",\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n height: 75,\n padding: 8,\n width: 225,\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: \"column\",\n gap: 8,\n },\n metricsRow: {\n flexDirection: \"row\",\n gap: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n },\n toolbar: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: 8,\n width: 499,\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\" margin={{ bottom: 48, left: 48, right: 48, top: 56 }}>\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 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 {[0, 2].map((startIndex) => (\n <View key={startIndex} style={styles.metricsRow}>\n {data.summary\n .slice(startIndex, startIndex + 2)\n .map((metric) => (\n <View\n key={metric.label}\n style={\n {\n ...styles.metricCard,\n borderLeftColor: metric.tone\n ? toneColor(theme, metric.tone)\n : accent,\n borderLeftWidth: 3,\n } as never\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 style={{\n height: 16,\n width: metric.trend.endsWith(\"QoQ\")\n ? metric.trend.length * 6.5 + 10\n : metric.trend.length * 5 + 18,\n }}\n />\n ) : null}\n </View>\n ))}\n </View>\n ))}\n </View>\n </Section>\n </View>\n </Page>\n\n <Page size=\"A4\" margin={{ bottom: 48, left: 48, right: 48, top: 56 }}>\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 style={styles.page as never}>\n <Section\n padding=\"md\"\n noWrap\n style={{\n position: \"relative\",\n top: sectionOffset[graphVariant],\n }}\n >\n <Text\n variant=\"sm\"\n transform=\"uppercase\"\n color=\"mutedForeground\"\n style={{\n position: \"relative\",\n top: titleOffset[graphVariant],\n }}\n >\n Performance Trend\n </Text>\n <View\n style={\n {\n ...styles.graphShell,\n paddingBottom: graphVariant === \"horizontal-bar\" ? 56 : 12,\n } as never\n }\n >\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={graphHeight[graphVariant]}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section\n padding=\"md\"\n style={{\n position: \"relative\",\n top: deliveryOffset[graphVariant],\n }}\n >\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 </View>\n </Page>\n\n <Page size=\"A4\" margin={{ bottom: 48, left: 48, right: 48, top: 56 }}>\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 style={styles.page as never}>\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: \"Avg 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 </Section>\n </View>\n </Page>\n </Document>\n );\n};\n\nexport const 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) {\n return null;\n }\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",+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport {\n Badge,\n DataTable,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Text,\n usePdfcnTheme,\n} from \"@/registry/bases/forme/components\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\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\nconst toneColor = (\n theme: PdfcnTheme,\n tone: \"success\" | \"warning\" | \"destructive\" | \"info\"\n) => {\n if (tone === \"success\") {\n return theme.colors.success;\n }\n if (tone === \"warning\") {\n return theme.colors.warning;\n }\n if (tone === \"destructive\") {\n return theme.colors.destructive;\n }\n return theme.colors.info;\n};\n\nexport const 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 const graphHeight: Record<ReportGraphVariant, number> = {\n area: 191,\n bar: 181,\n donut: 191,\n \"horizontal-bar\": 148,\n line: 191,\n pie: 191,\n };\n const deliveryOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 59,\n donut: -3,\n \"horizontal-bar\": -4,\n line: -30,\n pie: 0,\n };\n const sectionOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 32,\n donut: 0,\n \"horizontal-bar\": 0,\n line: 0,\n pie: 0,\n };\n const titleOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 0,\n donut: 0,\n \"horizontal-bar\": 0,\n line: 0,\n pie: 0,\n };\n\n const styles = StyleSheet.create({\n col: {\n width: 225,\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 alignItems: \"flex-start\",\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n height: 75,\n padding: 8,\n width: 225,\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: \"column\",\n gap: 8,\n },\n metricsRow: {\n flexDirection: \"row\",\n gap: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n },\n toolbar: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: 8,\n width: 499,\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\" margin={{ bottom: 48, left: 48, right: 48, top: 56 }}>\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with pdfcn\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\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 {[0, 2].map((startIndex) => (\n <View key={startIndex} style={styles.metricsRow}>\n {data.summary\n .slice(startIndex, startIndex + 2)\n .map((metric) => (\n <View\n key={metric.label}\n style={\n {\n ...styles.metricCard,\n borderLeftColor: metric.tone\n ? toneColor(theme, metric.tone)\n : accent,\n borderLeftWidth: 3,\n } as never\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 style={{\n height: 16,\n width: metric.trend.endsWith(\"QoQ\")\n ? metric.trend.length * 6.5 + 10\n : metric.trend.length * 5 + 18,\n }}\n />\n ) : null}\n </View>\n ))}\n </View>\n ))}\n </View>\n </Section>\n </View>\n </Page>\n\n <Page size=\"A4\" margin={{ bottom: 48, left: 48, right: 48, top: 56 }}>\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with pdfcn\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n <View style={styles.page as never}>\n <Section\n padding=\"md\"\n noWrap\n style={{\n position: \"relative\",\n top: sectionOffset[graphVariant],\n }}\n >\n <Text\n variant=\"sm\"\n transform=\"uppercase\"\n color=\"mutedForeground\"\n style={{\n position: \"relative\",\n top: titleOffset[graphVariant],\n }}\n >\n Performance Trend\n </Text>\n <View\n style={\n {\n ...styles.graphShell,\n paddingBottom: graphVariant === \"horizontal-bar\" ? 56 : 12,\n } as never\n }\n >\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={graphHeight[graphVariant]}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section\n padding=\"md\"\n style={{\n position: \"relative\",\n top: deliveryOffset[graphVariant],\n }}\n >\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 </View>\n </Page>\n\n <Page size=\"A4\" margin={{ bottom: 48, left: 48, right: 48, top: 56 }}>\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with pdfcn\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n <View style={styles.page as never}>\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: \"Avg 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 </Section>\n </View>\n </Page>\n </Document>\n );\n};\n\nexport const 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) {\n return null;\n }\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","target": "components/pdf/blocks/report-marketing/report-layout.tsx"},diff --git a/public/r/forme/report-operations.json b/public/r/forme/report-operations.jsonindex 9f9a338..7dc594a 100644--- a/public/r/forme/report-operations.json+++ b/public/r/forme/report-operations.json@@ -13,7 +13,7 @@"files": [{"path": "registry/bases/forme/blocks/report-operations/report-layout.tsx",- "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n Badge,\n DataTable,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\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\nconst toneColor = (\n theme: PdfcnTheme,\n tone: \"success\" | \"warning\" | \"destructive\" | \"info\"\n) => {\n if (tone === \"success\") {\n return theme.colors.success;\n }\n if (tone === \"warning\") {\n return theme.colors.warning;\n }\n if (tone === \"destructive\") {\n return theme.colors.destructive;\n }\n return theme.colors.info;\n};\n\nexport const 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 const graphHeight: Record<ReportGraphVariant, number> = {\n area: 191,\n bar: 181,\n donut: 191,\n \"horizontal-bar\": 148,\n line: 191,\n pie: 191,\n };\n const deliveryOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 59,\n donut: -3,\n \"horizontal-bar\": -4,\n line: -30,\n pie: 0,\n };\n const sectionOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 32,\n donut: 0,\n \"horizontal-bar\": 0,\n line: 0,\n pie: 0,\n };\n const titleOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 0,\n donut: 0,\n \"horizontal-bar\": 0,\n line: 0,\n pie: 0,\n };\n\n const styles = StyleSheet.create({\n col: {\n width: 225,\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 alignItems: \"flex-start\",\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n height: 75,\n padding: 8,\n width: 225,\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: \"column\",\n gap: 8,\n },\n metricsRow: {\n flexDirection: \"row\",\n gap: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n },\n toolbar: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: 8,\n width: 499,\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\" margin={{ bottom: 48, left: 48, right: 48, top: 56 }}>\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 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 {[0, 2].map((startIndex) => (\n <View key={startIndex} style={styles.metricsRow}>\n {data.summary\n .slice(startIndex, startIndex + 2)\n .map((metric) => (\n <View\n key={metric.label}\n style={\n {\n ...styles.metricCard,\n borderLeftColor: metric.tone\n ? toneColor(theme, metric.tone)\n : accent,\n borderLeftWidth: 3,\n } as never\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 style={{\n height: 16,\n width: metric.trend.endsWith(\"QoQ\")\n ? metric.trend.length * 6.5 + 10\n : metric.trend.length * 5 + 18,\n }}\n />\n ) : null}\n </View>\n ))}\n </View>\n ))}\n </View>\n </Section>\n </View>\n </Page>\n\n <Page size=\"A4\" margin={{ bottom: 48, left: 48, right: 48, top: 56 }}>\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 style={styles.page as never}>\n <Section\n padding=\"md\"\n noWrap\n style={{\n position: \"relative\",\n top: sectionOffset[graphVariant],\n }}\n >\n <Text\n variant=\"sm\"\n transform=\"uppercase\"\n color=\"mutedForeground\"\n style={{\n position: \"relative\",\n top: titleOffset[graphVariant],\n }}\n >\n Performance Trend\n </Text>\n <View\n style={\n {\n ...styles.graphShell,\n paddingBottom: graphVariant === \"horizontal-bar\" ? 56 : 12,\n } as never\n }\n >\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={graphHeight[graphVariant]}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section\n padding=\"md\"\n style={{\n position: \"relative\",\n top: deliveryOffset[graphVariant],\n }}\n >\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 </View>\n </Page>\n\n <Page size=\"A4\" margin={{ bottom: 48, left: 48, right: 48, top: 56 }}>\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 style={styles.page as never}>\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: \"Avg 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 </Section>\n </View>\n </Page>\n </Document>\n );\n};\n\nexport const 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) {\n return null;\n }\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",+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport {\n Badge,\n DataTable,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Text,\n usePdfcnTheme,\n} from \"@/registry/bases/forme/components\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\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\nconst toneColor = (\n theme: PdfcnTheme,\n tone: \"success\" | \"warning\" | \"destructive\" | \"info\"\n) => {\n if (tone === \"success\") {\n return theme.colors.success;\n }\n if (tone === \"warning\") {\n return theme.colors.warning;\n }\n if (tone === \"destructive\") {\n return theme.colors.destructive;\n }\n return theme.colors.info;\n};\n\nexport const 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 const graphHeight: Record<ReportGraphVariant, number> = {\n area: 191,\n bar: 181,\n donut: 191,\n \"horizontal-bar\": 148,\n line: 191,\n pie: 191,\n };\n const deliveryOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 59,\n donut: -3,\n \"horizontal-bar\": -4,\n line: -30,\n pie: 0,\n };\n const sectionOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 32,\n donut: 0,\n \"horizontal-bar\": 0,\n line: 0,\n pie: 0,\n };\n const titleOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 0,\n donut: 0,\n \"horizontal-bar\": 0,\n line: 0,\n pie: 0,\n };\n\n const styles = StyleSheet.create({\n col: {\n width: 225,\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 alignItems: \"flex-start\",\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n height: 75,\n padding: 8,\n width: 225,\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: \"column\",\n gap: 8,\n },\n metricsRow: {\n flexDirection: \"row\",\n gap: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n },\n toolbar: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: 8,\n width: 499,\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\" margin={{ bottom: 48, left: 48, right: 48, top: 56 }}>\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with pdfcn\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\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 {[0, 2].map((startIndex) => (\n <View key={startIndex} style={styles.metricsRow}>\n {data.summary\n .slice(startIndex, startIndex + 2)\n .map((metric) => (\n <View\n key={metric.label}\n style={\n {\n ...styles.metricCard,\n borderLeftColor: metric.tone\n ? toneColor(theme, metric.tone)\n : accent,\n borderLeftWidth: 3,\n } as never\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 style={{\n height: 16,\n width: metric.trend.endsWith(\"QoQ\")\n ? metric.trend.length * 6.5 + 10\n : metric.trend.length * 5 + 18,\n }}\n />\n ) : null}\n </View>\n ))}\n </View>\n ))}\n </View>\n </Section>\n </View>\n </Page>\n\n <Page size=\"A4\" margin={{ bottom: 48, left: 48, right: 48, top: 56 }}>\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with pdfcn\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n <View style={styles.page as never}>\n <Section\n padding=\"md\"\n noWrap\n style={{\n position: \"relative\",\n top: sectionOffset[graphVariant],\n }}\n >\n <Text\n variant=\"sm\"\n transform=\"uppercase\"\n color=\"mutedForeground\"\n style={{\n position: \"relative\",\n top: titleOffset[graphVariant],\n }}\n >\n Performance Trend\n </Text>\n <View\n style={\n {\n ...styles.graphShell,\n paddingBottom: graphVariant === \"horizontal-bar\" ? 56 : 12,\n } as never\n }\n >\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={graphHeight[graphVariant]}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section\n padding=\"md\"\n style={{\n position: \"relative\",\n top: deliveryOffset[graphVariant],\n }}\n >\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 </View>\n </Page>\n\n <Page size=\"A4\" margin={{ bottom: 48, left: 48, right: 48, top: 56 }}>\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with pdfcn\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n <View style={styles.page as never}>\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: \"Avg 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 </Section>\n </View>\n </Page>\n </Document>\n );\n};\n\nexport const 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) {\n return null;\n }\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","target": "components/pdf/blocks/report-operations/report-layout.tsx"},diff --git a/public/r/forme/report-security.json b/public/r/forme/report-security.jsonindex 25bb287..9f79577 100644--- a/public/r/forme/report-security.json+++ b/public/r/forme/report-security.json@@ -13,7 +13,7 @@"files": [{"path": "registry/bases/forme/blocks/report-security/report-layout.tsx",- "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n Badge,\n DataTable,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\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\nconst toneColor = (\n theme: PdfcnTheme,\n tone: \"success\" | \"warning\" | \"destructive\" | \"info\"\n) => {\n if (tone === \"success\") {\n return theme.colors.success;\n }\n if (tone === \"warning\") {\n return theme.colors.warning;\n }\n if (tone === \"destructive\") {\n return theme.colors.destructive;\n }\n return theme.colors.info;\n};\n\nexport const 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 const graphHeight: Record<ReportGraphVariant, number> = {\n area: 191,\n bar: 181,\n donut: 191,\n \"horizontal-bar\": 148,\n line: 191,\n pie: 191,\n };\n const deliveryOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 59,\n donut: -3,\n \"horizontal-bar\": -4,\n line: -30,\n pie: 0,\n };\n const sectionOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 32,\n donut: 0,\n \"horizontal-bar\": 0,\n line: 0,\n pie: 0,\n };\n const titleOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 0,\n donut: 0,\n \"horizontal-bar\": 0,\n line: 0,\n pie: 0,\n };\n\n const styles = StyleSheet.create({\n col: {\n width: 225,\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 alignItems: \"flex-start\",\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n height: 75,\n padding: 8,\n width: 225,\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: \"column\",\n gap: 8,\n },\n metricsRow: {\n flexDirection: \"row\",\n gap: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n },\n toolbar: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: 8,\n width: 499,\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\" margin={{ bottom: 48, left: 48, right: 48, top: 56 }}>\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 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 {[0, 2].map((startIndex) => (\n <View key={startIndex} style={styles.metricsRow}>\n {data.summary\n .slice(startIndex, startIndex + 2)\n .map((metric) => (\n <View\n key={metric.label}\n style={\n {\n ...styles.metricCard,\n borderLeftColor: metric.tone\n ? toneColor(theme, metric.tone)\n : accent,\n borderLeftWidth: 3,\n } as never\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 style={{\n height: 16,\n width: metric.trend.endsWith(\"QoQ\")\n ? metric.trend.length * 6.5 + 10\n : metric.trend.length * 5 + 18,\n }}\n />\n ) : null}\n </View>\n ))}\n </View>\n ))}\n </View>\n </Section>\n </View>\n </Page>\n\n <Page size=\"A4\" margin={{ bottom: 48, left: 48, right: 48, top: 56 }}>\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 style={styles.page as never}>\n <Section\n padding=\"md\"\n noWrap\n style={{\n position: \"relative\",\n top: sectionOffset[graphVariant],\n }}\n >\n <Text\n variant=\"sm\"\n transform=\"uppercase\"\n color=\"mutedForeground\"\n style={{\n position: \"relative\",\n top: titleOffset[graphVariant],\n }}\n >\n Performance Trend\n </Text>\n <View\n style={\n {\n ...styles.graphShell,\n paddingBottom: graphVariant === \"horizontal-bar\" ? 56 : 12,\n } as never\n }\n >\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={graphHeight[graphVariant]}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section\n padding=\"md\"\n style={{\n position: \"relative\",\n top: deliveryOffset[graphVariant],\n }}\n >\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 </View>\n </Page>\n\n <Page size=\"A4\" margin={{ bottom: 48, left: 48, right: 48, top: 56 }}>\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 style={styles.page as never}>\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: \"Avg 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 </Section>\n </View>\n </Page>\n </Document>\n );\n};\n\nexport const 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) {\n return null;\n }\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",+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport {\n Badge,\n DataTable,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Text,\n usePdfcnTheme,\n} from \"@/registry/bases/forme/components\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\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\nconst toneColor = (\n theme: PdfcnTheme,\n tone: \"success\" | \"warning\" | \"destructive\" | \"info\"\n) => {\n if (tone === \"success\") {\n return theme.colors.success;\n }\n if (tone === \"warning\") {\n return theme.colors.warning;\n }\n if (tone === \"destructive\") {\n return theme.colors.destructive;\n }\n return theme.colors.info;\n};\n\nexport const 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 const graphHeight: Record<ReportGraphVariant, number> = {\n area: 191,\n bar: 181,\n donut: 191,\n \"horizontal-bar\": 148,\n line: 191,\n pie: 191,\n };\n const deliveryOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 59,\n donut: -3,\n \"horizontal-bar\": -4,\n line: -30,\n pie: 0,\n };\n const sectionOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 32,\n donut: 0,\n \"horizontal-bar\": 0,\n line: 0,\n pie: 0,\n };\n const titleOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 0,\n donut: 0,\n \"horizontal-bar\": 0,\n line: 0,\n pie: 0,\n };\n\n const styles = StyleSheet.create({\n col: {\n width: 225,\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 alignItems: \"flex-start\",\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n height: 75,\n padding: 8,\n width: 225,\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: \"column\",\n gap: 8,\n },\n metricsRow: {\n flexDirection: \"row\",\n gap: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n },\n toolbar: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: 8,\n width: 499,\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\" margin={{ bottom: 48, left: 48, right: 48, top: 56 }}>\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with pdfcn\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\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 {[0, 2].map((startIndex) => (\n <View key={startIndex} style={styles.metricsRow}>\n {data.summary\n .slice(startIndex, startIndex + 2)\n .map((metric) => (\n <View\n key={metric.label}\n style={\n {\n ...styles.metricCard,\n borderLeftColor: metric.tone\n ? toneColor(theme, metric.tone)\n : accent,\n borderLeftWidth: 3,\n } as never\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 style={{\n height: 16,\n width: metric.trend.endsWith(\"QoQ\")\n ? metric.trend.length * 6.5 + 10\n : metric.trend.length * 5 + 18,\n }}\n />\n ) : null}\n </View>\n ))}\n </View>\n ))}\n </View>\n </Section>\n </View>\n </Page>\n\n <Page size=\"A4\" margin={{ bottom: 48, left: 48, right: 48, top: 56 }}>\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with pdfcn\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n <View style={styles.page as never}>\n <Section\n padding=\"md\"\n noWrap\n style={{\n position: \"relative\",\n top: sectionOffset[graphVariant],\n }}\n >\n <Text\n variant=\"sm\"\n transform=\"uppercase\"\n color=\"mutedForeground\"\n style={{\n position: \"relative\",\n top: titleOffset[graphVariant],\n }}\n >\n Performance Trend\n </Text>\n <View\n style={\n {\n ...styles.graphShell,\n paddingBottom: graphVariant === \"horizontal-bar\" ? 56 : 12,\n } as never\n }\n >\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={graphHeight[graphVariant]}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section\n padding=\"md\"\n style={{\n position: \"relative\",\n top: deliveryOffset[graphVariant],\n }}\n >\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 </View>\n </Page>\n\n <Page size=\"A4\" margin={{ bottom: 48, left: 48, right: 48, top: 56 }}>\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with pdfcn\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n <View style={styles.page as never}>\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: \"Avg 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 </Section>\n </View>\n </Page>\n </Document>\n );\n};\n\nexport const 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) {\n return null;\n }\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","target": "components/pdf/blocks/report-security/report-layout.tsx"},diff --git a/public/r/forme/section.json b/public/r/forme/section.jsonindex 3d87613..5bb955d 100644--- a/public/r/forme/section.json+++ b/public/r/forme/section.json@@ -13,7 +13,7 @@"files": [{"path": "registry/bases/forme/components/section/section.tsx",- "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { StyleSheet, View } from \"../../lib/forme-primitives\";\nimport type { Style } from \"../../lib/forme-primitives\";\nimport {\n mergePdfStyles,\n usePdfcnTheme,\n useSafeMemo,\n} 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\nconst 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 const 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) {\n styleArray.push(variantStyle);\n }\n if (accentColor && (variant === \"callout\" || variant === \"highlight\")) {\n styleArray.push({\n borderLeftColor: resolveColor(accentColor, theme.colors),\n });\n }\n if (padding && padding in paddingMap) {\n styleArray.push(paddingMap[padding]);\n }\n if (border && variant === \"default\") {\n styleArray.push(styles.border);\n }\n if (background) {\n styleArray.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return (\n <View wrap={noWrap ? false : undefined} style={mergePdfStyles(styleArray)}>\n {children}\n </View>\n );\n};\n",+ "content": "import { StyleSheet, View } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport {\n mergePdfStyles,\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/lib/theme-provider\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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\nconst 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 const 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) {\n styleArray.push(variantStyle);\n }\n if (accentColor && (variant === \"callout\" || variant === \"highlight\")) {\n styleArray.push({\n borderLeftColor: resolveColor(accentColor, theme.colors),\n });\n }\n if (padding && padding in paddingMap) {\n styleArray.push(paddingMap[padding]);\n }\n if (border && variant === \"default\") {\n styleArray.push(styles.border);\n }\n if (background) {\n styleArray.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return (\n <View wrap={noWrap ? false : undefined} style={mergePdfStyles(styleArray)}>\n {children}\n </View>\n );\n};\n","type": "registry:component","target": "components/pdf/components/section/section.tsx"},diff --git a/public/r/forme/signature.json b/public/r/forme/signature.jsonindex 01d700d..98c9fe4 100644--- a/public/r/forme/signature.json+++ b/public/r/forme/signature.json@@ -13,7 +13,7 @@"files": [{"path": "registry/bases/forme/components/signature/signature.tsx",- "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { Text as PDFText, StyleSheet, View } from \"../../lib/forme-primitives\";\nimport type { Style } from \"../../lib/forme-primitives\";\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\nconst 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\nconst renderSignerBlock = (\n signer: SignatureSigner,\n styles: ReturnType<typeof createSignatureStyles>\n) => (\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 ? <PDFText style={styles.name}>{signer.name}</PDFText> : 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\nexport const 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) {\n containerStyles.push(style);\n }\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",+ "content": "import {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/lib/theme-provider\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\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\nconst 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\nconst renderSignerBlock = (\n signer: SignatureSigner,\n styles: ReturnType<typeof createSignatureStyles>\n) => (\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 ? <PDFText style={styles.name}>{signer.name}</PDFText> : 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\nexport const 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) {\n containerStyles.push(style);\n }\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","target": "components/pdf/components/signature/signature.tsx"},diff --git a/public/r/forme/stack.json b/public/r/forme/stack.jsonindex 49e5623..570bdae 100644--- a/public/r/forme/stack.json+++ b/public/r/forme/stack.json@@ -13,7 +13,7 @@"files": [{"path": "registry/bases/forme/components/stack/stack.tsx",- "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { StyleSheet, View } from \"../../lib/forme-primitives\";\nimport type { Style } from \"../../lib/forme-primitives\";\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\nconst 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 const 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) {\n styleArray.push(alignMap[align]);\n }\n if (justify && justify in justifyMap) {\n styleArray.push(justifyMap[justify]);\n }\n if (wrap) {\n styleArray.push(styles.wrap);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return (\n <View wrap={noWrap ? false : undefined} style={styleArray as never}>\n {children}\n </View>\n );\n};\n",+ "content": "import { StyleSheet, View } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/lib/theme-provider\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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\nconst 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 const 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) {\n styleArray.push(alignMap[align]);\n }\n if (justify && justify in justifyMap) {\n styleArray.push(justifyMap[justify]);\n }\n if (wrap) {\n styleArray.push(styles.wrap);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return (\n <View wrap={noWrap ? false : undefined} style={styleArray as never}>\n {children}\n </View>\n );\n};\n","type": "registry:component","target": "components/pdf/components/stack/stack.tsx"},diff --git a/public/r/forme/table.json b/public/r/forme/table.jsonindex ca0e32a..e009181 100644--- a/public/r/forme/table.json+++ b/public/r/forme/table.json@@ -19,7 +19,7 @@},{"path": "registry/bases/forme/components/table/table.tsx",- "content": "import { Children, cloneElement, isValidElement } from \"react\";\nimport type { ReactElement, ReactNode } from \"react\";\n\nimport { Text as PDFText, View } from \"../../lib/forme-primitives\";\nimport type { Style } from \"../../lib/forme-primitives\";\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\nexport const TableHeader = ({ children, style }: TableSectionProps) => (\n <View style={style}>{children}</View>\n);\n\nexport const TableBody = ({ children, style }: TableSectionProps) => (\n <View style={style}>{children}</View>\n);\n\nexport const TableFooter = ({ children, style }: TableSectionProps) => (\n <View style={style}>{children}</View>\n);\n\nexport const 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.cell]\n : [styles.cellFixed, { width } as Style];\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) {\n cellStyles.push(cellVariantStyle);\n }\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\nexport const 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[] = [\n styles.row,\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\") {\n rowStyles.push(styles.rowFooterStriped);\n } else {\n rowStyles.push(styles.rowFooter);\n }\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\nconst 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)) {\n return child;\n }\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 += 1;\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 const 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",+ "content": "import { Children, cloneElement, isValidElement } from \"react\";\nimport type { ReactElement, ReactNode } from \"react\";\n\nimport {\n Text as PDFText,\n View,\n} from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/lib/theme-provider\";\n\nimport { createTableStyles } from \"./table.styles\";\nimport type {\n TableCellProps,\n TableProps,\n TableRowProps,\n TableSectionProps,\n TableVariant,\n} from \"./table.types\";\n\nexport const TableHeader = ({ children, style }: TableSectionProps) => (\n <View style={style}>{children}</View>\n);\n\nexport const TableBody = ({ children, style }: TableSectionProps) => (\n <View style={style}>{children}</View>\n);\n\nexport const TableFooter = ({ children, style }: TableSectionProps) => (\n <View style={style}>{children}</View>\n);\n\nexport const 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.cell]\n : [styles.cellFixed, { width } as Style];\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) {\n cellStyles.push(cellVariantStyle);\n }\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\nexport const 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[] = [\n styles.row,\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\") {\n rowStyles.push(styles.rowFooterStriped);\n } else {\n rowStyles.push(styles.rowFooter);\n }\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\nconst 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)) {\n return child;\n }\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 += 1;\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 const 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","type": "registry:component","target": "components/pdf/components/table/table.tsx"},diff --git a/public/r/forme/text.json b/public/r/forme/text.jsonindex 57726e3..ffb35ad 100644--- a/public/r/forme/text.json+++ b/public/r/forme/text.json@@ -13,7 +13,7 @@"files": [{"path": "registry/bases/forme/components/text/text.tsx",- "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { Text as PDFText, StyleSheet } from \"../../lib/forme-primitives\";\nimport type { Style } from \"../../lib/forme-primitives\";\nimport {\n mergePdfStyles,\n usePdfcnTheme,\n useSafeMemo,\n} 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\nconst 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 const 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) {\n styleArray.push(weightMap[weight]);\n }\n if (italic) {\n styleArray.push(styles.italic);\n }\n if (decoration && decoration in decorationMap) {\n styleArray.push(decorationMap[decoration]);\n }\n if (transform && transform in transformMap) {\n styleArray.push(transformMap[transform]);\n }\n if (noMargin) {\n styleArray.push(styles.noMargin);\n }\n const semantic = {} as Style;\n if (align) {\n semantic.textAlign = align;\n }\n if (color) {\n semantic.color = resolveColor(color, theme.colors);\n }\n if (Object.keys(semantic).length > 0) {\n styleArray.push(semantic);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return <PDFText style={mergePdfStyles(styleArray)}>{children}</PDFText>;\n};\n",+ "content": "import {\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport {\n mergePdfStyles,\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/lib/theme-provider\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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\nconst 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 const 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) {\n styleArray.push(weightMap[weight]);\n }\n if (italic) {\n styleArray.push(styles.italic);\n }\n if (decoration && decoration in decorationMap) {\n styleArray.push(decorationMap[decoration]);\n }\n if (transform && transform in transformMap) {\n styleArray.push(transformMap[transform]);\n }\n if (noMargin) {\n styleArray.push(styles.noMargin);\n }\n const semantic = {} as Style;\n if (align) {\n semantic.textAlign = align;\n }\n if (color) {\n semantic.color = resolveColor(color, theme.colors);\n }\n if (Object.keys(semantic).length > 0) {\n styleArray.push(semantic);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return <PDFText style={mergePdfStyles(styleArray)}>{children}</PDFText>;\n};\n","type": "registry:component","target": "components/pdf/components/text/text.tsx"},diff --git a/public/r/forme/theme-blueprint.json b/public/r/forme/theme-blueprint.jsonindex f364150..41a5e68 100644--- a/public/r/forme/theme-blueprint.json+++ b/public/r/forme/theme-blueprint.json@@ -22,7 +22,7 @@},{"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",+ "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/pdfcn-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"},diff --git a/public/r/forme/theme-corporate.json b/public/r/forme/theme-corporate.jsonindex 3faf1e9..77f6cfa 100644--- a/public/r/forme/theme-corporate.json+++ b/public/r/forme/theme-corporate.json@@ -22,7 +22,7 @@},{"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",+ "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/pdfcn-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"},diff --git a/public/r/forme/theme-elegant.json b/public/r/forme/theme-elegant.jsonindex 1eec75c..806d103 100644--- a/public/r/forme/theme-elegant.json+++ b/public/r/forme/theme-elegant.json@@ -22,7 +22,7 @@},{"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",+ "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/pdfcn-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"},diff --git a/public/r/forme/theme-executive.json b/public/r/forme/theme-executive.jsonindex 468541e..7022335 100644--- a/public/r/forme/theme-executive.json+++ b/public/r/forme/theme-executive.json@@ -22,7 +22,7 @@},{"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",+ "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/pdfcn-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"},diff --git a/public/r/forme/theme-forest.json b/public/r/forme/theme-forest.jsonindex 28dfaec..724291c 100644--- a/public/r/forme/theme-forest.json+++ b/public/r/forme/theme-forest.json@@ -22,7 +22,7 @@},{"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",+ "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/pdfcn-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"},diff --git a/public/r/forme/theme-minimal.json b/public/r/forme/theme-minimal.jsonindex b735d67..3e3ccbf 100644--- a/public/r/forme/theme-minimal.json+++ b/public/r/forme/theme-minimal.json@@ -22,7 +22,7 @@},{"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",+ "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/pdfcn-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"},diff --git a/public/r/forme/theme-modern.json b/public/r/forme/theme-modern.jsonindex 53a311a..1f59934 100644--- a/public/r/forme/theme-modern.json+++ b/public/r/forme/theme-modern.json@@ -22,7 +22,7 @@},{"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",+ "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/pdfcn-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"},diff --git a/public/r/forme/theme-professional.json b/public/r/forme/theme-professional.jsonindex 1c924e7..c7bc15a 100644--- a/public/r/forme/theme-professional.json+++ b/public/r/forme/theme-professional.json@@ -22,7 +22,7 @@},{"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",+ "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/pdfcn-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"},diff --git a/public/r/forme/theme-vivid.json b/public/r/forme/theme-vivid.jsonindex 2698a52..b64b9ba 100644--- a/public/r/forme/theme-vivid.json+++ b/public/r/forme/theme-vivid.json@@ -22,7 +22,7 @@},{"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",+ "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/pdfcn-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"},diff --git a/public/r/forme/utils.json b/public/r/forme/utils.jsonindex 217d4e6..c45dff6 100644--- a/public/r/forme/utils.json+++ b/public/r/forme/utils.json@@ -14,33 +14,15 @@"type": "registry:lib","target": "components/pdf/lib/pdfcn-theme.ts"},- {- "path": "registry/bases/forme/lib/pdfcn-theme-context.tsx",- "content": "/* eslint-disable react-refresh/only-export-components */\n// Exports both a component (PdfcnThemeProvider) and theme helpers intentionally.\n// All PDF components import from a single file — splitting would break the public API.\n\nimport type { Style } from \"@formepdf/react\";\nimport { isValidElement } from \"react\";\nimport type { DependencyList, ReactNode } from \"react\";\n\nimport { theme as defaultTheme } from \"./pdfcn-theme\";\n\nexport type PdfcnTheme = typeof defaultTheme;\n\nlet serializedTheme = defaultTheme;\n\nexport interface PdfcnThemeProviderProps {\n theme?: PdfcnTheme;\n children: ReactNode;\n}\n\ntype PdfStyleInput = Style | PdfStyleInput[] | false | null | undefined;\n\nconst mergeStyleInput = (target: Style, input: PdfStyleInput): void => {\n if (Array.isArray(input)) {\n for (const item of input) {\n mergeStyleInput(target, item);\n }\n } else if (input) {\n Object.assign(target, input);\n }\n};\n\n/** Flattens React-PDF-style arrays into the object Forme serializes. */\nexport const mergePdfStyles = (...inputs: PdfStyleInput[]): Style => {\n const merged: Style = {};\n for (const input of inputs) {\n mergeStyleInput(merged, input);\n }\n return merged;\n};\n\n/**\n * Forme serializes function components directly instead of mounting a React\n * tree. Resolve the provider's child so <Document> remains the top-level node.\n */\nconst renderForSerializer = (\n children: ReactNode,\n theme: PdfcnTheme\n): ReactNode => {\n serializedTheme = theme;\n\n if (!isValidElement(children) || typeof children.type !== \"function\") {\n return children;\n }\n if ((children.type as { __formeType?: string }).__formeType === \"Document\") {\n return children;\n }\n\n return (children.type as (props: unknown) => ReactNode)(children.props);\n};\n\nexport const PdfcnThemeProvider = ({\n theme,\n children,\n}: PdfcnThemeProviderProps) =>\n renderForSerializer(children, theme ?? defaultTheme);\n\n/** Returns the theme selected by the nearest serialized provider. */\nexport const usePdfcnTheme = (): PdfcnTheme => serializedTheme;\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 const useSafeMemo = <T,>(factory: () => T, _deps: DependencyList): T =>\n factory();\n",- "type": "registry:lib",- "target": "components/pdf/lib/pdfcn-theme-context.tsx"- },{"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 const 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","target": "components/pdf/lib/resolve-color.ts"},- {- "path": "registry/bases/forme/lib/forme-primitives.tsx",- "content": "import {\n Fixed as FormeFixed,\n Image as FormeImage,\n Link as FormeLink,\n StyleSheet,\n Text as FormeText,\n View as FormeView,\n} from \"@formepdf/react\";\nimport type {\n FixedProps,\n ImageProps,\n LinkProps,\n Style,\n TextProps,\n ViewProps,\n} from \"@formepdf/react\";\n\nexport type FormeStyleInput =\n | Style\n | false\n | null\n | undefined\n | readonly FormeStyleInput[];\n\nexport const mergeFormeStyles = (input: FormeStyleInput): Style | undefined => {\n if (!input) {\n return undefined;\n }\n\n if (!Array.isArray(input)) {\n return input as Style;\n }\n\n const merged: Style = {};\n for (const entry of input) {\n const resolved = mergeFormeStyles(entry);\n if (resolved) {\n Object.assign(merged, resolved);\n }\n }\n\n return Object.keys(merged).length > 0 ? merged : undefined;\n};\n\ntype WithStyle<T> = Omit<T, \"style\"> & { style?: FormeStyleInput };\n\nexport const View = ({ style, ...props }: WithStyle<ViewProps>) => (\n <FormeView {...props} style={mergeFormeStyles(style)} />\n);\n\nexport const Text = ({ style, ...props }: WithStyle<TextProps>) => (\n <FormeText {...props} style={mergeFormeStyles(style)} />\n);\n\nexport const Link = ({ style, ...props }: WithStyle<LinkProps>) => (\n <FormeLink {...props} style={mergeFormeStyles(style)} />\n);\n\nexport const Image = ({ style, ...props }: WithStyle<ImageProps>) => (\n <FormeImage {...props} style={mergeFormeStyles(style)} />\n);\n\nexport const Fixed = ({ style, ...props }: WithStyle<FixedProps>) => (\n <FormeFixed {...props} style={mergeFormeStyles(style)} />\n);\n\nexport { StyleSheet };\nexport type { Style };\n",- "type": "registry:lib",- "target": "components/pdf/lib/forme-primitives.tsx"- },- {- "path": "registry/bases/forme/lib/forme-svg.tsx",- "content": "import { Svg as FormeSvg } from \"@formepdf/react\";\nimport {\n Children,\n Fragment,\n cloneElement,\n createElement,\n isValidElement,\n} from \"react\";\nimport type { ReactNode, CSSProperties } from \"react\";\n\ntype AnyProps = Record<string, unknown> & {\n children?: ReactNode;\n style?: CSSProperties;\n};\n\nconst SVG_ATTRIBUTE_NAMES: Record<string, string> = {\n className: \"class\",\n dominantBaseline: \"dominant-baseline\",\n fillOpacity: \"fill-opacity\",\n fontFamily: \"font-family\",\n fontSize: \"font-size\",\n fontStyle: \"font-style\",\n fontWeight: \"font-weight\",\n strokeDasharray: \"stroke-dasharray\",\n strokeLinecap: \"stroke-linecap\",\n strokeLinejoin: \"stroke-linejoin\",\n strokeOpacity: \"stroke-opacity\",\n strokeWidth: \"stroke-width\",\n textAnchor: \"text-anchor\",\n};\n\nconst normalizeSvgProps = (props: AnyProps): AnyProps => {\n const normalized: AnyProps = {};\n\n for (const [name, value] of Object.entries(props)) {\n if (value === undefined) {\n continue;\n }\n\n if (name === \"style\" && value && typeof value === \"object\") {\n for (const [styleName, styleValue] of Object.entries(value)) {\n normalized[SVG_ATTRIBUTE_NAMES[styleName] ?? styleName] = styleValue;\n }\n continue;\n }\n\n normalized[SVG_ATTRIBUTE_NAMES[name] ?? name] = value;\n }\n\n return normalized;\n};\n\nconst resolveSvgChildren = (children: ReactNode): ReactNode =>\n Children.map(children, (child) => {\n if (!isValidElement<AnyProps>(child)) {\n return child;\n }\n\n if (typeof child.type === \"function\") {\n const resolved = (child.type as (props: AnyProps) => ReactNode)(\n child.props\n );\n return resolveSvgChildren(resolved);\n }\n\n if ((child.type as unknown) === Fragment) {\n return resolveSvgChildren(child.props.children);\n }\n\n if (child.props.children === undefined) {\n return child;\n }\n\n return cloneElement(\n child,\n undefined,\n resolveSvgChildren(child.props.children)\n );\n });\n\nexport const Svg = ({\n children,\n width,\n height,\n viewBox,\n style,\n ...rest\n}: AnyProps & { width?: number; height?: number; viewBox?: string }) => (\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 {resolveSvgChildren(children)}\n </FormeSvg>\n);\n\nexport const Circle = (props: AnyProps) =>\n createElement(\"circle\", normalizeSvgProps(props));\nexport const Rect = (props: AnyProps) =>\n createElement(\"rect\", normalizeSvgProps(props));\nexport const G = (props: AnyProps) =>\n createElement(\"g\", normalizeSvgProps(props));\nexport const Line = (props: AnyProps) =>\n createElement(\"line\", normalizeSvgProps(props));\nexport const Path = (props: AnyProps) =>\n createElement(\"path\", normalizeSvgProps(props));\nexport const SvgText = (props: AnyProps) =>\n createElement(\n \"text\",\n normalizeSvgProps({ fontFamily: \"sans-serif\", ...props })\n );\n",- "type": "registry:lib",- "target": "components/pdf/lib/forme-svg.tsx"- },{"path": "registry/bases/forme/lib/maybe-fixed.tsx",- "content": "import type { ReactNode } from \"react\";\n\nimport { Fixed, View } from \"./forme-primitives\";\nimport type { Style } from \"./forme-primitives\";\n\nexport const 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) {\n return view;\n }\n return <Fixed position={position}>{view}</Fixed>;\n};\n",+ "content": "import type { ReactNode } from \"react\";\n\nimport { Fixed, View } from \"./pdfcn-primitives\";\nimport type { Style } from \"./pdfcn-primitives\";\n\nexport const 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) {\n return view;\n }\n return <Fixed position={position}>{view}</Fixed>;\n};\n","type": "registry:lib","target": "components/pdf/lib/maybe-fixed.tsx"}diff --git a/public/r/forme/watermark.json b/public/r/forme/watermark.jsonindex 7d4b6ce..a8c8538 100644--- a/public/r/forme/watermark.json+++ b/public/r/forme/watermark.json@@ -13,7 +13,7 @@"files": [{"path": "registry/bases/forme/components/watermark/watermark.tsx",- "content": "import { Watermark as FormeWatermark } from \"@formepdf/react\";\n\nimport type { PDFComponentProps } from \"@/registry/themes\";\n\nimport { mergeFormeStyles } from \"../../lib/forme-primitives\";\nimport { usePdfcnTheme } 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\nconst withOpacity = (color: string, opacity: number): string => {\n const match = color.match(/^#([\\da-f]{2})([\\da-f]{2})([\\da-f]{2})$/i);\n if (!match) {\n return color;\n }\n\n const [, red, green, blue] = match;\n return `rgba(${Number.parseInt(red, 16)}, ${Number.parseInt(green, 16)}, ${Number.parseInt(blue, 16)}, ${opacity})`;\n};\n\nexport const PdfWatermark = ({\n text,\n opacity = 0.15,\n fontSize = 60,\n color = \"mutedForeground\",\n angle = -45,\n style,\n}: PdfWatermarkProps) => {\n const theme = usePdfcnTheme();\n const resolvedColor = resolveColor(color, theme.colors);\n\n return (\n <FormeWatermark\n text={text}\n angle={angle}\n color={withOpacity(resolvedColor, opacity)}\n fontSize={fontSize}\n style={mergeFormeStyles(style)}\n />\n );\n};\n",+ "content": "import { Watermark as FormeWatermark } from \"@formepdf/react\";\n\nimport { mergeFormeStyles } from \"@/registry/bases/forme/lib/pdfcn-primitives\";\nimport { usePdfcnTheme } from \"@/registry/bases/forme/lib/theme-provider\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/registry/themes\";\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\nconst withOpacity = (color: string, opacity: number): string => {\n const match = color.match(/^#([\\da-f]{2})([\\da-f]{2})([\\da-f]{2})$/i);\n if (!match) {\n return color;\n }\n\n const [, red, green, blue] = match;\n return `rgba(${Number.parseInt(red, 16)}, ${Number.parseInt(green, 16)}, ${Number.parseInt(blue, 16)}, ${opacity})`;\n};\n\nexport const PdfWatermark = ({\n text,\n opacity = 0.15,\n fontSize = 60,\n color = \"mutedForeground\",\n angle = -45,\n style,\n}: PdfWatermarkProps) => {\n const theme = usePdfcnTheme();\n const resolvedColor = resolveColor(color, theme.colors);\n\n return (\n <FormeWatermark\n text={text}\n angle={angle}\n color={withOpacity(resolvedColor, opacity)}\n fontSize={fontSize}\n style={mergeFormeStyles(style)}\n />\n );\n};\n","type": "registry:component","target": "components/pdf/components/watermark/watermark.tsx"},diff --git a/public/r/registry.json b/public/r/registry.jsonindex 56c6590..e18ee81 100644--- a/public/r/registry.json+++ b/public/r/registry.json@@ -11,25 +11,10 @@"type": "registry:lib","target": "components/pdf/lib/pdfcn-theme.ts"},- {- "path": "registry/bases/takumi/lib/pdfcn-theme-context.tsx",- "type": "registry:lib",- "target": "components/pdf/lib/pdfcn-theme-context.tsx"- },{"path": "registry/bases/takumi/lib/resolve-color.ts","type": "registry:lib","target": "components/pdf/lib/resolve-color.ts"- },- {- "path": "registry/bases/takumi/lib/takumi-primitives.tsx",- "type": "registry:lib",- "target": "components/pdf/lib/takumi-primitives.tsx"- },- {- "path": "registry/bases/takumi/lib/takumi-svg.tsx",- "type": "registry:lib",- "target": "components/pdf/lib/takumi-svg.tsx"}],"name": "takumi/utils",@@ -1061,26 +1046,11 @@"type": "registry:lib","target": "components/pdf/lib/pdfcn-theme.ts"},- {- "path": "registry/bases/forme/lib/pdfcn-theme-context.tsx",- "type": "registry:lib",- "target": "components/pdf/lib/pdfcn-theme-context.tsx"- },{"path": "registry/bases/forme/lib/resolve-color.ts","type": "registry:lib","target": "components/pdf/lib/resolve-color.ts"},- {- "path": "registry/bases/forme/lib/forme-primitives.tsx",- "type": "registry:lib",- "target": "components/pdf/lib/forme-primitives.tsx"- },- {- "path": "registry/bases/forme/lib/forme-svg.tsx",- "type": "registry:lib",- "target": "components/pdf/lib/forme-svg.tsx"- },{"path": "registry/bases/forme/lib/maybe-fixed.tsx","type": "registry:lib",diff --git a/public/r/takumi/alert.json b/public/r/takumi/alert.jsonindex 69518f6..09aa19c 100644--- a/public/r/takumi/alert.json+++ b/public/r/takumi/alert.json@@ -13,7 +13,7 @@"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\nconst 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\nconst borderLeft = (color: string) => ({\n borderLeftColor: color,\n borderLeftWidth: 4,\n});\n\nconst 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 sheet = StyleSheet.create({\n bg: {\n backgroundColor: colors.muted,\n },\n borderError: borderLeft(variantColors.error),\n borderInfo: borderLeft(variantColors.info),\n borderSuccess: borderLeft(variantColors.success),\n borderWarning: borderLeft(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 const 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) {\n return null;\n }\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",+ "content": "import type { ReactNode } from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/lib/theme-provider\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport {\n Circle,\n Line,\n Path,\n Svg,\n} from \"@/registry/bases/takumi/lib/pdfcn-svg\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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\nconst 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\nconst borderLeft = (color: string) => ({\n borderLeftColor: color,\n borderLeftWidth: 4,\n});\n\nconst 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 sheet = StyleSheet.create({\n bg: {\n backgroundColor: colors.muted,\n },\n borderError: borderLeft(variantColors.error),\n borderInfo: borderLeft(variantColors.info),\n borderSuccess: borderLeft(variantColors.success),\n borderWarning: borderLeft(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 const 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) {\n return null;\n }\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","target": "components/pdf/components/alert/alert.tsx"},diff --git a/public/r/takumi/badge.json b/public/r/takumi/badge.jsonindex 69e1723..9539d81 100644--- a/public/r/takumi/badge.json+++ b/public/r/takumi/badge.json@@ -13,7 +13,7 @@"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 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\nconst 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 lg: sheet.sizeLg,\n md: sheet.sizeMd,\n sm: sheet.sizeSm,\n } as Record<BadgeSize, Style>,\n containerVariantMap: {\n default: sheet.variantDefault,\n destructive: sheet.variantDestructive,\n info: sheet.variantInfo,\n outline: sheet.variantOutline,\n primary: sheet.variantPrimary,\n success: sheet.variantSuccess,\n warning: sheet.variantWarning,\n } as Record<BadgeVariant, Style>,\n textSizeMap: {\n lg: sheet.textLg,\n md: sheet.textMd,\n sm: sheet.textSm,\n } as Record<BadgeSize, Style>,\n textVariantMap: {\n default: sheet.textDefault,\n destructive: sheet.textDestructive,\n info: sheet.textInfo,\n outline: sheet.textOutline,\n primary: sheet.textPrimary,\n success: sheet.textSuccess,\n warning: sheet.textWarning,\n } as Record<BadgeVariant, Style>,\n };\n};\n\nexport const 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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/lib/theme-provider\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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 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\nconst 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 lg: sheet.sizeLg,\n md: sheet.sizeMd,\n sm: sheet.sizeSm,\n } as Record<BadgeSize, Style>,\n containerVariantMap: {\n default: sheet.variantDefault,\n destructive: sheet.variantDestructive,\n info: sheet.variantInfo,\n outline: sheet.variantOutline,\n primary: sheet.variantPrimary,\n success: sheet.variantSuccess,\n warning: sheet.variantWarning,\n } as Record<BadgeVariant, Style>,\n textSizeMap: {\n lg: sheet.textLg,\n md: sheet.textMd,\n sm: sheet.textSm,\n } as Record<BadgeSize, Style>,\n textVariantMap: {\n default: sheet.textDefault,\n destructive: sheet.textDestructive,\n info: sheet.textInfo,\n outline: sheet.textOutline,\n primary: sheet.textPrimary,\n success: sheet.textSuccess,\n warning: sheet.textWarning,\n } as Record<BadgeVariant, Style>,\n };\n};\n\nexport const 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","target": "components/pdf/components/badge/badge.tsx"},diff --git a/public/r/takumi/card.json b/public/r/takumi/card.jsonindex bd75d44..b71a813 100644--- a/public/r/takumi/card.json+++ b/public/r/takumi/card.json@@ -13,7 +13,7 @@"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\nconst 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 const 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\") {\n cardStyles.push(styles.cardBordered);\n }\n if (variant === \"muted\") {\n cardStyles.push(styles.cardMuted);\n }\n cardStyles.push(paddingMap[padding]);\n if (style) {\n cardStyles.push(style);\n }\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",+ "content": "import type { ReactNode } from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/lib/theme-provider\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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\nconst 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 const 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\") {\n cardStyles.push(styles.cardBordered);\n }\n if (variant === \"muted\") {\n cardStyles.push(styles.cardMuted);\n }\n cardStyles.push(paddingMap[padding]);\n if (style) {\n cardStyles.push(style);\n }\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","target": "components/pdf/components/card/card.tsx"},diff --git a/public/r/takumi/data-table.json b/public/r/takumi/data-table.jsonindex b565063..e9248a8 100644--- a/public/r/takumi/data-table.json+++ b/public/r/takumi/data-table.json@@ -14,19 +14,19 @@"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 const 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 const formatValue = (value: unknown): string => {\n if (value === null || value === undefined) {\n return \"\";\n }\n if (typeof value === \"number\") {\n return String(value);\n }\n return String(value);\n};\n",+ "content": "import { StyleSheet } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\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 const 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 const formatValue = (value: unknown): string => {\n if (value === null || value === undefined) {\n return \"\";\n }\n if (typeof value === \"number\") {\n return String(value);\n }\n return String(value);\n};\n","type": "registry:component","target": "components/pdf/components/data-table/data-table.styles.ts"},{"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 const 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 ?? (\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 ?? text)}\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 ?? (\n <PDFText\n style={[\n value ? compact.footerText : compact.text,\n col.align\n ? ({ textAlign: col.align } as Style)\n : {},\n ]}\n >\n {text}\n </PDFText>\n ))\n : (rendered ?? text)}\n </TableCell>\n );\n })}\n </TableRow>\n </TableFooter>\n )}\n </Table>\n );\n};\n",+ "content": "import { Fragment } from \"react\";\n\nimport {\n Table,\n TableBody,\n TableCell,\n TableFooter,\n TableHeader,\n TableRow,\n} from \"@/registry/bases/takumi/components/table\";\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/lib/theme-provider\";\nimport { Text as PDFText } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\n\nimport { createCompactStyles, formatValue } from \"./data-table.styles\";\nimport type { DataTableProps } from \"./data-table.types\";\n\nexport const 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 ?? (\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 ?? text)}\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 ?? (\n <PDFText\n style={[\n value ? compact.footerText : compact.text,\n col.align\n ? ({ textAlign: col.align } as Style)\n : {},\n ]}\n >\n {text}\n </PDFText>\n ))\n : (rendered ?? text)}\n </TableCell>\n );\n })}\n </TableRow>\n </TableFooter>\n )}\n </Table>\n );\n};\n","type": "registry:component","target": "components/pdf/components/data-table/data-table.tsx"},{"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 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 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",+ "content": "import type React from \"react\";\n\nimport type { TableVariant } from \"@/registry/bases/takumi/components/table/table.types\";\nimport type { PDFComponentProps } from \"@/registry/themes\";\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 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 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","target": "components/pdf/components/data-table/data-table.types.ts"},diff --git a/public/r/takumi/divider.json b/public/r/takumi/divider.jsonindex 3e69831..00b320a 100644--- a/public/r/takumi/divider.json+++ b/public/r/takumi/divider.json@@ -13,7 +13,7 @@"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\nconst 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 const 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 }\n const containerStyles: Style[] = [\n styles.labelContainer,\n spacingMap[spacing],\n ];\n if (width !== undefined) {\n containerStyles.push({ width } as Style);\n }\n if (style) {\n containerStyles.push(...[style].flat());\n }\n const labelTextStyle: Style[] = [styles.labelText];\n if (color) {\n labelTextStyle.push({ color: resolveColor(color, theme.colors) });\n }\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 }\n if (width !== undefined) {\n styleArray.push({ width } as Style);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return <View style={styleArray} />;\n};\n",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/lib/theme-provider\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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\nconst 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 const 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 }\n const containerStyles: Style[] = [\n styles.labelContainer,\n spacingMap[spacing],\n ];\n if (width !== undefined) {\n containerStyles.push({ width } as Style);\n }\n if (style) {\n containerStyles.push(...[style].flat());\n }\n const labelTextStyle: Style[] = [styles.labelText];\n if (color) {\n labelTextStyle.push({ color: resolveColor(color, theme.colors) });\n }\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 }\n if (width !== undefined) {\n styleArray.push({ width } as Style);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return <View style={styleArray} />;\n};\n","type": "registry:component","target": "components/pdf/components/divider/divider.tsx"},diff --git a/public/r/takumi/form.json b/public/r/takumi/form.jsonindex d887afc..dce3b74 100644--- a/public/r/takumi/form.json+++ b/public/r/takumi/form.json@@ -13,19 +13,19 @@"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 const createFormStyles = (\n t: PdfcnTheme,\n variant: PdfFormVariant = \"underline\"\n) => {\n const { spacing, borderRadius, fontWeights, typography } = t.primitives;\n const borderColor = t.colors.border;\n // lighter than spacing[0.5]=2pt — more refined\n const hairline = 0.75;\n // group title rule\n const rule = 1;\n\n const fieldAreaByVariant: Record<PdfFormVariant, object> = {\n box: {\n 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",+ "content": "import { StyleSheet } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\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 const createFormStyles = (\n t: PdfcnTheme,\n variant: PdfFormVariant = \"underline\"\n) => {\n const { spacing, borderRadius, fontWeights, typography } = t.primitives;\n const borderColor = t.colors.border;\n // lighter than spacing[0.5]=2pt — more refined\n const hairline = 0.75;\n // group title rule\n const rule = 1;\n\n const fieldAreaByVariant: Record<PdfFormVariant, object> = {\n box: {\n 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","target": "components/pdf/components/form/form.styles.ts"},{"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\nconst 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\nconst 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\nconst 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 let cols: number;\n if (layout === \"three-column\") {\n cols = 3;\n } else if (layout === \"two-column\") {\n cols = 2;\n } else {\n cols = 1;\n }\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 const 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) {\n rootStyles.push(style);\n }\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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/lib/theme-provider\";\nimport {\n View,\n Text as PDFText,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\n\nimport { createFormStyles } from \"./form.styles\";\nimport type {\n FormLayout,\n PdfFormField,\n PdfFormGroup,\n PdfFormProps,\n} from \"./form.types\";\n\nconst 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\nconst 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\nconst 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 let cols: number;\n if (layout === \"three-column\") {\n cols = 3;\n } else if (layout === \"two-column\") {\n cols = 2;\n } else {\n cols = 1;\n }\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 const 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) {\n rootStyles.push(style);\n }\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","target": "components/pdf/components/form/form.tsx"},{"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",+ "content": "import type { Style } from \"@/registry/bases/takumi/lib/pdfcn-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","target": "components/pdf/components/form/form.types.ts"},diff --git a/public/r/takumi/graph.json b/public/r/takumi/graph.jsonindex 19e044e..1b389df 100644--- a/public/r/takumi/graph.json+++ b/public/r/takumi/graph.json@@ -13,19 +13,19 @@"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 const createGraphStyles = (t: PdfcnTheme) =>\n 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",+ "content": "import { StyleSheet } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nexport const createGraphStyles = (t: PdfcnTheme) =>\n 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","type": "registry:component","target": "components/pdf/components/graph/graph.styles.ts"},{"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 */\nconst 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 <>\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\nconst 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\nconst 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\nconst 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 lastPoint = points.at(-1);\n const firstPoint = points.at(0);\n const areaPath =\n isArea && points.length > 1 && lastPoint && firstPoint\n ? `${lineDStr} L ${lastPoint.x} ${chartY + chartH} L ${firstPoint.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\nconst 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\nconst 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\nconst renderChartContent = (\n variant: string,\n series: GraphSeries[],\n layout: ChartLayout,\n palette: string[],\n showGrid: boolean,\n showValues: boolean,\n showDots: boolean,\n smooth: boolean,\n centerLabel: string | undefined,\n theme: PdfcnTheme\n): React.ReactNode => {\n switch (variant) {\n case \"bar\": {\n return renderBarChart(\n series,\n layout,\n palette,\n showGrid,\n showValues,\n theme\n );\n }\n case \"horizontal-bar\": {\n return renderHorizontalBarChart(\n series,\n layout,\n palette,\n showValues,\n theme\n );\n }\n case \"line\":\n case \"area\": {\n return renderLineAreaChart(\n series,\n layout,\n palette,\n showGrid,\n showValues,\n showDots,\n smooth,\n variant === \"area\",\n theme\n );\n }\n case \"pie\": {\n return renderPieDonutChart(\n series,\n layout,\n palette,\n undefined,\n false,\n theme\n );\n }\n case \"donut\": {\n return renderPieDonutChart(\n series,\n layout,\n palette,\n centerLabel,\n true,\n theme\n );\n }\n default: {\n return null;\n }\n }\n};\n\nconst renderAxisLabels = (\n isPieOrDonut: boolean,\n xLabel: string | undefined,\n yLabel: string | undefined,\n chartX: number,\n chartW: number,\n height: number,\n mutedForeground: string\n) => (\n <>\n {!isPieOrDonut && xLabel && (\n <SvgText\n x={chartX + chartW / 2}\n y={height - 2}\n fill={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={mutedForeground}\n textAnchor=\"start\"\n style={{ fontSize: 8 }}\n >\n {yLabel}\n </SvgText>\n )}\n </>\n);\n\nconst renderTextFallback = (\n variant: GraphProps[\"variant\"],\n series: GraphSeries[],\n layout: ChartLayout,\n showValues: boolean,\n textColor: string\n) => {\n if (variant === \"pie\" || variant === \"donut\") {\n const data = series[0]?.data ?? [];\n const total = data.reduce((sum, point) => sum + point.value, 0) || 1;\n const cx = layout.svgW / 2;\n const cy = layout.svgH / 2;\n const radius = Math.min(layout.svgW, layout.svgH) / 2 - 20;\n const labelRadius = radius * 1.18;\n let currentAngle = 0;\n\n return (\n <View\n style={{\n height: layout.svgH,\n left: 0,\n position: \"absolute\",\n top: 0,\n width: layout.svgW,\n }}\n >\n {data.map((point, index) => {\n const sweep = (point.value / total) * 360;\n const midAngle = currentAngle + sweep / 2;\n currentAngle += sweep;\n if (sweep <= 15) {\n return null;\n }\n const labelPoint = polarToCartesian(cx, cy, labelRadius, midAngle);\n const onRight = labelPoint.x > cx;\n return (\n <PDFText\n key={`fallback-pie-${point.label}-${index}`}\n style={{\n color: textColor,\n fontSize: 7,\n left: onRight ? labelPoint.x : labelPoint.x - 60,\n lineHeight: 1,\n position: \"absolute\",\n textAlign: onRight ? \"left\" : \"right\",\n top: labelPoint.y - 4,\n width: 60,\n }}\n >\n {truncate(point.label, 10)}\n </PDFText>\n );\n })}\n </View>\n );\n }\n\n const {\n chartH,\n chartW,\n chartX,\n chartY,\n svgH,\n svgW,\n xLabels,\n yMax,\n yMin,\n yTicks,\n } = layout;\n const range = yMax - yMin || 1;\n const toY = (value: number) =>\n chartY + chartH - ((value - yMin) / range) * chartH;\n const labelStyle = {\n color: textColor,\n fontSize: 7,\n lineHeight: 1,\n position: \"absolute\" as const,\n };\n\n if (variant === \"horizontal-bar\") {\n const labelWidth = 60;\n const rowHeight = chartH / Math.max(xLabels.length, 1);\n const maxValue = Math.max(\n ...series.flatMap((item) => item.data.map((point) => point.value)),\n 1\n );\n\n return (\n <View\n style={{\n height: svgH,\n left: 0,\n position: \"absolute\",\n top: 0,\n width: svgW,\n }}\n >\n {xLabels.map((label, index) => {\n const value = series[0]?.data[index]?.value ?? 0;\n const barWidth = (value / maxValue) * (chartW - labelWidth);\n return (\n <View key={`fallback-horizontal-${label}`}>\n <PDFText\n style={{\n ...labelStyle,\n left: chartX,\n textAlign: \"right\",\n top: chartY + index * rowHeight + rowHeight / 2 - 4,\n width: labelWidth - 4,\n }}\n >\n {truncate(label, 14)}\n </PDFText>\n {showValues ? (\n <PDFText\n style={{\n ...labelStyle,\n color: textColor,\n fontSize: 6,\n left: chartX + labelWidth + barWidth + 3,\n top: chartY + index * rowHeight + rowHeight / 2 - 4,\n width: 28,\n }}\n >\n {fmtNum(value)}\n </PDFText>\n ) : null}\n </View>\n );\n })}\n </View>\n );\n }\n\n const pointX = (index: number) =>\n chartX + (index / Math.max(xLabels.length - 1, 1)) * chartW;\n const groupWidth = chartW / Math.max(xLabels.length, 1);\n const barGap = 2;\n const barWidth = Math.max(\n (groupWidth - barGap * (series.length + 1)) / Math.max(series.length, 1),\n 1\n );\n\n return (\n <View\n style={{\n height: svgH,\n left: 0,\n position: \"absolute\",\n top: 0,\n width: svgW,\n }}\n >\n {yTicks.map((tick) => (\n <PDFText\n key={`fallback-y-${tick}`}\n style={{\n ...labelStyle,\n left: 0,\n textAlign: \"right\",\n top: toY(tick) - 4,\n width: chartX - 4,\n }}\n >\n {fmtNum(tick)}\n </PDFText>\n ))}\n {(variant === \"line\" || variant === \"area\") &&\n xLabels.map((label, index) => (\n <PDFText\n key={`fallback-x-${label}`}\n style={{\n ...labelStyle,\n left: pointX(index) - 12,\n textAlign: \"center\",\n top: chartY + chartH + 3,\n width: 24,\n }}\n >\n {truncate(label, 8)}\n </PDFText>\n ))}\n {variant === \"bar\" &&\n showValues &&\n xLabels.flatMap((label, categoryIndex) =>\n series.map((item, seriesIndex) => {\n const value = item.data[categoryIndex]?.value ?? 0;\n const left =\n chartX +\n categoryIndex * groupWidth +\n barGap +\n seriesIndex * (barWidth + barGap);\n return (\n <PDFText\n key={`fallback-bar-${label}-${item.name}-${seriesIndex}`}\n style={{\n ...labelStyle,\n fontSize: 6,\n left,\n textAlign: \"center\",\n top: toY(value) - 8,\n width: barWidth,\n }}\n >\n {fmtNum(value)}\n </PDFText>\n );\n })\n )}\n </View>\n );\n};\n\nconst renderGraphContent = (\n title: string | undefined,\n subtitle: string | undefined,\n chartContent: React.ReactNode,\n chartLabels: React.ReactNode,\n axisLabels: React.ReactNode,\n textFallback: React.ReactNode,\n width: number,\n height: number,\n legend: string,\n showLegend: boolean,\n isPieOrDonut: boolean,\n series: GraphSeries[],\n palette: string[],\n styles: ReturnType<typeof createGraphStyles>\n) => (\n <>\n {title && <PDFText style={styles.title}>{title}</PDFText>}\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n <View style={legend === \"right\" ? styles.chartWithRightLegend : undefined}>\n <View style={{ height, position: \"relative\", width }}>\n <Svg width={width} height={height}>\n {chartContent}\n {axisLabels}\n </Svg>\n {textFallback}\n </View>\n {showLegend &&\n legend === \"right\" &&\n Legend({ palette, position: \"right\", series, styles })}\n </View>\n {chartLabels}\n {showLegend &&\n legend === \"bottom\" &&\n Legend({ palette, position: \"bottom\", series, styles })}\n </>\n);\n\nconst renderBarLabels = (\n variant: GraphProps[\"variant\"],\n series: GraphSeries[],\n chartX: number,\n chartW: number\n) => {\n if (variant !== \"bar\") {\n return null;\n }\n\n return (\n <View\n style={{\n display: \"flex\",\n flexDirection: \"row\",\n marginLeft: chartX,\n width: chartW,\n }}\n >\n {(series[0]?.data ?? []).map((point) => (\n <View key={point.label} style={{ alignItems: \"center\", flex: 1 }}>\n <PDFText style={{ fontSize: 7 }}>{truncate(point.label, 10)}</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 const 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 }\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 const chartContent = renderChartContent(\n variant,\n series,\n layout,\n palette,\n showGrid,\n showValues,\n showDots,\n smooth,\n centerLabel,\n theme\n );\n\n const showLegend = legend !== \"none\" && !isPieOrDonut;\n const chartLabels = renderBarLabels(variant, series, chartX, chartW);\n\n const containerStyles: Style[] = [styles.container];\n if (style) {\n containerStyles.push(style);\n }\n\n const content = (\n <View style={containerStyles}>\n {renderGraphContent(\n title,\n subtitle,\n chartContent,\n chartLabels,\n renderAxisLabels(\n isPieOrDonut,\n xLabel,\n yLabel,\n chartX,\n chartW,\n height,\n theme.colors.mutedForeground\n ),\n renderTextFallback(\n variant,\n series,\n layout,\n showValues,\n theme.colors.mutedForeground\n ),\n width,\n height,\n legend,\n showLegend,\n isPieOrDonut,\n series,\n palette,\n styles\n )}\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",+ "content": "import type React from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/lib/theme-provider\";\nimport {\n View,\n Text as PDFText,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport {\n Circle,\n G,\n Line,\n Path,\n Rect,\n Svg,\n SvgText,\n} from \"@/registry/bases/takumi/lib/pdfcn-svg\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\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 */\nconst 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 <>\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\nconst 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\nconst 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\nconst 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 lastPoint = points.at(-1);\n const firstPoint = points.at(0);\n const areaPath =\n isArea && points.length > 1 && lastPoint && firstPoint\n ? `${lineDStr} L ${lastPoint.x} ${chartY + chartH} L ${firstPoint.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\nconst 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\nconst 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\nconst renderChartContent = (\n variant: string,\n series: GraphSeries[],\n layout: ChartLayout,\n palette: string[],\n showGrid: boolean,\n showValues: boolean,\n showDots: boolean,\n smooth: boolean,\n centerLabel: string | undefined,\n theme: PdfcnTheme\n): React.ReactNode => {\n switch (variant) {\n case \"bar\": {\n return renderBarChart(\n series,\n layout,\n palette,\n showGrid,\n showValues,\n theme\n );\n }\n case \"horizontal-bar\": {\n return renderHorizontalBarChart(\n series,\n layout,\n palette,\n showValues,\n theme\n );\n }\n case \"line\":\n case \"area\": {\n return renderLineAreaChart(\n series,\n layout,\n palette,\n showGrid,\n showValues,\n showDots,\n smooth,\n variant === \"area\",\n theme\n );\n }\n case \"pie\": {\n return renderPieDonutChart(\n series,\n layout,\n palette,\n undefined,\n false,\n theme\n );\n }\n case \"donut\": {\n return renderPieDonutChart(\n series,\n layout,\n palette,\n centerLabel,\n true,\n theme\n );\n }\n default: {\n return null;\n }\n }\n};\n\nconst renderAxisLabels = (\n isPieOrDonut: boolean,\n xLabel: string | undefined,\n yLabel: string | undefined,\n chartX: number,\n chartW: number,\n height: number,\n mutedForeground: string\n) => (\n <>\n {!isPieOrDonut && xLabel && (\n <SvgText\n x={chartX + chartW / 2}\n y={height - 2}\n fill={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={mutedForeground}\n textAnchor=\"start\"\n style={{ fontSize: 8 }}\n >\n {yLabel}\n </SvgText>\n )}\n </>\n);\n\nconst renderTextFallback = (\n variant: GraphProps[\"variant\"],\n series: GraphSeries[],\n layout: ChartLayout,\n showValues: boolean,\n textColor: string\n) => {\n if (variant === \"pie\" || variant === \"donut\") {\n const data = series[0]?.data ?? [];\n const total = data.reduce((sum, point) => sum + point.value, 0) || 1;\n const cx = layout.svgW / 2;\n const cy = layout.svgH / 2;\n const radius = Math.min(layout.svgW, layout.svgH) / 2 - 20;\n const labelRadius = radius * 1.18;\n let currentAngle = 0;\n\n return (\n <View\n style={{\n height: layout.svgH,\n left: 0,\n position: \"absolute\",\n top: 0,\n width: layout.svgW,\n }}\n >\n {data.map((point, index) => {\n const sweep = (point.value / total) * 360;\n const midAngle = currentAngle + sweep / 2;\n currentAngle += sweep;\n if (sweep <= 15) {\n return null;\n }\n const labelPoint = polarToCartesian(cx, cy, labelRadius, midAngle);\n const onRight = labelPoint.x > cx;\n return (\n <PDFText\n key={`fallback-pie-${point.label}-${index}`}\n style={{\n color: textColor,\n fontSize: 7,\n left: onRight ? labelPoint.x : labelPoint.x - 60,\n lineHeight: 1,\n position: \"absolute\",\n textAlign: onRight ? \"left\" : \"right\",\n top: labelPoint.y - 4,\n width: 60,\n }}\n >\n {truncate(point.label, 10)}\n </PDFText>\n );\n })}\n </View>\n );\n }\n\n const {\n chartH,\n chartW,\n chartX,\n chartY,\n svgH,\n svgW,\n xLabels,\n yMax,\n yMin,\n yTicks,\n } = layout;\n const range = yMax - yMin || 1;\n const toY = (value: number) =>\n chartY + chartH - ((value - yMin) / range) * chartH;\n const labelStyle = {\n color: textColor,\n fontSize: 7,\n lineHeight: 1,\n position: \"absolute\" as const,\n };\n\n if (variant === \"horizontal-bar\") {\n const labelWidth = 60;\n const rowHeight = chartH / Math.max(xLabels.length, 1);\n const maxValue = Math.max(\n ...series.flatMap((item) => item.data.map((point) => point.value)),\n 1\n );\n\n return (\n <View\n style={{\n height: svgH,\n left: 0,\n position: \"absolute\",\n top: 0,\n width: svgW,\n }}\n >\n {xLabels.map((label, index) => {\n const value = series[0]?.data[index]?.value ?? 0;\n const barWidth = (value / maxValue) * (chartW - labelWidth);\n return (\n <View key={`fallback-horizontal-${label}`}>\n <PDFText\n style={{\n ...labelStyle,\n left: chartX,\n textAlign: \"right\",\n top: chartY + index * rowHeight + rowHeight / 2 - 4,\n width: labelWidth - 4,\n }}\n >\n {truncate(label, 14)}\n </PDFText>\n {showValues ? (\n <PDFText\n style={{\n ...labelStyle,\n color: textColor,\n fontSize: 6,\n left: chartX + labelWidth + barWidth + 3,\n top: chartY + index * rowHeight + rowHeight / 2 - 4,\n width: 28,\n }}\n >\n {fmtNum(value)}\n </PDFText>\n ) : null}\n </View>\n );\n })}\n </View>\n );\n }\n\n const pointX = (index: number) =>\n chartX + (index / Math.max(xLabels.length - 1, 1)) * chartW;\n const groupWidth = chartW / Math.max(xLabels.length, 1);\n const barGap = 2;\n const barWidth = Math.max(\n (groupWidth - barGap * (series.length + 1)) / Math.max(series.length, 1),\n 1\n );\n\n return (\n <View\n style={{\n height: svgH,\n left: 0,\n position: \"absolute\",\n top: 0,\n width: svgW,\n }}\n >\n {yTicks.map((tick) => (\n <PDFText\n key={`fallback-y-${tick}`}\n style={{\n ...labelStyle,\n left: 0,\n textAlign: \"right\",\n top: toY(tick) - 4,\n width: chartX - 4,\n }}\n >\n {fmtNum(tick)}\n </PDFText>\n ))}\n {(variant === \"line\" || variant === \"area\") &&\n xLabels.map((label, index) => (\n <PDFText\n key={`fallback-x-${label}`}\n style={{\n ...labelStyle,\n left: pointX(index) - 12,\n textAlign: \"center\",\n top: chartY + chartH + 3,\n width: 24,\n }}\n >\n {truncate(label, 8)}\n </PDFText>\n ))}\n {variant === \"bar\" &&\n showValues &&\n xLabels.flatMap((label, categoryIndex) =>\n series.map((item, seriesIndex) => {\n const value = item.data[categoryIndex]?.value ?? 0;\n const left =\n chartX +\n categoryIndex * groupWidth +\n barGap +\n seriesIndex * (barWidth + barGap);\n return (\n <PDFText\n key={`fallback-bar-${label}-${item.name}-${seriesIndex}`}\n style={{\n ...labelStyle,\n fontSize: 6,\n left,\n textAlign: \"center\",\n top: toY(value) - 8,\n width: barWidth,\n }}\n >\n {fmtNum(value)}\n </PDFText>\n );\n })\n )}\n </View>\n );\n};\n\nconst renderGraphContent = (\n title: string | undefined,\n subtitle: string | undefined,\n chartContent: React.ReactNode,\n chartLabels: React.ReactNode,\n axisLabels: React.ReactNode,\n textFallback: React.ReactNode,\n width: number,\n height: number,\n legend: string,\n showLegend: boolean,\n isPieOrDonut: boolean,\n series: GraphSeries[],\n palette: string[],\n styles: ReturnType<typeof createGraphStyles>\n) => (\n <>\n {title && <PDFText style={styles.title}>{title}</PDFText>}\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n <View style={legend === \"right\" ? styles.chartWithRightLegend : undefined}>\n <View style={{ height, position: \"relative\", width }}>\n <Svg width={width} height={height}>\n {chartContent}\n {axisLabels}\n </Svg>\n {textFallback}\n </View>\n {showLegend &&\n legend === \"right\" &&\n Legend({ palette, position: \"right\", series, styles })}\n </View>\n {chartLabels}\n {showLegend &&\n legend === \"bottom\" &&\n Legend({ palette, position: \"bottom\", series, styles })}\n </>\n);\n\nconst renderBarLabels = (\n variant: GraphProps[\"variant\"],\n series: GraphSeries[],\n chartX: number,\n chartW: number\n) => {\n if (variant !== \"bar\") {\n return null;\n }\n\n return (\n <View\n style={{\n display: \"flex\",\n flexDirection: \"row\",\n marginLeft: chartX,\n width: chartW,\n }}\n >\n {(series[0]?.data ?? []).map((point) => (\n <View key={point.label} style={{ alignItems: \"center\", flex: 1 }}>\n <PDFText style={{ fontSize: 7 }}>{truncate(point.label, 10)}</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 const 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 }\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 const chartContent = renderChartContent(\n variant,\n series,\n layout,\n palette,\n showGrid,\n showValues,\n showDots,\n smooth,\n centerLabel,\n theme\n );\n\n const showLegend = legend !== \"none\" && !isPieOrDonut;\n const chartLabels = renderBarLabels(variant, series, chartX, chartW);\n\n const containerStyles: Style[] = [styles.container];\n if (style) {\n containerStyles.push(style);\n }\n\n const content = (\n <View style={containerStyles}>\n {renderGraphContent(\n title,\n subtitle,\n chartContent,\n chartLabels,\n renderAxisLabels(\n isPieOrDonut,\n xLabel,\n yLabel,\n chartX,\n chartW,\n height,\n theme.colors.mutedForeground\n ),\n renderTextFallback(\n variant,\n series,\n layout,\n showValues,\n theme.colors.mutedForeground\n ),\n width,\n height,\n legend,\n showLegend,\n isPieOrDonut,\n series,\n palette,\n styles\n )}\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","target": "components/pdf/components/graph/graph.tsx"},{"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",+ "content": "import type { Style } from \"@/registry/bases/takumi/lib/pdfcn-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","target": "components/pdf/components/graph/graph.types.ts"},diff --git a/public/r/takumi/heading.json b/public/r/takumi/heading.jsonindex 79fd33b..e7205a3 100644--- a/public/r/takumi/heading.json+++ b/public/r/takumi/heading.json@@ -13,7 +13,7 @@"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\nconst 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 const Heading = ({\n level = 1,\n align,\n color,\n transform,\n weight,\n tracking,\n noMargin,\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) {\n styleArray.push(weightMap[weight]);\n }\n if (tracking && tracking in trackingMap) {\n styleArray.push(trackingMap[tracking]);\n }\n if (transform && transform in transformMap) {\n styleArray.push(transformMap[transform as keyof typeof transformMap]);\n }\n if (noMargin) {\n styleArray.push(styles.noMargin);\n }\n const semantic = {} as Style;\n if (align) {\n semantic.textAlign = align;\n }\n if (color) {\n semantic.color = resolveColor(color, theme.colors);\n }\n if (Object.keys(semantic).length > 0) {\n styleArray.push(semantic);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return <Text style={styleArray}>{children}</Text>;\n};\n",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/lib/theme-provider\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport {\n Text,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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\nconst 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 const Heading = ({\n level = 1,\n align,\n color,\n transform,\n weight,\n tracking,\n noMargin,\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) {\n styleArray.push(weightMap[weight]);\n }\n if (tracking && tracking in trackingMap) {\n styleArray.push(trackingMap[tracking]);\n }\n if (transform && transform in transformMap) {\n styleArray.push(transformMap[transform as keyof typeof transformMap]);\n }\n if (noMargin) {\n styleArray.push(styles.noMargin);\n }\n const semantic = {} as Style;\n if (align) {\n semantic.textAlign = align;\n }\n if (color) {\n semantic.color = resolveColor(color, theme.colors);\n }\n if (Object.keys(semantic).length > 0) {\n styleArray.push(semantic);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return <Text style={styleArray}>{children}</Text>;\n};\n","type": "registry:component","target": "components/pdf/components/heading/heading.tsx"},diff --git a/public/r/takumi/invoice-classic.json b/public/r/takumi/invoice-classic.jsonindex bcf7057..fb104cb 100644--- a/public/r/takumi/invoice-classic.json+++ b/public/r/takumi/invoice-classic.json@@ -13,7 +13,7 @@"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: \"Nagpur, IN\",\n companyEmail: \"[email protected]\",\n companyName: \"PDFx Inc.\",\n dueDate: \"March 17, 2026\",\n invoiceDate: \"February 17, 2026\",\n invoiceNumber: \"INV-2026-001\",\n items: [\n { description: \"Web Development\", quantity: 1, unitPrice: 12_500 },\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: \"Innovative PDF Solutions\",\n summary: {\n subtotal: 36_250,\n tax: 2537.5,\n total: 38_787.5,\n },\n};\n\nconst InvoiceClassicContent = ({ data }: { data: InvoiceClassicData }) => {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n page: {\n backgroundColor: theme.colors.background,\n boxSizing: \"border-box\",\n minHeight: 841,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n position: \"relative\",\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\nexport const InvoiceClassicDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceClassicData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceClassicContent data={data} />\n </PdfcnThemeProvider>\n);\n",+ "content": "import {\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 \"@/registry/bases/takumi/components\";\nimport {\n View,\n StyleSheet,\n Document,\n Page,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\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: \"Nagpur, IN\",\n companyEmail: \"[email protected]\",\n companyName: \"pdfcn\",\n dueDate: \"March 17, 2026\",\n invoiceDate: \"February 17, 2026\",\n invoiceNumber: \"INV-2026-001\",\n items: [\n { description: \"Web Development\", quantity: 1, unitPrice: 12_500 },\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: \"Innovative PDF Solutions\",\n summary: {\n subtotal: 36_250,\n tax: 2537.5,\n total: 38_787.5,\n },\n};\n\nconst InvoiceClassicContent = ({ data }: { data: InvoiceClassicData }) => {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n page: {\n backgroundColor: theme.colors.background,\n boxSizing: \"border-box\",\n minHeight: 841,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n position: \"relative\",\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\nexport const InvoiceClassicDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceClassicData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceClassicContent data={data} />\n </PdfcnThemeProvider>\n);\n","type": "registry:block","target": "components/pdf/blocks/invoice-classic/invoice-classic.tsx"},diff --git a/public/r/takumi/invoice-consultant.json b/public/r/takumi/invoice-consultant.jsonindex 0a6a950..6acbdd7 100644--- a/public/r/takumi/invoice-consultant.json+++ b/public/r/takumi/invoice-consultant.json@@ -13,7 +13,7 @@"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: \"Nagpur, IN · [email protected]\",\n companyName: \"PDFx Inc.\",\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: 9500,\n tax: 475,\n total: 9975,\n totalHours: 60,\n },\n};\n\nconst InvoiceConsultantContent = ({\n data,\n}: {\n data: InvoiceConsultantData;\n}) => {\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 boxSizing: \"border-box\",\n minHeight: 841,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n position: \"relative\",\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\nexport const InvoiceConsultantDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceConsultantData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceConsultantContent data={data} />\n </PdfcnThemeProvider>\n);\n",+ "content": "import {\n KeyValue,\n PageFooter,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"@/registry/bases/takumi/components\";\nimport {\n View,\n StyleSheet,\n Document,\n Page,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\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: \"Nagpur, IN · [email protected]\",\n companyName: \"pdfcn\",\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: 9500,\n tax: 475,\n total: 9975,\n totalHours: 60,\n },\n};\n\nconst InvoiceConsultantContent = ({\n data,\n}: {\n data: InvoiceConsultantData;\n}) => {\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 boxSizing: \"border-box\",\n minHeight: 841,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n position: \"relative\",\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\nexport const InvoiceConsultantDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceConsultantData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceConsultantContent data={data} />\n </PdfcnThemeProvider>\n);\n","type": "registry:block","target": "components/pdf/blocks/invoice-consultant/invoice-consultant.tsx"},diff --git a/public/r/takumi/invoice-corporate.json b/public/r/takumi/invoice-corporate.jsonindex 67c3827..639e6e1 100644--- a/public/r/takumi/invoice-corporate.json+++ b/public/r/takumi/invoice-corporate.json@@ -13,7 +13,7 @@"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: \"Nagpur, IN\",\n companyEmail: \"[email protected]\",\n companyName: \"PDFx Inc.\",\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: 18_000 },\n {\n description: \"Training Workshop (per session)\",\n quantity: 3,\n unitPrice: 2500,\n },\n { description: \"Annual Support Package\", quantity: 1, unitPrice: 8500 },\n ],\n logo: \"/favicon.png\",\n notes:\n \"Corporate billing – Net 30 terms apply. For inquiries, contact [email protected]\",\n paymentTerms: {\n dueDate: \"March 24, 2026\",\n gst: \"GSTIN 987654321\",\n method: \"Wire Transfer / Corporate Account\",\n },\n subtitle: \"Innovative PDF Solutions\",\n summary: {\n subtotal: 56_500,\n tax: 4520,\n total: 61_020,\n },\n};\n\nconst 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 boxSizing: \"border-box\",\n minHeight: 841,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n position: \"relative\",\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\nexport const InvoiceCorporateDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceCorporateData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceCorporateContent data={data} />\n </PdfcnThemeProvider>\n);\n",+ "content": "import {\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 \"@/registry/bases/takumi/components\";\nimport {\n View,\n StyleSheet,\n Document,\n Page,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\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: \"Nagpur, IN\",\n companyEmail: \"[email protected]\",\n companyName: \"pdfcn\",\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: 18_000 },\n {\n description: \"Training Workshop (per session)\",\n quantity: 3,\n unitPrice: 2500,\n },\n { description: \"Annual Support Package\", quantity: 1, unitPrice: 8500 },\n ],\n logo: \"/favicon.png\",\n notes:\n \"Corporate billing – Net 30 terms apply. For inquiries, contact [email protected]\",\n paymentTerms: {\n dueDate: \"March 24, 2026\",\n gst: \"GSTIN 987654321\",\n method: \"Wire Transfer / Corporate Account\",\n },\n subtitle: \"Innovative PDF Solutions\",\n summary: {\n subtotal: 56_500,\n tax: 4520,\n total: 61_020,\n },\n};\n\nconst 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 boxSizing: \"border-box\",\n minHeight: 841,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n position: \"relative\",\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\nexport const InvoiceCorporateDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceCorporateData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceCorporateContent data={data} />\n </PdfcnThemeProvider>\n);\n","type": "registry:block","target": "components/pdf/blocks/invoice-corporate/invoice-corporate.tsx"},diff --git a/public/r/takumi/invoice-creative.json b/public/r/takumi/invoice-creative.jsonindex 302e18e..dd82ccd 100644--- a/public/r/takumi/invoice-creative.json+++ b/public/r/takumi/invoice-creative.json@@ -13,7 +13,7 @@"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: \"Nagpur, IN · [email protected]\",\n companyName: \"PDFx Inc.\",\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: \"Innovative PDF Solutions\",\n summary: {\n subtotal: 22_700,\n tax: 1475.5,\n total: 24_175.5,\n },\n};\n\nconst 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 boxSizing: \"border-box\",\n minHeight: 841,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n position: \"relative\",\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\nexport const InvoiceCreativeDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceCreativeData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceCreativeContent data={data} />\n </PdfcnThemeProvider>\n);\n",+ "content": "import {\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 \"@/registry/bases/takumi/components\";\nimport {\n View,\n StyleSheet,\n Document,\n Page,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\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: \"Nagpur, IN · [email protected]\",\n companyName: \"pdfcn\",\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: \"Innovative PDF Solutions\",\n summary: {\n subtotal: 22_700,\n tax: 1475.5,\n total: 24_175.5,\n },\n};\n\nconst 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 boxSizing: \"border-box\",\n minHeight: 841,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n position: \"relative\",\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\nexport const InvoiceCreativeDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceCreativeData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceCreativeContent data={data} />\n </PdfcnThemeProvider>\n);\n","type": "registry:block","target": "components/pdf/blocks/invoice-creative/invoice-creative.tsx"},diff --git a/public/r/takumi/invoice-minimal.json b/public/r/takumi/invoice-minimal.jsonindex 279a29a..2b3634c 100644--- a/public/r/takumi/invoice-minimal.json+++ b/public/r/takumi/invoice-minimal.json@@ -13,7 +13,7 @@"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: \"Nagpur, IN\",\n companyEmail: \"[email protected]\",\n companyName: \"PDFx Inc.\",\n dueDate: \"March 22, 2026\",\n invoiceDate: \"February 20, 2026\",\n invoiceNumber: \"INV-2026-003\",\n items: [\n { description: \"Annual License Plan\", quantity: 1, unitPrice: 25_000 },\n { description: \"Support & Maintenance\", quantity: 12, unitPrice: 1500 },\n { description: \"Custom Integration\", quantity: 1, unitPrice: 12_000 },\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: \"Innovative PDF Solutions\",\n summary: {\n subtotal: 55_000,\n tax: 3850,\n total: 58_850,\n },\n};\n\nconst 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 boxSizing: \"border-box\",\n minHeight: 841,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n position: \"relative\",\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={{ paddingRight: 20, width: \"50%\" }}>\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={{ width: \"50%\" }}>\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\nexport const InvoiceMinimalDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceMinimalData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceMinimalContent data={data} />\n </PdfcnThemeProvider>\n);\n",+ "content": "import {\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 \"@/registry/bases/takumi/components\";\nimport {\n View,\n StyleSheet,\n Document,\n Page,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\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: \"Nagpur, IN\",\n companyEmail: \"[email protected]\",\n companyName: \"pdfcn\",\n dueDate: \"March 22, 2026\",\n invoiceDate: \"February 20, 2026\",\n invoiceNumber: \"INV-2026-003\",\n items: [\n { description: \"Annual License Plan\", quantity: 1, unitPrice: 25_000 },\n { description: \"Support & Maintenance\", quantity: 12, unitPrice: 1500 },\n { description: \"Custom Integration\", quantity: 1, unitPrice: 12_000 },\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: \"Innovative PDF Solutions\",\n summary: {\n subtotal: 55_000,\n tax: 3850,\n total: 58_850,\n },\n};\n\nconst 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 boxSizing: \"border-box\",\n minHeight: 841,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n position: \"relative\",\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={{ paddingRight: 20, width: \"50%\" }}>\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={{ width: \"50%\" }}>\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\nexport const InvoiceMinimalDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceMinimalData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceMinimalContent data={data} />\n </PdfcnThemeProvider>\n);\n","type": "registry:block","target": "components/pdf/blocks/invoice-minimal/invoice-minimal.tsx"},diff --git a/public/r/takumi/invoice-modern.json b/public/r/takumi/invoice-modern.jsonindex 158740c..98d3869 100644--- a/public/r/takumi/invoice-modern.json+++ b/public/r/takumi/invoice-modern.json@@ -13,7 +13,7 @@"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: \"Nagpur, IN\",\n companyEmail: \"[email protected]\",\n companyName: \"PDFx Inc.\",\n dueDate: \"March 20, 2026\",\n invoiceDate: \"February 18, 2026\",\n invoiceNumber: \"INV-2026-002\",\n items: [\n { description: \"API Integration\", quantity: 1, unitPrice: 15_000 },\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: \"Innovative PDF Solutions\",\n summary: {\n subtotal: 33_200,\n tax: 2324,\n total: 35_524,\n },\n};\n\nconst 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 boxSizing: \"border-box\",\n minHeight: 841,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n position: \"relative\",\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\nexport const InvoiceModernDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceModernData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceModernContent data={data} />\n </PdfcnThemeProvider>\n);\n",+ "content": "import {\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 \"@/registry/bases/takumi/components\";\nimport {\n View,\n StyleSheet,\n Document,\n Page,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\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: \"Nagpur, IN\",\n companyEmail: \"[email protected]\",\n companyName: \"pdfcn\",\n dueDate: \"March 20, 2026\",\n invoiceDate: \"February 18, 2026\",\n invoiceNumber: \"INV-2026-002\",\n items: [\n { description: \"API Integration\", quantity: 1, unitPrice: 15_000 },\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: \"Innovative PDF Solutions\",\n summary: {\n subtotal: 33_200,\n tax: 2324,\n total: 35_524,\n },\n};\n\nconst 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 boxSizing: \"border-box\",\n minHeight: 841,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n position: \"relative\",\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\nexport const InvoiceModernDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceModernData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceModernContent data={data} />\n </PdfcnThemeProvider>\n);\n","type": "registry:block","target": "components/pdf/blocks/invoice-modern/invoice-modern.tsx"},diff --git a/public/r/takumi/keep-together.json b/public/r/takumi/keep-together.jsonindex b78f901..6110ae7 100644--- a/public/r/takumi/keep-together.json+++ b/public/r/takumi/keep-together.json@@ -13,7 +13,7 @@"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 const KeepTogether = ({ children, style }: KeepTogetherProps) => (\n <View style={[{ breakInside: \"avoid\" }, style].filter(Boolean) as never}>\n {children}\n </View>\n);\n",+ "content": "import type { ReactNode } from \"react\";\n\nimport { View } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/themes\";\n\nexport interface KeepTogetherProps {\n children?: ReactNode;\n minPresenceAhead?: number;\n style?: Style;\n}\n\nexport const KeepTogether = ({ children, style }: KeepTogetherProps) => (\n <View style={[{ breakInside: \"avoid\" }, style].filter(Boolean) as never}>\n {children}\n </View>\n);\n","type": "registry:component","target": "components/pdf/components/keep-together/keep-together.tsx"},diff --git a/public/r/takumi/key-value.json b/public/r/takumi/key-value.jsonindex 052e339..2ea526c 100644--- a/public/r/takumi/key-value.json+++ b/public/r/takumi/key-value.json@@ -13,7 +13,7 @@"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\nconst 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 const 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) {\n containerStyles.push(...[style].flat());\n }\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 }\n if (item.keyStyle) {\n keyStyles.push(item.keyStyle);\n }\n const valStyles: Style[] = [valueStyleMap[size]];\n if (boldValue) {\n valStyles.push(styles.valueBold);\n }\n const resolvedValueColor = item.valueColor ?? valueColor;\n if (resolvedValueColor) {\n valStyles.push({\n color: resolveColor(resolvedValueColor, theme.colors),\n });\n }\n if (item.valueStyle) {\n valStyles.push(item.valueStyle);\n }\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 }\n if (dividerThickness) {\n dividerStyle.borderBottomWidth = dividerThickness;\n }\n if (dividerMargin) {\n dividerStyle.marginBottom = dividerMargin;\n }\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) {\n rowStyles.push(styles.divider);\n }\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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/lib/theme-provider\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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\nconst 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 const 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) {\n containerStyles.push(...[style].flat());\n }\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 }\n if (item.keyStyle) {\n keyStyles.push(item.keyStyle);\n }\n const valStyles: Style[] = [valueStyleMap[size]];\n if (boldValue) {\n valStyles.push(styles.valueBold);\n }\n const resolvedValueColor = item.valueColor ?? valueColor;\n if (resolvedValueColor) {\n valStyles.push({\n color: resolveColor(resolvedValueColor, theme.colors),\n });\n }\n if (item.valueStyle) {\n valStyles.push(item.valueStyle);\n }\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 }\n if (dividerThickness) {\n dividerStyle.borderBottomWidth = dividerThickness;\n }\n if (dividerMargin) {\n dividerStyle.marginBottom = dividerMargin;\n }\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) {\n rowStyles.push(styles.divider);\n }\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","target": "components/pdf/components/key-value/key-value.tsx"},diff --git a/public/r/takumi/link.json b/public/r/takumi/link.jsonindex 86d5cbd..19c0594 100644--- a/public/r/takumi/link.json+++ b/public/r/takumi/link.json@@ -13,7 +13,7 @@"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\nconst 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 const 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 }\n const semantic = {} as Style;\n if (align) {\n semantic.textAlign = align;\n }\n if (color) {\n semantic.color = resolveColor(color, theme.colors);\n }\n if (Object.keys(semantic).length > 0) {\n styleArray.push(semantic);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return (\n <PDFLink src={href} style={styleArray}>\n {children}\n </PDFLink>\n );\n};\n",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/lib/theme-provider\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport {\n StyleSheet,\n Link as PDFLink,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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\nconst 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 const 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 }\n const semantic = {} as Style;\n if (align) {\n semantic.textAlign = align;\n }\n if (color) {\n semantic.color = resolveColor(color, theme.colors);\n }\n if (Object.keys(semantic).length > 0) {\n styleArray.push(semantic);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return (\n <PDFLink src={href} style={styleArray}>\n {children}\n </PDFLink>\n );\n};\n","type": "registry:component","target": "components/pdf/components/link/link.tsx"},diff --git a/public/r/takumi/list.json b/public/r/takumi/list.jsonindex 5549823..bd6a984 100644--- a/public/r/takumi/list.json+++ b/public/r/takumi/list.json@@ -13,19 +13,19 @@"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 const 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 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",+ "content": "import { StyleSheet } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\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 const 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 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","target": "components/pdf/components/list/list.styles.ts"},{"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\nconst getGapStyle = (gap: GapProp, styles: Styles): Style => {\n if (gap === \"xs\") {\n return styles.itemRowGapXs;\n }\n if (gap === \"md\") {\n return styles.itemRowGapMd;\n }\n return styles.itemRowGapSm;\n};\n\nconst 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) {\n row.push(getGapStyle(gap, styles));\n }\n return row;\n};\n\n/** Bullet dot marker — solid filled for level 0, outline ring for nested levels. */\nconst dotMarker = (level: number, styles: Styles): React.ReactElement =>\n 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// eslint-disable-next-line no-use-before-define, prefer-const\nlet renderBulletItem: (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles,\n level: number\n) => React.ReactElement;\n// eslint-disable-next-line no-use-before-define, prefer-const\nlet renderMultiLevelItem: (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles,\n level: number\n) => React.ReactElement;\n\nconst renderNumberedItem = (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement => (\n <View key={index} style={buildRowStyles(index, total, gap, styles, \"center\")}>\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\nconst 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\n style={[styles.checkBox, isChecked ? styles.checkBoxChecked : {}]}\n ></View>\n <View style={styles.itemTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n );\n};\n\nconst renderIconItem = (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement => (\n <View key={index} style={buildRowStyles(index, total, gap, styles, \"center\")}>\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\nconst renderDescriptiveItem = (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement => (\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\nconst 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 default: {\n break;\n }\n }\n return null;\n};\n\nconst renderItemList = (\n items: ListItem[],\n variant: ListVariant,\n gap: GapProp,\n styles: Styles,\n level: number\n): React.ReactElement => (\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\nrenderBulletItem = (item, index, total, gap, styles, level) => (\n <View key={index}>\n <View style={buildRowStyles(index, total, gap, styles)}>\n {dotMarker(level, styles)}\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\nrenderMultiLevelItem = (item, index, total, gap, styles, level) => (\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\nexport const 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) {\n containerStyles.push(styles.childrenContainer);\n }\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",+ "content": "import type React from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/lib/theme-provider\";\nimport {\n View,\n Text as PDFText,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\n\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\nconst getGapStyle = (gap: GapProp, styles: Styles): Style => {\n if (gap === \"xs\") {\n return styles.itemRowGapXs;\n }\n if (gap === \"md\") {\n return styles.itemRowGapMd;\n }\n return styles.itemRowGapSm;\n};\n\nconst 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) {\n row.push(getGapStyle(gap, styles));\n }\n return row;\n};\n\n/** Bullet dot marker — solid filled for level 0, outline ring for nested levels. */\nconst dotMarker = (level: number, styles: Styles): React.ReactElement =>\n 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// eslint-disable-next-line no-use-before-define, prefer-const\nlet renderBulletItem: (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles,\n level: number\n) => React.ReactElement;\n// eslint-disable-next-line no-use-before-define, prefer-const\nlet renderMultiLevelItem: (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles,\n level: number\n) => React.ReactElement;\n\nconst renderNumberedItem = (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement => (\n <View key={index} style={buildRowStyles(index, total, gap, styles, \"center\")}>\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\nconst 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\n style={[styles.checkBox, isChecked ? styles.checkBoxChecked : {}]}\n ></View>\n <View style={styles.itemTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n );\n};\n\nconst renderIconItem = (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement => (\n <View key={index} style={buildRowStyles(index, total, gap, styles, \"center\")}>\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\nconst renderDescriptiveItem = (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement => (\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\nconst 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 default: {\n break;\n }\n }\n return null;\n};\n\nconst renderItemList = (\n items: ListItem[],\n variant: ListVariant,\n gap: GapProp,\n styles: Styles,\n level: number\n): React.ReactElement => (\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\nrenderBulletItem = (item, index, total, gap, styles, level) => (\n <View key={index}>\n <View style={buildRowStyles(index, total, gap, styles)}>\n {dotMarker(level, styles)}\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\nrenderMultiLevelItem = (item, index, total, gap, styles, level) => (\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\nexport const 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) {\n containerStyles.push(styles.childrenContainer);\n }\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","target": "components/pdf/components/list/list.tsx"},{"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",+ "content": "import type { Style } from \"@/registry/bases/takumi/lib/pdfcn-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","target": "components/pdf/components/list/list.types.ts"},diff --git a/public/r/takumi/page-break.json b/public/r/takumi/page-break.jsonindex fd532d8..ec6614a 100644--- a/public/r/takumi/page-break.json+++ b/public/r/takumi/page-break.json@@ -13,7 +13,7 @@"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 const PageBreak = ({ style }: PageBreakProps) => (\n <View style={[{ breakBefore: \"page\" }, style].filter(Boolean) as never} />\n);\n",+ "content": "import { View } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PDFComponentProps } from \"@/registry/themes\";\n\nexport interface PageBreakProps extends Omit<PDFComponentProps, \"children\"> {\n children?: never;\n}\n\nexport const PageBreak = ({ style }: PageBreakProps) => (\n <View style={[{ breakBefore: \"page\" }, style].filter(Boolean) as never} />\n);\n","type": "registry:component","target": "components/pdf/components/page-break/page-break.tsx"},diff --git a/public/r/takumi/page-footer.json b/public/r/takumi/page-footer.jsonindex 328437b..2a36a36 100644--- a/public/r/takumi/page-footer.json+++ b/public/r/takumi/page-footer.json@@ -13,7 +13,7 @@"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\nconst 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\ntype Styles = ReturnType<typeof createPageFooterStyles>;\n\nconst applyTextColor = (\n styles: Style[],\n color: string | undefined\n): Style[] => {\n if (!color) {\n return styles;\n }\n return [...styles, { color }];\n};\n\nconst renderBranded = (\n styles: Styles,\n containerStyles: Style[],\n leftStyle: Style[],\n rightStyle: Style[],\n leftText: string | undefined,\n rightText: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles}>\n {leftText && <PDFText style={leftStyle}>{leftText}</PDFText>}\n {rightText && <PDFText style={rightStyle}>{rightText}</PDFText>}\n </View>\n);\n\nconst renderCentered = (\n styles: Styles,\n containerStyles: Style[],\n textStyle: Style[],\n leftText: string | undefined,\n rightText: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles}>\n {leftText && <PDFText style={textStyle}>{leftText}</PDFText>}\n {rightText && <PDFText style={textStyle}>{rightText}</PDFText>}\n </View>\n);\n\nconst renderThreeColumn = (\n styles: Styles,\n containerStyles: Style[],\n leftStyle: Style[],\n centerStyle: Style[],\n rightStyle: Style[],\n leftText: string | undefined,\n rightText: string | undefined,\n address: string | undefined,\n phone: string | undefined,\n email: string | undefined,\n website: string | undefined,\n noWrap: boolean\n) => (\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\nconst renderDetailed = (\n styles: Styles,\n containerStyles: Style[],\n companyStyle: Style[],\n addrStyle: Style[],\n contactStyle: Style[],\n pageNumStyle: Style[],\n leftText: string | undefined,\n rightText: string | undefined,\n address: string | undefined,\n phone: string | undefined,\n email: string | undefined,\n website: string | undefined,\n noWrap: boolean\n) => (\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 && <PDFText style={contactStyle}>{`Phone: ${phone}`}</PDFText>}\n {email && <PDFText style={contactStyle}>{`Email: ${email}`}</PDFText>}\n {website && <PDFText style={contactStyle}>{`Web: ${website}`}</PDFText>}\n </View>\n </View>\n {rightText && <PDFText style={pageNumStyle}>{rightText}</PDFText>}\n </View>\n);\n\nconst renderMinimal = (\n styles: Styles,\n containerStyles: Style[],\n leftStyle: Style[],\n rightStyle: Style[],\n leftText: string | undefined,\n rightText: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles}>\n {leftText && <PDFText style={leftStyle}>{leftText}</PDFText>}\n {rightText && <PDFText style={rightStyle}>{rightText}</PDFText>}\n </View>\n);\n\nconst renderSimple = (\n styles: Styles,\n containerStyles: Style[],\n leftStyle: Style[],\n centerStyle: Style[],\n rightStyle: Style[],\n leftText: string | undefined,\n centerText: string | undefined,\n rightText: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles}>\n {leftText && <PDFText style={leftStyle}>{leftText}</PDFText>}\n {centerText && <PDFText style={centerStyle}>{centerText}</PDFText>}\n {rightText && <PDFText style={rightStyle}>{rightText}</PDFText>}\n </View>\n);\n\nexport const 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 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 const applyOverrides = (base: Style[]): Style[] => {\n if (background) {\n base.push({ backgroundColor: resolveColor(background, theme.colors) });\n }\n if (style) {\n base.push(style);\n }\n if (sticky) {\n base.push(stickyStyle);\n }\n return base;\n };\n\n const variantRenderers: Record<PageFooterVariant, () => React.ReactNode> = {\n branded: () =>\n renderBranded(\n styles,\n applyOverrides([styles.brandedContainer, { marginTop: mt }]),\n applyTextColor([styles.textBranded], resolvedTextColor),\n applyTextColor([styles.textBrandedRight], resolvedTextColor),\n leftText,\n rightText,\n noWrap\n ),\n centered: () =>\n renderCentered(\n styles,\n applyOverrides([styles.centeredContainer, { marginTop: mt }]),\n applyTextColor([styles.textCenteredVariant], resolvedTextColor),\n leftText,\n rightText,\n noWrap\n ),\n detailed: () =>\n renderDetailed(\n styles,\n applyOverrides([styles.detailedContainer, { marginTop: mt }]),\n applyTextColor([styles.companyBold], resolvedTextColor),\n applyTextColor([styles.textLeft], resolvedTextColor),\n applyTextColor([styles.textRight], resolvedTextColor),\n applyTextColor([styles.detailedPageNumber], resolvedTextColor),\n leftText,\n rightText,\n address,\n phone,\n email,\n website,\n noWrap\n ),\n minimal: () =>\n renderMinimal(\n styles,\n applyOverrides([styles.minimalContainer, { marginTop: mt }]),\n applyTextColor([styles.textLeft], resolvedTextColor),\n applyTextColor([styles.textRight], resolvedTextColor),\n leftText,\n rightText,\n noWrap\n ),\n simple: () =>\n renderSimple(\n styles,\n applyOverrides([styles.simpleContainer, { marginTop: mt }]),\n applyTextColor([styles.textLeft], resolvedTextColor),\n applyTextColor([styles.textCenter], resolvedTextColor),\n applyTextColor([styles.textRight], resolvedTextColor),\n leftText,\n centerText,\n rightText,\n noWrap\n ),\n \"three-column\": () =>\n renderThreeColumn(\n styles,\n applyOverrides([styles.threeColumnContainer, { marginTop: mt }]),\n applyTextColor([styles.companyName], resolvedTextColor),\n applyTextColor([styles.contactInfoCenter], resolvedTextColor),\n applyTextColor([styles.textRight], resolvedTextColor),\n leftText,\n rightText,\n address,\n phone,\n email,\n website,\n noWrap\n ),\n };\n\n return variantRenderers[variant]() as React.ReactNode;\n};\n",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/lib/theme-provider\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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\nconst 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\ntype Styles = ReturnType<typeof createPageFooterStyles>;\n\nconst applyTextColor = (\n styles: Style[],\n color: string | undefined\n): Style[] => {\n if (!color) {\n return styles;\n }\n return [...styles, { color }];\n};\n\nconst renderBranded = (\n styles: Styles,\n containerStyles: Style[],\n leftStyle: Style[],\n rightStyle: Style[],\n leftText: string | undefined,\n rightText: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles}>\n {leftText && <PDFText style={leftStyle}>{leftText}</PDFText>}\n {rightText && <PDFText style={rightStyle}>{rightText}</PDFText>}\n </View>\n);\n\nconst renderCentered = (\n styles: Styles,\n containerStyles: Style[],\n textStyle: Style[],\n leftText: string | undefined,\n rightText: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles}>\n {leftText && <PDFText style={textStyle}>{leftText}</PDFText>}\n {rightText && <PDFText style={textStyle}>{rightText}</PDFText>}\n </View>\n);\n\nconst renderThreeColumn = (\n styles: Styles,\n containerStyles: Style[],\n leftStyle: Style[],\n centerStyle: Style[],\n rightStyle: Style[],\n leftText: string | undefined,\n rightText: string | undefined,\n address: string | undefined,\n phone: string | undefined,\n email: string | undefined,\n website: string | undefined,\n noWrap: boolean\n) => (\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\nconst renderDetailed = (\n styles: Styles,\n containerStyles: Style[],\n companyStyle: Style[],\n addrStyle: Style[],\n contactStyle: Style[],\n pageNumStyle: Style[],\n leftText: string | undefined,\n rightText: string | undefined,\n address: string | undefined,\n phone: string | undefined,\n email: string | undefined,\n website: string | undefined,\n noWrap: boolean\n) => (\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 && <PDFText style={contactStyle}>{`Phone: ${phone}`}</PDFText>}\n {email && <PDFText style={contactStyle}>{`Email: ${email}`}</PDFText>}\n {website && <PDFText style={contactStyle}>{`Web: ${website}`}</PDFText>}\n </View>\n </View>\n {rightText && <PDFText style={pageNumStyle}>{rightText}</PDFText>}\n </View>\n);\n\nconst renderMinimal = (\n styles: Styles,\n containerStyles: Style[],\n leftStyle: Style[],\n rightStyle: Style[],\n leftText: string | undefined,\n rightText: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles}>\n {leftText && <PDFText style={leftStyle}>{leftText}</PDFText>}\n {rightText && <PDFText style={rightStyle}>{rightText}</PDFText>}\n </View>\n);\n\nconst renderSimple = (\n styles: Styles,\n containerStyles: Style[],\n leftStyle: Style[],\n centerStyle: Style[],\n rightStyle: Style[],\n leftText: string | undefined,\n centerText: string | undefined,\n rightText: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles}>\n {leftText && <PDFText style={leftStyle}>{leftText}</PDFText>}\n {centerText && <PDFText style={centerStyle}>{centerText}</PDFText>}\n {rightText && <PDFText style={rightStyle}>{rightText}</PDFText>}\n </View>\n);\n\nexport const 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 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 const applyOverrides = (base: Style[]): Style[] => {\n if (background) {\n base.push({ backgroundColor: resolveColor(background, theme.colors) });\n }\n if (style) {\n base.push(style);\n }\n if (sticky) {\n base.push(stickyStyle);\n }\n return base;\n };\n\n const variantRenderers: Record<PageFooterVariant, () => React.ReactNode> = {\n branded: () =>\n renderBranded(\n styles,\n applyOverrides([styles.brandedContainer, { marginTop: mt }]),\n applyTextColor([styles.textBranded], resolvedTextColor),\n applyTextColor([styles.textBrandedRight], resolvedTextColor),\n leftText,\n rightText,\n noWrap\n ),\n centered: () =>\n renderCentered(\n styles,\n applyOverrides([styles.centeredContainer, { marginTop: mt }]),\n applyTextColor([styles.textCenteredVariant], resolvedTextColor),\n leftText,\n rightText,\n noWrap\n ),\n detailed: () =>\n renderDetailed(\n styles,\n applyOverrides([styles.detailedContainer, { marginTop: mt }]),\n applyTextColor([styles.companyBold], resolvedTextColor),\n applyTextColor([styles.textLeft], resolvedTextColor),\n applyTextColor([styles.textRight], resolvedTextColor),\n applyTextColor([styles.detailedPageNumber], resolvedTextColor),\n leftText,\n rightText,\n address,\n phone,\n email,\n website,\n noWrap\n ),\n minimal: () =>\n renderMinimal(\n styles,\n applyOverrides([styles.minimalContainer, { marginTop: mt }]),\n applyTextColor([styles.textLeft], resolvedTextColor),\n applyTextColor([styles.textRight], resolvedTextColor),\n leftText,\n rightText,\n noWrap\n ),\n simple: () =>\n renderSimple(\n styles,\n applyOverrides([styles.simpleContainer, { marginTop: mt }]),\n applyTextColor([styles.textLeft], resolvedTextColor),\n applyTextColor([styles.textCenter], resolvedTextColor),\n applyTextColor([styles.textRight], resolvedTextColor),\n leftText,\n centerText,\n rightText,\n noWrap\n ),\n \"three-column\": () =>\n renderThreeColumn(\n styles,\n applyOverrides([styles.threeColumnContainer, { marginTop: mt }]),\n applyTextColor([styles.companyName], resolvedTextColor),\n applyTextColor([styles.contactInfoCenter], resolvedTextColor),\n applyTextColor([styles.textRight], resolvedTextColor),\n leftText,\n rightText,\n address,\n phone,\n email,\n website,\n noWrap\n ),\n };\n\n return variantRenderers[variant]() as React.ReactNode;\n};\n","type": "registry:component","target": "components/pdf/components/page-footer/page-footer.tsx"},diff --git a/public/r/takumi/page-header.json b/public/r/takumi/page-header.jsonindex c74749f..d602326 100644--- a/public/r/takumi/page-header.json+++ b/public/r/takumi/page-header.json@@ -13,7 +13,7 @@"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\nconst 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\ntype Styles = ReturnType<typeof createPageHeaderStyles>;\n\nconst buildContainerStyles = (\n base: Style,\n mb: number,\n background: string | undefined,\n theme: PdfcnTheme,\n style: Style | undefined,\n ...extras: Style[]\n): Style[] => {\n const result: Style[] = [base, { marginBottom: mb }, ...extras];\n if (background) {\n result.push({ backgroundColor: resolveColor(background, theme.colors) });\n }\n if (style) {\n result.push(style);\n }\n return result;\n};\n\nconst buildTitleStyles = (\n base: Style[],\n titleColor: string | undefined,\n theme: PdfcnTheme\n): Style[] => {\n if (!titleColor) {\n return base;\n }\n return [...base, { color: resolveColor(titleColor, theme.colors) }];\n};\n\nconst renderBranded = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n noWrap: boolean\n) => (\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\nconst renderCentered = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n noWrap: boolean\n) => (\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\nconst renderLogoRight = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n logo: ReactNode | undefined,\n noWrap: boolean\n) => (\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\nconst renderLogoLeft = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n logo: ReactNode | undefined,\n rightText: string | undefined,\n rightSubText: string | undefined,\n noWrap: boolean\n) => (\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 && <PDFText style={styles.rightText}>{rightText}</PDFText>}\n {rightSubText && (\n <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>\n )}\n </View>\n )}\n </View>\n);\n\nconst renderTwoColumn = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n address: string | undefined,\n phone: string | undefined,\n email: string | undefined,\n noWrap: boolean\n) => (\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\nconst renderMinimal = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n rightText: string | undefined,\n rightSubText: string | undefined,\n noWrap: boolean\n) => (\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 && <PDFText style={styles.rightText}>{rightText}</PDFText>}\n {rightSubText && (\n <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>\n )}\n </View>\n )}\n </View>\n);\n\nconst renderSimple = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n rightText: string | undefined,\n rightSubText: string | undefined,\n noWrap: boolean\n) => (\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\nexport const 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 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 const variantRenderers: Record<PageHeaderVariant, () => React.ReactNode> = {\n branded: () =>\n renderBranded(\n styles,\n buildContainerStyles(\n styles.brandedContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles(\n [styles.title, styles.titleBranded, styles.titleCentered],\n titleColor,\n theme\n ),\n title,\n subtitle,\n noWrap\n ),\n centered: () =>\n renderCentered(\n styles,\n buildContainerStyles(\n styles.centeredContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles(\n [styles.title, styles.titleCentered],\n titleColor,\n theme\n ),\n title,\n subtitle,\n noWrap\n ),\n \"logo-left\": () =>\n renderLogoLeft(\n styles,\n buildContainerStyles(\n styles.logoLeftContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles([styles.title], titleColor, theme),\n title,\n subtitle,\n logo,\n rightText,\n rightSubText,\n noWrap\n ),\n \"logo-right\": () =>\n renderLogoRight(\n styles,\n buildContainerStyles(\n styles.logoRightContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles([styles.title], titleColor, theme),\n title,\n subtitle,\n logo,\n noWrap\n ),\n minimal: () =>\n renderMinimal(\n styles,\n buildContainerStyles(\n styles.minimalContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles(\n [styles.title, styles.titleMinimal],\n titleColor,\n theme\n ),\n title,\n subtitle,\n rightText,\n rightSubText,\n noWrap\n ),\n simple: () =>\n renderSimple(\n styles,\n buildContainerStyles(\n styles.simpleContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles([styles.title], titleColor, theme),\n title,\n subtitle,\n rightText,\n rightSubText,\n noWrap\n ),\n \"two-column\": () =>\n renderTwoColumn(\n styles,\n buildContainerStyles(\n styles.twoColumnContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles([styles.title], titleColor, theme),\n title,\n subtitle,\n address,\n phone,\n email,\n noWrap\n ),\n };\n\n return variantRenderers[variant]() as React.ReactNode;\n};\n",+ "content": "import type { ReactNode } from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/lib/theme-provider\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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\nconst 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\ntype Styles = ReturnType<typeof createPageHeaderStyles>;\n\nconst buildContainerStyles = (\n base: Style,\n mb: number,\n background: string | undefined,\n theme: PdfcnTheme,\n style: Style | undefined,\n ...extras: Style[]\n): Style[] => {\n const result: Style[] = [base, { marginBottom: mb }, ...extras];\n if (background) {\n result.push({ backgroundColor: resolveColor(background, theme.colors) });\n }\n if (style) {\n result.push(style);\n }\n return result;\n};\n\nconst buildTitleStyles = (\n base: Style[],\n titleColor: string | undefined,\n theme: PdfcnTheme\n): Style[] => {\n if (!titleColor) {\n return base;\n }\n return [...base, { color: resolveColor(titleColor, theme.colors) }];\n};\n\nconst renderBranded = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n noWrap: boolean\n) => (\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\nconst renderCentered = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n noWrap: boolean\n) => (\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\nconst renderLogoRight = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n logo: ReactNode | undefined,\n noWrap: boolean\n) => (\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\nconst renderLogoLeft = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n logo: ReactNode | undefined,\n rightText: string | undefined,\n rightSubText: string | undefined,\n noWrap: boolean\n) => (\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 && <PDFText style={styles.rightText}>{rightText}</PDFText>}\n {rightSubText && (\n <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>\n )}\n </View>\n )}\n </View>\n);\n\nconst renderTwoColumn = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n address: string | undefined,\n phone: string | undefined,\n email: string | undefined,\n noWrap: boolean\n) => (\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\nconst renderMinimal = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n rightText: string | undefined,\n rightSubText: string | undefined,\n noWrap: boolean\n) => (\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 && <PDFText style={styles.rightText}>{rightText}</PDFText>}\n {rightSubText && (\n <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>\n )}\n </View>\n )}\n </View>\n);\n\nconst renderSimple = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n rightText: string | undefined,\n rightSubText: string | undefined,\n noWrap: boolean\n) => (\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\nexport const 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 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 const variantRenderers: Record<PageHeaderVariant, () => React.ReactNode> = {\n branded: () =>\n renderBranded(\n styles,\n buildContainerStyles(\n styles.brandedContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles(\n [styles.title, styles.titleBranded, styles.titleCentered],\n titleColor,\n theme\n ),\n title,\n subtitle,\n noWrap\n ),\n centered: () =>\n renderCentered(\n styles,\n buildContainerStyles(\n styles.centeredContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles(\n [styles.title, styles.titleCentered],\n titleColor,\n theme\n ),\n title,\n subtitle,\n noWrap\n ),\n \"logo-left\": () =>\n renderLogoLeft(\n styles,\n buildContainerStyles(\n styles.logoLeftContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles([styles.title], titleColor, theme),\n title,\n subtitle,\n logo,\n rightText,\n rightSubText,\n noWrap\n ),\n \"logo-right\": () =>\n renderLogoRight(\n styles,\n buildContainerStyles(\n styles.logoRightContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles([styles.title], titleColor, theme),\n title,\n subtitle,\n logo,\n noWrap\n ),\n minimal: () =>\n renderMinimal(\n styles,\n buildContainerStyles(\n styles.minimalContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles(\n [styles.title, styles.titleMinimal],\n titleColor,\n theme\n ),\n title,\n subtitle,\n rightText,\n rightSubText,\n noWrap\n ),\n simple: () =>\n renderSimple(\n styles,\n buildContainerStyles(\n styles.simpleContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles([styles.title], titleColor, theme),\n title,\n subtitle,\n rightText,\n rightSubText,\n noWrap\n ),\n \"two-column\": () =>\n renderTwoColumn(\n styles,\n buildContainerStyles(\n styles.twoColumnContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles([styles.title], titleColor, theme),\n title,\n subtitle,\n address,\n phone,\n email,\n noWrap\n ),\n };\n\n return variantRenderers[variant]() as React.ReactNode;\n};\n","type": "registry:component","target": "components/pdf/components/page-header/page-header.tsx"},diff --git a/public/r/takumi/page-number.json b/public/r/takumi/page-number.jsonindex c2ab033..e9c2501 100644--- a/public/r/takumi/page-number.json+++ b/public/r/takumi/page-number.json@@ -13,7 +13,7 @@"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\nconst 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: {\n display: \"flex\",\n flexDirection: \"row\",\n width: \"100%\",\n },\n justifyCenter: { justifyContent: \"center\" },\n justifyLeft: { justifyContent: \"flex-start\" },\n justifyRight: { justifyContent: \"flex-end\" },\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\nconst _formatPageNumber = (\n format: string,\n pageNumber: number,\n totalPages: number\n): string =>\n format\n .replace(\"{page}\", String(pageNumber))\n .replace(\"{total}\", String(totalPages));\n\nexport const PdfPageNumber = ({\n format = \"Page {page} of {total}\",\n align = \"center\",\n size = \"sm\",\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 justifyMap = {\n center: styles.justifyCenter,\n left: styles.justifyLeft,\n right: styles.justifyRight,\n } as Record<PageNumberAlign, Style>;\n const textStyles: Style[] = [\n styles.text,\n alignMap[align],\n sizeMap[size],\n muted ? styles.colorMuted : styles.colorForeground,\n ];\n if (style) {\n textStyles.push(...[style].flat());\n }\n return (\n <View style={[styles.container, justifyMap[align]]}>\n {format.split(/({page}|{total})/).map((part, index) => {\n if (part === \"{page}\") {\n return (\n <PDFText\n key={`page-${index}`}\n className=\"pageNumber\"\n style={textStyles}\n />\n );\n }\n if (part === \"{total}\") {\n return (\n <PDFText\n key={`total-${index}`}\n className=\"totalPages\"\n style={textStyles}\n />\n );\n }\n return (\n <PDFText key={`text-${index}`} style={textStyles}>\n {part}\n </PDFText>\n );\n })}\n </View>\n );\n};\n",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/lib/theme-provider\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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\nconst 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: {\n display: \"flex\",\n flexDirection: \"row\",\n width: \"100%\",\n },\n justifyCenter: { justifyContent: \"center\" },\n justifyLeft: { justifyContent: \"flex-start\" },\n justifyRight: { justifyContent: \"flex-end\" },\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\nconst _formatPageNumber = (\n format: string,\n pageNumber: number,\n totalPages: number\n): string =>\n format\n .replace(\"{page}\", String(pageNumber))\n .replace(\"{total}\", String(totalPages));\n\nexport const PdfPageNumber = ({\n format = \"Page {page} of {total}\",\n align = \"center\",\n size = \"sm\",\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 justifyMap = {\n center: styles.justifyCenter,\n left: styles.justifyLeft,\n right: styles.justifyRight,\n } as Record<PageNumberAlign, Style>;\n const textStyles: Style[] = [\n styles.text,\n alignMap[align],\n sizeMap[size],\n muted ? styles.colorMuted : styles.colorForeground,\n ];\n if (style) {\n textStyles.push(...[style].flat());\n }\n return (\n <View style={[styles.container, justifyMap[align]]}>\n {format.split(/({page}|{total})/).map((part, index) => {\n if (part === \"{page}\") {\n return (\n <PDFText\n key={`page-${index}`}\n className=\"pageNumber\"\n style={textStyles}\n />\n );\n }\n if (part === \"{total}\") {\n return (\n <PDFText\n key={`total-${index}`}\n className=\"totalPages\"\n style={textStyles}\n />\n );\n }\n return (\n <PDFText key={`text-${index}`} style={textStyles}>\n {part}\n </PDFText>\n );\n })}\n </View>\n );\n};\n","type": "registry:component","target": "components/pdf/components/page-number/page-number.tsx"},diff --git a/public/r/takumi/pdf-image.json b/public/r/takumi/pdf-image.jsonindex 6d74980..e134be9 100644--- a/public/r/takumi/pdf-image.json+++ b/public/r/takumi/pdf-image.json@@ -13,7 +13,7 @@"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\nconst detectFormat = (src: PdfImageSrc): string | null => {\n if (typeof src !== \"string\") {\n return null;\n }\n const dataMatch = src.match(/^data:image\\/([a-zA-Z0-9+.-]+)/);\n if (dataMatch) {\n return dataMatch[1].toLowerCase();\n }\n return src.split(\"?\")[0].split(\".\").pop()?.toLowerCase() ?? null;\n};\n\nconst 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\nconst 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 const 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) {\n return height;\n }\n if (defaults.height !== undefined) {\n return defaults.height;\n }\n if (aspectRatio !== undefined && typeof resolvedWidth === \"number\") {\n return resolvedWidth / aspectRatio;\n }\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 }\n if (resolvedHeight !== undefined) {\n imageStyles.push({ height: resolvedHeight } as Style);\n }\n imageStyles.push({\n objectFit: resolvedFit,\n objectPosition: position,\n } as Style);\n if (resolvedRadius !== undefined) {\n imageStyles.push({ borderRadius: resolvedRadius } as Style);\n }\n if (variant === \"bordered\") {\n imageStyles.push(styles.imageBordered);\n }\n if (style) {\n imageStyles.push(style);\n }\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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/lib/theme-provider\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n Image,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\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\nconst detectFormat = (src: PdfImageSrc): string | null => {\n if (typeof src !== \"string\") {\n return null;\n }\n const dataMatch = src.match(/^data:image\\/([a-zA-Z0-9+.-]+)/);\n if (dataMatch) {\n return dataMatch[1].toLowerCase();\n }\n return src.split(\"?\")[0].split(\".\").pop()?.toLowerCase() ?? null;\n};\n\nconst 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\nconst 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 const 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) {\n return height;\n }\n if (defaults.height !== undefined) {\n return defaults.height;\n }\n if (aspectRatio !== undefined && typeof resolvedWidth === \"number\") {\n return resolvedWidth / aspectRatio;\n }\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 }\n if (resolvedHeight !== undefined) {\n imageStyles.push({ height: resolvedHeight } as Style);\n }\n imageStyles.push({\n objectFit: resolvedFit,\n objectPosition: position,\n } as Style);\n if (resolvedRadius !== undefined) {\n imageStyles.push({ borderRadius: resolvedRadius } as Style);\n }\n if (variant === \"bordered\") {\n imageStyles.push(styles.imageBordered);\n }\n if (style) {\n imageStyles.push(style);\n }\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","target": "components/pdf/components/pdf-image/pdf-image.tsx"},diff --git a/public/r/takumi/qrcode.json b/public/r/takumi/qrcode.jsonindex 5345c0b..8f254d9 100644--- a/public/r/takumi/qrcode.json+++ b/public/r/takumi/qrcode.json@@ -14,7 +14,7 @@"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\nconst 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\nconst 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 += 1) {\n const rowData: boolean[] = [];\n for (let col = 0; col < totalSize; col += 1) {\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 const 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) {\n containerStyles.push(...[style].flat());\n }\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",+ "content": "import QRCode from \"qrcode\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/lib/theme-provider\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport { Rect, Svg } from \"@/registry/bases/takumi/lib/pdfcn-svg\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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\nconst 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\nconst 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 += 1) {\n const rowData: boolean[] = [];\n for (let col = 0; col < totalSize; col += 1) {\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 const 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) {\n containerStyles.push(...[style].flat());\n }\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","target": "components/pdf/components/qrcode/qrcode.tsx"},diff --git a/public/r/takumi/report-financial.json b/public/r/takumi/report-financial.jsonindex bd308d5..095eb67 100644--- a/public/r/takumi/report-financial.json+++ b/public/r/takumi/report-financial.json@@ -19,7 +19,7 @@},{"path": "registry/bases/takumi/blocks/report-financial/report-layout.tsx",- "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n Badge,\n DataTable,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\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\nconst toneColor = (\n theme: PdfcnTheme,\n tone: \"success\" | \"warning\" | \"destructive\" | \"info\"\n) => {\n if (tone === \"success\") {\n return theme.colors.success;\n }\n if (tone === \"warning\") {\n return theme.colors.warning;\n }\n if (tone === \"destructive\") {\n return theme.colors.destructive;\n }\n return theme.colors.info;\n};\n\nexport const 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 const deliveryOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 31,\n donut: 65,\n \"horizontal-bar\": -2,\n line: -31,\n pie: 0,\n };\n const graphHeight: Record<ReportGraphVariant, number> = {\n area: 191,\n bar: 184,\n donut: 193,\n \"horizontal-bar\": 163,\n line: 195,\n pie: 191,\n };\n const graphOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 0,\n donut: 0,\n \"horizontal-bar\": 0,\n line: 0,\n pie: 0,\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 boxSizing: \"border-box\",\n minHeight: 841,\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 position: \"relative\",\n },\n pageBreak: {\n breakAfter: \"page\",\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, styles.pageBreak]}>\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 <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\n <Page size=\"A4\" style={[styles.page, styles.pageBreak]}>\n <Section\n padding=\"md\"\n noWrap\n style={\n graphVariant === \"horizontal-bar\" ? { marginTop: -6 } : undefined\n }\n >\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View\n style={[\n styles.graphShell,\n {\n marginTop: graphVariant === \"horizontal-bar\" ? 34 : 0,\n position: \"relative\",\n top: graphOffset[graphVariant],\n },\n ]}\n >\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={graphHeight[graphVariant]}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section\n padding=\"md\"\n style={{\n position: \"relative\",\n top: deliveryOffset[graphVariant],\n }}\n >\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 <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\n <Page size=\"A4\" style={styles.page}>\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: \"Avg 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 </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 const 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) {\n return null;\n }\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",+ "content": "import {\n Badge,\n DataTable,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Text,\n usePdfcnTheme,\n} from \"@/registry/bases/takumi/components\";\nimport {\n View,\n StyleSheet,\n Document,\n Page,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\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\nconst toneColor = (\n theme: PdfcnTheme,\n tone: \"success\" | \"warning\" | \"destructive\" | \"info\"\n) => {\n if (tone === \"success\") {\n return theme.colors.success;\n }\n if (tone === \"warning\") {\n return theme.colors.warning;\n }\n if (tone === \"destructive\") {\n return theme.colors.destructive;\n }\n return theme.colors.info;\n};\n\nexport const 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 const deliveryOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 31,\n donut: 65,\n \"horizontal-bar\": -2,\n line: -31,\n pie: 0,\n };\n const graphHeight: Record<ReportGraphVariant, number> = {\n area: 191,\n bar: 184,\n donut: 193,\n \"horizontal-bar\": 163,\n line: 195,\n pie: 191,\n };\n const graphOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 0,\n donut: 0,\n \"horizontal-bar\": 0,\n line: 0,\n pie: 0,\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 boxSizing: \"border-box\",\n minHeight: 841,\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 position: \"relative\",\n },\n pageBreak: {\n breakAfter: \"page\",\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, styles.pageBreak]}>\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 <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with pdfcn\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </Page>\n\n <Page size=\"A4\" style={[styles.page, styles.pageBreak]}>\n <Section\n padding=\"md\"\n noWrap\n style={\n graphVariant === \"horizontal-bar\" ? { marginTop: -6 } : undefined\n }\n >\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View\n style={[\n styles.graphShell,\n {\n marginTop: graphVariant === \"horizontal-bar\" ? 34 : 0,\n position: \"relative\",\n top: graphOffset[graphVariant],\n },\n ]}\n >\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={graphHeight[graphVariant]}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section\n padding=\"md\"\n style={{\n position: \"relative\",\n top: deliveryOffset[graphVariant],\n }}\n >\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 <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with pdfcn\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </Page>\n\n <Page size=\"A4\" style={styles.page}>\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: \"Avg 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 </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with pdfcn\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </Page>\n </Document>\n );\n};\n\nexport const 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) {\n return null;\n }\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","target": "components/pdf/blocks/report-financial/report-layout.tsx"},diff --git a/public/r/takumi/report-marketing.json b/public/r/takumi/report-marketing.jsonindex 16230d4..a218bd1 100644--- a/public/r/takumi/report-marketing.json+++ b/public/r/takumi/report-marketing.json@@ -13,7 +13,7 @@"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 KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\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\nconst toneColor = (\n theme: PdfcnTheme,\n tone: \"success\" | \"warning\" | \"destructive\" | \"info\"\n) => {\n if (tone === \"success\") {\n return theme.colors.success;\n }\n if (tone === \"warning\") {\n return theme.colors.warning;\n }\n if (tone === \"destructive\") {\n return theme.colors.destructive;\n }\n return theme.colors.info;\n};\n\nexport const 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 const deliveryOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 31,\n donut: 65,\n \"horizontal-bar\": -2,\n line: -31,\n pie: 0,\n };\n const graphHeight: Record<ReportGraphVariant, number> = {\n area: 191,\n bar: 184,\n donut: 193,\n \"horizontal-bar\": 163,\n line: 195,\n pie: 191,\n };\n const graphOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 0,\n donut: 0,\n \"horizontal-bar\": 0,\n line: 0,\n pie: 0,\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 boxSizing: \"border-box\",\n minHeight: 841,\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 position: \"relative\",\n },\n pageBreak: {\n breakAfter: \"page\",\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, styles.pageBreak]}>\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 <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\n <Page size=\"A4\" style={[styles.page, styles.pageBreak]}>\n <Section\n padding=\"md\"\n noWrap\n style={\n graphVariant === \"horizontal-bar\" ? { marginTop: -6 } : undefined\n }\n >\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View\n style={[\n styles.graphShell,\n {\n marginTop: graphVariant === \"horizontal-bar\" ? 34 : 0,\n position: \"relative\",\n top: graphOffset[graphVariant],\n },\n ]}\n >\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={graphHeight[graphVariant]}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section\n padding=\"md\"\n style={{\n position: \"relative\",\n top: deliveryOffset[graphVariant],\n }}\n >\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 <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\n <Page size=\"A4\" style={styles.page}>\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: \"Avg 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 </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 const 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) {\n return null;\n }\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",+ "content": "import {\n Badge,\n DataTable,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Text,\n usePdfcnTheme,\n} from \"@/registry/bases/takumi/components\";\nimport {\n View,\n StyleSheet,\n Document,\n Page,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\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\nconst toneColor = (\n theme: PdfcnTheme,\n tone: \"success\" | \"warning\" | \"destructive\" | \"info\"\n) => {\n if (tone === \"success\") {\n return theme.colors.success;\n }\n if (tone === \"warning\") {\n return theme.colors.warning;\n }\n if (tone === \"destructive\") {\n return theme.colors.destructive;\n }\n return theme.colors.info;\n};\n\nexport const 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 const deliveryOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 31,\n donut: 65,\n \"horizontal-bar\": -2,\n line: -31,\n pie: 0,\n };\n const graphHeight: Record<ReportGraphVariant, number> = {\n area: 191,\n bar: 184,\n donut: 193,\n \"horizontal-bar\": 163,\n line: 195,\n pie: 191,\n };\n const graphOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 0,\n donut: 0,\n \"horizontal-bar\": 0,\n line: 0,\n pie: 0,\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 boxSizing: \"border-box\",\n minHeight: 841,\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 position: \"relative\",\n },\n pageBreak: {\n breakAfter: \"page\",\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, styles.pageBreak]}>\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 <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with pdfcn\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </Page>\n\n <Page size=\"A4\" style={[styles.page, styles.pageBreak]}>\n <Section\n padding=\"md\"\n noWrap\n style={\n graphVariant === \"horizontal-bar\" ? { marginTop: -6 } : undefined\n }\n >\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View\n style={[\n styles.graphShell,\n {\n marginTop: graphVariant === \"horizontal-bar\" ? 34 : 0,\n position: \"relative\",\n top: graphOffset[graphVariant],\n },\n ]}\n >\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={graphHeight[graphVariant]}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section\n padding=\"md\"\n style={{\n position: \"relative\",\n top: deliveryOffset[graphVariant],\n }}\n >\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 <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with pdfcn\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </Page>\n\n <Page size=\"A4\" style={styles.page}>\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: \"Avg 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 </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with pdfcn\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </Page>\n </Document>\n );\n};\n\nexport const 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) {\n return null;\n }\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","target": "components/pdf/blocks/report-marketing/report-layout.tsx"},diff --git a/public/r/takumi/report-operations.json b/public/r/takumi/report-operations.jsonindex 7a98fb0..2280e5c 100644--- a/public/r/takumi/report-operations.json+++ b/public/r/takumi/report-operations.json@@ -13,7 +13,7 @@"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 KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\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\nconst toneColor = (\n theme: PdfcnTheme,\n tone: \"success\" | \"warning\" | \"destructive\" | \"info\"\n) => {\n if (tone === \"success\") {\n return theme.colors.success;\n }\n if (tone === \"warning\") {\n return theme.colors.warning;\n }\n if (tone === \"destructive\") {\n return theme.colors.destructive;\n }\n return theme.colors.info;\n};\n\nexport const 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 const deliveryOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 31,\n donut: 65,\n \"horizontal-bar\": -2,\n line: -31,\n pie: 0,\n };\n const graphHeight: Record<ReportGraphVariant, number> = {\n area: 191,\n bar: 184,\n donut: 193,\n \"horizontal-bar\": 163,\n line: 195,\n pie: 191,\n };\n const graphOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 0,\n donut: 0,\n \"horizontal-bar\": 0,\n line: 0,\n pie: 0,\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 boxSizing: \"border-box\",\n minHeight: 841,\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 position: \"relative\",\n },\n pageBreak: {\n breakAfter: \"page\",\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, styles.pageBreak]}>\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 <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\n <Page size=\"A4\" style={[styles.page, styles.pageBreak]}>\n <Section\n padding=\"md\"\n noWrap\n style={\n graphVariant === \"horizontal-bar\" ? { marginTop: -6 } : undefined\n }\n >\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View\n style={[\n styles.graphShell,\n {\n marginTop: graphVariant === \"horizontal-bar\" ? 34 : 0,\n position: \"relative\",\n top: graphOffset[graphVariant],\n },\n ]}\n >\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={graphHeight[graphVariant]}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section\n padding=\"md\"\n style={{\n position: \"relative\",\n top: deliveryOffset[graphVariant],\n }}\n >\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 <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\n <Page size=\"A4\" style={styles.page}>\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: \"Avg 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 </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 const 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) {\n return null;\n }\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",+ "content": "import {\n Badge,\n DataTable,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Text,\n usePdfcnTheme,\n} from \"@/registry/bases/takumi/components\";\nimport {\n View,\n StyleSheet,\n Document,\n Page,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\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\nconst toneColor = (\n theme: PdfcnTheme,\n tone: \"success\" | \"warning\" | \"destructive\" | \"info\"\n) => {\n if (tone === \"success\") {\n return theme.colors.success;\n }\n if (tone === \"warning\") {\n return theme.colors.warning;\n }\n if (tone === \"destructive\") {\n return theme.colors.destructive;\n }\n return theme.colors.info;\n};\n\nexport const 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 const deliveryOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 31,\n donut: 65,\n \"horizontal-bar\": -2,\n line: -31,\n pie: 0,\n };\n const graphHeight: Record<ReportGraphVariant, number> = {\n area: 191,\n bar: 184,\n donut: 193,\n \"horizontal-bar\": 163,\n line: 195,\n pie: 191,\n };\n const graphOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 0,\n donut: 0,\n \"horizontal-bar\": 0,\n line: 0,\n pie: 0,\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 boxSizing: \"border-box\",\n minHeight: 841,\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 position: \"relative\",\n },\n pageBreak: {\n breakAfter: \"page\",\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, styles.pageBreak]}>\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 <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with pdfcn\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </Page>\n\n <Page size=\"A4\" style={[styles.page, styles.pageBreak]}>\n <Section\n padding=\"md\"\n noWrap\n style={\n graphVariant === \"horizontal-bar\" ? { marginTop: -6 } : undefined\n }\n >\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View\n style={[\n styles.graphShell,\n {\n marginTop: graphVariant === \"horizontal-bar\" ? 34 : 0,\n position: \"relative\",\n top: graphOffset[graphVariant],\n },\n ]}\n >\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={graphHeight[graphVariant]}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section\n padding=\"md\"\n style={{\n position: \"relative\",\n top: deliveryOffset[graphVariant],\n }}\n >\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 <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with pdfcn\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </Page>\n\n <Page size=\"A4\" style={styles.page}>\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: \"Avg 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 </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with pdfcn\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </Page>\n </Document>\n );\n};\n\nexport const 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) {\n return null;\n }\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","target": "components/pdf/blocks/report-operations/report-layout.tsx"},diff --git a/public/r/takumi/report-security.json b/public/r/takumi/report-security.jsonindex 64182e5..d57fc97 100644--- a/public/r/takumi/report-security.json+++ b/public/r/takumi/report-security.json@@ -13,7 +13,7 @@"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 KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\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\nconst toneColor = (\n theme: PdfcnTheme,\n tone: \"success\" | \"warning\" | \"destructive\" | \"info\"\n) => {\n if (tone === \"success\") {\n return theme.colors.success;\n }\n if (tone === \"warning\") {\n return theme.colors.warning;\n }\n if (tone === \"destructive\") {\n return theme.colors.destructive;\n }\n return theme.colors.info;\n};\n\nexport const 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 const deliveryOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 31,\n donut: 65,\n \"horizontal-bar\": -2,\n line: -31,\n pie: 0,\n };\n const graphHeight: Record<ReportGraphVariant, number> = {\n area: 191,\n bar: 184,\n donut: 193,\n \"horizontal-bar\": 163,\n line: 195,\n pie: 191,\n };\n const graphOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 0,\n donut: 0,\n \"horizontal-bar\": 0,\n line: 0,\n pie: 0,\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 boxSizing: \"border-box\",\n minHeight: 841,\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 position: \"relative\",\n },\n pageBreak: {\n breakAfter: \"page\",\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, styles.pageBreak]}>\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 <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\n <Page size=\"A4\" style={[styles.page, styles.pageBreak]}>\n <Section\n padding=\"md\"\n noWrap\n style={\n graphVariant === \"horizontal-bar\" ? { marginTop: -6 } : undefined\n }\n >\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View\n style={[\n styles.graphShell,\n {\n marginTop: graphVariant === \"horizontal-bar\" ? 34 : 0,\n position: \"relative\",\n top: graphOffset[graphVariant],\n },\n ]}\n >\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={graphHeight[graphVariant]}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section\n padding=\"md\"\n style={{\n position: \"relative\",\n top: deliveryOffset[graphVariant],\n }}\n >\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 <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\n <Page size=\"A4\" style={styles.page}>\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: \"Avg 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 </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 const 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) {\n return null;\n }\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",+ "content": "import {\n Badge,\n DataTable,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Text,\n usePdfcnTheme,\n} from \"@/registry/bases/takumi/components\";\nimport {\n View,\n StyleSheet,\n Document,\n Page,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\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\nconst toneColor = (\n theme: PdfcnTheme,\n tone: \"success\" | \"warning\" | \"destructive\" | \"info\"\n) => {\n if (tone === \"success\") {\n return theme.colors.success;\n }\n if (tone === \"warning\") {\n return theme.colors.warning;\n }\n if (tone === \"destructive\") {\n return theme.colors.destructive;\n }\n return theme.colors.info;\n};\n\nexport const 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 const deliveryOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 31,\n donut: 65,\n \"horizontal-bar\": -2,\n line: -31,\n pie: 0,\n };\n const graphHeight: Record<ReportGraphVariant, number> = {\n area: 191,\n bar: 184,\n donut: 193,\n \"horizontal-bar\": 163,\n line: 195,\n pie: 191,\n };\n const graphOffset: Record<ReportGraphVariant, number> = {\n area: 0,\n bar: 0,\n donut: 0,\n \"horizontal-bar\": 0,\n line: 0,\n pie: 0,\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 boxSizing: \"border-box\",\n minHeight: 841,\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 position: \"relative\",\n },\n pageBreak: {\n breakAfter: \"page\",\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, styles.pageBreak]}>\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 <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with pdfcn\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </Page>\n\n <Page size=\"A4\" style={[styles.page, styles.pageBreak]}>\n <Section\n padding=\"md\"\n noWrap\n style={\n graphVariant === \"horizontal-bar\" ? { marginTop: -6 } : undefined\n }\n >\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View\n style={[\n styles.graphShell,\n {\n marginTop: graphVariant === \"horizontal-bar\" ? 34 : 0,\n position: \"relative\",\n top: graphOffset[graphVariant],\n },\n ]}\n >\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={graphHeight[graphVariant]}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section\n padding=\"md\"\n style={{\n position: \"relative\",\n top: deliveryOffset[graphVariant],\n }}\n >\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 <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with pdfcn\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </Page>\n\n <Page size=\"A4\" style={styles.page}>\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: \"Avg 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 </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with pdfcn\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </Page>\n </Document>\n );\n};\n\nexport const 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) {\n return null;\n }\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","target": "components/pdf/blocks/report-security/report-layout.tsx"},diff --git a/public/r/takumi/section.json b/public/r/takumi/section.jsonindex e2a88d1..d6bb9f4 100644--- a/public/r/takumi/section.json+++ b/public/r/takumi/section.json@@ -13,7 +13,7 @@"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\nconst 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 const Section = ({\n spacing = \"md\",\n padding,\n background,\n border,\n variant = \"default\",\n accentColor,\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) {\n styleArray.push(variantStyle);\n }\n if (accentColor && (variant === \"callout\" || variant === \"highlight\")) {\n styleArray.push({\n borderLeftColor: resolveColor(accentColor, theme.colors),\n });\n }\n if (padding && padding in paddingMap) {\n styleArray.push(paddingMap[padding]);\n }\n if (border && variant === \"default\") {\n styleArray.push(styles.border);\n }\n if (background) {\n styleArray.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return <View style={styleArray}>{children}</View>;\n};\n",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/lib/theme-provider\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport {\n View,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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\nconst 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 const Section = ({\n spacing = \"md\",\n padding,\n background,\n border,\n variant = \"default\",\n accentColor,\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) {\n styleArray.push(variantStyle);\n }\n if (accentColor && (variant === \"callout\" || variant === \"highlight\")) {\n styleArray.push({\n borderLeftColor: resolveColor(accentColor, theme.colors),\n });\n }\n if (padding && padding in paddingMap) {\n styleArray.push(paddingMap[padding]);\n }\n if (border && variant === \"default\") {\n styleArray.push(styles.border);\n }\n if (background) {\n styleArray.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return <View style={styleArray}>{children}</View>;\n};\n","type": "registry:component","target": "components/pdf/components/section/section.tsx"},diff --git a/public/r/takumi/signature.json b/public/r/takumi/signature.jsonindex 4383f8a..900fd6d 100644--- a/public/r/takumi/signature.json+++ b/public/r/takumi/signature.json@@ -13,7 +13,7 @@"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\nconst 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\nconst renderSignerBlock = (\n signer: SignatureSigner,\n styles: ReturnType<typeof createSignatureStyles>\n) => (\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 ? <PDFText style={styles.name}>{signer.name}</PDFText> : 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\nexport const 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) {\n containerStyles.push(style);\n }\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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/lib/theme-provider\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PdfcnTheme } from \"@/registry/themes\";\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\nconst 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\nconst renderSignerBlock = (\n signer: SignatureSigner,\n styles: ReturnType<typeof createSignatureStyles>\n) => (\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 ? <PDFText style={styles.name}>{signer.name}</PDFText> : 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\nexport const 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) {\n containerStyles.push(style);\n }\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","target": "components/pdf/components/signature/signature.tsx"},diff --git a/public/r/takumi/stack.json b/public/r/takumi/stack.jsonindex 25f0bdc..3a67614 100644--- a/public/r/takumi/stack.json+++ b/public/r/takumi/stack.json@@ -13,7 +13,7 @@"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\nconst 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 const Stack = ({\n gap = \"md\",\n direction = \"vertical\",\n align,\n justify,\n wrap,\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) {\n styleArray.push(alignMap[align]);\n }\n if (justify && justify in justifyMap) {\n styleArray.push(justifyMap[justify]);\n }\n if (wrap) {\n styleArray.push(styles.wrap);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return <View style={styleArray}>{children}</View>;\n};\n",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/lib/theme-provider\";\nimport {\n View,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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\nconst 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 const Stack = ({\n gap = \"md\",\n direction = \"vertical\",\n align,\n justify,\n wrap,\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) {\n styleArray.push(alignMap[align]);\n }\n if (justify && justify in justifyMap) {\n styleArray.push(justifyMap[justify]);\n }\n if (wrap) {\n styleArray.push(styles.wrap);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return <View style={styleArray}>{children}</View>;\n};\n","type": "registry:component","target": "components/pdf/components/stack/stack.tsx"},diff --git a/public/r/takumi/table.json b/public/r/takumi/table.jsonindex 80089dd..49b1331 100644--- a/public/r/takumi/table.json+++ b/public/r/takumi/table.json@@ -13,13 +13,13 @@"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 const 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 // eslint-disable-next-line prefer-destructuring\n const cellPadVCompact = spacing[0.5];\n // eslint-disable-next-line prefer-destructuring\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,\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,\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",+ "content": "import { StyleSheet } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\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 const 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 // eslint-disable-next-line prefer-destructuring\n const cellPadVCompact = spacing[0.5];\n // eslint-disable-next-line prefer-destructuring\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,\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,\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","target": "components/pdf/components/table/table.styles.ts"},{"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\nexport const TableHeader = ({ children, style }: TableSectionProps) => (\n <View style={style}>{children}</View>\n);\n\nexport const TableBody = ({ children, style }: TableSectionProps) => (\n <View style={style}>{children}</View>\n);\n\nexport const TableFooter = ({ children, style }: TableSectionProps) => (\n <View style={style}>{children}</View>\n);\n\nexport const 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.cell]\n : [styles.cellFixed, { width } as Style];\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) {\n cellStyles.push(cellVariantStyle);\n }\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\nexport const 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[] = [\n styles.row,\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\") {\n rowStyles.push(styles.rowFooterStriped);\n } else {\n rowStyles.push(styles.rowFooter);\n }\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\nconst 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)) {\n return child;\n }\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 += 1;\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 const 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",+ "content": "import { Children, cloneElement, isValidElement } from \"react\";\nimport type { ReactElement, ReactNode } from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/lib/theme-provider\";\nimport {\n View,\n Text as PDFText,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\n\nimport { createTableStyles } from \"./table.styles\";\nimport type {\n TableCellProps,\n TableProps,\n TableRowProps,\n TableSectionProps,\n TableVariant,\n} from \"./table.types\";\n\nexport const TableHeader = ({ children, style }: TableSectionProps) => (\n <View style={style}>{children}</View>\n);\n\nexport const TableBody = ({ children, style }: TableSectionProps) => (\n <View style={style}>{children}</View>\n);\n\nexport const TableFooter = ({ children, style }: TableSectionProps) => (\n <View style={style}>{children}</View>\n);\n\nexport const 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.cell]\n : [styles.cellFixed, { width } as Style];\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) {\n cellStyles.push(cellVariantStyle);\n }\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\nexport const 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[] = [\n styles.row,\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\") {\n rowStyles.push(styles.rowFooterStriped);\n } else {\n rowStyles.push(styles.rowFooter);\n }\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\nconst 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)) {\n return child;\n }\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 += 1;\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 const 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","type": "registry:component","target": "components/pdf/components/table/table.tsx"},diff --git a/public/r/takumi/text.json b/public/r/takumi/text.jsonindex 1c7be23..04d4a6e 100644--- a/public/r/takumi/text.json+++ b/public/r/takumi/text.json@@ -13,7 +13,7 @@"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\nconst 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 const 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) {\n styleArray.push(weightMap[weight]);\n }\n if (italic) {\n styleArray.push(styles.italic);\n }\n if (decoration && decoration in decorationMap) {\n styleArray.push(decorationMap[decoration]);\n }\n if (transform && transform in transformMap) {\n styleArray.push(transformMap[transform]);\n }\n if (noMargin) {\n styleArray.push(styles.noMargin);\n }\n const semantic = {} as Style;\n if (align) {\n semantic.textAlign = align;\n }\n if (color) {\n semantic.color = resolveColor(color, theme.colors);\n }\n if (Object.keys(semantic).length > 0) {\n styleArray.push(semantic);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return <PDFText style={styleArray}>{children}</PDFText>;\n};\n",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/lib/theme-provider\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport {\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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\nconst 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 const 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) {\n styleArray.push(weightMap[weight]);\n }\n if (italic) {\n styleArray.push(styles.italic);\n }\n if (decoration && decoration in decorationMap) {\n styleArray.push(decorationMap[decoration]);\n }\n if (transform && transform in transformMap) {\n styleArray.push(transformMap[transform]);\n }\n if (noMargin) {\n styleArray.push(styles.noMargin);\n }\n const semantic = {} as Style;\n if (align) {\n semantic.textAlign = align;\n }\n if (color) {\n semantic.color = resolveColor(color, theme.colors);\n }\n if (Object.keys(semantic).length > 0) {\n styleArray.push(semantic);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return <PDFText style={styleArray}>{children}</PDFText>;\n};\n","type": "registry:component","target": "components/pdf/components/text/text.tsx"},diff --git a/public/r/takumi/theme-blueprint.json b/public/r/takumi/theme-blueprint.jsonindex 01d6a4b..d694aa6 100644--- a/public/r/takumi/theme-blueprint.json+++ b/public/r/takumi/theme-blueprint.json@@ -22,7 +22,7 @@},{"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",+ "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/pdfcn-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"},diff --git a/public/r/takumi/theme-corporate.json b/public/r/takumi/theme-corporate.jsonindex a34b2dc..b904b8c 100644--- a/public/r/takumi/theme-corporate.json+++ b/public/r/takumi/theme-corporate.json@@ -22,7 +22,7 @@},{"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",+ "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/pdfcn-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"},diff --git a/public/r/takumi/theme-elegant.json b/public/r/takumi/theme-elegant.jsonindex dd11180..9d21ae3 100644--- a/public/r/takumi/theme-elegant.json+++ b/public/r/takumi/theme-elegant.json@@ -22,7 +22,7 @@},{"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",+ "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/pdfcn-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"},diff --git a/public/r/takumi/theme-executive.json b/public/r/takumi/theme-executive.jsonindex b1c8387..28cfe95 100644--- a/public/r/takumi/theme-executive.json+++ b/public/r/takumi/theme-executive.json@@ -22,7 +22,7 @@},{"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",+ "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/pdfcn-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"},diff --git a/public/r/takumi/theme-forest.json b/public/r/takumi/theme-forest.jsonindex a005289..bdb5c54 100644--- a/public/r/takumi/theme-forest.json+++ b/public/r/takumi/theme-forest.json@@ -22,7 +22,7 @@},{"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",+ "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/pdfcn-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"},diff --git a/public/r/takumi/theme-minimal.json b/public/r/takumi/theme-minimal.jsonindex 30ea127..aad6fd6 100644--- a/public/r/takumi/theme-minimal.json+++ b/public/r/takumi/theme-minimal.json@@ -22,7 +22,7 @@},{"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",+ "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/pdfcn-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"},diff --git a/public/r/takumi/theme-modern.json b/public/r/takumi/theme-modern.jsonindex f49bcfc..4932a1e 100644--- a/public/r/takumi/theme-modern.json+++ b/public/r/takumi/theme-modern.json@@ -22,7 +22,7 @@},{"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",+ "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/pdfcn-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"},diff --git a/public/r/takumi/theme-professional.json b/public/r/takumi/theme-professional.jsonindex b364f21..6220a38 100644--- a/public/r/takumi/theme-professional.json+++ b/public/r/takumi/theme-professional.json@@ -22,7 +22,7 @@},{"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",+ "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/pdfcn-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"},diff --git a/public/r/takumi/theme-vivid.json b/public/r/takumi/theme-vivid.jsonindex 5e37b15..0d5810c 100644--- a/public/r/takumi/theme-vivid.json+++ b/public/r/takumi/theme-vivid.json@@ -22,7 +22,7 @@},{"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",+ "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/pdfcn-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"},diff --git a/public/r/takumi/utils.json b/public/r/takumi/utils.jsonindex ef9e5ec..c12bf1f 100644--- a/public/r/takumi/utils.json+++ b/public/r/takumi/utils.json@@ -14,29 +14,11 @@"type": "registry:lib","target": "components/pdf/lib/pdfcn-theme.ts"},- {- "path": "registry/bases/takumi/lib/pdfcn-theme-context.tsx",- "content": "/* eslint-disable react-refresh/only-export-components */\n// Exports both a component (PdfcnThemeProvider) and theme helpers intentionally.\n// All PDF components import from a single file — splitting would break the public API.\n\nimport { isValidElement } from \"react\";\nimport type { DependencyList, ReactNode } from \"react\";\n\nimport { theme as defaultTheme } from \"./pdfcn-theme\";\n\nexport type PdfcnTheme = typeof defaultTheme;\n\nlet serializedTheme = defaultTheme;\n\nexport interface PdfcnThemeProviderProps {\n theme?: PdfcnTheme;\n children: ReactNode;\n}\n\n/**\n * Takumi converts function components directly instead of mounting a React\n * tree. Resolve the provider's child so the converter receives PDF markup.\n */\nconst renderForSerializer = (\n children: ReactNode,\n theme: PdfcnTheme\n): ReactNode => {\n serializedTheme = theme;\n\n if (!isValidElement(children) || typeof children.type !== \"function\") {\n return children;\n }\n\n return (children.type as (props: unknown) => ReactNode)(children.props);\n};\n\nexport const PdfcnThemeProvider = ({\n theme,\n children,\n}: PdfcnThemeProviderProps) =>\n renderForSerializer(children, theme ?? defaultTheme);\n\n/** Returns the theme selected by the nearest serialized provider. */\nexport const usePdfcnTheme = (): PdfcnTheme => serializedTheme;\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 const useSafeMemo = <T,>(factory: () => T, _deps: DependencyList): T =>\n factory();\n",- "type": "registry:lib",- "target": "components/pdf/lib/pdfcn-theme-context.tsx"- },{"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 const 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","target": "components/pdf/lib/resolve-color.ts"- },- {- "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\n/**\n * pdfcn's shared component tokens follow the PDF convention of using points.\n * Takumi follows browser CSS instead, where numeric lengths are pixels at\n * 96 DPI. Converting at the primitive boundary keeps the public component API\n * and the generated document's physical measurements aligned with Forme.\n */\nexport const PDF_POINT_TO_CSS_PIXEL = 96 / 72;\n\nexport const pointToCssPixel = (value: number): number =>\n value * PDF_POINT_TO_CSS_PIXEL;\n\nconst POINT_LENGTH_PROPERTIES = new Set([\n \"blockSize\",\n \"borderBlockEndWidth\",\n \"borderBlockStartWidth\",\n \"borderBlockWidth\",\n \"borderBottomLeftRadius\",\n \"borderBottomRightRadius\",\n \"borderBottomWidth\",\n \"borderEndEndRadius\",\n \"borderEndStartRadius\",\n \"borderInlineEndWidth\",\n \"borderInlineStartWidth\",\n \"borderInlineWidth\",\n \"borderLeftWidth\",\n \"borderRadius\",\n \"borderRightWidth\",\n \"borderStartEndRadius\",\n \"borderStartStartRadius\",\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderTopWidth\",\n \"borderWidth\",\n \"bottom\",\n \"columnGap\",\n \"flexBasis\",\n \"fontSize\",\n \"gap\",\n \"height\",\n \"inlineSize\",\n \"inset\",\n \"insetBlock\",\n \"insetBlockEnd\",\n \"insetBlockStart\",\n \"insetInline\",\n \"insetInlineEnd\",\n \"insetInlineStart\",\n \"left\",\n \"letterSpacing\",\n \"margin\",\n \"marginBlock\",\n \"marginBlockEnd\",\n \"marginBlockStart\",\n \"marginBottom\",\n \"marginInline\",\n \"marginInlineEnd\",\n \"marginInlineStart\",\n \"marginLeft\",\n \"marginRight\",\n \"marginTop\",\n \"maxBlockSize\",\n \"maxHeight\",\n \"maxInlineSize\",\n \"maxWidth\",\n \"minBlockSize\",\n \"minHeight\",\n \"minInlineSize\",\n \"minWidth\",\n \"outlineOffset\",\n \"outlineWidth\",\n \"padding\",\n \"paddingBlock\",\n \"paddingBlockEnd\",\n \"paddingBlockStart\",\n \"paddingBottom\",\n \"paddingInline\",\n \"paddingInlineEnd\",\n \"paddingInlineStart\",\n \"paddingLeft\",\n \"paddingRight\",\n \"paddingTop\",\n \"right\",\n \"rowGap\",\n \"textDecorationThickness\",\n \"textIndent\",\n \"top\",\n \"width\",\n]);\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\nexport const normalizeTakumiStyle = (style: Style): Style => {\n const {\n marginHorizontal,\n marginVertical,\n paddingHorizontal,\n paddingVertical,\n ...normalized\n } = style;\n\n if (marginHorizontal !== undefined) {\n normalized.marginLeft ??= marginHorizontal;\n normalized.marginRight ??= marginHorizontal;\n }\n if (marginVertical !== undefined) {\n normalized.marginBottom ??= marginVertical;\n normalized.marginTop ??= marginVertical;\n }\n if (paddingHorizontal !== undefined) {\n normalized.paddingLeft ??= paddingHorizontal;\n normalized.paddingRight ??= paddingHorizontal;\n }\n if (paddingVertical !== undefined) {\n normalized.paddingBottom ??= paddingVertical;\n normalized.paddingTop ??= paddingVertical;\n }\n\n const borderSides = [\"Top\", \"Right\", \"Bottom\", \"Left\"] as const;\n if (normalized.borderWidth !== undefined) {\n normalized.borderStyle ??= \"solid\";\n }\n for (const side of borderSides) {\n if (normalized[`border${side}Width`] !== undefined) {\n normalized[`border${side}Style`] ??= \"solid\";\n }\n }\n\n return Object.fromEntries(\n Object.entries(normalized).map(([property, value]) => [\n property,\n typeof value === \"number\" && POINT_LENGTH_PROPERTIES.has(property)\n ? pointToCssPixel(value)\n : value,\n ])\n );\n};\n\nconst flatten = (style?: StyleInput): Record<string, unknown> | undefined => {\n if (!style) {\n return undefined;\n }\n if (Array.isArray(style)) {\n return normalizeTakumiStyle(Object.assign({}, ...style.filter(Boolean)));\n }\n return normalizeTakumiStyle(style);\n};\n\nexport const 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 = {\n display: \"flex\",\n flexDirection: \"column\",\n ...flatten(style),\n };\n if (br) {\n Object.assign(merged, { breakBefore: \"page\" });\n }\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 const 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 const 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 const 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 <a href={src} style={flatten(style) as React.CSSProperties} {...rest}>\n {children}\n </a>\n);\n\nexport const Document = ({\n children,\n title,\n style,\n}: {\n children?: ReactNode;\n title?: string;\n style?: StyleInput;\n}) => (\n <div\n data-pdf-document={title}\n style={\n {\n display: \"flex\",\n flexDirection: \"column\",\n ...flatten(style),\n } as React.CSSProperties\n }\n >\n {children}\n </div>\n);\n\nexport const Page = ({\n children,\n size: _size,\n style,\n}: {\n children?: ReactNode;\n size?: string | { width: number; height: number };\n style?: StyleInput;\n}) => (\n <div\n data-pdf-page\n style={\n {\n display: \"flex\",\n flexDirection: \"column\",\n ...flatten(style),\n } as React.CSSProperties\n }\n >\n {children}\n </div>\n);\n",- "type": "registry:lib",- "target": "components/pdf/lib/takumi-primitives.tsx"- },- {- "path": "registry/bases/takumi/lib/takumi-svg.tsx",- "content": "import { Children, Fragment, cloneElement, isValidElement } from \"react\";\nimport type { CSSProperties, ReactNode, SVGProps } from \"react\";\n\nimport { normalizeTakumiStyle, pointToCssPixel } from \"./takumi-primitives\";\n\ntype SvgChildProps = Record<string, unknown> & {\n children?: ReactNode;\n};\n\nconst resolveSvgChildren = (children: ReactNode): ReactNode =>\n Children.map(children, (child) => {\n if (!isValidElement<SvgChildProps>(child)) {\n return child;\n }\n\n if (typeof child.type === \"function\") {\n const resolved = (child.type as (props: SvgChildProps) => ReactNode)(\n child.props\n );\n return resolveSvgChildren(resolved);\n }\n\n if ((child.type as unknown) === Fragment) {\n return resolveSvgChildren(child.props.children);\n }\n\n if (child.props.children === undefined) {\n return child;\n }\n\n return cloneElement(\n child,\n undefined,\n resolveSvgChildren(child.props.children)\n );\n });\n\nexport const Svg = ({\n children,\n style,\n height,\n viewBox,\n width,\n ...rest\n}: SVGProps<SVGSVGElement> & { style?: CSSProperties }) => {\n const numericHeight = typeof height === \"number\" ? height : undefined;\n const numericWidth = typeof width === \"number\" ? width : undefined;\n\n return (\n <svg\n style={\n style\n ? (normalizeTakumiStyle(\n style as Record<string, unknown>\n ) as CSSProperties)\n : undefined\n }\n height={\n numericHeight === undefined ? height : pointToCssPixel(numericHeight)\n }\n viewBox={\n viewBox ??\n (numericWidth !== undefined && numericHeight !== undefined\n ? `0 0 ${numericWidth} ${numericHeight}`\n : undefined)\n }\n width={numericWidth === undefined ? width : pointToCssPixel(numericWidth)}\n {...rest}\n >\n {resolveSvgChildren(children)}\n </svg>\n );\n};\n\nexport const Rect = (props: SVGProps<SVGRectElement>) => <rect {...props} />;\nexport const Circle = (props: SVGProps<SVGCircleElement>) => (\n <circle {...props} />\n);\nexport const G = (props: SVGProps<SVGGElement>) => <g {...props} />;\nexport const Line = (props: SVGProps<SVGLineElement>) => <line {...props} />;\nexport const Path = (props: SVGProps<SVGPathElement>) => <path {...props} />;\nexport const SvgText = ({\n children,\n style,\n ...rest\n}: SVGProps<SVGTextElement> & {\n children?: ReactNode;\n style?: CSSProperties;\n}) => {\n const { fontFamily, fontSize, fontStyle, fontWeight, ...remainingStyle } =\n style ?? {};\n\n return (\n <text\n fontFamily={fontFamily ?? \"sans-serif\"}\n fontSize={fontSize}\n fontStyle={fontStyle}\n fontWeight={fontWeight}\n style={remainingStyle}\n {...rest}\n >\n {children}\n </text>\n );\n};\n",- "type": "registry:lib",- "target": "components/pdf/lib/takumi-svg.tsx"}],"type": "registry:lib"diff --git a/public/r/takumi/watermark.json b/public/r/takumi/watermark.jsonindex 3cd6a9d..cbc64d0 100644--- a/public/r/takumi/watermark.json+++ b/public/r/takumi/watermark.json@@ -13,7 +13,7 @@"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\nconst 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 const PdfWatermark = ({\n text,\n opacity = 0.15,\n fontSize = 60,\n color = \"mutedForeground\",\n angle = -45,\n position = \"center\",\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) {\n containerStyles.push(...[style].flat());\n }\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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/lib/theme-provider\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdfcn-primitives\";\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\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\nconst 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 const PdfWatermark = ({\n text,\n opacity = 0.15,\n fontSize = 60,\n color = \"mutedForeground\",\n angle = -45,\n position = \"center\",\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) {\n containerStyles.push(...[style].flat());\n }\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","target": "components/pdf/components/watermark/watermark.tsx"},diff --git a/registry.json b/registry.jsonindex 56c6590..e18ee81 100644--- a/registry.json+++ b/registry.json@@ -11,25 +11,10 @@"type": "registry:lib","target": "components/pdf/lib/pdfcn-theme.ts"},- {- "path": "registry/bases/takumi/lib/pdfcn-theme-context.tsx",- "type": "registry:lib",- "target": "components/pdf/lib/pdfcn-theme-context.tsx"- },{"path": "registry/bases/takumi/lib/resolve-color.ts","type": "registry:lib","target": "components/pdf/lib/resolve-color.ts"- },- {- "path": "registry/bases/takumi/lib/takumi-primitives.tsx",- "type": "registry:lib",- "target": "components/pdf/lib/takumi-primitives.tsx"- },- {- "path": "registry/bases/takumi/lib/takumi-svg.tsx",- "type": "registry:lib",- "target": "components/pdf/lib/takumi-svg.tsx"}],"name": "takumi/utils",@@ -1061,26 +1046,11 @@"type": "registry:lib","target": "components/pdf/lib/pdfcn-theme.ts"},- {- "path": "registry/bases/forme/lib/pdfcn-theme-context.tsx",- "type": "registry:lib",- "target": "components/pdf/lib/pdfcn-theme-context.tsx"- },{"path": "registry/bases/forme/lib/resolve-color.ts","type": "registry:lib","target": "components/pdf/lib/resolve-color.ts"},- {- "path": "registry/bases/forme/lib/forme-primitives.tsx",- "type": "registry:lib",- "target": "components/pdf/lib/forme-primitives.tsx"- },- {- "path": "registry/bases/forme/lib/forme-svg.tsx",- "type": "registry:lib",- "target": "components/pdf/lib/forme-svg.tsx"- },{"path": "registry/bases/forme/lib/maybe-fixed.tsx","type": "registry:lib",diff --git a/registry/bases/forme/blocks/invoice-classic/invoice-classic.tsx b/registry/bases/forme/blocks/invoice-classic/invoice-classic.tsxindex c9740a8..c744f6d 100644--- a/registry/bases/forme/blocks/invoice-classic/invoice-classic.tsx+++ b/registry/bases/forme/blocks/invoice-classic/invoice-classic.tsx@@ -28,8 +28,8 @@ const sampleData: InvoiceClassicData = {phone: "+1 (555) 123-4567",},companyAddress: "Nagpur, IN",- companyEmail: "[email protected]",- companyName: "PDFx Inc.",+ companyEmail: "[email protected]",+ companyName: "pdfcn",dueDate: "March 17, 2026",invoiceDate: "February 17, 2026",invoiceNumber: "INV-2026-001",diff --git a/registry/bases/forme/blocks/invoice-consultant/invoice-consultant.tsx b/registry/bases/forme/blocks/invoice-consultant/invoice-consultant.tsxindex cab4e2e..4141755 100644--- a/registry/bases/forme/blocks/invoice-consultant/invoice-consultant.tsx+++ b/registry/bases/forme/blocks/invoice-consultant/invoice-consultant.tsx@@ -24,10 +24,10 @@ const sampleData: InvoiceConsultantData = {email: "[email protected]",name: "Sarah Johnson",},- companyAddress: "Nagpur, IN · [email protected]",- companyName: "PDFx Inc.",+ companyAddress: "Nagpur, IN · [email protected]",+ companyName: "pdfcn",consultant: {- email: "[email protected]",+ email: "[email protected]",name: "John Smith",title: "Senior Technical Consultant",},diff --git a/registry/bases/forme/blocks/invoice-corporate/invoice-corporate.tsx b/registry/bases/forme/blocks/invoice-corporate/invoice-corporate.tsxindex 85d6061..1afac33 100644--- a/registry/bases/forme/blocks/invoice-corporate/invoice-corporate.tsx+++ b/registry/bases/forme/blocks/invoice-corporate/invoice-corporate.tsx@@ -26,8 +26,8 @@ const sampleData: InvoiceCorporateData = {phone: "+1 (555) 888-9999",},companyAddress: "Nagpur, IN",- companyEmail: "[email protected]",- companyName: "PDFx Inc.",+ companyEmail: "[email protected]",+ companyName: "pdfcn",dueDate: "March 24, 2026",invoiceDate: "February 22, 2026",invoiceNumber: "INV-2026-004",@@ -47,7 +47,7 @@ const sampleData: InvoiceCorporateData = {],logo: "/favicon.png",notes:- "Corporate billing – Net 30 terms apply. For inquiries, contact [email protected]",+ "Corporate billing – Net 30 terms apply. For inquiries, contact [email protected]",paymentTerms: {dueDate: "March 24, 2026",gst: "GSTIN 987654321",diff --git a/registry/bases/forme/blocks/invoice-creative/invoice-creative.tsx b/registry/bases/forme/blocks/invoice-creative/invoice-creative.tsxindex fccc60c..b71508c 100644--- a/registry/bases/forme/blocks/invoice-creative/invoice-creative.tsx+++ b/registry/bases/forme/blocks/invoice-creative/invoice-creative.tsx@@ -25,8 +25,8 @@ const sampleData: InvoiceCreativeData = {name: "Creative Agency Co.",phone: "+1 (555) 321-7654",},- companyAddress: "Nagpur, IN · [email protected]",- companyName: "PDFx Inc.",+ companyAddress: "Nagpur, IN · [email protected]",+ companyName: "pdfcn",dueDate: "March 26, 2026",invoiceDate: "February 24, 2026",invoiceNumber: "INV-2026-005",diff --git a/registry/bases/forme/blocks/invoice-minimal/invoice-minimal.tsx b/registry/bases/forme/blocks/invoice-minimal/invoice-minimal.tsxindex 8a4cf93..2071da9 100644--- a/registry/bases/forme/blocks/invoice-minimal/invoice-minimal.tsx+++ b/registry/bases/forme/blocks/invoice-minimal/invoice-minimal.tsx@@ -27,8 +27,8 @@ const sampleData: InvoiceMinimalData = {phone: "+1 (555) 246-8135",},companyAddress: "Nagpur, IN",- companyEmail: "[email protected]",- companyName: "PDFx Inc.",+ companyEmail: "[email protected]",+ companyName: "pdfcn",dueDate: "March 22, 2026",invoiceDate: "February 20, 2026",invoiceNumber: "INV-2026-003",diff --git a/registry/bases/forme/blocks/invoice-modern/invoice-modern.tsx b/registry/bases/forme/blocks/invoice-modern/invoice-modern.tsxindex 559cef9..d2160a3 100644--- a/registry/bases/forme/blocks/invoice-modern/invoice-modern.tsx+++ b/registry/bases/forme/blocks/invoice-modern/invoice-modern.tsx@@ -27,8 +27,8 @@ const sampleData: InvoiceModernData = {phone: "+1 (555) 987-6543",},companyAddress: "Nagpur, IN",- companyEmail: "[email protected]",- companyName: "PDFx Inc.",+ companyEmail: "[email protected]",+ companyName: "pdfcn",dueDate: "March 20, 2026",invoiceDate: "February 18, 2026",invoiceNumber: "INV-2026-002",diff --git a/registry/bases/forme/blocks/report-financial/report-layout.tsx b/registry/bases/forme/blocks/report-financial/report-layout.tsxindex fd3dc74..3eed78b 100644--- a/registry/bases/forme/blocks/report-financial/report-layout.tsx+++ b/registry/bases/forme/blocks/report-financial/report-layout.tsx@@ -179,7 +179,7 @@ export const ReportLayout = ({<PageFootervariant="three-column"leftText="Confidential — Internal Use"- centerText="Generated with PDFx"+ centerText="Generated with pdfcn"rightText="Page 1 of 1"stickypagePadding={theme.spacing.page.marginLeft}@@ -255,7 +255,7 @@ export const ReportLayout = ({<PageFootervariant="three-column"leftText="Confidential — Internal Use"- centerText="Generated with PDFx"+ centerText="Generated with pdfcn"rightText="Page 1 of 1"stickypagePadding={theme.spacing.page.marginLeft}@@ -355,7 +355,7 @@ export const ReportLayout = ({<PageFootervariant="three-column"leftText="Confidential — Internal Use"- centerText="Generated with PDFx"+ centerText="Generated with pdfcn"rightText="Page 1 of 1"stickypagePadding={theme.spacing.page.marginLeft}diff --git a/registry/bases/forme/blocks/report-marketing/report-layout.tsx b/registry/bases/forme/blocks/report-marketing/report-layout.tsxindex fd3dc74..3eed78b 100644--- a/registry/bases/forme/blocks/report-marketing/report-layout.tsx+++ b/registry/bases/forme/blocks/report-marketing/report-layout.tsx@@ -179,7 +179,7 @@ export const ReportLayout = ({<PageFootervariant="three-column"leftText="Confidential — Internal Use"- centerText="Generated with PDFx"+ centerText="Generated with pdfcn"rightText="Page 1 of 1"stickypagePadding={theme.spacing.page.marginLeft}@@ -255,7 +255,7 @@ export const ReportLayout = ({<PageFootervariant="three-column"leftText="Confidential — Internal Use"- centerText="Generated with PDFx"+ centerText="Generated with pdfcn"rightText="Page 1 of 1"stickypagePadding={theme.spacing.page.marginLeft}@@ -355,7 +355,7 @@ export const ReportLayout = ({<PageFootervariant="three-column"leftText="Confidential — Internal Use"- centerText="Generated with PDFx"+ centerText="Generated with pdfcn"rightText="Page 1 of 1"stickypagePadding={theme.spacing.page.marginLeft}diff --git a/registry/bases/forme/blocks/report-operations/report-layout.tsx b/registry/bases/forme/blocks/report-operations/report-layout.tsxindex fd3dc74..3eed78b 100644--- a/registry/bases/forme/blocks/report-operations/report-layout.tsx+++ b/registry/bases/forme/blocks/report-operations/report-layout.tsx@@ -179,7 +179,7 @@ export const ReportLayout = ({<PageFootervariant="three-column"leftText="Confidential — Internal Use"- centerText="Generated with PDFx"+ centerText="Generated with pdfcn"rightText="Page 1 of 1"stickypagePadding={theme.spacing.page.marginLeft}@@ -255,7 +255,7 @@ export const ReportLayout = ({<PageFootervariant="three-column"leftText="Confidential — Internal Use"- centerText="Generated with PDFx"+ centerText="Generated with pdfcn"rightText="Page 1 of 1"stickypagePadding={theme.spacing.page.marginLeft}@@ -355,7 +355,7 @@ export const ReportLayout = ({<PageFootervariant="three-column"leftText="Confidential — Internal Use"- centerText="Generated with PDFx"+ centerText="Generated with pdfcn"rightText="Page 1 of 1"stickypagePadding={theme.spacing.page.marginLeft}diff --git a/registry/bases/forme/blocks/report-security/report-layout.tsx b/registry/bases/forme/blocks/report-security/report-layout.tsxindex fd3dc74..3eed78b 100644--- a/registry/bases/forme/blocks/report-security/report-layout.tsx+++ b/registry/bases/forme/blocks/report-security/report-layout.tsx@@ -179,7 +179,7 @@ export const ReportLayout = ({<PageFootervariant="three-column"leftText="Confidential — Internal Use"- centerText="Generated with PDFx"+ centerText="Generated with pdfcn"rightText="Page 1 of 1"stickypagePadding={theme.spacing.page.marginLeft}@@ -255,7 +255,7 @@ export const ReportLayout = ({<PageFootervariant="three-column"leftText="Confidential — Internal Use"- centerText="Generated with PDFx"+ centerText="Generated with pdfcn"rightText="Page 1 of 1"stickypagePadding={theme.spacing.page.marginLeft}@@ -355,7 +355,7 @@ export const ReportLayout = ({<PageFootervariant="three-column"leftText="Confidential — Internal Use"- centerText="Generated with PDFx"+ centerText="Generated with pdfcn"rightText="Page 1 of 1"stickypagePadding={theme.spacing.page.marginLeft}diff --git a/registry/bases/forme/components/alert/alert.tsx b/registry/bases/forme/components/alert/alert.tsxindex 2c98176..473612b 100644--- a/registry/bases/forme/components/alert/alert.tsx+++ b/registry/bases/forme/components/alert/alert.tsx@@ -4,14 +4,14 @@ import {Text as PDFText,StyleSheet,View,-} from "@/registry/bases/forme/lib/forme-primitives";-import type { Style } from "@/registry/bases/forme/lib/forme-primitives";-import { Circle, Line, Path, Svg } from "@/registry/bases/forme/lib/forme-svg";+} from "@/registry/bases/forme/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/forme/lib/pdfcn-primitives";+import { Circle, Line, Path, Svg } from "@/registry/bases/forme/lib/pdfcn-svg";import {mergePdfStyles,usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/forme/lib/pdfcn-theme-context";+} from "@/registry/bases/forme/lib/theme-provider";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";export type AlertVariant = "info" | "success" | "warning" | "error";diff --git a/registry/bases/forme/components/badge/badge.tsx b/registry/bases/forme/components/badge/badge.tsxindex 7745563..7e8984a 100644--- a/registry/bases/forme/components/badge/badge.tsx+++ b/registry/bases/forme/components/badge/badge.tsx@@ -2,12 +2,12 @@ import {Text as PDFText,StyleSheet,View,-} from "@/registry/bases/forme/lib/forme-primitives";-import type { Style } from "@/registry/bases/forme/lib/forme-primitives";+} from "@/registry/bases/forme/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/forme/lib/pdfcn-primitives";import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/forme/lib/pdfcn-theme-context";+} from "@/registry/bases/forme/lib/theme-provider";import { resolveColor } from "@/registry/bases/forme/lib/resolve-color";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";diff --git a/registry/bases/forme/components/card/card.tsx b/registry/bases/forme/components/card/card.tsxindex 34e1dac..64aa294 100644--- a/registry/bases/forme/components/card/card.tsx+++ b/registry/bases/forme/components/card/card.tsx@@ -4,12 +4,12 @@ import {Text as PDFText,StyleSheet,View,-} from "@/registry/bases/forme/lib/forme-primitives";-import type { Style } from "@/registry/bases/forme/lib/forme-primitives";+} from "@/registry/bases/forme/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/forme/lib/pdfcn-primitives";import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/forme/lib/pdfcn-theme-context";+} from "@/registry/bases/forme/lib/theme-provider";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";export type CardVariant = "default" | "bordered" | "muted";diff --git a/registry/bases/forme/components/data-table/data-table.tsx b/registry/bases/forme/components/data-table/data-table.tsxindex b8411e7..cd2969a 100644--- a/registry/bases/forme/components/data-table/data-table.tsx+++ b/registry/bases/forme/components/data-table/data-table.tsx@@ -8,12 +8,12 @@ import {TableHeader,TableRow,} from "@/registry/bases/forme/components/table";-import { Text as PDFText } from "@/registry/bases/forme/lib/forme-primitives";-import type { Style } from "@/registry/bases/forme/lib/forme-primitives";+import { Text as PDFText } from "@/registry/bases/forme/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/forme/lib/pdfcn-primitives";import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/forme/lib/pdfcn-theme-context";+} from "@/registry/bases/forme/lib/theme-provider";import { createCompactStyles, formatValue } from "./data-table.styles";import type { DataTableProps } from "./data-table.types";diff --git a/registry/bases/forme/components/divider/divider.tsx b/registry/bases/forme/components/divider/divider.tsxindex d3e6ba2..b6b137f 100644--- a/registry/bases/forme/components/divider/divider.tsx+++ b/registry/bases/forme/components/divider/divider.tsx@@ -2,12 +2,12 @@ import {Text as PDFText,StyleSheet,View,-} from "@/registry/bases/forme/lib/forme-primitives";-import type { Style } from "@/registry/bases/forme/lib/forme-primitives";+} from "@/registry/bases/forme/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/forme/lib/pdfcn-primitives";import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/forme/lib/pdfcn-theme-context";+} from "@/registry/bases/forme/lib/theme-provider";import { resolveColor } from "@/registry/bases/forme/lib/resolve-color";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";diff --git a/registry/bases/forme/components/form/form.tsx b/registry/bases/forme/components/form/form.tsxindex 760581e..660f965 100644--- a/registry/bases/forme/components/form/form.tsx+++ b/registry/bases/forme/components/form/form.tsx@@ -1,12 +1,12 @@import {Text as PDFText,View,-} from "@/registry/bases/forme/lib/forme-primitives";-import type { Style } from "@/registry/bases/forme/lib/forme-primitives";+} from "@/registry/bases/forme/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/forme/lib/pdfcn-primitives";import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/forme/lib/pdfcn-theme-context";+} from "@/registry/bases/forme/lib/theme-provider";import { createFormStyles } from "./form.styles";import type {diff --git a/registry/bases/forme/components/graph/graph.tsx b/registry/bases/forme/components/graph/graph.tsxindex 45af3b7..2fd70e3 100644--- a/registry/bases/forme/components/graph/graph.tsx+++ b/registry/bases/forme/components/graph/graph.tsx@@ -3,8 +3,8 @@ import type React from "react";import {Text as PDFText,View,-} from "@/registry/bases/forme/lib/forme-primitives";-import type { Style } from "@/registry/bases/forme/lib/forme-primitives";+} from "@/registry/bases/forme/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/forme/lib/pdfcn-primitives";import {Circle,G,@@ -13,11 +13,11 @@ import {Rect,Svg,SvgText,-} from "@/registry/bases/forme/lib/forme-svg";+} from "@/registry/bases/forme/lib/pdfcn-svg";import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/forme/lib/pdfcn-theme-context";+} from "@/registry/bases/forme/lib/theme-provider";import type { PdfcnTheme } from "@/registry/themes";import { createGraphStyles } from "./graph.styles";diff --git a/registry/bases/forme/components/heading/heading.tsx b/registry/bases/forme/components/heading/heading.tsxindex 787a1c0..4ebdde6 100644--- a/registry/bases/forme/components/heading/heading.tsx+++ b/registry/bases/forme/components/heading/heading.tsx@@ -1,10 +1,10 @@-import { StyleSheet, Text } from "@/registry/bases/forme/lib/forme-primitives";-import type { Style } from "@/registry/bases/forme/lib/forme-primitives";+import { StyleSheet, Text } from "@/registry/bases/forme/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/forme/lib/pdfcn-primitives";import {mergePdfStyles,usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/forme/lib/pdfcn-theme-context";+} from "@/registry/bases/forme/lib/theme-provider";import { resolveColor } from "@/registry/bases/forme/lib/resolve-color";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";diff --git a/registry/bases/forme/components/index.ts b/registry/bases/forme/components/index.tsindex 99b8157..c2bf15f 100644--- a/registry/bases/forme/components/index.ts+++ b/registry/bases/forme/components/index.ts@@ -147,5 +147,5 @@ export {PdfcnThemeProvider,usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/forme/lib/pdfcn-theme-context";+} from "@/registry/bases/forme/lib/theme-provider";export type { PdfcnTheme } from "@/registry/themes";diff --git a/registry/bases/forme/components/keep-together/keep-together.tsx b/registry/bases/forme/components/keep-together/keep-together.tsxindex d0a2cdd..73380a2 100644--- a/registry/bases/forme/components/keep-together/keep-together.tsx+++ b/registry/bases/forme/components/keep-together/keep-together.tsx@@ -1,6 +1,6 @@import type { ReactNode } from "react";-import { View } from "@/registry/bases/forme/lib/forme-primitives";+import { View } from "@/registry/bases/forme/lib/pdfcn-primitives";import type { Style } from "@/registry/themes";export interface KeepTogetherProps {diff --git a/registry/bases/forme/components/key-value/key-value.tsx b/registry/bases/forme/components/key-value/key-value.tsxindex abdc524..0a3050e 100644--- a/registry/bases/forme/components/key-value/key-value.tsx+++ b/registry/bases/forme/components/key-value/key-value.tsx@@ -2,12 +2,12 @@ import {Text as PDFText,StyleSheet,View,-} from "@/registry/bases/forme/lib/forme-primitives";-import type { Style } from "@/registry/bases/forme/lib/forme-primitives";+} from "@/registry/bases/forme/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/forme/lib/pdfcn-primitives";import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/forme/lib/pdfcn-theme-context";+} from "@/registry/bases/forme/lib/theme-provider";import { resolveColor } from "@/registry/bases/forme/lib/resolve-color";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";diff --git a/registry/bases/forme/components/link/link.tsx b/registry/bases/forme/components/link/link.tsxindex a60268a..2180381 100644--- a/registry/bases/forme/components/link/link.tsx+++ b/registry/bases/forme/components/link/link.tsx@@ -2,12 +2,12 @@ import {Link as PDFLink,StyleSheet,Text as PDFText,-} from "@/registry/bases/forme/lib/forme-primitives";-import type { Style } from "@/registry/bases/forme/lib/forme-primitives";+} from "@/registry/bases/forme/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/forme/lib/pdfcn-primitives";import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/forme/lib/pdfcn-theme-context";+} from "@/registry/bases/forme/lib/theme-provider";import { resolveColor } from "@/registry/bases/forme/lib/resolve-color";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";diff --git a/registry/bases/forme/components/list/list.tsx b/registry/bases/forme/components/list/list.tsxindex e1a894c..108bb6d 100644--- a/registry/bases/forme/components/list/list.tsx+++ b/registry/bases/forme/components/list/list.tsx@@ -3,12 +3,12 @@ import type React from "react";import {Text as PDFText,View,-} from "@/registry/bases/forme/lib/forme-primitives";-import type { Style } from "@/registry/bases/forme/lib/forme-primitives";+} from "@/registry/bases/forme/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/forme/lib/pdfcn-primitives";import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/forme/lib/pdfcn-theme-context";+} from "@/registry/bases/forme/lib/theme-provider";import { createListStyles } from "./list.styles";import type { ListItem, ListVariant, PdfListProps } from "./list.types";diff --git a/registry/bases/forme/components/page-footer/page-footer.tsx b/registry/bases/forme/components/page-footer/page-footer.tsxindex 834e526..6922f8d 100644--- a/registry/bases/forme/components/page-footer/page-footer.tsx+++ b/registry/bases/forme/components/page-footer/page-footer.tsx@@ -5,12 +5,12 @@ import {Text as PDFText,StyleSheet,View,-} from "@/registry/bases/forme/lib/forme-primitives";-import type { Style } from "@/registry/bases/forme/lib/forme-primitives";+} from "@/registry/bases/forme/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/forme/lib/pdfcn-primitives";import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/forme/lib/pdfcn-theme-context";+} from "@/registry/bases/forme/lib/theme-provider";import { resolveColor } from "@/registry/bases/forme/lib/resolve-color";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";diff --git a/registry/bases/forme/components/page-header/page-header.tsx b/registry/bases/forme/components/page-header/page-header.tsxindex db27d52..27d8c6b 100644--- a/registry/bases/forme/components/page-header/page-header.tsx+++ b/registry/bases/forme/components/page-header/page-header.tsx@@ -6,12 +6,12 @@ import {Text as PDFText,StyleSheet,View,-} from "@/registry/bases/forme/lib/forme-primitives";-import type { Style } from "@/registry/bases/forme/lib/forme-primitives";+} from "@/registry/bases/forme/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/forme/lib/pdfcn-primitives";import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/forme/lib/pdfcn-theme-context";+} from "@/registry/bases/forme/lib/theme-provider";import { resolveColor } from "@/registry/bases/forme/lib/resolve-color";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";diff --git a/registry/bases/forme/components/page-number/page-number.tsx b/registry/bases/forme/components/page-number/page-number.tsxindex 8378246..42c673b 100644--- a/registry/bases/forme/components/page-number/page-number.tsx+++ b/registry/bases/forme/components/page-number/page-number.tsx@@ -2,12 +2,12 @@ import {Text as PDFText,StyleSheet,View,-} from "@/registry/bases/forme/lib/forme-primitives";-import type { Style } from "@/registry/bases/forme/lib/forme-primitives";+} from "@/registry/bases/forme/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/forme/lib/pdfcn-primitives";import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/forme/lib/pdfcn-theme-context";+} from "@/registry/bases/forme/lib/theme-provider";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";export type PageNumberAlign = "left" | "center" | "right";diff --git a/registry/bases/forme/components/pdf-image/pdf-image.tsx b/registry/bases/forme/components/pdf-image/pdf-image.tsxindex 59dc171..f72a329 100644--- a/registry/bases/forme/components/pdf-image/pdf-image.tsx+++ b/registry/bases/forme/components/pdf-image/pdf-image.tsx@@ -3,12 +3,12 @@ import {Text as PDFText,StyleSheet,View,-} from "@/registry/bases/forme/lib/forme-primitives";-import type { Style } from "@/registry/bases/forme/lib/forme-primitives";+} from "@/registry/bases/forme/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/forme/lib/pdfcn-primitives";import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/forme/lib/pdfcn-theme-context";+} from "@/registry/bases/forme/lib/theme-provider";import type { PdfcnTheme } from "@/registry/themes";/** HTTP method used when fetching the image from a URL. */diff --git a/registry/bases/forme/components/qrcode/qrcode.tsx b/registry/bases/forme/components/qrcode/qrcode.tsxindex a60e64f..28912dd 100644--- a/registry/bases/forme/components/qrcode/qrcode.tsx+++ b/registry/bases/forme/components/qrcode/qrcode.tsx@@ -4,13 +4,13 @@ import {Text as PDFText,StyleSheet,View,-} from "@/registry/bases/forme/lib/forme-primitives";-import type { Style } from "@/registry/bases/forme/lib/forme-primitives";-import { Rect, Svg } from "@/registry/bases/forme/lib/forme-svg";+} from "@/registry/bases/forme/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/forme/lib/pdfcn-primitives";+import { Rect, Svg } from "@/registry/bases/forme/lib/pdfcn-svg";import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/forme/lib/pdfcn-theme-context";+} from "@/registry/bases/forme/lib/theme-provider";import { resolveColor } from "@/registry/bases/forme/lib/resolve-color";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";diff --git a/registry/bases/forme/components/section/section.tsx b/registry/bases/forme/components/section/section.tsxindex 6752635..6d7622b 100644--- a/registry/bases/forme/components/section/section.tsx+++ b/registry/bases/forme/components/section/section.tsx@@ -1,10 +1,10 @@-import { StyleSheet, View } from "@/registry/bases/forme/lib/forme-primitives";-import type { Style } from "@/registry/bases/forme/lib/forme-primitives";+import { StyleSheet, View } from "@/registry/bases/forme/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/forme/lib/pdfcn-primitives";import {mergePdfStyles,usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/forme/lib/pdfcn-theme-context";+} from "@/registry/bases/forme/lib/theme-provider";import { resolveColor } from "@/registry/bases/forme/lib/resolve-color";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";diff --git a/registry/bases/forme/components/signature/signature.tsx b/registry/bases/forme/components/signature/signature.tsxindex cb25146..b8ba384 100644--- a/registry/bases/forme/components/signature/signature.tsx+++ b/registry/bases/forme/components/signature/signature.tsx@@ -2,12 +2,12 @@ import {Text as PDFText,StyleSheet,View,-} from "@/registry/bases/forme/lib/forme-primitives";-import type { Style } from "@/registry/bases/forme/lib/forme-primitives";+} from "@/registry/bases/forme/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/forme/lib/pdfcn-primitives";import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/forme/lib/pdfcn-theme-context";+} from "@/registry/bases/forme/lib/theme-provider";import type { PdfcnTheme } from "@/registry/themes";export type SignatureVariant = "single" | "double" | "inline";diff --git a/registry/bases/forme/components/stack/stack.tsx b/registry/bases/forme/components/stack/stack.tsxindex c511d3e..0fa97bc 100644--- a/registry/bases/forme/components/stack/stack.tsx+++ b/registry/bases/forme/components/stack/stack.tsx@@ -1,9 +1,9 @@-import { StyleSheet, View } from "@/registry/bases/forme/lib/forme-primitives";-import type { Style } from "@/registry/bases/forme/lib/forme-primitives";+import { StyleSheet, View } from "@/registry/bases/forme/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/forme/lib/pdfcn-primitives";import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/forme/lib/pdfcn-theme-context";+} from "@/registry/bases/forme/lib/theme-provider";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";export type StackGap = "none" | "sm" | "md" | "lg" | "xl";diff --git a/registry/bases/forme/components/table/table.tsx b/registry/bases/forme/components/table/table.tsxindex 29a8694..e0c68e4 100644--- a/registry/bases/forme/components/table/table.tsx+++ b/registry/bases/forme/components/table/table.tsx@@ -4,12 +4,12 @@ import type { ReactElement, ReactNode } from "react";import {Text as PDFText,View,-} from "@/registry/bases/forme/lib/forme-primitives";-import type { Style } from "@/registry/bases/forme/lib/forme-primitives";+} from "@/registry/bases/forme/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/forme/lib/pdfcn-primitives";import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/forme/lib/pdfcn-theme-context";+} from "@/registry/bases/forme/lib/theme-provider";import { createTableStyles } from "./table.styles";import type {diff --git a/registry/bases/forme/components/text/text.tsx b/registry/bases/forme/components/text/text.tsxindex 3e032c9..03cd56c 100644--- a/registry/bases/forme/components/text/text.tsx+++ b/registry/bases/forme/components/text/text.tsx@@ -1,13 +1,13 @@import {Text as PDFText,StyleSheet,-} from "@/registry/bases/forme/lib/forme-primitives";-import type { Style } from "@/registry/bases/forme/lib/forme-primitives";+} from "@/registry/bases/forme/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/forme/lib/pdfcn-primitives";import {mergePdfStyles,usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/forme/lib/pdfcn-theme-context";+} from "@/registry/bases/forme/lib/theme-provider";import { resolveColor } from "@/registry/bases/forme/lib/resolve-color";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";diff --git a/registry/bases/forme/components/watermark/watermark.tsx b/registry/bases/forme/components/watermark/watermark.tsxindex e6431ea..4c5fb46 100644--- a/registry/bases/forme/components/watermark/watermark.tsx+++ b/registry/bases/forme/components/watermark/watermark.tsx@@ -1,7 +1,7 @@import { Watermark as FormeWatermark } from "@formepdf/react";-import { mergeFormeStyles } from "@/registry/bases/forme/lib/forme-primitives";-import { usePdfcnTheme } from "@/registry/bases/forme/lib/pdfcn-theme-context";+import { mergeFormeStyles } from "@/registry/bases/forme/lib/pdfcn-primitives";+import { usePdfcnTheme } from "@/registry/bases/forme/lib/theme-provider";import { resolveColor } from "@/registry/bases/forme/lib/resolve-color";import type { PDFComponentProps } from "@/registry/themes";diff --git a/registry/bases/forme/lib/maybe-fixed.tsx b/registry/bases/forme/lib/maybe-fixed.tsxindex d3d66c3..51ff5d9 100644--- a/registry/bases/forme/lib/maybe-fixed.tsx+++ b/registry/bases/forme/lib/maybe-fixed.tsx@@ -1,7 +1,7 @@import type { ReactNode } from "react";-import { Fixed, View } from "./forme-primitives";-import type { Style } from "./forme-primitives";+import { Fixed, View } from "./pdfcn-primitives";+import type { Style } from "./pdfcn-primitives";export const MaybeFixed = ({fixed,diff --git a/registry/bases/forme/lib/forme-primitives.tsx b/registry/bases/forme/lib/pdfcn-primitives.tsxsimilarity index 100%rename from registry/bases/forme/lib/forme-primitives.tsxrename to registry/bases/forme/lib/pdfcn-primitives.tsxdiff --git a/registry/bases/forme/lib/forme-svg.tsx b/registry/bases/forme/lib/pdfcn-svg.tsxsimilarity index 100%rename from registry/bases/forme/lib/forme-svg.tsxrename to registry/bases/forme/lib/pdfcn-svg.tsxdiff --git a/registry/bases/forme/lib/pdfcn-theme-context.tsx b/registry/bases/forme/lib/theme-provider.tsxsimilarity index 100%rename from registry/bases/forme/lib/pdfcn-theme-context.tsxrename to registry/bases/forme/lib/theme-provider.tsxdiff --git a/registry/bases/takumi/blocks/invoice-classic/invoice-classic.tsx b/registry/bases/takumi/blocks/invoice-classic/invoice-classic.tsxindex c01bed1..30fc268 100644--- a/registry/bases/takumi/blocks/invoice-classic/invoice-classic.tsx+++ b/registry/bases/takumi/blocks/invoice-classic/invoice-classic.tsx@@ -18,7 +18,7 @@ import {StyleSheet,Document,Page,-} from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PdfcnTheme } from "@/registry/themes";import type { InvoiceClassicData } from "./invoice-classic.types";@@ -32,8 +32,8 @@ const sampleData: InvoiceClassicData = {phone: "+1 (555) 123-4567",},companyAddress: "Nagpur, IN",- companyEmail: "[email protected]",- companyName: "PDFx Inc.",+ companyEmail: "[email protected]",+ companyName: "pdfcn",dueDate: "March 17, 2026",invoiceDate: "February 17, 2026",invoiceNumber: "INV-2026-001",diff --git a/registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.tsx b/registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.tsxindex 67342a5..d2c17df 100644--- a/registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.tsx+++ b/registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.tsx@@ -16,7 +16,7 @@ import {StyleSheet,Document,Page,-} from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PdfcnTheme } from "@/registry/themes";import type { InvoiceConsultantData } from "./invoice-consultant.types";@@ -28,10 +28,10 @@ const sampleData: InvoiceConsultantData = {email: "[email protected]",name: "Sarah Johnson",},- companyAddress: "Nagpur, IN · [email protected]",- companyName: "PDFx Inc.",+ companyAddress: "Nagpur, IN · [email protected]",+ companyName: "pdfcn",consultant: {- email: "[email protected]",+ email: "[email protected]",name: "John Smith",title: "Senior Technical Consultant",},diff --git a/registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.tsx b/registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.tsxindex 9baf4ba..163608b 100644--- a/registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.tsx+++ b/registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.tsx@@ -17,7 +17,7 @@ import {StyleSheet,Document,Page,-} from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PdfcnTheme } from "@/registry/themes";import type { InvoiceCorporateData } from "./invoice-corporate.types";@@ -30,8 +30,8 @@ const sampleData: InvoiceCorporateData = {phone: "+1 (555) 888-9999",},companyAddress: "Nagpur, IN",- companyEmail: "[email protected]",- companyName: "PDFx Inc.",+ companyEmail: "[email protected]",+ companyName: "pdfcn",dueDate: "March 24, 2026",invoiceDate: "February 22, 2026",invoiceNumber: "INV-2026-004",@@ -51,7 +51,7 @@ const sampleData: InvoiceCorporateData = {],logo: "/favicon.png",notes:- "Corporate billing – Net 30 terms apply. For inquiries, contact [email protected]",+ "Corporate billing – Net 30 terms apply. For inquiries, contact [email protected]",paymentTerms: {dueDate: "March 24, 2026",gst: "GSTIN 987654321",diff --git a/registry/bases/takumi/blocks/invoice-creative/invoice-creative.tsx b/registry/bases/takumi/blocks/invoice-creative/invoice-creative.tsxindex 3a10501..9c852b1 100644--- a/registry/bases/takumi/blocks/invoice-creative/invoice-creative.tsx+++ b/registry/bases/takumi/blocks/invoice-creative/invoice-creative.tsx@@ -17,7 +17,7 @@ import {StyleSheet,Document,Page,-} from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PdfcnTheme } from "@/registry/themes";import type { InvoiceCreativeData } from "./invoice-creative.types";@@ -29,8 +29,8 @@ const sampleData: InvoiceCreativeData = {name: "Creative Agency Co.",phone: "+1 (555) 321-7654",},- companyAddress: "Nagpur, IN · [email protected]",- companyName: "PDFx Inc.",+ companyAddress: "Nagpur, IN · [email protected]",+ companyName: "pdfcn",dueDate: "March 26, 2026",invoiceDate: "February 24, 2026",invoiceNumber: "INV-2026-005",diff --git a/registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.tsx b/registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.tsxindex ef4bb99..1f15a07 100644--- a/registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.tsx+++ b/registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.tsx@@ -17,7 +17,7 @@ import {StyleSheet,Document,Page,-} from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PdfcnTheme } from "@/registry/themes";import type { InvoiceMinimalData } from "./invoice-minimal.types";@@ -31,8 +31,8 @@ const sampleData: InvoiceMinimalData = {phone: "+1 (555) 246-8135",},companyAddress: "Nagpur, IN",- companyEmail: "[email protected]",- companyName: "PDFx Inc.",+ companyEmail: "[email protected]",+ companyName: "pdfcn",dueDate: "March 22, 2026",invoiceDate: "February 20, 2026",invoiceNumber: "INV-2026-003",diff --git a/registry/bases/takumi/blocks/invoice-modern/invoice-modern.tsx b/registry/bases/takumi/blocks/invoice-modern/invoice-modern.tsxindex 21ae1cb..c35184c 100644--- a/registry/bases/takumi/blocks/invoice-modern/invoice-modern.tsx+++ b/registry/bases/takumi/blocks/invoice-modern/invoice-modern.tsx@@ -17,7 +17,7 @@ import {StyleSheet,Document,Page,-} from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PdfcnTheme } from "@/registry/themes";import type { InvoiceModernData } from "./invoice-modern.types";@@ -31,8 +31,8 @@ const sampleData: InvoiceModernData = {phone: "+1 (555) 987-6543",},companyAddress: "Nagpur, IN",- companyEmail: "[email protected]",- companyName: "PDFx Inc.",+ companyEmail: "[email protected]",+ companyName: "pdfcn",dueDate: "March 20, 2026",invoiceDate: "February 18, 2026",invoiceNumber: "INV-2026-002",diff --git a/registry/bases/takumi/blocks/report-financial/report-layout.tsx b/registry/bases/takumi/blocks/report-financial/report-layout.tsxindex e6b8690..f1dee0d 100644--- a/registry/bases/takumi/blocks/report-financial/report-layout.tsx+++ b/registry/bases/takumi/blocks/report-financial/report-layout.tsx@@ -16,7 +16,7 @@ import {StyleSheet,Document,Page,-} from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PdfcnTheme } from "@/registry/themes";import type { BaseReportData } from "./report.types";@@ -230,7 +230,7 @@ export const ReportLayout = ({<PageFootervariant="three-column"leftText="Confidential — Internal Use"- centerText="Generated with PDFx"+ centerText="Generated with pdfcn"rightText="Page 1 of 1"stickypagePadding={theme.spacing.page.marginLeft}@@ -322,7 +322,7 @@ export const ReportLayout = ({<PageFootervariant="three-column"leftText="Confidential — Internal Use"- centerText="Generated with PDFx"+ centerText="Generated with pdfcn"rightText="Page 1 of 1"stickypagePadding={theme.spacing.page.marginLeft}@@ -374,7 +374,7 @@ export const ReportLayout = ({<PageFootervariant="three-column"leftText="Confidential — Internal Use"- centerText="Generated with PDFx"+ centerText="Generated with pdfcn"rightText="Page 1 of 1"stickypagePadding={theme.spacing.page.marginLeft}diff --git a/registry/bases/takumi/blocks/report-marketing/report-layout.tsx b/registry/bases/takumi/blocks/report-marketing/report-layout.tsxindex e6b8690..f1dee0d 100644--- a/registry/bases/takumi/blocks/report-marketing/report-layout.tsx+++ b/registry/bases/takumi/blocks/report-marketing/report-layout.tsx@@ -16,7 +16,7 @@ import {StyleSheet,Document,Page,-} from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PdfcnTheme } from "@/registry/themes";import type { BaseReportData } from "./report.types";@@ -230,7 +230,7 @@ export const ReportLayout = ({<PageFootervariant="three-column"leftText="Confidential — Internal Use"- centerText="Generated with PDFx"+ centerText="Generated with pdfcn"rightText="Page 1 of 1"stickypagePadding={theme.spacing.page.marginLeft}@@ -322,7 +322,7 @@ export const ReportLayout = ({<PageFootervariant="three-column"leftText="Confidential — Internal Use"- centerText="Generated with PDFx"+ centerText="Generated with pdfcn"rightText="Page 1 of 1"stickypagePadding={theme.spacing.page.marginLeft}@@ -374,7 +374,7 @@ export const ReportLayout = ({<PageFootervariant="three-column"leftText="Confidential — Internal Use"- centerText="Generated with PDFx"+ centerText="Generated with pdfcn"rightText="Page 1 of 1"stickypagePadding={theme.spacing.page.marginLeft}diff --git a/registry/bases/takumi/blocks/report-operations/report-layout.tsx b/registry/bases/takumi/blocks/report-operations/report-layout.tsxindex e6b8690..f1dee0d 100644--- a/registry/bases/takumi/blocks/report-operations/report-layout.tsx+++ b/registry/bases/takumi/blocks/report-operations/report-layout.tsx@@ -16,7 +16,7 @@ import {StyleSheet,Document,Page,-} from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PdfcnTheme } from "@/registry/themes";import type { BaseReportData } from "./report.types";@@ -230,7 +230,7 @@ export const ReportLayout = ({<PageFootervariant="three-column"leftText="Confidential — Internal Use"- centerText="Generated with PDFx"+ centerText="Generated with pdfcn"rightText="Page 1 of 1"stickypagePadding={theme.spacing.page.marginLeft}@@ -322,7 +322,7 @@ export const ReportLayout = ({<PageFootervariant="three-column"leftText="Confidential — Internal Use"- centerText="Generated with PDFx"+ centerText="Generated with pdfcn"rightText="Page 1 of 1"stickypagePadding={theme.spacing.page.marginLeft}@@ -374,7 +374,7 @@ export const ReportLayout = ({<PageFootervariant="three-column"leftText="Confidential — Internal Use"- centerText="Generated with PDFx"+ centerText="Generated with pdfcn"rightText="Page 1 of 1"stickypagePadding={theme.spacing.page.marginLeft}diff --git a/registry/bases/takumi/blocks/report-security/report-layout.tsx b/registry/bases/takumi/blocks/report-security/report-layout.tsxindex e6b8690..f1dee0d 100644--- a/registry/bases/takumi/blocks/report-security/report-layout.tsx+++ b/registry/bases/takumi/blocks/report-security/report-layout.tsx@@ -16,7 +16,7 @@ import {StyleSheet,Document,Page,-} from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PdfcnTheme } from "@/registry/themes";import type { BaseReportData } from "./report.types";@@ -230,7 +230,7 @@ export const ReportLayout = ({<PageFootervariant="three-column"leftText="Confidential — Internal Use"- centerText="Generated with PDFx"+ centerText="Generated with pdfcn"rightText="Page 1 of 1"stickypagePadding={theme.spacing.page.marginLeft}@@ -322,7 +322,7 @@ export const ReportLayout = ({<PageFootervariant="three-column"leftText="Confidential — Internal Use"- centerText="Generated with PDFx"+ centerText="Generated with pdfcn"rightText="Page 1 of 1"stickypagePadding={theme.spacing.page.marginLeft}@@ -374,7 +374,7 @@ export const ReportLayout = ({<PageFootervariant="three-column"leftText="Confidential — Internal Use"- centerText="Generated with PDFx"+ centerText="Generated with pdfcn"rightText="Page 1 of 1"stickypagePadding={theme.spacing.page.marginLeft}diff --git a/registry/bases/takumi/components/alert/alert.tsx b/registry/bases/takumi/components/alert/alert.tsxindex 6868f72..848ca71 100644--- a/registry/bases/takumi/components/alert/alert.tsx+++ b/registry/bases/takumi/components/alert/alert.tsx@@ -3,19 +3,19 @@ import type { ReactNode } from "react";import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/takumi/lib/pdfcn-theme-context";+} from "@/registry/bases/takumi/lib/theme-provider";import {View,Text as PDFText,StyleSheet,-} from "@/registry/bases/takumi/lib/takumi-primitives";-import type { Style } from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/takumi/lib/pdfcn-primitives";import {Circle,Line,Path,Svg,-} from "@/registry/bases/takumi/lib/takumi-svg";+} from "@/registry/bases/takumi/lib/pdfcn-svg";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";export type AlertVariant = "info" | "success" | "warning" | "error";diff --git a/registry/bases/takumi/components/badge/badge.tsx b/registry/bases/takumi/components/badge/badge.tsxindex 1087f90..29da6a2 100644--- a/registry/bases/takumi/components/badge/badge.tsx+++ b/registry/bases/takumi/components/badge/badge.tsx@@ -1,14 +1,14 @@import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/takumi/lib/pdfcn-theme-context";+} from "@/registry/bases/takumi/lib/theme-provider";import { resolveColor } from "@/registry/bases/takumi/lib/resolve-color";import {View,Text as PDFText,StyleSheet,-} from "@/registry/bases/takumi/lib/takumi-primitives";-import type { Style } from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";export type BadgeVariant =diff --git a/registry/bases/takumi/components/card/card.tsx b/registry/bases/takumi/components/card/card.tsxindex e8c5095..93de1a7 100644--- a/registry/bases/takumi/components/card/card.tsx+++ b/registry/bases/takumi/components/card/card.tsx@@ -3,13 +3,13 @@ import type { ReactNode } from "react";import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/takumi/lib/pdfcn-theme-context";+} from "@/registry/bases/takumi/lib/theme-provider";import {View,Text as PDFText,StyleSheet,-} from "@/registry/bases/takumi/lib/takumi-primitives";-import type { Style } from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";export type CardVariant = "default" | "bordered" | "muted";diff --git a/registry/bases/takumi/components/data-table/data-table.styles.ts b/registry/bases/takumi/components/data-table/data-table.styles.tsindex 5732209..e7106fe 100644--- a/registry/bases/takumi/components/data-table/data-table.styles.ts+++ b/registry/bases/takumi/components/data-table/data-table.styles.ts@@ -1,4 +1,4 @@-import { StyleSheet } from "@/registry/bases/takumi/lib/takumi-primitives";+import { StyleSheet } from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PdfcnTheme } from "@/registry/themes";/**diff --git a/registry/bases/takumi/components/data-table/data-table.tsx b/registry/bases/takumi/components/data-table/data-table.tsxindex 97354e7..ad3dd8e 100644--- a/registry/bases/takumi/components/data-table/data-table.tsx+++ b/registry/bases/takumi/components/data-table/data-table.tsx@@ -11,9 +11,9 @@ import {import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/takumi/lib/pdfcn-theme-context";-import { Text as PDFText } from "@/registry/bases/takumi/lib/takumi-primitives";-import type { Style } from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/theme-provider";+import { Text as PDFText } from "@/registry/bases/takumi/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/takumi/lib/pdfcn-primitives";import { createCompactStyles, formatValue } from "./data-table.styles";import type { DataTableProps } from "./data-table.types";diff --git a/registry/bases/takumi/components/divider/divider.tsx b/registry/bases/takumi/components/divider/divider.tsxindex d86ed34..4b72045 100644--- a/registry/bases/takumi/components/divider/divider.tsx+++ b/registry/bases/takumi/components/divider/divider.tsx@@ -1,14 +1,14 @@import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/takumi/lib/pdfcn-theme-context";+} from "@/registry/bases/takumi/lib/theme-provider";import { resolveColor } from "@/registry/bases/takumi/lib/resolve-color";import {View,Text as PDFText,StyleSheet,-} from "@/registry/bases/takumi/lib/takumi-primitives";-import type { Style } from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";export type DividerVariant = "solid" | "dashed" | "dotted";diff --git a/registry/bases/takumi/components/form/form.styles.ts b/registry/bases/takumi/components/form/form.styles.tsindex 0598d50..1d9ba8b 100644--- a/registry/bases/takumi/components/form/form.styles.ts+++ b/registry/bases/takumi/components/form/form.styles.ts@@ -1,4 +1,4 @@-import { StyleSheet } from "@/registry/bases/takumi/lib/takumi-primitives";+import { StyleSheet } from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PdfcnTheme } from "@/registry/themes";import type { PdfFormVariant } from "./form.types";diff --git a/registry/bases/takumi/components/form/form.tsx b/registry/bases/takumi/components/form/form.tsxindex f3501dc..9b738bc 100644--- a/registry/bases/takumi/components/form/form.tsx+++ b/registry/bases/takumi/components/form/form.tsx@@ -1,12 +1,12 @@import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/takumi/lib/pdfcn-theme-context";+} from "@/registry/bases/takumi/lib/theme-provider";import {View,Text as PDFText,-} from "@/registry/bases/takumi/lib/takumi-primitives";-import type { Style } from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/takumi/lib/pdfcn-primitives";import { createFormStyles } from "./form.styles";import type {diff --git a/registry/bases/takumi/components/form/form.types.ts b/registry/bases/takumi/components/form/form.types.tsindex 6e99df5..f5786e3 100644--- a/registry/bases/takumi/components/form/form.types.ts+++ b/registry/bases/takumi/components/form/form.types.ts@@ -1,4 +1,4 @@-import type { Style } from "@/registry/bases/takumi/lib/takumi-primitives";+import type { Style } from "@/registry/bases/takumi/lib/pdfcn-primitives";/** Visual style variant for the fillable form. */export type PdfFormVariant = "underline" | "box" | "outlined" | "ghost";diff --git a/registry/bases/takumi/components/graph/graph.styles.ts b/registry/bases/takumi/components/graph/graph.styles.tsindex c76b54d..343c59c 100644--- a/registry/bases/takumi/components/graph/graph.styles.ts+++ b/registry/bases/takumi/components/graph/graph.styles.ts@@ -1,4 +1,4 @@-import { StyleSheet } from "@/registry/bases/takumi/lib/takumi-primitives";+import { StyleSheet } from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PdfcnTheme } from "@/registry/themes";export const createGraphStyles = (t: PdfcnTheme) =>diff --git a/registry/bases/takumi/components/graph/graph.tsx b/registry/bases/takumi/components/graph/graph.tsxindex 54d29fb..9eb34b3 100644--- a/registry/bases/takumi/components/graph/graph.tsx+++ b/registry/bases/takumi/components/graph/graph.tsx@@ -3,12 +3,12 @@ import type React from "react";import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/takumi/lib/pdfcn-theme-context";+} from "@/registry/bases/takumi/lib/theme-provider";import {View,Text as PDFText,-} from "@/registry/bases/takumi/lib/takumi-primitives";-import type { Style } from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/takumi/lib/pdfcn-primitives";import {Circle,G,@@ -17,7 +17,7 @@ import {Rect,Svg,SvgText,-} from "@/registry/bases/takumi/lib/takumi-svg";+} from "@/registry/bases/takumi/lib/pdfcn-svg";import type { PdfcnTheme } from "@/registry/themes";import { createGraphStyles } from "./graph.styles";diff --git a/registry/bases/takumi/components/graph/graph.types.ts b/registry/bases/takumi/components/graph/graph.types.tsindex 22578bb..af9ac6a 100644--- a/registry/bases/takumi/components/graph/graph.types.ts+++ b/registry/bases/takumi/components/graph/graph.types.ts@@ -1,4 +1,4 @@-import type { Style } from "@/registry/bases/takumi/lib/takumi-primitives";+import type { Style } from "@/registry/bases/takumi/lib/pdfcn-primitives";/*** Options for calculating graph width based on theme page margins and container context.diff --git a/registry/bases/takumi/components/heading/heading.tsx b/registry/bases/takumi/components/heading/heading.tsxindex 7f16f85..9d36656 100644--- a/registry/bases/takumi/components/heading/heading.tsx+++ b/registry/bases/takumi/components/heading/heading.tsx@@ -1,13 +1,13 @@import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/takumi/lib/pdfcn-theme-context";+} from "@/registry/bases/takumi/lib/theme-provider";import { resolveColor } from "@/registry/bases/takumi/lib/resolve-color";import {Text,StyleSheet,-} from "@/registry/bases/takumi/lib/takumi-primitives";-import type { Style } from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";export type HeadingWeight = "normal" | "medium" | "semibold" | "bold";diff --git a/registry/bases/takumi/components/index.ts b/registry/bases/takumi/components/index.tsindex a23bdbf..51367be 100644--- a/registry/bases/takumi/components/index.ts+++ b/registry/bases/takumi/components/index.ts@@ -147,5 +147,5 @@ export {PdfcnThemeProvider,usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/takumi/lib/pdfcn-theme-context";+} from "@/registry/bases/takumi/lib/theme-provider";export type { PdfcnTheme } from "@/registry/themes";diff --git a/registry/bases/takumi/components/keep-together/keep-together.tsx b/registry/bases/takumi/components/keep-together/keep-together.tsxindex 07f331c..1aad377 100644--- a/registry/bases/takumi/components/keep-together/keep-together.tsx+++ b/registry/bases/takumi/components/keep-together/keep-together.tsx@@ -1,6 +1,6 @@import type { ReactNode } from "react";-import { View } from "@/registry/bases/takumi/lib/takumi-primitives";+import { View } from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { Style } from "@/registry/themes";export interface KeepTogetherProps {diff --git a/registry/bases/takumi/components/key-value/key-value.tsx b/registry/bases/takumi/components/key-value/key-value.tsxindex 095b864..c0e6284 100644--- a/registry/bases/takumi/components/key-value/key-value.tsx+++ b/registry/bases/takumi/components/key-value/key-value.tsx@@ -1,14 +1,14 @@import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/takumi/lib/pdfcn-theme-context";+} from "@/registry/bases/takumi/lib/theme-provider";import { resolveColor } from "@/registry/bases/takumi/lib/resolve-color";import {View,Text as PDFText,StyleSheet,-} from "@/registry/bases/takumi/lib/takumi-primitives";-import type { Style } from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";export type KeyValueDirection = "horizontal" | "vertical";diff --git a/registry/bases/takumi/components/link/link.tsx b/registry/bases/takumi/components/link/link.tsxindex 6291107..806905e 100644--- a/registry/bases/takumi/components/link/link.tsx+++ b/registry/bases/takumi/components/link/link.tsx@@ -1,13 +1,13 @@import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/takumi/lib/pdfcn-theme-context";+} from "@/registry/bases/takumi/lib/theme-provider";import { resolveColor } from "@/registry/bases/takumi/lib/resolve-color";import {StyleSheet,Link as PDFLink,-} from "@/registry/bases/takumi/lib/takumi-primitives";-import type { Style } from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";export type LinkVariant = "default" | "muted" | "primary";diff --git a/registry/bases/takumi/components/list/list.styles.ts b/registry/bases/takumi/components/list/list.styles.tsindex a0fd478..ecf404d 100644--- a/registry/bases/takumi/components/list/list.styles.ts+++ b/registry/bases/takumi/components/list/list.styles.ts@@ -1,4 +1,4 @@-import { StyleSheet } from "@/registry/bases/takumi/lib/takumi-primitives";+import { StyleSheet } from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PdfcnTheme } from "@/registry/themes";/**diff --git a/registry/bases/takumi/components/list/list.tsx b/registry/bases/takumi/components/list/list.tsxindex cbb104e..2d1559e 100644--- a/registry/bases/takumi/components/list/list.tsx+++ b/registry/bases/takumi/components/list/list.tsx@@ -3,12 +3,12 @@ import type React from "react";import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/takumi/lib/pdfcn-theme-context";+} from "@/registry/bases/takumi/lib/theme-provider";import {View,Text as PDFText,-} from "@/registry/bases/takumi/lib/takumi-primitives";-import type { Style } from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/takumi/lib/pdfcn-primitives";import { createListStyles } from "./list.styles";import type { ListItem, ListVariant, PdfListProps } from "./list.types";diff --git a/registry/bases/takumi/components/list/list.types.ts b/registry/bases/takumi/components/list/list.types.tsindex cc82f16..bf9611c 100644--- a/registry/bases/takumi/components/list/list.types.ts+++ b/registry/bases/takumi/components/list/list.types.ts@@ -1,4 +1,4 @@-import type { Style } from "@/registry/bases/takumi/lib/takumi-primitives";+import type { Style } from "@/registry/bases/takumi/lib/pdfcn-primitives";/** List visual style variant. */export type ListVariant =diff --git a/registry/bases/takumi/components/page-break/page-break.tsx b/registry/bases/takumi/components/page-break/page-break.tsxindex aa3c89c..be7547e 100644--- a/registry/bases/takumi/components/page-break/page-break.tsx+++ b/registry/bases/takumi/components/page-break/page-break.tsx@@ -1,4 +1,4 @@-import { View } from "@/registry/bases/takumi/lib/takumi-primitives";+import { View } from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PDFComponentProps } from "@/registry/themes";export interface PageBreakProps extends Omit<PDFComponentProps, "children"> {diff --git a/registry/bases/takumi/components/page-footer/page-footer.tsx b/registry/bases/takumi/components/page-footer/page-footer.tsxindex dd3d3ea..862caf4 100644--- a/registry/bases/takumi/components/page-footer/page-footer.tsx+++ b/registry/bases/takumi/components/page-footer/page-footer.tsx@@ -1,14 +1,14 @@import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/takumi/lib/pdfcn-theme-context";+} from "@/registry/bases/takumi/lib/theme-provider";import { resolveColor } from "@/registry/bases/takumi/lib/resolve-color";import {Text as PDFText,StyleSheet,View,-} from "@/registry/bases/takumi/lib/takumi-primitives";-import type { Style } from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";export type PageFooterVariant =diff --git a/registry/bases/takumi/components/page-header/page-header.tsx b/registry/bases/takumi/components/page-header/page-header.tsxindex e11f85f..163225e 100644--- a/registry/bases/takumi/components/page-header/page-header.tsx+++ b/registry/bases/takumi/components/page-header/page-header.tsx@@ -3,14 +3,14 @@ import type { ReactNode } from "react";import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/takumi/lib/pdfcn-theme-context";+} from "@/registry/bases/takumi/lib/theme-provider";import { resolveColor } from "@/registry/bases/takumi/lib/resolve-color";import {Text as PDFText,StyleSheet,View,-} from "@/registry/bases/takumi/lib/takumi-primitives";-import type { Style } from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";export type PageHeaderVariant =diff --git a/registry/bases/takumi/components/page-number/page-number.tsx b/registry/bases/takumi/components/page-number/page-number.tsxindex 95a96eb..6c10098 100644--- a/registry/bases/takumi/components/page-number/page-number.tsx+++ b/registry/bases/takumi/components/page-number/page-number.tsx@@ -1,13 +1,13 @@import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/takumi/lib/pdfcn-theme-context";+} from "@/registry/bases/takumi/lib/theme-provider";import {View,Text as PDFText,StyleSheet,-} from "@/registry/bases/takumi/lib/takumi-primitives";-import type { Style } from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";export type PageNumberAlign = "left" | "center" | "right";diff --git a/registry/bases/takumi/components/pdf-image/pdf-image.tsx b/registry/bases/takumi/components/pdf-image/pdf-image.tsxindex 3f2371f..b69605c 100644--- a/registry/bases/takumi/components/pdf-image/pdf-image.tsx+++ b/registry/bases/takumi/components/pdf-image/pdf-image.tsx@@ -1,14 +1,14 @@import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/takumi/lib/pdfcn-theme-context";+} from "@/registry/bases/takumi/lib/theme-provider";import {View,Text as PDFText,StyleSheet,Image,-} from "@/registry/bases/takumi/lib/takumi-primitives";-import type { Style } from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PdfcnTheme } from "@/registry/themes";/** HTTP method used when fetching the image from a URL. */diff --git a/registry/bases/takumi/components/qrcode/qrcode.tsx b/registry/bases/takumi/components/qrcode/qrcode.tsxindex 85aff23..2614130 100644--- a/registry/bases/takumi/components/qrcode/qrcode.tsx+++ b/registry/bases/takumi/components/qrcode/qrcode.tsx@@ -3,15 +3,15 @@ import QRCode from "qrcode";import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/takumi/lib/pdfcn-theme-context";+} from "@/registry/bases/takumi/lib/theme-provider";import { resolveColor } from "@/registry/bases/takumi/lib/resolve-color";import {View,Text as PDFText,StyleSheet,-} from "@/registry/bases/takumi/lib/takumi-primitives";-import type { Style } from "@/registry/bases/takumi/lib/takumi-primitives";-import { Rect, Svg } from "@/registry/bases/takumi/lib/takumi-svg";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/takumi/lib/pdfcn-primitives";+import { Rect, Svg } from "@/registry/bases/takumi/lib/pdfcn-svg";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";export type QRCodeErrorLevel = "L" | "M" | "Q" | "H";diff --git a/registry/bases/takumi/components/section/section.tsx b/registry/bases/takumi/components/section/section.tsxindex 89079d5..f39603c 100644--- a/registry/bases/takumi/components/section/section.tsx+++ b/registry/bases/takumi/components/section/section.tsx@@ -1,13 +1,13 @@import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/takumi/lib/pdfcn-theme-context";+} from "@/registry/bases/takumi/lib/theme-provider";import { resolveColor } from "@/registry/bases/takumi/lib/resolve-color";import {View,StyleSheet,-} from "@/registry/bases/takumi/lib/takumi-primitives";-import type { Style } from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";export type SectionSpacing = "none" | "sm" | "md" | "lg" | "xl";diff --git a/registry/bases/takumi/components/signature/signature.tsx b/registry/bases/takumi/components/signature/signature.tsxindex 5c64df8..6bed211 100644--- a/registry/bases/takumi/components/signature/signature.tsx+++ b/registry/bases/takumi/components/signature/signature.tsx@@ -1,13 +1,13 @@import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/takumi/lib/pdfcn-theme-context";+} from "@/registry/bases/takumi/lib/theme-provider";import {View,Text as PDFText,StyleSheet,-} from "@/registry/bases/takumi/lib/takumi-primitives";-import type { Style } from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PdfcnTheme } from "@/registry/themes";export type SignatureVariant = "single" | "double" | "inline";diff --git a/registry/bases/takumi/components/stack/stack.tsx b/registry/bases/takumi/components/stack/stack.tsxindex 7a5532b..f40daff 100644--- a/registry/bases/takumi/components/stack/stack.tsx+++ b/registry/bases/takumi/components/stack/stack.tsx@@ -1,12 +1,12 @@import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/takumi/lib/pdfcn-theme-context";+} from "@/registry/bases/takumi/lib/theme-provider";import {View,StyleSheet,-} from "@/registry/bases/takumi/lib/takumi-primitives";-import type { Style } from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";export type StackGap = "none" | "sm" | "md" | "lg" | "xl";diff --git a/registry/bases/takumi/components/table/table.styles.ts b/registry/bases/takumi/components/table/table.styles.tsindex ef6141c..c06072e 100644--- a/registry/bases/takumi/components/table/table.styles.ts+++ b/registry/bases/takumi/components/table/table.styles.ts@@ -1,4 +1,4 @@-import { StyleSheet } from "@/registry/bases/takumi/lib/takumi-primitives";+import { StyleSheet } from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PdfcnTheme } from "@/registry/themes";/**diff --git a/registry/bases/takumi/components/table/table.tsx b/registry/bases/takumi/components/table/table.tsxindex c467c0c..1e256ae 100644--- a/registry/bases/takumi/components/table/table.tsx+++ b/registry/bases/takumi/components/table/table.tsx@@ -4,12 +4,12 @@ import type { ReactElement, ReactNode } from "react";import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/takumi/lib/pdfcn-theme-context";+} from "@/registry/bases/takumi/lib/theme-provider";import {View,Text as PDFText,-} from "@/registry/bases/takumi/lib/takumi-primitives";-import type { Style } from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/takumi/lib/pdfcn-primitives";import { createTableStyles } from "./table.styles";import type {diff --git a/registry/bases/takumi/components/text/text.tsx b/registry/bases/takumi/components/text/text.tsxindex af79924..94d19a4 100644--- a/registry/bases/takumi/components/text/text.tsx+++ b/registry/bases/takumi/components/text/text.tsx@@ -1,13 +1,13 @@import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/takumi/lib/pdfcn-theme-context";+} from "@/registry/bases/takumi/lib/theme-provider";import { resolveColor } from "@/registry/bases/takumi/lib/resolve-color";import {Text as PDFText,StyleSheet,-} from "@/registry/bases/takumi/lib/takumi-primitives";-import type { Style } from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";export type TextVariant = "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl";diff --git a/registry/bases/takumi/components/watermark/watermark.tsx b/registry/bases/takumi/components/watermark/watermark.tsxindex 1e796e7..a50e894 100644--- a/registry/bases/takumi/components/watermark/watermark.tsx+++ b/registry/bases/takumi/components/watermark/watermark.tsx@@ -1,14 +1,14 @@import {usePdfcnTheme,useSafeMemo,-} from "@/registry/bases/takumi/lib/pdfcn-theme-context";+} from "@/registry/bases/takumi/lib/theme-provider";import { resolveColor } from "@/registry/bases/takumi/lib/resolve-color";import {View,Text as PDFText,StyleSheet,-} from "@/registry/bases/takumi/lib/takumi-primitives";-import type { Style } from "@/registry/bases/takumi/lib/takumi-primitives";+} from "@/registry/bases/takumi/lib/pdfcn-primitives";+import type { Style } from "@/registry/bases/takumi/lib/pdfcn-primitives";import type { PDFComponentProps, PdfcnTheme } from "@/registry/themes";export type WatermarkPosition =diff --git a/registry/bases/takumi/lib/takumi-primitives.tsx b/registry/bases/takumi/lib/pdfcn-primitives.tsxsimilarity index 100%rename from registry/bases/takumi/lib/takumi-primitives.tsxrename to registry/bases/takumi/lib/pdfcn-primitives.tsxdiff --git a/registry/bases/takumi/lib/takumi-svg.tsx b/registry/bases/takumi/lib/pdfcn-svg.tsxsimilarity index 97%rename from registry/bases/takumi/lib/takumi-svg.tsxrename to registry/bases/takumi/lib/pdfcn-svg.tsxindex 79d6bcf..b2c4a28 100644--- a/registry/bases/takumi/lib/takumi-svg.tsx+++ b/registry/bases/takumi/lib/pdfcn-svg.tsx@@ -1,7 +1,7 @@import { Children, Fragment, cloneElement, isValidElement } from "react";import type { CSSProperties, ReactNode, SVGProps } from "react";-import { normalizeTakumiStyle, pointToCssPixel } from "./takumi-primitives";+import { normalizeTakumiStyle, pointToCssPixel } from "./pdfcn-primitives";type SvgChildProps = Record<string, unknown> & {children?: ReactNode;diff --git a/registry/bases/takumi/lib/pdfcn-theme-context.tsx b/registry/bases/takumi/lib/theme-provider.tsxsimilarity index 100%rename from registry/bases/takumi/lib/pdfcn-theme-context.tsxrename to registry/bases/takumi/lib/theme-provider.tsxdiff --git a/registry/themes/theme-types.ts b/registry/themes/theme-types.tsindex 0c366e6..fe2e007 100644--- a/registry/themes/theme-types.ts+++ b/registry/themes/theme-types.ts@@ -234,7 +234,7 @@ export interface PageTokens {* @example* ```tsx* // In a component:- * import { theme } from '../lib/pdfx-theme';+ * import { theme } from '../lib/pdfcn-theme';** function createStyles(t: PdfcnTheme) {* return StyleSheet.create({diff --git a/scripts/build-registry.mjs b/scripts/build-registry.mjsdeleted file mode 100644index 69e4fb4..0000000--- a/scripts/build-registry.mjs+++ /dev/null@@ -1,55 +0,0 @@-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`);-};--try {- await main();-} catch (error) {- console.error(error);- process.exit(1);-}diff --git a/scripts/fix-port.mjs b/scripts/fix-port.mjsdeleted file mode 100644index ca486e6..0000000--- a/scripts/fix-port.mjs+++ /dev/null@@ -1,248 +0,0 @@-import fs from "node:fs";-import path from "node:path";--const ROOT = process.cwd();--const 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;-};--const 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 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 const 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")) &&- 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-docs.mjs b/scripts/generate-docs.mjsdeleted file mode 100644index bbc43cf..0000000--- a/scripts/generate-docs.mjs+++ /dev/null@@ -1,569 +0,0 @@-/**- * Generates base-scoped docs MDX matching the termcn page outline:- * Preview → Installation (CLI/Manual) → Usage → API Reference- *- * Run: node scripts/generate-docs.mjs- */-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",-};--const BLOCK_EXPORTS = {- "invoice-classic": "InvoiceClassicDocument",- "invoice-consultant": "InvoiceConsultantDocument",- "invoice-corporate": "InvoiceCorporateDocument",- "invoice-creative": "InvoiceCreativeDocument",- "invoice-minimal": "InvoiceMinimalDocument",- "invoice-modern": "InvoiceModernDocument",- "report-financial": "FinancialReportDocument",- "report-marketing": "MarketingReportDocument",- "report-operations": "OperationsReportDocument",- "report-security": "SecurityReportDocument",-};--const DESCRIPTIONS = {- alert: "Alert box with info, success, warning, and error variants.",- badge: "Compact status badge for labels and tags.",- card: "Bordered content card with title and body.",- "data-table": "Tabular data with columns and rows.",- divider: "Horizontal rule to separate sections.",- form: "Labeled form groups for PDF inputs.",- graph: "Bar, line, and area charts drawn with SVG.",- heading: "Document headings with typographic scale.",- "invoice-classic": "Classic invoice document template.",- "invoice-consultant": "Consultant-style invoice template.",- "invoice-corporate": "Corporate invoice document template.",- "invoice-creative": "Creative invoice document template.",- "invoice-minimal": "Minimal invoice document template.",- "invoice-modern": "Modern invoice document template.",- "keep-together": "Keeps children on the same PDF page.",- "key-value": "Definition list of keys and values.",- link: "Clickable link styled for PDF documents.",- list: "Ordered and unordered lists.",- "page-break": "Forces a page break in the document.",- "page-footer": "Repeating page footer.",- "page-header": "Repeating page header.",- "page-number": "Current page number marker.",- "pdf-image": "Embedded image with fit options.",- qrcode: "QR code generated from a string value.",- "report-financial": "Financial report document template.",- "report-marketing": "Marketing report document template.",- "report-operations": "Operations report document template.",- "report-security": "Security report document template.",- section: "Section wrapper with optional title.",- signature: "Signature block with name and label.",- stack: "Vertical stack with spacing.",- table: "Low-level table primitives.",- text: "Body text with typography variants.",- watermark: "Diagonal or centered watermark overlay.",-};--const USAGE = {- alert: `<PdfAlert variant="info" title="Info">\n Alert body\n</PdfAlert>`,- badge: `<Badge>Badge</Badge>`,- card: `<PdfCard title="Card">Card body</PdfCard>`,- "data-table": `<DataTable\n columns={[{ key: "name", header: "Name" }]}\n data={[{ name: "Widget" }]}\n/>`,- divider: `<Divider />`,- form: `<PdfForm\n title="Contact"\n groups={[{ fields: [{ label: "Email" }] }]}\n/>`,- graph: `<PdfGraph\n variant="bar"\n data={[{ label: "Q1", value: 30 }]}\n/>`,- heading: `<Heading level={1}>Heading</Heading>`,- "keep-together": `<KeepTogether>\n <Text>Keep these lines together.</Text>\n</KeepTogether>`,- "key-value": `<KeyValue items={[{ key: "Name", value: "Ada" }]} />`,- link: `<Link href="https://example.com">Example</Link>`,- list: `<PdfList items={[{ text: "Alpha" }, { text: "Beta" }]} />`,- "page-break": `<PageBreak />`,- "page-footer": `<PageFooter leftText="pdfcn" rightText="Confidential" />`,- "page-header": `<PageHeader title="Company" subtitle="Invoice" />`,- "page-number": `<PdfPageNumber />`,- "pdf-image": `<PdfImage src="/logo.png" width={120} />`,- qrcode: `<PdfQRCode value="https://pdfcn.dev" />`,- section: `<Section>\n <Text>Section body</Text>\n</Section>`,- signature: `<PdfSignatureBlock name="Jane Doe" label="Authorized Signature" />`,- stack: `<Stack gap="md">\n <Text>One</Text>\n <Text>Two</Text>\n</Stack>`,- table: `<Table>\n <TableHeader>\n <TableRow>\n <TableCell><Text>Item</Text></TableCell>\n </TableRow>\n </TableHeader>\n</Table>`,- text: `<Text>Hello from pdfcn</Text>`,- watermark: `<PdfWatermark text="DRAFT" />`,-};--const BASE_DEPS = {- forme: "@formepdf/react @formepdf/core",- takumi: "takumi-pdf @takumi-rs/helpers",-};--const TITLE_OVERRIDES = {- "data-table": "Data Table",- "keep-together": "Keep Together",- "key-value": "Key Value",- "page-break": "Page Break",- "page-footer": "Page Footer",- "page-header": "Page Header",- "page-number": "Page Number",- "pdf-image": "PDF Image",- qrcode: "QR Code",-};--const titleCase = (slug) => {- if (TITLE_OVERRIDES[slug]) {- return TITLE_OVERRIDES[slug];- }- return slug- .split("-")- .map((p) => p.charAt(0).toUpperCase() + p.slice(1))- .join(" ");-};--const ensureDir = (dir) => {- fs.mkdirSync(dir, { recursive: true });-};--const write = (file, content) => {- ensureDir(path.dirname(file));- fs.writeFileSync(file, content);-};--const escapeMdx = (value) =>- value.replaceAll("{", "{").replaceAll("}", "}");--const extractPropsTable = (sourcePath, exportName) => {- if (!fs.existsSync(sourcePath)) {- return null;- }- const src = fs.readFileSync(sourcePath, "utf-8");- const interfaceMatch = src.match(- new RegExp(- `export interface (\\w*Props)\\s+(?:extends [^{]+)?\\{([\\s\\S]*?)\\n\\}`- )- );- if (!interfaceMatch) {- return null;- }-- // eslint-disable-next-line prefer-destructuring- const body = interfaceMatch[2];- const rows = [];- const propRegex = /(?:\/\*\*([\s\S]*?)\*\/\s*)?(\w+)(\?)?:\s*([^;]+);/g;- let match = propRegex.exec(body);- while (match) {- const [, jsdoc, name, optional, typeRaw] = match;- if (name === "style" || name === "wrap") {- // keep them — common PDF props- }- const defaultMatch = jsdoc?.match(/@default\s+([^\n*]+)/);- const type = typeRaw.replaceAll(/\s+/g, " ").trim();- rows.push({- default: escapeMdx(defaultMatch ? defaultMatch[1].trim() : "-"),- name: `\`${name}\``,- required: optional ? "No" : "Yes",- type: `\`${escapeMdx(type)}\``,- });- match = propRegex.exec(body);- }-- if (rows.length === 0) {- return null;- }-- const header = `| Prop | Type | Default |\n| ---- | ---- | ------- |`;- const lines = rows.map(- (row) => `| ${row.name} | ${row.type} | ${row.default} |`- );- return `## API Reference\n\n### ${exportName}\n\n${header}\n${lines.join("\n")}\n`;-};--const manualSources = (base, kind, name) => {- const sources = [];- if (kind === "component") {- sources.push({- src: `registry/bases/${base}/components/${name}/${name}.tsx`,- title: `components/pdf/${name}.tsx`,- });- } else {- const file = `${name}.tsx`;- sources.push({- src: `registry/bases/${base}/blocks/${name}/${file}`,- title: `components/pdf/${name}.tsx`,- });- }-- sources.push(- {- src: `registry/bases/${base}/lib/pdfcn-theme-context.tsx`,- title: "components/pdf/pdfcn-theme-context.tsx",- },- {- src: `registry/bases/${base}/lib/pdfcn-theme.ts`,- title: "components/pdf/pdfcn-theme.ts",- },- {- src: `registry/bases/${base}/lib/resolve-color.ts`,- title: "components/pdf/resolve-color.ts",- }- );-- if (base === "takumi") {- sources.push(- {- src: `registry/bases/takumi/lib/takumi-primitives.tsx`,- title: "components/pdf/takumi-primitives.tsx",- },- {- src: `registry/bases/takumi/lib/takumi-svg.tsx`,- title: "components/pdf/takumi-svg.tsx",- }- );- }-- return sources- .filter((s) => fs.existsSync(path.join(ROOT, s.src)))- .map(- (s) =>- `<ComponentSource\n src="${s.src}"\n base="${base}"\n title="${s.title}"\n/>`- )- .join("\n\n");-};--const usageSnippet = (kind, name, exportName) => {- if (kind === "block") {- return `<${exportName} />`;- }- return USAGE[name] ?? `<${exportName} />`;-};--const componentMdx = (base, name) => {- const exportName = COMPONENT_EXPORTS[name];- const title = titleCase(name);- const description =- DESCRIPTIONS[name] ?? `${title} PDF component for the ${base} base.`;- const deps = BASE_DEPS[base];- const sourcePath = path.join(- ROOT,- `registry/bases/${base}/components/${name}/${name}.tsx`- );- const api = extractPropsTable(sourcePath, exportName) ?? "";- const importExtra =- name === "table"- ? `{ Table, TableBody, TableCell, TableHeader, TableRow, Text }`- : `{ ${exportName} }`;- const keepTogetherImport =- name === "keep-together" ||- name === "section" ||- name === "stack" ||- name === "watermark"- ? `\nimport { Text } from "@/components/pdf/text";`- : "";-- return `----title: "${title}"-description: "${description}"------<ComponentPreview base="${base}" name="${name}" hideCode />--## Installation--<CodeTabs>--<TabsList>- <TabsTrigger value="cli">Command</TabsTrigger>- <TabsTrigger value="manual">Manual</TabsTrigger>-</TabsList>--<TabsContent value="cli">--\`\`\`bash-npx shadcn@latest add @pdfcn/${base}/${name}-\`\`\`--</TabsContent>--<TabsContent value="manual">--<Steps>--<Step>Install the following dependencies:</Step>--\`\`\`bash-npm install ${deps}-\`\`\`--<Step>Copy and paste the following code into your project.</Step>--${manualSources(base, "component", name)}--<Step>Update the import paths to match your project setup.</Step>--</Steps>--</TabsContent>--</CodeTabs>--## Usage--\`\`\`tsx-import ${importExtra} from "@/components/pdf/${name}";${keepTogetherImport}-\`\`\`--\`\`\`tsx-${usageSnippet("component", name, exportName)}-\`\`\`--${api}`;-};--const blockMdx = (base, name) => {- const exportName = BLOCK_EXPORTS[name];- const title = titleCase(name);- const description =- DESCRIPTIONS[name] ?? `${title} PDF block for the ${base} base.`;- const deps = BASE_DEPS[base];-- return `----title: "${title}"-description: "${description}"------<ComponentPreview base="${base}" name="${name}" hideCode />--## Installation--<CodeTabs>--<TabsList>- <TabsTrigger value="cli">Command</TabsTrigger>- <TabsTrigger value="manual">Manual</TabsTrigger>-</TabsList>--<TabsContent value="cli">--\`\`\`bash-npx shadcn@latest add @pdfcn/${base}/${name}-\`\`\`--</TabsContent>--<TabsContent value="manual">--<Steps>--<Step>Install the following dependencies:</Step>--\`\`\`bash-npm install ${deps}-\`\`\`--<Step>Copy and paste the following code into your project.</Step>--${manualSources(base, "block", name)}--<Step>Update the import paths to match your project setup.</Step>--</Steps>--</TabsContent>--</CodeTabs>--## Usage--\`\`\`tsx-import { ${exportName} } from "@/components/pdf/${name}";-\`\`\`--\`\`\`tsx-<${exportName} />-\`\`\`-`;-};--const baseIndexMdx = (section, base, title) => {- const folderName = section === "components" ? "Components" : "Blocks";- const description =- section === "components"- ? `PDF UI primitives for the ${title} base.`- : `Invoice and report templates for the ${title} base.`;-- return `----title: "${title}"-description: "${description}"------<ComponentsList folderName="${folderName}" base="${base}" />-`;-};--const sectionIndexMdx = (section) => {- if (section === "components") {- return `----title: "Components"-description: "PDF UI primitives available on Takumi and Forme bases."------Choose a base to browse components.--- [Takumi](/docs/components/takumi)-- [Forme](/docs/components/forme)-`;- }-- return `----title: "Blocks"-description: "Full PDF document templates — invoices and reports."------Choose a base to browse blocks.--- [Takumi](/docs/blocks/takumi)-- [Forme](/docs/blocks/forme)-`;-};--const writeMeta = (file, title, pages) => {- write(file, `${JSON.stringify({ pages, title }, null, 2)}\n`);-};--const cleanFlatDocs = (section) => {- const dir = path.join(ROOT, `content/docs/${section}`);- for (const entry of fs.readdirSync(dir)) {- if (entry.endsWith(".mdx") && entry !== "index.mdx") {- fs.unlinkSync(path.join(dir, entry));- }- }-};--const main = () => {- cleanFlatDocs("components");- cleanFlatDocs("blocks");-- write(- path.join(ROOT, "content/docs/components/index.mdx"),- sectionIndexMdx("components")- );- write(- path.join(ROOT, "content/docs/blocks/index.mdx"),- sectionIndexMdx("blocks")- );-- writeMeta(- path.join(ROOT, "content/docs/components/meta.json"),- "Components",- ["index", "takumi", "forme"]- );- writeMeta(path.join(ROOT, "content/docs/blocks/meta.json"), "Blocks", [- "index",- "takumi",- "forme",- ]);-- for (const base of ["takumi", "forme"]) {- const baseTitle = base === "takumi" ? "Takumi" : "Forme";-- write(- path.join(ROOT, `content/docs/components/${base}/index.mdx`),- baseIndexMdx("components", base, baseTitle)- );- writeMeta(- path.join(ROOT, `content/docs/components/${base}/meta.json`),- baseTitle,- ["index", ...COMPONENTS]- );-- for (const name of COMPONENTS) {- write(- path.join(ROOT, `content/docs/components/${base}/${name}.mdx`),- componentMdx(base, name)- );- }-- write(- path.join(ROOT, `content/docs/blocks/${base}/index.mdx`),- baseIndexMdx("blocks", base, baseTitle)- );- writeMeta(- path.join(ROOT, `content/docs/blocks/${base}/meta.json`),- baseTitle,- ["index", ...BLOCKS]- );-- for (const name of BLOCKS) {- write(- path.join(ROOT, `content/docs/blocks/${base}/${name}.mdx`),- blockMdx(base, name)- );- }- }-- console.log(- `Generated docs for ${COMPONENTS.length} components × 2 bases and ${BLOCKS.length} blocks × 2 bases`- );-};--main();diff --git a/scripts/generate-registry.mjs b/scripts/generate-registry.mjsdeleted file mode 100644index 723df5e..0000000--- a/scripts/generate-registry.mjs+++ /dev/null@@ -1,1123 +0,0 @@-/**- * 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 PREVIEW_IMAGE_DATA_URI = `data:image/png;base64,${fs- .readFileSync(path.join(ROOT, "public/favicon.png"))- .toString("base64")}`;-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",-};--const titleCase = (slug) =>- slug- .split("-")- .map((p) => p.charAt(0).toUpperCase() + p.slice(1))- .join(" ");--const 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 { ${exportName} } from "@/registry/bases/forme/components/${name}";--__DEMO_BODY__--const Demo = () => {- return (- <Document>- <Page size="A4" margin={48}>- <DemoBody />- </Page>- </Document>- );-};-export default Demo;-`- : `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}";--__DEMO_BODY__--const Demo = () => {- return (- <Document>- <Page size="A4">- <PdfcnThemeProvider>- <DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>- );-};-export default Demo;-`;-- const bodies = {- alert: `function DemoBody() {- return (- <Section spacing="none">- <Heading level={1}>Document Alerts</Heading>- <Text>- The PdfAlert component displays callout boxes with different severity levels.- </Text>-- <Section>- <PdfAlert variant="info" title="Information">- This document contains important information about your account.- </PdfAlert>- <PdfAlert variant="success" title="Success">- Your payment has been processed successfully.- </PdfAlert>- <PdfAlert variant="warning" title="Warning">- Please review the terms and conditions before proceeding.- </PdfAlert>- <PdfAlert variant="error" title="Error">- Missing required fields. Please complete all sections.- </PdfAlert>- </Section>- </Section>- );-}`,- 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 <PdfImage src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAusB9Wl2nYQAAAAASUVORK5CYII=" caption="PDF image preview" />;-}`,- 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 rawBody =- bodies[name] ?? `function DemoBody() {\n return <${exportName} />;\n}`;- const body = rawBody- .replace("function DemoBody() {", "const DemoBody = () => {")- .replace(/\n}$/, "\n};");-- // table demo has its own imports - prepend carefully- if (name === "table") {- const providerOpen = isForme ? "" : " <PdfcnThemeProvider>\n";- const providerClose = isForme ? "" : " </PdfcnThemeProvider>\n";- return `${- isForme- ? `import { Document, Page } from "@formepdf/react";-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";--const 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>- );-};--const Demo = () => {- return (- <Document>- <Page size="A4"${isForme ? " margin={48}" : ""}>-${providerOpen} <DemoBody />-${providerClose} </Page>- </Document>- );-};-export default Demo;-`;- }-- // Some demos compose the component with other registry primitives.- const needsText = [- "stack",- "section",- "page-break",- "keep-together",- "watermark",- ].includes(name);- let supportingImports = "";- if (name === "alert") {- supportingImports = `import { Heading } from "@/registry/bases/${base}/components/heading";\nimport { Section } from "@/registry/bases/${base}/components/section";\nimport { Text } from "@/registry/bases/${base}/components/text";\n`;- } else if (needsText) {- supportingImports = `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${supportingImports}`- )- .replace("__DEMO_BODY__", body);-};--const REFERENCE_COMPONENT_DEMOS = {- alert: {- imports: ["Heading", "PdfAlert", "Section", "Text"],- jsx: `<Section spacing="none">- <Heading level={1}>Document Alerts</Heading>- <Text>- The PdfAlert component displays callout boxes with different severity levels.- </Text>- <Section>- <PdfAlert variant="info" title="Information">- This document contains important information about your account.- </PdfAlert>- <PdfAlert variant="success" title="Success">- Your payment has been processed successfully.- </PdfAlert>- <PdfAlert variant="warning" title="Warning">- Please review the terms and conditions before proceeding.- </PdfAlert>- <PdfAlert variant="error" title="Error">- Missing required fields. Please complete all sections.- </PdfAlert>- </Section>- </Section>`,- margin: 40,- },- badge: {- imports: ["Badge"],- jsx: `<View- style={{- display: "flex",- flexDirection: "row",- flexWrap: "wrap",- gap: 6,- marginBottom: 12,- }}- >- <Badge label="Small" variant="default" size="sm" />- <Badge label="Medium" variant="default" size="md" />- <Badge label="Large" variant="default" size="lg" />- </View>`,- margin: 40,- size: { height: 200, width: 595 },- },- card: {- imports: ["PdfCard", "Text"],- jsx: `<PdfCard title="Project Summary" variant="default" padding="md">- <Text noMargin>- This card groups related content with a title and body area. Use cards to- visually separate sections of your PDF document.- </Text>- </PdfCard>`,- margin: 40,- },- "data-table": {- imports: ["DataTable", "Heading", "Section"],- jsx: `<Section spacing="none">- <Heading level={3}>Team Directory</Heading>- <DataTable- size="compact"- variant="striped"- columns={[- { key: "id", header: "ID", align: "center" },- { key: "name", header: "Name" },- { key: "dept", header: "Department" },- { key: "status", header: "Status", align: "center" },- ]}- data={[- { id: 1, name: "Alice Johnson", dept: "Engineering", status: "Active" },- { id: 2, name: "Bob Smith", dept: "Marketing", status: "Active" },- { id: 3, name: "Carol Lee", dept: "Design", status: "Inactive" },- { id: 4, name: "Dan Wilson", dept: "Engineering", status: "Active" },- { id: 5, name: "Eve Brown", dept: "Sales", status: "Active" },- { id: 6, name: "Frank Chen", dept: "Support", status: "Active" },- { id: 7, name: "Grace Kim", dept: "Product", status: "Active" },- { id: 8, name: "Hank Davis", dept: "Marketing", status: "Inactive" },- ]}- />- </Section>`,- margin: 40,- },- divider: {- imports: ["Divider", "Heading", "Text"],- jsx: `<View>- <Heading level={2}>Section 1</Heading>- <Text>Content here.</Text>- <Divider />- <Heading level={2}>Section 2</Heading>- <Text>More content.</Text>- <Divider variant="dashed" />- <Heading level={2}>Section 3</Heading>- <Text>More content.</Text>- <Divider variant="dotted" />- <Heading level={2}>Section 4</Heading>- <Text>More content.</Text>- <Divider label="Section Divider" />- <Heading level={2}>Section 5</Heading>- <Text>More content.</Text>- </View>`,- margin: 30,- },- form: {- imports: ["PdfForm"],- jsx: `<PdfForm- title="Job Application"- subtitle="Please complete all fields clearly in block capitals."- variant="underline"- groups={[- {- title: "Personal Information",- fields: [- { label: "Full Name", hint: "First and last name" },- { label: "Date of Birth", hint: "DD / MM / YYYY" },- { label: "Email Address" },- { label: "Phone Number", hint: "+1 (555) 000-0000" },- ],- },- {- title: "Address",- layout: "two-column",- fields: [- { label: "Street Address", width: "100%" },- { label: "City" },- { label: "State / Province" },- { label: "Postal Code" },- ],- },- {- title: "Additional Information",- fields: [{ label: "Cover Letter", height: 60 }],- },- ]}- />`,- margin: 40,- },- graph: {- imports: ["PdfGraph"],- jsx: `<PdfGraph- variant="bar"- title="Monthly Revenue"- subtitle="FY 2025"- data={[- { label: "Jan", value: 42_000 },- { label: "Feb", value: 38_000 },- { label: "Mar", value: 55_000 },- { label: "Apr", value: 61_000 },- { label: "May", value: 49_000 },- { label: "Jun", value: 72_000 },- ]}- showValues- width={480}- height={260}- />`,- margin: 40,- },- heading: {- imports: ["Heading", "Section"],- jsx: `<Section spacing="none">- <Heading level={1}>Main Title</Heading>- <Heading level={2} align="center" color="primary">- Subtitle- </Heading>- <Heading level={3} style={{ color: "#1e3a5f" }}>- Custom Styled- </Heading>- </Section>`,- margin: 30,- },- "keep-together": {- imports: ["Heading", "KeepTogether", "Section", "Text"],- jsx: `<Section spacing="none">- <KeepTogether>- <Heading level={2}>Section Title</Heading>- <Section variant="callout" padding="sm">- <Text noMargin>- This heading and callout stay together as one atomic block when the- document flows onto another page.- </Text>- </Section>- </KeepTogether>- <KeepTogether minPresenceAhead={80}>- <Heading level={3}>Subsection Heading</Heading>- <Text>- Reserve enough room before starting this subsection so its heading is- never stranded at the bottom of a page.- </Text>- </KeepTogether>- <KeepTogether>- <Heading level={4}>Signature Block</Heading>- <Section variant="card" padding="sm">- <Text noMargin>Approved by: ____________________</Text>- </Section>- </KeepTogether>- </Section>`,- margin: 40,- },- "key-value": {- imports: ["KeyValue"],- jsx: `<KeyValue- direction="horizontal"- divided- items={[- { key: "Invoice #", value: "INV-2026-0042" },- { key: "Issue Date", value: "15 February 2026" },- { key: "Due Date", value: "17 March 2026" },- { key: "Status", value: "Unpaid", valueColor: "destructive" },- { key: "Total", value: "$4,200.00", valueColor: "primary" },- ]}- />`,- margin: 40,- },- link: {- imports: ["Link", "Section"],- jsx: `<Section spacing="none">- <Link href="https://pdfcn.dev">Documentation</Link>- <Link href="#section-1" color="primary">- Internal link- </Link>- </Section>`,- margin: 30,- },- list: {- imports: ["PdfList"],- jsx: `<PdfList- variant="bullet"- items={[- {- text: "Design system alignment",- description: "Match all components to the design specification.",- },- {- text: "Component implementation",- description: "Build PDF-native components for both renderer bases.",- },- {- text: "Write unit tests",- description: "Cover all variants and edge cases.",- },- ]}- />`,- margin: 40,- },- "page-break": {- imports: ["Heading", "PageBreak", "Text"],- jsx: `<View>- <Heading level={1}>Section 1</Heading>- <Text>Content on the first page.</Text>- <PageBreak />- <Heading level={1}>Section 2</Heading>- <Text>Content on the second page.</Text>- </View>`,- margin: 30,- },- "page-footer": {- imports: ["PageFooter", "Text"],- jsx: `<View- style={{ display: "flex", flexDirection: "column", minHeight: 220 }}- >- <Text- style={{ color: "#555555", fontSize: 10, lineHeight: 1.6, marginBottom: 6 }}- >- Invoice #1042 · Acme Corp · March 2026- </Text>- <Text- style={{ color: "#555555", fontSize: 10, lineHeight: 1.6, marginBottom: 6 }}- >- The footer remains visually separated from the document body.- </Text>- <View style={{ flex: 1 }} />- <PageFooter- leftText="© 2026 Acme Corp"- centerText="Confidential"- rightText="Page 1 of 1"- variant="simple"- />- </View>`,- margin: 30,- size: { height: 300, width: 595 },- },- "page-header": {- imports: ["PageHeader", "Text"],- jsx: `<View>- <PageHeader- title="Invoice #1042"- subtitle="Acme Corp"- rightText="March 2026"- rightSubText="Due: 2026-03-31"- variant="simple"- />- <Text- style={{ color: "#555555", fontSize: 10, lineHeight: 1.6, marginBottom: 6 }}- >- Prepared for Northwind Industries- </Text>- <Text- style={{ color: "#555555", fontSize: 10, lineHeight: 1.6, marginBottom: 6 }}- >- This document demonstrates the simple page header variant.- </Text>- </View>`,- margin: 30,- size: { height: 240, width: 595 },- },- "page-number": {- imports: ["Heading", "PdfPageNumber", "Text"],- jsx: `<View style={{ minHeight: 680, position: "relative" }}>- <View style={{ marginBottom: 60 }}>- <Heading level={1}>Multi-Page Report</Heading>- <Text>- Page numbers make long reports easier to review, reference, and print.- </Text>- <Text>- The format token displays the current page together with the total page count.- </Text>- </View>- <View- style={{ bottom: 0, left: 0, position: "absolute", right: 0 }}- >- <PdfPageNumber format="Page 1 of 1" align="center" />- </View>- </View>`,- margin: 40,- },- "pdf-image": {- extraImports: `import { PREVIEW_IMAGE_DATA_URI } from "@/examples/preview-assets";`,- imports: ["PdfImage"],- jsx: `<PdfImage- src={PREVIEW_IMAGE_DATA_URI}- variant="default"- height={120}- width={200}- caption="Variant: default"- />`,- margin: 40,- },- qrcode: {- imports: ["Heading", "PdfQRCode", "Section", "Stack", "Text"],- jsx: `<Section spacing="none">- <Heading level={1}>Invoice #12345</Heading>- <Text>Amount Due: $500.00</Text>- <Section>- <Stack direction="horizontal" gap="lg" align="start">- <PdfQRCode- value="https://pdfcn.dev/pay/invoice-12345"- size={100}- caption="Scan to pay"- />- <PdfQRCode- value="https://pdfcn.dev/verify/invoice-12345"- size={80}- caption="Verify document"- />- </Stack>- </Section>- <Text variant="sm" color="mutedForeground">- QR codes are rendered as crisp vector graphics in the generated PDF.- </Text>- </Section>`,- margin: 40,- },- section: {- imports: ["Heading", "Section", "Text"],- jsx: `<Section spacing="none">- <Section spacing="lg">- <Heading level={2}>Introduction</Heading>- <Text>This section uses generous spacing for a primary document area.</Text>- </Section>- <Section spacing="md">- <Heading level={2}>Details</Heading>- <Text>This section groups related content with medium spacing.</Text>- </Section>- </Section>`,- margin: 30,- },- signature: {- imports: ["PdfSignatureBlock"],- jsx: `<PdfSignatureBlock- variant="single"- label="Authorized By"- name="John Doe"- title="CEO, Acme Corp"- date="15 February 2026"- />`,- margin: 40,- },- stack: {- imports: ["Divider", "Heading", "Stack", "Text"],- jsx: `<Stack gap="md">- <Heading level={2}>Section</Heading>- <Text>First paragraph in the stack.</Text>- <Text>Second paragraph with consistent spacing.</Text>- <Divider spacing="lg" />- <Stack gap="lg">- <Heading level={3}>Wider gap</Heading>- <Text>Content grouped with a larger vertical rhythm.</Text>- </Stack>- </Stack>`,- margin: 30,- },- table: {- imports: [- "Table",- "TableBody",- "TableCell",- "TableFooter",- "TableHeader",- "TableRow",- ],- jsx: `<Table variant="line" zebraStripe={false}>- <TableHeader>- <TableRow header>- <TableCell>Item</TableCell>- <TableCell align="center">Qty</TableCell>- <TableCell align="right">Price</TableCell>- <TableCell align="right">Total</TableCell>- </TableRow>- </TableHeader>- <TableBody>- <TableRow>- <TableCell>Design</TableCell>- <TableCell align="center">1</TableCell>- <TableCell align="right">$150.00</TableCell>- <TableCell align="right">$150.00</TableCell>- </TableRow>- <TableRow>- <TableCell>Development</TableCell>- <TableCell align="center">1</TableCell>- <TableCell align="right">$2,500.00</TableCell>- <TableCell align="right">$2,500.00</TableCell>- </TableRow>- <TableRow>- <TableCell>Testing</TableCell>- <TableCell align="center">1</TableCell>- <TableCell align="right">$800.00</TableCell>- <TableCell align="right">$800.00</TableCell>- </TableRow>- </TableBody>- <TableFooter>- <TableRow footer>- <TableCell>Total</TableCell>- <TableCell> </TableCell>- <TableCell> </TableCell>- <TableCell align="right">$3,450.00</TableCell>- </TableRow>- </TableFooter>- </Table>`,- margin: 40,- },- text: {- imports: ["Section", "Text"],- jsx: `<Section spacing="none">- <Text>- Default body text for paragraphs, descriptions, and document content.- </Text>- <Text variant="xs" color="mutedForeground">- Caption text for metadata and supporting details.- </Text>- <Text variant="lg">Lead paragraph with a larger typographic scale.</Text>- </Section>`,- margin: 30,- },- watermark: {- imports: ["Heading", "PdfWatermark", "Text"],- jsx: `<View style={{ minHeight: 680, position: "relative" }}>- <PdfWatermark text="DRAFT" />- <Heading level={1}>Draft Document</Heading>- <Text>- This report is under review and should not be distributed externally.- </Text>- <Text>- The watermark sits behind the content while remaining clearly visible.- </Text>- <Text>- Use watermarks for draft, confidential, sample, or approval states.- </Text>- </View>`,- margin: 40,- },-};--const referenceDemoForComponent = (base, name) => {- const config = REFERENCE_COMPONENT_DEMOS[name];- if (!config) {- return demoForComponent(base, name);- }-- const isForme = base === "forme";- const size = config.size ?? "A4";- const sizeExpression =- typeof size === "string"- ? `"${size}"`- : `{{ width: ${size.width}, height: ${size.height} }}`;- const primitiveNames = [- "Document",- "Page",- ...(config.jsx.includes("<View") ? ["View"] : []),- ];- const primitiveImport = isForme- ? `import { ${primitiveNames.join(", ")} } from "@formepdf/react";`- : `import { ${primitiveNames.join(", ")} } from "@/registry/bases/takumi/lib/takumi-primitives";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";`;- const providerOpen = isForme ? "" : " <PdfcnThemeProvider>\n";- const providerClose = isForme ? "" : " </PdfcnThemeProvider>\n";- const marginProp = isForme ? ` margin={${config.margin}}` : "";-- const extraImports = config.extraImports ? `\n${config.extraImports}` : "";-- return `${primitiveImport}${extraImports}-import { ${config.imports.join(", ")} } from "@/registry/bases/${base}/components";--const DemoBody = () => (- ${config.jsx}-);--const Demo = () => {- return (- <Document>- <Page size=${sizeExpression}${marginProp}>-${providerOpen} <DemoBody />-${providerClose} </Page>- </Document>- );-};--export default Demo;-`;-};--const 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 (?:const|function) (\w+)/);- const fn = match?.[1] ?? exp;-- return `import { ${fn} } from "@/registry/bases/${base}/blocks/${name}/${name}";--const Demo =() => {- return <${fn} />;-}-export default Demo;-`;-};--const 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",- }));-};--const 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-primitives.tsx", "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",- }));-};--const main = () => {- const items = [];- const demoImports = { forme: [], takumi: [] };-- fs.writeFileSync(- path.join(ROOT, "examples/preview-assets.ts"),- `export const PREVIEW_IMAGE_DATA_URI = ${JSON.stringify(PREVIEW_IMAGE_DATA_URI)};--export const replacePreviewImageSources = <T>(value: T): T => {- if (value === "/favicon.png") {- return PREVIEW_IMAGE_DATA_URI as T;- }- if (Array.isArray(value)) {- return value.map((item) => replacePreviewImageSources(item)) as T;- }- if (value && typeof value === "object") {- return Object.fromEntries(- Object.entries(value).map(([key, item]) => [- key,- replacePreviewImageSources(item),- ])- ) as T;- }- return value;-};-`- );-- 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, referenceDemoForComponent(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].toSorted()) {- 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].toSorted()) {- 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.mtsdeleted file mode 100644index 99cd3a5..0000000--- a/scripts/port-pdfx.mts+++ /dev/null@@ -1,760 +0,0 @@-/**- * 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");--const ensureDir = (dir: string) => {- fs.mkdirSync(dir, { recursive: true });-};--const write = (file: string, content: string) => {- ensureDir(path.dirname(file));- fs.writeFileSync(file, content, "utf-8");-};--const read = (file: string) => fs.readFileSync(file, "utf-8");--const 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;-};--const renameShared = (content: string) =>- 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"');--const transformCommon = (content: string) =>- 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"'- );--const 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;-};--const 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;-};--const 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;-};--const flatten =(style?: ViewProps["style"]): CSSProperties | undefined => {- if (!style) return undefined;- if (Array.isArray(style)) {- return Object.assign({}, ...style.filter(Boolean));- }- return style;-}--export const 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 const 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 const Image =({- src,- style,- ...rest-}: { src: string; style?: Style | Style[] } & ImgHTMLAttributes<HTMLImageElement>) => {- return <img src={src} style={flatten(style)} alt="" {...rest} />;-}--export const 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 const Document =({- children,- title,- style,-}: {- children?: ReactNode;- title?: string;- style?: Style | Style[];-}) => {- return (- <div data-pdf-document={title} style={flatten(style)}>- {children}- </div>- );-}--export const 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 const Svg =({- children,- style,- ...rest-}: SVGProps<SVGSVGElement> & { style?: CSSProperties }) => {- return (- <svg style={style} {...rest}>- {children}- </svg>- );-}--export const Rect =(props: SVGProps<SVGRectElement>) => {- return <rect {...props} />;-}-export const Circle =(props: SVGProps<SVGCircleElement>) => {- return <circle {...props} />;-}-export const G =(props: SVGProps<SVGGElement>) => {- return <g {...props} />;-}-export const Line =(props: SVGProps<SVGLineElement>) => {- return <line {...props} />;-}-export const Path =(props: SVGProps<SVGPathElement>) => {- return <path {...props} />;-}-export const SvgText =({- children,- style,- ...rest-}: SVGProps<SVGTextElement> & { children?: ReactNode; style?: CSSProperties }) => {- return (- <text style={style} {...rest}>- {children}- </text>- );-}-`- );- }-};--const 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);-};--const 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 const 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 const 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 const 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 const 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.jsonindex 3ce6db0..91b4042 100644--- a/tsconfig.json+++ b/tsconfig.json@@ -34,5 +34,5 @@"next.config.mjs",".next/dev/types/**/*.ts"],- "exclude": ["node_modules", ".pdfx-ref", ".registry-build"]+ "exclude": ["node_modules"]}