Beautiful pdf components, built on Takumi and Forme. 100% Free, Zero config, one command setup.
refactor: standardize component import paths and update registry dependencies for improved clarity in Forme and Takumi examples
Aniket-50892f6342c23ee
diff --git a/components/home-pdf-preview.tsx b/components/home-pdf-preview.tsxindex c29d2db..268f010 100644--- a/components/home-pdf-preview.tsx+++ b/components/home-pdf-preview.tsx@@ -200,7 +200,7 @@ export const getHomePdfSource = (recipe: PdfRecipe, base: HomePdfBase) => {const imports = recipe.componentIds.map((id) => {const component = homePdfComponentCatalog[id];- return `import { ${component.codeName} } from "@/registry/bases/${base}/components/${id}";`;+ return `import { ${component.codeName} } from "@/components/pdf/${id}";`;}).join("\n");const functionName = recipe.iddiff --git a/examples/forme/alert.tsx b/examples/forme/alert.tsxindex 129a8eb..0bb10e8 100644--- a/examples/forme/alert.tsx+++ b/examples/forme/alert.tsx@@ -1,9 +1,9 @@import { Document, Page } from "@formepdf/react";-import { PdfAlert } from "@/registry/bases/forme/components/alert";-import { Heading } from "@/registry/bases/forme/components/heading";-import { Section } from "@/registry/bases/forme/components/section";-import { Text } from "@/registry/bases/forme/components/text";+import { PdfAlert } from "@/registry/bases/forme/components/alert/alert";+import { Heading } from "@/registry/bases/forme/components/heading/heading";+import { Section } from "@/registry/bases/forme/components/section/section";+import { Text } from "@/registry/bases/forme/components/text/text";const DemoBody = () => (<Section spacing="none">diff --git a/examples/forme/badge.tsx b/examples/forme/badge.tsxindex bafe108..f769a55 100644--- a/examples/forme/badge.tsx+++ b/examples/forme/badge.tsx@@ -1,6 +1,6 @@import { Document, Page, View } from "@formepdf/react";-import { Badge } from "@/registry/bases/forme/components/badge";+import { Badge } from "@/registry/bases/forme/components/badge/badge";const DemoBody = () => (<Viewdiff --git a/examples/forme/card.tsx b/examples/forme/card.tsxindex 1047ee1..1c138e1 100644--- a/examples/forme/card.tsx+++ b/examples/forme/card.tsx@@ -1,7 +1,7 @@import { Document, Page } from "@formepdf/react";-import { PdfCard } from "@/registry/bases/forme/components/card";-import { Text } from "@/registry/bases/forme/components/text";+import { PdfCard } from "@/registry/bases/forme/components/card/card";+import { Text } from "@/registry/bases/forme/components/text/text";const DemoBody = () => (<PdfCard title="Project Summary" variant="default" padding="md">diff --git a/examples/forme/data-table.tsx b/examples/forme/data-table.tsxindex c883329..3398734 100644--- a/examples/forme/data-table.tsx+++ b/examples/forme/data-table.tsx@@ -1,8 +1,8 @@import { Document, Page } from "@formepdf/react";-import { DataTable } from "@/registry/bases/forme/components/data-table";-import { Heading } from "@/registry/bases/forme/components/heading";-import { Section } from "@/registry/bases/forme/components/section";+import { DataTable } from "@/registry/bases/forme/components/data-table/data-table";+import { Heading } from "@/registry/bases/forme/components/heading/heading";+import { Section } from "@/registry/bases/forme/components/section/section";const DemoBody = () => (<Section spacing="none">diff --git a/examples/forme/divider.tsx b/examples/forme/divider.tsxindex a0c4276..92d0a8c 100644--- a/examples/forme/divider.tsx+++ b/examples/forme/divider.tsx@@ -1,8 +1,8 @@import { Document, Page, View } from "@formepdf/react";-import { Divider } from "@/registry/bases/forme/components/divider";-import { Heading } from "@/registry/bases/forme/components/heading";-import { Text } from "@/registry/bases/forme/components/text";+import { Divider } from "@/registry/bases/forme/components/divider/divider";+import { Heading } from "@/registry/bases/forme/components/heading/heading";+import { Text } from "@/registry/bases/forme/components/text/text";const DemoBody = () => (<View>diff --git a/examples/forme/form.tsx b/examples/forme/form.tsxindex 979e18b..25af316 100644--- a/examples/forme/form.tsx+++ b/examples/forme/form.tsx@@ -1,6 +1,6 @@import { Document, Page } from "@formepdf/react";-import { PdfForm } from "@/registry/bases/forme/components/form";+import { PdfForm } from "@/registry/bases/forme/components/form/form";const DemoBody = () => (<PdfFormdiff --git a/examples/forme/graph.tsx b/examples/forme/graph.tsxindex db7d314..e999061 100644--- a/examples/forme/graph.tsx+++ b/examples/forme/graph.tsx@@ -1,6 +1,6 @@import { Document, Page } from "@formepdf/react";-import { PdfGraph } from "@/registry/bases/forme/components/graph";+import { PdfGraph } from "@/registry/bases/forme/components/graph/graph";const DemoBody = () => (<PdfGraphdiff --git a/examples/forme/heading.tsx b/examples/forme/heading.tsxindex e48a020..82abf59 100644--- a/examples/forme/heading.tsx+++ b/examples/forme/heading.tsx@@ -1,7 +1,7 @@import { Document, Page } from "@formepdf/react";-import { Heading } from "@/registry/bases/forme/components/heading";-import { Section } from "@/registry/bases/forme/components/section";+import { Heading } from "@/registry/bases/forme/components/heading/heading";+import { Section } from "@/registry/bases/forme/components/section/section";const DemoBody = () => (<Section spacing="none">diff --git a/examples/forme/keep-together.tsx b/examples/forme/keep-together.tsxindex a111f98..b6e37ef 100644--- a/examples/forme/keep-together.tsx+++ b/examples/forme/keep-together.tsx@@ -1,9 +1,9 @@import { Document, Page } from "@formepdf/react";-import { Heading } from "@/registry/bases/forme/components/heading";-import { KeepTogether } from "@/registry/bases/forme/components/keep-together";-import { Section } from "@/registry/bases/forme/components/section";-import { Text } from "@/registry/bases/forme/components/text";+import { Heading } from "@/registry/bases/forme/components/heading/heading";+import { KeepTogether } from "@/registry/bases/forme/components/keep-together/keep-together";+import { Section } from "@/registry/bases/forme/components/section/section";+import { Text } from "@/registry/bases/forme/components/text/text";const DemoBody = () => (<Section spacing="none">diff --git a/examples/forme/key-value.tsx b/examples/forme/key-value.tsxindex c63d67a..0c17e5f 100644--- a/examples/forme/key-value.tsx+++ b/examples/forme/key-value.tsx@@ -1,6 +1,6 @@import { Document, Page } from "@formepdf/react";-import { KeyValue } from "@/registry/bases/forme/components/key-value";+import { KeyValue } from "@/registry/bases/forme/components/key-value/key-value";const DemoBody = () => (<KeyValuediff --git a/examples/forme/link.tsx b/examples/forme/link.tsxindex 27ac6e6..3a409db 100644--- a/examples/forme/link.tsx+++ b/examples/forme/link.tsx@@ -1,7 +1,7 @@import { Document, Page } from "@formepdf/react";-import { Link } from "@/registry/bases/forme/components/link";-import { Section } from "@/registry/bases/forme/components/section";+import { Link } from "@/registry/bases/forme/components/link/link";+import { Section } from "@/registry/bases/forme/components/section/section";const DemoBody = () => (<Section spacing="none">diff --git a/examples/forme/list.tsx b/examples/forme/list.tsxindex 30e61b4..24ac1c7 100644--- a/examples/forme/list.tsx+++ b/examples/forme/list.tsx@@ -1,6 +1,6 @@import { Document, Page } from "@formepdf/react";-import { PdfList } from "@/registry/bases/forme/components/list";+import { PdfList } from "@/registry/bases/forme/components/list/list";const DemoBody = () => (<PdfListdiff --git a/examples/forme/page-break.tsx b/examples/forme/page-break.tsxindex e26c2e4..a8162a4 100644--- a/examples/forme/page-break.tsx+++ b/examples/forme/page-break.tsx@@ -1,8 +1,8 @@import { Document, Page, View } from "@formepdf/react";-import { Heading } from "@/registry/bases/forme/components/heading";-import { PageBreak } from "@/registry/bases/forme/components/page-break";-import { Text } from "@/registry/bases/forme/components/text";+import { Heading } from "@/registry/bases/forme/components/heading/heading";+import { PageBreak } from "@/registry/bases/forme/components/page-break/page-break";+import { Text } from "@/registry/bases/forme/components/text/text";const DemoBody = () => (<View>diff --git a/examples/forme/page-footer.tsx b/examples/forme/page-footer.tsxindex bf3558c..e2497a4 100644--- a/examples/forme/page-footer.tsx+++ b/examples/forme/page-footer.tsx@@ -1,7 +1,7 @@import { Document, Page, View } from "@formepdf/react";-import { PageFooter } from "@/registry/bases/forme/components/page-footer";-import { Text } from "@/registry/bases/forme/components/text";+import { PageFooter } from "@/registry/bases/forme/components/page-footer/page-footer";+import { Text } from "@/registry/bases/forme/components/text/text";const DemoBody = () => (<View style={{ display: "flex", flexDirection: "column", minHeight: 220 }}>diff --git a/examples/forme/page-header.tsx b/examples/forme/page-header.tsxindex c4cf28a..4fc398f 100644--- a/examples/forme/page-header.tsx+++ b/examples/forme/page-header.tsx@@ -1,7 +1,7 @@import { Document, Page, View } from "@formepdf/react";-import { PageHeader } from "@/registry/bases/forme/components/page-header";-import { Text } from "@/registry/bases/forme/components/text";+import { PageHeader } from "@/registry/bases/forme/components/page-header/page-header";+import { Text } from "@/registry/bases/forme/components/text/text";const DemoBody = () => (<View>diff --git a/examples/forme/page-number.tsx b/examples/forme/page-number.tsxindex c21cb3e..59467a5 100644--- a/examples/forme/page-number.tsx+++ b/examples/forme/page-number.tsx@@ -1,8 +1,8 @@import { Document, Page, View } from "@formepdf/react";-import { Heading } from "@/registry/bases/forme/components/heading";-import { PdfPageNumber } from "@/registry/bases/forme/components/page-number";-import { Text } from "@/registry/bases/forme/components/text";+import { Heading } from "@/registry/bases/forme/components/heading/heading";+import { PdfPageNumber } from "@/registry/bases/forme/components/page-number/page-number";+import { Text } from "@/registry/bases/forme/components/text/text";const DemoBody = () => (<View style={{ minHeight: 680, position: "relative" }}>diff --git a/examples/forme/pdf-image.tsx b/examples/forme/pdf-image.tsxindex e4d0180..3ef4984 100644--- a/examples/forme/pdf-image.tsx+++ b/examples/forme/pdf-image.tsx@@ -1,7 +1,7 @@import { Document, Page } from "@formepdf/react";import { PREVIEW_IMAGE_DATA_URI } from "@/examples/preview-assets";-import { PdfImage } from "@/registry/bases/forme/components/pdf-image";+import { PdfImage } from "@/registry/bases/forme/components/pdf-image/pdf-image";const DemoBody = () => (<PdfImagediff --git a/examples/forme/qrcode.tsx b/examples/forme/qrcode.tsxindex 530d635..861f6f8 100644--- a/examples/forme/qrcode.tsx+++ b/examples/forme/qrcode.tsx@@ -1,10 +1,10 @@import { Document, Page } from "@formepdf/react";-import { Heading } from "@/registry/bases/forme/components/heading";-import { PdfQRCode } from "@/registry/bases/forme/components/qrcode";-import { Section } from "@/registry/bases/forme/components/section";-import { Stack } from "@/registry/bases/forme/components/stack";-import { Text } from "@/registry/bases/forme/components/text";+import { Heading } from "@/registry/bases/forme/components/heading/heading";+import { PdfQRCode } from "@/registry/bases/forme/components/qrcode/qrcode";+import { Section } from "@/registry/bases/forme/components/section/section";+import { Stack } from "@/registry/bases/forme/components/stack/stack";+import { Text } from "@/registry/bases/forme/components/text/text";const DemoBody = () => (<Section spacing="none">diff --git a/examples/forme/section.tsx b/examples/forme/section.tsxindex ffece1d..c745f68 100644--- a/examples/forme/section.tsx+++ b/examples/forme/section.tsx@@ -1,8 +1,8 @@import { Document, Page } from "@formepdf/react";-import { Heading } from "@/registry/bases/forme/components/heading";-import { Section } from "@/registry/bases/forme/components/section";-import { Text } from "@/registry/bases/forme/components/text";+import { Heading } from "@/registry/bases/forme/components/heading/heading";+import { Section } from "@/registry/bases/forme/components/section/section";+import { Text } from "@/registry/bases/forme/components/text/text";const DemoBody = () => (<Section spacing="none">diff --git a/examples/forme/signature.tsx b/examples/forme/signature.tsxindex c2cfb44..0faa083 100644--- a/examples/forme/signature.tsx+++ b/examples/forme/signature.tsx@@ -1,6 +1,6 @@import { Document, Page } from "@formepdf/react";-import { PdfSignatureBlock } from "@/registry/bases/forme/components/signature";+import { PdfSignatureBlock } from "@/registry/bases/forme/components/signature/signature";const DemoBody = () => (<PdfSignatureBlockdiff --git a/examples/forme/stack.tsx b/examples/forme/stack.tsxindex 61682b2..90d386e 100644--- a/examples/forme/stack.tsx+++ b/examples/forme/stack.tsx@@ -1,9 +1,9 @@import { Document, Page } from "@formepdf/react";-import { Divider } from "@/registry/bases/forme/components/divider";-import { Heading } from "@/registry/bases/forme/components/heading";-import { Stack } from "@/registry/bases/forme/components/stack";-import { Text } from "@/registry/bases/forme/components/text";+import { Divider } from "@/registry/bases/forme/components/divider/divider";+import { Heading } from "@/registry/bases/forme/components/heading/heading";+import { Stack } from "@/registry/bases/forme/components/stack/stack";+import { Text } from "@/registry/bases/forme/components/text/text";const DemoBody = () => (<Stack gap="md">diff --git a/examples/forme/table.tsx b/examples/forme/table.tsxindex 1c8c814..1aaffca 100644--- a/examples/forme/table.tsx+++ b/examples/forme/table.tsx@@ -7,7 +7,7 @@ import {TableFooter,TableHeader,TableRow,-} from "@/registry/bases/forme/components/table";+} from "@/registry/bases/forme/components/table/table";const DemoBody = () => (<Table variant="line" zebraStripe={false}>diff --git a/examples/forme/text.tsx b/examples/forme/text.tsxindex 8277a31..e08f1de 100644--- a/examples/forme/text.tsx+++ b/examples/forme/text.tsx@@ -1,7 +1,7 @@import { Document, Page } from "@formepdf/react";-import { Section } from "@/registry/bases/forme/components/section";-import { Text } from "@/registry/bases/forme/components/text";+import { Section } from "@/registry/bases/forme/components/section/section";+import { Text } from "@/registry/bases/forme/components/text/text";const DemoBody = () => (<Section spacing="none">diff --git a/examples/forme/watermark.tsx b/examples/forme/watermark.tsxindex bb0afea..425fb77 100644--- a/examples/forme/watermark.tsx+++ b/examples/forme/watermark.tsx@@ -1,8 +1,8 @@import { Document, Page, View } from "@formepdf/react";-import { Heading } from "@/registry/bases/forme/components/heading";-import { Text } from "@/registry/bases/forme/components/text";-import { PdfWatermark } from "@/registry/bases/forme/components/watermark";+import { Heading } from "@/registry/bases/forme/components/heading/heading";+import { Text } from "@/registry/bases/forme/components/text/text";+import { PdfWatermark } from "@/registry/bases/forme/components/watermark/watermark";const DemoBody = () => (<View style={{ minHeight: 680, position: "relative" }}>diff --git a/examples/takumi/alert.tsx b/examples/takumi/alert.tsxindex f813405..cdf953d 100644--- a/examples/takumi/alert.tsx+++ b/examples/takumi/alert.tsx@@ -1,7 +1,7 @@-import { PdfAlert } from "@/registry/bases/takumi/components/alert";-import { Heading } from "@/registry/bases/takumi/components/heading";-import { Section } from "@/registry/bases/takumi/components/section";-import { Text } from "@/registry/bases/takumi/components/text";+import { PdfAlert } from "@/registry/bases/takumi/components/alert/alert";+import { Heading } from "@/registry/bases/takumi/components/heading/heading";+import { Section } from "@/registry/bases/takumi/components/section/section";+import { Text } from "@/registry/bases/takumi/components/text/text";import { PdfcnThemeProvider } from "@/registry/bases/takumi/components/theme-provider";import { Document, Page } from "@/registry/bases/takumi/lib/pdf-primitives";diff --git a/examples/takumi/badge.tsx b/examples/takumi/badge.tsxindex bcaadb9..d048902 100644--- a/examples/takumi/badge.tsx+++ b/examples/takumi/badge.tsx@@ -1,4 +1,4 @@-import { Badge } from "@/registry/bases/takumi/components/badge";+import { Badge } from "@/registry/bases/takumi/components/badge/badge";import { PdfcnThemeProvider } from "@/registry/bases/takumi/components/theme-provider";import {Document,diff --git a/examples/takumi/card.tsx b/examples/takumi/card.tsxindex 7eca85c..167aa3f 100644--- a/examples/takumi/card.tsx+++ b/examples/takumi/card.tsx@@ -1,5 +1,5 @@-import { PdfCard } from "@/registry/bases/takumi/components/card";-import { Text } from "@/registry/bases/takumi/components/text";+import { PdfCard } from "@/registry/bases/takumi/components/card/card";+import { Text } from "@/registry/bases/takumi/components/text/text";import { PdfcnThemeProvider } from "@/registry/bases/takumi/components/theme-provider";import { Document, Page } from "@/registry/bases/takumi/lib/pdf-primitives";diff --git a/examples/takumi/data-table.tsx b/examples/takumi/data-table.tsxindex 9a819dc..e2382e3 100644--- a/examples/takumi/data-table.tsx+++ b/examples/takumi/data-table.tsx@@ -1,6 +1,6 @@-import { DataTable } from "@/registry/bases/takumi/components/data-table";-import { Heading } from "@/registry/bases/takumi/components/heading";-import { Section } from "@/registry/bases/takumi/components/section";+import { DataTable } from "@/registry/bases/takumi/components/data-table/data-table";+import { Heading } from "@/registry/bases/takumi/components/heading/heading";+import { Section } from "@/registry/bases/takumi/components/section/section";import { PdfcnThemeProvider } from "@/registry/bases/takumi/components/theme-provider";import { Document, Page } from "@/registry/bases/takumi/lib/pdf-primitives";diff --git a/examples/takumi/divider.tsx b/examples/takumi/divider.tsxindex fd38cd7..d21f568 100644--- a/examples/takumi/divider.tsx+++ b/examples/takumi/divider.tsx@@ -1,6 +1,6 @@-import { Divider } from "@/registry/bases/takumi/components/divider";-import { Heading } from "@/registry/bases/takumi/components/heading";-import { Text } from "@/registry/bases/takumi/components/text";+import { Divider } from "@/registry/bases/takumi/components/divider/divider";+import { Heading } from "@/registry/bases/takumi/components/heading/heading";+import { Text } from "@/registry/bases/takumi/components/text/text";import { PdfcnThemeProvider } from "@/registry/bases/takumi/components/theme-provider";import {Document,diff --git a/examples/takumi/form.tsx b/examples/takumi/form.tsxindex a996fa4..28ad5b2 100644--- a/examples/takumi/form.tsx+++ b/examples/takumi/form.tsx@@ -1,4 +1,4 @@-import { PdfForm } from "@/registry/bases/takumi/components/form";+import { PdfForm } from "@/registry/bases/takumi/components/form/form";import { PdfcnThemeProvider } from "@/registry/bases/takumi/components/theme-provider";import { Document, Page } from "@/registry/bases/takumi/lib/pdf-primitives";diff --git a/examples/takumi/graph.tsx b/examples/takumi/graph.tsxindex b87422d..59792f6 100644--- a/examples/takumi/graph.tsx+++ b/examples/takumi/graph.tsx@@ -1,4 +1,4 @@-import { PdfGraph } from "@/registry/bases/takumi/components/graph";+import { PdfGraph } from "@/registry/bases/takumi/components/graph/graph";import { PdfcnThemeProvider } from "@/registry/bases/takumi/components/theme-provider";import { Document, Page } from "@/registry/bases/takumi/lib/pdf-primitives";diff --git a/examples/takumi/heading.tsx b/examples/takumi/heading.tsxindex 929db28..7767108 100644--- a/examples/takumi/heading.tsx+++ b/examples/takumi/heading.tsx@@ -1,5 +1,5 @@-import { Heading } from "@/registry/bases/takumi/components/heading";-import { Section } from "@/registry/bases/takumi/components/section";+import { Heading } from "@/registry/bases/takumi/components/heading/heading";+import { Section } from "@/registry/bases/takumi/components/section/section";import { PdfcnThemeProvider } from "@/registry/bases/takumi/components/theme-provider";import { Document, Page } from "@/registry/bases/takumi/lib/pdf-primitives";diff --git a/examples/takumi/keep-together.tsx b/examples/takumi/keep-together.tsxindex ea417fe..6d93afa 100644--- a/examples/takumi/keep-together.tsx+++ b/examples/takumi/keep-together.tsx@@ -1,7 +1,7 @@-import { Heading } from "@/registry/bases/takumi/components/heading";-import { KeepTogether } from "@/registry/bases/takumi/components/keep-together";-import { Section } from "@/registry/bases/takumi/components/section";-import { Text } from "@/registry/bases/takumi/components/text";+import { Heading } from "@/registry/bases/takumi/components/heading/heading";+import { KeepTogether } from "@/registry/bases/takumi/components/keep-together/keep-together";+import { Section } from "@/registry/bases/takumi/components/section/section";+import { Text } from "@/registry/bases/takumi/components/text/text";import { PdfcnThemeProvider } from "@/registry/bases/takumi/components/theme-provider";import { Document, Page } from "@/registry/bases/takumi/lib/pdf-primitives";diff --git a/examples/takumi/key-value.tsx b/examples/takumi/key-value.tsxindex 795c9e7..b736972 100644--- a/examples/takumi/key-value.tsx+++ b/examples/takumi/key-value.tsx@@ -1,4 +1,4 @@-import { KeyValue } from "@/registry/bases/takumi/components/key-value";+import { KeyValue } from "@/registry/bases/takumi/components/key-value/key-value";import { PdfcnThemeProvider } from "@/registry/bases/takumi/components/theme-provider";import { Document, Page } from "@/registry/bases/takumi/lib/pdf-primitives";diff --git a/examples/takumi/link.tsx b/examples/takumi/link.tsxindex 6a22925..e2b8f19 100644--- a/examples/takumi/link.tsx+++ b/examples/takumi/link.tsx@@ -1,5 +1,5 @@-import { Link } from "@/registry/bases/takumi/components/link";-import { Section } from "@/registry/bases/takumi/components/section";+import { Link } from "@/registry/bases/takumi/components/link/link";+import { Section } from "@/registry/bases/takumi/components/section/section";import { PdfcnThemeProvider } from "@/registry/bases/takumi/components/theme-provider";import { Document, Page } from "@/registry/bases/takumi/lib/pdf-primitives";diff --git a/examples/takumi/list.tsx b/examples/takumi/list.tsxindex 6183b76..b7e61db 100644--- a/examples/takumi/list.tsx+++ b/examples/takumi/list.tsx@@ -1,4 +1,4 @@-import { PdfList } from "@/registry/bases/takumi/components/list";+import { PdfList } from "@/registry/bases/takumi/components/list/list";import { PdfcnThemeProvider } from "@/registry/bases/takumi/components/theme-provider";import { Document, Page } from "@/registry/bases/takumi/lib/pdf-primitives";diff --git a/examples/takumi/page-break.tsx b/examples/takumi/page-break.tsxindex f89dd71..fca1236 100644--- a/examples/takumi/page-break.tsx+++ b/examples/takumi/page-break.tsx@@ -1,6 +1,6 @@-import { Heading } from "@/registry/bases/takumi/components/heading";-import { PageBreak } from "@/registry/bases/takumi/components/page-break";-import { Text } from "@/registry/bases/takumi/components/text";+import { Heading } from "@/registry/bases/takumi/components/heading/heading";+import { PageBreak } from "@/registry/bases/takumi/components/page-break/page-break";+import { Text } from "@/registry/bases/takumi/components/text/text";import { PdfcnThemeProvider } from "@/registry/bases/takumi/components/theme-provider";import {Document,diff --git a/examples/takumi/page-footer.tsx b/examples/takumi/page-footer.tsxindex de91b41..971fbb5 100644--- a/examples/takumi/page-footer.tsx+++ b/examples/takumi/page-footer.tsx@@ -1,5 +1,5 @@-import { PageFooter } from "@/registry/bases/takumi/components/page-footer";-import { Text } from "@/registry/bases/takumi/components/text";+import { PageFooter } from "@/registry/bases/takumi/components/page-footer/page-footer";+import { Text } from "@/registry/bases/takumi/components/text/text";import { PdfcnThemeProvider } from "@/registry/bases/takumi/components/theme-provider";import {Document,diff --git a/examples/takumi/page-header.tsx b/examples/takumi/page-header.tsxindex 2fbcf55..d608b39 100644--- a/examples/takumi/page-header.tsx+++ b/examples/takumi/page-header.tsx@@ -1,5 +1,5 @@-import { PageHeader } from "@/registry/bases/takumi/components/page-header";-import { Text } from "@/registry/bases/takumi/components/text";+import { PageHeader } from "@/registry/bases/takumi/components/page-header/page-header";+import { Text } from "@/registry/bases/takumi/components/text/text";import { PdfcnThemeProvider } from "@/registry/bases/takumi/components/theme-provider";import {Document,diff --git a/examples/takumi/page-number.tsx b/examples/takumi/page-number.tsxindex 42a5fd8..df314d4 100644--- a/examples/takumi/page-number.tsx+++ b/examples/takumi/page-number.tsx@@ -1,6 +1,6 @@-import { Heading } from "@/registry/bases/takumi/components/heading";-import { PdfPageNumber } from "@/registry/bases/takumi/components/page-number";-import { Text } from "@/registry/bases/takumi/components/text";+import { Heading } from "@/registry/bases/takumi/components/heading/heading";+import { PdfPageNumber } from "@/registry/bases/takumi/components/page-number/page-number";+import { Text } from "@/registry/bases/takumi/components/text/text";import { PdfcnThemeProvider } from "@/registry/bases/takumi/components/theme-provider";import {Document,diff --git a/examples/takumi/pdf-image.tsx b/examples/takumi/pdf-image.tsxindex 28f90d0..6acf84c 100644--- a/examples/takumi/pdf-image.tsx+++ b/examples/takumi/pdf-image.tsx@@ -1,5 +1,5 @@import { PREVIEW_IMAGE_DATA_URI } from "@/examples/preview-assets";-import { PdfImage } from "@/registry/bases/takumi/components/pdf-image";+import { PdfImage } from "@/registry/bases/takumi/components/pdf-image/pdf-image";import { PdfcnThemeProvider } from "@/registry/bases/takumi/components/theme-provider";import { Document, Page } from "@/registry/bases/takumi/lib/pdf-primitives";diff --git a/examples/takumi/qrcode.tsx b/examples/takumi/qrcode.tsxindex 5586b17..6b8f699 100644--- a/examples/takumi/qrcode.tsx+++ b/examples/takumi/qrcode.tsx@@ -1,8 +1,8 @@-import { Heading } from "@/registry/bases/takumi/components/heading";-import { PdfQRCode } from "@/registry/bases/takumi/components/qrcode";-import { Section } from "@/registry/bases/takumi/components/section";-import { Stack } from "@/registry/bases/takumi/components/stack";-import { Text } from "@/registry/bases/takumi/components/text";+import { Heading } from "@/registry/bases/takumi/components/heading/heading";+import { PdfQRCode } from "@/registry/bases/takumi/components/qrcode/qrcode";+import { Section } from "@/registry/bases/takumi/components/section/section";+import { Stack } from "@/registry/bases/takumi/components/stack/stack";+import { Text } from "@/registry/bases/takumi/components/text/text";import { PdfcnThemeProvider } from "@/registry/bases/takumi/components/theme-provider";import { Document, Page } from "@/registry/bases/takumi/lib/pdf-primitives";diff --git a/examples/takumi/section.tsx b/examples/takumi/section.tsxindex 0abe3f8..81cfc90 100644--- a/examples/takumi/section.tsx+++ b/examples/takumi/section.tsx@@ -1,6 +1,6 @@-import { Heading } from "@/registry/bases/takumi/components/heading";-import { Section } from "@/registry/bases/takumi/components/section";-import { Text } from "@/registry/bases/takumi/components/text";+import { Heading } from "@/registry/bases/takumi/components/heading/heading";+import { Section } from "@/registry/bases/takumi/components/section/section";+import { Text } from "@/registry/bases/takumi/components/text/text";import { PdfcnThemeProvider } from "@/registry/bases/takumi/components/theme-provider";import { Document, Page } from "@/registry/bases/takumi/lib/pdf-primitives";diff --git a/examples/takumi/signature.tsx b/examples/takumi/signature.tsxindex 6eac052..73f0e92 100644--- a/examples/takumi/signature.tsx+++ b/examples/takumi/signature.tsx@@ -1,4 +1,4 @@-import { PdfSignatureBlock } from "@/registry/bases/takumi/components/signature";+import { PdfSignatureBlock } from "@/registry/bases/takumi/components/signature/signature";import { PdfcnThemeProvider } from "@/registry/bases/takumi/components/theme-provider";import { Document, Page } from "@/registry/bases/takumi/lib/pdf-primitives";diff --git a/examples/takumi/stack.tsx b/examples/takumi/stack.tsxindex 3dc354a..011cdb0 100644--- a/examples/takumi/stack.tsx+++ b/examples/takumi/stack.tsx@@ -1,7 +1,7 @@-import { Divider } from "@/registry/bases/takumi/components/divider";-import { Heading } from "@/registry/bases/takumi/components/heading";-import { Stack } from "@/registry/bases/takumi/components/stack";-import { Text } from "@/registry/bases/takumi/components/text";+import { Divider } from "@/registry/bases/takumi/components/divider/divider";+import { Heading } from "@/registry/bases/takumi/components/heading/heading";+import { Stack } from "@/registry/bases/takumi/components/stack/stack";+import { Text } from "@/registry/bases/takumi/components/text/text";import { PdfcnThemeProvider } from "@/registry/bases/takumi/components/theme-provider";import { Document, Page } from "@/registry/bases/takumi/lib/pdf-primitives";diff --git a/examples/takumi/table.tsx b/examples/takumi/table.tsxindex 2de812a..5a5a880 100644--- a/examples/takumi/table.tsx+++ b/examples/takumi/table.tsx@@ -5,7 +5,7 @@ import {TableFooter,TableHeader,TableRow,-} from "@/registry/bases/takumi/components/table";+} from "@/registry/bases/takumi/components/table/table";import { PdfcnThemeProvider } from "@/registry/bases/takumi/components/theme-provider";import { Document, Page } from "@/registry/bases/takumi/lib/pdf-primitives";diff --git a/examples/takumi/text.tsx b/examples/takumi/text.tsxindex 0fca98c..c7218f2 100644--- a/examples/takumi/text.tsx+++ b/examples/takumi/text.tsx@@ -1,5 +1,5 @@-import { Section } from "@/registry/bases/takumi/components/section";-import { Text } from "@/registry/bases/takumi/components/text";+import { Section } from "@/registry/bases/takumi/components/section/section";+import { Text } from "@/registry/bases/takumi/components/text/text";import { PdfcnThemeProvider } from "@/registry/bases/takumi/components/theme-provider";import { Document, Page } from "@/registry/bases/takumi/lib/pdf-primitives";diff --git a/examples/takumi/watermark.tsx b/examples/takumi/watermark.tsxindex fd125fd..a8836c7 100644--- a/examples/takumi/watermark.tsx+++ b/examples/takumi/watermark.tsx@@ -1,7 +1,7 @@-import { Heading } from "@/registry/bases/takumi/components/heading";-import { Text } from "@/registry/bases/takumi/components/text";+import { Heading } from "@/registry/bases/takumi/components/heading/heading";+import { Text } from "@/registry/bases/takumi/components/text/text";import { PdfcnThemeProvider } from "@/registry/bases/takumi/components/theme-provider";-import { PdfWatermark } from "@/registry/bases/takumi/components/watermark";+import { PdfWatermark } from "@/registry/bases/takumi/components/watermark/watermark";import {Document,Page,diff --git a/public/r/forme/alert.json b/public/r/forme/alert.jsonindex 30c0bf4..4595c4f 100644--- a/public/r/forme/alert.json+++ b/public/r/forme/alert.json@@ -8,20 +8,14 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils"],"files": [{"path": "registry/bases/forme/components/alert/alert.tsx",- "content": "import type { ReactNode } from \"react\";\n\nimport {\n mergePdfStyles,\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport { Circle, Line, Path, Svg } from \"@/registry/bases/forme/lib/pdf-svg\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import type { ReactNode } from \"react\";\n\nimport {\n mergePdfStyles,\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/components/theme-provider\";\nimport {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport { Circle, Line, Path, Svg } from \"@/registry/bases/forme/lib/pdf-svg\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/alert/alert.tsx"- },- {- "path": "registry/bases/forme/components/alert/index.ts",- "content": "export { PdfAlert, type PdfAlertProps, type AlertVariant } from \"./alert\";\n",- "type": "registry:component",- "target": "components/pdf/alert/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/badge.json b/public/r/forme/badge.jsonindex a627915..417d6cc 100644--- a/public/r/forme/badge.json+++ b/public/r/forme/badge.json@@ -8,20 +8,14 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils"],"files": [{"path": "registry/bases/forme/components/badge/badge.tsx",- "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/components/theme-provider\";\nimport {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/badge/badge.tsx"- },- {- "path": "registry/bases/forme/components/badge/index.ts",- "content": "export {\n Badge,\n type BadgeProps,\n type BadgeVariant,\n type BadgeSize,\n} from \"./badge\";\n",- "type": "registry:component",- "target": "components/pdf/badge/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/card.json b/public/r/forme/card.jsonindex 2f70bb2..29588c7 100644--- a/public/r/forme/card.json+++ b/public/r/forme/card.json@@ -8,20 +8,14 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils"],"files": [{"path": "registry/bases/forme/components/card/card.tsx",- "content": "import type { ReactNode } from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import type { ReactNode } from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/components/theme-provider\";\nimport {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/card/card.tsx"- },- {- "path": "registry/bases/forme/components/card/index.ts",- "content": "export { PdfCard, type PdfCardProps, type CardVariant } from \"./card\";\n",- "type": "registry:component",- "target": "components/pdf/card/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/data-table.json b/public/r/forme/data-table.jsonindex 7c375df..e63b4c2 100644--- a/public/r/forme/data-table.json+++ b/public/r/forme/data-table.json@@ -8,33 +8,27 @@"@formepdf/core"],"registryDependencies": [- "forme/utils",- "forme/table"+ "@pdfcn/forme/utils",+ "@pdfcn/forme/table"],"files": [{"path": "registry/bases/forme/components/data-table/data-table.styles.ts",- "content": "import { StyleSheet } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import { StyleSheet } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/data-table/data-table.styles.ts"},{"path": "registry/bases/forme/components/data-table/data-table.tsx",- "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 {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport { Text as PDFText } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-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 [\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/table\";\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/components/theme-provider\";\nimport { Text as PDFText } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-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 [\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/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 { TableVariant } from \"@/registry/bases/forme/components/table/table.types\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\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/types/pdf-components\";\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/data-table/data-table.types.ts"- },- {- "path": "registry/bases/forme/components/data-table/index.ts",- "content": "export { DataTable } from \"./data-table\";\nexport type {\n DataTableProps,\n DataTableColumn,\n DataTableSize,\n} from \"./data-table.types\";\n",- "type": "registry:component",- "target": "components/pdf/data-table/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/divider.json b/public/r/forme/divider.jsonindex 0b565c2..a4eacc2 100644--- a/public/r/forme/divider.json+++ b/public/r/forme/divider.json@@ -8,20 +8,14 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils"],"files": [{"path": "registry/bases/forme/components/divider/divider.tsx",- "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/components/theme-provider\";\nimport {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/divider/divider.tsx"- },- {- "path": "registry/bases/forme/components/divider/index.ts",- "content": "export {\n Divider,\n type DividerProps,\n type DividerVariant,\n type DividerThickness,\n type DividerSpacing,\n} from \"./divider\";\n",- "type": "registry:component",- "target": "components/pdf/divider/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/form.json b/public/r/forme/form.jsonindex dc38209..411805a 100644--- a/public/r/forme/form.json+++ b/public/r/forme/form.json@@ -8,18 +8,18 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils"],"files": [{"path": "registry/bases/forme/components/form/form.styles.ts",- "content": "import { StyleSheet } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import { StyleSheet } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/form/form.styles.ts"},{"path": "registry/bases/forme/components/form/form.tsx",- "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n Text as PDFText,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-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 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 usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/components/theme-provider\";\nimport {\n Text as PDFText,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-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 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/form/form.tsx"},@@ -28,12 +28,6 @@"content": "import type { Style } from \"@formepdf/react\";\n\n/** Visual style variant for the fillable form. */\nexport type PdfFormVariant = \"underline\" | \"box\" | \"outlined\" | \"ghost\";\n\n/** Column layout for a form section. */\nexport type FormLayout = \"single\" | \"two-column\" | \"three-column\";\n\n/** Label position relative to the field. */\nexport type FormLabelPosition = \"above\" | \"left\";\n\n/**\n * A single fillable field definition.\n * Props - `label` | `hint` | `height` | `width`\n * @see {@link PdfFormField}\n */\nexport interface PdfFormField {\n label: string;\n hint?: string;\n /**\n * Height of the blank field area in points.\n * @default 18\n */\n height?: number;\n width?: number | string;\n}\n\n/**\n * A logical group of fields with an optional section title.\n * Props - `title` | `fields` | `layout`\n * @see {@link PdfFormGroup}\n */\nexport interface PdfFormGroup {\n title?: string;\n fields: PdfFormField[];\n /**\n * @default 'single'\n */\n layout?: FormLayout;\n}\n\n/**\n * Fillable PDF form with grouped fields, layout variants, and label positioning options.\n * Props - `title` | `subtitle` | `groups` | `variant` | `labelPosition` | `noWrap` | `style`\n * @see {@link PdfFormProps}\n */\nexport interface PdfFormProps {\n title?: string;\n subtitle?: string;\n groups: PdfFormGroup[];\n /**\n * @default 'underline'\n */\n variant?: PdfFormVariant;\n /**\n * @default 'above'\n */\n labelPosition?: FormLabelPosition;\n noWrap?: boolean;\n style?: Style;\n}\n","type": "registry:component","target": "components/pdf/form/form.types.ts"- },- {- "path": "registry/bases/forme/components/form/index.ts",- "content": "export { PdfForm } from \"./form\";\nexport type {\n PdfFormProps,\n PdfFormVariant,\n PdfFormField,\n PdfFormGroup,\n FormLayout,\n FormLabelPosition,\n} from \"./form.types\";\n",- "type": "registry:component",- "target": "components/pdf/form/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/graph.json b/public/r/forme/graph.jsonindex e6a9b95..346b871 100644--- a/public/r/forme/graph.json+++ b/public/r/forme/graph.json@@ -8,18 +8,18 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils"],"files": [{"path": "registry/bases/forme/components/graph/graph.styles.ts",- "content": "import { StyleSheet } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import { StyleSheet } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/graph/graph.styles.ts"},{"path": "registry/bases/forme/components/graph/graph.tsx",- "content": "import type React from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n Text as PDFText,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport {\n Circle,\n G,\n Line,\n Path,\n Rect,\n Svg,\n SvgText,\n} from \"@/registry/bases/forme/lib/pdf-svg\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import type React from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/components/theme-provider\";\nimport {\n Text as PDFText,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport {\n Circle,\n G,\n Line,\n Path,\n Rect,\n Svg,\n SvgText,\n} from \"@/registry/bases/forme/lib/pdf-svg\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/graph/graph.tsx"},@@ -31,15 +31,9 @@},{"path": "registry/bases/forme/components/graph/graph.utils.ts",- "content": "import type { PdfcnTheme } from \"@/types/pdf-themes\";\n\nimport type {\n ChartLayout,\n GraphDataPoint,\n GraphSeries,\n GraphWidthOptions,\n} from \"./graph.types\";\n\n/** Standard A4 page width in PDF points. */\nexport const A4_WIDTH = 595;\n\n/**\n * Pre-calculated safe graph widths for common scenarios.\n * These values work with all built-in themes on A4 pages.\n */\nexport const GRAPH_SAFE_WIDTHS = {\n /** Safe width for graph directly in page content (no extra containers) */\n default: 420,\n /** Safe width for graph inside a Section with md padding */\n inSection: 400,\n /** Safe width for graph inside a Section + bordered wrapper (like graphShell) */\n inSectionWithWrapper: 380,\n} as const;\n\n/**\n * Calculate the safe graph width based on theme page margins and container context.\n *\n * This utility ensures graphs don't overflow their container by accounting for:\n * - Page margins (from theme)\n * - Container padding (e.g., Section component)\n * - Wrapper padding (e.g., a bordered graphShell View)\n *\n * @example\n * ```tsx\n * const width = getGraphWidth(theme);\n * // For a graph inside a Section with padding=\"md\" (12pt) and a graphShell (12pt):\n * const width = getGraphWidth(theme, { containerPadding: 12, wrapperPadding: 12 });\n * ```\n */\nexport const getGraphWidth = (\n theme: PdfcnTheme,\n options: GraphWidthOptions = {}\n): number => {\n const {\n containerPadding = 0,\n wrapperPadding = 0,\n pageWidth = A4_WIDTH,\n } = options;\n const { marginLeft, marginRight } = theme.spacing.page;\n const availableWidth =\n pageWidth -\n marginLeft -\n marginRight -\n containerPadding * 2 -\n wrapperPadding * 2;\n return Math.max(Math.floor(availableWidth), 100);\n};\n\nexport const CHART_MARGINS = {\n axisBottom: 24,\n axisLeft: 40,\n pieBottom: 10,\n pieLeft: 10,\n right: 10,\n top: 10,\n} as const;\n\n/** Normalize to always work with GraphSeries[]. */\nexport const normalizeData = (\n data: GraphDataPoint[] | GraphSeries[]\n): GraphSeries[] => {\n if (data.length === 0) {\n return [];\n }\n if (\"label\" in data[0] && \"value\" in data[0]) {\n return [{ data: data as GraphDataPoint[], name: \"Series 1\" }];\n }\n return data as GraphSeries[];\n};\n\n/** Compute nice Y-axis ticks for a given value range. */\nexport const computeYTicks = (\n min: number,\n max: number,\n count: number\n): number[] => {\n if (min === max) {\n return [0, max || 1];\n }\n const step = (max - min) / (count - 1);\n return Array.from({ length: count }, (_, i) => {\n const v = min + i * step;\n return Math.round(v * 100) / 100;\n });\n};\n\n/** Format a number for display on axis labels. */\nexport const fmtNum = (v: number): string => {\n if (Math.abs(v) >= 1_000_000) {\n return `${(v / 1_000_000).toFixed(1)}M`;\n }\n if (Math.abs(v) >= 1000) {\n return `${(v / 1000).toFixed(1)}K`;\n }\n if (!Number.isInteger(v)) {\n return v.toFixed(1);\n }\n return String(v);\n};\n\n/** Truncate a label to at most maxLen characters. */\nexport const truncate = (s: string, maxLen: number): string =>\n s.length > maxLen ? `${s.slice(0, maxLen - 1)}…` : s;\n\n/** Polar to Cartesian coordinate conversion for pie/donut arcs. */\nexport const polarToCartesian = (\n cx: number,\n cy: number,\n r: number,\n angleDeg: number\n) => {\n const rad = ((angleDeg - 90) * Math.PI) / 180;\n return { x: cx + r * Math.cos(rad), y: cy + r * Math.sin(rad) };\n};\n\n/** Build an SVG arc path for a pie/donut slice. */\nexport const arcPath = (\n cx: number,\n cy: number,\n r: number,\n startAngle: number,\n endAngle: number,\n innerR = 0\n): string => {\n const safeEnd = Math.min(endAngle, startAngle + 359.999);\n const large = safeEnd - startAngle > 180 ? 1 : 0;\n const s = polarToCartesian(cx, cy, r, safeEnd);\n const e = polarToCartesian(cx, cy, r, startAngle);\n if (innerR === 0) {\n return `M ${cx} ${cy} L ${s.x} ${s.y} A ${r} ${r} 0 ${large} 0 ${e.x} ${e.y} Z`;\n }\n const si = polarToCartesian(cx, cy, innerR, safeEnd);\n const ei = polarToCartesian(cx, cy, innerR, startAngle);\n return [\n `M ${s.x} ${s.y}`,\n `A ${r} ${r} 0 ${large} 0 ${e.x} ${e.y}`,\n `L ${ei.x} ${ei.y}`,\n `A ${innerR} ${innerR} 0 ${large} 1 ${si.x} ${si.y}`,\n \"Z\",\n ].join(\" \");\n};\n\n/** Compute smooth bezier control points (Catmull-Rom → cubic bezier). */\nexport const smoothPath = (\n points: { x: number; y: number }[],\n tension = 0.4\n): string => {\n if (points.length < 2) {\n return \"\";\n }\n if (points.length === 2) {\n return `M ${points[0].x} ${points[0].y} L ${points[1].x} ${points[1].y}`;\n }\n const parts: string[] = [`M ${points[0].x} ${points[0].y}`];\n for (let i = 0; i < points.length - 1; i += 1) {\n const p0 = points[Math.max(i - 1, 0)];\n const p1 = points[i];\n const p2 = points[i + 1];\n const p3 = points[Math.min(i + 2, points.length - 1)];\n const cp1x = p1.x + (p2.x - p0.x) * tension;\n const cp1y = p1.y + (p2.y - p0.y) * tension;\n const cp2x = p2.x - (p3.x - p1.x) * tension;\n const cp2y = p2.y - (p3.y - p1.y) * tension;\n parts.push(`C ${cp1x} ${cp1y} ${cp2x} ${cp2y} ${p2.x} ${p2.y}`);\n }\n return parts.join(\" \");\n};\n\n/** Get the default chart color palette from the theme. */\nexport const getDefaultPalette = (t: PdfcnTheme): string[] => [\n t.colors.primary,\n t.colors.info ?? \"#3B82F6\",\n t.colors.success ?? \"#22C55E\",\n t.colors.warning ?? \"#F59E0B\",\n t.colors.destructive ?? \"#EF4444\",\n \"#8B5CF6\",\n \"#F97316\",\n \"#14B8A6\",\n];\n\n/** Derive ChartLayout from series data, SVG dimensions, and variant. */\nexport const buildLayout = (\n series: GraphSeries[],\n width: number,\n height: number,\n isPieOrDonut: boolean,\n yTickCount: number\n): ChartLayout => {\n const mL = isPieOrDonut ? CHART_MARGINS.pieLeft : CHART_MARGINS.axisLeft;\n const mB = isPieOrDonut ? CHART_MARGINS.pieBottom : CHART_MARGINS.axisBottom;\n const chartX = mL;\n const chartY = CHART_MARGINS.top;\n const chartW = width - mL - CHART_MARGINS.right;\n const chartH = height - CHART_MARGINS.top - mB;\n const allValues = series.flatMap((s) => s.data.map((d) => d.value));\n const rawMin = Math.min(...allValues, 0);\n const rawMax = Math.max(...allValues, 1);\n const yMin = Math.min(0, rawMin);\n const yMax = rawMax + (rawMax - yMin) * 0.08;\n return {\n chartH,\n chartW,\n chartX,\n chartY,\n svgH: height,\n svgW: width,\n xLabels: series[0]?.data.map((d) => d.label) ?? [],\n yMax,\n yMin,\n yTicks: computeYTicks(yMin, yMax, yTickCount),\n };\n};\n",+ "content": "import type { PdfcnTheme } from \"@/registry/types/pdf-themes\";\n\nimport type {\n ChartLayout,\n GraphDataPoint,\n GraphSeries,\n GraphWidthOptions,\n} from \"./graph.types\";\n\n/** Standard A4 page width in PDF points. */\nexport const A4_WIDTH = 595;\n\n/**\n * Pre-calculated safe graph widths for common scenarios.\n * These values work with all built-in themes on A4 pages.\n */\nexport const GRAPH_SAFE_WIDTHS = {\n /** Safe width for graph directly in page content (no extra containers) */\n default: 420,\n /** Safe width for graph inside a Section with md padding */\n inSection: 400,\n /** Safe width for graph inside a Section + bordered wrapper (like graphShell) */\n inSectionWithWrapper: 380,\n} as const;\n\n/**\n * Calculate the safe graph width based on theme page margins and container context.\n *\n * This utility ensures graphs don't overflow their container by accounting for:\n * - Page margins (from theme)\n * - Container padding (e.g., Section component)\n * - Wrapper padding (e.g., a bordered graphShell View)\n *\n * @example\n * ```tsx\n * const width = getGraphWidth(theme);\n * // For a graph inside a Section with padding=\"md\" (12pt) and a graphShell (12pt):\n * const width = getGraphWidth(theme, { containerPadding: 12, wrapperPadding: 12 });\n * ```\n */\nexport const getGraphWidth = (\n theme: PdfcnTheme,\n options: GraphWidthOptions = {}\n): number => {\n const {\n containerPadding = 0,\n wrapperPadding = 0,\n pageWidth = A4_WIDTH,\n } = options;\n const { marginLeft, marginRight } = theme.spacing.page;\n const availableWidth =\n pageWidth -\n marginLeft -\n marginRight -\n containerPadding * 2 -\n wrapperPadding * 2;\n return Math.max(Math.floor(availableWidth), 100);\n};\n\nexport const CHART_MARGINS = {\n axisBottom: 24,\n axisLeft: 40,\n pieBottom: 10,\n pieLeft: 10,\n right: 10,\n top: 10,\n} as const;\n\n/** Normalize to always work with GraphSeries[]. */\nexport const normalizeData = (\n data: GraphDataPoint[] | GraphSeries[]\n): GraphSeries[] => {\n if (data.length === 0) {\n return [];\n }\n if (\"label\" in data[0] && \"value\" in data[0]) {\n return [{ data: data as GraphDataPoint[], name: \"Series 1\" }];\n }\n return data as GraphSeries[];\n};\n\n/** Compute nice Y-axis ticks for a given value range. */\nexport const computeYTicks = (\n min: number,\n max: number,\n count: number\n): number[] => {\n if (min === max) {\n return [0, max || 1];\n }\n const step = (max - min) / (count - 1);\n return Array.from({ length: count }, (_, i) => {\n const v = min + i * step;\n return Math.round(v * 100) / 100;\n });\n};\n\n/** Format a number for display on axis labels. */\nexport const fmtNum = (v: number): string => {\n if (Math.abs(v) >= 1_000_000) {\n return `${(v / 1_000_000).toFixed(1)}M`;\n }\n if (Math.abs(v) >= 1000) {\n return `${(v / 1000).toFixed(1)}K`;\n }\n if (!Number.isInteger(v)) {\n return v.toFixed(1);\n }\n return String(v);\n};\n\n/** Truncate a label to at most maxLen characters. */\nexport const truncate = (s: string, maxLen: number): string =>\n s.length > maxLen ? `${s.slice(0, maxLen - 1)}…` : s;\n\n/** Polar to Cartesian coordinate conversion for pie/donut arcs. */\nexport const polarToCartesian = (\n cx: number,\n cy: number,\n r: number,\n angleDeg: number\n) => {\n const rad = ((angleDeg - 90) * Math.PI) / 180;\n return { x: cx + r * Math.cos(rad), y: cy + r * Math.sin(rad) };\n};\n\n/** Build an SVG arc path for a pie/donut slice. */\nexport const arcPath = (\n cx: number,\n cy: number,\n r: number,\n startAngle: number,\n endAngle: number,\n innerR = 0\n): string => {\n const safeEnd = Math.min(endAngle, startAngle + 359.999);\n const large = safeEnd - startAngle > 180 ? 1 : 0;\n const s = polarToCartesian(cx, cy, r, safeEnd);\n const e = polarToCartesian(cx, cy, r, startAngle);\n if (innerR === 0) {\n return `M ${cx} ${cy} L ${s.x} ${s.y} A ${r} ${r} 0 ${large} 0 ${e.x} ${e.y} Z`;\n }\n const si = polarToCartesian(cx, cy, innerR, safeEnd);\n const ei = polarToCartesian(cx, cy, innerR, startAngle);\n return [\n `M ${s.x} ${s.y}`,\n `A ${r} ${r} 0 ${large} 0 ${e.x} ${e.y}`,\n `L ${ei.x} ${ei.y}`,\n `A ${innerR} ${innerR} 0 ${large} 1 ${si.x} ${si.y}`,\n \"Z\",\n ].join(\" \");\n};\n\n/** Compute smooth bezier control points (Catmull-Rom → cubic bezier). */\nexport const smoothPath = (\n points: { x: number; y: number }[],\n tension = 0.4\n): string => {\n if (points.length < 2) {\n return \"\";\n }\n if (points.length === 2) {\n return `M ${points[0].x} ${points[0].y} L ${points[1].x} ${points[1].y}`;\n }\n const parts: string[] = [`M ${points[0].x} ${points[0].y}`];\n for (let i = 0; i < points.length - 1; i += 1) {\n const p0 = points[Math.max(i - 1, 0)];\n const p1 = points[i];\n const p2 = points[i + 1];\n const p3 = points[Math.min(i + 2, points.length - 1)];\n const cp1x = p1.x + (p2.x - p0.x) * tension;\n const cp1y = p1.y + (p2.y - p0.y) * tension;\n const cp2x = p2.x - (p3.x - p1.x) * tension;\n const cp2y = p2.y - (p3.y - p1.y) * tension;\n parts.push(`C ${cp1x} ${cp1y} ${cp2x} ${cp2y} ${p2.x} ${p2.y}`);\n }\n return parts.join(\" \");\n};\n\n/** Get the default chart color palette from the theme. */\nexport const getDefaultPalette = (t: PdfcnTheme): string[] => [\n t.colors.primary,\n t.colors.info ?? \"#3B82F6\",\n t.colors.success ?? \"#22C55E\",\n t.colors.warning ?? \"#F59E0B\",\n t.colors.destructive ?? \"#EF4444\",\n \"#8B5CF6\",\n \"#F97316\",\n \"#14B8A6\",\n];\n\n/** Derive ChartLayout from series data, SVG dimensions, and variant. */\nexport const buildLayout = (\n series: GraphSeries[],\n width: number,\n height: number,\n isPieOrDonut: boolean,\n yTickCount: number\n): ChartLayout => {\n const mL = isPieOrDonut ? CHART_MARGINS.pieLeft : CHART_MARGINS.axisLeft;\n const mB = isPieOrDonut ? CHART_MARGINS.pieBottom : CHART_MARGINS.axisBottom;\n const chartX = mL;\n const chartY = CHART_MARGINS.top;\n const chartW = width - mL - CHART_MARGINS.right;\n const chartH = height - CHART_MARGINS.top - mB;\n const allValues = series.flatMap((s) => s.data.map((d) => d.value));\n const rawMin = Math.min(...allValues, 0);\n const rawMax = Math.max(...allValues, 1);\n const yMin = Math.min(0, rawMin);\n const yMax = rawMax + (rawMax - yMin) * 0.08;\n return {\n chartH,\n chartW,\n chartX,\n chartY,\n svgH: height,\n svgW: width,\n xLabels: series[0]?.data.map((d) => d.label) ?? [],\n yMax,\n yMin,\n yTicks: computeYTicks(yMin, yMax, yTickCount),\n };\n};\n","type": "registry:component","target": "components/pdf/graph/graph.utils.ts"- },- {- "path": "registry/bases/forme/components/graph/index.ts",- "content": "export { PdfGraph } from \"./graph\";\nexport { A4_WIDTH, GRAPH_SAFE_WIDTHS, getGraphWidth } from \"./graph.utils\";\nexport type {\n GraphDataPoint,\n GraphLegendPosition,\n GraphProps,\n GraphSeries,\n GraphVariant,\n GraphWidthOptions,\n} from \"./graph.types\";\n",- "type": "registry:component",- "target": "components/pdf/graph/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/heading.json b/public/r/forme/heading.jsonindex 57d6d10..a6d968f 100644--- a/public/r/forme/heading.json+++ b/public/r/forme/heading.json@@ -8,20 +8,14 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils"],"files": [{"path": "registry/bases/forme/components/heading/heading.tsx",- "content": "import {\n mergePdfStyles,\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport { StyleSheet, Text } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import {\n mergePdfStyles,\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/components/theme-provider\";\nimport { StyleSheet, Text } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/heading/heading.tsx"- },- {- "path": "registry/bases/forme/components/heading/index.ts",- "content": "export {\n Heading,\n type HeadingProps,\n type HeadingWeight,\n type HeadingTracking,\n} from \"./heading\";\n",- "type": "registry:component",- "target": "components/pdf/heading/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/invoice-classic.json b/public/r/forme/invoice-classic.jsonindex 49bf1c7..a50b4d7 100644--- a/public/r/forme/invoice-classic.json+++ b/public/r/forme/invoice-classic.json@@ -8,12 +8,19 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/pdf-image",+ "@pdfcn/forme/section",+ "@pdfcn/forme/table",+ "@pdfcn/forme/text"],"files": [{"path": "registry/bases/forme/blocks/invoice-classic/invoice-classic.tsx",- "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 \"@/types/pdf-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",+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport { KeyValue } from \"@/registry/bases/forme/components/key-value/key-value\";\nimport { PageFooter } from \"@/registry/bases/forme/components/page-footer/page-footer\";\nimport { PageHeader } from \"@/registry/bases/forme/components/page-header/page-header\";\nimport { PdfImage } from \"@/registry/bases/forme/components/pdf-image/pdf-image\";\nimport { Section } from \"@/registry/bases/forme/components/section/section\";\nimport {\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n} from \"@/registry/bases/forme/components/table/table\";\nimport { Text } from \"@/registry/bases/forme/components/text/text\";\nimport { PdfcnThemeProvider, usePdfcnTheme } from \"@/registry/bases/forme/components/theme-provider\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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 8150a27..bb597e4 100644--- a/public/r/forme/invoice-consultant.json+++ b/public/r/forme/invoice-consultant.json@@ -8,12 +8,17 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/section",+ "@pdfcn/forme/table",+ "@pdfcn/forme/text"],"files": [{"path": "registry/bases/forme/blocks/invoice-consultant/invoice-consultant.tsx",- "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 \"@/types/pdf-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",+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport { KeyValue } from \"@/registry/bases/forme/components/key-value/key-value\";\nimport { PageFooter } from \"@/registry/bases/forme/components/page-footer/page-footer\";\nimport { Section } from \"@/registry/bases/forme/components/section/section\";\nimport {\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n} from \"@/registry/bases/forme/components/table/table\";\nimport { Text } from \"@/registry/bases/forme/components/text/text\";\nimport { PdfcnThemeProvider, usePdfcnTheme } from \"@/registry/bases/forme/components/theme-provider\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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 30ac259..3f17667 100644--- a/public/r/forme/invoice-corporate.json+++ b/public/r/forme/invoice-corporate.json@@ -8,12 +8,18 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/pdf-image",+ "@pdfcn/forme/table",+ "@pdfcn/forme/text"],"files": [{"path": "registry/bases/forme/blocks/invoice-corporate/invoice-corporate.tsx",- "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 \"@/types/pdf-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",+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport { KeyValue } from \"@/registry/bases/forme/components/key-value/key-value\";\nimport { PageFooter } from \"@/registry/bases/forme/components/page-footer/page-footer\";\nimport { PageHeader } from \"@/registry/bases/forme/components/page-header/page-header\";\nimport { PdfImage } from \"@/registry/bases/forme/components/pdf-image/pdf-image\";\nimport {\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n} from \"@/registry/bases/forme/components/table/table\";\nimport { Text } from \"@/registry/bases/forme/components/text/text\";\nimport { PdfcnThemeProvider, usePdfcnTheme } from \"@/registry/bases/forme/components/theme-provider\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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 7d330af..94ee93f 100644--- a/public/r/forme/invoice-creative.json+++ b/public/r/forme/invoice-creative.json@@ -8,12 +8,18 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/section",+ "@pdfcn/forme/table",+ "@pdfcn/forme/text"],"files": [{"path": "registry/bases/forme/blocks/invoice-creative/invoice-creative.tsx",- "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 \"@/types/pdf-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",+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport { KeyValue } from \"@/registry/bases/forme/components/key-value/key-value\";\nimport { PageFooter } from \"@/registry/bases/forme/components/page-footer/page-footer\";\nimport { PageHeader } from \"@/registry/bases/forme/components/page-header/page-header\";\nimport { Section } from \"@/registry/bases/forme/components/section/section\";\nimport {\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n} from \"@/registry/bases/forme/components/table/table\";\nimport { Text } from \"@/registry/bases/forme/components/text/text\";\nimport { PdfcnThemeProvider, usePdfcnTheme } from \"@/registry/bases/forme/components/theme-provider\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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 ad512e9..4928471 100644--- a/public/r/forme/invoice-minimal.json+++ b/public/r/forme/invoice-minimal.json@@ -8,12 +8,18 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/section",+ "@pdfcn/forme/table",+ "@pdfcn/forme/text"],"files": [{"path": "registry/bases/forme/blocks/invoice-minimal/invoice-minimal.tsx",- "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 \"@/types/pdf-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",+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport { KeyValue } from \"@/registry/bases/forme/components/key-value/key-value\";\nimport { PageFooter } from \"@/registry/bases/forme/components/page-footer/page-footer\";\nimport { PageHeader } from \"@/registry/bases/forme/components/page-header/page-header\";\nimport { Section } from \"@/registry/bases/forme/components/section/section\";\nimport {\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n} from \"@/registry/bases/forme/components/table/table\";\nimport { Text } from \"@/registry/bases/forme/components/text/text\";\nimport { PdfcnThemeProvider, usePdfcnTheme } from \"@/registry/bases/forme/components/theme-provider\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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 adc002d..a3c4b9f 100644--- a/public/r/forme/invoice-modern.json+++ b/public/r/forme/invoice-modern.json@@ -8,12 +8,18 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/section",+ "@pdfcn/forme/table",+ "@pdfcn/forme/text"],"files": [{"path": "registry/bases/forme/blocks/invoice-modern/invoice-modern.tsx",- "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 \"@/types/pdf-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",+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport { KeyValue } from \"@/registry/bases/forme/components/key-value/key-value\";\nimport { PageFooter } from \"@/registry/bases/forme/components/page-footer/page-footer\";\nimport { PageHeader } from \"@/registry/bases/forme/components/page-header/page-header\";\nimport { Section } from \"@/registry/bases/forme/components/section/section\";\nimport {\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n} from \"@/registry/bases/forme/components/table/table\";\nimport { Text } from \"@/registry/bases/forme/components/text/text\";\nimport { PdfcnThemeProvider, usePdfcnTheme } from \"@/registry/bases/forme/components/theme-provider\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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 86d05f3..2acdd87 100644--- a/public/r/forme/keep-together.json+++ b/public/r/forme/keep-together.json@@ -8,20 +8,14 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils"],"files": [{"path": "registry/bases/forme/components/keep-together/keep-together.tsx",- "content": "import type { ReactNode } from \"react\";\n\nimport { View } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/types/pdf-components\";\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/pdf-primitives\";\nimport type { Style } from \"@/registry/types/pdf-components\";\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/keep-together/keep-together.tsx"- },- {- "path": "registry/bases/forme/components/keep-together/index.ts",- "content": "export { KeepTogether, type KeepTogetherProps } from \"./keep-together\";\n",- "type": "registry:component",- "target": "components/pdf/keep-together/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/key-value.json b/public/r/forme/key-value.jsonindex 6d2aeed..ab6df1f 100644--- a/public/r/forme/key-value.json+++ b/public/r/forme/key-value.json@@ -8,20 +8,14 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils"],"files": [{"path": "registry/bases/forme/components/key-value/key-value.tsx",- "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/components/theme-provider\";\nimport {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/key-value/key-value.tsx"- },- {- "path": "registry/bases/forme/components/key-value/index.ts",- "content": "export {\n KeyValue,\n type KeyValueProps,\n type KeyValueEntry,\n type KeyValueDirection,\n type KeyValueSize,\n} from \"./key-value\";\n",- "type": "registry:component",- "target": "components/pdf/key-value/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/link.json b/public/r/forme/link.jsonindex 8d3c419..9be878f 100644--- a/public/r/forme/link.json+++ b/public/r/forme/link.json@@ -8,20 +8,14 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils"],"files": [{"path": "registry/bases/forme/components/link/link.tsx",- "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n Link as PDFLink,\n StyleSheet,\n Text as PDFText,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/components/theme-provider\";\nimport {\n Link as PDFLink,\n StyleSheet,\n Text as PDFText,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/link/link.tsx"- },- {- "path": "registry/bases/forme/components/link/index.ts",- "content": "export {\n Link,\n type LinkProps,\n type LinkVariant,\n type LinkUnderline,\n} from \"./link\";\n",- "type": "registry:component",- "target": "components/pdf/link/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/list.json b/public/r/forme/list.jsonindex fd8fe66..7fcd19c 100644--- a/public/r/forme/list.json+++ b/public/r/forme/list.json@@ -8,18 +8,18 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils"],"files": [{"path": "registry/bases/forme/components/list/list.styles.ts",- "content": "import { StyleSheet } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/types/pdf-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 checklistTextWrap: {\n flex: 1,\n marginLeft: spacing[2],\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 \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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 checklistTextWrap: {\n flex: 1,\n marginLeft: spacing[2],\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/list/list.styles.ts"},{"path": "registry/bases/forme/components/list/list.tsx",- "content": "import type React from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n Text as PDFText,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-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\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 usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/components/theme-provider\";\nimport {\n Text as PDFText,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-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\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/list/list.tsx"},@@ -28,12 +28,6 @@"content": "import type { Style } from \"@formepdf/react\";\n\n/** List visual style variant. */\nexport type ListVariant =\n | \"bullet\"\n | \"numbered\"\n | \"checklist\"\n | \"icon\"\n | \"multi-level\"\n | \"descriptive\";\n\n/**\n * A single list item, optionally with nested children.\n * Props - `text` | `description` | `checked` | `children`\n * @see {@link ListItem}\n */\nexport interface ListItem {\n text: string;\n description?: string;\n checked?: boolean;\n children?: ListItem[];\n}\n\n/**\n * List of items with multiple style variants including bullet, numbered, checklist, and descriptive.\n * Props - `items` | `variant` | `gap` | `style` | `_level` | `noWrap`\n * @see {@link PdfListProps}\n */\nexport interface PdfListProps {\n items: ListItem[];\n /**\n * @default 'bullet'\n */\n variant?: ListVariant;\n /**\n * @default 'sm'\n */\n gap?: \"xs\" | \"sm\" | \"md\";\n style?: Style;\n _level?: number;\n /**\n * @default false\n */\n noWrap?: boolean;\n}\n","type": "registry:component","target": "components/pdf/list/list.types.ts"- },- {- "path": "registry/bases/forme/components/list/index.ts",- "content": "export { PdfList } from \"./list\";\nexport type { PdfListProps, ListVariant, ListItem } from \"./list.types\";\n",- "type": "registry:component",- "target": "components/pdf/list/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/page-break.json b/public/r/forme/page-break.jsonindex c0df82c..8324dd9 100644--- a/public/r/forme/page-break.json+++ b/public/r/forme/page-break.json@@ -8,20 +8,14 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils"],"files": [{"path": "registry/bases/forme/components/page-break/page-break.tsx",- "content": "import { PageBreak as FormePageBreak } from \"@formepdf/react\";\n\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\n\nexport interface PageBreakProps extends Omit<PDFComponentProps, \"children\"> {\n children?: never;\n}\n\nexport const PageBreak = (_props: PageBreakProps) => <FormePageBreak />;\n",+ "content": "import { PageBreak as FormePageBreak } from \"@formepdf/react\";\n\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\n\nexport interface PageBreakProps extends Omit<PDFComponentProps, \"children\"> {\n children?: never;\n}\n\nexport const PageBreak = (_props: PageBreakProps) => <FormePageBreak />;\n","type": "registry:component","target": "components/pdf/page-break/page-break.tsx"- },- {- "path": "registry/bases/forme/components/page-break/index.ts",- "content": "export { PageBreak } from \"./page-break\";\nexport type { PageBreakProps } from \"./page-break\";\n",- "type": "registry:component",- "target": "components/pdf/page-break/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/page-footer.json b/public/r/forme/page-footer.jsonindex 220f454..87c8fa7 100644--- a/public/r/forme/page-footer.json+++ b/public/r/forme/page-footer.json@@ -8,20 +8,14 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils"],"files": [{"path": "registry/bases/forme/components/page-footer/page-footer.tsx",- "content": "import type React from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n Fixed,\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import type React from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/components/theme-provider\";\nimport {\n Fixed,\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/page-footer/page-footer.tsx"- },- {- "path": "registry/bases/forme/components/page-footer/index.ts",- "content": "export {\n PageFooter,\n type PageFooterProps,\n type PageFooterVariant,\n} from \"./page-footer\";\n",- "type": "registry:component",- "target": "components/pdf/page-footer/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/page-header.json b/public/r/forme/page-header.jsonindex 8682935..a8b5c44 100644--- a/public/r/forme/page-header.json+++ b/public/r/forme/page-header.json@@ -8,20 +8,14 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils"],"files": [{"path": "registry/bases/forme/components/page-header/page-header.tsx",- "content": "import type React from \"react\";\nimport type { ReactNode } from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n Fixed,\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import type React from \"react\";\nimport type { ReactNode } from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/components/theme-provider\";\nimport {\n Fixed,\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/page-header/page-header.tsx"- },- {- "path": "registry/bases/forme/components/page-header/index.ts",- "content": "export {\n PageHeader,\n type PageHeaderProps,\n type PageHeaderVariant,\n} from \"./page-header\";\n",- "type": "registry:component",- "target": "components/pdf/page-header/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/page-number.json b/public/r/forme/page-number.jsonindex 6962bb9..4b76f8b 100644--- a/public/r/forme/page-number.json+++ b/public/r/forme/page-number.json@@ -8,20 +8,14 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils"],"files": [{"path": "registry/bases/forme/components/page-number/page-number.tsx",- "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/components/theme-provider\";\nimport {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/page-number/page-number.tsx"- },- {- "path": "registry/bases/forme/components/page-number/index.ts",- "content": "export {\n PdfPageNumber,\n type PdfPageNumberProps,\n type PageNumberAlign,\n type PageNumberSize,\n} from \"./page-number\";\n",- "type": "registry:component",- "target": "components/pdf/page-number/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/pdf-image.json b/public/r/forme/pdf-image.jsonindex f96322e..4d11e87 100644--- a/public/r/forme/pdf-image.json+++ b/public/r/forme/pdf-image.json@@ -8,20 +8,14 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils"],"files": [{"path": "registry/bases/forme/components/pdf-image/pdf-image.tsx",- "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n Image,\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/components/theme-provider\";\nimport {\n Image,\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/pdf-image/pdf-image.tsx"- },- {- "path": "registry/bases/forme/components/pdf-image/index.ts",- "content": "export {\n PdfImage,\n type PdfImageProps,\n type PdfImageSrc,\n type PdfImageVariant,\n type PdfImageFit,\n} from \"./pdf-image\";\n",- "type": "registry:component",- "target": "components/pdf/pdf-image/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/qrcode.json b/public/r/forme/qrcode.jsonindex 8826d04..49e1773 100644--- a/public/r/forme/qrcode.json+++ b/public/r/forme/qrcode.json@@ -9,20 +9,14 @@"qrcode"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils"],"files": [{"path": "registry/bases/forme/components/qrcode/qrcode.tsx",- "content": "import QRCode from \"qrcode\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport { Rect, Svg } from \"@/registry/bases/forme/lib/pdf-svg\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import QRCode from \"qrcode\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/components/theme-provider\";\nimport {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport { Rect, Svg } from \"@/registry/bases/forme/lib/pdf-svg\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/qrcode/qrcode.tsx"- },- {- "path": "registry/bases/forme/components/qrcode/index.ts",- "content": "export {\n PdfQRCode,\n type PdfQRCodeProps,\n type QRCodeErrorLevel,\n} from \"./qrcode\";\n",- "type": "registry:component",- "target": "components/pdf/qrcode/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/report-financial.json b/public/r/forme/report-financial.jsonindex b120b5d..7ce1c1f 100644--- a/public/r/forme/report-financial.json+++ b/public/r/forme/report-financial.json@@ -8,7 +8,16 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils",+ "@pdfcn/forme/badge",+ "@pdfcn/forme/data-table",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/graph",+ "@pdfcn/forme/list",+ "@pdfcn/forme/section",+ "@pdfcn/forme/text"],"files": [{@@ -19,7 +28,7 @@},{"path": "registry/bases/forme/blocks/report-financial/report-layout.tsx",- "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 \"@/types/pdf-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",+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport { Badge } from \"@/registry/bases/forme/components/badge/badge\";\nimport { DataTable } from \"@/registry/bases/forme/components/data-table/data-table\";\nimport { PdfGraph } from \"@/registry/bases/forme/components/graph/graph\";\nimport { KeyValue } from \"@/registry/bases/forme/components/key-value/key-value\";\nimport { PdfList } from \"@/registry/bases/forme/components/list/list\";\nimport { PageFooter } from \"@/registry/bases/forme/components/page-footer/page-footer\";\nimport { PageHeader } from \"@/registry/bases/forme/components/page-header/page-header\";\nimport { Section } from \"@/registry/bases/forme/components/section/section\";\nimport { Text } from \"@/registry/bases/forme/components/text/text\";\nimport { PdfcnThemeProvider, usePdfcnTheme } from \"@/registry/bases/forme/components/theme-provider\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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 f32630c..a254652 100644--- a/public/r/forme/report-marketing.json+++ b/public/r/forme/report-marketing.json@@ -8,12 +8,21 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils",+ "@pdfcn/forme/badge",+ "@pdfcn/forme/data-table",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/graph",+ "@pdfcn/forme/list",+ "@pdfcn/forme/section",+ "@pdfcn/forme/text"],"files": [{"path": "registry/bases/forme/blocks/report-marketing/report-layout.tsx",- "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 \"@/types/pdf-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",+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport { Badge } from \"@/registry/bases/forme/components/badge/badge\";\nimport { DataTable } from \"@/registry/bases/forme/components/data-table/data-table\";\nimport { PdfGraph } from \"@/registry/bases/forme/components/graph/graph\";\nimport { KeyValue } from \"@/registry/bases/forme/components/key-value/key-value\";\nimport { PdfList } from \"@/registry/bases/forme/components/list/list\";\nimport { PageFooter } from \"@/registry/bases/forme/components/page-footer/page-footer\";\nimport { PageHeader } from \"@/registry/bases/forme/components/page-header/page-header\";\nimport { Section } from \"@/registry/bases/forme/components/section/section\";\nimport { Text } from \"@/registry/bases/forme/components/text/text\";\nimport { PdfcnThemeProvider, usePdfcnTheme } from \"@/registry/bases/forme/components/theme-provider\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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 8df2d0a..c41e5a1 100644--- a/public/r/forme/report-operations.json+++ b/public/r/forme/report-operations.json@@ -8,12 +8,21 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils",+ "@pdfcn/forme/badge",+ "@pdfcn/forme/data-table",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/graph",+ "@pdfcn/forme/list",+ "@pdfcn/forme/section",+ "@pdfcn/forme/text"],"files": [{"path": "registry/bases/forme/blocks/report-operations/report-layout.tsx",- "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 \"@/types/pdf-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",+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport { Badge } from \"@/registry/bases/forme/components/badge/badge\";\nimport { DataTable } from \"@/registry/bases/forme/components/data-table/data-table\";\nimport { PdfGraph } from \"@/registry/bases/forme/components/graph/graph\";\nimport { KeyValue } from \"@/registry/bases/forme/components/key-value/key-value\";\nimport { PdfList } from \"@/registry/bases/forme/components/list/list\";\nimport { PageFooter } from \"@/registry/bases/forme/components/page-footer/page-footer\";\nimport { PageHeader } from \"@/registry/bases/forme/components/page-header/page-header\";\nimport { Section } from \"@/registry/bases/forme/components/section/section\";\nimport { Text } from \"@/registry/bases/forme/components/text/text\";\nimport { PdfcnThemeProvider, usePdfcnTheme } from \"@/registry/bases/forme/components/theme-provider\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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 25abede..17d3bb5 100644--- a/public/r/forme/report-security.json+++ b/public/r/forme/report-security.json@@ -8,12 +8,21 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils",+ "@pdfcn/forme/badge",+ "@pdfcn/forme/data-table",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/graph",+ "@pdfcn/forme/list",+ "@pdfcn/forme/section",+ "@pdfcn/forme/text"],"files": [{"path": "registry/bases/forme/blocks/report-security/report-layout.tsx",- "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 \"@/types/pdf-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",+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport { Badge } from \"@/registry/bases/forme/components/badge/badge\";\nimport { DataTable } from \"@/registry/bases/forme/components/data-table/data-table\";\nimport { PdfGraph } from \"@/registry/bases/forme/components/graph/graph\";\nimport { KeyValue } from \"@/registry/bases/forme/components/key-value/key-value\";\nimport { PdfList } from \"@/registry/bases/forme/components/list/list\";\nimport { PageFooter } from \"@/registry/bases/forme/components/page-footer/page-footer\";\nimport { PageHeader } from \"@/registry/bases/forme/components/page-header/page-header\";\nimport { Section } from \"@/registry/bases/forme/components/section/section\";\nimport { Text } from \"@/registry/bases/forme/components/text/text\";\nimport { PdfcnThemeProvider, usePdfcnTheme } from \"@/registry/bases/forme/components/theme-provider\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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 1dc3cf2..c37d6c1 100644--- a/public/r/forme/section.json+++ b/public/r/forme/section.json@@ -8,20 +8,14 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils"],"files": [{"path": "registry/bases/forme/components/section/section.tsx",- "content": "import {\n mergePdfStyles,\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport { StyleSheet, View } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import {\n mergePdfStyles,\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/components/theme-provider\";\nimport { StyleSheet, View } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/section/section.tsx"- },- {- "path": "registry/bases/forme/components/section/index.ts",- "content": "export {\n Section,\n type SectionProps,\n type SectionSpacing,\n type SectionPadding,\n type SectionVariant,\n} from \"./section\";\n",- "type": "registry:component",- "target": "components/pdf/section/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/signature.json b/public/r/forme/signature.jsonindex 1a6d37b..cf334c0 100644--- a/public/r/forme/signature.json+++ b/public/r/forme/signature.json@@ -8,20 +8,14 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils"],"files": [{"path": "registry/bases/forme/components/signature/signature.tsx",- "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/components/theme-provider\";\nimport {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/signature/signature.tsx"- },- {- "path": "registry/bases/forme/components/signature/index.ts",- "content": "export {\n PdfSignatureBlock,\n type PdfSignatureBlockProps,\n type SignatureVariant,\n type SignatureSigner,\n} from \"./signature\";\n",- "type": "registry:component",- "target": "components/pdf/signature/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/stack.json b/public/r/forme/stack.jsonindex cc04cec..f047409 100644--- a/public/r/forme/stack.json+++ b/public/r/forme/stack.json@@ -8,20 +8,14 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils"],"files": [{"path": "registry/bases/forme/components/stack/stack.tsx",- "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport { StyleSheet, View } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/components/theme-provider\";\nimport { StyleSheet, View } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/stack/stack.tsx"- },- {- "path": "registry/bases/forme/components/stack/index.ts",- "content": "export {\n Stack,\n type StackProps,\n type StackGap,\n type StackDirection,\n type StackAlign,\n type StackJustify,\n} from \"./stack\";\n",- "type": "registry:component",- "target": "components/pdf/stack/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/table.json b/public/r/forme/table.jsonindex ad4b86b..2bb3a2b 100644--- a/public/r/forme/table.json+++ b/public/r/forme/table.json@@ -8,32 +8,26 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils"],"files": [{"path": "registry/bases/forme/components/table/table.styles.ts",- "content": "import { StyleSheet } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import { StyleSheet } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/table/table.styles.ts"},{"path": "registry/bases/forme/components/table/table.tsx",- "content": "import { Children, cloneElement, isValidElement } from \"react\";\nimport type { ReactElement, ReactNode } from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n Text as PDFText,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-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 [\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 usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/components/theme-provider\";\nimport {\n Text as PDFText,\n View,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-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 [\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/table/table.tsx"},{"path": "registry/bases/forme/components/table/table.types.ts",- "content": "import type { PDFComponentProps } from \"@/types/pdf-components\";\n\n/** Table visual style variant. */\nexport type TableVariant =\n | \"line\"\n | \"grid\"\n | \"minimal\"\n | \"striped\"\n | \"compact\"\n | \"bordered\"\n | \"primary-header\";\n\n/**\n * Table container with visual style variants and optional zebra striping.\n * Props - `variant` | `zebraStripe` | `noWrap` | `children` | `style`\n * @see {@link TableProps}\n */\nexport interface TableProps extends PDFComponentProps {\n /**\n * @default 'line'\n */\n variant?: TableVariant;\n /**\n * @default false\n */\n zebraStripe?: boolean;\n /**\n * @default false\n */\n noWrap?: boolean;\n}\n\nexport type TableSectionProps = PDFComponentProps;\n\n/**\n * Table row with optional header, footer, and stripe states.\n * Props - `header` | `footer` | `stripe` | `variant` | `children` | `style`\n * @see {@link TableRowProps}\n */\nexport interface TableRowProps extends PDFComponentProps {\n header?: boolean;\n footer?: boolean;\n stripe?: boolean;\n variant?: TableVariant;\n}\n\n/**\n * Table cell with alignment, width, and header or footer text styling.\n * Props - `header` | `footer` | `align` | `width` | `variant` | `_last` | `children` | `style`\n * @see {@link TableCellProps}\n */\nexport interface TableCellProps extends PDFComponentProps {\n header?: boolean;\n footer?: boolean;\n align?: \"left\" | \"center\" | \"right\";\n width?: string | number;\n variant?: TableVariant;\n _last?: boolean;\n}\n",+ "content": "import type { PDFComponentProps } from \"@/registry/types/pdf-components\";\n\n/** Table visual style variant. */\nexport type TableVariant =\n | \"line\"\n | \"grid\"\n | \"minimal\"\n | \"striped\"\n | \"compact\"\n | \"bordered\"\n | \"primary-header\";\n\n/**\n * Table container with visual style variants and optional zebra striping.\n * Props - `variant` | `zebraStripe` | `noWrap` | `children` | `style`\n * @see {@link TableProps}\n */\nexport interface TableProps extends PDFComponentProps {\n /**\n * @default 'line'\n */\n variant?: TableVariant;\n /**\n * @default false\n */\n zebraStripe?: boolean;\n /**\n * @default false\n */\n noWrap?: boolean;\n}\n\nexport type TableSectionProps = PDFComponentProps;\n\n/**\n * Table row with optional header, footer, and stripe states.\n * Props - `header` | `footer` | `stripe` | `variant` | `children` | `style`\n * @see {@link TableRowProps}\n */\nexport interface TableRowProps extends PDFComponentProps {\n header?: boolean;\n footer?: boolean;\n stripe?: boolean;\n variant?: TableVariant;\n}\n\n/**\n * Table cell with alignment, width, and header or footer text styling.\n * Props - `header` | `footer` | `align` | `width` | `variant` | `_last` | `children` | `style`\n * @see {@link TableCellProps}\n */\nexport interface TableCellProps extends PDFComponentProps {\n header?: boolean;\n footer?: boolean;\n align?: \"left\" | \"center\" | \"right\";\n width?: string | number;\n variant?: TableVariant;\n _last?: boolean;\n}\n","type": "registry:component","target": "components/pdf/table/table.types.ts"- },- {- "path": "registry/bases/forme/components/table/index.ts",- "content": "export {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableRow,\n TableCell,\n} from \"./table\";\nexport type {\n TableProps,\n TableSectionProps,\n TableRowProps,\n TableCellProps,\n TableVariant,\n} from \"./table.types\";\n",- "type": "registry:component",- "target": "components/pdf/table/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/text.json b/public/r/forme/text.jsonindex 5cd2841..f19178e 100644--- a/public/r/forme/text.json+++ b/public/r/forme/text.json@@ -8,20 +8,14 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils"],"files": [{"path": "registry/bases/forme/components/text/text.tsx",- "content": "import {\n mergePdfStyles,\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import {\n mergePdfStyles,\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/components/theme-provider\";\nimport {\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/text/text.tsx"- },- {- "path": "registry/bases/forme/components/text/index.ts",- "content": "export {\n Text,\n type TextProps,\n type TextVariant,\n type TextWeight,\n type TextDecoration,\n} from \"./text\";\n",- "type": "registry:component",- "target": "components/pdf/text/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/utils.json b/public/r/forme/utils.jsonindex 9e0011c..b83c1f7 100644--- a/public/r/forme/utils.json+++ b/public/r/forme/utils.json@@ -7,13 +7,10 @@"@formepdf/react","@formepdf/core"],- "registryDependencies": [- "forme/theme-provider"- ],"files": [{"path": "registry/bases/forme/lib/resolve-color.ts",- "content": "import type { ColorTokens } from \"@/types/pdf-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",+ "content": "import type { ColorTokens } from \"@/registry/types/pdf-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": "lib/resolve-color.ts"},@@ -25,7 +22,7 @@},{"path": "registry/bases/forme/components/theme-provider.tsx",- "content": "import type { Style } from \"@formepdf/react\";\nimport { isValidElement } from \"react\";\nimport type { DependencyList, ReactNode } from \"react\";\n\nimport { professionalTheme } from \"@/lib/pdf-themes/professional\";\n\nexport type PdfcnTheme = typeof professionalTheme;\n\nlet serializedTheme = professionalTheme;\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\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\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 ?? professionalTheme);\n\nexport const usePdfcnTheme = (): PdfcnTheme => serializedTheme;\n\nexport const useSafeMemo = <T,>(factory: () => T, _deps: DependencyList): T =>\n factory();\n",+ "content": "import type { Style } from \"@formepdf/react\";\nimport { isValidElement } from \"react\";\nimport type { DependencyList, ReactNode } from \"react\";\n\nimport { professionalTheme } from \"@/registry/themes/professional\";\n\nexport type PdfcnTheme = typeof professionalTheme;\n\nlet serializedTheme = professionalTheme;\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\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\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 ?? professionalTheme);\n\nexport const usePdfcnTheme = (): PdfcnTheme => serializedTheme;\n\nexport const useSafeMemo = <T,>(factory: () => T, _deps: DependencyList): T =>\n factory();\n","type": "registry:lib","target": "components/pdf/theme-provider.tsx"},diff --git a/public/r/forme/watermark.json b/public/r/forme/watermark.jsonindex 4d73aa1..80a122b 100644--- a/public/r/forme/watermark.json+++ b/public/r/forme/watermark.json@@ -8,20 +8,14 @@"@formepdf/core"],"registryDependencies": [- "forme/utils"+ "@pdfcn/forme/utils"],"files": [{"path": "registry/bases/forme/components/watermark/watermark.tsx",- "content": "import { Watermark as FormeWatermark } from \"@formepdf/react\";\n\nimport { usePdfcnTheme } from \"@/components/pdf/theme-provider\";\nimport { mergeFormeStyles } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\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 { usePdfcnTheme } from \"@/registry/bases/forme/components/theme-provider\";\nimport { mergeFormeStyles } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\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/watermark/watermark.tsx"- },- {- "path": "registry/bases/forme/components/watermark/index.ts",- "content": "export {\n PdfWatermark,\n type PdfWatermarkProps,\n type WatermarkPosition,\n} from \"./watermark\";\n",- "type": "registry:component",- "target": "components/pdf/watermark/index.ts"}],"type": "registry:ui"diff --git a/public/r/registry.json b/public/r/registry.jsonindex 7231fef..92226d1 100644--- a/public/r/registry.json+++ b/public/r/registry.json@@ -3,7 +3,10 @@"homepage": "https://pdfcn.vercel.app","items": [{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Theme context and helpers for the takumi base","files": [{@@ -29,71 +32,73 @@],"name": "takumi/utils","title": "Takumi Utils",- "type": "registry:lib",- "registryDependencies": ["takumi/theme-provider"]+ "type": "registry:lib"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Alert PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/alert/alert.tsx","type": "registry:component","target": "components/pdf/alert/alert.tsx"- },- {- "path": "registry/bases/takumi/components/alert/index.ts",- "type": "registry:component",- "target": "components/pdf/alert/index.ts"}],"name": "takumi/alert",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Alert","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Badge PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/badge/badge.tsx","type": "registry:component","target": "components/pdf/badge/badge.tsx"- },- {- "path": "registry/bases/takumi/components/badge/index.ts",- "type": "registry:component",- "target": "components/pdf/badge/index.ts"}],"name": "takumi/badge",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Badge","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Card PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/card/card.tsx","type": "registry:component","target": "components/pdf/card/card.tsx"- },- {- "path": "registry/bases/takumi/components/card/index.ts",- "type": "registry:component",- "target": "components/pdf/card/index.ts"}],"name": "takumi/card",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Card","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Data Table PDF component (takumi)","files": [{@@ -110,40 +115,41 @@"path": "registry/bases/takumi/components/data-table/data-table.types.ts","type": "registry:component","target": "components/pdf/data-table/data-table.types.ts"- },- {- "path": "registry/bases/takumi/components/data-table/index.ts",- "type": "registry:component",- "target": "components/pdf/data-table/index.ts"}],"name": "takumi/data-table",- "registryDependencies": ["takumi/utils", "takumi/table"],+ "registryDependencies": [+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/table"+ ],"title": "Data Table","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Divider PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/divider/divider.tsx","type": "registry:component","target": "components/pdf/divider/divider.tsx"- },- {- "path": "registry/bases/takumi/components/divider/index.ts",- "type": "registry:component",- "target": "components/pdf/divider/index.ts"}],"name": "takumi/divider",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Divider","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Form PDF component (takumi)","files": [{@@ -160,20 +166,20 @@"path": "registry/bases/takumi/components/form/form.types.ts","type": "registry:component","target": "components/pdf/form/form.types.ts"- },- {- "path": "registry/bases/takumi/components/form/index.ts",- "type": "registry:component",- "target": "components/pdf/form/index.ts"}],"name": "takumi/form",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Form","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Graph PDF component (takumi)","files": [{@@ -195,100 +201,100 @@"path": "registry/bases/takumi/components/graph/graph.utils.ts","type": "registry:component","target": "components/pdf/graph/graph.utils.ts"- },- {- "path": "registry/bases/takumi/components/graph/index.ts",- "type": "registry:component",- "target": "components/pdf/graph/index.ts"}],"name": "takumi/graph",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Graph","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Heading PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/heading/heading.tsx","type": "registry:component","target": "components/pdf/heading/heading.tsx"- },- {- "path": "registry/bases/takumi/components/heading/index.ts",- "type": "registry:component",- "target": "components/pdf/heading/index.ts"}],"name": "takumi/heading",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Heading","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Keep Together PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/keep-together/keep-together.tsx","type": "registry:component","target": "components/pdf/keep-together/keep-together.tsx"- },- {- "path": "registry/bases/takumi/components/keep-together/index.ts",- "type": "registry:component",- "target": "components/pdf/keep-together/index.ts"}],"name": "takumi/keep-together",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Keep Together","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Key Value PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/key-value/key-value.tsx","type": "registry:component","target": "components/pdf/key-value/key-value.tsx"- },- {- "path": "registry/bases/takumi/components/key-value/index.ts",- "type": "registry:component",- "target": "components/pdf/key-value/index.ts"}],"name": "takumi/key-value",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Key Value","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Link PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/link/link.tsx","type": "registry:component","target": "components/pdf/link/link.tsx"- },- {- "path": "registry/bases/takumi/components/link/index.ts",- "type": "registry:component",- "target": "components/pdf/link/index.ts"}],"name": "takumi/link",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Link","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "List PDF component (takumi)","files": [{@@ -305,200 +311,201 @@"path": "registry/bases/takumi/components/list/list.types.ts","type": "registry:component","target": "components/pdf/list/list.types.ts"- },- {- "path": "registry/bases/takumi/components/list/index.ts",- "type": "registry:component",- "target": "components/pdf/list/index.ts"}],"name": "takumi/list",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "List","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Page Break PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/page-break/page-break.tsx","type": "registry:component","target": "components/pdf/page-break/page-break.tsx"- },- {- "path": "registry/bases/takumi/components/page-break/index.ts",- "type": "registry:component",- "target": "components/pdf/page-break/index.ts"}],"name": "takumi/page-break",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Page Break","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Page Footer PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/page-footer/page-footer.tsx","type": "registry:component","target": "components/pdf/page-footer/page-footer.tsx"- },- {- "path": "registry/bases/takumi/components/page-footer/index.ts",- "type": "registry:component",- "target": "components/pdf/page-footer/index.ts"}],"name": "takumi/page-footer",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Page Footer","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Page Header PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/page-header/page-header.tsx","type": "registry:component","target": "components/pdf/page-header/page-header.tsx"- },- {- "path": "registry/bases/takumi/components/page-header/index.ts",- "type": "registry:component",- "target": "components/pdf/page-header/index.ts"}],"name": "takumi/page-header",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Page Header","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Page Number PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/page-number/page-number.tsx","type": "registry:component","target": "components/pdf/page-number/page-number.tsx"- },- {- "path": "registry/bases/takumi/components/page-number/index.ts",- "type": "registry:component",- "target": "components/pdf/page-number/index.ts"}],"name": "takumi/page-number",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Page Number","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Pdf Image PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/pdf-image/pdf-image.tsx","type": "registry:component","target": "components/pdf/pdf-image/pdf-image.tsx"- },- {- "path": "registry/bases/takumi/components/pdf-image/index.ts",- "type": "registry:component",- "target": "components/pdf/pdf-image/index.ts"}],"name": "takumi/pdf-image",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Pdf Image","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers", "qrcode"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers",+ "qrcode"+ ],"description": "Qrcode PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/qrcode/qrcode.tsx","type": "registry:component","target": "components/pdf/qrcode/qrcode.tsx"- },- {- "path": "registry/bases/takumi/components/qrcode/index.ts",- "type": "registry:component",- "target": "components/pdf/qrcode/index.ts"}],"name": "takumi/qrcode",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Qrcode","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Section PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/section/section.tsx","type": "registry:component","target": "components/pdf/section/section.tsx"- },- {- "path": "registry/bases/takumi/components/section/index.ts",- "type": "registry:component",- "target": "components/pdf/section/index.ts"}],"name": "takumi/section",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Section","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Signature PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/signature/signature.tsx","type": "registry:component","target": "components/pdf/signature/signature.tsx"- },- {- "path": "registry/bases/takumi/components/signature/index.ts",- "type": "registry:component",- "target": "components/pdf/signature/index.ts"}],"name": "takumi/signature",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Signature","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Stack PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/stack/stack.tsx","type": "registry:component","target": "components/pdf/stack/stack.tsx"- },- {- "path": "registry/bases/takumi/components/stack/index.ts",- "type": "registry:component",- "target": "components/pdf/stack/index.ts"}],"name": "takumi/stack",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Stack","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Table PDF component (takumi)","files": [{@@ -515,60 +522,60 @@"path": "registry/bases/takumi/components/table/table.types.ts","type": "registry:component","target": "components/pdf/table/table.types.ts"- },- {- "path": "registry/bases/takumi/components/table/index.ts",- "type": "registry:component",- "target": "components/pdf/table/index.ts"}],"name": "takumi/table",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Table","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Text PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/text/text.tsx","type": "registry:component","target": "components/pdf/text/text.tsx"- },- {- "path": "registry/bases/takumi/components/text/index.ts",- "type": "registry:component",- "target": "components/pdf/text/index.ts"}],"name": "takumi/text",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Text","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Watermark PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/watermark/watermark.tsx","type": "registry:component","target": "components/pdf/watermark/watermark.tsx"- },- {- "path": "registry/bases/takumi/components/watermark/index.ts",- "type": "registry:component",- "target": "components/pdf/watermark/index.ts"}],"name": "takumi/watermark",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Watermark","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Invoice Classic PDF block (takumi)","files": [{@@ -583,12 +590,24 @@}],"name": "takumi/invoice-classic",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/pdf-image",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/table",+ "@pdfcn/takumi/text"+ ],"title": "Invoice Classic","type": "registry:block"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Invoice Consultant PDF block (takumi)","files": [{@@ -603,12 +622,22 @@}],"name": "takumi/invoice-consultant",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/table",+ "@pdfcn/takumi/text"+ ],"title": "Invoice Consultant","type": "registry:block"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Invoice Corporate PDF block (takumi)","files": [{@@ -623,12 +652,23 @@}],"name": "takumi/invoice-corporate",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/pdf-image",+ "@pdfcn/takumi/table",+ "@pdfcn/takumi/text"+ ],"title": "Invoice Corporate","type": "registry:block"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Invoice Creative PDF block (takumi)","files": [{@@ -643,12 +683,23 @@}],"name": "takumi/invoice-creative",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/table",+ "@pdfcn/takumi/text"+ ],"title": "Invoice Creative","type": "registry:block"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Invoice Minimal PDF block (takumi)","files": [{@@ -663,12 +714,23 @@}],"name": "takumi/invoice-minimal",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/table",+ "@pdfcn/takumi/text"+ ],"title": "Invoice Minimal","type": "registry:block"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Invoice Modern PDF block (takumi)","files": [{@@ -683,12 +745,23 @@}],"name": "takumi/invoice-modern",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/table",+ "@pdfcn/takumi/text"+ ],"title": "Invoice Modern","type": "registry:block"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Report Financial PDF block (takumi)","files": [{@@ -708,12 +781,26 @@}],"name": "takumi/report-financial",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/badge",+ "@pdfcn/takumi/data-table",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/graph",+ "@pdfcn/takumi/list",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/text"+ ],"title": "Report Financial","type": "registry:block"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Report Marketing PDF block (takumi)","files": [{@@ -733,12 +820,26 @@}],"name": "takumi/report-marketing",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/badge",+ "@pdfcn/takumi/data-table",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/graph",+ "@pdfcn/takumi/list",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/text"+ ],"title": "Report Marketing","type": "registry:block"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Report Operations PDF block (takumi)","files": [{@@ -758,12 +859,26 @@}],"name": "takumi/report-operations",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/badge",+ "@pdfcn/takumi/data-table",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/graph",+ "@pdfcn/takumi/list",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/text"+ ],"title": "Report Operations","type": "registry:block"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Report Security PDF block (takumi)","files": [{@@ -783,7 +898,18 @@}],"name": "takumi/report-security",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/badge",+ "@pdfcn/takumi/data-table",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/graph",+ "@pdfcn/takumi/list",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/text"+ ],"title": "Report Security","type": "registry:block"},@@ -1040,7 +1166,10 @@"type": "registry:theme"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Theme context and helpers for the forme base","files": [{@@ -1071,71 +1200,73 @@],"name": "forme/utils","title": "Forme Utils",- "type": "registry:lib",- "registryDependencies": ["forme/theme-provider"]+ "type": "registry:lib"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Alert PDF component (forme)","files": [{"path": "registry/bases/forme/components/alert/alert.tsx","type": "registry:component","target": "components/pdf/alert/alert.tsx"- },- {- "path": "registry/bases/forme/components/alert/index.ts",- "type": "registry:component",- "target": "components/pdf/alert/index.ts"}],"name": "forme/alert",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Alert","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Badge PDF component (forme)","files": [{"path": "registry/bases/forme/components/badge/badge.tsx","type": "registry:component","target": "components/pdf/badge/badge.tsx"- },- {- "path": "registry/bases/forme/components/badge/index.ts",- "type": "registry:component",- "target": "components/pdf/badge/index.ts"}],"name": "forme/badge",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Badge","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Card PDF component (forme)","files": [{"path": "registry/bases/forme/components/card/card.tsx","type": "registry:component","target": "components/pdf/card/card.tsx"- },- {- "path": "registry/bases/forme/components/card/index.ts",- "type": "registry:component",- "target": "components/pdf/card/index.ts"}],"name": "forme/card",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Card","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Data Table PDF component (forme)","files": [{@@ -1152,40 +1283,41 @@"path": "registry/bases/forme/components/data-table/data-table.types.ts","type": "registry:component","target": "components/pdf/data-table/data-table.types.ts"- },- {- "path": "registry/bases/forme/components/data-table/index.ts",- "type": "registry:component",- "target": "components/pdf/data-table/index.ts"}],"name": "forme/data-table",- "registryDependencies": ["forme/utils", "forme/table"],+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/table"+ ],"title": "Data Table","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Divider PDF component (forme)","files": [{"path": "registry/bases/forme/components/divider/divider.tsx","type": "registry:component","target": "components/pdf/divider/divider.tsx"- },- {- "path": "registry/bases/forme/components/divider/index.ts",- "type": "registry:component",- "target": "components/pdf/divider/index.ts"}],"name": "forme/divider",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Divider","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Form PDF component (forme)","files": [{@@ -1202,20 +1334,20 @@"path": "registry/bases/forme/components/form/form.types.ts","type": "registry:component","target": "components/pdf/form/form.types.ts"- },- {- "path": "registry/bases/forme/components/form/index.ts",- "type": "registry:component",- "target": "components/pdf/form/index.ts"}],"name": "forme/form",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Form","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Graph PDF component (forme)","files": [{@@ -1237,100 +1369,100 @@"path": "registry/bases/forme/components/graph/graph.utils.ts","type": "registry:component","target": "components/pdf/graph/graph.utils.ts"- },- {- "path": "registry/bases/forme/components/graph/index.ts",- "type": "registry:component",- "target": "components/pdf/graph/index.ts"}],"name": "forme/graph",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Graph","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Heading PDF component (forme)","files": [{"path": "registry/bases/forme/components/heading/heading.tsx","type": "registry:component","target": "components/pdf/heading/heading.tsx"- },- {- "path": "registry/bases/forme/components/heading/index.ts",- "type": "registry:component",- "target": "components/pdf/heading/index.ts"}],"name": "forme/heading",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Heading","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Keep Together PDF component (forme)","files": [{"path": "registry/bases/forme/components/keep-together/keep-together.tsx","type": "registry:component","target": "components/pdf/keep-together/keep-together.tsx"- },- {- "path": "registry/bases/forme/components/keep-together/index.ts",- "type": "registry:component",- "target": "components/pdf/keep-together/index.ts"}],"name": "forme/keep-together",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Keep Together","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Key Value PDF component (forme)","files": [{"path": "registry/bases/forme/components/key-value/key-value.tsx","type": "registry:component","target": "components/pdf/key-value/key-value.tsx"- },- {- "path": "registry/bases/forme/components/key-value/index.ts",- "type": "registry:component",- "target": "components/pdf/key-value/index.ts"}],"name": "forme/key-value",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Key Value","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Link PDF component (forme)","files": [{"path": "registry/bases/forme/components/link/link.tsx","type": "registry:component","target": "components/pdf/link/link.tsx"- },- {- "path": "registry/bases/forme/components/link/index.ts",- "type": "registry:component",- "target": "components/pdf/link/index.ts"}],"name": "forme/link",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Link","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "List PDF component (forme)","files": [{@@ -1347,200 +1479,201 @@"path": "registry/bases/forme/components/list/list.types.ts","type": "registry:component","target": "components/pdf/list/list.types.ts"- },- {- "path": "registry/bases/forme/components/list/index.ts",- "type": "registry:component",- "target": "components/pdf/list/index.ts"}],"name": "forme/list",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "List","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Page Break PDF component (forme)","files": [{"path": "registry/bases/forme/components/page-break/page-break.tsx","type": "registry:component","target": "components/pdf/page-break/page-break.tsx"- },- {- "path": "registry/bases/forme/components/page-break/index.ts",- "type": "registry:component",- "target": "components/pdf/page-break/index.ts"}],"name": "forme/page-break",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Page Break","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Page Footer PDF component (forme)","files": [{"path": "registry/bases/forme/components/page-footer/page-footer.tsx","type": "registry:component","target": "components/pdf/page-footer/page-footer.tsx"- },- {- "path": "registry/bases/forme/components/page-footer/index.ts",- "type": "registry:component",- "target": "components/pdf/page-footer/index.ts"}],"name": "forme/page-footer",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Page Footer","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Page Header PDF component (forme)","files": [{"path": "registry/bases/forme/components/page-header/page-header.tsx","type": "registry:component","target": "components/pdf/page-header/page-header.tsx"- },- {- "path": "registry/bases/forme/components/page-header/index.ts",- "type": "registry:component",- "target": "components/pdf/page-header/index.ts"}],"name": "forme/page-header",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Page Header","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Page Number PDF component (forme)","files": [{"path": "registry/bases/forme/components/page-number/page-number.tsx","type": "registry:component","target": "components/pdf/page-number/page-number.tsx"- },- {- "path": "registry/bases/forme/components/page-number/index.ts",- "type": "registry:component",- "target": "components/pdf/page-number/index.ts"}],"name": "forme/page-number",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Page Number","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Pdf Image PDF component (forme)","files": [{"path": "registry/bases/forme/components/pdf-image/pdf-image.tsx","type": "registry:component","target": "components/pdf/pdf-image/pdf-image.tsx"- },- {- "path": "registry/bases/forme/components/pdf-image/index.ts",- "type": "registry:component",- "target": "components/pdf/pdf-image/index.ts"}],"name": "forme/pdf-image",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Pdf Image","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core", "qrcode"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core",+ "qrcode"+ ],"description": "Qrcode PDF component (forme)","files": [{"path": "registry/bases/forme/components/qrcode/qrcode.tsx","type": "registry:component","target": "components/pdf/qrcode/qrcode.tsx"- },- {- "path": "registry/bases/forme/components/qrcode/index.ts",- "type": "registry:component",- "target": "components/pdf/qrcode/index.ts"}],"name": "forme/qrcode",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Qrcode","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Section PDF component (forme)","files": [{"path": "registry/bases/forme/components/section/section.tsx","type": "registry:component","target": "components/pdf/section/section.tsx"- },- {- "path": "registry/bases/forme/components/section/index.ts",- "type": "registry:component",- "target": "components/pdf/section/index.ts"}],"name": "forme/section",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Section","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Signature PDF component (forme)","files": [{"path": "registry/bases/forme/components/signature/signature.tsx","type": "registry:component","target": "components/pdf/signature/signature.tsx"- },- {- "path": "registry/bases/forme/components/signature/index.ts",- "type": "registry:component",- "target": "components/pdf/signature/index.ts"}],"name": "forme/signature",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Signature","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Stack PDF component (forme)","files": [{"path": "registry/bases/forme/components/stack/stack.tsx","type": "registry:component","target": "components/pdf/stack/stack.tsx"- },- {- "path": "registry/bases/forme/components/stack/index.ts",- "type": "registry:component",- "target": "components/pdf/stack/index.ts"}],"name": "forme/stack",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Stack","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Table PDF component (forme)","files": [{@@ -1557,60 +1690,60 @@"path": "registry/bases/forme/components/table/table.types.ts","type": "registry:component","target": "components/pdf/table/table.types.ts"- },- {- "path": "registry/bases/forme/components/table/index.ts",- "type": "registry:component",- "target": "components/pdf/table/index.ts"}],"name": "forme/table",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Table","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Text PDF component (forme)","files": [{"path": "registry/bases/forme/components/text/text.tsx","type": "registry:component","target": "components/pdf/text/text.tsx"- },- {- "path": "registry/bases/forme/components/text/index.ts",- "type": "registry:component",- "target": "components/pdf/text/index.ts"}],"name": "forme/text",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Text","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Watermark PDF component (forme)","files": [{"path": "registry/bases/forme/components/watermark/watermark.tsx","type": "registry:component","target": "components/pdf/watermark/watermark.tsx"- },- {- "path": "registry/bases/forme/components/watermark/index.ts",- "type": "registry:component",- "target": "components/pdf/watermark/index.ts"}],"name": "forme/watermark",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Watermark","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Invoice Classic PDF block (forme)","files": [{@@ -1625,12 +1758,24 @@}],"name": "forme/invoice-classic",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/pdf-image",+ "@pdfcn/forme/section",+ "@pdfcn/forme/table",+ "@pdfcn/forme/text"+ ],"title": "Invoice Classic","type": "registry:block"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Invoice Consultant PDF block (forme)","files": [{@@ -1645,12 +1790,22 @@}],"name": "forme/invoice-consultant",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/section",+ "@pdfcn/forme/table",+ "@pdfcn/forme/text"+ ],"title": "Invoice Consultant","type": "registry:block"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Invoice Corporate PDF block (forme)","files": [{@@ -1665,12 +1820,23 @@}],"name": "forme/invoice-corporate",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/pdf-image",+ "@pdfcn/forme/table",+ "@pdfcn/forme/text"+ ],"title": "Invoice Corporate","type": "registry:block"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Invoice Creative PDF block (forme)","files": [{@@ -1685,12 +1851,23 @@}],"name": "forme/invoice-creative",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/section",+ "@pdfcn/forme/table",+ "@pdfcn/forme/text"+ ],"title": "Invoice Creative","type": "registry:block"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Invoice Minimal PDF block (forme)","files": [{@@ -1705,12 +1882,23 @@}],"name": "forme/invoice-minimal",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/section",+ "@pdfcn/forme/table",+ "@pdfcn/forme/text"+ ],"title": "Invoice Minimal","type": "registry:block"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Invoice Modern PDF block (forme)","files": [{@@ -1725,12 +1913,23 @@}],"name": "forme/invoice-modern",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/section",+ "@pdfcn/forme/table",+ "@pdfcn/forme/text"+ ],"title": "Invoice Modern","type": "registry:block"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Report Financial PDF block (forme)","files": [{@@ -1750,12 +1949,26 @@}],"name": "forme/report-financial",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/badge",+ "@pdfcn/forme/data-table",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/graph",+ "@pdfcn/forme/list",+ "@pdfcn/forme/section",+ "@pdfcn/forme/text"+ ],"title": "Report Financial","type": "registry:block"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Report Marketing PDF block (forme)","files": [{@@ -1775,12 +1988,26 @@}],"name": "forme/report-marketing",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/badge",+ "@pdfcn/forme/data-table",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/graph",+ "@pdfcn/forme/list",+ "@pdfcn/forme/section",+ "@pdfcn/forme/text"+ ],"title": "Report Marketing","type": "registry:block"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Report Operations PDF block (forme)","files": [{@@ -1800,12 +2027,26 @@}],"name": "forme/report-operations",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/badge",+ "@pdfcn/forme/data-table",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/graph",+ "@pdfcn/forme/list",+ "@pdfcn/forme/section",+ "@pdfcn/forme/text"+ ],"title": "Report Operations","type": "registry:block"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Report Security PDF block (forme)","files": [{@@ -1825,10 +2066,21 @@}],"name": "forme/report-security",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/badge",+ "@pdfcn/forme/data-table",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/graph",+ "@pdfcn/forme/list",+ "@pdfcn/forme/section",+ "@pdfcn/forme/text"+ ],"title": "Report Security","type": "registry:block"}],"name": "pdfcn"-}+}\ No newline at end of filediff --git a/public/r/takumi/alert.json b/public/r/takumi/alert.jsonindex eb5936b..8a8dab3 100644--- a/public/r/takumi/alert.json+++ b/public/r/takumi/alert.json@@ -8,20 +8,14 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils"],"files": [{"path": "registry/bases/takumi/components/alert/alert.tsx",- "content": "import type { ReactNode } from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport { Circle, Line, Path, Svg } from \"@/registry/bases/takumi/lib/pdf-svg\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import type { ReactNode } from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport { Circle, Line, Path, Svg } from \"@/registry/bases/takumi/lib/pdf-svg\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/alert/alert.tsx"- },- {- "path": "registry/bases/takumi/components/alert/index.ts",- "content": "export { PdfAlert, type PdfAlertProps, type AlertVariant } from \"./alert\";\n",- "type": "registry:component",- "target": "components/pdf/alert/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/badge.json b/public/r/takumi/badge.jsonindex dd14e20..134ec94 100644--- a/public/r/takumi/badge.json+++ b/public/r/takumi/badge.json@@ -8,20 +8,14 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils"],"files": [{"path": "registry/bases/takumi/components/badge/badge.tsx",- "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/badge/badge.tsx"- },- {- "path": "registry/bases/takumi/components/badge/index.ts",- "content": "export {\n Badge,\n type BadgeProps,\n type BadgeVariant,\n type BadgeSize,\n} from \"./badge\";\n",- "type": "registry:component",- "target": "components/pdf/badge/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/card.json b/public/r/takumi/card.jsonindex 6409bf9..5b3fa92 100644--- a/public/r/takumi/card.json+++ b/public/r/takumi/card.json@@ -8,20 +8,14 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils"],"files": [{"path": "registry/bases/takumi/components/card/card.tsx",- "content": "import type { ReactNode } from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import type { ReactNode } from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/card/card.tsx"- },- {- "path": "registry/bases/takumi/components/card/index.ts",- "content": "export { PdfCard, type PdfCardProps, type CardVariant } from \"./card\";\n",- "type": "registry:component",- "target": "components/pdf/card/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/data-table.json b/public/r/takumi/data-table.jsonindex fd46358..67aa72c 100644--- a/public/r/takumi/data-table.json+++ b/public/r/takumi/data-table.json@@ -8,33 +8,27 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils",- "takumi/table"+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/table"],"files": [{"path": "registry/bases/takumi/components/data-table/data-table.styles.ts",- "content": "import { StyleSheet } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import { StyleSheet } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/data-table/data-table.styles.ts"},{"path": "registry/bases/takumi/components/data-table/data-table.tsx",- "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 \"@/components/pdf/theme-provider\";\nimport { Text as PDFText } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-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",+ "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/table\";\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/components/theme-provider\";\nimport { Text as PDFText } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-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/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 { TableVariant } from \"@/registry/bases/takumi/components/table/table.types\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\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/types/pdf-components\";\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/data-table/data-table.types.ts"- },- {- "path": "registry/bases/takumi/components/data-table/index.ts",- "content": "export { DataTable } from \"./data-table\";\nexport type {\n DataTableProps,\n DataTableColumn,\n DataTableSize,\n} from \"./data-table.types\";\n",- "type": "registry:component",- "target": "components/pdf/data-table/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/divider.json b/public/r/takumi/divider.jsonindex 144d293..eb329c3 100644--- a/public/r/takumi/divider.json+++ b/public/r/takumi/divider.json@@ -8,20 +8,14 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils"],"files": [{"path": "registry/bases/takumi/components/divider/divider.tsx",- "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/divider/divider.tsx"- },- {- "path": "registry/bases/takumi/components/divider/index.ts",- "content": "export {\n Divider,\n type DividerProps,\n type DividerVariant,\n type DividerThickness,\n type DividerSpacing,\n} from \"./divider\";\n",- "type": "registry:component",- "target": "components/pdf/divider/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/form.json b/public/r/takumi/form.jsonindex a0e17a3..c22ddc8 100644--- a/public/r/takumi/form.json+++ b/public/r/takumi/form.json@@ -8,18 +8,18 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils"],"files": [{"path": "registry/bases/takumi/components/form/form.styles.ts",- "content": "import { StyleSheet } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import { StyleSheet } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/form/form.styles.ts"},{"path": "registry/bases/takumi/components/form/form.tsx",- "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n View,\n Text as PDFText,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n View,\n Text as PDFText,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-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/form/form.tsx"},@@ -28,12 +28,6 @@"content": "import type { Style } from \"@/registry/bases/takumi/lib/pdf-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/form/form.types.ts"- },- {- "path": "registry/bases/takumi/components/form/index.ts",- "content": "export { PdfForm } from \"./form\";\nexport type {\n PdfFormProps,\n PdfFormVariant,\n PdfFormField,\n PdfFormGroup,\n FormLayout,\n FormLabelPosition,\n} from \"./form.types\";\n",- "type": "registry:component",- "target": "components/pdf/form/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/graph.json b/public/r/takumi/graph.jsonindex 3492b32..95a1a92 100644--- a/public/r/takumi/graph.json+++ b/public/r/takumi/graph.json@@ -8,18 +8,18 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils"],"files": [{"path": "registry/bases/takumi/components/graph/graph.styles.ts",- "content": "import { StyleSheet } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import { StyleSheet } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/graph/graph.styles.ts"},{"path": "registry/bases/takumi/components/graph/graph.tsx",- "content": "import type React from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n View,\n Text as PDFText,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport {\n Circle,\n G,\n Line,\n Path,\n Rect,\n Svg,\n SvgText,\n} from \"@/registry/bases/takumi/lib/pdf-svg\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import type React from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n View,\n Text as PDFText,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport {\n Circle,\n G,\n Line,\n Path,\n Rect,\n Svg,\n SvgText,\n} from \"@/registry/bases/takumi/lib/pdf-svg\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/graph/graph.tsx"},@@ -31,15 +31,9 @@},{"path": "registry/bases/takumi/components/graph/graph.utils.ts",- "content": "import type { PdfcnTheme } from \"@/types/pdf-themes\";\n\nimport type {\n ChartLayout,\n GraphDataPoint,\n GraphSeries,\n GraphWidthOptions,\n} from \"./graph.types\";\n\n/** Standard A4 page width in PDF points. */\nexport const A4_WIDTH = 595;\n\n/**\n * Pre-calculated safe graph widths for common scenarios.\n * These values work with all built-in themes on A4 pages.\n */\nexport const GRAPH_SAFE_WIDTHS = {\n /** Safe width for graph directly in page content (no extra containers) */\n default: 420,\n /** Safe width for graph inside a Section with md padding */\n inSection: 400,\n /** Safe width for graph inside a Section + bordered wrapper (like graphShell) */\n inSectionWithWrapper: 380,\n} as const;\n\n/**\n * Calculate the safe graph width based on theme page margins and container context.\n *\n * This utility ensures graphs don't overflow their container by accounting for:\n * - Page margins (from theme)\n * - Container padding (e.g., Section component)\n * - Wrapper padding (e.g., a bordered graphShell View)\n *\n * @example\n * ```tsx\n * const width = getGraphWidth(theme);\n * // For a graph inside a Section with padding=\"md\" (12pt) and a graphShell (12pt):\n * const width = getGraphWidth(theme, { containerPadding: 12, wrapperPadding: 12 });\n * ```\n */\nexport const getGraphWidth = (\n theme: PdfcnTheme,\n options: GraphWidthOptions = {}\n): number => {\n const {\n containerPadding = 0,\n wrapperPadding = 0,\n pageWidth = A4_WIDTH,\n } = options;\n const { marginLeft, marginRight } = theme.spacing.page;\n const availableWidth =\n pageWidth -\n marginLeft -\n marginRight -\n containerPadding * 2 -\n wrapperPadding * 2;\n return Math.max(Math.floor(availableWidth), 100);\n};\n\nexport const CHART_MARGINS = {\n axisBottom: 24,\n axisLeft: 40,\n pieBottom: 10,\n pieLeft: 10,\n right: 10,\n top: 10,\n} as const;\n\n/** Normalize to always work with GraphSeries[]. */\nexport const normalizeData = (\n data: GraphDataPoint[] | GraphSeries[]\n): GraphSeries[] => {\n if (data.length === 0) {\n return [];\n }\n if (\"label\" in data[0] && \"value\" in data[0]) {\n return [{ data: data as GraphDataPoint[], name: \"Series 1\" }];\n }\n return data as GraphSeries[];\n};\n\n/** Compute nice Y-axis ticks for a given value range. */\nexport const computeYTicks = (\n min: number,\n max: number,\n count: number\n): number[] => {\n if (min === max) {\n return [0, max || 1];\n }\n const step = (max - min) / (count - 1);\n return Array.from({ length: count }, (_, i) => {\n const v = min + i * step;\n return Math.round(v * 100) / 100;\n });\n};\n\n/** Format a number for display on axis labels. */\nexport const fmtNum = (v: number): string => {\n if (Math.abs(v) >= 1_000_000) {\n return `${(v / 1_000_000).toFixed(1)}M`;\n }\n if (Math.abs(v) >= 1000) {\n return `${(v / 1000).toFixed(1)}K`;\n }\n if (!Number.isInteger(v)) {\n return v.toFixed(1);\n }\n return String(v);\n};\n\n/** Truncate a label to at most maxLen characters. */\nexport const truncate = (s: string, maxLen: number): string =>\n s.length > maxLen ? `${s.slice(0, maxLen - 1)}…` : s;\n\n/** Polar to Cartesian coordinate conversion for pie/donut arcs. */\nexport const polarToCartesian = (\n cx: number,\n cy: number,\n r: number,\n angleDeg: number\n) => {\n const rad = ((angleDeg - 90) * Math.PI) / 180;\n return { x: cx + r * Math.cos(rad), y: cy + r * Math.sin(rad) };\n};\n\n/** Build an SVG arc path for a pie/donut slice. */\nexport const arcPath = (\n cx: number,\n cy: number,\n r: number,\n startAngle: number,\n endAngle: number,\n innerR = 0\n): string => {\n const safeEnd = Math.min(endAngle, startAngle + 359.999);\n const large = safeEnd - startAngle > 180 ? 1 : 0;\n const s = polarToCartesian(cx, cy, r, safeEnd);\n const e = polarToCartesian(cx, cy, r, startAngle);\n if (innerR === 0) {\n return `M ${cx} ${cy} L ${s.x} ${s.y} A ${r} ${r} 0 ${large} 0 ${e.x} ${e.y} Z`;\n }\n const si = polarToCartesian(cx, cy, innerR, safeEnd);\n const ei = polarToCartesian(cx, cy, innerR, startAngle);\n return [\n `M ${s.x} ${s.y}`,\n `A ${r} ${r} 0 ${large} 0 ${e.x} ${e.y}`,\n `L ${ei.x} ${ei.y}`,\n `A ${innerR} ${innerR} 0 ${large} 1 ${si.x} ${si.y}`,\n \"Z\",\n ].join(\" \");\n};\n\n/** Compute smooth bezier control points (Catmull-Rom → cubic bezier). */\nexport const smoothPath = (\n points: { x: number; y: number }[],\n tension = 0.4\n): string => {\n if (points.length < 2) {\n return \"\";\n }\n if (points.length === 2) {\n return `M ${points[0].x} ${points[0].y} L ${points[1].x} ${points[1].y}`;\n }\n const parts: string[] = [`M ${points[0].x} ${points[0].y}`];\n for (let i = 0; i < points.length - 1; i += 1) {\n const p0 = points[Math.max(i - 1, 0)];\n const p1 = points[i];\n const p2 = points[i + 1];\n const p3 = points[Math.min(i + 2, points.length - 1)];\n const cp1x = p1.x + (p2.x - p0.x) * tension;\n const cp1y = p1.y + (p2.y - p0.y) * tension;\n const cp2x = p2.x - (p3.x - p1.x) * tension;\n const cp2y = p2.y - (p3.y - p1.y) * tension;\n parts.push(`C ${cp1x} ${cp1y} ${cp2x} ${cp2y} ${p2.x} ${p2.y}`);\n }\n return parts.join(\" \");\n};\n\n/** Get the default chart color palette from the theme. */\nexport const getDefaultPalette = (t: PdfcnTheme): string[] => [\n t.colors.primary,\n t.colors.info ?? \"#3B82F6\",\n t.colors.success ?? \"#22C55E\",\n t.colors.warning ?? \"#F59E0B\",\n t.colors.destructive ?? \"#EF4444\",\n \"#8B5CF6\",\n \"#F97316\",\n \"#14B8A6\",\n];\n\n/** Derive ChartLayout from series data, SVG dimensions, and variant. */\nexport const buildLayout = (\n series: GraphSeries[],\n width: number,\n height: number,\n isPieOrDonut: boolean,\n yTickCount: number\n): ChartLayout => {\n const mL = isPieOrDonut ? CHART_MARGINS.pieLeft : CHART_MARGINS.axisLeft;\n const mB = isPieOrDonut ? CHART_MARGINS.pieBottom : CHART_MARGINS.axisBottom;\n const chartX = mL;\n const chartY = CHART_MARGINS.top;\n const chartW = width - mL - CHART_MARGINS.right;\n const chartH = height - CHART_MARGINS.top - mB;\n const allValues = series.flatMap((s) => s.data.map((d) => d.value));\n const rawMin = Math.min(...allValues, 0);\n const rawMax = Math.max(...allValues, 1);\n const yMin = Math.min(0, rawMin);\n const yMax = rawMax + (rawMax - yMin) * 0.08;\n return {\n chartH,\n chartW,\n chartX,\n chartY,\n svgH: height,\n svgW: width,\n xLabels: series[0]?.data.map((d) => d.label) ?? [],\n yMax,\n yMin,\n yTicks: computeYTicks(yMin, yMax, yTickCount),\n };\n};\n",+ "content": "import type { PdfcnTheme } from \"@/registry/types/pdf-themes\";\n\nimport type {\n ChartLayout,\n GraphDataPoint,\n GraphSeries,\n GraphWidthOptions,\n} from \"./graph.types\";\n\n/** Standard A4 page width in PDF points. */\nexport const A4_WIDTH = 595;\n\n/**\n * Pre-calculated safe graph widths for common scenarios.\n * These values work with all built-in themes on A4 pages.\n */\nexport const GRAPH_SAFE_WIDTHS = {\n /** Safe width for graph directly in page content (no extra containers) */\n default: 420,\n /** Safe width for graph inside a Section with md padding */\n inSection: 400,\n /** Safe width for graph inside a Section + bordered wrapper (like graphShell) */\n inSectionWithWrapper: 380,\n} as const;\n\n/**\n * Calculate the safe graph width based on theme page margins and container context.\n *\n * This utility ensures graphs don't overflow their container by accounting for:\n * - Page margins (from theme)\n * - Container padding (e.g., Section component)\n * - Wrapper padding (e.g., a bordered graphShell View)\n *\n * @example\n * ```tsx\n * const width = getGraphWidth(theme);\n * // For a graph inside a Section with padding=\"md\" (12pt) and a graphShell (12pt):\n * const width = getGraphWidth(theme, { containerPadding: 12, wrapperPadding: 12 });\n * ```\n */\nexport const getGraphWidth = (\n theme: PdfcnTheme,\n options: GraphWidthOptions = {}\n): number => {\n const {\n containerPadding = 0,\n wrapperPadding = 0,\n pageWidth = A4_WIDTH,\n } = options;\n const { marginLeft, marginRight } = theme.spacing.page;\n const availableWidth =\n pageWidth -\n marginLeft -\n marginRight -\n containerPadding * 2 -\n wrapperPadding * 2;\n return Math.max(Math.floor(availableWidth), 100);\n};\n\nexport const CHART_MARGINS = {\n axisBottom: 24,\n axisLeft: 40,\n pieBottom: 10,\n pieLeft: 10,\n right: 10,\n top: 10,\n} as const;\n\n/** Normalize to always work with GraphSeries[]. */\nexport const normalizeData = (\n data: GraphDataPoint[] | GraphSeries[]\n): GraphSeries[] => {\n if (data.length === 0) {\n return [];\n }\n if (\"label\" in data[0] && \"value\" in data[0]) {\n return [{ data: data as GraphDataPoint[], name: \"Series 1\" }];\n }\n return data as GraphSeries[];\n};\n\n/** Compute nice Y-axis ticks for a given value range. */\nexport const computeYTicks = (\n min: number,\n max: number,\n count: number\n): number[] => {\n if (min === max) {\n return [0, max || 1];\n }\n const step = (max - min) / (count - 1);\n return Array.from({ length: count }, (_, i) => {\n const v = min + i * step;\n return Math.round(v * 100) / 100;\n });\n};\n\n/** Format a number for display on axis labels. */\nexport const fmtNum = (v: number): string => {\n if (Math.abs(v) >= 1_000_000) {\n return `${(v / 1_000_000).toFixed(1)}M`;\n }\n if (Math.abs(v) >= 1000) {\n return `${(v / 1000).toFixed(1)}K`;\n }\n if (!Number.isInteger(v)) {\n return v.toFixed(1);\n }\n return String(v);\n};\n\n/** Truncate a label to at most maxLen characters. */\nexport const truncate = (s: string, maxLen: number): string =>\n s.length > maxLen ? `${s.slice(0, maxLen - 1)}…` : s;\n\n/** Polar to Cartesian coordinate conversion for pie/donut arcs. */\nexport const polarToCartesian = (\n cx: number,\n cy: number,\n r: number,\n angleDeg: number\n) => {\n const rad = ((angleDeg - 90) * Math.PI) / 180;\n return { x: cx + r * Math.cos(rad), y: cy + r * Math.sin(rad) };\n};\n\n/** Build an SVG arc path for a pie/donut slice. */\nexport const arcPath = (\n cx: number,\n cy: number,\n r: number,\n startAngle: number,\n endAngle: number,\n innerR = 0\n): string => {\n const safeEnd = Math.min(endAngle, startAngle + 359.999);\n const large = safeEnd - startAngle > 180 ? 1 : 0;\n const s = polarToCartesian(cx, cy, r, safeEnd);\n const e = polarToCartesian(cx, cy, r, startAngle);\n if (innerR === 0) {\n return `M ${cx} ${cy} L ${s.x} ${s.y} A ${r} ${r} 0 ${large} 0 ${e.x} ${e.y} Z`;\n }\n const si = polarToCartesian(cx, cy, innerR, safeEnd);\n const ei = polarToCartesian(cx, cy, innerR, startAngle);\n return [\n `M ${s.x} ${s.y}`,\n `A ${r} ${r} 0 ${large} 0 ${e.x} ${e.y}`,\n `L ${ei.x} ${ei.y}`,\n `A ${innerR} ${innerR} 0 ${large} 1 ${si.x} ${si.y}`,\n \"Z\",\n ].join(\" \");\n};\n\n/** Compute smooth bezier control points (Catmull-Rom → cubic bezier). */\nexport const smoothPath = (\n points: { x: number; y: number }[],\n tension = 0.4\n): string => {\n if (points.length < 2) {\n return \"\";\n }\n if (points.length === 2) {\n return `M ${points[0].x} ${points[0].y} L ${points[1].x} ${points[1].y}`;\n }\n const parts: string[] = [`M ${points[0].x} ${points[0].y}`];\n for (let i = 0; i < points.length - 1; i += 1) {\n const p0 = points[Math.max(i - 1, 0)];\n const p1 = points[i];\n const p2 = points[i + 1];\n const p3 = points[Math.min(i + 2, points.length - 1)];\n const cp1x = p1.x + (p2.x - p0.x) * tension;\n const cp1y = p1.y + (p2.y - p0.y) * tension;\n const cp2x = p2.x - (p3.x - p1.x) * tension;\n const cp2y = p2.y - (p3.y - p1.y) * tension;\n parts.push(`C ${cp1x} ${cp1y} ${cp2x} ${cp2y} ${p2.x} ${p2.y}`);\n }\n return parts.join(\" \");\n};\n\n/** Get the default chart color palette from the theme. */\nexport const getDefaultPalette = (t: PdfcnTheme): string[] => [\n t.colors.primary,\n t.colors.info ?? \"#3B82F6\",\n t.colors.success ?? \"#22C55E\",\n t.colors.warning ?? \"#F59E0B\",\n t.colors.destructive ?? \"#EF4444\",\n \"#8B5CF6\",\n \"#F97316\",\n \"#14B8A6\",\n];\n\n/** Derive ChartLayout from series data, SVG dimensions, and variant. */\nexport const buildLayout = (\n series: GraphSeries[],\n width: number,\n height: number,\n isPieOrDonut: boolean,\n yTickCount: number\n): ChartLayout => {\n const mL = isPieOrDonut ? CHART_MARGINS.pieLeft : CHART_MARGINS.axisLeft;\n const mB = isPieOrDonut ? CHART_MARGINS.pieBottom : CHART_MARGINS.axisBottom;\n const chartX = mL;\n const chartY = CHART_MARGINS.top;\n const chartW = width - mL - CHART_MARGINS.right;\n const chartH = height - CHART_MARGINS.top - mB;\n const allValues = series.flatMap((s) => s.data.map((d) => d.value));\n const rawMin = Math.min(...allValues, 0);\n const rawMax = Math.max(...allValues, 1);\n const yMin = Math.min(0, rawMin);\n const yMax = rawMax + (rawMax - yMin) * 0.08;\n return {\n chartH,\n chartW,\n chartX,\n chartY,\n svgH: height,\n svgW: width,\n xLabels: series[0]?.data.map((d) => d.label) ?? [],\n yMax,\n yMin,\n yTicks: computeYTicks(yMin, yMax, yTickCount),\n };\n};\n","type": "registry:component","target": "components/pdf/graph/graph.utils.ts"- },- {- "path": "registry/bases/takumi/components/graph/index.ts",- "content": "export { PdfGraph } from \"./graph\";\nexport { A4_WIDTH, GRAPH_SAFE_WIDTHS, getGraphWidth } from \"./graph.utils\";\nexport type {\n GraphDataPoint,\n GraphLegendPosition,\n GraphProps,\n GraphSeries,\n GraphVariant,\n GraphWidthOptions,\n} from \"./graph.types\";\n",- "type": "registry:component",- "target": "components/pdf/graph/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/heading.json b/public/r/takumi/heading.jsonindex afa1de2..f7ad4d9 100644--- a/public/r/takumi/heading.json+++ b/public/r/takumi/heading.json@@ -8,20 +8,14 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils"],"files": [{"path": "registry/bases/takumi/components/heading/heading.tsx",- "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport { Text, StyleSheet } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/components/theme-provider\";\nimport { Text, StyleSheet } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/heading/heading.tsx"- },- {- "path": "registry/bases/takumi/components/heading/index.ts",- "content": "export {\n Heading,\n type HeadingProps,\n type HeadingWeight,\n type HeadingTracking,\n} from \"./heading\";\n",- "type": "registry:component",- "target": "components/pdf/heading/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/invoice-classic.json b/public/r/takumi/invoice-classic.jsonindex 7eab828..b87e11a 100644--- a/public/r/takumi/invoice-classic.json+++ b/public/r/takumi/invoice-classic.json@@ -8,12 +8,19 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/pdf-image",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/table",+ "@pdfcn/takumi/text"],"files": [{"path": "registry/bases/takumi/blocks/invoice-classic/invoice-classic.tsx",- "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/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import { KeyValue } from \"@/registry/bases/takumi/components/key-value/key-value\";\nimport { PageFooter } from \"@/registry/bases/takumi/components/page-footer/page-footer\";\nimport { PageHeader } from \"@/registry/bases/takumi/components/page-header/page-header\";\nimport { PdfImage } from \"@/registry/bases/takumi/components/pdf-image/pdf-image\";\nimport { Section } from \"@/registry/bases/takumi/components/section/section\";\nimport { Table, TableBody, TableCell, TableHeader, TableRow } from \"@/registry/bases/takumi/components/table/table\";\nimport { Text } from \"@/registry/bases/takumi/components/text/text\";\nimport { PdfcnThemeProvider, usePdfcnTheme } from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n View,\n StyleSheet,\n Document,\n Page,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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 2b37acf..a15a271 100644--- a/public/r/takumi/invoice-consultant.json+++ b/public/r/takumi/invoice-consultant.json@@ -8,12 +8,17 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/table",+ "@pdfcn/takumi/text"],"files": [{"path": "registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.tsx",- "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/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import { KeyValue } from \"@/registry/bases/takumi/components/key-value/key-value\";\nimport { PageFooter } from \"@/registry/bases/takumi/components/page-footer/page-footer\";\nimport { Section } from \"@/registry/bases/takumi/components/section/section\";\nimport { Table, TableBody, TableCell, TableHeader, TableRow } from \"@/registry/bases/takumi/components/table/table\";\nimport { Text } from \"@/registry/bases/takumi/components/text/text\";\nimport { PdfcnThemeProvider, usePdfcnTheme } from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n View,\n StyleSheet,\n Document,\n Page,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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 90b237d..798453c 100644--- a/public/r/takumi/invoice-corporate.json+++ b/public/r/takumi/invoice-corporate.json@@ -8,12 +8,18 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/pdf-image",+ "@pdfcn/takumi/table",+ "@pdfcn/takumi/text"],"files": [{"path": "registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.tsx",- "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/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import { KeyValue } from \"@/registry/bases/takumi/components/key-value/key-value\";\nimport { PageFooter } from \"@/registry/bases/takumi/components/page-footer/page-footer\";\nimport { PageHeader } from \"@/registry/bases/takumi/components/page-header/page-header\";\nimport { PdfImage } from \"@/registry/bases/takumi/components/pdf-image/pdf-image\";\nimport { Table, TableBody, TableCell, TableHeader, TableRow } from \"@/registry/bases/takumi/components/table/table\";\nimport { Text } from \"@/registry/bases/takumi/components/text/text\";\nimport { PdfcnThemeProvider, usePdfcnTheme } from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n View,\n StyleSheet,\n Document,\n Page,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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 a378dc5..2637cbb 100644--- a/public/r/takumi/invoice-creative.json+++ b/public/r/takumi/invoice-creative.json@@ -8,12 +8,18 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/table",+ "@pdfcn/takumi/text"],"files": [{"path": "registry/bases/takumi/blocks/invoice-creative/invoice-creative.tsx",- "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/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import { KeyValue } from \"@/registry/bases/takumi/components/key-value/key-value\";\nimport { PageFooter } from \"@/registry/bases/takumi/components/page-footer/page-footer\";\nimport { PageHeader } from \"@/registry/bases/takumi/components/page-header/page-header\";\nimport { Section } from \"@/registry/bases/takumi/components/section/section\";\nimport { Table, TableBody, TableCell, TableHeader, TableRow } from \"@/registry/bases/takumi/components/table/table\";\nimport { Text } from \"@/registry/bases/takumi/components/text/text\";\nimport { PdfcnThemeProvider, usePdfcnTheme } from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n View,\n StyleSheet,\n Document,\n Page,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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 0836db3..5eff0b7 100644--- a/public/r/takumi/invoice-minimal.json+++ b/public/r/takumi/invoice-minimal.json@@ -8,12 +8,18 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/table",+ "@pdfcn/takumi/text"],"files": [{"path": "registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.tsx",- "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/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import { KeyValue } from \"@/registry/bases/takumi/components/key-value/key-value\";\nimport { PageFooter } from \"@/registry/bases/takumi/components/page-footer/page-footer\";\nimport { PageHeader } from \"@/registry/bases/takumi/components/page-header/page-header\";\nimport { Section } from \"@/registry/bases/takumi/components/section/section\";\nimport { Table, TableBody, TableCell, TableHeader, TableRow } from \"@/registry/bases/takumi/components/table/table\";\nimport { Text } from \"@/registry/bases/takumi/components/text/text\";\nimport { PdfcnThemeProvider, usePdfcnTheme } from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n View,\n StyleSheet,\n Document,\n Page,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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 5c1d9e4..19e24b4 100644--- a/public/r/takumi/invoice-modern.json+++ b/public/r/takumi/invoice-modern.json@@ -8,12 +8,18 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/table",+ "@pdfcn/takumi/text"],"files": [{"path": "registry/bases/takumi/blocks/invoice-modern/invoice-modern.tsx",- "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/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import { KeyValue } from \"@/registry/bases/takumi/components/key-value/key-value\";\nimport { PageFooter } from \"@/registry/bases/takumi/components/page-footer/page-footer\";\nimport { PageHeader } from \"@/registry/bases/takumi/components/page-header/page-header\";\nimport { Section } from \"@/registry/bases/takumi/components/section/section\";\nimport { Table, TableBody, TableCell, TableHeader, TableRow } from \"@/registry/bases/takumi/components/table/table\";\nimport { Text } from \"@/registry/bases/takumi/components/text/text\";\nimport { PdfcnThemeProvider, usePdfcnTheme } from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n View,\n StyleSheet,\n Document,\n Page,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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 034e956..dc4bc8f 100644--- a/public/r/takumi/keep-together.json+++ b/public/r/takumi/keep-together.json@@ -8,20 +8,14 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils"],"files": [{"path": "registry/bases/takumi/components/keep-together/keep-together.tsx",- "content": "import type { ReactNode } from \"react\";\n\nimport { View } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/types/pdf-components\";\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/pdf-primitives\";\nimport type { Style } from \"@/registry/types/pdf-components\";\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/keep-together/keep-together.tsx"- },- {- "path": "registry/bases/takumi/components/keep-together/index.ts",- "content": "export { KeepTogether, type KeepTogetherProps } from \"./keep-together\";\n",- "type": "registry:component",- "target": "components/pdf/keep-together/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/key-value.json b/public/r/takumi/key-value.jsonindex f98647a..af70e42 100644--- a/public/r/takumi/key-value.json+++ b/public/r/takumi/key-value.json@@ -8,20 +8,14 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils"],"files": [{"path": "registry/bases/takumi/components/key-value/key-value.tsx",- "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/key-value/key-value.tsx"- },- {- "path": "registry/bases/takumi/components/key-value/index.ts",- "content": "export {\n KeyValue,\n type KeyValueProps,\n type KeyValueEntry,\n type KeyValueDirection,\n type KeyValueSize,\n} from \"./key-value\";\n",- "type": "registry:component",- "target": "components/pdf/key-value/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/link.json b/public/r/takumi/link.jsonindex 1f5befd..f14ace4 100644--- a/public/r/takumi/link.json+++ b/public/r/takumi/link.json@@ -8,20 +8,14 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils"],"files": [{"path": "registry/bases/takumi/components/link/link.tsx",- "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n StyleSheet,\n Link as PDFLink,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n StyleSheet,\n Link as PDFLink,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/link/link.tsx"- },- {- "path": "registry/bases/takumi/components/link/index.ts",- "content": "export {\n Link,\n type LinkProps,\n type LinkVariant,\n type LinkUnderline,\n} from \"./link\";\n",- "type": "registry:component",- "target": "components/pdf/link/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/list.json b/public/r/takumi/list.jsonindex 832a963..c45488f 100644--- a/public/r/takumi/list.json+++ b/public/r/takumi/list.json@@ -8,18 +8,18 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils"],"files": [{"path": "registry/bases/takumi/components/list/list.styles.ts",- "content": "import { StyleSheet } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import { StyleSheet } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/list/list.styles.ts"},{"path": "registry/bases/takumi/components/list/list.tsx",- "content": "import type React from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n View,\n Text as PDFText,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-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",+ "content": "import type React from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n View,\n Text as PDFText,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-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/list/list.tsx"},@@ -28,12 +28,6 @@"content": "import type { Style } from \"@/registry/bases/takumi/lib/pdf-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/list/list.types.ts"- },- {- "path": "registry/bases/takumi/components/list/index.ts",- "content": "export { PdfList } from \"./list\";\nexport type { PdfListProps, ListVariant, ListItem } from \"./list.types\";\n",- "type": "registry:component",- "target": "components/pdf/list/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/page-break.json b/public/r/takumi/page-break.jsonindex 93a649b..6621f3c 100644--- a/public/r/takumi/page-break.json+++ b/public/r/takumi/page-break.json@@ -8,20 +8,14 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils"],"files": [{"path": "registry/bases/takumi/components/page-break/page-break.tsx",- "content": "import { View } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\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/pdf-primitives\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\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/page-break/page-break.tsx"- },- {- "path": "registry/bases/takumi/components/page-break/index.ts",- "content": "export { PageBreak } from \"./page-break\";\nexport type { PageBreakProps } from \"./page-break\";\n",- "type": "registry:component",- "target": "components/pdf/page-break/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/page-footer.json b/public/r/takumi/page-footer.jsonindex 9cd669e..f4c2a1d 100644--- a/public/r/takumi/page-footer.json+++ b/public/r/takumi/page-footer.json@@ -8,20 +8,14 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils"],"files": [{"path": "registry/bases/takumi/components/page-footer/page-footer.tsx",- "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/page-footer/page-footer.tsx"- },- {- "path": "registry/bases/takumi/components/page-footer/index.ts",- "content": "export {\n PageFooter,\n type PageFooterProps,\n type PageFooterVariant,\n} from \"./page-footer\";\n",- "type": "registry:component",- "target": "components/pdf/page-footer/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/page-header.json b/public/r/takumi/page-header.jsonindex 58a3fc8..113532e 100644--- a/public/r/takumi/page-header.json+++ b/public/r/takumi/page-header.json@@ -8,20 +8,14 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils"],"files": [{"path": "registry/bases/takumi/components/page-header/page-header.tsx",- "content": "import type { ReactNode } from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import type { ReactNode } from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n Text as PDFText,\n StyleSheet,\n View,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/page-header/page-header.tsx"- },- {- "path": "registry/bases/takumi/components/page-header/index.ts",- "content": "export {\n PageHeader,\n type PageHeaderProps,\n type PageHeaderVariant,\n} from \"./page-header\";\n",- "type": "registry:component",- "target": "components/pdf/page-header/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/page-number.json b/public/r/takumi/page-number.jsonindex ca38f0a..f5ec52d 100644--- a/public/r/takumi/page-number.json+++ b/public/r/takumi/page-number.json@@ -8,20 +8,14 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils"],"files": [{"path": "registry/bases/takumi/components/page-number/page-number.tsx",- "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/page-number/page-number.tsx"- },- {- "path": "registry/bases/takumi/components/page-number/index.ts",- "content": "export {\n PdfPageNumber,\n type PdfPageNumberProps,\n type PageNumberAlign,\n type PageNumberSize,\n} from \"./page-number\";\n",- "type": "registry:component",- "target": "components/pdf/page-number/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/pdf-image.json b/public/r/takumi/pdf-image.jsonindex 9f46d50..d363d86 100644--- a/public/r/takumi/pdf-image.json+++ b/public/r/takumi/pdf-image.json@@ -8,20 +8,14 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils"],"files": [{"path": "registry/bases/takumi/components/pdf-image/pdf-image.tsx",- "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n Image,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n Image,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/pdf-image/pdf-image.tsx"- },- {- "path": "registry/bases/takumi/components/pdf-image/index.ts",- "content": "export {\n PdfImage,\n type PdfImageProps,\n type PdfImageSrc,\n type PdfImageVariant,\n type PdfImageFit,\n} from \"./pdf-image\";\n",- "type": "registry:component",- "target": "components/pdf/pdf-image/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/qrcode.json b/public/r/takumi/qrcode.jsonindex 8d92ebf..12fd05f 100644--- a/public/r/takumi/qrcode.json+++ b/public/r/takumi/qrcode.json@@ -9,20 +9,14 @@"qrcode"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils"],"files": [{"path": "registry/bases/takumi/components/qrcode/qrcode.tsx",- "content": "import QRCode from \"qrcode\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport { Rect, Svg } from \"@/registry/bases/takumi/lib/pdf-svg\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import QRCode from \"qrcode\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport { Rect, Svg } from \"@/registry/bases/takumi/lib/pdf-svg\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/qrcode/qrcode.tsx"- },- {- "path": "registry/bases/takumi/components/qrcode/index.ts",- "content": "export {\n PdfQRCode,\n type PdfQRCodeProps,\n type QRCodeErrorLevel,\n} from \"./qrcode\";\n",- "type": "registry:component",- "target": "components/pdf/qrcode/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/report-financial.json b/public/r/takumi/report-financial.jsonindex cdfd25c..8eab126 100644--- a/public/r/takumi/report-financial.json+++ b/public/r/takumi/report-financial.json@@ -8,7 +8,16 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/badge",+ "@pdfcn/takumi/data-table",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/graph",+ "@pdfcn/takumi/list",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/text"],"files": [{@@ -19,7 +28,7 @@},{"path": "registry/bases/takumi/blocks/report-financial/report-layout.tsx",- "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/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import { Badge } from \"@/registry/bases/takumi/components/badge/badge\";\nimport { DataTable } from \"@/registry/bases/takumi/components/data-table/data-table\";\nimport { PdfGraph } from \"@/registry/bases/takumi/components/graph/graph\";\nimport { KeyValue } from \"@/registry/bases/takumi/components/key-value/key-value\";\nimport { PdfList } from \"@/registry/bases/takumi/components/list/list\";\nimport { PageFooter } from \"@/registry/bases/takumi/components/page-footer/page-footer\";\nimport { PageHeader } from \"@/registry/bases/takumi/components/page-header/page-header\";\nimport { Section } from \"@/registry/bases/takumi/components/section/section\";\nimport { Text } from \"@/registry/bases/takumi/components/text/text\";\nimport { PdfcnThemeProvider, usePdfcnTheme } from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n View,\n StyleSheet,\n Document,\n Page,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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 f82ada6..bb2d443 100644--- a/public/r/takumi/report-marketing.json+++ b/public/r/takumi/report-marketing.json@@ -8,12 +8,21 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/badge",+ "@pdfcn/takumi/data-table",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/graph",+ "@pdfcn/takumi/list",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/text"],"files": [{"path": "registry/bases/takumi/blocks/report-marketing/report-layout.tsx",- "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/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import { Badge } from \"@/registry/bases/takumi/components/badge/badge\";\nimport { DataTable } from \"@/registry/bases/takumi/components/data-table/data-table\";\nimport { PdfGraph } from \"@/registry/bases/takumi/components/graph/graph\";\nimport { KeyValue } from \"@/registry/bases/takumi/components/key-value/key-value\";\nimport { PdfList } from \"@/registry/bases/takumi/components/list/list\";\nimport { PageFooter } from \"@/registry/bases/takumi/components/page-footer/page-footer\";\nimport { PageHeader } from \"@/registry/bases/takumi/components/page-header/page-header\";\nimport { Section } from \"@/registry/bases/takumi/components/section/section\";\nimport { Text } from \"@/registry/bases/takumi/components/text/text\";\nimport { PdfcnThemeProvider, usePdfcnTheme } from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n View,\n StyleSheet,\n Document,\n Page,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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 8986eac..62a7af8 100644--- a/public/r/takumi/report-operations.json+++ b/public/r/takumi/report-operations.json@@ -8,12 +8,21 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/badge",+ "@pdfcn/takumi/data-table",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/graph",+ "@pdfcn/takumi/list",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/text"],"files": [{"path": "registry/bases/takumi/blocks/report-operations/report-layout.tsx",- "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/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import { Badge } from \"@/registry/bases/takumi/components/badge/badge\";\nimport { DataTable } from \"@/registry/bases/takumi/components/data-table/data-table\";\nimport { PdfGraph } from \"@/registry/bases/takumi/components/graph/graph\";\nimport { KeyValue } from \"@/registry/bases/takumi/components/key-value/key-value\";\nimport { PdfList } from \"@/registry/bases/takumi/components/list/list\";\nimport { PageFooter } from \"@/registry/bases/takumi/components/page-footer/page-footer\";\nimport { PageHeader } from \"@/registry/bases/takumi/components/page-header/page-header\";\nimport { Section } from \"@/registry/bases/takumi/components/section/section\";\nimport { Text } from \"@/registry/bases/takumi/components/text/text\";\nimport { PdfcnThemeProvider, usePdfcnTheme } from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n View,\n StyleSheet,\n Document,\n Page,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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 1486c55..384650f 100644--- a/public/r/takumi/report-security.json+++ b/public/r/takumi/report-security.json@@ -8,12 +8,21 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/badge",+ "@pdfcn/takumi/data-table",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/graph",+ "@pdfcn/takumi/list",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/text"],"files": [{"path": "registry/bases/takumi/blocks/report-security/report-layout.tsx",- "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/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import { Badge } from \"@/registry/bases/takumi/components/badge/badge\";\nimport { DataTable } from \"@/registry/bases/takumi/components/data-table/data-table\";\nimport { PdfGraph } from \"@/registry/bases/takumi/components/graph/graph\";\nimport { KeyValue } from \"@/registry/bases/takumi/components/key-value/key-value\";\nimport { PdfList } from \"@/registry/bases/takumi/components/list/list\";\nimport { PageFooter } from \"@/registry/bases/takumi/components/page-footer/page-footer\";\nimport { PageHeader } from \"@/registry/bases/takumi/components/page-header/page-header\";\nimport { Section } from \"@/registry/bases/takumi/components/section/section\";\nimport { Text } from \"@/registry/bases/takumi/components/text/text\";\nimport { PdfcnThemeProvider, usePdfcnTheme } from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n View,\n StyleSheet,\n Document,\n Page,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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 ec553e5..aea6f0c 100644--- a/public/r/takumi/section.json+++ b/public/r/takumi/section.json@@ -8,20 +8,14 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils"],"files": [{"path": "registry/bases/takumi/components/section/section.tsx",- "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport { View, StyleSheet } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/components/theme-provider\";\nimport { View, StyleSheet } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/section/section.tsx"- },- {- "path": "registry/bases/takumi/components/section/index.ts",- "content": "export {\n Section,\n type SectionProps,\n type SectionSpacing,\n type SectionPadding,\n type SectionVariant,\n} from \"./section\";\n",- "type": "registry:component",- "target": "components/pdf/section/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/signature.json b/public/r/takumi/signature.jsonindex 2274507..95b2bfc 100644--- a/public/r/takumi/signature.json+++ b/public/r/takumi/signature.json@@ -8,20 +8,14 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils"],"files": [{"path": "registry/bases/takumi/components/signature/signature.tsx",- "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/signature/signature.tsx"- },- {- "path": "registry/bases/takumi/components/signature/index.ts",- "content": "export {\n PdfSignatureBlock,\n type PdfSignatureBlockProps,\n type SignatureVariant,\n type SignatureSigner,\n} from \"./signature\";\n",- "type": "registry:component",- "target": "components/pdf/signature/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/stack.json b/public/r/takumi/stack.jsonindex e1098e2..667d63e 100644--- a/public/r/takumi/stack.json+++ b/public/r/takumi/stack.json@@ -8,20 +8,14 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils"],"files": [{"path": "registry/bases/takumi/components/stack/stack.tsx",- "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport { View, StyleSheet } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/components/theme-provider\";\nimport { View, StyleSheet } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/stack/stack.tsx"- },- {- "path": "registry/bases/takumi/components/stack/index.ts",- "content": "export {\n Stack,\n type StackProps,\n type StackGap,\n type StackDirection,\n type StackAlign,\n type StackJustify,\n} from \"./stack\";\n",- "type": "registry:component",- "target": "components/pdf/stack/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/table.json b/public/r/takumi/table.jsonindex 868b607..74d33fd 100644--- a/public/r/takumi/table.json+++ b/public/r/takumi/table.json@@ -8,32 +8,26 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils"],"files": [{"path": "registry/bases/takumi/components/table/table.styles.ts",- "content": "import { StyleSheet } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import { StyleSheet } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/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 {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n View,\n Text as PDFText,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-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",+ "content": "import { Children, cloneElement, isValidElement } from \"react\";\nimport type { ReactElement, ReactNode } from \"react\";\n\nimport {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n View,\n Text as PDFText,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-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/table/table.tsx"},{"path": "registry/bases/takumi/components/table/table.types.ts",- "content": "import type { PDFComponentProps } from \"@/types/pdf-components\";\n\n/** Table visual style variant. */\nexport type TableVariant =\n | \"line\"\n | \"grid\"\n | \"minimal\"\n | \"striped\"\n | \"compact\"\n | \"bordered\"\n | \"primary-header\";\n\n/**\n * Table container with visual style variants and optional zebra striping.\n * Props - `variant` | `zebraStripe` | `noWrap` | `children` | `style`\n * @see {@link TableProps}\n */\nexport interface TableProps extends PDFComponentProps {\n /**\n * @default 'line'\n */\n variant?: TableVariant;\n /**\n * @default false\n */\n zebraStripe?: boolean;\n /**\n * @default false\n */\n noWrap?: boolean;\n}\n\nexport type TableSectionProps = PDFComponentProps;\n\n/**\n * Table row with optional header, footer, and stripe states.\n * Props - `header` | `footer` | `stripe` | `variant` | `children` | `style`\n * @see {@link TableRowProps}\n */\nexport interface TableRowProps extends PDFComponentProps {\n header?: boolean;\n footer?: boolean;\n stripe?: boolean;\n variant?: TableVariant;\n}\n\n/**\n * Table cell with alignment, width, and header or footer text styling.\n * Props - `header` | `footer` | `align` | `width` | `variant` | `_last` | `children` | `style`\n * @see {@link TableCellProps}\n */\nexport interface TableCellProps extends PDFComponentProps {\n header?: boolean;\n footer?: boolean;\n align?: \"left\" | \"center\" | \"right\";\n width?: string | number;\n variant?: TableVariant;\n _last?: boolean;\n}\n",+ "content": "import type { PDFComponentProps } from \"@/registry/types/pdf-components\";\n\n/** Table visual style variant. */\nexport type TableVariant =\n | \"line\"\n | \"grid\"\n | \"minimal\"\n | \"striped\"\n | \"compact\"\n | \"bordered\"\n | \"primary-header\";\n\n/**\n * Table container with visual style variants and optional zebra striping.\n * Props - `variant` | `zebraStripe` | `noWrap` | `children` | `style`\n * @see {@link TableProps}\n */\nexport interface TableProps extends PDFComponentProps {\n /**\n * @default 'line'\n */\n variant?: TableVariant;\n /**\n * @default false\n */\n zebraStripe?: boolean;\n /**\n * @default false\n */\n noWrap?: boolean;\n}\n\nexport type TableSectionProps = PDFComponentProps;\n\n/**\n * Table row with optional header, footer, and stripe states.\n * Props - `header` | `footer` | `stripe` | `variant` | `children` | `style`\n * @see {@link TableRowProps}\n */\nexport interface TableRowProps extends PDFComponentProps {\n header?: boolean;\n footer?: boolean;\n stripe?: boolean;\n variant?: TableVariant;\n}\n\n/**\n * Table cell with alignment, width, and header or footer text styling.\n * Props - `header` | `footer` | `align` | `width` | `variant` | `_last` | `children` | `style`\n * @see {@link TableCellProps}\n */\nexport interface TableCellProps extends PDFComponentProps {\n header?: boolean;\n footer?: boolean;\n align?: \"left\" | \"center\" | \"right\";\n width?: string | number;\n variant?: TableVariant;\n _last?: boolean;\n}\n","type": "registry:component","target": "components/pdf/table/table.types.ts"- },- {- "path": "registry/bases/takumi/components/table/index.ts",- "content": "export {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableRow,\n TableCell,\n} from \"./table\";\nexport type {\n TableProps,\n TableSectionProps,\n TableRowProps,\n TableCellProps,\n TableVariant,\n} from \"./table.types\";\n",- "type": "registry:component",- "target": "components/pdf/table/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/text.json b/public/r/takumi/text.jsonindex 9f372bb..5fed715 100644--- a/public/r/takumi/text.json+++ b/public/r/takumi/text.json@@ -8,20 +8,14 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils"],"files": [{"path": "registry/bases/takumi/components/text/text.tsx",- "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/text/text.tsx"- },- {- "path": "registry/bases/takumi/components/text/index.ts",- "content": "export {\n Text,\n type TextProps,\n type TextVariant,\n type TextWeight,\n type TextDecoration,\n} from \"./text\";\n",- "type": "registry:component",- "target": "components/pdf/text/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/utils.json b/public/r/takumi/utils.jsonindex 9401db3..9e61ba7 100644--- a/public/r/takumi/utils.json+++ b/public/r/takumi/utils.json@@ -7,19 +7,16 @@"takumi-pdf","@takumi-rs/helpers"],- "registryDependencies": [- "takumi/theme-provider"- ],"files": [{"path": "registry/bases/takumi/lib/resolve-color.ts",- "content": "import type { ColorTokens } from \"@/types/pdf-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",+ "content": "import type { ColorTokens } from \"@/registry/types/pdf-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": "lib/resolve-color.ts"},{"path": "registry/bases/takumi/components/theme-provider.tsx",- "content": "import { isValidElement } from \"react\";\nimport type { DependencyList, ReactNode } from \"react\";\n\nimport { professionalTheme } from \"@/lib/pdf-themes/professional\";\n\nexport type PdfcnTheme = typeof professionalTheme;\n\nlet serializedTheme = professionalTheme;\n\nexport interface PdfcnThemeProviderProps {\n theme?: PdfcnTheme;\n children: ReactNode;\n}\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 ?? professionalTheme);\n\nexport const usePdfcnTheme = (): PdfcnTheme => serializedTheme;\n\nexport const useSafeMemo = <T,>(factory: () => T, _deps: DependencyList): T =>\n factory();\n",+ "content": "import { isValidElement } from \"react\";\nimport type { DependencyList, ReactNode } from \"react\";\n\nimport { professionalTheme } from \"@/registry/themes/professional\";\n\nexport type PdfcnTheme = typeof professionalTheme;\n\nlet serializedTheme = professionalTheme;\n\nexport interface PdfcnThemeProviderProps {\n theme?: PdfcnTheme;\n children: ReactNode;\n}\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 ?? professionalTheme);\n\nexport const usePdfcnTheme = (): PdfcnTheme => serializedTheme;\n\nexport const useSafeMemo = <T,>(factory: () => T, _deps: DependencyList): T =>\n factory();\n","type": "registry:lib","target": "components/pdf/theme-provider.tsx"},diff --git a/public/r/takumi/watermark.json b/public/r/takumi/watermark.jsonindex b4b6bb9..f8cfe68 100644--- a/public/r/takumi/watermark.json+++ b/public/r/takumi/watermark.json@@ -8,20 +8,14 @@"@takumi-rs/helpers"],"registryDependencies": [- "takumi/utils"+ "@pdfcn/takumi/utils"],"files": [{"path": "registry/bases/takumi/components/watermark/watermark.tsx",- "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/components/pdf/theme-provider\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/types/pdf-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",+ "content": "import {\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/takumi/components/theme-provider\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n} from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport type { Style } from \"@/registry/bases/takumi/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/takumi/lib/resolve-color\";\nimport type { PDFComponentProps } from \"@/registry/types/pdf-components\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-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/watermark/watermark.tsx"- },- {- "path": "registry/bases/takumi/components/watermark/index.ts",- "content": "export {\n PdfWatermark,\n type PdfWatermarkProps,\n type WatermarkPosition,\n} from \"./watermark\";\n",- "type": "registry:component",- "target": "components/pdf/watermark/index.ts"}],"type": "registry:ui"diff --git a/registry.json b/registry.jsonindex 7231fef..92226d1 100644--- a/registry.json+++ b/registry.json@@ -3,7 +3,10 @@"homepage": "https://pdfcn.vercel.app","items": [{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Theme context and helpers for the takumi base","files": [{@@ -29,71 +32,73 @@],"name": "takumi/utils","title": "Takumi Utils",- "type": "registry:lib",- "registryDependencies": ["takumi/theme-provider"]+ "type": "registry:lib"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Alert PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/alert/alert.tsx","type": "registry:component","target": "components/pdf/alert/alert.tsx"- },- {- "path": "registry/bases/takumi/components/alert/index.ts",- "type": "registry:component",- "target": "components/pdf/alert/index.ts"}],"name": "takumi/alert",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Alert","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Badge PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/badge/badge.tsx","type": "registry:component","target": "components/pdf/badge/badge.tsx"- },- {- "path": "registry/bases/takumi/components/badge/index.ts",- "type": "registry:component",- "target": "components/pdf/badge/index.ts"}],"name": "takumi/badge",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Badge","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Card PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/card/card.tsx","type": "registry:component","target": "components/pdf/card/card.tsx"- },- {- "path": "registry/bases/takumi/components/card/index.ts",- "type": "registry:component",- "target": "components/pdf/card/index.ts"}],"name": "takumi/card",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Card","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Data Table PDF component (takumi)","files": [{@@ -110,40 +115,41 @@"path": "registry/bases/takumi/components/data-table/data-table.types.ts","type": "registry:component","target": "components/pdf/data-table/data-table.types.ts"- },- {- "path": "registry/bases/takumi/components/data-table/index.ts",- "type": "registry:component",- "target": "components/pdf/data-table/index.ts"}],"name": "takumi/data-table",- "registryDependencies": ["takumi/utils", "takumi/table"],+ "registryDependencies": [+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/table"+ ],"title": "Data Table","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Divider PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/divider/divider.tsx","type": "registry:component","target": "components/pdf/divider/divider.tsx"- },- {- "path": "registry/bases/takumi/components/divider/index.ts",- "type": "registry:component",- "target": "components/pdf/divider/index.ts"}],"name": "takumi/divider",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Divider","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Form PDF component (takumi)","files": [{@@ -160,20 +166,20 @@"path": "registry/bases/takumi/components/form/form.types.ts","type": "registry:component","target": "components/pdf/form/form.types.ts"- },- {- "path": "registry/bases/takumi/components/form/index.ts",- "type": "registry:component",- "target": "components/pdf/form/index.ts"}],"name": "takumi/form",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Form","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Graph PDF component (takumi)","files": [{@@ -195,100 +201,100 @@"path": "registry/bases/takumi/components/graph/graph.utils.ts","type": "registry:component","target": "components/pdf/graph/graph.utils.ts"- },- {- "path": "registry/bases/takumi/components/graph/index.ts",- "type": "registry:component",- "target": "components/pdf/graph/index.ts"}],"name": "takumi/graph",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Graph","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Heading PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/heading/heading.tsx","type": "registry:component","target": "components/pdf/heading/heading.tsx"- },- {- "path": "registry/bases/takumi/components/heading/index.ts",- "type": "registry:component",- "target": "components/pdf/heading/index.ts"}],"name": "takumi/heading",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Heading","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Keep Together PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/keep-together/keep-together.tsx","type": "registry:component","target": "components/pdf/keep-together/keep-together.tsx"- },- {- "path": "registry/bases/takumi/components/keep-together/index.ts",- "type": "registry:component",- "target": "components/pdf/keep-together/index.ts"}],"name": "takumi/keep-together",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Keep Together","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Key Value PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/key-value/key-value.tsx","type": "registry:component","target": "components/pdf/key-value/key-value.tsx"- },- {- "path": "registry/bases/takumi/components/key-value/index.ts",- "type": "registry:component",- "target": "components/pdf/key-value/index.ts"}],"name": "takumi/key-value",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Key Value","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Link PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/link/link.tsx","type": "registry:component","target": "components/pdf/link/link.tsx"- },- {- "path": "registry/bases/takumi/components/link/index.ts",- "type": "registry:component",- "target": "components/pdf/link/index.ts"}],"name": "takumi/link",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Link","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "List PDF component (takumi)","files": [{@@ -305,200 +311,201 @@"path": "registry/bases/takumi/components/list/list.types.ts","type": "registry:component","target": "components/pdf/list/list.types.ts"- },- {- "path": "registry/bases/takumi/components/list/index.ts",- "type": "registry:component",- "target": "components/pdf/list/index.ts"}],"name": "takumi/list",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "List","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Page Break PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/page-break/page-break.tsx","type": "registry:component","target": "components/pdf/page-break/page-break.tsx"- },- {- "path": "registry/bases/takumi/components/page-break/index.ts",- "type": "registry:component",- "target": "components/pdf/page-break/index.ts"}],"name": "takumi/page-break",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Page Break","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Page Footer PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/page-footer/page-footer.tsx","type": "registry:component","target": "components/pdf/page-footer/page-footer.tsx"- },- {- "path": "registry/bases/takumi/components/page-footer/index.ts",- "type": "registry:component",- "target": "components/pdf/page-footer/index.ts"}],"name": "takumi/page-footer",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Page Footer","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Page Header PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/page-header/page-header.tsx","type": "registry:component","target": "components/pdf/page-header/page-header.tsx"- },- {- "path": "registry/bases/takumi/components/page-header/index.ts",- "type": "registry:component",- "target": "components/pdf/page-header/index.ts"}],"name": "takumi/page-header",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Page Header","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Page Number PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/page-number/page-number.tsx","type": "registry:component","target": "components/pdf/page-number/page-number.tsx"- },- {- "path": "registry/bases/takumi/components/page-number/index.ts",- "type": "registry:component",- "target": "components/pdf/page-number/index.ts"}],"name": "takumi/page-number",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Page Number","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Pdf Image PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/pdf-image/pdf-image.tsx","type": "registry:component","target": "components/pdf/pdf-image/pdf-image.tsx"- },- {- "path": "registry/bases/takumi/components/pdf-image/index.ts",- "type": "registry:component",- "target": "components/pdf/pdf-image/index.ts"}],"name": "takumi/pdf-image",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Pdf Image","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers", "qrcode"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers",+ "qrcode"+ ],"description": "Qrcode PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/qrcode/qrcode.tsx","type": "registry:component","target": "components/pdf/qrcode/qrcode.tsx"- },- {- "path": "registry/bases/takumi/components/qrcode/index.ts",- "type": "registry:component",- "target": "components/pdf/qrcode/index.ts"}],"name": "takumi/qrcode",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Qrcode","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Section PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/section/section.tsx","type": "registry:component","target": "components/pdf/section/section.tsx"- },- {- "path": "registry/bases/takumi/components/section/index.ts",- "type": "registry:component",- "target": "components/pdf/section/index.ts"}],"name": "takumi/section",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Section","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Signature PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/signature/signature.tsx","type": "registry:component","target": "components/pdf/signature/signature.tsx"- },- {- "path": "registry/bases/takumi/components/signature/index.ts",- "type": "registry:component",- "target": "components/pdf/signature/index.ts"}],"name": "takumi/signature",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Signature","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Stack PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/stack/stack.tsx","type": "registry:component","target": "components/pdf/stack/stack.tsx"- },- {- "path": "registry/bases/takumi/components/stack/index.ts",- "type": "registry:component",- "target": "components/pdf/stack/index.ts"}],"name": "takumi/stack",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Stack","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Table PDF component (takumi)","files": [{@@ -515,60 +522,60 @@"path": "registry/bases/takumi/components/table/table.types.ts","type": "registry:component","target": "components/pdf/table/table.types.ts"- },- {- "path": "registry/bases/takumi/components/table/index.ts",- "type": "registry:component",- "target": "components/pdf/table/index.ts"}],"name": "takumi/table",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Table","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Text PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/text/text.tsx","type": "registry:component","target": "components/pdf/text/text.tsx"- },- {- "path": "registry/bases/takumi/components/text/index.ts",- "type": "registry:component",- "target": "components/pdf/text/index.ts"}],"name": "takumi/text",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Text","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Watermark PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/watermark/watermark.tsx","type": "registry:component","target": "components/pdf/watermark/watermark.tsx"- },- {- "path": "registry/bases/takumi/components/watermark/index.ts",- "type": "registry:component",- "target": "components/pdf/watermark/index.ts"}],"name": "takumi/watermark",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils"+ ],"title": "Watermark","type": "registry:ui"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Invoice Classic PDF block (takumi)","files": [{@@ -583,12 +590,24 @@}],"name": "takumi/invoice-classic",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/pdf-image",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/table",+ "@pdfcn/takumi/text"+ ],"title": "Invoice Classic","type": "registry:block"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Invoice Consultant PDF block (takumi)","files": [{@@ -603,12 +622,22 @@}],"name": "takumi/invoice-consultant",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/table",+ "@pdfcn/takumi/text"+ ],"title": "Invoice Consultant","type": "registry:block"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Invoice Corporate PDF block (takumi)","files": [{@@ -623,12 +652,23 @@}],"name": "takumi/invoice-corporate",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/pdf-image",+ "@pdfcn/takumi/table",+ "@pdfcn/takumi/text"+ ],"title": "Invoice Corporate","type": "registry:block"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Invoice Creative PDF block (takumi)","files": [{@@ -643,12 +683,23 @@}],"name": "takumi/invoice-creative",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/table",+ "@pdfcn/takumi/text"+ ],"title": "Invoice Creative","type": "registry:block"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Invoice Minimal PDF block (takumi)","files": [{@@ -663,12 +714,23 @@}],"name": "takumi/invoice-minimal",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/table",+ "@pdfcn/takumi/text"+ ],"title": "Invoice Minimal","type": "registry:block"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Invoice Modern PDF block (takumi)","files": [{@@ -683,12 +745,23 @@}],"name": "takumi/invoice-modern",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/table",+ "@pdfcn/takumi/text"+ ],"title": "Invoice Modern","type": "registry:block"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Report Financial PDF block (takumi)","files": [{@@ -708,12 +781,26 @@}],"name": "takumi/report-financial",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/badge",+ "@pdfcn/takumi/data-table",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/graph",+ "@pdfcn/takumi/list",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/text"+ ],"title": "Report Financial","type": "registry:block"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Report Marketing PDF block (takumi)","files": [{@@ -733,12 +820,26 @@}],"name": "takumi/report-marketing",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/badge",+ "@pdfcn/takumi/data-table",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/graph",+ "@pdfcn/takumi/list",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/text"+ ],"title": "Report Marketing","type": "registry:block"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Report Operations PDF block (takumi)","files": [{@@ -758,12 +859,26 @@}],"name": "takumi/report-operations",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/badge",+ "@pdfcn/takumi/data-table",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/graph",+ "@pdfcn/takumi/list",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/text"+ ],"title": "Report Operations","type": "registry:block"},{- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Report Security PDF block (takumi)","files": [{@@ -783,7 +898,18 @@}],"name": "takumi/report-security",- "registryDependencies": ["takumi/utils"],+ "registryDependencies": [+ "@pdfcn/takumi/utils",+ "@pdfcn/takumi/badge",+ "@pdfcn/takumi/data-table",+ "@pdfcn/takumi/key-value",+ "@pdfcn/takumi/page-footer",+ "@pdfcn/takumi/page-header",+ "@pdfcn/takumi/graph",+ "@pdfcn/takumi/list",+ "@pdfcn/takumi/section",+ "@pdfcn/takumi/text"+ ],"title": "Report Security","type": "registry:block"},@@ -1040,7 +1166,10 @@"type": "registry:theme"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Theme context and helpers for the forme base","files": [{@@ -1071,71 +1200,73 @@],"name": "forme/utils","title": "Forme Utils",- "type": "registry:lib",- "registryDependencies": ["forme/theme-provider"]+ "type": "registry:lib"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Alert PDF component (forme)","files": [{"path": "registry/bases/forme/components/alert/alert.tsx","type": "registry:component","target": "components/pdf/alert/alert.tsx"- },- {- "path": "registry/bases/forme/components/alert/index.ts",- "type": "registry:component",- "target": "components/pdf/alert/index.ts"}],"name": "forme/alert",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Alert","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Badge PDF component (forme)","files": [{"path": "registry/bases/forme/components/badge/badge.tsx","type": "registry:component","target": "components/pdf/badge/badge.tsx"- },- {- "path": "registry/bases/forme/components/badge/index.ts",- "type": "registry:component",- "target": "components/pdf/badge/index.ts"}],"name": "forme/badge",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Badge","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Card PDF component (forme)","files": [{"path": "registry/bases/forme/components/card/card.tsx","type": "registry:component","target": "components/pdf/card/card.tsx"- },- {- "path": "registry/bases/forme/components/card/index.ts",- "type": "registry:component",- "target": "components/pdf/card/index.ts"}],"name": "forme/card",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Card","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Data Table PDF component (forme)","files": [{@@ -1152,40 +1283,41 @@"path": "registry/bases/forme/components/data-table/data-table.types.ts","type": "registry:component","target": "components/pdf/data-table/data-table.types.ts"- },- {- "path": "registry/bases/forme/components/data-table/index.ts",- "type": "registry:component",- "target": "components/pdf/data-table/index.ts"}],"name": "forme/data-table",- "registryDependencies": ["forme/utils", "forme/table"],+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/table"+ ],"title": "Data Table","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Divider PDF component (forme)","files": [{"path": "registry/bases/forme/components/divider/divider.tsx","type": "registry:component","target": "components/pdf/divider/divider.tsx"- },- {- "path": "registry/bases/forme/components/divider/index.ts",- "type": "registry:component",- "target": "components/pdf/divider/index.ts"}],"name": "forme/divider",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Divider","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Form PDF component (forme)","files": [{@@ -1202,20 +1334,20 @@"path": "registry/bases/forme/components/form/form.types.ts","type": "registry:component","target": "components/pdf/form/form.types.ts"- },- {- "path": "registry/bases/forme/components/form/index.ts",- "type": "registry:component",- "target": "components/pdf/form/index.ts"}],"name": "forme/form",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Form","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Graph PDF component (forme)","files": [{@@ -1237,100 +1369,100 @@"path": "registry/bases/forme/components/graph/graph.utils.ts","type": "registry:component","target": "components/pdf/graph/graph.utils.ts"- },- {- "path": "registry/bases/forme/components/graph/index.ts",- "type": "registry:component",- "target": "components/pdf/graph/index.ts"}],"name": "forme/graph",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Graph","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Heading PDF component (forme)","files": [{"path": "registry/bases/forme/components/heading/heading.tsx","type": "registry:component","target": "components/pdf/heading/heading.tsx"- },- {- "path": "registry/bases/forme/components/heading/index.ts",- "type": "registry:component",- "target": "components/pdf/heading/index.ts"}],"name": "forme/heading",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Heading","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Keep Together PDF component (forme)","files": [{"path": "registry/bases/forme/components/keep-together/keep-together.tsx","type": "registry:component","target": "components/pdf/keep-together/keep-together.tsx"- },- {- "path": "registry/bases/forme/components/keep-together/index.ts",- "type": "registry:component",- "target": "components/pdf/keep-together/index.ts"}],"name": "forme/keep-together",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Keep Together","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Key Value PDF component (forme)","files": [{"path": "registry/bases/forme/components/key-value/key-value.tsx","type": "registry:component","target": "components/pdf/key-value/key-value.tsx"- },- {- "path": "registry/bases/forme/components/key-value/index.ts",- "type": "registry:component",- "target": "components/pdf/key-value/index.ts"}],"name": "forme/key-value",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Key Value","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Link PDF component (forme)","files": [{"path": "registry/bases/forme/components/link/link.tsx","type": "registry:component","target": "components/pdf/link/link.tsx"- },- {- "path": "registry/bases/forme/components/link/index.ts",- "type": "registry:component",- "target": "components/pdf/link/index.ts"}],"name": "forme/link",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Link","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "List PDF component (forme)","files": [{@@ -1347,200 +1479,201 @@"path": "registry/bases/forme/components/list/list.types.ts","type": "registry:component","target": "components/pdf/list/list.types.ts"- },- {- "path": "registry/bases/forme/components/list/index.ts",- "type": "registry:component",- "target": "components/pdf/list/index.ts"}],"name": "forme/list",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "List","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Page Break PDF component (forme)","files": [{"path": "registry/bases/forme/components/page-break/page-break.tsx","type": "registry:component","target": "components/pdf/page-break/page-break.tsx"- },- {- "path": "registry/bases/forme/components/page-break/index.ts",- "type": "registry:component",- "target": "components/pdf/page-break/index.ts"}],"name": "forme/page-break",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Page Break","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Page Footer PDF component (forme)","files": [{"path": "registry/bases/forme/components/page-footer/page-footer.tsx","type": "registry:component","target": "components/pdf/page-footer/page-footer.tsx"- },- {- "path": "registry/bases/forme/components/page-footer/index.ts",- "type": "registry:component",- "target": "components/pdf/page-footer/index.ts"}],"name": "forme/page-footer",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Page Footer","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Page Header PDF component (forme)","files": [{"path": "registry/bases/forme/components/page-header/page-header.tsx","type": "registry:component","target": "components/pdf/page-header/page-header.tsx"- },- {- "path": "registry/bases/forme/components/page-header/index.ts",- "type": "registry:component",- "target": "components/pdf/page-header/index.ts"}],"name": "forme/page-header",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Page Header","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Page Number PDF component (forme)","files": [{"path": "registry/bases/forme/components/page-number/page-number.tsx","type": "registry:component","target": "components/pdf/page-number/page-number.tsx"- },- {- "path": "registry/bases/forme/components/page-number/index.ts",- "type": "registry:component",- "target": "components/pdf/page-number/index.ts"}],"name": "forme/page-number",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Page Number","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Pdf Image PDF component (forme)","files": [{"path": "registry/bases/forme/components/pdf-image/pdf-image.tsx","type": "registry:component","target": "components/pdf/pdf-image/pdf-image.tsx"- },- {- "path": "registry/bases/forme/components/pdf-image/index.ts",- "type": "registry:component",- "target": "components/pdf/pdf-image/index.ts"}],"name": "forme/pdf-image",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Pdf Image","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core", "qrcode"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core",+ "qrcode"+ ],"description": "Qrcode PDF component (forme)","files": [{"path": "registry/bases/forme/components/qrcode/qrcode.tsx","type": "registry:component","target": "components/pdf/qrcode/qrcode.tsx"- },- {- "path": "registry/bases/forme/components/qrcode/index.ts",- "type": "registry:component",- "target": "components/pdf/qrcode/index.ts"}],"name": "forme/qrcode",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Qrcode","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Section PDF component (forme)","files": [{"path": "registry/bases/forme/components/section/section.tsx","type": "registry:component","target": "components/pdf/section/section.tsx"- },- {- "path": "registry/bases/forme/components/section/index.ts",- "type": "registry:component",- "target": "components/pdf/section/index.ts"}],"name": "forme/section",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Section","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Signature PDF component (forme)","files": [{"path": "registry/bases/forme/components/signature/signature.tsx","type": "registry:component","target": "components/pdf/signature/signature.tsx"- },- {- "path": "registry/bases/forme/components/signature/index.ts",- "type": "registry:component",- "target": "components/pdf/signature/index.ts"}],"name": "forme/signature",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Signature","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Stack PDF component (forme)","files": [{"path": "registry/bases/forme/components/stack/stack.tsx","type": "registry:component","target": "components/pdf/stack/stack.tsx"- },- {- "path": "registry/bases/forme/components/stack/index.ts",- "type": "registry:component",- "target": "components/pdf/stack/index.ts"}],"name": "forme/stack",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Stack","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Table PDF component (forme)","files": [{@@ -1557,60 +1690,60 @@"path": "registry/bases/forme/components/table/table.types.ts","type": "registry:component","target": "components/pdf/table/table.types.ts"- },- {- "path": "registry/bases/forme/components/table/index.ts",- "type": "registry:component",- "target": "components/pdf/table/index.ts"}],"name": "forme/table",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Table","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Text PDF component (forme)","files": [{"path": "registry/bases/forme/components/text/text.tsx","type": "registry:component","target": "components/pdf/text/text.tsx"- },- {- "path": "registry/bases/forme/components/text/index.ts",- "type": "registry:component",- "target": "components/pdf/text/index.ts"}],"name": "forme/text",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Text","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Watermark PDF component (forme)","files": [{"path": "registry/bases/forme/components/watermark/watermark.tsx","type": "registry:component","target": "components/pdf/watermark/watermark.tsx"- },- {- "path": "registry/bases/forme/components/watermark/index.ts",- "type": "registry:component",- "target": "components/pdf/watermark/index.ts"}],"name": "forme/watermark",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils"+ ],"title": "Watermark","type": "registry:ui"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Invoice Classic PDF block (forme)","files": [{@@ -1625,12 +1758,24 @@}],"name": "forme/invoice-classic",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/pdf-image",+ "@pdfcn/forme/section",+ "@pdfcn/forme/table",+ "@pdfcn/forme/text"+ ],"title": "Invoice Classic","type": "registry:block"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Invoice Consultant PDF block (forme)","files": [{@@ -1645,12 +1790,22 @@}],"name": "forme/invoice-consultant",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/section",+ "@pdfcn/forme/table",+ "@pdfcn/forme/text"+ ],"title": "Invoice Consultant","type": "registry:block"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Invoice Corporate PDF block (forme)","files": [{@@ -1665,12 +1820,23 @@}],"name": "forme/invoice-corporate",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/pdf-image",+ "@pdfcn/forme/table",+ "@pdfcn/forme/text"+ ],"title": "Invoice Corporate","type": "registry:block"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Invoice Creative PDF block (forme)","files": [{@@ -1685,12 +1851,23 @@}],"name": "forme/invoice-creative",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/section",+ "@pdfcn/forme/table",+ "@pdfcn/forme/text"+ ],"title": "Invoice Creative","type": "registry:block"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Invoice Minimal PDF block (forme)","files": [{@@ -1705,12 +1882,23 @@}],"name": "forme/invoice-minimal",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/section",+ "@pdfcn/forme/table",+ "@pdfcn/forme/text"+ ],"title": "Invoice Minimal","type": "registry:block"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Invoice Modern PDF block (forme)","files": [{@@ -1725,12 +1913,23 @@}],"name": "forme/invoice-modern",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/section",+ "@pdfcn/forme/table",+ "@pdfcn/forme/text"+ ],"title": "Invoice Modern","type": "registry:block"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Report Financial PDF block (forme)","files": [{@@ -1750,12 +1949,26 @@}],"name": "forme/report-financial",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/badge",+ "@pdfcn/forme/data-table",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/graph",+ "@pdfcn/forme/list",+ "@pdfcn/forme/section",+ "@pdfcn/forme/text"+ ],"title": "Report Financial","type": "registry:block"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Report Marketing PDF block (forme)","files": [{@@ -1775,12 +1988,26 @@}],"name": "forme/report-marketing",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/badge",+ "@pdfcn/forme/data-table",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/graph",+ "@pdfcn/forme/list",+ "@pdfcn/forme/section",+ "@pdfcn/forme/text"+ ],"title": "Report Marketing","type": "registry:block"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Report Operations PDF block (forme)","files": [{@@ -1800,12 +2027,26 @@}],"name": "forme/report-operations",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/badge",+ "@pdfcn/forme/data-table",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/graph",+ "@pdfcn/forme/list",+ "@pdfcn/forme/section",+ "@pdfcn/forme/text"+ ],"title": "Report Operations","type": "registry:block"},{- "dependencies": ["@formepdf/react", "@formepdf/core"],+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Report Security PDF block (forme)","files": [{@@ -1825,10 +2066,21 @@}],"name": "forme/report-security",- "registryDependencies": ["forme/utils"],+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/badge",+ "@pdfcn/forme/data-table",+ "@pdfcn/forme/key-value",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/graph",+ "@pdfcn/forme/list",+ "@pdfcn/forme/section",+ "@pdfcn/forme/text"+ ],"title": "Report Security","type": "registry:block"}],"name": "pdfcn"-}+}\ No newline at end of filediff --git a/registry/bases/forme/blocks/invoice-classic/invoice-classic.tsx b/registry/bases/forme/blocks/invoice-classic/invoice-classic.tsxindex 6f2c041..380842d 100644--- a/registry/bases/forme/blocks/invoice-classic/invoice-classic.tsx+++ b/registry/bases/forme/blocks/invoice-classic/invoice-classic.tsx@@ -1,20 +1,19 @@import { Document, Page, StyleSheet, View } from "@formepdf/react";+import { KeyValue } from "@/registry/bases/forme/components/key-value/key-value";+import { PageFooter } from "@/registry/bases/forme/components/page-footer/page-footer";+import { PageHeader } from "@/registry/bases/forme/components/page-header/page-header";+import { PdfImage } from "@/registry/bases/forme/components/pdf-image/pdf-image";+import { Section } from "@/registry/bases/forme/components/section/section";import {- KeyValue,- PageFooter,- PageHeader,- PdfImage,- PdfcnThemeProvider,- Section,Table,TableBody,TableCell,TableHeader,TableRow,- Text,- usePdfcnTheme,-} from "@/registry/bases/forme/components";+} from "@/registry/bases/forme/components/table/table";+import { Text } from "@/registry/bases/forme/components/text/text";+import { PdfcnThemeProvider, usePdfcnTheme } from "@/registry/bases/forme/components/theme-provider";import type { PdfcnTheme } from "@/registry/types/pdf-themes";import type { InvoiceClassicData } from "./invoice-classic.types";diff --git a/registry/bases/forme/blocks/invoice-consultant/invoice-consultant.tsx b/registry/bases/forme/blocks/invoice-consultant/invoice-consultant.tsxindex 512799c..416ddce 100644--- a/registry/bases/forme/blocks/invoice-consultant/invoice-consultant.tsx+++ b/registry/bases/forme/blocks/invoice-consultant/invoice-consultant.tsx@@ -1,18 +1,17 @@import { Document, Page, StyleSheet, View } from "@formepdf/react";+import { KeyValue } from "@/registry/bases/forme/components/key-value/key-value";+import { PageFooter } from "@/registry/bases/forme/components/page-footer/page-footer";+import { Section } from "@/registry/bases/forme/components/section/section";import {- KeyValue,- PageFooter,- PdfcnThemeProvider,- Section,Table,TableBody,TableCell,TableHeader,TableRow,- Text,- usePdfcnTheme,-} from "@/registry/bases/forme/components";+} from "@/registry/bases/forme/components/table/table";+import { Text } from "@/registry/bases/forme/components/text/text";+import { PdfcnThemeProvider, usePdfcnTheme } from "@/registry/bases/forme/components/theme-provider";import type { PdfcnTheme } from "@/registry/types/pdf-themes";import type { InvoiceConsultantData } from "./invoice-consultant.types";diff --git a/registry/bases/forme/blocks/invoice-corporate/invoice-corporate.tsx b/registry/bases/forme/blocks/invoice-corporate/invoice-corporate.tsxindex 56353ce..0717d97 100644--- a/registry/bases/forme/blocks/invoice-corporate/invoice-corporate.tsx+++ b/registry/bases/forme/blocks/invoice-corporate/invoice-corporate.tsx@@ -1,19 +1,18 @@import { Document, Page, StyleSheet, View } from "@formepdf/react";+import { KeyValue } from "@/registry/bases/forme/components/key-value/key-value";+import { PageFooter } from "@/registry/bases/forme/components/page-footer/page-footer";+import { PageHeader } from "@/registry/bases/forme/components/page-header/page-header";+import { PdfImage } from "@/registry/bases/forme/components/pdf-image/pdf-image";import {- KeyValue,- PageFooter,- PageHeader,- PdfImage,- PdfcnThemeProvider,Table,TableBody,TableCell,TableHeader,TableRow,- Text,- usePdfcnTheme,-} from "@/registry/bases/forme/components";+} from "@/registry/bases/forme/components/table/table";+import { Text } from "@/registry/bases/forme/components/text/text";+import { PdfcnThemeProvider, usePdfcnTheme } from "@/registry/bases/forme/components/theme-provider";import type { PdfcnTheme } from "@/registry/types/pdf-themes";import type { InvoiceCorporateData } from "./invoice-corporate.types";diff --git a/registry/bases/forme/blocks/invoice-creative/invoice-creative.tsx b/registry/bases/forme/blocks/invoice-creative/invoice-creative.tsxindex cfdc159..52b6101 100644--- a/registry/bases/forme/blocks/invoice-creative/invoice-creative.tsx+++ b/registry/bases/forme/blocks/invoice-creative/invoice-creative.tsx@@ -1,19 +1,18 @@import { Document, Page, StyleSheet, View } from "@formepdf/react";+import { KeyValue } from "@/registry/bases/forme/components/key-value/key-value";+import { PageFooter } from "@/registry/bases/forme/components/page-footer/page-footer";+import { PageHeader } from "@/registry/bases/forme/components/page-header/page-header";+import { Section } from "@/registry/bases/forme/components/section/section";import {- KeyValue,- PageFooter,- PageHeader,- PdfcnThemeProvider,- Section,Table,TableBody,TableCell,TableHeader,TableRow,- Text,- usePdfcnTheme,-} from "@/registry/bases/forme/components";+} from "@/registry/bases/forme/components/table/table";+import { Text } from "@/registry/bases/forme/components/text/text";+import { PdfcnThemeProvider, usePdfcnTheme } from "@/registry/bases/forme/components/theme-provider";import type { PdfcnTheme } from "@/registry/types/pdf-themes";import type { InvoiceCreativeData } from "./invoice-creative.types";diff --git a/registry/bases/forme/blocks/invoice-minimal/invoice-minimal.tsx b/registry/bases/forme/blocks/invoice-minimal/invoice-minimal.tsxindex a9f0a1a..11546e2 100644--- a/registry/bases/forme/blocks/invoice-minimal/invoice-minimal.tsx+++ b/registry/bases/forme/blocks/invoice-minimal/invoice-minimal.tsx@@ -1,19 +1,18 @@import { Document, Page, StyleSheet, View } from "@formepdf/react";+import { KeyValue } from "@/registry/bases/forme/components/key-value/key-value";+import { PageFooter } from "@/registry/bases/forme/components/page-footer/page-footer";+import { PageHeader } from "@/registry/bases/forme/components/page-header/page-header";+import { Section } from "@/registry/bases/forme/components/section/section";import {- KeyValue,- PageFooter,- PageHeader,- PdfcnThemeProvider,- Section,Table,TableBody,TableCell,TableHeader,TableRow,- Text,- usePdfcnTheme,-} from "@/registry/bases/forme/components";+} from "@/registry/bases/forme/components/table/table";+import { Text } from "@/registry/bases/forme/components/text/text";+import { PdfcnThemeProvider, usePdfcnTheme } from "@/registry/bases/forme/components/theme-provider";import type { PdfcnTheme } from "@/registry/types/pdf-themes";import type { InvoiceMinimalData } from "./invoice-minimal.types";diff --git a/registry/bases/forme/blocks/invoice-modern/invoice-modern.tsx b/registry/bases/forme/blocks/invoice-modern/invoice-modern.tsxindex 435e9af..6084c07 100644--- a/registry/bases/forme/blocks/invoice-modern/invoice-modern.tsx+++ b/registry/bases/forme/blocks/invoice-modern/invoice-modern.tsx@@ -1,19 +1,18 @@import { Document, Page, StyleSheet, View } from "@formepdf/react";+import { KeyValue } from "@/registry/bases/forme/components/key-value/key-value";+import { PageFooter } from "@/registry/bases/forme/components/page-footer/page-footer";+import { PageHeader } from "@/registry/bases/forme/components/page-header/page-header";+import { Section } from "@/registry/bases/forme/components/section/section";import {- KeyValue,- PageFooter,- PageHeader,- PdfcnThemeProvider,- Section,Table,TableBody,TableCell,TableHeader,TableRow,- Text,- usePdfcnTheme,-} from "@/registry/bases/forme/components";+} from "@/registry/bases/forme/components/table/table";+import { Text } from "@/registry/bases/forme/components/text/text";+import { PdfcnThemeProvider, usePdfcnTheme } from "@/registry/bases/forme/components/theme-provider";import type { PdfcnTheme } from "@/registry/types/pdf-themes";import type { InvoiceModernData } from "./invoice-modern.types";diff --git a/registry/bases/forme/blocks/report-financial/report-layout.tsx b/registry/bases/forme/blocks/report-financial/report-layout.tsxindex 49e727c..b480b0a 100644--- a/registry/bases/forme/blocks/report-financial/report-layout.tsx+++ b/registry/bases/forme/blocks/report-financial/report-layout.tsx@@ -1,18 +1,15 @@import { Document, Page, StyleSheet, View } from "@formepdf/react";-import {- Badge,- DataTable,- KeyValue,- PageFooter,- PageHeader,- PdfGraph,- PdfList,- PdfcnThemeProvider,- Section,- Text,- usePdfcnTheme,-} from "@/registry/bases/forme/components";+import { Badge } from "@/registry/bases/forme/components/badge/badge";+import { DataTable } from "@/registry/bases/forme/components/data-table/data-table";+import { PdfGraph } from "@/registry/bases/forme/components/graph/graph";+import { KeyValue } from "@/registry/bases/forme/components/key-value/key-value";+import { PdfList } from "@/registry/bases/forme/components/list/list";+import { PageFooter } from "@/registry/bases/forme/components/page-footer/page-footer";+import { PageHeader } from "@/registry/bases/forme/components/page-header/page-header";+import { Section } from "@/registry/bases/forme/components/section/section";+import { Text } from "@/registry/bases/forme/components/text/text";+import { PdfcnThemeProvider, usePdfcnTheme } from "@/registry/bases/forme/components/theme-provider";import type { PdfcnTheme } from "@/registry/types/pdf-themes";import type { BaseReportData } from "./report.types";diff --git a/registry/bases/forme/blocks/report-marketing/report-layout.tsx b/registry/bases/forme/blocks/report-marketing/report-layout.tsxindex 49e727c..b480b0a 100644--- a/registry/bases/forme/blocks/report-marketing/report-layout.tsx+++ b/registry/bases/forme/blocks/report-marketing/report-layout.tsx@@ -1,18 +1,15 @@import { Document, Page, StyleSheet, View } from "@formepdf/react";-import {- Badge,- DataTable,- KeyValue,- PageFooter,- PageHeader,- PdfGraph,- PdfList,- PdfcnThemeProvider,- Section,- Text,- usePdfcnTheme,-} from "@/registry/bases/forme/components";+import { Badge } from "@/registry/bases/forme/components/badge/badge";+import { DataTable } from "@/registry/bases/forme/components/data-table/data-table";+import { PdfGraph } from "@/registry/bases/forme/components/graph/graph";+import { KeyValue } from "@/registry/bases/forme/components/key-value/key-value";+import { PdfList } from "@/registry/bases/forme/components/list/list";+import { PageFooter } from "@/registry/bases/forme/components/page-footer/page-footer";+import { PageHeader } from "@/registry/bases/forme/components/page-header/page-header";+import { Section } from "@/registry/bases/forme/components/section/section";+import { Text } from "@/registry/bases/forme/components/text/text";+import { PdfcnThemeProvider, usePdfcnTheme } from "@/registry/bases/forme/components/theme-provider";import type { PdfcnTheme } from "@/registry/types/pdf-themes";import type { BaseReportData } from "./report.types";diff --git a/registry/bases/forme/blocks/report-operations/report-layout.tsx b/registry/bases/forme/blocks/report-operations/report-layout.tsxindex 49e727c..b480b0a 100644--- a/registry/bases/forme/blocks/report-operations/report-layout.tsx+++ b/registry/bases/forme/blocks/report-operations/report-layout.tsx@@ -1,18 +1,15 @@import { Document, Page, StyleSheet, View } from "@formepdf/react";-import {- Badge,- DataTable,- KeyValue,- PageFooter,- PageHeader,- PdfGraph,- PdfList,- PdfcnThemeProvider,- Section,- Text,- usePdfcnTheme,-} from "@/registry/bases/forme/components";+import { Badge } from "@/registry/bases/forme/components/badge/badge";+import { DataTable } from "@/registry/bases/forme/components/data-table/data-table";+import { PdfGraph } from "@/registry/bases/forme/components/graph/graph";+import { KeyValue } from "@/registry/bases/forme/components/key-value/key-value";+import { PdfList } from "@/registry/bases/forme/components/list/list";+import { PageFooter } from "@/registry/bases/forme/components/page-footer/page-footer";+import { PageHeader } from "@/registry/bases/forme/components/page-header/page-header";+import { Section } from "@/registry/bases/forme/components/section/section";+import { Text } from "@/registry/bases/forme/components/text/text";+import { PdfcnThemeProvider, usePdfcnTheme } from "@/registry/bases/forme/components/theme-provider";import type { PdfcnTheme } from "@/registry/types/pdf-themes";import type { BaseReportData } from "./report.types";diff --git a/registry/bases/forme/blocks/report-security/report-layout.tsx b/registry/bases/forme/blocks/report-security/report-layout.tsxindex 49e727c..b480b0a 100644--- a/registry/bases/forme/blocks/report-security/report-layout.tsx+++ b/registry/bases/forme/blocks/report-security/report-layout.tsx@@ -1,18 +1,15 @@import { Document, Page, StyleSheet, View } from "@formepdf/react";-import {- Badge,- DataTable,- KeyValue,- PageFooter,- PageHeader,- PdfGraph,- PdfList,- PdfcnThemeProvider,- Section,- Text,- usePdfcnTheme,-} from "@/registry/bases/forme/components";+import { Badge } from "@/registry/bases/forme/components/badge/badge";+import { DataTable } from "@/registry/bases/forme/components/data-table/data-table";+import { PdfGraph } from "@/registry/bases/forme/components/graph/graph";+import { KeyValue } from "@/registry/bases/forme/components/key-value/key-value";+import { PdfList } from "@/registry/bases/forme/components/list/list";+import { PageFooter } from "@/registry/bases/forme/components/page-footer/page-footer";+import { PageHeader } from "@/registry/bases/forme/components/page-header/page-header";+import { Section } from "@/registry/bases/forme/components/section/section";+import { Text } from "@/registry/bases/forme/components/text/text";+import { PdfcnThemeProvider, usePdfcnTheme } from "@/registry/bases/forme/components/theme-provider";import type { PdfcnTheme } from "@/registry/types/pdf-themes";import type { BaseReportData } from "./report.types";diff --git a/registry/bases/forme/components/alert/index.ts b/registry/bases/forme/components/alert/index.tsdeleted file mode 100644index 9961c94..0000000--- a/registry/bases/forme/components/alert/index.ts+++ /dev/null@@ -1 +0,0 @@-export { PdfAlert, type PdfAlertProps, type AlertVariant } from "./alert";diff --git a/registry/bases/forme/components/badge/index.ts b/registry/bases/forme/components/badge/index.tsdeleted file mode 100644index 2ae6ef6..0000000--- a/registry/bases/forme/components/badge/index.ts+++ /dev/null@@ -1,6 +0,0 @@-export {- Badge,- type BadgeProps,- type BadgeVariant,- type BadgeSize,-} from "./badge";diff --git a/registry/bases/forme/components/card/index.ts b/registry/bases/forme/components/card/index.tsdeleted file mode 100644index 17f5fea..0000000--- a/registry/bases/forme/components/card/index.ts+++ /dev/null@@ -1 +0,0 @@-export { PdfCard, type PdfCardProps, type CardVariant } from "./card";diff --git a/registry/bases/forme/components/data-table/data-table.tsx b/registry/bases/forme/components/data-table/data-table.tsxindex 6a0ca9e..b05d5a6 100644--- a/registry/bases/forme/components/data-table/data-table.tsx+++ b/registry/bases/forme/components/data-table/data-table.tsx@@ -7,7 +7,7 @@ import {TableFooter,TableHeader,TableRow,-} from "@/registry/bases/forme/components/table";+} from "@/registry/bases/forme/components/table/table";import {usePdfcnTheme,useSafeMemo,diff --git a/registry/bases/forme/components/data-table/index.ts b/registry/bases/forme/components/data-table/index.tsdeleted file mode 100644index e34f14d..0000000--- a/registry/bases/forme/components/data-table/index.ts+++ /dev/null@@ -1,6 +0,0 @@-export { DataTable } from "./data-table";-export type {- DataTableProps,- DataTableColumn,- DataTableSize,-} from "./data-table.types";diff --git a/registry/bases/forme/components/divider/index.ts b/registry/bases/forme/components/divider/index.tsdeleted file mode 100644index 6a4d5ec..0000000--- a/registry/bases/forme/components/divider/index.ts+++ /dev/null@@ -1,7 +0,0 @@-export {- Divider,- type DividerProps,- type DividerVariant,- type DividerThickness,- type DividerSpacing,-} from "./divider";diff --git a/registry/bases/forme/components/form/index.ts b/registry/bases/forme/components/form/index.tsdeleted file mode 100644index e968b85..0000000--- a/registry/bases/forme/components/form/index.ts+++ /dev/null@@ -1,9 +0,0 @@-export { PdfForm } from "./form";-export type {- PdfFormProps,- PdfFormVariant,- PdfFormField,- PdfFormGroup,- FormLayout,- FormLabelPosition,-} from "./form.types";diff --git a/registry/bases/forme/components/graph/index.ts b/registry/bases/forme/components/graph/index.tsdeleted file mode 100644index a9dd44f..0000000--- a/registry/bases/forme/components/graph/index.ts+++ /dev/null@@ -1,10 +0,0 @@-export { PdfGraph } from "./graph";-export { A4_WIDTH, GRAPH_SAFE_WIDTHS, getGraphWidth } from "./graph.utils";-export type {- GraphDataPoint,- GraphLegendPosition,- GraphProps,- GraphSeries,- GraphVariant,- GraphWidthOptions,-} from "./graph.types";diff --git a/registry/bases/forme/components/heading/index.ts b/registry/bases/forme/components/heading/index.tsdeleted file mode 100644index b31d254..0000000--- a/registry/bases/forme/components/heading/index.ts+++ /dev/null@@ -1,6 +0,0 @@-export {- Heading,- type HeadingProps,- type HeadingWeight,- type HeadingTracking,-} from "./heading";diff --git a/registry/bases/forme/components/index.ts b/registry/bases/forme/components/index.tsdeleted file mode 100644index 64a8fd1..0000000--- a/registry/bases/forme/components/index.ts+++ /dev/null@@ -1,151 +0,0 @@-export type { PDFComponentProps } from "@/registry/types/pdf-components";-export {- Heading,- type HeadingProps,- type HeadingWeight,- type HeadingTracking,-} from "./heading";-export {- Divider,- type DividerProps,- type DividerVariant,- type DividerThickness,- type DividerSpacing,-} from "./divider";-export { PageBreak, type PageBreakProps } from "./page-break";-export {- PdfPageNumber,- type PdfPageNumberProps,- type PageNumberAlign,- type PageNumberSize,-} from "./page-number";-export {- PdfWatermark,- type PdfWatermarkProps,- type WatermarkPosition,-} from "./watermark";-export {- PdfQRCode,- type PdfQRCodeProps,- type QRCodeErrorLevel,-} from "./qrcode";-export { PdfAlert, type PdfAlertProps, type AlertVariant } from "./alert";-export {- Link,- type LinkProps,- type LinkVariant,- type LinkUnderline,-} from "./link";-export {- Text,- type TextProps,- type TextVariant,- type TextWeight,- type TextDecoration,-} from "./text";-export {- Stack,- type StackProps,- type StackGap,- type StackDirection,- type StackAlign,- type StackJustify,-} from "./stack";-export {- Section,- type SectionProps,- type SectionSpacing,- type SectionPadding,- type SectionVariant,-} from "./section";-export {- Table,- TableHeader,- TableBody,- TableFooter,- TableRow,- TableCell,- type TableProps,- type TableSectionProps,- type TableRowProps,- type TableCellProps,- type TableVariant,-} from "./table";-export {- DataTable,- type DataTableProps,- type DataTableColumn,- type DataTableSize,-} from "./data-table";-export {- Badge,- type BadgeProps,- type BadgeVariant,- type BadgeSize,-} from "./badge";-export {- KeyValue,- type KeyValueProps,- type KeyValueEntry,- type KeyValueDirection,- type KeyValueSize,-} from "./key-value";-export {- PageHeader,- type PageHeaderProps,- type PageHeaderVariant,-} from "./page-header";-export {- PageFooter,- type PageFooterProps,- type PageFooterVariant,-} from "./page-footer";-export {- PdfList,- type PdfListProps,- type ListVariant,- type ListItem,-} from "./list";-export { PdfCard, type PdfCardProps, type CardVariant } from "./card";-export {- PdfForm,- type PdfFormProps,- type PdfFormVariant,- type PdfFormField,- type PdfFormGroup,- type FormLayout,- type FormLabelPosition,-} from "./form";-export {- PdfSignatureBlock,- type PdfSignatureBlockProps,- type SignatureVariant,- type SignatureSigner,-} from "./signature";-export { KeepTogether, type KeepTogetherProps } from "./keep-together";-export {- PdfImage,- type PdfImageProps,- type PdfImageSrc,- type PdfImageVariant,- type PdfImageFit,-} from "./pdf-image";-export {- PdfGraph,- getGraphWidth,- A4_WIDTH,- GRAPH_SAFE_WIDTHS,- type GraphProps,- type GraphVariant,- type GraphDataPoint,- type GraphSeries,- type GraphLegendPosition,- type GraphWidthOptions,-} from "./graph";--export {- PdfcnThemeProvider,- usePdfcnTheme,- useSafeMemo,-} from "@/registry/bases/forme/components/theme-provider";-export type { PdfcnTheme } from "@/registry/types/pdf-themes";diff --git a/registry/bases/forme/components/keep-together/index.ts b/registry/bases/forme/components/keep-together/index.tsdeleted file mode 100644index b111cfb..0000000--- a/registry/bases/forme/components/keep-together/index.ts+++ /dev/null@@ -1 +0,0 @@-export { KeepTogether, type KeepTogetherProps } from "./keep-together";diff --git a/registry/bases/forme/components/key-value/index.ts b/registry/bases/forme/components/key-value/index.tsdeleted file mode 100644index 59d9c39..0000000--- a/registry/bases/forme/components/key-value/index.ts+++ /dev/null@@ -1,7 +0,0 @@-export {- KeyValue,- type KeyValueProps,- type KeyValueEntry,- type KeyValueDirection,- type KeyValueSize,-} from "./key-value";diff --git a/registry/bases/forme/components/link/index.ts b/registry/bases/forme/components/link/index.tsdeleted file mode 100644index 22bf1b6..0000000--- a/registry/bases/forme/components/link/index.ts+++ /dev/null@@ -1,6 +0,0 @@-export {- Link,- type LinkProps,- type LinkVariant,- type LinkUnderline,-} from "./link";diff --git a/registry/bases/forme/components/list/index.ts b/registry/bases/forme/components/list/index.tsdeleted file mode 100644index 5535351..0000000--- a/registry/bases/forme/components/list/index.ts+++ /dev/null@@ -1,2 +0,0 @@-export { PdfList } from "./list";-export type { PdfListProps, ListVariant, ListItem } from "./list.types";diff --git a/registry/bases/forme/components/page-break/index.ts b/registry/bases/forme/components/page-break/index.tsdeleted file mode 100644index 174a541..0000000--- a/registry/bases/forme/components/page-break/index.ts+++ /dev/null@@ -1,2 +0,0 @@-export { PageBreak } from "./page-break";-export type { PageBreakProps } from "./page-break";diff --git a/registry/bases/forme/components/page-footer/index.ts b/registry/bases/forme/components/page-footer/index.tsdeleted file mode 100644index f02d612..0000000--- a/registry/bases/forme/components/page-footer/index.ts+++ /dev/null@@ -1,5 +0,0 @@-export {- PageFooter,- type PageFooterProps,- type PageFooterVariant,-} from "./page-footer";diff --git a/registry/bases/forme/components/page-header/index.ts b/registry/bases/forme/components/page-header/index.tsdeleted file mode 100644index 91eaac3..0000000--- a/registry/bases/forme/components/page-header/index.ts+++ /dev/null@@ -1,5 +0,0 @@-export {- PageHeader,- type PageHeaderProps,- type PageHeaderVariant,-} from "./page-header";diff --git a/registry/bases/forme/components/page-number/index.ts b/registry/bases/forme/components/page-number/index.tsdeleted file mode 100644index bef083e..0000000--- a/registry/bases/forme/components/page-number/index.ts+++ /dev/null@@ -1,6 +0,0 @@-export {- PdfPageNumber,- type PdfPageNumberProps,- type PageNumberAlign,- type PageNumberSize,-} from "./page-number";diff --git a/registry/bases/forme/components/pdf-image/index.ts b/registry/bases/forme/components/pdf-image/index.tsdeleted file mode 100644index 826f276..0000000--- a/registry/bases/forme/components/pdf-image/index.ts+++ /dev/null@@ -1,7 +0,0 @@-export {- PdfImage,- type PdfImageProps,- type PdfImageSrc,- type PdfImageVariant,- type PdfImageFit,-} from "./pdf-image";diff --git a/registry/bases/forme/components/qrcode/index.ts b/registry/bases/forme/components/qrcode/index.tsdeleted file mode 100644index b0fac4d..0000000--- a/registry/bases/forme/components/qrcode/index.ts+++ /dev/null@@ -1,5 +0,0 @@-export {- PdfQRCode,- type PdfQRCodeProps,- type QRCodeErrorLevel,-} from "./qrcode";diff --git a/registry/bases/forme/components/section/index.ts b/registry/bases/forme/components/section/index.tsdeleted file mode 100644index 18c2e0f..0000000--- a/registry/bases/forme/components/section/index.ts+++ /dev/null@@ -1,7 +0,0 @@-export {- Section,- type SectionProps,- type SectionSpacing,- type SectionPadding,- type SectionVariant,-} from "./section";diff --git a/registry/bases/forme/components/signature/index.ts b/registry/bases/forme/components/signature/index.tsdeleted file mode 100644index fe7589d..0000000--- a/registry/bases/forme/components/signature/index.ts+++ /dev/null@@ -1,6 +0,0 @@-export {- PdfSignatureBlock,- type PdfSignatureBlockProps,- type SignatureVariant,- type SignatureSigner,-} from "./signature";diff --git a/registry/bases/forme/components/stack/index.ts b/registry/bases/forme/components/stack/index.tsdeleted file mode 100644index 159aa8e..0000000--- a/registry/bases/forme/components/stack/index.ts+++ /dev/null@@ -1,8 +0,0 @@-export {- Stack,- type StackProps,- type StackGap,- type StackDirection,- type StackAlign,- type StackJustify,-} from "./stack";diff --git a/registry/bases/forme/components/table/index.ts b/registry/bases/forme/components/table/index.tsdeleted file mode 100644index edd8ab6..0000000--- a/registry/bases/forme/components/table/index.ts+++ /dev/null@@ -1,15 +0,0 @@-export {- Table,- TableHeader,- TableBody,- TableFooter,- TableRow,- TableCell,-} from "./table";-export type {- TableProps,- TableSectionProps,- TableRowProps,- TableCellProps,- TableVariant,-} from "./table.types";diff --git a/registry/bases/forme/components/text/index.ts b/registry/bases/forme/components/text/index.tsdeleted file mode 100644index 25d1338..0000000--- a/registry/bases/forme/components/text/index.ts+++ /dev/null@@ -1,7 +0,0 @@-export {- Text,- type TextProps,- type TextVariant,- type TextWeight,- type TextDecoration,-} from "./text";diff --git a/registry/bases/forme/components/watermark/index.ts b/registry/bases/forme/components/watermark/index.tsdeleted file mode 100644index f30a740..0000000--- a/registry/bases/forme/components/watermark/index.ts+++ /dev/null@@ -1,5 +0,0 @@-export {- PdfWatermark,- type PdfWatermarkProps,- type WatermarkPosition,-} from "./watermark";diff --git a/registry/bases/takumi/blocks/invoice-classic/invoice-classic.tsx b/registry/bases/takumi/blocks/invoice-classic/invoice-classic.tsxindex 91ba8d1..f35f6c1 100644--- a/registry/bases/takumi/blocks/invoice-classic/invoice-classic.tsx+++ b/registry/bases/takumi/blocks/invoice-classic/invoice-classic.tsx@@ -1,18 +1,11 @@-import {- KeyValue,- PageFooter,- PageHeader,- PdfImage,- PdfcnThemeProvider,- Section,- Table,- TableBody,- TableCell,- TableHeader,- TableRow,- Text,- usePdfcnTheme,-} from "@/registry/bases/takumi/components";+import { KeyValue } from "@/registry/bases/takumi/components/key-value/key-value";+import { PageFooter } from "@/registry/bases/takumi/components/page-footer/page-footer";+import { PageHeader } from "@/registry/bases/takumi/components/page-header/page-header";+import { PdfImage } from "@/registry/bases/takumi/components/pdf-image/pdf-image";+import { Section } from "@/registry/bases/takumi/components/section/section";+import { Table, TableBody, TableCell, TableHeader, TableRow } from "@/registry/bases/takumi/components/table/table";+import { Text } from "@/registry/bases/takumi/components/text/text";+import { PdfcnThemeProvider, usePdfcnTheme } from "@/registry/bases/takumi/components/theme-provider";import {View,StyleSheet,diff --git a/registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.tsx b/registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.tsxindex b47ea46..c0e4120 100644--- a/registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.tsx+++ b/registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.tsx@@ -1,16 +1,9 @@-import {- KeyValue,- PageFooter,- PdfcnThemeProvider,- Section,- Table,- TableBody,- TableCell,- TableHeader,- TableRow,- Text,- usePdfcnTheme,-} from "@/registry/bases/takumi/components";+import { KeyValue } from "@/registry/bases/takumi/components/key-value/key-value";+import { PageFooter } from "@/registry/bases/takumi/components/page-footer/page-footer";+import { Section } from "@/registry/bases/takumi/components/section/section";+import { Table, TableBody, TableCell, TableHeader, TableRow } from "@/registry/bases/takumi/components/table/table";+import { Text } from "@/registry/bases/takumi/components/text/text";+import { PdfcnThemeProvider, usePdfcnTheme } from "@/registry/bases/takumi/components/theme-provider";import {View,StyleSheet,diff --git a/registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.tsx b/registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.tsxindex 4f5d8b7..3515689 100644--- a/registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.tsx+++ b/registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.tsx@@ -1,17 +1,10 @@-import {- KeyValue,- PageFooter,- PageHeader,- PdfImage,- PdfcnThemeProvider,- Table,- TableBody,- TableCell,- TableHeader,- TableRow,- Text,- usePdfcnTheme,-} from "@/registry/bases/takumi/components";+import { KeyValue } from "@/registry/bases/takumi/components/key-value/key-value";+import { PageFooter } from "@/registry/bases/takumi/components/page-footer/page-footer";+import { PageHeader } from "@/registry/bases/takumi/components/page-header/page-header";+import { PdfImage } from "@/registry/bases/takumi/components/pdf-image/pdf-image";+import { Table, TableBody, TableCell, TableHeader, TableRow } from "@/registry/bases/takumi/components/table/table";+import { Text } from "@/registry/bases/takumi/components/text/text";+import { PdfcnThemeProvider, usePdfcnTheme } from "@/registry/bases/takumi/components/theme-provider";import {View,StyleSheet,diff --git a/registry/bases/takumi/blocks/invoice-creative/invoice-creative.tsx b/registry/bases/takumi/blocks/invoice-creative/invoice-creative.tsxindex e2a601d..c9fa6fa 100644--- a/registry/bases/takumi/blocks/invoice-creative/invoice-creative.tsx+++ b/registry/bases/takumi/blocks/invoice-creative/invoice-creative.tsx@@ -1,17 +1,10 @@-import {- KeyValue,- PageFooter,- PageHeader,- PdfcnThemeProvider,- Section,- Table,- TableBody,- TableCell,- TableHeader,- TableRow,- Text,- usePdfcnTheme,-} from "@/registry/bases/takumi/components";+import { KeyValue } from "@/registry/bases/takumi/components/key-value/key-value";+import { PageFooter } from "@/registry/bases/takumi/components/page-footer/page-footer";+import { PageHeader } from "@/registry/bases/takumi/components/page-header/page-header";+import { Section } from "@/registry/bases/takumi/components/section/section";+import { Table, TableBody, TableCell, TableHeader, TableRow } from "@/registry/bases/takumi/components/table/table";+import { Text } from "@/registry/bases/takumi/components/text/text";+import { PdfcnThemeProvider, usePdfcnTheme } from "@/registry/bases/takumi/components/theme-provider";import {View,StyleSheet,diff --git a/registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.tsx b/registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.tsxindex daa3c35..ba5fd5c 100644--- a/registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.tsx+++ b/registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.tsx@@ -1,17 +1,10 @@-import {- KeyValue,- PageFooter,- PageHeader,- PdfcnThemeProvider,- Section,- Table,- TableBody,- TableCell,- TableHeader,- TableRow,- Text,- usePdfcnTheme,-} from "@/registry/bases/takumi/components";+import { KeyValue } from "@/registry/bases/takumi/components/key-value/key-value";+import { PageFooter } from "@/registry/bases/takumi/components/page-footer/page-footer";+import { PageHeader } from "@/registry/bases/takumi/components/page-header/page-header";+import { Section } from "@/registry/bases/takumi/components/section/section";+import { Table, TableBody, TableCell, TableHeader, TableRow } from "@/registry/bases/takumi/components/table/table";+import { Text } from "@/registry/bases/takumi/components/text/text";+import { PdfcnThemeProvider, usePdfcnTheme } from "@/registry/bases/takumi/components/theme-provider";import {View,StyleSheet,diff --git a/registry/bases/takumi/blocks/invoice-modern/invoice-modern.tsx b/registry/bases/takumi/blocks/invoice-modern/invoice-modern.tsxindex 9419c5b..71875db 100644--- a/registry/bases/takumi/blocks/invoice-modern/invoice-modern.tsx+++ b/registry/bases/takumi/blocks/invoice-modern/invoice-modern.tsx@@ -1,17 +1,10 @@-import {- KeyValue,- PageFooter,- PageHeader,- PdfcnThemeProvider,- Section,- Table,- TableBody,- TableCell,- TableHeader,- TableRow,- Text,- usePdfcnTheme,-} from "@/registry/bases/takumi/components";+import { KeyValue } from "@/registry/bases/takumi/components/key-value/key-value";+import { PageFooter } from "@/registry/bases/takumi/components/page-footer/page-footer";+import { PageHeader } from "@/registry/bases/takumi/components/page-header/page-header";+import { Section } from "@/registry/bases/takumi/components/section/section";+import { Table, TableBody, TableCell, TableHeader, TableRow } from "@/registry/bases/takumi/components/table/table";+import { Text } from "@/registry/bases/takumi/components/text/text";+import { PdfcnThemeProvider, usePdfcnTheme } from "@/registry/bases/takumi/components/theme-provider";import {View,StyleSheet,diff --git a/registry/bases/takumi/blocks/report-financial/report-layout.tsx b/registry/bases/takumi/blocks/report-financial/report-layout.tsxindex 18b778d..c3fcbd2 100644--- a/registry/bases/takumi/blocks/report-financial/report-layout.tsx+++ b/registry/bases/takumi/blocks/report-financial/report-layout.tsx@@ -1,16 +1,13 @@-import {- Badge,- DataTable,- KeyValue,- PageFooter,- PageHeader,- PdfGraph,- PdfList,- PdfcnThemeProvider,- Section,- Text,- usePdfcnTheme,-} from "@/registry/bases/takumi/components";+import { Badge } from "@/registry/bases/takumi/components/badge/badge";+import { DataTable } from "@/registry/bases/takumi/components/data-table/data-table";+import { PdfGraph } from "@/registry/bases/takumi/components/graph/graph";+import { KeyValue } from "@/registry/bases/takumi/components/key-value/key-value";+import { PdfList } from "@/registry/bases/takumi/components/list/list";+import { PageFooter } from "@/registry/bases/takumi/components/page-footer/page-footer";+import { PageHeader } from "@/registry/bases/takumi/components/page-header/page-header";+import { Section } from "@/registry/bases/takumi/components/section/section";+import { Text } from "@/registry/bases/takumi/components/text/text";+import { PdfcnThemeProvider, usePdfcnTheme } from "@/registry/bases/takumi/components/theme-provider";import {View,StyleSheet,diff --git a/registry/bases/takumi/blocks/report-marketing/report-layout.tsx b/registry/bases/takumi/blocks/report-marketing/report-layout.tsxindex 18b778d..c3fcbd2 100644--- a/registry/bases/takumi/blocks/report-marketing/report-layout.tsx+++ b/registry/bases/takumi/blocks/report-marketing/report-layout.tsx@@ -1,16 +1,13 @@-import {- Badge,- DataTable,- KeyValue,- PageFooter,- PageHeader,- PdfGraph,- PdfList,- PdfcnThemeProvider,- Section,- Text,- usePdfcnTheme,-} from "@/registry/bases/takumi/components";+import { Badge } from "@/registry/bases/takumi/components/badge/badge";+import { DataTable } from "@/registry/bases/takumi/components/data-table/data-table";+import { PdfGraph } from "@/registry/bases/takumi/components/graph/graph";+import { KeyValue } from "@/registry/bases/takumi/components/key-value/key-value";+import { PdfList } from "@/registry/bases/takumi/components/list/list";+import { PageFooter } from "@/registry/bases/takumi/components/page-footer/page-footer";+import { PageHeader } from "@/registry/bases/takumi/components/page-header/page-header";+import { Section } from "@/registry/bases/takumi/components/section/section";+import { Text } from "@/registry/bases/takumi/components/text/text";+import { PdfcnThemeProvider, usePdfcnTheme } from "@/registry/bases/takumi/components/theme-provider";import {View,StyleSheet,diff --git a/registry/bases/takumi/blocks/report-operations/report-layout.tsx b/registry/bases/takumi/blocks/report-operations/report-layout.tsxindex 18b778d..c3fcbd2 100644--- a/registry/bases/takumi/blocks/report-operations/report-layout.tsx+++ b/registry/bases/takumi/blocks/report-operations/report-layout.tsx@@ -1,16 +1,13 @@-import {- Badge,- DataTable,- KeyValue,- PageFooter,- PageHeader,- PdfGraph,- PdfList,- PdfcnThemeProvider,- Section,- Text,- usePdfcnTheme,-} from "@/registry/bases/takumi/components";+import { Badge } from "@/registry/bases/takumi/components/badge/badge";+import { DataTable } from "@/registry/bases/takumi/components/data-table/data-table";+import { PdfGraph } from "@/registry/bases/takumi/components/graph/graph";+import { KeyValue } from "@/registry/bases/takumi/components/key-value/key-value";+import { PdfList } from "@/registry/bases/takumi/components/list/list";+import { PageFooter } from "@/registry/bases/takumi/components/page-footer/page-footer";+import { PageHeader } from "@/registry/bases/takumi/components/page-header/page-header";+import { Section } from "@/registry/bases/takumi/components/section/section";+import { Text } from "@/registry/bases/takumi/components/text/text";+import { PdfcnThemeProvider, usePdfcnTheme } from "@/registry/bases/takumi/components/theme-provider";import {View,StyleSheet,diff --git a/registry/bases/takumi/blocks/report-security/report-layout.tsx b/registry/bases/takumi/blocks/report-security/report-layout.tsxindex 18b778d..c3fcbd2 100644--- a/registry/bases/takumi/blocks/report-security/report-layout.tsx+++ b/registry/bases/takumi/blocks/report-security/report-layout.tsx@@ -1,16 +1,13 @@-import {- Badge,- DataTable,- KeyValue,- PageFooter,- PageHeader,- PdfGraph,- PdfList,- PdfcnThemeProvider,- Section,- Text,- usePdfcnTheme,-} from "@/registry/bases/takumi/components";+import { Badge } from "@/registry/bases/takumi/components/badge/badge";+import { DataTable } from "@/registry/bases/takumi/components/data-table/data-table";+import { PdfGraph } from "@/registry/bases/takumi/components/graph/graph";+import { KeyValue } from "@/registry/bases/takumi/components/key-value/key-value";+import { PdfList } from "@/registry/bases/takumi/components/list/list";+import { PageFooter } from "@/registry/bases/takumi/components/page-footer/page-footer";+import { PageHeader } from "@/registry/bases/takumi/components/page-header/page-header";+import { Section } from "@/registry/bases/takumi/components/section/section";+import { Text } from "@/registry/bases/takumi/components/text/text";+import { PdfcnThemeProvider, usePdfcnTheme } from "@/registry/bases/takumi/components/theme-provider";import {View,StyleSheet,diff --git a/registry/bases/takumi/components/alert/index.ts b/registry/bases/takumi/components/alert/index.tsdeleted file mode 100644index 9961c94..0000000--- a/registry/bases/takumi/components/alert/index.ts+++ /dev/null@@ -1 +0,0 @@-export { PdfAlert, type PdfAlertProps, type AlertVariant } from "./alert";diff --git a/registry/bases/takumi/components/badge/index.ts b/registry/bases/takumi/components/badge/index.tsdeleted file mode 100644index 2ae6ef6..0000000--- a/registry/bases/takumi/components/badge/index.ts+++ /dev/null@@ -1,6 +0,0 @@-export {- Badge,- type BadgeProps,- type BadgeVariant,- type BadgeSize,-} from "./badge";diff --git a/registry/bases/takumi/components/card/index.ts b/registry/bases/takumi/components/card/index.tsdeleted file mode 100644index 17f5fea..0000000--- a/registry/bases/takumi/components/card/index.ts+++ /dev/null@@ -1 +0,0 @@-export { PdfCard, type PdfCardProps, type CardVariant } from "./card";diff --git a/registry/bases/takumi/components/data-table/data-table.tsx b/registry/bases/takumi/components/data-table/data-table.tsxindex b411092..f5b48e8 100644--- a/registry/bases/takumi/components/data-table/data-table.tsx+++ b/registry/bases/takumi/components/data-table/data-table.tsx@@ -7,7 +7,7 @@ import {TableFooter,TableHeader,TableRow,-} from "@/registry/bases/takumi/components/table";+} from "@/registry/bases/takumi/components/table/table";import {usePdfcnTheme,useSafeMemo,diff --git a/registry/bases/takumi/components/data-table/index.ts b/registry/bases/takumi/components/data-table/index.tsdeleted file mode 100644index e34f14d..0000000--- a/registry/bases/takumi/components/data-table/index.ts+++ /dev/null@@ -1,6 +0,0 @@-export { DataTable } from "./data-table";-export type {- DataTableProps,- DataTableColumn,- DataTableSize,-} from "./data-table.types";diff --git a/registry/bases/takumi/components/divider/index.ts b/registry/bases/takumi/components/divider/index.tsdeleted file mode 100644index 6a4d5ec..0000000--- a/registry/bases/takumi/components/divider/index.ts+++ /dev/null@@ -1,7 +0,0 @@-export {- Divider,- type DividerProps,- type DividerVariant,- type DividerThickness,- type DividerSpacing,-} from "./divider";diff --git a/registry/bases/takumi/components/form/index.ts b/registry/bases/takumi/components/form/index.tsdeleted file mode 100644index e968b85..0000000--- a/registry/bases/takumi/components/form/index.ts+++ /dev/null@@ -1,9 +0,0 @@-export { PdfForm } from "./form";-export type {- PdfFormProps,- PdfFormVariant,- PdfFormField,- PdfFormGroup,- FormLayout,- FormLabelPosition,-} from "./form.types";diff --git a/registry/bases/takumi/components/graph/index.ts b/registry/bases/takumi/components/graph/index.tsdeleted file mode 100644index a9dd44f..0000000--- a/registry/bases/takumi/components/graph/index.ts+++ /dev/null@@ -1,10 +0,0 @@-export { PdfGraph } from "./graph";-export { A4_WIDTH, GRAPH_SAFE_WIDTHS, getGraphWidth } from "./graph.utils";-export type {- GraphDataPoint,- GraphLegendPosition,- GraphProps,- GraphSeries,- GraphVariant,- GraphWidthOptions,-} from "./graph.types";diff --git a/registry/bases/takumi/components/heading/index.ts b/registry/bases/takumi/components/heading/index.tsdeleted file mode 100644index b31d254..0000000--- a/registry/bases/takumi/components/heading/index.ts+++ /dev/null@@ -1,6 +0,0 @@-export {- Heading,- type HeadingProps,- type HeadingWeight,- type HeadingTracking,-} from "./heading";diff --git a/registry/bases/takumi/components/index.ts b/registry/bases/takumi/components/index.tsdeleted file mode 100644index f16c3fd..0000000--- a/registry/bases/takumi/components/index.ts+++ /dev/null@@ -1,151 +0,0 @@-export type { PDFComponentProps } from "@/registry/types/pdf-components";-export {- Heading,- type HeadingProps,- type HeadingWeight,- type HeadingTracking,-} from "./heading";-export {- Divider,- type DividerProps,- type DividerVariant,- type DividerThickness,- type DividerSpacing,-} from "./divider";-export { PageBreak, type PageBreakProps } from "./page-break";-export {- PdfPageNumber,- type PdfPageNumberProps,- type PageNumberAlign,- type PageNumberSize,-} from "./page-number";-export {- PdfWatermark,- type PdfWatermarkProps,- type WatermarkPosition,-} from "./watermark";-export {- PdfQRCode,- type PdfQRCodeProps,- type QRCodeErrorLevel,-} from "./qrcode";-export { PdfAlert, type PdfAlertProps, type AlertVariant } from "./alert";-export {- Link,- type LinkProps,- type LinkVariant,- type LinkUnderline,-} from "./link";-export {- Text,- type TextProps,- type TextVariant,- type TextWeight,- type TextDecoration,-} from "./text";-export {- Stack,- type StackProps,- type StackGap,- type StackDirection,- type StackAlign,- type StackJustify,-} from "./stack";-export {- Section,- type SectionProps,- type SectionSpacing,- type SectionPadding,- type SectionVariant,-} from "./section";-export {- Table,- TableHeader,- TableBody,- TableFooter,- TableRow,- TableCell,- type TableProps,- type TableSectionProps,- type TableRowProps,- type TableCellProps,- type TableVariant,-} from "./table";-export {- DataTable,- type DataTableProps,- type DataTableColumn,- type DataTableSize,-} from "./data-table";-export {- Badge,- type BadgeProps,- type BadgeVariant,- type BadgeSize,-} from "./badge";-export {- KeyValue,- type KeyValueProps,- type KeyValueEntry,- type KeyValueDirection,- type KeyValueSize,-} from "./key-value";-export {- PageHeader,- type PageHeaderProps,- type PageHeaderVariant,-} from "./page-header";-export {- PageFooter,- type PageFooterProps,- type PageFooterVariant,-} from "./page-footer";-export {- PdfList,- type PdfListProps,- type ListVariant,- type ListItem,-} from "./list";-export { PdfCard, type PdfCardProps, type CardVariant } from "./card";-export {- PdfForm,- type PdfFormProps,- type PdfFormVariant,- type PdfFormField,- type PdfFormGroup,- type FormLayout,- type FormLabelPosition,-} from "./form";-export {- PdfSignatureBlock,- type PdfSignatureBlockProps,- type SignatureVariant,- type SignatureSigner,-} from "./signature";-export { KeepTogether, type KeepTogetherProps } from "./keep-together";-export {- PdfImage,- type PdfImageProps,- type PdfImageSrc,- type PdfImageVariant,- type PdfImageFit,-} from "./pdf-image";-export {- PdfGraph,- getGraphWidth,- A4_WIDTH,- GRAPH_SAFE_WIDTHS,- type GraphProps,- type GraphVariant,- type GraphDataPoint,- type GraphSeries,- type GraphLegendPosition,- type GraphWidthOptions,-} from "./graph";--export {- PdfcnThemeProvider,- usePdfcnTheme,- useSafeMemo,-} from "@/registry/bases/takumi/components/theme-provider";-export type { PdfcnTheme } from "@/registry/types/pdf-themes";diff --git a/registry/bases/takumi/components/keep-together/index.ts b/registry/bases/takumi/components/keep-together/index.tsdeleted file mode 100644index b111cfb..0000000--- a/registry/bases/takumi/components/keep-together/index.ts+++ /dev/null@@ -1 +0,0 @@-export { KeepTogether, type KeepTogetherProps } from "./keep-together";diff --git a/registry/bases/takumi/components/key-value/index.ts b/registry/bases/takumi/components/key-value/index.tsdeleted file mode 100644index 59d9c39..0000000--- a/registry/bases/takumi/components/key-value/index.ts+++ /dev/null@@ -1,7 +0,0 @@-export {- KeyValue,- type KeyValueProps,- type KeyValueEntry,- type KeyValueDirection,- type KeyValueSize,-} from "./key-value";diff --git a/registry/bases/takumi/components/link/index.ts b/registry/bases/takumi/components/link/index.tsdeleted file mode 100644index 22bf1b6..0000000--- a/registry/bases/takumi/components/link/index.ts+++ /dev/null@@ -1,6 +0,0 @@-export {- Link,- type LinkProps,- type LinkVariant,- type LinkUnderline,-} from "./link";diff --git a/registry/bases/takumi/components/list/index.ts b/registry/bases/takumi/components/list/index.tsdeleted file mode 100644index 5535351..0000000--- a/registry/bases/takumi/components/list/index.ts+++ /dev/null@@ -1,2 +0,0 @@-export { PdfList } from "./list";-export type { PdfListProps, ListVariant, ListItem } from "./list.types";diff --git a/registry/bases/takumi/components/page-break/index.ts b/registry/bases/takumi/components/page-break/index.tsdeleted file mode 100644index 174a541..0000000--- a/registry/bases/takumi/components/page-break/index.ts+++ /dev/null@@ -1,2 +0,0 @@-export { PageBreak } from "./page-break";-export type { PageBreakProps } from "./page-break";diff --git a/registry/bases/takumi/components/page-footer/index.ts b/registry/bases/takumi/components/page-footer/index.tsdeleted file mode 100644index f02d612..0000000--- a/registry/bases/takumi/components/page-footer/index.ts+++ /dev/null@@ -1,5 +0,0 @@-export {- PageFooter,- type PageFooterProps,- type PageFooterVariant,-} from "./page-footer";diff --git a/registry/bases/takumi/components/page-header/index.ts b/registry/bases/takumi/components/page-header/index.tsdeleted file mode 100644index 91eaac3..0000000--- a/registry/bases/takumi/components/page-header/index.ts+++ /dev/null@@ -1,5 +0,0 @@-export {- PageHeader,- type PageHeaderProps,- type PageHeaderVariant,-} from "./page-header";diff --git a/registry/bases/takumi/components/page-number/index.ts b/registry/bases/takumi/components/page-number/index.tsdeleted file mode 100644index bef083e..0000000--- a/registry/bases/takumi/components/page-number/index.ts+++ /dev/null@@ -1,6 +0,0 @@-export {- PdfPageNumber,- type PdfPageNumberProps,- type PageNumberAlign,- type PageNumberSize,-} from "./page-number";diff --git a/registry/bases/takumi/components/pdf-image/index.ts b/registry/bases/takumi/components/pdf-image/index.tsdeleted file mode 100644index 826f276..0000000--- a/registry/bases/takumi/components/pdf-image/index.ts+++ /dev/null@@ -1,7 +0,0 @@-export {- PdfImage,- type PdfImageProps,- type PdfImageSrc,- type PdfImageVariant,- type PdfImageFit,-} from "./pdf-image";diff --git a/registry/bases/takumi/components/qrcode/index.ts b/registry/bases/takumi/components/qrcode/index.tsdeleted file mode 100644index b0fac4d..0000000--- a/registry/bases/takumi/components/qrcode/index.ts+++ /dev/null@@ -1,5 +0,0 @@-export {- PdfQRCode,- type PdfQRCodeProps,- type QRCodeErrorLevel,-} from "./qrcode";diff --git a/registry/bases/takumi/components/section/index.ts b/registry/bases/takumi/components/section/index.tsdeleted file mode 100644index 18c2e0f..0000000--- a/registry/bases/takumi/components/section/index.ts+++ /dev/null@@ -1,7 +0,0 @@-export {- Section,- type SectionProps,- type SectionSpacing,- type SectionPadding,- type SectionVariant,-} from "./section";diff --git a/registry/bases/takumi/components/signature/index.ts b/registry/bases/takumi/components/signature/index.tsdeleted file mode 100644index fe7589d..0000000--- a/registry/bases/takumi/components/signature/index.ts+++ /dev/null@@ -1,6 +0,0 @@-export {- PdfSignatureBlock,- type PdfSignatureBlockProps,- type SignatureVariant,- type SignatureSigner,-} from "./signature";diff --git a/registry/bases/takumi/components/stack/index.ts b/registry/bases/takumi/components/stack/index.tsdeleted file mode 100644index 159aa8e..0000000--- a/registry/bases/takumi/components/stack/index.ts+++ /dev/null@@ -1,8 +0,0 @@-export {- Stack,- type StackProps,- type StackGap,- type StackDirection,- type StackAlign,- type StackJustify,-} from "./stack";diff --git a/registry/bases/takumi/components/table/index.ts b/registry/bases/takumi/components/table/index.tsdeleted file mode 100644index edd8ab6..0000000--- a/registry/bases/takumi/components/table/index.ts+++ /dev/null@@ -1,15 +0,0 @@-export {- Table,- TableHeader,- TableBody,- TableFooter,- TableRow,- TableCell,-} from "./table";-export type {- TableProps,- TableSectionProps,- TableRowProps,- TableCellProps,- TableVariant,-} from "./table.types";diff --git a/registry/bases/takumi/components/text/index.ts b/registry/bases/takumi/components/text/index.tsdeleted file mode 100644index 25d1338..0000000--- a/registry/bases/takumi/components/text/index.ts+++ /dev/null@@ -1,7 +0,0 @@-export {- Text,- type TextProps,- type TextVariant,- type TextWeight,- type TextDecoration,-} from "./text";diff --git a/registry/bases/takumi/components/watermark/index.ts b/registry/bases/takumi/components/watermark/index.tsdeleted file mode 100644index f30a740..0000000--- a/registry/bases/takumi/components/watermark/index.ts+++ /dev/null@@ -1,5 +0,0 @@-export {- PdfWatermark,- type PdfWatermarkProps,- type WatermarkPosition,-} from "./watermark";