Beautiful pdf components, built on Takumi and Forme. 100% Free, Zero config, one command setup.
Refactor application architecture and update related components
Aniket-5080c30c9eff3a2
diff --git a/app/api/pdf/forme/route.tsx b/app/api/pdf/forme/route.tsxindex 2494c10..df32161 100644--- a/app/api/pdf/forme/route.tsx+++ b/app/api/pdf/forme/route.tsx@@ -1,17 +1,22 @@import { renderDocument } from "@formepdf/core";+import { serialize } from "@formepdf/react";-import { demos } from "@/examples/__index__";+import { demos } from "@/examples/__forme__";export const GET = async (request: Request) => {const { searchParams } = new URL(request.url);const name = searchParams.get("name");- if (!name || !(name in demos.forme)) {+ if (!name || !(name in demos)) {return new Response(`Unknown demo: ${name}`, { status: 404 });}try {- const Demo = demos.forme[name as keyof typeof demos.forme];+ const Demo = demos[name as keyof typeof demos];+ if (searchParams.get("format") === "document") {+ return Response.json({ document: serialize(<Demo />) });+ }+const pdfBytes = await renderDocument(<Demo />);return new Response(Buffer.from(pdfBytes), {diff --git a/app/api/pdf/takumi/route.tsx b/app/api/pdf/takumi/route.tsxindex 51fb2dc..8e4deb1 100644--- a/app/api/pdf/takumi/route.tsx+++ b/app/api/pdf/takumi/route.tsx@@ -1,18 +1,24 @@import { googleFonts } from "@takumi-rs/helpers";+import { fromJsx } from "@takumi-rs/helpers/jsx";import { render } from "takumi-pdf";-import { demos } from "@/examples/__index__";+import { demos } from "@/examples/__takumi__";export const GET = async (request: Request) => {const { searchParams } = new URL(request.url);const name = searchParams.get("name");- if (!name || !(name in demos.takumi)) {+ if (!name || !(name in demos)) {return new Response(`Unknown demo: ${name}`, { status: 404 });}try {- const Demo = demos.takumi[name as keyof typeof demos.takumi];+ const Demo = demos[name as keyof typeof demos];+ if (searchParams.get("format") === "document") {+ const { node, stylesheets } = await fromJsx(<Demo />);+ return Response.json({ node, stylesheets });+ }+const pdf = await render(<Demo />, {fonts: await googleFonts(["Inter", "Times New Roman"]),margin: { bottom: 48, left: 48, right: 48, top: 48 },diff --git a/components/component-preview.tsx b/components/component-preview.tsxindex 9f1ed16..1f79060 100644--- a/components/component-preview.tsx+++ b/components/component-preview.tsx@@ -1,20 +1,39 @@import type { ReactNode } from "react";import { ComponentSource } from "@/components/component-source";+import { PdfPreview } from "@/components/pdf-preview-wrapper";+import { cn } from "@/lib/utils";+import { DEFAULT_BASE } from "@/registry/bases";+import type { BaseName } from "@/registry/bases";export const ComponentPreview = ({+ base = DEFAULT_BASE,name,src,title,children,+ className,+ hideCode = false,}: {+ base?: BaseName;name?: string;src?: string;title?: string;children?: ReactNode;+ className?: string;+ hideCode?: boolean;}) => (<>{children}- <ComponentSource name={name} src={src} title={title} />+ {name ? (+ <PdfPreview+ base={base}+ name={name}+ className={cn("mt-4", className)}+ />+ ) : null}+ {!hideCode ? (+ <ComponentSource base={base} name={name} src={src} title={title} />+ ) : null}</>);diff --git a/components/component-source.tsx b/components/component-source.tsxindex a75266a..24c0343 100644--- a/components/component-source.tsx+++ b/components/component-source.tsx@@ -9,6 +9,7 @@ import {readOptionalFromRoot,} from "@/lib/registry";import { cn } from "@/lib/utils";+import type { BaseName } from "@/registry/bases";const ComponentCode = ({code,@@ -38,6 +39,7 @@ const ComponentCode = ({);export const ComponentSource = async ({+ base = "takumi",name,src,title,@@ -45,6 +47,7 @@ export const ComponentSource = async ({className,language,}: {+ base?: BaseName;name?: string;src?: string;title?: string;@@ -55,7 +58,9 @@ export const ComponentSource = async ({let code: string | null = null;if (name) {- code = (await getDemoSource(name)) ?? (await getRegistrySource(name));+ code =+ (await getDemoSource(name, base)) ??+ (await getRegistrySource(name, base));}if (src) {diff --git a/components/components-list.tsx b/components/components-list.tsxindex aefe06a..910a8dd 100644--- a/components/components-list.tsx+++ b/components/components-list.tsx@@ -1,10 +1,11 @@import Link from "next/link";import { ROUTES } from "@/constants/routes";-import { isComponentsFolder } from "@/lib/docs";import type { PageTreeFolder, PageTreePage } from "@/lib/page-tree";-import { getAllPagesFromFolder, getPagesFromFolder } from "@/lib/page-tree";+import { getFolderPages } from "@/lib/page-tree";import { source } from "@/lib/source";+import { cn } from "@/lib/utils";+import { DEFAULT_BASE } from "@/registry/bases";const getFolder = (name: string): PageTreeFolder | undefined => {for (const node of source.pageTree.children) {@@ -14,8 +15,19 @@ const getFolder = (name: string): PageTreeFolder | undefined => {}};-const ComponentGrid = ({ pages }: { pages: PageTreePage[] }) => (- <div className="grid grid-cols-2 gap-4 md:grid-cols-3 md:gap-x-8 lg:gap-x-16 lg:gap-y-6 xl:gap-x-20">+const ComponentGrid = ({+ className,+ pages,+}: {+ className?: string;+ pages: PageTreePage[];+}) => (+ <div+ className={cn(+ "grid grid-cols-2 gap-4 md:grid-cols-3 md:gap-x-8 lg:gap-x-16 lg:gap-y-6 xl:gap-x-20",+ className+ )}+ >{pages.map((component) => (<LinkclassName="inline-flex items-center gap-2 text-lg font-medium underline-offset-4 hover:underline md:text-base"@@ -31,28 +43,29 @@ const ComponentGrid = ({ pages }: { pages: PageTreePage[] }) => (export const ComponentsList = ({folderName = "Components",+ base = DEFAULT_BASE,+ className,}: {folderName?: string;+ base?: string;+ className?: string;}) => {const folder = getFolder(folderName);if (!folder) {return null;}- if (!isComponentsFolder(folder)) {- const pages = getPagesFromFolder(folder);- if (pages.length === 0) {- return null;- }- return <ComponentGrid pages={pages} />;- }-- const pages = getAllPagesFromFolder(folder).filter(- (page) => page.url !== ROUTES.DOCS_COMPONENTS+ const sectionUrl =+ folderName.toLowerCase() === "blocks"+ ? ROUTES.DOCS_BLOCKS+ : ROUTES.DOCS_COMPONENTS;+ const basePages = getFolderPages(folder, base);+ const pages = (basePages.length > 0 ? basePages : getFolderPages(folder)).filter(+ (page) =>+ page.url !== sectionUrl && page.url !== `${sectionUrl}/${base}`);- if (pages.length === 0) {- return null;- }- return <ComponentGrid pages={pages} />;+ return pages.length > 0 ? (+ <ComponentGrid className={className} pages={pages} />+ ) : null;};diff --git a/components/docs-base-switcher.tsx b/components/docs-base-switcher.tsxindex 35f99e8..c0d4557 100644--- a/components/docs-base-switcher.tsx+++ b/components/docs-base-switcher.tsx@@ -68,9 +68,9 @@ export const DocsBaseSwitcher = ({{baseItem.title}</Link>))}- {activeBase ? (- <div className="ml-auto shrink-0 text-sm text-muted-foreground opacity-80">- {activeBase.title}+ {activeBase?.meta?.logo ? (+ <div className="ml-auto shrink-0 text-muted-foreground opacity-80 [&_svg]:h-5 [&_svg]:w-fit">+ <activeBase.meta.logo aria-label={`${activeBase.title} logo`} /></div>) : null}</div>diff --git a/components/haptics-switcher.tsx b/components/haptics-switcher.tsxnew file mode 100644index 0000000..4657483--- /dev/null+++ b/components/haptics-switcher.tsx@@ -0,0 +1,64 @@+"use client";++import { Vibrate, VibrateOff } from "lucide-react";++import { useFeedback } from "@/hooks/use-feedback";+import { useHapticsEnabled } from "@/hooks/use-haptic-toggle";+import { useMounted } from "@/hooks/use-mounted";+import { cn } from "@/lib/utils";++const HAPTICS_OPTIONS = [+ { icon: Vibrate, label: "on", value: true },+ { icon: VibrateOff, label: "off", value: false },+] as const;++export const HapticsSwitcher = () => {+ const [value, setValue] = useHapticsEnabled();+ const isMounted = useMounted();+ const feedbackOn = useFeedback({ sound: "toggleOn" });+ const feedbackOff = useFeedback({ sound: "toggleOff" });++ if (!isMounted) {+ return <div className="flex h-8 w-20" />;+ }++ return (+ <div+ className="inline-flex items-center rounded-full bg-background inset-ring-1 inset-ring-border"+ role="radiogroup"+ aria-label="Haptics"+ >+ {HAPTICS_OPTIONS.map((option) => {+ const Icon = option.icon;+ const isActive = value === option.value;++ return (+ <button+ key={option.label}+ type="button"+ data-active={isActive}+ className={cn(+ "relative flex size-8 items-center justify-center rounded-full text-muted-foreground transition-[color,box-shadow] hover:text-foreground data-[active=true]:text-foreground data-[active=true]:inset-ring-1 data-[active=true]:inset-ring-border [&_svg]:size-4"+ )}+ role="radio"+ aria-checked={isActive}+ aria-label={`Switch haptics ${option.label}`}+ onClick={() => {+ if (option.value === value) {+ return;+ }+ if (option.value) {+ feedbackOn();+ } else {+ feedbackOff();+ }+ setValue(option.value);+ }}+ >+ <Icon />+ </button>+ );+ })}+ </div>+ );+};diff --git a/components/icons.tsx b/components/icons.tsxindex 4afaed9..86f692c 100644--- a/components/icons.tsx+++ b/components/icons.tsx@@ -407,6 +407,70 @@ export const CssIcon = ({</svg>);+// Official Takumi mark used by takumi.kane.tw as its favicon/logo.+export const TakumiIcon = ({+ className,+ ...props+}: React.ComponentProps<"svg">) => (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 128 128"+ className={cn("size-4", className)}+ {...props}+ >+ <defs>+ <linearGradient+ id="takumi-mark-a"+ gradientUnits="userSpaceOnUse"+ x1="59.7"+ y1="8.6"+ x2="59.7"+ y2="128"+ >+ <stop offset="0" stopColor="#ffa944" />+ <stop offset="1" stopColor="#ff3300" />+ </linearGradient>+ <linearGradient+ id="takumi-mark-b"+ gradientUnits="userSpaceOnUse"+ x1="90.7"+ y1="0"+ x2="90.7"+ y2="73.7"+ >+ <stop offset="0" stopColor="#ff3535" />+ <stop offset="1" stopColor="#d71d36" />+ </linearGradient>+ </defs>+ <path+ fill="url(#takumi-mark-a)"+ d="M114.3 14.1c1.1.9 3.2 2.7 4.2 4.5s.9 3.5.8 4.8-.4 2.3-2 4.3c-1.7 2-4.7 5-12.8 13.7-8.1 8.8-21.4 23.4-35.3 38.4s-28.6 30.5-36.4 38.7-8.8 8.8-10 9.2-2.5.4-4.1 0-3.5-1.2-6.5-3.8-7.1-6.9-9.4-10S.1 108.8.1 107c0-1.7.4-3.4 5.3-8.6s14.3-13.9 30.5-28.9c16.1-14.9 39-36.1 51-47.2s13.2-12 14.7-12.7 3.2-1.1 4.8-.9 2.8 1 3.9 1.9a32 32 0 0 1 2.5 2.1l.4.5z"+ />+ <path+ fill="url(#takumi-mark-b)"+ d="M79 .5C65.3 3.1 46.9 23.4 56.8 36.3c3.3 4.3 5.1 6.7 9.3 9.7 10.2 7.3 39.1 31 53.1 26.9 12-3.5 9.4-16.9 5.6-25.8-1.3-3-25.7-52.8-45.8-46.6"+ />+ </svg>+);++// Official Forme square mark, matching the project favicon artwork.+export const FormeIcon = ({+ className,+ ...props+}: React.ComponentProps<"svg">) => (+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 64 64"+ className={cn("size-4", className)}+ {...props}+ >+ <rect x="6" y="6" width="52" height="52" rx="6" fill="#0f172a" />+ <rect x="16" y="16" width="32" height="4" rx="1" fill="#ffffff" />+ <rect x="16" y="26" width="22" height="4" rx="1" fill="#ffffff" />+ <rect x="16" y="36" width="4" height="12" rx="1" fill="#ffffff" />+ </svg>+);+export const getIconForLanguageExtension = (language: string) => {switch (language) {case "json": {diff --git a/components/mode-switcher.tsx b/components/mode-switcher.tsxindex 489e480..8c55d1f 100644--- a/components/mode-switcher.tsx+++ b/components/mode-switcher.tsx@@ -1,38 +1,62 @@"use client";-import { ThemeIcon } from "@/components/icons";-import { Button } from "@/components/ui/button";-import { Kbd } from "@/components/ui/kbd";-import {- Tooltip,- TooltipContent,- TooltipTrigger,-} from "@/components/ui/tooltip";-import { useThemeToggle } from "@/hooks/use-theme-toggle";+import { MonitorIcon, MoonIcon, SunIcon } from "lucide-react";+import { useTheme } from "next-themes";++import { useFeedback } from "@/hooks/use-feedback";+import { useMounted } from "@/hooks/use-mounted";+import { cn } from "@/lib/utils";++const THEME_OPTIONS = [+ { icon: MonitorIcon, value: "system" },+ { icon: SunIcon, value: "light" },+ { icon: MoonIcon, value: "dark" },+] as const;export const ModeSwitcher = () => {- const { toggleTheme } = useThemeToggle();+ const { theme, setTheme } = useTheme();+ const isMounted = useMounted();+ const feedbackOn = useFeedback({ sound: "toggleOn" });+ const feedbackOff = useFeedback({ sound: "toggleOff" });++ if (!isMounted) {+ return <div className="flex h-8 w-24" />;+ }return (- <Tooltip>- <TooltipTrigger asChild>- <Button- variant="ghost"- size="icon"- className="group/toggle extend-touch-target size-8"- onClick={toggleTheme}- title="Toggle theme"- >- <ThemeIcon className="size-4.5" strokeWidth="2" />- <span className="sr-only">Toggle theme</span>- </Button>- </TooltipTrigger>- <TooltipContent className="pr-2 pl-3">- <div className="flex items-center gap-3">- Toggle Mode- <Kbd>D</Kbd>- </div>- </TooltipContent>- </Tooltip>+ <div+ className="inline-flex items-center rounded-full bg-background inset-ring-1 inset-ring-border"+ role="radiogroup"+ aria-label="Theme"+ >+ {THEME_OPTIONS.map((option) => {+ const Icon = option.icon;+ const isActive = theme === option.value;++ return (+ <button+ key={option.value}+ type="button"+ data-active={isActive}+ className={cn(+ "relative flex size-8 items-center justify-center rounded-full text-muted-foreground transition-[color,box-shadow] hover:text-foreground data-[active=true]:text-foreground data-[active=true]:inset-ring-1 data-[active=true]:inset-ring-border [&_svg]:size-4"+ )}+ role="radio"+ aria-checked={isActive}+ aria-label={`Switch to ${option.value} theme`}+ onClick={() => {+ if (option.value === "dark") {+ feedbackOff();+ } else {+ feedbackOn();+ }+ setTheme(option.value);+ }}+ >+ <Icon />+ </button>+ );+ })}+ </div>);};diff --git a/components/pdf-preview.tsx b/components/pdf-preview.tsxindex e91c5aa..d2bd8a1 100644--- a/components/pdf-preview.tsx+++ b/components/pdf-preview.tsx@@ -1,6 +1,6 @@"use client";-import { useEffect, useState } from "react";+import { createElement, useEffect, useMemo, useRef, useState } from "react";import { Document, Page, pdfjs } from "react-pdf";import { cn } from "@/lib/utils";@@ -31,6 +31,25 @@ export const PdfPreview = ({const [error, setError] = useState<string | null>(null);const [numPages, setNumPages] = useState(0);const [page, setPage] = useState(1);+ const [pageWidth, setPageWidth] = useState(560);+ const containerRef = useRef<HTMLDivElement>(null);+ const file = useMemo(() => (data ? { data } : null), [data]);++ useEffect(() => {+ const container = containerRef.current;+ if (!container) {+ return;+ }++ const updateWidth = () => {+ setPageWidth(Math.min(560, Math.max(240, container.clientWidth - 32)));+ };+ const observer = new ResizeObserver(updateWidth);+ updateWidth();+ observer.observe(container);++ return () => observer.disconnect();+ }, []);useEffect(() => {let cancelled = false;@@ -41,28 +60,51 @@ export const PdfPreview = ({(async () => {try {if (base === "takumi") {- const res = await fetch(- `/api/pdf/takumi?name=${encodeURIComponent(name)}`- );- if (!res.ok) {- throw new Error(await res.text());+ const [+ { demos },+ { default: initialize, render },+ pdfWasmModule,+ { googleFonts },+ { fromJsx },+ ] = await Promise.all([+ import("@/examples/__takumi__"),+ import("takumi-pdf"),+ import("takumi-pdf/takumi_pdf_wasm_bg.wasm"),+ import("@takumi-rs/helpers"),+ import("@takumi-rs/helpers/jsx"),+ ]);+ const Demo = demos[name];+ if (!Demo) {+ throw new Error(`Unknown Takumi demo: ${name}`);}- const buf = new Uint8Array(await res.arrayBuffer());+ const { node, stylesheets } = await fromJsx(createElement(Demo));+ const pdfWasm = (+ pdfWasmModule as unknown as { default: string }+ ).default;+ await initialize({ module_or_path: pdfWasm });+ const buf = await render(node, {+ fonts: await googleFonts(["Inter", "Times New Roman"]),+ margin: { bottom: 48, left: 48, right: 48, top: 48 },+ size: "a4",+ stylesheets,+ });if (!cancelled) {- setData(buf);+ setData(new Uint8Array(buf));}return;}- const res = await fetch(- `/api/pdf/forme?name=${encodeURIComponent(name)}`- );- if (!res.ok) {- throw new Error(await res.text());+ const [{ demos }, { renderDocument }] = await Promise.all([+ import("@/examples/__forme__"),+ import("@formepdf/core/browser"),+ ]);+ const Demo = demos[name];+ if (!Demo) {+ throw new Error(`Unknown Forme demo: ${name}`);}- const buf = new Uint8Array(await res.arrayBuffer());+ const buf = await renderDocument(createElement(Demo));if (!cancelled) {- setData(buf);+ setData(new Uint8Array(buf));}} catch (error) {if (!cancelled) {@@ -80,6 +122,7 @@ export const PdfPreview = ({return (<div+ ref={containerRef}className={cn("overflow-hidden rounded-lg border bg-muted/30", className)}style={{ minHeight: height }}>@@ -93,14 +136,15 @@ export const PdfPreview = ({Rendering PDF…</div>)}- {data && (+ {file && (<div className="flex flex-col items-center gap-3 p-4"><Document- file={{ data }}+ file={file}+ onLoadError={(loadError) => setError(loadError.message)}onLoadSuccess={({ numPages: n }) => setNumPages(n)}loading={null}>- <Page pageNumber={page} width={560} />+ <Page pageNumber={page} width={pageWidth} /></Document>{numPages > 1 && (<div className="flex items-center gap-3 text-sm">diff --git a/components/playground/evaluate.ts b/components/playground/evaluate.tsnew file mode 100644index 0000000..23dd808--- /dev/null+++ b/components/playground/evaluate.ts@@ -0,0 +1,37 @@+import * as React from "react";+import { transform } from "sucrase";+import * as z from "zod/mini";+import { optionsSchema } from "./schema";++const exportsSchema = z.object({+ default: z.function(),+ options: optionsSchema,+});++function transformCode(code: string) {+ return transform(code, {+ transforms: ["jsx", "typescript", "imports"],+ production: true,+ }).code;+}++export function evaluateCodeExports(code: string, react: typeof React) {+ const exports: Record<string, unknown> = {};+ new Function("exports", "React", transformCode(code))(exports, react);+ return exportsSchema.parse(exports);+}++function mirrorTw<P>(props: P): P {+ if (!props || typeof props !== "object" || !("tw" in props)) return props;+ const { tw, className, class: klass } = props as Record<string, unknown>;+ return { ...props, className: [className ?? klass, tw].filter(Boolean).join(" ") };+}++export const renderReact: typeof React = {+ ...React,+ createElement: ((+ type: React.ElementType,+ props: Record<string, unknown> | null,+ ...children: React.ReactNode[]+ ) => React.createElement(type, mirrorTw(props), ...children)) as typeof React.createElement,+};diff --git a/components/playground/geometry.ts b/components/playground/geometry.tsnew file mode 100644index 0000000..6b64199--- /dev/null+++ b/components/playground/geometry.ts@@ -0,0 +1,41 @@+const PX_PER_MM = 96 / 25.4;+const PAGE_SIZES = {+ a4: { width: 210 * PX_PER_MM, height: 297 * PX_PER_MM },+ letter: { width: 8.5 * 96, height: 11 * 96 },+};+const DEFAULT_PAGE_MARGIN = 48;++type PdfOptions = NonNullable<PlaygroundOptions["pdf"]>;++export type OutputGeometry = {+ width: number;+ height?: number;+ padding?: string;+ label: string;+};++function marginPadding(margin: PdfOptions["margin"]): string {+ if (margin === undefined) return `${DEFAULT_PAGE_MARGIN}px`;+ if (typeof margin === "number") return `${margin}px`;+ const { top = 0, right = 0, bottom = 0, left = 0 } = margin;+ return `${top}px ${right}px ${bottom}px ${left}px`;+}++function pdfGeometry(pdf: PdfOptions): OutputGeometry {+ const size = typeof pdf.size === "object" ? pdf.size : PAGE_SIZES[pdf.size ?? "a4"];+ const preset = typeof pdf.size === "object" ? undefined : (pdf.size ?? "a4");+ const width = Math.round(pdf.landscape ? size.height : size.width);+ const height = Math.round(pdf.landscape ? size.width : size.height);+ const name = preset ? preset.toUpperCase() : `${width} × ${height}`;+ return {+ width,+ label: pdf.landscape ? `${name} landscape` : name,+ padding: marginPadding(pdf.margin),+ };+}++export function outputGeometry(options: PlaygroundOptions): OutputGeometry {+ if (options.pdf) return pdfGeometry(options.pdf);+ const { width = 1200, height = 630 } = options;+ return { width, height, label: `${width} × ${height}` };+}diff --git a/components/playground/index.ts b/components/playground/index.tsnew file mode 100644index 0000000..3eb5369--- /dev/null+++ b/components/playground/index.ts@@ -0,0 +1,5 @@+export { TakumiPreview } from "./takumi-preview";+export { useRenderWorker } from "./use-render-worker";+export { OutputPanel } from "./output-panel";+export type { RenderSuccess, RenderError } from "./use-render-worker";+export type { PdfView } from "./output-panel";diff --git a/components/playground/inspect-pdf.ts b/components/playground/inspect-pdf.tsnew file mode 100644index 0000000..2ead275--- /dev/null+++ b/components/playground/inspect-pdf.ts@@ -0,0 +1,98 @@+export type PdfInspection = {+ pages: number;+ standards: string[];+ tagged: boolean;+ title?: string;+ authors?: string[];+ created?: string;+ bookmarks: Bookmark[];+ attachments: { name: string; description?: string }[];+};++type Bookmark = { title: string; depth: number };++function bytesToChars(bytes: Uint8Array): string {+ let text = "";+ for (let offset = 0; offset < bytes.length; offset += 0x8000) {+ text += String.fromCharCode(...bytes.subarray(offset, offset + 0x8000));+ }+ return text;+}++function utf8(value: string | undefined): string | undefined {+ return value && new TextDecoder().decode(Uint8Array.from(value, (char) => char.charCodeAt(0)));+}++function pdfString(raw: string): string {+ if (raw.startsWith("<")) {+ const hex = raw.slice(1, -1).replace(/\s/g, "");+ const text = (hex.match(/.{4}/g) ?? [])+ .map((unit) => String.fromCharCode(Number.parseInt(unit, 16)))+ .join("");+ return text.replace(/^/, "");+ }+ return raw.slice(1, -1).replace(/\\([()\\])/g, "$1");+}++function entry(object: string, key: string): string | undefined {+ const match = object.match(new RegExp(`/${key}\\s*(\\([^)]*\\)|<[0-9A-Fa-f\\s]*>)`));+ return match?.[1] && pdfString(match[1]);+}++function readBookmarks(objects: string[]): Bookmark[] {+ const byNumber = new Map<string, string>();+ for (const object of objects) {+ const number = object.match(/(\d+)\s+0\s+obj/)?.[1];+ if (number) byNumber.set(number, object);+ }+ const followRef = (object: string | undefined, key: string) => {+ const number = object?.match(new RegExp(`/${key}\\s+(\\d+)\\s+0\\s+R`))?.[1];+ return number === undefined ? undefined : byNumber.get(number);+ };+ const bookmarks: Bookmark[] = [];+ const walk = (first: string | undefined, depth: number) => {+ let node = first;+ while (node && bookmarks.length < 500) {+ bookmarks.push({ title: entry(node, "Title") ?? "", depth });+ walk(followRef(node, "First"), depth + 1);+ node = followRef(node, "Next");+ }+ };+ walk(+ followRef(+ objects.find((object) => /\/Type\s*\/Outlines/.test(object)),+ "First",+ ),+ 0,+ );+ return bookmarks.filter((bookmark) => bookmark.title);+}++export function inspectPdf(bytes: Uint8Array): PdfInspection {+ const text = bytesToChars(bytes);+ const objects = text.split("endobj");+ const xmp = text.match(/<x:xmpmeta[\s\S]*?<\/x:xmpmeta>/)?.[0] ?? "";+ const xmpValue = (tag: string) => xmp.match(new RegExp(`<${tag}>([^<]*)<`))?.[1];+ const archival = xmpValue("pdfaid:part");+ const accessible = xmpValue("pdfuaid:part");+ const standards = [+ archival && `PDF/A-${archival}${(xmpValue("pdfaid:conformance") ?? "").toLowerCase()}`,+ accessible && `PDF/UA-${accessible}`,+ ].filter((standard): standard is string => Boolean(standard));+ const authors = [...xmp.matchAll(/<dc:creator>[\s\S]*?<\/dc:creator>/g)]+ .flatMap((match) => [...match[0].matchAll(/<rdf:li>([^<]*)</g)])+ .map((match) => utf8(match[1]));+ return {+ pages: text.match(/\/Type\s*\/Page[^s]/g)?.length ?? 0,+ standards,+ tagged: text.includes("/StructTreeRoot"),+ title: utf8(xmp.match(/<dc:title>[\s\S]*?<rdf:li[^>]*>([^<]*)</)?.[1]),+ authors: authors.length > 0 ? (authors as string[]) : undefined,+ created: xmpValue("xmp:CreateDate")?.slice(0, 10),+ bookmarks: readBookmarks(objects),+ attachments: objects+ .filter((object) => object.includes("/Filespec"))+ .map((object) => ({ name: entry(object, "F") ?? "", description: entry(object, "Desc") }))+ .filter((attachment) => attachment.name),+ };+}diff --git a/components/playground/options.ts b/components/playground/options.tsnew file mode 100644index 0000000..ac794d6--- /dev/null+++ b/components/playground/options.ts@@ -0,0 +1,20 @@+import type { RenderOptions } from "takumi-pdf";++type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;++export type PlaygroundPdfOptions = DistributiveOmit<+ RenderOptions,+ "fonts" | "images" | "stylesheets" | "fontFamilies"+>;++declare global {+ type PlaygroundOptions = {+ width?: number;+ height?: number;+ format?: "png" | "jpeg" | "webp";+ quality?: number;+ devicePixelRatio?: number;+ stylesheets?: string[];+ pdf?: PlaygroundPdfOptions;+ };+}diff --git a/components/playground/output-panel.tsx b/components/playground/output-panel.tsxnew file mode 100644index 0000000..e238fbf--- /dev/null+++ b/components/playground/output-panel.tsx@@ -0,0 +1,137 @@+"use client";++import type { ReactNode } from "react";+import type { PdfInspection } from "./inspect-pdf";+import type { RenderError, RenderSuccess } from "./use-render-worker";+import { cn } from "@/lib/utils";++function PdfPreview({ url, dimmed }: { url: string | undefined; dimmed: boolean }) {+ if (!url) return null;+ return (+ <object+ data={url}+ type="application/pdf"+ aria-label="Rendered PDF"+ className={cn("size-full", dimmed && "opacity-40")}+ >+ <div className="flex h-full items-center justify-center p-6 text-center font-mono text-xs text-muted-foreground">+ <a href={url} target="_blank" rel="noreferrer" className="underline">+ Open PDF in new tab+ </a>+ </div>+ </object>+ );+}++function Field({ label, children }: { label: string; children: ReactNode }) {+ return (+ <div className="flex gap-3 border-b py-1.5 last:border-b-0">+ <span className="w-24 shrink-0 text-muted-foreground">{label}</span>+ <div className="min-w-0 flex-1">{children}</div>+ </div>+ );+}++function DocumentPanel({ inspection }: { inspection: PdfInspection }) {+ return (+ <div className="h-full overflow-auto bg-muted/20 px-4 py-3 font-mono text-xs">+ <Field label="Standards">+ {inspection.standards.length > 0 ? (+ <span className="text-primary">{inspection.standards.join(" · ")}</span>+ ) : (+ <span className="text-muted-foreground">plain PDF</span>+ )}+ </Field>+ <Field label="Tagged">{inspection.tagged ? "yes" : "no"}</Field>+ <Field label="Pages">{inspection.pages}</Field>+ {inspection.title && <Field label="Title">{inspection.title}</Field>}+ {inspection.authors && <Field label="Authors">{inspection.authors.join(", ")}</Field>}+ {inspection.created && <Field label="Created">{inspection.created}</Field>}+ <Field label="Bookmarks">+ {inspection.bookmarks.length === 0 ? (+ <span className="text-muted-foreground">none</span>+ ) : (+ inspection.bookmarks.map((bookmark, index) => (+ <div+ key={`${bookmark.title}-${index}`}+ style={{ paddingLeft: bookmark.depth * 12 }}+ className="truncate"+ >+ {bookmark.title}+ </div>+ ))+ )}+ </Field>+ <Field label="Attachments">+ {inspection.attachments.length === 0 ? (+ <span className="text-muted-foreground">none</span>+ ) : (+ inspection.attachments.map((attachment) => (+ <div key={attachment.name} className="truncate">+ {attachment.name}+ {attachment.description && (+ <span className="text-muted-foreground"> — {attachment.description}</span>+ )}+ </div>+ ))+ )}+ </Field>+ </div>+ );+}++export type PdfView = "preview" | "document";++export function OutputPanel({+ lastSuccess,+ error,+ isReady,+ pdfView,+}: {+ lastSuccess: RenderSuccess | undefined;+ error: RenderError | undefined;+ isReady: boolean;+ pdfView: PdfView;+}) {+ if (!lastSuccess && !error) {+ return (+ <div className="flex h-full items-center justify-center gap-2 bg-muted/20 font-mono text-xs text-muted-foreground">+ <div className="size-3.5 animate-spin rounded-full border-2 border-current border-t-transparent" />+ {isReady ? "rendering…" : "loading wasm…"}+ </div>+ );+ }++ if (lastSuccess?.outputKind === "pdf" && pdfView === "document" && lastSuccess.inspection) {+ return <DocumentPanel inspection={lastSuccess.inspection} />;+ }++ const output =+ lastSuccess &&+ (lastSuccess.outputKind === "pdf" ? (+ <PdfPreview url={lastSuccess.outputUrl} dimmed={Boolean(error)} />+ ) : (+ <img+ src={lastSuccess.outputUrl}+ alt="Rendered output"+ className={cn("border max-h-full max-w-full object-contain", error && "opacity-40")}+ />+ ));++ return (+ <div className="relative h-full min-w-0 overflow-hidden bg-muted/20">+ {lastSuccess?.outputKind === "pdf" ? (+ <div className="absolute inset-0">{output}</div>+ ) : (+ <div className="absolute inset-0 flex items-center justify-center">{output}</div>+ )}+ {error && (+ <div className="absolute inset-x-0 bottom-0 border-t bg-background/95 px-3 py-2 font-mono text-xs">+ <pre className="max-h-40 overflow-auto whitespace-pre-wrap text-muted-foreground">+ {error.message}+ </pre>+ </div>+ )}+ </div>+ );+}diff --git a/components/playground/schema.ts b/components/playground/schema.tsnew file mode 100644index 0000000..1b36b59--- /dev/null+++ b/components/playground/schema.ts@@ -0,0 +1,68 @@+import * as z from "zod/mini";+import type { PdfInspection } from "./inspect-pdf";++export const optionsSchema = z.object({+ width: z.optional(z.int().check(z.positive(), z.minimum(1))),+ height: z.optional(z.int().check(z.positive(), z.minimum(1))),+ quality: z.optional(z.int().check(z.positive(), z.minimum(1), z.maximum(100))),+ format: z.optional(z.enum(["png", "jpeg", "webp"])),+ devicePixelRatio: z.optional(z.number().check(z.positive(), z.minimum(0.1), z.maximum(10.0))),+ stylesheets: z.optional(z.array(z.string())),+ pdf: z.optional(z.custom<Record<string, unknown>>()),+});++export const outputKinds = ["image", "pdf"] as const;++export type OutputKind = (typeof outputKinds)[number];++const renderSuccessSchema = z.object({+ status: z.literal("success"),+ id: z.int().check(z.positive(), z.minimum(1)),+ outputBuffer: z.any(),+ outputUrl: z.optional(z.string()),+ duration: z.number(),+ outputKind: z.enum(outputKinds),+ outputFormat: z.string(),+ label: z.string(),+ inspection: z.optional(z.custom<PdfInspection>()),+});++const renderErrorSchema = z.object({+ status: z.literal("error"),+ id: z.int().check(z.positive(), z.minimum(1)),+ message: z.string(),+});++const renderRequestSchema = z.object({+ type: z.literal("render-request"),+ id: z.int().check(z.positive(), z.minimum(1)),+ code: z.string(),+});++export const renderResultSchema = z.object({+ type: z.literal("render-result"),+ result: z.discriminatedUnion("status", [renderSuccessSchema, renderErrorSchema]),+});++const readySchema = z.object({+ type: z.literal("ready"),+});++const previewResultSchema = z.object({+ type: z.literal("preview-result"),+ id: z.int().check(z.positive(), z.minimum(1)),+ html: z.string(),+ width: z.optional(z.int().check(z.positive(), z.minimum(1))),+ height: z.optional(z.int().check(z.positive(), z.minimum(1))),+ padding: z.optional(z.string()),+ cssContents: z.optional(z.array(z.string())),+});++export const messageSchema = z.discriminatedUnion("type", [+ renderRequestSchema,+ renderResultSchema,+ readySchema,+ previewResultSchema,+]);++export type RenderMessageInput = z.input<typeof messageSchema>;diff --git a/components/playground/takumi-preview.tsx b/components/playground/takumi-preview.tsxnew file mode 100644index 0000000..cdf778f--- /dev/null+++ b/components/playground/takumi-preview.tsx@@ -0,0 +1,64 @@+"use client";++import { useState } from "react";+import { cn } from "@/lib/utils";+import { useRenderWorker } from "./use-render-worker";+import { OutputPanel, type PdfView } from "./output-panel";++interface TakumiPreviewProps {+ code: string;+ className?: string;+ height?: number;+}++export function TakumiPreview({ code, className, height = 640 }: TakumiPreviewProps) {+ const [pdfView, setPdfView] = useState<PdfView>("preview");+ const { isReady, lastSuccess, renderError } = useRenderWorker(code);++ return (+ <div+ className={cn("overflow-hidden rounded-lg border bg-muted/30", className)}+ style={{ minHeight: height }}+ >+ <div className="flex h-6 shrink-0 items-center gap-1.5 border-b px-3 font-mono text-[11px] uppercase tracking-wide text-muted-foreground">+ <span>PDF Preview</span>+ {lastSuccess?.outputKind === "pdf" && (+ <div className="ml-auto flex items-center gap-1">+ {(["preview", "document"] as const).map((id) => (+ <button+ key={id}+ type="button"+ onClick={() => setPdfView(id)}+ className={cn(+ "rounded-sm px-1.5 py-0.5 uppercase transition-colors hover:text-foreground",+ pdfView === id && "bg-muted text-foreground"+ )}+ >+ {id}+ </button>+ ))}+ {lastSuccess?.outputUrl && (+ <a+ href={lastSuccess.outputUrl}+ target="_blank"+ rel="noreferrer"+ title="Open PDF in new tab"+ className="rounded-sm px-1 py-0.5 transition-colors hover:text-foreground"+ >+ ↗+ </a>+ )}+ </div>+ )}+ </div>+ <div style={{ height: height - 24 }}>+ <OutputPanel+ lastSuccess={lastSuccess}+ error={renderError}+ isReady={isReady}+ pdfView={pdfView}+ />+ </div>+ </div>+ );+}diff --git a/components/playground/use-render-worker.ts b/components/playground/use-render-worker.tsnew file mode 100644index 0000000..a9445be--- /dev/null+++ b/components/playground/use-render-worker.ts@@ -0,0 +1,101 @@+"use client";++import { useEffect, useRef, useState } from "react";+import type { z } from "zod/mini";+import {+ messageSchema,+ type RenderMessageInput,+ type renderResultSchema,+} from "./schema";++export type RenderResult = z.infer<typeof renderResultSchema>["result"];+export type RenderSuccess = Extract<RenderResult, { status: "success" }> & { outputSize: number };+export type RenderError = Extract<RenderResult, { status: "error" }>;++function isBlobUrl(url: string | undefined): url is string {+ return typeof url === "string" && url.startsWith("blob:");+}++function mimeType(result: RenderResult & { status: "success" }) {+ return result.outputKind === "pdf" ? "application/pdf" : `image/${result.outputFormat}`;+}++export function useRenderWorker(ranCode: string | undefined) {+ const [isReady, setIsReady] = useState(false);+ const [lastSuccess, setLastSuccess] = useState<RenderSuccess>();+ const [renderError, setRenderError] = useState<RenderError>();+ const currentRequestIdRef = useRef(0);+ const workerRef = useRef<Worker | undefined>(undefined);++ useEffect(() => {+ const worker = new Worker(+ new URL("./worker.ts", import.meta.url),+ { type: "module" }+ );++ worker.onmessage = (event: MessageEvent) => {+ const message = messageSchema.parse(event.data);++ switch (message.type) {+ case "ready": {+ setIsReady(true);+ break;+ }+ case "render-request": {+ throw new Error("request is not possible for response");+ }+ case "preview-result": {+ break;+ }+ case "render-result": {+ const { result } = message;+ if (result.id !== currentRequestIdRef.current) break;++ if (result.status === "success") {+ const blob = new Blob([result.outputBuffer as BlobPart], { type: mimeType(result) });+ setLastSuccess({+ ...result,+ outputUrl: URL.createObjectURL(blob),+ outputSize: blob.size,+ });+ setRenderError(undefined);+ } else {+ setRenderError(result);+ }+ break;+ }+ default: {+ message satisfies never;+ }+ }+ };++ workerRef.current = worker;++ return () => {+ worker.terminate();+ workerRef.current = undefined;+ setIsReady(false);+ };+ }, []);++ useEffect(() => {+ if (!isReady || ranCode === undefined) return;++ const requestId = currentRequestIdRef.current + 1;+ currentRequestIdRef.current = requestId;+ workerRef.current?.postMessage({+ type: "render-request",+ id: requestId,+ code: ranCode,+ } satisfies RenderMessageInput);+ }, [isReady, ranCode]);++ useEffect(() => {+ if (!isBlobUrl(lastSuccess?.outputUrl)) return;+ const url = lastSuccess.outputUrl;+ return () => URL.revokeObjectURL(url);+ }, [lastSuccess]);++ return { isReady, lastSuccess, renderError };+}diff --git a/components/playground/worker.ts b/components/playground/worker.tsnew file mode 100644index 0000000..ba2d041--- /dev/null+++ b/components/playground/worker.ts@@ -0,0 +1,106 @@+import initPdf, { render, type PageSize } from "takumi-pdf";+import { googleFonts } from "@takumi-rs/helpers";+import type * as React from "react";+import { renderToStaticMarkup } from "react-dom/server";+import { evaluateCodeExports, renderReact } from "./evaluate";+import { outputGeometry } from "./geometry";+import { inspectPdf } from "./inspect-pdf";+import { messageSchema, type RenderMessageInput } from "./schema";++function postMessage(message: RenderMessageInput, transfer?: Transferable[]) {+ return self.postMessage(message, { transfer });+}++const GOOGLE_FONT_NAMES = ["Inter", "Times New Roman"];++let fontsReady: ReturnType<typeof googleFonts> | undefined;+let wasmReady: Promise<unknown> | undefined;++function getFonts() {+ fontsReady ??= googleFonts(GOOGLE_FONT_NAMES);+ return fontsReady;+}++async function initWasm() {+ wasmReady ??= initPdf();+ await wasmReady;+}++async function renderRequest(id: number, code: string) {+ await initWasm();++ const { default: component, options } = evaluateCodeExports(code, renderReact);+ const element = renderReact.createElement(component as React.JSXElementConstructor<unknown>);+ const geometry = outputGeometry(options);++ postMessage({+ type: "preview-result",+ id,+ html: renderToStaticMarkup(element),+ width: geometry.width,+ height: geometry.height,+ padding: geometry.padding,+ });++ const fonts = await getFonts();+ const start = performance.now();++ const pdfOptions = options.pdf ?? {} as Record<string, unknown>;+ const pdfBytes = await render(element, {+ fonts,+ size: (pdfOptions.size as PageSize | undefined) ?? "a4",+ margin: pdfOptions.margin ?? { top: 48, right: 48, bottom: 48, left: 48 },+ ...pdfOptions,+ });++ const duration = performance.now() - start;++ postMessage(+ {+ type: "render-result",+ result: {+ status: "success",+ id,+ outputBuffer: pdfBytes,+ duration,+ outputKind: "pdf",+ outputFormat: "pdf",+ label: geometry.label,+ inspection: inspectPdf(pdfBytes),+ },+ },+ [pdfBytes.buffer],+ );+}++self.onmessage = async (event: MessageEvent) => {+ const payload = messageSchema.parse(event.data);++ switch (payload.type) {+ case "render-request": {+ try {+ await renderRequest(payload.id, payload.code);+ } catch (error) {+ postMessage({+ type: "render-result",+ result: {+ status: "error",+ id: payload.id,+ message: error instanceof Error ? error.message : "Unknown error",+ },+ });+ }+ break;+ }+ case "ready":+ case "render-result":+ case "preview-result": {+ throw new Error("Respond message should not be sent from main window.");+ }+ default: {+ payload satisfies never;+ }+ }+};++postMessage({ type: "ready" });diff --git a/components/site-settings.tsx b/components/site-settings.tsxindex 46b94b9..3b5ee52 100644--- a/components/site-settings.tsx+++ b/components/site-settings.tsx@@ -1,13 +1,11 @@"use client";import { SettingsIcon } from "lucide-react";-import { useRef, useState } from "react";-import { useHotkeys } from "react-hotkeys-hook";+import { useState } from "react";-import type { VibrateIconHandle } from "@/components/animated-icons/vibrate";-import { VibrateIcon } from "@/components/animated-icons/vibrate";-import type { Volume2IconHandle } from "@/components/animated-icons/volume-2";-import { Volume2Icon } from "@/components/animated-icons/volume-2";+import { HapticsSwitcher } from "@/components/haptics-switcher";+import { ModeSwitcher } from "@/components/mode-switcher";+import { SoundSwitcher } from "@/components/sound-switcher";import { Button } from "@/components/ui/button";import {Drawer,@@ -25,52 +23,19 @@ import {PopoverContent,PopoverTrigger,} from "@/components/ui/popover";-import { Toggle } from "@/components/ui/toggle";-import { useHapticsEnabled } from "@/hooks/use-haptic-toggle";-import { useIsMac } from "@/hooks/use-is-mac";+import { useHapticsToggle } from "@/hooks/use-haptic-toggle";import { useIsMobile } from "@/hooks/use-mobile";-import { useSoundEnabled } from "@/hooks/use-sound-toggle";+import { useSoundToggle } from "@/hooks/use-sound-toggle";+import { useThemeToggle } from "@/hooks/use-theme-toggle";export const SiteSettings = () => {- const volumeIconRef = useRef<Volume2IconHandle>(null);- const vibrateIconRef = useRef<VibrateIconHandle>(null);const [isOpen, setIsOpen] = useState(false);const isMobile = useIsMobile();- const isMac = useIsMac();- const [soundEnabled, setSoundEnabled] = useSoundEnabled();- const [hapticsEnabled, setHapticsEnabled] = useHapticsEnabled();- useHotkeys(- "meta+s, ctrl+s",- () => {- setSoundEnabled((prev) => !prev);- },- { preventDefault: true }- );-- useHotkeys(- "meta+h, ctrl+h",- () => {- setHapticsEnabled((prev) => !prev);- },- { preventDefault: true }- );-- const handleSoundMouseEnter = () => {- volumeIconRef.current?.startAnimation();- };-- const handleSoundMouseLeave = () => {- volumeIconRef.current?.stopAnimation();- };-- const handleHapticsMouseEnter = () => {- vibrateIconRef.current?.startAnimation();- };-- const handleHapticsMouseLeave = () => {- vibrateIconRef.current?.stopAnimation();- };+ // Hotkeys must stay mounted outside the popover content.+ useThemeToggle();+ useSoundToggle();+ useHapticsToggle();const trigger = (<Button@@ -84,40 +49,27 @@ export const SiteSettings = () => {);const content = (- <div className="flex flex-col gap-1">- <div className="flex items-center justify-between gap-2 pl-1">+ <div className="flex flex-col gap-2">+ <div className="flex items-center justify-between gap-4">+ <div className="flex items-center gap-2">+ <span className="w-12 text-sm">Theme</span>+ {!isMobile && <Kbd>D</Kbd>}+ </div>+ <ModeSwitcher />+ </div>+ <div className="flex items-center justify-between gap-4"><div className="flex items-center gap-2">- <span className="text-sm">Toggle Sound</span>- {!isMobile && <Kbd>{isMac ? "⌘" : "Ctrl"}+S</Kbd>}+ <span className="w-12 text-sm">Sound</span>+ {!isMobile && <Kbd>S</Kbd>}</div>- <Toggle- pressed={soundEnabled}- onPressedChange={setSoundEnabled}- aria-label="Toggle sound"- variant="ghost"- size="icon-sm"- onMouseEnter={handleSoundMouseEnter}- onMouseLeave={handleSoundMouseLeave}- >- <Volume2Icon ref={volumeIconRef} />- </Toggle>+ <SoundSwitcher /></div>- <div className="flex items-center justify-between gap-2 pl-1">+ <div className="flex items-center justify-between gap-4"><div className="flex items-center gap-2">- <span className="text-sm">Toggle Haptics</span>- {!isMobile && <Kbd>{isMac ? "⌘" : "Ctrl"}+H</Kbd>}+ <span className="w-12 text-sm">Haptics</span>+ {!isMobile && <Kbd>H</Kbd>}</div>- <Toggle- pressed={hapticsEnabled}- onPressedChange={setHapticsEnabled}- aria-label="Toggle haptics"- variant="ghost"- size="icon-sm"- onMouseEnter={handleHapticsMouseEnter}- onMouseLeave={handleHapticsMouseLeave}- >- <VibrateIcon ref={vibrateIconRef} />- </Toggle>+ <HapticsSwitcher /></div></div>);@@ -143,7 +95,13 @@ export const SiteSettings = () => {) : (<Popover open={isOpen} onOpenChange={setIsOpen} sounds><PopoverTrigger asChild>{trigger}</PopoverTrigger>- <PopoverContent className="p-1 w-fit">{content}</PopoverContent>+ <PopoverContent+ align="end"+ className="w-56 p-2 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-100 data-[state=open]:fade-in-0 data-[state=open]:zoom-in-100 dark:bg-black"+ onOpenAutoFocus={(event) => event.preventDefault()}+ >+ {content}+ </PopoverContent></Popover>)}</>diff --git a/components/sound-switcher.tsx b/components/sound-switcher.tsxnew file mode 100644index 0000000..8e92ca9--- /dev/null+++ b/components/sound-switcher.tsx@@ -0,0 +1,64 @@+"use client";++import { Volume2, VolumeX } from "lucide-react";++import { useFeedback } from "@/hooks/use-feedback";+import { useMounted } from "@/hooks/use-mounted";+import { useSoundEnabled } from "@/hooks/use-sound-toggle";+import { cn } from "@/lib/utils";++const SOUND_OPTIONS = [+ { icon: Volume2, label: "on", value: true },+ { icon: VolumeX, label: "off", value: false },+] as const;++export const SoundSwitcher = () => {+ const [value, setValue] = useSoundEnabled();+ const isMounted = useMounted();+ const feedbackOn = useFeedback({ sound: "toggleOn" });+ const feedbackOff = useFeedback({ sound: "toggleOff" });++ if (!isMounted) {+ return <div className="flex h-8 w-20" />;+ }++ return (+ <div+ className="inline-flex items-center rounded-full bg-background inset-ring-1 inset-ring-border"+ role="radiogroup"+ aria-label="Sound"+ >+ {SOUND_OPTIONS.map((option) => {+ const Icon = option.icon;+ const isActive = value === option.value;++ return (+ <button+ key={option.label}+ type="button"+ data-active={isActive}+ className={cn(+ "relative flex size-8 items-center justify-center rounded-full text-muted-foreground transition-[color,box-shadow] hover:text-foreground data-[active=true]:text-foreground data-[active=true]:inset-ring-1 data-[active=true]:inset-ring-border [&_svg]:size-4"+ )}+ role="radio"+ aria-checked={isActive}+ aria-label={`Switch sound ${option.label}`}+ onClick={() => {+ if (option.value === value) {+ return;+ }+ if (option.value) {+ feedbackOn();+ } else {+ feedbackOff();+ }+ setValue(option.value);+ }}+ >+ <Icon />+ </button>+ );+ })}+ </div>+ );+};diff --git a/constants/site.ts b/constants/site.tsindex 70c4c73..1efa5c3 100644--- a/constants/site.ts+++ b/constants/site.ts@@ -20,8 +20,8 @@ export const SITE = {TWITTER: "@alaymanguy",},DESCRIPTION: {- LONG: "A shadcn registry of PDF components for Takumi PDF and Forme PDF — invoices, reports, tables, and primitives with live PDF preview.",- SHORT: "PDF component registry for Takumi and Forme",+ LONG: "A collection of beautifully designed, accessible, and customizable PDF components. Built on Takumi PDF and Forme. Works with shadcn/ui.",+ SHORT: "Beautiful PDFs, made simple",},KEYWORDS: ["shadcn",diff --git a/content/docs/(root)/index.mdx b/content/docs/(root)/index.mdxindex ae01cf3..30eb573 100644--- a/content/docs/(root)/index.mdx+++ b/content/docs/(root)/index.mdx@@ -1,22 +1,73 @@----title: Introduction-description: pdfcn is a shadcn registry of PDF components for Takumi PDF and Forme PDF.+title: "Introduction"+description: "Copy-paste PDF components for React. Built on Takumi PDF and Forme, works with the shadcn CLI."----# pdfcn+**pdfcn** provides beautifully designed, accessible, and customizable PDF components. Built on [Takumi PDF](https://takumi.kane.tw/docs/pdf) and [Forme](https://docs.formepdf.com), and designed to work seamlessly with the [shadcn CLI](https://ui.shadcn.com).-A registry of PDF primitives, layouts, and document blocks with **100% parity** across two bases:+## Philosophy-- **Takumi PDF** — JSX/Tailwind to paged PDF (WASM). Browser preview via `react-pdf`.-- **Forme PDF** — React primitives with Forme’s layout engine. Client and server render.+pdfcn follows the shadcn model for document generation: copy-paste components you can own, with zero lock-in and sensible defaults that work immediately.-## Install+PDF layouts are often treated as one-off templates — assembled with renderer-specific primitives, duplicated styling, and brittle page-break logic. pdfcn takes a different approach. It stays close to each renderer's primitives, keeps the API familiar across Takumi PDF and Forme, and lets you drop down to the underlying renderer whenever you need more control.-```bash-npx shadcn@latest add @pdfcn/takumi/text-npx shadcn@latest add @pdfcn/forme/invoice-minimal-```+The goal is simple: make generated PDFs feel like the rest of your stack — composable, themeable, accessible, and easy to customize.-## Bases+## Why pdfcn?-Switch bases in the docs to see the same component implemented for each engine. Public props and variants match [pdfx](https://github.com/akii09/pdfx) — only the PDF primitives differ.+Most PDF component setups are either too opinionated or too scattered. pdfcn is built for teams that want to ship quickly without giving up control:++- **Own Your Code:** Copy the components into your project and customize everything.+- **Start Fast:** Run one command and render your first document with production-ready defaults.+- **Choose Your Engine:** Use the same component API with Takumi PDF or Forme, then drop to raw renderer APIs when needed.++## Two Rendering Bases++Every component and block ships in two implementations:++- [Takumi PDF](https://takumi.kane.tw/docs/pdf) — JSX and Tailwind-style classes rendered to paged, selectable-text PDFs with WebAssembly.+- [Forme](https://docs.formepdf.com) — React PDF primitives rendered with a page-native layout engine and first-class browser support.++The public props and variants follow [pdfx](https://github.com/akii09/pdfx); only the renderer-specific primitives differ.++## Features++<div className="not-prose grid gap-4 sm:grid-cols-2 mt-4">+ <FeatureCard+ icon={ZapIcon}+ title="Zero Config"+ description="Works out of the box with sensible defaults and renderer-aware installation."+ />+ <FeatureCard+ icon={SunMoonIcon}+ title="Theme Aware"+ description="Share a consistent PDF theme across components, blocks, and both rendering bases."+ />+ <FeatureCard+ icon={LayoutGridIcon}+ title="Composable"+ description="Build invoices, reports, forms, and tables from small declarative components."+ />+ <FeatureCard+ icon={Code2Icon}+ title="TypeScript"+ description="Full type safety with matching public props across Takumi PDF and Forme."+ />+ <FeatureCard+ icon={ClipboardCopyIcon}+ title="Copy & Paste"+ description="Own your PDF code. Install it into your project and customize every detail."+ />+ <FeatureCard+ icon={BlocksIcon}+ title="shadcn Compatible"+ description="Uses the shadcn registry format — add components and blocks with one command."+ />+</div>++import { ZapIcon } from "lucide-react";+import { SunMoonIcon } from "lucide-react";+import { LayoutGridIcon } from "lucide-react";+import { Code2Icon } from "lucide-react";+import { ClipboardCopyIcon } from "lucide-react";+import { BlocksIcon } from "lucide-react";diff --git a/content/docs/(root)/installation.mdx b/content/docs/(root)/installation.mdxindex 58cb689..cd45976 100644--- a/content/docs/(root)/installation.mdx+++ b/content/docs/(root)/installation.mdx@@ -1,103 +1,76 @@---title: Installation-description: How to use this template to build your own shadcn component.+description: Install PDF components, blocks, and themes from the registry.----## Building Your Component+## Prerequisites-### 1. Fork the Template+A React project that can run either [Takumi PDF](https://takumi.kane.tw/docs/pdf) or [Forme](https://docs.formepdf.com).-Click "Use this template" on [GitHub](https://github.com/shadcn-labs/startercn).+## Installation-### 2. Install Dependencies+Run the following command to add a Takumi PDF component:```bash-pnpm install+npx shadcn@latest add @pdfcn/takumi/text```-### 3. Create Your Component+Forme components use the `forme/` namespace:-Replace the placeholder at `registry/new-york/your-component.tsx`:+```bash+npx shadcn@latest add @pdfcn/forme/text+```-```tsx-import { forwardRef, HTMLAttributes } from "react";-import { cn } from "@/lib/utils";+The registry installs the matching renderer dependencies and the shared theme utilities required by the selected component.-export interface MyButtonProps extends HTMLAttributes<HTMLButtonElement> {- variant?: "default" | "outline";-}+## Usage-const MyButton = forwardRef<HTMLButtonElement, MyButtonProps>(- ({ className, variant = "default", ...props }, ref) => {- return (- <button- ref={ref}- className={cn(- "rounded-md px-4 py-2 font-medium",- variant === "default" && "bg-primary text-primary-foreground",- variant === "outline" && "border border-input",- className- )}- {...props}- />- );- }-);--MyButton.displayName = "MyButton";--export { MyButton };-```+Import the installed component and use it inside your renderer's document primitives:-### 4. Update registry.json--```json-{- "name": "your-name/your-registry",- "homepage": "https://your-site.com",- "items": [- {- "name": "my-button",- "type": "registry:ui",- "title": "My Button",- "description": "A custom button component.",- "files": [- {- "path": "registry/new-york/my-button.tsx",- "type": "registry:ui",- "target": "components/ui/my-button.tsx"- }- ]- }- ]+```tsx+import { Document, Page } from "@/components/pdf/takumi-primitives";+import { PdfcnThemeProvider } from "@/components/pdf/pdfcn-theme-context";+import { Text } from "@/components/pdf/text";++export function Invoice() {+ return (+ <Document>+ <Page size="A4">+ <PdfcnThemeProvider>+ <Text variant="title">Invoice</Text>+ </PdfcnThemeProvider>+ </Page>+ </Document>+ );}```-### 5. Build & Deploy+For Forme, use `Document` and `Page` from `@formepdf/react`; the installed pdfcn component API stays the same.++## Install a Block++Blocks are complete document templates composed from registry components:```bash-pnpm registry:build-pnpm build+npx shadcn@latest add @pdfcn/takumi/invoice-minimal```-Deploy your app and your component is live!+Use the `forme/` namespace for the equivalent Forme document:----+```bash+npx shadcn@latest add @pdfcn/forme/invoice-minimal+```-## Installing Components+## Install a Theme-To install a component from any registry built with this template:+pdfcn ships theme presets that integrate with `PdfcnThemeProvider`:```bash-npx shadcn@latest add https://example.com/r/my-button.json+npx shadcn@latest add @pdfcn/takumi/theme-minimal```-Then use it:+For Forme:-```tsx-import { MyButton } from "@/components/ui/my-button";--export function Demo() {- return <MyButton variant="outline">Click me</MyButton>;-}+```bash+npx shadcn@latest add @pdfcn/forme/theme-minimal```diff --git a/content/docs/blocks/forme/meta.json b/content/docs/blocks/forme/meta.jsonindex 9924d6b..fe3158f 100644--- a/content/docs/blocks/forme/meta.json+++ b/content/docs/blocks/forme/meta.json@@ -1,6 +1,6 @@{"pages": [- "index",+ "!index","invoice-classic","invoice-consultant","invoice-corporate",diff --git a/content/docs/blocks/index.mdx b/content/docs/blocks/index.mdxindex f39bf53..95472aa 100644--- a/content/docs/blocks/index.mdx+++ b/content/docs/blocks/index.mdx@@ -1,8 +1,6 @@---title: Blocks-description: Full PDF document templates — invoices and reports.+description: Pre-built invoices and reports composed from pdfcn components.----# Blocks--Invoice and report templates composed from registry components.+<ComponentsList className="mt-4" folderName="Blocks" base="takumi" />diff --git a/content/docs/blocks/invoice-classic.mdx b/content/docs/blocks/invoice-classic.mdxdeleted file mode 100644index 51e2128..0000000--- a/content/docs/blocks/invoice-classic.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Invoice Classic-description: Invoice Classic PDF block for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Invoice Classic--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/invoice-classic-```--<PdfPreview base="takumi" name="invoice-classic" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/invoice-classic-```--<PdfPreview base="forme" name="invoice-classic" />diff --git a/content/docs/blocks/invoice-consultant.mdx b/content/docs/blocks/invoice-consultant.mdxdeleted file mode 100644index 05e8959..0000000--- a/content/docs/blocks/invoice-consultant.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Invoice Consultant-description: Invoice Consultant PDF block for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Invoice Consultant--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/invoice-consultant-```--<PdfPreview base="takumi" name="invoice-consultant" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/invoice-consultant-```--<PdfPreview base="forme" name="invoice-consultant" />diff --git a/content/docs/blocks/invoice-corporate.mdx b/content/docs/blocks/invoice-corporate.mdxdeleted file mode 100644index a6c0191..0000000--- a/content/docs/blocks/invoice-corporate.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Invoice Corporate-description: Invoice Corporate PDF block for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Invoice Corporate--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/invoice-corporate-```--<PdfPreview base="takumi" name="invoice-corporate" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/invoice-corporate-```--<PdfPreview base="forme" name="invoice-corporate" />diff --git a/content/docs/blocks/invoice-creative.mdx b/content/docs/blocks/invoice-creative.mdxdeleted file mode 100644index 34978fb..0000000--- a/content/docs/blocks/invoice-creative.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Invoice Creative-description: Invoice Creative PDF block for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Invoice Creative--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/invoice-creative-```--<PdfPreview base="takumi" name="invoice-creative" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/invoice-creative-```--<PdfPreview base="forme" name="invoice-creative" />diff --git a/content/docs/blocks/invoice-minimal.mdx b/content/docs/blocks/invoice-minimal.mdxdeleted file mode 100644index 463c0df..0000000--- a/content/docs/blocks/invoice-minimal.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Invoice Minimal-description: Invoice Minimal PDF block for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Invoice Minimal--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/invoice-minimal-```--<PdfPreview base="takumi" name="invoice-minimal" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/invoice-minimal-```--<PdfPreview base="forme" name="invoice-minimal" />diff --git a/content/docs/blocks/invoice-modern.mdx b/content/docs/blocks/invoice-modern.mdxdeleted file mode 100644index aa26eef..0000000--- a/content/docs/blocks/invoice-modern.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Invoice Modern-description: Invoice Modern PDF block for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Invoice Modern--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/invoice-modern-```--<PdfPreview base="takumi" name="invoice-modern" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/invoice-modern-```--<PdfPreview base="forme" name="invoice-modern" />diff --git a/content/docs/blocks/report-financial.mdx b/content/docs/blocks/report-financial.mdxdeleted file mode 100644index 3701981..0000000--- a/content/docs/blocks/report-financial.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Report Financial-description: Report Financial PDF block for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Report Financial--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/report-financial-```--<PdfPreview base="takumi" name="report-financial" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/report-financial-```--<PdfPreview base="forme" name="report-financial" />diff --git a/content/docs/blocks/report-marketing.mdx b/content/docs/blocks/report-marketing.mdxdeleted file mode 100644index adc368e..0000000--- a/content/docs/blocks/report-marketing.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Report Marketing-description: Report Marketing PDF block for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Report Marketing--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/report-marketing-```--<PdfPreview base="takumi" name="report-marketing" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/report-marketing-```--<PdfPreview base="forme" name="report-marketing" />diff --git a/content/docs/blocks/report-operations.mdx b/content/docs/blocks/report-operations.mdxdeleted file mode 100644index 1636748..0000000--- a/content/docs/blocks/report-operations.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Report Operations-description: Report Operations PDF block for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Report Operations--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/report-operations-```--<PdfPreview base="takumi" name="report-operations" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/report-operations-```--<PdfPreview base="forme" name="report-operations" />diff --git a/content/docs/blocks/report-security.mdx b/content/docs/blocks/report-security.mdxdeleted file mode 100644index 2306fbc..0000000--- a/content/docs/blocks/report-security.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Report Security-description: Report Security PDF block for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Report Security--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/report-security-```--<PdfPreview base="takumi" name="report-security" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/report-security-```--<PdfPreview base="forme" name="report-security" />diff --git a/content/docs/blocks/takumi/meta.json b/content/docs/blocks/takumi/meta.jsonindex bba6ade..8f66c9d 100644--- a/content/docs/blocks/takumi/meta.json+++ b/content/docs/blocks/takumi/meta.json@@ -1,6 +1,6 @@{"pages": [- "index",+ "!index","invoice-classic","invoice-consultant","invoice-corporate",diff --git a/content/docs/components/alert.mdx b/content/docs/components/alert.mdxdeleted file mode 100644index b5f1b41..0000000--- a/content/docs/components/alert.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Alert-description: Alert PDF component for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Alert--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/alert-```--<PdfPreview base="takumi" name="alert" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/alert-```--<PdfPreview base="forme" name="alert" />diff --git a/content/docs/components/badge.mdx b/content/docs/components/badge.mdxdeleted file mode 100644index fdf15ca..0000000--- a/content/docs/components/badge.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Badge-description: Badge PDF component for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Badge--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/badge-```--<PdfPreview base="takumi" name="badge" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/badge-```--<PdfPreview base="forme" name="badge" />diff --git a/content/docs/components/card.mdx b/content/docs/components/card.mdxdeleted file mode 100644index fba8206..0000000--- a/content/docs/components/card.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Card-description: Card PDF component for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Card--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/card-```--<PdfPreview base="takumi" name="card" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/card-```--<PdfPreview base="forme" name="card" />diff --git a/content/docs/components/data-table.mdx b/content/docs/components/data-table.mdxdeleted file mode 100644index 831a784..0000000--- a/content/docs/components/data-table.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Data Table-description: Data Table PDF component for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Data Table--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/data-table-```--<PdfPreview base="takumi" name="data-table" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/data-table-```--<PdfPreview base="forme" name="data-table" />diff --git a/content/docs/components/divider.mdx b/content/docs/components/divider.mdxdeleted file mode 100644index c7b87ec..0000000--- a/content/docs/components/divider.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Divider-description: Divider PDF component for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Divider--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/divider-```--<PdfPreview base="takumi" name="divider" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/divider-```--<PdfPreview base="forme" name="divider" />diff --git a/content/docs/components/form.mdx b/content/docs/components/form.mdxdeleted file mode 100644index 34a85f1..0000000--- a/content/docs/components/form.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Form-description: Form PDF component for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Form--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/form-```--<PdfPreview base="takumi" name="form" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/form-```--<PdfPreview base="forme" name="form" />diff --git a/content/docs/components/forme/data-table.mdx b/content/docs/components/forme/data-table.mdxindex b414a90..56f05c8 100644--- a/content/docs/components/forme/data-table.mdx+++ b/content/docs/components/forme/data-table.mdx@@ -78,3 +78,37 @@ import { DataTable } from "@/components/pdf/data-table";data={[{ name: "Widget" }]}/>```++### Variants++Use any `TableVariant` for the table treatment and `size="compact"` for denser reports.++```tsx+<DataTable columns={columns} data={rows} variant="striped" size="compact" />+```++## API Reference++### DataTable++| Prop | Type | Default |+| ---------- | --------------------- | ----------- |+| `columns` | `DataTableColumn<T>[]` | - |+| `data` | `T[]` | - |+| `variant` | `TableVariant` | `'grid'` |+| `footer` | `Partial<Record<keyof T, string \| number>>` | - |+| `stripe` | `boolean` | `false` |+| `size` | `'default' \| 'compact'` | `'default'` |+| `noWrap` | `boolean` | `false` |+| `style` | `Style` | - |++### DataTableColumn++| Prop | Type | Default |+| -------------- | ----------------------------------------- | -------- |+| `key` | `keyof T & string` | - |+| `header` | `string` | - |+| `align` | `'left' \| 'center' \| 'right'` | `'left'` |+| `width` | `string \| number` | - |+| `render` | `(value, row) => ReactNode` | - |+| `renderFooter` | `(value) => ReactNode` | - |diff --git a/content/docs/components/forme/form.mdx b/content/docs/components/forme/form.mdxindex d046ba2..83a1c07 100644--- a/content/docs/components/forme/form.mdx+++ b/content/docs/components/forme/form.mdx@@ -75,3 +75,29 @@ import { PdfForm } from "@/components/pdf/form";```tsx<PdfForm title="Contact" groups={[{ fields: [{ label: "Email" }] }]} />```++### Variants++```tsx+<PdfForm+ variant="outlined"+ labelPosition="left"+ groups={[{ title: "Contact", layout: "two-column", fields }]}+/>+```++## API Reference++### PdfForm++| Prop | Type | Default |+| --------------- | ------------------- | ------------- |+| `title` | `string` | - |+| `subtitle` | `string` | - |+| `groups` | `PdfFormGroup[]` | - |+| `variant` | `PdfFormVariant` | `'underline'` |+| `labelPosition` | `'above' \| 'left'` | `'above'` |+| `noWrap` | `boolean` | `false` |+| `style` | `Style` | - |++`PdfFormVariant` is `'underline' | 'box' | 'outlined' | 'ghost'`. Groups support `single`, `two-column`, and `three-column` layouts.diff --git a/content/docs/components/forme/graph.mdx b/content/docs/components/forme/graph.mdxindex 22f05ab..9898363 100644--- a/content/docs/components/forme/graph.mdx+++ b/content/docs/components/forme/graph.mdx@@ -75,3 +75,38 @@ import { PdfGraph } from "@/components/pdf/graph";```tsx<PdfGraph variant="bar" data={[{ label: "Q1", value: 30 }]} />```++### Variants++```tsx+<PdfGraph variant="line" data={series} showDots smooth />+<PdfGraph variant="donut" data={totals} centerLabel="$48k" />+```++## API Reference++### PdfGraph++| Prop | Type | Default |+| ------------- | -------------------------------- | ---------- |+| `variant` | `GraphVariant` | `'bar'` |+| `data` | `GraphDataPoint[] \| GraphSeries[]` | - |+| `title` | `string` | - |+| `subtitle` | `string` | - |+| `xLabel` | `string` | - |+| `yLabel` | `string` | - |+| `width` | `number` | `420` |+| `height` | `number` | `260` |+| `fullWidth` | `boolean` | `false` |+| `colors` | `string[]` | theme |+| `showValues` | `boolean` | `false` |+| `showGrid` | `boolean` | `true` |+| `legend` | `'bottom' \| 'right' \| 'none'` | `'bottom'` |+| `centerLabel` | `string` | - |+| `showDots` | `boolean` | `true` |+| `smooth` | `boolean` | `false` |+| `yTicks` | `number` | `5` |+| `noWrap` | `boolean` | `true` |+| `style` | `Style` | - |++`GraphVariant` is `'bar' | 'horizontal-bar' | 'line' | 'area' | 'pie' | 'donut'`.diff --git a/content/docs/components/forme/list.mdx b/content/docs/components/forme/list.mdxindex f31dbd6..7cf8773 100644--- a/content/docs/components/forme/list.mdx+++ b/content/docs/components/forme/list.mdx@@ -75,3 +75,24 @@ import { PdfList } from "@/components/pdf/list";```tsx<PdfList items={[{ text: "Alpha" }, { text: "Beta" }]} />```++### Variants++```tsx+<PdfList variant="numbered" items={items} />+<PdfList variant="checklist" items={checklistItems} gap="md" />+```++## API Reference++### PdfList++| Prop | Type | Default |+| --------- | ---------------------------- | ---------- |+| `items` | `ListItem[]` | - |+| `variant` | `ListVariant` | `'bullet'` |+| `gap` | `'xs' \| 'sm' \| 'md'` | `'sm'` |+| `noWrap` | `boolean` | `false` |+| `style` | `Style` | - |++`ListVariant` is `'bullet' | 'numbered' | 'checklist' | 'icon' | 'multi-level' | 'descriptive'`.diff --git a/content/docs/components/forme/meta.json b/content/docs/components/forme/meta.jsonindex fe6570d..8231036 100644--- a/content/docs/components/forme/meta.json+++ b/content/docs/components/forme/meta.json@@ -1,6 +1,6 @@{"pages": [- "index",+ "!index","alert","badge","card",diff --git a/content/docs/components/forme/table.mdx b/content/docs/components/forme/table.mdxindex 15992c1..b0b7e2c 100644--- a/content/docs/components/forme/table.mdx+++ b/content/docs/components/forme/table.mdx@@ -90,3 +90,44 @@ import {</TableHeader></Table>```++### Variants++```tsx+<Table variant="striped" zebraStripe>+ {/* header, body, rows, and cells */}+</Table>+```++## API Reference++### Table++| Prop | Type | Default |+| ------------- | -------------- | -------- |+| `variant` | `TableVariant` | `'line'` |+| `zebraStripe` | `boolean` | `false` |+| `noWrap` | `boolean` | `false` |+| `children` | `ReactNode` | - |+| `style` | `Style` | - |++### TableRow++| Prop | Type | Default |+| --------- | -------------- | ------- |+| `header` | `boolean` | `false` |+| `footer` | `boolean` | `false` |+| `stripe` | `boolean` | `false` |+| `variant` | `TableVariant` | inherited |++### TableCell++| Prop | Type | Default |+| --------- | -------------------------------- | -------- |+| `header` | `boolean` | `false` |+| `footer` | `boolean` | `false` |+| `align` | `'left' \| 'center' \| 'right'` | `'left'` |+| `width` | `string \| number` | - |+| `variant` | `TableVariant` | inherited |++`TableVariant` is `'line' | 'grid' | 'minimal' | 'striped' | 'compact' | 'bordered' | 'primary-header'`.diff --git a/content/docs/components/graph.mdx b/content/docs/components/graph.mdxdeleted file mode 100644index 2cc3380..0000000--- a/content/docs/components/graph.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Graph-description: Graph PDF component for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Graph--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/graph-```--<PdfPreview base="takumi" name="graph" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/graph-```--<PdfPreview base="forme" name="graph" />diff --git a/content/docs/components/heading.mdx b/content/docs/components/heading.mdxdeleted file mode 100644index aae376e..0000000--- a/content/docs/components/heading.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Heading-description: Heading PDF component for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Heading--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/heading-```--<PdfPreview base="takumi" name="heading" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/heading-```--<PdfPreview base="forme" name="heading" />diff --git a/content/docs/components/index.mdx b/content/docs/components/index.mdxindex 9de235c..d5d9150 100644--- a/content/docs/components/index.mdx+++ b/content/docs/components/index.mdx@@ -1,8 +1,8 @@---title: Components-description: PDF UI primitives available on both Takumi and Forme bases.+description: Here you can find all the PDF components available in the library.----# Components+Every component is available for both the Takumi PDF and Forme bases with matching public props.-Every component exists for both `takumi` and `forme` with matching props.+<ComponentsList className="mt-4" base="takumi" />diff --git a/content/docs/components/keep-together.mdx b/content/docs/components/keep-together.mdxdeleted file mode 100644index e9b4506..0000000--- a/content/docs/components/keep-together.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Keep Together-description: Keep Together PDF component for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Keep Together--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/keep-together-```--<PdfPreview base="takumi" name="keep-together" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/keep-together-```--<PdfPreview base="forme" name="keep-together" />diff --git a/content/docs/components/key-value.mdx b/content/docs/components/key-value.mdxdeleted file mode 100644index 9a798c9..0000000--- a/content/docs/components/key-value.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Key Value-description: Key Value PDF component for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Key Value--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/key-value-```--<PdfPreview base="takumi" name="key-value" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/key-value-```--<PdfPreview base="forme" name="key-value" />diff --git a/content/docs/components/link.mdx b/content/docs/components/link.mdxdeleted file mode 100644index 896cb91..0000000--- a/content/docs/components/link.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Link-description: Link PDF component for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Link--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/link-```--<PdfPreview base="takumi" name="link" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/link-```--<PdfPreview base="forme" name="link" />diff --git a/content/docs/components/list.mdx b/content/docs/components/list.mdxdeleted file mode 100644index 49c357f..0000000--- a/content/docs/components/list.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: List-description: List PDF component for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# List--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/list-```--<PdfPreview base="takumi" name="list" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/list-```--<PdfPreview base="forme" name="list" />diff --git a/content/docs/components/page-break.mdx b/content/docs/components/page-break.mdxdeleted file mode 100644index 3c09ed2..0000000--- a/content/docs/components/page-break.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Page Break-description: Page Break PDF component for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Page Break--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/page-break-```--<PdfPreview base="takumi" name="page-break" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/page-break-```--<PdfPreview base="forme" name="page-break" />diff --git a/content/docs/components/page-footer.mdx b/content/docs/components/page-footer.mdxdeleted file mode 100644index d271a53..0000000--- a/content/docs/components/page-footer.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Page Footer-description: Page Footer PDF component for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Page Footer--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/page-footer-```--<PdfPreview base="takumi" name="page-footer" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/page-footer-```--<PdfPreview base="forme" name="page-footer" />diff --git a/content/docs/components/page-header.mdx b/content/docs/components/page-header.mdxdeleted file mode 100644index 9e458db..0000000--- a/content/docs/components/page-header.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Page Header-description: Page Header PDF component for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Page Header--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/page-header-```--<PdfPreview base="takumi" name="page-header" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/page-header-```--<PdfPreview base="forme" name="page-header" />diff --git a/content/docs/components/page-number.mdx b/content/docs/components/page-number.mdxdeleted file mode 100644index ddfa44c..0000000--- a/content/docs/components/page-number.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Page Number-description: Page Number PDF component for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Page Number--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/page-number-```--<PdfPreview base="takumi" name="page-number" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/page-number-```--<PdfPreview base="forme" name="page-number" />diff --git a/content/docs/components/pdf-image.mdx b/content/docs/components/pdf-image.mdxdeleted file mode 100644index 0ee1ede..0000000--- a/content/docs/components/pdf-image.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Pdf Image-description: Pdf Image PDF component for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Pdf Image--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/pdf-image-```--<PdfPreview base="takumi" name="pdf-image" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/pdf-image-```--<PdfPreview base="forme" name="pdf-image" />diff --git a/content/docs/components/qrcode.mdx b/content/docs/components/qrcode.mdxdeleted file mode 100644index e048e00..0000000--- a/content/docs/components/qrcode.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Qrcode-description: Qrcode PDF component for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Qrcode--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/qrcode-```--<PdfPreview base="takumi" name="qrcode" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/qrcode-```--<PdfPreview base="forme" name="qrcode" />diff --git a/content/docs/components/section.mdx b/content/docs/components/section.mdxdeleted file mode 100644index a58d1bf..0000000--- a/content/docs/components/section.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Section-description: Section PDF component for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Section--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/section-```--<PdfPreview base="takumi" name="section" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/section-```--<PdfPreview base="forme" name="section" />diff --git a/content/docs/components/signature.mdx b/content/docs/components/signature.mdxdeleted file mode 100644index bfba0d5..0000000--- a/content/docs/components/signature.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Signature-description: Signature PDF component for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Signature--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/signature-```--<PdfPreview base="takumi" name="signature" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/signature-```--<PdfPreview base="forme" name="signature" />diff --git a/content/docs/components/stack.mdx b/content/docs/components/stack.mdxdeleted file mode 100644index 302e562..0000000--- a/content/docs/components/stack.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Stack-description: Stack PDF component for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Stack--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/stack-```--<PdfPreview base="takumi" name="stack" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/stack-```--<PdfPreview base="forme" name="stack" />diff --git a/content/docs/components/table.mdx b/content/docs/components/table.mdxdeleted file mode 100644index 522f051..0000000--- a/content/docs/components/table.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Table-description: Table PDF component for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Table--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/table-```--<PdfPreview base="takumi" name="table" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/table-```--<PdfPreview base="forme" name="table" />diff --git a/content/docs/components/takumi/data-table.mdx b/content/docs/components/takumi/data-table.mdxindex c9399bc..5c96ccc 100644--- a/content/docs/components/takumi/data-table.mdx+++ b/content/docs/components/takumi/data-table.mdx@@ -90,3 +90,37 @@ import { DataTable } from "@/components/pdf/data-table";data={[{ name: "Widget" }]}/>```++### Variants++Use any `TableVariant` for the table treatment and `size="compact"` for denser reports.++```tsx+<DataTable columns={columns} data={rows} variant="striped" size="compact" />+```++## API Reference++### DataTable++| Prop | Type | Default |+| ---------- | --------------------- | ----------- |+| `columns` | `DataTableColumn<T>[]` | - |+| `data` | `T[]` | - |+| `variant` | `TableVariant` | `'grid'` |+| `footer` | `Partial<Record<keyof T, string \| number>>` | - |+| `stripe` | `boolean` | `false` |+| `size` | `'default' \| 'compact'` | `'default'` |+| `noWrap` | `boolean` | `false` |+| `style` | `Style` | - |++### DataTableColumn++| Prop | Type | Default |+| -------------- | ----------------------------------------- | -------- |+| `key` | `keyof T & string` | - |+| `header` | `string` | - |+| `align` | `'left' \| 'center' \| 'right'` | `'left'` |+| `width` | `string \| number` | - |+| `render` | `(value, row) => ReactNode` | - |+| `renderFooter` | `(value) => ReactNode` | - |diff --git a/content/docs/components/takumi/form.mdx b/content/docs/components/takumi/form.mdxindex 17b46c2..38acfe1 100644--- a/content/docs/components/takumi/form.mdx+++ b/content/docs/components/takumi/form.mdx@@ -87,3 +87,29 @@ import { PdfForm } from "@/components/pdf/form";```tsx<PdfForm title="Contact" groups={[{ fields: [{ label: "Email" }] }]} />```++### Variants++```tsx+<PdfForm+ variant="outlined"+ labelPosition="left"+ groups={[{ title: "Contact", layout: "two-column", fields }]}+/>+```++## API Reference++### PdfForm++| Prop | Type | Default |+| --------------- | ------------------- | ------------- |+| `title` | `string` | - |+| `subtitle` | `string` | - |+| `groups` | `PdfFormGroup[]` | - |+| `variant` | `PdfFormVariant` | `'underline'` |+| `labelPosition` | `'above' \| 'left'` | `'above'` |+| `noWrap` | `boolean` | `false` |+| `style` | `Style` | - |++`PdfFormVariant` is `'underline' | 'box' | 'outlined' | 'ghost'`. Groups support `single`, `two-column`, and `three-column` layouts.diff --git a/content/docs/components/takumi/graph.mdx b/content/docs/components/takumi/graph.mdxindex 4d3c9ea..45c7208 100644--- a/content/docs/components/takumi/graph.mdx+++ b/content/docs/components/takumi/graph.mdx@@ -87,3 +87,38 @@ import { PdfGraph } from "@/components/pdf/graph";```tsx<PdfGraph variant="bar" data={[{ label: "Q1", value: 30 }]} />```++### Variants++```tsx+<PdfGraph variant="line" data={series} showDots smooth />+<PdfGraph variant="donut" data={totals} centerLabel="$48k" />+```++## API Reference++### PdfGraph++| Prop | Type | Default |+| ------------- | -------------------------------- | ---------- |+| `variant` | `GraphVariant` | `'bar'` |+| `data` | `GraphDataPoint[] \| GraphSeries[]` | - |+| `title` | `string` | - |+| `subtitle` | `string` | - |+| `xLabel` | `string` | - |+| `yLabel` | `string` | - |+| `width` | `number` | `420` |+| `height` | `number` | `260` |+| `fullWidth` | `boolean` | `false` |+| `colors` | `string[]` | theme |+| `showValues` | `boolean` | `false` |+| `showGrid` | `boolean` | `true` |+| `legend` | `'bottom' \| 'right' \| 'none'` | `'bottom'` |+| `centerLabel` | `string` | - |+| `showDots` | `boolean` | `true` |+| `smooth` | `boolean` | `false` |+| `yTicks` | `number` | `5` |+| `noWrap` | `boolean` | `true` |+| `style` | `Style` | - |++`GraphVariant` is `'bar' | 'horizontal-bar' | 'line' | 'area' | 'pie' | 'donut'`.diff --git a/content/docs/components/takumi/list.mdx b/content/docs/components/takumi/list.mdxindex 9796b91..fbb696f 100644--- a/content/docs/components/takumi/list.mdx+++ b/content/docs/components/takumi/list.mdx@@ -87,3 +87,24 @@ import { PdfList } from "@/components/pdf/list";```tsx<PdfList items={[{ text: "Alpha" }, { text: "Beta" }]} />```++### Variants++```tsx+<PdfList variant="numbered" items={items} />+<PdfList variant="checklist" items={checklistItems} gap="md" />+```++## API Reference++### PdfList++| Prop | Type | Default |+| --------- | ---------------------------- | ---------- |+| `items` | `ListItem[]` | - |+| `variant` | `ListVariant` | `'bullet'` |+| `gap` | `'xs' \| 'sm' \| 'md'` | `'sm'` |+| `noWrap` | `boolean` | `false` |+| `style` | `Style` | - |++`ListVariant` is `'bullet' | 'numbered' | 'checklist' | 'icon' | 'multi-level' | 'descriptive'`.diff --git a/content/docs/components/takumi/meta.json b/content/docs/components/takumi/meta.jsonindex 7c91656..9848a80 100644--- a/content/docs/components/takumi/meta.json+++ b/content/docs/components/takumi/meta.json@@ -1,6 +1,6 @@{"pages": [- "index",+ "!index","alert","badge","card",diff --git a/content/docs/components/takumi/table.mdx b/content/docs/components/takumi/table.mdxindex 4754952..7ba7ebf 100644--- a/content/docs/components/takumi/table.mdx+++ b/content/docs/components/takumi/table.mdx@@ -102,3 +102,44 @@ import {</TableHeader></Table>```++### Variants++```tsx+<Table variant="striped" zebraStripe>+ {/* header, body, rows, and cells */}+</Table>+```++## API Reference++### Table++| Prop | Type | Default |+| ------------- | -------------- | -------- |+| `variant` | `TableVariant` | `'line'` |+| `zebraStripe` | `boolean` | `false` |+| `noWrap` | `boolean` | `false` |+| `children` | `ReactNode` | - |+| `style` | `Style` | - |++### TableRow++| Prop | Type | Default |+| --------- | -------------- | ------- |+| `header` | `boolean` | `false` |+| `footer` | `boolean` | `false` |+| `stripe` | `boolean` | `false` |+| `variant` | `TableVariant` | inherited |++### TableCell++| Prop | Type | Default |+| --------- | -------------------------------- | -------- |+| `header` | `boolean` | `false` |+| `footer` | `boolean` | `false` |+| `align` | `'left' \| 'center' \| 'right'` | `'left'` |+| `width` | `string \| number` | - |+| `variant` | `TableVariant` | inherited |++`TableVariant` is `'line' | 'grid' | 'minimal' | 'striped' | 'compact' | 'bordered' | 'primary-header'`.diff --git a/content/docs/components/text.mdx b/content/docs/components/text.mdxdeleted file mode 100644index 36a6ab9..0000000--- a/content/docs/components/text.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Text-description: Text PDF component for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Text--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/text-```--<PdfPreview base="takumi" name="text" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/text-```--<PdfPreview base="forme" name="text" />diff --git a/content/docs/components/watermark.mdx b/content/docs/components/watermark.mdxdeleted file mode 100644index dea80d7..0000000--- a/content/docs/components/watermark.mdx+++ /dev/null@@ -1,24 +0,0 @@-----title: Watermark-description: Watermark PDF component for Takumi and Forme.------import { PdfPreview } from "@/components/pdf-preview";--# Watermark--## Takumi--```bash-npx shadcn@latest add @pdfcn/takumi/watermark-```--<PdfPreview base="takumi" name="watermark" />--## Forme--```bash-npx shadcn@latest add @pdfcn/forme/watermark-```--<PdfPreview base="forme" name="watermark" />diff --git a/examples/__forme__.ts b/examples/__forme__.tsnew file mode 100644index 0000000..45a77ea--- /dev/null+++ b/examples/__forme__.ts@@ -0,0 +1,76 @@+import type { ComponentType } from "react";++import forme_alert from "@/examples/forme/alert";+import forme_badge from "@/examples/forme/badge";+import forme_card from "@/examples/forme/card";+import forme_data_table from "@/examples/forme/data-table";+import forme_divider from "@/examples/forme/divider";+import forme_form from "@/examples/forme/form";+import forme_graph from "@/examples/forme/graph";+import forme_heading from "@/examples/forme/heading";+import forme_invoice_classic from "@/examples/forme/invoice-classic";+import forme_invoice_consultant from "@/examples/forme/invoice-consultant";+import forme_invoice_corporate from "@/examples/forme/invoice-corporate";+import forme_invoice_creative from "@/examples/forme/invoice-creative";+import forme_invoice_minimal from "@/examples/forme/invoice-minimal";+import forme_invoice_modern from "@/examples/forme/invoice-modern";+import forme_keep_together from "@/examples/forme/keep-together";+import forme_key_value from "@/examples/forme/key-value";+import forme_link from "@/examples/forme/link";+import forme_list from "@/examples/forme/list";+import forme_page_break from "@/examples/forme/page-break";+import forme_page_footer from "@/examples/forme/page-footer";+import forme_page_header from "@/examples/forme/page-header";+import forme_page_number from "@/examples/forme/page-number";+import forme_pdf_image from "@/examples/forme/pdf-image";+import forme_qrcode from "@/examples/forme/qrcode";+import forme_report_financial from "@/examples/forme/report-financial";+import forme_report_marketing from "@/examples/forme/report-marketing";+import forme_report_operations from "@/examples/forme/report-operations";+import forme_report_security from "@/examples/forme/report-security";+import forme_section from "@/examples/forme/section";+import forme_signature from "@/examples/forme/signature";+import forme_stack from "@/examples/forme/stack";+import forme_table from "@/examples/forme/table";+import forme_text from "@/examples/forme/text";+import forme_watermark from "@/examples/forme/watermark";++export type DemoName = string;+type DemoMap = Record<string, ComponentType>;++export const demos: DemoMap = {+ alert: forme_alert,+ badge: forme_badge,+ card: forme_card,+ "data-table": forme_data_table,+ divider: forme_divider,+ form: forme_form,+ graph: forme_graph,+ heading: forme_heading,+ "invoice-classic": forme_invoice_classic,+ "invoice-consultant": forme_invoice_consultant,+ "invoice-corporate": forme_invoice_corporate,+ "invoice-creative": forme_invoice_creative,+ "invoice-minimal": forme_invoice_minimal,+ "invoice-modern": forme_invoice_modern,+ "keep-together": forme_keep_together,+ "key-value": forme_key_value,+ link: forme_link,+ list: forme_list,+ "page-break": forme_page_break,+ "page-footer": forme_page_footer,+ "page-header": forme_page_header,+ "page-number": forme_page_number,+ "pdf-image": forme_pdf_image,+ qrcode: forme_qrcode,+ "report-financial": forme_report_financial,+ "report-marketing": forme_report_marketing,+ "report-operations": forme_report_operations,+ "report-security": forme_report_security,+ section: forme_section,+ signature: forme_signature,+ stack: forme_stack,+ table: forme_table,+ text: forme_text,+ watermark: forme_watermark,+};diff --git a/examples/__index__.ts b/examples/__index__.tsindex 0e8dcb1..eb50a6c 100644--- a/examples/__index__.ts+++ b/examples/__index__.ts@@ -1,39 +1,6 @@import type { ComponentType } from "react";+import type { BaseName } from "@/registry/bases";-import forme_alert from "@/examples/forme/alert";-import forme_badge from "@/examples/forme/badge";-import forme_card from "@/examples/forme/card";-import forme_data_table from "@/examples/forme/data-table";-import forme_divider from "@/examples/forme/divider";-import forme_form from "@/examples/forme/form";-import forme_graph from "@/examples/forme/graph";-import forme_heading from "@/examples/forme/heading";-import forme_invoice_classic from "@/examples/forme/invoice-classic";-import forme_invoice_consultant from "@/examples/forme/invoice-consultant";-import forme_invoice_corporate from "@/examples/forme/invoice-corporate";-import forme_invoice_creative from "@/examples/forme/invoice-creative";-import forme_invoice_minimal from "@/examples/forme/invoice-minimal";-import forme_invoice_modern from "@/examples/forme/invoice-modern";-import forme_keep_together from "@/examples/forme/keep-together";-import forme_key_value from "@/examples/forme/key-value";-import forme_link from "@/examples/forme/link";-import forme_list from "@/examples/forme/list";-import forme_page_break from "@/examples/forme/page-break";-import forme_page_footer from "@/examples/forme/page-footer";-import forme_page_header from "@/examples/forme/page-header";-import forme_page_number from "@/examples/forme/page-number";-import forme_pdf_image from "@/examples/forme/pdf-image";-import forme_qrcode from "@/examples/forme/qrcode";-import forme_report_financial from "@/examples/forme/report-financial";-import forme_report_marketing from "@/examples/forme/report-marketing";-import forme_report_operations from "@/examples/forme/report-operations";-import forme_report_security from "@/examples/forme/report-security";-import forme_section from "@/examples/forme/section";-import forme_signature from "@/examples/forme/signature";-import forme_stack from "@/examples/forme/stack";-import forme_table from "@/examples/forme/table";-import forme_text from "@/examples/forme/text";-import forme_watermark from "@/examples/forme/watermark";import takumi_alert from "@/examples/takumi/alert";import takumi_badge from "@/examples/takumi/badge";import takumi_card from "@/examples/takumi/card";@@ -42,12 +9,6 @@ import takumi_divider from "@/examples/takumi/divider";import takumi_form from "@/examples/takumi/form";import takumi_graph from "@/examples/takumi/graph";import takumi_heading from "@/examples/takumi/heading";-import takumi_invoice_classic from "@/examples/takumi/invoice-classic";-import takumi_invoice_consultant from "@/examples/takumi/invoice-consultant";-import takumi_invoice_corporate from "@/examples/takumi/invoice-corporate";-import takumi_invoice_creative from "@/examples/takumi/invoice-creative";-import takumi_invoice_minimal from "@/examples/takumi/invoice-minimal";-import takumi_invoice_modern from "@/examples/takumi/invoice-modern";import takumi_keep_together from "@/examples/takumi/keep-together";import takumi_key_value from "@/examples/takumi/key-value";import takumi_link from "@/examples/takumi/link";@@ -58,92 +19,131 @@ import takumi_page_header from "@/examples/takumi/page-header";import takumi_page_number from "@/examples/takumi/page-number";import takumi_pdf_image from "@/examples/takumi/pdf-image";import takumi_qrcode from "@/examples/takumi/qrcode";-import takumi_report_financial from "@/examples/takumi/report-financial";-import takumi_report_marketing from "@/examples/takumi/report-marketing";-import takumi_report_operations from "@/examples/takumi/report-operations";-import takumi_report_security from "@/examples/takumi/report-security";import takumi_section from "@/examples/takumi/section";import takumi_signature from "@/examples/takumi/signature";import takumi_stack from "@/examples/takumi/stack";import takumi_table from "@/examples/takumi/table";import takumi_text from "@/examples/takumi/text";import takumi_watermark from "@/examples/takumi/watermark";-import type { BaseName } from "@/registry/bases";+import takumi_invoice_classic from "@/examples/takumi/invoice-classic";+import takumi_invoice_consultant from "@/examples/takumi/invoice-consultant";+import takumi_invoice_corporate from "@/examples/takumi/invoice-corporate";+import takumi_invoice_creative from "@/examples/takumi/invoice-creative";+import takumi_invoice_minimal from "@/examples/takumi/invoice-minimal";+import takumi_invoice_modern from "@/examples/takumi/invoice-modern";+import takumi_report_financial from "@/examples/takumi/report-financial";+import takumi_report_marketing from "@/examples/takumi/report-marketing";+import takumi_report_operations from "@/examples/takumi/report-operations";+import takumi_report_security from "@/examples/takumi/report-security";+import forme_alert from "@/examples/forme/alert";+import forme_badge from "@/examples/forme/badge";+import forme_card from "@/examples/forme/card";+import forme_data_table from "@/examples/forme/data-table";+import forme_divider from "@/examples/forme/divider";+import forme_form from "@/examples/forme/form";+import forme_graph from "@/examples/forme/graph";+import forme_heading from "@/examples/forme/heading";+import forme_keep_together from "@/examples/forme/keep-together";+import forme_key_value from "@/examples/forme/key-value";+import forme_link from "@/examples/forme/link";+import forme_list from "@/examples/forme/list";+import forme_page_break from "@/examples/forme/page-break";+import forme_page_footer from "@/examples/forme/page-footer";+import forme_page_header from "@/examples/forme/page-header";+import forme_page_number from "@/examples/forme/page-number";+import forme_pdf_image from "@/examples/forme/pdf-image";+import forme_qrcode from "@/examples/forme/qrcode";+import forme_section from "@/examples/forme/section";+import forme_signature from "@/examples/forme/signature";+import forme_stack from "@/examples/forme/stack";+import forme_table from "@/examples/forme/table";+import forme_text from "@/examples/forme/text";+import forme_watermark from "@/examples/forme/watermark";+import forme_invoice_classic from "@/examples/forme/invoice-classic";+import forme_invoice_consultant from "@/examples/forme/invoice-consultant";+import forme_invoice_corporate from "@/examples/forme/invoice-corporate";+import forme_invoice_creative from "@/examples/forme/invoice-creative";+import forme_invoice_minimal from "@/examples/forme/invoice-minimal";+import forme_invoice_modern from "@/examples/forme/invoice-modern";+import forme_report_financial from "@/examples/forme/report-financial";+import forme_report_marketing from "@/examples/forme/report-marketing";+import forme_report_operations from "@/examples/forme/report-operations";+import forme_report_security from "@/examples/forme/report-security";type DemoMap = Record<string, ComponentType>;export const demos: Record<BaseName, DemoMap> = {- forme: {- alert: forme_alert,- badge: forme_badge,- card: forme_card,- "data-table": forme_data_table,- divider: forme_divider,- form: forme_form,- graph: forme_graph,- heading: forme_heading,- "invoice-classic": forme_invoice_classic,- "invoice-consultant": forme_invoice_consultant,- "invoice-corporate": forme_invoice_corporate,- "invoice-creative": forme_invoice_creative,- "invoice-minimal": forme_invoice_minimal,- "invoice-modern": forme_invoice_modern,- "keep-together": forme_keep_together,- "key-value": forme_key_value,- link: forme_link,- list: forme_list,- "page-break": forme_page_break,- "page-footer": forme_page_footer,- "page-header": forme_page_header,- "page-number": forme_page_number,- "pdf-image": forme_pdf_image,- qrcode: forme_qrcode,- "report-financial": forme_report_financial,- "report-marketing": forme_report_marketing,- "report-operations": forme_report_operations,- "report-security": forme_report_security,- section: forme_section,- signature: forme_signature,- stack: forme_stack,- table: forme_table,- text: forme_text,- watermark: forme_watermark,- },takumi: {- alert: takumi_alert,- badge: takumi_badge,- card: takumi_card,+ "alert": takumi_alert,+ "badge": takumi_badge,+ "card": takumi_card,"data-table": takumi_data_table,- divider: takumi_divider,- form: takumi_form,- graph: takumi_graph,- heading: takumi_heading,- "invoice-classic": takumi_invoice_classic,- "invoice-consultant": takumi_invoice_consultant,- "invoice-corporate": takumi_invoice_corporate,- "invoice-creative": takumi_invoice_creative,- "invoice-minimal": takumi_invoice_minimal,- "invoice-modern": takumi_invoice_modern,+ "divider": takumi_divider,+ "form": takumi_form,+ "graph": takumi_graph,+ "heading": takumi_heading,"keep-together": takumi_keep_together,"key-value": takumi_key_value,- link: takumi_link,- list: takumi_list,+ "link": takumi_link,+ "list": takumi_list,"page-break": takumi_page_break,"page-footer": takumi_page_footer,"page-header": takumi_page_header,"page-number": takumi_page_number,"pdf-image": takumi_pdf_image,- qrcode: takumi_qrcode,+ "qrcode": takumi_qrcode,+ "section": takumi_section,+ "signature": takumi_signature,+ "stack": takumi_stack,+ "table": takumi_table,+ "text": takumi_text,+ "watermark": takumi_watermark,+ "invoice-classic": takumi_invoice_classic,+ "invoice-consultant": takumi_invoice_consultant,+ "invoice-corporate": takumi_invoice_corporate,+ "invoice-creative": takumi_invoice_creative,+ "invoice-minimal": takumi_invoice_minimal,+ "invoice-modern": takumi_invoice_modern,"report-financial": takumi_report_financial,"report-marketing": takumi_report_marketing,"report-operations": takumi_report_operations,"report-security": takumi_report_security,- section: takumi_section,- signature: takumi_signature,- stack: takumi_stack,- table: takumi_table,- text: takumi_text,- watermark: takumi_watermark,+ },+ forme: {+ "alert": forme_alert,+ "badge": forme_badge,+ "card": forme_card,+ "data-table": forme_data_table,+ "divider": forme_divider,+ "form": forme_form,+ "graph": forme_graph,+ "heading": forme_heading,+ "keep-together": forme_keep_together,+ "key-value": forme_key_value,+ "link": forme_link,+ "list": forme_list,+ "page-break": forme_page_break,+ "page-footer": forme_page_footer,+ "page-header": forme_page_header,+ "page-number": forme_page_number,+ "pdf-image": forme_pdf_image,+ "qrcode": forme_qrcode,+ "section": forme_section,+ "signature": forme_signature,+ "stack": forme_stack,+ "table": forme_table,+ "text": forme_text,+ "watermark": forme_watermark,+ "invoice-classic": forme_invoice_classic,+ "invoice-consultant": forme_invoice_consultant,+ "invoice-corporate": forme_invoice_corporate,+ "invoice-creative": forme_invoice_creative,+ "invoice-minimal": forme_invoice_minimal,+ "invoice-modern": forme_invoice_modern,+ "report-financial": forme_report_financial,+ "report-marketing": forme_report_marketing,+ "report-operations": forme_report_operations,+ "report-security": forme_report_security,},};diff --git a/examples/__takumi__.ts b/examples/__takumi__.tsnew file mode 100644index 0000000..65fe86b--- /dev/null+++ b/examples/__takumi__.ts@@ -0,0 +1,76 @@+import type { ComponentType } from "react";++import takumi_alert from "@/examples/takumi/alert";+import takumi_badge from "@/examples/takumi/badge";+import takumi_card from "@/examples/takumi/card";+import takumi_data_table from "@/examples/takumi/data-table";+import takumi_divider from "@/examples/takumi/divider";+import takumi_form from "@/examples/takumi/form";+import takumi_graph from "@/examples/takumi/graph";+import takumi_heading from "@/examples/takumi/heading";+import takumi_invoice_classic from "@/examples/takumi/invoice-classic";+import takumi_invoice_consultant from "@/examples/takumi/invoice-consultant";+import takumi_invoice_corporate from "@/examples/takumi/invoice-corporate";+import takumi_invoice_creative from "@/examples/takumi/invoice-creative";+import takumi_invoice_minimal from "@/examples/takumi/invoice-minimal";+import takumi_invoice_modern from "@/examples/takumi/invoice-modern";+import takumi_keep_together from "@/examples/takumi/keep-together";+import takumi_key_value from "@/examples/takumi/key-value";+import takumi_link from "@/examples/takumi/link";+import takumi_list from "@/examples/takumi/list";+import takumi_page_break from "@/examples/takumi/page-break";+import takumi_page_footer from "@/examples/takumi/page-footer";+import takumi_page_header from "@/examples/takumi/page-header";+import takumi_page_number from "@/examples/takumi/page-number";+import takumi_pdf_image from "@/examples/takumi/pdf-image";+import takumi_qrcode from "@/examples/takumi/qrcode";+import takumi_report_financial from "@/examples/takumi/report-financial";+import takumi_report_marketing from "@/examples/takumi/report-marketing";+import takumi_report_operations from "@/examples/takumi/report-operations";+import takumi_report_security from "@/examples/takumi/report-security";+import takumi_section from "@/examples/takumi/section";+import takumi_signature from "@/examples/takumi/signature";+import takumi_stack from "@/examples/takumi/stack";+import takumi_table from "@/examples/takumi/table";+import takumi_text from "@/examples/takumi/text";+import takumi_watermark from "@/examples/takumi/watermark";++export type DemoName = string;+type DemoMap = Record<string, ComponentType>;++export const demos: DemoMap = {+ alert: takumi_alert,+ badge: takumi_badge,+ card: takumi_card,+ "data-table": takumi_data_table,+ divider: takumi_divider,+ form: takumi_form,+ graph: takumi_graph,+ heading: takumi_heading,+ "invoice-classic": takumi_invoice_classic,+ "invoice-consultant": takumi_invoice_consultant,+ "invoice-corporate": takumi_invoice_corporate,+ "invoice-creative": takumi_invoice_creative,+ "invoice-minimal": takumi_invoice_minimal,+ "invoice-modern": takumi_invoice_modern,+ "keep-together": takumi_keep_together,+ "key-value": takumi_key_value,+ link: takumi_link,+ list: takumi_list,+ "page-break": takumi_page_break,+ "page-footer": takumi_page_footer,+ "page-header": takumi_page_header,+ "page-number": takumi_page_number,+ "pdf-image": takumi_pdf_image,+ qrcode: takumi_qrcode,+ "report-financial": takumi_report_financial,+ "report-marketing": takumi_report_marketing,+ "report-operations": takumi_report_operations,+ "report-security": takumi_report_security,+ section: takumi_section,+ signature: takumi_signature,+ stack: takumi_stack,+ table: takumi_table,+ text: takumi_text,+ watermark: takumi_watermark,+};diff --git a/examples/forme/alert.tsx b/examples/forme/alert.tsxindex a68ec65..9dce630 100644--- a/examples/forme/alert.tsx+++ b/examples/forme/alert.tsx@@ -1,21 +1,18 @@import { Document, Page } from "@formepdf/react";-import { PdfAlert } from "@/registry/bases/forme/components/alert";-import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";-const DemoBody = () => (- <PdfAlert variant="info" title="Info">- Alert body- </PdfAlert>-);-const Demo = () => (- <Document>- <Page size="A4" margin={48}>- <PdfcnThemeProvider>+const Demo =() => {+ return (+ <Document>+ <Page size="A4" margin={48}><DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <PdfAlert variant="info" title="Info">Alert body</PdfAlert>;+}diff --git a/examples/forme/badge.tsx b/examples/forme/badge.tsxindex dd69a3d..cb5fc6c 100644--- a/examples/forme/badge.tsx+++ b/examples/forme/badge.tsx@@ -1,17 +1,18 @@import { Document, Page } from "@formepdf/react";-import { Badge } from "@/registry/bases/forme/components/badge";-import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";-const DemoBody = () => <Badge>Badge</Badge>;-const Demo = () => (- <Document>- <Page size="A4" margin={48}>- <PdfcnThemeProvider>+const Demo =() => {+ return (+ <Document>+ <Page size="A4" margin={48}><DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <Badge>Badge</Badge>;+}diff --git a/examples/forme/card.tsx b/examples/forme/card.tsxindex dadcf54..a65f938 100644--- a/examples/forme/card.tsx+++ b/examples/forme/card.tsx@@ -1,17 +1,18 @@import { Document, Page } from "@formepdf/react";-import { PdfCard } from "@/registry/bases/forme/components/card";-import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";-const DemoBody = () => <PdfCard title="Card">Card body</PdfCard>;-const Demo = () => (- <Document>- <Page size="A4" margin={48}>- <PdfcnThemeProvider>+const Demo =() => {+ return (+ <Document>+ <Page size="A4" margin={48}><DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <PdfCard title="Card">Card body</PdfCard>;+}diff --git a/examples/forme/data-table.tsx b/examples/forme/data-table.tsxindex 09c39c9..c44daaa 100644--- a/examples/forme/data-table.tsx+++ b/examples/forme/data-table.tsx@@ -1,28 +1,29 @@import { Document, Page } from "@formepdf/react";-import { DataTable } from "@/registry/bases/forme/components/data-table";-import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";-const DemoBody = () => (- <DataTable- columns={[- { header: "Name", key: "name" },- { header: "Price", key: "price" },- ]}- data={[- { name: "Widget", price: "const Demo =0" },- { name: "Gadget", price: "$20" },- ]}- />-);-const Demo = () => (- <Document>- <Page size="A4" margin={48}>- <PdfcnThemeProvider>+const Demo =() => {+ return (+ <Document>+ <Page size="A4" margin={48}><DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return (+ <DataTable+ columns={[+ { key: "name", header: "Name" },+ { key: "price", header: "Price" },+ ]}+ data={[+ { name: "Widget", price: "$10" },+ { name: "Gadget", price: "$20" },+ ]}+ />+ );+}diff --git a/examples/forme/divider.tsx b/examples/forme/divider.tsxindex 99c26ac..aa21c3f 100644--- a/examples/forme/divider.tsx+++ b/examples/forme/divider.tsx@@ -1,17 +1,18 @@import { Document, Page } from "@formepdf/react";-import { Divider } from "@/registry/bases/forme/components/divider";-import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";-const DemoBody = () => <Divider />;-const Demo = () => (- <Document>- <Page size="A4" margin={48}>- <PdfcnThemeProvider>+const Demo =() => {+ return (+ <Document>+ <Page size="A4" margin={48}><DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <Divider />;+}diff --git a/examples/forme/form.tsx b/examples/forme/form.tsxindex 27a8b9e..24f2ae6 100644--- a/examples/forme/form.tsx+++ b/examples/forme/form.tsx@@ -1,22 +1,23 @@import { Document, Page } from "@formepdf/react";-import { PdfForm } from "@/registry/bases/forme/components/form";-import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";-const DemoBody = () => (- <PdfForm- title="Contact"- groups={[{ fields: [{ label: "Email" }, { label: "Phone" }] }]}- />-);-const Demo = () => (- <Document>- <Page size="A4" margin={48}>- <PdfcnThemeProvider>+const Demo =() => {+ return (+ <Document>+ <Page size="A4" margin={48}><DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return (+ <PdfForm+ title="Contact"+ groups={[{ fields: [{ label: "Email" }, { label: "Phone" }] }]}+ />+ );+}diff --git a/examples/forme/graph.tsx b/examples/forme/graph.tsxindex c58168e..968e28d 100644--- a/examples/forme/graph.tsx+++ b/examples/forme/graph.tsx@@ -1,26 +1,27 @@import { Document, Page } from "@formepdf/react";-import { PdfGraph } from "@/registry/bases/forme/components/graph";-import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";-const DemoBody = () => (- <PdfGraph- variant="bar"- data={[- { label: "Q1", value: 30 },- { label: "Q2", value: 45 },- { label: "Q3", value: 28 },- ]}- />-);-const Demo = () => (- <Document>- <Page size="A4" margin={48}>- <PdfcnThemeProvider>+const Demo =() => {+ return (+ <Document>+ <Page size="A4" margin={48}><DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return (+ <PdfGraph+ variant="bar"+ data={[+ { label: "Q1", value: 30 },+ { label: "Q2", value: 45 },+ { label: "Q3", value: 28 },+ ]}+ />+ );+}diff --git a/examples/forme/heading.tsx b/examples/forme/heading.tsxindex c4473b7..5efd327 100644--- a/examples/forme/heading.tsx+++ b/examples/forme/heading.tsx@@ -1,17 +1,18 @@import { Document, Page } from "@formepdf/react";-import { Heading } from "@/registry/bases/forme/components/heading";-import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";-const DemoBody = () => <Heading level={1}>Heading</Heading>;-const Demo = () => (- <Document>- <Page size="A4" margin={48}>- <PdfcnThemeProvider>+const Demo =() => {+ return (+ <Document>+ <Page size="A4" margin={48}><DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <Heading level={1}>Heading</Heading>;+}diff --git a/examples/forme/invoice-classic.tsx b/examples/forme/invoice-classic.tsxindex 2ad6be1..e31ef0c 100644--- a/examples/forme/invoice-classic.tsx+++ b/examples/forme/invoice-classic.tsx@@ -1,4 +1,6 @@import { InvoiceClassicDocument } from "@/registry/bases/forme/blocks/invoice-classic/invoice-classic";-const Demo = () => <InvoiceClassicDocument />;+const Demo =() => {+ return <InvoiceClassicDocument />;+}export default Demo;diff --git a/examples/forme/invoice-consultant.tsx b/examples/forme/invoice-consultant.tsxindex b687643..2227f7d 100644--- a/examples/forme/invoice-consultant.tsx+++ b/examples/forme/invoice-consultant.tsx@@ -1,4 +1,6 @@import { InvoiceConsultantDocument } from "@/registry/bases/forme/blocks/invoice-consultant/invoice-consultant";-const Demo = () => <InvoiceConsultantDocument />;+const Demo =() => {+ return <InvoiceConsultantDocument />;+}export default Demo;diff --git a/examples/forme/invoice-corporate.tsx b/examples/forme/invoice-corporate.tsxindex 83dbc9f..e6bf213 100644--- a/examples/forme/invoice-corporate.tsx+++ b/examples/forme/invoice-corporate.tsx@@ -1,4 +1,6 @@import { InvoiceCorporateDocument } from "@/registry/bases/forme/blocks/invoice-corporate/invoice-corporate";-const Demo = () => <InvoiceCorporateDocument />;+const Demo =() => {+ return <InvoiceCorporateDocument />;+}export default Demo;diff --git a/examples/forme/invoice-creative.tsx b/examples/forme/invoice-creative.tsxindex 72efa05..6e089f2 100644--- a/examples/forme/invoice-creative.tsx+++ b/examples/forme/invoice-creative.tsx@@ -1,4 +1,6 @@import { InvoiceCreativeDocument } from "@/registry/bases/forme/blocks/invoice-creative/invoice-creative";-const Demo = () => <InvoiceCreativeDocument />;+const Demo =() => {+ return <InvoiceCreativeDocument />;+}export default Demo;diff --git a/examples/forme/invoice-minimal.tsx b/examples/forme/invoice-minimal.tsxindex 92d21c1..233a398 100644--- a/examples/forme/invoice-minimal.tsx+++ b/examples/forme/invoice-minimal.tsx@@ -1,4 +1,6 @@import { InvoiceMinimalDocument } from "@/registry/bases/forme/blocks/invoice-minimal/invoice-minimal";-const Demo = () => <InvoiceMinimalDocument />;+const Demo =() => {+ return <InvoiceMinimalDocument />;+}export default Demo;diff --git a/examples/forme/invoice-modern.tsx b/examples/forme/invoice-modern.tsxindex 1600682..1676eb7 100644--- a/examples/forme/invoice-modern.tsx+++ b/examples/forme/invoice-modern.tsx@@ -1,4 +1,6 @@import { InvoiceModernDocument } from "@/registry/bases/forme/blocks/invoice-modern/invoice-modern";-const Demo = () => <InvoiceModernDocument />;+const Demo =() => {+ return <InvoiceModernDocument />;+}export default Demo;diff --git a/examples/forme/keep-together.tsx b/examples/forme/keep-together.tsxindex cea4f65..04fe093 100644--- a/examples/forme/keep-together.tsx+++ b/examples/forme/keep-together.tsx@@ -1,22 +1,23 @@import { Document, Page } from "@formepdf/react";-import { KeepTogether } from "@/registry/bases/forme/components/keep-together";import { Text } from "@/registry/bases/forme/components/text";-import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";-const DemoBody = () => (- <KeepTogether>- <Text>Keep these lines together on one page.</Text>- </KeepTogether>-);-const Demo = () => (- <Document>- <Page size="A4" margin={48}>- <PdfcnThemeProvider>+const Demo =() => {+ return (+ <Document>+ <Page size="A4" margin={48}><DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return (+ <KeepTogether>+ <Text>Keep these lines together on one page.</Text>+ </KeepTogether>+ );+}diff --git a/examples/forme/key-value.tsx b/examples/forme/key-value.tsxindex 5270afb..05d3a3e 100644--- a/examples/forme/key-value.tsx+++ b/examples/forme/key-value.tsx@@ -1,15 +1,18 @@import { Document, Page } from "@formepdf/react";-import { KeyValue } from "@/registry/bases/forme/components/key-value";-import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";-const Demo = () => (- <Document>- <Page size="A4" margin={48}>- <PdfcnThemeProvider>- <KeyValue items={[{ key: "Name", value: "Ada" }]} />- </PdfcnThemeProvider>- </Page>- </Document>-);++const Demo =() => {+ return (+ <Document>+ <Page size="A4" margin={48}>+ <DemoBody />+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <KeyValue items={[{ key: "Name", value: "Ada" }]} />;+}diff --git a/examples/forme/link.tsx b/examples/forme/link.tsxindex 992f01e..eca5209 100644--- a/examples/forme/link.tsx+++ b/examples/forme/link.tsx@@ -1,15 +1,18 @@import { Document, Page } from "@formepdf/react";-import { Link } from "@/registry/bases/forme/components/link";-import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";-const Demo = () => (- <Document>- <Page size="A4" margin={48}>- <PdfcnThemeProvider>- <Link href="https://example.com">Example</Link>- </PdfcnThemeProvider>- </Page>- </Document>-);++const Demo =() => {+ return (+ <Document>+ <Page size="A4" margin={48}>+ <DemoBody />+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <Link href="https://example.com">Example</Link>;+}diff --git a/examples/forme/list.tsx b/examples/forme/list.tsxindex 4a1b951..b1aba72 100644--- a/examples/forme/list.tsx+++ b/examples/forme/list.tsx@@ -1,17 +1,18 @@import { Document, Page } from "@formepdf/react";-import { PdfList } from "@/registry/bases/forme/components/list";-import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";-const Demo = () => (- <Document>- <Page size="A4" margin={48}>- <PdfcnThemeProvider>- <PdfList- items={[{ text: "Alpha" }, { text: "Beta" }, { text: "Gamma" }]}- />- </PdfcnThemeProvider>- </Page>- </Document>-);++const Demo =() => {+ return (+ <Document>+ <Page size="A4" margin={48}>+ <DemoBody />+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <PdfList items={[{ text: "Alpha" }, { text: "Beta" }, { text: "Gamma" }]} />;+}diff --git a/examples/forme/page-break.tsx b/examples/forme/page-break.tsxindex a0d29c2..6e09836 100644--- a/examples/forme/page-break.tsx+++ b/examples/forme/page-break.tsx@@ -1,24 +1,25 @@import { Document, Page } from "@formepdf/react";-import { PageBreak } from "@/registry/bases/forme/components/page-break";import { Text } from "@/registry/bases/forme/components/text";-import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";-const DemoBody = () => (- <>- <Text>Before</Text>- <PageBreak />- <Text>After</Text>- </>-);-const Demo = () => (- <Document>- <Page size="A4" margin={48}>- <PdfcnThemeProvider>+const Demo =() => {+ return (+ <Document>+ <Page size="A4" margin={48}><DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return (+ <>+ <Text>Before</Text>+ <PageBreak />+ <Text>After</Text>+ </>+ );+}diff --git a/examples/forme/page-footer.tsx b/examples/forme/page-footer.tsxindex 82ebb99..a85ca25 100644--- a/examples/forme/page-footer.tsx+++ b/examples/forme/page-footer.tsx@@ -1,17 +1,18 @@import { Document, Page } from "@formepdf/react";-import { PageFooter } from "@/registry/bases/forme/components/page-footer";-import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";-const DemoBody = () => <PageFooter leftText="pdfcn" rightText="Confidential" />;-const Demo = () => (- <Document>- <Page size="A4" margin={48}>- <PdfcnThemeProvider>+const Demo =() => {+ return (+ <Document>+ <Page size="A4" margin={48}><DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <PageFooter leftText="pdfcn" rightText="Confidential" />;+}diff --git a/examples/forme/page-header.tsx b/examples/forme/page-header.tsxindex ae76293..8c06091 100644--- a/examples/forme/page-header.tsx+++ b/examples/forme/page-header.tsx@@ -1,17 +1,18 @@import { Document, Page } from "@formepdf/react";-import { PageHeader } from "@/registry/bases/forme/components/page-header";-import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";-const DemoBody = () => <PageHeader title="Company" subtitle="Invoice" />;-const Demo = () => (- <Document>- <Page size="A4" margin={48}>- <PdfcnThemeProvider>+const Demo =() => {+ return (+ <Document>+ <Page size="A4" margin={48}><DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <PageHeader title="Company" subtitle="Invoice" />;+}diff --git a/examples/forme/page-number.tsx b/examples/forme/page-number.tsxindex fef8380..17ae9ba 100644--- a/examples/forme/page-number.tsx+++ b/examples/forme/page-number.tsx@@ -1,17 +1,18 @@import { Document, Page } from "@formepdf/react";-import { PdfPageNumber } from "@/registry/bases/forme/components/page-number";-import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";-const DemoBody = () => <PdfPageNumber />;-const Demo = () => (- <Document>- <Page size="A4" margin={48}>- <PdfcnThemeProvider>+const Demo =() => {+ return (+ <Document>+ <Page size="A4" margin={48}><DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <PdfPageNumber />;+}diff --git a/examples/forme/pdf-image.tsx b/examples/forme/pdf-image.tsxindex 099109a..f3cda38 100644--- a/examples/forme/pdf-image.tsx+++ b/examples/forme/pdf-image.tsx@@ -1,17 +1,19 @@import { Document, Page } from "@formepdf/react";-+import { PdfImage } from "@/registry/bases/forme/components/pdf-image";import { Text } from "@/registry/bases/forme/components/text";-import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";-const DemoBody = () => <Text>PdfImage demo — pass src in your document.</Text>;-const Demo = () => (- <Document>- <Page size="A4" margin={48}>- <PdfcnThemeProvider>+const Demo =() => {+ return (+ <Document>+ <Page size="A4" margin={48}><DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <Text>PdfImage demo — pass src in your document.</Text>;+}diff --git a/examples/forme/qrcode.tsx b/examples/forme/qrcode.tsxindex b433c9b..286458a 100644--- a/examples/forme/qrcode.tsx+++ b/examples/forme/qrcode.tsx@@ -1,17 +1,18 @@import { Document, Page } from "@formepdf/react";-import { PdfQRCode } from "@/registry/bases/forme/components/qrcode";-import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";-const DemoBody = () => <PdfQRCode value="https://pdfcn.dev" />;-const Demo = () => (- <Document>- <Page size="A4" margin={48}>- <PdfcnThemeProvider>+const Demo =() => {+ return (+ <Document>+ <Page size="A4" margin={48}><DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <PdfQRCode value="https://pdfcn.dev" />;+}diff --git a/examples/forme/report-financial.tsx b/examples/forme/report-financial.tsxindex 139a2df..a5e7654 100644--- a/examples/forme/report-financial.tsx+++ b/examples/forme/report-financial.tsx@@ -1,4 +1,6 @@import { FinancialReportDocument } from "@/registry/bases/forme/blocks/report-financial/report-financial";-const Demo = () => <FinancialReportDocument />;+const Demo =() => {+ return <FinancialReportDocument />;+}export default Demo;diff --git a/examples/forme/report-marketing.tsx b/examples/forme/report-marketing.tsxindex 3a3236c..2ad11c9 100644--- a/examples/forme/report-marketing.tsx+++ b/examples/forme/report-marketing.tsx@@ -1,4 +1,6 @@import { MarketingReportDocument } from "@/registry/bases/forme/blocks/report-marketing/report-marketing";-const Demo = () => <MarketingReportDocument />;+const Demo =() => {+ return <MarketingReportDocument />;+}export default Demo;diff --git a/examples/forme/report-operations.tsx b/examples/forme/report-operations.tsxindex 87d99cb..92f8e52 100644--- a/examples/forme/report-operations.tsx+++ b/examples/forme/report-operations.tsx@@ -1,4 +1,6 @@import { OperationsReportDocument } from "@/registry/bases/forme/blocks/report-operations/report-operations";-const Demo = () => <OperationsReportDocument />;+const Demo =() => {+ return <OperationsReportDocument />;+}export default Demo;diff --git a/examples/forme/report-security.tsx b/examples/forme/report-security.tsxindex ed955d3..826abbc 100644--- a/examples/forme/report-security.tsx+++ b/examples/forme/report-security.tsx@@ -1,4 +1,6 @@import { SecurityReportDocument } from "@/registry/bases/forme/blocks/report-security/report-security";-const Demo = () => <SecurityReportDocument />;+const Demo =() => {+ return <SecurityReportDocument />;+}export default Demo;diff --git a/examples/forme/section.tsx b/examples/forme/section.tsxindex 06b7576..91ea2ac 100644--- a/examples/forme/section.tsx+++ b/examples/forme/section.tsx@@ -1,22 +1,19 @@import { Document, Page } from "@formepdf/react";-import { Section } from "@/registry/bases/forme/components/section";import { Text } from "@/registry/bases/forme/components/text";-import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";-const DemoBody = () => (- <Section>- <Text>Section body</Text>- </Section>-);-const Demo = () => (- <Document>- <Page size="A4" margin={48}>- <PdfcnThemeProvider>+const Demo =() => {+ return (+ <Document>+ <Page size="A4" margin={48}><DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <Section><Text>Section body</Text></Section>;+}diff --git a/examples/forme/signature.tsx b/examples/forme/signature.tsxindex 8285051..416a07c 100644--- a/examples/forme/signature.tsx+++ b/examples/forme/signature.tsx@@ -1,19 +1,18 @@import { Document, Page } from "@formepdf/react";-import { PdfSignatureBlock } from "@/registry/bases/forme/components/signature";-import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";-const DemoBody = () => (- <PdfSignatureBlock name="Jane Doe" label="Authorized Signature" />-);-const Demo = () => (- <Document>- <Page size="A4" margin={48}>- <PdfcnThemeProvider>+const Demo =() => {+ return (+ <Document>+ <Page size="A4" margin={48}><DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <PdfSignatureBlock name="Jane Doe" label="Authorized Signature" />;+}diff --git a/examples/forme/stack.tsx b/examples/forme/stack.tsxindex ddc0b0a..b41586f 100644--- a/examples/forme/stack.tsx+++ b/examples/forme/stack.tsx@@ -1,23 +1,24 @@import { Document, Page } from "@formepdf/react";-import { Stack } from "@/registry/bases/forme/components/stack";import { Text } from "@/registry/bases/forme/components/text";-import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";-const DemoBody = () => (- <Stack gap="md">- <Text>One</Text>- <Text>Two</Text>- </Stack>-);-const Demo = () => (- <Document>- <Page size="A4" margin={48}>- <PdfcnThemeProvider>+const Demo =() => {+ return (+ <Document>+ <Page size="A4" margin={48}><DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return (+ <Stack gap="md">+ <Text>One</Text>+ <Text>Two</Text>+ </Stack>+ );+}diff --git a/examples/forme/table.tsx b/examples/forme/table.tsxindex 3edf11e..8268a34 100644--- a/examples/forme/table.tsx+++ b/examples/forme/table.tsx@@ -1,43 +1,33 @@import { Document, Page } from "@formepdf/react";+import { Table } from "@/registry/bases/forme/components/table";+import { TableBody, TableCell, TableHeader, TableRow, Text } from "@/registry/bases/forme/components";-import {- Table,- TableBody,- TableCell,- TableHeader,- TableRow,- Text,-} from "@/registry/bases/forme/components";-import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";--const Demo = () => (- <Document>- <Page size="A4" margin={48}>- <PdfcnThemeProvider>- <Table>- <TableHeader>- <TableRow>- <TableCell>- <Text>Item</Text>- </TableCell>- <TableCell>- <Text>Qty</Text>- </TableCell>- </TableRow>- </TableHeader>- <TableBody>- <TableRow>- <TableCell>- <Text>Widget</Text>- </TableCell>- <TableCell>- <Text>2</Text>- </TableCell>- </TableRow>- </TableBody>- </Table>- </PdfcnThemeProvider>- </Page>- </Document>-);+const Demo =() => {+ return (+ <Document>+ <Page size="A4" margin={48}>+ <DemoBody />+ </Page>+ </Document>+ );+}export default Demo;++const DemoBody =() => {+ return (+ <Table>+ <TableHeader>+ <TableRow>+ <TableCell><Text>Item</Text></TableCell>+ <TableCell><Text>Qty</Text></TableCell>+ </TableRow>+ </TableHeader>+ <TableBody>+ <TableRow>+ <TableCell><Text>Widget</Text></TableCell>+ <TableCell><Text>2</Text></TableCell>+ </TableRow>+ </TableBody>+ </Table>+ );+}diff --git a/examples/forme/text.tsx b/examples/forme/text.tsxindex be9ba2a..9318acb 100644--- a/examples/forme/text.tsx+++ b/examples/forme/text.tsx@@ -1,17 +1,18 @@import { Document, Page } from "@formepdf/react";-import { Text } from "@/registry/bases/forme/components/text";-import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";-const DemoBody = () => <Text>Hello from pdfcn forme</Text>;-const Demo = () => (- <Document>- <Page size="A4" margin={48}>- <PdfcnThemeProvider>+const Demo =() => {+ return (+ <Document>+ <Page size="A4" margin={48}><DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <Text>Hello from pdfcn forme</Text>;+}diff --git a/examples/forme/watermark.tsx b/examples/forme/watermark.tsxindex 21f105b..61e3841 100644--- a/examples/forme/watermark.tsx+++ b/examples/forme/watermark.tsx@@ -1,23 +1,24 @@import { Document, Page } from "@formepdf/react";--import { Text } from "@/registry/bases/forme/components/text";import { PdfWatermark } from "@/registry/bases/forme/components/watermark";-import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";+import { Text } from "@/registry/bases/forme/components/text";-const DemoBody = () => (- <>- <PdfWatermark text="DRAFT" />- <Text>Document content</Text>- </>-);-const Demo = () => (- <Document>- <Page size="A4" margin={48}>- <PdfcnThemeProvider>+const Demo =() => {+ return (+ <Document>+ <Page size="A4" margin={48}><DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return (+ <>+ <PdfWatermark text="DRAFT" />+ <Text>Document content</Text>+ </>+ );+}diff --git a/examples/takumi/alert.tsx b/examples/takumi/alert.tsxindex 5419653..93a0326 100644--- a/examples/takumi/alert.tsx+++ b/examples/takumi/alert.tsx@@ -1,20 +1,21 @@-import { PdfAlert } from "@/registry/bases/takumi/components/alert";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { PdfAlert } from "@/registry/bases/takumi/components/alert";-const DemoBody = () => (- <PdfAlert variant="info" title="Info">- Alert body- </PdfAlert>-);-const Demo = () => (- <Document>- <Page size="A4">- <PdfcnThemeProvider>- <DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+const Demo =() => {+ return (+ <Document>+ <Page size="A4">+ <PdfcnThemeProvider>+ <DemoBody />+ </PdfcnThemeProvider>+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <PdfAlert variant="info" title="Info">Alert body</PdfAlert>;+}diff --git a/examples/takumi/badge.tsx b/examples/takumi/badge.tsxindex 719560a..9fe4a1d 100644--- a/examples/takumi/badge.tsx+++ b/examples/takumi/badge.tsx@@ -1,16 +1,21 @@-import { Badge } from "@/registry/bases/takumi/components/badge";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { Badge } from "@/registry/bases/takumi/components/badge";-const DemoBody = () => <Badge>Badge</Badge>;-const Demo = () => (- <Document>- <Page size="A4">- <PdfcnThemeProvider>- <DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+const Demo =() => {+ return (+ <Document>+ <Page size="A4">+ <PdfcnThemeProvider>+ <DemoBody />+ </PdfcnThemeProvider>+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <Badge>Badge</Badge>;+}diff --git a/examples/takumi/card.tsx b/examples/takumi/card.tsxindex b48bd7f..7af6041 100644--- a/examples/takumi/card.tsx+++ b/examples/takumi/card.tsx@@ -1,16 +1,21 @@-import { PdfCard } from "@/registry/bases/takumi/components/card";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { PdfCard } from "@/registry/bases/takumi/components/card";-const DemoBody = () => <PdfCard title="Card">Card body</PdfCard>;-const Demo = () => (- <Document>- <Page size="A4">- <PdfcnThemeProvider>- <DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+const Demo =() => {+ return (+ <Document>+ <Page size="A4">+ <PdfcnThemeProvider>+ <DemoBody />+ </PdfcnThemeProvider>+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <PdfCard title="Card">Card body</PdfCard>;+}diff --git a/examples/takumi/data-table.tsx b/examples/takumi/data-table.tsxindex 944fb85..aa87c1b 100644--- a/examples/takumi/data-table.tsx+++ b/examples/takumi/data-table.tsx@@ -1,27 +1,32 @@-import { DataTable } from "@/registry/bases/takumi/components/data-table";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { DataTable } from "@/registry/bases/takumi/components/data-table";-const DemoBody = () => (- <DataTable- columns={[- { header: "Name", key: "name" },- { header: "Price", key: "price" },- ]}- data={[- { name: "Widget", price: "const Demo =0" },- { name: "Gadget", price: "$20" },- ]}- />-);-const Demo = () => (- <Document>- <Page size="A4">- <PdfcnThemeProvider>- <DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+const Demo =() => {+ return (+ <Document>+ <Page size="A4">+ <PdfcnThemeProvider>+ <DemoBody />+ </PdfcnThemeProvider>+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return (+ <DataTable+ columns={[+ { key: "name", header: "Name" },+ { key: "price", header: "Price" },+ ]}+ data={[+ { name: "Widget", price: "$10" },+ { name: "Gadget", price: "$20" },+ ]}+ />+ );+}diff --git a/examples/takumi/divider.tsx b/examples/takumi/divider.tsxindex ad3bd9b..3f21b83 100644--- a/examples/takumi/divider.tsx+++ b/examples/takumi/divider.tsx@@ -1,16 +1,21 @@-import { Divider } from "@/registry/bases/takumi/components/divider";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { Divider } from "@/registry/bases/takumi/components/divider";-const DemoBody = () => <Divider />;-const Demo = () => (- <Document>- <Page size="A4">- <PdfcnThemeProvider>- <DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+const Demo =() => {+ return (+ <Document>+ <Page size="A4">+ <PdfcnThemeProvider>+ <DemoBody />+ </PdfcnThemeProvider>+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <Divider />;+}diff --git a/examples/takumi/form.tsx b/examples/takumi/form.tsxindex c72afbf..301e5b0 100644--- a/examples/takumi/form.tsx+++ b/examples/takumi/form.tsx@@ -1,21 +1,26 @@-import { PdfForm } from "@/registry/bases/takumi/components/form";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { PdfForm } from "@/registry/bases/takumi/components/form";-const DemoBody = () => (- <PdfForm- title="Contact"- groups={[{ fields: [{ label: "Email" }, { label: "Phone" }] }]}- />-);-const Demo = () => (- <Document>- <Page size="A4">- <PdfcnThemeProvider>- <DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+const Demo =() => {+ return (+ <Document>+ <Page size="A4">+ <PdfcnThemeProvider>+ <DemoBody />+ </PdfcnThemeProvider>+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return (+ <PdfForm+ title="Contact"+ groups={[{ fields: [{ label: "Email" }, { label: "Phone" }] }]}+ />+ );+}diff --git a/examples/takumi/graph.tsx b/examples/takumi/graph.tsxindex 28d8edd..ab147f7 100644--- a/examples/takumi/graph.tsx+++ b/examples/takumi/graph.tsx@@ -1,25 +1,30 @@-import { PdfGraph } from "@/registry/bases/takumi/components/graph";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { PdfGraph } from "@/registry/bases/takumi/components/graph";-const DemoBody = () => (- <PdfGraph- variant="bar"- data={[- { label: "Q1", value: 30 },- { label: "Q2", value: 45 },- { label: "Q3", value: 28 },- ]}- />-);-const Demo = () => (- <Document>- <Page size="A4">- <PdfcnThemeProvider>- <DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+const Demo =() => {+ return (+ <Document>+ <Page size="A4">+ <PdfcnThemeProvider>+ <DemoBody />+ </PdfcnThemeProvider>+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return (+ <PdfGraph+ variant="bar"+ data={[+ { label: "Q1", value: 30 },+ { label: "Q2", value: 45 },+ { label: "Q3", value: 28 },+ ]}+ />+ );+}diff --git a/examples/takumi/heading.tsx b/examples/takumi/heading.tsxindex 9733b0c..42ed7ab 100644--- a/examples/takumi/heading.tsx+++ b/examples/takumi/heading.tsx@@ -1,16 +1,21 @@-import { Heading } from "@/registry/bases/takumi/components/heading";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { Heading } from "@/registry/bases/takumi/components/heading";-const DemoBody = () => <Heading level={1}>Heading</Heading>;-const Demo = () => (- <Document>- <Page size="A4">- <PdfcnThemeProvider>- <DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+const Demo =() => {+ return (+ <Document>+ <Page size="A4">+ <PdfcnThemeProvider>+ <DemoBody />+ </PdfcnThemeProvider>+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <Heading level={1}>Heading</Heading>;+}diff --git a/examples/takumi/invoice-classic.tsx b/examples/takumi/invoice-classic.tsxindex ea16048..3307bdc 100644--- a/examples/takumi/invoice-classic.tsx+++ b/examples/takumi/invoice-classic.tsx@@ -1,4 +1,6 @@import { InvoiceClassicDocument } from "@/registry/bases/takumi/blocks/invoice-classic/invoice-classic";-const Demo = () => <InvoiceClassicDocument />;+const Demo =() => {+ return <InvoiceClassicDocument />;+}export default Demo;diff --git a/examples/takumi/invoice-consultant.tsx b/examples/takumi/invoice-consultant.tsxindex 268c84a..82ae4e6 100644--- a/examples/takumi/invoice-consultant.tsx+++ b/examples/takumi/invoice-consultant.tsx@@ -1,4 +1,6 @@import { InvoiceConsultantDocument } from "@/registry/bases/takumi/blocks/invoice-consultant/invoice-consultant";-const Demo = () => <InvoiceConsultantDocument />;+const Demo =() => {+ return <InvoiceConsultantDocument />;+}export default Demo;diff --git a/examples/takumi/invoice-corporate-playground.tsx b/examples/takumi/invoice-corporate-playground.tsxnew file mode 100644index 0000000..50d1fc0--- /dev/null+++ b/examples/takumi/invoice-corporate-playground.tsx@@ -0,0 +1,112 @@+const sampleData = {+ invoiceNumber: "INV-2026-004",+ invoiceDate: "February 22, 2026",+ dueDate: "March 24, 2026",+ companyName: "Your Company",+ subtitle: "Professional Services",+ companyAddress: "City, Country",+ billTo: {+ name: "Global Industries Ltd.",+ address: "100 Corporate Plaza, Tower B",+ email: "[email protected]",+ phone: "+1 (555) 888-9999",+ },+ items: [+ { description: "Enterprise Software License", quantity: 5, unitPrice: 4500 },+ { description: "Implementation Services", quantity: 1, unitPrice: 18000 },+ { description: "Training Workshop", quantity: 3, unitPrice: 2500 },+ { description: "Annual Support Package", quantity: 1, unitPrice: 8500 },+ ],+ summary: { subtotal: 57000, tax: 4560, total: 61560 },+ paymentTerms: {+ dueDate: "March 24, 2026",+ method: "Wire Transfer / Corporate Account",+ gst: "GSTIN 987654321",+ },+ notes: "Corporate billing – Net 30 terms apply.",+};++const money = (v: number) => `$${v.toLocaleString("en-US")}`;++export default function InvoiceCorporate() {+ const d = sampleData;+ return (+ <div tw="flex w-full flex-col text-[#30313d]">+ <div tw="flex items-start justify-between">+ <div tw="flex flex-col">+ <h1 tw="m-0 text-2xl font-semibold">Invoice {d.invoiceNumber}</h1>+ <p tw="mt-2 mb-0 text-xs text-[#687385]">+ Issued {d.invoiceDate} · Due {d.dueDate}+ </p>+ </div>+ <span tw="rounded-full bg-[#eef2ff] px-3 py-1 text-xs font-semibold text-[#4338ca]">+ Pending+ </span>+ </div>++ <div tw="mt-8 flex text-xs">+ <div tw="flex w-[240px] flex-col">+ <span tw="mb-1 font-semibold text-[#687385]">From</span>+ <span>{d.companyName}</span>+ <span tw="text-[#687385]">{d.companyAddress}</span>+ </div>+ <div tw="flex w-[240px] flex-col">+ <span tw="mb-1 font-semibold text-[#687385]">Bill To</span>+ <span>{d.billTo.name}</span>+ <span tw="text-[#687385]">{d.billTo.address}</span>+ <span tw="text-[#687385]">{d.billTo.email}</span>+ <span tw="text-[#687385]">{d.billTo.phone}</span>+ </div>+ </div>++ <div tw="mt-8 flex border-b border-[#ebeef1] pb-2 text-[11px] font-semibold text-[#687385]">+ <span tw="flex-1">Description</span>+ <span tw="w-[60px] text-right">Qty</span>+ <span tw="w-[100px] text-right">Unit Price</span>+ <span tw="w-[100px] text-right">Amount</span>+ </div>+ {d.items.map((item) => (+ <div key={item.description} tw="flex break-inside-avoid pt-3 text-xs">+ <span tw="flex-1">{item.description}</span>+ <span tw="w-[60px] text-right text-[#687385]">{item.quantity}</span>+ <span tw="w-[100px] text-right text-[#687385]">{money(item.unitPrice)}</span>+ <span tw="w-[100px] text-right">{money(item.quantity * item.unitPrice)}</span>+ </div>+ ))}++ <div tw="mt-8 flex break-inside-avoid justify-end">+ <div tw="flex w-[260px] flex-col text-xs">+ <div tw="flex justify-between">+ <span tw="text-[#687385]">Subtotal</span>+ <span>{money(d.summary.subtotal)}</span>+ </div>+ <div tw="mt-2 flex justify-between">+ <span tw="text-[#687385]">Tax (8%)</span>+ <span>{money(d.summary.tax)}</span>+ </div>+ <div tw="mt-3 flex justify-between border-t border-[#ebeef1] pt-3 text-sm font-semibold">+ <span>Total Due</span>+ <span>{money(d.summary.total)}</span>+ </div>+ </div>+ </div>++ <div tw="mt-8 text-xs text-[#687385]">+ <p tw="m-0">Payment Terms: {d.paymentTerms.method}</p>+ <p tw="m-0 mt-1">Due: {d.paymentTerms.dueDate}</p>+ <p tw="m-0 mt-1">{d.paymentTerms.gst}</p>+ </div>++ {d.notes && (+ <p tw="mt-8 mb-0 text-[11px] text-[#687385]">{d.notes}</p>+ )}+ </div>+ );+}++export const options: PlaygroundOptions = {+ pdf: {+ size: "a4",+ margin: 48,+ },+};diff --git a/examples/takumi/invoice-corporate.tsx b/examples/takumi/invoice-corporate.tsxindex 16c7be3..4b7c6ef 100644--- a/examples/takumi/invoice-corporate.tsx+++ b/examples/takumi/invoice-corporate.tsx@@ -1,4 +1,6 @@import { InvoiceCorporateDocument } from "@/registry/bases/takumi/blocks/invoice-corporate/invoice-corporate";-const Demo = () => <InvoiceCorporateDocument />;+const Demo =() => {+ return <InvoiceCorporateDocument />;+}export default Demo;diff --git a/examples/takumi/invoice-creative.tsx b/examples/takumi/invoice-creative.tsxindex 1b7e01d..e26c571 100644--- a/examples/takumi/invoice-creative.tsx+++ b/examples/takumi/invoice-creative.tsx@@ -1,4 +1,6 @@import { InvoiceCreativeDocument } from "@/registry/bases/takumi/blocks/invoice-creative/invoice-creative";-const Demo = () => <InvoiceCreativeDocument />;+const Demo =() => {+ return <InvoiceCreativeDocument />;+}export default Demo;diff --git a/examples/takumi/invoice-minimal.tsx b/examples/takumi/invoice-minimal.tsxindex 4ab42a4..115ef7f 100644--- a/examples/takumi/invoice-minimal.tsx+++ b/examples/takumi/invoice-minimal.tsx@@ -1,4 +1,6 @@import { InvoiceMinimalDocument } from "@/registry/bases/takumi/blocks/invoice-minimal/invoice-minimal";-const Demo = () => <InvoiceMinimalDocument />;+const Demo =() => {+ return <InvoiceMinimalDocument />;+}export default Demo;diff --git a/examples/takumi/invoice-modern.tsx b/examples/takumi/invoice-modern.tsxindex c27d008..e127091 100644--- a/examples/takumi/invoice-modern.tsx+++ b/examples/takumi/invoice-modern.tsx@@ -1,4 +1,6 @@import { InvoiceModernDocument } from "@/registry/bases/takumi/blocks/invoice-modern/invoice-modern";-const Demo = () => <InvoiceModernDocument />;+const Demo =() => {+ return <InvoiceModernDocument />;+}export default Demo;diff --git a/examples/takumi/keep-together.tsx b/examples/takumi/keep-together.tsxindex 416b7a5..16b9740 100644--- a/examples/takumi/keep-together.tsx+++ b/examples/takumi/keep-together.tsx@@ -1,21 +1,26 @@+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";import { KeepTogether } from "@/registry/bases/takumi/components/keep-together";import { Text } from "@/registry/bases/takumi/components/text";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";-import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";-const DemoBody = () => (- <KeepTogether>- <Text>Keep these lines together on one page.</Text>- </KeepTogether>-);-const Demo = () => (- <Document>- <Page size="A4">- <PdfcnThemeProvider>- <DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+const Demo =() => {+ return (+ <Document>+ <Page size="A4">+ <PdfcnThemeProvider>+ <DemoBody />+ </PdfcnThemeProvider>+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return (+ <KeepTogether>+ <Text>Keep these lines together on one page.</Text>+ </KeepTogether>+ );+}diff --git a/examples/takumi/key-value.tsx b/examples/takumi/key-value.tsxindex eaa9259..5582df4 100644--- a/examples/takumi/key-value.tsx+++ b/examples/takumi/key-value.tsx@@ -1,14 +1,21 @@-import { KeyValue } from "@/registry/bases/takumi/components/key-value";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { KeyValue } from "@/registry/bases/takumi/components/key-value";+-const Demo = () => (- <Document>- <Page size="A4">- <PdfcnThemeProvider>- <KeyValue items={[{ key: "Name", value: "Ada" }]} />- </PdfcnThemeProvider>- </Page>- </Document>-);+const Demo =() => {+ return (+ <Document>+ <Page size="A4">+ <PdfcnThemeProvider>+ <DemoBody />+ </PdfcnThemeProvider>+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <KeyValue items={[{ key: "Name", value: "Ada" }]} />;+}diff --git a/examples/takumi/link.tsx b/examples/takumi/link.tsxindex b825de6..3014780 100644--- a/examples/takumi/link.tsx+++ b/examples/takumi/link.tsx@@ -1,14 +1,21 @@-import { Link } from "@/registry/bases/takumi/components/link";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { Link } from "@/registry/bases/takumi/components/link";+-const Demo = () => (- <Document>- <Page size="A4">- <PdfcnThemeProvider>- <Link href="https://example.com">Example</Link>- </PdfcnThemeProvider>- </Page>- </Document>-);+const Demo =() => {+ return (+ <Document>+ <Page size="A4">+ <PdfcnThemeProvider>+ <DemoBody />+ </PdfcnThemeProvider>+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <Link href="https://example.com">Example</Link>;+}diff --git a/examples/takumi/list.tsx b/examples/takumi/list.tsxindex 7f43a10..76b6a6c 100644--- a/examples/takumi/list.tsx+++ b/examples/takumi/list.tsx@@ -1,16 +1,21 @@-import { PdfList } from "@/registry/bases/takumi/components/list";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { PdfList } from "@/registry/bases/takumi/components/list";+-const Demo = () => (- <Document>- <Page size="A4">- <PdfcnThemeProvider>- <PdfList- items={[{ text: "Alpha" }, { text: "Beta" }, { text: "Gamma" }]}- />- </PdfcnThemeProvider>- </Page>- </Document>-);+const Demo =() => {+ return (+ <Document>+ <Page size="A4">+ <PdfcnThemeProvider>+ <DemoBody />+ </PdfcnThemeProvider>+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <PdfList items={[{ text: "Alpha" }, { text: "Beta" }, { text: "Gamma" }]} />;+}diff --git a/examples/takumi/page-break.tsx b/examples/takumi/page-break.tsxindex 2b9eeb4..fba041e 100644--- a/examples/takumi/page-break.tsx+++ b/examples/takumi/page-break.tsx@@ -1,23 +1,28 @@+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";import { PageBreak } from "@/registry/bases/takumi/components/page-break";import { Text } from "@/registry/bases/takumi/components/text";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";-import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";-const DemoBody = () => (- <>- <Text>Before</Text>- <PageBreak />- <Text>After</Text>- </>-);-const Demo = () => (- <Document>- <Page size="A4">- <PdfcnThemeProvider>- <DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+const Demo =() => {+ return (+ <Document>+ <Page size="A4">+ <PdfcnThemeProvider>+ <DemoBody />+ </PdfcnThemeProvider>+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return (+ <>+ <Text>Before</Text>+ <PageBreak />+ <Text>After</Text>+ </>+ );+}diff --git a/examples/takumi/page-footer.tsx b/examples/takumi/page-footer.tsxindex a501bf3..cf0c52e 100644--- a/examples/takumi/page-footer.tsx+++ b/examples/takumi/page-footer.tsx@@ -1,16 +1,21 @@-import { PageFooter } from "@/registry/bases/takumi/components/page-footer";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { PageFooter } from "@/registry/bases/takumi/components/page-footer";-const DemoBody = () => <PageFooter leftText="pdfcn" rightText="Confidential" />;-const Demo = () => (- <Document>- <Page size="A4">- <PdfcnThemeProvider>- <DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+const Demo =() => {+ return (+ <Document>+ <Page size="A4">+ <PdfcnThemeProvider>+ <DemoBody />+ </PdfcnThemeProvider>+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <PageFooter leftText="pdfcn" rightText="Confidential" />;+}diff --git a/examples/takumi/page-header.tsx b/examples/takumi/page-header.tsxindex 266571a..643c7a7 100644--- a/examples/takumi/page-header.tsx+++ b/examples/takumi/page-header.tsx@@ -1,16 +1,21 @@-import { PageHeader } from "@/registry/bases/takumi/components/page-header";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { PageHeader } from "@/registry/bases/takumi/components/page-header";-const DemoBody = () => <PageHeader title="Company" subtitle="Invoice" />;-const Demo = () => (- <Document>- <Page size="A4">- <PdfcnThemeProvider>- <DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+const Demo =() => {+ return (+ <Document>+ <Page size="A4">+ <PdfcnThemeProvider>+ <DemoBody />+ </PdfcnThemeProvider>+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <PageHeader title="Company" subtitle="Invoice" />;+}diff --git a/examples/takumi/page-number.tsx b/examples/takumi/page-number.tsxindex e824525..29edf65 100644--- a/examples/takumi/page-number.tsx+++ b/examples/takumi/page-number.tsx@@ -1,16 +1,21 @@-import { PdfPageNumber } from "@/registry/bases/takumi/components/page-number";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { PdfPageNumber } from "@/registry/bases/takumi/components/page-number";-const DemoBody = () => <PdfPageNumber />;-const Demo = () => (- <Document>- <Page size="A4">- <PdfcnThemeProvider>- <DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+const Demo =() => {+ return (+ <Document>+ <Page size="A4">+ <PdfcnThemeProvider>+ <DemoBody />+ </PdfcnThemeProvider>+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <PdfPageNumber />;+}diff --git a/examples/takumi/pdf-image.tsx b/examples/takumi/pdf-image.tsxindex 0432e19..b527e69 100644--- a/examples/takumi/pdf-image.tsx+++ b/examples/takumi/pdf-image.tsx@@ -1,16 +1,22 @@-import { Text } from "@/registry/bases/takumi/components/text";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { PdfImage } from "@/registry/bases/takumi/components/pdf-image";+import { Text } from "@/registry/bases/takumi/components/text";-const DemoBody = () => <Text>PdfImage demo — pass src in your document.</Text>;-const Demo = () => (- <Document>- <Page size="A4">- <PdfcnThemeProvider>- <DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+const Demo =() => {+ return (+ <Document>+ <Page size="A4">+ <PdfcnThemeProvider>+ <DemoBody />+ </PdfcnThemeProvider>+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <Text>PdfImage demo — pass src in your document.</Text>;+}diff --git a/examples/takumi/qrcode.tsx b/examples/takumi/qrcode.tsxindex 0e60d00..4c4ccfd 100644--- a/examples/takumi/qrcode.tsx+++ b/examples/takumi/qrcode.tsx@@ -1,16 +1,21 @@-import { PdfQRCode } from "@/registry/bases/takumi/components/qrcode";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { PdfQRCode } from "@/registry/bases/takumi/components/qrcode";-const DemoBody = () => <PdfQRCode value="https://pdfcn.dev" />;-const Demo = () => (- <Document>- <Page size="A4">- <PdfcnThemeProvider>- <DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+const Demo =() => {+ return (+ <Document>+ <Page size="A4">+ <PdfcnThemeProvider>+ <DemoBody />+ </PdfcnThemeProvider>+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <PdfQRCode value="https://pdfcn.dev" />;+}diff --git a/examples/takumi/report-financial.tsx b/examples/takumi/report-financial.tsxindex 6b4f49e..200d835 100644--- a/examples/takumi/report-financial.tsx+++ b/examples/takumi/report-financial.tsx@@ -1,4 +1,6 @@import { FinancialReportDocument } from "@/registry/bases/takumi/blocks/report-financial/report-financial";-const Demo = () => <FinancialReportDocument />;+const Demo =() => {+ return <FinancialReportDocument />;+}export default Demo;diff --git a/examples/takumi/report-marketing.tsx b/examples/takumi/report-marketing.tsxindex 8e082ed..200e75a 100644--- a/examples/takumi/report-marketing.tsx+++ b/examples/takumi/report-marketing.tsx@@ -1,4 +1,6 @@import { MarketingReportDocument } from "@/registry/bases/takumi/blocks/report-marketing/report-marketing";-const Demo = () => <MarketingReportDocument />;+const Demo =() => {+ return <MarketingReportDocument />;+}export default Demo;diff --git a/examples/takumi/report-operations.tsx b/examples/takumi/report-operations.tsxindex 7276353..0e2d81f 100644--- a/examples/takumi/report-operations.tsx+++ b/examples/takumi/report-operations.tsx@@ -1,4 +1,6 @@import { OperationsReportDocument } from "@/registry/bases/takumi/blocks/report-operations/report-operations";-const Demo = () => <OperationsReportDocument />;+const Demo =() => {+ return <OperationsReportDocument />;+}export default Demo;diff --git a/examples/takumi/report-security.tsx b/examples/takumi/report-security.tsxindex 6cc1868..a21c2a8 100644--- a/examples/takumi/report-security.tsx+++ b/examples/takumi/report-security.tsx@@ -1,4 +1,6 @@import { SecurityReportDocument } from "@/registry/bases/takumi/blocks/report-security/report-security";-const Demo = () => <SecurityReportDocument />;+const Demo =() => {+ return <SecurityReportDocument />;+}export default Demo;diff --git a/examples/takumi/section.tsx b/examples/takumi/section.tsxindex 37d3e02..016f90c 100644--- a/examples/takumi/section.tsx+++ b/examples/takumi/section.tsx@@ -1,21 +1,22 @@+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";import { Section } from "@/registry/bases/takumi/components/section";import { Text } from "@/registry/bases/takumi/components/text";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";-import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";-const DemoBody = () => (- <Section>- <Text>Section body</Text>- </Section>-);-const Demo = () => (- <Document>- <Page size="A4">- <PdfcnThemeProvider>- <DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+const Demo =() => {+ return (+ <Document>+ <Page size="A4">+ <PdfcnThemeProvider>+ <DemoBody />+ </PdfcnThemeProvider>+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <Section><Text>Section body</Text></Section>;+}diff --git a/examples/takumi/signature.tsx b/examples/takumi/signature.tsxindex fd1dacd..f990098 100644--- a/examples/takumi/signature.tsx+++ b/examples/takumi/signature.tsx@@ -1,18 +1,21 @@-import { PdfSignatureBlock } from "@/registry/bases/takumi/components/signature";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { PdfSignatureBlock } from "@/registry/bases/takumi/components/signature";-const DemoBody = () => (- <PdfSignatureBlock name="Jane Doe" label="Authorized Signature" />-);-const Demo = () => (- <Document>- <Page size="A4">- <PdfcnThemeProvider>- <DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+const Demo =() => {+ return (+ <Document>+ <Page size="A4">+ <PdfcnThemeProvider>+ <DemoBody />+ </PdfcnThemeProvider>+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <PdfSignatureBlock name="Jane Doe" label="Authorized Signature" />;+}diff --git a/examples/takumi/stack.tsx b/examples/takumi/stack.tsxindex c0d762c..2167bdb 100644--- a/examples/takumi/stack.tsx+++ b/examples/takumi/stack.tsx@@ -1,22 +1,27 @@+import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";import { Stack } from "@/registry/bases/takumi/components/stack";import { Text } from "@/registry/bases/takumi/components/text";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";-import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";-const DemoBody = () => (- <Stack gap="md">- <Text>One</Text>- <Text>Two</Text>- </Stack>-);-const Demo = () => (- <Document>- <Page size="A4">- <PdfcnThemeProvider>- <DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+const Demo =() => {+ return (+ <Document>+ <Page size="A4">+ <PdfcnThemeProvider>+ <DemoBody />+ </PdfcnThemeProvider>+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return (+ <Stack gap="md">+ <Text>One</Text>+ <Text>Two</Text>+ </Stack>+ );+}diff --git a/examples/takumi/table.tsx b/examples/takumi/table.tsxindex 5cdffb6..2570765 100644--- a/examples/takumi/table.tsx+++ b/examples/takumi/table.tsx@@ -1,42 +1,36 @@-import {- Table,- TableBody,- TableCell,- TableHeader,- TableRow,- Text,-} from "@/registry/bases/takumi/components";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { Table } from "@/registry/bases/takumi/components/table";+import { TableBody, TableCell, TableHeader, TableRow, Text } from "@/registry/bases/takumi/components";-const Demo = () => (- <Document>- <Page size="A4">- <PdfcnThemeProvider>- <Table>- <TableHeader>- <TableRow>- <TableCell>- <Text>Item</Text>- </TableCell>- <TableCell>- <Text>Qty</Text>- </TableCell>- </TableRow>- </TableHeader>- <TableBody>- <TableRow>- <TableCell>- <Text>Widget</Text>- </TableCell>- <TableCell>- <Text>2</Text>- </TableCell>- </TableRow>- </TableBody>- </Table>- </PdfcnThemeProvider>- </Page>- </Document>-);+const Demo =() => {+ return (+ <Document>+ <Page size="A4">+ <PdfcnThemeProvider>+ <DemoBody />+ </PdfcnThemeProvider>+ </Page>+ </Document>+ );+}export default Demo;++const DemoBody =() => {+ return (+ <Table>+ <TableHeader>+ <TableRow>+ <TableCell><Text>Item</Text></TableCell>+ <TableCell><Text>Qty</Text></TableCell>+ </TableRow>+ </TableHeader>+ <TableBody>+ <TableRow>+ <TableCell><Text>Widget</Text></TableCell>+ <TableCell><Text>2</Text></TableCell>+ </TableRow>+ </TableBody>+ </Table>+ );+}diff --git a/examples/takumi/text.tsx b/examples/takumi/text.tsxindex 376ed4d..00d9113 100644--- a/examples/takumi/text.tsx+++ b/examples/takumi/text.tsx@@ -1,16 +1,21 @@-import { Text } from "@/registry/bases/takumi/components/text";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { Text } from "@/registry/bases/takumi/components/text";-const DemoBody = () => <Text>Hello from pdfcn takumi</Text>;-const Demo = () => (- <Document>- <Page size="A4">- <PdfcnThemeProvider>- <DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+const Demo =() => {+ return (+ <Document>+ <Page size="A4">+ <PdfcnThemeProvider>+ <DemoBody />+ </PdfcnThemeProvider>+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return <Text>Hello from pdfcn takumi</Text>;+}diff --git a/examples/takumi/watermark.tsx b/examples/takumi/watermark.tsxindex 16dd385..c5b0a0d 100644--- a/examples/takumi/watermark.tsx+++ b/examples/takumi/watermark.tsx@@ -1,22 +1,27 @@-import { Text } from "@/registry/bases/takumi/components/text";-import { PdfWatermark } from "@/registry/bases/takumi/components/watermark";-import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";+import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";+import { PdfWatermark } from "@/registry/bases/takumi/components/watermark";+import { Text } from "@/registry/bases/takumi/components/text";-const DemoBody = () => (- <>- <PdfWatermark text="DRAFT" />- <Text>Document content</Text>- </>-);-const Demo = () => (- <Document>- <Page size="A4">- <PdfcnThemeProvider>- <DemoBody />- </PdfcnThemeProvider>- </Page>- </Document>-);+const Demo =() => {+ return (+ <Document>+ <Page size="A4">+ <PdfcnThemeProvider>+ <DemoBody />+ </PdfcnThemeProvider>+ </Page>+ </Document>+ );+}export default Demo;++function DemoBody() {+ return (+ <>+ <PdfWatermark text="DRAFT" />+ <Text>Document content</Text>+ </>+ );+}diff --git a/hooks/use-haptic-toggle.ts b/hooks/use-haptic-toggle.tsindex 96698d2..536a94c 100644--- a/hooks/use-haptic-toggle.ts+++ b/hooks/use-haptic-toggle.ts@@ -1,6 +1,50 @@+"use client";++import { defineSound } from "@web-kits/audio";import { useAtom } from "jotai";import { atomWithStorage } from "jotai/utils";+import { useCallback } from "react";+import { useHotkeys } from "react-hotkeys-hook";+import { useWebHaptics } from "web-haptics/react";++import * as audio from "@/audio/core";+import { useSoundEnabled } from "@/hooks/use-sound-toggle";const hapticsEnabledAtom = atomWithStorage("haptics-enabled", false);export const useHapticsEnabled = () => useAtom(hapticsEnabledAtom);++export const useHapticsToggle = () => {+ const [hapticsEnabled, setHapticsEnabled] = useAtom(hapticsEnabledAtom);+ const [soundEnabled] = useSoundEnabled();+ const { trigger: hapticTrigger } = useWebHaptics();++ const toggleHaptics = useCallback(() => {+ if (hapticsEnabled) {+ if (soundEnabled) {+ defineSound(audio._patch.sounds["toggle-off"])();+ }+ void hapticTrigger("light");+ setHapticsEnabled(false);+ } else {+ setHapticsEnabled(true);+ if (soundEnabled) {+ defineSound(audio._patch.sounds["toggle-on"])();+ }+ void hapticTrigger("light");+ }+ }, [hapticsEnabled, setHapticsEnabled, soundEnabled, hapticTrigger]);++ useHotkeys(+ "h",+ () => toggleHaptics(),+ {+ enableOnContentEditable: true,+ enableOnFormTags: true,+ preventDefault: true,+ },+ [toggleHaptics]+ );++ return { hapticsEnabled, toggleHaptics };+};diff --git a/hooks/use-sound-toggle.ts b/hooks/use-sound-toggle.tsindex 171ad84..9bcfdb7 100644--- a/hooks/use-sound-toggle.ts+++ b/hooks/use-sound-toggle.ts@@ -1,6 +1,40 @@+"use client";++import { defineSound } from "@web-kits/audio";import { useAtom } from "jotai";import { atomWithStorage } from "jotai/utils";+import { useCallback } from "react";+import { useHotkeys } from "react-hotkeys-hook";++import * as audio from "@/audio/core";const soundEnabledAtom = atomWithStorage("sound-enabled", false);export const useSoundEnabled = () => useAtom(soundEnabledAtom);++export const useSoundToggle = () => {+ const [soundEnabled, setSoundEnabled] = useAtom(soundEnabledAtom);++ const toggleSound = useCallback(() => {+ if (soundEnabled) {+ defineSound(audio._patch.sounds["toggle-off"])();+ setSoundEnabled(false);+ } else {+ setSoundEnabled(true);+ defineSound(audio._patch.sounds["toggle-on"])();+ }+ }, [soundEnabled, setSoundEnabled]);++ useHotkeys(+ "s",+ () => toggleSound(),+ {+ enableOnContentEditable: true,+ enableOnFormTags: true,+ preventDefault: true,+ },+ [toggleSound]+ );++ return { soundEnabled, toggleSound };+};diff --git a/hooks/use-theme-toggle.ts b/hooks/use-theme-toggle.tsindex 4281014..f3c2eb2 100644--- a/hooks/use-theme-toggle.ts+++ b/hooks/use-theme-toggle.ts@@ -29,7 +29,16 @@ export const useThemeToggle = () => {setTheme(nextResolved);}, [resolvedTheme, setTheme, feedbackOn, feedbackOff]);- useHotkeys("d", () => toggleTheme(), { preventDefault: true });+ useHotkeys(+ "d",+ () => toggleTheme(),+ {+ enableOnContentEditable: true,+ enableOnFormTags: true,+ preventDefault: true,+ },+ [toggleTheme]+ );return { toggleTheme };};diff --git a/lib/page-tree.ts b/lib/page-tree.tsindex dae768c..177fd1c 100644--- a/lib/page-tree.ts+++ b/lib/page-tree.ts@@ -3,6 +3,7 @@ import type {Root as PageTreeRoot,} from "fumadocs-core/page-tree";+import { ROUTES } from "@/constants/routes";import {EXCLUDED_SECTIONS,isBlocksFolder,@@ -41,7 +42,9 @@ export const getPagesFromFolder = (folder: PageTreeFolder): PageTreePage[] =>const matchesBase = (folder: PageTreeFolder, base: string): boolean =>folder.$id === base ||- (typeof folder.name === "string" && folder.name.toLowerCase() === base);+ String(folder.$id ?? "").endsWith(`/${base}`) ||+ (typeof folder.name === "string" &&+ folder.name.toLowerCase() === base.toLowerCase());export const findBaseFolder = (folder: PageTreeFolder,@@ -118,7 +121,9 @@ export const getTreeGroups = (if (baseFolder) {// Get pages from the base folderconst pages = getAllPagesFromFolder(baseFolder).filter(- (page) => !page.url.endsWith("/components") && !page.url.endsWith("/components/")+ (page) =>+ page.url !== ROUTES.DOCS_COMPONENTS &&+ page.url !== `${ROUTES.DOCS_COMPONENTS}/${currentBase}`);if (pages.length > 0) {groups.push({@@ -129,7 +134,7 @@ export const getTreeGroups = (} else {// No base folder found, get all pages from components folderconst pages = getAllPagesFromFolder(item).filter(- (page) => !page.url.endsWith("/components") && !page.url.endsWith("/components/")+ (page) => page.url !== ROUTES.DOCS_COMPONENTS);if (pages.length > 0) {groups.push({@@ -140,7 +145,9 @@ export const getTreeGroups = (}} else if (isBlocksFolder(item)) {const pages = getFolderPages(item, currentBase).filter(- (page) => !page.url.endsWith("/blocks") && !page.url.endsWith("/blocks/")+ (page) =>+ page.url !== ROUTES.DOCS_BLOCKS &&+ page.url !== `${ROUTES.DOCS_BLOCKS}/${currentBase}`);if (pages.length > 0) {groups.push({diff --git a/mdx-components.tsx b/mdx-components.tsxindex 708edcc..b1d632f 100644--- a/mdx-components.tsx+++ b/mdx-components.tsx@@ -10,7 +10,7 @@ import { ComponentSource } from "@/components/component-source";import { ComponentsList } from "@/components/components-list";import { CopyButton } from "@/components/copy-button";import { getIconForLanguageExtension } from "@/components/icons";-import { PdfPreview } from "@/components/pdf-preview";+import { PdfPreview } from "@/components/pdf-preview-wrapper";import {Accordion,AccordionContent,diff --git a/next.config.mjs b/next.config.mjsindex 89476f1..accf8fa 100644--- a/next.config.mjs+++ b/next.config.mjs@@ -57,6 +57,25 @@ const nextConfig = {"@formepdf/core","@takumi-rs/helpers",],+ webpack(config, { dev, isServer }) {+ config.module.rules.push({+ generator: {+ filename: "static/wasm/[name].[contenthash][ext]",+ },+ test: /takumi_pdf_wasm_bg\.wasm$/,+ type: "asset/resource",+ });+ config.output.webassemblyModuleFilename =+ isServer && !dev+ ? "../static/wasm/[modulehash].wasm"+ : "static/wasm/[modulehash].wasm";+ config.experiments = {+ ...config.experiments,+ asyncWebAssembly: true,+ };++ return config;+ },};const withMDX = createMDX({});diff --git a/package.json b/package.jsonindex 383d444..f363903 100644--- a/package.json+++ b/package.json@@ -3,8 +3,8 @@"version": "0.1.0","private": true,"scripts": {- "dev": "next dev",- "build": "pnpm registry:build && next build",+ "dev": "next dev --webpack",+ "build": "pnpm registry:build && next build --webpack","start": "next start","typecheck": "tsc --noEmit","registry:build": "node scripts/generate-registry.mjs && node scripts/build-registry.mjs",@@ -33,7 +33,7 @@"motion": "^12.38.0","next": "16.2.4","next-themes": "0.4.6",- "pdfjs-dist": "^6.2.108",+ "pdfjs-dist": "5.4.296","postcss": "^8.5.10","qrcode": "^1.5.4","radix-ui": "^1.4.3",@@ -44,6 +44,7 @@"rehype-pretty-code": "^0.14.3","shiki": "^4.0.2","sonner": "^2.0.7",+ "sucrase": "^3.35.1","tailwind-merge": "^3.5.0","takumi-pdf": "^0.4.1","ts-morph": "^26.0.0",diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 06c6435..4cce721 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -63,8 +63,8 @@ importers:specifier: 0.4.6pdfjs-dist:- specifier: ^6.2.108- version: 6.2.108+ specifier: 5.4.296+ version: 5.4.296postcss:specifier: ^8.5.10version: 8.5.10@@ -95,6 +95,9 @@ importers:sonner:specifier: ^2.0.7+ sucrase:+ specifier: ^3.35.1+ version: 3.35.1tailwind-merge:specifier: ^3.5.0version: 3.5.0@@ -893,48 +896,24 @@ packages:cpu: [arm64]os: [android]- '@napi-rs/[email protected]':- resolution: {integrity: sha512-7kSCdUhoXiO+AaIMXdBGdtp6EctZNkmF62Rea/BmVQlwKaM3bBhOzyGUzxyxz9dv5vdBfpyAaxhSRSJF4kqK4A==}- engines: {node: '>= 10'}- cpu: [arm64]- os: [android]-'@napi-rs/[email protected]':resolution: {integrity: sha512-2PcswRaC7Ly645DGt88///zuFDhJxJYdKAs1uU3mfk1atYkXufgcgLfBpk6Tm12nCQBaNt1wpybuPZ4qOhTo8A==}engines: {node: '>= 10'}cpu: [arm64]os: [darwin]- '@napi-rs/[email protected]':- resolution: {integrity: sha512-ds14V1BPagLszQyaDTeggny5fNeTCqsUQ5QhFj9VDxSEfzrVxXtdbR0LoFyKa0Siaaw8KvqSk4t7k/WoZJwvbg==}- engines: {node: '>= 10'}- cpu: [arm64]- os: [darwin]-'@napi-rs/[email protected]':resolution: {integrity: sha512-ePNZtj7pNIva/siZMg+HmbeozkIjqUIYdoymH8HaA3qK7LfzFN4WMBM8G6HQ9ZC+H3+Dnn5pqtiXpgLykaPOhw==}engines: {node: '>= 10'}cpu: [x64]os: [darwin]- '@napi-rs/[email protected]':- resolution: {integrity: sha512-qof3LRAAycmkV2I1izZo9RoSHF8kCQr5O05sFwv0jK8rSdYV6KHVwimo6Qb7RxZj40WHKbLHm5JDaUF0o5XUAA==}- engines: {node: '>= 10'}- cpu: [x64]- os: [darwin]-'@napi-rs/[email protected]':resolution: {integrity: sha512-d5cDB48oWFGU8/XPhUOFAlySgb/VAu7D+s8fi55K1Pcfg8aPplHWqMgibhVLU8ky7Pyg/fuiVLz4Nf3JrSTuUA==}engines: {node: '>= 10'}cpu: [arm]os: [linux]- '@napi-rs/[email protected]':- resolution: {integrity: sha512-FU2kKZLmolHA9+KcUA+l1+xH3WTLUUTQDU/kLv9SEUr2TrRPu94aytOeizFJDHPs/QBcw4QL1mCQhetQXYBbag==}- engines: {node: '>= 10'}- cpu: [arm]- os: [linux]-'@napi-rs/[email protected]':resolution: {integrity: sha512-rDxgxRu69RvDlX/bh9o22DxLsGr8EqsNgotL9+RwQE1S0b0cqeatqsw6aW45mukm0B42DIAaAacKaYQ8cqS1nw==}engines: {node: '>= 10'}@@ -942,13 +921,6 @@ packages:os: [linux]libc: [glibc]- '@napi-rs/[email protected]':- resolution: {integrity: sha512-GVSjntxKeA+/y/ZKf1F+cmUw1WeIkE5aMRPqnZUlBTBvBcrvgWccJAWuYCKPX4QJQwZILIIwhgdAbl51yj6fpA==}- engines: {node: '>= 10'}- cpu: [arm64]- os: [linux]- libc: [glibc]-'@napi-rs/[email protected]':resolution: {integrity: sha512-K3mDW66N+xT2/V439u1alFANiBUjdEx2gLiNYnCmUsva5jZMxWTjafBYwTzYK+EMFMHrUoabuU+T1BIP5CgbYQ==}engines: {node: '>= 10'}@@ -956,13 +928,6 @@ packages:os: [linux]libc: [musl]- '@napi-rs/[email protected]':- resolution: {integrity: sha512-J51oK/axyZ13kxycumSMfLiDZMdWdOVvqDFI28BpuViZHE3A0bQfr8B5vg8YnPEnqLD3BSn1hkdlh2buspEcNQ==}- engines: {node: '>= 10'}- cpu: [arm64]- os: [linux]- libc: [musl]-'@napi-rs/[email protected]':resolution: {integrity: sha512-mooqUBTIsccZpnoQC4NgrC1v6C1vof39etLNMnBwCY+p0gajWJvAHLGQ6g/gGyS5YrpDW+GefSN4+Cvcr08UWw==}engines: {node: '>= 10'}@@ -970,13 +935,6 @@ packages:os: [linux]libc: [glibc]- '@napi-rs/[email protected]':- resolution: {integrity: sha512-CtQgQjoVTX67jS9XuCTtJ40Sl7wRLMguoFnnGnfDmCWf7kzKFZVwj5ynqUOIGKFMSB61ZCuQlwPvVNxYTTseaw==}- engines: {node: '>= 10'}- cpu: [riscv64]- os: [linux]- libc: [glibc]-'@napi-rs/[email protected]':resolution: {integrity: sha512-1eCvkDCazm7FFhsT7DfGOdSaHgZVK3bt/dSBl5EWHOWmnz+I7j8tPseJqqD81NF+MH21jKUK4wQSDjN0mdhnTg==}engines: {node: '>= 10'}@@ -984,13 +942,6 @@ packages:os: [linux]libc: [glibc]- '@napi-rs/[email protected]':- resolution: {integrity: sha512-jtfzAHFp+FRaR7zGT4jyCe6wUgAG/dVb5A4Apd8FY9jKarntDfUAlJXscugiH7ZF5kKnu7/lHFk9LaDPcrGEVQ==}- engines: {node: '>= 10'}- cpu: [x64]- os: [linux]- libc: [glibc]-'@napi-rs/[email protected]':resolution: {integrity: sha512-20arT6lnI19S68qNlii73TSEDbECNgzMz2EpldC1V3mZFuRkeujXkcebRk0LRJe9SEUAooYiLokfMViY8IX7yA==}engines: {node: '>= 10'}@@ -998,45 +949,22 @@ packages:os: [linux]libc: [musl]- '@napi-rs/[email protected]':- resolution: {integrity: sha512-xTzaUCKUHTY4bCGadeeRZggbRVbGUT1petg7Z8r9AJR2+D9Bqu6nQAgqBGC6D47tA70LjaaaLTrJ7wNY1T74dg==}- engines: {node: '>= 10'}- cpu: [x64]- os: [linux]- libc: [musl]-'@napi-rs/[email protected]':resolution: {integrity: sha512-DZFFT1wIAg37LJw37yhMRFfjATd3vTQzjZ1Yki8u2vhO6Hi5VE6BVaGQ1aaDu7xb4iMErz+9EOwjpS7xcxFeBw==}engines: {node: '>= 10'}cpu: [arm64]os: [win32]- '@napi-rs/[email protected]':- resolution: {integrity: sha512-ktVLuBkI6QVOm5BwO/WbdGwxgeetAMJa7TTmR8qBarXF0OU2NKjvjUtPJAl2y8t+zBRczJl/1VOl9gua6WcK2g==}- engines: {node: '>= 10'}- cpu: [arm64]- os: [win32]-'@napi-rs/[email protected]':resolution: {integrity: sha512-MyT1j3mHC2+Lu4pBi9mKyMJhtP6U7k7EldY7sj/uS5gJA65gTXt8MefJQXLJo5d/vZbuWmfxzkEUNc/urV3pHA==}engines: {node: '>= 10'}cpu: [x64]os: [win32]- '@napi-rs/[email protected]':- resolution: {integrity: sha512-SGhlQ8bDjL1Cz2KnsKMasr/5sTcwG/SZkB6WCJxLsmSm/3aS2C+3p39bA7iZ2/94+NkVDySZfbiGoaSZSFHYxA==}- engines: {node: '>= 10'}- cpu: [x64]- os: [win32]-'@napi-rs/[email protected]':resolution: {integrity: sha512-xglYA6q3XO5P3BNJYxVZ1IV7DLVjp1Py6nwag88YntrS+3vKHyYcMqXVS4ZztJmwz2uGvz1FWhI/4LgbR5uQDA==}engines: {node: '>= 10'}- '@napi-rs/[email protected]':- resolution: {integrity: sha512-OlI657a5XXvKGFX7kNeIzJ8rO7IXt87Mqu2H8rXE46viAuOfum/JA7ysX7+eBhxNKznT+RCZh418mndlcFX3+w==}- engines: {node: '>= 10'}-'@next/[email protected]':resolution: {integrity: sha512-dKkkOzOSwFYe5RX6y26fZgkSpVAlIOJKQHIiydQcrWH6y/97+RceSOAdjZ14Qa3zLduVUy0TXcn+EiM6t4rPgw==}@@ -2372,6 +2300,9 @@ packages:resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==}engines: {node: '>=8'}+ resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==}+resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}@@ -2532,6 +2463,10 @@ packages:resolution: {integrity: sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==}engines: {node: '>=20'}+ resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==}+ engines: {node: '>= 6'}+resolution: {integrity: sha512-VRhuHOLoKYOy4UbilLbUzbYg93XLjv2PncJC50EuTWPA3gaja1UjBsUP/D/9/juV3vQFr6XBEzn9KCAHdUvOHw==}@@ -3710,6 +3645,9 @@ packages:resolution: {integrity: sha512-dkEJPVvun4FryqBmZ5KhDo0K9iDXAwn08tMLDinNdRBNPcYEDiWYysLcc6k3mjTMlbP9KyylvRpd4wFtwrT9rw==}engines: {node: ^20.17.0 || >=22.9.0}+ resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==}+resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==}engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}@@ -3903,10 +3841,6 @@ packages:resolution: {integrity: sha512-DlOzet0HO7OEnmUmB6wWGJrrdvbyJKftI1bhMitK7O2N8W2gc757yyYBbINy9IDafXAV9wmKr9t7xsTaNKRG5Q==}engines: {node: '>=20.16.0 || >=22.3.0'}- resolution: {integrity: sha512-YxFb+SQcodN2rnX9Tn3dHYlqfb7NjlzzfONPpJd+AKoKtUjEdevTfbC07d5TcczzOK6261auRkP/M8OBHs9vFQ==}- engines: {node: '>=22.13.0 || >=24'}-resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}@@ -3918,6 +3852,10 @@ packages:resolution: {integrity: sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==}engines: {node: '>=12'}+ resolution: {integrity: sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==}+ engines: {node: '>= 6'}+resolution: {integrity: sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==}engines: {node: '>=16.20.0'}@@ -4314,6 +4252,11 @@ packages:babel-plugin-macros:optional: true+ resolution: {integrity: sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw==}+ engines: {node: '>=16 || 14 >=14.17'}+ hasBin: true+resolution: {integrity: sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng==}engines: {node: '>=20'}@@ -4337,6 +4280,13 @@ packages:resolution: {integrity: sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==}engines: {node: '>=6'}+ resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==}+ engines: {node: '>=0.8'}++ resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==}+resolution: {integrity: sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==}@@ -4377,6 +4327,9 @@ packages:resolution: {integrity: sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==}+ resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==}+resolution: {integrity: sha512-ztMO++owQnz8c/gIENcM9XfCEzgoGphTv+nKpYNM1bgsdOVC/jRZuEBf6N+mLLDNg68Kl+GgUZfOySaRiG1/Ug==}@@ -5286,69 +5239,36 @@ snapshots:'@napi-rs/[email protected]':optional: true- '@napi-rs/[email protected]':- optional: true-'@napi-rs/[email protected]':optional: true- '@napi-rs/[email protected]':- optional: true-'@napi-rs/[email protected]':optional: true- '@napi-rs/[email protected]':- optional: true-'@napi-rs/[email protected]':optional: true- '@napi-rs/[email protected]':- optional: true-'@napi-rs/[email protected]':optional: true- '@napi-rs/[email protected]':- optional: true-'@napi-rs/[email protected]':optional: true- '@napi-rs/[email protected]':- optional: true-'@napi-rs/[email protected]':optional: true- '@napi-rs/[email protected]':- optional: true-'@napi-rs/[email protected]':optional: true- '@napi-rs/[email protected]':- optional: true-'@napi-rs/[email protected]':optional: true- '@napi-rs/[email protected]':- optional: true-'@napi-rs/[email protected]':optional: true- '@napi-rs/[email protected]':- optional: true-'@napi-rs/[email protected]':optional: true- '@napi-rs/[email protected]':- optional: true-'@napi-rs/[email protected]':optionalDependencies:'@napi-rs/canvas-android-arm64': 0.1.100@@ -5364,21 +5284,6 @@ snapshots:'@napi-rs/canvas-win32-x64-msvc': 0.1.100optional: true- '@napi-rs/[email protected]':- optionalDependencies:- '@napi-rs/canvas-android-arm64': 1.0.3- '@napi-rs/canvas-darwin-arm64': 1.0.3- '@napi-rs/canvas-darwin-x64': 1.0.3- '@napi-rs/canvas-linux-arm-gnueabihf': 1.0.3- '@napi-rs/canvas-linux-arm64-gnu': 1.0.3- '@napi-rs/canvas-linux-arm64-musl': 1.0.3- '@napi-rs/canvas-linux-riscv64-gnu': 1.0.3- '@napi-rs/canvas-linux-x64-gnu': 1.0.3- '@napi-rs/canvas-linux-x64-musl': 1.0.3- '@napi-rs/canvas-win32-arm64-msvc': 1.0.3- '@napi-rs/canvas-win32-x64-msvc': 1.0.3- optional: true-'@next/[email protected]': {}'@next/[email protected]':@@ -6540,6 +6445,8 @@ snapshots:dependencies:color-convert: 2.0.1+ [email protected]: {}+@@ -6688,6 +6595,8 @@ snapshots:+ [email protected]: {}+@@ -8102,6 +8011,12 @@ snapshots:+ dependencies:+ any-promise: 1.3.0+ object-assign: 4.1.1+ thenify-all: 1.6.0+@@ -8330,16 +8245,14 @@ snapshots:optionalDependencies:'@napi-rs/canvas': 0.1.100- optionalDependencies:- '@napi-rs/canvas': 1.0.3-+ [email protected]: {}+@@ -8916,6 +8829,16 @@ snapshots:optionalDependencies:'@babel/core': 7.29.0+ dependencies:+ '@jridgewell/gen-mapping': 0.3.13+ commander: 4.1.1+ lines-and-columns: 1.2.4+ mz: 2.7.0+ pirates: 4.0.7+ tinyglobby: 0.2.16+ ts-interface-checker: 0.1.13+@@ -8932,6 +8855,14 @@ snapshots:+ dependencies:+ thenify: 3.3.1++ dependencies:+ any-promise: 1.3.0+@@ -8963,6 +8894,8 @@ snapshots:+ [email protected]: {}+dependencies:'@ts-morph/common': 0.27.0diff --git a/public/r/forme/alert.json b/public/r/forme/alert.jsonindex 65cc5cd..318766b 100644--- a/public/r/forme/alert.json+++ b/public/r/forme/alert.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/forme/components/alert/alert.tsx",- "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport type { ReactNode } from \"react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { Circle, Line, Path, Svg } from \"../../lib/forme-svg\";\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\n\nexport type AlertVariant = \"info\" | \"success\" | \"warning\" | \"error\";\n\n/**\n * Alert box with severity variants for info, success, warning, and error states.\n * Props - `variant` | `title` | `children` | `showIcon` | `showBorder` | `style`\n * @see {@link PdfAlertProps}\n */\nexport interface PdfAlertProps extends Omit<PDFComponentProps, \"children\"> {\n /**\n * @default 'info'\n */\n variant?: AlertVariant;\n title?: string;\n children?: ReactNode;\n /**\n * @default true\n */\n showIcon?: boolean;\n /**\n * @default true\n */\n showBorder?: boolean;\n}\n\n/** Stroke width for all alert SVG icons (SVG user units). */\nconst ICON_STROKE_WIDTH = 1.5;\n\nconst SvgWrap = ({ children }: { children: ReactNode }) => (\n <Svg width={16} height={16} viewBox=\"0 0 16 16\">\n {children}\n </Svg>\n);\n\nconst ICON_MAP = {\n error: ({ color }: { color: string }) => (\n <SvgWrap>\n <Circle\n cx={8}\n cy={8}\n r={7}\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n />\n <Line\n x1={5.5}\n y1={5.5}\n x2={10.5}\n y2={10.5}\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n />\n <Line\n x1={10.5}\n y1={5.5}\n x2={5.5}\n y2={10.5}\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n />\n </SvgWrap>\n ),\n info: ({ color }: { color: string }) => (\n <SvgWrap>\n <Circle\n cx={8}\n cy={8}\n r={7}\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n />\n <Circle cx={8} cy={4.5} r={1} fill={color} />\n <Line\n x1={8}\n y1={7}\n x2={8}\n y2={11.5}\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n />\n </SvgWrap>\n ),\n success: ({ color }: { color: string }) => (\n <SvgWrap>\n <Circle\n cx={8}\n cy={8}\n r={7}\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n />\n <Path\n d=\"M5 8 L7 10 L11 6\"\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </SvgWrap>\n ),\n warning: ({ color }: { color: string }) => (\n <SvgWrap>\n <Path\n d=\"M8 1.5 L15 14.5 L1 14.5 Z\"\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinejoin=\"round\"\n />\n <Line\n x1={8}\n y1={6}\n x2={8}\n y2={10}\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n />\n <Circle cx={8} cy={12.5} r={0.75} fill={color} />\n </SvgWrap>\n ),\n};\n\nfunction AlertIcon({\n variant,\n color,\n}: {\n variant: AlertVariant;\n color: string;\n}) {\n const Icon = ICON_MAP[variant];\n return <Icon color={color} />;\n}\n\nfunction createAlertStyles(theme: PdfcnTheme) {\n const { typography, colors, primitives } = theme;\n\n const variantColors = {\n error: colors.destructive ?? \"#EF4444\",\n info: colors.info ?? \"#3B82F6\",\n success: colors.success ?? \"#22C55E\",\n warning: colors.warning ?? \"#F59E0B\",\n } satisfies Record<AlertVariant, string>;\n\n const bl = (color: string) => ({\n borderLeftColor: color,\n borderLeftWidth: 4,\n });\n\n const sheet = StyleSheet.create({\n bg: {\n backgroundColor: colors.muted,\n },\n borderError: bl(variantColors.error),\n borderInfo: bl(variantColors.info),\n borderSuccess: bl(variantColors.success),\n borderWarning: bl(variantColors.warning),\n container: {\n borderRadius: 4,\n flexDirection: \"row\",\n marginBottom: theme.spacing.componentGap,\n padding: 12,\n },\n contentContainer: { flex: 1 },\n description: {\n color: colors.mutedForeground,\n fontFamily: typography.body.fontFamily,\n fontSize: primitives.typography.sm,\n lineHeight: typography.body.lineHeight,\n },\n iconContainer: {\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n marginRight: 10,\n paddingTop: 2,\n width: 20,\n },\n title: {\n color: colors.foreground,\n fontFamily: typography.heading.fontFamily,\n fontSize: primitives.typography.sm,\n fontWeight: primitives.fontWeights.semibold,\n marginBottom: 4,\n },\n });\n\n return {\n ...sheet,\n borderMap: {\n error: sheet.borderError,\n info: sheet.borderInfo,\n success: sheet.borderSuccess,\n warning: sheet.borderWarning,\n } as Record<AlertVariant, Style>,\n /** Resolved hex colors for each variant — used to tint the SVG icons. */\n variantColors,\n };\n}\n\nexport function PdfAlert({\n variant = \"info\",\n title,\n children,\n showIcon = true,\n showBorder = true,\n style,\n}: PdfAlertProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createAlertStyles(theme), [theme]);\n\n if (!title && !children) {return null;}\n\n const containerStyles: Style[] = [\n styles.container,\n styles.bg,\n ...(showBorder ? [styles.borderMap[variant]] : []),\n ...(style ? [style].flat() : []),\n ];\n\n return (\n <View wrap={false} style={containerStyles as never}>\n {showIcon && (\n <View style={styles.iconContainer}>\n <AlertIcon variant={variant} color={styles.variantColors[variant]} />\n </View>\n )}\n <View style={styles.contentContainer}>\n {title && <PDFText style={styles.title}>{title}</PDFText>}\n {typeof children === \"string\" ? (\n <PDFText style={styles.description}>{children}</PDFText>\n ) : (\n children\n )}\n </View>\n </View>\n );\n}\n",- "type": "registry:component"+ "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport type { ReactNode } from \"react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { Circle, Line, Path, Svg } from \"../../lib/forme-svg\";\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\n\nexport type AlertVariant = \"info\" | \"success\" | \"warning\" | \"error\";\n\n/**\n * Alert box with severity variants for info, success, warning, and error states.\n * Props - `variant` | `title` | `children` | `showIcon` | `showBorder` | `style`\n * @see {@link PdfAlertProps}\n */\nexport interface PdfAlertProps extends Omit<PDFComponentProps, \"children\"> {\n /**\n * @default 'info'\n */\n variant?: AlertVariant;\n title?: string;\n children?: ReactNode;\n /**\n * @default true\n */\n showIcon?: boolean;\n /**\n * @default true\n */\n showBorder?: boolean;\n}\n\n/** Stroke width for all alert SVG icons (SVG user units). */\nconst ICON_STROKE_WIDTH = 1.5;\n\nconst SvgWrap = ({ children }: { children: ReactNode }) => (\n <Svg width={16} height={16} viewBox=\"0 0 16 16\">\n {children}\n </Svg>\n);\n\nconst ICON_MAP = {\n error: ({ color }: { color: string }) => (\n <SvgWrap>\n <Circle\n cx={8}\n cy={8}\n r={7}\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n />\n <Line\n x1={5.5}\n y1={5.5}\n x2={10.5}\n y2={10.5}\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n />\n <Line\n x1={10.5}\n y1={5.5}\n x2={5.5}\n y2={10.5}\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n />\n </SvgWrap>\n ),\n info: ({ color }: { color: string }) => (\n <SvgWrap>\n <Circle\n cx={8}\n cy={8}\n r={7}\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n />\n <Circle cx={8} cy={4.5} r={1} fill={color} />\n <Line\n x1={8}\n y1={7}\n x2={8}\n y2={11.5}\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n />\n </SvgWrap>\n ),\n success: ({ color }: { color: string }) => (\n <SvgWrap>\n <Circle\n cx={8}\n cy={8}\n r={7}\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n />\n <Path\n d=\"M5 8 L7 10 L11 6\"\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </SvgWrap>\n ),\n warning: ({ color }: { color: string }) => (\n <SvgWrap>\n <Path\n d=\"M8 1.5 L15 14.5 L1 14.5 Z\"\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinejoin=\"round\"\n />\n <Line\n x1={8}\n y1={6}\n x2={8}\n y2={10}\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n />\n <Circle cx={8} cy={12.5} r={0.75} fill={color} />\n </SvgWrap>\n ),\n};\n\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={containerStyles as never}>\n {showIcon && (\n <View style={styles.iconContainer}>\n <AlertIcon variant={variant} color={styles.variantColors[variant]} />\n </View>\n )}\n <View style={styles.contentContainer}>\n {title && <PDFText style={styles.title}>{title}</PDFText>}\n {typeof children === \"string\" ? (\n <PDFText style={styles.description}>{children}</PDFText>\n ) : (\n children\n )}\n </View>\n </View>\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/alert/alert.tsx"},{"path": "registry/bases/forme/components/alert/index.ts","content": "export { PdfAlert, type PdfAlertProps, type AlertVariant } from \"./alert\";\n",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/alert/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/badge.json b/public/r/forme/badge.jsonindex daa544c..47f355b 100644--- a/public/r/forme/badge.json+++ b/public/r/forme/badge.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/forme/components/badge/badge.tsx",- "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type BadgeVariant =\n | \"default\"\n | \"primary\"\n | \"success\"\n | \"warning\"\n | \"destructive\"\n | \"info\"\n | \"outline\";\nexport type BadgeSize = \"sm\" | \"md\" | \"lg\";\n\n/**\n * Inline label for status, tags, or categories.\n *\n * Accepts text via either `label` prop or `children` (string). `label` takes\n * precedence when both are provided. The children pattern (`<Badge>text</Badge>`)\n * is supported for compatibility with common React idioms, but note that\n * `@formepdf/react` doesn't support JSX children the way HTML does — only\n * string children are accepted.\n *\n * Props - `label` | `children` | `variant` | `size` | `background` | `color` | `style`\n * @see {@link BadgeProps}\n */\nexport interface BadgeProps extends Omit<PDFComponentProps, \"children\"> {\n /** Text to display. Takes precedence over children when both are provided. */\n label?: string;\n /** String children as an alternative to the label prop. */\n children?: string;\n /**\n * @default 'default'\n */\n variant?: BadgeVariant;\n /**\n * @default 'md'\n */\n size?: BadgeSize;\n background?: string;\n color?: string;\n}\n\nfunction createBadgeStyles(t: PdfcnTheme) {\n const { spacing, borderRadius, fontWeights } = t.primitives;\n const c = t.colors;\n const textBase = {\n fontFamily: t.typography.body.fontFamily,\n fontWeight: fontWeights.semibold,\n letterSpacing: 0.3,\n };\n const variantBox = (borderColor: string, bgColor: string = c.muted) => ({\n backgroundColor: bgColor,\n borderColor,\n borderStyle: \"solid\" as const,\n borderWidth: spacing[0.5],\n });\n const sheet = StyleSheet.create({\n containerBase: {\n alignItems: \"center\" as const,\n alignSelf: \"flex-start\" as const,\n borderRadius: borderRadius.full,\n flexDirection: \"row\" as const,\n },\n sizeLg: { paddingHorizontal: spacing[4], paddingVertical: spacing[2] },\n sizeMd: { paddingHorizontal: spacing[3], paddingVertical: spacing[1] },\n sizeSm: { paddingHorizontal: spacing[2], paddingVertical: spacing[0.5] },\n textDefault: { ...textBase, color: c.mutedForeground },\n textDestructive: { ...textBase, color: c.destructive },\n textInfo: { ...textBase, color: c.info },\n textLg: { fontSize: t.primitives.typography.sm },\n textMd: { fontSize: t.primitives.typography.xs },\n textOutline: { ...textBase, color: c.foreground },\n textPrimary: { ...textBase, color: c.primaryForeground },\n textSm: { fontSize: t.primitives.typography.xs - 1 },\n textSuccess: { ...textBase, color: c.success },\n textWarning: { ...textBase, color: c.warning },\n variantDefault: variantBox(c.border),\n variantDestructive: variantBox(c.destructive),\n variantInfo: variantBox(c.info),\n variantOutline: variantBox(c.border, c.background),\n variantPrimary: variantBox(c.primary, c.primary),\n variantSuccess: variantBox(c.success),\n variantWarning: variantBox(c.warning),\n });\n return {\n ...sheet,\n containerSizeMap: {\n sm: sheet.sizeSm,\n md: sheet.sizeMd,\n lg: sheet.sizeLg,\n } as Record<BadgeSize, Style>,\n containerVariantMap: {\n default: sheet.variantDefault,\n primary: sheet.variantPrimary,\n success: sheet.variantSuccess,\n warning: sheet.variantWarning,\n destructive: sheet.variantDestructive,\n info: sheet.variantInfo,\n outline: sheet.variantOutline,\n } as Record<BadgeVariant, Style>,\n textSizeMap: {\n sm: sheet.textSm,\n md: sheet.textMd,\n lg: sheet.textLg,\n } as Record<BadgeSize, Style>,\n textVariantMap: {\n default: sheet.textDefault,\n primary: sheet.textPrimary,\n success: sheet.textSuccess,\n warning: sheet.textWarning,\n destructive: sheet.textDestructive,\n info: sheet.textInfo,\n outline: sheet.textOutline,\n } as Record<BadgeVariant, Style>,\n };\n}\n\nexport function Badge({\n label,\n children,\n variant = \"default\",\n size = \"md\",\n background,\n color,\n style,\n}: BadgeProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createBadgeStyles(theme), [theme]);\n // `label` takes precedence; fall back to string children for React idiom compatibility\n const text = label ?? children ?? \"\";\n const containerStyles: Style[] = [\n styles.containerBase,\n styles.containerVariantMap[variant],\n styles.containerSizeMap[size],\n ...(background\n ? [{ backgroundColor: resolveColor(background, theme.colors) }]\n : []),\n ...(style ? [style].flat() : []),\n ];\n const textStyles: Style[] = [\n styles.textVariantMap[variant],\n styles.textSizeMap[size],\n ...(color ? [{ color: resolveColor(color, theme.colors) }] : []),\n ];\n return (\n <View style={containerStyles as never}>\n <PDFText style={textStyles as never}>{text}</PDFText>\n </View>\n );\n}\n",- "type": "registry:component"+ "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type BadgeVariant =\n | \"default\"\n | \"primary\"\n | \"success\"\n | \"warning\"\n | \"destructive\"\n | \"info\"\n | \"outline\";\nexport type BadgeSize = \"sm\" | \"md\" | \"lg\";\n\n/**\n * Inline label for status, tags, or categories.\n *\n * Accepts text via either `label` prop or `children` (string). `label` takes\n * precedence when both are provided. The children pattern (`<Badge>text</Badge>`)\n * is supported for compatibility with common React idioms, but note that\n * `@formepdf/react` doesn't support JSX children the way HTML does — only\n * string children are accepted.\n *\n * Props - `label` | `children` | `variant` | `size` | `background` | `color` | `style`\n * @see {@link BadgeProps}\n */\nexport interface BadgeProps extends Omit<PDFComponentProps, \"children\"> {\n /** Text to display. Takes precedence over children when both are provided. */\n label?: string;\n /** String children as an alternative to the label prop. */\n children?: string;\n /**\n * @default 'default'\n */\n variant?: BadgeVariant;\n /**\n * @default 'md'\n */\n size?: BadgeSize;\n background?: string;\n color?: string;\n}\n\nconst createBadgeStyles = (t: PdfcnTheme) => {\n const { spacing, borderRadius, fontWeights } = t.primitives;\n const c = t.colors;\n const textBase = {\n fontFamily: t.typography.body.fontFamily,\n fontWeight: fontWeights.semibold,\n letterSpacing: 0.3,\n };\n const variantBox = (borderColor: string, bgColor: string = c.muted) => ({\n backgroundColor: bgColor,\n borderColor,\n borderStyle: \"solid\" as const,\n borderWidth: spacing[0.5],\n });\n const sheet = StyleSheet.create({\n containerBase: {\n alignItems: \"center\" as const,\n alignSelf: \"flex-start\" as const,\n borderRadius: borderRadius.full,\n flexDirection: \"row\" as const,\n },\n sizeLg: { paddingHorizontal: spacing[4], paddingVertical: spacing[2] },\n sizeMd: { paddingHorizontal: spacing[3], paddingVertical: spacing[1] },\n sizeSm: { paddingHorizontal: spacing[2], paddingVertical: spacing[0.5] },\n textDefault: { ...textBase, color: c.mutedForeground },\n textDestructive: { ...textBase, color: c.destructive },\n textInfo: { ...textBase, color: c.info },\n textLg: { fontSize: t.primitives.typography.sm },\n textMd: { fontSize: t.primitives.typography.xs },\n textOutline: { ...textBase, color: c.foreground },\n textPrimary: { ...textBase, color: c.primaryForeground },\n textSm: { fontSize: t.primitives.typography.xs - 1 },\n textSuccess: { ...textBase, color: c.success },\n textWarning: { ...textBase, color: c.warning },\n variantDefault: variantBox(c.border),\n variantDestructive: variantBox(c.destructive),\n variantInfo: variantBox(c.info),\n variantOutline: variantBox(c.border, c.background),\n variantPrimary: variantBox(c.primary, c.primary),\n variantSuccess: variantBox(c.success),\n variantWarning: variantBox(c.warning),\n });\n return {\n ...sheet,\n containerSizeMap: {\n lg: sheet.sizeLg,\n md: sheet.sizeMd,\n sm: sheet.sizeSm,\n } as Record<BadgeSize, Style>,\n containerVariantMap: {\n default: sheet.variantDefault,\n destructive: sheet.variantDestructive,\n info: sheet.variantInfo,\n outline: sheet.variantOutline,\n primary: sheet.variantPrimary,\n success: sheet.variantSuccess,\n warning: sheet.variantWarning,\n } as Record<BadgeVariant, Style>,\n textSizeMap: {\n lg: sheet.textLg,\n md: sheet.textMd,\n sm: sheet.textSm,\n } as Record<BadgeSize, Style>,\n textVariantMap: {\n default: sheet.textDefault,\n destructive: sheet.textDestructive,\n info: sheet.textInfo,\n outline: sheet.textOutline,\n primary: sheet.textPrimary,\n success: sheet.textSuccess,\n warning: sheet.textWarning,\n } as Record<BadgeVariant, Style>,\n };\n};\n\nexport const Badge = ({\n label,\n children,\n variant = \"default\",\n size = \"md\",\n background,\n color,\n style,\n}: BadgeProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createBadgeStyles(theme), [theme]);\n // `label` takes precedence; fall back to string children for React idiom compatibility\n const text = label ?? children ?? \"\";\n const containerStyles: Style[] = [\n styles.containerBase,\n styles.containerVariantMap[variant],\n styles.containerSizeMap[size],\n ...(background\n ? [{ backgroundColor: resolveColor(background, theme.colors) }]\n : []),\n ...(style ? [style].flat() : []),\n ];\n const textStyles: Style[] = [\n styles.textVariantMap[variant],\n styles.textSizeMap[size],\n ...(color ? [{ color: resolveColor(color, theme.colors) }] : []),\n ];\n return (\n <View style={containerStyles as never}>\n <PDFText style={textStyles as never}>{text}</PDFText>\n </View>\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/badge/badge.tsx"},{"path": "registry/bases/forme/components/badge/index.ts","content": "export {\n Badge,\n type BadgeProps,\n type BadgeVariant,\n type BadgeSize,\n} from \"./badge\";\n",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/badge/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/card.json b/public/r/forme/card.jsonindex 8583aaf..9e2dc9a 100644--- a/public/r/forme/card.json+++ b/public/r/forme/card.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/forme/components/card/card.tsx",- "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport type { ReactNode } from \"react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\n\nexport type CardVariant = \"default\" | \"bordered\" | \"muted\";\n\n/**\n * Bordered content card with optional title and padding presets.\n * Props - `title` | `children` | `variant` | `padding` | `wrap` | `style`\n * @see {@link PdfCardProps}\n */\nexport interface PdfCardProps extends Omit<PDFComponentProps, \"children\"> {\n title?: string;\n children?: ReactNode;\n /**\n * @default 'default'\n */\n variant?: CardVariant;\n /**\n * @default 'md'\n */\n padding?: \"sm\" | \"md\" | \"lg\";\n /**\n * When false, the card will not split across PDF pages.\n * @default false\n */\n wrap?: boolean;\n}\n\nfunction createCardStyles(t: PdfcnTheme) {\n const { spacing, borderRadius, fontWeights } = t.primitives;\n return StyleSheet.create({\n body: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n lineHeight: t.typography.body.lineHeight,\n },\n card: {\n backgroundColor: t.colors.background,\n borderColor: t.colors.border,\n borderRadius: borderRadius.sm,\n borderStyle: \"solid\",\n borderWidth: 1,\n marginBottom: t.spacing.componentGap,\n },\n cardBordered: { borderWidth: 2 },\n cardMuted: { backgroundColor: t.colors.muted },\n paddingLg: { padding: spacing[4] },\n paddingMd: { padding: spacing[3] },\n paddingSm: { padding: spacing[2] },\n title: {\n borderBottomColor: t.colors.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n color: t.colors.foreground,\n fontFamily: t.typography.heading.fontFamily,\n fontSize: t.primitives.typography.base,\n fontWeight: fontWeights.semibold,\n lineHeight: t.typography.heading.lineHeight,\n marginBottom: spacing[2],\n paddingBottom: spacing[1] + 2,\n },\n });\n}\n\nexport function PdfCard({\n title,\n children,\n variant = \"default\",\n padding = \"md\",\n wrap = false,\n style,\n}: PdfCardProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createCardStyles(theme), [theme]);\n const paddingMap = {\n lg: styles.paddingLg,\n md: styles.paddingMd,\n sm: styles.paddingSm,\n };\n const cardStyles: Style[] = [styles.card];\n if (variant === \"bordered\") {cardStyles.push(styles.cardBordered);}\n if (variant === \"muted\") {cardStyles.push(styles.cardMuted);}\n cardStyles.push(paddingMap[padding]);\n if (style) {cardStyles.push(style);}\n return (\n <View wrap={wrap} style={cardStyles as never}>\n {title ? <PDFText style={styles.title}>{title}</PDFText> : null}\n {typeof children === \"string\" ? (\n <PDFText style={styles.body}>{children}</PDFText>\n ) : (\n children\n )}\n </View>\n );\n}\n",- "type": "registry:component"+ "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport type { ReactNode } from \"react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\n\nexport type CardVariant = \"default\" | \"bordered\" | \"muted\";\n\n/**\n * Bordered content card with optional title and padding presets.\n * Props - `title` | `children` | `variant` | `padding` | `wrap` | `style`\n * @see {@link PdfCardProps}\n */\nexport interface PdfCardProps extends Omit<PDFComponentProps, \"children\"> {\n title?: string;\n children?: ReactNode;\n /**\n * @default 'default'\n */\n variant?: CardVariant;\n /**\n * @default 'md'\n */\n padding?: \"sm\" | \"md\" | \"lg\";\n /**\n * When false, the card will not split across PDF pages.\n * @default false\n */\n wrap?: boolean;\n}\n\nconst createCardStyles = (t: PdfcnTheme) => {\n const { spacing, borderRadius, fontWeights } = t.primitives;\n return StyleSheet.create({\n body: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n lineHeight: t.typography.body.lineHeight,\n },\n card: {\n backgroundColor: t.colors.background,\n borderColor: t.colors.border,\n borderRadius: borderRadius.sm,\n borderStyle: \"solid\",\n borderWidth: 1,\n marginBottom: t.spacing.componentGap,\n },\n cardBordered: { borderWidth: 2 },\n cardMuted: { backgroundColor: t.colors.muted },\n paddingLg: { padding: spacing[4] },\n paddingMd: { padding: spacing[3] },\n paddingSm: { padding: spacing[2] },\n title: {\n borderBottomColor: t.colors.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n color: t.colors.foreground,\n fontFamily: t.typography.heading.fontFamily,\n fontSize: t.primitives.typography.base,\n fontWeight: fontWeights.semibold,\n lineHeight: t.typography.heading.lineHeight,\n marginBottom: spacing[2],\n paddingBottom: spacing[1] + 2,\n },\n });\n};\n\nexport const PdfCard = ({\n title,\n children,\n variant = \"default\",\n padding = \"md\",\n wrap = false,\n style,\n}: PdfCardProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createCardStyles(theme), [theme]);\n const paddingMap = {\n lg: styles.paddingLg,\n md: styles.paddingMd,\n sm: styles.paddingSm,\n };\n const cardStyles: Style[] = [styles.card];\n if (variant === \"bordered\") {\n cardStyles.push(styles.cardBordered);\n }\n if (variant === \"muted\") {\n cardStyles.push(styles.cardMuted);\n }\n cardStyles.push(paddingMap[padding]);\n if (style) {\n cardStyles.push(style);\n }\n return (\n <View wrap={wrap} style={cardStyles as never}>\n {title ? <PDFText style={styles.title}>{title}</PDFText> : null}\n {typeof children === \"string\" ? (\n <PDFText style={styles.body}>{children}</PDFText>\n ) : (\n children\n )}\n </View>\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/card/card.tsx"},{"path": "registry/bases/forme/components/card/index.ts","content": "export { PdfCard, type PdfCardProps, type CardVariant } from \"./card\";\n",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/card/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/data-table.json b/public/r/forme/data-table.jsonindex 0f8a5b4..4b4bd98 100644--- a/public/r/forme/data-table.json+++ b/public/r/forme/data-table.json@@ -14,23 +14,27 @@"files": [{"path": "registry/bases/forme/components/data-table/data-table.styles.ts",- "content": "import { StyleSheet } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\n/**\n * Creates compact-mode cell and text styles for the DataTable component.\n * Used when `size=\"compact\"` to render denser rows with smaller font sizes.\n * @param t - The resolved PdfcnTheme instance.\n */\nexport function createCompactStyles(t: PdfcnTheme) {\n const { spacing, fontWeights, lineHeights } = t.primitives;\n return StyleSheet.create({\n cell: {\n paddingHorizontal: spacing[2],\n paddingVertical: spacing[0.5],\n },\n footerText: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n fontWeight: fontWeights.semibold,\n lineHeight: lineHeights.normal,\n },\n headerText: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n fontWeight: fontWeights.semibold,\n lineHeight: lineHeights.normal,\n },\n text: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n lineHeight: lineHeights.normal,\n },\n });\n}\n\n/**\n * Converts an arbitrary cell value to a display string.\n * Returns an empty string for null/undefined values.\n * @param value - The raw cell value to format.\n */\nexport function formatValue(value: unknown): string {\n if (value === null || value === undefined) {return \"\";}\n if (typeof value === \"number\") {return String(value);}\n return String(value);\n}\n",- "type": "registry:component"+ "content": "import { StyleSheet } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\n/**\n * Creates compact-mode cell and text styles for the DataTable component.\n * Used when `size=\"compact\"` to render denser rows with smaller font sizes.\n * @param t - The resolved PdfcnTheme instance.\n */\nexport const createCompactStyles = (t: PdfcnTheme) => {\n const { spacing, fontWeights, lineHeights } = t.primitives;\n return StyleSheet.create({\n cell: {\n paddingHorizontal: spacing[2],\n paddingVertical: spacing[0.5],\n },\n footerText: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n fontWeight: fontWeights.semibold,\n lineHeight: lineHeights.normal,\n },\n headerText: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n fontWeight: fontWeights.semibold,\n lineHeight: lineHeights.normal,\n },\n text: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n lineHeight: lineHeights.normal,\n },\n });\n};\n\n/**\n * Converts an arbitrary cell value to a display string.\n * Returns an empty string for null/undefined values.\n * @param value - The raw cell value to format.\n */\nexport const formatValue = (value: unknown): string => {\n if (value === null || value === undefined) {\n return \"\";\n }\n if (typeof value === \"number\") {\n return String(value);\n }\n return String(value);\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/data-table/data-table.styles.ts"},{"path": "registry/bases/forme/components/data-table/data-table.tsx",- "content": "import { Text as PDFText } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport { Fragment } from \"react\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport {\n Table,\n TableBody,\n TableCell,\n TableFooter,\n TableHeader,\n TableRow,\n} from \"../table\";\nimport { createCompactStyles, formatValue } from \"./data-table.styles\";\nimport type { DataTableProps } from \"./data-table.types\";\n\nexport function DataTable<T extends Record<string, unknown>>({\n columns,\n data,\n variant = \"grid\",\n footer,\n stripe = false,\n size = \"default\",\n noWrap = false,\n style,\n}: DataTableProps<T>) {\n const theme = usePdfcnTheme();\n const compact = useSafeMemo(() => createCompactStyles(theme), [theme]);\n const isCompact = size === \"compact\";\n\n return (\n <Table variant={variant} zebraStripe={stripe} noWrap={noWrap} style={style}>\n <TableHeader>\n <TableRow header>\n {columns.map((col) => (\n <TableCell\n key={col.key}\n header\n align={col.align ?? \"left\"}\n width={col.width}\n style={isCompact ? compact.cell : undefined}\n >\n {isCompact ? (\n <PDFText\n style={\n [\n compact.headerText,\n col.align ? ({ textAlign: col.align } as Style) : {},\n ] as never\n }\n >\n {col.header}\n </PDFText>\n ) : (\n col.header\n )}\n </TableCell>\n ))}\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.map((row, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: DataTable has no row id; order is stable for static data\n <Fragment key={i}>\n <TableRow>\n {columns.map((col) => {\n const value = row[col.key];\n const rendered = col.render ? col.render(value, row) : null;\n const text = rendered === null ? formatValue(value) : null;\n return (\n <TableCell\n key={col.key}\n align={col.align ?? \"left\"}\n width={col.width}\n style={isCompact ? compact.cell : undefined}\n >\n {isCompact ? (\n rendered !== null ? (\n rendered\n ) : (\n <PDFText\n style={\n [\n compact.text,\n col.align\n ? ({ textAlign: col.align } as Style)\n : {},\n ] as never\n }\n >\n {text}\n </PDFText>\n )\n ) : (rendered !== null ? (\n rendered\n ) : (\n text\n ))}\n </TableCell>\n );\n })}\n </TableRow>\n </Fragment>\n ))}\n </TableBody>\n {footer && (\n <TableFooter>\n <TableRow footer>\n {columns.map((col) => {\n const value = col.key in footer ? footer[col.key] : \"\";\n const rendered = col.renderFooter\n ? col.renderFooter(value)\n : null;\n const text = rendered === null ? formatValue(value) : null;\n return (\n <TableCell\n key={col.key}\n footer={!!value}\n align={col.align ?? \"left\"}\n width={col.width}\n style={isCompact ? compact.cell : undefined}\n >\n {isCompact ? (\n rendered !== null ? (\n rendered\n ) : (\n <PDFText\n style={\n [\n value ? compact.footerText : compact.text,\n col.align\n ? ({ textAlign: col.align } as Style)\n : {},\n ] as never\n }\n >\n {text}\n </PDFText>\n )\n ) : (rendered !== null ? (\n rendered\n ) : (\n text\n ))}\n </TableCell>\n );\n })}\n </TableRow>\n </TableFooter>\n )}\n </Table>\n );\n}\n",- "type": "registry:component"+ "content": "import { Text as PDFText } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport { Fragment } from \"react\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport {\n Table,\n TableBody,\n TableCell,\n TableFooter,\n TableHeader,\n TableRow,\n} from \"../table\";\nimport { createCompactStyles, formatValue } from \"./data-table.styles\";\nimport type { DataTableProps } from \"./data-table.types\";\n\nexport const DataTable = <T extends Record<string, unknown>>({\n columns,\n data,\n variant = \"grid\",\n footer,\n stripe = false,\n size = \"default\",\n noWrap = false,\n style,\n}: DataTableProps<T>) => {\n const theme = usePdfcnTheme();\n const compact = useSafeMemo(() => createCompactStyles(theme), [theme]);\n const isCompact = size === \"compact\";\n\n return (\n <Table variant={variant} zebraStripe={stripe} noWrap={noWrap} style={style}>\n <TableHeader>\n <TableRow header>\n {columns.map((col) => (\n <TableCell\n key={col.key}\n header\n align={col.align ?? \"left\"}\n width={col.width}\n style={isCompact ? compact.cell : undefined}\n >\n {isCompact ? (\n <PDFText\n style={\n [\n compact.headerText,\n col.align ? ({ textAlign: col.align } as Style) : {},\n ] as never\n }\n >\n {col.header}\n </PDFText>\n ) : (\n col.header\n )}\n </TableCell>\n ))}\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.map((row, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: DataTable has no row id; order is stable for static data\n <Fragment key={i}>\n <TableRow>\n {columns.map((col) => {\n const value = row[col.key];\n const rendered = col.render ? col.render(value, row) : null;\n const text = rendered === null ? formatValue(value) : null;\n return (\n <TableCell\n key={col.key}\n align={col.align ?? \"left\"}\n width={col.width}\n style={isCompact ? compact.cell : undefined}\n >\n {isCompact\n ? (rendered ?? (\n <PDFText\n style={\n [\n compact.text,\n col.align\n ? ({ textAlign: col.align } as Style)\n : {},\n ] as never\n }\n >\n {text}\n </PDFText>\n ))\n : (rendered ?? text)}\n </TableCell>\n );\n })}\n </TableRow>\n </Fragment>\n ))}\n </TableBody>\n {footer && (\n <TableFooter>\n <TableRow footer>\n {columns.map((col) => {\n const value = col.key in footer ? footer[col.key] : \"\";\n const rendered = col.renderFooter\n ? col.renderFooter(value)\n : null;\n const text = rendered === null ? formatValue(value) : null;\n return (\n <TableCell\n key={col.key}\n footer={!!value}\n align={col.align ?? \"left\"}\n width={col.width}\n style={isCompact ? compact.cell : undefined}\n >\n {isCompact\n ? (rendered ?? (\n <PDFText\n style={\n [\n value ? compact.footerText : compact.text,\n col.align\n ? ({ textAlign: col.align } as Style)\n : {},\n ] as never\n }\n >\n {text}\n </PDFText>\n ))\n : (rendered ?? text)}\n </TableCell>\n );\n })}\n </TableRow>\n </TableFooter>\n )}\n </Table>\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/data-table/data-table.tsx"},{"path": "registry/bases/forme/components/data-table/data-table.types.ts","content": "import type React from \"react\";\n\nimport type { PDFComponentProps } from \"@/registry/themes\";\n\nimport type { TableVariant } from \"../table/table.types\";\n\n/** DataTable row density size. */\nexport type DataTableSize = \"default\" | \"compact\";\n\n/**\n * Column definition for a DataTable.\n * Props - `key` | `header` | `align` | `width` | `render` | `renderFooter`\n * @see {@link DataTableColumn}\n */\nexport interface DataTableColumn<T = Record<string, unknown>> {\n key: keyof T & string;\n header: string;\n align?: \"left\" | \"center\" | \"right\";\n width?: string | number;\n /**\n * Custom cell renderer. Must return @formepdf/react elements (Text, View,\n * Image, etc.) — NOT HTML DOM elements. TypeScript accepts ReactNode but DOM\n * nodes will crash at runtime in the PDF renderer.\n */\n render?: (value: unknown, row: T) => React.ReactNode;\n /**\n * Custom footer cell renderer. Same constraint: return @formepdf/react\n * elements only — no HTML/DOM nodes.\n */\n renderFooter?: (value: unknown) => React.ReactNode;\n}\n\n/**\n * Data table for PDF rendering with column definitions, footer support, and stripe options.\n * Props - `columns` | `data` | `variant` | `footer` | `stripe` | `size` | `noWrap` | `style`\n * @see {@link DataTableProps}\n */\nexport interface DataTableProps<T = Record<string, unknown>> extends Omit<\n PDFComponentProps,\n \"children\"\n> {\n columns: DataTableColumn<T>[];\n data: T[];\n /**\n * @default 'grid'\n */\n variant?: TableVariant;\n footer?: Partial<Record<keyof T & string, string | number>>;\n stripe?: boolean;\n /**\n * @default 'default'\n */\n size?: DataTableSize;\n noWrap?: boolean;\n}\n",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/data-table/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/divider.json b/public/r/forme/divider.jsonindex 8b875f2..fc1d3a5 100644--- a/public/r/forme/divider.json+++ b/public/r/forme/divider.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/forme/components/divider/divider.tsx",- "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type DividerVariant = \"solid\" | \"dashed\" | \"dotted\";\nexport type DividerThickness = \"thin\" | \"medium\" | \"thick\";\nexport type DividerSpacing = \"none\" | \"sm\" | \"md\" | \"lg\";\n\n/**\n * Horizontal rule with optional label, style variants, and spacing presets.\n * Props - `spacing` | `variant` | `color` | `thickness` | `label` | `width` | `style`\n * @see {@link DividerProps}\n */\nexport interface DividerProps extends Omit<PDFComponentProps, \"children\"> {\n /**\n * @default 'md'\n */\n spacing?: DividerSpacing;\n /**\n * @default 'solid'\n */\n variant?: DividerVariant;\n color?: string;\n /**\n * @default 'thin'\n */\n thickness?: DividerThickness;\n label?: string;\n width?: string | number;\n}\n\nfunction createDividerStyles(t: PdfcnTheme) {\n const { spacing, fontWeights } = t.primitives;\n return StyleSheet.create({\n base: { borderBottomColor: t.colors.border, borderBottomStyle: \"solid\" },\n dashed: { borderBottomStyle: \"dashed\" },\n dotted: { borderBottomStyle: \"dotted\" },\n labelContainer: { alignItems: \"center\", flexDirection: \"row\" },\n labelLine: {\n borderBottomColor: t.colors.border,\n borderBottomStyle: \"solid\",\n flex: 1,\n },\n labelText: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n fontWeight: fontWeights.medium,\n letterSpacing: t.primitives.letterSpacing.wider * 10,\n paddingHorizontal: spacing[3],\n textTransform: \"uppercase\",\n },\n medium: { borderBottomWidth: spacing[1] },\n solid: { borderBottomStyle: \"solid\" },\n spacingLg: { marginVertical: t.spacing.sectionGap },\n spacingMd: { marginVertical: t.spacing.componentGap },\n spacingNone: { marginVertical: spacing[0] },\n spacingSm: { marginVertical: t.spacing.paragraphGap },\n thick: { borderBottomWidth: spacing[2] },\n thin: { borderBottomWidth: spacing[0.5] },\n } as any);\n}\n\nexport function Divider({\n spacing = \"md\",\n variant = \"solid\",\n color,\n thickness = \"thin\",\n label,\n width,\n style,\n}: DividerProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createDividerStyles(theme), [theme]);\n const spacingMap = {\n lg: styles.spacingLg,\n md: styles.spacingMd,\n none: styles.spacingNone,\n sm: styles.spacingSm,\n };\n const variantMap = {\n dashed: styles.dashed,\n dotted: styles.dotted,\n solid: styles.solid,\n };\n const thicknessMap = {\n medium: styles.medium,\n thick: styles.thick,\n thin: styles.thin,\n };\n\n if (label) {\n const lineStyle: Style[] = [\n styles.labelLine,\n thicknessMap[thickness],\n variantMap[variant],\n ];\n if (color)\n {lineStyle.push({ borderBottomColor: resolveColor(color, theme.colors) } as any);}\n const containerStyles: Style[] = [\n styles.labelContainer,\n spacingMap[spacing],\n ];\n if (width !== undefined) {containerStyles.push({ width } as Style);}\n if (style) {containerStyles.push(...[style].flat());}\n const labelTextStyle: Style[] = [styles.labelText];\n if (color)\n {labelTextStyle.push({ color: resolveColor(color, theme.colors) });}\n return (\n <View style={containerStyles as never}>\n <View style={lineStyle as never} />\n <PDFText style={labelTextStyle as never}>{label}</PDFText>\n <View style={lineStyle as never} />\n </View>\n );\n }\n\n const styleArray: Style[] = [\n styles.base,\n spacingMap[spacing],\n variantMap[variant],\n thicknessMap[thickness],\n ];\n if (color)\n {styleArray.push({ borderBottomColor: resolveColor(color, theme.colors) });}\n if (width !== undefined) {styleArray.push({ width } as Style);}\n if (style) {styleArray.push(...[style].flat());}\n return <View style={styleArray as never} />;\n}\n",- "type": "registry:component"+ "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type DividerVariant = \"solid\" | \"dashed\" | \"dotted\";\nexport type DividerThickness = \"thin\" | \"medium\" | \"thick\";\nexport type DividerSpacing = \"none\" | \"sm\" | \"md\" | \"lg\";\n\n/**\n * Horizontal rule with optional label, style variants, and spacing presets.\n * Props - `spacing` | `variant` | `color` | `thickness` | `label` | `width` | `style`\n * @see {@link DividerProps}\n */\nexport interface DividerProps extends Omit<PDFComponentProps, \"children\"> {\n /**\n * @default 'md'\n */\n spacing?: DividerSpacing;\n /**\n * @default 'solid'\n */\n variant?: DividerVariant;\n color?: string;\n /**\n * @default 'thin'\n */\n thickness?: DividerThickness;\n label?: string;\n width?: string | number;\n}\n\nconst createDividerStyles = (t: PdfcnTheme) => {\n const { spacing, fontWeights } = t.primitives;\n return StyleSheet.create({\n base: { borderBottomColor: t.colors.border, borderBottomStyle: \"solid\" },\n dashed: { borderBottomStyle: \"dashed\" },\n dotted: { borderBottomStyle: \"dotted\" },\n labelContainer: { alignItems: \"center\", flexDirection: \"row\" },\n labelLine: {\n borderBottomColor: t.colors.border,\n borderBottomStyle: \"solid\",\n flex: 1,\n },\n labelText: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n fontWeight: fontWeights.medium,\n letterSpacing: t.primitives.letterSpacing.wider * 10,\n paddingHorizontal: spacing[3],\n textTransform: \"uppercase\",\n },\n medium: { borderBottomWidth: spacing[1] },\n solid: { borderBottomStyle: \"solid\" },\n spacingLg: { marginVertical: t.spacing.sectionGap },\n spacingMd: { marginVertical: t.spacing.componentGap },\n spacingNone: { marginVertical: spacing[0] },\n spacingSm: { marginVertical: t.spacing.paragraphGap },\n thick: { borderBottomWidth: spacing[2] },\n thin: { borderBottomWidth: spacing[0.5] },\n } as Record<string, Style>);\n};\n\nexport const Divider = ({\n spacing = \"md\",\n variant = \"solid\",\n color,\n thickness = \"thin\",\n label,\n width,\n style,\n}: DividerProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createDividerStyles(theme), [theme]);\n const spacingMap = {\n lg: styles.spacingLg,\n md: styles.spacingMd,\n none: styles.spacingNone,\n sm: styles.spacingSm,\n };\n const variantMap = {\n dashed: styles.dashed,\n dotted: styles.dotted,\n solid: styles.solid,\n };\n const thicknessMap = {\n medium: styles.medium,\n thick: styles.thick,\n thin: styles.thin,\n };\n\n if (label) {\n const lineStyle: Style[] = [\n styles.labelLine,\n thicknessMap[thickness],\n variantMap[variant],\n ];\n if (color) {\n lineStyle.push({\n borderBottomColor: resolveColor(color, theme.colors),\n } as Style);\n }\n const containerStyles: Style[] = [\n styles.labelContainer,\n spacingMap[spacing],\n ];\n if (width !== undefined) {\n containerStyles.push({ width } as Style);\n }\n if (style) {\n containerStyles.push(...[style].flat());\n }\n const labelTextStyle: Style[] = [styles.labelText];\n if (color) {\n labelTextStyle.push({ color: resolveColor(color, theme.colors) });\n }\n return (\n <View style={containerStyles as never}>\n <View style={lineStyle as never} />\n <PDFText style={labelTextStyle as never}>{label}</PDFText>\n <View style={lineStyle as never} />\n </View>\n );\n }\n\n const styleArray: Style[] = [\n styles.base,\n spacingMap[spacing],\n variantMap[variant],\n thicknessMap[thickness],\n ];\n if (color) {\n styleArray.push({ borderBottomColor: resolveColor(color, theme.colors) });\n }\n if (width !== undefined) {\n styleArray.push({ width } as Style);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return <View style={styleArray as never} />;\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/divider/divider.tsx"},{"path": "registry/bases/forme/components/divider/index.ts","content": "export {\n Divider,\n type DividerProps,\n type DividerVariant,\n type DividerThickness,\n type DividerSpacing,\n} from \"./divider\";\n",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/divider/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/form.json b/public/r/forme/form.jsonindex e7e728a..a0e46f1 100644--- a/public/r/forme/form.json+++ b/public/r/forme/form.json@@ -13,23 +13,27 @@"files": [{"path": "registry/bases/forme/components/form/form.styles.ts",- "content": "import { StyleSheet } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport type { PdfFormVariant } from \"./form.types\";\n\n/** Style factory for fillable form layouts, derived from the active theme. */\nexport function createFormStyles(\n t: PdfcnTheme,\n variant: PdfFormVariant = \"underline\"\n) {\n const { spacing, borderRadius, fontWeights, typography } = t.primitives;\n const borderColor = t.colors.border;\n const hairline = 0.75; // lighter than spacing[0.5]=2pt — more refined\n const rule = 1; // group title rule\n\n const fieldAreaByVariant: Record<PdfFormVariant, object> = {\n box: {\n borderColor: borderColor,\n borderRadius: borderRadius.sm,\n borderStyle: \"solid\",\n borderWidth: hairline,\n },\n ghost: {\n backgroundColor: t.colors.muted,\n borderRadius: borderRadius.sm,\n },\n outlined: {\n borderColor: t.colors.foreground,\n borderRadius: borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: hairline,\n },\n underline: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n },\n };\n\n const hasPadding =\n variant === \"box\" || variant === \"outlined\" || variant === \"ghost\";\n\n return StyleSheet.create({\n column: {\n flex: 1,\n },\n\n columnsRow: {\n flexDirection: \"row\",\n gap: spacing[4],\n },\n fieldAbove: {\n marginBottom: spacing[3],\n width: \"100%\",\n },\n fieldArea: {\n width: \"100%\" as const,\n ...fieldAreaByVariant[variant],\n },\n\n fieldLeft: {\n alignItems: \"flex-end\",\n flexDirection: \"row\",\n gap: spacing[2],\n marginBottom: spacing[3],\n },\n fieldLeftArea: {\n flex: 1,\n },\n\n formDivider: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n marginBottom: spacing[4],\n },\n formSubtitle: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n lineHeight: t.typography.body.lineHeight,\n marginBottom: spacing[3],\n },\n\n formTitle: {\n color: t.colors.foreground,\n fontFamily: t.typography.heading.fontFamily,\n fontSize: typography.xl,\n fontWeight: fontWeights.bold,\n lineHeight: t.typography.heading.lineHeight,\n marginBottom: spacing[1],\n },\n group: {\n marginBottom: spacing[5],\n },\n\n groupTitle: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.semibold,\n letterSpacing: 0.8,\n lineHeight: 1.2,\n marginBottom: spacing[3],\n textTransform: \"uppercase\",\n },\n hint: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n opacity: 0.14,\n paddingBottom: hasPadding ? spacing[1] : 0,\n paddingHorizontal: hasPadding ? spacing[2] : 0,\n paddingTop: hasPadding ? spacing[1] : spacing[0.5],\n },\n labelAbove: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.medium,\n letterSpacing: 0.5,\n lineHeight: 1.2,\n marginBottom: spacing[1],\n textTransform: \"uppercase\",\n },\n\n labelLeft: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.medium,\n lineHeight: t.typography.body.lineHeight,\n paddingBottom: hasPadding ? spacing[1] : 0,\n width: 80,\n },\n\n root: {\n marginBottom: t.spacing.componentGap,\n width: \"100%\",\n },\n });\n}\n",- "type": "registry:component"+ "content": "import { StyleSheet } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport type { PdfFormVariant } from \"./form.types\";\n\n/** Style factory for fillable form layouts, derived from the active theme. */\nexport const createFormStyles = (\n t: PdfcnTheme,\n variant: PdfFormVariant = \"underline\"\n) => {\n const { spacing, borderRadius, fontWeights, typography } = t.primitives;\n const borderColor = t.colors.border;\n // lighter than spacing[0.5]=2pt — more refined\n const hairline = 0.75;\n // group title rule\n const rule = 1;\n\n const fieldAreaByVariant: Record<PdfFormVariant, object> = {\n box: {\n borderColor,\n borderRadius: borderRadius.sm,\n borderStyle: \"solid\",\n borderWidth: hairline,\n },\n ghost: {\n backgroundColor: t.colors.muted,\n borderRadius: borderRadius.sm,\n },\n outlined: {\n borderColor: t.colors.foreground,\n borderRadius: borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: hairline,\n },\n underline: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n },\n };\n\n const hasPadding =\n variant === \"box\" || variant === \"outlined\" || variant === \"ghost\";\n\n return StyleSheet.create({\n column: {\n flex: 1,\n },\n\n columnsRow: {\n flexDirection: \"row\",\n gap: spacing[4],\n },\n fieldAbove: {\n marginBottom: spacing[3],\n width: \"100%\",\n },\n fieldArea: {\n width: \"100%\" as const,\n ...fieldAreaByVariant[variant],\n },\n\n fieldLeft: {\n alignItems: \"flex-end\",\n flexDirection: \"row\",\n gap: spacing[2],\n marginBottom: spacing[3],\n },\n fieldLeftArea: {\n flex: 1,\n },\n\n formDivider: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n marginBottom: spacing[4],\n },\n formSubtitle: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n lineHeight: t.typography.body.lineHeight,\n marginBottom: spacing[3],\n },\n\n formTitle: {\n color: t.colors.foreground,\n fontFamily: t.typography.heading.fontFamily,\n fontSize: typography.xl,\n fontWeight: fontWeights.bold,\n lineHeight: t.typography.heading.lineHeight,\n marginBottom: spacing[1],\n },\n group: {\n marginBottom: spacing[5],\n },\n\n groupTitle: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.semibold,\n letterSpacing: 0.8,\n lineHeight: 1.2,\n marginBottom: spacing[3],\n textTransform: \"uppercase\",\n },\n hint: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n opacity: 0.14,\n paddingBottom: hasPadding ? spacing[1] : 0,\n paddingHorizontal: hasPadding ? spacing[2] : 0,\n paddingTop: hasPadding ? spacing[1] : spacing[0.5],\n },\n labelAbove: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.medium,\n letterSpacing: 0.5,\n lineHeight: 1.2,\n marginBottom: spacing[1],\n textTransform: \"uppercase\",\n },\n\n labelLeft: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.medium,\n lineHeight: t.typography.body.lineHeight,\n paddingBottom: hasPadding ? spacing[1] : 0,\n width: 80,\n },\n\n root: {\n marginBottom: t.spacing.componentGap,\n width: \"100%\",\n },\n });\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/form/form.styles.ts"},{"path": "registry/bases/forme/components/form/form.tsx",- "content": "import { Text as PDFText, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { createFormStyles } from \"./form.styles\";\nimport type {\n FormLayout,\n PdfFormField,\n PdfFormGroup,\n PdfFormProps,\n} from \"./form.types\";\n\nfunction renderFieldAbove(\n field: PdfFormField,\n idx: number,\n styles: ReturnType<typeof createFormStyles>\n) {\n const areaHeight = field.height ?? 18;\n const areaStyle: Style[] = [styles.fieldArea, { minHeight: areaHeight }];\n\n return (\n <View key={`${field.label}-${idx}`} style={styles.fieldAbove}>\n <PDFText style={styles.labelAbove}>{field.label}</PDFText>\n <View style={areaStyle as never}>\n {field.hint ? (\n <PDFText style={styles.hint}>{field.hint}</PDFText>\n ) : null}\n </View>\n </View>\n );\n}\n\nfunction renderFieldLeft(\n field: PdfFormField,\n idx: number,\n styles: ReturnType<typeof createFormStyles>\n) {\n const areaHeight = field.height ?? 18;\n const areaStyle: Style[] = [\n styles.fieldArea,\n styles.fieldLeftArea,\n { minHeight: areaHeight },\n ];\n\n return (\n <View key={`${field.label}-${idx}`} style={styles.fieldLeft}>\n <PDFText style={styles.labelLeft}>{field.label}</PDFText>\n <View style={areaStyle as never}>\n {field.hint ? (\n <PDFText style={styles.hint}>{field.hint}</PDFText>\n ) : null}\n </View>\n </View>\n );\n}\n\nfunction renderGroup(\n group: PdfFormGroup,\n gi: number,\n styles: ReturnType<typeof createFormStyles>,\n labelPosition: \"above\" | \"left\"\n) {\n const layout: FormLayout = group.layout ?? \"single\";\n const cols = layout === \"three-column\" ? 3 : (layout === \"two-column\" ? 2 : 1);\n\n const renderField = (field: PdfFormField, idx: number) =>\n labelPosition === \"left\"\n ? renderFieldLeft(field, idx, styles)\n : renderFieldAbove(field, idx, styles);\n\n if (cols === 1) {\n return (\n <View key={`group-${gi}`} style={styles.group}>\n {group.title ? (\n <PDFText style={styles.groupTitle}>{group.title}</PDFText>\n ) : null}\n {group.fields.map(renderField)}\n </View>\n );\n }\n\n const chunkSize = Math.ceil(group.fields.length / cols);\n const chunks: PdfFormField[][] = [];\n for (let i = 0; i < group.fields.length; i += chunkSize) {\n chunks.push(group.fields.slice(i, i + chunkSize));\n }\n while (chunks.length < cols) {\n chunks.push([]);\n }\n\n return (\n <View key={`group-${gi}`} style={styles.group}>\n {group.title ? (\n <PDFText style={styles.groupTitle}>{group.title}</PDFText>\n ) : null}\n <View style={styles.columnsRow}>\n {chunks.map((chunk, ci) => (\n <View\n key={`col-${gi}-${chunk[0]?.label ?? ci}`}\n style={styles.column}\n >\n {chunk.map(renderField)}\n </View>\n ))}\n </View>\n </View>\n );\n}\n\nexport function PdfForm({\n title,\n subtitle,\n groups,\n variant = \"underline\",\n labelPosition = \"above\",\n noWrap = false,\n style,\n}: PdfFormProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(\n () => createFormStyles(theme, variant),\n [theme, variant]\n );\n\n const rootStyles: Style[] = [styles.root];\n if (style) {rootStyles.push(style);}\n\n const inner = (\n <View style={rootStyles as never}>\n {title ? <PDFText style={styles.formTitle}>{title}</PDFText> : null}\n {subtitle ? (\n <PDFText style={styles.formSubtitle}>{subtitle}</PDFText>\n ) : null}\n {title || subtitle ? <View style={styles.formDivider} /> : null}\n {groups.map((group, gi) => renderGroup(group, gi, styles, labelPosition))}\n </View>\n );\n\n return noWrap ? <View wrap={false}>{inner}</View> : inner;\n}\n",- "type": "registry:component"+ "content": "import { Text as PDFText, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { createFormStyles } from \"./form.styles\";\nimport type {\n FormLayout,\n PdfFormField,\n PdfFormGroup,\n PdfFormProps,\n} from \"./form.types\";\n\nconst renderFieldAbove = (\n field: PdfFormField,\n idx: number,\n styles: ReturnType<typeof createFormStyles>\n) => {\n const areaHeight = field.height ?? 18;\n const areaStyle: Style[] = [styles.fieldArea, { minHeight: areaHeight }];\n\n return (\n <View key={`${field.label}-${idx}`} style={styles.fieldAbove}>\n <PDFText style={styles.labelAbove}>{field.label}</PDFText>\n <View style={areaStyle as never}>\n {field.hint ? (\n <PDFText style={styles.hint}>{field.hint}</PDFText>\n ) : null}\n </View>\n </View>\n );\n};\n\nconst renderFieldLeft = (\n field: PdfFormField,\n idx: number,\n styles: ReturnType<typeof createFormStyles>\n) => {\n const areaHeight = field.height ?? 18;\n const areaStyle: Style[] = [\n styles.fieldArea,\n styles.fieldLeftArea,\n { minHeight: areaHeight },\n ];\n\n return (\n <View key={`${field.label}-${idx}`} style={styles.fieldLeft}>\n <PDFText style={styles.labelLeft}>{field.label}</PDFText>\n <View style={areaStyle as never}>\n {field.hint ? (\n <PDFText style={styles.hint}>{field.hint}</PDFText>\n ) : null}\n </View>\n </View>\n );\n};\n\nconst renderGroup = (\n group: PdfFormGroup,\n gi: number,\n styles: ReturnType<typeof createFormStyles>,\n labelPosition: \"above\" | \"left\"\n) => {\n const layout: FormLayout = group.layout ?? \"single\";\n let cols: number;\n if (layout === \"three-column\") {\n cols = 3;\n } else if (layout === \"two-column\") {\n cols = 2;\n } else {\n cols = 1;\n }\n\n const renderField = (field: PdfFormField, idx: number) =>\n labelPosition === \"left\"\n ? renderFieldLeft(field, idx, styles)\n : renderFieldAbove(field, idx, styles);\n\n if (cols === 1) {\n return (\n <View key={`group-${gi}`} style={styles.group}>\n {group.title ? (\n <PDFText style={styles.groupTitle}>{group.title}</PDFText>\n ) : null}\n {group.fields.map(renderField)}\n </View>\n );\n }\n\n const chunkSize = Math.ceil(group.fields.length / cols);\n const chunks: PdfFormField[][] = [];\n for (let i = 0; i < group.fields.length; i += chunkSize) {\n chunks.push(group.fields.slice(i, i + chunkSize));\n }\n while (chunks.length < cols) {\n chunks.push([]);\n }\n\n return (\n <View key={`group-${gi}`} style={styles.group}>\n {group.title ? (\n <PDFText style={styles.groupTitle}>{group.title}</PDFText>\n ) : null}\n <View style={styles.columnsRow}>\n {chunks.map((chunk, ci) => (\n <View\n key={`col-${gi}-${chunk[0]?.label ?? ci}`}\n style={styles.column}\n >\n {chunk.map(renderField)}\n </View>\n ))}\n </View>\n </View>\n );\n};\n\nexport const PdfForm = ({\n title,\n subtitle,\n groups,\n variant = \"underline\",\n labelPosition = \"above\",\n noWrap = false,\n style,\n}: PdfFormProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(\n () => createFormStyles(theme, variant),\n [theme, variant]\n );\n\n const rootStyles: Style[] = [styles.root];\n if (style) {\n rootStyles.push(style);\n }\n\n const inner = (\n <View style={rootStyles as never}>\n {title ? <PDFText style={styles.formTitle}>{title}</PDFText> : null}\n {subtitle ? (\n <PDFText style={styles.formSubtitle}>{subtitle}</PDFText>\n ) : null}\n {title || subtitle ? <View style={styles.formDivider} /> : null}\n {groups.map((group, gi) => renderGroup(group, gi, styles, labelPosition))}\n </View>\n );\n\n return noWrap ? <View wrap={false}>{inner}</View> : inner;\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/form/form.tsx"},{"path": "registry/bases/forme/components/form/form.types.ts","content": "import type { Style } from \"@formepdf/react\";\n\n/** Visual style variant for the fillable form. */\nexport type PdfFormVariant = \"underline\" | \"box\" | \"outlined\" | \"ghost\";\n\n/** Column layout for a form section. */\nexport type FormLayout = \"single\" | \"two-column\" | \"three-column\";\n\n/** Label position relative to the field. */\nexport type FormLabelPosition = \"above\" | \"left\";\n\n/**\n * A single fillable field definition.\n * Props - `label` | `hint` | `height` | `width`\n * @see {@link PdfFormField}\n */\nexport interface PdfFormField {\n label: string;\n hint?: string;\n /**\n * Height of the blank field area in points.\n * @default 18\n */\n height?: number;\n width?: number | string;\n}\n\n/**\n * A logical group of fields with an optional section title.\n * Props - `title` | `fields` | `layout`\n * @see {@link PdfFormGroup}\n */\nexport interface PdfFormGroup {\n title?: string;\n fields: PdfFormField[];\n /**\n * @default 'single'\n */\n layout?: FormLayout;\n}\n\n/**\n * Fillable PDF form with grouped fields, layout variants, and label positioning options.\n * Props - `title` | `subtitle` | `groups` | `variant` | `labelPosition` | `noWrap` | `style`\n * @see {@link PdfFormProps}\n */\nexport interface PdfFormProps {\n title?: string;\n subtitle?: string;\n groups: PdfFormGroup[];\n /**\n * @default 'underline'\n */\n variant?: PdfFormVariant;\n /**\n * @default 'above'\n */\n labelPosition?: FormLabelPosition;\n noWrap?: boolean;\n style?: Style;\n}\n",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/form/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/graph.json b/public/r/forme/graph.jsonindex 3de889a..421564f 100644--- a/public/r/forme/graph.json+++ b/public/r/forme/graph.json@@ -13,28 +13,33 @@"files": [{"path": "registry/bases/forme/components/graph/graph.styles.ts",- "content": "import { StyleSheet } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nexport function createGraphStyles(t: PdfcnTheme) {\n return StyleSheet.create({\n chartWithRightLegend: {\n alignItems: \"flex-start\",\n display: \"flex\",\n flexDirection: \"row\",\n },\n container: {\n display: \"flex\",\n flexDirection: \"column\",\n marginBottom: t.spacing.componentGap,\n },\n legendColumn: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n marginLeft: 12,\n marginTop: 18,\n minWidth: 120,\n },\n legendItem: {\n alignItems: \"center\",\n display: \"flex\",\n flexDirection: \"row\",\n gap: 4,\n },\n legendRow: {\n display: \"flex\",\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: 12,\n marginTop: 6,\n },\n legendText: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n },\n subtitle: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginBottom: 6,\n },\n title: {\n color: t.colors.foreground,\n fontFamily: t.typography.heading.fontFamily,\n fontSize: t.primitives.typography.base,\n fontWeight: t.primitives.fontWeights.semibold,\n marginBottom: 2,\n },\n });\n}\n",- "type": "registry:component"+ "content": "import { StyleSheet } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nexport const createGraphStyles = (t: PdfcnTheme) =>\n StyleSheet.create({\n chartWithRightLegend: {\n alignItems: \"flex-start\",\n display: \"flex\",\n flexDirection: \"row\",\n },\n container: {\n display: \"flex\",\n flexDirection: \"column\",\n marginBottom: t.spacing.componentGap,\n },\n legendColumn: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n marginLeft: 12,\n marginTop: 18,\n minWidth: 120,\n },\n legendItem: {\n alignItems: \"center\",\n display: \"flex\",\n flexDirection: \"row\",\n gap: 4,\n },\n legendRow: {\n display: \"flex\",\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: 12,\n marginTop: 6,\n },\n legendText: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n },\n subtitle: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginBottom: 6,\n },\n title: {\n color: t.colors.foreground,\n fontFamily: t.typography.heading.fontFamily,\n fontSize: t.primitives.typography.base,\n fontWeight: t.primitives.fontWeights.semibold,\n marginBottom: 2,\n },\n });\n",+ "type": "registry:component",+ "target": "components/pdf/components/graph/graph.styles.ts"},{"path": "registry/bases/forme/components/graph/graph.tsx",- "content": "import { Text as PDFText, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport type React from \"react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { Circle, G, Line, Path, Rect, Svg, SvgText } from \"../../lib/forme-svg\";\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { createGraphStyles } from \"./graph.styles\";\nimport type { ChartLayout, GraphProps, GraphSeries } from \"./graph.types\";\nimport {\n GRAPH_SAFE_WIDTHS,\n arcPath,\n buildLayout,\n fmtNum,\n getDefaultPalette,\n getGraphWidth,\n normalizeData,\n polarToCartesian,\n smoothPath,\n truncate,\n} from \"./graph.utils\";\n\n/**\n * Shared Y-axis grid lines and tick labels for cartesian charts (bar, line, area).\n * Extracted to avoid duplicating the identical block across render functions.\n */\nfunction renderGridAndYAxis(\n ticks: number[],\n toY: (v: number) => number,\n chartX: number,\n chartW: number,\n showGrid: boolean,\n gridColor: string,\n textColor: string\n) {\n return (\n <>\n {ticks.map((tick) => {\n const ty = toY(tick);\n return (\n <G key={`grid-${tick}`}>\n {showGrid && (\n <Line\n x1={chartX}\n y1={ty}\n x2={chartX + chartW}\n y2={ty}\n stroke={gridColor}\n strokeWidth={0.5}\n strokeDasharray=\"3 3\"\n />\n )}\n <SvgText\n x={chartX - 4}\n y={ty + 3}\n fill={textColor}\n textAnchor=\"end\"\n style={{ fontSize: 7 }}\n >\n {fmtNum(tick)}\n </SvgText>\n </G>\n );\n })}\n </>\n );\n}\n\nfunction renderBarChart(\n series: GraphSeries[],\n layout: ChartLayout,\n palette: string[],\n showGrid: boolean,\n showValues: boolean,\n theme: PdfcnTheme\n) {\n const { chartX, chartY, chartW, chartH, yMin, yMax, yTicks, xLabels } =\n layout;\n const nCategories = xLabels.length;\n const nSeries = series.length;\n const groupGap = 0.25;\n const groupW = chartW / nCategories;\n const barW = (groupW * (1 - groupGap)) / nSeries;\n const textColor = theme.colors.mutedForeground;\n const gridColor = theme.colors.border;\n const axisColor = theme.colors.foreground;\n const range = yMax - yMin || 1;\n const toY = (v: number) => chartY + chartH - ((v - yMin) / range) * chartH;\n\n return (\n <>\n {renderGridAndYAxis(\n yTicks,\n toY,\n chartX,\n chartW,\n showGrid,\n gridColor,\n textColor\n )}\n\n <Line\n x1={chartX}\n y1={chartY + chartH}\n x2={chartX + chartW}\n y2={chartY + chartH}\n stroke={axisColor}\n strokeWidth={1}\n />\n\n {xLabels.map((label, ci) => {\n const groupLeft = chartX + ci * groupW + groupW * (groupGap / 2);\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <G key={`group-${ci}`}>\n {series.map((s, si) => {\n const val = s.data[ci]?.value ?? 0;\n const color =\n s.data[ci]?.color ?? s.color ?? palette[si % palette.length];\n const barH = ((val - yMin) / range) * chartH;\n const bx = groupLeft + si * barW;\n const by = chartY + chartH - barH;\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <G key={`bar-${ci}-${si}`}>\n <Rect\n x={bx}\n y={by}\n width={barW - 1}\n height={barH}\n fill={color}\n />\n {showValues && barH > 10 && (\n <SvgText\n x={bx + barW / 2 - 0.5}\n y={by - 2}\n fill={axisColor}\n textAnchor=\"middle\"\n style={{ fontSize: 6 }}\n >\n {fmtNum(val)}\n </SvgText>\n )}\n </G>\n );\n })}\n <SvgText\n x={groupLeft + (nSeries * barW) / 2}\n y={chartY + chartH + 10}\n fill={textColor}\n textAnchor=\"middle\"\n style={{ fontSize: 7 }}\n >\n {truncate(label, 10)}\n </SvgText>\n </G>\n );\n })}\n </>\n );\n}\n\nfunction renderHorizontalBarChart(\n series: GraphSeries[],\n layout: ChartLayout,\n palette: string[],\n showValues: boolean,\n theme: PdfcnTheme\n) {\n const { chartX, chartY, chartW, chartH, xLabels } = layout;\n const nCategories = xLabels.length;\n const allValues = series.flatMap((s) => s.data.map((d) => d.value));\n const maxVal = Math.max(...allValues, 1);\n const rowH = chartH / nCategories;\n const barH = rowH * 0.5;\n const textColor = theme.colors.mutedForeground;\n const axisColor = theme.colors.foreground;\n const labelW = 60;\n\n return (\n <>\n {xLabels.map((label, ci) => {\n const rowY = chartY + ci * rowH;\n const val = series[0]?.data[ci]?.value ?? 0;\n const color =\n series[0]?.data[ci]?.color ??\n series[0]?.color ??\n palette[ci % palette.length];\n const barW = (val / maxVal) * (chartW - labelW);\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <G key={`hbar-${ci}`}>\n <SvgText\n x={chartX + labelW - 4}\n y={rowY + rowH / 2 + 3}\n fill={textColor}\n textAnchor=\"end\"\n style={{ fontSize: 7 }}\n >\n {truncate(label, 14)}\n </SvgText>\n <Rect\n x={chartX + labelW}\n y={rowY + (rowH - barH) / 2}\n width={Math.max(barW, 1)}\n height={barH}\n fill={color}\n />\n {showValues && (\n <SvgText\n x={chartX + labelW + barW + 3}\n y={rowY + rowH / 2 + 3}\n fill={axisColor}\n textAnchor=\"start\"\n style={{ fontSize: 6 }}\n >\n {fmtNum(val)}\n </SvgText>\n )}\n </G>\n );\n })}\n <Line\n x1={chartX + labelW}\n y1={chartY}\n x2={chartX + labelW}\n y2={chartY + chartH}\n stroke={axisColor}\n strokeWidth={1}\n />\n </>\n );\n}\n\nfunction renderLineAreaChart(\n series: GraphSeries[],\n layout: ChartLayout,\n palette: string[],\n showGrid: boolean,\n showValues: boolean,\n showDots: boolean,\n smooth: boolean,\n isArea: boolean,\n theme: PdfcnTheme\n) {\n const { chartX, chartY, chartW, chartH, yMin, yMax, yTicks, xLabels } =\n layout;\n const range = yMax - yMin || 1;\n const textColor = theme.colors.mutedForeground;\n const gridColor = theme.colors.border;\n const axisColor = theme.colors.foreground;\n const nPoints = xLabels.length;\n\n const xFor = (i: number) => chartX + (i / Math.max(nPoints - 1, 1)) * chartW;\n const yFor = (v: number) => chartY + chartH - ((v - yMin) / range) * chartH;\n\n return (\n <>\n {renderGridAndYAxis(\n yTicks,\n yFor,\n chartX,\n chartW,\n showGrid,\n gridColor,\n textColor\n )}\n\n <Line\n x1={chartX}\n y1={chartY + chartH}\n x2={chartX + chartW}\n y2={chartY + chartH}\n stroke={axisColor}\n strokeWidth={1}\n />\n\n {series.map((s, si) => {\n const color = s.color ?? palette[si % palette.length];\n const points = s.data.map((d, i) => ({ x: xFor(i), y: yFor(d.value) }));\n\n const lineDStr = smooth\n ? smoothPath(points)\n : `M ${points.map((p) => `${p.x} ${p.y}`).join(\" L \")}`;\n\n const areaPath =\n isArea && points.length > 1\n ? `${lineDStr} L ${points.at(-1)!.x} ${chartY + chartH} L ${points[0]!.x} ${chartY + chartH} Z`\n : null;\n\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <G key={`series-${si}`}>\n {isArea && areaPath && (\n <Path d={areaPath} fill={color} fillOpacity={0.2} stroke=\"none\" />\n )}\n <Path d={lineDStr} stroke={color} strokeWidth={2} fill=\"none\" />\n {showDots &&\n points.map((p, pi) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <Circle\n key={`dot-${pi}`}\n cx={p.x}\n cy={p.y}\n r={3}\n fill={color}\n />\n ))}\n {showValues &&\n points.map((p, pi) => (\n <SvgText\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n key={`val-${pi}`}\n x={p.x}\n y={p.y - 5}\n fill={color}\n textAnchor=\"middle\"\n style={{ fontSize: 6 }}\n >\n {fmtNum(s.data[pi].value)}\n </SvgText>\n ))}\n </G>\n );\n })}\n\n {xLabels.map((label, i) => (\n <SvgText\n key={`xlabel-${label}`}\n x={xFor(i)}\n y={chartY + chartH + 10}\n fill={textColor}\n textAnchor=\"middle\"\n style={{ fontSize: 7 }}\n >\n {truncate(label, 8)}\n </SvgText>\n ))}\n </>\n );\n}\n\nfunction renderPieDonutChart(\n series: GraphSeries[],\n layout: ChartLayout,\n palette: string[],\n centerLabel: string | undefined,\n isDonut: boolean,\n theme: PdfcnTheme\n) {\n const { svgW, svgH } = layout;\n const cx = svgW / 2;\n const cy = svgH / 2;\n const r = Math.min(svgW, svgH) / 2 - 20;\n const innerR = isDonut ? r * 0.52 : 0;\n const textColor = theme.colors.mutedForeground;\n\n const data = series[0]?.data ?? [];\n const total = data.reduce((sum, d) => sum + d.value, 0) || 1;\n\n let currentAngle = 0;\n\n return (\n <>\n {data.map((d, i) => {\n const color = d.color ?? palette[i % palette.length];\n const sweep = (d.value / total) * 360;\n const midAngle = currentAngle + sweep / 2;\n const path = arcPath(\n cx,\n cy,\n r,\n currentAngle,\n currentAngle + sweep,\n innerR\n );\n currentAngle += sweep;\n\n const labelR = r * 1.18;\n const lp = polarToCartesian(cx, cy, labelR, midAngle);\n const anchor = lp.x > cx ? \"start\" : \"end\";\n\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <G key={`slice-${i}`}>\n <Path d={path} fill={color} stroke=\"white\" strokeWidth={1} />\n {/* Show label only if slice is large enough to label */}\n {sweep > 15 && (\n <SvgText\n x={lp.x}\n y={lp.y + 3}\n fill={textColor}\n textAnchor={anchor}\n style={{ fontSize: 7 }}\n >\n {truncate(d.label, 10)}\n </SvgText>\n )}\n </G>\n );\n })}\n\n {isDonut && centerLabel && (\n <>\n <Circle cx={cx} cy={cy} r={innerR} fill=\"white\" />\n <SvgText\n x={cx}\n y={cy + 4}\n fill={theme.colors.foreground}\n textAnchor=\"middle\"\n style={{ fontSize: 9, fontWeight: \"bold\" }}\n >\n {centerLabel}\n </SvgText>\n </>\n )}\n </>\n );\n}\n\nfunction Legend({\n series,\n palette,\n styles,\n position = \"bottom\",\n}: {\n series: GraphSeries[];\n palette: string[];\n styles: ReturnType<typeof createGraphStyles>;\n position?: \"bottom\" | \"right\";\n}) {\n const containerStyle =\n position === \"right\" ? styles.legendColumn : styles.legendRow;\n\n return (\n <View style={containerStyle as never}>\n {series.map((s, i) => (\n <View key={s.name} style={styles.legendItem}>\n <Svg width={10} height={10}>\n <Rect\n x={0}\n y={2}\n width={8}\n height={8}\n fill={s.color ?? palette[i % palette.length]}\n />\n </Svg>\n <PDFText style={styles.legendText}>{s.name}</PDFText>\n </View>\n ))}\n </View>\n );\n}\n\n/**\n * PdfGraph — renders bar, horizontal-bar, line, area, pie, and donut charts\n * natively inside react-pdf documents using SVG primitives.\n *\n * No external chart libraries are required or used — all rendering is done via\n * react-pdf's built-in SVG support (`<Svg>`, `<Rect>`, `<Path>`, `<Line>`, etc.).\n *\n * @example Bar chart\n * ```tsx\n * <PdfGraph\n * variant=\"bar\"\n * title=\"Monthly Revenue\"\n * data={[\n * { label: 'Jan', value: 42000 },\n * { label: 'Feb', value: 38000 },\n * { label: 'Mar', value: 55000 },\n * ]}\n * />\n * ```\n *\n * @example Donut chart with center label\n * ```tsx\n * <PdfGraph\n * variant=\"donut\"\n * data={[\n * { label: 'Product A', value: 45 },\n * { label: 'Product B', value: 30 },\n * { label: 'Other', value: 25 },\n * ]}\n * centerLabel=\"$1.2M\"\n * />\n * ```\n *\n * **Limitations (by design):**\n * - No interactivity (PDFs are static)\n * - No animations\n * - SVG Text inside charts uses SVG font attributes (not react-pdf StyleSheet fonts)\n * - For print PDFs use SVG-friendly fonts registered with Font.register()\n */\nexport function PdfGraph({\n variant = \"bar\",\n data,\n title,\n subtitle,\n xLabel,\n yLabel,\n width: explicitWidth,\n height = 260,\n fullWidth = false,\n containerPadding = 0,\n wrapperPadding = 0,\n colors,\n showValues = false,\n showGrid = true,\n legend = \"bottom\",\n centerLabel,\n showDots = true,\n smooth = false,\n yTicks: yTickCount = 5,\n noWrap = true,\n style,\n}: GraphProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createGraphStyles(theme), [theme]);\n const palette = colors ?? getDefaultPalette(theme);\n const series = normalizeData(data);\n\n const width = useSafeMemo(() => {\n if (fullWidth)\n {return getGraphWidth(theme, { containerPadding, wrapperPadding });}\n return explicitWidth ?? GRAPH_SAFE_WIDTHS.default;\n }, [fullWidth, explicitWidth, theme, containerPadding, wrapperPadding]);\n\n const isPieOrDonut = variant === \"pie\" || variant === \"donut\";\n const layout = buildLayout(series, width, height, isPieOrDonut, yTickCount);\n const { chartX, chartW } = layout;\n\n let chartContent: React.ReactNode = null;\n\n switch (variant) {\n case \"bar\": {\n chartContent = renderBarChart(\n series,\n layout,\n palette,\n showGrid,\n showValues,\n theme\n );\n break;\n }\n case \"horizontal-bar\": {\n chartContent = renderHorizontalBarChart(\n series,\n layout,\n palette,\n showValues,\n theme\n );\n break;\n }\n case \"line\":\n case \"area\": {\n chartContent = renderLineAreaChart(\n series,\n layout,\n palette,\n showGrid,\n showValues,\n showDots,\n smooth,\n variant === \"area\",\n theme\n );\n break;\n }\n case \"pie\": {\n chartContent = renderPieDonutChart(\n series,\n layout,\n palette,\n undefined,\n false,\n theme\n );\n break;\n }\n case \"donut\": {\n chartContent = renderPieDonutChart(\n series,\n layout,\n palette,\n centerLabel,\n true,\n theme\n );\n break;\n }\n }\n\n const showLegend = legend !== \"none\" && !isPieOrDonut;\n\n const containerStyles: Style[] = [styles.container];\n if (style) {containerStyles.push(style);}\n\n const content = (\n <View style={containerStyles as never}>\n {title && <PDFText style={styles.title}>{title}</PDFText>}\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n <View\n style={legend === \"right\" ? styles.chartWithRightLegend : undefined}\n >\n <Svg width={width} height={height}>\n {chartContent}\n {!isPieOrDonut && xLabel && (\n <SvgText\n x={chartX + chartW / 2}\n y={height - 2}\n fill={theme.colors.mutedForeground}\n textAnchor=\"middle\"\n style={{ fontSize: 8 }}\n >\n {xLabel}\n </SvgText>\n )}\n {!isPieOrDonut && yLabel && (\n <SvgText\n x={2}\n y={10}\n fill={theme.colors.mutedForeground}\n textAnchor=\"start\"\n style={{ fontSize: 8 }}\n >\n {yLabel}\n </SvgText>\n )}\n </Svg>\n {showLegend &&\n legend === \"right\" &&\n Legend({ palette, position: \"right\", series, styles })}\n </View>\n {showLegend &&\n legend === \"bottom\" &&\n Legend({ palette, position: \"bottom\", series, styles })}\n </View>\n );\n\n return noWrap ? <View wrap={false}>{content}</View> : content;\n}\n",- "type": "registry:component"+ "content": "import { Text as PDFText, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport type React from \"react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { Circle, G, Line, Path, Rect, Svg, SvgText } from \"../../lib/forme-svg\";\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { createGraphStyles } from \"./graph.styles\";\nimport type { ChartLayout, GraphProps, GraphSeries } from \"./graph.types\";\nimport {\n GRAPH_SAFE_WIDTHS,\n arcPath,\n buildLayout,\n fmtNum,\n getDefaultPalette,\n getGraphWidth,\n normalizeData,\n polarToCartesian,\n smoothPath,\n truncate,\n} from \"./graph.utils\";\n\n/**\n * Shared Y-axis grid lines and tick labels for cartesian charts (bar, line, area).\n * Extracted to avoid duplicating the identical block across render functions.\n */\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 renderGraphContent = (\n title: string | undefined,\n subtitle: string | undefined,\n chartContent: React.ReactNode,\n axisLabels: 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 <Svg width={width} height={height}>\n {chartContent}\n {axisLabels}\n </Svg>\n {showLegend &&\n legend === \"right\" &&\n Legend({ palette, position: \"right\", series, styles })}\n </View>\n {showLegend &&\n legend === \"bottom\" &&\n Legend({ palette, position: \"bottom\", series, styles })}\n </>\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\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 renderAxisLabels(\n isPieOrDonut,\n xLabel,\n yLabel,\n chartX,\n chartW,\n height,\n theme.colors.mutedForeground\n ),\n width,\n height,\n legend,\n showLegend,\n isPieOrDonut,\n series,\n palette,\n styles\n )}\n </View>\n );\n\n return noWrap ? <View wrap={false}>{content}</View> : content;\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/graph/graph.tsx"},{"path": "registry/bases/forme/components/graph/graph.types.ts","content": "import type { Style } from \"@formepdf/react\";\n\n/**\n * Options for calculating graph width based on theme page margins and container context.\n * Props - `containerPadding` | `wrapperPadding` | `pageWidth`\n * @see {@link GraphWidthOptions}\n */\nexport interface GraphWidthOptions {\n containerPadding?: number;\n wrapperPadding?: number;\n pageWidth?: number;\n}\n\nexport type GraphVariant =\n | \"bar\"\n | \"horizontal-bar\"\n | \"line\"\n | \"area\"\n | \"pie\"\n | \"donut\";\n\nexport type GraphLegendPosition = \"bottom\" | \"right\" | \"none\";\n\n/**\n * A single data point with a label, numeric value, and optional color override.\n * Props - `label` | `value` | `color`\n * @see {@link GraphDataPoint}\n */\nexport interface GraphDataPoint {\n label: string;\n value: number;\n color?: string;\n}\n\n/**\n * A named data series containing multiple data points, used for multi-series charts.\n * Props - `name` | `data` | `color`\n * @see {@link GraphSeries}\n */\nexport interface GraphSeries {\n name: string;\n data: GraphDataPoint[];\n color?: string;\n}\n\n/**\n * Multi-variant PDF chart (bar, line, area, pie, donut) rendered with SVG primitives.\n * Props - `variant` | `data` | `title` | `subtitle` | `xLabel` | `yLabel` | `width` | `height` | `fullWidth` | `containerPadding` | `wrapperPadding` | `colors` | `showValues` | `showGrid` | `legend` | `centerLabel` | `showDots` | `smooth` | `yTicks` | `noWrap` | `style`\n * @see {@link GraphProps}\n */\nexport interface GraphProps {\n /**\n * @default 'bar'\n */\n variant?: GraphVariant;\n data: GraphDataPoint[] | GraphSeries[];\n title?: string;\n subtitle?: string;\n xLabel?: string;\n yLabel?: string;\n /**\n * @default 420\n */\n width?: number;\n /**\n * @default 260\n */\n height?: number;\n /**\n * @default false\n */\n fullWidth?: boolean;\n containerPadding?: number;\n wrapperPadding?: number;\n colors?: string[];\n /**\n * @default false\n */\n showValues?: boolean;\n /**\n * @default true\n */\n showGrid?: boolean;\n /**\n * @default 'bottom'\n */\n legend?: GraphLegendPosition;\n centerLabel?: string;\n /**\n * @default true\n */\n showDots?: boolean;\n /**\n * @default false\n */\n smooth?: boolean;\n /**\n * @default 5\n */\n yTicks?: number;\n /**\n * @default true\n */\n noWrap?: boolean;\n style?: Style;\n}\n\n/** Internal chart layout dimensions computed from props and data. */\nexport interface ChartLayout {\n svgW: number;\n svgH: number;\n chartX: number;\n chartY: number;\n chartW: number;\n chartH: number;\n yMin: number;\n yMax: number;\n yTicks: number[];\n xLabels: string[];\n}\n",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/graph/graph.types.ts"},{"path": "registry/bases/forme/components/graph/graph.utils.ts",- "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport type {\n ChartLayout,\n GraphDataPoint,\n GraphSeries,\n GraphWidthOptions,\n} from \"./graph.types\";\n\n/** Standard A4 page width in PDF points. */\nexport const A4_WIDTH = 595;\n\n/**\n * Pre-calculated safe graph widths for common scenarios.\n * These values work with all built-in themes on A4 pages.\n */\nexport const GRAPH_SAFE_WIDTHS = {\n /** Safe width for graph directly in page content (no extra containers) */\n default: 420,\n /** Safe width for graph inside a Section with md padding */\n inSection: 400,\n /** Safe width for graph inside a Section + bordered wrapper (like graphShell) */\n inSectionWithWrapper: 380,\n} as const;\n\n/**\n * Calculate the safe graph width based on theme page margins and container context.\n *\n * This utility ensures graphs don't overflow their container by accounting for:\n * - Page margins (from theme)\n * - Container padding (e.g., Section component)\n * - Wrapper padding (e.g., a bordered graphShell View)\n *\n * @example\n * ```tsx\n * const width = getGraphWidth(theme);\n * // For a graph inside a Section with padding=\"md\" (12pt) and a graphShell (12pt):\n * const width = getGraphWidth(theme, { containerPadding: 12, wrapperPadding: 12 });\n * ```\n */\nexport function getGraphWidth(\n theme: PdfcnTheme,\n options: GraphWidthOptions = {}\n): number {\n const {\n containerPadding = 0,\n wrapperPadding = 0,\n pageWidth = A4_WIDTH,\n } = options;\n const { marginLeft, marginRight } = theme.spacing.page;\n const availableWidth =\n pageWidth -\n marginLeft -\n marginRight -\n containerPadding * 2 -\n wrapperPadding * 2;\n return Math.max(Math.floor(availableWidth), 100);\n}\n\nexport const CHART_MARGINS = {\n axisBottom: 24,\n axisLeft: 40,\n pieBottom: 10,\n pieLeft: 10,\n right: 10,\n top: 10,\n} as const;\n\n/** Normalize to always work with GraphSeries[]. */\nexport function normalizeData(\n data: GraphDataPoint[] | GraphSeries[]\n): GraphSeries[] {\n if (data.length === 0) {return [];}\n if (\"label\" in data[0] && \"value\" in data[0]) {\n return [{ data: data as GraphDataPoint[], name: \"Series 1\" }];\n }\n return data as GraphSeries[];\n}\n\n/** Compute nice Y-axis ticks for a given value range. */\nexport function computeYTicks(\n min: number,\n max: number,\n count: number\n): number[] {\n if (min === max) {return [0, max || 1];}\n const step = (max - min) / (count - 1);\n return Array.from({ length: count }, (_, i) => {\n const v = min + i * step;\n return Math.round(v * 100) / 100;\n });\n}\n\n/** Format a number for display on axis labels. */\nexport function fmtNum(v: number): string {\n if (Math.abs(v) >= 1_000_000) {return `${(v / 1_000_000).toFixed(1)}M`;}\n if (Math.abs(v) >= 1000) {return `${(v / 1_000).toFixed(1)}K`;}\n if (!Number.isInteger(v)) {return v.toFixed(1);}\n return String(v);\n}\n\n/** Truncate a label to at most maxLen characters. */\nexport function truncate(s: string, maxLen: number): string {\n return s.length > maxLen ? `${s.slice(0, maxLen - 1)}…` : s;\n}\n\n/** Polar to Cartesian coordinate conversion for pie/donut arcs. */\nexport function polarToCartesian(\n cx: number,\n cy: number,\n r: number,\n angleDeg: number\n) {\n const rad = ((angleDeg - 90) * Math.PI) / 180;\n return { x: cx + r * Math.cos(rad), y: cy + r * Math.sin(rad) };\n}\n\n/** Build an SVG arc path for a pie/donut slice. */\nexport function arcPath(\n cx: number,\n cy: number,\n r: number,\n startAngle: number,\n endAngle: number,\n innerR = 0\n): string {\n const safeEnd = Math.min(endAngle, startAngle + 359.999);\n const large = safeEnd - startAngle > 180 ? 1 : 0;\n const s = polarToCartesian(cx, cy, r, safeEnd);\n const e = polarToCartesian(cx, cy, r, startAngle);\n if (innerR === 0) {\n return `M ${cx} ${cy} L ${s.x} ${s.y} A ${r} ${r} 0 ${large} 0 ${e.x} ${e.y} Z`;\n }\n const si = polarToCartesian(cx, cy, innerR, safeEnd);\n const ei = polarToCartesian(cx, cy, innerR, startAngle);\n return [\n `M ${s.x} ${s.y}`,\n `A ${r} ${r} 0 ${large} 0 ${e.x} ${e.y}`,\n `L ${ei.x} ${ei.y}`,\n `A ${innerR} ${innerR} 0 ${large} 1 ${si.x} ${si.y}`,\n \"Z\",\n ].join(\" \");\n}\n\n/** Compute smooth bezier control points (Catmull-Rom → cubic bezier). */\nexport function smoothPath(\n points: { x: number; y: number }[],\n tension = 0.4\n): string {\n if (points.length < 2) {return \"\";}\n if (points.length === 2) {\n return `M ${points[0].x} ${points[0].y} L ${points[1].x} ${points[1].y}`;\n }\n const parts: string[] = [`M ${points[0].x} ${points[0].y}`];\n for (let i = 0; i < points.length - 1; i++) {\n const p0 = points[Math.max(i - 1, 0)];\n const p1 = points[i];\n const p2 = points[i + 1];\n const p3 = points[Math.min(i + 2, points.length - 1)];\n const cp1x = p1.x + (p2.x - p0.x) * tension;\n const cp1y = p1.y + (p2.y - p0.y) * tension;\n const cp2x = p2.x - (p3.x - p1.x) * tension;\n const cp2y = p2.y - (p3.y - p1.y) * tension;\n parts.push(`C ${cp1x} ${cp1y} ${cp2x} ${cp2y} ${p2.x} ${p2.y}`);\n }\n return parts.join(\" \");\n}\n\n/** Get the default chart color palette from the theme. */\nexport function getDefaultPalette(t: PdfcnTheme): string[] {\n return [\n t.colors.primary,\n t.colors.info ?? \"#3B82F6\",\n t.colors.success ?? \"#22C55E\",\n t.colors.warning ?? \"#F59E0B\",\n t.colors.destructive ?? \"#EF4444\",\n \"#8B5CF6\",\n \"#F97316\",\n \"#14B8A6\",\n ];\n}\n\n/** Derive ChartLayout from series data, SVG dimensions, and variant. */\nexport function buildLayout(\n series: GraphSeries[],\n width: number,\n height: number,\n isPieOrDonut: boolean,\n yTickCount: number\n): ChartLayout {\n const mL = isPieOrDonut ? CHART_MARGINS.pieLeft : CHART_MARGINS.axisLeft;\n const mB = isPieOrDonut ? CHART_MARGINS.pieBottom : CHART_MARGINS.axisBottom;\n const chartX = mL;\n const chartY = CHART_MARGINS.top;\n const chartW = width - mL - CHART_MARGINS.right;\n const chartH = height - CHART_MARGINS.top - mB;\n const allValues = series.flatMap((s) => s.data.map((d) => d.value));\n const rawMin = Math.min(...allValues, 0);\n const rawMax = Math.max(...allValues, 1);\n const yMin = Math.min(0, rawMin);\n const yMax = rawMax + (rawMax - yMin) * 0.08;\n return {\n chartH,\n chartW,\n chartX,\n chartY,\n svgH: height,\n svgW: width,\n xLabels: series[0]?.data.map((d) => d.label) ?? [],\n yMax,\n yMin,\n yTicks: computeYTicks(yMin, yMax, yTickCount),\n };\n}\n",- "type": "registry:component"+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport type {\n ChartLayout,\n GraphDataPoint,\n GraphSeries,\n GraphWidthOptions,\n} from \"./graph.types\";\n\n/** Standard A4 page width in PDF points. */\nexport const A4_WIDTH = 595;\n\n/**\n * Pre-calculated safe graph widths for common scenarios.\n * These values work with all built-in themes on A4 pages.\n */\nexport const GRAPH_SAFE_WIDTHS = {\n /** Safe width for graph directly in page content (no extra containers) */\n default: 420,\n /** Safe width for graph inside a Section with md padding */\n inSection: 400,\n /** Safe width for graph inside a Section + bordered wrapper (like graphShell) */\n inSectionWithWrapper: 380,\n} as const;\n\n/**\n * Calculate the safe graph width based on theme page margins and container context.\n *\n * This utility ensures graphs don't overflow their container by accounting for:\n * - Page margins (from theme)\n * - Container padding (e.g., Section component)\n * - Wrapper padding (e.g., a bordered graphShell View)\n *\n * @example\n * ```tsx\n * const width = getGraphWidth(theme);\n * // For a graph inside a Section with padding=\"md\" (12pt) and a graphShell (12pt):\n * const width = getGraphWidth(theme, { containerPadding: 12, wrapperPadding: 12 });\n * ```\n */\nexport 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/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/graph/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/heading.json b/public/r/forme/heading.jsonindex b3f9c02..7902f75 100644--- a/public/r/forme/heading.json+++ b/public/r/forme/heading.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/forme/components/heading/heading.tsx",- "content": "import { StyleSheet, Text } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type HeadingWeight = \"normal\" | \"medium\" | \"semibold\" | \"bold\";\nexport type HeadingTracking = \"tighter\" | \"tight\" | \"normal\" | \"wide\" | \"wider\";\n\n/**\n * PDF heading mapped to h1–h6 font sizes from the theme.\n * Props - `level` | `align` | `color` | `transform` | `weight` | `tracking` | `noMargin` | `keepWithNext` | `children` | `style`\n * @see {@link HeadingProps}\n */\nexport interface HeadingProps extends PDFComponentProps {\n /**\n * @default 1\n */\n level?: 1 | 2 | 3 | 4 | 5 | 6;\n /**\n * @default 'left'\n */\n align?: \"left\" | \"center\" | \"right\";\n color?: string;\n transform?: \"uppercase\" | \"lowercase\" | \"capitalize\";\n /**\n * @default 'bold'\n */\n weight?: HeadingWeight;\n /**\n * @default 'normal'\n */\n tracking?: HeadingTracking;\n /**\n * @default false\n */\n noMargin?: boolean;\n keepWithNext?: boolean;\n}\n\nfunction createHeadingStyles(t: PdfcnTheme) {\n const { heading } = t.typography;\n const { spacing, fontWeights, letterSpacing } = t.primitives;\n const { sectionGap, componentGap, paragraphGap } = t.spacing;\n const base = {\n color: t.colors.foreground,\n fontFamily: heading.fontFamily,\n fontWeight: fontWeights.bold,\n lineHeight: heading.lineHeight,\n };\n return StyleSheet.create({\n capitalize: { textTransform: \"capitalize\" },\n h1: {\n ...base,\n fontSize: heading.fontSize.h1,\n marginBottom: paragraphGap,\n marginTop: spacing[0],\n },\n h2: {\n ...base,\n fontSize: heading.fontSize.h2,\n marginBottom: paragraphGap,\n marginTop: sectionGap,\n },\n h3: {\n ...base,\n fontSize: heading.fontSize.h3,\n marginBottom: paragraphGap,\n marginTop: componentGap,\n },\n h4: {\n ...base,\n fontSize: heading.fontSize.h4,\n marginBottom: paragraphGap,\n marginTop: paragraphGap,\n },\n h5: {\n ...base,\n fontSize: heading.fontSize.h5,\n marginBottom: spacing[1],\n marginTop: paragraphGap,\n },\n h6: {\n ...base,\n fontSize: heading.fontSize.h6,\n marginBottom: spacing[1],\n marginTop: paragraphGap,\n },\n lowercase: { textTransform: \"lowercase\" },\n noMargin: { marginBottom: 0, marginTop: 0 },\n trackingNormal: { letterSpacing: letterSpacing.normal },\n trackingTight: { letterSpacing: letterSpacing.tight * 10 },\n trackingTighter: { letterSpacing: letterSpacing.tight * 15 },\n trackingWide: { letterSpacing: letterSpacing.wide * 10 },\n trackingWider: { letterSpacing: letterSpacing.wider * 10 },\n uppercase: {\n letterSpacing: letterSpacing.wider * 10,\n textTransform: \"uppercase\",\n },\n weightBold: { fontWeight: fontWeights.bold },\n weightMedium: { fontWeight: fontWeights.medium },\n weightNormal: { fontWeight: fontWeights.regular },\n weightSemibold: { fontWeight: fontWeights.semibold },\n });\n}\n\nexport function Heading({\n level = 1,\n align,\n color,\n transform,\n weight,\n tracking,\n noMargin,\n keepWithNext = true,\n children,\n style,\n}: HeadingProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createHeadingStyles(theme), [theme]);\n const safeLevel = Math.min(Math.max(Math.round(level), 1), 6) as\n | 1\n | 2\n | 3\n | 4\n | 5\n | 6;\n const weightMap = {\n bold: styles.weightBold,\n medium: styles.weightMedium,\n normal: styles.weightNormal,\n semibold: styles.weightSemibold,\n };\n const trackingMap = {\n normal: styles.trackingNormal,\n tight: styles.trackingTight,\n tighter: styles.trackingTighter,\n wide: styles.trackingWide,\n wider: styles.trackingWider,\n };\n const transformMap = {\n capitalize: styles.capitalize,\n lowercase: styles.lowercase,\n uppercase: styles.uppercase,\n };\n const styleArray: Style[] = [\n styles[`h${safeLevel}` as keyof typeof styles] as Style,\n ];\n if (weight && weight in weightMap) {styleArray.push(weightMap[weight]);}\n if (tracking && tracking in trackingMap)\n {styleArray.push(trackingMap[tracking]);}\n if (transform && transform in transformMap)\n {styleArray.push(transformMap[transform as keyof typeof transformMap]);}\n if (noMargin) {styleArray.push(styles.noMargin);}\n const semantic = {} as Style;\n if (align) {semantic.textAlign = align;}\n if (color) {semantic.color = resolveColor(color, theme.colors);}\n if (Object.keys(semantic).length > 0) {styleArray.push(semantic);}\n if (style) {styleArray.push(...[style].flat());}\n return <Text style={styleArray as never}>{children}</Text>;\n}\n",- "type": "registry:component"+ "content": "import { StyleSheet, Text } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type HeadingWeight = \"normal\" | \"medium\" | \"semibold\" | \"bold\";\nexport type HeadingTracking = \"tighter\" | \"tight\" | \"normal\" | \"wide\" | \"wider\";\n\n/**\n * PDF heading mapped to h1–h6 font sizes from the theme.\n * Props - `level` | `align` | `color` | `transform` | `weight` | `tracking` | `noMargin` | `keepWithNext` | `children` | `style`\n * @see {@link HeadingProps}\n */\nexport interface HeadingProps extends PDFComponentProps {\n /**\n * @default 1\n */\n level?: 1 | 2 | 3 | 4 | 5 | 6;\n /**\n * @default 'left'\n */\n align?: \"left\" | \"center\" | \"right\";\n color?: string;\n transform?: \"uppercase\" | \"lowercase\" | \"capitalize\";\n /**\n * @default 'bold'\n */\n weight?: HeadingWeight;\n /**\n * @default 'normal'\n */\n tracking?: HeadingTracking;\n /**\n * @default false\n */\n noMargin?: boolean;\n keepWithNext?: boolean;\n}\n\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 as never}>{children}</Text>;\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/heading/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/invoice-classic.json b/public/r/forme/invoice-classic.jsonindex 6900234..293e26a 100644--- a/public/r/forme/invoice-classic.json+++ b/public/r/forme/invoice-classic.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/forme/blocks/invoice-classic/invoice-classic.tsx",- "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfImage,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport type { InvoiceClassicData } from \"./invoice-classic.types\";\n\n// Sample data — replace with your own props or data source\nconst sampleData: InvoiceClassicData = {\n billTo: {\n address: \"456 Client Ave, Suite 2\",\n email: \"[email protected]\",\n name: \"Client Corp.\",\n phone: \"+1 (555) 123-4567\",\n },\n companyAddress: \"City, Country\",\n companyEmail: \"[email protected]\",\n companyName: \"Your Company\",\n dueDate: \"March 17, 2026\",\n invoiceDate: \"February 17, 2026\",\n invoiceNumber: \"INV-2026-001\",\n items: [\n { description: \"Web Development\", quantity: 1, unitPrice: 12500 },\n { description: \"UI/UX Design\", quantity: 1, unitPrice: 8750 },\n { description: \"Consulting\", quantity: 10, unitPrice: 1500 },\n ],\n logo: \"/favicon.png\",\n notes: \"Thank you for your business!\",\n paymentTerms: {\n dueDate: \"March 17, 2026\",\n gst: \"GSTIN 123456789\",\n method: \"UPI / Card / Bank Transfer\",\n },\n subtitle: \"Professional Services\",\n summary: {\n subtotal: 36250,\n tax: 2537.5,\n total: 38787.5,\n },\n};\n\nexport function InvoiceClassicDocument({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceClassicData;\n}) {\n return (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceClassicContent data={data} />\n </PdfcnThemeProvider>\n );\n}\n\nfunction InvoiceClassicContent({ data }: { data: InvoiceClassicData }) {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n page: {\n backgroundColor: theme.colors.background,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <PageHeader\n variant=\"logo-left\"\n logo={\n <PdfImage src={data.logo ?? \"/favicon.png\"} style={{ margin: 0 }} />\n }\n title={data.companyName}\n subtitle={data.subtitle}\n rightText={data.invoiceNumber}\n rightSubText={`Due: ${data.dueDate}`}\n style={{ marginBottom: 0 }}\n />\n <Section noWrap style={{ flexDirection: \"row\" }}>\n <View style={{ flex: 1, paddingRight: 15 }}>\n <Text\n style={{ fontSize: 9, fontWeight: \"bold\", marginBottom: 2 }}\n color=\"mutedForeground\"\n transform=\"uppercase\"\n noMargin\n >\n From\n </Text>\n <Text noMargin variant=\"xs\">\n {data.companyName}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.companyAddress}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.companyEmail}\n </Text>\n </View>\n <View style={{ flex: 1, paddingRight: 15 }}>\n <Text\n style={{ fontSize: 9, fontWeight: \"bold\", marginBottom: 2 }}\n color=\"mutedForeground\"\n transform=\"uppercase\"\n noMargin\n >\n Bill To\n </Text>\n <Text noMargin variant=\"xs\">\n {data.billTo.name}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.billTo.address}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.billTo.email}\n </Text>\n </View>\n <View style={{ flex: 1, paddingRight: 15 }}>\n <Text\n style={{ fontSize: 9, fontWeight: \"bold\", marginBottom: 2 }}\n color=\"mutedForeground\"\n transform=\"uppercase\"\n noMargin\n >\n Payment Terms\n </Text>\n <Text noMargin variant=\"xs\">\n {data.paymentTerms.method}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.paymentTerms.gst}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.paymentTerms.dueDate}\n </Text>\n </View>\n </Section>\n <Table variant=\"grid\" zebraStripe>\n <TableHeader>\n <TableRow header>\n <TableCell>Description</TableCell>\n <TableCell align=\"center\">QTY</TableCell>\n <TableCell align=\"center\">Rate</TableCell>\n <TableCell align=\"right\">Total</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: invoice items have no stable id\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"center\">{`$${item.unitPrice}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toFixed(2)}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={{ flexDirection: \"row\", marginTop: 16 }}>\n <View style={{ marginLeft: \"auto\", width: 220 }}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toFixed(2)}`,\n },\n { key: \"Tax\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Total\",\n keyStyle: { fontSize: 12, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: { fontSize: 12, fontWeight: \"bold\" },\n },\n ]}\n divided\n />\n </View>\n </Section>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </View></Page>\n </Document>\n );\n}\n",- "type": "registry:block"+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfImage,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport type { InvoiceClassicData } from \"./invoice-classic.types\";\n\n// Sample data — replace with your own props or data source\nconst sampleData: InvoiceClassicData = {\n billTo: {\n address: \"456 Client Ave, Suite 2\",\n email: \"[email protected]\",\n name: \"Client Corp.\",\n phone: \"+1 (555) 123-4567\",\n },\n companyAddress: \"City, Country\",\n companyEmail: \"[email protected]\",\n companyName: \"Your Company\",\n dueDate: \"March 17, 2026\",\n invoiceDate: \"February 17, 2026\",\n invoiceNumber: \"INV-2026-001\",\n items: [\n { description: \"Web Development\", quantity: 1, unitPrice: 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: \"Professional Services\",\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 padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <PageHeader\n variant=\"logo-left\"\n logo={\n <PdfImage\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 noWrap style={{ flexDirection: \"row\", marginTop: 16 }}>\n <View style={{ marginLeft: \"auto\", width: 220 }}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toFixed(2)}`,\n },\n { key: \"Tax\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Total\",\n keyStyle: { fontSize: 12, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: { fontSize: 12, fontWeight: \"bold\" },\n },\n ]}\n divided\n />\n </View>\n </Section>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </View>\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"},{"path": "registry/bases/forme/blocks/invoice-classic/invoice-classic.types.ts","content": "export interface InvoiceClassicData {\n invoiceNumber: string;\n invoiceDate: string;\n dueDate: string;\n companyName: string;\n subtitle: string;\n companyAddress: string;\n companyEmail: string;\n logo?: string;\n billTo: {\n name: string;\n address: string;\n email: string;\n phone: string;\n };\n items: {\n description: string;\n quantity: number;\n unitPrice: number;\n }[];\n summary: {\n subtotal: number;\n tax: number;\n total: number;\n };\n paymentTerms: {\n dueDate: string;\n method: string;\n gst: string;\n };\n notes?: string;\n}\n",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-classic/invoice-classic.types.ts"}],"type": "registry:block"diff --git a/public/r/forme/invoice-consultant.json b/public/r/forme/invoice-consultant.jsonindex 7e0c1f9..f113f52 100644--- a/public/r/forme/invoice-consultant.json+++ b/public/r/forme/invoice-consultant.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/forme/blocks/invoice-consultant/invoice-consultant.tsx",- "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport type { InvoiceConsultantData } from \"./invoice-consultant.types\";\n\nconst sampleData: InvoiceConsultantData = {\n client: {\n address: \"500 Tech Park, Suite 200\",\n company: \"Acme Technologies\",\n email: \"[email protected]\",\n name: \"Sarah Johnson\",\n },\n companyAddress: \"City, Country · [email protected]\",\n companyName: \"Your Consulting\",\n consultant: {\n email: \"[email protected]\",\n name: \"John Smith\",\n title: \"Senior Technical Consultant\",\n },\n dueDate: \"March 28, 2026\",\n invoiceDate: \"February 26, 2026\",\n invoiceNumber: \"INV-2026-006\",\n notes:\n \"Services rendered for February 2026. All hours verified and approved by client.\",\n paymentTerms: {\n dueDate: \"March 28, 2026\",\n method: \"Bank Transfer / Check\",\n },\n projectRef: \"PROJ-2026-ACME-001\",\n services: [\n { description: \"Architecture Review & Planning\", hours: 16, rate: 175 },\n { description: \"Code Review & Optimization\", hours: 24, rate: 150 },\n { description: \"Technical Documentation\", hours: 12, rate: 125 },\n { description: \"Team Training & Knowledge Transfer\", hours: 8, rate: 200 },\n ],\n subtitle: \"Professional Consulting Services\",\n summary: {\n subtotal: 10300,\n tax: 515,\n total: 10815,\n totalHours: 60,\n },\n};\n\nexport function InvoiceConsultantDocument({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceConsultantData;\n}) {\n return (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceConsultantContent data={data} />\n </PdfcnThemeProvider>\n );\n}\n\nfunction InvoiceConsultantContent({ data }: { data: InvoiceConsultantData }) {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n calloutNote: {\n backgroundColor: theme.colors.muted,\n borderLeftColor: theme.colors.info,\n borderLeftStyle: \"solid\",\n borderLeftWidth: 3,\n marginTop: 16,\n paddingLeft: 12,\n paddingVertical: 8,\n },\n companyInfo: {\n flex: 1,\n },\n headerRow: {\n alignItems: \"flex-start\",\n borderBottomColor: theme.colors.primary,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 2,\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: theme.spacing.sectionGap,\n paddingBottom: theme.spacing.componentGap,\n },\n hoursBadge: {\n alignSelf: \"flex-start\",\n backgroundColor: theme.colors.primary,\n borderRadius: theme.primitives.borderRadius.sm,\n color: theme.colors.primaryForeground,\n paddingHorizontal: 12,\n paddingVertical: 8,\n },\n hoursBox: {\n flex: 1,\n paddingRight: 24,\n },\n invoiceInfo: {\n alignItems: \"flex-end\",\n },\n page: {\n backgroundColor: theme.colors.background,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n partiesRow: {\n flexDirection: \"row\",\n gap: 40,\n marginBottom: theme.spacing.sectionGap,\n },\n partyColumn: {\n flex: 1,\n },\n partyLabel: {\n borderBottomColor: theme.colors.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n color: theme.colors.primary,\n fontSize: 9,\n fontWeight: \"bold\",\n letterSpacing: 0.6,\n marginBottom: 6,\n paddingBottom: 4,\n textTransform: \"uppercase\",\n },\n projectRef: {\n alignItems: \"center\",\n backgroundColor: theme.colors.muted,\n borderRadius: theme.primitives.borderRadius.sm,\n flexDirection: \"row\",\n gap: 8,\n marginBottom: theme.spacing.sectionGap,\n paddingHorizontal: 10,\n paddingVertical: 6,\n },\n summaryRow: {\n flexDirection: \"row\",\n marginTop: 20,\n },\n totalsBox: {\n width: 250,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <View style={styles.headerRow}>\n <View style={styles.companyInfo}>\n <Text variant=\"xl\" weight=\"bold\" noMargin>\n {data.companyName}\n </Text>\n <Text variant=\"sm\" color=\"mutedForeground\" noMargin>\n {data.subtitle}\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n {data.companyAddress}\n </Text>\n </View>\n <View style={styles.invoiceInfo}>\n <Text\n variant=\"xs\"\n color=\"mutedForeground\"\n transform=\"uppercase\"\n noMargin\n >\n Invoice\n </Text>\n <Text variant=\"lg\" weight=\"bold\" noMargin>\n {data.invoiceNumber}\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n {data.invoiceDate}\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Due: {data.dueDate}\n </Text>\n </View>\n </View>\n {data.projectRef && (\n <View style={styles.projectRef}>\n <Text\n variant=\"xs\"\n weight=\"semibold\"\n color=\"mutedForeground\"\n noMargin\n >\n Project Reference:\n </Text>\n <Text variant=\"xs\" weight=\"bold\" noMargin>\n {data.projectRef}\n </Text>\n </View>\n )}\n <View style={styles.partiesRow}>\n <View style={styles.partyColumn}>\n <Text style={styles.partyLabel} noMargin>\n From (Consultant)\n </Text>\n <Text variant=\"sm\" weight=\"semibold\" noMargin>\n {data.consultant.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.consultant.title}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.consultant.email}\n </Text>\n </View>\n <View style={styles.partyColumn}>\n <Text style={styles.partyLabel} noMargin>\n Bill To (Client)\n </Text>\n <Text variant=\"sm\" weight=\"semibold\" noMargin>\n {data.client.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.client.company}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.client.address}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.client.email}\n </Text>\n </View>\n </View>\n <Table variant=\"line\">\n <TableHeader>\n <TableRow header>\n <TableCell>Service Description</TableCell>\n <TableCell align=\"center\">Hours</TableCell>\n <TableCell align=\"right\">Rate ($/hr)</TableCell>\n <TableCell align=\"right\">Amount</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.services.map((service, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF list, no reordering\n <TableRow key={index}>\n <TableCell>{service.description}</TableCell>\n <TableCell align=\"center\">{`${service.hours}`}</TableCell>\n <TableCell align=\"right\">{`$${service.rate}`}</TableCell>\n <TableCell align=\"right\">{`$${(service.hours * service.rate).toLocaleString()}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={styles.summaryRow}>\n <View style={styles.hoursBox}>\n <View style={styles.hoursBadge}>\n <Text\n style={{\n color: theme.colors.primaryForeground,\n fontSize: 9,\n fontWeight: \"bold\",\n }}\n noMargin\n >\n Total Hours: {data.summary.totalHours}\n </Text>\n </View>\n <Text variant=\"xs\" color=\"mutedForeground\" style={{ marginTop: 8 }}>\n Payment: {data.paymentTerms.method}\n </Text>\n </View>\n <View style={styles.totalsBox}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toLocaleString()}`,\n },\n { key: \"Tax (5%)\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Amount Due\",\n keyStyle: { fontSize: 13, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: {\n color: theme.colors.primary,\n fontSize: 14,\n fontWeight: \"bold\",\n },\n },\n ]}\n divided\n />\n </View>\n </Section>\n {data.notes && (\n <View style={styles.calloutNote}>\n <Text variant=\"xs\" color=\"mutedForeground\">\n {data.notes}\n </Text>\n </View>\n )}\n <PageFooter\n leftText=\"Professional services invoice – Please retain for records\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </View></Page>\n </Document>\n );\n}\n",- "type": "registry:block"+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport type { InvoiceConsultantData } from \"./invoice-consultant.types\";\n\nconst sampleData: InvoiceConsultantData = {\n client: {\n address: \"500 Tech Park, Suite 200\",\n company: \"Acme Technologies\",\n email: \"[email protected]\",\n name: \"Sarah Johnson\",\n },\n companyAddress: \"City, Country · [email protected]\",\n companyName: \"Your Consulting\",\n consultant: {\n email: \"[email protected]\",\n name: \"John Smith\",\n title: \"Senior Technical Consultant\",\n },\n dueDate: \"March 28, 2026\",\n invoiceDate: \"February 26, 2026\",\n invoiceNumber: \"INV-2026-006\",\n notes:\n \"Services rendered for February 2026. All hours verified and approved by client.\",\n paymentTerms: {\n dueDate: \"March 28, 2026\",\n method: \"Bank Transfer / Check\",\n },\n projectRef: \"PROJ-2026-ACME-001\",\n services: [\n { description: \"Architecture Review & Planning\", hours: 16, rate: 175 },\n { description: \"Code Review & Optimization\", hours: 24, rate: 150 },\n { description: \"Technical Documentation\", hours: 12, rate: 125 },\n { description: \"Team Training & Knowledge Transfer\", hours: 8, rate: 200 },\n ],\n subtitle: \"Professional Consulting Services\",\n summary: {\n subtotal: 10_300,\n tax: 515,\n total: 10_815,\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 padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n partiesRow: {\n flexDirection: \"row\",\n gap: 40,\n marginBottom: theme.spacing.sectionGap,\n },\n partyColumn: {\n flex: 1,\n },\n partyLabel: {\n borderBottomColor: theme.colors.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n color: theme.colors.primary,\n fontSize: 9,\n fontWeight: \"bold\",\n letterSpacing: 0.6,\n marginBottom: 6,\n paddingBottom: 4,\n textTransform: \"uppercase\",\n },\n projectRef: {\n alignItems: \"center\",\n backgroundColor: theme.colors.muted,\n borderRadius: theme.primitives.borderRadius.sm,\n flexDirection: \"row\",\n gap: 8,\n marginBottom: theme.spacing.sectionGap,\n paddingHorizontal: 10,\n paddingVertical: 6,\n },\n summaryRow: {\n flexDirection: \"row\",\n marginTop: 20,\n },\n totalsBox: {\n width: 250,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <View style={styles.headerRow}>\n <View style={styles.companyInfo}>\n <Text variant=\"xl\" weight=\"bold\" noMargin>\n {data.companyName}\n </Text>\n <Text variant=\"sm\" color=\"mutedForeground\" noMargin>\n {data.subtitle}\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n {data.companyAddress}\n </Text>\n </View>\n <View style={styles.invoiceInfo}>\n <Text\n variant=\"xs\"\n color=\"mutedForeground\"\n transform=\"uppercase\"\n noMargin\n >\n Invoice\n </Text>\n <Text variant=\"lg\" weight=\"bold\" noMargin>\n {data.invoiceNumber}\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n {data.invoiceDate}\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Due: {data.dueDate}\n </Text>\n </View>\n </View>\n {data.projectRef && (\n <View style={styles.projectRef}>\n <Text\n variant=\"xs\"\n weight=\"semibold\"\n color=\"mutedForeground\"\n noMargin\n >\n Project Reference:\n </Text>\n <Text variant=\"xs\" weight=\"bold\" noMargin>\n {data.projectRef}\n </Text>\n </View>\n )}\n <View style={styles.partiesRow}>\n <View style={styles.partyColumn}>\n <Text style={styles.partyLabel} noMargin>\n From (Consultant)\n </Text>\n <Text variant=\"sm\" weight=\"semibold\" noMargin>\n {data.consultant.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.consultant.title}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.consultant.email}\n </Text>\n </View>\n <View style={styles.partyColumn}>\n <Text style={styles.partyLabel} noMargin>\n Bill To (Client)\n </Text>\n <Text variant=\"sm\" weight=\"semibold\" noMargin>\n {data.client.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.client.company}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.client.address}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.client.email}\n </Text>\n </View>\n </View>\n <Table variant=\"line\">\n <TableHeader>\n <TableRow header>\n <TableCell>Service Description</TableCell>\n <TableCell align=\"center\">Hours</TableCell>\n <TableCell align=\"right\">Rate ($/hr)</TableCell>\n <TableCell align=\"right\">Amount</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.services.map((service, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF list, no reordering\n <TableRow key={index}>\n <TableCell>{service.description}</TableCell>\n <TableCell align=\"center\">{`${service.hours}`}</TableCell>\n <TableCell align=\"right\">{`$${service.rate}`}</TableCell>\n <TableCell align=\"right\">{`$${(service.hours * service.rate).toLocaleString()}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={styles.summaryRow}>\n <View style={styles.hoursBox}>\n <View style={styles.hoursBadge}>\n <Text\n style={{\n color: theme.colors.primaryForeground,\n fontSize: 9,\n fontWeight: \"bold\",\n }}\n noMargin\n >\n Total Hours: {data.summary.totalHours}\n </Text>\n </View>\n <Text\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 <PageFooter\n leftText=\"Professional services invoice – Please retain for records\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\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"},{"path": "registry/bases/forme/blocks/invoice-consultant/invoice-consultant.types.ts","content": "export interface InvoiceConsultantData {\n invoiceNumber: string;\n invoiceDate: string;\n dueDate: string;\n companyName: string;\n subtitle: string;\n companyAddress: string;\n consultant: {\n name: string;\n title: string;\n email: string;\n };\n client: {\n name: string;\n company: string;\n address: string;\n email: string;\n };\n services: {\n description: string;\n hours: number;\n rate: number;\n }[];\n summary: {\n totalHours: number;\n subtotal: number;\n tax: number;\n total: number;\n };\n paymentTerms: {\n dueDate: string;\n method: string;\n };\n projectRef?: string;\n notes?: string;\n}\n",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-consultant/invoice-consultant.types.ts"}],"type": "registry:block"diff --git a/public/r/forme/invoice-corporate.json b/public/r/forme/invoice-corporate.jsonindex c565ed0..0c553d4 100644--- a/public/r/forme/invoice-corporate.json+++ b/public/r/forme/invoice-corporate.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/forme/blocks/invoice-corporate/invoice-corporate.tsx",- "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfImage,\n PdfcnThemeProvider,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport type { InvoiceCorporateData } from \"./invoice-corporate.types\";\n\nconst sampleData: InvoiceCorporateData = {\n billTo: {\n address: \"100 Corporate Plaza, Tower B\",\n email: \"[email protected]\",\n name: \"Global Industries Ltd.\",\n phone: \"+1 (555) 888-9999\",\n },\n companyAddress: \"City, Country\",\n companyEmail: \"[email protected]\",\n companyName: \"Your Company\",\n dueDate: \"March 24, 2026\",\n invoiceDate: \"February 22, 2026\",\n invoiceNumber: \"INV-2026-004\",\n items: [\n {\n description: \"Enterprise Software License\",\n quantity: 5,\n unitPrice: 4500,\n },\n { description: \"Implementation Services\", quantity: 1, unitPrice: 18000 },\n { description: \"Training Workshop\", quantity: 3, unitPrice: 2500 },\n { description: \"Annual Support Package\", quantity: 1, unitPrice: 8500 },\n ],\n logo: \"/favicon.png\",\n notes: \"Corporate billing – Net 30 terms apply.\",\n paymentTerms: {\n dueDate: \"March 24, 2026\",\n gst: \"GSTIN 987654321\",\n method: \"Wire Transfer / Corporate Account\",\n },\n subtitle: \"Professional Services\",\n summary: {\n subtotal: 57000,\n tax: 4560,\n total: 61560,\n },\n};\n\nexport function InvoiceCorporateDocument({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceCorporateData;\n}) {\n return (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceCorporateContent data={data} />\n </PdfcnThemeProvider>\n );\n}\n\nfunction InvoiceCorporateContent({ data }: { data: InvoiceCorporateData }) {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n infoColumn: {\n flex: 1,\n },\n infoGrid: {\n flexDirection: \"row\",\n gap: 24,\n marginBottom: theme.spacing.sectionGap,\n },\n infoLabel: {\n color: theme.colors.mutedForeground,\n fontSize: 9,\n fontWeight: \"bold\",\n letterSpacing: 0.6,\n marginBottom: 6,\n textTransform: \"uppercase\",\n },\n page: {\n backgroundColor: theme.colors.background,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n summaryCard: {\n backgroundColor: theme.colors.muted,\n borderRadius: theme.primitives.borderRadius.md,\n marginTop: 20,\n padding: 16,\n },\n summaryRow: {\n flexDirection: \"row\",\n justifyContent: \"flex-end\",\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <PageHeader\n variant=\"logo-right\"\n logo={\n <PdfImage\n src={data.logo ?? \"/favicon.png\"}\n width={56}\n height={56}\n style={{ margin: 0 }}\n />\n }\n title={data.companyName}\n subtitle={`${data.subtitle} · ${data.companyAddress}`}\n style={{ marginBottom: theme.spacing.sectionGap }}\n />\n <View style={styles.infoGrid}>\n <View style={styles.infoColumn}>\n <Text style={styles.infoLabel} noMargin>\n Invoice Details\n </Text>\n <KeyValue\n size=\"sm\"\n items={[\n { key: \"Invoice #\", value: data.invoiceNumber },\n { key: \"Issue Date\", value: data.invoiceDate },\n { key: \"Due Date\", value: data.dueDate },\n { key: \"Payment\", value: data.paymentTerms.method },\n ]}\n />\n </View>\n <View style={styles.infoColumn}>\n <Text style={styles.infoLabel} noMargin>\n Bill To\n </Text>\n <Text variant=\"sm\" weight=\"semibold\" noMargin>\n {data.billTo.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.address}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.email}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.phone}\n </Text>\n </View>\n </View>\n <Table variant=\"bordered\">\n <TableHeader>\n <TableRow header>\n <TableCell>Description</TableCell>\n <TableCell align=\"center\">Qty</TableCell>\n <TableCell align=\"right\">Unit Price</TableCell>\n <TableCell align=\"right\">Amount</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF list, no reordering\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"right\">{`$${item.unitPrice.toLocaleString()}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toLocaleString()}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <View style={styles.summaryCard}>\n <View style={styles.summaryRow}>\n <View style={{ width: 260 }}>\n <KeyValue\n size=\"md\"\n dividerThickness={1}\n dividerColor=\"border\"\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toLocaleString()}`,\n },\n { key: \"Tax (8%)\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Total Due\",\n keyStyle: { fontSize: 13, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: {\n color: theme.colors.primary,\n fontSize: 14,\n fontWeight: \"bold\",\n },\n },\n ]}\n divided\n />\n </View>\n </View>\n </View>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </View></Page>\n </Document>\n );\n}\n",- "type": "registry:block"+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfImage,\n PdfcnThemeProvider,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport type { InvoiceCorporateData } from \"./invoice-corporate.types\";\n\nconst sampleData: InvoiceCorporateData = {\n billTo: {\n address: \"100 Corporate Plaza, Tower B\",\n email: \"[email protected]\",\n name: \"Global Industries Ltd.\",\n phone: \"+1 (555) 888-9999\",\n },\n companyAddress: \"City, Country\",\n companyEmail: \"[email protected]\",\n companyName: \"Your Company\",\n dueDate: \"March 24, 2026\",\n invoiceDate: \"February 22, 2026\",\n invoiceNumber: \"INV-2026-004\",\n items: [\n {\n description: \"Enterprise Software License\",\n quantity: 5,\n unitPrice: 4500,\n },\n { description: \"Implementation Services\", quantity: 1, unitPrice: 18_000 },\n { description: \"Training Workshop\", quantity: 3, unitPrice: 2500 },\n { description: \"Annual Support Package\", quantity: 1, unitPrice: 8500 },\n ],\n logo: \"/favicon.png\",\n notes: \"Corporate billing – Net 30 terms apply.\",\n paymentTerms: {\n dueDate: \"March 24, 2026\",\n gst: \"GSTIN 987654321\",\n method: \"Wire Transfer / Corporate Account\",\n },\n subtitle: \"Professional Services\",\n summary: {\n subtotal: 57_000,\n tax: 4560,\n total: 61_560,\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 padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n summaryCard: {\n backgroundColor: theme.colors.muted,\n borderRadius: theme.primitives.borderRadius.md,\n marginTop: 20,\n padding: 16,\n },\n summaryRow: {\n flexDirection: \"row\",\n justifyContent: \"flex-end\",\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <PageHeader\n variant=\"logo-right\"\n logo={\n <PdfImage\n src={data.logo ?? \"/favicon.png\"}\n width={56}\n height={56}\n style={{ margin: 0 }}\n />\n }\n title={data.companyName}\n subtitle={`${data.subtitle} · ${data.companyAddress}`}\n style={{ marginBottom: theme.spacing.sectionGap }}\n />\n <View style={styles.infoGrid}>\n <View style={styles.infoColumn}>\n <Text style={styles.infoLabel} noMargin>\n Invoice Details\n </Text>\n <KeyValue\n size=\"sm\"\n items={[\n { key: \"Invoice #\", value: data.invoiceNumber },\n { key: \"Issue Date\", value: data.invoiceDate },\n { key: \"Due Date\", value: data.dueDate },\n { key: \"Payment\", value: data.paymentTerms.method },\n ]}\n />\n </View>\n <View style={styles.infoColumn}>\n <Text style={styles.infoLabel} noMargin>\n Bill To\n </Text>\n <Text variant=\"sm\" weight=\"semibold\" noMargin>\n {data.billTo.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.address}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.email}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.phone}\n </Text>\n </View>\n </View>\n <Table variant=\"bordered\">\n <TableHeader>\n <TableRow header>\n <TableCell>Description</TableCell>\n <TableCell align=\"center\">Qty</TableCell>\n <TableCell align=\"right\">Unit Price</TableCell>\n <TableCell align=\"right\">Amount</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF list, no reordering\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"right\">{`$${item.unitPrice.toLocaleString()}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toLocaleString()}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <View style={styles.summaryCard}>\n <View style={styles.summaryRow}>\n <View style={{ width: 260 }}>\n <KeyValue\n size=\"md\"\n dividerThickness={1}\n dividerColor=\"border\"\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toLocaleString()}`,\n },\n {\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 <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\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"},{"path": "registry/bases/forme/blocks/invoice-corporate/invoice-corporate.types.ts","content": "export interface InvoiceCorporateData {\n invoiceNumber: string;\n invoiceDate: string;\n dueDate: string;\n companyName: string;\n subtitle: string;\n companyAddress: string;\n companyEmail: string;\n logo?: string;\n billTo: {\n name: string;\n address: string;\n email: string;\n phone: string;\n };\n items: {\n description: string;\n quantity: number;\n unitPrice: number;\n }[];\n summary: {\n subtotal: number;\n tax: number;\n total: number;\n };\n paymentTerms: {\n dueDate: string;\n method: string;\n gst: string;\n };\n notes?: string;\n}\n",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-corporate/invoice-corporate.types.ts"}],"type": "registry:block"diff --git a/public/r/forme/invoice-creative.json b/public/r/forme/invoice-creative.jsonindex ba0acd9..5f4d1d5 100644--- a/public/r/forme/invoice-creative.json+++ b/public/r/forme/invoice-creative.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/forme/blocks/invoice-creative/invoice-creative.tsx",- "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport type { InvoiceCreativeData } from \"./invoice-creative.types\";\n\nconst sampleData: InvoiceCreativeData = {\n billTo: {\n address: \"250 Design District, Loft 5\",\n email: \"[email protected]\",\n name: \"Creative Agency Co.\",\n phone: \"+1 (555) 321-7654\",\n },\n companyAddress: \"City, Country · [email protected]\",\n companyName: \"Your Agency\",\n dueDate: \"March 26, 2026\",\n invoiceDate: \"February 24, 2026\",\n invoiceNumber: \"INV-2026-005\",\n items: [\n { description: \"Brand Identity Design\", quantity: 1, unitPrice: 8500 },\n {\n description: \"Marketing Collateral Package\",\n quantity: 1,\n unitPrice: 4200,\n },\n {\n description: \"Social Media Assets (per set)\",\n quantity: 4,\n unitPrice: 750,\n },\n { description: \"Motion Graphics (30s)\", quantity: 2, unitPrice: 3500 },\n ],\n notes:\n \"Creative work is protected under copyright. Full usage rights transfer upon payment.\",\n paymentTerms: {\n dueDate: \"March 26, 2026\",\n gst: \"GSTIN 456789123\",\n method: \"Credit Card / PayPal / Stripe\",\n },\n subtitle: \"Creative Services\",\n summary: {\n subtotal: 22700,\n tax: 1475.5,\n total: 24175.5,\n },\n};\n\nexport function InvoiceCreativeDocument({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceCreativeData;\n}) {\n return (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceCreativeContent data={data} />\n </PdfcnThemeProvider>\n );\n}\n\nfunction InvoiceCreativeContent({ data }: { data: InvoiceCreativeData }) {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n accentBlock: {\n backgroundColor: theme.colors.muted,\n borderLeftColor: theme.colors.accent,\n borderLeftStyle: \"solid\",\n borderLeftWidth: 4,\n marginBottom: theme.spacing.sectionGap,\n paddingLeft: 14,\n paddingVertical: 10,\n },\n badgeLabel: {\n color: theme.colors.primaryForeground,\n fontSize: 8,\n fontWeight: \"bold\",\n letterSpacing: 1.2,\n marginBottom: 2,\n textTransform: \"uppercase\",\n },\n badgeNumber: {\n color: theme.colors.primaryForeground,\n fontSize: 16,\n fontWeight: \"bold\",\n },\n heroSection: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: theme.spacing.sectionGap,\n },\n infoColumn: {\n flex: 1,\n },\n infoGrid: {\n flexDirection: \"row\",\n gap: 32,\n },\n invoiceBadge: {\n alignItems: \"center\",\n backgroundColor: theme.colors.primary,\n borderRadius: theme.primitives.borderRadius.md,\n paddingHorizontal: 20,\n paddingVertical: 14,\n },\n page: {\n backgroundColor: theme.colors.background,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n sectionLabel: {\n color: theme.colors.accent,\n fontSize: 8,\n fontWeight: \"bold\",\n letterSpacing: 0.8,\n marginBottom: 6,\n textTransform: \"uppercase\",\n },\n summaryLeft: {\n flex: 1,\n paddingRight: 20,\n },\n summaryRight: {\n backgroundColor: theme.colors.muted,\n borderRadius: theme.primitives.borderRadius.sm,\n padding: 14,\n width: 240,\n },\n summarySection: {\n flexDirection: \"row\",\n marginTop: 24,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <View style={styles.heroSection}>\n <View style={{ flex: 1 }}>\n <PageHeader\n variant=\"centered\"\n title={data.companyName}\n subtitle={`${data.subtitle} · ${data.companyAddress}`}\n marginBottom={0}\n />\n </View>\n <View style={styles.invoiceBadge}>\n <Text style={styles.badgeLabel} noMargin>\n Invoice\n </Text>\n <Text style={styles.badgeNumber} noMargin>\n {data.invoiceNumber}\n </Text>\n </View>\n </View>\n <View style={styles.accentBlock}>\n <View style={styles.infoGrid}>\n <View style={styles.infoColumn}>\n <Text style={styles.sectionLabel} noMargin>\n Billed To\n </Text>\n <Text variant=\"sm\" weight=\"semibold\" noMargin>\n {data.billTo.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.address}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.email} · {data.billTo.phone}\n </Text>\n </View>\n <View style={styles.infoColumn}>\n <Text style={styles.sectionLabel} noMargin>\n Invoice Info\n </Text>\n <KeyValue\n size=\"sm\"\n items={[\n { key: \"Issue Date\", value: data.invoiceDate },\n { key: \"Due Date\", value: data.dueDate },\n { key: \"Payment\", value: data.paymentTerms.method },\n ]}\n />\n </View>\n </View>\n </View>\n <Table variant=\"striped\" zebraStripe>\n <TableHeader>\n <TableRow header>\n <TableCell>Deliverable</TableCell>\n <TableCell align=\"center\">Qty</TableCell>\n <TableCell align=\"right\">Rate</TableCell>\n <TableCell align=\"right\">Amount</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF list, no reordering\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"right\">{`$${item.unitPrice.toLocaleString()}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toLocaleString()}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={styles.summarySection}>\n <View style={styles.summaryLeft}>\n <Text style={styles.sectionLabel} noMargin>\n Notes & Terms\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\">\n {data.notes}\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" style={{ marginTop: 4 }}>\n GST: {data.paymentTerms.gst}\n </Text>\n </View>\n <View style={styles.summaryRight}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toLocaleString()}`,\n },\n { key: \"Tax (6.5%)\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Total\",\n keyStyle: { fontSize: 13, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: {\n color: theme.colors.accent,\n fontSize: 14,\n fontWeight: \"bold\",\n },\n },\n ]}\n divided\n />\n </View>\n </Section>\n <PageFooter\n variant=\"centered\"\n centerText=\"Thank you for choosing us for your creative needs!\"\n sticky\n pagePadding={25}\n />\n </View></Page>\n </Document>\n );\n}\n",- "type": "registry:block"+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport type { InvoiceCreativeData } from \"./invoice-creative.types\";\n\nconst sampleData: InvoiceCreativeData = {\n billTo: {\n address: \"250 Design District, Loft 5\",\n email: \"[email protected]\",\n name: \"Creative Agency Co.\",\n phone: \"+1 (555) 321-7654\",\n },\n companyAddress: \"City, Country · [email protected]\",\n companyName: \"Your Agency\",\n dueDate: \"March 26, 2026\",\n invoiceDate: \"February 24, 2026\",\n invoiceNumber: \"INV-2026-005\",\n items: [\n { description: \"Brand Identity Design\", quantity: 1, unitPrice: 8500 },\n {\n description: \"Marketing Collateral Package\",\n quantity: 1,\n unitPrice: 4200,\n },\n {\n description: \"Social Media Assets (per set)\",\n quantity: 4,\n unitPrice: 750,\n },\n { description: \"Motion Graphics (30s)\", quantity: 2, unitPrice: 3500 },\n ],\n notes:\n \"Creative work is protected under copyright. Full usage rights transfer upon payment.\",\n paymentTerms: {\n dueDate: \"March 26, 2026\",\n gst: \"GSTIN 456789123\",\n method: \"Credit Card / PayPal / Stripe\",\n },\n subtitle: \"Creative Services\",\n summary: {\n subtotal: 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 padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n sectionLabel: {\n color: theme.colors.accent,\n fontSize: 8,\n fontWeight: \"bold\",\n letterSpacing: 0.8,\n marginBottom: 6,\n textTransform: \"uppercase\",\n },\n summaryLeft: {\n flex: 1,\n paddingRight: 20,\n },\n summaryRight: {\n backgroundColor: theme.colors.muted,\n borderRadius: theme.primitives.borderRadius.sm,\n padding: 14,\n width: 240,\n },\n summarySection: {\n flexDirection: \"row\",\n marginTop: 24,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <View style={styles.heroSection}>\n <View style={{ flex: 1 }}>\n <PageHeader\n variant=\"centered\"\n title={data.companyName}\n subtitle={`${data.subtitle} · ${data.companyAddress}`}\n marginBottom={0}\n />\n </View>\n <View style={styles.invoiceBadge}>\n <Text style={styles.badgeLabel} noMargin>\n Invoice\n </Text>\n <Text style={styles.badgeNumber} noMargin>\n {data.invoiceNumber}\n </Text>\n </View>\n </View>\n <View style={styles.accentBlock}>\n <View style={styles.infoGrid}>\n <View style={styles.infoColumn}>\n <Text style={styles.sectionLabel} noMargin>\n Billed To\n </Text>\n <Text variant=\"sm\" weight=\"semibold\" noMargin>\n {data.billTo.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.address}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.email} · {data.billTo.phone}\n </Text>\n </View>\n <View style={styles.infoColumn}>\n <Text style={styles.sectionLabel} noMargin>\n Invoice Info\n </Text>\n <KeyValue\n size=\"sm\"\n items={[\n { key: \"Issue Date\", value: data.invoiceDate },\n { key: \"Due Date\", value: data.dueDate },\n { key: \"Payment\", value: data.paymentTerms.method },\n ]}\n />\n </View>\n </View>\n </View>\n <Table variant=\"striped\" zebraStripe>\n <TableHeader>\n <TableRow header>\n <TableCell>Deliverable</TableCell>\n <TableCell align=\"center\">Qty</TableCell>\n <TableCell align=\"right\">Rate</TableCell>\n <TableCell align=\"right\">Amount</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF list, no reordering\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"right\">{`$${item.unitPrice.toLocaleString()}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toLocaleString()}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={styles.summarySection}>\n <View style={styles.summaryLeft}>\n <Text style={styles.sectionLabel} noMargin>\n Notes & Terms\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\">\n {data.notes}\n </Text>\n <Text\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 <PageFooter\n variant=\"centered\"\n centerText=\"Thank you for choosing us for your creative needs!\"\n sticky\n pagePadding={25}\n />\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"},{"path": "registry/bases/forme/blocks/invoice-creative/invoice-creative.types.ts","content": "export interface InvoiceCreativeData {\n invoiceNumber: string;\n invoiceDate: string;\n dueDate: string;\n companyName: string;\n subtitle: string;\n companyAddress: string;\n billTo: {\n name: string;\n address: string;\n email: string;\n phone: string;\n };\n items: {\n description: string;\n quantity: number;\n unitPrice: number;\n }[];\n summary: {\n subtotal: number;\n tax: number;\n total: number;\n };\n paymentTerms: {\n dueDate: string;\n method: string;\n gst: string;\n };\n notes?: string;\n}\n",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-creative/invoice-creative.types.ts"}],"type": "registry:block"diff --git a/public/r/forme/invoice-minimal.json b/public/r/forme/invoice-minimal.jsonindex 43c06f1..eec8111 100644--- a/public/r/forme/invoice-minimal.json+++ b/public/r/forme/invoice-minimal.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/forme/blocks/invoice-minimal/invoice-minimal.tsx",- "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport type { InvoiceMinimalData } from \"./invoice-minimal.types\";\n\n// Sample data — replace with your own props or data source\nconst sampleData: InvoiceMinimalData = {\n billTo: {\n address: \"500 Enterprise Way, Building A\",\n email: \"[email protected]\",\n name: \"Enterprise Corp\",\n phone: \"+1 (555) 246-8135\",\n },\n companyAddress: \"City, Country\",\n companyEmail: \"[email protected]\",\n companyName: \"Your Company\",\n dueDate: \"March 22, 2026\",\n invoiceDate: \"February 20, 2026\",\n invoiceNumber: \"INV-2026-003\",\n items: [\n { description: \"Annual Licenselan\", quantity: 1, unitPrice: 25000 },\n { description: \"Support & Maintenance\", quantity: 12, unitPrice: 1500 },\n { description: \"Custom Integration\", quantity: 1, unitPrice: 12000 },\n ],\n notes:\n \"Invoice for annual enterprise subscription. Please retain for your records.\",\n paymentTerms: {\n dueDate: \"March 22, 2026\",\n gst: \"GSTIN 123456789\",\n method: \"ACH Transfer / Check\",\n },\n subtitle: \"Professional Services\",\n summary: {\n subtotal: 55000,\n tax: 3850,\n total: 58850,\n },\n};\n\nexport function InvoiceMinimalDocument({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceMinimalData;\n}) {\n return (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceMinimalContent data={data} />\n </PdfcnThemeProvider>\n );\n}\n\nfunction InvoiceMinimalContent({ data }: { data: InvoiceMinimalData }) {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n infoLabel: {\n color: theme.colors.primary,\n fontSize: 8,\n fontWeight: \"bold\",\n letterSpacing: 0.8,\n marginBottom: 4,\n textTransform: \"uppercase\",\n },\n infoRow: {\n flexDirection: \"row\",\n marginBottom: theme.spacing.sectionGap,\n },\n invoiceStamp: {\n alignSelf: \"flex-start\",\n borderColor: theme.colors.primary,\n borderRadius: theme.primitives.borderRadius.sm,\n borderStyle: \"solid\",\n borderWidth: 2,\n paddingHorizontal: 12,\n paddingVertical: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <Section\n noWrap\n style={{\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n marginBottom: theme.spacing.sectionGap,\n }}\n >\n <View style={{ flex: 1 }}>\n <PageHeader\n variant=\"minimal\"\n title={data.companyName}\n subtitle={`${data.companyAddress} · ${data.companyEmail}`}\n marginBottom={0}\n />\n </View>\n <View style={styles.invoiceStamp}>\n <Text\n style={{\n color: theme.colors.primary,\n fontSize: 7,\n fontWeight: \"bold\",\n textAlign: \"right\",\n }}\n noMargin\n transform=\"uppercase\"\n >\n Invoice\n </Text>\n <Text\n style={{\n color: theme.colors.foreground,\n fontSize: 14,\n fontWeight: \"bold\",\n textAlign: \"right\",\n }}\n noMargin\n >\n {data.invoiceNumber}\n </Text>\n <Text\n style={{\n color: theme.colors.mutedForeground,\n fontSize: 8,\n textAlign: \"right\",\n }}\n noMargin\n >\n {data.invoiceDate}\n </Text>\n </View>\n </Section>\n <View style={styles.infoRow}>\n <View style={{ flex: 1, paddingRight: 20 }}>\n <Text style={styles.infoLabel} noMargin>\n Bill To\n </Text>\n <Text variant=\"sm\" noMargin>\n {data.billTo.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.address}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.email}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.phone}\n </Text>\n </View>\n <View style={{ flex: 1 }}>\n <Text style={styles.infoLabel} noMargin>\n Invoice Details\n </Text>\n <KeyValue\n size=\"sm\"\n items={[\n { key: \"Due Date\", value: data.dueDate },\n { key: \"Payment\", value: data.paymentTerms.method },\n { key: \"GST\", value: data.paymentTerms.gst },\n ]}\n />\n </View>\n </View>\n <Table variant=\"compact\">\n <TableHeader>\n <TableRow header>\n <TableCell>Description</TableCell>\n <TableCell align=\"center\">Qty</TableCell>\n <TableCell align=\"right\">Rate</TableCell>\n <TableCell align=\"right\">Total</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: invoice items have no stable id\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"right\">{`$${item.unitPrice.toLocaleString()}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toFixed(2)}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={{ flexDirection: \"row\", marginTop: 20 }}>\n <View style={{ flex: 1 }} />\n <View style={{ width: 240 }}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toFixed(2)}`,\n },\n { key: \"Tax (7%)\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Balance Due\",\n keyStyle: { fontSize: 12, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: {\n color: theme.colors.primary,\n fontSize: 13,\n fontWeight: \"bold\",\n },\n },\n ]}\n divided\n />\n </View>\n </Section>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </View></Page>\n </Document>\n );\n}\n",- "type": "registry:block"+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport type { InvoiceMinimalData } from \"./invoice-minimal.types\";\n\n// Sample data — replace with your own props or data source\nconst sampleData: InvoiceMinimalData = {\n billTo: {\n address: \"500 Enterprise Way, Building A\",\n email: \"[email protected]\",\n name: \"Enterprise Corp\",\n phone: \"+1 (555) 246-8135\",\n },\n companyAddress: \"City, Country\",\n companyEmail: \"[email protected]\",\n companyName: \"Your Company\",\n dueDate: \"March 22, 2026\",\n invoiceDate: \"February 20, 2026\",\n invoiceNumber: \"INV-2026-003\",\n items: [\n { description: \"Annual Licenselan\", quantity: 1, unitPrice: 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: \"Professional Services\",\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 padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <Section\n noWrap\n style={{\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n marginBottom: theme.spacing.sectionGap,\n }}\n >\n <View style={{ flex: 1 }}>\n <PageHeader\n variant=\"minimal\"\n title={data.companyName}\n subtitle={`${data.companyAddress} · ${data.companyEmail}`}\n marginBottom={0}\n />\n </View>\n <View style={styles.invoiceStamp}>\n <Text\n style={{\n color: theme.colors.primary,\n fontSize: 7,\n fontWeight: \"bold\",\n textAlign: \"right\",\n }}\n noMargin\n transform=\"uppercase\"\n >\n Invoice\n </Text>\n <Text\n style={{\n color: theme.colors.foreground,\n fontSize: 14,\n fontWeight: \"bold\",\n textAlign: \"right\",\n }}\n noMargin\n >\n {data.invoiceNumber}\n </Text>\n <Text\n style={{\n color: theme.colors.mutedForeground,\n fontSize: 8,\n textAlign: \"right\",\n }}\n noMargin\n >\n {data.invoiceDate}\n </Text>\n </View>\n </Section>\n <View style={styles.infoRow}>\n <View style={{ flex: 1, paddingRight: 20 }}>\n <Text style={styles.infoLabel} noMargin>\n Bill To\n </Text>\n <Text variant=\"sm\" noMargin>\n {data.billTo.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.address}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.email}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.phone}\n </Text>\n </View>\n <View style={{ flex: 1 }}>\n <Text style={styles.infoLabel} noMargin>\n Invoice Details\n </Text>\n <KeyValue\n size=\"sm\"\n items={[\n { key: \"Due Date\", value: data.dueDate },\n { key: \"Payment\", value: data.paymentTerms.method },\n { key: \"GST\", value: data.paymentTerms.gst },\n ]}\n />\n </View>\n </View>\n <Table variant=\"compact\">\n <TableHeader>\n <TableRow header>\n <TableCell>Description</TableCell>\n <TableCell align=\"center\">Qty</TableCell>\n <TableCell align=\"right\">Rate</TableCell>\n <TableCell align=\"right\">Total</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: invoice items have no stable id\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"right\">{`$${item.unitPrice.toLocaleString()}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toFixed(2)}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={{ flexDirection: \"row\", marginTop: 20 }}>\n <View style={{ flex: 1 }} />\n <View style={{ width: 240 }}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toFixed(2)}`,\n },\n { key: \"Tax (7%)\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Balance Due\",\n keyStyle: { fontSize: 12, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: {\n color: theme.colors.primary,\n fontSize: 13,\n fontWeight: \"bold\",\n },\n },\n ]}\n divided\n />\n </View>\n </Section>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </View>\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"},{"path": "registry/bases/forme/blocks/invoice-minimal/invoice-minimal.types.ts","content": "export interface InvoiceMinimalData {\n invoiceNumber: string;\n invoiceDate: string;\n dueDate: string;\n companyName: string;\n subtitle: string;\n companyAddress: string;\n companyEmail: string;\n billTo: {\n name: string;\n address: string;\n email: string;\n phone: string;\n };\n items: {\n description: string;\n quantity: number;\n unitPrice: number;\n }[];\n summary: {\n subtotal: number;\n tax: number;\n total: number;\n };\n paymentTerms: {\n dueDate: string;\n method: string;\n gst: string;\n };\n notes?: string;\n}\n",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-minimal/invoice-minimal.types.ts"}],"type": "registry:block"diff --git a/public/r/forme/invoice-modern.json b/public/r/forme/invoice-modern.jsonindex a1e27f7..4fe5609 100644--- a/public/r/forme/invoice-modern.json+++ b/public/r/forme/invoice-modern.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/forme/blocks/invoice-modern/invoice-modern.tsx",- "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport type { InvoiceModernData } from \"./invoice-modern.types\";\n\n// Sample data — replace with your own props or data source\nconst sampleData: InvoiceModernData = {\n billTo: {\n address: \"789 Innovation Blvd, Floor 3\",\n email: \"[email protected]\",\n name: \"TechStart Solutions\",\n phone: \"+1 (555) 987-6543\",\n },\n companyAddress: \"City, Country\",\n companyEmail: \"[email protected]\",\n companyName: \"Your Company\",\n dueDate: \"March 20, 2026\",\n invoiceDate: \"February 18, 2026\",\n invoiceNumber: \"INV-2026-002\",\n items: [\n { description: \"API Integration\", quantity: 1, unitPrice: 15000 },\n { description: \"SEO\", quantity: 2, unitPrice: 5500 },\n { description: \"Security Audit\", quantity: 1, unitPrice: 7200 },\n ],\n notes: \"Payment terms: Net 30 days. Thank you for your business!\",\n paymentTerms: {\n dueDate: \"March 20, 2026\",\n gst: \"GSTIN 123456789\",\n method: \"Wire Transfer / Bank Account\",\n },\n subtitle: \"Professional Services\",\n summary: {\n subtotal: 33200,\n tax: 2324,\n total: 35524,\n },\n};\n\nexport function InvoiceModernDocument({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceModernData;\n}) {\n return (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceModernContent data={data} />\n </PdfcnThemeProvider>\n );\n}\n\nfunction InvoiceModernContent({ data }: { data: InvoiceModernData }) {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n dividerCol: {\n backgroundColor: theme.colors.border,\n marginRight: 12,\n width: 1,\n },\n metaCol: {\n flex: 1,\n paddingRight: 12,\n },\n metaLabel: {\n color: theme.colors.mutedForeground,\n fontSize: 8,\n fontWeight: \"bold\",\n letterSpacing: 0.5,\n marginBottom: 3,\n textTransform: \"uppercase\",\n },\n metaRow: {\n flexDirection: \"row\",\n marginBottom: theme.spacing.sectionGap,\n },\n metaValue: {\n color: theme.colors.foreground,\n fontSize: 9,\n },\n page: {\n backgroundColor: theme.colors.background,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <PageHeader\n variant=\"branded\"\n title={data.companyName}\n subtitle={`${data.subtitle} · ${data.companyAddress} · ${data.companyEmail}`}\n />\n <View style={styles.metaRow}>\n <View style={styles.metaCol}>\n <Text style={styles.metaLabel} noMargin>\n Invoice Number\n </Text>\n <Text\n style={{ ...styles.metaValue, fontSize: 11, fontWeight: \"bold\" }}\n noMargin\n >\n {data.invoiceNumber}\n </Text>\n </View>\n <View style={styles.metaCol}>\n <Text style={styles.metaLabel} noMargin>\n Invoice Date\n </Text>\n <Text style={styles.metaValue} noMargin>\n {data.invoiceDate}\n </Text>\n </View>\n <View style={styles.metaCol}>\n <Text style={styles.metaLabel} noMargin>\n Due Date\n </Text>\n <Text style={styles.metaValue} noMargin>\n {data.dueDate}\n </Text>\n </View>\n <View style={styles.dividerCol} />\n <View style={{ flex: 2 }}>\n <Text style={styles.metaLabel} noMargin>\n Billed To\n </Text>\n <Text style={{ ...styles.metaValue, fontWeight: \"bold\" }} noMargin>\n {data.billTo.name}\n </Text>\n <Text\n style={{\n ...styles.metaValue,\n color: theme.colors.mutedForeground,\n }}\n noMargin\n >\n {data.billTo.address}\n </Text>\n <Text\n style={{\n ...styles.metaValue,\n color: theme.colors.mutedForeground,\n }}\n noMargin\n >\n {data.billTo.email}\n </Text>\n <Text\n style={{\n ...styles.metaValue,\n color: theme.colors.mutedForeground,\n }}\n noMargin\n >\n {data.billTo.phone}\n </Text>\n </View>\n </View>\n <Table variant=\"primary-header\">\n <TableHeader>\n <TableRow header>\n <TableCell>Description</TableCell>\n <TableCell align=\"center\">Qty</TableCell>\n <TableCell align=\"right\">Unit Price</TableCell>\n <TableCell align=\"right\">Amount</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: invoice items have no stable id\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"right\">{`$${item.unitPrice.toLocaleString()}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toFixed(2)}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={{ flexDirection: \"row\", marginTop: 16 }}>\n <View style={{ flex: 1, paddingRight: 20 }}>\n <Text style={styles.metaLabel} noMargin>\n Payment Method\n </Text>\n <Text variant=\"xs\" noMargin>\n {data.paymentTerms.method}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.paymentTerms.gst}\n </Text>\n </View>\n <View style={{ width: 220 }}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toFixed(2)}`,\n },\n { key: \"Tax (7%)\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Total Due\",\n keyStyle: { fontSize: 12, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: { fontSize: 12, fontWeight: \"bold\" },\n },\n ]}\n divided\n />\n </View>\n </Section>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </View></Page>\n </Document>\n );\n}\n",- "type": "registry:block"+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport type { InvoiceModernData } from \"./invoice-modern.types\";\n\n// Sample data — replace with your own props or data source\nconst sampleData: InvoiceModernData = {\n billTo: {\n address: \"789 Innovation Blvd, Floor 3\",\n email: \"[email protected]\",\n name: \"TechStart Solutions\",\n phone: \"+1 (555) 987-6543\",\n },\n companyAddress: \"City, Country\",\n companyEmail: \"[email protected]\",\n companyName: \"Your Company\",\n dueDate: \"March 20, 2026\",\n invoiceDate: \"February 18, 2026\",\n invoiceNumber: \"INV-2026-002\",\n items: [\n { description: \"API Integration\", quantity: 1, unitPrice: 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: \"Professional Services\",\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 padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <PageHeader\n variant=\"branded\"\n title={data.companyName}\n subtitle={`${data.subtitle} · ${data.companyAddress} · ${data.companyEmail}`}\n />\n <View style={styles.metaRow}>\n <View style={styles.metaCol}>\n <Text style={styles.metaLabel} noMargin>\n Invoice Number\n </Text>\n <Text\n style={{\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 <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\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"},{"path": "registry/bases/forme/blocks/invoice-modern/invoice-modern.types.ts","content": "export interface InvoiceModernData {\n invoiceNumber: string;\n invoiceDate: string;\n dueDate: string;\n companyName: string;\n subtitle: string;\n companyAddress: string;\n companyEmail: string;\n billTo: {\n name: string;\n address: string;\n email: string;\n phone: string;\n };\n items: {\n description: string;\n quantity: number;\n unitPrice: number;\n }[];\n summary: {\n subtotal: number;\n tax: number;\n total: number;\n };\n paymentTerms: {\n dueDate: string;\n method: string;\n gst: string;\n };\n notes?: string;\n}\n",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-modern/invoice-modern.types.ts"}],"type": "registry:block"diff --git a/public/r/forme/keep-together.json b/public/r/forme/keep-together.jsonindex 16f22d0..8288edf 100644--- a/public/r/forme/keep-together.json+++ b/public/r/forme/keep-together.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/forme/components/keep-together/keep-together.tsx",- "content": "import { View } from \"@formepdf/react\";\nimport type { ReactNode } from \"react\";\n\nimport type { Style } from \"@/registry/themes\";\n\nexport interface KeepTogetherProps {\n children?: ReactNode;\n minPresenceAhead?: number;\n style?: Style;\n}\n\nexport function KeepTogether({ children, style }: KeepTogetherProps) {\n return (\n <View wrap={false} style={style as never}>\n {children}\n </View>\n );\n}\n",- "type": "registry:component"+ "content": "import { View } from \"@formepdf/react\";\nimport type { ReactNode } from \"react\";\n\nimport type { Style } from \"@/registry/themes\";\n\nexport interface KeepTogetherProps {\n children?: ReactNode;\n minPresenceAhead?: number;\n style?: Style;\n}\n\nexport const KeepTogether = ({ children, style }: KeepTogetherProps) => (\n <View wrap={false} style={style as never}>\n {children}\n </View>\n);\n",+ "type": "registry:component",+ "target": "components/pdf/components/keep-together/keep-together.tsx"},{"path": "registry/bases/forme/components/keep-together/index.ts","content": "export { KeepTogether, type KeepTogetherProps } from \"./keep-together\";\n",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/keep-together/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/key-value.json b/public/r/forme/key-value.jsonindex 28f0b9c..a06cfac 100644--- a/public/r/forme/key-value.json+++ b/public/r/forme/key-value.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/forme/components/key-value/key-value.tsx",- "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type KeyValueDirection = \"horizontal\" | \"vertical\";\nexport type KeyValueSize = \"sm\" | \"md\" | \"lg\";\n\n/**\n * A single key-value row with optional per-item color and style overrides.\n * Props - `key` | `value` | `valueColor` | `valueStyle` | `keyStyle`\n * @see {@link KeyValueEntry}\n */\nexport interface KeyValueEntry {\n key: string;\n value: string;\n valueColor?: string;\n valueStyle?: Style;\n keyStyle?: Style;\n}\n\n/**\n * List of key-value pairs with layout and style options.\n * Props - `items` | `direction` | `divided` | `size` | `labelFlex` | `labelColor` | `valueColor` | `boldValue` | `noWrap` | `dividerColor` | `dividerThickness` | `dividerMargin` | `style`\n * @see {@link KeyValueProps}\n */\nexport interface KeyValueProps extends Omit<PDFComponentProps, \"children\"> {\n items: KeyValueEntry[];\n /**\n * @default 'horizontal'\n */\n direction?: KeyValueDirection;\n /**\n * @default false\n */\n divided?: boolean;\n /**\n * @default 'md'\n */\n size?: KeyValueSize;\n /**\n * @default 1\n */\n labelFlex?: number;\n labelColor?: string;\n valueColor?: string;\n /**\n * @default false\n */\n boldValue?: boolean;\n /**\n * @default false\n */\n noWrap?: boolean;\n dividerColor?: string;\n dividerThickness?: number;\n dividerMargin?: number;\n}\n\nfunction createKeyValueStyles(t: PdfcnTheme) {\n const { spacing, fontWeights } = t.primitives;\n const c = t.colors;\n const { body } = t.typography;\n const keyBase = {\n color: c.mutedForeground,\n fontFamily: body.fontFamily,\n fontWeight: fontWeights.medium,\n };\n const valueBase = {\n color: c.foreground,\n fontFamily: body.fontFamily,\n fontWeight: fontWeights.regular,\n };\n return StyleSheet.create({\n container: { flexDirection: \"column\" },\n divider: {\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n },\n keyLg: { ...keyBase, fontSize: t.primitives.typography.base },\n keyMd: { ...keyBase, fontSize: body.fontSize },\n keySm: { ...keyBase, fontSize: t.primitives.typography.xs },\n rowHorizontal: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n paddingVertical: spacing[1],\n },\n rowVertical: {\n flexDirection: \"column\",\n marginBottom: t.spacing.paragraphGap,\n },\n valueBold: { fontWeight: fontWeights.bold },\n valueLg: { ...valueBase, fontSize: t.primitives.typography.base },\n valueMd: { ...valueBase, fontSize: body.fontSize },\n valueSm: { ...valueBase, fontSize: t.primitives.typography.xs },\n });\n}\n\nexport function KeyValue({\n items,\n direction = \"horizontal\",\n divided = false,\n size = \"md\",\n labelFlex = 1,\n labelColor,\n valueColor,\n boldValue = false,\n noWrap = false,\n dividerColor,\n dividerThickness,\n dividerMargin,\n style,\n}: KeyValueProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createKeyValueStyles(theme), [theme]);\n const keyStyleMap = {\n lg: styles.keyLg,\n md: styles.keyMd,\n sm: styles.keySm,\n } as Record<KeyValueSize, Style>;\n const valueStyleMap = {\n lg: styles.valueLg,\n md: styles.valueMd,\n sm: styles.valueSm,\n } as Record<KeyValueSize, Style>;\n const containerStyles: Style[] = [styles.container];\n if (style) {containerStyles.push(...[style].flat());}\n\n return (\n <View wrap={!noWrap} style={containerStyles as never}>\n {items.map((item, index) => {\n const isLast = index === items.length - 1;\n const keyStyles: Style[] = [keyStyleMap[size]];\n if (labelColor)\n {keyStyles.push({ color: resolveColor(labelColor, theme.colors) });}\n if (item.keyStyle) {keyStyles.push(item.keyStyle);}\n const valStyles: Style[] = [valueStyleMap[size]];\n if (boldValue) {valStyles.push(styles.valueBold);}\n const resolvedValueColor = item.valueColor ?? valueColor;\n if (resolvedValueColor)\n {valStyles.push({\n color: resolveColor(resolvedValueColor, theme.colors),\n });}\n if (item.valueStyle) {valStyles.push(item.valueStyle);}\n\n if (direction === \"horizontal\") {\n const rowStyles: Style[] = [styles.rowHorizontal];\n if (divided && !isLast) {\n const dividerStyle: Style = {};\n if (dividerColor)\n {dividerStyle.borderBottomColor = resolveColor(\n dividerColor,\n theme.colors\n );}\n if (dividerThickness)\n {dividerStyle.borderBottomWidth = dividerThickness;}\n if (dividerMargin) {dividerStyle.marginBottom = dividerMargin;}\n rowStyles.push({ ...styles.divider, ...dividerStyle });\n }\n return (\n <View key={item.key} style={rowStyles as never}>\n <PDFText style={[...keyStyles, { flex: labelFlex }] as never}>\n {item.key}\n </PDFText>\n <PDFText\n style={[...valStyles, { flex: 1, textAlign: \"right\" }] as never}\n >\n {item.value}\n </PDFText>\n </View>\n );\n }\n\n const rowStyles: Style[] = [styles.rowVertical];\n if (divided && !isLast) {rowStyles.push(styles.divider);}\n return (\n <View key={item.key} style={rowStyles as never}>\n <PDFText style={keyStyles as never}>{item.key}</PDFText>\n <PDFText style={valStyles as never}>{item.value}</PDFText>\n </View>\n );\n })}\n </View>\n );\n}\n",- "type": "registry:component"+ "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type KeyValueDirection = \"horizontal\" | \"vertical\";\nexport type KeyValueSize = \"sm\" | \"md\" | \"lg\";\n\n/**\n * A single key-value row with optional per-item color and style overrides.\n * Props - `key` | `value` | `valueColor` | `valueStyle` | `keyStyle`\n * @see {@link KeyValueEntry}\n */\nexport interface KeyValueEntry {\n key: string;\n value: string;\n valueColor?: string;\n valueStyle?: Style;\n keyStyle?: Style;\n}\n\n/**\n * List of key-value pairs with layout and style options.\n * Props - `items` | `direction` | `divided` | `size` | `labelFlex` | `labelColor` | `valueColor` | `boldValue` | `noWrap` | `dividerColor` | `dividerThickness` | `dividerMargin` | `style`\n * @see {@link KeyValueProps}\n */\nexport interface KeyValueProps extends Omit<PDFComponentProps, \"children\"> {\n items: KeyValueEntry[];\n /**\n * @default 'horizontal'\n */\n direction?: KeyValueDirection;\n /**\n * @default false\n */\n divided?: boolean;\n /**\n * @default 'md'\n */\n size?: KeyValueSize;\n /**\n * @default 1\n */\n labelFlex?: number;\n labelColor?: string;\n valueColor?: string;\n /**\n * @default false\n */\n boldValue?: boolean;\n /**\n * @default false\n */\n noWrap?: boolean;\n dividerColor?: string;\n dividerThickness?: number;\n dividerMargin?: number;\n}\n\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 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 && !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 as never}>\n <PDFText style={[...keyStyles, { flex: labelFlex }] as never}>\n {item.key}\n </PDFText>\n <PDFText\n style={[...valStyles, { flex: 1, textAlign: \"right\" }] as never}\n >\n {item.value}\n </PDFText>\n </View>\n );\n }\n\n const rowStyles: Style[] = [styles.rowVertical];\n if (divided && !isLast) {\n rowStyles.push(styles.divider);\n }\n return (\n <View key={item.key} style={rowStyles as never}>\n <PDFText style={keyStyles as never}>{item.key}</PDFText>\n <PDFText style={valStyles as never}>{item.value}</PDFText>\n </View>\n );\n })}\n </View>\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/key-value/key-value.tsx"},{"path": "registry/bases/forme/components/key-value/index.ts","content": "export {\n KeyValue,\n type KeyValueProps,\n type KeyValueEntry,\n type KeyValueDirection,\n type KeyValueSize,\n} from \"./key-value\";\n",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/key-value/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/link.json b/public/r/forme/link.jsonindex e4ac1fc..6cba25a 100644--- a/public/r/forme/link.json+++ b/public/r/forme/link.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/forme/components/link/link.tsx",- "content": "import { Link as PDFLink, StyleSheet } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type LinkVariant = \"default\" | \"muted\" | \"primary\";\nexport type LinkUnderline = \"always\" | \"none\";\n\n/**\n * Clickable hyperlink for PDF documents.\n * Props - `href` | `children` | `align` | `color` | `variant` | `underline` | `style`\n * @see {@link LinkProps}\n */\nexport interface LinkProps extends PDFComponentProps {\n href: string;\n /**\n * @default 'left'\n */\n align?: \"left\" | \"center\" | \"right\";\n color?: string;\n /**\n * @default 'default'\n */\n variant?: LinkVariant;\n /**\n * @default 'always'\n */\n underline?: LinkUnderline;\n}\n\nfunction createLinkStyles(t: PdfcnTheme) {\n const { fontWeights } = t.primitives;\n const base = {\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n lineHeight: t.typography.body.lineHeight,\n marginBottom: t.spacing.paragraphGap,\n };\n return StyleSheet.create({\n default: {\n ...base,\n color: t.colors.accent,\n fontWeight: fontWeights.medium,\n textDecoration: \"underline\",\n },\n muted: {\n ...base,\n color: t.colors.mutedForeground,\n fontWeight: fontWeights.regular,\n textDecoration: \"underline\",\n },\n primary: {\n ...base,\n color: t.colors.primary,\n fontWeight: fontWeights.semibold,\n textDecoration: \"underline\",\n },\n underlineAlways: { textDecoration: \"underline\" },\n underlineNone: { textDecoration: \"none\" },\n });\n}\n\nexport function Link({\n href,\n align,\n color,\n variant = \"default\",\n underline,\n children,\n style,\n}: LinkProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createLinkStyles(theme), [theme]);\n const variantMap = {\n default: styles.default,\n muted: styles.muted,\n primary: styles.primary,\n };\n const underlineMap = {\n always: styles.underlineAlways,\n none: styles.underlineNone,\n };\n const styleArray: Style[] = [variantMap[variant]];\n if (underline && underline in underlineMap)\n {styleArray.push(underlineMap[underline]);}\n const semantic = {} as Style;\n if (align) {semantic.textAlign = align;}\n if (color) {semantic.color = resolveColor(color, theme.colors);}\n if (Object.keys(semantic).length > 0) {styleArray.push(semantic);}\n if (style) {styleArray.push(...[style].flat());}\n return (\n <PDFLink href={href} style={styleArray as never}>\n {children}\n </PDFLink>\n );\n}\n",- "type": "registry:component"+ "content": "import { Link as PDFLink, StyleSheet } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type LinkVariant = \"default\" | \"muted\" | \"primary\";\nexport type LinkUnderline = \"always\" | \"none\";\n\n/**\n * Clickable hyperlink for PDF documents.\n * Props - `href` | `children` | `align` | `color` | `variant` | `underline` | `style`\n * @see {@link LinkProps}\n */\nexport interface LinkProps extends PDFComponentProps {\n href: string;\n /**\n * @default 'left'\n */\n align?: \"left\" | \"center\" | \"right\";\n color?: string;\n /**\n * @default 'default'\n */\n variant?: LinkVariant;\n /**\n * @default 'always'\n */\n underline?: LinkUnderline;\n}\n\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 href={href} style={styleArray as never}>\n {children}\n </PDFLink>\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/link/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/list.json b/public/r/forme/list.jsonindex b8148ee..482ee76 100644--- a/public/r/forme/list.json+++ b/public/r/forme/list.json@@ -13,23 +13,27 @@"files": [{"path": "registry/bases/forme/components/list/list.styles.ts",- "content": "import { StyleSheet } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\n/**\n * Creates all list styles derived from the active theme.\n * @param t - The resolved PdfcnTheme instance.\n */\nexport function createListStyles(t: PdfcnTheme) {\n const { borderRadius, spacing, fontWeights, typography } = t.primitives;\n\n return StyleSheet.create({\n checkBox: {\n alignItems: \"center\",\n backgroundColor: t.colors.background,\n borderColor: t.colors.border,\n borderRadius: 3,\n borderStyle: \"solid\",\n borderWidth: 1.5,\n height: spacing[4],\n justifyContent: \"center\",\n marginRight: spacing[2],\n width: spacing[4],\n },\n checkBoxChecked: {\n backgroundColor: t.colors.success,\n borderColor: t.colors.success,\n },\n checkMark: {\n color: t.colors.background,\n fontFamily: t.typography.body.fontFamily,\n fontSize: 8,\n fontWeight: fontWeights.bold,\n },\n childrenContainer: {\n display: \"flex\",\n flexDirection: \"column\",\n marginLeft: spacing[5],\n marginTop: spacing[1],\n },\n container: {\n display: \"flex\",\n flexDirection: \"column\",\n marginBottom: t.spacing.componentGap,\n width: \"100%\",\n },\n descriptiveAccent: {\n backgroundColor: t.colors.primary,\n borderRadius: borderRadius.sm,\n marginRight: spacing[3],\n minHeight: spacing[4],\n width: 3,\n },\n descriptiveContent: {\n flex: 1,\n },\n descriptiveDesc: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n lineHeight: t.typography.body.lineHeight,\n marginTop: 1,\n },\n descriptiveTitle: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: t.typography.body.lineHeight,\n },\n iconBox: {\n alignItems: \"center\",\n backgroundColor: t.colors.primary,\n borderRadius: borderRadius.md,\n height: spacing[5],\n justifyContent: \"center\",\n marginRight: spacing[2],\n width: spacing[5],\n },\n iconMark: {\n color: t.colors.primaryForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: 9,\n fontWeight: fontWeights.bold,\n },\n itemRow: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n },\n itemRowCenter: {\n alignItems: \"center\",\n flexDirection: \"row\",\n },\n itemRowGapMd: { marginBottom: spacing[3] },\n itemRowGapSm: { marginBottom: spacing[2] },\n itemRowGapXs: { marginBottom: spacing[1] },\n itemText: {\n // No flex here — Text nodes with flex shorthand get flexBasis:0, which causes\n // Yoga to under-measure multi-line text height → overlapping rows.\n // flex:1 must live on the wrapping View, not on the Text itself.\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n lineHeight: t.typography.body.lineHeight,\n },\n itemTextBold: {\n fontWeight: fontWeights.semibold,\n },\n itemTextSub: {\n // Same: no flex — see itemText comment.\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize - 0.5,\n lineHeight: t.typography.body.lineHeight,\n },\n itemTextWrap: {\n // Companion to itemText / itemTextSub. Apply this to the View that wraps\n // the Text so flex expansion happens at the View level, not the Text level.\n flex: 1,\n },\n markerBulletDot: {\n backgroundColor: t.colors.primary,\n borderRadius: 3,\n height: 5,\n width: 5,\n },\n markerBulletSubDot: {\n backgroundColor: \"transparent\",\n borderColor: t.colors.mutedForeground,\n borderRadius: 2,\n borderStyle: \"solid\",\n borderWidth: 1,\n height: 4,\n width: 4,\n },\n markerBulletSubWrap: {\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n marginTop: spacing[1],\n width: spacing[4],\n },\n markerBulletWrap: {\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n marginTop: spacing[1],\n width: spacing[4],\n },\n markerNumberBadge: {\n alignItems: \"center\",\n backgroundColor: t.colors.primary,\n borderRadius: spacing[5],\n height: spacing[5],\n justifyContent: \"center\",\n marginRight: spacing[2],\n width: spacing[5],\n },\n markerNumberText: {\n color: t.colors.primaryForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.bold,\n },\n });\n}\n",- "type": "registry:component"+ "content": "import { StyleSheet } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\n/**\n * Creates all list styles derived from the active theme.\n * @param t - The resolved PdfcnTheme instance.\n */\nexport 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 checkMark: {\n color: t.colors.background,\n fontFamily: t.typography.body.fontFamily,\n fontSize: 8,\n fontWeight: fontWeights.bold,\n },\n childrenContainer: {\n display: \"flex\",\n flexDirection: \"column\",\n marginLeft: spacing[5],\n marginTop: spacing[1],\n },\n container: {\n display: \"flex\",\n flexDirection: \"column\",\n marginBottom: t.spacing.componentGap,\n width: \"100%\",\n },\n descriptiveAccent: {\n backgroundColor: t.colors.primary,\n borderRadius: borderRadius.sm,\n marginRight: spacing[3],\n minHeight: spacing[4],\n width: 3,\n },\n descriptiveContent: {\n flex: 1,\n },\n descriptiveDesc: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n lineHeight: t.typography.body.lineHeight,\n marginTop: 1,\n },\n descriptiveTitle: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: t.typography.body.lineHeight,\n },\n iconBox: {\n alignItems: \"center\",\n backgroundColor: t.colors.primary,\n borderRadius: borderRadius.md,\n height: spacing[5],\n justifyContent: \"center\",\n marginRight: spacing[2],\n width: spacing[5],\n },\n iconMark: {\n color: t.colors.primaryForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: 9,\n fontWeight: fontWeights.bold,\n },\n itemRow: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n },\n itemRowCenter: {\n alignItems: \"center\",\n flexDirection: \"row\",\n },\n itemRowGapMd: { marginBottom: spacing[3] },\n itemRowGapSm: { marginBottom: spacing[2] },\n itemRowGapXs: { marginBottom: spacing[1] },\n itemText: {\n // No flex here — Text nodes with flex shorthand get flexBasis:0, which causes\n // Yoga to under-measure multi-line text height → overlapping rows.\n // flex:1 must live on the wrapping View, not on the Text itself.\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n lineHeight: t.typography.body.lineHeight,\n },\n itemTextBold: {\n fontWeight: fontWeights.semibold,\n },\n itemTextSub: {\n // Same: no flex — see itemText comment.\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize - 0.5,\n lineHeight: t.typography.body.lineHeight,\n },\n itemTextWrap: {\n // Companion to itemText / itemTextSub. Apply this to the View that wraps\n // the Text so flex expansion happens at the View level, not the Text level.\n flex: 1,\n },\n markerBulletDot: {\n backgroundColor: t.colors.primary,\n borderRadius: 3,\n height: 5,\n width: 5,\n },\n markerBulletSubDot: {\n backgroundColor: \"transparent\",\n borderColor: t.colors.mutedForeground,\n borderRadius: 2,\n borderStyle: \"solid\",\n borderWidth: 1,\n height: 4,\n width: 4,\n },\n markerBulletSubWrap: {\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n marginTop: spacing[1],\n width: spacing[4],\n },\n markerBulletWrap: {\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n marginTop: spacing[1],\n width: spacing[4],\n },\n markerNumberBadge: {\n alignItems: \"center\",\n backgroundColor: t.colors.primary,\n borderRadius: spacing[5],\n height: spacing[5],\n justifyContent: \"center\",\n marginRight: spacing[2],\n width: spacing[5],\n },\n markerNumberText: {\n color: t.colors.primaryForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.bold,\n },\n });\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/list/list.styles.ts"},{"path": "registry/bases/forme/components/list/list.tsx",- "content": "import { Text as PDFText, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport type React from 'react';\nimport { usePdfcnTheme, useSafeMemo } from '../../lib/pdfcn-theme-context';\nimport { createListStyles } from './list.styles';\nimport type { ListItem, ListVariant, PdfListProps } from './list.types';\n\ntype Styles = ReturnType<typeof createListStyles>;\ntype GapProp = 'xs' | 'sm' | 'md';\n\nfunction getGapStyle(gap: GapProp, styles: Styles): Style {\n if (gap === 'xs') return styles.itemRowGapXs;\n if (gap === 'md') return styles.itemRowGapMd;\n return styles.itemRowGapSm;\n}\n\nfunction buildRowStyles(\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles,\n align: 'start' | 'center' = 'start'\n): Style[] {\n const row: Style[] = [align === 'center' ? styles.itemRowCenter : styles.itemRow];\n if (index !== total - 1) row.push(getGapStyle(gap, styles));\n return row;\n}\n\n/** Bullet dot marker — solid filled for level 0, outline ring for nested levels. */\nfunction dotMarker(level: number, styles: Styles): React.ReactElement {\n return level === 0 ? (\n <View style={styles.markerBulletWrap}>\n <View style={styles.markerBulletDot} />\n </View>\n ) : (\n <View style={styles.markerBulletSubWrap}>\n <View style={styles.markerBulletSubDot} />\n </View>\n );\n}\n\nfunction renderBulletItem(\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles,\n level: number\n): React.ReactElement {\n return (\n <View key={index}>\n <View style={buildRowStyles(index, total, gap, styles) as never}>\n {dotMarker(level, styles)}\n {/* flex:1 on the View, NOT on the Text — avoids Yoga height underestimation\n for multi-line Text nodes that would cause overlapping rows. */}\n <View style={styles.itemTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n {item.children && item.children.length > 0\n ? renderItemList(item.children, 'bullet', gap, styles, level + 1)\n : null}\n </View>\n );\n}\n\nfunction renderNumberedItem(\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement {\n return (\n <View key={index} style={buildRowStyles(index, total, gap, styles, 'center') as never}>\n <View style={styles.markerNumberBadge}>\n <PDFText style={styles.markerNumberText}>{`${index + 1}`}</PDFText>\n </View>\n <View style={styles.itemTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n );\n}\n\nfunction renderChecklistItem(\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement {\n const isChecked = item.checked ?? true;\n return (\n <View key={index} style={buildRowStyles(index, total, gap, styles, 'center') as never}>\n <View style={[styles.checkBox, isChecked ? styles.checkBoxChecked : {}] as never}>\n {isChecked ? <PDFText style={styles.checkMark}>✓</PDFText> : null}\n </View>\n <View style={styles.itemTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n );\n}\n\nfunction renderIconItem(\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement {\n return (\n <View key={index} style={buildRowStyles(index, total, gap, styles, 'center') as never}>\n <View style={styles.iconBox}>\n <PDFText style={styles.iconMark}>★</PDFText>\n </View>\n <View style={styles.itemTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n );\n}\n\nfunction renderMultiLevelItem(\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles,\n level: number\n): React.ReactElement {\n return (\n <View key={index}>\n <View style={buildRowStyles(index, total, gap, styles) as never}>\n {dotMarker(level, styles)}\n <View style={styles.itemTextWrap}>\n <PDFText\n style={[\n level === 0 ? styles.itemText : styles.itemTextSub,\n level === 0 ? styles.itemTextBold : {},\n ] as never}\n >\n {item.text}\n </PDFText>\n </View>\n </View>\n {item.children && item.children.length > 0\n ? renderItemList(item.children, 'multi-level', gap, styles, level + 1)\n : null}\n </View>\n );\n}\n\nfunction renderDescriptiveItem(\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement {\n return (\n <View key={index} style={buildRowStyles(index, total, gap, styles) as never}>\n <View style={styles.descriptiveAccent} />\n <View style={styles.descriptiveContent}>\n <PDFText style={styles.descriptiveTitle}>{item.text}</PDFText>\n {item.description ? (\n <PDFText style={styles.descriptiveDesc}>{item.description}</PDFText>\n ) : null}\n </View>\n </View>\n );\n}\n\nfunction renderItem(\n item: ListItem,\n index: number,\n total: number,\n variant: ListVariant,\n gap: GapProp,\n styles: Styles,\n level: number\n): React.ReactElement | null {\n switch (variant) {\n case 'bullet':\n return renderBulletItem(item, index, total, gap, styles, level);\n case 'numbered':\n return renderNumberedItem(item, index, total, gap, styles);\n case 'checklist':\n return renderChecklistItem(item, index, total, gap, styles);\n case 'icon':\n return renderIconItem(item, index, total, gap, styles);\n case 'multi-level':\n return renderMultiLevelItem(item, index, total, gap, styles, level);\n case 'descriptive':\n return renderDescriptiveItem(item, index, total, gap, styles);\n }\n}\n\nfunction renderItemList(\n items: ListItem[],\n variant: ListVariant,\n gap: GapProp,\n styles: Styles,\n level: number\n): React.ReactElement {\n return (\n <View style={level > 0 ? styles.childrenContainer : undefined}>\n {items.map((item, index) =>\n renderItem(item, index, items.length, variant, gap, styles, level)\n )}\n </View>\n );\n}\n\nexport function PdfList({\n items,\n variant = 'bullet',\n gap = 'sm',\n style,\n noWrap = false,\n _level = 0,\n}: PdfListProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createListStyles(theme), [theme]);\n\n const containerStyles: Style[] = [styles.container];\n if (_level > 0) containerStyles.push(styles.childrenContainer);\n const styleArray = style ? [...containerStyles, style] : containerStyles;\n\n return (\n <View style={styleArray as never}>\n {items.map((item, index) =>\n renderItem(item, index, items.length, variant, gap, styles, _level)\n )}\n </View>\n );\n}\n",- "type": "registry:component"+ "content": "import { Text as PDFText, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport type React from \"react\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { createListStyles } from \"./list.styles\";\nimport type { ListItem, ListVariant, PdfListProps } from \"./list.types\";\n\ntype Styles = ReturnType<typeof createListStyles>;\ntype GapProp = \"xs\" | \"sm\" | \"md\";\n\nconst getGapStyle = (gap: GapProp, styles: Styles): Style => {\n if (gap === \"xs\") {\n return styles.itemRowGapXs;\n }\n if (gap === \"md\") {\n return styles.itemRowGapMd;\n }\n return styles.itemRowGapSm;\n};\n\nconst buildRowStyles = (\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles,\n align: \"start\" | \"center\" = \"start\"\n): Style[] => {\n const row: Style[] = [\n align === \"center\" ? styles.itemRowCenter : styles.itemRow,\n ];\n if (index !== total - 1) {\n row.push(getGapStyle(gap, styles));\n }\n return row;\n};\n\n/** Bullet dot marker — solid filled for level 0, outline ring for nested levels. */\nconst dotMarker = (level: number, styles: Styles): React.ReactElement =>\n level === 0 ? (\n <View style={styles.markerBulletWrap}>\n <View style={styles.markerBulletDot} />\n </View>\n ) : (\n <View style={styles.markerBulletSubWrap}>\n <View style={styles.markerBulletSubDot} />\n </View>\n );\n\n// eslint-disable-next-line no-use-before-define, prefer-const\nlet renderBulletItem: (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles,\n level: number\n) => React.ReactElement;\n// eslint-disable-next-line no-use-before-define, prefer-const\nlet renderMultiLevelItem: (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles,\n level: number\n) => React.ReactElement;\n\nconst renderNumberedItem = (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement => (\n <View\n key={index}\n style={buildRowStyles(index, total, gap, styles, \"center\") as never}\n >\n <View style={styles.markerNumberBadge}>\n <PDFText style={styles.markerNumberText}>{`${index + 1}`}</PDFText>\n </View>\n <View style={styles.itemTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n);\n\nconst renderChecklistItem = (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement => {\n const isChecked = item.checked ?? true;\n return (\n <View\n key={index}\n style={buildRowStyles(index, total, gap, styles, \"center\") as never}\n >\n <View\n style={\n [styles.checkBox, isChecked ? styles.checkBoxChecked : {}] as never\n }\n >\n {isChecked ? <PDFText style={styles.checkMark}>✓</PDFText> : null}\n </View>\n <View style={styles.itemTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n );\n};\n\nconst renderIconItem = (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement => (\n <View\n key={index}\n style={buildRowStyles(index, total, gap, styles, \"center\") as never}\n >\n <View style={styles.iconBox}>\n <PDFText style={styles.iconMark}>★</PDFText>\n </View>\n <View style={styles.itemTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n);\n\nconst renderDescriptiveItem = (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement => (\n <View key={index} style={buildRowStyles(index, total, gap, styles) as never}>\n <View style={styles.descriptiveAccent} />\n <View style={styles.descriptiveContent}>\n <PDFText style={styles.descriptiveTitle}>{item.text}</PDFText>\n {item.description ? (\n <PDFText style={styles.descriptiveDesc}>{item.description}</PDFText>\n ) : null}\n </View>\n </View>\n);\n\nconst renderItem = (\n item: ListItem,\n index: number,\n total: number,\n variant: ListVariant,\n gap: GapProp,\n styles: Styles,\n level: number\n): React.ReactElement | null => {\n switch (variant) {\n case \"bullet\": {\n return renderBulletItem(item, index, total, gap, styles, level);\n }\n case \"numbered\": {\n return renderNumberedItem(item, index, total, gap, styles);\n }\n case \"checklist\": {\n return renderChecklistItem(item, index, total, gap, styles);\n }\n case \"icon\": {\n return renderIconItem(item, index, total, gap, styles);\n }\n case \"multi-level\": {\n return renderMultiLevelItem(item, index, total, gap, styles, level);\n }\n case \"descriptive\": {\n return renderDescriptiveItem(item, index, total, gap, styles);\n }\n default: {\n break;\n }\n }\n return null;\n};\n\nconst renderItemList = (\n items: ListItem[],\n variant: ListVariant,\n gap: GapProp,\n styles: Styles,\n level: number\n): React.ReactElement => (\n <View style={level > 0 ? styles.childrenContainer : undefined}>\n {items.map((item, index) =>\n renderItem(item, index, items.length, variant, gap, styles, level)\n )}\n </View>\n);\n\nrenderBulletItem = (item, index, total, gap, styles, level) => (\n <View key={index}>\n <View style={buildRowStyles(index, total, gap, styles) as never}>\n {dotMarker(level, styles)}\n <View style={styles.itemTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n {item.children && item.children.length > 0\n ? renderItemList(item.children, \"bullet\", gap, styles, level + 1)\n : null}\n </View>\n);\n\nrenderMultiLevelItem = (item, index, total, gap, styles, level) => (\n <View key={index}>\n <View style={buildRowStyles(index, total, gap, styles) as never}>\n {dotMarker(level, styles)}\n <View style={styles.itemTextWrap}>\n <PDFText\n style={\n [\n level === 0 ? styles.itemText : styles.itemTextSub,\n level === 0 ? styles.itemTextBold : {},\n ] as never\n }\n >\n {item.text}\n </PDFText>\n </View>\n </View>\n {item.children && item.children.length > 0\n ? renderItemList(item.children, \"multi-level\", gap, styles, level + 1)\n : null}\n </View>\n);\n\nexport const PdfList = ({\n items,\n variant = \"bullet\",\n gap = \"sm\",\n style,\n _level = 0,\n}: PdfListProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createListStyles(theme), [theme]);\n\n const containerStyles: Style[] = [styles.container];\n if (_level > 0) {\n containerStyles.push(styles.childrenContainer);\n }\n const styleArray = style ? [...containerStyles, style] : containerStyles;\n\n return (\n <View style={styleArray as never}>\n {items.map((item, index) =>\n renderItem(item, index, items.length, variant, gap, styles, _level)\n )}\n </View>\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/list/list.tsx"},{"path": "registry/bases/forme/components/list/list.types.ts","content": "import type { Style } from \"@formepdf/react\";\n\n/** List visual style variant. */\nexport type ListVariant =\n | \"bullet\"\n | \"numbered\"\n | \"checklist\"\n | \"icon\"\n | \"multi-level\"\n | \"descriptive\";\n\n/**\n * A single list item, optionally with nested children.\n * Props - `text` | `description` | `checked` | `children`\n * @see {@link ListItem}\n */\nexport interface ListItem {\n text: string;\n description?: string;\n checked?: boolean;\n children?: ListItem[];\n}\n\n/**\n * List of items with multiple style variants including bullet, numbered, checklist, and descriptive.\n * Props - `items` | `variant` | `gap` | `style` | `_level` | `noWrap`\n * @see {@link PdfListProps}\n */\nexport interface PdfListProps {\n items: ListItem[];\n /**\n * @default 'bullet'\n */\n variant?: ListVariant;\n /**\n * @default 'sm'\n */\n gap?: \"xs\" | \"sm\" | \"md\";\n style?: Style;\n _level?: number;\n /**\n * @default false\n */\n noWrap?: boolean;\n}\n",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/list/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/page-break.json b/public/r/forme/page-break.jsonindex 2226ab4..453e521 100644--- a/public/r/forme/page-break.json+++ b/public/r/forme/page-break.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/forme/components/page-break/page-break.tsx",- "content": "import { PageBreak as FormePageBreak } from \"@formepdf/react\";\n\nimport type { PDFComponentProps } from \"@/registry/themes\";\n\nexport interface PageBreakProps extends Omit<PDFComponentProps, \"children\"> {\n children?: never;\n}\n\nexport function PageBreak(_props: PageBreakProps) {\n return <FormePageBreak />;\n}\n",- "type": "registry:component"+ "content": "import { PageBreak as FormePageBreak } from \"@formepdf/react\";\n\nimport type { PDFComponentProps } from \"@/registry/themes\";\n\nexport interface PageBreakProps extends Omit<PDFComponentProps, \"children\"> {\n children?: never;\n}\n\nexport const PageBreak = (_props: PageBreakProps) => <FormePageBreak />;\n",+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/page-break/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/page-footer.json b/public/r/forme/page-footer.jsonindex f2ec06a..4933e4a 100644--- a/public/r/forme/page-footer.json+++ b/public/r/forme/page-footer.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/forme/components/page-footer/page-footer.tsx",- "content": "import { Text as PDFText, StyleSheet, View, Fixed } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport type React from \"react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nfunction wrapFixed(fixed: boolean | undefined, node: React.ReactElement) {\n if (!fixed) {return node;}\n return <Fixed position=\"footer\">{node}</Fixed>;\n}\nexport type PageFooterVariant =\n | \"simple\"\n | \"centered\"\n | \"branded\"\n | \"minimal\"\n | \"three-column\"\n | \"detailed\";\n\n/**\n * Footer row with layout variants, optional sticky or fixed positioning, and contact info support.\n * Props - `leftText` | `rightText` | `centerText` | `variant` | `background` | `textColor` | `marginTop` | `address` | `phone` | `email` | `website` | `fixed` | `sticky` | `pagePadding` | `noWrap` | `style`\n * @see {@link PageFooterProps}\n */\nexport interface PageFooterProps extends Omit<PDFComponentProps, \"children\"> {\n leftText?: string;\n rightText?: string;\n centerText?: string;\n /**\n * @default 'simple'\n */\n variant?: PageFooterVariant;\n background?: string;\n textColor?: string;\n marginTop?: number;\n address?: string;\n phone?: string;\n email?: string;\n website?: string;\n /**\n * @default false\n */\n fixed?: boolean;\n /**\n * @default false\n */\n sticky?: boolean;\n /**\n * @default 0\n */\n pagePadding?: number;\n /**\n * @default true\n */\n noWrap?: boolean;\n}\n\nfunction createPageFooterStyles(t: PdfcnTheme) {\n const { spacing, fontWeights } = t.primitives;\n const c = t.colors;\n const { body } = t.typography;\n\n const textBase = {\n color: c.mutedForeground,\n fontFamily: body.fontFamily,\n fontSize: t.primitives.typography.xs,\n lineHeight: body.lineHeight,\n };\n\n return StyleSheet.create({\n brandedContainer: {\n alignItems: \"center\",\n backgroundColor: c.primary,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingHorizontal: spacing[4],\n paddingVertical: spacing[3],\n },\n\n centeredContainer: {\n alignItems: \"center\",\n borderTopColor: c.border,\n borderTopStyle: \"solid\",\n borderTopWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"column\",\n paddingTop: spacing[3],\n },\n\n companyBold: {\n ...textBase,\n color: c.foreground,\n fontWeight: fontWeights.bold,\n },\n\n companyName: {\n ...textBase,\n color: c.foreground,\n fontWeight: fontWeights.medium,\n },\n\n contactInfoCenter: {\n ...textBase,\n fontSize: t.primitives.typography.xs - 1,\n marginTop: spacing[0.5],\n textAlign: \"center\",\n },\n detailedContainer: {\n borderTopColor: c.border,\n borderTopStyle: \"solid\",\n borderTopWidth: spacing[1],\n display: \"flex\",\n flexDirection: \"column\",\n paddingTop: spacing[3],\n },\n detailedLeft: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n detailedPageNumber: {\n ...textBase,\n borderTopColor: c.border,\n borderTopStyle: \"solid\",\n borderTopWidth: spacing[0.5],\n paddingTop: spacing[2],\n textAlign: \"center\",\n },\n detailedRight: {\n alignItems: \"flex-end\",\n display: \"flex\",\n flexDirection: \"column\",\n },\n detailedTopRow: {\n alignItems: \"flex-start\",\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: spacing[2],\n },\n\n minimalContainer: {\n alignItems: \"center\",\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingBottom: spacing[1],\n paddingTop: spacing[1],\n },\n simpleContainer: {\n alignItems: \"center\",\n borderTopColor: c.border,\n borderTopStyle: \"solid\",\n borderTopWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingTop: spacing[3],\n },\n textBranded: {\n ...textBase,\n color: c.primaryForeground,\n fontWeight: fontWeights.medium,\n },\n textBrandedRight: {\n ...textBase,\n color: c.primaryForeground,\n textAlign: \"right\",\n },\n textCenter: {\n ...textBase,\n flex: 1,\n textAlign: \"center\",\n },\n textCenteredVariant: {\n ...textBase,\n marginBottom: spacing[1],\n textAlign: \"center\",\n },\n\n textLeft: {\n ...textBase,\n flex: 1,\n },\n textRight: {\n ...textBase,\n textAlign: \"right\",\n },\n threeColumnCenter: {\n alignItems: \"center\",\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n threeColumnContainer: {\n alignItems: \"flex-start\",\n borderTopColor: c.border,\n borderTopStyle: \"solid\",\n borderTopWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingTop: spacing[3],\n },\n threeColumnLeft: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n threeColumnRight: {\n alignItems: \"flex-end\",\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n });\n}\n\nexport function PageFooter({\n leftText,\n rightText,\n centerText,\n variant = \"simple\",\n background,\n textColor,\n marginTop,\n address,\n phone,\n email,\n website,\n fixed = false,\n sticky = false,\n pagePadding = 0,\n noWrap = true,\n style,\n}: PageFooterProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createPageFooterStyles(theme), [theme]);\n // sticky implies fixed; marginTop is irrelevant with absolute positioning\n const isFixed = fixed || sticky;\n const mt = sticky ? 0 : (marginTop ?? theme.spacing.sectionGap);\n const resolvedTextColor = textColor\n ? resolveColor(textColor, theme.colors)\n : undefined;\n const stickyStyle: Style = sticky\n ? {\n bottom: pagePadding,\n left: pagePadding,\n position: \"absolute\",\n right: pagePadding,\n }\n : {};\n\n function applyOverrides(base: Style[]): Style[] {\n if (background)\n {base.push({ backgroundColor: resolveColor(background, theme.colors) });}\n if (style) {base.push(style);}\n if (sticky) {base.push(stickyStyle);}\n return base;\n }\n\n if (variant === \"branded\") {\n const containerStyles = applyOverrides([\n styles.brandedContainer,\n { marginTop: mt },\n ]);\n\n const lStyle: Style[] = [styles.textBranded];\n const rStyle: Style[] = [styles.textBrandedRight];\n if (resolvedTextColor) {\n lStyle.push({ color: resolvedTextColor });\n rStyle.push({ color: resolvedTextColor });\n }\n\n return wrapFixed(\n isFixed,\n <View wrap={!noWrap} style={containerStyles as never}>\n {leftText && <PDFText style={lStyle as never}>{leftText}</PDFText>}\n {rightText && <PDFText style={rStyle as never}>{rightText}</PDFText>}\n </View>\n );\n }\n\n if (variant === \"centered\") {\n const containerStyles = applyOverrides([\n styles.centeredContainer,\n { marginTop: mt },\n ]);\n\n const tStyle: Style[] = [styles.textCenteredVariant];\n if (resolvedTextColor) {tStyle.push({ color: resolvedTextColor });}\n\n return wrapFixed(\n isFixed,\n <View wrap={!noWrap} style={containerStyles as never}>\n {leftText && <PDFText style={tStyle as never}>{leftText}</PDFText>}\n {rightText && <PDFText style={tStyle as never}>{rightText}</PDFText>}\n </View>\n );\n }\n\n if (variant === \"three-column\") {\n const containerStyles = applyOverrides([\n styles.threeColumnContainer,\n { marginTop: mt },\n ]);\n\n const leftStyle: Style[] = [styles.companyName];\n const centerStyle: Style[] = [styles.contactInfoCenter];\n const rightStyle: Style[] = [styles.textRight];\n if (resolvedTextColor) {\n leftStyle.push({ color: resolvedTextColor });\n centerStyle.push({ color: resolvedTextColor });\n rightStyle.push({ color: resolvedTextColor });\n }\n\n return wrapFixed(\n isFixed,\n <View wrap={!noWrap} style={containerStyles as never}>\n <View style={styles.threeColumnLeft}>\n {leftText && <PDFText style={leftStyle as never}>{leftText}</PDFText>}\n {address && <PDFText style={styles.textLeft}>{address}</PDFText>}\n </View>\n <View style={styles.threeColumnCenter}>\n {phone && <PDFText style={centerStyle as never}>{phone}</PDFText>}\n {email && <PDFText style={centerStyle as never}>{email}</PDFText>}\n {website && <PDFText style={centerStyle as never}>{website}</PDFText>}\n </View>\n <View style={styles.threeColumnRight}>\n {rightText && <PDFText style={rightStyle as never}>{rightText}</PDFText>}\n </View>\n </View>\n );\n }\n\n if (variant === \"detailed\") {\n const containerStyles = applyOverrides([\n styles.detailedContainer,\n { marginTop: mt },\n ]);\n\n const companyStyle: Style[] = [styles.companyBold];\n const addrStyle: Style[] = [styles.textLeft];\n const contactStyle: Style[] = [styles.textRight];\n const pageNumStyle: Style[] = [styles.detailedPageNumber];\n if (resolvedTextColor) {\n companyStyle.push({ color: resolvedTextColor });\n addrStyle.push({ color: resolvedTextColor });\n contactStyle.push({ color: resolvedTextColor });\n pageNumStyle.push({ color: resolvedTextColor });\n }\n\n return wrapFixed(\n isFixed,\n <View wrap={!noWrap} style={containerStyles as never}>\n <View style={styles.detailedTopRow}>\n <View style={styles.detailedLeft}>\n {leftText && <PDFText style={companyStyle as never}>{leftText}</PDFText>}\n {address && <PDFText style={addrStyle as never}>{address}</PDFText>}\n </View>\n <View style={styles.detailedRight}>\n {phone && (\n <PDFText style={contactStyle as never}>{`Phone: ${phone}`}</PDFText>\n )}\n {email && (\n <PDFText style={contactStyle as never}>{`Email: ${email}`}</PDFText>\n )}\n {website && (\n <PDFText style={contactStyle as never}>{`Web: ${website}`}</PDFText>\n )}\n </View>\n </View>\n {rightText && <PDFText style={pageNumStyle as never}>{rightText}</PDFText>}\n </View>\n );\n }\n\n if (variant === \"minimal\") {\n const containerStyles = applyOverrides([\n styles.minimalContainer,\n { marginTop: mt },\n ]);\n\n const lStyle: Style[] = [styles.textLeft];\n const rStyle: Style[] = [styles.textRight];\n if (resolvedTextColor) {\n lStyle.push({ color: resolvedTextColor });\n rStyle.push({ color: resolvedTextColor });\n }\n\n return wrapFixed(\n isFixed,\n <View wrap={!noWrap} style={containerStyles as never}>\n {leftText && <PDFText style={lStyle as never}>{leftText}</PDFText>}\n {rightText && <PDFText style={rStyle as never}>{rightText}</PDFText>}\n </View>\n );\n }\n\n const containerStyles = applyOverrides([\n styles.simpleContainer,\n { marginTop: mt },\n ]);\n\n const lStyle: Style[] = [styles.textLeft];\n const cStyle: Style[] = [styles.textCenter];\n const rStyle: Style[] = [styles.textRight];\n if (resolvedTextColor) {\n lStyle.push({ color: resolvedTextColor });\n cStyle.push({ color: resolvedTextColor });\n rStyle.push({ color: resolvedTextColor });\n }\n\n return wrapFixed(\n isFixed,\n <View wrap={!noWrap} style={containerStyles as never}>\n {leftText && <PDFText style={lStyle as never}>{leftText}</PDFText>}\n {centerText && <PDFText style={cStyle as never}>{centerText}</PDFText>}\n {rightText && <PDFText style={rStyle as never}>{rightText}</PDFText>}\n </View>\n );\n}\n",- "type": "registry:component"+ "content": "import { Text as PDFText, StyleSheet, View, Fixed } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport type React from \"react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nconst wrapFixed = (fixed: boolean | undefined, node: React.ReactElement) => {\n if (!fixed) {\n return node;\n }\n return <Fixed position=\"footer\">{node}</Fixed>;\n};\nexport type PageFooterVariant =\n | \"simple\"\n | \"centered\"\n | \"branded\"\n | \"minimal\"\n | \"three-column\"\n | \"detailed\";\n\n/**\n * Footer row with layout variants, optional sticky or fixed positioning, and contact info support.\n * Props - `leftText` | `rightText` | `centerText` | `variant` | `background` | `textColor` | `marginTop` | `address` | `phone` | `email` | `website` | `fixed` | `sticky` | `pagePadding` | `noWrap` | `style`\n * @see {@link PageFooterProps}\n */\nexport interface PageFooterProps extends Omit<PDFComponentProps, \"children\"> {\n leftText?: string;\n rightText?: string;\n centerText?: string;\n /**\n * @default 'simple'\n */\n variant?: PageFooterVariant;\n background?: string;\n textColor?: string;\n marginTop?: number;\n address?: string;\n phone?: string;\n email?: string;\n website?: string;\n /**\n * @default false\n */\n fixed?: boolean;\n /**\n * @default false\n */\n sticky?: boolean;\n /**\n * @default 0\n */\n pagePadding?: number;\n /**\n * @default true\n */\n noWrap?: boolean;\n}\n\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 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 = 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 wrapFixed(_isFixed, variantRenderers[variant]() as React.ReactElement);\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/page-footer/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/page-header.json b/public/r/forme/page-header.jsonindex 2f837ca..393b073 100644--- a/public/r/forme/page-header.json+++ b/public/r/forme/page-header.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/forme/components/page-header/page-header.tsx",- "content": "import { Text as PDFText, StyleSheet, View, Fixed } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport type React from \"react\";\nimport type { ReactNode } from \"react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nfunction wrapFixed(fixed: boolean | undefined, node: React.ReactElement) {\n if (!fixed) {return node;}\n return <Fixed position=\"header\">{node}</Fixed>;\n}\nexport type PageHeaderVariant =\n | \"simple\"\n | \"centered\"\n | \"minimal\"\n | \"branded\"\n | \"logo-left\"\n | \"logo-right\"\n | \"two-column\";\n\n/**\n * Header row with layout variants, logo support, and optional fixed positioning.\n * Props - `title` | `subtitle` | `rightText` | `rightSubText` | `variant` | `background` | `titleColor` | `marginBottom` | `address` | `phone` | `email` | `logo` | `fixed` | `noWrap` | `style`\n * @see {@link PageHeaderProps}\n */\nexport interface PageHeaderProps extends Omit<PDFComponentProps, \"children\"> {\n title: string;\n subtitle?: string;\n rightText?: string;\n rightSubText?: string;\n /**\n * @default 'simple'\n */\n variant?: PageHeaderVariant;\n background?: string;\n titleColor?: string;\n marginBottom?: number;\n address?: string;\n phone?: string;\n email?: string;\n logo?: ReactNode;\n /**\n * @default false\n */\n fixed?: boolean;\n /**\n * @default true\n */\n noWrap?: boolean;\n}\n\nfunction createPageHeaderStyles(t: PdfcnTheme) {\n const { spacing, borderRadius, fontWeights } = t.primitives;\n const c = t.colors;\n const { heading, body } = t.typography;\n\n return StyleSheet.create({\n brandedContainer: {\n alignItems: \"center\",\n backgroundColor: c.primary,\n borderRadius: borderRadius.sm,\n display: \"flex\",\n flexDirection: \"column\",\n padding: spacing[6],\n },\n centeredContainer: {\n alignItems: \"center\",\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"column\",\n paddingBottom: spacing[4],\n },\n contactInfo: {\n color: c.mutedForeground,\n fontFamily: body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginTop: spacing[0.5],\n textAlign: \"right\",\n },\n\n logoContainer: {\n height: 48,\n marginRight: spacing[4],\n width: 48,\n },\n\n logoContent: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n logoLeftContainer: {\n alignItems: \"center\",\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n paddingBottom: spacing[4],\n },\n logoRightContainer: {\n alignItems: \"center\",\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingBottom: spacing[4],\n },\n\n logoRightContent: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n\n logoRightLogoContainer: {\n height: 48,\n marginLeft: spacing[4],\n width: 48,\n },\n minimalContainer: {\n alignItems: \"center\",\n borderBottomColor: c.primary,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[1],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingBottom: spacing[3],\n },\n minimalLeft: {\n flex: 1,\n },\n minimalRight: {\n alignItems: \"flex-end\",\n },\n\n rightSubText: {\n color: c.mutedForeground,\n fontFamily: body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginTop: spacing[1],\n textAlign: \"right\",\n },\n rightText: {\n color: c.foreground,\n fontFamily: body.fontFamily,\n fontSize: body.fontSize,\n fontWeight: fontWeights.medium,\n textAlign: \"right\",\n },\n simpleContainer: {\n alignItems: \"flex-start\",\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingBottom: spacing[4],\n },\n\n simpleLeft: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n simpleRight: {\n alignItems: \"flex-end\",\n display: \"flex\",\n flexDirection: \"column\",\n },\n\n subtitle: {\n color: c.mutedForeground,\n fontFamily: body.fontFamily,\n fontSize: body.fontSize,\n lineHeight: body.lineHeight,\n marginTop: spacing[1],\n },\n subtitleBranded: {\n color: c.primaryForeground,\n marginTop: spacing[1],\n },\n subtitleCentered: {\n textAlign: \"center\",\n },\n\n title: {\n color: c.foreground,\n fontFamily: heading.fontFamily,\n fontSize: heading.fontSize.h3,\n fontWeight: fontWeights.bold,\n lineHeight: heading.lineHeight,\n marginBottom: 0,\n },\n titleBranded: {\n color: c.primaryForeground,\n },\n titleCentered: {\n textAlign: \"center\",\n },\n\n titleMinimal: {\n fontSize: heading.fontSize.h3,\n fontWeight: fontWeights.bold,\n },\n twoColumnContainer: {\n alignItems: \"flex-start\",\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingBottom: spacing[4],\n },\n twoColumnLeft: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n twoColumnRight: {\n alignItems: \"flex-end\",\n display: \"flex\",\n flexDirection: \"column\",\n },\n });\n}\n\nexport function PageHeader({\n title,\n subtitle,\n rightText,\n rightSubText,\n variant = \"simple\",\n background,\n titleColor,\n marginBottom,\n logo,\n address,\n phone,\n email,\n fixed = false,\n noWrap = true,\n style,\n}: PageHeaderProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createPageHeaderStyles(theme), [theme]);\n const mb = marginBottom ?? theme.spacing.sectionGap;\n\n if (variant === \"branded\") {\n const containerStyles: Style[] = [\n styles.brandedContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [\n styles.title,\n styles.titleBranded,\n styles.titleCentered,\n ];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return wrapFixed(\n fixed,\n <View wrap={!noWrap} style={containerStyles as never}>\n <PDFText style={titleStyles as never}>{title}</PDFText>\n {subtitle && (\n <PDFText style={[styles.subtitle, styles.subtitleBranded] as never}>\n {subtitle}\n </PDFText>\n )}\n </View>\n );\n }\n\n if (variant === \"centered\") {\n const containerStyles: Style[] = [\n styles.centeredContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [styles.title, styles.titleCentered];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return wrapFixed(\n fixed,\n <View wrap={!noWrap} style={containerStyles as never}>\n <PDFText style={titleStyles as never}>{title}</PDFText>\n {subtitle && (\n <PDFText style={[styles.subtitle, styles.subtitleCentered] as never}>\n {subtitle}\n </PDFText>\n )}\n </View>\n );\n }\n\n if (variant === \"logo-right\") {\n const containerStyles: Style[] = [\n styles.logoRightContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [styles.title];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return wrapFixed(\n fixed,\n <View wrap={!noWrap} style={containerStyles as never}>\n <View style={styles.logoRightContent}>\n <PDFText style={titleStyles as never}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {logo && <View style={styles.logoRightLogoContainer}>{logo}</View>}\n </View>\n );\n }\n\n if (variant === \"logo-left\") {\n const containerStyles: Style[] = [\n styles.logoLeftContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [styles.title];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return wrapFixed(\n fixed,\n <View wrap={!noWrap} style={containerStyles as never}>\n {logo && <View style={styles.logoContainer}>{logo}</View>}\n <View style={styles.logoContent}>\n <PDFText style={titleStyles as never}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {(rightText || rightSubText) && (\n <View style={styles.simpleRight}>\n {rightText && (\n <PDFText style={styles.rightText}>{rightText}</PDFText>\n )}\n {rightSubText && (\n <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>\n )}\n </View>\n )}\n </View>\n );\n }\n\n if (variant === \"two-column\") {\n const containerStyles: Style[] = [\n styles.twoColumnContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [styles.title];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return wrapFixed(\n fixed,\n <View wrap={!noWrap} style={containerStyles as never}>\n <View style={styles.twoColumnLeft}>\n <PDFText style={titleStyles as never}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {(address || phone || email) && (\n <View style={styles.twoColumnRight}>\n {address && <PDFText style={styles.contactInfo}>{address}</PDFText>}\n {phone && <PDFText style={styles.contactInfo}>{phone}</PDFText>}\n {email && <PDFText style={styles.contactInfo}>{email}</PDFText>}\n </View>\n )}\n </View>\n );\n }\n\n if (variant === \"minimal\") {\n const containerStyles: Style[] = [\n styles.minimalContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [styles.title, styles.titleMinimal];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return wrapFixed(\n fixed,\n <View wrap={!noWrap} style={containerStyles as never}>\n <View style={styles.minimalLeft}>\n <PDFText style={titleStyles as never}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {(rightText || rightSubText) && (\n <View style={styles.minimalRight}>\n {rightText && (\n <PDFText style={styles.rightText}>{rightText}</PDFText>\n )}\n {rightSubText && (\n <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>\n )}\n </View>\n )}\n </View>\n );\n }\n\n const containerStyles: Style[] = [\n styles.simpleContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [styles.title];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return wrapFixed(\n fixed,\n <View wrap={!noWrap} style={containerStyles as never}>\n <View style={styles.simpleLeft}>\n <PDFText style={titleStyles as never}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {(rightText || rightSubText) && (\n <View style={styles.simpleRight}>\n {rightText && <PDFText style={styles.rightText}>{rightText}</PDFText>}\n {rightSubText && (\n <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>\n )}\n </View>\n )}\n </View>\n );\n}\n",- "type": "registry:component"+ "content": "import { Text as PDFText, StyleSheet, View, Fixed } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport type React from \"react\";\nimport type { ReactNode } from \"react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\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 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 as never}>\n <PDFText style={titleStyles as never}>{title}</PDFText>\n {subtitle && (\n <PDFText style={[styles.subtitle, styles.subtitleBranded] as never}>\n {subtitle}\n </PDFText>\n )}\n </View>\n);\n\nconst renderCentered = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles as never}>\n <PDFText style={titleStyles as never}>{title}</PDFText>\n {subtitle && (\n <PDFText style={[styles.subtitle, styles.subtitleCentered] as never}>\n {subtitle}\n </PDFText>\n )}\n </View>\n);\n\nconst renderLogoRight = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n logo: ReactNode | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles as never}>\n <View style={styles.logoRightContent}>\n <PDFText style={titleStyles as never}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {logo && <View style={styles.logoRightLogoContainer}>{logo}</View>}\n </View>\n);\n\nconst renderLogoLeft = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n logo: ReactNode | undefined,\n rightText: string | undefined,\n rightSubText: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles as never}>\n {logo && <View style={styles.logoContainer}>{logo}</View>}\n <View style={styles.logoContent}>\n <PDFText style={titleStyles as never}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {(rightText || rightSubText) && (\n <View style={styles.simpleRight}>\n {rightText && <PDFText style={styles.rightText}>{rightText}</PDFText>}\n {rightSubText && (\n <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>\n )}\n </View>\n )}\n </View>\n);\n\nconst renderTwoColumn = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n address: string | undefined,\n phone: string | undefined,\n email: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles as never}>\n <View style={styles.twoColumnLeft}>\n <PDFText style={titleStyles as never}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {(address || phone || email) && (\n <View style={styles.twoColumnRight}>\n {address && <PDFText style={styles.contactInfo}>{address}</PDFText>}\n {phone && <PDFText style={styles.contactInfo}>{phone}</PDFText>}\n {email && <PDFText style={styles.contactInfo}>{email}</PDFText>}\n </View>\n )}\n </View>\n);\n\nconst renderMinimal = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n rightText: string | undefined,\n rightSubText: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles as never}>\n <View style={styles.minimalLeft}>\n <PDFText style={titleStyles as never}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {(rightText || rightSubText) && (\n <View style={styles.minimalRight}>\n {rightText && <PDFText style={styles.rightText}>{rightText}</PDFText>}\n {rightSubText && (\n <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>\n )}\n </View>\n )}\n </View>\n);\n\nconst renderSimple = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n rightText: string | undefined,\n rightSubText: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles as never}>\n <View style={styles.simpleLeft}>\n <PDFText style={titleStyles as never}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {(rightText || rightSubText) && (\n <View style={styles.simpleRight}>\n {rightText && <PDFText style={styles.rightText}>{rightText}</PDFText>}\n {rightSubText && (\n <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>\n )}\n </View>\n )}\n </View>\n);\n\nexport const PageHeader = ({\n title,\n subtitle,\n rightText,\n rightSubText,\n variant = \"simple\",\n background,\n titleColor,\n marginBottom,\n logo,\n address,\n phone,\n email,\n fixed = false,\n noWrap = true,\n style,\n}: PageHeaderProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createPageHeaderStyles(theme), [theme]);\n const mb = marginBottom ?? theme.spacing.sectionGap;\n\n const variantRenderers: Record<PageHeaderVariant, () => React.ReactNode> = {\n branded: () =>\n renderBranded(\n styles,\n buildContainerStyles(\n styles.brandedContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles(\n [styles.title, styles.titleBranded, styles.titleCentered],\n titleColor,\n theme\n ),\n title,\n subtitle,\n noWrap\n ),\n centered: () =>\n renderCentered(\n styles,\n buildContainerStyles(\n styles.centeredContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles(\n [styles.title, styles.titleCentered],\n titleColor,\n theme\n ),\n title,\n subtitle,\n noWrap\n ),\n \"logo-left\": () =>\n renderLogoLeft(\n styles,\n buildContainerStyles(\n styles.logoLeftContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles([styles.title], titleColor, theme),\n title,\n subtitle,\n logo,\n rightText,\n rightSubText,\n noWrap\n ),\n \"logo-right\": () =>\n renderLogoRight(\n styles,\n buildContainerStyles(\n styles.logoRightContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles([styles.title], titleColor, theme),\n title,\n subtitle,\n logo,\n noWrap\n ),\n minimal: () =>\n renderMinimal(\n styles,\n buildContainerStyles(\n styles.minimalContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles(\n [styles.title, styles.titleMinimal],\n titleColor,\n theme\n ),\n title,\n subtitle,\n rightText,\n rightSubText,\n noWrap\n ),\n simple: () =>\n renderSimple(\n styles,\n buildContainerStyles(\n styles.simpleContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles([styles.title], titleColor, theme),\n title,\n subtitle,\n rightText,\n rightSubText,\n noWrap\n ),\n \"two-column\": () =>\n renderTwoColumn(\n styles,\n buildContainerStyles(\n styles.twoColumnContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles([styles.title], titleColor, theme),\n title,\n subtitle,\n address,\n phone,\n email,\n noWrap\n ),\n };\n\n return wrapFixed(fixed, variantRenderers[variant]() as React.ReactElement);\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/page-header/page-header.tsx"},{"path": "registry/bases/forme/components/page-header/index.ts","content": "export {\n PageHeader,\n type PageHeaderProps,\n type PageHeaderVariant,\n} from \"./page-header\";\n",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/page-header/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/page-number.json b/public/r/forme/page-number.jsonindex 2b9b3f6..8776127 100644--- a/public/r/forme/page-number.json+++ b/public/r/forme/page-number.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/forme/components/page-number/page-number.tsx",- "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\n\nexport type PageNumberAlign = \"left\" | \"center\" | \"right\";\nexport type PageNumberSize = \"xs\" | \"sm\" | \"md\";\n\n/**\n * Auto page number rendered with a configurable format string at a or inline position.\n * Props - `format` | `align` | `size` | `fixed` | `muted` | `style`\n * @see {@link PdfPageNumberProps}\n */\nexport interface PdfPageNumberProps extends Omit<\n PDFComponentProps,\n \"children\"\n> {\n /**\n * Format string — use `{page}` for current page and `{total}` for total page count.\n * @default 'Page {page} of {total}'\n */\n format?: string;\n /**\n * @default 'center'\n */\n align?: PageNumberAlign;\n /**\n * @default 'sm'\n */\n size?: PageNumberSize;\n /**\n * @default false\n */\n fixed?: boolean;\n /**\n * @default true\n */\n muted?: boolean;\n children?: never;\n}\n\nfunction createPageNumberStyles(t: PdfcnTheme) {\n const { typography, colors, primitives } = t;\n return StyleSheet.create({\n alignCenter: { textAlign: \"center\" },\n alignLeft: { textAlign: \"left\" },\n alignRight: { textAlign: \"right\" },\n colorForeground: { color: colors.foreground },\n colorMuted: { color: colors.mutedForeground },\n container: { width: \"100%\" },\n sizeMd: { fontSize: primitives.typography.base },\n sizeSm: { fontSize: primitives.typography.sm },\n sizeXs: { fontSize: primitives.typography.xs },\n text: { fontFamily: typography.body.fontFamily },\n });\n}\n\nfunction formatPageNumber(\n format: string,\n pageNumber: number,\n totalPages: number\n): string {\n return format\n .replace(\"{page}\", String(pageNumber))\n .replace(\"{total}\", String(totalPages));\n}\n\nexport function PdfPageNumber({\n format = \"Page {page} of {total}\",\n align = \"center\",\n size = \"sm\",\n fixed = false,\n muted = true,\n style,\n}: PdfPageNumberProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createPageNumberStyles(theme), [theme]);\n const alignMap = {\n center: styles.alignCenter,\n left: styles.alignLeft,\n right: styles.alignRight,\n } as Record<PageNumberAlign, Style>;\n const sizeMap = {\n md: styles.sizeMd,\n sm: styles.sizeSm,\n xs: styles.sizeXs,\n } as Record<PageNumberSize, Style>;\n const textStyles: Style[] = [\n styles.text,\n alignMap[align],\n sizeMap[size],\n muted ? styles.colorMuted : styles.colorForeground,\n ];\n if (style) {textStyles.push(...[style].flat());}\n return (\n <View style={styles.container}>\n <PDFText style={textStyles as never}>\n {format\n .replace(\"{page}\", \"{{pageNumber}}\")\n .replace(\"{total}\", \"{{totalPages}}\")}\n </PDFText>\n </View>\n );\n}\n",- "type": "registry:component"+ "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\n\nexport type PageNumberAlign = \"left\" | \"center\" | \"right\";\nexport type PageNumberSize = \"xs\" | \"sm\" | \"md\";\n\n/**\n * Auto page number rendered with a configurable format string at a or inline position.\n * Props - `format` | `align` | `size` | `fixed` | `muted` | `style`\n * @see {@link PdfPageNumberProps}\n */\nexport interface PdfPageNumberProps extends Omit<\n PDFComponentProps,\n \"children\"\n> {\n /**\n * Format string — use `{page}` for current page and `{total}` for total page count.\n * @default 'Page {page} of {total}'\n */\n format?: string;\n /**\n * @default 'center'\n */\n align?: PageNumberAlign;\n /**\n * @default 'sm'\n */\n size?: PageNumberSize;\n /**\n * @default false\n */\n fixed?: boolean;\n /**\n * @default true\n */\n muted?: boolean;\n children?: never;\n}\n\nconst createPageNumberStyles = (t: PdfcnTheme) => {\n const { typography, colors, primitives } = t;\n return StyleSheet.create({\n alignCenter: { textAlign: \"center\" },\n alignLeft: { textAlign: \"left\" },\n alignRight: { textAlign: \"right\" },\n colorForeground: { color: colors.foreground },\n colorMuted: { color: colors.mutedForeground },\n container: { width: \"100%\" },\n sizeMd: { fontSize: primitives.typography.base },\n sizeSm: { fontSize: primitives.typography.sm },\n sizeXs: { fontSize: primitives.typography.xs },\n text: { fontFamily: typography.body.fontFamily },\n });\n};\n\nconst _formatPageNumber = (\n format: string,\n pageNumber: number,\n totalPages: number\n): string =>\n format\n .replace(\"{page}\", String(pageNumber))\n .replace(\"{total}\", String(totalPages));\n\nexport const PdfPageNumber = ({\n format = \"Page {page} of {total}\",\n align = \"center\",\n size = \"sm\",\n muted = true,\n style,\n}: PdfPageNumberProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createPageNumberStyles(theme), [theme]);\n const alignMap = {\n center: styles.alignCenter,\n left: styles.alignLeft,\n right: styles.alignRight,\n } as Record<PageNumberAlign, Style>;\n const sizeMap = {\n md: styles.sizeMd,\n sm: styles.sizeSm,\n xs: styles.sizeXs,\n } as Record<PageNumberSize, Style>;\n const textStyles: Style[] = [\n styles.text,\n alignMap[align],\n sizeMap[size],\n muted ? styles.colorMuted : styles.colorForeground,\n ];\n if (style) {\n textStyles.push(...[style].flat());\n }\n return (\n <View style={styles.container}>\n <PDFText style={textStyles as never}>\n {format\n .replace(\"{page}\", \"{{pageNumber}}\")\n .replace(\"{total}\", \"{{totalPages}}\")}\n </PDFText>\n </View>\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/page-number/page-number.tsx"},{"path": "registry/bases/forme/components/page-number/index.ts","content": "export {\n PdfPageNumber,\n type PdfPageNumberProps,\n type PageNumberAlign,\n type PageNumberSize,\n} from \"./page-number\";\n",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/page-number/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/pdf-image.json b/public/r/forme/pdf-image.jsonindex 1097aee..96abeed 100644--- a/public/r/forme/pdf-image.json+++ b/public/r/forme/pdf-image.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/forme/components/pdf-image/pdf-image.tsx",- "content": "import { Image, Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\n\n/** HTTP method used when fetching the image from a URL. */\nexport type PdfImageHTTPMethod =\n | \"GET\"\n | \"HEAD\"\n | \"POST\"\n | \"PUT\"\n | \"DELETE\"\n | \"PATCH\";\n\nexport type PdfImageSrc =\n | string\n | {\n uri: string;\n method?: PdfImageHTTPMethod;\n headers?: Record<string, string>;\n body?: string;\n };\n\nexport type PdfImageFit = \"cover\" | \"contain\" | \"fill\" | \"none\";\n\nexport type PdfImageVariant =\n | \"default\"\n | \"full-width\"\n | \"thumbnail\"\n | \"avatar\"\n | \"cover\"\n | \"bordered\"\n | \"rounded\";\n\n/**\n * Image element with layout presets, caption, and aspect ratio support.\n * Props - `src` | `variant` | `width` | `height` | `fit` | `position` | `caption` | `aspectRatio` | `borderRadius` | `noWrap` | `style`\n * @see {@link PdfImageProps}\n */\nexport interface PdfImageProps {\n src: PdfImageSrc;\n /**\n * @default 'default'\n */\n variant?: PdfImageVariant;\n width?: number | string;\n height?: number | string;\n fit?: PdfImageFit;\n /**\n * @default '50% 50%'\n */\n position?: string;\n caption?: string;\n aspectRatio?: number;\n borderRadius?: number;\n /**\n * @default true\n */\n noWrap?: boolean;\n style?: Style;\n}\n\ninterface VariantDefaults {\n width?: number | string;\n height?: number | string;\n fit: PdfImageFit;\n borderRadius?: number;\n}\n\nconst VARIANT_DEFAULTS: Record<PdfImageVariant, VariantDefaults> = {\n avatar: { borderRadius: 999, fit: \"cover\", height: 48, width: 48 },\n bordered: { fit: \"contain\", width: \"100%\" },\n cover: { fit: \"cover\", height: 160, width: \"100%\" },\n default: { fit: \"contain\" },\n \"full-width\": { fit: \"cover\", width: \"100%\" },\n rounded: { borderRadius: 8, fit: \"contain\", width: 200 },\n thumbnail: { fit: \"cover\", height: 80, width: 80 },\n};\n\nconst UNSUPPORTED_FORMATS = new Set([\"webp\", \"avif\", \"heic\", \"heif\", \"ico\"]);\n\nfunction detectFormat(src: PdfImageSrc): string | null {\n if (typeof src !== \"string\") return null;\n const dataMatch = src.match(/^data:image\\/([a-zA-Z0-9+.-]+)/);\n if (dataMatch) return dataMatch[1].toLowerCase();\n return src.split(\"?\")[0].split(\".\").pop()?.toLowerCase() ?? null;\n}\n\nfunction warnIfUnsupported(src: PdfImageSrc): void {\n const fmt = detectFormat(src);\n if (fmt && UNSUPPORTED_FORMATS.has(fmt)) {\n console.warn(\n `[PdfImage] Unsupported format \"${fmt}\" detected. react-pdf supports: JPEG, PNG, GIF (first frame), BMP, SVG. Convert to PNG or JPEG before use.`\n );\n }\n}\n\nfunction createImageStyles(t: PdfcnTheme) {\n const { spacing } = t.primitives;\n return StyleSheet.create({\n caption: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginTop: spacing[1],\n textAlign: \"center\",\n },\n container: { flexDirection: \"column\" },\n image: {},\n imageBordered: {\n borderColor: t.colors.border,\n borderStyle: \"solid\",\n borderWidth: 1,\n },\n });\n}\n\nexport function PdfImage({\n src,\n variant = \"default\",\n width,\n height,\n fit,\n position = \"50% 50%\",\n caption,\n aspectRatio,\n borderRadius,\n noWrap = true,\n style,\n}: PdfImageProps) {\n warnIfUnsupported(src);\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createImageStyles(theme), [theme]);\n const defaults = VARIANT_DEFAULTS[variant];\n\n const resolvedWidth = width ?? defaults.width;\n const resolvedHeight: number | string | undefined = (() => {\n if (height !== undefined) {return height;}\n if (defaults.height !== undefined) {return defaults.height;}\n if (aspectRatio !== undefined && typeof resolvedWidth === \"number\")\n {return resolvedWidth / aspectRatio;}\n return;\n })();\n\n const resolvedFit = fit ?? defaults.fit;\n const resolvedRadius = borderRadius ?? defaults.borderRadius;\n\n const imageStyles: Style[] = [styles.image];\n if (resolvedWidth !== undefined)\n {imageStyles.push({ width: resolvedWidth } as Style);}\n if (resolvedHeight !== undefined)\n {imageStyles.push({ height: resolvedHeight } as Style);}\n imageStyles.push({\n objectFit: resolvedFit,\n objectPosition: position,\n } as Style);\n if (resolvedRadius !== undefined)\n {imageStyles.push({ borderRadius: resolvedRadius } as Style);}\n if (variant === \"bordered\") {imageStyles.push(styles.imageBordered);}\n if (style) {imageStyles.push(style);}\n\n const content = (\n <View style={styles.container}>\n <Image src={src as never} style={imageStyles as never} />\n {caption ? <PDFText style={styles.caption}>{caption}</PDFText> : null}\n </View>\n );\n\n return noWrap ? <View wrap={false}>{content}</View> : content;\n}\n",- "type": "registry:component"+ "content": "import { Image, Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\n\n/** HTTP method used when fetching the image from a URL. */\nexport type PdfImageHTTPMethod =\n | \"GET\"\n | \"HEAD\"\n | \"POST\"\n | \"PUT\"\n | \"DELETE\"\n | \"PATCH\";\n\nexport type PdfImageSrc =\n | string\n | {\n uri: string;\n method?: PdfImageHTTPMethod;\n headers?: Record<string, string>;\n body?: string;\n };\n\nexport type PdfImageFit = \"cover\" | \"contain\" | \"fill\" | \"none\";\n\nexport type PdfImageVariant =\n | \"default\"\n | \"full-width\"\n | \"thumbnail\"\n | \"avatar\"\n | \"cover\"\n | \"bordered\"\n | \"rounded\";\n\n/**\n * Image element with layout presets, caption, and aspect ratio support.\n * Props - `src` | `variant` | `width` | `height` | `fit` | `position` | `caption` | `aspectRatio` | `borderRadius` | `noWrap` | `style`\n * @see {@link PdfImageProps}\n */\nexport interface PdfImageProps {\n src: PdfImageSrc;\n /**\n * @default 'default'\n */\n variant?: PdfImageVariant;\n width?: number | string;\n height?: number | string;\n fit?: PdfImageFit;\n /**\n * @default '50% 50%'\n */\n position?: string;\n caption?: string;\n aspectRatio?: number;\n borderRadius?: number;\n /**\n * @default true\n */\n noWrap?: boolean;\n style?: Style;\n}\n\ninterface VariantDefaults {\n width?: number | string;\n height?: number | string;\n fit: PdfImageFit;\n borderRadius?: number;\n}\n\nconst VARIANT_DEFAULTS: Record<PdfImageVariant, VariantDefaults> = {\n avatar: { borderRadius: 999, fit: \"cover\", height: 48, width: 48 },\n bordered: { fit: \"contain\", width: \"100%\" },\n cover: { fit: \"cover\", height: 160, width: \"100%\" },\n default: { fit: \"contain\" },\n \"full-width\": { fit: \"cover\", width: \"100%\" },\n rounded: { borderRadius: 8, fit: \"contain\", width: 200 },\n thumbnail: { fit: \"cover\", height: 80, width: 80 },\n};\n\nconst UNSUPPORTED_FORMATS = new Set([\"webp\", \"avif\", \"heic\", \"heif\", \"ico\"]);\n\nconst detectFormat = (src: PdfImageSrc): string | null => {\n if (typeof src !== \"string\") {\n return null;\n }\n const dataMatch = src.match(/^data:image\\/([a-zA-Z0-9+.-]+)/);\n if (dataMatch) {\n return dataMatch[1].toLowerCase();\n }\n return src.split(\"?\")[0].split(\".\").pop()?.toLowerCase() ?? null;\n};\n\nconst warnIfUnsupported = (src: PdfImageSrc): void => {\n const fmt = detectFormat(src);\n if (fmt && UNSUPPORTED_FORMATS.has(fmt)) {\n console.warn(\n `[PdfImage] Unsupported format \"${fmt}\" detected. react-pdf supports: JPEG, PNG, GIF (first frame), BMP, SVG. Convert to PNG or JPEG before use.`\n );\n }\n};\n\nconst createImageStyles = (t: PdfcnTheme) => {\n const { spacing } = t.primitives;\n return StyleSheet.create({\n caption: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginTop: spacing[1],\n textAlign: \"center\",\n },\n container: { flexDirection: \"column\" },\n image: {},\n imageBordered: {\n borderColor: t.colors.border,\n borderStyle: \"solid\",\n borderWidth: 1,\n },\n });\n};\n\nexport const PdfImage = ({\n src,\n variant = \"default\",\n width,\n height,\n fit,\n position = \"50% 50%\",\n caption,\n aspectRatio,\n borderRadius,\n noWrap = true,\n style,\n}: PdfImageProps) => {\n warnIfUnsupported(src);\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createImageStyles(theme), [theme]);\n const defaults = VARIANT_DEFAULTS[variant];\n\n const resolvedWidth = width ?? defaults.width;\n const resolvedHeight: number | string | undefined = (() => {\n if (height !== undefined) {\n return height;\n }\n if (defaults.height !== undefined) {\n return defaults.height;\n }\n if (aspectRatio !== undefined && typeof resolvedWidth === \"number\") {\n return resolvedWidth / aspectRatio;\n }\n })();\n\n const resolvedFit = fit ?? defaults.fit;\n const resolvedRadius = borderRadius ?? defaults.borderRadius;\n\n const imageStyles: Style[] = [styles.image];\n if (resolvedWidth !== undefined) {\n imageStyles.push({ width: resolvedWidth } as Style);\n }\n if (resolvedHeight !== undefined) {\n imageStyles.push({ height: resolvedHeight } as Style);\n }\n imageStyles.push({\n objectFit: resolvedFit,\n objectPosition: position,\n } as Style);\n if (resolvedRadius !== undefined) {\n imageStyles.push({ borderRadius: resolvedRadius } as Style);\n }\n if (variant === \"bordered\") {\n imageStyles.push(styles.imageBordered);\n }\n if (style) {\n imageStyles.push(style);\n }\n\n const content = (\n <View style={styles.container}>\n <Image src={src as never} style={imageStyles as never} />\n {caption ? <PDFText style={styles.caption}>{caption}</PDFText> : null}\n </View>\n );\n\n return noWrap ? <View wrap={false}>{content}</View> : content;\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/pdf-image/pdf-image.tsx"},{"path": "registry/bases/forme/components/pdf-image/index.ts","content": "export {\n PdfImage,\n type PdfImageProps,\n type PdfImageSrc,\n type PdfImageVariant,\n type PdfImageFit,\n} from \"./pdf-image\";\n",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/pdf-image/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/qrcode.json b/public/r/forme/qrcode.jsonindex 185a920..3e6a4e0 100644--- a/public/r/forme/qrcode.json+++ b/public/r/forme/qrcode.json@@ -14,13 +14,15 @@"files": [{"path": "registry/bases/forme/components/qrcode/qrcode.tsx",- "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport QRCode from \"qrcode\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { Rect, Svg } from \"../../lib/forme-svg\";\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type QRCodeErrorLevel = \"L\" | \"M\" | \"Q\" | \"H\";\n\n/**\n * QR code rendered as an SVG grid for use in PDF documents.\n * Props - `value` | `size` | `color` | `backgroundColor` | `errorLevel` | `margin` | `caption` | `style`\n * @see {@link PdfQRCodeProps}\n */\nexport interface PdfQRCodeProps extends Omit<PDFComponentProps, \"children\"> {\n value: string;\n size?: number;\n color?: string;\n backgroundColor?: string;\n errorLevel?: QRCodeErrorLevel;\n margin?: number;\n caption?: string;\n children?: never;\n}\n\nfunction createQRCodeStyles(t: PdfcnTheme) {\n const { spacing } = t.primitives;\n return StyleSheet.create({\n caption: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginTop: spacing[1],\n textAlign: \"center\",\n },\n container: { alignItems: \"center\" },\n });\n}\n\nfunction generateQRMatrix(\n value: string,\n errorLevel: QRCodeErrorLevel,\n margin: number\n): boolean[][] {\n const qr = QRCode.create(value, { errorCorrectionLevel: errorLevel });\n const { size, data } = qr.modules;\n const totalSize = size + margin * 2;\n const matrix: boolean[][] = [];\n for (let row = 0; row < totalSize; row++) {\n const rowData: boolean[] = [];\n for (let col = 0; col < totalSize; col++) {\n const isInMargin =\n row < margin ||\n row >= size + margin ||\n col < margin ||\n col >= size + margin;\n if (isInMargin) {\n rowData.push(false);\n } else {\n rowData.push(data[(row - margin) * size + (col - margin)] === 1);\n }\n }\n matrix.push(rowData);\n }\n return matrix;\n}\n\nexport function PdfQRCode({\n value,\n size = 100,\n color = \"#000000\",\n backgroundColor = \"#ffffff\",\n errorLevel = \"M\",\n margin = 2,\n caption,\n style,\n}: PdfQRCodeProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createQRCodeStyles(theme), [theme]);\n const matrix = useSafeMemo(\n () => generateQRMatrix(value, errorLevel, margin),\n [value, errorLevel, margin]\n );\n const moduleSize = size / matrix.length;\n const resolvedColor = resolveColor(color, theme.colors);\n const resolvedBgColor =\n backgroundColor === \"transparent\"\n ? undefined\n : resolveColor(backgroundColor, theme.colors);\n const containerStyles: Style[] = [styles.container];\n if (style) {containerStyles.push(...[style].flat());}\n\n return (\n <View style={containerStyles as never}>\n <Svg width={size} height={size} viewBox={`0 0 ${size} ${size}`}>\n {resolvedBgColor !== undefined && (\n <Rect x={0} y={0} width={size} height={size} fill={resolvedBgColor} />\n )}\n {matrix\n .flatMap((row, y) =>\n row\n .map((isDark, x) => (isDark ? { x, y } : null))\n .filter((pos): pos is { x: number; y: number } => pos !== null)\n )\n .map((pos) => (\n <Rect\n key={`qr-${pos.y}-${pos.x}`}\n x={pos.x * moduleSize}\n y={pos.y * moduleSize}\n width={moduleSize}\n height={moduleSize}\n fill={resolvedColor}\n />\n ))}\n </Svg>\n {caption && <PDFText style={styles.caption}>{caption}</PDFText>}\n </View>\n );\n}\n",- "type": "registry:component"+ "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport QRCode from \"qrcode\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { Rect, Svg } from \"../../lib/forme-svg\";\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type QRCodeErrorLevel = \"L\" | \"M\" | \"Q\" | \"H\";\n\n/**\n * QR code rendered as an SVG grid for use in PDF documents.\n * Props - `value` | `size` | `color` | `backgroundColor` | `errorLevel` | `margin` | `caption` | `style`\n * @see {@link PdfQRCodeProps}\n */\nexport interface PdfQRCodeProps extends Omit<PDFComponentProps, \"children\"> {\n value: string;\n size?: number;\n color?: string;\n backgroundColor?: string;\n errorLevel?: QRCodeErrorLevel;\n margin?: number;\n caption?: string;\n children?: never;\n}\n\nconst createQRCodeStyles = (t: PdfcnTheme) => {\n const { spacing } = t.primitives;\n return StyleSheet.create({\n caption: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginTop: spacing[1],\n textAlign: \"center\",\n },\n container: { alignItems: \"center\" },\n });\n};\n\nconst generateQRMatrix = (\n value: string,\n errorLevel: QRCodeErrorLevel,\n margin: number\n): boolean[][] => {\n const qr = QRCode.create(value, { errorCorrectionLevel: errorLevel });\n const { size, data } = qr.modules;\n const totalSize = size + margin * 2;\n const matrix: boolean[][] = [];\n for (let row = 0; row < totalSize; row += 1) {\n const rowData: boolean[] = [];\n for (let col = 0; col < totalSize; col += 1) {\n const isInMargin =\n row < margin ||\n row >= size + margin ||\n col < margin ||\n col >= size + margin;\n if (isInMargin) {\n rowData.push(false);\n } else {\n rowData.push(data[(row - margin) * size + (col - margin)] === 1);\n }\n }\n matrix.push(rowData);\n }\n return matrix;\n};\n\nexport const PdfQRCode = ({\n value,\n size = 100,\n color = \"#000000\",\n backgroundColor = \"#ffffff\",\n errorLevel = \"M\",\n margin = 2,\n caption,\n style,\n}: PdfQRCodeProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createQRCodeStyles(theme), [theme]);\n const matrix = useSafeMemo(\n () => generateQRMatrix(value, errorLevel, margin),\n [value, errorLevel, margin]\n );\n const moduleSize = size / matrix.length;\n const resolvedColor = resolveColor(color, theme.colors);\n const resolvedBgColor =\n backgroundColor === \"transparent\"\n ? undefined\n : resolveColor(backgroundColor, theme.colors);\n const containerStyles: Style[] = [styles.container];\n if (style) {\n containerStyles.push(...[style].flat());\n }\n\n return (\n <View style={containerStyles as never}>\n <Svg width={size} height={size} viewBox={`0 0 ${size} ${size}`}>\n {resolvedBgColor !== undefined && (\n <Rect x={0} y={0} width={size} height={size} fill={resolvedBgColor} />\n )}\n {matrix\n .flatMap((row, y) =>\n row\n .map((isDark, x) => (isDark ? { x, y } : null))\n .filter((pos): pos is { x: number; y: number } => pos !== null)\n )\n .map((pos) => (\n <Rect\n key={`qr-${pos.y}-${pos.x}`}\n x={pos.x * moduleSize}\n y={pos.y * moduleSize}\n width={moduleSize}\n height={moduleSize}\n fill={resolvedColor}\n />\n ))}\n </Svg>\n {caption && <PDFText style={styles.caption}>{caption}</PDFText>}\n </View>\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/qrcode/qrcode.tsx"},{"path": "registry/bases/forme/components/qrcode/index.ts","content": "export {\n PdfQRCode,\n type PdfQRCodeProps,\n type QRCodeErrorLevel,\n} from \"./qrcode\";\n",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/qrcode/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/report-financial.json b/public/r/forme/report-financial.jsonindex 71aa009..3949865 100644--- a/public/r/forme/report-financial.json+++ b/public/r/forme/report-financial.json@@ -13,18 +13,21 @@"files": [{"path": "registry/bases/forme/blocks/report-financial/report-financial.tsx",- "content": "import { ReportTemplateFrame } from './report-layout';\nimport type { ReportTemplateProps } from './report-layout';\nimport type { BaseReportData } from \"./report.types\";\n\nconst sampleFinancialData: BaseReportData = {\n author: \"Finance Ops\",\n generatedAt: \"February 23, 2026\",\n highlights: [\n \"Revenue accelerated after enterprise expansion campaign launch.\",\n \"Gross margin improved due to infrastructure cost renegotiation.\",\n \"Collections requires executive follow-up on two overdue accounts.\",\n ],\n period: \"Q1 2026\",\n rows: [\n {\n label: \"Enterprise Sales\",\n owner: \"A. Patel\",\n status: \"On Track\",\n progress: 88,\n risk: \"Low\",\n },\n {\n label: \"SMB Sales\",\n owner: \"L. Khan\",\n status: \"On Track\",\n progress: 79,\n risk: \"Medium\",\n },\n {\n label: \"Collections\",\n owner: \"J. Reyes\",\n status: \"At Risk\",\n progress: 63,\n risk: \"High\",\n },\n {\n label: \"Cost Optimization\",\n owner: \"K. Singh\",\n status: \"On Track\",\n progress: 82,\n risk: \"Low\",\n },\n ],\n series: [\n { label: \"W1\", value: 72 },\n { label: \"W2\", value: 74 },\n { label: \"W3\", value: 76 },\n { label: \"W4\", value: 77 },\n { label: \"W5\", value: 79 },\n { label: \"W6\", value: 80 },\n { label: \"W7\", value: 81 },\n { label: \"W8\", value: 83 },\n { label: \"W9\", value: 82 },\n { label: \"W10\", value: 84 },\n { label: \"W11\", value: 86 },\n { label: \"W12\", value: 88 },\n ],\n subtitle: \"Revenue, margin, and expense control overview\",\n summary: [\n { label: \"Revenue\", value: \"$2.48M\", trend: \"+14.2% QoQ\", tone: \"success\" },\n {\n label: \"Gross Margin\",\n value: \"61.8%\",\n trend: \"+2.1 pts\",\n tone: \"success\",\n },\n { label: \"Opex\", value: \"$0.93M\", trend: \"-3.4% QoQ\", tone: \"success\" },\n { label: \"Runway\", value: \"22 months\", trend: \"Stable\", tone: \"info\" },\n ],\n title: \"Quarterly Financial Report\",\n};\n\nexport function FinancialReportDocument({\n theme,\n data = sampleFinancialData,\n}: ReportTemplateProps) {\n return (\n <ReportTemplateFrame\n theme={theme}\n data={data}\n titlePrefix=\"Financial Report\"\n statusLabel=\"Finance: Healthy\"\n statusTone=\"success\"\n graphVariant=\"line\"\n graphTitle=\"Revenue trajectory\"\n graphSubtitle=\"Quarterly weighted revenue index\"\n graphLegend=\"none\"\n graphColors={[\"#0F172A\"]}\n />\n );\n}\n",- "type": "registry:block"+ "content": "import { ReportTemplateFrame } from \"./report-layout\";\nimport type { ReportTemplateProps } from \"./report-layout\";\nimport type { BaseReportData } from \"./report.types\";\n\nconst sampleFinancialData: BaseReportData = {\n author: \"Finance Ops\",\n generatedAt: \"February 23, 2026\",\n highlights: [\n \"Revenue accelerated after enterprise expansion campaign launch.\",\n \"Gross margin improved due to infrastructure cost renegotiation.\",\n \"Collections requires executive follow-up on two overdue accounts.\",\n ],\n period: \"Q1 2026\",\n rows: [\n {\n label: \"Enterprise Sales\",\n owner: \"A. Patel\",\n progress: 88,\n risk: \"Low\",\n status: \"On Track\",\n },\n {\n label: \"SMB Sales\",\n owner: \"L. Khan\",\n progress: 79,\n risk: \"Medium\",\n status: \"On Track\",\n },\n {\n label: \"Collections\",\n owner: \"J. Reyes\",\n progress: 63,\n risk: \"High\",\n status: \"At Risk\",\n },\n {\n label: \"Cost Optimization\",\n owner: \"K. Singh\",\n progress: 82,\n risk: \"Low\",\n status: \"On Track\",\n },\n ],\n series: [\n { label: \"W1\", value: 72 },\n { label: \"W2\", value: 74 },\n { label: \"W3\", value: 76 },\n { label: \"W4\", value: 77 },\n { label: \"W5\", value: 79 },\n { label: \"W6\", value: 80 },\n { label: \"W7\", value: 81 },\n { label: \"W8\", value: 83 },\n { label: \"W9\", value: 82 },\n { label: \"W10\", value: 84 },\n { label: \"W11\", value: 86 },\n { label: \"W12\", value: 88 },\n ],\n subtitle: \"Revenue, margin, and expense control overview\",\n summary: [\n { label: \"Revenue\", tone: \"success\", trend: \"+14.2% QoQ\", value: \"$2.48M\" },\n {\n label: \"Gross Margin\",\n tone: \"success\",\n trend: \"+2.1 pts\",\n value: \"61.8%\",\n },\n { label: \"Opex\", tone: \"success\", trend: \"-3.4% QoQ\", value: \"$0.93M\" },\n { label: \"Runway\", tone: \"info\", trend: \"Stable\", value: \"22 months\" },\n ],\n title: \"Quarterly Financial Report\",\n};\n\nexport const FinancialReportDocument = ({\n theme,\n data = sampleFinancialData,\n}: ReportTemplateProps) => (\n <ReportTemplateFrame\n theme={theme}\n data={data}\n titlePrefix=\"Financial Report\"\n statusLabel=\"Finance: Healthy\"\n statusTone=\"success\"\n graphVariant=\"line\"\n graphTitle=\"Revenue trajectory\"\n graphSubtitle=\"Quarterly weighted revenue index\"\n graphLegend=\"none\"\n graphColors={[\"#0F172A\"]}\n />\n);\n",+ "type": "registry:block",+ "target": "components/pdf/blocks/report-financial/report-financial.tsx"},{"path": "registry/bases/forme/blocks/report-financial/report-layout.tsx",- "content": "import {\n Badge,\n DataTable,\n Divider,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Stack,\n Text,\n usePdfcnTheme,\n} from '../../components';\nimport type { PdfcnTheme } from '@/registry/themes';\nimport { Document, Page, StyleSheet, View } from \"@formepdf/react\";\nimport type { BaseReportData } from './report.types';\n\nexport interface ReportTemplateProps {\n theme?: PdfcnTheme;\n data?: BaseReportData;\n}\n\ntype ReportGraphVariant = 'bar' | 'horizontal-bar' | 'line' | 'area' | 'pie' | 'donut';\n\ninterface ReportLayoutProps {\n data: BaseReportData;\n titlePrefix: string;\n statusLabel: string;\n statusTone: 'success' | 'warning' | 'destructive' | 'info';\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: 'bottom' | 'right' | 'none';\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: Array<{ label: string; value: number }>;\n}\n\nfunction toneColor(theme: PdfcnTheme, tone: 'success' | 'warning' | 'destructive' | 'info') {\n if (tone === 'success') return theme.colors.success;\n if (tone === 'warning') return theme.colors.warning;\n if (tone === 'destructive') return theme.colors.destructive;\n return theme.colors.info;\n}\n\nexport function ReportLayout({\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend = 'none',\n graphShowValues = false,\n graphColors,\n graphData,\n}: ReportLayoutProps) {\n const theme = usePdfcnTheme();\n const accent = toneColor(theme, statusTone);\n\n const styles = StyleSheet.create({\n page: {\n paddingTop: theme.spacing.page.marginTop,\n paddingLeft: theme.spacing.page.marginLeft,\n paddingRight: theme.spacing.page.marginRight,\n paddingBottom: theme.spacing.page.marginBottom,\n backgroundColor: theme.colors.background,\n },\n toolbar: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n marginBottom: 8,\n },\n metricsGrid: {\n flexDirection: 'row',\n flexWrap: 'wrap',\n gap: 8,\n },\n metricCard: {\n width: '48.6%',\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n padding: 8,\n backgroundColor: theme.colors.background,\n },\n metricLabel: {\n fontSize: 8,\n textTransform: 'uppercase',\n color: theme.colors.mutedForeground,\n marginBottom: 2,\n letterSpacing: 0.5,\n },\n metricValue: {\n fontSize: 14,\n color: theme.colors.foreground,\n fontWeight: theme.primitives.fontWeights.bold,\n marginBottom: 2,\n },\n metricTrend: {\n fontSize: 9,\n color: theme.colors.mutedForeground,\n },\n graphShell: {\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n padding: 12,\n backgroundColor: theme.colors.background,\n },\n twoColumn: {\n flexDirection: 'row',\n gap: 10,\n alignItems: 'flex-start',\n },\n col: {\n flex: 1,\n },\n });\n\n return (\n <Document title={`${titlePrefix} ${data.period}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <PageHeader\n variant=\"two-column\"\n title={data.title}\n subtitle={`${titlePrefix} · ${data.subtitle}`}\n rightText={data.period}\n rightSubText={`Generated ${data.generatedAt}`}\n marginBottom={14}\n />\n\n <View style={styles.toolbar}>\n <Badge label={statusLabel} variant={statusTone} size=\"sm\" />\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Author: {data.author}\n </Text>\n </View>\n\n <Section variant=\"card\" padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Executive Summary\n </Text>\n <View style={styles.metricsGrid}>\n {data.summary.map((metric) => (\n <View\n key={metric.label}\n style={[\n styles.metricCard,\n {\n borderLeftWidth: 3,\n borderLeftColor: metric.tone ? toneColor(theme, metric.tone) : accent,\n },\n ] as never}\n >\n <Text style={styles.metricLabel} noMargin>\n {metric.label}\n </Text>\n <Text style={styles.metricValue} noMargin>\n {metric.value}\n </Text>\n {metric.trend ? (\n <Badge label={metric.trend} size=\"sm\" variant={metric.tone ?? 'info'} />\n ) : null}\n </View>\n ))}\n </View>\n </Section>\n\n <Section padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View style={styles.graphShell}>\n <PdfGraph\n variant={graphVariant}\n data={graphData ?? data.series}\n title={graphTitle}\n subtitle={graphSubtitle}\n yLabel={undefined}\n xLabel={undefined}\n showGrid={graphVariant !== 'pie' && graphVariant !== 'donut'}\n showValues={graphShowValues}\n smooth={graphVariant === 'line' || graphVariant === 'area'}\n legend={graphLegend}\n height={200}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section padding=\"md\">\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Delivery Table\n </Text>\n <DataTable\n variant=\"compact\"\n size=\"compact\"\n stripe\n columns={[\n { key: 'label', header: 'Stream' },\n { key: 'owner', header: 'Owner' },\n { key: 'status', header: 'Status', align: 'center' },\n {\n key: 'progress',\n header: 'Progress',\n align: 'right',\n render: (value) => `${String(value)}%`,\n },\n { key: 'risk', header: 'Risk', align: 'right' },\n ]}\n data={data.rows}\n footer={{\n label: 'Totals',\n owner: '-',\n status: '-',\n progress: Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n ),\n risk: '-',\n }}\n />\n </Section>\n\n <Section padding=\"md\" variant=\"card\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Highlights & Risks\n </Text>\n <View style={styles.twoColumn}>\n <View style={styles.col}>\n <PdfList\n variant=\"checklist\"\n items={data.highlights.map((item) => ({ text: item, checked: true }))}\n gap=\"sm\"\n />\n </View>\n <View style={styles.col}>\n <KeyValue\n size=\"sm\"\n divided\n items={[\n {\n key: 'Open Risks',\n value: `${data.rows.filter((r) => r.risk !== 'Low').length}`,\n },\n {\n key: 'On-Track Streams',\n value: `${data.rows.filter((r) => r.status === 'On Track').length}/${data.rows.length}`,\n },\n {\n key: 'Average Progress',\n value: `${Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n )}%`,\n },\n ]}\n />\n </View>\n </View>\n <Divider />\n <Stack gap=\"sm\">\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: keep each section under one page using `noWrap` for concise blocks.\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: pass explicit row keys/owners to avoid ambiguous reporting handoffs.\n </Text>\n </Stack>\n </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with PDFx\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </View></Page>\n </Document>\n );\n}\n\nexport function ReportTemplateFrame({\n theme,\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend,\n graphShowValues,\n graphColors,\n graphData,\n}: ReportTemplateProps & {\n titlePrefix: string;\n statusLabel: string;\n statusTone: 'success' | 'warning' | 'destructive' | 'info';\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: 'bottom' | 'right' | 'none';\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: Array<{ label: string; value: number }>;\n}) {\n if (!data) return null;\n\n return (\n <PdfcnThemeProvider theme={theme}>\n <ReportLayout\n data={data}\n titlePrefix={titlePrefix}\n statusLabel={statusLabel}\n statusTone={statusTone}\n graphVariant={graphVariant}\n graphTitle={graphTitle}\n graphSubtitle={graphSubtitle}\n graphLegend={graphLegend}\n graphShowValues={graphShowValues}\n graphColors={graphColors}\n graphData={graphData}\n />\n </PdfcnThemeProvider>\n );\n}\n",- "type": "registry:block"+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n Badge,\n DataTable,\n Divider,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Stack,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport 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\n const styles = StyleSheet.create({\n col: {\n flex: 1,\n },\n graphShell: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 12,\n },\n metricCard: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 8,\n width: \"48.6%\",\n },\n metricLabel: {\n color: theme.colors.mutedForeground,\n fontSize: 8,\n letterSpacing: 0.5,\n marginBottom: 2,\n textTransform: \"uppercase\",\n },\n metricTrend: {\n color: theme.colors.mutedForeground,\n fontSize: 9,\n },\n metricValue: {\n color: theme.colors.foreground,\n fontSize: 14,\n fontWeight: theme.primitives.fontWeights.bold,\n marginBottom: 2,\n },\n metricsGrid: {\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n paddingBottom: theme.spacing.page.marginBottom,\n paddingLeft: theme.spacing.page.marginLeft,\n paddingRight: theme.spacing.page.marginRight,\n paddingTop: theme.spacing.page.marginTop,\n },\n toolbar: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: 8,\n },\n twoColumn: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n gap: 10,\n },\n });\n\n return (\n <Document title={`${titlePrefix} ${data.period}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <PageHeader\n variant=\"two-column\"\n title={data.title}\n subtitle={`${titlePrefix} · ${data.subtitle}`}\n rightText={data.period}\n rightSubText={`Generated ${data.generatedAt}`}\n marginBottom={14}\n />\n\n <View style={styles.toolbar}>\n <Badge label={statusLabel} variant={statusTone} size=\"sm\" />\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Author: {data.author}\n </Text>\n </View>\n\n <Section variant=\"card\" padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Executive Summary\n </Text>\n <View style={styles.metricsGrid}>\n {data.summary.map((metric) => (\n <View\n key={metric.label}\n style={\n [\n styles.metricCard,\n {\n borderLeftColor: metric.tone\n ? toneColor(theme, metric.tone)\n : accent,\n borderLeftWidth: 3,\n },\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 />\n ) : null}\n </View>\n ))}\n </View>\n </Section>\n\n <Section padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View style={styles.graphShell}>\n <PdfGraph\n variant={graphVariant}\n data={graphData ?? data.series}\n title={graphTitle}\n subtitle={graphSubtitle}\n yLabel={undefined}\n xLabel={undefined}\n showGrid={graphVariant !== \"pie\" && graphVariant !== \"donut\"}\n showValues={graphShowValues}\n smooth={graphVariant === \"line\" || graphVariant === \"area\"}\n legend={graphLegend}\n height={200}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section padding=\"md\">\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Delivery Table\n </Text>\n <DataTable\n variant=\"compact\"\n size=\"compact\"\n stripe\n columns={[\n { header: \"Stream\", key: \"label\" },\n { header: \"Owner\", key: \"owner\" },\n { align: \"center\", header: \"Status\", key: \"status\" },\n {\n align: \"right\",\n header: \"Progress\",\n key: \"progress\",\n render: (value) => `${String(value)}%`,\n },\n { align: \"right\", header: \"Risk\", key: \"risk\" },\n ]}\n data={data.rows}\n footer={{\n label: \"Totals\",\n owner: \"-\",\n progress: Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n ),\n risk: \"-\",\n status: \"-\",\n }}\n />\n </Section>\n\n <Section padding=\"md\" variant=\"card\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Highlights & Risks\n </Text>\n <View style={styles.twoColumn}>\n <View style={styles.col}>\n <PdfList\n variant=\"checklist\"\n items={data.highlights.map((item) => ({\n checked: true,\n text: item,\n }))}\n gap=\"sm\"\n />\n </View>\n <View style={styles.col}>\n <KeyValue\n size=\"sm\"\n divided\n items={[\n {\n key: \"Open Risks\",\n value: `${data.rows.filter((r) => r.risk !== \"Low\").length}`,\n },\n {\n key: \"On-Track Streams\",\n value: `${data.rows.filter((r) => r.status === \"On Track\").length}/${data.rows.length}`,\n },\n {\n key: \"Average Progress\",\n value: `${Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n )}%`,\n },\n ]}\n />\n </View>\n </View>\n <Divider />\n <Stack gap=\"sm\">\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: keep each section under one page using `noWrap`\n for concise blocks.\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: pass explicit row keys/owners to avoid ambiguous\n reporting handoffs.\n </Text>\n </Stack>\n </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with PDFx\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </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"},{"path": "registry/bases/forme/blocks/report-financial/report.types.ts","content": "export interface SummaryMetric {\n label: string;\n value: string;\n trend?: string;\n tone?: \"success\" | \"warning\" | \"destructive\" | \"info\";\n}\n\nexport type ReportRow = Record<string, unknown> & {\n label: string;\n owner: string;\n status: string;\n progress: number;\n risk?: string;\n};\n\nexport interface ReportSeriesPoint {\n label: string;\n value: number;\n}\n\nexport interface BaseReportData {\n title: string;\n subtitle: string;\n generatedAt: string;\n period: string;\n author: string;\n summary: SummaryMetric[];\n rows: ReportRow[];\n series: ReportSeriesPoint[];\n highlights: string[];\n}\n",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-financial/report.types.ts"}],"type": "registry:block"diff --git a/public/r/forme/report-marketing.json b/public/r/forme/report-marketing.jsonindex 8e7d9a5..4897c43 100644--- a/public/r/forme/report-marketing.json+++ b/public/r/forme/report-marketing.json@@ -13,18 +13,21 @@"files": [{"path": "registry/bases/forme/blocks/report-marketing/report-layout.tsx",- "content": "import {\n Badge,\n DataTable,\n Divider,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Stack,\n Text,\n usePdfcnTheme,\n} from '../../components';\nimport type { PdfcnTheme } from '@/registry/themes';\nimport { Document, Page, StyleSheet, View } from \"@formepdf/react\";\nimport type { BaseReportData } from './report.types';\n\nexport interface ReportTemplateProps {\n theme?: PdfcnTheme;\n data?: BaseReportData;\n}\n\ntype ReportGraphVariant = 'bar' | 'horizontal-bar' | 'line' | 'area' | 'pie' | 'donut';\n\ninterface ReportLayoutProps {\n data: BaseReportData;\n titlePrefix: string;\n statusLabel: string;\n statusTone: 'success' | 'warning' | 'destructive' | 'info';\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: 'bottom' | 'right' | 'none';\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: Array<{ label: string; value: number }>;\n}\n\nfunction toneColor(theme: PdfcnTheme, tone: 'success' | 'warning' | 'destructive' | 'info') {\n if (tone === 'success') return theme.colors.success;\n if (tone === 'warning') return theme.colors.warning;\n if (tone === 'destructive') return theme.colors.destructive;\n return theme.colors.info;\n}\n\nexport function ReportLayout({\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend = 'none',\n graphShowValues = false,\n graphColors,\n graphData,\n}: ReportLayoutProps) {\n const theme = usePdfcnTheme();\n const accent = toneColor(theme, statusTone);\n\n const styles = StyleSheet.create({\n page: {\n paddingTop: theme.spacing.page.marginTop,\n paddingLeft: theme.spacing.page.marginLeft,\n paddingRight: theme.spacing.page.marginRight,\n paddingBottom: theme.spacing.page.marginBottom,\n backgroundColor: theme.colors.background,\n },\n toolbar: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n marginBottom: 8,\n },\n metricsGrid: {\n flexDirection: 'row',\n flexWrap: 'wrap',\n gap: 8,\n },\n metricCard: {\n width: '48.6%',\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n padding: 8,\n backgroundColor: theme.colors.background,\n },\n metricLabel: {\n fontSize: 8,\n textTransform: 'uppercase',\n color: theme.colors.mutedForeground,\n marginBottom: 2,\n letterSpacing: 0.5,\n },\n metricValue: {\n fontSize: 14,\n color: theme.colors.foreground,\n fontWeight: theme.primitives.fontWeights.bold,\n marginBottom: 2,\n },\n metricTrend: {\n fontSize: 9,\n color: theme.colors.mutedForeground,\n },\n graphShell: {\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n padding: 12,\n backgroundColor: theme.colors.background,\n },\n twoColumn: {\n flexDirection: 'row',\n gap: 10,\n alignItems: 'flex-start',\n },\n col: {\n flex: 1,\n },\n });\n\n return (\n <Document title={`${titlePrefix} ${data.period}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <PageHeader\n variant=\"two-column\"\n title={data.title}\n subtitle={`${titlePrefix} · ${data.subtitle}`}\n rightText={data.period}\n rightSubText={`Generated ${data.generatedAt}`}\n marginBottom={14}\n />\n\n <View style={styles.toolbar}>\n <Badge label={statusLabel} variant={statusTone} size=\"sm\" />\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Author: {data.author}\n </Text>\n </View>\n\n <Section variant=\"card\" padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Executive Summary\n </Text>\n <View style={styles.metricsGrid}>\n {data.summary.map((metric) => (\n <View\n key={metric.label}\n style={[\n styles.metricCard,\n {\n borderLeftWidth: 3,\n borderLeftColor: metric.tone ? toneColor(theme, metric.tone) : accent,\n },\n ] as never}\n >\n <Text style={styles.metricLabel} noMargin>\n {metric.label}\n </Text>\n <Text style={styles.metricValue} noMargin>\n {metric.value}\n </Text>\n {metric.trend ? (\n <Badge label={metric.trend} size=\"sm\" variant={metric.tone ?? 'info'} />\n ) : null}\n </View>\n ))}\n </View>\n </Section>\n\n <Section padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View style={styles.graphShell}>\n <PdfGraph\n variant={graphVariant}\n data={graphData ?? data.series}\n title={graphTitle}\n subtitle={graphSubtitle}\n yLabel={undefined}\n xLabel={undefined}\n showGrid={graphVariant !== 'pie' && graphVariant !== 'donut'}\n showValues={graphShowValues}\n smooth={graphVariant === 'line' || graphVariant === 'area'}\n legend={graphLegend}\n height={200}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section padding=\"md\">\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Delivery Table\n </Text>\n <DataTable\n variant=\"compact\"\n size=\"compact\"\n stripe\n columns={[\n { key: 'label', header: 'Stream' },\n { key: 'owner', header: 'Owner' },\n { key: 'status', header: 'Status', align: 'center' },\n {\n key: 'progress',\n header: 'Progress',\n align: 'right',\n render: (value) => `${String(value)}%`,\n },\n { key: 'risk', header: 'Risk', align: 'right' },\n ]}\n data={data.rows}\n footer={{\n label: 'Totals',\n owner: '-',\n status: '-',\n progress: Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n ),\n risk: '-',\n }}\n />\n </Section>\n\n <Section padding=\"md\" variant=\"card\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Highlights & Risks\n </Text>\n <View style={styles.twoColumn}>\n <View style={styles.col}>\n <PdfList\n variant=\"checklist\"\n items={data.highlights.map((item) => ({ text: item, checked: true }))}\n gap=\"sm\"\n />\n </View>\n <View style={styles.col}>\n <KeyValue\n size=\"sm\"\n divided\n items={[\n {\n key: 'Open Risks',\n value: `${data.rows.filter((r) => r.risk !== 'Low').length}`,\n },\n {\n key: 'On-Track Streams',\n value: `${data.rows.filter((r) => r.status === 'On Track').length}/${data.rows.length}`,\n },\n {\n key: 'Average Progress',\n value: `${Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n )}%`,\n },\n ]}\n />\n </View>\n </View>\n <Divider />\n <Stack gap=\"sm\">\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: keep each section under one page using `noWrap` for concise blocks.\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: pass explicit row keys/owners to avoid ambiguous reporting handoffs.\n </Text>\n </Stack>\n </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with PDFx\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </View></Page>\n </Document>\n );\n}\n\nexport function ReportTemplateFrame({\n theme,\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend,\n graphShowValues,\n graphColors,\n graphData,\n}: ReportTemplateProps & {\n titlePrefix: string;\n statusLabel: string;\n statusTone: 'success' | 'warning' | 'destructive' | 'info';\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: 'bottom' | 'right' | 'none';\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: Array<{ label: string; value: number }>;\n}) {\n if (!data) return null;\n\n return (\n <PdfcnThemeProvider theme={theme}>\n <ReportLayout\n data={data}\n titlePrefix={titlePrefix}\n statusLabel={statusLabel}\n statusTone={statusTone}\n graphVariant={graphVariant}\n graphTitle={graphTitle}\n graphSubtitle={graphSubtitle}\n graphLegend={graphLegend}\n graphShowValues={graphShowValues}\n graphColors={graphColors}\n graphData={graphData}\n />\n </PdfcnThemeProvider>\n );\n}\n",- "type": "registry:block"+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n Badge,\n DataTable,\n Divider,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Stack,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport 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\n const styles = StyleSheet.create({\n col: {\n flex: 1,\n },\n graphShell: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 12,\n },\n metricCard: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 8,\n width: \"48.6%\",\n },\n metricLabel: {\n color: theme.colors.mutedForeground,\n fontSize: 8,\n letterSpacing: 0.5,\n marginBottom: 2,\n textTransform: \"uppercase\",\n },\n metricTrend: {\n color: theme.colors.mutedForeground,\n fontSize: 9,\n },\n metricValue: {\n color: theme.colors.foreground,\n fontSize: 14,\n fontWeight: theme.primitives.fontWeights.bold,\n marginBottom: 2,\n },\n metricsGrid: {\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n paddingBottom: theme.spacing.page.marginBottom,\n paddingLeft: theme.spacing.page.marginLeft,\n paddingRight: theme.spacing.page.marginRight,\n paddingTop: theme.spacing.page.marginTop,\n },\n toolbar: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: 8,\n },\n twoColumn: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n gap: 10,\n },\n });\n\n return (\n <Document title={`${titlePrefix} ${data.period}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <PageHeader\n variant=\"two-column\"\n title={data.title}\n subtitle={`${titlePrefix} · ${data.subtitle}`}\n rightText={data.period}\n rightSubText={`Generated ${data.generatedAt}`}\n marginBottom={14}\n />\n\n <View style={styles.toolbar}>\n <Badge label={statusLabel} variant={statusTone} size=\"sm\" />\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Author: {data.author}\n </Text>\n </View>\n\n <Section variant=\"card\" padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Executive Summary\n </Text>\n <View style={styles.metricsGrid}>\n {data.summary.map((metric) => (\n <View\n key={metric.label}\n style={\n [\n styles.metricCard,\n {\n borderLeftColor: metric.tone\n ? toneColor(theme, metric.tone)\n : accent,\n borderLeftWidth: 3,\n },\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 />\n ) : null}\n </View>\n ))}\n </View>\n </Section>\n\n <Section padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View style={styles.graphShell}>\n <PdfGraph\n variant={graphVariant}\n data={graphData ?? data.series}\n title={graphTitle}\n subtitle={graphSubtitle}\n yLabel={undefined}\n xLabel={undefined}\n showGrid={graphVariant !== \"pie\" && graphVariant !== \"donut\"}\n showValues={graphShowValues}\n smooth={graphVariant === \"line\" || graphVariant === \"area\"}\n legend={graphLegend}\n height={200}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section padding=\"md\">\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Delivery Table\n </Text>\n <DataTable\n variant=\"compact\"\n size=\"compact\"\n stripe\n columns={[\n { header: \"Stream\", key: \"label\" },\n { header: \"Owner\", key: \"owner\" },\n { align: \"center\", header: \"Status\", key: \"status\" },\n {\n align: \"right\",\n header: \"Progress\",\n key: \"progress\",\n render: (value) => `${String(value)}%`,\n },\n { align: \"right\", header: \"Risk\", key: \"risk\" },\n ]}\n data={data.rows}\n footer={{\n label: \"Totals\",\n owner: \"-\",\n progress: Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n ),\n risk: \"-\",\n status: \"-\",\n }}\n />\n </Section>\n\n <Section padding=\"md\" variant=\"card\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Highlights & Risks\n </Text>\n <View style={styles.twoColumn}>\n <View style={styles.col}>\n <PdfList\n variant=\"checklist\"\n items={data.highlights.map((item) => ({\n checked: true,\n text: item,\n }))}\n gap=\"sm\"\n />\n </View>\n <View style={styles.col}>\n <KeyValue\n size=\"sm\"\n divided\n items={[\n {\n key: \"Open Risks\",\n value: `${data.rows.filter((r) => r.risk !== \"Low\").length}`,\n },\n {\n key: \"On-Track Streams\",\n value: `${data.rows.filter((r) => r.status === \"On Track\").length}/${data.rows.length}`,\n },\n {\n key: \"Average Progress\",\n value: `${Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n )}%`,\n },\n ]}\n />\n </View>\n </View>\n <Divider />\n <Stack gap=\"sm\">\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: keep each section under one page using `noWrap`\n for concise blocks.\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: pass explicit row keys/owners to avoid ambiguous\n reporting handoffs.\n </Text>\n </Stack>\n </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with PDFx\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </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"},{"path": "registry/bases/forme/blocks/report-marketing/report-marketing.tsx",- "content": "import { ReportTemplateFrame } from './report-layout';\nimport type { ReportTemplateProps } from './report-layout';\nimport type { BaseReportData } from \"./report.types\";\n\nconst sampleMarketingData: BaseReportData = {\n author: \"Growth Team\",\n generatedAt: \"February 23, 2026\",\n highlights: [\n \"Channel mix improved CAC while maintaining lead quality.\",\n \"Lifecycle email workflow has deliverability issues under investigation.\",\n \"Referral program is producing higher-intent pipeline with lower cost.\",\n ],\n period: \"Campaign Cycle 2026-02\",\n rows: [\n {\n label: \"SEO\",\n owner: \"H. Evans\",\n status: \"On Track\",\n progress: 84,\n risk: \"Low\",\n },\n {\n label: \"Paid Search\",\n owner: \"K. Martin\",\n status: \"On Track\",\n progress: 80,\n risk: \"Low\",\n },\n {\n label: \"Lifecycle Email\",\n owner: \"V. Lee\",\n status: \"At Risk\",\n progress: 64,\n risk: \"Medium\",\n },\n {\n label: \"Partner Referrals\",\n owner: \"J. Gomez\",\n status: \"On Track\",\n progress: 75,\n risk: \"Medium\",\n },\n ],\n series: [\n { label: \"W1\", value: 55 },\n { label: \"W2\", value: 57 },\n { label: \"W3\", value: 59 },\n { label: \"W4\", value: 60 },\n { label: \"W5\", value: 62 },\n { label: \"W6\", value: 63 },\n { label: \"W7\", value: 65 },\n { label: \"W8\", value: 67 },\n { label: \"W9\", value: 66 },\n { label: \"W10\", value: 68 },\n { label: \"W11\", value: 70 },\n { label: \"W12\", value: 72 },\n ],\n subtitle: \"Pipeline, conversion efficiency, and channel performance\",\n summary: [\n { label: \"MQLs\", value: \"3,940\", trend: \"+22.1% cycle\", tone: \"success\" },\n { label: \"CAC\", value: \"$118\", trend: \"-7.4%\", tone: \"success\" },\n { label: \"Win Rate\", value: \"28.6%\", trend: \"+1.1 pts\", tone: \"info\" },\n { label: \"Churn Risk\", value: \"6.2%\", trend: \"+0.8 pts\", tone: \"warning\" },\n ],\n title: \"Growth & Marketing Report\",\n};\n\nexport function MarketingReportDocument({\n theme,\n data = sampleMarketingData,\n}: ReportTemplateProps) {\n return (\n <ReportTemplateFrame\n theme={theme}\n data={data}\n titlePrefix=\"Growth Report\"\n statusLabel=\"Growth: Strong\"\n statusTone=\"success\"\n graphVariant=\"bar\"\n graphTitle=\"Pipeline build by week\"\n graphSubtitle=\"Demand creation output trend\"\n graphLegend=\"none\"\n graphShowValues\n graphColors={[\"#0EA5E9\"]}\n />\n );\n}\n",- "type": "registry:block"+ "content": "import { ReportTemplateFrame } from \"./report-layout\";\nimport type { ReportTemplateProps } from \"./report-layout\";\nimport type { BaseReportData } from \"./report.types\";\n\nconst sampleMarketingData: BaseReportData = {\n author: \"Growth Team\",\n generatedAt: \"February 23, 2026\",\n highlights: [\n \"Channel mix improved CAC while maintaining lead quality.\",\n \"Lifecycle email workflow has deliverability issues under investigation.\",\n \"Referral program is producing higher-intent pipeline with lower cost.\",\n ],\n period: \"Campaign Cycle 2026-02\",\n rows: [\n {\n label: \"SEO\",\n owner: \"H. Evans\",\n progress: 84,\n risk: \"Low\",\n status: \"On Track\",\n },\n {\n label: \"Paid Search\",\n owner: \"K. Martin\",\n progress: 80,\n risk: \"Low\",\n status: \"On Track\",\n },\n {\n label: \"Lifecycle Email\",\n owner: \"V. Lee\",\n progress: 64,\n risk: \"Medium\",\n status: \"At Risk\",\n },\n {\n label: \"Partner Referrals\",\n owner: \"J. Gomez\",\n progress: 75,\n risk: \"Medium\",\n status: \"On Track\",\n },\n ],\n series: [\n { label: \"W1\", value: 55 },\n { label: \"W2\", value: 57 },\n { label: \"W3\", value: 59 },\n { label: \"W4\", value: 60 },\n { label: \"W5\", value: 62 },\n { label: \"W6\", value: 63 },\n { label: \"W7\", value: 65 },\n { label: \"W8\", value: 67 },\n { label: \"W9\", value: 66 },\n { label: \"W10\", value: 68 },\n { label: \"W11\", value: 70 },\n { label: \"W12\", value: 72 },\n ],\n subtitle: \"Pipeline, conversion efficiency, and channel performance\",\n summary: [\n { label: \"MQLs\", tone: \"success\", trend: \"+22.1% cycle\", value: \"3,940\" },\n { label: \"CAC\", tone: \"success\", trend: \"-7.4%\", value: \"$118\" },\n { label: \"Win Rate\", tone: \"info\", trend: \"+1.1 pts\", value: \"28.6%\" },\n { label: \"Churn Risk\", tone: \"warning\", trend: \"+0.8 pts\", value: \"6.2%\" },\n ],\n title: \"Growth & Marketing Report\",\n};\n\nexport const MarketingReportDocument = ({\n theme,\n data = sampleMarketingData,\n}: ReportTemplateProps) => (\n <ReportTemplateFrame\n theme={theme}\n data={data}\n titlePrefix=\"Growth Report\"\n statusLabel=\"Growth: Strong\"\n statusTone=\"success\"\n graphVariant=\"bar\"\n graphTitle=\"Pipeline build by week\"\n graphSubtitle=\"Demand creation output trend\"\n graphLegend=\"none\"\n graphShowValues\n graphColors={[\"#0EA5E9\"]}\n />\n);\n",+ "type": "registry:block",+ "target": "components/pdf/blocks/report-marketing/report-marketing.tsx"},{"path": "registry/bases/forme/blocks/report-marketing/report.types.ts","content": "export interface SummaryMetric {\n label: string;\n value: string;\n trend?: string;\n tone?: \"success\" | \"warning\" | \"destructive\" | \"info\";\n}\n\nexport type ReportRow = Record<string, unknown> & {\n label: string;\n owner: string;\n status: string;\n progress: number;\n risk?: string;\n};\n\nexport interface ReportSeriesPoint {\n label: string;\n value: number;\n}\n\nexport interface BaseReportData {\n title: string;\n subtitle: string;\n generatedAt: string;\n period: string;\n author: string;\n summary: SummaryMetric[];\n rows: ReportRow[];\n series: ReportSeriesPoint[];\n highlights: string[];\n}\n",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-marketing/report.types.ts"}],"type": "registry:block"diff --git a/public/r/forme/report-operations.json b/public/r/forme/report-operations.jsonindex 8a063c5..3719683 100644--- a/public/r/forme/report-operations.json+++ b/public/r/forme/report-operations.json@@ -13,18 +13,21 @@"files": [{"path": "registry/bases/forme/blocks/report-operations/report-layout.tsx",- "content": "import {\n Badge,\n DataTable,\n Divider,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Stack,\n Text,\n usePdfcnTheme,\n} from '../../components';\nimport type { PdfcnTheme } from '@/registry/themes';\nimport { Document, Page, StyleSheet, View } from \"@formepdf/react\";\nimport type { BaseReportData } from './report.types';\n\nexport interface ReportTemplateProps {\n theme?: PdfcnTheme;\n data?: BaseReportData;\n}\n\ntype ReportGraphVariant = 'bar' | 'horizontal-bar' | 'line' | 'area' | 'pie' | 'donut';\n\ninterface ReportLayoutProps {\n data: BaseReportData;\n titlePrefix: string;\n statusLabel: string;\n statusTone: 'success' | 'warning' | 'destructive' | 'info';\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: 'bottom' | 'right' | 'none';\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: Array<{ label: string; value: number }>;\n}\n\nfunction toneColor(theme: PdfcnTheme, tone: 'success' | 'warning' | 'destructive' | 'info') {\n if (tone === 'success') return theme.colors.success;\n if (tone === 'warning') return theme.colors.warning;\n if (tone === 'destructive') return theme.colors.destructive;\n return theme.colors.info;\n}\n\nexport function ReportLayout({\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend = 'none',\n graphShowValues = false,\n graphColors,\n graphData,\n}: ReportLayoutProps) {\n const theme = usePdfcnTheme();\n const accent = toneColor(theme, statusTone);\n\n const styles = StyleSheet.create({\n page: {\n paddingTop: theme.spacing.page.marginTop,\n paddingLeft: theme.spacing.page.marginLeft,\n paddingRight: theme.spacing.page.marginRight,\n paddingBottom: theme.spacing.page.marginBottom,\n backgroundColor: theme.colors.background,\n },\n toolbar: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n marginBottom: 8,\n },\n metricsGrid: {\n flexDirection: 'row',\n flexWrap: 'wrap',\n gap: 8,\n },\n metricCard: {\n width: '48.6%',\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n padding: 8,\n backgroundColor: theme.colors.background,\n },\n metricLabel: {\n fontSize: 8,\n textTransform: 'uppercase',\n color: theme.colors.mutedForeground,\n marginBottom: 2,\n letterSpacing: 0.5,\n },\n metricValue: {\n fontSize: 14,\n color: theme.colors.foreground,\n fontWeight: theme.primitives.fontWeights.bold,\n marginBottom: 2,\n },\n metricTrend: {\n fontSize: 9,\n color: theme.colors.mutedForeground,\n },\n graphShell: {\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n padding: 12,\n backgroundColor: theme.colors.background,\n },\n twoColumn: {\n flexDirection: 'row',\n gap: 10,\n alignItems: 'flex-start',\n },\n col: {\n flex: 1,\n },\n });\n\n return (\n <Document title={`${titlePrefix} ${data.period}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <PageHeader\n variant=\"two-column\"\n title={data.title}\n subtitle={`${titlePrefix} · ${data.subtitle}`}\n rightText={data.period}\n rightSubText={`Generated ${data.generatedAt}`}\n marginBottom={14}\n />\n\n <View style={styles.toolbar}>\n <Badge label={statusLabel} variant={statusTone} size=\"sm\" />\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Author: {data.author}\n </Text>\n </View>\n\n <Section variant=\"card\" padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Executive Summary\n </Text>\n <View style={styles.metricsGrid}>\n {data.summary.map((metric) => (\n <View\n key={metric.label}\n style={[\n styles.metricCard,\n {\n borderLeftWidth: 3,\n borderLeftColor: metric.tone ? toneColor(theme, metric.tone) : accent,\n },\n ] as never}\n >\n <Text style={styles.metricLabel} noMargin>\n {metric.label}\n </Text>\n <Text style={styles.metricValue} noMargin>\n {metric.value}\n </Text>\n {metric.trend ? (\n <Badge label={metric.trend} size=\"sm\" variant={metric.tone ?? 'info'} />\n ) : null}\n </View>\n ))}\n </View>\n </Section>\n\n <Section padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View style={styles.graphShell}>\n <PdfGraph\n variant={graphVariant}\n data={graphData ?? data.series}\n title={graphTitle}\n subtitle={graphSubtitle}\n yLabel={undefined}\n xLabel={undefined}\n showGrid={graphVariant !== 'pie' && graphVariant !== 'donut'}\n showValues={graphShowValues}\n smooth={graphVariant === 'line' || graphVariant === 'area'}\n legend={graphLegend}\n height={200}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section padding=\"md\">\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Delivery Table\n </Text>\n <DataTable\n variant=\"compact\"\n size=\"compact\"\n stripe\n columns={[\n { key: 'label', header: 'Stream' },\n { key: 'owner', header: 'Owner' },\n { key: 'status', header: 'Status', align: 'center' },\n {\n key: 'progress',\n header: 'Progress',\n align: 'right',\n render: (value) => `${String(value)}%`,\n },\n { key: 'risk', header: 'Risk', align: 'right' },\n ]}\n data={data.rows}\n footer={{\n label: 'Totals',\n owner: '-',\n status: '-',\n progress: Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n ),\n risk: '-',\n }}\n />\n </Section>\n\n <Section padding=\"md\" variant=\"card\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Highlights & Risks\n </Text>\n <View style={styles.twoColumn}>\n <View style={styles.col}>\n <PdfList\n variant=\"checklist\"\n items={data.highlights.map((item) => ({ text: item, checked: true }))}\n gap=\"sm\"\n />\n </View>\n <View style={styles.col}>\n <KeyValue\n size=\"sm\"\n divided\n items={[\n {\n key: 'Open Risks',\n value: `${data.rows.filter((r) => r.risk !== 'Low').length}`,\n },\n {\n key: 'On-Track Streams',\n value: `${data.rows.filter((r) => r.status === 'On Track').length}/${data.rows.length}`,\n },\n {\n key: 'Average Progress',\n value: `${Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n )}%`,\n },\n ]}\n />\n </View>\n </View>\n <Divider />\n <Stack gap=\"sm\">\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: keep each section under one page using `noWrap` for concise blocks.\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: pass explicit row keys/owners to avoid ambiguous reporting handoffs.\n </Text>\n </Stack>\n </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with PDFx\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </View></Page>\n </Document>\n );\n}\n\nexport function ReportTemplateFrame({\n theme,\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend,\n graphShowValues,\n graphColors,\n graphData,\n}: ReportTemplateProps & {\n titlePrefix: string;\n statusLabel: string;\n statusTone: 'success' | 'warning' | 'destructive' | 'info';\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: 'bottom' | 'right' | 'none';\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: Array<{ label: string; value: number }>;\n}) {\n if (!data) return null;\n\n return (\n <PdfcnThemeProvider theme={theme}>\n <ReportLayout\n data={data}\n titlePrefix={titlePrefix}\n statusLabel={statusLabel}\n statusTone={statusTone}\n graphVariant={graphVariant}\n graphTitle={graphTitle}\n graphSubtitle={graphSubtitle}\n graphLegend={graphLegend}\n graphShowValues={graphShowValues}\n graphColors={graphColors}\n graphData={graphData}\n />\n </PdfcnThemeProvider>\n );\n}\n",- "type": "registry:block"+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n Badge,\n DataTable,\n Divider,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Stack,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport 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\n const styles = StyleSheet.create({\n col: {\n flex: 1,\n },\n graphShell: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 12,\n },\n metricCard: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 8,\n width: \"48.6%\",\n },\n metricLabel: {\n color: theme.colors.mutedForeground,\n fontSize: 8,\n letterSpacing: 0.5,\n marginBottom: 2,\n textTransform: \"uppercase\",\n },\n metricTrend: {\n color: theme.colors.mutedForeground,\n fontSize: 9,\n },\n metricValue: {\n color: theme.colors.foreground,\n fontSize: 14,\n fontWeight: theme.primitives.fontWeights.bold,\n marginBottom: 2,\n },\n metricsGrid: {\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n paddingBottom: theme.spacing.page.marginBottom,\n paddingLeft: theme.spacing.page.marginLeft,\n paddingRight: theme.spacing.page.marginRight,\n paddingTop: theme.spacing.page.marginTop,\n },\n toolbar: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: 8,\n },\n twoColumn: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n gap: 10,\n },\n });\n\n return (\n <Document title={`${titlePrefix} ${data.period}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <PageHeader\n variant=\"two-column\"\n title={data.title}\n subtitle={`${titlePrefix} · ${data.subtitle}`}\n rightText={data.period}\n rightSubText={`Generated ${data.generatedAt}`}\n marginBottom={14}\n />\n\n <View style={styles.toolbar}>\n <Badge label={statusLabel} variant={statusTone} size=\"sm\" />\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Author: {data.author}\n </Text>\n </View>\n\n <Section variant=\"card\" padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Executive Summary\n </Text>\n <View style={styles.metricsGrid}>\n {data.summary.map((metric) => (\n <View\n key={metric.label}\n style={\n [\n styles.metricCard,\n {\n borderLeftColor: metric.tone\n ? toneColor(theme, metric.tone)\n : accent,\n borderLeftWidth: 3,\n },\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 />\n ) : null}\n </View>\n ))}\n </View>\n </Section>\n\n <Section padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View style={styles.graphShell}>\n <PdfGraph\n variant={graphVariant}\n data={graphData ?? data.series}\n title={graphTitle}\n subtitle={graphSubtitle}\n yLabel={undefined}\n xLabel={undefined}\n showGrid={graphVariant !== \"pie\" && graphVariant !== \"donut\"}\n showValues={graphShowValues}\n smooth={graphVariant === \"line\" || graphVariant === \"area\"}\n legend={graphLegend}\n height={200}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section padding=\"md\">\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Delivery Table\n </Text>\n <DataTable\n variant=\"compact\"\n size=\"compact\"\n stripe\n columns={[\n { header: \"Stream\", key: \"label\" },\n { header: \"Owner\", key: \"owner\" },\n { align: \"center\", header: \"Status\", key: \"status\" },\n {\n align: \"right\",\n header: \"Progress\",\n key: \"progress\",\n render: (value) => `${String(value)}%`,\n },\n { align: \"right\", header: \"Risk\", key: \"risk\" },\n ]}\n data={data.rows}\n footer={{\n label: \"Totals\",\n owner: \"-\",\n progress: Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n ),\n risk: \"-\",\n status: \"-\",\n }}\n />\n </Section>\n\n <Section padding=\"md\" variant=\"card\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Highlights & Risks\n </Text>\n <View style={styles.twoColumn}>\n <View style={styles.col}>\n <PdfList\n variant=\"checklist\"\n items={data.highlights.map((item) => ({\n checked: true,\n text: item,\n }))}\n gap=\"sm\"\n />\n </View>\n <View style={styles.col}>\n <KeyValue\n size=\"sm\"\n divided\n items={[\n {\n key: \"Open Risks\",\n value: `${data.rows.filter((r) => r.risk !== \"Low\").length}`,\n },\n {\n key: \"On-Track Streams\",\n value: `${data.rows.filter((r) => r.status === \"On Track\").length}/${data.rows.length}`,\n },\n {\n key: \"Average Progress\",\n value: `${Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n )}%`,\n },\n ]}\n />\n </View>\n </View>\n <Divider />\n <Stack gap=\"sm\">\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: keep each section under one page using `noWrap`\n for concise blocks.\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: pass explicit row keys/owners to avoid ambiguous\n reporting handoffs.\n </Text>\n </Stack>\n </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with PDFx\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </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"},{"path": "registry/bases/forme/blocks/report-operations/report-operations.tsx",- "content": "import { ReportTemplateFrame } from './report-layout';\nimport type { ReportTemplateProps } from './report-layout';\nimport type { BaseReportData } from \"./report.types\";\n\nconst sampleOperationsData: BaseReportData = {\n author: \"Delivery Office\",\n generatedAt: \"February 23, 2026\",\n highlights: [\n \"SLA improved after shift rebalancing and incident triage changes.\",\n \"Backlog grew in week 4 due to release-related ticket surge.\",\n \"Incident queue remediation plan has executive sponsorship and budget.\",\n ],\n period: \"February 2026\",\n rows: [\n {\n label: \"L1 Support\",\n owner: \"N. Mehta\",\n status: \"On Track\",\n progress: 91,\n risk: \"Low\",\n },\n {\n label: \"L2 Support\",\n owner: \"D. Chen\",\n status: \"On Track\",\n progress: 85,\n risk: \"Low\",\n },\n {\n label: \"Incident Queue\",\n owner: \"R. Walker\",\n status: \"At Risk\",\n progress: 66,\n risk: \"High\",\n },\n {\n label: \"Automation Rollout\",\n owner: \"M. Roy\",\n status: \"On Track\",\n progress: 77,\n risk: \"Medium\",\n },\n ],\n series: [\n { label: \"W1\", value: 69 },\n { label: \"W2\", value: 71 },\n { label: \"W3\", value: 73 },\n { label: \"W4\", value: 74 },\n { label: \"W5\", value: 75 },\n { label: \"W6\", value: 76 },\n { label: \"W7\", value: 78 },\n { label: \"W8\", value: 79 },\n { label: \"W9\", value: 78 },\n { label: \"W10\", value: 80 },\n { label: \"W11\", value: 81 },\n { label: \"W12\", value: 83 },\n ],\n subtitle: \"Delivery throughput, SLA adherence, and backlog visibility\",\n summary: [\n {\n label: \"Tickets Closed\",\n value: \"1,284\",\n trend: \"+9.8% MoM\",\n tone: \"success\",\n },\n {\n label: \"SLA Hit Rate\",\n value: \"96.1%\",\n trend: \"+1.4 pts\",\n tone: \"success\",\n },\n { label: \"Backlog\", value: \"214\", trend: \"+6.0%\", tone: \"warning\" },\n { label: \"Escalations\", value: \"17\", trend: \"-18.5%\", tone: \"success\" },\n ],\n title: \"Monthly Operations Report\",\n};\n\nexport function OperationsReportDocument({\n theme,\n data = sampleOperationsData,\n}: ReportTemplateProps) {\n return (\n <ReportTemplateFrame\n theme={theme}\n data={data}\n titlePrefix=\"Operations Report\"\n statusLabel=\"Ops: Watch\"\n statusTone=\"warning\"\n graphVariant=\"horizontal-bar\"\n graphTitle=\"Throughput by week\"\n graphSubtitle=\"Resolved workload distribution\"\n graphLegend=\"none\"\n graphShowValues\n graphColors={[\"#2563EB\"]}\n graphData={[\n { label: \"Incident\", value: 66 },\n { label: \"Automation\", value: 77 },\n { label: \"L2 Support\", value: 85 },\n { label: \"L1 Support\", value: 91 },\n ]}\n />\n );\n}\n",- "type": "registry:block"+ "content": "import { ReportTemplateFrame } from \"./report-layout\";\nimport type { ReportTemplateProps } from \"./report-layout\";\nimport type { BaseReportData } from \"./report.types\";\n\nconst sampleOperationsData: BaseReportData = {\n author: \"Delivery Office\",\n generatedAt: \"February 23, 2026\",\n highlights: [\n \"SLA improved after shift rebalancing and incident triage changes.\",\n \"Backlog grew in week 4 due to release-related ticket surge.\",\n \"Incident queue remediation plan has executive sponsorship and budget.\",\n ],\n period: \"February 2026\",\n rows: [\n {\n label: \"L1 Support\",\n owner: \"N. Mehta\",\n progress: 91,\n risk: \"Low\",\n status: \"On Track\",\n },\n {\n label: \"L2 Support\",\n owner: \"D. Chen\",\n progress: 85,\n risk: \"Low\",\n status: \"On Track\",\n },\n {\n label: \"Incident Queue\",\n owner: \"R. Walker\",\n progress: 66,\n risk: \"High\",\n status: \"At Risk\",\n },\n {\n label: \"Automation Rollout\",\n owner: \"M. Roy\",\n progress: 77,\n risk: \"Medium\",\n status: \"On Track\",\n },\n ],\n series: [\n { label: \"W1\", value: 69 },\n { label: \"W2\", value: 71 },\n { label: \"W3\", value: 73 },\n { label: \"W4\", value: 74 },\n { label: \"W5\", value: 75 },\n { label: \"W6\", value: 76 },\n { label: \"W7\", value: 78 },\n { label: \"W8\", value: 79 },\n { label: \"W9\", value: 78 },\n { label: \"W10\", value: 80 },\n { label: \"W11\", value: 81 },\n { label: \"W12\", value: 83 },\n ],\n subtitle: \"Delivery throughput, SLA adherence, and backlog visibility\",\n summary: [\n {\n label: \"Tickets Closed\",\n tone: \"success\",\n trend: \"+9.8% MoM\",\n value: \"1,284\",\n },\n {\n label: \"SLA Hit Rate\",\n tone: \"success\",\n trend: \"+1.4 pts\",\n value: \"96.1%\",\n },\n { label: \"Backlog\", tone: \"warning\", trend: \"+6.0%\", value: \"214\" },\n { label: \"Escalations\", tone: \"success\", trend: \"-18.5%\", value: \"17\" },\n ],\n title: \"Monthly Operations Report\",\n};\n\nexport const OperationsReportDocument = ({\n theme,\n data = sampleOperationsData,\n}: ReportTemplateProps) => (\n <ReportTemplateFrame\n theme={theme}\n data={data}\n titlePrefix=\"Operations Report\"\n statusLabel=\"Ops: Watch\"\n statusTone=\"warning\"\n graphVariant=\"horizontal-bar\"\n graphTitle=\"Throughput by week\"\n graphSubtitle=\"Resolved workload distribution\"\n graphLegend=\"none\"\n graphShowValues\n graphColors={[\"#2563EB\"]}\n graphData={[\n { label: \"Incident\", value: 66 },\n { label: \"Automation\", value: 77 },\n { label: \"L2 Support\", value: 85 },\n { label: \"L1 Support\", value: 91 },\n ]}\n />\n);\n",+ "type": "registry:block",+ "target": "components/pdf/blocks/report-operations/report-operations.tsx"},{"path": "registry/bases/forme/blocks/report-operations/report.types.ts","content": "export interface SummaryMetric {\n label: string;\n value: string;\n trend?: string;\n tone?: \"success\" | \"warning\" | \"destructive\" | \"info\";\n}\n\nexport type ReportRow = Record<string, unknown> & {\n label: string;\n owner: string;\n status: string;\n progress: number;\n risk?: string;\n};\n\nexport interface ReportSeriesPoint {\n label: string;\n value: number;\n}\n\nexport interface BaseReportData {\n title: string;\n subtitle: string;\n generatedAt: string;\n period: string;\n author: string;\n summary: SummaryMetric[];\n rows: ReportRow[];\n series: ReportSeriesPoint[];\n highlights: string[];\n}\n",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-operations/report.types.ts"}],"type": "registry:block"diff --git a/public/r/forme/report-security.json b/public/r/forme/report-security.jsonindex f029243..1607327 100644--- a/public/r/forme/report-security.json+++ b/public/r/forme/report-security.json@@ -13,18 +13,21 @@"files": [{"path": "registry/bases/forme/blocks/report-security/report-layout.tsx",- "content": "import {\n Badge,\n DataTable,\n Divider,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Stack,\n Text,\n usePdfcnTheme,\n} from '../../components';\nimport type { PdfcnTheme } from '@/registry/themes';\nimport { Document, Page, StyleSheet, View } from \"@formepdf/react\";\nimport type { BaseReportData } from './report.types';\n\nexport interface ReportTemplateProps {\n theme?: PdfcnTheme;\n data?: BaseReportData;\n}\n\ntype ReportGraphVariant = 'bar' | 'horizontal-bar' | 'line' | 'area' | 'pie' | 'donut';\n\ninterface ReportLayoutProps {\n data: BaseReportData;\n titlePrefix: string;\n statusLabel: string;\n statusTone: 'success' | 'warning' | 'destructive' | 'info';\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: 'bottom' | 'right' | 'none';\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: Array<{ label: string; value: number }>;\n}\n\nfunction toneColor(theme: PdfcnTheme, tone: 'success' | 'warning' | 'destructive' | 'info') {\n if (tone === 'success') return theme.colors.success;\n if (tone === 'warning') return theme.colors.warning;\n if (tone === 'destructive') return theme.colors.destructive;\n return theme.colors.info;\n}\n\nexport function ReportLayout({\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend = 'none',\n graphShowValues = false,\n graphColors,\n graphData,\n}: ReportLayoutProps) {\n const theme = usePdfcnTheme();\n const accent = toneColor(theme, statusTone);\n\n const styles = StyleSheet.create({\n page: {\n paddingTop: theme.spacing.page.marginTop,\n paddingLeft: theme.spacing.page.marginLeft,\n paddingRight: theme.spacing.page.marginRight,\n paddingBottom: theme.spacing.page.marginBottom,\n backgroundColor: theme.colors.background,\n },\n toolbar: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n marginBottom: 8,\n },\n metricsGrid: {\n flexDirection: 'row',\n flexWrap: 'wrap',\n gap: 8,\n },\n metricCard: {\n width: '48.6%',\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n padding: 8,\n backgroundColor: theme.colors.background,\n },\n metricLabel: {\n fontSize: 8,\n textTransform: 'uppercase',\n color: theme.colors.mutedForeground,\n marginBottom: 2,\n letterSpacing: 0.5,\n },\n metricValue: {\n fontSize: 14,\n color: theme.colors.foreground,\n fontWeight: theme.primitives.fontWeights.bold,\n marginBottom: 2,\n },\n metricTrend: {\n fontSize: 9,\n color: theme.colors.mutedForeground,\n },\n graphShell: {\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n padding: 12,\n backgroundColor: theme.colors.background,\n },\n twoColumn: {\n flexDirection: 'row',\n gap: 10,\n alignItems: 'flex-start',\n },\n col: {\n flex: 1,\n },\n });\n\n return (\n <Document title={`${titlePrefix} ${data.period}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <PageHeader\n variant=\"two-column\"\n title={data.title}\n subtitle={`${titlePrefix} · ${data.subtitle}`}\n rightText={data.period}\n rightSubText={`Generated ${data.generatedAt}`}\n marginBottom={14}\n />\n\n <View style={styles.toolbar}>\n <Badge label={statusLabel} variant={statusTone} size=\"sm\" />\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Author: {data.author}\n </Text>\n </View>\n\n <Section variant=\"card\" padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Executive Summary\n </Text>\n <View style={styles.metricsGrid}>\n {data.summary.map((metric) => (\n <View\n key={metric.label}\n style={[\n styles.metricCard,\n {\n borderLeftWidth: 3,\n borderLeftColor: metric.tone ? toneColor(theme, metric.tone) : accent,\n },\n ] as never}\n >\n <Text style={styles.metricLabel} noMargin>\n {metric.label}\n </Text>\n <Text style={styles.metricValue} noMargin>\n {metric.value}\n </Text>\n {metric.trend ? (\n <Badge label={metric.trend} size=\"sm\" variant={metric.tone ?? 'info'} />\n ) : null}\n </View>\n ))}\n </View>\n </Section>\n\n <Section padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View style={styles.graphShell}>\n <PdfGraph\n variant={graphVariant}\n data={graphData ?? data.series}\n title={graphTitle}\n subtitle={graphSubtitle}\n yLabel={undefined}\n xLabel={undefined}\n showGrid={graphVariant !== 'pie' && graphVariant !== 'donut'}\n showValues={graphShowValues}\n smooth={graphVariant === 'line' || graphVariant === 'area'}\n legend={graphLegend}\n height={200}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section padding=\"md\">\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Delivery Table\n </Text>\n <DataTable\n variant=\"compact\"\n size=\"compact\"\n stripe\n columns={[\n { key: 'label', header: 'Stream' },\n { key: 'owner', header: 'Owner' },\n { key: 'status', header: 'Status', align: 'center' },\n {\n key: 'progress',\n header: 'Progress',\n align: 'right',\n render: (value) => `${String(value)}%`,\n },\n { key: 'risk', header: 'Risk', align: 'right' },\n ]}\n data={data.rows}\n footer={{\n label: 'Totals',\n owner: '-',\n status: '-',\n progress: Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n ),\n risk: '-',\n }}\n />\n </Section>\n\n <Section padding=\"md\" variant=\"card\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Highlights & Risks\n </Text>\n <View style={styles.twoColumn}>\n <View style={styles.col}>\n <PdfList\n variant=\"checklist\"\n items={data.highlights.map((item) => ({ text: item, checked: true }))}\n gap=\"sm\"\n />\n </View>\n <View style={styles.col}>\n <KeyValue\n size=\"sm\"\n divided\n items={[\n {\n key: 'Open Risks',\n value: `${data.rows.filter((r) => r.risk !== 'Low').length}`,\n },\n {\n key: 'On-Track Streams',\n value: `${data.rows.filter((r) => r.status === 'On Track').length}/${data.rows.length}`,\n },\n {\n key: 'Average Progress',\n value: `${Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n )}%`,\n },\n ]}\n />\n </View>\n </View>\n <Divider />\n <Stack gap=\"sm\">\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: keep each section under one page using `noWrap` for concise blocks.\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: pass explicit row keys/owners to avoid ambiguous reporting handoffs.\n </Text>\n </Stack>\n </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with PDFx\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </View></Page>\n </Document>\n );\n}\n\nexport function ReportTemplateFrame({\n theme,\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend,\n graphShowValues,\n graphColors,\n graphData,\n}: ReportTemplateProps & {\n titlePrefix: string;\n statusLabel: string;\n statusTone: 'success' | 'warning' | 'destructive' | 'info';\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: 'bottom' | 'right' | 'none';\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: Array<{ label: string; value: number }>;\n}) {\n if (!data) return null;\n\n return (\n <PdfcnThemeProvider theme={theme}>\n <ReportLayout\n data={data}\n titlePrefix={titlePrefix}\n statusLabel={statusLabel}\n statusTone={statusTone}\n graphVariant={graphVariant}\n graphTitle={graphTitle}\n graphSubtitle={graphSubtitle}\n graphLegend={graphLegend}\n graphShowValues={graphShowValues}\n graphColors={graphColors}\n graphData={graphData}\n />\n </PdfcnThemeProvider>\n );\n}\n",- "type": "registry:block"+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n Badge,\n DataTable,\n Divider,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Stack,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport 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\n const styles = StyleSheet.create({\n col: {\n flex: 1,\n },\n graphShell: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 12,\n },\n metricCard: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 8,\n width: \"48.6%\",\n },\n metricLabel: {\n color: theme.colors.mutedForeground,\n fontSize: 8,\n letterSpacing: 0.5,\n marginBottom: 2,\n textTransform: \"uppercase\",\n },\n metricTrend: {\n color: theme.colors.mutedForeground,\n fontSize: 9,\n },\n metricValue: {\n color: theme.colors.foreground,\n fontSize: 14,\n fontWeight: theme.primitives.fontWeights.bold,\n marginBottom: 2,\n },\n metricsGrid: {\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n paddingBottom: theme.spacing.page.marginBottom,\n paddingLeft: theme.spacing.page.marginLeft,\n paddingRight: theme.spacing.page.marginRight,\n paddingTop: theme.spacing.page.marginTop,\n },\n toolbar: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: 8,\n },\n twoColumn: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n gap: 10,\n },\n });\n\n return (\n <Document title={`${titlePrefix} ${data.period}`}>\n <Page size=\"A4\" margin={48}>\n <View style={styles.page as never}>\n <PageHeader\n variant=\"two-column\"\n title={data.title}\n subtitle={`${titlePrefix} · ${data.subtitle}`}\n rightText={data.period}\n rightSubText={`Generated ${data.generatedAt}`}\n marginBottom={14}\n />\n\n <View style={styles.toolbar}>\n <Badge label={statusLabel} variant={statusTone} size=\"sm\" />\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Author: {data.author}\n </Text>\n </View>\n\n <Section variant=\"card\" padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Executive Summary\n </Text>\n <View style={styles.metricsGrid}>\n {data.summary.map((metric) => (\n <View\n key={metric.label}\n style={\n [\n styles.metricCard,\n {\n borderLeftColor: metric.tone\n ? toneColor(theme, metric.tone)\n : accent,\n borderLeftWidth: 3,\n },\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 />\n ) : null}\n </View>\n ))}\n </View>\n </Section>\n\n <Section padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View style={styles.graphShell}>\n <PdfGraph\n variant={graphVariant}\n data={graphData ?? data.series}\n title={graphTitle}\n subtitle={graphSubtitle}\n yLabel={undefined}\n xLabel={undefined}\n showGrid={graphVariant !== \"pie\" && graphVariant !== \"donut\"}\n showValues={graphShowValues}\n smooth={graphVariant === \"line\" || graphVariant === \"area\"}\n legend={graphLegend}\n height={200}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section padding=\"md\">\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Delivery Table\n </Text>\n <DataTable\n variant=\"compact\"\n size=\"compact\"\n stripe\n columns={[\n { header: \"Stream\", key: \"label\" },\n { header: \"Owner\", key: \"owner\" },\n { align: \"center\", header: \"Status\", key: \"status\" },\n {\n align: \"right\",\n header: \"Progress\",\n key: \"progress\",\n render: (value) => `${String(value)}%`,\n },\n { align: \"right\", header: \"Risk\", key: \"risk\" },\n ]}\n data={data.rows}\n footer={{\n label: \"Totals\",\n owner: \"-\",\n progress: Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n ),\n risk: \"-\",\n status: \"-\",\n }}\n />\n </Section>\n\n <Section padding=\"md\" variant=\"card\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Highlights & Risks\n </Text>\n <View style={styles.twoColumn}>\n <View style={styles.col}>\n <PdfList\n variant=\"checklist\"\n items={data.highlights.map((item) => ({\n checked: true,\n text: item,\n }))}\n gap=\"sm\"\n />\n </View>\n <View style={styles.col}>\n <KeyValue\n size=\"sm\"\n divided\n items={[\n {\n key: \"Open Risks\",\n value: `${data.rows.filter((r) => r.risk !== \"Low\").length}`,\n },\n {\n key: \"On-Track Streams\",\n value: `${data.rows.filter((r) => r.status === \"On Track\").length}/${data.rows.length}`,\n },\n {\n key: \"Average Progress\",\n value: `${Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n )}%`,\n },\n ]}\n />\n </View>\n </View>\n <Divider />\n <Stack gap=\"sm\">\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: keep each section under one page using `noWrap`\n for concise blocks.\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: pass explicit row keys/owners to avoid ambiguous\n reporting handoffs.\n </Text>\n </Stack>\n </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with PDFx\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </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"},{"path": "registry/bases/forme/blocks/report-security/report-security.tsx",- "content": "import { ReportTemplateFrame } from './report-layout';\nimport type { ReportTemplateProps } from './report-layout';\nimport type { BaseReportData } from \"./report.types\";\n\nconst sampleSecurityData: BaseReportData = {\n author: \"Security Engineering\",\n generatedAt: \"February 23, 2026\",\n highlights: [\n \"Critical vulnerabilities reduced through mandatory patch windows.\",\n \"Secrets rotation remains the highest-risk stream and needs additional staffing.\",\n \"External penetration test scheduled for next sprint to validate fixes.\",\n ],\n period: \"Sprint 05, 2026\",\n rows: [\n {\n label: \"Identity Hardening\",\n owner: \"E. Brown\",\n status: \"On Track\",\n progress: 87,\n risk: \"Low\",\n },\n {\n label: \"Secrets Rotation\",\n owner: \"P. Nair\",\n status: \"At Risk\",\n progress: 58,\n risk: \"High\",\n },\n {\n label: \"Dependency Scanning\",\n owner: \"I. Shah\",\n status: \"On Track\",\n progress: 81,\n risk: \"Medium\",\n },\n {\n label: \"WAF Policy\",\n owner: \"S. Reed\",\n status: \"On Track\",\n progress: 76,\n risk: \"Low\",\n },\n ],\n series: [\n { label: \"W1\", value: 61 },\n { label: \"W2\", value: 63 },\n { label: \"W3\", value: 64 },\n { label: \"W4\", value: 66 },\n { label: \"W5\", value: 67 },\n { label: \"W6\", value: 68 },\n { label: \"W7\", value: 69 },\n { label: \"W8\", value: 71 },\n { label: \"W9\", value: 72 },\n { label: \"W10\", value: 74 },\n { label: \"W11\", value: 76 },\n { label: \"W12\", value: 78 },\n ],\n subtitle: \"Vulnerability trends, control maturity, and remediation health\",\n summary: [\n {\n label: \"Critical Vulns\",\n value: \"2\",\n trend: \"-3 from last sprint\",\n tone: \"success\",\n },\n { label: \"Patch SLA\", value: \"92.0%\", trend: \"+5.3 pts\", tone: \"success\" },\n { label: \"Open Findings\", value: \"41\", trend: \"+4\", tone: \"warning\" },\n { label: \"Control Score\", value: \"84/100\", trend: \"+2 pts\", tone: \"info\" },\n ],\n title: \"Security Posture Report\",\n};\n\nexport function SecurityReportDocument({\n theme,\n data = sampleSecurityData,\n}: ReportTemplateProps) {\n return (\n <ReportTemplateFrame\n theme={theme}\n data={data}\n titlePrefix=\"Security Report\"\n statusLabel=\"Security: Action Needed\"\n statusTone=\"destructive\"\n graphVariant=\"donut\"\n graphTitle=\"Open risk distribution\"\n graphSubtitle=\"High/Medium/Low workload share\"\n graphLegend=\"right\"\n graphShowValues\n graphColors={[\"#DC2626\", \"#F59E0B\", \"#16A34A\", \"#0EA5E9\"]}\n graphData={[\n { label: \"High Risk\", value: 14 },\n { label: \"Medium Risk\", value: 17 },\n { label: \"Low Risk\", value: 8 },\n { label: \"Info\", value: 4 },\n ]}\n />\n );\n}\n",- "type": "registry:block"+ "content": "import { ReportTemplateFrame } from \"./report-layout\";\nimport type { ReportTemplateProps } from \"./report-layout\";\nimport type { BaseReportData } from \"./report.types\";\n\nconst sampleSecurityData: BaseReportData = {\n author: \"Security Engineering\",\n generatedAt: \"February 23, 2026\",\n highlights: [\n \"Critical vulnerabilities reduced through mandatory patch windows.\",\n \"Secrets rotation remains the highest-risk stream and needs additional staffing.\",\n \"External penetration test scheduled for next sprint to validate fixes.\",\n ],\n period: \"Sprint 05, 2026\",\n rows: [\n {\n label: \"Identity Hardening\",\n owner: \"E. Brown\",\n progress: 87,\n risk: \"Low\",\n status: \"On Track\",\n },\n {\n label: \"Secrets Rotation\",\n owner: \"P. Nair\",\n progress: 58,\n risk: \"High\",\n status: \"At Risk\",\n },\n {\n label: \"Dependency Scanning\",\n owner: \"I. Shah\",\n progress: 81,\n risk: \"Medium\",\n status: \"On Track\",\n },\n {\n label: \"WAF Policy\",\n owner: \"S. Reed\",\n progress: 76,\n risk: \"Low\",\n status: \"On Track\",\n },\n ],\n series: [\n { label: \"W1\", value: 61 },\n { label: \"W2\", value: 63 },\n { label: \"W3\", value: 64 },\n { label: \"W4\", value: 66 },\n { label: \"W5\", value: 67 },\n { label: \"W6\", value: 68 },\n { label: \"W7\", value: 69 },\n { label: \"W8\", value: 71 },\n { label: \"W9\", value: 72 },\n { label: \"W10\", value: 74 },\n { label: \"W11\", value: 76 },\n { label: \"W12\", value: 78 },\n ],\n subtitle: \"Vulnerability trends, control maturity, and remediation health\",\n summary: [\n {\n label: \"Critical Vulns\",\n tone: \"success\",\n trend: \"-3 from last sprint\",\n value: \"2\",\n },\n { label: \"Patch SLA\", tone: \"success\", trend: \"+5.3 pts\", value: \"92.0%\" },\n { label: \"Open Findings\", tone: \"warning\", trend: \"+4\", value: \"41\" },\n { label: \"Control Score\", tone: \"info\", trend: \"+2 pts\", value: \"84/100\" },\n ],\n title: \"Security Posture Report\",\n};\n\nexport const SecurityReportDocument = ({\n theme,\n data = sampleSecurityData,\n}: ReportTemplateProps) => (\n <ReportTemplateFrame\n theme={theme}\n data={data}\n titlePrefix=\"Security Report\"\n statusLabel=\"Security: Action Needed\"\n statusTone=\"destructive\"\n graphVariant=\"donut\"\n graphTitle=\"Open risk distribution\"\n graphSubtitle=\"High/Medium/Low workload share\"\n graphLegend=\"right\"\n graphShowValues\n graphColors={[\"#DC2626\", \"#F59E0B\", \"#16A34A\", \"#0EA5E9\"]}\n graphData={[\n { label: \"High Risk\", value: 14 },\n { label: \"Medium Risk\", value: 17 },\n { label: \"Low Risk\", value: 8 },\n { label: \"Info\", value: 4 },\n ]}\n />\n);\n",+ "type": "registry:block",+ "target": "components/pdf/blocks/report-security/report-security.tsx"},{"path": "registry/bases/forme/blocks/report-security/report.types.ts","content": "export interface SummaryMetric {\n label: string;\n value: string;\n trend?: string;\n tone?: \"success\" | \"warning\" | \"destructive\" | \"info\";\n}\n\nexport type ReportRow = Record<string, unknown> & {\n label: string;\n owner: string;\n status: string;\n progress: number;\n risk?: string;\n};\n\nexport interface ReportSeriesPoint {\n label: string;\n value: number;\n}\n\nexport interface BaseReportData {\n title: string;\n subtitle: string;\n generatedAt: string;\n period: string;\n author: string;\n summary: SummaryMetric[];\n rows: ReportRow[];\n series: ReportSeriesPoint[];\n highlights: string[];\n}\n",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-security/report.types.ts"}],"type": "registry:block"diff --git a/public/r/forme/section.json b/public/r/forme/section.jsonindex a5f5c41..387d28a 100644--- a/public/r/forme/section.json+++ b/public/r/forme/section.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/forme/components/section/section.tsx",- "content": "import { StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type SectionSpacing = \"none\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\nexport type SectionPadding = \"none\" | \"sm\" | \"md\" | \"lg\";\nexport type SectionVariant = \"default\" | \"callout\" | \"highlight\" | \"card\";\n\n/**\n * Layout container with spacing, padding, and visual style variants.\n * Props - `spacing` | `padding` | `background` | `border` | `variant` | `accentColor` | `noWrap` | `children` | `style`\n * @see {@link SectionProps}\n */\nexport interface SectionProps extends PDFComponentProps {\n /**\n * @default 'md'\n */\n spacing?: SectionSpacing;\n padding?: SectionPadding;\n background?: string;\n /**\n * @default false\n */\n border?: boolean;\n /**\n * @default 'default'\n */\n variant?: SectionVariant;\n accentColor?: string;\n /**\n * @default false\n */\n noWrap?: boolean;\n}\n\nfunction createSectionStyles(t: PdfcnTheme) {\n const { spacing, borderRadius } = t.primitives;\n return StyleSheet.create({\n base: { flexDirection: \"column\" },\n border: {\n borderColor: t.colors.border,\n borderRadius: borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: spacing[0.5],\n },\n callout: {\n borderLeftColor: t.colors.primary,\n borderLeftStyle: \"solid\",\n borderLeftWidth: spacing[1],\n paddingLeft: spacing[4],\n paddingVertical: spacing[2],\n },\n card: {\n borderColor: t.colors.border,\n borderRadius: borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: spacing[0.5],\n padding: spacing[4],\n },\n highlight: {\n backgroundColor: t.colors.muted,\n borderLeftColor: t.colors.primary,\n borderLeftStyle: \"solid\",\n borderLeftWidth: spacing[1],\n padding: spacing[4],\n },\n paddingLg: { padding: spacing[6] },\n paddingMd: { padding: spacing[4] },\n paddingNone: { padding: spacing[0] },\n paddingSm: { padding: spacing[3] },\n spacingLg: { marginVertical: spacing[8] },\n spacingMd: { marginVertical: t.spacing.sectionGap },\n spacingNone: { marginVertical: spacing[0] },\n spacingSm: { marginVertical: spacing[4] },\n spacingXl: { marginVertical: spacing[12] },\n });\n}\n\nexport function Section({\n spacing = \"md\",\n padding,\n background,\n border,\n variant = \"default\",\n accentColor,\n noWrap = false,\n children,\n style,\n}: SectionProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createSectionStyles(theme), [theme]);\n const spacingMap = {\n lg: styles.spacingLg,\n md: styles.spacingMd,\n none: styles.spacingNone,\n sm: styles.spacingSm,\n xl: styles.spacingXl,\n };\n const paddingMap = {\n lg: styles.paddingLg,\n md: styles.paddingMd,\n none: styles.paddingNone,\n sm: styles.paddingSm,\n };\n const variantMap: Record<SectionVariant, Style | null> = {\n callout: styles.callout,\n card: styles.card,\n default: null,\n highlight: styles.highlight,\n };\n const styleArray: Style[] = [styles.base, spacingMap[spacing]];\n const variantStyle = variantMap[variant];\n if (variantStyle) {styleArray.push(variantStyle);}\n if (accentColor && (variant === \"callout\" || variant === \"highlight\")) {\n styleArray.push({\n borderLeftColor: resolveColor(accentColor, theme.colors),\n });\n }\n if (padding && padding in paddingMap) {styleArray.push(paddingMap[padding]);}\n if (border && variant === \"default\") {styleArray.push(styles.border);}\n if (background)\n {styleArray.push({\n backgroundColor: resolveColor(background, theme.colors),\n });}\n if (style) {styleArray.push(...[style].flat());}\n return (\n <View wrap={noWrap ? false : undefined} style={styleArray as never}>\n {children}\n </View>\n );\n}\n",- "type": "registry:component"+ "content": "import { StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type SectionSpacing = \"none\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\nexport type SectionPadding = \"none\" | \"sm\" | \"md\" | \"lg\";\nexport type SectionVariant = \"default\" | \"callout\" | \"highlight\" | \"card\";\n\n/**\n * Layout container with spacing, padding, and visual style variants.\n * Props - `spacing` | `padding` | `background` | `border` | `variant` | `accentColor` | `noWrap` | `children` | `style`\n * @see {@link SectionProps}\n */\nexport interface SectionProps extends PDFComponentProps {\n /**\n * @default 'md'\n */\n spacing?: SectionSpacing;\n padding?: SectionPadding;\n background?: string;\n /**\n * @default false\n */\n border?: boolean;\n /**\n * @default 'default'\n */\n variant?: SectionVariant;\n accentColor?: string;\n /**\n * @default false\n */\n noWrap?: boolean;\n}\n\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={styleArray as never}>\n {children}\n </View>\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/section/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/signature.json b/public/r/forme/signature.jsonindex 0e20a93..7797e60 100644--- a/public/r/forme/signature.json+++ b/public/r/forme/signature.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/forme/components/signature/signature.tsx",- "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\n\nexport type SignatureVariant = \"single\" | \"double\" | \"inline\";\n\n/**\n * Signature signer properties.\n * Props - `label` | `name` | `title` | `date`\n * @see {@link SignatureSigner}\n */\nexport interface SignatureSigner {\n label?: string;\n name?: string;\n title?: string;\n date?: string;\n}\n\n/**\n * Signature block properties.\n * Props - `variant` | `label` | `name` | `title` | `date` | `signers` | `style`\n * @see {@link PdfSignatureBlockProps}\n */\nexport interface PdfSignatureBlockProps {\n /**\n * Layout variant: [single, double, inline]\n * @default 'single'\n */\n variant?: SignatureVariant;\n label?: string;\n name?: string;\n title?: string;\n date?: string;\n signers?: [SignatureSigner, SignatureSigner];\n style?: Style;\n}\n\nfunction createSignatureStyles(t: PdfcnTheme) {\n const { spacing, fontWeights, typography } = t.primitives;\n return StyleSheet.create({\n block: { flex: 1, minWidth: 140 },\n container: {\n marginBottom: t.spacing.componentGap,\n marginTop: t.spacing.sectionGap,\n },\n dateText: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n marginTop: 1,\n },\n doubleRow: {\n flexDirection: \"row\",\n gap: spacing[8],\n justifyContent: \"space-between\",\n },\n inlineLabel: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n },\n inlineLine: {\n borderBottomColor: t.colors.foreground,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n height: spacing[5],\n minWidth: 120,\n paddingHorizontal: spacing[2],\n },\n inlineName: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n },\n inlineRow: {\n alignItems: \"center\",\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: spacing[3],\n },\n label: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n marginBottom: spacing[1],\n },\n line: {\n borderBottomColor: t.colors.foreground,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n marginBottom: spacing[1],\n minHeight: spacing[6],\n },\n name: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n },\n titleText: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n },\n });\n}\n\nfunction renderSignerBlock(\n signer: SignatureSigner,\n styles: ReturnType<typeof createSignatureStyles>\n) {\n return (\n <View style={styles.block}>\n {signer.label ? (\n <PDFText style={styles.label}>{signer.label}</PDFText>\n ) : null}\n <View style={styles.line} />\n {signer.name ? (\n <PDFText style={styles.name}>{signer.name}</PDFText>\n ) : null}\n {signer.title ? (\n <PDFText style={styles.titleText}>{signer.title}</PDFText>\n ) : null}\n {signer.date ? (\n <PDFText style={styles.dateText}>{signer.date}</PDFText>\n ) : null}\n </View>\n );\n}\n\nexport function PdfSignatureBlock({\n variant = \"single\",\n label = \"Signature\",\n name,\n title,\n date,\n signers,\n style,\n}: PdfSignatureBlockProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createSignatureStyles(theme), [theme]);\n const containerStyles: Style[] = [styles.container];\n if (style) {containerStyles.push(style);}\n\n if (variant === \"inline\") {\n return (\n <View wrap={false} style={containerStyles as never}>\n <View style={styles.inlineRow}>\n <PDFText style={styles.inlineLabel}>{`${label}:`}</PDFText>\n <View style={styles.inlineLine} />\n {name ? <PDFText style={styles.inlineName}>{name}</PDFText> : null}\n </View>\n </View>\n );\n }\n\n if (variant === \"double\") {\n const [first, second] = signers ?? [\n { date: \"\", label: \"Authorized by\", name: \"\", title: \"\" },\n { date: \"\", label: \"Approved by\", name: \"\", title: \"\" },\n ];\n return (\n <View wrap={false} style={containerStyles as never}>\n <View style={styles.doubleRow}>\n {renderSignerBlock(first, styles)}\n {renderSignerBlock(second, styles)}\n </View>\n </View>\n );\n }\n\n return (\n <View wrap={false} style={containerStyles as never}>\n {renderSignerBlock({ date, label, name, title }, styles)}\n </View>\n );\n}\n",- "type": "registry:component"+ "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\n\nexport type SignatureVariant = \"single\" | \"double\" | \"inline\";\n\n/**\n * Signature signer properties.\n * Props - `label` | `name` | `title` | `date`\n * @see {@link SignatureSigner}\n */\nexport interface SignatureSigner {\n label?: string;\n name?: string;\n title?: string;\n date?: string;\n}\n\n/**\n * Signature block properties.\n * Props - `variant` | `label` | `name` | `title` | `date` | `signers` | `style`\n * @see {@link PdfSignatureBlockProps}\n */\nexport interface PdfSignatureBlockProps {\n /**\n * Layout variant: [single, double, inline]\n * @default 'single'\n */\n variant?: SignatureVariant;\n label?: string;\n name?: string;\n title?: string;\n date?: string;\n signers?: [SignatureSigner, SignatureSigner];\n style?: Style;\n}\n\nconst createSignatureStyles = (t: PdfcnTheme) => {\n const { spacing, fontWeights, typography } = t.primitives;\n return StyleSheet.create({\n block: { flex: 1, minWidth: 140 },\n container: {\n marginBottom: t.spacing.componentGap,\n marginTop: t.spacing.sectionGap,\n },\n dateText: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n marginTop: 1,\n },\n doubleRow: {\n flexDirection: \"row\",\n gap: spacing[8],\n justifyContent: \"space-between\",\n },\n inlineLabel: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n },\n inlineLine: {\n borderBottomColor: t.colors.foreground,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n height: spacing[5],\n minWidth: 120,\n paddingHorizontal: spacing[2],\n },\n inlineName: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n },\n inlineRow: {\n alignItems: \"center\",\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: spacing[3],\n },\n label: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n marginBottom: spacing[1],\n },\n line: {\n borderBottomColor: t.colors.foreground,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n marginBottom: spacing[1],\n minHeight: spacing[6],\n },\n name: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n },\n titleText: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n },\n });\n};\n\nconst renderSignerBlock = (\n signer: SignatureSigner,\n styles: ReturnType<typeof createSignatureStyles>\n) => (\n <View style={styles.block}>\n {signer.label ? (\n <PDFText style={styles.label}>{signer.label}</PDFText>\n ) : null}\n <View style={styles.line} />\n {signer.name ? <PDFText style={styles.name}>{signer.name}</PDFText> : null}\n {signer.title ? (\n <PDFText style={styles.titleText}>{signer.title}</PDFText>\n ) : null}\n {signer.date ? (\n <PDFText style={styles.dateText}>{signer.date}</PDFText>\n ) : null}\n </View>\n);\n\nexport const PdfSignatureBlock = ({\n variant = \"single\",\n label = \"Signature\",\n name,\n title,\n date,\n signers,\n style,\n}: PdfSignatureBlockProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createSignatureStyles(theme), [theme]);\n const containerStyles: Style[] = [styles.container];\n if (style) {\n containerStyles.push(style);\n }\n\n if (variant === \"inline\") {\n return (\n <View wrap={false} style={containerStyles as never}>\n <View style={styles.inlineRow}>\n <PDFText style={styles.inlineLabel}>{`${label}:`}</PDFText>\n <View style={styles.inlineLine} />\n {name ? <PDFText style={styles.inlineName}>{name}</PDFText> : null}\n </View>\n </View>\n );\n }\n\n if (variant === \"double\") {\n const [first, second] = signers ?? [\n { date: \"\", label: \"Authorized by\", name: \"\", title: \"\" },\n { date: \"\", label: \"Approved by\", name: \"\", title: \"\" },\n ];\n return (\n <View wrap={false} style={containerStyles as never}>\n <View style={styles.doubleRow}>\n {renderSignerBlock(first, styles)}\n {renderSignerBlock(second, styles)}\n </View>\n </View>\n );\n }\n\n return (\n <View wrap={false} style={containerStyles as never}>\n {renderSignerBlock({ date, label, name, title }, styles)}\n </View>\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/signature/signature.tsx"},{"path": "registry/bases/forme/components/signature/index.ts","content": "export {\n PdfSignatureBlock,\n type PdfSignatureBlockProps,\n type SignatureVariant,\n type SignatureSigner,\n} from \"./signature\";\n",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/signature/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/stack.json b/public/r/forme/stack.jsonindex 9fe322f..d7f6bf7 100644--- a/public/r/forme/stack.json+++ b/public/r/forme/stack.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/forme/components/stack/stack.tsx",- "content": "import { StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\n\nexport type StackGap = \"none\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\nexport type StackDirection = \"vertical\" | \"horizontal\";\nexport type StackAlign = \"start\" | \"center\" | \"end\" | \"stretch\";\nexport type StackJustify = \"start\" | \"center\" | \"end\" | \"between\" | \"around\";\n\n/**\n * Flex layout container with gap and direction control.\n * Props - `gap` | `direction` | `align` | `justify` | `wrap` | `noWrap` | `children` | `style`\n * @see {@link StackProps}\n */\nexport interface StackProps extends PDFComponentProps {\n /**\n * @default 'md'\n */\n gap?: StackGap;\n /**\n * @default 'vertical'\n */\n direction?: StackDirection;\n /**\n * @default 'start'\n */\n align?: StackAlign;\n /**\n * @default 'start'\n */\n justify?: StackJustify;\n /**\n * @default false\n */\n wrap?: boolean;\n /**\n * @default false\n */\n noWrap?: boolean;\n}\n\nfunction createStackStyles(t: PdfcnTheme) {\n const { spacing } = t.primitives;\n return StyleSheet.create({\n alignCenter: { alignItems: \"center\" },\n alignEnd: { alignItems: \"flex-end\" },\n alignStart: { alignItems: \"flex-start\" },\n alignStretch: { alignItems: \"stretch\" },\n gapLg: { gap: spacing[6] },\n gapMd: { gap: spacing[4] },\n gapNone: { gap: spacing[0] },\n gapSm: { gap: spacing[2] },\n gapXl: { gap: spacing[8] },\n horizontal: { flexDirection: \"row\" },\n justifyAround: { justifyContent: \"space-around\" },\n justifyBetween: { justifyContent: \"space-between\" },\n justifyCenter: { justifyContent: \"center\" },\n justifyEnd: { justifyContent: \"flex-end\" },\n justifyStart: { justifyContent: \"flex-start\" },\n vertical: { flexDirection: \"column\" },\n wrap: { flexWrap: \"wrap\" },\n });\n}\n\nexport function Stack({\n gap = \"md\",\n direction = \"vertical\",\n align,\n justify,\n wrap,\n noWrap,\n children,\n style,\n}: StackProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createStackStyles(theme), [theme]);\n const gapMap = {\n lg: styles.gapLg,\n md: styles.gapMd,\n none: styles.gapNone,\n sm: styles.gapSm,\n xl: styles.gapXl,\n };\n const alignMap = {\n center: styles.alignCenter,\n end: styles.alignEnd,\n start: styles.alignStart,\n stretch: styles.alignStretch,\n };\n const justifyMap = {\n around: styles.justifyAround,\n between: styles.justifyBetween,\n center: styles.justifyCenter,\n end: styles.justifyEnd,\n start: styles.justifyStart,\n };\n const styleArray: Style[] = [\n direction === \"horizontal\" ? styles.horizontal : styles.vertical,\n gapMap[gap],\n ];\n if (align && align in alignMap) {styleArray.push(alignMap[align]);}\n if (justify && justify in justifyMap) {styleArray.push(justifyMap[justify]);}\n if (wrap) {styleArray.push(styles.wrap);}\n if (style) {styleArray.push(...[style].flat());}\n return (\n <View wrap={noWrap ? false : undefined} style={styleArray as never}>\n {children}\n </View>\n );\n}\n",- "type": "registry:component"+ "content": "import { StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\n\nexport type StackGap = \"none\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\nexport type StackDirection = \"vertical\" | \"horizontal\";\nexport type StackAlign = \"start\" | \"center\" | \"end\" | \"stretch\";\nexport type StackJustify = \"start\" | \"center\" | \"end\" | \"between\" | \"around\";\n\n/**\n * Flex layout container with gap and direction control.\n * Props - `gap` | `direction` | `align` | `justify` | `wrap` | `noWrap` | `children` | `style`\n * @see {@link StackProps}\n */\nexport interface StackProps extends PDFComponentProps {\n /**\n * @default 'md'\n */\n gap?: StackGap;\n /**\n * @default 'vertical'\n */\n direction?: StackDirection;\n /**\n * @default 'start'\n */\n align?: StackAlign;\n /**\n * @default 'start'\n */\n justify?: StackJustify;\n /**\n * @default false\n */\n wrap?: boolean;\n /**\n * @default false\n */\n noWrap?: boolean;\n}\n\nconst createStackStyles = (t: PdfcnTheme) => {\n const { spacing } = t.primitives;\n return StyleSheet.create({\n alignCenter: { alignItems: \"center\" },\n alignEnd: { alignItems: \"flex-end\" },\n alignStart: { alignItems: \"flex-start\" },\n alignStretch: { alignItems: \"stretch\" },\n gapLg: { gap: spacing[6] },\n gapMd: { gap: spacing[4] },\n gapNone: { gap: spacing[0] },\n gapSm: { gap: spacing[2] },\n gapXl: { gap: spacing[8] },\n horizontal: { flexDirection: \"row\" },\n justifyAround: { justifyContent: \"space-around\" },\n justifyBetween: { justifyContent: \"space-between\" },\n justifyCenter: { justifyContent: \"center\" },\n justifyEnd: { justifyContent: \"flex-end\" },\n justifyStart: { justifyContent: \"flex-start\" },\n vertical: { flexDirection: \"column\" },\n wrap: { flexWrap: \"wrap\" },\n });\n};\n\nexport const Stack = ({\n gap = \"md\",\n direction = \"vertical\",\n align,\n justify,\n wrap,\n noWrap,\n children,\n style,\n}: StackProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createStackStyles(theme), [theme]);\n const gapMap = {\n lg: styles.gapLg,\n md: styles.gapMd,\n none: styles.gapNone,\n sm: styles.gapSm,\n xl: styles.gapXl,\n };\n const alignMap = {\n center: styles.alignCenter,\n end: styles.alignEnd,\n start: styles.alignStart,\n stretch: styles.alignStretch,\n };\n const justifyMap = {\n around: styles.justifyAround,\n between: styles.justifyBetween,\n center: styles.justifyCenter,\n end: styles.justifyEnd,\n start: styles.justifyStart,\n };\n const styleArray: Style[] = [\n direction === \"horizontal\" ? styles.horizontal : styles.vertical,\n gapMap[gap],\n ];\n if (align && align in alignMap) {\n styleArray.push(alignMap[align]);\n }\n if (justify && justify in justifyMap) {\n styleArray.push(justifyMap[justify]);\n }\n if (wrap) {\n styleArray.push(styles.wrap);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return (\n <View wrap={noWrap ? false : undefined} style={styleArray as never}>\n {children}\n </View>\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/stack/stack.tsx"},{"path": "registry/bases/forme/components/stack/index.ts","content": "export {\n Stack,\n type StackProps,\n type StackGap,\n type StackDirection,\n type StackAlign,\n type StackJustify,\n} from \"./stack\";\n",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/stack/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/table.json b/public/r/forme/table.jsonindex a9bc412..bb4c6e0 100644--- a/public/r/forme/table.json+++ b/public/r/forme/table.json@@ -13,23 +13,27 @@"files": [{"path": "registry/bases/forme/components/table/table.styles.ts",- "content": "import { StyleSheet } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\n/**\n * Creates all table styles derived from the active theme.\n * @param t - The resolved PdfcnTheme instance.\n */\nexport function createTableStyles(t: PdfcnTheme) {\n const { spacing, borderRadius, fontWeights, typography } = t.primitives;\n const borderColor = t.colors.border;\n\n const hairline = 0.5;\n const rule = 1;\n const thick = 1.5;\n\n const cellPadV = spacing[2] - 2;\n const cellPadH = spacing[2] + 2;\n const cellPadVCompact = spacing[0.5];\n const cellPadHCompact = spacing[2];\n\n const rowDivider = {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\" as const,\n borderBottomWidth: hairline,\n };\n\n return StyleSheet.create({\n cell: {\n flex: 1,\n justifyContent: \"center\",\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellBordered: {\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellBorderedBorder: {\n borderRightColor: borderColor,\n borderRightStyle: \"solid\",\n borderRightWidth: hairline,\n },\n\n cellCompact: {\n paddingHorizontal: cellPadHCompact,\n paddingVertical: cellPadVCompact,\n },\n\n cellFixed: {\n flexGrow: 0,\n flexShrink: 0,\n justifyContent: \"center\",\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellGridBorder: {\n borderRightColor: borderColor,\n borderRightStyle: \"solid\",\n borderRightWidth: hairline,\n },\n\n cellMinimal: {\n paddingHorizontal: spacing[2] - 2,\n paddingVertical: spacing[1] + 1,\n },\n\n cellPrimaryHeader: {\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellStriped: {\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellText: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n lineHeight: 1.2,\n },\n cellTextCompact: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n lineHeight: 1.2,\n },\n cellTextFooter: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: 1.2,\n },\n cellTextHeaderBordered: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.bold,\n lineHeight: 1.2,\n },\n cellTextHeaderCompact: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.semibold,\n letterSpacing: 0.6,\n lineHeight: 1.2,\n textTransform: \"uppercase\",\n },\n cellTextHeaderGrid: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: 1.2,\n },\n cellTextHeaderLine: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: 1.2,\n },\n\n cellTextHeaderMinimal: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.medium,\n lineHeight: 1.2,\n },\n cellTextHeaderPrimaryHeader: {\n color: t.colors.primaryForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.semibold,\n letterSpacing: 0.6,\n lineHeight: 1.2,\n textTransform: \"uppercase\",\n },\n cellTextHeaderStriped: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: 1.2,\n },\n row: {\n display: \"flex\",\n flexDirection: \"row\",\n },\n rowBordered: rowDivider,\n rowCompact: rowDivider,\n rowFooter: {\n borderTopColor: borderColor,\n borderTopStyle: \"solid\",\n borderTopWidth: rule,\n },\n\n rowFooterStriped: {\n backgroundColor: t.colors.muted,\n borderTopColor: borderColor,\n borderTopStyle: \"solid\",\n borderTopWidth: rule,\n },\n rowGrid: rowDivider,\n\n rowHeaderBordered: {\n backgroundColor: t.colors.muted,\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n },\n\n rowHeaderCompact: {\n backgroundColor: t.colors.muted,\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n rowHeaderGrid: {\n backgroundColor: t.colors.muted,\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n\n rowHeaderLine: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n rowHeaderMinimal: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n rowHeaderPrimaryHeader: {\n backgroundColor: t.colors.primary,\n },\n rowHeaderStriped: {\n backgroundColor: t.colors.muted,\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n rowLine: rowDivider,\n\n rowMinimal: rowDivider,\n rowPrimaryHeader: rowDivider,\n\n rowStripe: {\n backgroundColor: t.colors.muted,\n },\n\n rowStriped: {},\n table: {\n display: \"flex\",\n flexDirection: \"column\",\n marginBottom: t.spacing.componentGap,\n width: \"100%\",\n },\n tableBordered: {\n borderBottomLeftRadius: borderRadius.sm,\n borderBottomRightRadius: borderRadius.sm,\n borderColor: borderColor,\n borderStyle: \"solid\",\n borderTopLeftRadius: borderRadius.sm,\n borderTopRightRadius: borderRadius.sm,\n borderWidth: rule,\n overflow: \"hidden\" as const,\n },\n tableCompact: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n },\n tableGrid: {\n borderBottomLeftRadius: borderRadius.md,\n borderBottomRightRadius: borderRadius.md,\n borderColor: borderColor,\n borderStyle: \"solid\",\n borderTopLeftRadius: borderRadius.md,\n borderTopRightRadius: borderRadius.md,\n borderWidth: thick,\n overflow: \"hidden\" as const,\n },\n tableLine: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n },\n tableMinimal: {\n paddingVertical: spacing[2],\n },\n\n tablePrimaryHeader: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n },\n\n tableStriped: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n borderTopColor: borderColor,\n borderTopStyle: \"solid\",\n borderTopWidth: hairline,\n },\n });\n}\n",- "type": "registry:component"+ "content": "import { StyleSheet } from \"@formepdf/react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\n/**\n * Creates all table styles derived from the active theme.\n * @param t - The resolved PdfcnTheme instance.\n */\nexport const createTableStyles = (t: PdfcnTheme) => {\n const { spacing, borderRadius, fontWeights, typography } = t.primitives;\n const borderColor = t.colors.border;\n\n const hairline = 0.5;\n const rule = 1;\n const thick = 1.5;\n\n const cellPadV = spacing[2] - 2;\n const cellPadH = spacing[2] + 2;\n // eslint-disable-next-line prefer-destructuring\n const cellPadVCompact = spacing[0.5];\n // eslint-disable-next-line prefer-destructuring\n const cellPadHCompact = spacing[2];\n\n const rowDivider = {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\" as const,\n borderBottomWidth: hairline,\n };\n\n return StyleSheet.create({\n cell: {\n flex: 1,\n justifyContent: \"center\",\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellBordered: {\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellBorderedBorder: {\n borderRightColor: borderColor,\n borderRightStyle: \"solid\",\n borderRightWidth: hairline,\n },\n\n cellCompact: {\n paddingHorizontal: cellPadHCompact,\n paddingVertical: cellPadVCompact,\n },\n\n cellFixed: {\n flexGrow: 0,\n flexShrink: 0,\n justifyContent: \"center\",\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellGridBorder: {\n borderRightColor: borderColor,\n borderRightStyle: \"solid\",\n borderRightWidth: hairline,\n },\n\n cellMinimal: {\n paddingHorizontal: spacing[2] - 2,\n paddingVertical: spacing[1] + 1,\n },\n\n cellPrimaryHeader: {\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellStriped: {\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellText: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n lineHeight: 1.2,\n },\n cellTextCompact: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n lineHeight: 1.2,\n },\n cellTextFooter: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: 1.2,\n },\n cellTextHeaderBordered: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.bold,\n lineHeight: 1.2,\n },\n cellTextHeaderCompact: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.semibold,\n letterSpacing: 0.6,\n lineHeight: 1.2,\n textTransform: \"uppercase\",\n },\n cellTextHeaderGrid: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: 1.2,\n },\n cellTextHeaderLine: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: 1.2,\n },\n\n cellTextHeaderMinimal: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.medium,\n lineHeight: 1.2,\n },\n cellTextHeaderPrimaryHeader: {\n color: t.colors.primaryForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.semibold,\n letterSpacing: 0.6,\n lineHeight: 1.2,\n textTransform: \"uppercase\",\n },\n cellTextHeaderStriped: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: 1.2,\n },\n row: {\n display: \"flex\",\n flexDirection: \"row\",\n },\n rowBordered: rowDivider,\n rowCompact: rowDivider,\n rowFooter: {\n borderTopColor: borderColor,\n borderTopStyle: \"solid\",\n borderTopWidth: rule,\n },\n\n rowFooterStriped: {\n backgroundColor: t.colors.muted,\n borderTopColor: borderColor,\n borderTopStyle: \"solid\",\n borderTopWidth: rule,\n },\n rowGrid: rowDivider,\n\n rowHeaderBordered: {\n backgroundColor: t.colors.muted,\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n },\n\n rowHeaderCompact: {\n backgroundColor: t.colors.muted,\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n rowHeaderGrid: {\n backgroundColor: t.colors.muted,\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n\n rowHeaderLine: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n rowHeaderMinimal: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n rowHeaderPrimaryHeader: {\n backgroundColor: t.colors.primary,\n },\n rowHeaderStriped: {\n backgroundColor: t.colors.muted,\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n rowLine: rowDivider,\n\n rowMinimal: rowDivider,\n rowPrimaryHeader: rowDivider,\n\n rowStripe: {\n backgroundColor: t.colors.muted,\n },\n\n rowStriped: {},\n table: {\n display: \"flex\",\n flexDirection: \"column\",\n marginBottom: t.spacing.componentGap,\n width: \"100%\",\n },\n tableBordered: {\n borderBottomLeftRadius: borderRadius.sm,\n borderBottomRightRadius: borderRadius.sm,\n borderColor,\n borderStyle: \"solid\",\n borderTopLeftRadius: borderRadius.sm,\n borderTopRightRadius: borderRadius.sm,\n borderWidth: rule,\n overflow: \"hidden\" as const,\n },\n tableCompact: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n },\n tableGrid: {\n borderBottomLeftRadius: borderRadius.md,\n borderBottomRightRadius: borderRadius.md,\n borderColor,\n borderStyle: \"solid\",\n borderTopLeftRadius: borderRadius.md,\n borderTopRightRadius: borderRadius.md,\n borderWidth: thick,\n overflow: \"hidden\" as const,\n },\n tableLine: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n },\n tableMinimal: {\n paddingVertical: spacing[2],\n },\n\n tablePrimaryHeader: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n },\n\n tableStriped: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n borderTopColor: borderColor,\n borderTopStyle: \"solid\",\n borderTopWidth: hairline,\n },\n });\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/table/table.styles.ts"},{"path": "registry/bases/forme/components/table/table.tsx",- "content": "import { Text as PDFText, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport { Children, cloneElement, isValidElement } from 'react';\nimport type { ReactElement, ReactNode } from 'react';\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { createTableStyles } from \"./table.styles\";\nimport type {\n TableCellProps,\n TableProps,\n TableRowProps,\n TableSectionProps,\n TableVariant,\n} from \"./table.types\";\n\nfunction processTableChildren(\n children: ReactNode,\n variant: TableVariant,\n zebraStripe: boolean\n): ReactNode {\n let bodyRowIndex = 0;\n\n return Children.map(children, (child) => {\n if (!isValidElement(child)) {return child;}\n\n if (\n child.type === TableHeader ||\n child.type === TableBody ||\n child.type === TableFooter\n ) {\n const isBody = child.type === TableBody;\n const sectionChild = child as ReactElement<TableSectionProps>;\n const sectionChildren = Children.map(\n sectionChild.props.children,\n (rowChild) => {\n if (isValidElement(rowChild) && rowChild.type === TableRow) {\n const rowProps: Partial<TableRowProps> = { variant };\n\n if (isBody && zebraStripe) {\n const isStripe = bodyRowIndex % 2 === 1;\n bodyRowIndex++;\n if (isStripe) {\n rowProps.stripe = true;\n }\n }\n\n return cloneElement(\n rowChild as ReactElement<TableRowProps>,\n rowProps\n );\n }\n return rowChild;\n }\n );\n\n return cloneElement(child, {}, sectionChildren);\n }\n\n if (child.type === TableRow) {\n return cloneElement(child as ReactElement<TableRowProps>, { variant });\n }\n\n return child;\n });\n}\n\nexport function TableHeader({ children, style }: TableSectionProps) {\n return <View style={style}>{children}</View>;\n}\n\nexport function TableBody({ children, style }: TableSectionProps) {\n return <View style={style}>{children}</View>;\n}\n\nexport function TableFooter({ children, style }: TableSectionProps) {\n return <View style={style}>{children}</View>;\n}\n\nexport function Table({\n children,\n style,\n variant = \"line\",\n zebraStripe = false,\n noWrap = false,\n}: TableProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createTableStyles(theme), [theme]);\n const tableStyles: Style[] = [styles.table];\n const effectiveZebra = variant === \"striped\" ? true : zebraStripe;\n\n tableStyles.push(\n {\n bordered: styles.tableBordered,\n compact: styles.tableCompact,\n grid: styles.tableGrid,\n line: styles.tableLine,\n minimal: styles.tableMinimal,\n \"primary-header\": styles.tablePrimaryHeader,\n striped: styles.tableStriped,\n }[variant]\n );\n\n const styleArray = style ? [...tableStyles, style] : tableStyles;\n const processedChildren = processTableChildren(\n children,\n variant,\n effectiveZebra\n );\n\n const inner = <View style={styleArray as never}>{processedChildren}</View>;\n return noWrap ? <View wrap={false}>{inner}</View> : inner;\n}\n\nexport function TableRow({\n header,\n footer,\n stripe,\n children,\n style,\n variant = \"line\",\n}: TableRowProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createTableStyles(theme), [theme]);\n const rowStyles: Style[] = [styles.row];\n\n rowStyles.push(\n {\n bordered: styles.rowBordered,\n compact: styles.rowCompact,\n grid: styles.rowGrid,\n line: styles.rowLine,\n minimal: styles.rowMinimal,\n \"primary-header\": styles.rowPrimaryHeader,\n striped: styles.rowStriped,\n }[variant]\n );\n\n if (header) {\n rowStyles.push(\n {\n bordered: styles.rowHeaderBordered,\n compact: styles.rowHeaderCompact,\n grid: styles.rowHeaderGrid,\n line: styles.rowHeaderLine,\n minimal: styles.rowHeaderMinimal,\n \"primary-header\": styles.rowHeaderPrimaryHeader,\n striped: styles.rowHeaderStriped,\n }[variant]\n );\n }\n\n if (footer) {\n if (variant === \"striped\") {rowStyles.push(styles.rowFooterStriped);}\n else {rowStyles.push(styles.rowFooter);}\n }\n\n if (stripe && !header && !footer) {\n rowStyles.push(styles.rowStripe);\n }\n\n const styleArray = style ? [...rowStyles, style] : rowStyles;\n const childArray = Children.toArray(children);\n const processedChildren = childArray.map((child, i) => {\n if (isValidElement(child) && child.type === TableCell) {\n return cloneElement(child as ReactElement<TableCellProps>, {\n _last: i === childArray.length - 1,\n footer,\n header,\n variant,\n });\n }\n return child;\n });\n\n return (\n <View wrap={false} style={styleArray as never}>\n {processedChildren}\n </View>\n );\n}\n\nexport function TableCell({\n header,\n footer,\n align,\n width,\n children,\n style,\n variant = \"line\",\n _last,\n}: TableCellProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createTableStyles(theme), [theme]);\n const cellStyles: Style[] =\n width !== undefined\n ? [styles.cellFixed, { width } as Style]\n : [styles.cell];\n\n const cellVariantStyle = (\n {\n bordered: styles.cellBordered,\n compact: styles.cellCompact,\n minimal: styles.cellMinimal,\n \"primary-header\": styles.cellPrimaryHeader,\n striped: styles.cellStriped,\n } as Partial<Record<TableVariant, Style>>\n )[variant];\n if (cellVariantStyle) {cellStyles.push(cellVariantStyle);}\n\n if (variant === \"grid\" && !_last) {\n cellStyles.push(styles.cellGridBorder);\n } else if (variant === \"bordered\" && !_last) {\n cellStyles.push(styles.cellBorderedBorder);\n }\n\n if (align) {\n cellStyles.push({ textAlign: align } as Style);\n }\n\n const styleArray = style ? [...cellStyles, style] : cellStyles;\n\n let textStyle: Style = styles.cellText;\n if (header) {\n textStyle = {\n bordered: styles.cellTextHeaderBordered,\n compact: styles.cellTextHeaderCompact,\n grid: styles.cellTextHeaderGrid,\n line: styles.cellTextHeaderLine,\n minimal: styles.cellTextHeaderMinimal,\n \"primary-header\": styles.cellTextHeaderPrimaryHeader,\n striped: styles.cellTextHeaderStriped,\n }[variant];\n } else if (footer) {\n textStyle = styles.cellTextFooter;\n } else if (variant === \"compact\") {\n textStyle = styles.cellTextCompact;\n }\n\n const content =\n typeof children === \"string\" ? (\n <PDFText\n style={\n [\n textStyle,\n align ? { textAlign: align } : {},\n { margin: 0, padding: 0 },\n ] as never\n }\n >\n {children}\n </PDFText>\n ) : (\n children\n );\n\n return <View style={styleArray as never}>{content}</View>;\n}\n",- "type": "registry:component"+ "content": "import { Text as PDFText, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport { Children, cloneElement, isValidElement } from \"react\";\nimport type { ReactElement, ReactNode } from \"react\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { createTableStyles } from \"./table.styles\";\nimport type {\n TableCellProps,\n TableProps,\n TableRowProps,\n TableSectionProps,\n TableVariant,\n} from \"./table.types\";\n\nexport const TableHeader = ({ children, style }: TableSectionProps) => (\n <View style={style}>{children}</View>\n);\n\nexport const TableBody = ({ children, style }: TableSectionProps) => (\n <View style={style}>{children}</View>\n);\n\nexport const TableFooter = ({ children, style }: TableSectionProps) => (\n <View style={style}>{children}</View>\n);\n\nexport const TableCell = ({\n header,\n footer,\n align,\n width,\n children,\n style,\n variant = \"line\",\n _last,\n}: TableCellProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createTableStyles(theme), [theme]);\n const cellStyles: Style[] =\n width === undefined\n ? [styles.cell]\n : [styles.cellFixed, { width } as Style];\n\n const cellVariantStyle = (\n {\n bordered: styles.cellBordered,\n compact: styles.cellCompact,\n minimal: styles.cellMinimal,\n \"primary-header\": styles.cellPrimaryHeader,\n striped: styles.cellStriped,\n } as Partial<Record<TableVariant, Style>>\n )[variant];\n if (cellVariantStyle) {\n cellStyles.push(cellVariantStyle);\n }\n\n if (variant === \"grid\" && !_last) {\n cellStyles.push(styles.cellGridBorder);\n } else if (variant === \"bordered\" && !_last) {\n cellStyles.push(styles.cellBorderedBorder);\n }\n\n if (align) {\n cellStyles.push({ textAlign: align } as Style);\n }\n\n const styleArray = style ? [...cellStyles, style] : cellStyles;\n\n let textStyle: Style = styles.cellText;\n if (header) {\n textStyle = {\n bordered: styles.cellTextHeaderBordered,\n compact: styles.cellTextHeaderCompact,\n grid: styles.cellTextHeaderGrid,\n line: styles.cellTextHeaderLine,\n minimal: styles.cellTextHeaderMinimal,\n \"primary-header\": styles.cellTextHeaderPrimaryHeader,\n striped: styles.cellTextHeaderStriped,\n }[variant];\n } else if (footer) {\n textStyle = styles.cellTextFooter;\n } else if (variant === \"compact\") {\n textStyle = styles.cellTextCompact;\n }\n\n const content =\n typeof children === \"string\" ? (\n <PDFText\n style={\n [\n textStyle,\n align ? { textAlign: align } : {},\n { margin: 0, padding: 0 },\n ] as never\n }\n >\n {children}\n </PDFText>\n ) : (\n children\n );\n\n return <View style={styleArray as never}>{content}</View>;\n};\n\nexport const TableRow = ({\n header,\n footer,\n stripe,\n children,\n style,\n variant = \"line\",\n}: TableRowProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createTableStyles(theme), [theme]);\n const rowStyles: Style[] = [\n styles.row,\n {\n bordered: styles.rowBordered,\n compact: styles.rowCompact,\n grid: styles.rowGrid,\n line: styles.rowLine,\n minimal: styles.rowMinimal,\n \"primary-header\": styles.rowPrimaryHeader,\n striped: styles.rowStriped,\n }[variant],\n ];\n\n if (header) {\n rowStyles.push(\n {\n bordered: styles.rowHeaderBordered,\n compact: styles.rowHeaderCompact,\n grid: styles.rowHeaderGrid,\n line: styles.rowHeaderLine,\n minimal: styles.rowHeaderMinimal,\n \"primary-header\": styles.rowHeaderPrimaryHeader,\n striped: styles.rowHeaderStriped,\n }[variant]\n );\n }\n\n if (footer) {\n if (variant === \"striped\") {\n rowStyles.push(styles.rowFooterStriped);\n } else {\n rowStyles.push(styles.rowFooter);\n }\n }\n\n if (stripe && !header && !footer) {\n rowStyles.push(styles.rowStripe);\n }\n\n const styleArray = style ? [...rowStyles, style] : rowStyles;\n const childArray = Children.toArray(children);\n const processedChildren = childArray.map((child, i) => {\n if (isValidElement(child) && child.type === TableCell) {\n return cloneElement(child as ReactElement<TableCellProps>, {\n _last: i === childArray.length - 1,\n footer,\n header,\n variant,\n });\n }\n return child;\n });\n\n return (\n <View wrap={false} style={styleArray as never}>\n {processedChildren}\n </View>\n );\n};\n\nconst processTableChildren = (\n children: ReactNode,\n variant: TableVariant,\n zebraStripe: boolean\n): ReactNode => {\n let bodyRowIndex = 0;\n\n return Children.map(children, (child) => {\n if (!isValidElement(child)) {\n return child;\n }\n\n if (\n child.type === TableHeader ||\n child.type === TableBody ||\n child.type === TableFooter\n ) {\n const isBody = child.type === TableBody;\n const sectionChild = child as ReactElement<TableSectionProps>;\n const sectionChildren = Children.map(\n sectionChild.props.children,\n (rowChild) => {\n if (isValidElement(rowChild) && rowChild.type === TableRow) {\n const rowProps: Partial<TableRowProps> = { variant };\n\n if (isBody && zebraStripe) {\n const isStripe = bodyRowIndex % 2 === 1;\n bodyRowIndex += 1;\n if (isStripe) {\n rowProps.stripe = true;\n }\n }\n\n return cloneElement(\n rowChild as ReactElement<TableRowProps>,\n rowProps\n );\n }\n return rowChild;\n }\n );\n\n return cloneElement(child, {}, sectionChildren);\n }\n\n if (child.type === TableRow) {\n return cloneElement(child as ReactElement<TableRowProps>, { variant });\n }\n\n return child;\n });\n};\n\nexport const Table = ({\n children,\n style,\n variant = \"line\",\n zebraStripe = false,\n noWrap = false,\n}: TableProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createTableStyles(theme), [theme]);\n const tableStyles: Style[] = [styles.table];\n const effectiveZebra = variant === \"striped\" ? true : zebraStripe;\n\n tableStyles.push(\n {\n bordered: styles.tableBordered,\n compact: styles.tableCompact,\n grid: styles.tableGrid,\n line: styles.tableLine,\n minimal: styles.tableMinimal,\n \"primary-header\": styles.tablePrimaryHeader,\n striped: styles.tableStriped,\n }[variant]\n );\n\n const styleArray = style ? [...tableStyles, style] : tableStyles;\n const processedChildren = processTableChildren(\n children,\n variant,\n effectiveZebra\n );\n\n const inner = <View style={styleArray as never}>{processedChildren}</View>;\n return noWrap ? <View wrap={false}>{inner}</View> : inner;\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/table/table.tsx"},{"path": "registry/bases/forme/components/table/table.types.ts","content": "import type { PDFComponentProps } from \"@/registry/themes\";\n\n/** Table visual style variant. */\nexport type TableVariant =\n | \"line\"\n | \"grid\"\n | \"minimal\"\n | \"striped\"\n | \"compact\"\n | \"bordered\"\n | \"primary-header\";\n\n/**\n * Table container with visual style variants and optional zebra striping.\n * Props - `variant` | `zebraStripe` | `noWrap` | `children` | `style`\n * @see {@link TableProps}\n */\nexport interface TableProps extends PDFComponentProps {\n /**\n * @default 'line'\n */\n variant?: TableVariant;\n /**\n * @default false\n */\n zebraStripe?: boolean;\n /**\n * @default false\n */\n noWrap?: boolean;\n}\n\nexport type TableSectionProps = PDFComponentProps;\n\n/**\n * Table row with optional header, footer, and stripe states.\n * Props - `header` | `footer` | `stripe` | `variant` | `children` | `style`\n * @see {@link TableRowProps}\n */\nexport interface TableRowProps extends PDFComponentProps {\n header?: boolean;\n footer?: boolean;\n stripe?: boolean;\n variant?: TableVariant;\n}\n\n/**\n * Table cell with alignment, width, and header or footer text styling.\n * Props - `header` | `footer` | `align` | `width` | `variant` | `_last` | `children` | `style`\n * @see {@link TableCellProps}\n */\nexport interface TableCellProps extends PDFComponentProps {\n header?: boolean;\n footer?: boolean;\n align?: \"left\" | \"center\" | \"right\";\n width?: string | number;\n variant?: TableVariant;\n _last?: boolean;\n}\n",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/table/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/text.json b/public/r/forme/text.jsonindex cd49f5f..ae2029e 100644--- a/public/r/forme/text.json+++ b/public/r/forme/text.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/forme/components/text/text.tsx",- "content": "import { Text as PDFText, StyleSheet } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type TextVariant = \"xs\" | \"sm\" | \"base\" | \"lg\" | \"xl\" | \"2xl\" | \"3xl\";\nexport type TextWeight = \"normal\" | \"medium\" | \"semibold\" | \"bold\";\nexport type TextDecoration = \"underline\" | \"line-through\" | \"none\";\n\n/**\n * Body text with typography scale, alignment, and decoration options.\n * Props - `variant` | `align` | `color` | `weight` | `italic` | `decoration` | `transform` | `noMargin` | `children` | `style`\n * @see {@link TextProps}\n */\nexport interface TextProps extends PDFComponentProps {\n /**\n * @default 'base'\n */\n variant?: TextVariant;\n /**\n * @default 'left'\n */\n align?: \"left\" | \"center\" | \"right\" | \"justify\";\n color?: string;\n /**\n * @default 'normal'\n */\n weight?: TextWeight;\n /**\n * @default false\n */\n italic?: boolean;\n /**\n * @default 'none'\n */\n decoration?: TextDecoration;\n transform?: \"uppercase\" | \"lowercase\" | \"capitalize\";\n /**\n * @default false\n */\n noMargin?: boolean;\n}\n\nfunction createTextStyles(t: PdfcnTheme) {\n const { fontWeights, letterSpacing } = t.primitives;\n const base = {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n lineHeight: t.typography.body.lineHeight,\n marginBottom: t.spacing.paragraphGap,\n marginTop: 0,\n };\n return StyleSheet.create({\n \"2xl\": { ...base, fontSize: t.primitives.typography[\"2xl\"] },\n \"3xl\": { ...base, fontSize: t.primitives.typography[\"3xl\"] },\n base: { ...base, fontSize: t.primitives.typography.base },\n capitalize: { textTransform: \"capitalize\" },\n decorationNone: { textDecoration: \"none\" },\n italic: { fontStyle: \"italic\" },\n lg: { ...base, fontSize: t.primitives.typography.lg },\n lineThrough: { textDecoration: \"line-through\" },\n lowercase: { textTransform: \"lowercase\" },\n noMargin: { marginBottom: 0, marginTop: 0 },\n sm: { ...base, fontSize: t.primitives.typography.sm },\n text: { ...base, fontSize: t.typography.body.fontSize },\n underline: { textDecoration: \"underline\" },\n uppercase: {\n letterSpacing: letterSpacing.wider * 10,\n textTransform: \"uppercase\",\n },\n weightBold: { fontWeight: fontWeights.bold },\n weightMedium: { fontWeight: fontWeights.medium },\n weightNormal: { fontWeight: fontWeights.regular },\n weightSemibold: { fontWeight: fontWeights.semibold },\n xl: { ...base, fontSize: t.primitives.typography.xl },\n xs: { ...base, fontSize: t.primitives.typography.xs },\n });\n}\n\nexport function Text({\n variant,\n align,\n color,\n weight,\n italic,\n decoration,\n transform,\n noMargin,\n children,\n style,\n}: TextProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createTextStyles(theme), [theme]);\n const weightMap = {\n bold: styles.weightBold,\n medium: styles.weightMedium,\n normal: styles.weightNormal,\n semibold: styles.weightSemibold,\n };\n const decorationMap = {\n \"line-through\": styles.lineThrough,\n none: styles.decorationNone,\n underline: styles.underline,\n };\n const transformMap = {\n capitalize: styles.capitalize,\n lowercase: styles.lowercase,\n uppercase: styles.uppercase,\n };\n const styleArray: Style[] = [variant ? styles[variant] : styles.text];\n if (weight && weight in weightMap) {styleArray.push(weightMap[weight]);}\n if (italic) {styleArray.push(styles.italic);}\n if (decoration && decoration in decorationMap)\n {styleArray.push(decorationMap[decoration]);}\n if (transform && transform in transformMap)\n {styleArray.push(transformMap[transform]);}\n if (noMargin) {styleArray.push(styles.noMargin);}\n const semantic = {} as Style;\n if (align) {semantic.textAlign = align;}\n if (color) {semantic.color = resolveColor(color, theme.colors);}\n if (Object.keys(semantic).length > 0) {styleArray.push(semantic);}\n if (style) {styleArray.push(...[style].flat());}\n return <PDFText style={styleArray as never}>{children}</PDFText>;\n}\n",- "type": "registry:component"+ "content": "import { Text as PDFText, StyleSheet } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type TextVariant = \"xs\" | \"sm\" | \"base\" | \"lg\" | \"xl\" | \"2xl\" | \"3xl\";\nexport type TextWeight = \"normal\" | \"medium\" | \"semibold\" | \"bold\";\nexport type TextDecoration = \"underline\" | \"line-through\" | \"none\";\n\n/**\n * Body text with typography scale, alignment, and decoration options.\n * Props - `variant` | `align` | `color` | `weight` | `italic` | `decoration` | `transform` | `noMargin` | `children` | `style`\n * @see {@link TextProps}\n */\nexport interface TextProps extends PDFComponentProps {\n /**\n * @default 'base'\n */\n variant?: TextVariant;\n /**\n * @default 'left'\n */\n align?: \"left\" | \"center\" | \"right\" | \"justify\";\n color?: string;\n /**\n * @default 'normal'\n */\n weight?: TextWeight;\n /**\n * @default false\n */\n italic?: boolean;\n /**\n * @default 'none'\n */\n decoration?: TextDecoration;\n transform?: \"uppercase\" | \"lowercase\" | \"capitalize\";\n /**\n * @default false\n */\n noMargin?: boolean;\n}\n\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 as never}>{children}</PDFText>;\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/text/index.ts"}],"type": "registry:ui"diff --git a/public/r/forme/utils.json b/public/r/forme/utils.jsonindex e8369a0..1f5d29a 100644--- a/public/r/forme/utils.json+++ b/public/r/forme/utils.json@@ -11,27 +11,32 @@{"path": "registry/bases/forme/lib/pdfcn-theme.ts","content": "import { professionalTheme } from \"@/registry/themes\";\n\nexport const theme = professionalTheme;\n",- "type": "registry:lib"+ "type": "registry:lib",+ "target": "components/pdf/lib/pdfcn-theme.ts"},{"path": "registry/bases/forme/lib/pdfcn-theme-context.tsx",- "content": "/* eslint-disable react-refresh/only-export-components */\n// Exports both a component (PdfcnThemeProvider) and hooks/context intentionally.\n// All PDF components import from a single file — splitting would break the public API.\n\nimport * as React from \"react\";\nimport { createContext, useContext, useMemo } from 'react';\nimport type { DependencyList, ReactNode } from 'react';\n\nimport { theme as defaultTheme } from \"./pdfcn-theme\";\n\nexport type PdfcnTheme = typeof defaultTheme;\n\nexport const PdfcnThemeContext = createContext<PdfcnTheme>(defaultTheme);\n\nexport interface PdfcnThemeProviderProps {\n theme?: PdfcnTheme;\n children: ReactNode;\n}\n\n/**\n * Detect whether React currently has an active dispatcher.\n * When components are invoked as plain functions in tests, dispatcher is null.\n */\nfunction hasActiveDispatcher(): boolean {\n const maybeInternals = React as unknown as {\n __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE?: {\n H?: unknown;\n };\n };\n\n const dispatcher =\n maybeInternals\n .__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE?.H;\n return dispatcher != null;\n}\n\nexport function PdfcnThemeProvider({\n theme,\n children,\n}: PdfcnThemeProviderProps) {\n const resolvedTheme = useMemo(() => theme ?? defaultTheme, [theme]);\n return (\n <PdfcnThemeContext.Provider value={resolvedTheme}>\n {children}\n </PdfcnThemeContext.Provider>\n );\n}\n\n/**\n * Regex patterns that indicate a hook was called outside a valid React render tree.\n * These errors are caught and suppressed so components fall back to safe defaults.\n */\nconst HOOK_ERROR_PATTERNS =\n /invalid hook call|useContext|useMemo|cannot read properties of null|dispatcher|renderWithHooks|resolveDispatcher|hooks can only be called|rendered fewer hooks/i;\n\n/**\n * Calls a React hook with a graceful fallback for non-render environments (e.g. unit tests).\n * Uses hasActiveDispatcher() as the primary guard; the try/catch is a safety net for edge\n * cases where the dispatcher check passes but the hook still cannot execute.\n */\nfunction callHook<T>(hook: () => T, fallback: T): T {\n if (!hasActiveDispatcher()) {return fallback;}\n try {\n return hook();\n } catch (error) {\n if (error instanceof Error && HOOK_ERROR_PATTERNS.test(error.message))\n {return fallback;}\n throw error;\n }\n}\n\n/**\n * Returns the active PdfcnTheme from context, or the default theme when called\n * outside a React render tree (e.g. unit tests).\n */\nexport function usePdfcnTheme(): PdfcnTheme {\n return callHook(() => useContext(PdfcnThemeContext), defaultTheme);\n}\n\n/**\n * Calls factory() and returns the result.\n * The deps parameter is accepted for API compatibility with existing callers.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function useSafeMemo<T>(factory: () => T, _deps: DependencyList): T {\n return factory();\n}\n",- "type": "registry:lib"+ "content": "\"use client\";\n\n/* eslint-disable react-refresh/only-export-components */\n// Exports both a component (PdfcnThemeProvider) and hooks/context intentionally.\n// All PDF components import from a single file — splitting would break the public API.\n\nimport * as React from \"react\";\nimport { createContext, useContext } from \"react\";\nimport type { DependencyList, ReactNode } from \"react\";\n\nimport { theme as defaultTheme } from \"./pdfcn-theme\";\n\nexport type PdfcnTheme = typeof defaultTheme;\n\nexport const PdfcnThemeContext = createContext<PdfcnTheme>(defaultTheme);\n\nexport interface PdfcnThemeProviderProps {\n theme?: PdfcnTheme;\n children: ReactNode;\n}\n\n/**\n * Detect whether React currently has an active dispatcher.\n * When components are invoked as plain functions in tests, dispatcher is null.\n */\nconst hasActiveDispatcher = (): boolean => {\n const maybeInternals = React as unknown as {\n __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE?: {\n H?: unknown;\n };\n };\n\n const dispatcher =\n maybeInternals\n .__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE?.H;\n return dispatcher != null;\n};\n\nexport const PdfcnThemeProvider = ({\n theme,\n children,\n}: PdfcnThemeProviderProps) => (\n <PdfcnThemeContext.Provider value={theme ?? defaultTheme}>\n {children}\n </PdfcnThemeContext.Provider>\n);\n\n/**\n * Regex patterns that indicate a hook was called outside a valid React render tree.\n * These errors are caught and suppressed so components fall back to safe defaults.\n */\nconst HOOK_ERROR_PATTERNS =\n /invalid hook call|minified react error #321|useContext|useMemo|cannot read properties of null|dispatcher|renderWithHooks|resolveDispatcher|hooks can only be called|rendered fewer hooks/i;\n\n/**\n * Calls a React hook with a graceful fallback for non-render environments (e.g. unit tests).\n * Uses hasActiveDispatcher() as the primary guard; the try/catch is a safety net for edge\n * cases where the dispatcher check passes but the hook still cannot execute.\n */\nconst callHook = <T,>(hook: () => T, fallback: T): T => {\n if (!hasActiveDispatcher()) {\n return fallback;\n }\n try {\n return hook();\n } catch (error) {\n if (error instanceof Error && HOOK_ERROR_PATTERNS.test(error.message)) {\n return fallback;\n }\n throw error;\n }\n};\n\n/**\n * Returns the active PdfcnTheme from context, or the default theme when called\n * outside a React render tree (e.g. unit tests).\n */\nexport const usePdfcnTheme = (): PdfcnTheme =>\n callHook(() => useContext(PdfcnThemeContext), defaultTheme);\n\n/**\n * Calls factory() and returns the result.\n * The deps parameter is accepted for API compatibility with existing callers.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport const useSafeMemo = <T,>(factory: () => T, _deps: DependencyList): T =>\n factory();\n",+ "type": "registry:lib",+ "target": "components/pdf/lib/pdfcn-theme-context.tsx"},{"path": "registry/bases/forme/lib/resolve-color.ts",- "content": "import type { ColorTokens } from \"@/registry/themes\";\n\n/** Theme color token keys that can be used for the color prop */\nexport const THEME_COLOR_KEYS = [\n \"foreground\",\n \"background\",\n \"muted\",\n \"mutedForeground\",\n \"primary\",\n \"primaryForeground\",\n \"border\",\n \"accent\",\n \"destructive\",\n \"success\",\n \"warning\",\n \"info\",\n] as const satisfies (keyof ColorTokens)[];\n\n/** Resolves a color value: theme token key → hex, or raw CSS color as-is. */\nexport function resolveColor(value: string, colors: ColorTokens): string {\n const key = value as (typeof THEME_COLOR_KEYS)[number];\n return THEME_COLOR_KEYS.includes(key) ? colors[key] : value;\n}\n",- "type": "registry:lib"+ "content": "import type { ColorTokens } from \"@/registry/themes\";\n\n/** Theme color token keys that can be used for the color prop */\nexport const THEME_COLOR_KEYS = [\n \"foreground\",\n \"background\",\n \"muted\",\n \"mutedForeground\",\n \"primary\",\n \"primaryForeground\",\n \"border\",\n \"accent\",\n \"destructive\",\n \"success\",\n \"warning\",\n \"info\",\n] as const satisfies (keyof ColorTokens)[];\n\n/** Resolves a color value: theme token key → hex, or raw CSS color as-is. */\nexport const resolveColor = (value: string, colors: ColorTokens): string => {\n const key = value as (typeof THEME_COLOR_KEYS)[number];\n return THEME_COLOR_KEYS.includes(key) ? colors[key] : value;\n};\n",+ "type": "registry:lib",+ "target": "components/pdf/lib/resolve-color.ts"},{"path": "registry/bases/forme/lib/forme-svg.tsx",- "content": "import { Svg as FormeSvg } from \"@formepdf/react\";\nimport { createElement } from 'react';\nimport type { ReactNode, CSSProperties } from 'react';\n\ntype AnyProps = Record<string, unknown> & {\n children?: ReactNode;\n style?: CSSProperties;\n};\n\nexport function Svg({\n children,\n width,\n height,\n viewBox,\n style,\n ...rest\n}: AnyProps & { width?: number; height?: number; viewBox?: string }) {\n return (\n <FormeSvg\n width={width as number}\n height={height as number}\n viewBox={viewBox as string | undefined}\n style={style as never}\n {...rest}\n >\n {children}\n </FormeSvg>\n );\n}\n\nexport const Circle = (props: AnyProps) => createElement(\"circle\", props);\nexport const Rect = (props: AnyProps) => createElement(\"rect\", props);\nexport const G = (props: AnyProps) => createElement(\"g\", props);\nexport const Line = (props: AnyProps) => createElement(\"line\", props);\nexport const Path = (props: AnyProps) => createElement(\"path\", props);\nexport const SvgText = (props: AnyProps) => createElement(\"text\", props);\n",- "type": "registry:lib"+ "content": "import { Svg as FormeSvg } from \"@formepdf/react\";\nimport { createElement } from \"react\";\nimport type { ReactNode, CSSProperties } from \"react\";\n\ntype AnyProps = Record<string, unknown> & {\n children?: ReactNode;\n style?: CSSProperties;\n};\n\nexport const Svg = ({\n children,\n width,\n height,\n viewBox,\n style,\n ...rest\n}: AnyProps & { width?: number; height?: number; viewBox?: string }) => (\n <FormeSvg\n width={width as number}\n height={height as number}\n viewBox={viewBox as string | undefined}\n style={style as never}\n {...rest}\n >\n {children}\n </FormeSvg>\n);\n\nexport const Circle = (props: AnyProps) => createElement(\"circle\", props);\nexport const Rect = (props: AnyProps) => createElement(\"rect\", props);\nexport const G = (props: AnyProps) => createElement(\"g\", props);\nexport const Line = (props: AnyProps) => createElement(\"line\", props);\nexport const Path = (props: AnyProps) => createElement(\"path\", props);\nexport const SvgText = (props: AnyProps) => createElement(\"text\", props);\n",+ "type": "registry:lib",+ "target": "components/pdf/lib/forme-svg.tsx"},{"path": "registry/bases/forme/lib/maybe-fixed.tsx",- "content": "import { Fixed, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport type { ReactNode } from \"react\";\n\nexport function MaybeFixed({\n fixed,\n position,\n wrap,\n style,\n children,\n}: {\n fixed?: boolean;\n position: \"header\" | \"footer\";\n wrap?: boolean;\n style?: Style | Style[];\n children?: ReactNode;\n}) {\n const view = (\n <View wrap={wrap} style={style as never}>\n {children}\n </View>\n );\n if (!fixed) {return view;}\n return <Fixed position={position}>{view}</Fixed>;\n}\n",- "type": "registry:lib"+ "content": "import { Fixed, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\nimport type { ReactNode } from \"react\";\n\nexport const MaybeFixed = ({\n fixed,\n position,\n wrap,\n style,\n children,\n}: {\n fixed?: boolean;\n position: \"header\" | \"footer\";\n wrap?: boolean;\n style?: Style | Style[];\n children?: ReactNode;\n}) => {\n const view = (\n <View wrap={wrap} style={style as never}>\n {children}\n </View>\n );\n if (!fixed) {\n return view;\n }\n return <Fixed position={position}>{view}</Fixed>;\n};\n",+ "type": "registry:lib",+ "target": "components/pdf/lib/maybe-fixed.tsx"}],"type": "registry:lib"diff --git a/public/r/forme/watermark.json b/public/r/forme/watermark.jsonindex 6e20f3f..4e6630a 100644--- a/public/r/forme/watermark.json+++ b/public/r/forme/watermark.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/forme/components/watermark/watermark.tsx",- "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type WatermarkPosition =\n | \"center\"\n | \"top-left\"\n | \"top-right\"\n | \"bottom-left\"\n | \"bottom-right\";\n\n/**\n * Diagonal watermark overlaid across the full page using absolute positioning.\n * Props - `text` | `opacity` | `fontSize` | `color` | `angle` | `position` | `fixed` | `style`\n * @see {@link PdfWatermarkProps}\n */\nexport interface PdfWatermarkProps extends Omit<PDFComponentProps, \"children\"> {\n text: string;\n opacity?: number;\n fontSize?: number;\n color?: string;\n angle?: number;\n position?: WatermarkPosition;\n /**\n * @default true\n */\n fixed?: boolean;\n children?: never;\n}\n\nfunction createWatermarkStyles(t: PdfcnTheme) {\n const { fontWeights } = t.primitives;\n // Use page margins as corner insets so watermark position adapts to the active theme.\n const { marginTop, marginBottom, marginLeft, marginRight } = t.spacing.page;\n return StyleSheet.create({\n container: {\n alignItems: \"center\",\n bottom: 0,\n justifyContent: \"center\",\n left: 0,\n pointerEvents: \"none\",\n position: \"absolute\",\n right: 0,\n top: 0,\n zIndex: -1,\n },\n positionBottomLeft: {\n alignItems: \"flex-start\",\n justifyContent: \"flex-end\",\n paddingBottom: marginBottom,\n paddingLeft: marginLeft,\n },\n positionBottomRight: {\n alignItems: \"flex-end\",\n justifyContent: \"flex-end\",\n paddingBottom: marginBottom,\n paddingRight: marginRight,\n },\n positionCenter: { alignItems: \"center\", justifyContent: \"center\" },\n positionTopLeft: {\n alignItems: \"flex-start\",\n justifyContent: \"flex-start\",\n paddingLeft: marginLeft,\n paddingTop: marginTop,\n },\n positionTopRight: {\n alignItems: \"flex-end\",\n justifyContent: \"flex-start\",\n paddingRight: marginRight,\n paddingTop: marginTop,\n },\n text: {\n fontFamily: t.typography.heading.fontFamily,\n fontWeight: fontWeights.bold,\n letterSpacing: 4,\n textTransform: \"uppercase\",\n },\n });\n}\n\nexport function PdfWatermark({\n text,\n opacity = 0.15,\n fontSize = 60,\n color = \"mutedForeground\",\n angle = -45,\n position = \"center\",\n fixed = true,\n style,\n}: PdfWatermarkProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createWatermarkStyles(theme), [theme]);\n const positionMap: Record<WatermarkPosition, Style> = {\n \"bottom-left\": styles.positionBottomLeft,\n \"bottom-right\": styles.positionBottomRight,\n center: styles.positionCenter,\n \"top-left\": styles.positionTopLeft,\n \"top-right\": styles.positionTopRight,\n };\n const containerStyles: Style[] = [styles.container, positionMap[position]];\n if (style) {containerStyles.push(...[style].flat());}\n const textStyles: Style[] = [\n styles.text,\n {\n color: resolveColor(color, theme.colors),\n fontSize,\n opacity,\n transform: `rotate(${angle}deg)`,\n },\n ];\n return (\n <View style={containerStyles as never}>\n <PDFText style={textStyles as never}>{text}</PDFText>\n </View>\n );\n}\n",- "type": "registry:component"+ "content": "import { Text as PDFText, StyleSheet, View } from \"@formepdf/react\";\nimport type { Style } from \"@formepdf/react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\n\nexport type WatermarkPosition =\n | \"center\"\n | \"top-left\"\n | \"top-right\"\n | \"bottom-left\"\n | \"bottom-right\";\n\n/**\n * Diagonal watermark overlaid across the full page using absolute positioning.\n * Props - `text` | `opacity` | `fontSize` | `color` | `angle` | `position` | `fixed` | `style`\n * @see {@link PdfWatermarkProps}\n */\nexport interface PdfWatermarkProps extends Omit<PDFComponentProps, \"children\"> {\n text: string;\n opacity?: number;\n fontSize?: number;\n color?: string;\n angle?: number;\n position?: WatermarkPosition;\n /**\n * @default true\n */\n fixed?: boolean;\n children?: never;\n}\n\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 as never}>\n <PDFText style={textStyles as never}>{text}</PDFText>\n </View>\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/watermark/index.ts"}],"type": "registry:ui"diff --git a/public/r/registry.json b/public/r/registry.jsonindex 03d2aba..7da8cc0 100644--- a/public/r/registry.json+++ b/public/r/registry.json@@ -1,1931 +1,2511 @@{"$schema": "https://ui.shadcn.com/schema/registry.json",- "name": "pdfcn","homepage": "https://pdfcn.vercel.app","items": [{- "name": "takumi/utils",- "type": "registry:lib",- "title": "Takumi Utils",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Theme context and helpers for the takumi base","files": [{"path": "registry/bases/takumi/lib/pdfcn-theme.ts",- "type": "registry:lib"+ "type": "registry:lib",+ "target": "components/pdf/lib/pdfcn-theme.ts"},{"path": "registry/bases/takumi/lib/pdfcn-theme-context.tsx",- "type": "registry:lib"+ "type": "registry:lib",+ "target": "components/pdf/lib/pdfcn-theme-context.tsx"},{"path": "registry/bases/takumi/lib/resolve-color.ts",- "type": "registry:lib"+ "type": "registry:lib",+ "target": "components/pdf/lib/resolve-color.ts"},{"path": "registry/bases/takumi/lib/takumi-primitives.tsx",- "type": "registry:lib"+ "type": "registry:lib",+ "target": "components/pdf/lib/takumi-primitives.tsx"},{"path": "registry/bases/takumi/lib/takumi-svg.tsx",- "type": "registry:lib"+ "type": "registry:lib",+ "target": "components/pdf/lib/takumi-svg.tsx"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]+ "name": "takumi/utils",+ "title": "Takumi Utils",+ "type": "registry:lib"},{- "name": "takumi/alert",- "type": "registry:ui",- "title": "Alert",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Alert PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/alert/alert.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/alert/alert.tsx"},{"path": "registry/bases/takumi/components/alert/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/alert/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/alert",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Alert",+ "type": "registry:ui"},{- "name": "takumi/badge",- "type": "registry:ui",- "title": "Badge",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Badge PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/badge/badge.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/badge/badge.tsx"},{"path": "registry/bases/takumi/components/badge/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/badge/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/badge",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Badge",+ "type": "registry:ui"},{- "name": "takumi/card",- "type": "registry:ui",- "title": "Card",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Card PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/card/card.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/card/card.tsx"},{"path": "registry/bases/takumi/components/card/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/card/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/card",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Card",+ "type": "registry:ui"},{- "name": "takumi/data-table",- "type": "registry:ui",- "title": "Data Table",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Data Table PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/data-table/data-table.styles.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/data-table/data-table.styles.ts"},{"path": "registry/bases/takumi/components/data-table/data-table.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/data-table/data-table.tsx"},{"path": "registry/bases/takumi/components/data-table/data-table.types.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/data-table/data-table.types.ts"},{"path": "registry/bases/takumi/components/data-table/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/data-table/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils", "takumi/table"]+ "name": "takumi/data-table",+ "registryDependencies": [+ "takumi/utils",+ "takumi/table"+ ],+ "title": "Data Table",+ "type": "registry:ui"},{- "name": "takumi/divider",- "type": "registry:ui",- "title": "Divider",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Divider PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/divider/divider.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/divider/divider.tsx"},{"path": "registry/bases/takumi/components/divider/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/divider/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/divider",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Divider",+ "type": "registry:ui"},{- "name": "takumi/form",- "type": "registry:ui",- "title": "Form",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Form PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/form/form.styles.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/form/form.styles.ts"},{"path": "registry/bases/takumi/components/form/form.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/form/form.tsx"},{"path": "registry/bases/takumi/components/form/form.types.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/form/form.types.ts"},{"path": "registry/bases/takumi/components/form/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/form/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/form",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Form",+ "type": "registry:ui"},{- "name": "takumi/graph",- "type": "registry:ui",- "title": "Graph",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Graph PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/graph/graph.styles.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/graph/graph.styles.ts"},{"path": "registry/bases/takumi/components/graph/graph.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/graph/graph.tsx"},{"path": "registry/bases/takumi/components/graph/graph.types.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/graph/graph.types.ts"},{"path": "registry/bases/takumi/components/graph/graph.utils.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/graph/graph.utils.ts"},{"path": "registry/bases/takumi/components/graph/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/graph/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/graph",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Graph",+ "type": "registry:ui"},{- "name": "takumi/heading",- "type": "registry:ui",- "title": "Heading",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Heading PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/heading/heading.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/heading/heading.tsx"},{"path": "registry/bases/takumi/components/heading/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/heading/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/heading",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Heading",+ "type": "registry:ui"},{- "name": "takumi/keep-together",- "type": "registry:ui",- "title": "Keep Together",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/keep-together/keep-together.tsx"},{"path": "registry/bases/takumi/components/keep-together/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/keep-together/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/keep-together",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Keep Together",+ "type": "registry:ui"},{- "name": "takumi/key-value",- "type": "registry:ui",- "title": "Key Value",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/key-value/key-value.tsx"},{"path": "registry/bases/takumi/components/key-value/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/key-value/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/key-value",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Key Value",+ "type": "registry:ui"},{- "name": "takumi/link",- "type": "registry:ui",- "title": "Link",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Link PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/link/link.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/link/link.tsx"},{"path": "registry/bases/takumi/components/link/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/link/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/link",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Link",+ "type": "registry:ui"},{- "name": "takumi/list",- "type": "registry:ui",- "title": "List",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "List PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/list/list.styles.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/list/list.styles.ts"},{"path": "registry/bases/takumi/components/list/list.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/list/list.tsx"},{"path": "registry/bases/takumi/components/list/list.types.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/list/list.types.ts"},{"path": "registry/bases/takumi/components/list/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/list/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/list",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "List",+ "type": "registry:ui"},{- "name": "takumi/page-break",- "type": "registry:ui",- "title": "Page Break",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/page-break/page-break.tsx"},{"path": "registry/bases/takumi/components/page-break/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/page-break/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/page-break",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Page Break",+ "type": "registry:ui"},{- "name": "takumi/page-footer",- "type": "registry:ui",- "title": "Page Footer",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/page-footer/page-footer.tsx"},{"path": "registry/bases/takumi/components/page-footer/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/page-footer/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/page-footer",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Page Footer",+ "type": "registry:ui"},{- "name": "takumi/page-header",- "type": "registry:ui",- "title": "Page Header",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/page-header/page-header.tsx"},{"path": "registry/bases/takumi/components/page-header/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/page-header/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/page-header",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Page Header",+ "type": "registry:ui"},{- "name": "takumi/page-number",- "type": "registry:ui",- "title": "Page Number",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/page-number/page-number.tsx"},{"path": "registry/bases/takumi/components/page-number/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/page-number/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/page-number",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Page Number",+ "type": "registry:ui"},{- "name": "takumi/pdf-image",- "type": "registry:ui",- "title": "Pdf Image",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/pdf-image/pdf-image.tsx"},{"path": "registry/bases/takumi/components/pdf-image/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/pdf-image/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/pdf-image",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Pdf Image",+ "type": "registry:ui"},{- "name": "takumi/qrcode",- "type": "registry:ui",- "title": "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"+ "type": "registry:component",+ "target": "components/pdf/components/qrcode/qrcode.tsx"},{"path": "registry/bases/takumi/components/qrcode/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/qrcode/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers", "qrcode"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/qrcode",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Qrcode",+ "type": "registry:ui"},{- "name": "takumi/section",- "type": "registry:ui",- "title": "Section",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Section PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/section/section.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/section/section.tsx"},{"path": "registry/bases/takumi/components/section/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/section/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/section",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Section",+ "type": "registry:ui"},{- "name": "takumi/signature",- "type": "registry:ui",- "title": "Signature",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Signature PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/signature/signature.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/signature/signature.tsx"},{"path": "registry/bases/takumi/components/signature/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/signature/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/signature",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Signature",+ "type": "registry:ui"},{- "name": "takumi/stack",- "type": "registry:ui",- "title": "Stack",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Stack PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/stack/stack.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/stack/stack.tsx"},{"path": "registry/bases/takumi/components/stack/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/stack/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/stack",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Stack",+ "type": "registry:ui"},{- "name": "takumi/table",- "type": "registry:ui",- "title": "Table",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Table PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/table/table.styles.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/table/table.styles.ts"},{"path": "registry/bases/takumi/components/table/table.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/table/table.tsx"},{"path": "registry/bases/takumi/components/table/table.types.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/table/table.types.ts"},{"path": "registry/bases/takumi/components/table/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/table/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/table",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Table",+ "type": "registry:ui"},{- "name": "takumi/text",- "type": "registry:ui",- "title": "Text",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Text PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/text/text.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/text/text.tsx"},{"path": "registry/bases/takumi/components/text/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/text/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/text",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Text",+ "type": "registry:ui"},{- "name": "takumi/watermark",- "type": "registry:ui",- "title": "Watermark",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Watermark PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/watermark/watermark.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/watermark/watermark.tsx"},{"path": "registry/bases/takumi/components/watermark/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/watermark/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/watermark",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Watermark",+ "type": "registry:ui"},{- "name": "takumi/invoice-classic",- "type": "registry:block",- "title": "Invoice Classic",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Invoice Classic PDF block (takumi)","files": [{"path": "registry/bases/takumi/blocks/invoice-classic/invoice-classic.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-classic/invoice-classic.tsx"},{"path": "registry/bases/takumi/blocks/invoice-classic/invoice-classic.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-classic/invoice-classic.types.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/invoice-classic",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Invoice Classic",+ "type": "registry:block"},{- "name": "takumi/invoice-consultant",- "type": "registry:block",- "title": "Invoice Consultant",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Invoice Consultant PDF block (takumi)","files": [{"path": "registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-consultant/invoice-consultant.tsx"},{"path": "registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-consultant/invoice-consultant.types.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/invoice-consultant",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Invoice Consultant",+ "type": "registry:block"},{- "name": "takumi/invoice-corporate",- "type": "registry:block",- "title": "Invoice Corporate",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Invoice Corporate PDF block (takumi)","files": [{"path": "registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-corporate/invoice-corporate.tsx"},{"path": "registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-corporate/invoice-corporate.types.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/invoice-corporate",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Invoice Corporate",+ "type": "registry:block"},{- "name": "takumi/invoice-creative",- "type": "registry:block",- "title": "Invoice Creative",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Invoice Creative PDF block (takumi)","files": [{"path": "registry/bases/takumi/blocks/invoice-creative/invoice-creative.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-creative/invoice-creative.tsx"},{"path": "registry/bases/takumi/blocks/invoice-creative/invoice-creative.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-creative/invoice-creative.types.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/invoice-creative",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Invoice Creative",+ "type": "registry:block"},{- "name": "takumi/invoice-minimal",- "type": "registry:block",- "title": "Invoice Minimal",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Invoice Minimal PDF block (takumi)","files": [{"path": "registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-minimal/invoice-minimal.tsx"},{"path": "registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-minimal/invoice-minimal.types.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/invoice-minimal",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Invoice Minimal",+ "type": "registry:block"},{- "name": "takumi/invoice-modern",- "type": "registry:block",- "title": "Invoice Modern",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Invoice Modern PDF block (takumi)","files": [{"path": "registry/bases/takumi/blocks/invoice-modern/invoice-modern.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-modern/invoice-modern.tsx"},{"path": "registry/bases/takumi/blocks/invoice-modern/invoice-modern.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-modern/invoice-modern.types.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/invoice-modern",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Invoice Modern",+ "type": "registry:block"},{- "name": "takumi/report-financial",- "type": "registry:block",- "title": "Report Financial",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Report Financial PDF block (takumi)","files": [{"path": "registry/bases/takumi/blocks/report-financial/report-financial.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-financial/report-financial.tsx"},{"path": "registry/bases/takumi/blocks/report-financial/report-layout.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-financial/report-layout.tsx"},{"path": "registry/bases/takumi/blocks/report-financial/report.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-financial/report.types.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/report-financial",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Report Financial",+ "type": "registry:block"},{- "name": "takumi/report-marketing",- "type": "registry:block",- "title": "Report Marketing",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Report Marketing PDF block (takumi)","files": [{"path": "registry/bases/takumi/blocks/report-marketing/report-layout.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-marketing/report-layout.tsx"},{"path": "registry/bases/takumi/blocks/report-marketing/report-marketing.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-marketing/report-marketing.tsx"},{"path": "registry/bases/takumi/blocks/report-marketing/report.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-marketing/report.types.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/report-marketing",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Report Marketing",+ "type": "registry:block"},{- "name": "takumi/report-operations",- "type": "registry:block",- "title": "Report Operations",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Report Operations PDF block (takumi)","files": [{"path": "registry/bases/takumi/blocks/report-operations/report-layout.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-operations/report-layout.tsx"},{"path": "registry/bases/takumi/blocks/report-operations/report-operations.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-operations/report-operations.tsx"},{"path": "registry/bases/takumi/blocks/report-operations/report.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-operations/report.types.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/report-operations",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Report Operations",+ "type": "registry:block"},{- "name": "takumi/report-security",- "type": "registry:block",- "title": "Report Security",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Report Security PDF block (takumi)","files": [{"path": "registry/bases/takumi/blocks/report-security/report-layout.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-security/report-layout.tsx"},{"path": "registry/bases/takumi/blocks/report-security/report-security.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-security/report-security.tsx"},{"path": "registry/bases/takumi/blocks/report-security/report.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-security/report.types.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/report-security",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Report Security",+ "type": "registry:block"},{- "name": "takumi/theme-professional",- "type": "registry:theme",- "title": "Professional Theme (takumi)",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "professional theme tokens for takumi","files": [{"path": "registry/themes/professional.ts",- "type": "registry:theme",- "target": "components/pdf/theme-professional.ts"+ "target": "components/pdf/theme-professional.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/takumi/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]+ "name": "takumi/theme-professional",+ "title": "Professional Theme (takumi)",+ "type": "registry:theme"},{- "name": "takumi/theme-modern",- "type": "registry:theme",- "title": "Modern Theme (takumi)",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "modern theme tokens for takumi","files": [{"path": "registry/themes/modern.ts",- "type": "registry:theme",- "target": "components/pdf/theme-modern.ts"+ "target": "components/pdf/theme-modern.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/takumi/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]+ "name": "takumi/theme-modern",+ "title": "Modern Theme (takumi)",+ "type": "registry:theme"},{- "name": "takumi/theme-minimal",- "type": "registry:theme",- "title": "Minimal Theme (takumi)",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "minimal theme tokens for takumi","files": [{"path": "registry/themes/minimal.ts",- "type": "registry:theme",- "target": "components/pdf/theme-minimal.ts"+ "target": "components/pdf/theme-minimal.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/takumi/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]+ "name": "takumi/theme-minimal",+ "title": "Minimal Theme (takumi)",+ "type": "registry:theme"},{- "name": "takumi/theme-executive",- "type": "registry:theme",- "title": "Executive Theme (takumi)",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "executive theme tokens for takumi","files": [{"path": "registry/themes/executive.ts",- "type": "registry:theme",- "target": "components/pdf/theme-executive.ts"+ "target": "components/pdf/theme-executive.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/takumi/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]+ "name": "takumi/theme-executive",+ "title": "Executive Theme (takumi)",+ "type": "registry:theme"},{- "name": "takumi/theme-corporate",- "type": "registry:theme",- "title": "Corporate Theme (takumi)",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "corporate theme tokens for takumi","files": [{"path": "registry/themes/corporate.ts",- "type": "registry:theme",- "target": "components/pdf/theme-corporate.ts"+ "target": "components/pdf/theme-corporate.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/takumi/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]+ "name": "takumi/theme-corporate",+ "title": "Corporate Theme (takumi)",+ "type": "registry:theme"},{- "name": "takumi/theme-elegant",- "type": "registry:theme",- "title": "Elegant Theme (takumi)",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "elegant theme tokens for takumi","files": [{"path": "registry/themes/elegant.ts",- "type": "registry:theme",- "target": "components/pdf/theme-elegant.ts"+ "target": "components/pdf/theme-elegant.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/takumi/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]+ "name": "takumi/theme-elegant",+ "title": "Elegant Theme (takumi)",+ "type": "registry:theme"},{- "name": "takumi/theme-vivid",- "type": "registry:theme",- "title": "Vivid Theme (takumi)",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "vivid theme tokens for takumi","files": [{"path": "registry/themes/vivid.ts",- "type": "registry:theme",- "target": "components/pdf/theme-vivid.ts"+ "target": "components/pdf/theme-vivid.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/takumi/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]+ "name": "takumi/theme-vivid",+ "title": "Vivid Theme (takumi)",+ "type": "registry:theme"},{- "name": "takumi/theme-forest",- "type": "registry:theme",- "title": "Forest Theme (takumi)",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "forest theme tokens for takumi","files": [{"path": "registry/themes/forest.ts",- "type": "registry:theme",- "target": "components/pdf/theme-forest.ts"+ "target": "components/pdf/theme-forest.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/takumi/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]+ "name": "takumi/theme-forest",+ "title": "Forest Theme (takumi)",+ "type": "registry:theme"},{- "name": "takumi/theme-blueprint",- "type": "registry:theme",- "title": "Blueprint Theme (takumi)",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "blueprint theme tokens for takumi","files": [{"path": "registry/themes/blueprint.ts",- "type": "registry:theme",- "target": "components/pdf/theme-blueprint.ts"+ "target": "components/pdf/theme-blueprint.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/takumi/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]+ "name": "takumi/theme-blueprint",+ "title": "Blueprint Theme (takumi)",+ "type": "registry:theme"},{- "name": "forme/utils",- "type": "registry:lib",- "title": "Forme Utils",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Theme context and helpers for the forme base","files": [{"path": "registry/bases/forme/lib/pdfcn-theme.ts",- "type": "registry:lib"+ "type": "registry:lib",+ "target": "components/pdf/lib/pdfcn-theme.ts"},{"path": "registry/bases/forme/lib/pdfcn-theme-context.tsx",- "type": "registry:lib"+ "type": "registry:lib",+ "target": "components/pdf/lib/pdfcn-theme-context.tsx"},{"path": "registry/bases/forme/lib/resolve-color.ts",- "type": "registry:lib"+ "type": "registry:lib",+ "target": "components/pdf/lib/resolve-color.ts"},{"path": "registry/bases/forme/lib/forme-svg.tsx",- "type": "registry:lib"+ "type": "registry:lib",+ "target": "components/pdf/lib/forme-svg.tsx"},{"path": "registry/bases/forme/lib/maybe-fixed.tsx",- "type": "registry:lib"+ "type": "registry:lib",+ "target": "components/pdf/lib/maybe-fixed.tsx"}],- "dependencies": ["@formepdf/react", "@formepdf/core"]+ "name": "forme/utils",+ "title": "Forme Utils",+ "type": "registry:lib"},{- "name": "forme/alert",- "type": "registry:ui",- "title": "Alert",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Alert PDF component (forme)","files": [{"path": "registry/bases/forme/components/alert/alert.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/alert/alert.tsx"},{"path": "registry/bases/forme/components/alert/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/alert/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/alert",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Alert",+ "type": "registry:ui"},{- "name": "forme/badge",- "type": "registry:ui",- "title": "Badge",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Badge PDF component (forme)","files": [{"path": "registry/bases/forme/components/badge/badge.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/badge/badge.tsx"},{"path": "registry/bases/forme/components/badge/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/badge/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/badge",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Badge",+ "type": "registry:ui"},{- "name": "forme/card",- "type": "registry:ui",- "title": "Card",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Card PDF component (forme)","files": [{"path": "registry/bases/forme/components/card/card.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/card/card.tsx"},{"path": "registry/bases/forme/components/card/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/card/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/card",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Card",+ "type": "registry:ui"},{- "name": "forme/data-table",- "type": "registry:ui",- "title": "Data Table",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Data Table PDF component (forme)","files": [{"path": "registry/bases/forme/components/data-table/data-table.styles.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/data-table/data-table.styles.ts"},{"path": "registry/bases/forme/components/data-table/data-table.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/data-table/data-table.tsx"},{"path": "registry/bases/forme/components/data-table/data-table.types.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/data-table/data-table.types.ts"},{"path": "registry/bases/forme/components/data-table/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/data-table/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils", "forme/table"]+ "name": "forme/data-table",+ "registryDependencies": [+ "forme/utils",+ "forme/table"+ ],+ "title": "Data Table",+ "type": "registry:ui"},{- "name": "forme/divider",- "type": "registry:ui",- "title": "Divider",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Divider PDF component (forme)","files": [{"path": "registry/bases/forme/components/divider/divider.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/divider/divider.tsx"},{"path": "registry/bases/forme/components/divider/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/divider/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/divider",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Divider",+ "type": "registry:ui"},{- "name": "forme/form",- "type": "registry:ui",- "title": "Form",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Form PDF component (forme)","files": [{"path": "registry/bases/forme/components/form/form.styles.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/form/form.styles.ts"},{"path": "registry/bases/forme/components/form/form.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/form/form.tsx"},{"path": "registry/bases/forme/components/form/form.types.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/form/form.types.ts"},{"path": "registry/bases/forme/components/form/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/form/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/form",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Form",+ "type": "registry:ui"},{- "name": "forme/graph",- "type": "registry:ui",- "title": "Graph",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Graph PDF component (forme)","files": [{"path": "registry/bases/forme/components/graph/graph.styles.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/graph/graph.styles.ts"},{"path": "registry/bases/forme/components/graph/graph.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/graph/graph.tsx"},{"path": "registry/bases/forme/components/graph/graph.types.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/graph/graph.types.ts"},{"path": "registry/bases/forme/components/graph/graph.utils.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/graph/graph.utils.ts"},{"path": "registry/bases/forme/components/graph/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/graph/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/graph",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Graph",+ "type": "registry:ui"},{- "name": "forme/heading",- "type": "registry:ui",- "title": "Heading",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Heading PDF component (forme)","files": [{"path": "registry/bases/forme/components/heading/heading.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/heading/heading.tsx"},{"path": "registry/bases/forme/components/heading/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/heading/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/heading",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Heading",+ "type": "registry:ui"},{- "name": "forme/keep-together",- "type": "registry:ui",- "title": "Keep Together",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/keep-together/keep-together.tsx"},{"path": "registry/bases/forme/components/keep-together/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/keep-together/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/keep-together",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Keep Together",+ "type": "registry:ui"},{- "name": "forme/key-value",- "type": "registry:ui",- "title": "Key Value",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/key-value/key-value.tsx"},{"path": "registry/bases/forme/components/key-value/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/key-value/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/key-value",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Key Value",+ "type": "registry:ui"},{- "name": "forme/link",- "type": "registry:ui",- "title": "Link",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Link PDF component (forme)","files": [{"path": "registry/bases/forme/components/link/link.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/link/link.tsx"},{"path": "registry/bases/forme/components/link/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/link/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/link",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Link",+ "type": "registry:ui"},{- "name": "forme/list",- "type": "registry:ui",- "title": "List",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "List PDF component (forme)","files": [{"path": "registry/bases/forme/components/list/list.styles.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/list/list.styles.ts"},{"path": "registry/bases/forme/components/list/list.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/list/list.tsx"},{"path": "registry/bases/forme/components/list/list.types.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/list/list.types.ts"},{"path": "registry/bases/forme/components/list/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/list/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/list",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "List",+ "type": "registry:ui"},{- "name": "forme/page-break",- "type": "registry:ui",- "title": "Page Break",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/page-break/page-break.tsx"},{"path": "registry/bases/forme/components/page-break/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/page-break/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/page-break",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Page Break",+ "type": "registry:ui"},{- "name": "forme/page-footer",- "type": "registry:ui",- "title": "Page Footer",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/page-footer/page-footer.tsx"},{"path": "registry/bases/forme/components/page-footer/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/page-footer/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/page-footer",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Page Footer",+ "type": "registry:ui"},{- "name": "forme/page-header",- "type": "registry:ui",- "title": "Page Header",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/page-header/page-header.tsx"},{"path": "registry/bases/forme/components/page-header/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/page-header/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/page-header",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Page Header",+ "type": "registry:ui"},{- "name": "forme/page-number",- "type": "registry:ui",- "title": "Page Number",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/page-number/page-number.tsx"},{"path": "registry/bases/forme/components/page-number/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/page-number/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/page-number",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Page Number",+ "type": "registry:ui"},{- "name": "forme/pdf-image",- "type": "registry:ui",- "title": "Pdf Image",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/pdf-image/pdf-image.tsx"},{"path": "registry/bases/forme/components/pdf-image/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/pdf-image/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/pdf-image",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Pdf Image",+ "type": "registry:ui"},{- "name": "forme/qrcode",- "type": "registry:ui",- "title": "Qrcode",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core",+ "qrcode"+ ],"description": "Qrcode PDF component (forme)","files": [{"path": "registry/bases/forme/components/qrcode/qrcode.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/qrcode/qrcode.tsx"},{"path": "registry/bases/forme/components/qrcode/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/qrcode/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core", "qrcode"],- "registryDependencies": ["forme/utils"]+ "name": "forme/qrcode",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Qrcode",+ "type": "registry:ui"},{- "name": "forme/section",- "type": "registry:ui",- "title": "Section",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Section PDF component (forme)","files": [{"path": "registry/bases/forme/components/section/section.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/section/section.tsx"},{"path": "registry/bases/forme/components/section/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/section/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/section",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Section",+ "type": "registry:ui"},{- "name": "forme/signature",- "type": "registry:ui",- "title": "Signature",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Signature PDF component (forme)","files": [{"path": "registry/bases/forme/components/signature/signature.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/signature/signature.tsx"},{"path": "registry/bases/forme/components/signature/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/signature/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/signature",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Signature",+ "type": "registry:ui"},{- "name": "forme/stack",- "type": "registry:ui",- "title": "Stack",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Stack PDF component (forme)","files": [{"path": "registry/bases/forme/components/stack/stack.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/stack/stack.tsx"},{"path": "registry/bases/forme/components/stack/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/stack/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/stack",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Stack",+ "type": "registry:ui"},{- "name": "forme/table",- "type": "registry:ui",- "title": "Table",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Table PDF component (forme)","files": [{"path": "registry/bases/forme/components/table/table.styles.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/table/table.styles.ts"},{"path": "registry/bases/forme/components/table/table.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/table/table.tsx"},{"path": "registry/bases/forme/components/table/table.types.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/table/table.types.ts"},{"path": "registry/bases/forme/components/table/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/table/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/table",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Table",+ "type": "registry:ui"},{- "name": "forme/text",- "type": "registry:ui",- "title": "Text",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Text PDF component (forme)","files": [{"path": "registry/bases/forme/components/text/text.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/text/text.tsx"},{"path": "registry/bases/forme/components/text/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/text/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/text",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Text",+ "type": "registry:ui"},{- "name": "forme/watermark",- "type": "registry:ui",- "title": "Watermark",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Watermark PDF component (forme)","files": [{"path": "registry/bases/forme/components/watermark/watermark.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/watermark/watermark.tsx"},{"path": "registry/bases/forme/components/watermark/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/watermark/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/watermark",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Watermark",+ "type": "registry:ui"},{- "name": "forme/invoice-classic",- "type": "registry:block",- "title": "Invoice Classic",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Invoice Classic PDF block (forme)","files": [{"path": "registry/bases/forme/blocks/invoice-classic/invoice-classic.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-classic/invoice-classic.tsx"},{"path": "registry/bases/forme/blocks/invoice-classic/invoice-classic.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-classic/invoice-classic.types.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/invoice-classic",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Invoice Classic",+ "type": "registry:block"},{- "name": "forme/invoice-consultant",- "type": "registry:block",- "title": "Invoice Consultant",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Invoice Consultant PDF block (forme)","files": [{"path": "registry/bases/forme/blocks/invoice-consultant/invoice-consultant.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-consultant/invoice-consultant.tsx"},{"path": "registry/bases/forme/blocks/invoice-consultant/invoice-consultant.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-consultant/invoice-consultant.types.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/invoice-consultant",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Invoice Consultant",+ "type": "registry:block"},{- "name": "forme/invoice-corporate",- "type": "registry:block",- "title": "Invoice Corporate",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Invoice Corporate PDF block (forme)","files": [{"path": "registry/bases/forme/blocks/invoice-corporate/invoice-corporate.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-corporate/invoice-corporate.tsx"},{"path": "registry/bases/forme/blocks/invoice-corporate/invoice-corporate.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-corporate/invoice-corporate.types.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/invoice-corporate",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Invoice Corporate",+ "type": "registry:block"},{- "name": "forme/invoice-creative",- "type": "registry:block",- "title": "Invoice Creative",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Invoice Creative PDF block (forme)","files": [{"path": "registry/bases/forme/blocks/invoice-creative/invoice-creative.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-creative/invoice-creative.tsx"},{"path": "registry/bases/forme/blocks/invoice-creative/invoice-creative.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-creative/invoice-creative.types.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/invoice-creative",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Invoice Creative",+ "type": "registry:block"},{- "name": "forme/invoice-minimal",- "type": "registry:block",- "title": "Invoice Minimal",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Invoice Minimal PDF block (forme)","files": [{"path": "registry/bases/forme/blocks/invoice-minimal/invoice-minimal.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-minimal/invoice-minimal.tsx"},{"path": "registry/bases/forme/blocks/invoice-minimal/invoice-minimal.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-minimal/invoice-minimal.types.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/invoice-minimal",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Invoice Minimal",+ "type": "registry:block"},{- "name": "forme/invoice-modern",- "type": "registry:block",- "title": "Invoice Modern",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Invoice Modern PDF block (forme)","files": [{"path": "registry/bases/forme/blocks/invoice-modern/invoice-modern.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-modern/invoice-modern.tsx"},{"path": "registry/bases/forme/blocks/invoice-modern/invoice-modern.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-modern/invoice-modern.types.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/invoice-modern",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Invoice Modern",+ "type": "registry:block"},{- "name": "forme/report-financial",- "type": "registry:block",- "title": "Report Financial",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Report Financial PDF block (forme)","files": [{"path": "registry/bases/forme/blocks/report-financial/report-financial.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-financial/report-financial.tsx"},{"path": "registry/bases/forme/blocks/report-financial/report-layout.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-financial/report-layout.tsx"},{"path": "registry/bases/forme/blocks/report-financial/report.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-financial/report.types.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/report-financial",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Report Financial",+ "type": "registry:block"},{- "name": "forme/report-marketing",- "type": "registry:block",- "title": "Report Marketing",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Report Marketing PDF block (forme)","files": [{"path": "registry/bases/forme/blocks/report-marketing/report-layout.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-marketing/report-layout.tsx"},{"path": "registry/bases/forme/blocks/report-marketing/report-marketing.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-marketing/report-marketing.tsx"},{"path": "registry/bases/forme/blocks/report-marketing/report.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-marketing/report.types.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/report-marketing",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Report Marketing",+ "type": "registry:block"},{- "name": "forme/report-operations",- "type": "registry:block",- "title": "Report Operations",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Report Operations PDF block (forme)","files": [{"path": "registry/bases/forme/blocks/report-operations/report-layout.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-operations/report-layout.tsx"},{"path": "registry/bases/forme/blocks/report-operations/report-operations.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-operations/report-operations.tsx"},{"path": "registry/bases/forme/blocks/report-operations/report.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-operations/report.types.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/report-operations",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Report Operations",+ "type": "registry:block"},{- "name": "forme/report-security",- "type": "registry:block",- "title": "Report Security",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Report Security PDF block (forme)","files": [{"path": "registry/bases/forme/blocks/report-security/report-layout.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-security/report-layout.tsx"},{"path": "registry/bases/forme/blocks/report-security/report-security.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-security/report-security.tsx"},{"path": "registry/bases/forme/blocks/report-security/report.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-security/report.types.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/report-security",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Report Security",+ "type": "registry:block"},{- "name": "forme/theme-professional",- "type": "registry:theme",- "title": "Professional Theme (forme)",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "professional theme tokens for forme","files": [{"path": "registry/themes/professional.ts",- "type": "registry:theme",- "target": "components/pdf/theme-professional.ts"+ "target": "components/pdf/theme-professional.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/forme/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["@formepdf/react", "@formepdf/core"]+ "name": "forme/theme-professional",+ "title": "Professional Theme (forme)",+ "type": "registry:theme"},{- "name": "forme/theme-modern",- "type": "registry:theme",- "title": "Modern Theme (forme)",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "modern theme tokens for forme","files": [{"path": "registry/themes/modern.ts",- "type": "registry:theme",- "target": "components/pdf/theme-modern.ts"+ "target": "components/pdf/theme-modern.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/forme/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["@formepdf/react", "@formepdf/core"]+ "name": "forme/theme-modern",+ "title": "Modern Theme (forme)",+ "type": "registry:theme"},{- "name": "forme/theme-minimal",- "type": "registry:theme",- "title": "Minimal Theme (forme)",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "minimal theme tokens for forme","files": [{"path": "registry/themes/minimal.ts",- "type": "registry:theme",- "target": "components/pdf/theme-minimal.ts"+ "target": "components/pdf/theme-minimal.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/forme/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["@formepdf/react", "@formepdf/core"]+ "name": "forme/theme-minimal",+ "title": "Minimal Theme (forme)",+ "type": "registry:theme"},{- "name": "forme/theme-executive",- "type": "registry:theme",- "title": "Executive Theme (forme)",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "executive theme tokens for forme","files": [{"path": "registry/themes/executive.ts",- "type": "registry:theme",- "target": "components/pdf/theme-executive.ts"+ "target": "components/pdf/theme-executive.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/forme/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["@formepdf/react", "@formepdf/core"]+ "name": "forme/theme-executive",+ "title": "Executive Theme (forme)",+ "type": "registry:theme"},{- "name": "forme/theme-corporate",- "type": "registry:theme",- "title": "Corporate Theme (forme)",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "corporate theme tokens for forme","files": [{"path": "registry/themes/corporate.ts",- "type": "registry:theme",- "target": "components/pdf/theme-corporate.ts"+ "target": "components/pdf/theme-corporate.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/forme/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["@formepdf/react", "@formepdf/core"]+ "name": "forme/theme-corporate",+ "title": "Corporate Theme (forme)",+ "type": "registry:theme"},{- "name": "forme/theme-elegant",- "type": "registry:theme",- "title": "Elegant Theme (forme)",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "elegant theme tokens for forme","files": [{"path": "registry/themes/elegant.ts",- "type": "registry:theme",- "target": "components/pdf/theme-elegant.ts"+ "target": "components/pdf/theme-elegant.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/forme/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["@formepdf/react", "@formepdf/core"]+ "name": "forme/theme-elegant",+ "title": "Elegant Theme (forme)",+ "type": "registry:theme"},{- "name": "forme/theme-vivid",- "type": "registry:theme",- "title": "Vivid Theme (forme)",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "vivid theme tokens for forme","files": [{"path": "registry/themes/vivid.ts",- "type": "registry:theme",- "target": "components/pdf/theme-vivid.ts"+ "target": "components/pdf/theme-vivid.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/forme/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["@formepdf/react", "@formepdf/core"]+ "name": "forme/theme-vivid",+ "title": "Vivid Theme (forme)",+ "type": "registry:theme"},{- "name": "forme/theme-forest",- "type": "registry:theme",- "title": "Forest Theme (forme)",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "forest theme tokens for forme","files": [{"path": "registry/themes/forest.ts",- "type": "registry:theme",- "target": "components/pdf/theme-forest.ts"+ "target": "components/pdf/theme-forest.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/forme/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["@formepdf/react", "@formepdf/core"]+ "name": "forme/theme-forest",+ "title": "Forest Theme (forme)",+ "type": "registry:theme"},{- "name": "forme/theme-blueprint",- "type": "registry:theme",- "title": "Blueprint Theme (forme)",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "blueprint theme tokens for forme","files": [{"path": "registry/themes/blueprint.ts",- "type": "registry:theme",- "target": "components/pdf/theme-blueprint.ts"+ "target": "components/pdf/theme-blueprint.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/forme/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["@formepdf/react", "@formepdf/core"]+ "name": "forme/theme-blueprint",+ "title": "Blueprint Theme (forme)",+ "type": "registry:theme"}- ]+ ],+ "name": "pdfcn"}diff --git a/public/r/takumi/alert.json b/public/r/takumi/alert.jsonindex e9aed97..69518f6 100644--- a/public/r/takumi/alert.json+++ b/public/r/takumi/alert.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/takumi/components/alert/alert.tsx",- "content": "import type { ReactNode } from \"react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\nimport { Circle, Line, Path, Svg } from \"../../lib/takumi-svg\";\n\nexport type AlertVariant = \"info\" | \"success\" | \"warning\" | \"error\";\n\n/**\n * Alert box with severity variants for info, success, warning, and error states.\n * Props - `variant` | `title` | `children` | `showIcon` | `showBorder` | `style`\n * @see {@link PdfAlertProps}\n */\nexport interface PdfAlertProps extends Omit<PDFComponentProps, \"children\"> {\n /**\n * @default 'info'\n */\n variant?: AlertVariant;\n title?: string;\n children?: ReactNode;\n /**\n * @default true\n */\n showIcon?: boolean;\n /**\n * @default true\n */\n showBorder?: boolean;\n}\n\n/** Stroke width for all alert SVG icons (SVG user units). */\nconst ICON_STROKE_WIDTH = 1.5;\n\nconst SvgWrap = ({ children }: { children: ReactNode }) => (\n <Svg width={16} height={16} viewBox=\"0 0 16 16\">\n {children}\n </Svg>\n);\n\nconst ICON_MAP = {\n error: ({ color }: { color: string }) => (\n <SvgWrap>\n <Circle\n cx={8}\n cy={8}\n r={7}\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n />\n <Line\n x1={5.5}\n y1={5.5}\n x2={10.5}\n y2={10.5}\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n />\n <Line\n x1={10.5}\n y1={5.5}\n x2={5.5}\n y2={10.5}\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n />\n </SvgWrap>\n ),\n info: ({ color }: { color: string }) => (\n <SvgWrap>\n <Circle\n cx={8}\n cy={8}\n r={7}\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n />\n <Circle cx={8} cy={4.5} r={1} fill={color} />\n <Line\n x1={8}\n y1={7}\n x2={8}\n y2={11.5}\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n />\n </SvgWrap>\n ),\n success: ({ color }: { color: string }) => (\n <SvgWrap>\n <Circle\n cx={8}\n cy={8}\n r={7}\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n />\n <Path\n d=\"M5 8 L7 10 L11 6\"\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </SvgWrap>\n ),\n warning: ({ color }: { color: string }) => (\n <SvgWrap>\n <Path\n d=\"M8 1.5 L15 14.5 L1 14.5 Z\"\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinejoin=\"round\"\n />\n <Line\n x1={8}\n y1={6}\n x2={8}\n y2={10}\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n />\n <Circle cx={8} cy={12.5} r={0.75} fill={color} />\n </SvgWrap>\n ),\n};\n\nfunction AlertIcon({\n variant,\n color,\n}: {\n variant: AlertVariant;\n color: string;\n}) {\n const Icon = ICON_MAP[variant];\n return <Icon color={color} />;\n}\n\nfunction createAlertStyles(theme: PdfcnTheme) {\n const { typography, colors, primitives } = theme;\n\n const variantColors = {\n error: colors.destructive ?? \"#EF4444\",\n info: colors.info ?? \"#3B82F6\",\n success: colors.success ?? \"#22C55E\",\n warning: colors.warning ?? \"#F59E0B\",\n } satisfies Record<AlertVariant, string>;\n\n const bl = (color: string) => ({\n borderLeftColor: color,\n borderLeftWidth: 4,\n });\n\n const sheet = StyleSheet.create({\n bg: {\n backgroundColor: colors.muted,\n },\n borderError: bl(variantColors.error),\n borderInfo: bl(variantColors.info),\n borderSuccess: bl(variantColors.success),\n borderWarning: bl(variantColors.warning),\n container: {\n borderRadius: 4,\n flexDirection: \"row\",\n marginBottom: theme.spacing.componentGap,\n padding: 12,\n },\n contentContainer: { flex: 1 },\n description: {\n color: colors.mutedForeground,\n fontFamily: typography.body.fontFamily,\n fontSize: primitives.typography.sm,\n lineHeight: typography.body.lineHeight,\n },\n iconContainer: {\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n marginRight: 10,\n paddingTop: 2,\n width: 20,\n },\n title: {\n color: colors.foreground,\n fontFamily: typography.heading.fontFamily,\n fontSize: primitives.typography.sm,\n fontWeight: primitives.fontWeights.semibold,\n marginBottom: 4,\n },\n });\n\n return {\n ...sheet,\n borderMap: {\n error: sheet.borderError,\n info: sheet.borderInfo,\n success: sheet.borderSuccess,\n warning: sheet.borderWarning,\n } as Record<AlertVariant, Style>,\n /** Resolved hex colors for each variant — used to tint the SVG icons. */\n variantColors,\n };\n}\n\nexport function PdfAlert({\n variant = \"info\",\n title,\n children,\n showIcon = true,\n showBorder = true,\n style,\n}: PdfAlertProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createAlertStyles(theme), [theme]);\n\n if (!title && !children) {return null;}\n\n const containerStyles: Style[] = [\n styles.container,\n styles.bg,\n ...(showBorder ? [styles.borderMap[variant]] : []),\n ...(style ? [style].flat() : []),\n ];\n\n return (\n <View\n style={[{ breakInside: \"avoid\" as const }, containerStyles]\n .flat()\n .filter(Boolean)}\n >\n {showIcon && (\n <View style={styles.iconContainer}>\n <AlertIcon variant={variant} color={styles.variantColors[variant]} />\n </View>\n )}\n <View style={styles.contentContainer}>\n {title && <PDFText style={styles.title}>{title}</PDFText>}\n {typeof children === \"string\" ? (\n <PDFText style={styles.description}>{children}</PDFText>\n ) : (\n children\n )}\n </View>\n </View>\n );\n}\n",- "type": "registry:component"+ "content": "import type { ReactNode } from \"react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\nimport { Circle, Line, Path, Svg } from \"../../lib/takumi-svg\";\n\nexport type AlertVariant = \"info\" | \"success\" | \"warning\" | \"error\";\n\n/**\n * Alert box with severity variants for info, success, warning, and error states.\n * Props - `variant` | `title` | `children` | `showIcon` | `showBorder` | `style`\n * @see {@link PdfAlertProps}\n */\nexport interface PdfAlertProps extends Omit<PDFComponentProps, \"children\"> {\n /**\n * @default 'info'\n */\n variant?: AlertVariant;\n title?: string;\n children?: ReactNode;\n /**\n * @default true\n */\n showIcon?: boolean;\n /**\n * @default true\n */\n showBorder?: boolean;\n}\n\n/** Stroke width for all alert SVG icons (SVG user units). */\nconst ICON_STROKE_WIDTH = 1.5;\n\nconst SvgWrap = ({ children }: { children: ReactNode }) => (\n <Svg width={16} height={16} viewBox=\"0 0 16 16\">\n {children}\n </Svg>\n);\n\nconst ICON_MAP = {\n error: ({ color }: { color: string }) => (\n <SvgWrap>\n <Circle\n cx={8}\n cy={8}\n r={7}\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n />\n <Line\n x1={5.5}\n y1={5.5}\n x2={10.5}\n y2={10.5}\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n />\n <Line\n x1={10.5}\n y1={5.5}\n x2={5.5}\n y2={10.5}\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n />\n </SvgWrap>\n ),\n info: ({ color }: { color: string }) => (\n <SvgWrap>\n <Circle\n cx={8}\n cy={8}\n r={7}\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n />\n <Circle cx={8} cy={4.5} r={1} fill={color} />\n <Line\n x1={8}\n y1={7}\n x2={8}\n y2={11.5}\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n />\n </SvgWrap>\n ),\n success: ({ color }: { color: string }) => (\n <SvgWrap>\n <Circle\n cx={8}\n cy={8}\n r={7}\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n />\n <Path\n d=\"M5 8 L7 10 L11 6\"\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </SvgWrap>\n ),\n warning: ({ color }: { color: string }) => (\n <SvgWrap>\n <Path\n d=\"M8 1.5 L15 14.5 L1 14.5 Z\"\n fill=\"none\"\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinejoin=\"round\"\n />\n <Line\n x1={8}\n y1={6}\n x2={8}\n y2={10}\n stroke={color}\n strokeWidth={ICON_STROKE_WIDTH}\n strokeLinecap=\"round\"\n />\n <Circle cx={8} cy={12.5} r={0.75} fill={color} />\n </SvgWrap>\n ),\n};\n\nconst AlertIcon = ({\n variant,\n color,\n}: {\n variant: AlertVariant;\n color: string;\n}) => {\n const Icon = ICON_MAP[variant];\n return <Icon color={color} />;\n};\n\nconst borderLeft = (color: string) => ({\n borderLeftColor: color,\n borderLeftWidth: 4,\n});\n\nconst createAlertStyles = (theme: PdfcnTheme) => {\n const { typography, colors, primitives } = theme;\n\n const variantColors = {\n error: colors.destructive ?? \"#EF4444\",\n info: colors.info ?? \"#3B82F6\",\n success: colors.success ?? \"#22C55E\",\n warning: colors.warning ?? \"#F59E0B\",\n } satisfies Record<AlertVariant, string>;\n\n const sheet = StyleSheet.create({\n bg: {\n backgroundColor: colors.muted,\n },\n borderError: borderLeft(variantColors.error),\n borderInfo: borderLeft(variantColors.info),\n borderSuccess: borderLeft(variantColors.success),\n borderWarning: borderLeft(variantColors.warning),\n container: {\n borderRadius: 4,\n flexDirection: \"row\",\n marginBottom: theme.spacing.componentGap,\n padding: 12,\n },\n contentContainer: { flex: 1 },\n description: {\n color: colors.mutedForeground,\n fontFamily: typography.body.fontFamily,\n fontSize: primitives.typography.sm,\n lineHeight: typography.body.lineHeight,\n },\n iconContainer: {\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n marginRight: 10,\n paddingTop: 2,\n width: 20,\n },\n title: {\n color: colors.foreground,\n fontFamily: typography.heading.fontFamily,\n fontSize: primitives.typography.sm,\n fontWeight: primitives.fontWeights.semibold,\n marginBottom: 4,\n },\n });\n\n return {\n ...sheet,\n borderMap: {\n error: sheet.borderError,\n info: sheet.borderInfo,\n success: sheet.borderSuccess,\n warning: sheet.borderWarning,\n } as Record<AlertVariant, Style>,\n /** Resolved hex colors for each variant — used to tint the SVG icons. */\n variantColors,\n };\n};\n\nexport const PdfAlert = ({\n variant = \"info\",\n title,\n children,\n showIcon = true,\n showBorder = true,\n style,\n}: PdfAlertProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createAlertStyles(theme), [theme]);\n\n if (!title && !children) {\n return null;\n }\n\n const containerStyles: Style[] = [\n styles.container,\n styles.bg,\n ...(showBorder ? [styles.borderMap[variant]] : []),\n ...(style ? [style].flat() : []),\n ];\n\n return (\n <View\n style={[{ breakInside: \"avoid\" as const }, containerStyles]\n .flat()\n .filter(Boolean)}\n >\n {showIcon && (\n <View style={styles.iconContainer}>\n <AlertIcon variant={variant} color={styles.variantColors[variant]} />\n </View>\n )}\n <View style={styles.contentContainer}>\n {title && <PDFText style={styles.title}>{title}</PDFText>}\n {typeof children === \"string\" ? (\n <PDFText style={styles.description}>{children}</PDFText>\n ) : (\n children\n )}\n </View>\n </View>\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/alert/alert.tsx"},{"path": "registry/bases/takumi/components/alert/index.ts","content": "export { PdfAlert, type PdfAlertProps, type AlertVariant } from \"./alert\";\n",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/alert/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/badge.json b/public/r/takumi/badge.jsonindex 0a8d6a7..20c932a 100644--- a/public/r/takumi/badge.json+++ b/public/r/takumi/badge.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/takumi/components/badge/badge.tsx",- "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type BadgeVariant =\n | \"default\"\n | \"primary\"\n | \"success\"\n | \"warning\"\n | \"destructive\"\n | \"info\"\n | \"outline\";\nexport type BadgeSize = \"sm\" | \"md\" | \"lg\";\n\n/**\n * Inline label for status, tags, or categories.\n *\n * Accepts text via either `label` prop or `children` (string). `label` takes\n * precedence when both are provided. The children pattern (`<Badge>text</Badge>`)\n * is supported for compatibility with common React idioms, but note that\n * `Takumi PDF primitives` doesn't support JSX children the way HTML does — only\n * string children are accepted.\n *\n * Props - `label` | `children` | `variant` | `size` | `background` | `color` | `style`\n * @see {@link BadgeProps}\n */\nexport interface BadgeProps extends Omit<PDFComponentProps, \"children\"> {\n /** Text to display. Takes precedence over children when both are provided. */\n label?: string;\n /** String children as an alternative to the label prop. */\n children?: string;\n /**\n * @default 'default'\n */\n variant?: BadgeVariant;\n /**\n * @default 'md'\n */\n size?: BadgeSize;\n background?: string;\n color?: string;\n}\n\nfunction createBadgeStyles(t: PdfcnTheme) {\n const { spacing, borderRadius, fontWeights } = t.primitives;\n const c = t.colors;\n const textBase = {\n fontFamily: t.typography.body.fontFamily,\n fontWeight: fontWeights.semibold,\n letterSpacing: 0.3,\n };\n const variantBox = (borderColor: string, bgColor: string = c.muted) => ({\n backgroundColor: bgColor,\n borderColor,\n borderStyle: \"solid\" as const,\n borderWidth: spacing[0.5],\n });\n const sheet = StyleSheet.create({\n containerBase: {\n alignItems: \"center\" as const,\n alignSelf: \"flex-start\" as const,\n borderRadius: borderRadius.full,\n flexDirection: \"row\" as const,\n },\n sizeLg: { paddingHorizontal: spacing[4], paddingVertical: spacing[2] },\n sizeMd: { paddingHorizontal: spacing[3], paddingVertical: spacing[1] },\n sizeSm: { paddingHorizontal: spacing[2], paddingVertical: spacing[0.5] },\n textDefault: { ...textBase, color: c.mutedForeground },\n textDestructive: { ...textBase, color: c.destructive },\n textInfo: { ...textBase, color: c.info },\n textLg: { fontSize: t.primitives.typography.sm },\n textMd: { fontSize: t.primitives.typography.xs },\n textOutline: { ...textBase, color: c.foreground },\n textPrimary: { ...textBase, color: c.primaryForeground },\n textSm: { fontSize: t.primitives.typography.xs - 1 },\n textSuccess: { ...textBase, color: c.success },\n textWarning: { ...textBase, color: c.warning },\n variantDefault: variantBox(c.border),\n variantDestructive: variantBox(c.destructive),\n variantInfo: variantBox(c.info),\n variantOutline: variantBox(c.border, c.background),\n variantPrimary: variantBox(c.primary, c.primary),\n variantSuccess: variantBox(c.success),\n variantWarning: variantBox(c.warning),\n });\n return {\n ...sheet,\n containerSizeMap: {\n sm: sheet.sizeSm,\n md: sheet.sizeMd,\n lg: sheet.sizeLg,\n } as Record<BadgeSize, Style>,\n containerVariantMap: {\n default: sheet.variantDefault,\n primary: sheet.variantPrimary,\n success: sheet.variantSuccess,\n warning: sheet.variantWarning,\n destructive: sheet.variantDestructive,\n info: sheet.variantInfo,\n outline: sheet.variantOutline,\n } as Record<BadgeVariant, Style>,\n textSizeMap: {\n sm: sheet.textSm,\n md: sheet.textMd,\n lg: sheet.textLg,\n } as Record<BadgeSize, Style>,\n textVariantMap: {\n default: sheet.textDefault,\n primary: sheet.textPrimary,\n success: sheet.textSuccess,\n warning: sheet.textWarning,\n destructive: sheet.textDestructive,\n info: sheet.textInfo,\n outline: sheet.textOutline,\n } as Record<BadgeVariant, Style>,\n };\n}\n\nexport function Badge({\n label,\n children,\n variant = \"default\",\n size = \"md\",\n background,\n color,\n style,\n}: BadgeProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createBadgeStyles(theme), [theme]);\n // `label` takes precedence; fall back to string children for React idiom compatibility\n const text = label ?? children ?? \"\";\n const containerStyles: Style[] = [\n styles.containerBase,\n styles.containerVariantMap[variant],\n styles.containerSizeMap[size],\n ...(background\n ? [{ backgroundColor: resolveColor(background, theme.colors) }]\n : []),\n ...(style ? [style].flat() : []),\n ];\n const textStyles: Style[] = [\n styles.textVariantMap[variant],\n styles.textSizeMap[size],\n ...(color ? [{ color: resolveColor(color, theme.colors) }] : []),\n ];\n return (\n <View style={containerStyles}>\n <PDFText style={textStyles}>{text}</PDFText>\n </View>\n );\n}\n",- "type": "registry:component"+ "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type BadgeVariant =\n | \"default\"\n | \"primary\"\n | \"success\"\n | \"warning\"\n | \"destructive\"\n | \"info\"\n | \"outline\";\nexport type BadgeSize = \"sm\" | \"md\" | \"lg\";\n\n/**\n * Inline label for status, tags, or categories.\n *\n * Accepts text via either `label` prop or `children` (string). `label` takes\n * precedence when both are provided. The children pattern (`<Badge>text</Badge>`)\n * is supported for compatibility with common React idioms, but note that\n * `Takumi PDF primitives` doesn't support JSX children the way HTML does — only\n * string children are accepted.\n *\n * Props - `label` | `children` | `variant` | `size` | `background` | `color` | `style`\n * @see {@link BadgeProps}\n */\nexport interface BadgeProps extends Omit<PDFComponentProps, \"children\"> {\n /** Text to display. Takes precedence over children when both are provided. */\n label?: string;\n /** String children as an alternative to the label prop. */\n children?: string;\n /**\n * @default 'default'\n */\n variant?: BadgeVariant;\n /**\n * @default 'md'\n */\n size?: BadgeSize;\n background?: string;\n color?: string;\n}\n\nconst createBadgeStyles = (t: PdfcnTheme) => {\n const { spacing, borderRadius, fontWeights } = t.primitives;\n const c = t.colors;\n const textBase = {\n fontFamily: t.typography.body.fontFamily,\n fontWeight: fontWeights.semibold,\n letterSpacing: 0.3,\n };\n const variantBox = (borderColor: string, bgColor: string = c.muted) => ({\n backgroundColor: bgColor,\n borderColor,\n borderStyle: \"solid\" as const,\n borderWidth: spacing[0.5],\n });\n const sheet = StyleSheet.create({\n containerBase: {\n alignItems: \"center\" as const,\n alignSelf: \"flex-start\" as const,\n borderRadius: borderRadius.full,\n flexDirection: \"row\" as const,\n },\n sizeLg: { paddingHorizontal: spacing[4], paddingVertical: spacing[2] },\n sizeMd: { paddingHorizontal: spacing[3], paddingVertical: spacing[1] },\n sizeSm: { paddingHorizontal: spacing[2], paddingVertical: spacing[0.5] },\n textDefault: { ...textBase, color: c.mutedForeground },\n textDestructive: { ...textBase, color: c.destructive },\n textInfo: { ...textBase, color: c.info },\n textLg: { fontSize: t.primitives.typography.sm },\n textMd: { fontSize: t.primitives.typography.xs },\n textOutline: { ...textBase, color: c.foreground },\n textPrimary: { ...textBase, color: c.primaryForeground },\n textSm: { fontSize: t.primitives.typography.xs - 1 },\n textSuccess: { ...textBase, color: c.success },\n textWarning: { ...textBase, color: c.warning },\n variantDefault: variantBox(c.border),\n variantDestructive: variantBox(c.destructive),\n variantInfo: variantBox(c.info),\n variantOutline: variantBox(c.border, c.background),\n variantPrimary: variantBox(c.primary, c.primary),\n variantSuccess: variantBox(c.success),\n variantWarning: variantBox(c.warning),\n });\n return {\n ...sheet,\n containerSizeMap: {\n lg: sheet.sizeLg,\n md: sheet.sizeMd,\n sm: sheet.sizeSm,\n } as Record<BadgeSize, Style>,\n containerVariantMap: {\n default: sheet.variantDefault,\n destructive: sheet.variantDestructive,\n info: sheet.variantInfo,\n outline: sheet.variantOutline,\n primary: sheet.variantPrimary,\n success: sheet.variantSuccess,\n warning: sheet.variantWarning,\n } as Record<BadgeVariant, Style>,\n textSizeMap: {\n lg: sheet.textLg,\n md: sheet.textMd,\n sm: sheet.textSm,\n } as Record<BadgeSize, Style>,\n textVariantMap: {\n default: sheet.textDefault,\n destructive: sheet.textDestructive,\n info: sheet.textInfo,\n outline: sheet.textOutline,\n primary: sheet.textPrimary,\n success: sheet.textSuccess,\n warning: sheet.textWarning,\n } as Record<BadgeVariant, Style>,\n };\n};\n\nexport const Badge = ({\n label,\n children,\n variant = \"default\",\n size = \"md\",\n background,\n color,\n style,\n}: BadgeProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createBadgeStyles(theme), [theme]);\n // `label` takes precedence; fall back to string children for React idiom compatibility\n const text = label ?? children ?? \"\";\n const containerStyles: Style[] = [\n styles.containerBase,\n styles.containerVariantMap[variant],\n styles.containerSizeMap[size],\n ...(background\n ? [{ backgroundColor: resolveColor(background, theme.colors) }]\n : []),\n ...(style ? [style].flat() : []),\n ];\n const textStyles: Style[] = [\n styles.textVariantMap[variant],\n styles.textSizeMap[size],\n ...(color ? [{ color: resolveColor(color, theme.colors) }] : []),\n ];\n return (\n <View style={containerStyles}>\n <PDFText style={textStyles}>{text}</PDFText>\n </View>\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/badge/badge.tsx"},{"path": "registry/bases/takumi/components/badge/index.ts","content": "export {\n Badge,\n type BadgeProps,\n type BadgeVariant,\n type BadgeSize,\n} from \"./badge\";\n",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/badge/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/card.json b/public/r/takumi/card.jsonindex 4cbdc33..bd75d44 100644--- a/public/r/takumi/card.json+++ b/public/r/takumi/card.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/takumi/components/card/card.tsx",- "content": "import type { ReactNode } from \"react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type CardVariant = \"default\" | \"bordered\" | \"muted\";\n\n/**\n * Bordered content card with optional title and padding presets.\n * Props - `title` | `children` | `variant` | `padding` | `wrap` | `style`\n * @see {@link PdfCardProps}\n */\nexport interface PdfCardProps extends Omit<PDFComponentProps, \"children\"> {\n title?: string;\n children?: ReactNode;\n /**\n * @default 'default'\n */\n variant?: CardVariant;\n /**\n * @default 'md'\n */\n padding?: \"sm\" | \"md\" | \"lg\";\n /**\n * When false, the card will not split across PDF pages.\n * @default false\n */\n wrap?: boolean;\n}\n\nfunction createCardStyles(t: PdfcnTheme) {\n const { spacing, borderRadius, fontWeights } = t.primitives;\n return StyleSheet.create({\n body: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n lineHeight: t.typography.body.lineHeight,\n },\n card: {\n backgroundColor: t.colors.background,\n borderColor: t.colors.border,\n borderRadius: borderRadius.sm,\n borderStyle: \"solid\",\n borderWidth: 1,\n marginBottom: t.spacing.componentGap,\n },\n cardBordered: { borderWidth: 2 },\n cardMuted: { backgroundColor: t.colors.muted },\n paddingLg: { padding: spacing[4] },\n paddingMd: { padding: spacing[3] },\n paddingSm: { padding: spacing[2] },\n title: {\n borderBottomColor: t.colors.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n color: t.colors.foreground,\n fontFamily: t.typography.heading.fontFamily,\n fontSize: t.primitives.typography.base,\n fontWeight: fontWeights.semibold,\n lineHeight: t.typography.heading.lineHeight,\n marginBottom: spacing[2],\n paddingBottom: spacing[1] + 2,\n },\n });\n}\n\nexport function PdfCard({\n title,\n children,\n variant = \"default\",\n padding = \"md\",\n wrap = false,\n style,\n}: PdfCardProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createCardStyles(theme), [theme]);\n const paddingMap = {\n lg: styles.paddingLg,\n md: styles.paddingMd,\n sm: styles.paddingSm,\n };\n const cardStyles: Style[] = [styles.card];\n if (variant === \"bordered\") {cardStyles.push(styles.cardBordered);}\n if (variant === \"muted\") {cardStyles.push(styles.cardMuted);}\n cardStyles.push(paddingMap[padding]);\n if (style) {cardStyles.push(style);}\n return (\n <View wrap={wrap} style={cardStyles}>\n {title ? <PDFText style={styles.title}>{title}</PDFText> : null}\n {typeof children === \"string\" ? (\n <PDFText style={styles.body}>{children}</PDFText>\n ) : (\n children\n )}\n </View>\n );\n}\n",- "type": "registry:component"+ "content": "import type { ReactNode } from \"react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type CardVariant = \"default\" | \"bordered\" | \"muted\";\n\n/**\n * Bordered content card with optional title and padding presets.\n * Props - `title` | `children` | `variant` | `padding` | `wrap` | `style`\n * @see {@link PdfCardProps}\n */\nexport interface PdfCardProps extends Omit<PDFComponentProps, \"children\"> {\n title?: string;\n children?: ReactNode;\n /**\n * @default 'default'\n */\n variant?: CardVariant;\n /**\n * @default 'md'\n */\n padding?: \"sm\" | \"md\" | \"lg\";\n /**\n * When false, the card will not split across PDF pages.\n * @default false\n */\n wrap?: boolean;\n}\n\nconst createCardStyles = (t: PdfcnTheme) => {\n const { spacing, borderRadius, fontWeights } = t.primitives;\n return StyleSheet.create({\n body: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n lineHeight: t.typography.body.lineHeight,\n },\n card: {\n backgroundColor: t.colors.background,\n borderColor: t.colors.border,\n borderRadius: borderRadius.sm,\n borderStyle: \"solid\",\n borderWidth: 1,\n marginBottom: t.spacing.componentGap,\n },\n cardBordered: { borderWidth: 2 },\n cardMuted: { backgroundColor: t.colors.muted },\n paddingLg: { padding: spacing[4] },\n paddingMd: { padding: spacing[3] },\n paddingSm: { padding: spacing[2] },\n title: {\n borderBottomColor: t.colors.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n color: t.colors.foreground,\n fontFamily: t.typography.heading.fontFamily,\n fontSize: t.primitives.typography.base,\n fontWeight: fontWeights.semibold,\n lineHeight: t.typography.heading.lineHeight,\n marginBottom: spacing[2],\n paddingBottom: spacing[1] + 2,\n },\n });\n};\n\nexport const PdfCard = ({\n title,\n children,\n variant = \"default\",\n padding = \"md\",\n wrap = false,\n style,\n}: PdfCardProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createCardStyles(theme), [theme]);\n const paddingMap = {\n lg: styles.paddingLg,\n md: styles.paddingMd,\n sm: styles.paddingSm,\n };\n const cardStyles: Style[] = [styles.card];\n if (variant === \"bordered\") {\n cardStyles.push(styles.cardBordered);\n }\n if (variant === \"muted\") {\n cardStyles.push(styles.cardMuted);\n }\n cardStyles.push(paddingMap[padding]);\n if (style) {\n cardStyles.push(style);\n }\n return (\n <View wrap={wrap} style={cardStyles}>\n {title ? <PDFText style={styles.title}>{title}</PDFText> : null}\n {typeof children === \"string\" ? (\n <PDFText style={styles.body}>{children}</PDFText>\n ) : (\n children\n )}\n </View>\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/card/card.tsx"},{"path": "registry/bases/takumi/components/card/index.ts","content": "export { PdfCard, type PdfCardProps, type CardVariant } from \"./card\";\n",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/card/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/data-table.json b/public/r/takumi/data-table.jsonindex 9cf9749..8fe89fd 100644--- a/public/r/takumi/data-table.json+++ b/public/r/takumi/data-table.json@@ -14,23 +14,27 @@"files": [{"path": "registry/bases/takumi/components/data-table/data-table.styles.ts",- "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { StyleSheet } from \"../../lib/takumi-primitives\";\n\n/**\n * Creates compact-mode cell and text styles for the DataTable component.\n * Used when `size=\"compact\"` to render denser rows with smaller font sizes.\n * @param t - The resolved PdfcnTheme instance.\n */\nexport function createCompactStyles(t: PdfcnTheme) {\n const { spacing, fontWeights, lineHeights } = t.primitives;\n return StyleSheet.create({\n cell: {\n paddingHorizontal: spacing[2],\n paddingVertical: spacing[0.5],\n },\n footerText: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n fontWeight: fontWeights.semibold,\n lineHeight: lineHeights.normal,\n },\n headerText: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n fontWeight: fontWeights.semibold,\n lineHeight: lineHeights.normal,\n },\n text: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n lineHeight: lineHeights.normal,\n },\n });\n}\n\n/**\n * Converts an arbitrary cell value to a display string.\n * Returns an empty string for null/undefined values.\n * @param value - The raw cell value to format.\n */\nexport function formatValue(value: unknown): string {\n if (value === null || value === undefined) {return \"\";}\n if (typeof value === \"number\") {return String(value);}\n return String(value);\n}\n",- "type": "registry:component"+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { StyleSheet } from \"../../lib/takumi-primitives\";\n\n/**\n * Creates compact-mode cell and text styles for the DataTable component.\n * Used when `size=\"compact\"` to render denser rows with smaller font sizes.\n * @param t - The resolved PdfcnTheme instance.\n */\nexport const createCompactStyles = (t: PdfcnTheme) => {\n const { spacing, fontWeights, lineHeights } = t.primitives;\n return StyleSheet.create({\n cell: {\n paddingHorizontal: spacing[2],\n paddingVertical: spacing[0.5],\n },\n footerText: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n fontWeight: fontWeights.semibold,\n lineHeight: lineHeights.normal,\n },\n headerText: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n fontWeight: fontWeights.semibold,\n lineHeight: lineHeights.normal,\n },\n text: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n lineHeight: lineHeights.normal,\n },\n });\n};\n\n/**\n * Converts an arbitrary cell value to a display string.\n * Returns an empty string for null/undefined values.\n * @param value - The raw cell value to format.\n */\nexport const formatValue = (value: unknown): string => {\n if (value === null || value === undefined) {\n return \"\";\n }\n if (typeof value === \"number\") {\n return String(value);\n }\n return String(value);\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/data-table/data-table.styles.ts"},{"path": "registry/bases/takumi/components/data-table/data-table.tsx",- "content": "import { Fragment } from \"react\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { Text as PDFText } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\nimport {\n Table,\n TableBody,\n TableCell,\n TableFooter,\n TableHeader,\n TableRow,\n} from \"../table\";\nimport { createCompactStyles, formatValue } from \"./data-table.styles\";\nimport type { DataTableProps } from \"./data-table.types\";\n\nexport function DataTable<T extends Record<string, unknown>>({\n columns,\n data,\n variant = \"grid\",\n footer,\n stripe = false,\n size = \"default\",\n noWrap = false,\n style,\n}: DataTableProps<T>) {\n const theme = usePdfcnTheme();\n const compact = useSafeMemo(() => createCompactStyles(theme), [theme]);\n const isCompact = size === \"compact\";\n\n return (\n <Table variant={variant} zebraStripe={stripe} noWrap={noWrap} style={style}>\n <TableHeader>\n <TableRow header>\n {columns.map((col) => (\n <TableCell\n key={col.key}\n header\n align={col.align ?? \"left\"}\n width={col.width}\n style={isCompact ? compact.cell : undefined}\n >\n {isCompact ? (\n <PDFText\n style={[\n compact.headerText,\n col.align ? ({ textAlign: col.align } as Style) : {},\n ]}\n >\n {col.header}\n </PDFText>\n ) : (\n col.header\n )}\n </TableCell>\n ))}\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.map((row, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: DataTable has no row id; order is stable for static data\n <Fragment key={i}>\n <TableRow>\n {columns.map((col) => {\n const value = row[col.key];\n const rendered = col.render ? col.render(value, row) : null;\n const text = rendered === null ? formatValue(value) : null;\n return (\n <TableCell\n key={col.key}\n align={col.align ?? \"left\"}\n width={col.width}\n style={isCompact ? compact.cell : undefined}\n >\n {isCompact ? (\n rendered !== null ? (\n rendered\n ) : (\n <PDFText\n style={[\n compact.text,\n col.align\n ? ({ textAlign: col.align } as Style)\n : {},\n ]}\n >\n {text}\n </PDFText>\n )\n ) : (rendered !== null ? (\n rendered\n ) : (\n text\n ))}\n </TableCell>\n );\n })}\n </TableRow>\n </Fragment>\n ))}\n </TableBody>\n {footer && (\n <TableFooter>\n <TableRow footer>\n {columns.map((col) => {\n const value = col.key in footer ? footer[col.key] : \"\";\n const rendered = col.renderFooter\n ? col.renderFooter(value)\n : null;\n const text = rendered === null ? formatValue(value) : null;\n return (\n <TableCell\n key={col.key}\n footer={!!value}\n align={col.align ?? \"left\"}\n width={col.width}\n style={isCompact ? compact.cell : undefined}\n >\n {isCompact ? (\n rendered !== null ? (\n rendered\n ) : (\n <PDFText\n style={[\n value ? compact.footerText : compact.text,\n col.align ? ({ textAlign: col.align } as Style) : {},\n ]}\n >\n {text}\n </PDFText>\n )\n ) : (rendered !== null ? (\n rendered\n ) : (\n text\n ))}\n </TableCell>\n );\n })}\n </TableRow>\n </TableFooter>\n )}\n </Table>\n );\n}\n",- "type": "registry:component"+ "content": "import { Fragment } from \"react\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { Text as PDFText } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\nimport {\n Table,\n TableBody,\n TableCell,\n TableFooter,\n TableHeader,\n TableRow,\n} from \"../table\";\nimport { createCompactStyles, formatValue } from \"./data-table.styles\";\nimport type { DataTableProps } from \"./data-table.types\";\n\nexport const DataTable = <T extends Record<string, unknown>>({\n columns,\n data,\n variant = \"grid\",\n footer,\n stripe = false,\n size = \"default\",\n noWrap = false,\n style,\n}: DataTableProps<T>) => {\n const theme = usePdfcnTheme();\n const compact = useSafeMemo(() => createCompactStyles(theme), [theme]);\n const isCompact = size === \"compact\";\n\n return (\n <Table variant={variant} zebraStripe={stripe} noWrap={noWrap} style={style}>\n <TableHeader>\n <TableRow header>\n {columns.map((col) => (\n <TableCell\n key={col.key}\n header\n align={col.align ?? \"left\"}\n width={col.width}\n style={isCompact ? compact.cell : undefined}\n >\n {isCompact ? (\n <PDFText\n style={[\n compact.headerText,\n col.align ? ({ textAlign: col.align } as Style) : {},\n ]}\n >\n {col.header}\n </PDFText>\n ) : (\n col.header\n )}\n </TableCell>\n ))}\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.map((row, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: DataTable has no row id; order is stable for static data\n <Fragment key={i}>\n <TableRow>\n {columns.map((col) => {\n const value = row[col.key];\n const rendered = col.render ? col.render(value, row) : null;\n const text = rendered === null ? formatValue(value) : null;\n return (\n <TableCell\n key={col.key}\n align={col.align ?? \"left\"}\n width={col.width}\n style={isCompact ? compact.cell : undefined}\n >\n {isCompact\n ? (rendered ?? (\n <PDFText\n style={[\n compact.text,\n col.align\n ? ({ textAlign: col.align } as Style)\n : {},\n ]}\n >\n {text}\n </PDFText>\n ))\n : (rendered ?? text)}\n </TableCell>\n );\n })}\n </TableRow>\n </Fragment>\n ))}\n </TableBody>\n {footer && (\n <TableFooter>\n <TableRow footer>\n {columns.map((col) => {\n const value = col.key in footer ? footer[col.key] : \"\";\n const rendered = col.renderFooter\n ? col.renderFooter(value)\n : null;\n const text = rendered === null ? formatValue(value) : null;\n return (\n <TableCell\n key={col.key}\n footer={!!value}\n align={col.align ?? \"left\"}\n width={col.width}\n style={isCompact ? compact.cell : undefined}\n >\n {isCompact\n ? (rendered ?? (\n <PDFText\n style={[\n value ? compact.footerText : compact.text,\n col.align\n ? ({ textAlign: col.align } as Style)\n : {},\n ]}\n >\n {text}\n </PDFText>\n ))\n : (rendered ?? text)}\n </TableCell>\n );\n })}\n </TableRow>\n </TableFooter>\n )}\n </Table>\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/data-table/data-table.tsx"},{"path": "registry/bases/takumi/components/data-table/data-table.types.ts","content": "import type React from \"react\";\n\nimport type { PDFComponentProps } from \"@/registry/themes\";\n\nimport type { TableVariant } from \"../table/table.types\";\n\n/** DataTable row density size. */\nexport type DataTableSize = \"default\" | \"compact\";\n\n/**\n * Column definition for a DataTable.\n * Props - `key` | `header` | `align` | `width` | `render` | `renderFooter`\n * @see {@link DataTableColumn}\n */\nexport interface DataTableColumn<T = Record<string, unknown>> {\n key: keyof T & string;\n header: string;\n align?: \"left\" | \"center\" | \"right\";\n width?: string | number;\n /**\n * Custom cell renderer. Must return Takumi PDF primitives elements (Text, View,\n * Image, etc.) — NOT HTML DOM elements. TypeScript accepts ReactNode but DOM\n * nodes will crash at runtime in the PDF renderer.\n */\n render?: (value: unknown, row: T) => React.ReactNode;\n /**\n * Custom footer cell renderer. Same constraint: return Takumi PDF primitives\n * elements only — no HTML/DOM nodes.\n */\n renderFooter?: (value: unknown) => React.ReactNode;\n}\n\n/**\n * Data table for PDF rendering with column definitions, footer support, and stripe options.\n * Props - `columns` | `data` | `variant` | `footer` | `stripe` | `size` | `noWrap` | `style`\n * @see {@link DataTableProps}\n */\nexport interface DataTableProps<T = Record<string, unknown>> extends Omit<\n PDFComponentProps,\n \"children\"\n> {\n columns: DataTableColumn<T>[];\n data: T[];\n /**\n * @default 'grid'\n */\n variant?: TableVariant;\n footer?: Partial<Record<keyof T & string, string | number>>;\n stripe?: boolean;\n /**\n * @default 'default'\n */\n size?: DataTableSize;\n noWrap?: boolean;\n}\n",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/data-table/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/divider.json b/public/r/takumi/divider.jsonindex a59775f..3e69831 100644--- a/public/r/takumi/divider.json+++ b/public/r/takumi/divider.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/takumi/components/divider/divider.tsx",- "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type DividerVariant = \"solid\" | \"dashed\" | \"dotted\";\nexport type DividerThickness = \"thin\" | \"medium\" | \"thick\";\nexport type DividerSpacing = \"none\" | \"sm\" | \"md\" | \"lg\";\n\n/**\n * Horizontal rule with optional label, style variants, and spacing presets.\n * Props - `spacing` | `variant` | `color` | `thickness` | `label` | `width` | `style`\n * @see {@link DividerProps}\n */\nexport interface DividerProps extends Omit<PDFComponentProps, \"children\"> {\n /**\n * @default 'md'\n */\n spacing?: DividerSpacing;\n /**\n * @default 'solid'\n */\n variant?: DividerVariant;\n color?: string;\n /**\n * @default 'thin'\n */\n thickness?: DividerThickness;\n label?: string;\n width?: string | number;\n}\n\nfunction createDividerStyles(t: PdfcnTheme) {\n const { spacing, fontWeights } = t.primitives;\n return StyleSheet.create({\n base: { borderBottomColor: t.colors.border, borderBottomStyle: \"solid\" },\n dashed: { borderBottomStyle: \"dashed\" },\n dotted: { borderBottomStyle: \"dotted\" },\n labelContainer: { alignItems: \"center\", flexDirection: \"row\" },\n labelLine: {\n borderBottomColor: t.colors.border,\n borderBottomStyle: \"solid\",\n flex: 1,\n },\n labelText: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n fontWeight: fontWeights.medium,\n letterSpacing: t.primitives.letterSpacing.wider * 10,\n paddingHorizontal: spacing[3],\n textTransform: \"uppercase\",\n },\n medium: { borderBottomWidth: spacing[1] },\n solid: { borderBottomStyle: \"solid\" },\n spacingLg: { marginVertical: t.spacing.sectionGap },\n spacingMd: { marginVertical: t.spacing.componentGap },\n spacingNone: { marginVertical: spacing[0] },\n spacingSm: { marginVertical: t.spacing.paragraphGap },\n thick: { borderBottomWidth: spacing[2] },\n thin: { borderBottomWidth: spacing[0.5] },\n });\n}\n\nexport function Divider({\n spacing = \"md\",\n variant = \"solid\",\n color,\n thickness = \"thin\",\n label,\n width,\n style,\n}: DividerProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createDividerStyles(theme), [theme]);\n const spacingMap = {\n lg: styles.spacingLg,\n md: styles.spacingMd,\n none: styles.spacingNone,\n sm: styles.spacingSm,\n };\n const variantMap = {\n dashed: styles.dashed,\n dotted: styles.dotted,\n solid: styles.solid,\n };\n const thicknessMap = {\n medium: styles.medium,\n thick: styles.thick,\n thin: styles.thin,\n };\n\n if (label) {\n const lineStyle: Style[] = [\n styles.labelLine,\n thicknessMap[thickness],\n variantMap[variant],\n ];\n if (color)\n {lineStyle.push({ borderBottomColor: resolveColor(color, theme.colors) });}\n const containerStyles: Style[] = [\n styles.labelContainer,\n spacingMap[spacing],\n ];\n if (width !== undefined) {containerStyles.push({ width } as Style);}\n if (style) {containerStyles.push(...[style].flat());}\n const labelTextStyle: Style[] = [styles.labelText];\n if (color)\n {labelTextStyle.push({ color: resolveColor(color, theme.colors) });}\n return (\n <View style={containerStyles}>\n <View style={lineStyle} />\n <PDFText style={labelTextStyle}>{label}</PDFText>\n <View style={lineStyle} />\n </View>\n );\n }\n\n const styleArray: Style[] = [\n styles.base,\n spacingMap[spacing],\n variantMap[variant],\n thicknessMap[thickness],\n ];\n if (color)\n {styleArray.push({ borderBottomColor: resolveColor(color, theme.colors) });}\n if (width !== undefined) {styleArray.push({ width } as Style);}\n if (style) {styleArray.push(...[style].flat());}\n return <View style={styleArray} />;\n}\n",- "type": "registry:component"+ "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type DividerVariant = \"solid\" | \"dashed\" | \"dotted\";\nexport type DividerThickness = \"thin\" | \"medium\" | \"thick\";\nexport type DividerSpacing = \"none\" | \"sm\" | \"md\" | \"lg\";\n\n/**\n * Horizontal rule with optional label, style variants, and spacing presets.\n * Props - `spacing` | `variant` | `color` | `thickness` | `label` | `width` | `style`\n * @see {@link DividerProps}\n */\nexport interface DividerProps extends Omit<PDFComponentProps, \"children\"> {\n /**\n * @default 'md'\n */\n spacing?: DividerSpacing;\n /**\n * @default 'solid'\n */\n variant?: DividerVariant;\n color?: string;\n /**\n * @default 'thin'\n */\n thickness?: DividerThickness;\n label?: string;\n width?: string | number;\n}\n\nconst createDividerStyles = (t: PdfcnTheme) => {\n const { spacing, fontWeights } = t.primitives;\n return StyleSheet.create({\n base: { borderBottomColor: t.colors.border, borderBottomStyle: \"solid\" },\n dashed: { borderBottomStyle: \"dashed\" },\n dotted: { borderBottomStyle: \"dotted\" },\n labelContainer: { alignItems: \"center\", flexDirection: \"row\" },\n labelLine: {\n borderBottomColor: t.colors.border,\n borderBottomStyle: \"solid\",\n flex: 1,\n },\n labelText: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n fontWeight: fontWeights.medium,\n letterSpacing: t.primitives.letterSpacing.wider * 10,\n paddingHorizontal: spacing[3],\n textTransform: \"uppercase\",\n },\n medium: { borderBottomWidth: spacing[1] },\n solid: { borderBottomStyle: \"solid\" },\n spacingLg: { marginVertical: t.spacing.sectionGap },\n spacingMd: { marginVertical: t.spacing.componentGap },\n spacingNone: { marginVertical: spacing[0] },\n spacingSm: { marginVertical: t.spacing.paragraphGap },\n thick: { borderBottomWidth: spacing[2] },\n thin: { borderBottomWidth: spacing[0.5] },\n });\n};\n\nexport const Divider = ({\n spacing = \"md\",\n variant = \"solid\",\n color,\n thickness = \"thin\",\n label,\n width,\n style,\n}: DividerProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createDividerStyles(theme), [theme]);\n const spacingMap = {\n lg: styles.spacingLg,\n md: styles.spacingMd,\n none: styles.spacingNone,\n sm: styles.spacingSm,\n };\n const variantMap = {\n dashed: styles.dashed,\n dotted: styles.dotted,\n solid: styles.solid,\n };\n const thicknessMap = {\n medium: styles.medium,\n thick: styles.thick,\n thin: styles.thin,\n };\n\n if (label) {\n const lineStyle: Style[] = [\n styles.labelLine,\n thicknessMap[thickness],\n variantMap[variant],\n ];\n if (color) {\n lineStyle.push({ borderBottomColor: resolveColor(color, theme.colors) });\n }\n const containerStyles: Style[] = [\n styles.labelContainer,\n spacingMap[spacing],\n ];\n if (width !== undefined) {\n containerStyles.push({ width } as Style);\n }\n if (style) {\n containerStyles.push(...[style].flat());\n }\n const labelTextStyle: Style[] = [styles.labelText];\n if (color) {\n labelTextStyle.push({ color: resolveColor(color, theme.colors) });\n }\n return (\n <View style={containerStyles}>\n <View style={lineStyle} />\n <PDFText style={labelTextStyle}>{label}</PDFText>\n <View style={lineStyle} />\n </View>\n );\n }\n\n const styleArray: Style[] = [\n styles.base,\n spacingMap[spacing],\n variantMap[variant],\n thicknessMap[thickness],\n ];\n if (color) {\n styleArray.push({ borderBottomColor: resolveColor(color, theme.colors) });\n }\n if (width !== undefined) {\n styleArray.push({ width } as Style);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return <View style={styleArray} />;\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/divider/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/form.json b/public/r/takumi/form.jsonindex 047e420..d887afc 100644--- a/public/r/takumi/form.json+++ b/public/r/takumi/form.json@@ -13,23 +13,27 @@"files": [{"path": "registry/bases/takumi/components/form/form.styles.ts",- "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { PdfFormVariant } from \"./form.types\";\n\n/** Style factory for fillable form layouts, derived from the active theme. */\nexport function createFormStyles(\n t: PdfcnTheme,\n variant: PdfFormVariant = \"underline\"\n) {\n const { spacing, borderRadius, fontWeights, typography } = t.primitives;\n const borderColor = t.colors.border;\n const hairline = 0.75; // lighter than spacing[0.5]=2pt — more refined\n const rule = 1; // group title rule\n\n const fieldAreaByVariant: Record<PdfFormVariant, object> = {\n box: {\n borderColor: borderColor,\n borderRadius: borderRadius.sm,\n borderStyle: \"solid\",\n borderWidth: hairline,\n },\n ghost: {\n backgroundColor: t.colors.muted,\n borderRadius: borderRadius.sm,\n },\n outlined: {\n borderColor: t.colors.foreground,\n borderRadius: borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: hairline,\n },\n underline: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n },\n };\n\n const hasPadding =\n variant === \"box\" || variant === \"outlined\" || variant === \"ghost\";\n\n return StyleSheet.create({\n column: {\n flex: 1,\n },\n\n columnsRow: {\n flexDirection: \"row\",\n gap: spacing[4],\n },\n fieldAbove: {\n marginBottom: spacing[3],\n width: \"100%\",\n },\n fieldArea: {\n width: \"100%\" as const,\n ...fieldAreaByVariant[variant],\n },\n\n fieldLeft: {\n alignItems: \"flex-end\",\n flexDirection: \"row\",\n gap: spacing[2],\n marginBottom: spacing[3],\n },\n fieldLeftArea: {\n flex: 1,\n },\n\n formDivider: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n marginBottom: spacing[4],\n },\n formSubtitle: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n lineHeight: t.typography.body.lineHeight,\n marginBottom: spacing[3],\n },\n\n formTitle: {\n color: t.colors.foreground,\n fontFamily: t.typography.heading.fontFamily,\n fontSize: typography.xl,\n fontWeight: fontWeights.bold,\n lineHeight: t.typography.heading.lineHeight,\n marginBottom: spacing[1],\n },\n group: {\n marginBottom: spacing[5],\n },\n\n groupTitle: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.semibold,\n letterSpacing: 0.8,\n lineHeight: 1.2,\n marginBottom: spacing[3],\n textTransform: \"uppercase\",\n },\n hint: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n opacity: 0.14,\n paddingBottom: hasPadding ? spacing[1] : 0,\n paddingHorizontal: hasPadding ? spacing[2] : 0,\n paddingTop: hasPadding ? spacing[1] : spacing[0.5],\n },\n labelAbove: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.medium,\n letterSpacing: 0.5,\n lineHeight: 1.2,\n marginBottom: spacing[1],\n textTransform: \"uppercase\",\n },\n\n labelLeft: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.medium,\n lineHeight: t.typography.body.lineHeight,\n paddingBottom: hasPadding ? spacing[1] : 0,\n width: 80,\n },\n\n root: {\n marginBottom: t.spacing.componentGap,\n width: \"100%\",\n },\n });\n}\n",- "type": "registry:component"+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { PdfFormVariant } from \"./form.types\";\n\n/** Style factory for fillable form layouts, derived from the active theme. */\nexport const createFormStyles = (\n t: PdfcnTheme,\n variant: PdfFormVariant = \"underline\"\n) => {\n const { spacing, borderRadius, fontWeights, typography } = t.primitives;\n const borderColor = t.colors.border;\n // lighter than spacing[0.5]=2pt — more refined\n const hairline = 0.75;\n // group title rule\n const rule = 1;\n\n const fieldAreaByVariant: Record<PdfFormVariant, object> = {\n box: {\n borderColor,\n borderRadius: borderRadius.sm,\n borderStyle: \"solid\",\n borderWidth: hairline,\n },\n ghost: {\n backgroundColor: t.colors.muted,\n borderRadius: borderRadius.sm,\n },\n outlined: {\n borderColor: t.colors.foreground,\n borderRadius: borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: hairline,\n },\n underline: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n },\n };\n\n const hasPadding =\n variant === \"box\" || variant === \"outlined\" || variant === \"ghost\";\n\n return StyleSheet.create({\n column: {\n flex: 1,\n },\n\n columnsRow: {\n flexDirection: \"row\",\n gap: spacing[4],\n },\n fieldAbove: {\n marginBottom: spacing[3],\n width: \"100%\",\n },\n fieldArea: {\n width: \"100%\" as const,\n ...fieldAreaByVariant[variant],\n },\n\n fieldLeft: {\n alignItems: \"flex-end\",\n flexDirection: \"row\",\n gap: spacing[2],\n marginBottom: spacing[3],\n },\n fieldLeftArea: {\n flex: 1,\n },\n\n formDivider: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n marginBottom: spacing[4],\n },\n formSubtitle: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n lineHeight: t.typography.body.lineHeight,\n marginBottom: spacing[3],\n },\n\n formTitle: {\n color: t.colors.foreground,\n fontFamily: t.typography.heading.fontFamily,\n fontSize: typography.xl,\n fontWeight: fontWeights.bold,\n lineHeight: t.typography.heading.lineHeight,\n marginBottom: spacing[1],\n },\n group: {\n marginBottom: spacing[5],\n },\n\n groupTitle: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.semibold,\n letterSpacing: 0.8,\n lineHeight: 1.2,\n marginBottom: spacing[3],\n textTransform: \"uppercase\",\n },\n hint: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n opacity: 0.14,\n paddingBottom: hasPadding ? spacing[1] : 0,\n paddingHorizontal: hasPadding ? spacing[2] : 0,\n paddingTop: hasPadding ? spacing[1] : spacing[0.5],\n },\n labelAbove: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.medium,\n letterSpacing: 0.5,\n lineHeight: 1.2,\n marginBottom: spacing[1],\n textTransform: \"uppercase\",\n },\n\n labelLeft: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.medium,\n lineHeight: t.typography.body.lineHeight,\n paddingBottom: hasPadding ? spacing[1] : 0,\n width: 80,\n },\n\n root: {\n marginBottom: t.spacing.componentGap,\n width: \"100%\",\n },\n });\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/form/form.styles.ts"},{"path": "registry/bases/takumi/components/form/form.tsx",- "content": "import { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, Text as PDFText } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\nimport { createFormStyles } from \"./form.styles\";\nimport type {\n FormLayout,\n PdfFormField,\n PdfFormGroup,\n PdfFormProps,\n} from \"./form.types\";\n\nfunction renderFieldAbove(\n field: PdfFormField,\n idx: number,\n styles: ReturnType<typeof createFormStyles>\n) {\n const areaHeight = field.height ?? 18;\n const areaStyle: Style[] = [styles.fieldArea, { minHeight: areaHeight }];\n\n return (\n <View key={`${field.label}-${idx}`} style={styles.fieldAbove}>\n <PDFText style={styles.labelAbove}>{field.label}</PDFText>\n <View style={areaStyle}>\n {field.hint ? (\n <PDFText style={styles.hint}>{field.hint}</PDFText>\n ) : null}\n </View>\n </View>\n );\n}\n\nfunction renderFieldLeft(\n field: PdfFormField,\n idx: number,\n styles: ReturnType<typeof createFormStyles>\n) {\n const areaHeight = field.height ?? 18;\n const areaStyle: Style[] = [\n styles.fieldArea,\n styles.fieldLeftArea,\n { minHeight: areaHeight },\n ];\n\n return (\n <View key={`${field.label}-${idx}`} style={styles.fieldLeft}>\n <PDFText style={styles.labelLeft}>{field.label}</PDFText>\n <View style={areaStyle}>\n {field.hint ? (\n <PDFText style={styles.hint}>{field.hint}</PDFText>\n ) : null}\n </View>\n </View>\n );\n}\n\nfunction renderGroup(\n group: PdfFormGroup,\n gi: number,\n styles: ReturnType<typeof createFormStyles>,\n labelPosition: \"above\" | \"left\"\n) {\n const layout: FormLayout = group.layout ?? \"single\";\n const cols = layout === \"three-column\" ? 3 : (layout === \"two-column\" ? 2 : 1);\n\n const renderField = (field: PdfFormField, idx: number) =>\n labelPosition === \"left\"\n ? renderFieldLeft(field, idx, styles)\n : renderFieldAbove(field, idx, styles);\n\n if (cols === 1) {\n return (\n <View key={`group-${gi}`} style={styles.group}>\n {group.title ? (\n <PDFText style={styles.groupTitle}>{group.title}</PDFText>\n ) : null}\n {group.fields.map(renderField)}\n </View>\n );\n }\n\n const chunkSize = Math.ceil(group.fields.length / cols);\n const chunks: PdfFormField[][] = [];\n for (let i = 0; i < group.fields.length; i += chunkSize) {\n chunks.push(group.fields.slice(i, i + chunkSize));\n }\n while (chunks.length < cols) {\n chunks.push([]);\n }\n\n return (\n <View key={`group-${gi}`} style={styles.group}>\n {group.title ? (\n <PDFText style={styles.groupTitle}>{group.title}</PDFText>\n ) : null}\n <View style={styles.columnsRow}>\n {chunks.map((chunk, ci) => (\n <View\n key={`col-${gi}-${chunk[0]?.label ?? ci}`}\n style={styles.column}\n >\n {chunk.map(renderField)}\n </View>\n ))}\n </View>\n </View>\n );\n}\n\nexport function PdfForm({\n title,\n subtitle,\n groups,\n variant = \"underline\",\n labelPosition = \"above\",\n noWrap = false,\n style,\n}: PdfFormProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(\n () => createFormStyles(theme, variant),\n [theme, variant]\n );\n\n const rootStyles: Style[] = [styles.root];\n if (style) {rootStyles.push(style);}\n\n const inner = (\n <View style={rootStyles}>\n {title ? <PDFText style={styles.formTitle}>{title}</PDFText> : null}\n {subtitle ? (\n <PDFText style={styles.formSubtitle}>{subtitle}</PDFText>\n ) : null}\n {title || subtitle ? <View style={styles.formDivider} /> : null}\n {groups.map((group, gi) => renderGroup(group, gi, styles, labelPosition))}\n </View>\n );\n\n return noWrap ? (\n <View style={[{ breakInside: \"avoid\" as const }].filter(Boolean)}>\n {inner}\n </View>\n ) : (\n inner\n );\n}\n",- "type": "registry:component"+ "content": "import { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, Text as PDFText } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\nimport { createFormStyles } from \"./form.styles\";\nimport type {\n FormLayout,\n PdfFormField,\n PdfFormGroup,\n PdfFormProps,\n} from \"./form.types\";\n\nconst renderFieldAbove = (\n field: PdfFormField,\n idx: number,\n styles: ReturnType<typeof createFormStyles>\n) => {\n const areaHeight = field.height ?? 18;\n const areaStyle: Style[] = [styles.fieldArea, { minHeight: areaHeight }];\n\n return (\n <View key={`${field.label}-${idx}`} style={styles.fieldAbove}>\n <PDFText style={styles.labelAbove}>{field.label}</PDFText>\n <View style={areaStyle}>\n {field.hint ? (\n <PDFText style={styles.hint}>{field.hint}</PDFText>\n ) : null}\n </View>\n </View>\n );\n};\n\nconst renderFieldLeft = (\n field: PdfFormField,\n idx: number,\n styles: ReturnType<typeof createFormStyles>\n) => {\n const areaHeight = field.height ?? 18;\n const areaStyle: Style[] = [\n styles.fieldArea,\n styles.fieldLeftArea,\n { minHeight: areaHeight },\n ];\n\n return (\n <View key={`${field.label}-${idx}`} style={styles.fieldLeft}>\n <PDFText style={styles.labelLeft}>{field.label}</PDFText>\n <View style={areaStyle}>\n {field.hint ? (\n <PDFText style={styles.hint}>{field.hint}</PDFText>\n ) : null}\n </View>\n </View>\n );\n};\n\nconst renderGroup = (\n group: PdfFormGroup,\n gi: number,\n styles: ReturnType<typeof createFormStyles>,\n labelPosition: \"above\" | \"left\"\n) => {\n const layout: FormLayout = group.layout ?? \"single\";\n let cols: number;\n if (layout === \"three-column\") {\n cols = 3;\n } else if (layout === \"two-column\") {\n cols = 2;\n } else {\n cols = 1;\n }\n\n const renderField = (field: PdfFormField, idx: number) =>\n labelPosition === \"left\"\n ? renderFieldLeft(field, idx, styles)\n : renderFieldAbove(field, idx, styles);\n\n if (cols === 1) {\n return (\n <View key={`group-${gi}`} style={styles.group}>\n {group.title ? (\n <PDFText style={styles.groupTitle}>{group.title}</PDFText>\n ) : null}\n {group.fields.map(renderField)}\n </View>\n );\n }\n\n const chunkSize = Math.ceil(group.fields.length / cols);\n const chunks: PdfFormField[][] = [];\n for (let i = 0; i < group.fields.length; i += chunkSize) {\n chunks.push(group.fields.slice(i, i + chunkSize));\n }\n while (chunks.length < cols) {\n chunks.push([]);\n }\n\n return (\n <View key={`group-${gi}`} style={styles.group}>\n {group.title ? (\n <PDFText style={styles.groupTitle}>{group.title}</PDFText>\n ) : null}\n <View style={styles.columnsRow}>\n {chunks.map((chunk, ci) => (\n <View\n key={`col-${gi}-${chunk[0]?.label ?? ci}`}\n style={styles.column}\n >\n {chunk.map(renderField)}\n </View>\n ))}\n </View>\n </View>\n );\n};\n\nexport const PdfForm = ({\n title,\n subtitle,\n groups,\n variant = \"underline\",\n labelPosition = \"above\",\n noWrap = false,\n style,\n}: PdfFormProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(\n () => createFormStyles(theme, variant),\n [theme, variant]\n );\n\n const rootStyles: Style[] = [styles.root];\n if (style) {\n rootStyles.push(style);\n }\n\n const inner = (\n <View style={rootStyles}>\n {title ? <PDFText style={styles.formTitle}>{title}</PDFText> : null}\n {subtitle ? (\n <PDFText style={styles.formSubtitle}>{subtitle}</PDFText>\n ) : null}\n {title || subtitle ? <View style={styles.formDivider} /> : null}\n {groups.map((group, gi) => renderGroup(group, gi, styles, labelPosition))}\n </View>\n );\n\n return noWrap ? (\n <View style={[{ breakInside: \"avoid\" as const }].filter(Boolean)}>\n {inner}\n </View>\n ) : (\n inner\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/form/form.tsx"},{"path": "registry/bases/takumi/components/form/form.types.ts","content": "import type { Style } from \"../../lib/takumi-primitives\";\n\n/** Visual style variant for the fillable form. */\nexport type PdfFormVariant = \"underline\" | \"box\" | \"outlined\" | \"ghost\";\n\n/** Column layout for a form section. */\nexport type FormLayout = \"single\" | \"two-column\" | \"three-column\";\n\n/** Label position relative to the field. */\nexport type FormLabelPosition = \"above\" | \"left\";\n\n/**\n * A single fillable field definition.\n * Props - `label` | `hint` | `height` | `width`\n * @see {@link PdfFormField}\n */\nexport interface PdfFormField {\n label: string;\n hint?: string;\n /**\n * Height of the blank field area in points.\n * @default 18\n */\n height?: number;\n width?: number | string;\n}\n\n/**\n * A logical group of fields with an optional section title.\n * Props - `title` | `fields` | `layout`\n * @see {@link PdfFormGroup}\n */\nexport interface PdfFormGroup {\n title?: string;\n fields: PdfFormField[];\n /**\n * @default 'single'\n */\n layout?: FormLayout;\n}\n\n/**\n * Fillable PDF form with grouped fields, layout variants, and label positioning options.\n * Props - `title` | `subtitle` | `groups` | `variant` | `labelPosition` | `noWrap` | `style`\n * @see {@link PdfFormProps}\n */\nexport interface PdfFormProps {\n title?: string;\n subtitle?: string;\n groups: PdfFormGroup[];\n /**\n * @default 'underline'\n */\n variant?: PdfFormVariant;\n /**\n * @default 'above'\n */\n labelPosition?: FormLabelPosition;\n noWrap?: boolean;\n style?: Style;\n}\n",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/form/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/graph.json b/public/r/takumi/graph.jsonindex 3e53293..0e673df 100644--- a/public/r/takumi/graph.json+++ b/public/r/takumi/graph.json@@ -13,28 +13,33 @@"files": [{"path": "registry/bases/takumi/components/graph/graph.styles.ts",- "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { StyleSheet } from \"../../lib/takumi-primitives\";\n\nexport function createGraphStyles(t: PdfcnTheme) {\n return StyleSheet.create({\n chartWithRightLegend: {\n alignItems: \"flex-start\",\n display: \"flex\",\n flexDirection: \"row\",\n },\n container: {\n display: \"flex\",\n flexDirection: \"column\",\n marginBottom: t.spacing.componentGap,\n },\n legendColumn: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n marginLeft: 12,\n marginTop: 18,\n minWidth: 120,\n },\n legendItem: {\n alignItems: \"center\",\n display: \"flex\",\n flexDirection: \"row\",\n gap: 4,\n },\n legendRow: {\n display: \"flex\",\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: 12,\n marginTop: 6,\n },\n legendText: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n },\n subtitle: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginBottom: 6,\n },\n title: {\n color: t.colors.foreground,\n fontFamily: t.typography.heading.fontFamily,\n fontSize: t.primitives.typography.base,\n fontWeight: t.primitives.fontWeights.semibold,\n marginBottom: 2,\n },\n });\n}\n",- "type": "registry:component"+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { StyleSheet } from \"../../lib/takumi-primitives\";\n\nexport const createGraphStyles = (t: PdfcnTheme) =>\n StyleSheet.create({\n chartWithRightLegend: {\n alignItems: \"flex-start\",\n display: \"flex\",\n flexDirection: \"row\",\n },\n container: {\n display: \"flex\",\n flexDirection: \"column\",\n marginBottom: t.spacing.componentGap,\n },\n legendColumn: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n marginLeft: 12,\n marginTop: 18,\n minWidth: 120,\n },\n legendItem: {\n alignItems: \"center\",\n display: \"flex\",\n flexDirection: \"row\",\n gap: 4,\n },\n legendRow: {\n display: \"flex\",\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: 12,\n marginTop: 6,\n },\n legendText: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n },\n subtitle: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginBottom: 6,\n },\n title: {\n color: t.colors.foreground,\n fontFamily: t.typography.heading.fontFamily,\n fontSize: t.primitives.typography.base,\n fontWeight: t.primitives.fontWeights.semibold,\n marginBottom: 2,\n },\n });\n",+ "type": "registry:component",+ "target": "components/pdf/components/graph/graph.styles.ts"},{"path": "registry/bases/takumi/components/graph/graph.tsx",- "content": "import type React from \"react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, Text as PDFText } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\nimport {\n Circle,\n G,\n Line,\n Path,\n Rect,\n Svg,\n SvgText,\n} from \"../../lib/takumi-svg\";\nimport { createGraphStyles } from \"./graph.styles\";\nimport type { ChartLayout, GraphProps, GraphSeries } from \"./graph.types\";\nimport {\n GRAPH_SAFE_WIDTHS,\n arcPath,\n buildLayout,\n fmtNum,\n getDefaultPalette,\n getGraphWidth,\n normalizeData,\n polarToCartesian,\n smoothPath,\n truncate,\n} from \"./graph.utils\";\n\n/**\n * Shared Y-axis grid lines and tick labels for cartesian charts (bar, line, area).\n * Extracted to avoid duplicating the identical block across render functions.\n */\nfunction renderGridAndYAxis(\n ticks: number[],\n toY: (v: number) => number,\n chartX: number,\n chartW: number,\n showGrid: boolean,\n gridColor: string,\n textColor: string\n) {\n return (\n <>\n {ticks.map((tick) => {\n const ty = toY(tick);\n return (\n <G key={`grid-${tick}`}>\n {showGrid && (\n <Line\n x1={chartX}\n y1={ty}\n x2={chartX + chartW}\n y2={ty}\n stroke={gridColor}\n strokeWidth={0.5}\n strokeDasharray=\"3 3\"\n />\n )}\n <SvgText\n x={chartX - 4}\n y={ty + 3}\n fill={textColor}\n textAnchor=\"end\"\n style={{ fontSize: 7 }}\n >\n {fmtNum(tick)}\n </SvgText>\n </G>\n );\n })}\n </>\n );\n}\n\nfunction renderBarChart(\n series: GraphSeries[],\n layout: ChartLayout,\n palette: string[],\n showGrid: boolean,\n showValues: boolean,\n theme: PdfcnTheme\n) {\n const { chartX, chartY, chartW, chartH, yMin, yMax, yTicks, xLabels } =\n layout;\n const nCategories = xLabels.length;\n const nSeries = series.length;\n const groupGap = 0.25;\n const groupW = chartW / nCategories;\n const barW = (groupW * (1 - groupGap)) / nSeries;\n const textColor = theme.colors.mutedForeground;\n const gridColor = theme.colors.border;\n const axisColor = theme.colors.foreground;\n const range = yMax - yMin || 1;\n const toY = (v: number) => chartY + chartH - ((v - yMin) / range) * chartH;\n\n return (\n <>\n {renderGridAndYAxis(\n yTicks,\n toY,\n chartX,\n chartW,\n showGrid,\n gridColor,\n textColor\n )}\n\n <Line\n x1={chartX}\n y1={chartY + chartH}\n x2={chartX + chartW}\n y2={chartY + chartH}\n stroke={axisColor}\n strokeWidth={1}\n />\n\n {xLabels.map((label, ci) => {\n const groupLeft = chartX + ci * groupW + groupW * (groupGap / 2);\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <G key={`group-${ci}`}>\n {series.map((s, si) => {\n const val = s.data[ci]?.value ?? 0;\n const color =\n s.data[ci]?.color ?? s.color ?? palette[si % palette.length];\n const barH = ((val - yMin) / range) * chartH;\n const bx = groupLeft + si * barW;\n const by = chartY + chartH - barH;\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <G key={`bar-${ci}-${si}`}>\n <Rect\n x={bx}\n y={by}\n width={barW - 1}\n height={barH}\n fill={color}\n />\n {showValues && barH > 10 && (\n <SvgText\n x={bx + barW / 2 - 0.5}\n y={by - 2}\n fill={axisColor}\n textAnchor=\"middle\"\n style={{ fontSize: 6 }}\n >\n {fmtNum(val)}\n </SvgText>\n )}\n </G>\n );\n })}\n <SvgText\n x={groupLeft + (nSeries * barW) / 2}\n y={chartY + chartH + 10}\n fill={textColor}\n textAnchor=\"middle\"\n style={{ fontSize: 7 }}\n >\n {truncate(label, 10)}\n </SvgText>\n </G>\n );\n })}\n </>\n );\n}\n\nfunction renderHorizontalBarChart(\n series: GraphSeries[],\n layout: ChartLayout,\n palette: string[],\n showValues: boolean,\n theme: PdfcnTheme\n) {\n const { chartX, chartY, chartW, chartH, xLabels } = layout;\n const nCategories = xLabels.length;\n const allValues = series.flatMap((s) => s.data.map((d) => d.value));\n const maxVal = Math.max(...allValues, 1);\n const rowH = chartH / nCategories;\n const barH = rowH * 0.5;\n const textColor = theme.colors.mutedForeground;\n const axisColor = theme.colors.foreground;\n const labelW = 60;\n\n return (\n <>\n {xLabels.map((label, ci) => {\n const rowY = chartY + ci * rowH;\n const val = series[0]?.data[ci]?.value ?? 0;\n const color =\n series[0]?.data[ci]?.color ??\n series[0]?.color ??\n palette[ci % palette.length];\n const barW = (val / maxVal) * (chartW - labelW);\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <G key={`hbar-${ci}`}>\n <SvgText\n x={chartX + labelW - 4}\n y={rowY + rowH / 2 + 3}\n fill={textColor}\n textAnchor=\"end\"\n style={{ fontSize: 7 }}\n >\n {truncate(label, 14)}\n </SvgText>\n <Rect\n x={chartX + labelW}\n y={rowY + (rowH - barH) / 2}\n width={Math.max(barW, 1)}\n height={barH}\n fill={color}\n />\n {showValues && (\n <SvgText\n x={chartX + labelW + barW + 3}\n y={rowY + rowH / 2 + 3}\n fill={axisColor}\n textAnchor=\"start\"\n style={{ fontSize: 6 }}\n >\n {fmtNum(val)}\n </SvgText>\n )}\n </G>\n );\n })}\n <Line\n x1={chartX + labelW}\n y1={chartY}\n x2={chartX + labelW}\n y2={chartY + chartH}\n stroke={axisColor}\n strokeWidth={1}\n />\n </>\n );\n}\n\nfunction renderLineAreaChart(\n series: GraphSeries[],\n layout: ChartLayout,\n palette: string[],\n showGrid: boolean,\n showValues: boolean,\n showDots: boolean,\n smooth: boolean,\n isArea: boolean,\n theme: PdfcnTheme\n) {\n const { chartX, chartY, chartW, chartH, yMin, yMax, yTicks, xLabels } =\n layout;\n const range = yMax - yMin || 1;\n const textColor = theme.colors.mutedForeground;\n const gridColor = theme.colors.border;\n const axisColor = theme.colors.foreground;\n const nPoints = xLabels.length;\n\n const xFor = (i: number) => chartX + (i / Math.max(nPoints - 1, 1)) * chartW;\n const yFor = (v: number) => chartY + chartH - ((v - yMin) / range) * chartH;\n\n return (\n <>\n {renderGridAndYAxis(\n yTicks,\n yFor,\n chartX,\n chartW,\n showGrid,\n gridColor,\n textColor\n )}\n\n <Line\n x1={chartX}\n y1={chartY + chartH}\n x2={chartX + chartW}\n y2={chartY + chartH}\n stroke={axisColor}\n strokeWidth={1}\n />\n\n {series.map((s, si) => {\n const color = s.color ?? palette[si % palette.length];\n const points = s.data.map((d, i) => ({ x: xFor(i), y: yFor(d.value) }));\n\n const lineDStr = smooth\n ? smoothPath(points)\n : `M ${points.map((p) => `${p.x} ${p.y}`).join(\" L \")}`;\n\n const areaPath =\n isArea && points.length > 1\n ? `${lineDStr} L ${points.at(-1)!.x} ${chartY + chartH} L ${points[0]!.x} ${chartY + chartH} Z`\n : null;\n\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <G key={`series-${si}`}>\n {isArea && areaPath && (\n <Path d={areaPath} fill={color} fillOpacity={0.2} stroke=\"none\" />\n )}\n <Path d={lineDStr} stroke={color} strokeWidth={2} fill=\"none\" />\n {showDots &&\n points.map((p, pi) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <Circle\n key={`dot-${pi}`}\n cx={p.x}\n cy={p.y}\n r={3}\n fill={color}\n />\n ))}\n {showValues &&\n points.map((p, pi) => (\n <SvgText\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n key={`val-${pi}`}\n x={p.x}\n y={p.y - 5}\n fill={color}\n textAnchor=\"middle\"\n style={{ fontSize: 6 }}\n >\n {fmtNum(s.data[pi].value)}\n </SvgText>\n ))}\n </G>\n );\n })}\n\n {xLabels.map((label, i) => (\n <SvgText\n key={`xlabel-${label}`}\n x={xFor(i)}\n y={chartY + chartH + 10}\n fill={textColor}\n textAnchor=\"middle\"\n style={{ fontSize: 7 }}\n >\n {truncate(label, 8)}\n </SvgText>\n ))}\n </>\n );\n}\n\nfunction renderPieDonutChart(\n series: GraphSeries[],\n layout: ChartLayout,\n palette: string[],\n centerLabel: string | undefined,\n isDonut: boolean,\n theme: PdfcnTheme\n) {\n const { svgW, svgH } = layout;\n const cx = svgW / 2;\n const cy = svgH / 2;\n const r = Math.min(svgW, svgH) / 2 - 20;\n const innerR = isDonut ? r * 0.52 : 0;\n const textColor = theme.colors.mutedForeground;\n\n const data = series[0]?.data ?? [];\n const total = data.reduce((sum, d) => sum + d.value, 0) || 1;\n\n let currentAngle = 0;\n\n return (\n <>\n {data.map((d, i) => {\n const color = d.color ?? palette[i % palette.length];\n const sweep = (d.value / total) * 360;\n const midAngle = currentAngle + sweep / 2;\n const path = arcPath(\n cx,\n cy,\n r,\n currentAngle,\n currentAngle + sweep,\n innerR\n );\n currentAngle += sweep;\n\n const labelR = r * 1.18;\n const lp = polarToCartesian(cx, cy, labelR, midAngle);\n const anchor = lp.x > cx ? \"start\" : \"end\";\n\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <G key={`slice-${i}`}>\n <Path d={path} fill={color} stroke=\"white\" strokeWidth={1} />\n {/* Show label only if slice is large enough to label */}\n {sweep > 15 && (\n <SvgText\n x={lp.x}\n y={lp.y + 3}\n fill={textColor}\n textAnchor={anchor}\n style={{ fontSize: 7 }}\n >\n {truncate(d.label, 10)}\n </SvgText>\n )}\n </G>\n );\n })}\n\n {isDonut && centerLabel && (\n <>\n <Circle cx={cx} cy={cy} r={innerR} fill=\"white\" />\n <SvgText\n x={cx}\n y={cy + 4}\n fill={theme.colors.foreground}\n textAnchor=\"middle\"\n style={{ fontSize: 9, fontWeight: \"bold\" }}\n >\n {centerLabel}\n </SvgText>\n </>\n )}\n </>\n );\n}\n\nfunction Legend({\n series,\n palette,\n styles,\n position = \"bottom\",\n}: {\n series: GraphSeries[];\n palette: string[];\n styles: ReturnType<typeof createGraphStyles>;\n position?: \"bottom\" | \"right\";\n}) {\n const containerStyle =\n position === \"right\" ? styles.legendColumn : styles.legendRow;\n\n return (\n <View style={containerStyle}>\n {series.map((s, i) => (\n <View key={s.name} style={styles.legendItem}>\n <Svg width={10} height={10}>\n <Rect\n x={0}\n y={2}\n width={8}\n height={8}\n fill={s.color ?? palette[i % palette.length]}\n />\n </Svg>\n <PDFText style={styles.legendText}>{s.name}</PDFText>\n </View>\n ))}\n </View>\n );\n}\n\n/**\n * PdfGraph — renders bar, horizontal-bar, line, area, pie, and donut charts\n * natively inside react-pdf documents using SVG primitives.\n *\n * No external chart libraries are required or used — all rendering is done via\n * react-pdf's built-in SVG support (`<Svg>`, `<Rect>`, `<Path>`, `<Line>`, etc.).\n *\n * @example Bar chart\n * ```tsx\n * <PdfGraph\n * variant=\"bar\"\n * title=\"Monthly Revenue\"\n * data={[\n * { label: 'Jan', value: 42000 },\n * { label: 'Feb', value: 38000 },\n * { label: 'Mar', value: 55000 },\n * ]}\n * />\n * ```\n *\n * @example Donut chart with center label\n * ```tsx\n * <PdfGraph\n * variant=\"donut\"\n * data={[\n * { label: 'Product A', value: 45 },\n * { label: 'Product B', value: 30 },\n * { label: 'Other', value: 25 },\n * ]}\n * centerLabel=\"$1.2M\"\n * />\n * ```\n *\n * **Limitations (by design):**\n * - No interactivity (PDFs are static)\n * - No animations\n * - SVG Text inside charts uses SVG font attributes (not react-pdf StyleSheet fonts)\n * - For print PDFs use SVG-friendly fonts registered with Font.register()\n */\nexport function PdfGraph({\n variant = \"bar\",\n data,\n title,\n subtitle,\n xLabel,\n yLabel,\n width: explicitWidth,\n height = 260,\n fullWidth = false,\n containerPadding = 0,\n wrapperPadding = 0,\n colors,\n showValues = false,\n showGrid = true,\n legend = \"bottom\",\n centerLabel,\n showDots = true,\n smooth = false,\n yTicks: yTickCount = 5,\n noWrap = true,\n style,\n}: GraphProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createGraphStyles(theme), [theme]);\n const palette = colors ?? getDefaultPalette(theme);\n const series = normalizeData(data);\n\n const width = useSafeMemo(() => {\n if (fullWidth)\n {return getGraphWidth(theme, { containerPadding, wrapperPadding });}\n return explicitWidth ?? GRAPH_SAFE_WIDTHS.default;\n }, [fullWidth, explicitWidth, theme, containerPadding, wrapperPadding]);\n\n const isPieOrDonut = variant === \"pie\" || variant === \"donut\";\n const layout = buildLayout(series, width, height, isPieOrDonut, yTickCount);\n const { chartX, chartW } = layout;\n\n let chartContent: React.ReactNode = null;\n\n switch (variant) {\n case \"bar\": {\n chartContent = renderBarChart(\n series,\n layout,\n palette,\n showGrid,\n showValues,\n theme\n );\n break;\n }\n case \"horizontal-bar\": {\n chartContent = renderHorizontalBarChart(\n series,\n layout,\n palette,\n showValues,\n theme\n );\n break;\n }\n case \"line\":\n case \"area\": {\n chartContent = renderLineAreaChart(\n series,\n layout,\n palette,\n showGrid,\n showValues,\n showDots,\n smooth,\n variant === \"area\",\n theme\n );\n break;\n }\n case \"pie\": {\n chartContent = renderPieDonutChart(\n series,\n layout,\n palette,\n undefined,\n false,\n theme\n );\n break;\n }\n case \"donut\": {\n chartContent = renderPieDonutChart(\n series,\n layout,\n palette,\n centerLabel,\n true,\n theme\n );\n break;\n }\n }\n\n const showLegend = legend !== \"none\" && !isPieOrDonut;\n\n const containerStyles: Style[] = [styles.container];\n if (style) {containerStyles.push(style);}\n\n const content = (\n <View style={containerStyles}>\n {title && <PDFText style={styles.title}>{title}</PDFText>}\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n <View\n style={legend === \"right\" ? styles.chartWithRightLegend : undefined}\n >\n <Svg width={width} height={height}>\n {chartContent}\n {!isPieOrDonut && xLabel && (\n <SvgText\n x={chartX + chartW / 2}\n y={height - 2}\n fill={theme.colors.mutedForeground}\n textAnchor=\"middle\"\n style={{ fontSize: 8 }}\n >\n {xLabel}\n </SvgText>\n )}\n {!isPieOrDonut && yLabel && (\n <SvgText\n x={2}\n y={10}\n fill={theme.colors.mutedForeground}\n textAnchor=\"start\"\n style={{ fontSize: 8 }}\n >\n {yLabel}\n </SvgText>\n )}\n </Svg>\n {showLegend &&\n legend === \"right\" &&\n Legend({ palette, position: \"right\", series, styles })}\n </View>\n {showLegend &&\n legend === \"bottom\" &&\n Legend({ palette, position: \"bottom\", series, styles })}\n </View>\n );\n\n return noWrap ? (\n <View style={[{ breakInside: \"avoid\" as const }].filter(Boolean)}>\n {content}\n </View>\n ) : (\n content\n );\n}\n",- "type": "registry:component"+ "content": "import type React from \"react\";\n\nimport type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, Text as PDFText } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\nimport {\n Circle,\n G,\n Line,\n Path,\n Rect,\n Svg,\n SvgText,\n} from \"../../lib/takumi-svg\";\nimport { createGraphStyles } from \"./graph.styles\";\nimport type { ChartLayout, GraphProps, GraphSeries } from \"./graph.types\";\nimport {\n GRAPH_SAFE_WIDTHS,\n arcPath,\n buildLayout,\n fmtNum,\n getDefaultPalette,\n getGraphWidth,\n normalizeData,\n polarToCartesian,\n smoothPath,\n truncate,\n} from \"./graph.utils\";\n\n/**\n * Shared Y-axis grid lines and tick labels for cartesian charts (bar, line, area).\n * Extracted to avoid duplicating the identical block across render functions.\n */\nconst renderGridAndYAxis = (\n ticks: number[],\n toY: (v: number) => number,\n chartX: number,\n chartW: number,\n showGrid: boolean,\n gridColor: string,\n textColor: string\n) => (\n <>\n {ticks.map((tick) => {\n const ty = toY(tick);\n return (\n <G key={`grid-${tick}`}>\n {showGrid && (\n <Line\n x1={chartX}\n y1={ty}\n x2={chartX + chartW}\n y2={ty}\n stroke={gridColor}\n strokeWidth={0.5}\n strokeDasharray=\"3 3\"\n />\n )}\n <SvgText\n x={chartX - 4}\n y={ty + 3}\n fill={textColor}\n textAnchor=\"end\"\n style={{ fontSize: 7 }}\n >\n {fmtNum(tick)}\n </SvgText>\n </G>\n );\n })}\n </>\n);\n\nconst renderBarChart = (\n series: GraphSeries[],\n layout: ChartLayout,\n palette: string[],\n showGrid: boolean,\n showValues: boolean,\n theme: PdfcnTheme\n) => {\n const { chartX, chartY, chartW, chartH, yMin, yMax, yTicks, xLabels } =\n layout;\n const nCategories = xLabels.length;\n const nSeries = series.length;\n const groupGap = 0.25;\n const groupW = chartW / nCategories;\n const barW = (groupW * (1 - groupGap)) / nSeries;\n const textColor = theme.colors.mutedForeground;\n const gridColor = theme.colors.border;\n const axisColor = theme.colors.foreground;\n const range = yMax - yMin || 1;\n const toY = (v: number) => chartY + chartH - ((v - yMin) / range) * chartH;\n\n return (\n <>\n {renderGridAndYAxis(\n yTicks,\n toY,\n chartX,\n chartW,\n showGrid,\n gridColor,\n textColor\n )}\n\n <Line\n x1={chartX}\n y1={chartY + chartH}\n x2={chartX + chartW}\n y2={chartY + chartH}\n stroke={axisColor}\n strokeWidth={1}\n />\n\n {xLabels.map((label, ci) => {\n const groupLeft = chartX + ci * groupW + groupW * (groupGap / 2);\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <G key={`group-${ci}`}>\n {series.map((s, si) => {\n const val = s.data[ci]?.value ?? 0;\n const color =\n s.data[ci]?.color ?? s.color ?? palette[si % palette.length];\n const barH = ((val - yMin) / range) * chartH;\n const bx = groupLeft + si * barW;\n const by = chartY + chartH - barH;\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <G key={`bar-${ci}-${si}`}>\n <Rect\n x={bx}\n y={by}\n width={barW - 1}\n height={barH}\n fill={color}\n />\n {showValues && barH > 10 && (\n <SvgText\n x={bx + barW / 2 - 0.5}\n y={by - 2}\n fill={axisColor}\n textAnchor=\"middle\"\n style={{ fontSize: 6 }}\n >\n {fmtNum(val)}\n </SvgText>\n )}\n </G>\n );\n })}\n <SvgText\n x={groupLeft + (nSeries * barW) / 2}\n y={chartY + chartH + 10}\n fill={textColor}\n textAnchor=\"middle\"\n style={{ fontSize: 7 }}\n >\n {truncate(label, 10)}\n </SvgText>\n </G>\n );\n })}\n </>\n );\n};\n\nconst renderHorizontalBarChart = (\n series: GraphSeries[],\n layout: ChartLayout,\n palette: string[],\n showValues: boolean,\n theme: PdfcnTheme\n) => {\n const { chartX, chartY, chartW, chartH, xLabels } = layout;\n const nCategories = xLabels.length;\n const allValues = series.flatMap((s) => s.data.map((d) => d.value));\n const maxVal = Math.max(...allValues, 1);\n const rowH = chartH / nCategories;\n const barH = rowH * 0.5;\n const textColor = theme.colors.mutedForeground;\n const axisColor = theme.colors.foreground;\n const labelW = 60;\n\n return (\n <>\n {xLabels.map((label, ci) => {\n const rowY = chartY + ci * rowH;\n const val = series[0]?.data[ci]?.value ?? 0;\n const color =\n series[0]?.data[ci]?.color ??\n series[0]?.color ??\n palette[ci % palette.length];\n const barW = (val / maxVal) * (chartW - labelW);\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <G key={`hbar-${ci}`}>\n <SvgText\n x={chartX + labelW - 4}\n y={rowY + rowH / 2 + 3}\n fill={textColor}\n textAnchor=\"end\"\n style={{ fontSize: 7 }}\n >\n {truncate(label, 14)}\n </SvgText>\n <Rect\n x={chartX + labelW}\n y={rowY + (rowH - barH) / 2}\n width={Math.max(barW, 1)}\n height={barH}\n fill={color}\n />\n {showValues && (\n <SvgText\n x={chartX + labelW + barW + 3}\n y={rowY + rowH / 2 + 3}\n fill={axisColor}\n textAnchor=\"start\"\n style={{ fontSize: 6 }}\n >\n {fmtNum(val)}\n </SvgText>\n )}\n </G>\n );\n })}\n <Line\n x1={chartX + labelW}\n y1={chartY}\n x2={chartX + labelW}\n y2={chartY + chartH}\n stroke={axisColor}\n strokeWidth={1}\n />\n </>\n );\n};\n\nconst renderLineAreaChart = (\n series: GraphSeries[],\n layout: ChartLayout,\n palette: string[],\n showGrid: boolean,\n showValues: boolean,\n showDots: boolean,\n smooth: boolean,\n isArea: boolean,\n theme: PdfcnTheme\n) => {\n const { chartX, chartY, chartW, chartH, yMin, yMax, yTicks, xLabels } =\n layout;\n const range = yMax - yMin || 1;\n const textColor = theme.colors.mutedForeground;\n const gridColor = theme.colors.border;\n const axisColor = theme.colors.foreground;\n const nPoints = xLabels.length;\n\n const xFor = (i: number) => chartX + (i / Math.max(nPoints - 1, 1)) * chartW;\n const yFor = (v: number) => chartY + chartH - ((v - yMin) / range) * chartH;\n\n return (\n <>\n {renderGridAndYAxis(\n yTicks,\n yFor,\n chartX,\n chartW,\n showGrid,\n gridColor,\n textColor\n )}\n\n <Line\n x1={chartX}\n y1={chartY + chartH}\n x2={chartX + chartW}\n y2={chartY + chartH}\n stroke={axisColor}\n strokeWidth={1}\n />\n\n {series.map((s, si) => {\n const color = s.color ?? palette[si % palette.length];\n const points = s.data.map((d, i) => ({ x: xFor(i), y: yFor(d.value) }));\n\n const lineDStr = smooth\n ? smoothPath(points)\n : `M ${points.map((p) => `${p.x} ${p.y}`).join(\" L \")}`;\n\n const lastPoint = points.at(-1);\n const firstPoint = points.at(0);\n const areaPath =\n isArea && points.length > 1 && lastPoint && firstPoint\n ? `${lineDStr} L ${lastPoint.x} ${chartY + chartH} L ${firstPoint.x} ${chartY + chartH} Z`\n : null;\n\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <G key={`series-${si}`}>\n {isArea && areaPath && (\n <Path d={areaPath} fill={color} fillOpacity={0.2} stroke=\"none\" />\n )}\n <Path d={lineDStr} stroke={color} strokeWidth={2} fill=\"none\" />\n {showDots &&\n points.map((p, pi) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <Circle\n key={`dot-${pi}`}\n cx={p.x}\n cy={p.y}\n r={3}\n fill={color}\n />\n ))}\n {showValues &&\n points.map((p, pi) => (\n <SvgText\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n key={`val-${pi}`}\n x={p.x}\n y={p.y - 5}\n fill={color}\n textAnchor=\"middle\"\n style={{ fontSize: 6 }}\n >\n {fmtNum(s.data[pi].value)}\n </SvgText>\n ))}\n </G>\n );\n })}\n\n {xLabels.map((label, i) => (\n <SvgText\n key={`xlabel-${label}`}\n x={xFor(i)}\n y={chartY + chartH + 10}\n fill={textColor}\n textAnchor=\"middle\"\n style={{ fontSize: 7 }}\n >\n {truncate(label, 8)}\n </SvgText>\n ))}\n </>\n );\n};\n\nconst renderPieDonutChart = (\n series: GraphSeries[],\n layout: ChartLayout,\n palette: string[],\n centerLabel: string | undefined,\n isDonut: boolean,\n theme: PdfcnTheme\n) => {\n const { svgW, svgH } = layout;\n const cx = svgW / 2;\n const cy = svgH / 2;\n const r = Math.min(svgW, svgH) / 2 - 20;\n const innerR = isDonut ? r * 0.52 : 0;\n const textColor = theme.colors.mutedForeground;\n\n const data = series[0]?.data ?? [];\n const total = data.reduce((sum, d) => sum + d.value, 0) || 1;\n\n let currentAngle = 0;\n\n return (\n <>\n {data.map((d, i) => {\n const color = d.color ?? palette[i % palette.length];\n const sweep = (d.value / total) * 360;\n const midAngle = currentAngle + sweep / 2;\n const path = arcPath(\n cx,\n cy,\n r,\n currentAngle,\n currentAngle + sweep,\n innerR\n );\n currentAngle += sweep;\n\n const labelR = r * 1.18;\n const lp = polarToCartesian(cx, cy, labelR, midAngle);\n const anchor = lp.x > cx ? \"start\" : \"end\";\n\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF chart data — index is the stable identity\n <G key={`slice-${i}`}>\n <Path d={path} fill={color} stroke=\"white\" strokeWidth={1} />\n {/* Show label only if slice is large enough to label */}\n {sweep > 15 && (\n <SvgText\n x={lp.x}\n y={lp.y + 3}\n fill={textColor}\n textAnchor={anchor}\n style={{ fontSize: 7 }}\n >\n {truncate(d.label, 10)}\n </SvgText>\n )}\n </G>\n );\n })}\n\n {isDonut && centerLabel && (\n <>\n <Circle cx={cx} cy={cy} r={innerR} fill=\"white\" />\n <SvgText\n x={cx}\n y={cy + 4}\n fill={theme.colors.foreground}\n textAnchor=\"middle\"\n style={{ fontSize: 9, fontWeight: \"bold\" }}\n >\n {centerLabel}\n </SvgText>\n </>\n )}\n </>\n );\n};\n\nconst Legend = ({\n series,\n palette,\n styles,\n position = \"bottom\",\n}: {\n series: GraphSeries[];\n palette: string[];\n styles: ReturnType<typeof createGraphStyles>;\n position?: \"bottom\" | \"right\";\n}) => {\n const containerStyle =\n position === \"right\" ? styles.legendColumn : styles.legendRow;\n\n return (\n <View style={containerStyle}>\n {series.map((s, i) => (\n <View key={s.name} style={styles.legendItem}>\n <Svg width={10} height={10}>\n <Rect\n x={0}\n y={2}\n width={8}\n height={8}\n fill={s.color ?? palette[i % palette.length]}\n />\n </Svg>\n <PDFText style={styles.legendText}>{s.name}</PDFText>\n </View>\n ))}\n </View>\n );\n};\n\nconst renderChartContent = (\n variant: string,\n series: GraphSeries[],\n layout: ChartLayout,\n palette: string[],\n showGrid: boolean,\n showValues: boolean,\n showDots: boolean,\n smooth: boolean,\n centerLabel: string | undefined,\n theme: PdfcnTheme\n): React.ReactNode => {\n switch (variant) {\n case \"bar\": {\n return renderBarChart(\n series,\n layout,\n palette,\n showGrid,\n showValues,\n theme\n );\n }\n case \"horizontal-bar\": {\n return renderHorizontalBarChart(\n series,\n layout,\n palette,\n showValues,\n theme\n );\n }\n case \"line\":\n case \"area\": {\n return renderLineAreaChart(\n series,\n layout,\n palette,\n showGrid,\n showValues,\n showDots,\n smooth,\n variant === \"area\",\n theme\n );\n }\n case \"pie\": {\n return renderPieDonutChart(\n series,\n layout,\n palette,\n undefined,\n false,\n theme\n );\n }\n case \"donut\": {\n return renderPieDonutChart(\n series,\n layout,\n palette,\n centerLabel,\n true,\n theme\n );\n }\n default: {\n return null;\n }\n }\n};\n\nconst renderAxisLabels = (\n isPieOrDonut: boolean,\n xLabel: string | undefined,\n yLabel: string | undefined,\n chartX: number,\n chartW: number,\n height: number,\n mutedForeground: string\n) => (\n <>\n {!isPieOrDonut && xLabel && (\n <SvgText\n x={chartX + chartW / 2}\n y={height - 2}\n fill={mutedForeground}\n textAnchor=\"middle\"\n style={{ fontSize: 8 }}\n >\n {xLabel}\n </SvgText>\n )}\n {!isPieOrDonut && yLabel && (\n <SvgText\n x={2}\n y={10}\n fill={mutedForeground}\n textAnchor=\"start\"\n style={{ fontSize: 8 }}\n >\n {yLabel}\n </SvgText>\n )}\n </>\n);\n\nconst renderGraphContent = (\n title: string | undefined,\n subtitle: string | undefined,\n chartContent: React.ReactNode,\n axisLabels: 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 <Svg width={width} height={height}>\n {chartContent}\n {axisLabels}\n </Svg>\n {showLegend &&\n legend === \"right\" &&\n Legend({ palette, position: \"right\", series, styles })}\n </View>\n {showLegend &&\n legend === \"bottom\" &&\n Legend({ palette, position: \"bottom\", series, styles })}\n </>\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\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 renderAxisLabels(\n isPieOrDonut,\n xLabel,\n yLabel,\n chartX,\n chartW,\n height,\n theme.colors.mutedForeground\n ),\n width,\n height,\n legend,\n showLegend,\n isPieOrDonut,\n series,\n palette,\n styles\n )}\n </View>\n );\n\n return noWrap ? (\n <View style={[{ breakInside: \"avoid\" as const }].filter(Boolean)}>\n {content}\n </View>\n ) : (\n content\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/graph/graph.tsx"},{"path": "registry/bases/takumi/components/graph/graph.types.ts","content": "import type { Style } from \"../../lib/takumi-primitives\";\n\n/**\n * Options for calculating graph width based on theme page margins and container context.\n * Props - `containerPadding` | `wrapperPadding` | `pageWidth`\n * @see {@link GraphWidthOptions}\n */\nexport interface GraphWidthOptions {\n containerPadding?: number;\n wrapperPadding?: number;\n pageWidth?: number;\n}\n\nexport type GraphVariant =\n | \"bar\"\n | \"horizontal-bar\"\n | \"line\"\n | \"area\"\n | \"pie\"\n | \"donut\";\n\nexport type GraphLegendPosition = \"bottom\" | \"right\" | \"none\";\n\n/**\n * A single data point with a label, numeric value, and optional color override.\n * Props - `label` | `value` | `color`\n * @see {@link GraphDataPoint}\n */\nexport interface GraphDataPoint {\n label: string;\n value: number;\n color?: string;\n}\n\n/**\n * A named data series containing multiple data points, used for multi-series charts.\n * Props - `name` | `data` | `color`\n * @see {@link GraphSeries}\n */\nexport interface GraphSeries {\n name: string;\n data: GraphDataPoint[];\n color?: string;\n}\n\n/**\n * Multi-variant PDF chart (bar, line, area, pie, donut) rendered with SVG primitives.\n * Props - `variant` | `data` | `title` | `subtitle` | `xLabel` | `yLabel` | `width` | `height` | `fullWidth` | `containerPadding` | `wrapperPadding` | `colors` | `showValues` | `showGrid` | `legend` | `centerLabel` | `showDots` | `smooth` | `yTicks` | `noWrap` | `style`\n * @see {@link GraphProps}\n */\nexport interface GraphProps {\n /**\n * @default 'bar'\n */\n variant?: GraphVariant;\n data: GraphDataPoint[] | GraphSeries[];\n title?: string;\n subtitle?: string;\n xLabel?: string;\n yLabel?: string;\n /**\n * @default 420\n */\n width?: number;\n /**\n * @default 260\n */\n height?: number;\n /**\n * @default false\n */\n fullWidth?: boolean;\n containerPadding?: number;\n wrapperPadding?: number;\n colors?: string[];\n /**\n * @default false\n */\n showValues?: boolean;\n /**\n * @default true\n */\n showGrid?: boolean;\n /**\n * @default 'bottom'\n */\n legend?: GraphLegendPosition;\n centerLabel?: string;\n /**\n * @default true\n */\n showDots?: boolean;\n /**\n * @default false\n */\n smooth?: boolean;\n /**\n * @default 5\n */\n yTicks?: number;\n /**\n * @default true\n */\n noWrap?: boolean;\n style?: Style;\n}\n\n/** Internal chart layout dimensions computed from props and data. */\nexport interface ChartLayout {\n svgW: number;\n svgH: number;\n chartX: number;\n chartY: number;\n chartW: number;\n chartH: number;\n yMin: number;\n yMax: number;\n yTicks: number[];\n xLabels: string[];\n}\n",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/graph/graph.types.ts"},{"path": "registry/bases/takumi/components/graph/graph.utils.ts",- "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport type {\n ChartLayout,\n GraphDataPoint,\n GraphSeries,\n GraphWidthOptions,\n} from \"./graph.types\";\n\n/** Standard A4 page width in PDF points. */\nexport const A4_WIDTH = 595;\n\n/**\n * Pre-calculated safe graph widths for common scenarios.\n * These values work with all built-in themes on A4 pages.\n */\nexport const GRAPH_SAFE_WIDTHS = {\n /** Safe width for graph directly in page content (no extra containers) */\n default: 420,\n /** Safe width for graph inside a Section with md padding */\n inSection: 400,\n /** Safe width for graph inside a Section + bordered wrapper (like graphShell) */\n inSectionWithWrapper: 380,\n} as const;\n\n/**\n * Calculate the safe graph width based on theme page margins and container context.\n *\n * This utility ensures graphs don't overflow their container by accounting for:\n * - Page margins (from theme)\n * - Container padding (e.g., Section component)\n * - Wrapper padding (e.g., a bordered graphShell View)\n *\n * @example\n * ```tsx\n * const width = getGraphWidth(theme);\n * // For a graph inside a Section with padding=\"md\" (12pt) and a graphShell (12pt):\n * const width = getGraphWidth(theme, { containerPadding: 12, wrapperPadding: 12 });\n * ```\n */\nexport function getGraphWidth(\n theme: PdfcnTheme,\n options: GraphWidthOptions = {}\n): number {\n const {\n containerPadding = 0,\n wrapperPadding = 0,\n pageWidth = A4_WIDTH,\n } = options;\n const { marginLeft, marginRight } = theme.spacing.page;\n const availableWidth =\n pageWidth -\n marginLeft -\n marginRight -\n containerPadding * 2 -\n wrapperPadding * 2;\n return Math.max(Math.floor(availableWidth), 100);\n}\n\nexport const CHART_MARGINS = {\n axisBottom: 24,\n axisLeft: 40,\n pieBottom: 10,\n pieLeft: 10,\n right: 10,\n top: 10,\n} as const;\n\n/** Normalize to always work with GraphSeries[]. */\nexport function normalizeData(\n data: GraphDataPoint[] | GraphSeries[]\n): GraphSeries[] {\n if (data.length === 0) {return [];}\n if (\"label\" in data[0] && \"value\" in data[0]) {\n return [{ data: data as GraphDataPoint[], name: \"Series 1\" }];\n }\n return data as GraphSeries[];\n}\n\n/** Compute nice Y-axis ticks for a given value range. */\nexport function computeYTicks(\n min: number,\n max: number,\n count: number\n): number[] {\n if (min === max) {return [0, max || 1];}\n const step = (max - min) / (count - 1);\n return Array.from({ length: count }, (_, i) => {\n const v = min + i * step;\n return Math.round(v * 100) / 100;\n });\n}\n\n/** Format a number for display on axis labels. */\nexport function fmtNum(v: number): string {\n if (Math.abs(v) >= 1_000_000) {return `${(v / 1_000_000).toFixed(1)}M`;}\n if (Math.abs(v) >= 1000) {return `${(v / 1_000).toFixed(1)}K`;}\n if (!Number.isInteger(v)) {return v.toFixed(1);}\n return String(v);\n}\n\n/** Truncate a label to at most maxLen characters. */\nexport function truncate(s: string, maxLen: number): string {\n return s.length > maxLen ? `${s.slice(0, maxLen - 1)}…` : s;\n}\n\n/** Polar to Cartesian coordinate conversion for pie/donut arcs. */\nexport function polarToCartesian(\n cx: number,\n cy: number,\n r: number,\n angleDeg: number\n) {\n const rad = ((angleDeg - 90) * Math.PI) / 180;\n return { x: cx + r * Math.cos(rad), y: cy + r * Math.sin(rad) };\n}\n\n/** Build an SVG arc path for a pie/donut slice. */\nexport function arcPath(\n cx: number,\n cy: number,\n r: number,\n startAngle: number,\n endAngle: number,\n innerR = 0\n): string {\n const safeEnd = Math.min(endAngle, startAngle + 359.999);\n const large = safeEnd - startAngle > 180 ? 1 : 0;\n const s = polarToCartesian(cx, cy, r, safeEnd);\n const e = polarToCartesian(cx, cy, r, startAngle);\n if (innerR === 0) {\n return `M ${cx} ${cy} L ${s.x} ${s.y} A ${r} ${r} 0 ${large} 0 ${e.x} ${e.y} Z`;\n }\n const si = polarToCartesian(cx, cy, innerR, safeEnd);\n const ei = polarToCartesian(cx, cy, innerR, startAngle);\n return [\n `M ${s.x} ${s.y}`,\n `A ${r} ${r} 0 ${large} 0 ${e.x} ${e.y}`,\n `L ${ei.x} ${ei.y}`,\n `A ${innerR} ${innerR} 0 ${large} 1 ${si.x} ${si.y}`,\n \"Z\",\n ].join(\" \");\n}\n\n/** Compute smooth bezier control points (Catmull-Rom → cubic bezier). */\nexport function smoothPath(\n points: { x: number; y: number }[],\n tension = 0.4\n): string {\n if (points.length < 2) {return \"\";}\n if (points.length === 2) {\n return `M ${points[0].x} ${points[0].y} L ${points[1].x} ${points[1].y}`;\n }\n const parts: string[] = [`M ${points[0].x} ${points[0].y}`];\n for (let i = 0; i < points.length - 1; i++) {\n const p0 = points[Math.max(i - 1, 0)];\n const p1 = points[i];\n const p2 = points[i + 1];\n const p3 = points[Math.min(i + 2, points.length - 1)];\n const cp1x = p1.x + (p2.x - p0.x) * tension;\n const cp1y = p1.y + (p2.y - p0.y) * tension;\n const cp2x = p2.x - (p3.x - p1.x) * tension;\n const cp2y = p2.y - (p3.y - p1.y) * tension;\n parts.push(`C ${cp1x} ${cp1y} ${cp2x} ${cp2y} ${p2.x} ${p2.y}`);\n }\n return parts.join(\" \");\n}\n\n/** Get the default chart color palette from the theme. */\nexport function getDefaultPalette(t: PdfcnTheme): string[] {\n return [\n t.colors.primary,\n t.colors.info ?? \"#3B82F6\",\n t.colors.success ?? \"#22C55E\",\n t.colors.warning ?? \"#F59E0B\",\n t.colors.destructive ?? \"#EF4444\",\n \"#8B5CF6\",\n \"#F97316\",\n \"#14B8A6\",\n ];\n}\n\n/** Derive ChartLayout from series data, SVG dimensions, and variant. */\nexport function buildLayout(\n series: GraphSeries[],\n width: number,\n height: number,\n isPieOrDonut: boolean,\n yTickCount: number\n): ChartLayout {\n const mL = isPieOrDonut ? CHART_MARGINS.pieLeft : CHART_MARGINS.axisLeft;\n const mB = isPieOrDonut ? CHART_MARGINS.pieBottom : CHART_MARGINS.axisBottom;\n const chartX = mL;\n const chartY = CHART_MARGINS.top;\n const chartW = width - mL - CHART_MARGINS.right;\n const chartH = height - CHART_MARGINS.top - mB;\n const allValues = series.flatMap((s) => s.data.map((d) => d.value));\n const rawMin = Math.min(...allValues, 0);\n const rawMax = Math.max(...allValues, 1);\n const yMin = Math.min(0, rawMin);\n const yMax = rawMax + (rawMax - yMin) * 0.08;\n return {\n chartH,\n chartW,\n chartX,\n chartY,\n svgH: height,\n svgW: width,\n xLabels: series[0]?.data.map((d) => d.label) ?? [],\n yMax,\n yMin,\n yTicks: computeYTicks(yMin, yMax, yTickCount),\n };\n}\n",- "type": "registry:component"+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport type {\n ChartLayout,\n GraphDataPoint,\n GraphSeries,\n GraphWidthOptions,\n} from \"./graph.types\";\n\n/** Standard A4 page width in PDF points. */\nexport const A4_WIDTH = 595;\n\n/**\n * Pre-calculated safe graph widths for common scenarios.\n * These values work with all built-in themes on A4 pages.\n */\nexport const GRAPH_SAFE_WIDTHS = {\n /** Safe width for graph directly in page content (no extra containers) */\n default: 420,\n /** Safe width for graph inside a Section with md padding */\n inSection: 400,\n /** Safe width for graph inside a Section + bordered wrapper (like graphShell) */\n inSectionWithWrapper: 380,\n} as const;\n\n/**\n * Calculate the safe graph width based on theme page margins and container context.\n *\n * This utility ensures graphs don't overflow their container by accounting for:\n * - Page margins (from theme)\n * - Container padding (e.g., Section component)\n * - Wrapper padding (e.g., a bordered graphShell View)\n *\n * @example\n * ```tsx\n * const width = getGraphWidth(theme);\n * // For a graph inside a Section with padding=\"md\" (12pt) and a graphShell (12pt):\n * const width = getGraphWidth(theme, { containerPadding: 12, wrapperPadding: 12 });\n * ```\n */\nexport 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/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/graph/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/heading.json b/public/r/takumi/heading.jsonindex 10ef4a5..79fd33b 100644--- a/public/r/takumi/heading.json+++ b/public/r/takumi/heading.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/takumi/components/heading/heading.tsx",- "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { Text, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type HeadingWeight = \"normal\" | \"medium\" | \"semibold\" | \"bold\";\nexport type HeadingTracking = \"tighter\" | \"tight\" | \"normal\" | \"wide\" | \"wider\";\n\n/**\n * PDF heading mapped to h1–h6 font sizes from the theme.\n * Props - `level` | `align` | `color` | `transform` | `weight` | `tracking` | `noMargin` | `keepWithNext` | `children` | `style`\n * @see {@link HeadingProps}\n */\nexport interface HeadingProps extends PDFComponentProps {\n /**\n * @default 1\n */\n level?: 1 | 2 | 3 | 4 | 5 | 6;\n /**\n * @default 'left'\n */\n align?: \"left\" | \"center\" | \"right\";\n color?: string;\n transform?: \"uppercase\" | \"lowercase\" | \"capitalize\";\n /**\n * @default 'bold'\n */\n weight?: HeadingWeight;\n /**\n * @default 'normal'\n */\n tracking?: HeadingTracking;\n /**\n * @default false\n */\n noMargin?: boolean;\n keepWithNext?: boolean;\n}\n\nfunction createHeadingStyles(t: PdfcnTheme) {\n const { heading } = t.typography;\n const { spacing, fontWeights, letterSpacing } = t.primitives;\n const { sectionGap, componentGap, paragraphGap } = t.spacing;\n const base = {\n color: t.colors.foreground,\n fontFamily: heading.fontFamily,\n fontWeight: fontWeights.bold,\n lineHeight: heading.lineHeight,\n };\n return StyleSheet.create({\n capitalize: { textTransform: \"capitalize\" },\n h1: {\n ...base,\n fontSize: heading.fontSize.h1,\n marginBottom: paragraphGap,\n marginTop: spacing[0],\n },\n h2: {\n ...base,\n fontSize: heading.fontSize.h2,\n marginBottom: paragraphGap,\n marginTop: sectionGap,\n },\n h3: {\n ...base,\n fontSize: heading.fontSize.h3,\n marginBottom: paragraphGap,\n marginTop: componentGap,\n },\n h4: {\n ...base,\n fontSize: heading.fontSize.h4,\n marginBottom: paragraphGap,\n marginTop: paragraphGap,\n },\n h5: {\n ...base,\n fontSize: heading.fontSize.h5,\n marginBottom: spacing[1],\n marginTop: paragraphGap,\n },\n h6: {\n ...base,\n fontSize: heading.fontSize.h6,\n marginBottom: spacing[1],\n marginTop: paragraphGap,\n },\n lowercase: { textTransform: \"lowercase\" },\n noMargin: { marginBottom: 0, marginTop: 0 },\n trackingNormal: { letterSpacing: letterSpacing.normal },\n trackingTight: { letterSpacing: letterSpacing.tight * 10 },\n trackingTighter: { letterSpacing: letterSpacing.tight * 15 },\n trackingWide: { letterSpacing: letterSpacing.wide * 10 },\n trackingWider: { letterSpacing: letterSpacing.wider * 10 },\n uppercase: {\n letterSpacing: letterSpacing.wider * 10,\n textTransform: \"uppercase\",\n },\n weightBold: { fontWeight: fontWeights.bold },\n weightMedium: { fontWeight: fontWeights.medium },\n weightNormal: { fontWeight: fontWeights.regular },\n weightSemibold: { fontWeight: fontWeights.semibold },\n });\n}\n\nexport function Heading({\n level = 1,\n align,\n color,\n transform,\n weight,\n tracking,\n noMargin,\n keepWithNext = true,\n children,\n style,\n}: HeadingProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createHeadingStyles(theme), [theme]);\n const safeLevel = Math.min(Math.max(Math.round(level), 1), 6) as\n | 1\n | 2\n | 3\n | 4\n | 5\n | 6;\n const weightMap = {\n bold: styles.weightBold,\n medium: styles.weightMedium,\n normal: styles.weightNormal,\n semibold: styles.weightSemibold,\n };\n const trackingMap = {\n normal: styles.trackingNormal,\n tight: styles.trackingTight,\n tighter: styles.trackingTighter,\n wide: styles.trackingWide,\n wider: styles.trackingWider,\n };\n const transformMap = {\n capitalize: styles.capitalize,\n lowercase: styles.lowercase,\n uppercase: styles.uppercase,\n };\n const styleArray: Style[] = [\n styles[`h${safeLevel}` as keyof typeof styles] as Style,\n ];\n if (weight && weight in weightMap) {styleArray.push(weightMap[weight]);}\n if (tracking && tracking in trackingMap)\n {styleArray.push(trackingMap[tracking]);}\n if (transform && transform in transformMap)\n {styleArray.push(transformMap[transform as keyof typeof transformMap]);}\n if (noMargin) {styleArray.push(styles.noMargin);}\n const semantic = {} as Style;\n if (align) {semantic.textAlign = align;}\n if (color) {semantic.color = resolveColor(color, theme.colors);}\n if (Object.keys(semantic).length > 0) {styleArray.push(semantic);}\n if (style) {styleArray.push(...[style].flat());}\n return <Text style={styleArray}>{children}</Text>;\n}\n",- "type": "registry:component"+ "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { Text, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type HeadingWeight = \"normal\" | \"medium\" | \"semibold\" | \"bold\";\nexport type HeadingTracking = \"tighter\" | \"tight\" | \"normal\" | \"wide\" | \"wider\";\n\n/**\n * PDF heading mapped to h1–h6 font sizes from the theme.\n * Props - `level` | `align` | `color` | `transform` | `weight` | `tracking` | `noMargin` | `keepWithNext` | `children` | `style`\n * @see {@link HeadingProps}\n */\nexport interface HeadingProps extends PDFComponentProps {\n /**\n * @default 1\n */\n level?: 1 | 2 | 3 | 4 | 5 | 6;\n /**\n * @default 'left'\n */\n align?: \"left\" | \"center\" | \"right\";\n color?: string;\n transform?: \"uppercase\" | \"lowercase\" | \"capitalize\";\n /**\n * @default 'bold'\n */\n weight?: HeadingWeight;\n /**\n * @default 'normal'\n */\n tracking?: HeadingTracking;\n /**\n * @default false\n */\n noMargin?: boolean;\n keepWithNext?: boolean;\n}\n\nconst createHeadingStyles = (t: PdfcnTheme) => {\n const { heading } = t.typography;\n const { spacing, fontWeights, letterSpacing } = t.primitives;\n const { sectionGap, componentGap, paragraphGap } = t.spacing;\n const base = {\n color: t.colors.foreground,\n fontFamily: heading.fontFamily,\n fontWeight: fontWeights.bold,\n lineHeight: heading.lineHeight,\n };\n return StyleSheet.create({\n capitalize: { textTransform: \"capitalize\" },\n h1: {\n ...base,\n fontSize: heading.fontSize.h1,\n marginBottom: paragraphGap,\n marginTop: spacing[0],\n },\n h2: {\n ...base,\n fontSize: heading.fontSize.h2,\n marginBottom: paragraphGap,\n marginTop: sectionGap,\n },\n h3: {\n ...base,\n fontSize: heading.fontSize.h3,\n marginBottom: paragraphGap,\n marginTop: componentGap,\n },\n h4: {\n ...base,\n fontSize: heading.fontSize.h4,\n marginBottom: paragraphGap,\n marginTop: paragraphGap,\n },\n h5: {\n ...base,\n fontSize: heading.fontSize.h5,\n marginBottom: spacing[1],\n marginTop: paragraphGap,\n },\n h6: {\n ...base,\n fontSize: heading.fontSize.h6,\n marginBottom: spacing[1],\n marginTop: paragraphGap,\n },\n lowercase: { textTransform: \"lowercase\" },\n noMargin: { marginBottom: 0, marginTop: 0 },\n trackingNormal: { letterSpacing: letterSpacing.normal },\n trackingTight: { letterSpacing: letterSpacing.tight * 10 },\n trackingTighter: { letterSpacing: letterSpacing.tight * 15 },\n trackingWide: { letterSpacing: letterSpacing.wide * 10 },\n trackingWider: { letterSpacing: letterSpacing.wider * 10 },\n uppercase: {\n letterSpacing: letterSpacing.wider * 10,\n textTransform: \"uppercase\",\n },\n weightBold: { fontWeight: fontWeights.bold },\n weightMedium: { fontWeight: fontWeights.medium },\n weightNormal: { fontWeight: fontWeights.regular },\n weightSemibold: { fontWeight: fontWeights.semibold },\n });\n};\n\nexport const Heading = ({\n level = 1,\n align,\n color,\n transform,\n weight,\n tracking,\n noMargin,\n children,\n style,\n}: HeadingProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createHeadingStyles(theme), [theme]);\n const safeLevel = Math.min(Math.max(Math.round(level), 1), 6) as\n | 1\n | 2\n | 3\n | 4\n | 5\n | 6;\n const weightMap = {\n bold: styles.weightBold,\n medium: styles.weightMedium,\n normal: styles.weightNormal,\n semibold: styles.weightSemibold,\n };\n const trackingMap = {\n normal: styles.trackingNormal,\n tight: styles.trackingTight,\n tighter: styles.trackingTighter,\n wide: styles.trackingWide,\n wider: styles.trackingWider,\n };\n const transformMap = {\n capitalize: styles.capitalize,\n lowercase: styles.lowercase,\n uppercase: styles.uppercase,\n };\n const styleArray: Style[] = [\n styles[`h${safeLevel}` as keyof typeof styles] as Style,\n ];\n if (weight && weight in weightMap) {\n styleArray.push(weightMap[weight]);\n }\n if (tracking && tracking in trackingMap) {\n styleArray.push(trackingMap[tracking]);\n }\n if (transform && transform in transformMap) {\n styleArray.push(transformMap[transform as keyof typeof transformMap]);\n }\n if (noMargin) {\n styleArray.push(styles.noMargin);\n }\n const semantic = {} as Style;\n if (align) {\n semantic.textAlign = align;\n }\n if (color) {\n semantic.color = resolveColor(color, theme.colors);\n }\n if (Object.keys(semantic).length > 0) {\n styleArray.push(semantic);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return <Text style={styleArray}>{children}</Text>;\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/heading/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/invoice-classic.json b/public/r/takumi/invoice-classic.jsonindex aea8474..82922a0 100644--- a/public/r/takumi/invoice-classic.json+++ b/public/r/takumi/invoice-classic.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/takumi/blocks/invoice-classic/invoice-classic.tsx",- "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfImage,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { InvoiceClassicData } from \"./invoice-classic.types\";\n\n// Sample data — replace with your own props or data source\nconst sampleData: InvoiceClassicData = {\n billTo: {\n address: \"456 Client Ave, Suite 2\",\n email: \"[email protected]\",\n name: \"Client Corp.\",\n phone: \"+1 (555) 123-4567\",\n },\n companyAddress: \"City, Country\",\n companyEmail: \"[email protected]\",\n companyName: \"Your Company\",\n dueDate: \"March 17, 2026\",\n invoiceDate: \"February 17, 2026\",\n invoiceNumber: \"INV-2026-001\",\n items: [\n { description: \"Web Development\", quantity: 1, unitPrice: 12500 },\n { description: \"UI/UX Design\", quantity: 1, unitPrice: 8750 },\n { description: \"Consulting\", quantity: 10, unitPrice: 1500 },\n ],\n logo: \"/favicon.png\",\n notes: \"Thank you for your business!\",\n paymentTerms: {\n dueDate: \"March 17, 2026\",\n gst: \"GSTIN 123456789\",\n method: \"UPI / Card / Bank Transfer\",\n },\n subtitle: \"Professional Services\",\n summary: {\n subtotal: 36250,\n tax: 2537.5,\n total: 38787.5,\n },\n};\n\nexport function InvoiceClassicDocument({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceClassicData;\n}) {\n return (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceClassicContent data={data} />\n </PdfcnThemeProvider>\n );\n}\n\nfunction InvoiceClassicContent({ data }: { data: InvoiceClassicData }) {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n page: {\n backgroundColor: theme.colors.background,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" style={styles.page}>\n <PageHeader\n variant=\"logo-left\"\n logo={\n <PdfImage src={data.logo ?? \"/favicon.png\"} style={{ margin: 0 }} />\n }\n title={data.companyName}\n subtitle={data.subtitle}\n rightText={data.invoiceNumber}\n rightSubText={`Due: ${data.dueDate}`}\n style={{ marginBottom: 0 }}\n />\n <Section noWrap style={{ flexDirection: \"row\" }}>\n <View style={{ flex: 1, paddingRight: 15 }}>\n <Text\n style={{ fontSize: 9, fontWeight: \"bold\", marginBottom: 2 }}\n color=\"mutedForeground\"\n transform=\"uppercase\"\n noMargin\n >\n From\n </Text>\n <Text noMargin variant=\"xs\">\n {data.companyName}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.companyAddress}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.companyEmail}\n </Text>\n </View>\n <View style={{ flex: 1, paddingRight: 15 }}>\n <Text\n style={{ fontSize: 9, fontWeight: \"bold\", marginBottom: 2 }}\n color=\"mutedForeground\"\n transform=\"uppercase\"\n noMargin\n >\n Bill To\n </Text>\n <Text noMargin variant=\"xs\">\n {data.billTo.name}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.billTo.address}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.billTo.email}\n </Text>\n </View>\n <View style={{ flex: 1, paddingRight: 15 }}>\n <Text\n style={{ fontSize: 9, fontWeight: \"bold\", marginBottom: 2 }}\n color=\"mutedForeground\"\n transform=\"uppercase\"\n noMargin\n >\n Payment Terms\n </Text>\n <Text noMargin variant=\"xs\">\n {data.paymentTerms.method}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.paymentTerms.gst}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.paymentTerms.dueDate}\n </Text>\n </View>\n </Section>\n <Table variant=\"grid\" zebraStripe>\n <TableHeader>\n <TableRow header>\n <TableCell>Description</TableCell>\n <TableCell align=\"center\">QTY</TableCell>\n <TableCell align=\"center\">Rate</TableCell>\n <TableCell align=\"right\">Total</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: invoice items have no stable id\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"center\">{`$${item.unitPrice}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toFixed(2)}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={{ flexDirection: \"row\", marginTop: 16 }}>\n <View style={{ marginLeft: \"auto\", width: 220 }}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toFixed(2)}`,\n },\n { key: \"Tax\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Total\",\n keyStyle: { fontSize: 12, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: { fontSize: 12, fontWeight: \"bold\" },\n },\n ]}\n divided\n />\n </View>\n </Section>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </Page>\n </Document>\n );\n}\n",- "type": "registry:block"+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfImage,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { InvoiceClassicData } from \"./invoice-classic.types\";\n\n// Sample data — replace with your own props or data source\nconst sampleData: InvoiceClassicData = {\n billTo: {\n address: \"456 Client Ave, Suite 2\",\n email: \"[email protected]\",\n name: \"Client Corp.\",\n phone: \"+1 (555) 123-4567\",\n },\n companyAddress: \"City, Country\",\n companyEmail: \"[email protected]\",\n companyName: \"Your Company\",\n dueDate: \"March 17, 2026\",\n invoiceDate: \"February 17, 2026\",\n invoiceNumber: \"INV-2026-001\",\n items: [\n { description: \"Web Development\", quantity: 1, unitPrice: 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: \"Professional Services\",\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 padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" style={styles.page}>\n <PageHeader\n variant=\"logo-left\"\n logo={\n <PdfImage src={data.logo ?? \"/favicon.png\"} style={{ margin: 0 }} />\n }\n title={data.companyName}\n subtitle={data.subtitle}\n rightText={data.invoiceNumber}\n rightSubText={`Due: ${data.dueDate}`}\n style={{ marginBottom: 0 }}\n />\n <Section noWrap style={{ flexDirection: \"row\" }}>\n <View style={{ flex: 1, paddingRight: 15 }}>\n <Text\n style={{ fontSize: 9, fontWeight: \"bold\", marginBottom: 2 }}\n color=\"mutedForeground\"\n transform=\"uppercase\"\n noMargin\n >\n From\n </Text>\n <Text noMargin variant=\"xs\">\n {data.companyName}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.companyAddress}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.companyEmail}\n </Text>\n </View>\n <View style={{ flex: 1, paddingRight: 15 }}>\n <Text\n style={{ fontSize: 9, fontWeight: \"bold\", marginBottom: 2 }}\n color=\"mutedForeground\"\n transform=\"uppercase\"\n noMargin\n >\n Bill To\n </Text>\n <Text noMargin variant=\"xs\">\n {data.billTo.name}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.billTo.address}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.billTo.email}\n </Text>\n </View>\n <View style={{ flex: 1, paddingRight: 15 }}>\n <Text\n style={{ fontSize: 9, fontWeight: \"bold\", marginBottom: 2 }}\n color=\"mutedForeground\"\n transform=\"uppercase\"\n noMargin\n >\n Payment Terms\n </Text>\n <Text noMargin variant=\"xs\">\n {data.paymentTerms.method}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.paymentTerms.gst}\n </Text>\n <Text noMargin variant=\"xs\">\n {data.paymentTerms.dueDate}\n </Text>\n </View>\n </Section>\n <Table variant=\"grid\" zebraStripe>\n <TableHeader>\n <TableRow header>\n <TableCell>Description</TableCell>\n <TableCell align=\"center\">QTY</TableCell>\n <TableCell align=\"center\">Rate</TableCell>\n <TableCell align=\"right\">Total</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: invoice items have no stable id\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"center\">{`$${item.unitPrice}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toFixed(2)}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={{ flexDirection: \"row\", marginTop: 16 }}>\n <View style={{ marginLeft: \"auto\", width: 220 }}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toFixed(2)}`,\n },\n { key: \"Tax\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Total\",\n keyStyle: { fontSize: 12, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: { fontSize: 12, fontWeight: \"bold\" },\n },\n ]}\n divided\n />\n </View>\n </Section>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </Page>\n </Document>\n );\n};\n\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"},{"path": "registry/bases/takumi/blocks/invoice-classic/invoice-classic.types.ts","content": "export interface InvoiceClassicData {\n invoiceNumber: string;\n invoiceDate: string;\n dueDate: string;\n companyName: string;\n subtitle: string;\n companyAddress: string;\n companyEmail: string;\n logo?: string;\n billTo: {\n name: string;\n address: string;\n email: string;\n phone: string;\n };\n items: {\n description: string;\n quantity: number;\n unitPrice: number;\n }[];\n summary: {\n subtotal: number;\n tax: number;\n total: number;\n };\n paymentTerms: {\n dueDate: string;\n method: string;\n gst: string;\n };\n notes?: string;\n}\n",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-classic/invoice-classic.types.ts"}],"type": "registry:block"diff --git a/public/r/takumi/invoice-consultant.json b/public/r/takumi/invoice-consultant.jsonindex a89ea0a..7b682d2 100644--- a/public/r/takumi/invoice-consultant.json+++ b/public/r/takumi/invoice-consultant.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.tsx",- "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { InvoiceConsultantData } from \"./invoice-consultant.types\";\n\nconst sampleData: InvoiceConsultantData = {\n client: {\n address: \"500 Tech Park, Suite 200\",\n company: \"Acme Technologies\",\n email: \"[email protected]\",\n name: \"Sarah Johnson\",\n },\n companyAddress: \"City, Country · [email protected]\",\n companyName: \"Your Consulting\",\n consultant: {\n email: \"[email protected]\",\n name: \"John Smith\",\n title: \"Senior Technical Consultant\",\n },\n dueDate: \"March 28, 2026\",\n invoiceDate: \"February 26, 2026\",\n invoiceNumber: \"INV-2026-006\",\n notes:\n \"Services rendered for February 2026. All hours verified and approved by client.\",\n paymentTerms: {\n dueDate: \"March 28, 2026\",\n method: \"Bank Transfer / Check\",\n },\n projectRef: \"PROJ-2026-ACME-001\",\n services: [\n { description: \"Architecture Review & Planning\", hours: 16, rate: 175 },\n { description: \"Code Review & Optimization\", hours: 24, rate: 150 },\n { description: \"Technical Documentation\", hours: 12, rate: 125 },\n { description: \"Team Training & Knowledge Transfer\", hours: 8, rate: 200 },\n ],\n subtitle: \"Professional Consulting Services\",\n summary: {\n subtotal: 10300,\n tax: 515,\n total: 10815,\n totalHours: 60,\n },\n};\n\nexport function InvoiceConsultantDocument({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceConsultantData;\n}) {\n return (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceConsultantContent data={data} />\n </PdfcnThemeProvider>\n );\n}\n\nfunction InvoiceConsultantContent({ data }: { data: InvoiceConsultantData }) {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n calloutNote: {\n backgroundColor: theme.colors.muted,\n borderLeftColor: theme.colors.info,\n borderLeftStyle: \"solid\",\n borderLeftWidth: 3,\n marginTop: 16,\n paddingLeft: 12,\n paddingVertical: 8,\n },\n companyInfo: {\n flex: 1,\n },\n headerRow: {\n alignItems: \"flex-start\",\n borderBottomColor: theme.colors.primary,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 2,\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: theme.spacing.sectionGap,\n paddingBottom: theme.spacing.componentGap,\n },\n hoursBadge: {\n alignSelf: \"flex-start\",\n backgroundColor: theme.colors.primary,\n borderRadius: theme.primitives.borderRadius.sm,\n color: theme.colors.primaryForeground,\n paddingHorizontal: 12,\n paddingVertical: 8,\n },\n hoursBox: {\n flex: 1,\n paddingRight: 24,\n },\n invoiceInfo: {\n alignItems: \"flex-end\",\n },\n page: {\n backgroundColor: theme.colors.background,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n partiesRow: {\n flexDirection: \"row\",\n gap: 40,\n marginBottom: theme.spacing.sectionGap,\n },\n partyColumn: {\n flex: 1,\n },\n partyLabel: {\n borderBottomColor: theme.colors.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n color: theme.colors.primary,\n fontSize: 9,\n fontWeight: \"bold\",\n letterSpacing: 0.6,\n marginBottom: 6,\n paddingBottom: 4,\n textTransform: \"uppercase\",\n },\n projectRef: {\n alignItems: \"center\",\n backgroundColor: theme.colors.muted,\n borderRadius: theme.primitives.borderRadius.sm,\n flexDirection: \"row\",\n gap: 8,\n marginBottom: theme.spacing.sectionGap,\n paddingHorizontal: 10,\n paddingVertical: 6,\n },\n summaryRow: {\n flexDirection: \"row\",\n marginTop: 20,\n },\n totalsBox: {\n width: 250,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" style={styles.page}>\n <View style={styles.headerRow}>\n <View style={styles.companyInfo}>\n <Text variant=\"xl\" weight=\"bold\" noMargin>\n {data.companyName}\n </Text>\n <Text variant=\"sm\" color=\"mutedForeground\" noMargin>\n {data.subtitle}\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n {data.companyAddress}\n </Text>\n </View>\n <View style={styles.invoiceInfo}>\n <Text\n variant=\"xs\"\n color=\"mutedForeground\"\n transform=\"uppercase\"\n noMargin\n >\n Invoice\n </Text>\n <Text variant=\"lg\" weight=\"bold\" noMargin>\n {data.invoiceNumber}\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n {data.invoiceDate}\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Due: {data.dueDate}\n </Text>\n </View>\n </View>\n {data.projectRef && (\n <View style={styles.projectRef}>\n <Text\n variant=\"xs\"\n weight=\"semibold\"\n color=\"mutedForeground\"\n noMargin\n >\n Project Reference:\n </Text>\n <Text variant=\"xs\" weight=\"bold\" noMargin>\n {data.projectRef}\n </Text>\n </View>\n )}\n <View style={styles.partiesRow}>\n <View style={styles.partyColumn}>\n <Text style={styles.partyLabel} noMargin>\n From (Consultant)\n </Text>\n <Text variant=\"sm\" weight=\"semibold\" noMargin>\n {data.consultant.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.consultant.title}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.consultant.email}\n </Text>\n </View>\n <View style={styles.partyColumn}>\n <Text style={styles.partyLabel} noMargin>\n Bill To (Client)\n </Text>\n <Text variant=\"sm\" weight=\"semibold\" noMargin>\n {data.client.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.client.company}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.client.address}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.client.email}\n </Text>\n </View>\n </View>\n <Table variant=\"line\">\n <TableHeader>\n <TableRow header>\n <TableCell>Service Description</TableCell>\n <TableCell align=\"center\">Hours</TableCell>\n <TableCell align=\"right\">Rate ($/hr)</TableCell>\n <TableCell align=\"right\">Amount</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.services.map((service, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF list, no reordering\n <TableRow key={index}>\n <TableCell>{service.description}</TableCell>\n <TableCell align=\"center\">{`${service.hours}`}</TableCell>\n <TableCell align=\"right\">{`$${service.rate}`}</TableCell>\n <TableCell align=\"right\">{`$${(service.hours * service.rate).toLocaleString()}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={styles.summaryRow}>\n <View style={styles.hoursBox}>\n <View style={styles.hoursBadge}>\n <Text\n style={{\n color: theme.colors.primaryForeground,\n fontSize: 9,\n fontWeight: \"bold\",\n }}\n noMargin\n >\n Total Hours: {data.summary.totalHours}\n </Text>\n </View>\n <Text variant=\"xs\" color=\"mutedForeground\" style={{ marginTop: 8 }}>\n Payment: {data.paymentTerms.method}\n </Text>\n </View>\n <View style={styles.totalsBox}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toLocaleString()}`,\n },\n { key: \"Tax (5%)\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Amount Due\",\n keyStyle: { fontSize: 13, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: {\n color: theme.colors.primary,\n fontSize: 14,\n fontWeight: \"bold\",\n },\n },\n ]}\n divided\n />\n </View>\n </Section>\n {data.notes && (\n <View style={styles.calloutNote}>\n <Text variant=\"xs\" color=\"mutedForeground\">\n {data.notes}\n </Text>\n </View>\n )}\n <PageFooter\n leftText=\"Professional services invoice – Please retain for records\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </Page>\n </Document>\n );\n}\n",- "type": "registry:block"+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { InvoiceConsultantData } from \"./invoice-consultant.types\";\n\nconst sampleData: InvoiceConsultantData = {\n client: {\n address: \"500 Tech Park, Suite 200\",\n company: \"Acme Technologies\",\n email: \"[email protected]\",\n name: \"Sarah Johnson\",\n },\n companyAddress: \"City, Country · [email protected]\",\n companyName: \"Your Consulting\",\n consultant: {\n email: \"[email protected]\",\n name: \"John Smith\",\n title: \"Senior Technical Consultant\",\n },\n dueDate: \"March 28, 2026\",\n invoiceDate: \"February 26, 2026\",\n invoiceNumber: \"INV-2026-006\",\n notes:\n \"Services rendered for February 2026. All hours verified and approved by client.\",\n paymentTerms: {\n dueDate: \"March 28, 2026\",\n method: \"Bank Transfer / Check\",\n },\n projectRef: \"PROJ-2026-ACME-001\",\n services: [\n { description: \"Architecture Review & Planning\", hours: 16, rate: 175 },\n { description: \"Code Review & Optimization\", hours: 24, rate: 150 },\n { description: \"Technical Documentation\", hours: 12, rate: 125 },\n { description: \"Team Training & Knowledge Transfer\", hours: 8, rate: 200 },\n ],\n subtitle: \"Professional Consulting Services\",\n summary: {\n subtotal: 10_300,\n tax: 515,\n total: 10_815,\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 padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n partiesRow: {\n flexDirection: \"row\",\n gap: 40,\n marginBottom: theme.spacing.sectionGap,\n },\n partyColumn: {\n flex: 1,\n },\n partyLabel: {\n borderBottomColor: theme.colors.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n color: theme.colors.primary,\n fontSize: 9,\n fontWeight: \"bold\",\n letterSpacing: 0.6,\n marginBottom: 6,\n paddingBottom: 4,\n textTransform: \"uppercase\",\n },\n projectRef: {\n alignItems: \"center\",\n backgroundColor: theme.colors.muted,\n borderRadius: theme.primitives.borderRadius.sm,\n flexDirection: \"row\",\n gap: 8,\n marginBottom: theme.spacing.sectionGap,\n paddingHorizontal: 10,\n paddingVertical: 6,\n },\n summaryRow: {\n flexDirection: \"row\",\n marginTop: 20,\n },\n totalsBox: {\n width: 250,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" style={styles.page}>\n <View style={styles.headerRow}>\n <View style={styles.companyInfo}>\n <Text variant=\"xl\" weight=\"bold\" noMargin>\n {data.companyName}\n </Text>\n <Text variant=\"sm\" color=\"mutedForeground\" noMargin>\n {data.subtitle}\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n {data.companyAddress}\n </Text>\n </View>\n <View style={styles.invoiceInfo}>\n <Text\n variant=\"xs\"\n color=\"mutedForeground\"\n transform=\"uppercase\"\n noMargin\n >\n Invoice\n </Text>\n <Text variant=\"lg\" weight=\"bold\" noMargin>\n {data.invoiceNumber}\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n {data.invoiceDate}\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Due: {data.dueDate}\n </Text>\n </View>\n </View>\n {data.projectRef && (\n <View style={styles.projectRef}>\n <Text\n variant=\"xs\"\n weight=\"semibold\"\n color=\"mutedForeground\"\n noMargin\n >\n Project Reference:\n </Text>\n <Text variant=\"xs\" weight=\"bold\" noMargin>\n {data.projectRef}\n </Text>\n </View>\n )}\n <View style={styles.partiesRow}>\n <View style={styles.partyColumn}>\n <Text style={styles.partyLabel} noMargin>\n From (Consultant)\n </Text>\n <Text variant=\"sm\" weight=\"semibold\" noMargin>\n {data.consultant.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.consultant.title}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.consultant.email}\n </Text>\n </View>\n <View style={styles.partyColumn}>\n <Text style={styles.partyLabel} noMargin>\n Bill To (Client)\n </Text>\n <Text variant=\"sm\" weight=\"semibold\" noMargin>\n {data.client.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.client.company}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.client.address}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.client.email}\n </Text>\n </View>\n </View>\n <Table variant=\"line\">\n <TableHeader>\n <TableRow header>\n <TableCell>Service Description</TableCell>\n <TableCell align=\"center\">Hours</TableCell>\n <TableCell align=\"right\">Rate ($/hr)</TableCell>\n <TableCell align=\"right\">Amount</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.services.map((service, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF list, no reordering\n <TableRow key={index}>\n <TableCell>{service.description}</TableCell>\n <TableCell align=\"center\">{`${service.hours}`}</TableCell>\n <TableCell align=\"right\">{`$${service.rate}`}</TableCell>\n <TableCell align=\"right\">{`$${(service.hours * service.rate).toLocaleString()}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={styles.summaryRow}>\n <View style={styles.hoursBox}>\n <View style={styles.hoursBadge}>\n <Text\n style={{\n color: theme.colors.primaryForeground,\n fontSize: 9,\n fontWeight: \"bold\",\n }}\n noMargin\n >\n Total Hours: {data.summary.totalHours}\n </Text>\n </View>\n <Text variant=\"xs\" color=\"mutedForeground\" style={{ marginTop: 8 }}>\n Payment: {data.paymentTerms.method}\n </Text>\n </View>\n <View style={styles.totalsBox}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toLocaleString()}`,\n },\n { key: \"Tax (5%)\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Amount Due\",\n keyStyle: { fontSize: 13, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: {\n color: theme.colors.primary,\n fontSize: 14,\n fontWeight: \"bold\",\n },\n },\n ]}\n divided\n />\n </View>\n </Section>\n {data.notes && (\n <View style={styles.calloutNote}>\n <Text variant=\"xs\" color=\"mutedForeground\">\n {data.notes}\n </Text>\n </View>\n )}\n <PageFooter\n leftText=\"Professional services invoice – Please retain for records\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </Page>\n </Document>\n );\n};\n\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"},{"path": "registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.types.ts","content": "export interface InvoiceConsultantData {\n invoiceNumber: string;\n invoiceDate: string;\n dueDate: string;\n companyName: string;\n subtitle: string;\n companyAddress: string;\n consultant: {\n name: string;\n title: string;\n email: string;\n };\n client: {\n name: string;\n company: string;\n address: string;\n email: string;\n };\n services: {\n description: string;\n hours: number;\n rate: number;\n }[];\n summary: {\n totalHours: number;\n subtotal: number;\n tax: number;\n total: number;\n };\n paymentTerms: {\n dueDate: string;\n method: string;\n };\n projectRef?: string;\n notes?: string;\n}\n",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-consultant/invoice-consultant.types.ts"}],"type": "registry:block"diff --git a/public/r/takumi/invoice-corporate.json b/public/r/takumi/invoice-corporate.jsonindex c397978..4c52f2d 100644--- a/public/r/takumi/invoice-corporate.json+++ b/public/r/takumi/invoice-corporate.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.tsx",- "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfImage,\n PdfcnThemeProvider,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { InvoiceCorporateData } from \"./invoice-corporate.types\";\n\nconst sampleData: InvoiceCorporateData = {\n billTo: {\n address: \"100 Corporate Plaza, Tower B\",\n email: \"[email protected]\",\n name: \"Global Industries Ltd.\",\n phone: \"+1 (555) 888-9999\",\n },\n companyAddress: \"City, Country\",\n companyEmail: \"[email protected]\",\n companyName: \"Your Company\",\n dueDate: \"March 24, 2026\",\n invoiceDate: \"February 22, 2026\",\n invoiceNumber: \"INV-2026-004\",\n items: [\n {\n description: \"Enterprise Software License\",\n quantity: 5,\n unitPrice: 4500,\n },\n { description: \"Implementation Services\", quantity: 1, unitPrice: 18000 },\n { description: \"Training Workshop\", quantity: 3, unitPrice: 2500 },\n { description: \"Annual Support Package\", quantity: 1, unitPrice: 8500 },\n ],\n logo: \"/favicon.png\",\n notes: \"Corporate billing – Net 30 terms apply.\",\n paymentTerms: {\n dueDate: \"March 24, 2026\",\n gst: \"GSTIN 987654321\",\n method: \"Wire Transfer / Corporate Account\",\n },\n subtitle: \"Professional Services\",\n summary: {\n subtotal: 57000,\n tax: 4560,\n total: 61560,\n },\n};\n\nexport function InvoiceCorporateDocument({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceCorporateData;\n}) {\n return (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceCorporateContent data={data} />\n </PdfcnThemeProvider>\n );\n}\n\nfunction InvoiceCorporateContent({ data }: { data: InvoiceCorporateData }) {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n infoColumn: {\n flex: 1,\n },\n infoGrid: {\n flexDirection: \"row\",\n gap: 24,\n marginBottom: theme.spacing.sectionGap,\n },\n infoLabel: {\n color: theme.colors.mutedForeground,\n fontSize: 9,\n fontWeight: \"bold\",\n letterSpacing: 0.6,\n marginBottom: 6,\n textTransform: \"uppercase\",\n },\n page: {\n backgroundColor: theme.colors.background,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n summaryCard: {\n backgroundColor: theme.colors.muted,\n borderRadius: theme.primitives.borderRadius.md,\n marginTop: 20,\n padding: 16,\n },\n summaryRow: {\n flexDirection: \"row\",\n justifyContent: \"flex-end\",\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" style={styles.page}>\n <PageHeader\n variant=\"logo-right\"\n logo={\n <PdfImage\n src={data.logo ?? \"/favicon.png\"}\n width={56}\n height={56}\n style={{ margin: 0 }}\n />\n }\n title={data.companyName}\n subtitle={`${data.subtitle} · ${data.companyAddress}`}\n style={{ marginBottom: theme.spacing.sectionGap }}\n />\n <View style={styles.infoGrid}>\n <View style={styles.infoColumn}>\n <Text style={styles.infoLabel} noMargin>\n Invoice Details\n </Text>\n <KeyValue\n size=\"sm\"\n items={[\n { key: \"Invoice #\", value: data.invoiceNumber },\n { key: \"Issue Date\", value: data.invoiceDate },\n { key: \"Due Date\", value: data.dueDate },\n { key: \"Payment\", value: data.paymentTerms.method },\n ]}\n />\n </View>\n <View style={styles.infoColumn}>\n <Text style={styles.infoLabel} noMargin>\n Bill To\n </Text>\n <Text variant=\"sm\" weight=\"semibold\" noMargin>\n {data.billTo.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.address}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.email}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.phone}\n </Text>\n </View>\n </View>\n <Table variant=\"bordered\">\n <TableHeader>\n <TableRow header>\n <TableCell>Description</TableCell>\n <TableCell align=\"center\">Qty</TableCell>\n <TableCell align=\"right\">Unit Price</TableCell>\n <TableCell align=\"right\">Amount</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF list, no reordering\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"right\">{`$${item.unitPrice.toLocaleString()}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toLocaleString()}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <View style={styles.summaryCard}>\n <View style={styles.summaryRow}>\n <View style={{ width: 260 }}>\n <KeyValue\n size=\"md\"\n dividerThickness={1}\n dividerColor=\"border\"\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toLocaleString()}`,\n },\n { key: \"Tax (8%)\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Total Due\",\n keyStyle: { fontSize: 13, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: {\n color: theme.colors.primary,\n fontSize: 14,\n fontWeight: \"bold\",\n },\n },\n ]}\n divided\n />\n </View>\n </View>\n </View>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </Page>\n </Document>\n );\n}\n",- "type": "registry:block"+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfImage,\n PdfcnThemeProvider,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { InvoiceCorporateData } from \"./invoice-corporate.types\";\n\nconst sampleData: InvoiceCorporateData = {\n billTo: {\n address: \"100 Corporate Plaza, Tower B\",\n email: \"[email protected]\",\n name: \"Global Industries Ltd.\",\n phone: \"+1 (555) 888-9999\",\n },\n companyAddress: \"City, Country\",\n companyEmail: \"[email protected]\",\n companyName: \"Your Company\",\n dueDate: \"March 24, 2026\",\n invoiceDate: \"February 22, 2026\",\n invoiceNumber: \"INV-2026-004\",\n items: [\n {\n description: \"Enterprise Software License\",\n quantity: 5,\n unitPrice: 4500,\n },\n { description: \"Implementation Services\", quantity: 1, unitPrice: 18_000 },\n { description: \"Training Workshop\", quantity: 3, unitPrice: 2500 },\n { description: \"Annual Support Package\", quantity: 1, unitPrice: 8500 },\n ],\n logo: \"/favicon.png\",\n notes: \"Corporate billing – Net 30 terms apply.\",\n paymentTerms: {\n dueDate: \"March 24, 2026\",\n gst: \"GSTIN 987654321\",\n method: \"Wire Transfer / Corporate Account\",\n },\n subtitle: \"Professional Services\",\n summary: {\n subtotal: 57_000,\n tax: 4560,\n total: 61_560,\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 padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n summaryCard: {\n backgroundColor: theme.colors.muted,\n borderRadius: theme.primitives.borderRadius.md,\n marginTop: 20,\n padding: 16,\n },\n summaryRow: {\n flexDirection: \"row\",\n justifyContent: \"flex-end\",\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" style={styles.page}>\n <PageHeader\n variant=\"logo-right\"\n logo={\n <PdfImage\n src={data.logo ?? \"/favicon.png\"}\n width={56}\n height={56}\n style={{ margin: 0 }}\n />\n }\n title={data.companyName}\n subtitle={`${data.subtitle} · ${data.companyAddress}`}\n style={{ marginBottom: theme.spacing.sectionGap }}\n />\n <View style={styles.infoGrid}>\n <View style={styles.infoColumn}>\n <Text style={styles.infoLabel} noMargin>\n Invoice Details\n </Text>\n <KeyValue\n size=\"sm\"\n items={[\n { key: \"Invoice #\", value: data.invoiceNumber },\n { key: \"Issue Date\", value: data.invoiceDate },\n { key: \"Due Date\", value: data.dueDate },\n { key: \"Payment\", value: data.paymentTerms.method },\n ]}\n />\n </View>\n <View style={styles.infoColumn}>\n <Text style={styles.infoLabel} noMargin>\n Bill To\n </Text>\n <Text variant=\"sm\" weight=\"semibold\" noMargin>\n {data.billTo.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.address}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.email}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.phone}\n </Text>\n </View>\n </View>\n <Table variant=\"bordered\">\n <TableHeader>\n <TableRow header>\n <TableCell>Description</TableCell>\n <TableCell align=\"center\">Qty</TableCell>\n <TableCell align=\"right\">Unit Price</TableCell>\n <TableCell align=\"right\">Amount</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF list, no reordering\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"right\">{`$${item.unitPrice.toLocaleString()}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toLocaleString()}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <View style={styles.summaryCard}>\n <View style={styles.summaryRow}>\n <View style={{ width: 260 }}>\n <KeyValue\n size=\"md\"\n dividerThickness={1}\n dividerColor=\"border\"\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toLocaleString()}`,\n },\n { key: \"Tax (8%)\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Total Due\",\n keyStyle: { fontSize: 13, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: {\n color: theme.colors.primary,\n fontSize: 14,\n fontWeight: \"bold\",\n },\n },\n ]}\n divided\n />\n </View>\n </View>\n </View>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </Page>\n </Document>\n );\n};\n\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"},{"path": "registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.types.ts","content": "export interface InvoiceCorporateData {\n invoiceNumber: string;\n invoiceDate: string;\n dueDate: string;\n companyName: string;\n subtitle: string;\n companyAddress: string;\n companyEmail: string;\n logo?: string;\n billTo: {\n name: string;\n address: string;\n email: string;\n phone: string;\n };\n items: {\n description: string;\n quantity: number;\n unitPrice: number;\n }[];\n summary: {\n subtotal: number;\n tax: number;\n total: number;\n };\n paymentTerms: {\n dueDate: string;\n method: string;\n gst: string;\n };\n notes?: string;\n}\n",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-corporate/invoice-corporate.types.ts"}],"type": "registry:block"diff --git a/public/r/takumi/invoice-creative.json b/public/r/takumi/invoice-creative.jsonindex e705c56..bf3b93c 100644--- a/public/r/takumi/invoice-creative.json+++ b/public/r/takumi/invoice-creative.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/takumi/blocks/invoice-creative/invoice-creative.tsx",- "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { InvoiceCreativeData } from \"./invoice-creative.types\";\n\nconst sampleData: InvoiceCreativeData = {\n billTo: {\n address: \"250 Design District, Loft 5\",\n email: \"[email protected]\",\n name: \"Creative Agency Co.\",\n phone: \"+1 (555) 321-7654\",\n },\n companyAddress: \"City, Country · [email protected]\",\n companyName: \"Your Agency\",\n dueDate: \"March 26, 2026\",\n invoiceDate: \"February 24, 2026\",\n invoiceNumber: \"INV-2026-005\",\n items: [\n { description: \"Brand Identity Design\", quantity: 1, unitPrice: 8500 },\n {\n description: \"Marketing Collateral Package\",\n quantity: 1,\n unitPrice: 4200,\n },\n {\n description: \"Social Media Assets (per set)\",\n quantity: 4,\n unitPrice: 750,\n },\n { description: \"Motion Graphics (30s)\", quantity: 2, unitPrice: 3500 },\n ],\n notes:\n \"Creative work is protected under copyright. Full usage rights transfer upon payment.\",\n paymentTerms: {\n dueDate: \"March 26, 2026\",\n gst: \"GSTIN 456789123\",\n method: \"Credit Card / PayPal / Stripe\",\n },\n subtitle: \"Creative Services\",\n summary: {\n subtotal: 22700,\n tax: 1475.5,\n total: 24175.5,\n },\n};\n\nexport function InvoiceCreativeDocument({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceCreativeData;\n}) {\n return (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceCreativeContent data={data} />\n </PdfcnThemeProvider>\n );\n}\n\nfunction InvoiceCreativeContent({ data }: { data: InvoiceCreativeData }) {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n accentBlock: {\n backgroundColor: theme.colors.muted,\n borderLeftColor: theme.colors.accent,\n borderLeftStyle: \"solid\",\n borderLeftWidth: 4,\n marginBottom: theme.spacing.sectionGap,\n paddingLeft: 14,\n paddingVertical: 10,\n },\n badgeLabel: {\n color: theme.colors.primaryForeground,\n fontSize: 8,\n fontWeight: \"bold\",\n letterSpacing: 1.2,\n marginBottom: 2,\n textTransform: \"uppercase\",\n },\n badgeNumber: {\n color: theme.colors.primaryForeground,\n fontSize: 16,\n fontWeight: \"bold\",\n },\n heroSection: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: theme.spacing.sectionGap,\n },\n infoColumn: {\n flex: 1,\n },\n infoGrid: {\n flexDirection: \"row\",\n gap: 32,\n },\n invoiceBadge: {\n alignItems: \"center\",\n backgroundColor: theme.colors.primary,\n borderRadius: theme.primitives.borderRadius.md,\n paddingHorizontal: 20,\n paddingVertical: 14,\n },\n page: {\n backgroundColor: theme.colors.background,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n sectionLabel: {\n color: theme.colors.accent,\n fontSize: 8,\n fontWeight: \"bold\",\n letterSpacing: 0.8,\n marginBottom: 6,\n textTransform: \"uppercase\",\n },\n summaryLeft: {\n flex: 1,\n paddingRight: 20,\n },\n summaryRight: {\n backgroundColor: theme.colors.muted,\n borderRadius: theme.primitives.borderRadius.sm,\n padding: 14,\n width: 240,\n },\n summarySection: {\n flexDirection: \"row\",\n marginTop: 24,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" style={styles.page}>\n <View style={styles.heroSection}>\n <View style={{ flex: 1 }}>\n <PageHeader\n variant=\"centered\"\n title={data.companyName}\n subtitle={`${data.subtitle} · ${data.companyAddress}`}\n marginBottom={0}\n />\n </View>\n <View style={styles.invoiceBadge}>\n <Text style={styles.badgeLabel} noMargin>\n Invoice\n </Text>\n <Text style={styles.badgeNumber} noMargin>\n {data.invoiceNumber}\n </Text>\n </View>\n </View>\n <View style={styles.accentBlock}>\n <View style={styles.infoGrid}>\n <View style={styles.infoColumn}>\n <Text style={styles.sectionLabel} noMargin>\n Billed To\n </Text>\n <Text variant=\"sm\" weight=\"semibold\" noMargin>\n {data.billTo.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.address}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.email} · {data.billTo.phone}\n </Text>\n </View>\n <View style={styles.infoColumn}>\n <Text style={styles.sectionLabel} noMargin>\n Invoice Info\n </Text>\n <KeyValue\n size=\"sm\"\n items={[\n { key: \"Issue Date\", value: data.invoiceDate },\n { key: \"Due Date\", value: data.dueDate },\n { key: \"Payment\", value: data.paymentTerms.method },\n ]}\n />\n </View>\n </View>\n </View>\n <Table variant=\"striped\" zebraStripe>\n <TableHeader>\n <TableRow header>\n <TableCell>Deliverable</TableCell>\n <TableCell align=\"center\">Qty</TableCell>\n <TableCell align=\"right\">Rate</TableCell>\n <TableCell align=\"right\">Amount</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF list, no reordering\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"right\">{`$${item.unitPrice.toLocaleString()}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toLocaleString()}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={styles.summarySection}>\n <View style={styles.summaryLeft}>\n <Text style={styles.sectionLabel} noMargin>\n Notes & Terms\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\">\n {data.notes}\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" style={{ marginTop: 4 }}>\n GST: {data.paymentTerms.gst}\n </Text>\n </View>\n <View style={styles.summaryRight}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toLocaleString()}`,\n },\n { key: \"Tax (6.5%)\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Total\",\n keyStyle: { fontSize: 13, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: {\n color: theme.colors.accent,\n fontSize: 14,\n fontWeight: \"bold\",\n },\n },\n ]}\n divided\n />\n </View>\n </Section>\n <PageFooter\n variant=\"centered\"\n centerText=\"Thank you for choosing us for your creative needs!\"\n sticky\n pagePadding={25}\n />\n </Page>\n </Document>\n );\n}\n",- "type": "registry:block"+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { InvoiceCreativeData } from \"./invoice-creative.types\";\n\nconst sampleData: InvoiceCreativeData = {\n billTo: {\n address: \"250 Design District, Loft 5\",\n email: \"[email protected]\",\n name: \"Creative Agency Co.\",\n phone: \"+1 (555) 321-7654\",\n },\n companyAddress: \"City, Country · [email protected]\",\n companyName: \"Your Agency\",\n dueDate: \"March 26, 2026\",\n invoiceDate: \"February 24, 2026\",\n invoiceNumber: \"INV-2026-005\",\n items: [\n { description: \"Brand Identity Design\", quantity: 1, unitPrice: 8500 },\n {\n description: \"Marketing Collateral Package\",\n quantity: 1,\n unitPrice: 4200,\n },\n {\n description: \"Social Media Assets (per set)\",\n quantity: 4,\n unitPrice: 750,\n },\n { description: \"Motion Graphics (30s)\", quantity: 2, unitPrice: 3500 },\n ],\n notes:\n \"Creative work is protected under copyright. Full usage rights transfer upon payment.\",\n paymentTerms: {\n dueDate: \"March 26, 2026\",\n gst: \"GSTIN 456789123\",\n method: \"Credit Card / PayPal / Stripe\",\n },\n subtitle: \"Creative Services\",\n summary: {\n subtotal: 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 padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n sectionLabel: {\n color: theme.colors.accent,\n fontSize: 8,\n fontWeight: \"bold\",\n letterSpacing: 0.8,\n marginBottom: 6,\n textTransform: \"uppercase\",\n },\n summaryLeft: {\n flex: 1,\n paddingRight: 20,\n },\n summaryRight: {\n backgroundColor: theme.colors.muted,\n borderRadius: theme.primitives.borderRadius.sm,\n padding: 14,\n width: 240,\n },\n summarySection: {\n flexDirection: \"row\",\n marginTop: 24,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" style={styles.page}>\n <View style={styles.heroSection}>\n <View style={{ flex: 1 }}>\n <PageHeader\n variant=\"centered\"\n title={data.companyName}\n subtitle={`${data.subtitle} · ${data.companyAddress}`}\n marginBottom={0}\n />\n </View>\n <View style={styles.invoiceBadge}>\n <Text style={styles.badgeLabel} noMargin>\n Invoice\n </Text>\n <Text style={styles.badgeNumber} noMargin>\n {data.invoiceNumber}\n </Text>\n </View>\n </View>\n <View style={styles.accentBlock}>\n <View style={styles.infoGrid}>\n <View style={styles.infoColumn}>\n <Text style={styles.sectionLabel} noMargin>\n Billed To\n </Text>\n <Text variant=\"sm\" weight=\"semibold\" noMargin>\n {data.billTo.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.address}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.email} · {data.billTo.phone}\n </Text>\n </View>\n <View style={styles.infoColumn}>\n <Text style={styles.sectionLabel} noMargin>\n Invoice Info\n </Text>\n <KeyValue\n size=\"sm\"\n items={[\n { key: \"Issue Date\", value: data.invoiceDate },\n { key: \"Due Date\", value: data.dueDate },\n { key: \"Payment\", value: data.paymentTerms.method },\n ]}\n />\n </View>\n </View>\n </View>\n <Table variant=\"striped\" zebraStripe>\n <TableHeader>\n <TableRow header>\n <TableCell>Deliverable</TableCell>\n <TableCell align=\"center\">Qty</TableCell>\n <TableCell align=\"right\">Rate</TableCell>\n <TableCell align=\"right\">Amount</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static PDF list, no reordering\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"right\">{`$${item.unitPrice.toLocaleString()}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toLocaleString()}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={styles.summarySection}>\n <View style={styles.summaryLeft}>\n <Text style={styles.sectionLabel} noMargin>\n Notes & Terms\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\">\n {data.notes}\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" style={{ marginTop: 4 }}>\n GST: {data.paymentTerms.gst}\n </Text>\n </View>\n <View style={styles.summaryRight}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toLocaleString()}`,\n },\n { key: \"Tax (6.5%)\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Total\",\n keyStyle: { fontSize: 13, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: {\n color: theme.colors.accent,\n fontSize: 14,\n fontWeight: \"bold\",\n },\n },\n ]}\n divided\n />\n </View>\n </Section>\n <PageFooter\n variant=\"centered\"\n centerText=\"Thank you for choosing us for your creative needs!\"\n sticky\n pagePadding={25}\n />\n </Page>\n </Document>\n );\n};\n\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"},{"path": "registry/bases/takumi/blocks/invoice-creative/invoice-creative.types.ts","content": "export interface InvoiceCreativeData {\n invoiceNumber: string;\n invoiceDate: string;\n dueDate: string;\n companyName: string;\n subtitle: string;\n companyAddress: string;\n billTo: {\n name: string;\n address: string;\n email: string;\n phone: string;\n };\n items: {\n description: string;\n quantity: number;\n unitPrice: number;\n }[];\n summary: {\n subtotal: number;\n tax: number;\n total: number;\n };\n paymentTerms: {\n dueDate: string;\n method: string;\n gst: string;\n };\n notes?: string;\n}\n",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-creative/invoice-creative.types.ts"}],"type": "registry:block"diff --git a/public/r/takumi/invoice-minimal.json b/public/r/takumi/invoice-minimal.jsonindex bff9aeb..703cf99 100644--- a/public/r/takumi/invoice-minimal.json+++ b/public/r/takumi/invoice-minimal.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.tsx",- "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { InvoiceMinimalData } from \"./invoice-minimal.types\";\n\n// Sample data — replace with your own props or data source\nconst sampleData: InvoiceMinimalData = {\n billTo: {\n address: \"500 Enterprise Way, Building A\",\n email: \"[email protected]\",\n name: \"Enterprise Corp\",\n phone: \"+1 (555) 246-8135\",\n },\n companyAddress: \"City, Country\",\n companyEmail: \"[email protected]\",\n companyName: \"Your Company\",\n dueDate: \"March 22, 2026\",\n invoiceDate: \"February 20, 2026\",\n invoiceNumber: \"INV-2026-003\",\n items: [\n { description: \"Annual Licenselan\", quantity: 1, unitPrice: 25000 },\n { description: \"Support & Maintenance\", quantity: 12, unitPrice: 1500 },\n { description: \"Custom Integration\", quantity: 1, unitPrice: 12000 },\n ],\n notes:\n \"Invoice for annual enterprise subscription. Please retain for your records.\",\n paymentTerms: {\n dueDate: \"March 22, 2026\",\n gst: \"GSTIN 123456789\",\n method: \"ACH Transfer / Check\",\n },\n subtitle: \"Professional Services\",\n summary: {\n subtotal: 55000,\n tax: 3850,\n total: 58850,\n },\n};\n\nexport function InvoiceMinimalDocument({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceMinimalData;\n}) {\n return (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceMinimalContent data={data} />\n </PdfcnThemeProvider>\n );\n}\n\nfunction InvoiceMinimalContent({ data }: { data: InvoiceMinimalData }) {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n infoLabel: {\n color: theme.colors.primary,\n fontSize: 8,\n fontWeight: \"bold\",\n letterSpacing: 0.8,\n marginBottom: 4,\n textTransform: \"uppercase\",\n },\n infoRow: {\n flexDirection: \"row\",\n marginBottom: theme.spacing.sectionGap,\n },\n invoiceStamp: {\n alignSelf: \"flex-start\",\n borderColor: theme.colors.primary,\n borderRadius: theme.primitives.borderRadius.sm,\n borderStyle: \"solid\",\n borderWidth: 2,\n paddingHorizontal: 12,\n paddingVertical: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" style={styles.page}>\n <Section\n noWrap\n style={{\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n marginBottom: theme.spacing.sectionGap,\n }}\n >\n <View style={{ flex: 1 }}>\n <PageHeader\n variant=\"minimal\"\n title={data.companyName}\n subtitle={`${data.companyAddress} · ${data.companyEmail}`}\n marginBottom={0}\n />\n </View>\n <View style={styles.invoiceStamp}>\n <Text\n style={{\n color: theme.colors.primary,\n fontSize: 7,\n fontWeight: \"bold\",\n textAlign: \"right\",\n }}\n noMargin\n transform=\"uppercase\"\n >\n Invoice\n </Text>\n <Text\n style={{\n color: theme.colors.foreground,\n fontSize: 14,\n fontWeight: \"bold\",\n textAlign: \"right\",\n }}\n noMargin\n >\n {data.invoiceNumber}\n </Text>\n <Text\n style={{\n color: theme.colors.mutedForeground,\n fontSize: 8,\n textAlign: \"right\",\n }}\n noMargin\n >\n {data.invoiceDate}\n </Text>\n </View>\n </Section>\n <View style={styles.infoRow}>\n <View style={{ flex: 1, paddingRight: 20 }}>\n <Text style={styles.infoLabel} noMargin>\n Bill To\n </Text>\n <Text variant=\"sm\" noMargin>\n {data.billTo.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.address}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.email}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.phone}\n </Text>\n </View>\n <View style={{ flex: 1 }}>\n <Text style={styles.infoLabel} noMargin>\n Invoice Details\n </Text>\n <KeyValue\n size=\"sm\"\n items={[\n { key: \"Due Date\", value: data.dueDate },\n { key: \"Payment\", value: data.paymentTerms.method },\n { key: \"GST\", value: data.paymentTerms.gst },\n ]}\n />\n </View>\n </View>\n <Table variant=\"compact\">\n <TableHeader>\n <TableRow header>\n <TableCell>Description</TableCell>\n <TableCell align=\"center\">Qty</TableCell>\n <TableCell align=\"right\">Rate</TableCell>\n <TableCell align=\"right\">Total</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: invoice items have no stable id\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"right\">{`$${item.unitPrice.toLocaleString()}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toFixed(2)}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={{ flexDirection: \"row\", marginTop: 20 }}>\n <View style={{ flex: 1 }} />\n <View style={{ width: 240 }}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toFixed(2)}`,\n },\n { key: \"Tax (7%)\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Balance Due\",\n keyStyle: { fontSize: 12, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: {\n color: theme.colors.primary,\n fontSize: 13,\n fontWeight: \"bold\",\n },\n },\n ]}\n divided\n />\n </View>\n </Section>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </Page>\n </Document>\n );\n}\n",- "type": "registry:block"+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { InvoiceMinimalData } from \"./invoice-minimal.types\";\n\n// Sample data — replace with your own props or data source\nconst sampleData: InvoiceMinimalData = {\n billTo: {\n address: \"500 Enterprise Way, Building A\",\n email: \"[email protected]\",\n name: \"Enterprise Corp\",\n phone: \"+1 (555) 246-8135\",\n },\n companyAddress: \"City, Country\",\n companyEmail: \"[email protected]\",\n companyName: \"Your Company\",\n dueDate: \"March 22, 2026\",\n invoiceDate: \"February 20, 2026\",\n invoiceNumber: \"INV-2026-003\",\n items: [\n { description: \"Annual Licenselan\", quantity: 1, unitPrice: 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: \"Professional Services\",\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 padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" style={styles.page}>\n <Section\n noWrap\n style={{\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n marginBottom: theme.spacing.sectionGap,\n }}\n >\n <View style={{ flex: 1 }}>\n <PageHeader\n variant=\"minimal\"\n title={data.companyName}\n subtitle={`${data.companyAddress} · ${data.companyEmail}`}\n marginBottom={0}\n />\n </View>\n <View style={styles.invoiceStamp}>\n <Text\n style={{\n color: theme.colors.primary,\n fontSize: 7,\n fontWeight: \"bold\",\n textAlign: \"right\",\n }}\n noMargin\n transform=\"uppercase\"\n >\n Invoice\n </Text>\n <Text\n style={{\n color: theme.colors.foreground,\n fontSize: 14,\n fontWeight: \"bold\",\n textAlign: \"right\",\n }}\n noMargin\n >\n {data.invoiceNumber}\n </Text>\n <Text\n style={{\n color: theme.colors.mutedForeground,\n fontSize: 8,\n textAlign: \"right\",\n }}\n noMargin\n >\n {data.invoiceDate}\n </Text>\n </View>\n </Section>\n <View style={styles.infoRow}>\n <View style={{ flex: 1, paddingRight: 20 }}>\n <Text style={styles.infoLabel} noMargin>\n Bill To\n </Text>\n <Text variant=\"sm\" noMargin>\n {data.billTo.name}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.address}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.email}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.billTo.phone}\n </Text>\n </View>\n <View style={{ flex: 1 }}>\n <Text style={styles.infoLabel} noMargin>\n Invoice Details\n </Text>\n <KeyValue\n size=\"sm\"\n items={[\n { key: \"Due Date\", value: data.dueDate },\n { key: \"Payment\", value: data.paymentTerms.method },\n { key: \"GST\", value: data.paymentTerms.gst },\n ]}\n />\n </View>\n </View>\n <Table variant=\"compact\">\n <TableHeader>\n <TableRow header>\n <TableCell>Description</TableCell>\n <TableCell align=\"center\">Qty</TableCell>\n <TableCell align=\"right\">Rate</TableCell>\n <TableCell align=\"right\">Total</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: invoice items have no stable id\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"right\">{`$${item.unitPrice.toLocaleString()}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toFixed(2)}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={{ flexDirection: \"row\", marginTop: 20 }}>\n <View style={{ flex: 1 }} />\n <View style={{ width: 240 }}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toFixed(2)}`,\n },\n { key: \"Tax (7%)\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Balance Due\",\n keyStyle: { fontSize: 12, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: {\n color: theme.colors.primary,\n fontSize: 13,\n fontWeight: \"bold\",\n },\n },\n ]}\n divided\n />\n </View>\n </Section>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </Page>\n </Document>\n );\n};\n\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"},{"path": "registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.types.ts","content": "export interface InvoiceMinimalData {\n invoiceNumber: string;\n invoiceDate: string;\n dueDate: string;\n companyName: string;\n subtitle: string;\n companyAddress: string;\n companyEmail: string;\n billTo: {\n name: string;\n address: string;\n email: string;\n phone: string;\n };\n items: {\n description: string;\n quantity: number;\n unitPrice: number;\n }[];\n summary: {\n subtotal: number;\n tax: number;\n total: number;\n };\n paymentTerms: {\n dueDate: string;\n method: string;\n gst: string;\n };\n notes?: string;\n}\n",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-minimal/invoice-minimal.types.ts"}],"type": "registry:block"diff --git a/public/r/takumi/invoice-modern.json b/public/r/takumi/invoice-modern.jsonindex 4a0bf77..10d7ddc 100644--- a/public/r/takumi/invoice-modern.json+++ b/public/r/takumi/invoice-modern.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/takumi/blocks/invoice-modern/invoice-modern.tsx",- "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { InvoiceModernData } from \"./invoice-modern.types\";\n\n// Sample data — replace with your own props or data source\nconst sampleData: InvoiceModernData = {\n billTo: {\n address: \"789 Innovation Blvd, Floor 3\",\n email: \"[email protected]\",\n name: \"TechStart Solutions\",\n phone: \"+1 (555) 987-6543\",\n },\n companyAddress: \"City, Country\",\n companyEmail: \"[email protected]\",\n companyName: \"Your Company\",\n dueDate: \"March 20, 2026\",\n invoiceDate: \"February 18, 2026\",\n invoiceNumber: \"INV-2026-002\",\n items: [\n { description: \"API Integration\", quantity: 1, unitPrice: 15000 },\n { description: \"SEO\", quantity: 2, unitPrice: 5500 },\n { description: \"Security Audit\", quantity: 1, unitPrice: 7200 },\n ],\n notes: \"Payment terms: Net 30 days. Thank you for your business!\",\n paymentTerms: {\n dueDate: \"March 20, 2026\",\n gst: \"GSTIN 123456789\",\n method: \"Wire Transfer / Bank Account\",\n },\n subtitle: \"Professional Services\",\n summary: {\n subtotal: 33200,\n tax: 2324,\n total: 35524,\n },\n};\n\nexport function InvoiceModernDocument({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: InvoiceModernData;\n}) {\n return (\n <PdfcnThemeProvider theme={theme}>\n <InvoiceModernContent data={data} />\n </PdfcnThemeProvider>\n );\n}\n\nfunction InvoiceModernContent({ data }: { data: InvoiceModernData }) {\n const theme = usePdfcnTheme();\n\n const styles = StyleSheet.create({\n dividerCol: {\n backgroundColor: theme.colors.border,\n marginRight: 12,\n width: 1,\n },\n metaCol: {\n flex: 1,\n paddingRight: 12,\n },\n metaLabel: {\n color: theme.colors.mutedForeground,\n fontSize: 8,\n fontWeight: \"bold\",\n letterSpacing: 0.5,\n marginBottom: 3,\n textTransform: \"uppercase\",\n },\n metaRow: {\n flexDirection: \"row\",\n marginBottom: theme.spacing.sectionGap,\n },\n metaValue: {\n color: theme.colors.foreground,\n fontSize: 9,\n },\n page: {\n backgroundColor: theme.colors.background,\n padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" style={styles.page}>\n <PageHeader\n variant=\"branded\"\n title={data.companyName}\n subtitle={`${data.subtitle} · ${data.companyAddress} · ${data.companyEmail}`}\n />\n <View style={styles.metaRow}>\n <View style={styles.metaCol}>\n <Text style={styles.metaLabel} noMargin>\n Invoice Number\n </Text>\n <Text\n style={{ ...styles.metaValue, fontSize: 11, fontWeight: \"bold\" }}\n noMargin\n >\n {data.invoiceNumber}\n </Text>\n </View>\n <View style={styles.metaCol}>\n <Text style={styles.metaLabel} noMargin>\n Invoice Date\n </Text>\n <Text style={styles.metaValue} noMargin>\n {data.invoiceDate}\n </Text>\n </View>\n <View style={styles.metaCol}>\n <Text style={styles.metaLabel} noMargin>\n Due Date\n </Text>\n <Text style={styles.metaValue} noMargin>\n {data.dueDate}\n </Text>\n </View>\n <View style={styles.dividerCol} />\n <View style={{ flex: 2 }}>\n <Text style={styles.metaLabel} noMargin>\n Billed To\n </Text>\n <Text style={{ ...styles.metaValue, fontWeight: \"bold\" }} noMargin>\n {data.billTo.name}\n </Text>\n <Text\n style={{\n ...styles.metaValue,\n color: theme.colors.mutedForeground,\n }}\n noMargin\n >\n {data.billTo.address}\n </Text>\n <Text\n style={{\n ...styles.metaValue,\n color: theme.colors.mutedForeground,\n }}\n noMargin\n >\n {data.billTo.email}\n </Text>\n <Text\n style={{\n ...styles.metaValue,\n color: theme.colors.mutedForeground,\n }}\n noMargin\n >\n {data.billTo.phone}\n </Text>\n </View>\n </View>\n <Table variant=\"primary-header\">\n <TableHeader>\n <TableRow header>\n <TableCell>Description</TableCell>\n <TableCell align=\"center\">Qty</TableCell>\n <TableCell align=\"right\">Unit Price</TableCell>\n <TableCell align=\"right\">Amount</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: invoice items have no stable id\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"right\">{`$${item.unitPrice.toLocaleString()}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toFixed(2)}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={{ flexDirection: \"row\", marginTop: 16 }}>\n <View style={{ flex: 1, paddingRight: 20 }}>\n <Text style={styles.metaLabel} noMargin>\n Payment Method\n </Text>\n <Text variant=\"xs\" noMargin>\n {data.paymentTerms.method}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.paymentTerms.gst}\n </Text>\n </View>\n <View style={{ width: 220 }}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toFixed(2)}`,\n },\n { key: \"Tax (7%)\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Total Due\",\n keyStyle: { fontSize: 12, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: { fontSize: 12, fontWeight: \"bold\" },\n },\n ]}\n divided\n />\n </View>\n </Section>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </Page>\n </Document>\n );\n}\n",- "type": "registry:block"+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n KeyValue,\n PageFooter,\n PageHeader,\n PdfcnThemeProvider,\n Section,\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { InvoiceModernData } from \"./invoice-modern.types\";\n\n// Sample data — replace with your own props or data source\nconst sampleData: InvoiceModernData = {\n billTo: {\n address: \"789 Innovation Blvd, Floor 3\",\n email: \"[email protected]\",\n name: \"TechStart Solutions\",\n phone: \"+1 (555) 987-6543\",\n },\n companyAddress: \"City, Country\",\n companyEmail: \"[email protected]\",\n companyName: \"Your Company\",\n dueDate: \"March 20, 2026\",\n invoiceDate: \"February 18, 2026\",\n invoiceNumber: \"INV-2026-002\",\n items: [\n { description: \"API Integration\", quantity: 1, unitPrice: 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: \"Professional Services\",\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 padding: theme.spacing.page.marginTop,\n paddingBottom: theme.spacing.page.marginBottom,\n },\n });\n\n return (\n <Document title={`Invoice ${data.invoiceNumber}`}>\n <Page size=\"A4\" style={styles.page}>\n <PageHeader\n variant=\"branded\"\n title={data.companyName}\n subtitle={`${data.subtitle} · ${data.companyAddress} · ${data.companyEmail}`}\n />\n <View style={styles.metaRow}>\n <View style={styles.metaCol}>\n <Text style={styles.metaLabel} noMargin>\n Invoice Number\n </Text>\n <Text\n style={{ ...styles.metaValue, fontSize: 11, fontWeight: \"bold\" }}\n noMargin\n >\n {data.invoiceNumber}\n </Text>\n </View>\n <View style={styles.metaCol}>\n <Text style={styles.metaLabel} noMargin>\n Invoice Date\n </Text>\n <Text style={styles.metaValue} noMargin>\n {data.invoiceDate}\n </Text>\n </View>\n <View style={styles.metaCol}>\n <Text style={styles.metaLabel} noMargin>\n Due Date\n </Text>\n <Text style={styles.metaValue} noMargin>\n {data.dueDate}\n </Text>\n </View>\n <View style={styles.dividerCol} />\n <View style={{ flex: 2 }}>\n <Text style={styles.metaLabel} noMargin>\n Billed To\n </Text>\n <Text style={{ ...styles.metaValue, fontWeight: \"bold\" }} noMargin>\n {data.billTo.name}\n </Text>\n <Text\n style={{\n ...styles.metaValue,\n color: theme.colors.mutedForeground,\n }}\n noMargin\n >\n {data.billTo.address}\n </Text>\n <Text\n style={{\n ...styles.metaValue,\n color: theme.colors.mutedForeground,\n }}\n noMargin\n >\n {data.billTo.email}\n </Text>\n <Text\n style={{\n ...styles.metaValue,\n color: theme.colors.mutedForeground,\n }}\n noMargin\n >\n {data.billTo.phone}\n </Text>\n </View>\n </View>\n <Table variant=\"primary-header\">\n <TableHeader>\n <TableRow header>\n <TableCell>Description</TableCell>\n <TableCell align=\"center\">Qty</TableCell>\n <TableCell align=\"right\">Unit Price</TableCell>\n <TableCell align=\"right\">Amount</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.items.map((item, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: invoice items have no stable id\n <TableRow key={index}>\n <TableCell>{item.description}</TableCell>\n <TableCell align=\"center\">{`${item.quantity}`}</TableCell>\n <TableCell align=\"right\">{`$${item.unitPrice.toLocaleString()}`}</TableCell>\n <TableCell align=\"right\">{`$${(item.quantity * item.unitPrice).toFixed(2)}`}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n <Section noWrap style={{ flexDirection: \"row\", marginTop: 16 }}>\n <View style={{ flex: 1, paddingRight: 20 }}>\n <Text style={styles.metaLabel} noMargin>\n Payment Method\n </Text>\n <Text variant=\"xs\" noMargin>\n {data.paymentTerms.method}\n </Text>\n <Text variant=\"xs\" noMargin color=\"mutedForeground\">\n {data.paymentTerms.gst}\n </Text>\n </View>\n <View style={{ width: 220 }}>\n <KeyValue\n size=\"sm\"\n dividerThickness={1}\n items={[\n {\n key: \"Subtotal\",\n value: `$${data.summary.subtotal.toFixed(2)}`,\n },\n { key: \"Tax (7%)\", value: `$${data.summary.tax.toFixed(2)}` },\n {\n key: \"Total Due\",\n keyStyle: { fontSize: 12, fontWeight: \"bold\" },\n value: `$${data.summary.total.toFixed(2)}`,\n valueStyle: { fontSize: 12, fontWeight: \"bold\" },\n },\n ]}\n divided\n />\n </View>\n </Section>\n <PageFooter\n leftText={data.notes}\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={25}\n />\n </Page>\n </Document>\n );\n};\n\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"},{"path": "registry/bases/takumi/blocks/invoice-modern/invoice-modern.types.ts","content": "export interface InvoiceModernData {\n invoiceNumber: string;\n invoiceDate: string;\n dueDate: string;\n companyName: string;\n subtitle: string;\n companyAddress: string;\n companyEmail: string;\n billTo: {\n name: string;\n address: string;\n email: string;\n phone: string;\n };\n items: {\n description: string;\n quantity: number;\n unitPrice: number;\n }[];\n summary: {\n subtotal: number;\n tax: number;\n total: number;\n };\n paymentTerms: {\n dueDate: string;\n method: string;\n gst: string;\n };\n notes?: string;\n}\n",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-modern/invoice-modern.types.ts"}],"type": "registry:block"diff --git a/public/r/takumi/keep-together.json b/public/r/takumi/keep-together.jsonindex 69f180a..b78f901 100644--- a/public/r/takumi/keep-together.json+++ b/public/r/takumi/keep-together.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/takumi/components/keep-together/keep-together.tsx",- "content": "import type { ReactNode } from \"react\";\n\nimport type { Style } from \"@/registry/themes\";\n\nimport { View } from \"../../lib/takumi-primitives\";\n\nexport interface KeepTogetherProps {\n children?: ReactNode;\n minPresenceAhead?: number;\n style?: Style;\n}\n\nexport function KeepTogether({ children, style }: KeepTogetherProps) {\n return (\n <View style={[{ breakInside: \"avoid\" }, style].filter(Boolean) as never}>\n {children}\n </View>\n );\n}\n",- "type": "registry:component"+ "content": "import type { ReactNode } from \"react\";\n\nimport type { Style } from \"@/registry/themes\";\n\nimport { View } from \"../../lib/takumi-primitives\";\n\nexport interface KeepTogetherProps {\n children?: ReactNode;\n minPresenceAhead?: number;\n style?: Style;\n}\n\nexport const KeepTogether = ({ children, style }: KeepTogetherProps) => (\n <View style={[{ breakInside: \"avoid\" }, style].filter(Boolean) as never}>\n {children}\n </View>\n);\n",+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/keep-together/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/key-value.json b/public/r/takumi/key-value.jsonindex 3415831..052e339 100644--- a/public/r/takumi/key-value.json+++ b/public/r/takumi/key-value.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/takumi/components/key-value/key-value.tsx",- "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type KeyValueDirection = \"horizontal\" | \"vertical\";\nexport type KeyValueSize = \"sm\" | \"md\" | \"lg\";\n\n/**\n * A single key-value row with optional per-item color and style overrides.\n * Props - `key` | `value` | `valueColor` | `valueStyle` | `keyStyle`\n * @see {@link KeyValueEntry}\n */\nexport interface KeyValueEntry {\n key: string;\n value: string;\n valueColor?: string;\n valueStyle?: Style;\n keyStyle?: Style;\n}\n\n/**\n * List of key-value pairs with layout and style options.\n * Props - `items` | `direction` | `divided` | `size` | `labelFlex` | `labelColor` | `valueColor` | `boldValue` | `noWrap` | `dividerColor` | `dividerThickness` | `dividerMargin` | `style`\n * @see {@link KeyValueProps}\n */\nexport interface KeyValueProps extends Omit<PDFComponentProps, \"children\"> {\n items: KeyValueEntry[];\n /**\n * @default 'horizontal'\n */\n direction?: KeyValueDirection;\n /**\n * @default false\n */\n divided?: boolean;\n /**\n * @default 'md'\n */\n size?: KeyValueSize;\n /**\n * @default 1\n */\n labelFlex?: number;\n labelColor?: string;\n valueColor?: string;\n /**\n * @default false\n */\n boldValue?: boolean;\n /**\n * @default false\n */\n noWrap?: boolean;\n dividerColor?: string;\n dividerThickness?: number;\n dividerMargin?: number;\n}\n\nfunction createKeyValueStyles(t: PdfcnTheme) {\n const { spacing, fontWeights } = t.primitives;\n const c = t.colors;\n const { body } = t.typography;\n const keyBase = {\n color: c.mutedForeground,\n fontFamily: body.fontFamily,\n fontWeight: fontWeights.medium,\n };\n const valueBase = {\n color: c.foreground,\n fontFamily: body.fontFamily,\n fontWeight: fontWeights.regular,\n };\n return StyleSheet.create({\n container: { flexDirection: \"column\" },\n divider: {\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n },\n keyLg: { ...keyBase, fontSize: t.primitives.typography.base },\n keyMd: { ...keyBase, fontSize: body.fontSize },\n keySm: { ...keyBase, fontSize: t.primitives.typography.xs },\n rowHorizontal: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n paddingVertical: spacing[1],\n },\n rowVertical: {\n flexDirection: \"column\",\n marginBottom: t.spacing.paragraphGap,\n },\n valueBold: { fontWeight: fontWeights.bold },\n valueLg: { ...valueBase, fontSize: t.primitives.typography.base },\n valueMd: { ...valueBase, fontSize: body.fontSize },\n valueSm: { ...valueBase, fontSize: t.primitives.typography.xs },\n });\n}\n\nexport function KeyValue({\n items,\n direction = \"horizontal\",\n divided = false,\n size = \"md\",\n labelFlex = 1,\n labelColor,\n valueColor,\n boldValue = false,\n noWrap = false,\n dividerColor,\n dividerThickness,\n dividerMargin,\n style,\n}: KeyValueProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createKeyValueStyles(theme), [theme]);\n const keyStyleMap = {\n lg: styles.keyLg,\n md: styles.keyMd,\n sm: styles.keySm,\n } as Record<KeyValueSize, Style>;\n const valueStyleMap = {\n lg: styles.valueLg,\n md: styles.valueMd,\n sm: styles.valueSm,\n } as Record<KeyValueSize, Style>;\n const containerStyles: Style[] = [styles.container];\n if (style) {containerStyles.push(...[style].flat());}\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n {items.map((item, index) => {\n const isLast = index === items.length - 1;\n const keyStyles: Style[] = [keyStyleMap[size]];\n if (labelColor)\n {keyStyles.push({ color: resolveColor(labelColor, theme.colors) });}\n if (item.keyStyle) {keyStyles.push(item.keyStyle);}\n const valStyles: Style[] = [valueStyleMap[size]];\n if (boldValue) {valStyles.push(styles.valueBold);}\n const resolvedValueColor = item.valueColor ?? valueColor;\n if (resolvedValueColor)\n {valStyles.push({\n color: resolveColor(resolvedValueColor, theme.colors),\n });}\n if (item.valueStyle) {valStyles.push(item.valueStyle);}\n\n if (direction === \"horizontal\") {\n const rowStyles: Style[] = [styles.rowHorizontal];\n if (divided && !isLast) {\n const dividerStyle: Style = {};\n if (dividerColor)\n {dividerStyle.borderBottomColor = resolveColor(\n dividerColor,\n theme.colors\n );}\n if (dividerThickness)\n {dividerStyle.borderBottomWidth = dividerThickness;}\n if (dividerMargin) {dividerStyle.marginBottom = dividerMargin;}\n rowStyles.push({ ...styles.divider, ...dividerStyle });\n }\n return (\n <View key={item.key} style={rowStyles}>\n <PDFText style={[...keyStyles, { flex: labelFlex }]}>\n {item.key}\n </PDFText>\n <PDFText style={[...valStyles, { flex: 1, textAlign: \"right\" }]}>\n {item.value}\n </PDFText>\n </View>\n );\n }\n\n const rowStyles: Style[] = [styles.rowVertical];\n if (divided && !isLast) {rowStyles.push(styles.divider);}\n return (\n <View key={item.key} style={rowStyles}>\n <PDFText style={keyStyles}>{item.key}</PDFText>\n <PDFText style={valStyles}>{item.value}</PDFText>\n </View>\n );\n })}\n </View>\n );\n}\n",- "type": "registry:component"+ "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type KeyValueDirection = \"horizontal\" | \"vertical\";\nexport type KeyValueSize = \"sm\" | \"md\" | \"lg\";\n\n/**\n * A single key-value row with optional per-item color and style overrides.\n * Props - `key` | `value` | `valueColor` | `valueStyle` | `keyStyle`\n * @see {@link KeyValueEntry}\n */\nexport interface KeyValueEntry {\n key: string;\n value: string;\n valueColor?: string;\n valueStyle?: Style;\n keyStyle?: Style;\n}\n\n/**\n * List of key-value pairs with layout and style options.\n * Props - `items` | `direction` | `divided` | `size` | `labelFlex` | `labelColor` | `valueColor` | `boldValue` | `noWrap` | `dividerColor` | `dividerThickness` | `dividerMargin` | `style`\n * @see {@link KeyValueProps}\n */\nexport interface KeyValueProps extends Omit<PDFComponentProps, \"children\"> {\n items: KeyValueEntry[];\n /**\n * @default 'horizontal'\n */\n direction?: KeyValueDirection;\n /**\n * @default false\n */\n divided?: boolean;\n /**\n * @default 'md'\n */\n size?: KeyValueSize;\n /**\n * @default 1\n */\n labelFlex?: number;\n labelColor?: string;\n valueColor?: string;\n /**\n * @default false\n */\n boldValue?: boolean;\n /**\n * @default false\n */\n noWrap?: boolean;\n dividerColor?: string;\n dividerThickness?: number;\n dividerMargin?: number;\n}\n\nconst createKeyValueStyles = (t: PdfcnTheme) => {\n const { spacing, fontWeights } = t.primitives;\n const c = t.colors;\n const { body } = t.typography;\n const keyBase = {\n color: c.mutedForeground,\n fontFamily: body.fontFamily,\n fontWeight: fontWeights.medium,\n };\n const valueBase = {\n color: c.foreground,\n fontFamily: body.fontFamily,\n fontWeight: fontWeights.regular,\n };\n return StyleSheet.create({\n container: { flexDirection: \"column\" },\n divider: {\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n },\n keyLg: { ...keyBase, fontSize: t.primitives.typography.base },\n keyMd: { ...keyBase, fontSize: body.fontSize },\n keySm: { ...keyBase, fontSize: t.primitives.typography.xs },\n rowHorizontal: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n paddingVertical: spacing[1],\n },\n rowVertical: {\n flexDirection: \"column\",\n marginBottom: t.spacing.paragraphGap,\n },\n valueBold: { fontWeight: fontWeights.bold },\n valueLg: { ...valueBase, fontSize: t.primitives.typography.base },\n valueMd: { ...valueBase, fontSize: body.fontSize },\n valueSm: { ...valueBase, fontSize: t.primitives.typography.xs },\n });\n};\n\nexport const KeyValue = ({\n items,\n direction = \"horizontal\",\n divided = false,\n size = \"md\",\n labelFlex = 1,\n labelColor,\n valueColor,\n boldValue = false,\n noWrap = false,\n dividerColor,\n dividerThickness,\n dividerMargin,\n style,\n}: KeyValueProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createKeyValueStyles(theme), [theme]);\n const keyStyleMap = {\n lg: styles.keyLg,\n md: styles.keyMd,\n sm: styles.keySm,\n } as Record<KeyValueSize, Style>;\n const valueStyleMap = {\n lg: styles.valueLg,\n md: styles.valueMd,\n sm: styles.valueSm,\n } as Record<KeyValueSize, Style>;\n const containerStyles: Style[] = [styles.container];\n if (style) {\n containerStyles.push(...[style].flat());\n }\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n {items.map((item, index) => {\n const isLast = index === items.length - 1;\n const keyStyles: Style[] = [keyStyleMap[size]];\n if (labelColor) {\n keyStyles.push({ color: resolveColor(labelColor, theme.colors) });\n }\n if (item.keyStyle) {\n keyStyles.push(item.keyStyle);\n }\n const valStyles: Style[] = [valueStyleMap[size]];\n if (boldValue) {\n valStyles.push(styles.valueBold);\n }\n const resolvedValueColor = item.valueColor ?? valueColor;\n if (resolvedValueColor) {\n valStyles.push({\n color: resolveColor(resolvedValueColor, theme.colors),\n });\n }\n if (item.valueStyle) {\n valStyles.push(item.valueStyle);\n }\n\n if (direction === \"horizontal\") {\n const rowStyles: Style[] = [styles.rowHorizontal];\n if (divided && !isLast) {\n const dividerStyle: Style = {};\n if (dividerColor) {\n dividerStyle.borderBottomColor = resolveColor(\n dividerColor,\n theme.colors\n );\n }\n if (dividerThickness) {\n dividerStyle.borderBottomWidth = dividerThickness;\n }\n if (dividerMargin) {\n dividerStyle.marginBottom = dividerMargin;\n }\n rowStyles.push({ ...styles.divider, ...dividerStyle });\n }\n return (\n <View key={item.key} style={rowStyles}>\n <PDFText style={[...keyStyles, { flex: labelFlex }]}>\n {item.key}\n </PDFText>\n <PDFText style={[...valStyles, { flex: 1, textAlign: \"right\" }]}>\n {item.value}\n </PDFText>\n </View>\n );\n }\n\n const rowStyles: Style[] = [styles.rowVertical];\n if (divided && !isLast) {\n rowStyles.push(styles.divider);\n }\n return (\n <View key={item.key} style={rowStyles}>\n <PDFText style={keyStyles}>{item.key}</PDFText>\n <PDFText style={valStyles}>{item.value}</PDFText>\n </View>\n );\n })}\n </View>\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/key-value/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/link.json b/public/r/takumi/link.jsonindex 879659f..86d5cbd 100644--- a/public/r/takumi/link.json+++ b/public/r/takumi/link.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/takumi/components/link/link.tsx",- "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { StyleSheet, Link as PDFLink } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type LinkVariant = \"default\" | \"muted\" | \"primary\";\nexport type LinkUnderline = \"always\" | \"none\";\n\n/**\n * Clickable hyperlink for PDF documents.\n * Props - `href` | `children` | `align` | `color` | `variant` | `underline` | `style`\n * @see {@link LinkProps}\n */\nexport interface LinkProps extends PDFComponentProps {\n href: string;\n /**\n * @default 'left'\n */\n align?: \"left\" | \"center\" | \"right\";\n color?: string;\n /**\n * @default 'default'\n */\n variant?: LinkVariant;\n /**\n * @default 'always'\n */\n underline?: LinkUnderline;\n}\n\nfunction createLinkStyles(t: PdfcnTheme) {\n const { fontWeights } = t.primitives;\n const base = {\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n lineHeight: t.typography.body.lineHeight,\n marginBottom: t.spacing.paragraphGap,\n };\n return StyleSheet.create({\n default: {\n ...base,\n color: t.colors.accent,\n fontWeight: fontWeights.medium,\n textDecoration: \"underline\",\n },\n muted: {\n ...base,\n color: t.colors.mutedForeground,\n fontWeight: fontWeights.regular,\n textDecoration: \"underline\",\n },\n primary: {\n ...base,\n color: t.colors.primary,\n fontWeight: fontWeights.semibold,\n textDecoration: \"underline\",\n },\n underlineAlways: { textDecoration: \"underline\" },\n underlineNone: { textDecoration: \"none\" },\n });\n}\n\nexport function Link({\n href,\n align,\n color,\n variant = \"default\",\n underline,\n children,\n style,\n}: LinkProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createLinkStyles(theme), [theme]);\n const variantMap = {\n default: styles.default,\n muted: styles.muted,\n primary: styles.primary,\n };\n const underlineMap = {\n always: styles.underlineAlways,\n none: styles.underlineNone,\n };\n const styleArray: Style[] = [variantMap[variant]];\n if (underline && underline in underlineMap)\n {styleArray.push(underlineMap[underline]);}\n const semantic = {} as Style;\n if (align) {semantic.textAlign = align;}\n if (color) {semantic.color = resolveColor(color, theme.colors);}\n if (Object.keys(semantic).length > 0) {styleArray.push(semantic);}\n if (style) {styleArray.push(...[style].flat());}\n return (\n <PDFLink src={href} style={styleArray}>\n {children}\n </PDFLink>\n );\n}\n",- "type": "registry:component"+ "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { StyleSheet, Link as PDFLink } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type LinkVariant = \"default\" | \"muted\" | \"primary\";\nexport type LinkUnderline = \"always\" | \"none\";\n\n/**\n * Clickable hyperlink for PDF documents.\n * Props - `href` | `children` | `align` | `color` | `variant` | `underline` | `style`\n * @see {@link LinkProps}\n */\nexport interface LinkProps extends PDFComponentProps {\n href: string;\n /**\n * @default 'left'\n */\n align?: \"left\" | \"center\" | \"right\";\n color?: string;\n /**\n * @default 'default'\n */\n variant?: LinkVariant;\n /**\n * @default 'always'\n */\n underline?: LinkUnderline;\n}\n\nconst createLinkStyles = (t: PdfcnTheme) => {\n const { fontWeights } = t.primitives;\n const base = {\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n lineHeight: t.typography.body.lineHeight,\n marginBottom: t.spacing.paragraphGap,\n };\n return StyleSheet.create({\n default: {\n ...base,\n color: t.colors.accent,\n fontWeight: fontWeights.medium,\n textDecoration: \"underline\",\n },\n muted: {\n ...base,\n color: t.colors.mutedForeground,\n fontWeight: fontWeights.regular,\n textDecoration: \"underline\",\n },\n primary: {\n ...base,\n color: t.colors.primary,\n fontWeight: fontWeights.semibold,\n textDecoration: \"underline\",\n },\n underlineAlways: { textDecoration: \"underline\" },\n underlineNone: { textDecoration: \"none\" },\n });\n};\n\nexport const Link = ({\n href,\n align,\n color,\n variant = \"default\",\n underline,\n children,\n style,\n}: LinkProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createLinkStyles(theme), [theme]);\n const variantMap = {\n default: styles.default,\n muted: styles.muted,\n primary: styles.primary,\n };\n const underlineMap = {\n always: styles.underlineAlways,\n none: styles.underlineNone,\n };\n const styleArray: Style[] = [variantMap[variant]];\n if (underline && underline in underlineMap) {\n styleArray.push(underlineMap[underline]);\n }\n const semantic = {} as Style;\n if (align) {\n semantic.textAlign = align;\n }\n if (color) {\n semantic.color = resolveColor(color, theme.colors);\n }\n if (Object.keys(semantic).length > 0) {\n styleArray.push(semantic);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return (\n <PDFLink src={href} style={styleArray}>\n {children}\n </PDFLink>\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/link/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/list.json b/public/r/takumi/list.jsonindex 4356f8b..2359276 100644--- a/public/r/takumi/list.json+++ b/public/r/takumi/list.json@@ -13,23 +13,27 @@"files": [{"path": "registry/bases/takumi/components/list/list.styles.ts",- "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { StyleSheet } from \"../../lib/takumi-primitives\";\n\n/**\n * Creates all list styles derived from the active theme.\n * @param t - The resolved PdfcnTheme instance.\n */\nexport function createListStyles(t: PdfcnTheme) {\n const { borderRadius, spacing, fontWeights, typography } = t.primitives;\n\n return StyleSheet.create({\n checkBox: {\n alignItems: \"center\",\n backgroundColor: t.colors.background,\n borderColor: t.colors.border,\n borderRadius: 3,\n borderStyle: \"solid\",\n borderWidth: 1.5,\n height: spacing[4],\n justifyContent: \"center\",\n marginRight: spacing[2],\n width: spacing[4],\n },\n checkBoxChecked: {\n backgroundColor: t.colors.success,\n borderColor: t.colors.success,\n },\n checkMark: {\n color: t.colors.background,\n fontFamily: t.typography.body.fontFamily,\n fontSize: 8,\n fontWeight: fontWeights.bold,\n },\n childrenContainer: {\n display: \"flex\",\n flexDirection: \"column\",\n marginLeft: spacing[5],\n marginTop: spacing[1],\n },\n container: {\n display: \"flex\",\n flexDirection: \"column\",\n marginBottom: t.spacing.componentGap,\n width: \"100%\",\n },\n descriptiveAccent: {\n backgroundColor: t.colors.primary,\n borderRadius: borderRadius.sm,\n marginRight: spacing[3],\n minHeight: spacing[4],\n width: 3,\n },\n descriptiveContent: {\n flex: 1,\n },\n descriptiveDesc: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n lineHeight: t.typography.body.lineHeight,\n marginTop: 1,\n },\n descriptiveTitle: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: t.typography.body.lineHeight,\n },\n iconBox: {\n alignItems: \"center\",\n backgroundColor: t.colors.primary,\n borderRadius: borderRadius.md,\n height: spacing[5],\n justifyContent: \"center\",\n marginRight: spacing[2],\n width: spacing[5],\n },\n iconMark: {\n color: t.colors.primaryForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: 9,\n fontWeight: fontWeights.bold,\n },\n itemRow: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n },\n itemRowCenter: {\n alignItems: \"center\",\n flexDirection: \"row\",\n },\n itemRowGapMd: { marginBottom: spacing[3] },\n itemRowGapSm: { marginBottom: spacing[2] },\n itemRowGapXs: { marginBottom: spacing[1] },\n itemText: {\n // No flex here — Text nodes with flex shorthand get flexBasis:0, which causes\n // Yoga to under-measure multi-line text height → overlapping rows.\n // flex:1 must live on the wrapping View, not on the Text itself.\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n lineHeight: t.typography.body.lineHeight,\n },\n itemTextBold: {\n fontWeight: fontWeights.semibold,\n },\n itemTextSub: {\n // Same: no flex — see itemText comment.\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize - 0.5,\n lineHeight: t.typography.body.lineHeight,\n },\n itemTextWrap: {\n // Companion to itemText / itemTextSub. Apply this to the View that wraps\n // the Text so flex expansion happens at the View level, not the Text level.\n flex: 1,\n },\n markerBulletDot: {\n backgroundColor: t.colors.primary,\n borderRadius: 3,\n height: 5,\n width: 5,\n },\n markerBulletSubDot: {\n backgroundColor: \"transparent\",\n borderColor: t.colors.mutedForeground,\n borderRadius: 2,\n borderStyle: \"solid\",\n borderWidth: 1,\n height: 4,\n width: 4,\n },\n markerBulletSubWrap: {\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n marginTop: spacing[1],\n width: spacing[4],\n },\n markerBulletWrap: {\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n marginTop: spacing[1],\n width: spacing[4],\n },\n markerNumberBadge: {\n alignItems: \"center\",\n backgroundColor: t.colors.primary,\n borderRadius: spacing[5],\n height: spacing[5],\n justifyContent: \"center\",\n marginRight: spacing[2],\n width: spacing[5],\n },\n markerNumberText: {\n color: t.colors.primaryForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.bold,\n },\n });\n}\n",- "type": "registry:component"+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { StyleSheet } from \"../../lib/takumi-primitives\";\n\n/**\n * Creates all list styles derived from the active theme.\n * @param t - The resolved PdfcnTheme instance.\n */\nexport const createListStyles = (t: PdfcnTheme) => {\n const { borderRadius, spacing, fontWeights, typography } = t.primitives;\n\n return StyleSheet.create({\n checkBox: {\n alignItems: \"center\",\n backgroundColor: t.colors.background,\n borderColor: t.colors.border,\n borderRadius: 3,\n borderStyle: \"solid\",\n borderWidth: 1.5,\n height: spacing[4],\n justifyContent: \"center\",\n marginRight: spacing[2],\n width: spacing[4],\n },\n checkBoxChecked: {\n backgroundColor: t.colors.success,\n borderColor: t.colors.success,\n },\n checkMark: {\n color: t.colors.background,\n fontFamily: t.typography.body.fontFamily,\n fontSize: 8,\n fontWeight: fontWeights.bold,\n },\n childrenContainer: {\n display: \"flex\",\n flexDirection: \"column\",\n marginLeft: spacing[5],\n marginTop: spacing[1],\n },\n container: {\n display: \"flex\",\n flexDirection: \"column\",\n marginBottom: t.spacing.componentGap,\n width: \"100%\",\n },\n descriptiveAccent: {\n backgroundColor: t.colors.primary,\n borderRadius: borderRadius.sm,\n marginRight: spacing[3],\n minHeight: spacing[4],\n width: 3,\n },\n descriptiveContent: {\n flex: 1,\n },\n descriptiveDesc: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n lineHeight: t.typography.body.lineHeight,\n marginTop: 1,\n },\n descriptiveTitle: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: t.typography.body.lineHeight,\n },\n iconBox: {\n alignItems: \"center\",\n backgroundColor: t.colors.primary,\n borderRadius: borderRadius.md,\n height: spacing[5],\n justifyContent: \"center\",\n marginRight: spacing[2],\n width: spacing[5],\n },\n iconMark: {\n color: t.colors.primaryForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: 9,\n fontWeight: fontWeights.bold,\n },\n itemRow: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n },\n itemRowCenter: {\n alignItems: \"center\",\n flexDirection: \"row\",\n },\n itemRowGapMd: { marginBottom: spacing[3] },\n itemRowGapSm: { marginBottom: spacing[2] },\n itemRowGapXs: { marginBottom: spacing[1] },\n itemText: {\n // No flex here — Text nodes with flex shorthand get flexBasis:0, which causes\n // Yoga to under-measure multi-line text height → overlapping rows.\n // flex:1 must live on the wrapping View, not on the Text itself.\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n lineHeight: t.typography.body.lineHeight,\n },\n itemTextBold: {\n fontWeight: fontWeights.semibold,\n },\n itemTextSub: {\n // Same: no flex — see itemText comment.\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize - 0.5,\n lineHeight: t.typography.body.lineHeight,\n },\n itemTextWrap: {\n // Companion to itemText / itemTextSub. Apply this to the View that wraps\n // the Text so flex expansion happens at the View level, not the Text level.\n flex: 1,\n },\n markerBulletDot: {\n backgroundColor: t.colors.primary,\n borderRadius: 3,\n height: 5,\n width: 5,\n },\n markerBulletSubDot: {\n backgroundColor: \"transparent\",\n borderColor: t.colors.mutedForeground,\n borderRadius: 2,\n borderStyle: \"solid\",\n borderWidth: 1,\n height: 4,\n width: 4,\n },\n markerBulletSubWrap: {\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n marginTop: spacing[1],\n width: spacing[4],\n },\n markerBulletWrap: {\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n marginTop: spacing[1],\n width: spacing[4],\n },\n markerNumberBadge: {\n alignItems: \"center\",\n backgroundColor: t.colors.primary,\n borderRadius: spacing[5],\n height: spacing[5],\n justifyContent: \"center\",\n marginRight: spacing[2],\n width: spacing[5],\n },\n markerNumberText: {\n color: t.colors.primaryForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.bold,\n },\n });\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/list/list.styles.ts"},{"path": "registry/bases/takumi/components/list/list.tsx",- "content": "import type React from \"react\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, Text as PDFText } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\nimport { createListStyles } from \"./list.styles\";\nimport type { ListItem, ListVariant, PdfListProps } from \"./list.types\";\n\ntype Styles = ReturnType<typeof createListStyles>;\ntype GapProp = \"xs\" | \"sm\" | \"md\";\n\nfunction getGapStyle(gap: GapProp, styles: Styles): Style {\n if (gap === \"xs\") {return styles.itemRowGapXs;}\n if (gap === \"md\") {return styles.itemRowGapMd;}\n return styles.itemRowGapSm;\n}\n\nfunction buildRowStyles(\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles,\n align: \"start\" | \"center\" = \"start\"\n): Style[] {\n const row: Style[] = [\n align === \"center\" ? styles.itemRowCenter : styles.itemRow,\n ];\n if (index !== total - 1) {row.push(getGapStyle(gap, styles));}\n return row;\n}\n\n/** Bullet dot marker — solid filled for level 0, outline ring for nested levels. */\nfunction dotMarker(level: number, styles: Styles): React.ReactElement {\n return level === 0 ? (\n <View style={styles.markerBulletWrap}>\n <View style={styles.markerBulletDot} />\n </View>\n ) : (\n <View style={styles.markerBulletSubWrap}>\n <View style={styles.markerBulletSubDot} />\n </View>\n );\n}\n\nfunction renderBulletItem(\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles,\n level: number\n): React.ReactElement {\n return (\n <View key={index}>\n <View style={buildRowStyles(index, total, gap, styles)}>\n {dotMarker(level, styles)}\n {/* flex:1 on the View, NOT on the Text — avoids Yoga height underestimation\n for multi-line Text nodes that would cause overlapping rows. */}\n <View style={styles.itemTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n {item.children && item.children.length > 0\n ? renderItemList(item.children, \"bullet\", gap, styles, level + 1)\n : null}\n </View>\n );\n}\n\nfunction renderNumberedItem(\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement {\n return (\n <View\n key={index}\n style={buildRowStyles(index, total, gap, styles, \"center\")}\n >\n <View style={styles.markerNumberBadge}>\n <PDFText style={styles.markerNumberText}>{`${index + 1}`}</PDFText>\n </View>\n <View style={styles.itemTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n );\n}\n\nfunction renderChecklistItem(\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement {\n const isChecked = item.checked ?? true;\n return (\n <View\n key={index}\n style={buildRowStyles(index, total, gap, styles, \"center\")}\n >\n <View style={[styles.checkBox, isChecked ? styles.checkBoxChecked : {}]}>\n {isChecked ? <PDFText style={styles.checkMark}>✓</PDFText> : null}\n </View>\n <View style={styles.itemTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n );\n}\n\nfunction renderIconItem(\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement {\n return (\n <View\n key={index}\n style={buildRowStyles(index, total, gap, styles, \"center\")}\n >\n <View style={styles.iconBox}>\n <PDFText style={styles.iconMark}>★</PDFText>\n </View>\n <View style={styles.itemTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n );\n}\n\nfunction renderMultiLevelItem(\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles,\n level: number\n): React.ReactElement {\n return (\n <View key={index}>\n <View style={buildRowStyles(index, total, gap, styles)}>\n {dotMarker(level, styles)}\n <View style={styles.itemTextWrap}>\n <PDFText\n style={[\n level === 0 ? styles.itemText : styles.itemTextSub,\n level === 0 ? styles.itemTextBold : {},\n ]}\n >\n {item.text}\n </PDFText>\n </View>\n </View>\n {item.children && item.children.length > 0\n ? renderItemList(item.children, \"multi-level\", gap, styles, level + 1)\n : null}\n </View>\n );\n}\n\nfunction renderDescriptiveItem(\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement {\n return (\n <View key={index} style={buildRowStyles(index, total, gap, styles)}>\n <View style={styles.descriptiveAccent} />\n <View style={styles.descriptiveContent}>\n <PDFText style={styles.descriptiveTitle}>{item.text}</PDFText>\n {item.description ? (\n <PDFText style={styles.descriptiveDesc}>{item.description}</PDFText>\n ) : null}\n </View>\n </View>\n );\n}\n\nfunction renderItem(\n item: ListItem,\n index: number,\n total: number,\n variant: ListVariant,\n gap: GapProp,\n styles: Styles,\n level: number\n): React.ReactElement | null {\n switch (variant) {\n case \"bullet\": {\n return renderBulletItem(item, index, total, gap, styles, level);\n }\n case \"numbered\": {\n return renderNumberedItem(item, index, total, gap, styles);\n }\n case \"checklist\": {\n return renderChecklistItem(item, index, total, gap, styles);\n }\n case \"icon\": {\n return renderIconItem(item, index, total, gap, styles);\n }\n case \"multi-level\": {\n return renderMultiLevelItem(item, index, total, gap, styles, level);\n }\n case \"descriptive\": {\n return renderDescriptiveItem(item, index, total, gap, styles);\n }\n }\n}\n\nfunction renderItemList(\n items: ListItem[],\n variant: ListVariant,\n gap: GapProp,\n styles: Styles,\n level: number\n): React.ReactElement {\n return (\n <View style={level > 0 ? styles.childrenContainer : undefined}>\n {items.map((item, index) =>\n renderItem(item, index, items.length, variant, gap, styles, level)\n )}\n </View>\n );\n}\n\nexport function PdfList({\n items,\n variant = \"bullet\",\n gap = \"sm\",\n style,\n noWrap = false,\n _level = 0,\n}: PdfListProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createListStyles(theme), [theme]);\n\n const containerStyles: Style[] = [styles.container];\n if (_level > 0) {containerStyles.push(styles.childrenContainer);}\n const styleArray = style ? [...containerStyles, style] : containerStyles;\n\n return (\n <View wrap={!noWrap} style={styleArray}>\n {items.map((item, index) =>\n renderItem(item, index, items.length, variant, gap, styles, _level)\n )}\n </View>\n );\n}\n",- "type": "registry:component"+ "content": "import type React from \"react\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, Text as PDFText } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\nimport { createListStyles } from \"./list.styles\";\nimport type { ListItem, ListVariant, PdfListProps } from \"./list.types\";\n\ntype Styles = ReturnType<typeof createListStyles>;\ntype GapProp = \"xs\" | \"sm\" | \"md\";\n\nconst getGapStyle = (gap: GapProp, styles: Styles): Style => {\n if (gap === \"xs\") {\n return styles.itemRowGapXs;\n }\n if (gap === \"md\") {\n return styles.itemRowGapMd;\n }\n return styles.itemRowGapSm;\n};\n\nconst buildRowStyles = (\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles,\n align: \"start\" | \"center\" = \"start\"\n): Style[] => {\n const row: Style[] = [\n align === \"center\" ? styles.itemRowCenter : styles.itemRow,\n ];\n if (index !== total - 1) {\n row.push(getGapStyle(gap, styles));\n }\n return row;\n};\n\n/** Bullet dot marker — solid filled for level 0, outline ring for nested levels. */\nconst dotMarker = (level: number, styles: Styles): React.ReactElement =>\n level === 0 ? (\n <View style={styles.markerBulletWrap}>\n <View style={styles.markerBulletDot} />\n </View>\n ) : (\n <View style={styles.markerBulletSubWrap}>\n <View style={styles.markerBulletSubDot} />\n </View>\n );\n\n// eslint-disable-next-line no-use-before-define, prefer-const\nlet renderBulletItem: (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles,\n level: number\n) => React.ReactElement;\n// eslint-disable-next-line no-use-before-define, prefer-const\nlet renderMultiLevelItem: (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles,\n level: number\n) => React.ReactElement;\n\nconst renderNumberedItem = (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement => (\n <View key={index} style={buildRowStyles(index, total, gap, styles, \"center\")}>\n <View style={styles.markerNumberBadge}>\n <PDFText style={styles.markerNumberText}>{`${index + 1}`}</PDFText>\n </View>\n <View style={styles.itemTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n);\n\nconst renderChecklistItem = (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement => {\n const isChecked = item.checked ?? true;\n return (\n <View\n key={index}\n style={buildRowStyles(index, total, gap, styles, \"center\")}\n >\n <View style={[styles.checkBox, isChecked ? styles.checkBoxChecked : {}]}>\n {isChecked ? <PDFText style={styles.checkMark}>✓</PDFText> : null}\n </View>\n <View style={styles.itemTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n );\n};\n\nconst renderIconItem = (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement => (\n <View key={index} style={buildRowStyles(index, total, gap, styles, \"center\")}>\n <View style={styles.iconBox}>\n <PDFText style={styles.iconMark}>★</PDFText>\n </View>\n <View style={styles.itemTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n);\n\nconst renderDescriptiveItem = (\n item: ListItem,\n index: number,\n total: number,\n gap: GapProp,\n styles: Styles\n): React.ReactElement => (\n <View key={index} style={buildRowStyles(index, total, gap, styles)}>\n <View style={styles.descriptiveAccent} />\n <View style={styles.descriptiveContent}>\n <PDFText style={styles.descriptiveTitle}>{item.text}</PDFText>\n {item.description ? (\n <PDFText style={styles.descriptiveDesc}>{item.description}</PDFText>\n ) : null}\n </View>\n </View>\n);\n\nconst renderItem = (\n item: ListItem,\n index: number,\n total: number,\n variant: ListVariant,\n gap: GapProp,\n styles: Styles,\n level: number\n): React.ReactElement | null => {\n switch (variant) {\n case \"bullet\": {\n return renderBulletItem(item, index, total, gap, styles, level);\n }\n case \"numbered\": {\n return renderNumberedItem(item, index, total, gap, styles);\n }\n case \"checklist\": {\n return renderChecklistItem(item, index, total, gap, styles);\n }\n case \"icon\": {\n return renderIconItem(item, index, total, gap, styles);\n }\n case \"multi-level\": {\n return renderMultiLevelItem(item, index, total, gap, styles, level);\n }\n case \"descriptive\": {\n return renderDescriptiveItem(item, index, total, gap, styles);\n }\n default: {\n break;\n }\n }\n return null;\n};\n\nconst renderItemList = (\n items: ListItem[],\n variant: ListVariant,\n gap: GapProp,\n styles: Styles,\n level: number\n): React.ReactElement => (\n <View style={level > 0 ? styles.childrenContainer : undefined}>\n {items.map((item, index) =>\n renderItem(item, index, items.length, variant, gap, styles, level)\n )}\n </View>\n);\n\nrenderBulletItem = (item, index, total, gap, styles, level) => (\n <View key={index}>\n <View style={buildRowStyles(index, total, gap, styles)}>\n {dotMarker(level, styles)}\n <View style={styles.itemTextWrap}>\n <PDFText style={styles.itemText}>{item.text}</PDFText>\n </View>\n </View>\n {item.children && item.children.length > 0\n ? renderItemList(item.children, \"bullet\", gap, styles, level + 1)\n : null}\n </View>\n);\n\nrenderMultiLevelItem = (item, index, total, gap, styles, level) => (\n <View key={index}>\n <View style={buildRowStyles(index, total, gap, styles)}>\n {dotMarker(level, styles)}\n <View style={styles.itemTextWrap}>\n <PDFText\n style={[\n level === 0 ? styles.itemText : styles.itemTextSub,\n level === 0 ? styles.itemTextBold : {},\n ]}\n >\n {item.text}\n </PDFText>\n </View>\n </View>\n {item.children && item.children.length > 0\n ? renderItemList(item.children, \"multi-level\", gap, styles, level + 1)\n : null}\n </View>\n);\n\nexport const PdfList = ({\n items,\n variant = \"bullet\",\n gap = \"sm\",\n style,\n noWrap = false,\n _level = 0,\n}: PdfListProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createListStyles(theme), [theme]);\n\n const containerStyles: Style[] = [styles.container];\n if (_level > 0) {\n containerStyles.push(styles.childrenContainer);\n }\n const styleArray = style ? [...containerStyles, style] : containerStyles;\n\n return (\n <View wrap={!noWrap} style={styleArray}>\n {items.map((item, index) =>\n renderItem(item, index, items.length, variant, gap, styles, _level)\n )}\n </View>\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/list/list.tsx"},{"path": "registry/bases/takumi/components/list/list.types.ts","content": "import type { Style } from \"../../lib/takumi-primitives\";\n\n/** List visual style variant. */\nexport type ListVariant =\n | \"bullet\"\n | \"numbered\"\n | \"checklist\"\n | \"icon\"\n | \"multi-level\"\n | \"descriptive\";\n\n/**\n * A single list item, optionally with nested children.\n * Props - `text` | `description` | `checked` | `children`\n * @see {@link ListItem}\n */\nexport interface ListItem {\n text: string;\n description?: string;\n checked?: boolean;\n children?: ListItem[];\n}\n\n/**\n * List of items with multiple style variants including bullet, numbered, checklist, and descriptive.\n * Props - `items` | `variant` | `gap` | `style` | `_level` | `noWrap`\n * @see {@link PdfListProps}\n */\nexport interface PdfListProps {\n items: ListItem[];\n /**\n * @default 'bullet'\n */\n variant?: ListVariant;\n /**\n * @default 'sm'\n */\n gap?: \"xs\" | \"sm\" | \"md\";\n style?: Style;\n _level?: number;\n /**\n * @default false\n */\n noWrap?: boolean;\n}\n",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/list/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/page-break.json b/public/r/takumi/page-break.jsonindex 4cfc92f..fd532d8 100644--- a/public/r/takumi/page-break.json+++ b/public/r/takumi/page-break.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/takumi/components/page-break/page-break.tsx",- "content": "import type { PDFComponentProps } from \"@/registry/themes\";\n\nimport { View } from \"../../lib/takumi-primitives\";\n\nexport interface PageBreakProps extends Omit<PDFComponentProps, \"children\"> {\n children?: never;\n}\n\nexport function PageBreak({ style }: PageBreakProps) {\n return (\n <View style={[{ breakBefore: \"page\" }, style].filter(Boolean) as never} />\n );\n}\n",- "type": "registry:component"+ "content": "import type { PDFComponentProps } from \"@/registry/themes\";\n\nimport { View } from \"../../lib/takumi-primitives\";\n\nexport interface PageBreakProps extends Omit<PDFComponentProps, \"children\"> {\n children?: never;\n}\n\nexport const PageBreak = ({ style }: PageBreakProps) => (\n <View style={[{ breakBefore: \"page\" }, style].filter(Boolean) as never} />\n);\n",+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/page-break/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/page-footer.json b/public/r/takumi/page-footer.jsonindex 196e66a..328437b 100644--- a/public/r/takumi/page-footer.json+++ b/public/r/takumi/page-footer.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/takumi/components/page-footer/page-footer.tsx",- "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { Text as PDFText, StyleSheet, View } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type PageFooterVariant =\n | \"simple\"\n | \"centered\"\n | \"branded\"\n | \"minimal\"\n | \"three-column\"\n | \"detailed\";\n\n/**\n * Footer row with layout variants, optional sticky or fixed positioning, and contact info support.\n * Props - `leftText` | `rightText` | `centerText` | `variant` | `background` | `textColor` | `marginTop` | `address` | `phone` | `email` | `website` | `fixed` | `sticky` | `pagePadding` | `noWrap` | `style`\n * @see {@link PageFooterProps}\n */\nexport interface PageFooterProps extends Omit<PDFComponentProps, \"children\"> {\n leftText?: string;\n rightText?: string;\n centerText?: string;\n /**\n * @default 'simple'\n */\n variant?: PageFooterVariant;\n background?: string;\n textColor?: string;\n marginTop?: number;\n address?: string;\n phone?: string;\n email?: string;\n website?: string;\n /**\n * @default false\n */\n fixed?: boolean;\n /**\n * @default false\n */\n sticky?: boolean;\n /**\n * @default 0\n */\n pagePadding?: number;\n /**\n * @default true\n */\n noWrap?: boolean;\n}\n\nfunction createPageFooterStyles(t: PdfcnTheme) {\n const { spacing, fontWeights } = t.primitives;\n const c = t.colors;\n const { body } = t.typography;\n\n const textBase = {\n color: c.mutedForeground,\n fontFamily: body.fontFamily,\n fontSize: t.primitives.typography.xs,\n lineHeight: body.lineHeight,\n };\n\n return StyleSheet.create({\n brandedContainer: {\n alignItems: \"center\",\n backgroundColor: c.primary,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingHorizontal: spacing[4],\n paddingVertical: spacing[3],\n },\n\n centeredContainer: {\n alignItems: \"center\",\n borderTopColor: c.border,\n borderTopStyle: \"solid\",\n borderTopWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"column\",\n paddingTop: spacing[3],\n },\n\n companyBold: {\n ...textBase,\n color: c.foreground,\n fontWeight: fontWeights.bold,\n },\n\n companyName: {\n ...textBase,\n color: c.foreground,\n fontWeight: fontWeights.medium,\n },\n\n contactInfoCenter: {\n ...textBase,\n fontSize: t.primitives.typography.xs - 1,\n marginTop: spacing[0.5],\n textAlign: \"center\",\n },\n detailedContainer: {\n borderTopColor: c.border,\n borderTopStyle: \"solid\",\n borderTopWidth: spacing[1],\n display: \"flex\",\n flexDirection: \"column\",\n paddingTop: spacing[3],\n },\n detailedLeft: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n detailedPageNumber: {\n ...textBase,\n borderTopColor: c.border,\n borderTopStyle: \"solid\",\n borderTopWidth: spacing[0.5],\n paddingTop: spacing[2],\n textAlign: \"center\",\n },\n detailedRight: {\n alignItems: \"flex-end\",\n display: \"flex\",\n flexDirection: \"column\",\n },\n detailedTopRow: {\n alignItems: \"flex-start\",\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: spacing[2],\n },\n\n minimalContainer: {\n alignItems: \"center\",\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingBottom: spacing[1],\n paddingTop: spacing[1],\n },\n simpleContainer: {\n alignItems: \"center\",\n borderTopColor: c.border,\n borderTopStyle: \"solid\",\n borderTopWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingTop: spacing[3],\n },\n textBranded: {\n ...textBase,\n color: c.primaryForeground,\n fontWeight: fontWeights.medium,\n },\n textBrandedRight: {\n ...textBase,\n color: c.primaryForeground,\n textAlign: \"right\",\n },\n textCenter: {\n ...textBase,\n flex: 1,\n textAlign: \"center\",\n },\n textCenteredVariant: {\n ...textBase,\n marginBottom: spacing[1],\n textAlign: \"center\",\n },\n\n textLeft: {\n ...textBase,\n flex: 1,\n },\n textRight: {\n ...textBase,\n textAlign: \"right\",\n },\n threeColumnCenter: {\n alignItems: \"center\",\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n threeColumnContainer: {\n alignItems: \"flex-start\",\n borderTopColor: c.border,\n borderTopStyle: \"solid\",\n borderTopWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingTop: spacing[3],\n },\n threeColumnLeft: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n threeColumnRight: {\n alignItems: \"flex-end\",\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n });\n}\n\nexport function PageFooter({\n leftText,\n rightText,\n centerText,\n variant = \"simple\",\n background,\n textColor,\n marginTop,\n address,\n phone,\n email,\n website,\n fixed = false,\n sticky = false,\n pagePadding = 0,\n noWrap = true,\n style,\n}: PageFooterProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createPageFooterStyles(theme), [theme]);\n // sticky implies fixed; marginTop is irrelevant with absolute positioning\n const isFixed = fixed || sticky;\n const mt = sticky ? 0 : (marginTop ?? theme.spacing.sectionGap);\n const resolvedTextColor = textColor\n ? resolveColor(textColor, theme.colors)\n : undefined;\n const stickyStyle: Style = sticky\n ? {\n bottom: pagePadding,\n left: pagePadding,\n position: \"absolute\",\n right: pagePadding,\n }\n : {};\n\n function applyOverrides(base: Style[]): Style[] {\n if (background)\n {base.push({ backgroundColor: resolveColor(background, theme.colors) });}\n if (style) {base.push(style);}\n if (sticky) {base.push(stickyStyle);}\n return base;\n }\n\n if (variant === \"branded\") {\n const containerStyles = applyOverrides([\n styles.brandedContainer,\n { marginTop: mt },\n ]);\n\n const lStyle: Style[] = [styles.textBranded];\n const rStyle: Style[] = [styles.textBrandedRight];\n if (resolvedTextColor) {\n lStyle.push({ color: resolvedTextColor });\n rStyle.push({ color: resolvedTextColor });\n }\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n {leftText && <PDFText style={lStyle}>{leftText}</PDFText>}\n {rightText && <PDFText style={rStyle}>{rightText}</PDFText>}\n </View>\n );\n }\n\n if (variant === \"centered\") {\n const containerStyles = applyOverrides([\n styles.centeredContainer,\n { marginTop: mt },\n ]);\n\n const tStyle: Style[] = [styles.textCenteredVariant];\n if (resolvedTextColor) {tStyle.push({ color: resolvedTextColor });}\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n {leftText && <PDFText style={tStyle}>{leftText}</PDFText>}\n {rightText && <PDFText style={tStyle}>{rightText}</PDFText>}\n </View>\n );\n }\n\n if (variant === \"three-column\") {\n const containerStyles = applyOverrides([\n styles.threeColumnContainer,\n { marginTop: mt },\n ]);\n\n const leftStyle: Style[] = [styles.companyName];\n const centerStyle: Style[] = [styles.contactInfoCenter];\n const rightStyle: Style[] = [styles.textRight];\n if (resolvedTextColor) {\n leftStyle.push({ color: resolvedTextColor });\n centerStyle.push({ color: resolvedTextColor });\n rightStyle.push({ color: resolvedTextColor });\n }\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n <View style={styles.threeColumnLeft}>\n {leftText && <PDFText style={leftStyle}>{leftText}</PDFText>}\n {address && <PDFText style={styles.textLeft}>{address}</PDFText>}\n </View>\n <View style={styles.threeColumnCenter}>\n {phone && <PDFText style={centerStyle}>{phone}</PDFText>}\n {email && <PDFText style={centerStyle}>{email}</PDFText>}\n {website && <PDFText style={centerStyle}>{website}</PDFText>}\n </View>\n <View style={styles.threeColumnRight}>\n {rightText && <PDFText style={rightStyle}>{rightText}</PDFText>}\n </View>\n </View>\n );\n }\n\n if (variant === \"detailed\") {\n const containerStyles = applyOverrides([\n styles.detailedContainer,\n { marginTop: mt },\n ]);\n\n const companyStyle: Style[] = [styles.companyBold];\n const addrStyle: Style[] = [styles.textLeft];\n const contactStyle: Style[] = [styles.textRight];\n const pageNumStyle: Style[] = [styles.detailedPageNumber];\n if (resolvedTextColor) {\n companyStyle.push({ color: resolvedTextColor });\n addrStyle.push({ color: resolvedTextColor });\n contactStyle.push({ color: resolvedTextColor });\n pageNumStyle.push({ color: resolvedTextColor });\n }\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n <View style={styles.detailedTopRow}>\n <View style={styles.detailedLeft}>\n {leftText && <PDFText style={companyStyle}>{leftText}</PDFText>}\n {address && <PDFText style={addrStyle}>{address}</PDFText>}\n </View>\n <View style={styles.detailedRight}>\n {phone && (\n <PDFText style={contactStyle}>{`Phone: ${phone}`}</PDFText>\n )}\n {email && (\n <PDFText style={contactStyle}>{`Email: ${email}`}</PDFText>\n )}\n {website && (\n <PDFText style={contactStyle}>{`Web: ${website}`}</PDFText>\n )}\n </View>\n </View>\n {rightText && <PDFText style={pageNumStyle}>{rightText}</PDFText>}\n </View>\n );\n }\n\n if (variant === \"minimal\") {\n const containerStyles = applyOverrides([\n styles.minimalContainer,\n { marginTop: mt },\n ]);\n\n const lStyle: Style[] = [styles.textLeft];\n const rStyle: Style[] = [styles.textRight];\n if (resolvedTextColor) {\n lStyle.push({ color: resolvedTextColor });\n rStyle.push({ color: resolvedTextColor });\n }\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n {leftText && <PDFText style={lStyle}>{leftText}</PDFText>}\n {rightText && <PDFText style={rStyle}>{rightText}</PDFText>}\n </View>\n );\n }\n\n const containerStyles = applyOverrides([\n styles.simpleContainer,\n { marginTop: mt },\n ]);\n\n const lStyle: Style[] = [styles.textLeft];\n const cStyle: Style[] = [styles.textCenter];\n const rStyle: Style[] = [styles.textRight];\n if (resolvedTextColor) {\n lStyle.push({ color: resolvedTextColor });\n cStyle.push({ color: resolvedTextColor });\n rStyle.push({ color: resolvedTextColor });\n }\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n {leftText && <PDFText style={lStyle}>{leftText}</PDFText>}\n {centerText && <PDFText style={cStyle}>{centerText}</PDFText>}\n {rightText && <PDFText style={rStyle}>{rightText}</PDFText>}\n </View>\n );\n}\n",- "type": "registry:component"+ "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { Text as PDFText, StyleSheet, View } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type PageFooterVariant =\n | \"simple\"\n | \"centered\"\n | \"branded\"\n | \"minimal\"\n | \"three-column\"\n | \"detailed\";\n\n/**\n * Footer row with layout variants, optional sticky or fixed positioning, and contact info support.\n * Props - `leftText` | `rightText` | `centerText` | `variant` | `background` | `textColor` | `marginTop` | `address` | `phone` | `email` | `website` | `fixed` | `sticky` | `pagePadding` | `noWrap` | `style`\n * @see {@link PageFooterProps}\n */\nexport interface PageFooterProps extends Omit<PDFComponentProps, \"children\"> {\n leftText?: string;\n rightText?: string;\n centerText?: string;\n /**\n * @default 'simple'\n */\n variant?: PageFooterVariant;\n background?: string;\n textColor?: string;\n marginTop?: number;\n address?: string;\n phone?: string;\n email?: string;\n website?: string;\n /**\n * @default false\n */\n fixed?: boolean;\n /**\n * @default false\n */\n sticky?: boolean;\n /**\n * @default 0\n */\n pagePadding?: number;\n /**\n * @default true\n */\n noWrap?: boolean;\n}\n\nconst createPageFooterStyles = (t: PdfcnTheme) => {\n const { spacing, fontWeights } = t.primitives;\n const c = t.colors;\n const { body } = t.typography;\n\n const textBase = {\n color: c.mutedForeground,\n fontFamily: body.fontFamily,\n fontSize: t.primitives.typography.xs,\n lineHeight: body.lineHeight,\n };\n\n return StyleSheet.create({\n brandedContainer: {\n alignItems: \"center\",\n backgroundColor: c.primary,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingHorizontal: spacing[4],\n paddingVertical: spacing[3],\n },\n\n centeredContainer: {\n alignItems: \"center\",\n borderTopColor: c.border,\n borderTopStyle: \"solid\",\n borderTopWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"column\",\n paddingTop: spacing[3],\n },\n\n companyBold: {\n ...textBase,\n color: c.foreground,\n fontWeight: fontWeights.bold,\n },\n\n companyName: {\n ...textBase,\n color: c.foreground,\n fontWeight: fontWeights.medium,\n },\n\n contactInfoCenter: {\n ...textBase,\n fontSize: t.primitives.typography.xs - 1,\n marginTop: spacing[0.5],\n textAlign: \"center\",\n },\n detailedContainer: {\n borderTopColor: c.border,\n borderTopStyle: \"solid\",\n borderTopWidth: spacing[1],\n display: \"flex\",\n flexDirection: \"column\",\n paddingTop: spacing[3],\n },\n detailedLeft: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n detailedPageNumber: {\n ...textBase,\n borderTopColor: c.border,\n borderTopStyle: \"solid\",\n borderTopWidth: spacing[0.5],\n paddingTop: spacing[2],\n textAlign: \"center\",\n },\n detailedRight: {\n alignItems: \"flex-end\",\n display: \"flex\",\n flexDirection: \"column\",\n },\n detailedTopRow: {\n alignItems: \"flex-start\",\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: spacing[2],\n },\n\n minimalContainer: {\n alignItems: \"center\",\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingBottom: spacing[1],\n paddingTop: spacing[1],\n },\n simpleContainer: {\n alignItems: \"center\",\n borderTopColor: c.border,\n borderTopStyle: \"solid\",\n borderTopWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingTop: spacing[3],\n },\n textBranded: {\n ...textBase,\n color: c.primaryForeground,\n fontWeight: fontWeights.medium,\n },\n textBrandedRight: {\n ...textBase,\n color: c.primaryForeground,\n textAlign: \"right\",\n },\n textCenter: {\n ...textBase,\n flex: 1,\n textAlign: \"center\",\n },\n textCenteredVariant: {\n ...textBase,\n marginBottom: spacing[1],\n textAlign: \"center\",\n },\n\n textLeft: {\n ...textBase,\n flex: 1,\n },\n textRight: {\n ...textBase,\n textAlign: \"right\",\n },\n threeColumnCenter: {\n alignItems: \"center\",\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n threeColumnContainer: {\n alignItems: \"flex-start\",\n borderTopColor: c.border,\n borderTopStyle: \"solid\",\n borderTopWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingTop: spacing[3],\n },\n threeColumnLeft: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n threeColumnRight: {\n alignItems: \"flex-end\",\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n });\n};\n\ntype Styles = ReturnType<typeof createPageFooterStyles>;\n\nconst applyTextColor = (\n styles: Style[],\n color: string | undefined\n): Style[] => {\n if (!color) {\n return styles;\n }\n return [...styles, { color }];\n};\n\nconst renderBranded = (\n styles: Styles,\n containerStyles: Style[],\n leftStyle: Style[],\n rightStyle: Style[],\n leftText: string | undefined,\n rightText: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles}>\n {leftText && <PDFText style={leftStyle}>{leftText}</PDFText>}\n {rightText && <PDFText style={rightStyle}>{rightText}</PDFText>}\n </View>\n);\n\nconst renderCentered = (\n styles: Styles,\n containerStyles: Style[],\n textStyle: Style[],\n leftText: string | undefined,\n rightText: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles}>\n {leftText && <PDFText style={textStyle}>{leftText}</PDFText>}\n {rightText && <PDFText style={textStyle}>{rightText}</PDFText>}\n </View>\n);\n\nconst renderThreeColumn = (\n styles: Styles,\n containerStyles: Style[],\n leftStyle: Style[],\n centerStyle: Style[],\n rightStyle: Style[],\n leftText: string | undefined,\n rightText: string | undefined,\n address: string | undefined,\n phone: string | undefined,\n email: string | undefined,\n website: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles}>\n <View style={styles.threeColumnLeft}>\n {leftText && <PDFText style={leftStyle}>{leftText}</PDFText>}\n {address && <PDFText style={styles.textLeft}>{address}</PDFText>}\n </View>\n <View style={styles.threeColumnCenter}>\n {phone && <PDFText style={centerStyle}>{phone}</PDFText>}\n {email && <PDFText style={centerStyle}>{email}</PDFText>}\n {website && <PDFText style={centerStyle}>{website}</PDFText>}\n </View>\n <View style={styles.threeColumnRight}>\n {rightText && <PDFText style={rightStyle}>{rightText}</PDFText>}\n </View>\n </View>\n);\n\nconst renderDetailed = (\n styles: Styles,\n containerStyles: Style[],\n companyStyle: Style[],\n addrStyle: Style[],\n contactStyle: Style[],\n pageNumStyle: Style[],\n leftText: string | undefined,\n rightText: string | undefined,\n address: string | undefined,\n phone: string | undefined,\n email: string | undefined,\n website: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles}>\n <View style={styles.detailedTopRow}>\n <View style={styles.detailedLeft}>\n {leftText && <PDFText style={companyStyle}>{leftText}</PDFText>}\n {address && <PDFText style={addrStyle}>{address}</PDFText>}\n </View>\n <View style={styles.detailedRight}>\n {phone && <PDFText style={contactStyle}>{`Phone: ${phone}`}</PDFText>}\n {email && <PDFText style={contactStyle}>{`Email: ${email}`}</PDFText>}\n {website && <PDFText style={contactStyle}>{`Web: ${website}`}</PDFText>}\n </View>\n </View>\n {rightText && <PDFText style={pageNumStyle}>{rightText}</PDFText>}\n </View>\n);\n\nconst renderMinimal = (\n styles: Styles,\n containerStyles: Style[],\n leftStyle: Style[],\n rightStyle: Style[],\n leftText: string | undefined,\n rightText: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles}>\n {leftText && <PDFText style={leftStyle}>{leftText}</PDFText>}\n {rightText && <PDFText style={rightStyle}>{rightText}</PDFText>}\n </View>\n);\n\nconst renderSimple = (\n styles: Styles,\n containerStyles: Style[],\n leftStyle: Style[],\n centerStyle: Style[],\n rightStyle: Style[],\n leftText: string | undefined,\n centerText: string | undefined,\n rightText: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles}>\n {leftText && <PDFText style={leftStyle}>{leftText}</PDFText>}\n {centerText && <PDFText style={centerStyle}>{centerText}</PDFText>}\n {rightText && <PDFText style={rightStyle}>{rightText}</PDFText>}\n </View>\n);\n\nexport const PageFooter = ({\n leftText,\n rightText,\n centerText,\n variant = \"simple\",\n background,\n textColor,\n marginTop,\n address,\n phone,\n email,\n website,\n fixed = false,\n sticky = false,\n pagePadding = 0,\n noWrap = true,\n style,\n}: PageFooterProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createPageFooterStyles(theme), [theme]);\n const _isFixed = fixed || sticky;\n const mt = sticky ? 0 : (marginTop ?? theme.spacing.sectionGap);\n const resolvedTextColor = textColor\n ? resolveColor(textColor, theme.colors)\n : undefined;\n const stickyStyle: Style = sticky\n ? {\n bottom: pagePadding,\n left: pagePadding,\n position: \"absolute\",\n right: pagePadding,\n }\n : {};\n\n const applyOverrides = (base: Style[]): Style[] => {\n if (background) {\n base.push({ backgroundColor: resolveColor(background, theme.colors) });\n }\n if (style) {\n base.push(style);\n }\n if (sticky) {\n base.push(stickyStyle);\n }\n return base;\n };\n\n const variantRenderers: Record<PageFooterVariant, () => React.ReactNode> = {\n branded: () =>\n renderBranded(\n styles,\n applyOverrides([styles.brandedContainer, { marginTop: mt }]),\n applyTextColor([styles.textBranded], resolvedTextColor),\n applyTextColor([styles.textBrandedRight], resolvedTextColor),\n leftText,\n rightText,\n noWrap\n ),\n centered: () =>\n renderCentered(\n styles,\n applyOverrides([styles.centeredContainer, { marginTop: mt }]),\n applyTextColor([styles.textCenteredVariant], resolvedTextColor),\n leftText,\n rightText,\n noWrap\n ),\n detailed: () =>\n renderDetailed(\n styles,\n applyOverrides([styles.detailedContainer, { marginTop: mt }]),\n applyTextColor([styles.companyBold], resolvedTextColor),\n applyTextColor([styles.textLeft], resolvedTextColor),\n applyTextColor([styles.textRight], resolvedTextColor),\n applyTextColor([styles.detailedPageNumber], resolvedTextColor),\n leftText,\n rightText,\n address,\n phone,\n email,\n website,\n noWrap\n ),\n minimal: () =>\n renderMinimal(\n styles,\n applyOverrides([styles.minimalContainer, { marginTop: mt }]),\n applyTextColor([styles.textLeft], resolvedTextColor),\n applyTextColor([styles.textRight], resolvedTextColor),\n leftText,\n rightText,\n noWrap\n ),\n simple: () =>\n renderSimple(\n styles,\n applyOverrides([styles.simpleContainer, { marginTop: mt }]),\n applyTextColor([styles.textLeft], resolvedTextColor),\n applyTextColor([styles.textCenter], resolvedTextColor),\n applyTextColor([styles.textRight], resolvedTextColor),\n leftText,\n centerText,\n rightText,\n noWrap\n ),\n \"three-column\": () =>\n renderThreeColumn(\n styles,\n applyOverrides([styles.threeColumnContainer, { marginTop: mt }]),\n applyTextColor([styles.companyName], resolvedTextColor),\n applyTextColor([styles.contactInfoCenter], resolvedTextColor),\n applyTextColor([styles.textRight], resolvedTextColor),\n leftText,\n rightText,\n address,\n phone,\n email,\n website,\n noWrap\n ),\n };\n\n return variantRenderers[variant]() as React.ReactNode;\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/page-footer/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/page-header.json b/public/r/takumi/page-header.jsonindex 1f25f23..c74749f 100644--- a/public/r/takumi/page-header.json+++ b/public/r/takumi/page-header.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/takumi/components/page-header/page-header.tsx",- "content": "import type { ReactNode } from \"react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { Text as PDFText, StyleSheet, View } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type PageHeaderVariant =\n | \"simple\"\n | \"centered\"\n | \"minimal\"\n | \"branded\"\n | \"logo-left\"\n | \"logo-right\"\n | \"two-column\";\n\n/**\n * Header row with layout variants, logo support, and optional fixed positioning.\n * Props - `title` | `subtitle` | `rightText` | `rightSubText` | `variant` | `background` | `titleColor` | `marginBottom` | `address` | `phone` | `email` | `logo` | `fixed` | `noWrap` | `style`\n * @see {@link PageHeaderProps}\n */\nexport interface PageHeaderProps extends Omit<PDFComponentProps, \"children\"> {\n title: string;\n subtitle?: string;\n rightText?: string;\n rightSubText?: string;\n /**\n * @default 'simple'\n */\n variant?: PageHeaderVariant;\n background?: string;\n titleColor?: string;\n marginBottom?: number;\n address?: string;\n phone?: string;\n email?: string;\n logo?: ReactNode;\n /**\n * @default false\n */\n fixed?: boolean;\n /**\n * @default true\n */\n noWrap?: boolean;\n}\n\nfunction createPageHeaderStyles(t: PdfcnTheme) {\n const { spacing, borderRadius, fontWeights } = t.primitives;\n const c = t.colors;\n const { heading, body } = t.typography;\n\n return StyleSheet.create({\n brandedContainer: {\n alignItems: \"center\",\n backgroundColor: c.primary,\n borderRadius: borderRadius.sm,\n display: \"flex\",\n flexDirection: \"column\",\n padding: spacing[6],\n },\n centeredContainer: {\n alignItems: \"center\",\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"column\",\n paddingBottom: spacing[4],\n },\n contactInfo: {\n color: c.mutedForeground,\n fontFamily: body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginTop: spacing[0.5],\n textAlign: \"right\",\n },\n\n logoContainer: {\n height: 48,\n marginRight: spacing[4],\n width: 48,\n },\n\n logoContent: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n logoLeftContainer: {\n alignItems: \"center\",\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n paddingBottom: spacing[4],\n },\n logoRightContainer: {\n alignItems: \"center\",\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingBottom: spacing[4],\n },\n\n logoRightContent: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n\n logoRightLogoContainer: {\n height: 48,\n marginLeft: spacing[4],\n width: 48,\n },\n minimalContainer: {\n alignItems: \"center\",\n borderBottomColor: c.primary,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[1],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingBottom: spacing[3],\n },\n minimalLeft: {\n flex: 1,\n },\n minimalRight: {\n alignItems: \"flex-end\",\n },\n\n rightSubText: {\n color: c.mutedForeground,\n fontFamily: body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginTop: spacing[1],\n textAlign: \"right\",\n },\n rightText: {\n color: c.foreground,\n fontFamily: body.fontFamily,\n fontSize: body.fontSize,\n fontWeight: fontWeights.medium,\n textAlign: \"right\",\n },\n simpleContainer: {\n alignItems: \"flex-start\",\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingBottom: spacing[4],\n },\n\n simpleLeft: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n simpleRight: {\n alignItems: \"flex-end\",\n display: \"flex\",\n flexDirection: \"column\",\n },\n\n subtitle: {\n color: c.mutedForeground,\n fontFamily: body.fontFamily,\n fontSize: body.fontSize,\n lineHeight: body.lineHeight,\n marginTop: spacing[1],\n },\n subtitleBranded: {\n color: c.primaryForeground,\n marginTop: spacing[1],\n },\n subtitleCentered: {\n textAlign: \"center\",\n },\n\n title: {\n color: c.foreground,\n fontFamily: heading.fontFamily,\n fontSize: heading.fontSize.h3,\n fontWeight: fontWeights.bold,\n lineHeight: heading.lineHeight,\n marginBottom: 0,\n },\n titleBranded: {\n color: c.primaryForeground,\n },\n titleCentered: {\n textAlign: \"center\",\n },\n\n titleMinimal: {\n fontSize: heading.fontSize.h3,\n fontWeight: fontWeights.bold,\n },\n twoColumnContainer: {\n alignItems: \"flex-start\",\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingBottom: spacing[4],\n },\n twoColumnLeft: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n twoColumnRight: {\n alignItems: \"flex-end\",\n display: \"flex\",\n flexDirection: \"column\",\n },\n });\n}\n\nexport function PageHeader({\n title,\n subtitle,\n rightText,\n rightSubText,\n variant = \"simple\",\n background,\n titleColor,\n marginBottom,\n logo,\n address,\n phone,\n email,\n fixed = false,\n noWrap = true,\n style,\n}: PageHeaderProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createPageHeaderStyles(theme), [theme]);\n const mb = marginBottom ?? theme.spacing.sectionGap;\n\n if (variant === \"branded\") {\n const containerStyles: Style[] = [\n styles.brandedContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [\n styles.title,\n styles.titleBranded,\n styles.titleCentered,\n ];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n <PDFText style={titleStyles}>{title}</PDFText>\n {subtitle && (\n <PDFText style={[styles.subtitle, styles.subtitleBranded]}>\n {subtitle}\n </PDFText>\n )}\n </View>\n );\n }\n\n if (variant === \"centered\") {\n const containerStyles: Style[] = [\n styles.centeredContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [styles.title, styles.titleCentered];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n <PDFText style={titleStyles}>{title}</PDFText>\n {subtitle && (\n <PDFText style={[styles.subtitle, styles.subtitleCentered]}>\n {subtitle}\n </PDFText>\n )}\n </View>\n );\n }\n\n if (variant === \"logo-right\") {\n const containerStyles: Style[] = [\n styles.logoRightContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [styles.title];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n <View style={styles.logoRightContent}>\n <PDFText style={titleStyles}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {logo && <View style={styles.logoRightLogoContainer}>{logo}</View>}\n </View>\n );\n }\n\n if (variant === \"logo-left\") {\n const containerStyles: Style[] = [\n styles.logoLeftContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [styles.title];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n {logo && <View style={styles.logoContainer}>{logo}</View>}\n <View style={styles.logoContent}>\n <PDFText style={titleStyles}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {(rightText || rightSubText) && (\n <View style={styles.simpleRight}>\n {rightText && (\n <PDFText style={styles.rightText}>{rightText}</PDFText>\n )}\n {rightSubText && (\n <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>\n )}\n </View>\n )}\n </View>\n );\n }\n\n if (variant === \"two-column\") {\n const containerStyles: Style[] = [\n styles.twoColumnContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [styles.title];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n <View style={styles.twoColumnLeft}>\n <PDFText style={titleStyles}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {(address || phone || email) && (\n <View style={styles.twoColumnRight}>\n {address && <PDFText style={styles.contactInfo}>{address}</PDFText>}\n {phone && <PDFText style={styles.contactInfo}>{phone}</PDFText>}\n {email && <PDFText style={styles.contactInfo}>{email}</PDFText>}\n </View>\n )}\n </View>\n );\n }\n\n if (variant === \"minimal\") {\n const containerStyles: Style[] = [\n styles.minimalContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [styles.title, styles.titleMinimal];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n <View style={styles.minimalLeft}>\n <PDFText style={titleStyles}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {(rightText || rightSubText) && (\n <View style={styles.minimalRight}>\n {rightText && (\n <PDFText style={styles.rightText}>{rightText}</PDFText>\n )}\n {rightSubText && (\n <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>\n )}\n </View>\n )}\n </View>\n );\n }\n\n const containerStyles: Style[] = [\n styles.simpleContainer,\n { marginBottom: mb },\n ];\n if (background) {\n containerStyles.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {containerStyles.push(style);}\n\n const titleStyles: Style[] = [styles.title];\n if (titleColor)\n {titleStyles.push({ color: resolveColor(titleColor, theme.colors) });}\n\n return (\n <View wrap={!noWrap} style={containerStyles}>\n <View style={styles.simpleLeft}>\n <PDFText style={titleStyles}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {(rightText || rightSubText) && (\n <View style={styles.simpleRight}>\n {rightText && <PDFText style={styles.rightText}>{rightText}</PDFText>}\n {rightSubText && (\n <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>\n )}\n </View>\n )}\n </View>\n );\n}\n",- "type": "registry:component"+ "content": "import type { ReactNode } from \"react\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { Text as PDFText, StyleSheet, View } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type PageHeaderVariant =\n | \"simple\"\n | \"centered\"\n | \"minimal\"\n | \"branded\"\n | \"logo-left\"\n | \"logo-right\"\n | \"two-column\";\n\n/**\n * Header row with layout variants, logo support, and optional fixed positioning.\n * Props - `title` | `subtitle` | `rightText` | `rightSubText` | `variant` | `background` | `titleColor` | `marginBottom` | `address` | `phone` | `email` | `logo` | `fixed` | `noWrap` | `style`\n * @see {@link PageHeaderProps}\n */\nexport interface PageHeaderProps extends Omit<PDFComponentProps, \"children\"> {\n title: string;\n subtitle?: string;\n rightText?: string;\n rightSubText?: string;\n /**\n * @default 'simple'\n */\n variant?: PageHeaderVariant;\n background?: string;\n titleColor?: string;\n marginBottom?: number;\n address?: string;\n phone?: string;\n email?: string;\n logo?: ReactNode;\n /**\n * @default false\n */\n fixed?: boolean;\n /**\n * @default true\n */\n noWrap?: boolean;\n}\n\nconst createPageHeaderStyles = (t: PdfcnTheme) => {\n const { spacing, borderRadius, fontWeights } = t.primitives;\n const c = t.colors;\n const { heading, body } = t.typography;\n\n return StyleSheet.create({\n brandedContainer: {\n alignItems: \"center\",\n backgroundColor: c.primary,\n borderRadius: borderRadius.sm,\n display: \"flex\",\n flexDirection: \"column\",\n padding: spacing[6],\n },\n centeredContainer: {\n alignItems: \"center\",\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"column\",\n paddingBottom: spacing[4],\n },\n contactInfo: {\n color: c.mutedForeground,\n fontFamily: body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginTop: spacing[0.5],\n textAlign: \"right\",\n },\n\n logoContainer: {\n height: 48,\n marginRight: spacing[4],\n width: 48,\n },\n\n logoContent: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n logoLeftContainer: {\n alignItems: \"center\",\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n paddingBottom: spacing[4],\n },\n logoRightContainer: {\n alignItems: \"center\",\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingBottom: spacing[4],\n },\n\n logoRightContent: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n\n logoRightLogoContainer: {\n height: 48,\n marginLeft: spacing[4],\n width: 48,\n },\n minimalContainer: {\n alignItems: \"center\",\n borderBottomColor: c.primary,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[1],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingBottom: spacing[3],\n },\n minimalLeft: {\n flex: 1,\n },\n minimalRight: {\n alignItems: \"flex-end\",\n },\n\n rightSubText: {\n color: c.mutedForeground,\n fontFamily: body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginTop: spacing[1],\n textAlign: \"right\",\n },\n rightText: {\n color: c.foreground,\n fontFamily: body.fontFamily,\n fontSize: body.fontSize,\n fontWeight: fontWeights.medium,\n textAlign: \"right\",\n },\n simpleContainer: {\n alignItems: \"flex-start\",\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingBottom: spacing[4],\n },\n\n simpleLeft: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n simpleRight: {\n alignItems: \"flex-end\",\n display: \"flex\",\n flexDirection: \"column\",\n },\n\n subtitle: {\n color: c.mutedForeground,\n fontFamily: body.fontFamily,\n fontSize: body.fontSize,\n lineHeight: body.lineHeight,\n marginTop: spacing[1],\n },\n subtitleBranded: {\n color: c.primaryForeground,\n marginTop: spacing[1],\n },\n subtitleCentered: {\n textAlign: \"center\",\n },\n\n title: {\n color: c.foreground,\n fontFamily: heading.fontFamily,\n fontSize: heading.fontSize.h3,\n fontWeight: fontWeights.bold,\n lineHeight: heading.lineHeight,\n marginBottom: 0,\n },\n titleBranded: {\n color: c.primaryForeground,\n },\n titleCentered: {\n textAlign: \"center\",\n },\n\n titleMinimal: {\n fontSize: heading.fontSize.h3,\n fontWeight: fontWeights.bold,\n },\n twoColumnContainer: {\n alignItems: \"flex-start\",\n borderBottomColor: c.border,\n borderBottomStyle: \"solid\",\n borderBottomWidth: spacing[0.5],\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingBottom: spacing[4],\n },\n twoColumnLeft: {\n display: \"flex\",\n flex: 1,\n flexDirection: \"column\",\n },\n twoColumnRight: {\n alignItems: \"flex-end\",\n display: \"flex\",\n flexDirection: \"column\",\n },\n });\n};\n\ntype Styles = ReturnType<typeof createPageHeaderStyles>;\n\nconst buildContainerStyles = (\n base: Style,\n mb: number,\n background: string | undefined,\n theme: PdfcnTheme,\n style: Style | undefined,\n ...extras: Style[]\n): Style[] => {\n const result: Style[] = [base, { marginBottom: mb }, ...extras];\n if (background) {\n result.push({ backgroundColor: resolveColor(background, theme.colors) });\n }\n if (style) {\n result.push(style);\n }\n return result;\n};\n\nconst buildTitleStyles = (\n base: Style[],\n titleColor: string | undefined,\n theme: PdfcnTheme\n): Style[] => {\n if (!titleColor) {\n return base;\n }\n return [...base, { color: resolveColor(titleColor, theme.colors) }];\n};\n\nconst renderBranded = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles}>\n <PDFText style={titleStyles}>{title}</PDFText>\n {subtitle && (\n <PDFText style={[styles.subtitle, styles.subtitleBranded]}>\n {subtitle}\n </PDFText>\n )}\n </View>\n);\n\nconst renderCentered = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles}>\n <PDFText style={titleStyles}>{title}</PDFText>\n {subtitle && (\n <PDFText style={[styles.subtitle, styles.subtitleCentered]}>\n {subtitle}\n </PDFText>\n )}\n </View>\n);\n\nconst renderLogoRight = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n logo: ReactNode | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles}>\n <View style={styles.logoRightContent}>\n <PDFText style={titleStyles}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {logo && <View style={styles.logoRightLogoContainer}>{logo}</View>}\n </View>\n);\n\nconst renderLogoLeft = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n logo: ReactNode | undefined,\n rightText: string | undefined,\n rightSubText: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles}>\n {logo && <View style={styles.logoContainer}>{logo}</View>}\n <View style={styles.logoContent}>\n <PDFText style={titleStyles}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {(rightText || rightSubText) && (\n <View style={styles.simpleRight}>\n {rightText && <PDFText style={styles.rightText}>{rightText}</PDFText>}\n {rightSubText && (\n <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>\n )}\n </View>\n )}\n </View>\n);\n\nconst renderTwoColumn = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n address: string | undefined,\n phone: string | undefined,\n email: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles}>\n <View style={styles.twoColumnLeft}>\n <PDFText style={titleStyles}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {(address || phone || email) && (\n <View style={styles.twoColumnRight}>\n {address && <PDFText style={styles.contactInfo}>{address}</PDFText>}\n {phone && <PDFText style={styles.contactInfo}>{phone}</PDFText>}\n {email && <PDFText style={styles.contactInfo}>{email}</PDFText>}\n </View>\n )}\n </View>\n);\n\nconst renderMinimal = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n rightText: string | undefined,\n rightSubText: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles}>\n <View style={styles.minimalLeft}>\n <PDFText style={titleStyles}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {(rightText || rightSubText) && (\n <View style={styles.minimalRight}>\n {rightText && <PDFText style={styles.rightText}>{rightText}</PDFText>}\n {rightSubText && (\n <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>\n )}\n </View>\n )}\n </View>\n);\n\nconst renderSimple = (\n styles: Styles,\n containerStyles: Style[],\n titleStyles: Style[],\n title: string,\n subtitle: string | undefined,\n rightText: string | undefined,\n rightSubText: string | undefined,\n noWrap: boolean\n) => (\n <View wrap={!noWrap} style={containerStyles}>\n <View style={styles.simpleLeft}>\n <PDFText style={titleStyles}>{title}</PDFText>\n {subtitle && <PDFText style={styles.subtitle}>{subtitle}</PDFText>}\n </View>\n {(rightText || rightSubText) && (\n <View style={styles.simpleRight}>\n {rightText && <PDFText style={styles.rightText}>{rightText}</PDFText>}\n {rightSubText && (\n <PDFText style={styles.rightSubText}>{rightSubText}</PDFText>\n )}\n </View>\n )}\n </View>\n);\n\nexport const PageHeader = ({\n title,\n subtitle,\n rightText,\n rightSubText,\n variant = \"simple\",\n background,\n titleColor,\n marginBottom,\n logo,\n address,\n phone,\n email,\n noWrap = true,\n style,\n}: PageHeaderProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createPageHeaderStyles(theme), [theme]);\n const mb = marginBottom ?? theme.spacing.sectionGap;\n\n const variantRenderers: Record<PageHeaderVariant, () => React.ReactNode> = {\n branded: () =>\n renderBranded(\n styles,\n buildContainerStyles(\n styles.brandedContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles(\n [styles.title, styles.titleBranded, styles.titleCentered],\n titleColor,\n theme\n ),\n title,\n subtitle,\n noWrap\n ),\n centered: () =>\n renderCentered(\n styles,\n buildContainerStyles(\n styles.centeredContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles(\n [styles.title, styles.titleCentered],\n titleColor,\n theme\n ),\n title,\n subtitle,\n noWrap\n ),\n \"logo-left\": () =>\n renderLogoLeft(\n styles,\n buildContainerStyles(\n styles.logoLeftContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles([styles.title], titleColor, theme),\n title,\n subtitle,\n logo,\n rightText,\n rightSubText,\n noWrap\n ),\n \"logo-right\": () =>\n renderLogoRight(\n styles,\n buildContainerStyles(\n styles.logoRightContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles([styles.title], titleColor, theme),\n title,\n subtitle,\n logo,\n noWrap\n ),\n minimal: () =>\n renderMinimal(\n styles,\n buildContainerStyles(\n styles.minimalContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles(\n [styles.title, styles.titleMinimal],\n titleColor,\n theme\n ),\n title,\n subtitle,\n rightText,\n rightSubText,\n noWrap\n ),\n simple: () =>\n renderSimple(\n styles,\n buildContainerStyles(\n styles.simpleContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles([styles.title], titleColor, theme),\n title,\n subtitle,\n rightText,\n rightSubText,\n noWrap\n ),\n \"two-column\": () =>\n renderTwoColumn(\n styles,\n buildContainerStyles(\n styles.twoColumnContainer,\n mb,\n background,\n theme,\n style\n ),\n buildTitleStyles([styles.title], titleColor, theme),\n title,\n subtitle,\n address,\n phone,\n email,\n noWrap\n ),\n };\n\n return variantRenderers[variant]() as React.ReactNode;\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/page-header/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/page-number.json b/public/r/takumi/page-number.jsonindex 0c2b94a..8d6a07a 100644--- a/public/r/takumi/page-number.json+++ b/public/r/takumi/page-number.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/takumi/components/page-number/page-number.tsx",- "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type PageNumberAlign = \"left\" | \"center\" | \"right\";\nexport type PageNumberSize = \"xs\" | \"sm\" | \"md\";\n\n/**\n * Auto page number rendered with a configurable format string at a or inline position.\n * Props - `format` | `align` | `size` | `fixed` | `muted` | `style`\n * @see {@link PdfPageNumberProps}\n */\nexport interface PdfPageNumberProps extends Omit<\n PDFComponentProps,\n \"children\"\n> {\n /**\n * Format string — use `{page}` for current page and `{total}` for total page count.\n * @default 'Page {page} of {total}'\n */\n format?: string;\n /**\n * @default 'center'\n */\n align?: PageNumberAlign;\n /**\n * @default 'sm'\n */\n size?: PageNumberSize;\n /**\n * @default false\n */\n fixed?: boolean;\n /**\n * @default true\n */\n muted?: boolean;\n children?: never;\n}\n\nfunction createPageNumberStyles(t: PdfcnTheme) {\n const { typography, colors, primitives } = t;\n return StyleSheet.create({\n alignCenter: { textAlign: \"center\" },\n alignLeft: { textAlign: \"left\" },\n alignRight: { textAlign: \"right\" },\n colorForeground: { color: colors.foreground },\n colorMuted: { color: colors.mutedForeground },\n container: { width: \"100%\" },\n sizeMd: { fontSize: primitives.typography.base },\n sizeSm: { fontSize: primitives.typography.sm },\n sizeXs: { fontSize: primitives.typography.xs },\n text: { fontFamily: typography.body.fontFamily },\n });\n}\n\nfunction formatPageNumber(\n format: string,\n pageNumber: number,\n totalPages: number\n): string {\n return format\n .replace(\"{page}\", String(pageNumber))\n .replace(\"{total}\", String(totalPages));\n}\n\nexport function PdfPageNumber({\n format = \"Page {page} of {total}\",\n align = \"center\",\n size = \"sm\",\n fixed = false,\n muted = true,\n style,\n}: PdfPageNumberProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createPageNumberStyles(theme), [theme]);\n const alignMap = {\n center: styles.alignCenter,\n left: styles.alignLeft,\n right: styles.alignRight,\n } as Record<PageNumberAlign, Style>;\n const sizeMap = {\n md: styles.sizeMd,\n sm: styles.sizeSm,\n xs: styles.sizeXs,\n } as Record<PageNumberSize, Style>;\n const textStyles: Style[] = [\n styles.text,\n alignMap[align],\n sizeMap[size],\n muted ? styles.colorMuted : styles.colorForeground,\n ];\n if (style) {textStyles.push(...[style].flat());}\n return (\n <View style={styles.container}>\n <PDFText style={textStyles}>\n {format.split(/({page}|{total})/).map((part, i) => {\n if (part === \"{page}\") {return <span key={i} className=\"pageNumber\" />;}\n if (part === \"{total}\")\n {return <span key={i} className=\"totalPages\" />;}\n return <span key={i}>{part}</span>;\n })}\n </PDFText>\n </View>\n );\n}\n",- "type": "registry:component"+ "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type PageNumberAlign = \"left\" | \"center\" | \"right\";\nexport type PageNumberSize = \"xs\" | \"sm\" | \"md\";\n\n/**\n * Auto page number rendered with a configurable format string at a or inline position.\n * Props - `format` | `align` | `size` | `fixed` | `muted` | `style`\n * @see {@link PdfPageNumberProps}\n */\nexport interface PdfPageNumberProps extends Omit<\n PDFComponentProps,\n \"children\"\n> {\n /**\n * Format string — use `{page}` for current page and `{total}` for total page count.\n * @default 'Page {page} of {total}'\n */\n format?: string;\n /**\n * @default 'center'\n */\n align?: PageNumberAlign;\n /**\n * @default 'sm'\n */\n size?: PageNumberSize;\n /**\n * @default false\n */\n fixed?: boolean;\n /**\n * @default true\n */\n muted?: boolean;\n children?: never;\n}\n\nconst createPageNumberStyles = (t: PdfcnTheme) => {\n const { typography, colors, primitives } = t;\n return StyleSheet.create({\n alignCenter: { textAlign: \"center\" },\n alignLeft: { textAlign: \"left\" },\n alignRight: { textAlign: \"right\" },\n colorForeground: { color: colors.foreground },\n colorMuted: { color: colors.mutedForeground },\n container: { 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}>\n {format.split(/({page}|{total})/).map((part, i) => {\n if (part === \"{page}\") {\n return <span key={i} className=\"pageNumber\" />;\n }\n if (part === \"{total}\") {\n return <span key={i} className=\"totalPages\" />;\n }\n return <span key={i}>{part}</span>;\n })}\n </PDFText>\n </View>\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/page-number/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/pdf-image.json b/public/r/takumi/pdf-image.jsonindex 5e031ea..6d74980 100644--- a/public/r/takumi/pdf-image.json+++ b/public/r/takumi/pdf-image.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/takumi/components/pdf-image/pdf-image.tsx",- "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n Image,\n} from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\n/** HTTP method used when fetching the image from a URL. */\nexport type PdfImageHTTPMethod =\n | \"GET\"\n | \"HEAD\"\n | \"POST\"\n | \"PUT\"\n | \"DELETE\"\n | \"PATCH\";\n\nexport type PdfImageSrc =\n | string\n | {\n uri: string;\n method?: PdfImageHTTPMethod;\n headers?: Record<string, string>;\n body?: string;\n };\n\nexport type PdfImageFit = \"cover\" | \"contain\" | \"fill\" | \"none\";\n\nexport type PdfImageVariant =\n | \"default\"\n | \"full-width\"\n | \"thumbnail\"\n | \"avatar\"\n | \"cover\"\n | \"bordered\"\n | \"rounded\";\n\n/**\n * Image element with layout presets, caption, and aspect ratio support.\n * Props - `src` | `variant` | `width` | `height` | `fit` | `position` | `caption` | `aspectRatio` | `borderRadius` | `noWrap` | `style`\n * @see {@link PdfImageProps}\n */\nexport interface PdfImageProps {\n src: PdfImageSrc;\n /**\n * @default 'default'\n */\n variant?: PdfImageVariant;\n width?: number | string;\n height?: number | string;\n fit?: PdfImageFit;\n /**\n * @default '50% 50%'\n */\n position?: string;\n caption?: string;\n aspectRatio?: number;\n borderRadius?: number;\n /**\n * @default true\n */\n noWrap?: boolean;\n style?: Style;\n}\n\ninterface VariantDefaults {\n width?: number | string;\n height?: number | string;\n fit: PdfImageFit;\n borderRadius?: number;\n}\n\nconst VARIANT_DEFAULTS: Record<PdfImageVariant, VariantDefaults> = {\n avatar: { borderRadius: 999, fit: \"cover\", height: 48, width: 48 },\n bordered: { fit: \"contain\", width: \"100%\" },\n cover: { fit: \"cover\", height: 160, width: \"100%\" },\n default: { fit: \"contain\" },\n \"full-width\": { fit: \"cover\", width: \"100%\" },\n rounded: { borderRadius: 8, fit: \"contain\", width: 200 },\n thumbnail: { fit: \"cover\", height: 80, width: 80 },\n};\n\nconst UNSUPPORTED_FORMATS = new Set([\"webp\", \"avif\", \"heic\", \"heif\", \"ico\"]);\n\nfunction detectFormat(src: PdfImageSrc): string | null {\n if (typeof src !== \"string\") return null;\n const dataMatch = src.match(/^data:image\\/([a-zA-Z0-9+.-]+)/);\n if (dataMatch) return dataMatch[1].toLowerCase();\n return src.split(\"?\")[0].split(\".\").pop()?.toLowerCase() ?? null;\n}\n\nfunction warnIfUnsupported(src: PdfImageSrc): void {\n const fmt = detectFormat(src);\n if (fmt && UNSUPPORTED_FORMATS.has(fmt)) {\n console.warn(\n `[PdfImage] Unsupported format \"${fmt}\" detected. react-pdf supports: JPEG, PNG, GIF (first frame), BMP, SVG. Convert to PNG or JPEG before use.`\n );\n }\n}\n\nfunction createImageStyles(t: PdfcnTheme) {\n const { spacing } = t.primitives;\n return StyleSheet.create({\n caption: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginTop: spacing[1],\n textAlign: \"center\",\n },\n container: { flexDirection: \"column\" },\n image: {},\n imageBordered: {\n borderColor: t.colors.border,\n borderStyle: \"solid\",\n borderWidth: 1,\n },\n });\n}\n\nexport function PdfImage({\n src,\n variant = \"default\",\n width,\n height,\n fit,\n position = \"50% 50%\",\n caption,\n aspectRatio,\n borderRadius,\n noWrap = true,\n style,\n}: PdfImageProps) {\n warnIfUnsupported(src);\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createImageStyles(theme), [theme]);\n const defaults = VARIANT_DEFAULTS[variant];\n\n const resolvedWidth = width ?? defaults.width;\n const resolvedHeight: number | string | undefined = (() => {\n if (height !== undefined) {return height;}\n if (defaults.height !== undefined) {return defaults.height;}\n if (aspectRatio !== undefined && typeof resolvedWidth === \"number\")\n {return resolvedWidth / aspectRatio;}\n return;\n })();\n\n const resolvedFit = fit ?? defaults.fit;\n const resolvedRadius = borderRadius ?? defaults.borderRadius;\n\n const imageStyles: Style[] = [styles.image];\n if (resolvedWidth !== undefined)\n {imageStyles.push({ width: resolvedWidth } as Style);}\n if (resolvedHeight !== undefined)\n {imageStyles.push({ height: resolvedHeight } as Style);}\n imageStyles.push({\n objectFit: resolvedFit,\n objectPosition: position,\n } as Style);\n if (resolvedRadius !== undefined)\n {imageStyles.push({ borderRadius: resolvedRadius } as Style);}\n if (variant === \"bordered\") {imageStyles.push(styles.imageBordered);}\n if (style) {imageStyles.push(style);}\n\n const content = (\n <View style={styles.container}>\n <Image src={src} style={imageStyles} />\n {caption ? <PDFText style={styles.caption}>{caption}</PDFText> : null}\n </View>\n );\n\n return noWrap ? (\n <View style={[{ breakInside: \"avoid\" as const }].filter(Boolean)}>\n {content}\n </View>\n ) : (\n content\n );\n}\n",- "type": "registry:component"+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport {\n View,\n Text as PDFText,\n StyleSheet,\n Image,\n} from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\n/** HTTP method used when fetching the image from a URL. */\nexport type PdfImageHTTPMethod =\n | \"GET\"\n | \"HEAD\"\n | \"POST\"\n | \"PUT\"\n | \"DELETE\"\n | \"PATCH\";\n\nexport type PdfImageSrc =\n | string\n | {\n uri: string;\n method?: PdfImageHTTPMethod;\n headers?: Record<string, string>;\n body?: string;\n };\n\nexport type PdfImageFit = \"cover\" | \"contain\" | \"fill\" | \"none\";\n\nexport type PdfImageVariant =\n | \"default\"\n | \"full-width\"\n | \"thumbnail\"\n | \"avatar\"\n | \"cover\"\n | \"bordered\"\n | \"rounded\";\n\n/**\n * Image element with layout presets, caption, and aspect ratio support.\n * Props - `src` | `variant` | `width` | `height` | `fit` | `position` | `caption` | `aspectRatio` | `borderRadius` | `noWrap` | `style`\n * @see {@link PdfImageProps}\n */\nexport interface PdfImageProps {\n src: PdfImageSrc;\n /**\n * @default 'default'\n */\n variant?: PdfImageVariant;\n width?: number | string;\n height?: number | string;\n fit?: PdfImageFit;\n /**\n * @default '50% 50%'\n */\n position?: string;\n caption?: string;\n aspectRatio?: number;\n borderRadius?: number;\n /**\n * @default true\n */\n noWrap?: boolean;\n style?: Style;\n}\n\ninterface VariantDefaults {\n width?: number | string;\n height?: number | string;\n fit: PdfImageFit;\n borderRadius?: number;\n}\n\nconst VARIANT_DEFAULTS: Record<PdfImageVariant, VariantDefaults> = {\n avatar: { borderRadius: 999, fit: \"cover\", height: 48, width: 48 },\n bordered: { fit: \"contain\", width: \"100%\" },\n cover: { fit: \"cover\", height: 160, width: \"100%\" },\n default: { fit: \"contain\" },\n \"full-width\": { fit: \"cover\", width: \"100%\" },\n rounded: { borderRadius: 8, fit: \"contain\", width: 200 },\n thumbnail: { fit: \"cover\", height: 80, width: 80 },\n};\n\nconst UNSUPPORTED_FORMATS = new Set([\"webp\", \"avif\", \"heic\", \"heif\", \"ico\"]);\n\nconst detectFormat = (src: PdfImageSrc): string | null => {\n if (typeof src !== \"string\") {\n return null;\n }\n const dataMatch = src.match(/^data:image\\/([a-zA-Z0-9+.-]+)/);\n if (dataMatch) {\n return dataMatch[1].toLowerCase();\n }\n return src.split(\"?\")[0].split(\".\").pop()?.toLowerCase() ?? null;\n};\n\nconst warnIfUnsupported = (src: PdfImageSrc): void => {\n const fmt = detectFormat(src);\n if (fmt && UNSUPPORTED_FORMATS.has(fmt)) {\n console.warn(\n `[PdfImage] Unsupported format \"${fmt}\" detected. react-pdf supports: JPEG, PNG, GIF (first frame), BMP, SVG. Convert to PNG or JPEG before use.`\n );\n }\n};\n\nconst createImageStyles = (t: PdfcnTheme) => {\n const { spacing } = t.primitives;\n return StyleSheet.create({\n caption: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginTop: spacing[1],\n textAlign: \"center\",\n },\n container: { flexDirection: \"column\" },\n image: {},\n imageBordered: {\n borderColor: t.colors.border,\n borderStyle: \"solid\",\n borderWidth: 1,\n },\n });\n};\n\nexport const PdfImage = ({\n src,\n variant = \"default\",\n width,\n height,\n fit,\n position = \"50% 50%\",\n caption,\n aspectRatio,\n borderRadius,\n noWrap = true,\n style,\n}: PdfImageProps) => {\n warnIfUnsupported(src);\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createImageStyles(theme), [theme]);\n const defaults = VARIANT_DEFAULTS[variant];\n\n const resolvedWidth = width ?? defaults.width;\n const resolvedHeight: number | string | undefined = (() => {\n if (height !== undefined) {\n return height;\n }\n if (defaults.height !== undefined) {\n return defaults.height;\n }\n if (aspectRatio !== undefined && typeof resolvedWidth === \"number\") {\n return resolvedWidth / aspectRatio;\n }\n })();\n\n const resolvedFit = fit ?? defaults.fit;\n const resolvedRadius = borderRadius ?? defaults.borderRadius;\n\n const imageStyles: Style[] = [styles.image];\n if (resolvedWidth !== undefined) {\n imageStyles.push({ width: resolvedWidth } as Style);\n }\n if (resolvedHeight !== undefined) {\n imageStyles.push({ height: resolvedHeight } as Style);\n }\n imageStyles.push({\n objectFit: resolvedFit,\n objectPosition: position,\n } as Style);\n if (resolvedRadius !== undefined) {\n imageStyles.push({ borderRadius: resolvedRadius } as Style);\n }\n if (variant === \"bordered\") {\n imageStyles.push(styles.imageBordered);\n }\n if (style) {\n imageStyles.push(style);\n }\n\n const content = (\n <View style={styles.container}>\n <Image src={src} style={imageStyles} />\n {caption ? <PDFText style={styles.caption}>{caption}</PDFText> : null}\n </View>\n );\n\n return noWrap ? (\n <View style={[{ breakInside: \"avoid\" as const }].filter(Boolean)}>\n {content}\n </View>\n ) : (\n content\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/pdf-image/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/qrcode.json b/public/r/takumi/qrcode.jsonindex ef1d5cd..5345c0b 100644--- a/public/r/takumi/qrcode.json+++ b/public/r/takumi/qrcode.json@@ -14,13 +14,15 @@"files": [{"path": "registry/bases/takumi/components/qrcode/qrcode.tsx",- "content": "import QRCode from \"qrcode\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\nimport { Rect, Svg } from \"../../lib/takumi-svg\";\n\nexport type QRCodeErrorLevel = \"L\" | \"M\" | \"Q\" | \"H\";\n\n/**\n * QR code rendered as an SVG grid for use in PDF documents.\n * Props - `value` | `size` | `color` | `backgroundColor` | `errorLevel` | `margin` | `caption` | `style`\n * @see {@link PdfQRCodeProps}\n */\nexport interface PdfQRCodeProps extends Omit<PDFComponentProps, \"children\"> {\n value: string;\n size?: number;\n color?: string;\n backgroundColor?: string;\n errorLevel?: QRCodeErrorLevel;\n margin?: number;\n caption?: string;\n children?: never;\n}\n\nfunction createQRCodeStyles(t: PdfcnTheme) {\n const { spacing } = t.primitives;\n return StyleSheet.create({\n caption: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginTop: spacing[1],\n textAlign: \"center\",\n },\n container: { alignItems: \"center\" },\n });\n}\n\nfunction generateQRMatrix(\n value: string,\n errorLevel: QRCodeErrorLevel,\n margin: number\n): boolean[][] {\n const qr = QRCode.create(value, { errorCorrectionLevel: errorLevel });\n const { size, data } = qr.modules;\n const totalSize = size + margin * 2;\n const matrix: boolean[][] = [];\n for (let row = 0; row < totalSize; row++) {\n const rowData: boolean[] = [];\n for (let col = 0; col < totalSize; col++) {\n const isInMargin =\n row < margin ||\n row >= size + margin ||\n col < margin ||\n col >= size + margin;\n if (isInMargin) {\n rowData.push(false);\n } else {\n rowData.push(data[(row - margin) * size + (col - margin)] === 1);\n }\n }\n matrix.push(rowData);\n }\n return matrix;\n}\n\nexport function PdfQRCode({\n value,\n size = 100,\n color = \"#000000\",\n backgroundColor = \"#ffffff\",\n errorLevel = \"M\",\n margin = 2,\n caption,\n style,\n}: PdfQRCodeProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createQRCodeStyles(theme), [theme]);\n const matrix = useSafeMemo(\n () => generateQRMatrix(value, errorLevel, margin),\n [value, errorLevel, margin]\n );\n const moduleSize = size / matrix.length;\n const resolvedColor = resolveColor(color, theme.colors);\n const resolvedBgColor =\n backgroundColor === \"transparent\"\n ? undefined\n : resolveColor(backgroundColor, theme.colors);\n const containerStyles: Style[] = [styles.container];\n if (style) {containerStyles.push(...[style].flat());}\n\n return (\n <View style={containerStyles}>\n <Svg width={size} height={size} viewBox={`0 0 ${size} ${size}`}>\n {resolvedBgColor !== undefined && (\n <Rect x={0} y={0} width={size} height={size} fill={resolvedBgColor} />\n )}\n {matrix\n .flatMap((row, y) =>\n row\n .map((isDark, x) => (isDark ? { x, y } : null))\n .filter((pos): pos is { x: number; y: number } => pos !== null)\n )\n .map((pos) => (\n <Rect\n key={`qr-${pos.y}-${pos.x}`}\n x={pos.x * moduleSize}\n y={pos.y * moduleSize}\n width={moduleSize}\n height={moduleSize}\n fill={resolvedColor}\n />\n ))}\n </Svg>\n {caption && <PDFText style={styles.caption}>{caption}</PDFText>}\n </View>\n );\n}\n",- "type": "registry:component"+ "content": "import QRCode from \"qrcode\";\n\nimport type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\nimport { Rect, Svg } from \"../../lib/takumi-svg\";\n\nexport type QRCodeErrorLevel = \"L\" | \"M\" | \"Q\" | \"H\";\n\n/**\n * QR code rendered as an SVG grid for use in PDF documents.\n * Props - `value` | `size` | `color` | `backgroundColor` | `errorLevel` | `margin` | `caption` | `style`\n * @see {@link PdfQRCodeProps}\n */\nexport interface PdfQRCodeProps extends Omit<PDFComponentProps, \"children\"> {\n value: string;\n size?: number;\n color?: string;\n backgroundColor?: string;\n errorLevel?: QRCodeErrorLevel;\n margin?: number;\n caption?: string;\n children?: never;\n}\n\nconst createQRCodeStyles = (t: PdfcnTheme) => {\n const { spacing } = t.primitives;\n return StyleSheet.create({\n caption: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.primitives.typography.xs,\n marginTop: spacing[1],\n textAlign: \"center\",\n },\n container: { alignItems: \"center\" },\n });\n};\n\nconst generateQRMatrix = (\n value: string,\n errorLevel: QRCodeErrorLevel,\n margin: number\n): boolean[][] => {\n const qr = QRCode.create(value, { errorCorrectionLevel: errorLevel });\n const { size, data } = qr.modules;\n const totalSize = size + margin * 2;\n const matrix: boolean[][] = [];\n for (let row = 0; row < totalSize; row += 1) {\n const rowData: boolean[] = [];\n for (let col = 0; col < totalSize; col += 1) {\n const isInMargin =\n row < margin ||\n row >= size + margin ||\n col < margin ||\n col >= size + margin;\n if (isInMargin) {\n rowData.push(false);\n } else {\n rowData.push(data[(row - margin) * size + (col - margin)] === 1);\n }\n }\n matrix.push(rowData);\n }\n return matrix;\n};\n\nexport const PdfQRCode = ({\n value,\n size = 100,\n color = \"#000000\",\n backgroundColor = \"#ffffff\",\n errorLevel = \"M\",\n margin = 2,\n caption,\n style,\n}: PdfQRCodeProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createQRCodeStyles(theme), [theme]);\n const matrix = useSafeMemo(\n () => generateQRMatrix(value, errorLevel, margin),\n [value, errorLevel, margin]\n );\n const moduleSize = size / matrix.length;\n const resolvedColor = resolveColor(color, theme.colors);\n const resolvedBgColor =\n backgroundColor === \"transparent\"\n ? undefined\n : resolveColor(backgroundColor, theme.colors);\n const containerStyles: Style[] = [styles.container];\n if (style) {\n containerStyles.push(...[style].flat());\n }\n\n return (\n <View style={containerStyles}>\n <Svg width={size} height={size} viewBox={`0 0 ${size} ${size}`}>\n {resolvedBgColor !== undefined && (\n <Rect x={0} y={0} width={size} height={size} fill={resolvedBgColor} />\n )}\n {matrix\n .flatMap((row, y) =>\n row\n .map((isDark, x) => (isDark ? { x, y } : null))\n .filter((pos): pos is { x: number; y: number } => pos !== null)\n )\n .map((pos) => (\n <Rect\n key={`qr-${pos.y}-${pos.x}`}\n x={pos.x * moduleSize}\n y={pos.y * moduleSize}\n width={moduleSize}\n height={moduleSize}\n fill={resolvedColor}\n />\n ))}\n </Svg>\n {caption && <PDFText style={styles.caption}>{caption}</PDFText>}\n </View>\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/qrcode/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/report-financial.json b/public/r/takumi/report-financial.jsonindex 2f15e01..2a0e17f 100644--- a/public/r/takumi/report-financial.json+++ b/public/r/takumi/report-financial.json@@ -13,18 +13,21 @@"files": [{"path": "registry/bases/takumi/blocks/report-financial/report-financial.tsx",- "content": "import { ReportTemplateFrame } from './report-layout';\nimport type { ReportTemplateProps } from './report-layout';\nimport type { BaseReportData } from \"./report.types\";\n\nconst sampleFinancialData: BaseReportData = {\n author: \"Finance Ops\",\n generatedAt: \"February 23, 2026\",\n highlights: [\n \"Revenue accelerated after enterprise expansion campaign launch.\",\n \"Gross margin improved due to infrastructure cost renegotiation.\",\n \"Collections requires executive follow-up on two overdue accounts.\",\n ],\n period: \"Q1 2026\",\n rows: [\n {\n label: \"Enterprise Sales\",\n owner: \"A. Patel\",\n status: \"On Track\",\n progress: 88,\n risk: \"Low\",\n },\n {\n label: \"SMB Sales\",\n owner: \"L. Khan\",\n status: \"On Track\",\n progress: 79,\n risk: \"Medium\",\n },\n {\n label: \"Collections\",\n owner: \"J. Reyes\",\n status: \"At Risk\",\n progress: 63,\n risk: \"High\",\n },\n {\n label: \"Cost Optimization\",\n owner: \"K. Singh\",\n status: \"On Track\",\n progress: 82,\n risk: \"Low\",\n },\n ],\n series: [\n { label: \"W1\", value: 72 },\n { label: \"W2\", value: 74 },\n { label: \"W3\", value: 76 },\n { label: \"W4\", value: 77 },\n { label: \"W5\", value: 79 },\n { label: \"W6\", value: 80 },\n { label: \"W7\", value: 81 },\n { label: \"W8\", value: 83 },\n { label: \"W9\", value: 82 },\n { label: \"W10\", value: 84 },\n { label: \"W11\", value: 86 },\n { label: \"W12\", value: 88 },\n ],\n subtitle: \"Revenue, margin, and expense control overview\",\n summary: [\n { label: \"Revenue\", value: \"$2.48M\", trend: \"+14.2% QoQ\", tone: \"success\" },\n {\n label: \"Gross Margin\",\n value: \"61.8%\",\n trend: \"+2.1 pts\",\n tone: \"success\",\n },\n { label: \"Opex\", value: \"$0.93M\", trend: \"-3.4% QoQ\", tone: \"success\" },\n { label: \"Runway\", value: \"22 months\", trend: \"Stable\", tone: \"info\" },\n ],\n title: \"Quarterly Financial Report\",\n};\n\nexport function FinancialReportDocument({\n theme,\n data = sampleFinancialData,\n}: ReportTemplateProps) {\n return (\n <ReportTemplateFrame\n theme={theme}\n data={data}\n titlePrefix=\"Financial Report\"\n statusLabel=\"Finance: Healthy\"\n statusTone=\"success\"\n graphVariant=\"line\"\n graphTitle=\"Revenue trajectory\"\n graphSubtitle=\"Quarterly weighted revenue index\"\n graphLegend=\"none\"\n graphColors={[\"#0F172A\"]}\n />\n );\n}\n",- "type": "registry:block"+ "content": "import { ReportTemplateFrame } from \"./report-layout\";\nimport type { ReportTemplateProps } from \"./report-layout\";\nimport type { BaseReportData } from \"./report.types\";\n\nconst sampleFinancialData: BaseReportData = {\n author: \"Finance Ops\",\n generatedAt: \"February 23, 2026\",\n highlights: [\n \"Revenue accelerated after enterprise expansion campaign launch.\",\n \"Gross margin improved due to infrastructure cost renegotiation.\",\n \"Collections requires executive follow-up on two overdue accounts.\",\n ],\n period: \"Q1 2026\",\n rows: [\n {\n label: \"Enterprise Sales\",\n owner: \"A. Patel\",\n progress: 88,\n risk: \"Low\",\n status: \"On Track\",\n },\n {\n label: \"SMB Sales\",\n owner: \"L. Khan\",\n progress: 79,\n risk: \"Medium\",\n status: \"On Track\",\n },\n {\n label: \"Collections\",\n owner: \"J. Reyes\",\n progress: 63,\n risk: \"High\",\n status: \"At Risk\",\n },\n {\n label: \"Cost Optimization\",\n owner: \"K. Singh\",\n progress: 82,\n risk: \"Low\",\n status: \"On Track\",\n },\n ],\n series: [\n { label: \"W1\", value: 72 },\n { label: \"W2\", value: 74 },\n { label: \"W3\", value: 76 },\n { label: \"W4\", value: 77 },\n { label: \"W5\", value: 79 },\n { label: \"W6\", value: 80 },\n { label: \"W7\", value: 81 },\n { label: \"W8\", value: 83 },\n { label: \"W9\", value: 82 },\n { label: \"W10\", value: 84 },\n { label: \"W11\", value: 86 },\n { label: \"W12\", value: 88 },\n ],\n subtitle: \"Revenue, margin, and expense control overview\",\n summary: [\n { label: \"Revenue\", tone: \"success\", trend: \"+14.2% QoQ\", value: \"$2.48M\" },\n {\n label: \"Gross Margin\",\n tone: \"success\",\n trend: \"+2.1 pts\",\n value: \"61.8%\",\n },\n { label: \"Opex\", tone: \"success\", trend: \"-3.4% QoQ\", value: \"$0.93M\" },\n { label: \"Runway\", tone: \"info\", trend: \"Stable\", value: \"22 months\" },\n ],\n title: \"Quarterly Financial Report\",\n};\n\nexport const FinancialReportDocument = ({\n theme,\n data = sampleFinancialData,\n}: ReportTemplateProps) => (\n <ReportTemplateFrame\n theme={theme}\n data={data}\n titlePrefix=\"Financial Report\"\n statusLabel=\"Finance: Healthy\"\n statusTone=\"success\"\n graphVariant=\"line\"\n graphTitle=\"Revenue trajectory\"\n graphSubtitle=\"Quarterly weighted revenue index\"\n graphLegend=\"none\"\n graphColors={[\"#0F172A\"]}\n />\n);\n",+ "type": "registry:block",+ "target": "components/pdf/blocks/report-financial/report-financial.tsx"},{"path": "registry/bases/takumi/blocks/report-financial/report-layout.tsx",- "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n Badge,\n DataTable,\n Divider,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Stack,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { BaseReportData } from \"./report.types\";\n\nexport interface ReportTemplateProps {\n theme?: PdfcnTheme;\n data?: BaseReportData;\n}\n\ntype ReportGraphVariant =\n | \"bar\"\n | \"horizontal-bar\"\n | \"line\"\n | \"area\"\n | \"pie\"\n | \"donut\";\n\ninterface ReportLayoutProps {\n data: BaseReportData;\n titlePrefix: string;\n statusLabel: string;\n statusTone: \"success\" | \"warning\" | \"destructive\" | \"info\";\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: \"bottom\" | \"right\" | \"none\";\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: { label: string; value: number }[];\n}\n\nfunction toneColor(\n theme: PdfcnTheme,\n tone: \"success\" | \"warning\" | \"destructive\" | \"info\"\n) {\n if (tone === \"success\") {return theme.colors.success;}\n if (tone === \"warning\") {return theme.colors.warning;}\n if (tone === \"destructive\") {return theme.colors.destructive;}\n return theme.colors.info;\n}\n\nexport function ReportLayout({\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend = \"none\",\n graphShowValues = false,\n graphColors,\n graphData,\n}: ReportLayoutProps) {\n const theme = usePdfcnTheme();\n const accent = toneColor(theme, statusTone);\n\n const styles = StyleSheet.create({\n col: {\n flex: 1,\n },\n graphShell: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 12,\n },\n metricCard: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 8,\n width: \"48.6%\",\n },\n metricLabel: {\n color: theme.colors.mutedForeground,\n fontSize: 8,\n letterSpacing: 0.5,\n marginBottom: 2,\n textTransform: \"uppercase\",\n },\n metricTrend: {\n color: theme.colors.mutedForeground,\n fontSize: 9,\n },\n metricValue: {\n color: theme.colors.foreground,\n fontSize: 14,\n fontWeight: theme.primitives.fontWeights.bold,\n marginBottom: 2,\n },\n metricsGrid: {\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n paddingBottom: theme.spacing.page.marginBottom,\n paddingLeft: theme.spacing.page.marginLeft,\n paddingRight: theme.spacing.page.marginRight,\n paddingTop: theme.spacing.page.marginTop,\n },\n toolbar: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: 8,\n },\n twoColumn: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n gap: 10,\n },\n });\n\n return (\n <Document title={`${titlePrefix} ${data.period}`}>\n <Page size=\"A4\" style={styles.page}>\n <PageHeader\n variant=\"two-column\"\n title={data.title}\n subtitle={`${titlePrefix} · ${data.subtitle}`}\n rightText={data.period}\n rightSubText={`Generated ${data.generatedAt}`}\n marginBottom={14}\n />\n\n <View style={styles.toolbar}>\n <Badge label={statusLabel} variant={statusTone} size=\"sm\" />\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Author: {data.author}\n </Text>\n </View>\n\n <Section variant=\"card\" padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Executive Summary\n </Text>\n <View style={styles.metricsGrid}>\n {data.summary.map((metric) => (\n <View\n key={metric.label}\n style={[\n styles.metricCard,\n {\n borderLeftColor: metric.tone\n ? toneColor(theme, metric.tone)\n : accent,\n borderLeftWidth: 3,\n },\n ]}\n >\n <Text style={styles.metricLabel} noMargin>\n {metric.label}\n </Text>\n <Text style={styles.metricValue} noMargin>\n {metric.value}\n </Text>\n {metric.trend ? (\n <Badge\n label={metric.trend}\n size=\"sm\"\n variant={metric.tone ?? \"info\"}\n />\n ) : null}\n </View>\n ))}\n </View>\n </Section>\n\n <Section padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View style={styles.graphShell}>\n <PdfGraph\n variant={graphVariant}\n data={graphData ?? data.series}\n title={graphTitle}\n subtitle={graphSubtitle}\n yLabel={undefined}\n xLabel={undefined}\n showGrid={graphVariant !== \"pie\" && graphVariant !== \"donut\"}\n showValues={graphShowValues}\n smooth={graphVariant === \"line\" || graphVariant === \"area\"}\n legend={graphLegend}\n height={200}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section padding=\"md\">\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Delivery Table\n </Text>\n <DataTable\n variant=\"compact\"\n size=\"compact\"\n stripe\n columns={[\n { header: \"Stream\", key: \"label\" },\n { header: \"Owner\", key: \"owner\" },\n { align: \"center\", header: \"Status\", key: \"status\" },\n {\n align: \"right\",\n header: \"Progress\",\n key: \"progress\",\n render: (value) => `${String(value)}%`,\n },\n { align: \"right\", header: \"Risk\", key: \"risk\" },\n ]}\n data={data.rows}\n footer={{\n label: \"Totals\",\n owner: \"-\",\n progress: Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n ),\n risk: \"-\",\n status: \"-\",\n }}\n />\n </Section>\n\n <Section padding=\"md\" variant=\"card\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Highlights & Risks\n </Text>\n <View style={styles.twoColumn}>\n <View style={styles.col}>\n <PdfList\n variant=\"checklist\"\n items={data.highlights.map((item) => ({\n checked: true,\n text: item,\n }))}\n gap=\"sm\"\n />\n </View>\n <View style={styles.col}>\n <KeyValue\n size=\"sm\"\n divided\n items={[\n {\n key: \"Open Risks\",\n value: `${data.rows.filter((r) => r.risk !== \"Low\").length}`,\n },\n {\n key: \"On-Track Streams\",\n value: `${data.rows.filter((r) => r.status === \"On Track\").length}/${data.rows.length}`,\n },\n {\n key: \"Average Progress\",\n value: `${Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n )}%`,\n },\n ]}\n />\n </View>\n </View>\n <Divider />\n <Stack gap=\"sm\">\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: keep each section under one page using `noWrap` for\n concise blocks.\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: pass explicit row keys/owners to avoid ambiguous\n reporting handoffs.\n </Text>\n </Stack>\n </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with PDFx\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </Page>\n </Document>\n );\n}\n\nexport function ReportTemplateFrame({\n theme,\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend,\n graphShowValues,\n graphColors,\n graphData,\n}: ReportTemplateProps & {\n titlePrefix: string;\n statusLabel: string;\n statusTone: \"success\" | \"warning\" | \"destructive\" | \"info\";\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: \"bottom\" | \"right\" | \"none\";\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: { label: string; value: number }[];\n}) {\n if (!data) {return null;}\n\n return (\n <PdfcnThemeProvider theme={theme}>\n <ReportLayout\n data={data}\n titlePrefix={titlePrefix}\n statusLabel={statusLabel}\n statusTone={statusTone}\n graphVariant={graphVariant}\n graphTitle={graphTitle}\n graphSubtitle={graphSubtitle}\n graphLegend={graphLegend}\n graphShowValues={graphShowValues}\n graphColors={graphColors}\n graphData={graphData}\n />\n </PdfcnThemeProvider>\n );\n}\n",- "type": "registry:block"+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n Badge,\n DataTable,\n Divider,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Stack,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { BaseReportData } from \"./report.types\";\n\nexport interface ReportTemplateProps {\n theme?: PdfcnTheme;\n data?: BaseReportData;\n}\n\ntype ReportGraphVariant =\n | \"bar\"\n | \"horizontal-bar\"\n | \"line\"\n | \"area\"\n | \"pie\"\n | \"donut\";\n\ninterface ReportLayoutProps {\n data: BaseReportData;\n titlePrefix: string;\n statusLabel: string;\n statusTone: \"success\" | \"warning\" | \"destructive\" | \"info\";\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: \"bottom\" | \"right\" | \"none\";\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: { label: string; value: number }[];\n}\n\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\n const styles = StyleSheet.create({\n col: {\n flex: 1,\n },\n graphShell: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 12,\n },\n metricCard: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 8,\n width: \"48.6%\",\n },\n metricLabel: {\n color: theme.colors.mutedForeground,\n fontSize: 8,\n letterSpacing: 0.5,\n marginBottom: 2,\n textTransform: \"uppercase\",\n },\n metricTrend: {\n color: theme.colors.mutedForeground,\n fontSize: 9,\n },\n metricValue: {\n color: theme.colors.foreground,\n fontSize: 14,\n fontWeight: theme.primitives.fontWeights.bold,\n marginBottom: 2,\n },\n metricsGrid: {\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n paddingBottom: theme.spacing.page.marginBottom,\n paddingLeft: theme.spacing.page.marginLeft,\n paddingRight: theme.spacing.page.marginRight,\n paddingTop: theme.spacing.page.marginTop,\n },\n toolbar: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: 8,\n },\n twoColumn: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n gap: 10,\n },\n });\n\n return (\n <Document title={`${titlePrefix} ${data.period}`}>\n <Page size=\"A4\" style={styles.page}>\n <PageHeader\n variant=\"two-column\"\n title={data.title}\n subtitle={`${titlePrefix} · ${data.subtitle}`}\n rightText={data.period}\n rightSubText={`Generated ${data.generatedAt}`}\n marginBottom={14}\n />\n\n <View style={styles.toolbar}>\n <Badge label={statusLabel} variant={statusTone} size=\"sm\" />\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Author: {data.author}\n </Text>\n </View>\n\n <Section variant=\"card\" padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Executive Summary\n </Text>\n <View style={styles.metricsGrid}>\n {data.summary.map((metric) => (\n <View\n key={metric.label}\n style={[\n styles.metricCard,\n {\n borderLeftColor: metric.tone\n ? toneColor(theme, metric.tone)\n : accent,\n borderLeftWidth: 3,\n },\n ]}\n >\n <Text style={styles.metricLabel} noMargin>\n {metric.label}\n </Text>\n <Text style={styles.metricValue} noMargin>\n {metric.value}\n </Text>\n {metric.trend ? (\n <Badge\n label={metric.trend}\n size=\"sm\"\n variant={metric.tone ?? \"info\"}\n />\n ) : null}\n </View>\n ))}\n </View>\n </Section>\n\n <Section padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View style={styles.graphShell}>\n <PdfGraph\n variant={graphVariant}\n data={graphData ?? data.series}\n title={graphTitle}\n subtitle={graphSubtitle}\n yLabel={undefined}\n xLabel={undefined}\n showGrid={graphVariant !== \"pie\" && graphVariant !== \"donut\"}\n showValues={graphShowValues}\n smooth={graphVariant === \"line\" || graphVariant === \"area\"}\n legend={graphLegend}\n height={200}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section padding=\"md\">\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Delivery Table\n </Text>\n <DataTable\n variant=\"compact\"\n size=\"compact\"\n stripe\n columns={[\n { header: \"Stream\", key: \"label\" },\n { header: \"Owner\", key: \"owner\" },\n { align: \"center\", header: \"Status\", key: \"status\" },\n {\n align: \"right\",\n header: \"Progress\",\n key: \"progress\",\n render: (value) => `${String(value)}%`,\n },\n { align: \"right\", header: \"Risk\", key: \"risk\" },\n ]}\n data={data.rows}\n footer={{\n label: \"Totals\",\n owner: \"-\",\n progress: Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n ),\n risk: \"-\",\n status: \"-\",\n }}\n />\n </Section>\n\n <Section padding=\"md\" variant=\"card\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Highlights & Risks\n </Text>\n <View style={styles.twoColumn}>\n <View style={styles.col}>\n <PdfList\n variant=\"checklist\"\n items={data.highlights.map((item) => ({\n checked: true,\n text: item,\n }))}\n gap=\"sm\"\n />\n </View>\n <View style={styles.col}>\n <KeyValue\n size=\"sm\"\n divided\n items={[\n {\n key: \"Open Risks\",\n value: `${data.rows.filter((r) => r.risk !== \"Low\").length}`,\n },\n {\n key: \"On-Track Streams\",\n value: `${data.rows.filter((r) => r.status === \"On Track\").length}/${data.rows.length}`,\n },\n {\n key: \"Average Progress\",\n value: `${Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n )}%`,\n },\n ]}\n />\n </View>\n </View>\n <Divider />\n <Stack gap=\"sm\">\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: keep each section under one page using `noWrap` for\n concise blocks.\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: pass explicit row keys/owners to avoid ambiguous\n reporting handoffs.\n </Text>\n </Stack>\n </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with PDFx\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </Page>\n </Document>\n );\n};\n\nexport 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"},{"path": "registry/bases/takumi/blocks/report-financial/report.types.ts","content": "export interface SummaryMetric {\n label: string;\n value: string;\n trend?: string;\n tone?: \"success\" | \"warning\" | \"destructive\" | \"info\";\n}\n\nexport type ReportRow = Record<string, unknown> & {\n label: string;\n owner: string;\n status: string;\n progress: number;\n risk?: string;\n};\n\nexport interface ReportSeriesPoint {\n label: string;\n value: number;\n}\n\nexport interface BaseReportData {\n title: string;\n subtitle: string;\n generatedAt: string;\n period: string;\n author: string;\n summary: SummaryMetric[];\n rows: ReportRow[];\n series: ReportSeriesPoint[];\n highlights: string[];\n}\n",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-financial/report.types.ts"}],"type": "registry:block"diff --git a/public/r/takumi/report-marketing.json b/public/r/takumi/report-marketing.jsonindex ea918a5..45f5df8 100644--- a/public/r/takumi/report-marketing.json+++ b/public/r/takumi/report-marketing.json@@ -13,18 +13,21 @@"files": [{"path": "registry/bases/takumi/blocks/report-marketing/report-layout.tsx",- "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n Badge,\n DataTable,\n Divider,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Stack,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { BaseReportData } from \"./report.types\";\n\nexport interface ReportTemplateProps {\n theme?: PdfcnTheme;\n data?: BaseReportData;\n}\n\ntype ReportGraphVariant =\n | \"bar\"\n | \"horizontal-bar\"\n | \"line\"\n | \"area\"\n | \"pie\"\n | \"donut\";\n\ninterface ReportLayoutProps {\n data: BaseReportData;\n titlePrefix: string;\n statusLabel: string;\n statusTone: \"success\" | \"warning\" | \"destructive\" | \"info\";\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: \"bottom\" | \"right\" | \"none\";\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: { label: string; value: number }[];\n}\n\nfunction toneColor(\n theme: PdfcnTheme,\n tone: \"success\" | \"warning\" | \"destructive\" | \"info\"\n) {\n if (tone === \"success\") {return theme.colors.success;}\n if (tone === \"warning\") {return theme.colors.warning;}\n if (tone === \"destructive\") {return theme.colors.destructive;}\n return theme.colors.info;\n}\n\nexport function ReportLayout({\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend = \"none\",\n graphShowValues = false,\n graphColors,\n graphData,\n}: ReportLayoutProps) {\n const theme = usePdfcnTheme();\n const accent = toneColor(theme, statusTone);\n\n const styles = StyleSheet.create({\n col: {\n flex: 1,\n },\n graphShell: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 12,\n },\n metricCard: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 8,\n width: \"48.6%\",\n },\n metricLabel: {\n color: theme.colors.mutedForeground,\n fontSize: 8,\n letterSpacing: 0.5,\n marginBottom: 2,\n textTransform: \"uppercase\",\n },\n metricTrend: {\n color: theme.colors.mutedForeground,\n fontSize: 9,\n },\n metricValue: {\n color: theme.colors.foreground,\n fontSize: 14,\n fontWeight: theme.primitives.fontWeights.bold,\n marginBottom: 2,\n },\n metricsGrid: {\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n paddingBottom: theme.spacing.page.marginBottom,\n paddingLeft: theme.spacing.page.marginLeft,\n paddingRight: theme.spacing.page.marginRight,\n paddingTop: theme.spacing.page.marginTop,\n },\n toolbar: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: 8,\n },\n twoColumn: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n gap: 10,\n },\n });\n\n return (\n <Document title={`${titlePrefix} ${data.period}`}>\n <Page size=\"A4\" style={styles.page}>\n <PageHeader\n variant=\"two-column\"\n title={data.title}\n subtitle={`${titlePrefix} · ${data.subtitle}`}\n rightText={data.period}\n rightSubText={`Generated ${data.generatedAt}`}\n marginBottom={14}\n />\n\n <View style={styles.toolbar}>\n <Badge label={statusLabel} variant={statusTone} size=\"sm\" />\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Author: {data.author}\n </Text>\n </View>\n\n <Section variant=\"card\" padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Executive Summary\n </Text>\n <View style={styles.metricsGrid}>\n {data.summary.map((metric) => (\n <View\n key={metric.label}\n style={[\n styles.metricCard,\n {\n borderLeftColor: metric.tone\n ? toneColor(theme, metric.tone)\n : accent,\n borderLeftWidth: 3,\n },\n ]}\n >\n <Text style={styles.metricLabel} noMargin>\n {metric.label}\n </Text>\n <Text style={styles.metricValue} noMargin>\n {metric.value}\n </Text>\n {metric.trend ? (\n <Badge\n label={metric.trend}\n size=\"sm\"\n variant={metric.tone ?? \"info\"}\n />\n ) : null}\n </View>\n ))}\n </View>\n </Section>\n\n <Section padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View style={styles.graphShell}>\n <PdfGraph\n variant={graphVariant}\n data={graphData ?? data.series}\n title={graphTitle}\n subtitle={graphSubtitle}\n yLabel={undefined}\n xLabel={undefined}\n showGrid={graphVariant !== \"pie\" && graphVariant !== \"donut\"}\n showValues={graphShowValues}\n smooth={graphVariant === \"line\" || graphVariant === \"area\"}\n legend={graphLegend}\n height={200}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section padding=\"md\">\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Delivery Table\n </Text>\n <DataTable\n variant=\"compact\"\n size=\"compact\"\n stripe\n columns={[\n { header: \"Stream\", key: \"label\" },\n { header: \"Owner\", key: \"owner\" },\n { align: \"center\", header: \"Status\", key: \"status\" },\n {\n align: \"right\",\n header: \"Progress\",\n key: \"progress\",\n render: (value) => `${String(value)}%`,\n },\n { align: \"right\", header: \"Risk\", key: \"risk\" },\n ]}\n data={data.rows}\n footer={{\n label: \"Totals\",\n owner: \"-\",\n progress: Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n ),\n risk: \"-\",\n status: \"-\",\n }}\n />\n </Section>\n\n <Section padding=\"md\" variant=\"card\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Highlights & Risks\n </Text>\n <View style={styles.twoColumn}>\n <View style={styles.col}>\n <PdfList\n variant=\"checklist\"\n items={data.highlights.map((item) => ({\n checked: true,\n text: item,\n }))}\n gap=\"sm\"\n />\n </View>\n <View style={styles.col}>\n <KeyValue\n size=\"sm\"\n divided\n items={[\n {\n key: \"Open Risks\",\n value: `${data.rows.filter((r) => r.risk !== \"Low\").length}`,\n },\n {\n key: \"On-Track Streams\",\n value: `${data.rows.filter((r) => r.status === \"On Track\").length}/${data.rows.length}`,\n },\n {\n key: \"Average Progress\",\n value: `${Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n )}%`,\n },\n ]}\n />\n </View>\n </View>\n <Divider />\n <Stack gap=\"sm\">\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: keep each section under one page using `noWrap` for\n concise blocks.\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: pass explicit row keys/owners to avoid ambiguous\n reporting handoffs.\n </Text>\n </Stack>\n </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with PDFx\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </Page>\n </Document>\n );\n}\n\nexport function ReportTemplateFrame({\n theme,\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend,\n graphShowValues,\n graphColors,\n graphData,\n}: ReportTemplateProps & {\n titlePrefix: string;\n statusLabel: string;\n statusTone: \"success\" | \"warning\" | \"destructive\" | \"info\";\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: \"bottom\" | \"right\" | \"none\";\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: { label: string; value: number }[];\n}) {\n if (!data) {return null;}\n\n return (\n <PdfcnThemeProvider theme={theme}>\n <ReportLayout\n data={data}\n titlePrefix={titlePrefix}\n statusLabel={statusLabel}\n statusTone={statusTone}\n graphVariant={graphVariant}\n graphTitle={graphTitle}\n graphSubtitle={graphSubtitle}\n graphLegend={graphLegend}\n graphShowValues={graphShowValues}\n graphColors={graphColors}\n graphData={graphData}\n />\n </PdfcnThemeProvider>\n );\n}\n",- "type": "registry:block"+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n Badge,\n DataTable,\n Divider,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Stack,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { BaseReportData } from \"./report.types\";\n\nexport interface ReportTemplateProps {\n theme?: PdfcnTheme;\n data?: BaseReportData;\n}\n\ntype ReportGraphVariant =\n | \"bar\"\n | \"horizontal-bar\"\n | \"line\"\n | \"area\"\n | \"pie\"\n | \"donut\";\n\ninterface ReportLayoutProps {\n data: BaseReportData;\n titlePrefix: string;\n statusLabel: string;\n statusTone: \"success\" | \"warning\" | \"destructive\" | \"info\";\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: \"bottom\" | \"right\" | \"none\";\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: { label: string; value: number }[];\n}\n\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\n const styles = StyleSheet.create({\n col: {\n flex: 1,\n },\n graphShell: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 12,\n },\n metricCard: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 8,\n width: \"48.6%\",\n },\n metricLabel: {\n color: theme.colors.mutedForeground,\n fontSize: 8,\n letterSpacing: 0.5,\n marginBottom: 2,\n textTransform: \"uppercase\",\n },\n metricTrend: {\n color: theme.colors.mutedForeground,\n fontSize: 9,\n },\n metricValue: {\n color: theme.colors.foreground,\n fontSize: 14,\n fontWeight: theme.primitives.fontWeights.bold,\n marginBottom: 2,\n },\n metricsGrid: {\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n paddingBottom: theme.spacing.page.marginBottom,\n paddingLeft: theme.spacing.page.marginLeft,\n paddingRight: theme.spacing.page.marginRight,\n paddingTop: theme.spacing.page.marginTop,\n },\n toolbar: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: 8,\n },\n twoColumn: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n gap: 10,\n },\n });\n\n return (\n <Document title={`${titlePrefix} ${data.period}`}>\n <Page size=\"A4\" style={styles.page}>\n <PageHeader\n variant=\"two-column\"\n title={data.title}\n subtitle={`${titlePrefix} · ${data.subtitle}`}\n rightText={data.period}\n rightSubText={`Generated ${data.generatedAt}`}\n marginBottom={14}\n />\n\n <View style={styles.toolbar}>\n <Badge label={statusLabel} variant={statusTone} size=\"sm\" />\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Author: {data.author}\n </Text>\n </View>\n\n <Section variant=\"card\" padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Executive Summary\n </Text>\n <View style={styles.metricsGrid}>\n {data.summary.map((metric) => (\n <View\n key={metric.label}\n style={[\n styles.metricCard,\n {\n borderLeftColor: metric.tone\n ? toneColor(theme, metric.tone)\n : accent,\n borderLeftWidth: 3,\n },\n ]}\n >\n <Text style={styles.metricLabel} noMargin>\n {metric.label}\n </Text>\n <Text style={styles.metricValue} noMargin>\n {metric.value}\n </Text>\n {metric.trend ? (\n <Badge\n label={metric.trend}\n size=\"sm\"\n variant={metric.tone ?? \"info\"}\n />\n ) : null}\n </View>\n ))}\n </View>\n </Section>\n\n <Section padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View style={styles.graphShell}>\n <PdfGraph\n variant={graphVariant}\n data={graphData ?? data.series}\n title={graphTitle}\n subtitle={graphSubtitle}\n yLabel={undefined}\n xLabel={undefined}\n showGrid={graphVariant !== \"pie\" && graphVariant !== \"donut\"}\n showValues={graphShowValues}\n smooth={graphVariant === \"line\" || graphVariant === \"area\"}\n legend={graphLegend}\n height={200}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section padding=\"md\">\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Delivery Table\n </Text>\n <DataTable\n variant=\"compact\"\n size=\"compact\"\n stripe\n columns={[\n { header: \"Stream\", key: \"label\" },\n { header: \"Owner\", key: \"owner\" },\n { align: \"center\", header: \"Status\", key: \"status\" },\n {\n align: \"right\",\n header: \"Progress\",\n key: \"progress\",\n render: (value) => `${String(value)}%`,\n },\n { align: \"right\", header: \"Risk\", key: \"risk\" },\n ]}\n data={data.rows}\n footer={{\n label: \"Totals\",\n owner: \"-\",\n progress: Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n ),\n risk: \"-\",\n status: \"-\",\n }}\n />\n </Section>\n\n <Section padding=\"md\" variant=\"card\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Highlights & Risks\n </Text>\n <View style={styles.twoColumn}>\n <View style={styles.col}>\n <PdfList\n variant=\"checklist\"\n items={data.highlights.map((item) => ({\n checked: true,\n text: item,\n }))}\n gap=\"sm\"\n />\n </View>\n <View style={styles.col}>\n <KeyValue\n size=\"sm\"\n divided\n items={[\n {\n key: \"Open Risks\",\n value: `${data.rows.filter((r) => r.risk !== \"Low\").length}`,\n },\n {\n key: \"On-Track Streams\",\n value: `${data.rows.filter((r) => r.status === \"On Track\").length}/${data.rows.length}`,\n },\n {\n key: \"Average Progress\",\n value: `${Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n )}%`,\n },\n ]}\n />\n </View>\n </View>\n <Divider />\n <Stack gap=\"sm\">\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: keep each section under one page using `noWrap` for\n concise blocks.\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: pass explicit row keys/owners to avoid ambiguous\n reporting handoffs.\n </Text>\n </Stack>\n </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with PDFx\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </Page>\n </Document>\n );\n};\n\nexport 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"},{"path": "registry/bases/takumi/blocks/report-marketing/report-marketing.tsx",- "content": "import { ReportTemplateFrame } from './report-layout';\nimport type { ReportTemplateProps } from './report-layout';\nimport type { BaseReportData } from \"./report.types\";\n\nconst sampleMarketingData: BaseReportData = {\n author: \"Growth Team\",\n generatedAt: \"February 23, 2026\",\n highlights: [\n \"Channel mix improved CAC while maintaining lead quality.\",\n \"Lifecycle email workflow has deliverability issues under investigation.\",\n \"Referral program is producing higher-intent pipeline with lower cost.\",\n ],\n period: \"Campaign Cycle 2026-02\",\n rows: [\n {\n label: \"SEO\",\n owner: \"H. Evans\",\n status: \"On Track\",\n progress: 84,\n risk: \"Low\",\n },\n {\n label: \"Paid Search\",\n owner: \"K. Martin\",\n status: \"On Track\",\n progress: 80,\n risk: \"Low\",\n },\n {\n label: \"Lifecycle Email\",\n owner: \"V. Lee\",\n status: \"At Risk\",\n progress: 64,\n risk: \"Medium\",\n },\n {\n label: \"Partner Referrals\",\n owner: \"J. Gomez\",\n status: \"On Track\",\n progress: 75,\n risk: \"Medium\",\n },\n ],\n series: [\n { label: \"W1\", value: 55 },\n { label: \"W2\", value: 57 },\n { label: \"W3\", value: 59 },\n { label: \"W4\", value: 60 },\n { label: \"W5\", value: 62 },\n { label: \"W6\", value: 63 },\n { label: \"W7\", value: 65 },\n { label: \"W8\", value: 67 },\n { label: \"W9\", value: 66 },\n { label: \"W10\", value: 68 },\n { label: \"W11\", value: 70 },\n { label: \"W12\", value: 72 },\n ],\n subtitle: \"Pipeline, conversion efficiency, and channel performance\",\n summary: [\n { label: \"MQLs\", value: \"3,940\", trend: \"+22.1% cycle\", tone: \"success\" },\n { label: \"CAC\", value: \"$118\", trend: \"-7.4%\", tone: \"success\" },\n { label: \"Win Rate\", value: \"28.6%\", trend: \"+1.1 pts\", tone: \"info\" },\n { label: \"Churn Risk\", value: \"6.2%\", trend: \"+0.8 pts\", tone: \"warning\" },\n ],\n title: \"Growth & Marketing Report\",\n};\n\nexport function MarketingReportDocument({\n theme,\n data = sampleMarketingData,\n}: ReportTemplateProps) {\n return (\n <ReportTemplateFrame\n theme={theme}\n data={data}\n titlePrefix=\"Growth Report\"\n statusLabel=\"Growth: Strong\"\n statusTone=\"success\"\n graphVariant=\"bar\"\n graphTitle=\"Pipeline build by week\"\n graphSubtitle=\"Demand creation output trend\"\n graphLegend=\"none\"\n graphShowValues\n graphColors={[\"#0EA5E9\"]}\n />\n );\n}\n",- "type": "registry:block"+ "content": "import { ReportTemplateFrame } from \"./report-layout\";\nimport type { ReportTemplateProps } from \"./report-layout\";\nimport type { BaseReportData } from \"./report.types\";\n\nconst sampleMarketingData: BaseReportData = {\n author: \"Growth Team\",\n generatedAt: \"February 23, 2026\",\n highlights: [\n \"Channel mix improved CAC while maintaining lead quality.\",\n \"Lifecycle email workflow has deliverability issues under investigation.\",\n \"Referral program is producing higher-intent pipeline with lower cost.\",\n ],\n period: \"Campaign Cycle 2026-02\",\n rows: [\n {\n label: \"SEO\",\n owner: \"H. Evans\",\n progress: 84,\n risk: \"Low\",\n status: \"On Track\",\n },\n {\n label: \"Paid Search\",\n owner: \"K. Martin\",\n progress: 80,\n risk: \"Low\",\n status: \"On Track\",\n },\n {\n label: \"Lifecycle Email\",\n owner: \"V. Lee\",\n progress: 64,\n risk: \"Medium\",\n status: \"At Risk\",\n },\n {\n label: \"Partner Referrals\",\n owner: \"J. Gomez\",\n progress: 75,\n risk: \"Medium\",\n status: \"On Track\",\n },\n ],\n series: [\n { label: \"W1\", value: 55 },\n { label: \"W2\", value: 57 },\n { label: \"W3\", value: 59 },\n { label: \"W4\", value: 60 },\n { label: \"W5\", value: 62 },\n { label: \"W6\", value: 63 },\n { label: \"W7\", value: 65 },\n { label: \"W8\", value: 67 },\n { label: \"W9\", value: 66 },\n { label: \"W10\", value: 68 },\n { label: \"W11\", value: 70 },\n { label: \"W12\", value: 72 },\n ],\n subtitle: \"Pipeline, conversion efficiency, and channel performance\",\n summary: [\n { label: \"MQLs\", tone: \"success\", trend: \"+22.1% cycle\", value: \"3,940\" },\n { label: \"CAC\", tone: \"success\", trend: \"-7.4%\", value: \"$118\" },\n { label: \"Win Rate\", tone: \"info\", trend: \"+1.1 pts\", value: \"28.6%\" },\n { label: \"Churn Risk\", tone: \"warning\", trend: \"+0.8 pts\", value: \"6.2%\" },\n ],\n title: \"Growth & Marketing Report\",\n};\n\nexport const MarketingReportDocument = ({\n theme,\n data = sampleMarketingData,\n}: ReportTemplateProps) => (\n <ReportTemplateFrame\n theme={theme}\n data={data}\n titlePrefix=\"Growth Report\"\n statusLabel=\"Growth: Strong\"\n statusTone=\"success\"\n graphVariant=\"bar\"\n graphTitle=\"Pipeline build by week\"\n graphSubtitle=\"Demand creation output trend\"\n graphLegend=\"none\"\n graphShowValues\n graphColors={[\"#0EA5E9\"]}\n />\n);\n",+ "type": "registry:block",+ "target": "components/pdf/blocks/report-marketing/report-marketing.tsx"},{"path": "registry/bases/takumi/blocks/report-marketing/report.types.ts","content": "export interface SummaryMetric {\n label: string;\n value: string;\n trend?: string;\n tone?: \"success\" | \"warning\" | \"destructive\" | \"info\";\n}\n\nexport type ReportRow = Record<string, unknown> & {\n label: string;\n owner: string;\n status: string;\n progress: number;\n risk?: string;\n};\n\nexport interface ReportSeriesPoint {\n label: string;\n value: number;\n}\n\nexport interface BaseReportData {\n title: string;\n subtitle: string;\n generatedAt: string;\n period: string;\n author: string;\n summary: SummaryMetric[];\n rows: ReportRow[];\n series: ReportSeriesPoint[];\n highlights: string[];\n}\n",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-marketing/report.types.ts"}],"type": "registry:block"diff --git a/public/r/takumi/report-operations.json b/public/r/takumi/report-operations.jsonindex 64d3c18..f82552d 100644--- a/public/r/takumi/report-operations.json+++ b/public/r/takumi/report-operations.json@@ -13,18 +13,21 @@"files": [{"path": "registry/bases/takumi/blocks/report-operations/report-layout.tsx",- "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n Badge,\n DataTable,\n Divider,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Stack,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { BaseReportData } from \"./report.types\";\n\nexport interface ReportTemplateProps {\n theme?: PdfcnTheme;\n data?: BaseReportData;\n}\n\ntype ReportGraphVariant =\n | \"bar\"\n | \"horizontal-bar\"\n | \"line\"\n | \"area\"\n | \"pie\"\n | \"donut\";\n\ninterface ReportLayoutProps {\n data: BaseReportData;\n titlePrefix: string;\n statusLabel: string;\n statusTone: \"success\" | \"warning\" | \"destructive\" | \"info\";\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: \"bottom\" | \"right\" | \"none\";\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: { label: string; value: number }[];\n}\n\nfunction toneColor(\n theme: PdfcnTheme,\n tone: \"success\" | \"warning\" | \"destructive\" | \"info\"\n) {\n if (tone === \"success\") {return theme.colors.success;}\n if (tone === \"warning\") {return theme.colors.warning;}\n if (tone === \"destructive\") {return theme.colors.destructive;}\n return theme.colors.info;\n}\n\nexport function ReportLayout({\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend = \"none\",\n graphShowValues = false,\n graphColors,\n graphData,\n}: ReportLayoutProps) {\n const theme = usePdfcnTheme();\n const accent = toneColor(theme, statusTone);\n\n const styles = StyleSheet.create({\n col: {\n flex: 1,\n },\n graphShell: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 12,\n },\n metricCard: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 8,\n width: \"48.6%\",\n },\n metricLabel: {\n color: theme.colors.mutedForeground,\n fontSize: 8,\n letterSpacing: 0.5,\n marginBottom: 2,\n textTransform: \"uppercase\",\n },\n metricTrend: {\n color: theme.colors.mutedForeground,\n fontSize: 9,\n },\n metricValue: {\n color: theme.colors.foreground,\n fontSize: 14,\n fontWeight: theme.primitives.fontWeights.bold,\n marginBottom: 2,\n },\n metricsGrid: {\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n paddingBottom: theme.spacing.page.marginBottom,\n paddingLeft: theme.spacing.page.marginLeft,\n paddingRight: theme.spacing.page.marginRight,\n paddingTop: theme.spacing.page.marginTop,\n },\n toolbar: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: 8,\n },\n twoColumn: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n gap: 10,\n },\n });\n\n return (\n <Document title={`${titlePrefix} ${data.period}`}>\n <Page size=\"A4\" style={styles.page}>\n <PageHeader\n variant=\"two-column\"\n title={data.title}\n subtitle={`${titlePrefix} · ${data.subtitle}`}\n rightText={data.period}\n rightSubText={`Generated ${data.generatedAt}`}\n marginBottom={14}\n />\n\n <View style={styles.toolbar}>\n <Badge label={statusLabel} variant={statusTone} size=\"sm\" />\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Author: {data.author}\n </Text>\n </View>\n\n <Section variant=\"card\" padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Executive Summary\n </Text>\n <View style={styles.metricsGrid}>\n {data.summary.map((metric) => (\n <View\n key={metric.label}\n style={[\n styles.metricCard,\n {\n borderLeftColor: metric.tone\n ? toneColor(theme, metric.tone)\n : accent,\n borderLeftWidth: 3,\n },\n ]}\n >\n <Text style={styles.metricLabel} noMargin>\n {metric.label}\n </Text>\n <Text style={styles.metricValue} noMargin>\n {metric.value}\n </Text>\n {metric.trend ? (\n <Badge\n label={metric.trend}\n size=\"sm\"\n variant={metric.tone ?? \"info\"}\n />\n ) : null}\n </View>\n ))}\n </View>\n </Section>\n\n <Section padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View style={styles.graphShell}>\n <PdfGraph\n variant={graphVariant}\n data={graphData ?? data.series}\n title={graphTitle}\n subtitle={graphSubtitle}\n yLabel={undefined}\n xLabel={undefined}\n showGrid={graphVariant !== \"pie\" && graphVariant !== \"donut\"}\n showValues={graphShowValues}\n smooth={graphVariant === \"line\" || graphVariant === \"area\"}\n legend={graphLegend}\n height={200}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section padding=\"md\">\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Delivery Table\n </Text>\n <DataTable\n variant=\"compact\"\n size=\"compact\"\n stripe\n columns={[\n { header: \"Stream\", key: \"label\" },\n { header: \"Owner\", key: \"owner\" },\n { align: \"center\", header: \"Status\", key: \"status\" },\n {\n align: \"right\",\n header: \"Progress\",\n key: \"progress\",\n render: (value) => `${String(value)}%`,\n },\n { align: \"right\", header: \"Risk\", key: \"risk\" },\n ]}\n data={data.rows}\n footer={{\n label: \"Totals\",\n owner: \"-\",\n progress: Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n ),\n risk: \"-\",\n status: \"-\",\n }}\n />\n </Section>\n\n <Section padding=\"md\" variant=\"card\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Highlights & Risks\n </Text>\n <View style={styles.twoColumn}>\n <View style={styles.col}>\n <PdfList\n variant=\"checklist\"\n items={data.highlights.map((item) => ({\n checked: true,\n text: item,\n }))}\n gap=\"sm\"\n />\n </View>\n <View style={styles.col}>\n <KeyValue\n size=\"sm\"\n divided\n items={[\n {\n key: \"Open Risks\",\n value: `${data.rows.filter((r) => r.risk !== \"Low\").length}`,\n },\n {\n key: \"On-Track Streams\",\n value: `${data.rows.filter((r) => r.status === \"On Track\").length}/${data.rows.length}`,\n },\n {\n key: \"Average Progress\",\n value: `${Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n )}%`,\n },\n ]}\n />\n </View>\n </View>\n <Divider />\n <Stack gap=\"sm\">\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: keep each section under one page using `noWrap` for\n concise blocks.\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: pass explicit row keys/owners to avoid ambiguous\n reporting handoffs.\n </Text>\n </Stack>\n </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with PDFx\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </Page>\n </Document>\n );\n}\n\nexport function ReportTemplateFrame({\n theme,\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend,\n graphShowValues,\n graphColors,\n graphData,\n}: ReportTemplateProps & {\n titlePrefix: string;\n statusLabel: string;\n statusTone: \"success\" | \"warning\" | \"destructive\" | \"info\";\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: \"bottom\" | \"right\" | \"none\";\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: { label: string; value: number }[];\n}) {\n if (!data) {return null;}\n\n return (\n <PdfcnThemeProvider theme={theme}>\n <ReportLayout\n data={data}\n titlePrefix={titlePrefix}\n statusLabel={statusLabel}\n statusTone={statusTone}\n graphVariant={graphVariant}\n graphTitle={graphTitle}\n graphSubtitle={graphSubtitle}\n graphLegend={graphLegend}\n graphShowValues={graphShowValues}\n graphColors={graphColors}\n graphData={graphData}\n />\n </PdfcnThemeProvider>\n );\n}\n",- "type": "registry:block"+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n Badge,\n DataTable,\n Divider,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Stack,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { BaseReportData } from \"./report.types\";\n\nexport interface ReportTemplateProps {\n theme?: PdfcnTheme;\n data?: BaseReportData;\n}\n\ntype ReportGraphVariant =\n | \"bar\"\n | \"horizontal-bar\"\n | \"line\"\n | \"area\"\n | \"pie\"\n | \"donut\";\n\ninterface ReportLayoutProps {\n data: BaseReportData;\n titlePrefix: string;\n statusLabel: string;\n statusTone: \"success\" | \"warning\" | \"destructive\" | \"info\";\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: \"bottom\" | \"right\" | \"none\";\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: { label: string; value: number }[];\n}\n\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\n const styles = StyleSheet.create({\n col: {\n flex: 1,\n },\n graphShell: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 12,\n },\n metricCard: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 8,\n width: \"48.6%\",\n },\n metricLabel: {\n color: theme.colors.mutedForeground,\n fontSize: 8,\n letterSpacing: 0.5,\n marginBottom: 2,\n textTransform: \"uppercase\",\n },\n metricTrend: {\n color: theme.colors.mutedForeground,\n fontSize: 9,\n },\n metricValue: {\n color: theme.colors.foreground,\n fontSize: 14,\n fontWeight: theme.primitives.fontWeights.bold,\n marginBottom: 2,\n },\n metricsGrid: {\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n paddingBottom: theme.spacing.page.marginBottom,\n paddingLeft: theme.spacing.page.marginLeft,\n paddingRight: theme.spacing.page.marginRight,\n paddingTop: theme.spacing.page.marginTop,\n },\n toolbar: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: 8,\n },\n twoColumn: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n gap: 10,\n },\n });\n\n return (\n <Document title={`${titlePrefix} ${data.period}`}>\n <Page size=\"A4\" style={styles.page}>\n <PageHeader\n variant=\"two-column\"\n title={data.title}\n subtitle={`${titlePrefix} · ${data.subtitle}`}\n rightText={data.period}\n rightSubText={`Generated ${data.generatedAt}`}\n marginBottom={14}\n />\n\n <View style={styles.toolbar}>\n <Badge label={statusLabel} variant={statusTone} size=\"sm\" />\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Author: {data.author}\n </Text>\n </View>\n\n <Section variant=\"card\" padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Executive Summary\n </Text>\n <View style={styles.metricsGrid}>\n {data.summary.map((metric) => (\n <View\n key={metric.label}\n style={[\n styles.metricCard,\n {\n borderLeftColor: metric.tone\n ? toneColor(theme, metric.tone)\n : accent,\n borderLeftWidth: 3,\n },\n ]}\n >\n <Text style={styles.metricLabel} noMargin>\n {metric.label}\n </Text>\n <Text style={styles.metricValue} noMargin>\n {metric.value}\n </Text>\n {metric.trend ? (\n <Badge\n label={metric.trend}\n size=\"sm\"\n variant={metric.tone ?? \"info\"}\n />\n ) : null}\n </View>\n ))}\n </View>\n </Section>\n\n <Section padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View style={styles.graphShell}>\n <PdfGraph\n variant={graphVariant}\n data={graphData ?? data.series}\n title={graphTitle}\n subtitle={graphSubtitle}\n yLabel={undefined}\n xLabel={undefined}\n showGrid={graphVariant !== \"pie\" && graphVariant !== \"donut\"}\n showValues={graphShowValues}\n smooth={graphVariant === \"line\" || graphVariant === \"area\"}\n legend={graphLegend}\n height={200}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section padding=\"md\">\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Delivery Table\n </Text>\n <DataTable\n variant=\"compact\"\n size=\"compact\"\n stripe\n columns={[\n { header: \"Stream\", key: \"label\" },\n { header: \"Owner\", key: \"owner\" },\n { align: \"center\", header: \"Status\", key: \"status\" },\n {\n align: \"right\",\n header: \"Progress\",\n key: \"progress\",\n render: (value) => `${String(value)}%`,\n },\n { align: \"right\", header: \"Risk\", key: \"risk\" },\n ]}\n data={data.rows}\n footer={{\n label: \"Totals\",\n owner: \"-\",\n progress: Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n ),\n risk: \"-\",\n status: \"-\",\n }}\n />\n </Section>\n\n <Section padding=\"md\" variant=\"card\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Highlights & Risks\n </Text>\n <View style={styles.twoColumn}>\n <View style={styles.col}>\n <PdfList\n variant=\"checklist\"\n items={data.highlights.map((item) => ({\n checked: true,\n text: item,\n }))}\n gap=\"sm\"\n />\n </View>\n <View style={styles.col}>\n <KeyValue\n size=\"sm\"\n divided\n items={[\n {\n key: \"Open Risks\",\n value: `${data.rows.filter((r) => r.risk !== \"Low\").length}`,\n },\n {\n key: \"On-Track Streams\",\n value: `${data.rows.filter((r) => r.status === \"On Track\").length}/${data.rows.length}`,\n },\n {\n key: \"Average Progress\",\n value: `${Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n )}%`,\n },\n ]}\n />\n </View>\n </View>\n <Divider />\n <Stack gap=\"sm\">\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: keep each section under one page using `noWrap` for\n concise blocks.\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: pass explicit row keys/owners to avoid ambiguous\n reporting handoffs.\n </Text>\n </Stack>\n </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with PDFx\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </Page>\n </Document>\n );\n};\n\nexport 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"},{"path": "registry/bases/takumi/blocks/report-operations/report-operations.tsx",- "content": "import { ReportTemplateFrame } from './report-layout';\nimport type { ReportTemplateProps } from './report-layout';\nimport type { BaseReportData } from \"./report.types\";\n\nconst sampleOperationsData: BaseReportData = {\n author: \"Delivery Office\",\n generatedAt: \"February 23, 2026\",\n highlights: [\n \"SLA improved after shift rebalancing and incident triage changes.\",\n \"Backlog grew in week 4 due to release-related ticket surge.\",\n \"Incident queue remediation plan has executive sponsorship and budget.\",\n ],\n period: \"February 2026\",\n rows: [\n {\n label: \"L1 Support\",\n owner: \"N. Mehta\",\n status: \"On Track\",\n progress: 91,\n risk: \"Low\",\n },\n {\n label: \"L2 Support\",\n owner: \"D. Chen\",\n status: \"On Track\",\n progress: 85,\n risk: \"Low\",\n },\n {\n label: \"Incident Queue\",\n owner: \"R. Walker\",\n status: \"At Risk\",\n progress: 66,\n risk: \"High\",\n },\n {\n label: \"Automation Rollout\",\n owner: \"M. Roy\",\n status: \"On Track\",\n progress: 77,\n risk: \"Medium\",\n },\n ],\n series: [\n { label: \"W1\", value: 69 },\n { label: \"W2\", value: 71 },\n { label: \"W3\", value: 73 },\n { label: \"W4\", value: 74 },\n { label: \"W5\", value: 75 },\n { label: \"W6\", value: 76 },\n { label: \"W7\", value: 78 },\n { label: \"W8\", value: 79 },\n { label: \"W9\", value: 78 },\n { label: \"W10\", value: 80 },\n { label: \"W11\", value: 81 },\n { label: \"W12\", value: 83 },\n ],\n subtitle: \"Delivery throughput, SLA adherence, and backlog visibility\",\n summary: [\n {\n label: \"Tickets Closed\",\n value: \"1,284\",\n trend: \"+9.8% MoM\",\n tone: \"success\",\n },\n {\n label: \"SLA Hit Rate\",\n value: \"96.1%\",\n trend: \"+1.4 pts\",\n tone: \"success\",\n },\n { label: \"Backlog\", value: \"214\", trend: \"+6.0%\", tone: \"warning\" },\n { label: \"Escalations\", value: \"17\", trend: \"-18.5%\", tone: \"success\" },\n ],\n title: \"Monthly Operations Report\",\n};\n\nexport function OperationsReportDocument({\n theme,\n data = sampleOperationsData,\n}: ReportTemplateProps) {\n return (\n <ReportTemplateFrame\n theme={theme}\n data={data}\n titlePrefix=\"Operations Report\"\n statusLabel=\"Ops: Watch\"\n statusTone=\"warning\"\n graphVariant=\"horizontal-bar\"\n graphTitle=\"Throughput by week\"\n graphSubtitle=\"Resolved workload distribution\"\n graphLegend=\"none\"\n graphShowValues\n graphColors={[\"#2563EB\"]}\n graphData={[\n { label: \"Incident\", value: 66 },\n { label: \"Automation\", value: 77 },\n { label: \"L2 Support\", value: 85 },\n { label: \"L1 Support\", value: 91 },\n ]}\n />\n );\n}\n",- "type": "registry:block"+ "content": "import { ReportTemplateFrame } from \"./report-layout\";\nimport type { ReportTemplateProps } from \"./report-layout\";\nimport type { BaseReportData } from \"./report.types\";\n\nconst sampleOperationsData: BaseReportData = {\n author: \"Delivery Office\",\n generatedAt: \"February 23, 2026\",\n highlights: [\n \"SLA improved after shift rebalancing and incident triage changes.\",\n \"Backlog grew in week 4 due to release-related ticket surge.\",\n \"Incident queue remediation plan has executive sponsorship and budget.\",\n ],\n period: \"February 2026\",\n rows: [\n {\n label: \"L1 Support\",\n owner: \"N. Mehta\",\n progress: 91,\n risk: \"Low\",\n status: \"On Track\",\n },\n {\n label: \"L2 Support\",\n owner: \"D. Chen\",\n progress: 85,\n risk: \"Low\",\n status: \"On Track\",\n },\n {\n label: \"Incident Queue\",\n owner: \"R. Walker\",\n progress: 66,\n risk: \"High\",\n status: \"At Risk\",\n },\n {\n label: \"Automation Rollout\",\n owner: \"M. Roy\",\n progress: 77,\n risk: \"Medium\",\n status: \"On Track\",\n },\n ],\n series: [\n { label: \"W1\", value: 69 },\n { label: \"W2\", value: 71 },\n { label: \"W3\", value: 73 },\n { label: \"W4\", value: 74 },\n { label: \"W5\", value: 75 },\n { label: \"W6\", value: 76 },\n { label: \"W7\", value: 78 },\n { label: \"W8\", value: 79 },\n { label: \"W9\", value: 78 },\n { label: \"W10\", value: 80 },\n { label: \"W11\", value: 81 },\n { label: \"W12\", value: 83 },\n ],\n subtitle: \"Delivery throughput, SLA adherence, and backlog visibility\",\n summary: [\n {\n label: \"Tickets Closed\",\n tone: \"success\",\n trend: \"+9.8% MoM\",\n value: \"1,284\",\n },\n {\n label: \"SLA Hit Rate\",\n tone: \"success\",\n trend: \"+1.4 pts\",\n value: \"96.1%\",\n },\n { label: \"Backlog\", tone: \"warning\", trend: \"+6.0%\", value: \"214\" },\n { label: \"Escalations\", tone: \"success\", trend: \"-18.5%\", value: \"17\" },\n ],\n title: \"Monthly Operations Report\",\n};\n\nexport const OperationsReportDocument = ({\n theme,\n data = sampleOperationsData,\n}: ReportTemplateProps) => (\n <ReportTemplateFrame\n theme={theme}\n data={data}\n titlePrefix=\"Operations Report\"\n statusLabel=\"Ops: Watch\"\n statusTone=\"warning\"\n graphVariant=\"horizontal-bar\"\n graphTitle=\"Throughput by week\"\n graphSubtitle=\"Resolved workload distribution\"\n graphLegend=\"none\"\n graphShowValues\n graphColors={[\"#2563EB\"]}\n graphData={[\n { label: \"Incident\", value: 66 },\n { label: \"Automation\", value: 77 },\n { label: \"L2 Support\", value: 85 },\n { label: \"L1 Support\", value: 91 },\n ]}\n />\n);\n",+ "type": "registry:block",+ "target": "components/pdf/blocks/report-operations/report-operations.tsx"},{"path": "registry/bases/takumi/blocks/report-operations/report.types.ts","content": "export interface SummaryMetric {\n label: string;\n value: string;\n trend?: string;\n tone?: \"success\" | \"warning\" | \"destructive\" | \"info\";\n}\n\nexport type ReportRow = Record<string, unknown> & {\n label: string;\n owner: string;\n status: string;\n progress: number;\n risk?: string;\n};\n\nexport interface ReportSeriesPoint {\n label: string;\n value: number;\n}\n\nexport interface BaseReportData {\n title: string;\n subtitle: string;\n generatedAt: string;\n period: string;\n author: string;\n summary: SummaryMetric[];\n rows: ReportRow[];\n series: ReportSeriesPoint[];\n highlights: string[];\n}\n",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-operations/report.types.ts"}],"type": "registry:block"diff --git a/public/r/takumi/report-security.json b/public/r/takumi/report-security.jsonindex 98d5251..7b7e3af 100644--- a/public/r/takumi/report-security.json+++ b/public/r/takumi/report-security.json@@ -13,18 +13,21 @@"files": [{"path": "registry/bases/takumi/blocks/report-security/report-layout.tsx",- "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n Badge,\n DataTable,\n Divider,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Stack,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { BaseReportData } from \"./report.types\";\n\nexport interface ReportTemplateProps {\n theme?: PdfcnTheme;\n data?: BaseReportData;\n}\n\ntype ReportGraphVariant =\n | \"bar\"\n | \"horizontal-bar\"\n | \"line\"\n | \"area\"\n | \"pie\"\n | \"donut\";\n\ninterface ReportLayoutProps {\n data: BaseReportData;\n titlePrefix: string;\n statusLabel: string;\n statusTone: \"success\" | \"warning\" | \"destructive\" | \"info\";\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: \"bottom\" | \"right\" | \"none\";\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: { label: string; value: number }[];\n}\n\nfunction toneColor(\n theme: PdfcnTheme,\n tone: \"success\" | \"warning\" | \"destructive\" | \"info\"\n) {\n if (tone === \"success\") {return theme.colors.success;}\n if (tone === \"warning\") {return theme.colors.warning;}\n if (tone === \"destructive\") {return theme.colors.destructive;}\n return theme.colors.info;\n}\n\nexport function ReportLayout({\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend = \"none\",\n graphShowValues = false,\n graphColors,\n graphData,\n}: ReportLayoutProps) {\n const theme = usePdfcnTheme();\n const accent = toneColor(theme, statusTone);\n\n const styles = StyleSheet.create({\n col: {\n flex: 1,\n },\n graphShell: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 12,\n },\n metricCard: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 8,\n width: \"48.6%\",\n },\n metricLabel: {\n color: theme.colors.mutedForeground,\n fontSize: 8,\n letterSpacing: 0.5,\n marginBottom: 2,\n textTransform: \"uppercase\",\n },\n metricTrend: {\n color: theme.colors.mutedForeground,\n fontSize: 9,\n },\n metricValue: {\n color: theme.colors.foreground,\n fontSize: 14,\n fontWeight: theme.primitives.fontWeights.bold,\n marginBottom: 2,\n },\n metricsGrid: {\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n paddingBottom: theme.spacing.page.marginBottom,\n paddingLeft: theme.spacing.page.marginLeft,\n paddingRight: theme.spacing.page.marginRight,\n paddingTop: theme.spacing.page.marginTop,\n },\n toolbar: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: 8,\n },\n twoColumn: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n gap: 10,\n },\n });\n\n return (\n <Document title={`${titlePrefix} ${data.period}`}>\n <Page size=\"A4\" style={styles.page}>\n <PageHeader\n variant=\"two-column\"\n title={data.title}\n subtitle={`${titlePrefix} · ${data.subtitle}`}\n rightText={data.period}\n rightSubText={`Generated ${data.generatedAt}`}\n marginBottom={14}\n />\n\n <View style={styles.toolbar}>\n <Badge label={statusLabel} variant={statusTone} size=\"sm\" />\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Author: {data.author}\n </Text>\n </View>\n\n <Section variant=\"card\" padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Executive Summary\n </Text>\n <View style={styles.metricsGrid}>\n {data.summary.map((metric) => (\n <View\n key={metric.label}\n style={[\n styles.metricCard,\n {\n borderLeftColor: metric.tone\n ? toneColor(theme, metric.tone)\n : accent,\n borderLeftWidth: 3,\n },\n ]}\n >\n <Text style={styles.metricLabel} noMargin>\n {metric.label}\n </Text>\n <Text style={styles.metricValue} noMargin>\n {metric.value}\n </Text>\n {metric.trend ? (\n <Badge\n label={metric.trend}\n size=\"sm\"\n variant={metric.tone ?? \"info\"}\n />\n ) : null}\n </View>\n ))}\n </View>\n </Section>\n\n <Section padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View style={styles.graphShell}>\n <PdfGraph\n variant={graphVariant}\n data={graphData ?? data.series}\n title={graphTitle}\n subtitle={graphSubtitle}\n yLabel={undefined}\n xLabel={undefined}\n showGrid={graphVariant !== \"pie\" && graphVariant !== \"donut\"}\n showValues={graphShowValues}\n smooth={graphVariant === \"line\" || graphVariant === \"area\"}\n legend={graphLegend}\n height={200}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section padding=\"md\">\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Delivery Table\n </Text>\n <DataTable\n variant=\"compact\"\n size=\"compact\"\n stripe\n columns={[\n { header: \"Stream\", key: \"label\" },\n { header: \"Owner\", key: \"owner\" },\n { align: \"center\", header: \"Status\", key: \"status\" },\n {\n align: \"right\",\n header: \"Progress\",\n key: \"progress\",\n render: (value) => `${String(value)}%`,\n },\n { align: \"right\", header: \"Risk\", key: \"risk\" },\n ]}\n data={data.rows}\n footer={{\n label: \"Totals\",\n owner: \"-\",\n progress: Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n ),\n risk: \"-\",\n status: \"-\",\n }}\n />\n </Section>\n\n <Section padding=\"md\" variant=\"card\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Highlights & Risks\n </Text>\n <View style={styles.twoColumn}>\n <View style={styles.col}>\n <PdfList\n variant=\"checklist\"\n items={data.highlights.map((item) => ({\n checked: true,\n text: item,\n }))}\n gap=\"sm\"\n />\n </View>\n <View style={styles.col}>\n <KeyValue\n size=\"sm\"\n divided\n items={[\n {\n key: \"Open Risks\",\n value: `${data.rows.filter((r) => r.risk !== \"Low\").length}`,\n },\n {\n key: \"On-Track Streams\",\n value: `${data.rows.filter((r) => r.status === \"On Track\").length}/${data.rows.length}`,\n },\n {\n key: \"Average Progress\",\n value: `${Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n )}%`,\n },\n ]}\n />\n </View>\n </View>\n <Divider />\n <Stack gap=\"sm\">\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: keep each section under one page using `noWrap` for\n concise blocks.\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: pass explicit row keys/owners to avoid ambiguous\n reporting handoffs.\n </Text>\n </Stack>\n </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with PDFx\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </Page>\n </Document>\n );\n}\n\nexport function ReportTemplateFrame({\n theme,\n data,\n titlePrefix,\n statusLabel,\n statusTone,\n graphVariant,\n graphTitle,\n graphSubtitle,\n graphLegend,\n graphShowValues,\n graphColors,\n graphData,\n}: ReportTemplateProps & {\n titlePrefix: string;\n statusLabel: string;\n statusTone: \"success\" | \"warning\" | \"destructive\" | \"info\";\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: \"bottom\" | \"right\" | \"none\";\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: { label: string; value: number }[];\n}) {\n if (!data) {return null;}\n\n return (\n <PdfcnThemeProvider theme={theme}>\n <ReportLayout\n data={data}\n titlePrefix={titlePrefix}\n statusLabel={statusLabel}\n statusTone={statusTone}\n graphVariant={graphVariant}\n graphTitle={graphTitle}\n graphSubtitle={graphSubtitle}\n graphLegend={graphLegend}\n graphShowValues={graphShowValues}\n graphColors={graphColors}\n graphData={graphData}\n />\n </PdfcnThemeProvider>\n );\n}\n",- "type": "registry:block"+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport {\n Badge,\n DataTable,\n Divider,\n KeyValue,\n PageFooter,\n PageHeader,\n PdfGraph,\n PdfList,\n PdfcnThemeProvider,\n Section,\n Stack,\n Text,\n usePdfcnTheme,\n} from \"../../components\";\nimport { View, StyleSheet, Document, Page } from \"../../lib/takumi-primitives\";\nimport type { BaseReportData } from \"./report.types\";\n\nexport interface ReportTemplateProps {\n theme?: PdfcnTheme;\n data?: BaseReportData;\n}\n\ntype ReportGraphVariant =\n | \"bar\"\n | \"horizontal-bar\"\n | \"line\"\n | \"area\"\n | \"pie\"\n | \"donut\";\n\ninterface ReportLayoutProps {\n data: BaseReportData;\n titlePrefix: string;\n statusLabel: string;\n statusTone: \"success\" | \"warning\" | \"destructive\" | \"info\";\n graphVariant: ReportGraphVariant;\n graphTitle: string;\n graphSubtitle: string;\n graphLegend?: \"bottom\" | \"right\" | \"none\";\n graphShowValues?: boolean;\n graphColors?: string[];\n graphData?: { label: string; value: number }[];\n}\n\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\n const styles = StyleSheet.create({\n col: {\n flex: 1,\n },\n graphShell: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 12,\n },\n metricCard: {\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 1,\n padding: 8,\n width: \"48.6%\",\n },\n metricLabel: {\n color: theme.colors.mutedForeground,\n fontSize: 8,\n letterSpacing: 0.5,\n marginBottom: 2,\n textTransform: \"uppercase\",\n },\n metricTrend: {\n color: theme.colors.mutedForeground,\n fontSize: 9,\n },\n metricValue: {\n color: theme.colors.foreground,\n fontSize: 14,\n fontWeight: theme.primitives.fontWeights.bold,\n marginBottom: 2,\n },\n metricsGrid: {\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: 8,\n },\n page: {\n backgroundColor: theme.colors.background,\n paddingBottom: theme.spacing.page.marginBottom,\n paddingLeft: theme.spacing.page.marginLeft,\n paddingRight: theme.spacing.page.marginRight,\n paddingTop: theme.spacing.page.marginTop,\n },\n toolbar: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: 8,\n },\n twoColumn: {\n alignItems: \"flex-start\",\n flexDirection: \"row\",\n gap: 10,\n },\n });\n\n return (\n <Document title={`${titlePrefix} ${data.period}`}>\n <Page size=\"A4\" style={styles.page}>\n <PageHeader\n variant=\"two-column\"\n title={data.title}\n subtitle={`${titlePrefix} · ${data.subtitle}`}\n rightText={data.period}\n rightSubText={`Generated ${data.generatedAt}`}\n marginBottom={14}\n />\n\n <View style={styles.toolbar}>\n <Badge label={statusLabel} variant={statusTone} size=\"sm\" />\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Author: {data.author}\n </Text>\n </View>\n\n <Section variant=\"card\" padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Executive Summary\n </Text>\n <View style={styles.metricsGrid}>\n {data.summary.map((metric) => (\n <View\n key={metric.label}\n style={[\n styles.metricCard,\n {\n borderLeftColor: metric.tone\n ? toneColor(theme, metric.tone)\n : accent,\n borderLeftWidth: 3,\n },\n ]}\n >\n <Text style={styles.metricLabel} noMargin>\n {metric.label}\n </Text>\n <Text style={styles.metricValue} noMargin>\n {metric.value}\n </Text>\n {metric.trend ? (\n <Badge\n label={metric.trend}\n size=\"sm\"\n variant={metric.tone ?? \"info\"}\n />\n ) : null}\n </View>\n ))}\n </View>\n </Section>\n\n <Section padding=\"md\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Performance Trend\n </Text>\n <View style={styles.graphShell}>\n <PdfGraph\n variant={graphVariant}\n data={graphData ?? data.series}\n title={graphTitle}\n subtitle={graphSubtitle}\n yLabel={undefined}\n xLabel={undefined}\n showGrid={graphVariant !== \"pie\" && graphVariant !== \"donut\"}\n showValues={graphShowValues}\n smooth={graphVariant === \"line\" || graphVariant === \"area\"}\n legend={graphLegend}\n height={200}\n colors={graphColors}\n fullWidth\n containerPadding={12}\n wrapperPadding={12}\n style={{ marginBottom: 0 }}\n />\n </View>\n </Section>\n\n <Section padding=\"md\">\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Delivery Table\n </Text>\n <DataTable\n variant=\"compact\"\n size=\"compact\"\n stripe\n columns={[\n { header: \"Stream\", key: \"label\" },\n { header: \"Owner\", key: \"owner\" },\n { align: \"center\", header: \"Status\", key: \"status\" },\n {\n align: \"right\",\n header: \"Progress\",\n key: \"progress\",\n render: (value) => `${String(value)}%`,\n },\n { align: \"right\", header: \"Risk\", key: \"risk\" },\n ]}\n data={data.rows}\n footer={{\n label: \"Totals\",\n owner: \"-\",\n progress: Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n ),\n risk: \"-\",\n status: \"-\",\n }}\n />\n </Section>\n\n <Section padding=\"md\" variant=\"card\" noWrap>\n <Text variant=\"sm\" transform=\"uppercase\" color=\"mutedForeground\">\n Highlights & Risks\n </Text>\n <View style={styles.twoColumn}>\n <View style={styles.col}>\n <PdfList\n variant=\"checklist\"\n items={data.highlights.map((item) => ({\n checked: true,\n text: item,\n }))}\n gap=\"sm\"\n />\n </View>\n <View style={styles.col}>\n <KeyValue\n size=\"sm\"\n divided\n items={[\n {\n key: \"Open Risks\",\n value: `${data.rows.filter((r) => r.risk !== \"Low\").length}`,\n },\n {\n key: \"On-Track Streams\",\n value: `${data.rows.filter((r) => r.status === \"On Track\").length}/${data.rows.length}`,\n },\n {\n key: \"Average Progress\",\n value: `${Math.round(\n data.rows.reduce((sum, row) => sum + row.progress, 0) /\n Math.max(data.rows.length, 1)\n )}%`,\n },\n ]}\n />\n </View>\n </View>\n <Divider />\n <Stack gap=\"sm\">\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: keep each section under one page using `noWrap` for\n concise blocks.\n </Text>\n <Text variant=\"xs\" color=\"mutedForeground\" noMargin>\n Best practice: pass explicit row keys/owners to avoid ambiguous\n reporting handoffs.\n </Text>\n </Stack>\n </Section>\n\n <PageFooter\n variant=\"three-column\"\n leftText=\"Confidential — Internal Use\"\n centerText=\"Generated with PDFx\"\n rightText=\"Page 1 of 1\"\n sticky\n pagePadding={theme.spacing.page.marginLeft}\n />\n </Page>\n </Document>\n );\n};\n\nexport 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"},{"path": "registry/bases/takumi/blocks/report-security/report-security.tsx",- "content": "import { ReportTemplateFrame } from './report-layout';\nimport type { ReportTemplateProps } from './report-layout';\nimport type { BaseReportData } from \"./report.types\";\n\nconst sampleSecurityData: BaseReportData = {\n author: \"Security Engineering\",\n generatedAt: \"February 23, 2026\",\n highlights: [\n \"Critical vulnerabilities reduced through mandatory patch windows.\",\n \"Secrets rotation remains the highest-risk stream and needs additional staffing.\",\n \"External penetration test scheduled for next sprint to validate fixes.\",\n ],\n period: \"Sprint 05, 2026\",\n rows: [\n {\n label: \"Identity Hardening\",\n owner: \"E. Brown\",\n status: \"On Track\",\n progress: 87,\n risk: \"Low\",\n },\n {\n label: \"Secrets Rotation\",\n owner: \"P. Nair\",\n status: \"At Risk\",\n progress: 58,\n risk: \"High\",\n },\n {\n label: \"Dependency Scanning\",\n owner: \"I. Shah\",\n status: \"On Track\",\n progress: 81,\n risk: \"Medium\",\n },\n {\n label: \"WAF Policy\",\n owner: \"S. Reed\",\n status: \"On Track\",\n progress: 76,\n risk: \"Low\",\n },\n ],\n series: [\n { label: \"W1\", value: 61 },\n { label: \"W2\", value: 63 },\n { label: \"W3\", value: 64 },\n { label: \"W4\", value: 66 },\n { label: \"W5\", value: 67 },\n { label: \"W6\", value: 68 },\n { label: \"W7\", value: 69 },\n { label: \"W8\", value: 71 },\n { label: \"W9\", value: 72 },\n { label: \"W10\", value: 74 },\n { label: \"W11\", value: 76 },\n { label: \"W12\", value: 78 },\n ],\n subtitle: \"Vulnerability trends, control maturity, and remediation health\",\n summary: [\n {\n label: \"Critical Vulns\",\n value: \"2\",\n trend: \"-3 from last sprint\",\n tone: \"success\",\n },\n { label: \"Patch SLA\", value: \"92.0%\", trend: \"+5.3 pts\", tone: \"success\" },\n { label: \"Open Findings\", value: \"41\", trend: \"+4\", tone: \"warning\" },\n { label: \"Control Score\", value: \"84/100\", trend: \"+2 pts\", tone: \"info\" },\n ],\n title: \"Security Posture Report\",\n};\n\nexport function SecurityReportDocument({\n theme,\n data = sampleSecurityData,\n}: ReportTemplateProps) {\n return (\n <ReportTemplateFrame\n theme={theme}\n data={data}\n titlePrefix=\"Security Report\"\n statusLabel=\"Security: Action Needed\"\n statusTone=\"destructive\"\n graphVariant=\"donut\"\n graphTitle=\"Open risk distribution\"\n graphSubtitle=\"High/Medium/Low workload share\"\n graphLegend=\"right\"\n graphShowValues\n graphColors={[\"#DC2626\", \"#F59E0B\", \"#16A34A\", \"#0EA5E9\"]}\n graphData={[\n { label: \"High Risk\", value: 14 },\n { label: \"Medium Risk\", value: 17 },\n { label: \"Low Risk\", value: 8 },\n { label: \"Info\", value: 4 },\n ]}\n />\n );\n}\n",- "type": "registry:block"+ "content": "import { ReportTemplateFrame } from \"./report-layout\";\nimport type { ReportTemplateProps } from \"./report-layout\";\nimport type { BaseReportData } from \"./report.types\";\n\nconst sampleSecurityData: BaseReportData = {\n author: \"Security Engineering\",\n generatedAt: \"February 23, 2026\",\n highlights: [\n \"Critical vulnerabilities reduced through mandatory patch windows.\",\n \"Secrets rotation remains the highest-risk stream and needs additional staffing.\",\n \"External penetration test scheduled for next sprint to validate fixes.\",\n ],\n period: \"Sprint 05, 2026\",\n rows: [\n {\n label: \"Identity Hardening\",\n owner: \"E. Brown\",\n progress: 87,\n risk: \"Low\",\n status: \"On Track\",\n },\n {\n label: \"Secrets Rotation\",\n owner: \"P. Nair\",\n progress: 58,\n risk: \"High\",\n status: \"At Risk\",\n },\n {\n label: \"Dependency Scanning\",\n owner: \"I. Shah\",\n progress: 81,\n risk: \"Medium\",\n status: \"On Track\",\n },\n {\n label: \"WAF Policy\",\n owner: \"S. Reed\",\n progress: 76,\n risk: \"Low\",\n status: \"On Track\",\n },\n ],\n series: [\n { label: \"W1\", value: 61 },\n { label: \"W2\", value: 63 },\n { label: \"W3\", value: 64 },\n { label: \"W4\", value: 66 },\n { label: \"W5\", value: 67 },\n { label: \"W6\", value: 68 },\n { label: \"W7\", value: 69 },\n { label: \"W8\", value: 71 },\n { label: \"W9\", value: 72 },\n { label: \"W10\", value: 74 },\n { label: \"W11\", value: 76 },\n { label: \"W12\", value: 78 },\n ],\n subtitle: \"Vulnerability trends, control maturity, and remediation health\",\n summary: [\n {\n label: \"Critical Vulns\",\n tone: \"success\",\n trend: \"-3 from last sprint\",\n value: \"2\",\n },\n { label: \"Patch SLA\", tone: \"success\", trend: \"+5.3 pts\", value: \"92.0%\" },\n { label: \"Open Findings\", tone: \"warning\", trend: \"+4\", value: \"41\" },\n { label: \"Control Score\", tone: \"info\", trend: \"+2 pts\", value: \"84/100\" },\n ],\n title: \"Security Posture Report\",\n};\n\nexport const SecurityReportDocument = ({\n theme,\n data = sampleSecurityData,\n}: ReportTemplateProps) => (\n <ReportTemplateFrame\n theme={theme}\n data={data}\n titlePrefix=\"Security Report\"\n statusLabel=\"Security: Action Needed\"\n statusTone=\"destructive\"\n graphVariant=\"donut\"\n graphTitle=\"Open risk distribution\"\n graphSubtitle=\"High/Medium/Low workload share\"\n graphLegend=\"right\"\n graphShowValues\n graphColors={[\"#DC2626\", \"#F59E0B\", \"#16A34A\", \"#0EA5E9\"]}\n graphData={[\n { label: \"High Risk\", value: 14 },\n { label: \"Medium Risk\", value: 17 },\n { label: \"Low Risk\", value: 8 },\n { label: \"Info\", value: 4 },\n ]}\n />\n);\n",+ "type": "registry:block",+ "target": "components/pdf/blocks/report-security/report-security.tsx"},{"path": "registry/bases/takumi/blocks/report-security/report.types.ts","content": "export interface SummaryMetric {\n label: string;\n value: string;\n trend?: string;\n tone?: \"success\" | \"warning\" | \"destructive\" | \"info\";\n}\n\nexport type ReportRow = Record<string, unknown> & {\n label: string;\n owner: string;\n status: string;\n progress: number;\n risk?: string;\n};\n\nexport interface ReportSeriesPoint {\n label: string;\n value: number;\n}\n\nexport interface BaseReportData {\n title: string;\n subtitle: string;\n generatedAt: string;\n period: string;\n author: string;\n summary: SummaryMetric[];\n rows: ReportRow[];\n series: ReportSeriesPoint[];\n highlights: string[];\n}\n",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-security/report.types.ts"}],"type": "registry:block"diff --git a/public/r/takumi/section.json b/public/r/takumi/section.jsonindex cf4bba0..e2a88d1 100644--- a/public/r/takumi/section.json+++ b/public/r/takumi/section.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/takumi/components/section/section.tsx",- "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { View, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type SectionSpacing = \"none\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\nexport type SectionPadding = \"none\" | \"sm\" | \"md\" | \"lg\";\nexport type SectionVariant = \"default\" | \"callout\" | \"highlight\" | \"card\";\n\n/**\n * Layout container with spacing, padding, and visual style variants.\n * Props - `spacing` | `padding` | `background` | `border` | `variant` | `accentColor` | `noWrap` | `children` | `style`\n * @see {@link SectionProps}\n */\nexport interface SectionProps extends PDFComponentProps {\n /**\n * @default 'md'\n */\n spacing?: SectionSpacing;\n padding?: SectionPadding;\n background?: string;\n /**\n * @default false\n */\n border?: boolean;\n /**\n * @default 'default'\n */\n variant?: SectionVariant;\n accentColor?: string;\n /**\n * @default false\n */\n noWrap?: boolean;\n}\n\nfunction createSectionStyles(t: PdfcnTheme) {\n const { spacing, borderRadius } = t.primitives;\n return StyleSheet.create({\n base: { flexDirection: \"column\" },\n border: {\n borderColor: t.colors.border,\n borderRadius: borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: spacing[0.5],\n },\n callout: {\n borderLeftColor: t.colors.primary,\n borderLeftStyle: \"solid\",\n borderLeftWidth: spacing[1],\n paddingLeft: spacing[4],\n paddingVertical: spacing[2],\n },\n card: {\n borderColor: t.colors.border,\n borderRadius: borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: spacing[0.5],\n padding: spacing[4],\n },\n highlight: {\n backgroundColor: t.colors.muted,\n borderLeftColor: t.colors.primary,\n borderLeftStyle: \"solid\",\n borderLeftWidth: spacing[1],\n padding: spacing[4],\n },\n paddingLg: { padding: spacing[6] },\n paddingMd: { padding: spacing[4] },\n paddingNone: { padding: spacing[0] },\n paddingSm: { padding: spacing[3] },\n spacingLg: { marginVertical: spacing[8] },\n spacingMd: { marginVertical: t.spacing.sectionGap },\n spacingNone: { marginVertical: spacing[0] },\n spacingSm: { marginVertical: spacing[4] },\n spacingXl: { marginVertical: spacing[12] },\n });\n}\n\nexport function Section({\n spacing = \"md\",\n padding,\n background,\n border,\n variant = \"default\",\n accentColor,\n noWrap = false,\n children,\n style,\n}: SectionProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createSectionStyles(theme), [theme]);\n const spacingMap = {\n lg: styles.spacingLg,\n md: styles.spacingMd,\n none: styles.spacingNone,\n sm: styles.spacingSm,\n xl: styles.spacingXl,\n };\n const paddingMap = {\n lg: styles.paddingLg,\n md: styles.paddingMd,\n none: styles.paddingNone,\n sm: styles.paddingSm,\n };\n const variantMap: Record<SectionVariant, Style | null> = {\n callout: styles.callout,\n card: styles.card,\n default: null,\n highlight: styles.highlight,\n };\n const styleArray: Style[] = [styles.base, spacingMap[spacing]];\n const variantStyle = variantMap[variant];\n if (variantStyle) {styleArray.push(variantStyle);}\n if (accentColor && (variant === \"callout\" || variant === \"highlight\")) {\n styleArray.push({\n borderLeftColor: resolveColor(accentColor, theme.colors),\n });\n }\n if (padding && padding in paddingMap) {styleArray.push(paddingMap[padding]);}\n if (border && variant === \"default\") {styleArray.push(styles.border);}\n if (background)\n {styleArray.push({\n backgroundColor: resolveColor(background, theme.colors),\n });}\n if (style) {styleArray.push(...[style].flat());}\n return <View style={styleArray}>{children}</View>;\n}\n",- "type": "registry:component"+ "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { View, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type SectionSpacing = \"none\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\nexport type SectionPadding = \"none\" | \"sm\" | \"md\" | \"lg\";\nexport type SectionVariant = \"default\" | \"callout\" | \"highlight\" | \"card\";\n\n/**\n * Layout container with spacing, padding, and visual style variants.\n * Props - `spacing` | `padding` | `background` | `border` | `variant` | `accentColor` | `noWrap` | `children` | `style`\n * @see {@link SectionProps}\n */\nexport interface SectionProps extends PDFComponentProps {\n /**\n * @default 'md'\n */\n spacing?: SectionSpacing;\n padding?: SectionPadding;\n background?: string;\n /**\n * @default false\n */\n border?: boolean;\n /**\n * @default 'default'\n */\n variant?: SectionVariant;\n accentColor?: string;\n /**\n * @default false\n */\n noWrap?: boolean;\n}\n\nconst createSectionStyles = (t: PdfcnTheme) => {\n const { spacing, borderRadius } = t.primitives;\n return StyleSheet.create({\n base: { flexDirection: \"column\" },\n border: {\n borderColor: t.colors.border,\n borderRadius: borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: spacing[0.5],\n },\n callout: {\n borderLeftColor: t.colors.primary,\n borderLeftStyle: \"solid\",\n borderLeftWidth: spacing[1],\n paddingLeft: spacing[4],\n paddingVertical: spacing[2],\n },\n card: {\n borderColor: t.colors.border,\n borderRadius: borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: spacing[0.5],\n padding: spacing[4],\n },\n highlight: {\n backgroundColor: t.colors.muted,\n borderLeftColor: t.colors.primary,\n borderLeftStyle: \"solid\",\n borderLeftWidth: spacing[1],\n padding: spacing[4],\n },\n paddingLg: { padding: spacing[6] },\n paddingMd: { padding: spacing[4] },\n paddingNone: { padding: spacing[0] },\n paddingSm: { padding: spacing[3] },\n spacingLg: { marginVertical: spacing[8] },\n spacingMd: { marginVertical: t.spacing.sectionGap },\n spacingNone: { marginVertical: spacing[0] },\n spacingSm: { marginVertical: spacing[4] },\n spacingXl: { marginVertical: spacing[12] },\n });\n};\n\nexport const Section = ({\n spacing = \"md\",\n padding,\n background,\n border,\n variant = \"default\",\n accentColor,\n children,\n style,\n}: SectionProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createSectionStyles(theme), [theme]);\n const spacingMap = {\n lg: styles.spacingLg,\n md: styles.spacingMd,\n none: styles.spacingNone,\n sm: styles.spacingSm,\n xl: styles.spacingXl,\n };\n const paddingMap = {\n lg: styles.paddingLg,\n md: styles.paddingMd,\n none: styles.paddingNone,\n sm: styles.paddingSm,\n };\n const variantMap: Record<SectionVariant, Style | null> = {\n callout: styles.callout,\n card: styles.card,\n default: null,\n highlight: styles.highlight,\n };\n const styleArray: Style[] = [styles.base, spacingMap[spacing]];\n const variantStyle = variantMap[variant];\n if (variantStyle) {\n styleArray.push(variantStyle);\n }\n if (accentColor && (variant === \"callout\" || variant === \"highlight\")) {\n styleArray.push({\n borderLeftColor: resolveColor(accentColor, theme.colors),\n });\n }\n if (padding && padding in paddingMap) {\n styleArray.push(paddingMap[padding]);\n }\n if (border && variant === \"default\") {\n styleArray.push(styles.border);\n }\n if (background) {\n styleArray.push({\n backgroundColor: resolveColor(background, theme.colors),\n });\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return <View style={styleArray}>{children}</View>;\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/section/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/signature.json b/public/r/takumi/signature.jsonindex 30466eb..4383f8a 100644--- a/public/r/takumi/signature.json+++ b/public/r/takumi/signature.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/takumi/components/signature/signature.tsx",- "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type SignatureVariant = \"single\" | \"double\" | \"inline\";\n\n/**\n * Signature signer properties.\n * Props - `label` | `name` | `title` | `date`\n * @see {@link SignatureSigner}\n */\nexport interface SignatureSigner {\n label?: string;\n name?: string;\n title?: string;\n date?: string;\n}\n\n/**\n * Signature block properties.\n * Props - `variant` | `label` | `name` | `title` | `date` | `signers` | `style`\n * @see {@link PdfSignatureBlockProps}\n */\nexport interface PdfSignatureBlockProps {\n /**\n * Layout variant: [single, double, inline]\n * @default 'single'\n */\n variant?: SignatureVariant;\n label?: string;\n name?: string;\n title?: string;\n date?: string;\n signers?: [SignatureSigner, SignatureSigner];\n style?: Style;\n}\n\nfunction createSignatureStyles(t: PdfcnTheme) {\n const { spacing, fontWeights, typography } = t.primitives;\n return StyleSheet.create({\n block: { flex: 1, minWidth: 140 },\n container: {\n marginBottom: t.spacing.componentGap,\n marginTop: t.spacing.sectionGap,\n },\n dateText: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n marginTop: 1,\n },\n doubleRow: {\n flexDirection: \"row\",\n gap: spacing[8],\n justifyContent: \"space-between\",\n },\n inlineLabel: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n },\n inlineLine: {\n borderBottomColor: t.colors.foreground,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n height: spacing[5],\n minWidth: 120,\n paddingHorizontal: spacing[2],\n },\n inlineName: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n },\n inlineRow: {\n alignItems: \"center\",\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: spacing[3],\n },\n label: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n marginBottom: spacing[1],\n },\n line: {\n borderBottomColor: t.colors.foreground,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n marginBottom: spacing[1],\n minHeight: spacing[6],\n },\n name: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n },\n titleText: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n },\n });\n}\n\nfunction renderSignerBlock(\n signer: SignatureSigner,\n styles: ReturnType<typeof createSignatureStyles>\n) {\n return (\n <View style={styles.block}>\n {signer.label ? (\n <PDFText style={styles.label}>{signer.label}</PDFText>\n ) : null}\n <View style={styles.line} />\n {signer.name ? (\n <PDFText style={styles.name}>{signer.name}</PDFText>\n ) : null}\n {signer.title ? (\n <PDFText style={styles.titleText}>{signer.title}</PDFText>\n ) : null}\n {signer.date ? (\n <PDFText style={styles.dateText}>{signer.date}</PDFText>\n ) : null}\n </View>\n );\n}\n\nexport function PdfSignatureBlock({\n variant = \"single\",\n label = \"Signature\",\n name,\n title,\n date,\n signers,\n style,\n}: PdfSignatureBlockProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createSignatureStyles(theme), [theme]);\n const containerStyles: Style[] = [styles.container];\n if (style) {containerStyles.push(style);}\n\n if (variant === \"inline\") {\n return (\n <View\n style={[{ breakInside: \"avoid\" as const }, containerStyles]\n .flat()\n .filter(Boolean)}\n >\n <View style={styles.inlineRow}>\n <PDFText style={styles.inlineLabel}>{`${label}:`}</PDFText>\n <View style={styles.inlineLine} />\n {name ? <PDFText style={styles.inlineName}>{name}</PDFText> : null}\n </View>\n </View>\n );\n }\n\n if (variant === \"double\") {\n const [first, second] = signers ?? [\n { date: \"\", label: \"Authorized by\", name: \"\", title: \"\" },\n { date: \"\", label: \"Approved by\", name: \"\", title: \"\" },\n ];\n return (\n <View\n style={[{ breakInside: \"avoid\" as const }, containerStyles]\n .flat()\n .filter(Boolean)}\n >\n <View style={styles.doubleRow}>\n {renderSignerBlock(first, styles)}\n {renderSignerBlock(second, styles)}\n </View>\n </View>\n );\n }\n\n return (\n <View\n style={[{ breakInside: \"avoid\" as const }, containerStyles]\n .flat()\n .filter(Boolean)}\n >\n {renderSignerBlock({ date, label, name, title }, styles)}\n </View>\n );\n}\n",- "type": "registry:component"+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type SignatureVariant = \"single\" | \"double\" | \"inline\";\n\n/**\n * Signature signer properties.\n * Props - `label` | `name` | `title` | `date`\n * @see {@link SignatureSigner}\n */\nexport interface SignatureSigner {\n label?: string;\n name?: string;\n title?: string;\n date?: string;\n}\n\n/**\n * Signature block properties.\n * Props - `variant` | `label` | `name` | `title` | `date` | `signers` | `style`\n * @see {@link PdfSignatureBlockProps}\n */\nexport interface PdfSignatureBlockProps {\n /**\n * Layout variant: [single, double, inline]\n * @default 'single'\n */\n variant?: SignatureVariant;\n label?: string;\n name?: string;\n title?: string;\n date?: string;\n signers?: [SignatureSigner, SignatureSigner];\n style?: Style;\n}\n\nconst createSignatureStyles = (t: PdfcnTheme) => {\n const { spacing, fontWeights, typography } = t.primitives;\n return StyleSheet.create({\n block: { flex: 1, minWidth: 140 },\n container: {\n marginBottom: t.spacing.componentGap,\n marginTop: t.spacing.sectionGap,\n },\n dateText: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n marginTop: 1,\n },\n doubleRow: {\n flexDirection: \"row\",\n gap: spacing[8],\n justifyContent: \"space-between\",\n },\n inlineLabel: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n },\n inlineLine: {\n borderBottomColor: t.colors.foreground,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n height: spacing[5],\n minWidth: 120,\n paddingHorizontal: spacing[2],\n },\n inlineName: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n },\n inlineRow: {\n alignItems: \"center\",\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: spacing[3],\n },\n label: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n marginBottom: spacing[1],\n },\n line: {\n borderBottomColor: t.colors.foreground,\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n marginBottom: spacing[1],\n minHeight: spacing[6],\n },\n name: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n },\n titleText: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.sm,\n },\n });\n};\n\nconst renderSignerBlock = (\n signer: SignatureSigner,\n styles: ReturnType<typeof createSignatureStyles>\n) => (\n <View style={styles.block}>\n {signer.label ? (\n <PDFText style={styles.label}>{signer.label}</PDFText>\n ) : null}\n <View style={styles.line} />\n {signer.name ? <PDFText style={styles.name}>{signer.name}</PDFText> : null}\n {signer.title ? (\n <PDFText style={styles.titleText}>{signer.title}</PDFText>\n ) : null}\n {signer.date ? (\n <PDFText style={styles.dateText}>{signer.date}</PDFText>\n ) : null}\n </View>\n);\n\nexport const PdfSignatureBlock = ({\n variant = \"single\",\n label = \"Signature\",\n name,\n title,\n date,\n signers,\n style,\n}: PdfSignatureBlockProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createSignatureStyles(theme), [theme]);\n const containerStyles: Style[] = [styles.container];\n if (style) {\n containerStyles.push(style);\n }\n\n if (variant === \"inline\") {\n return (\n <View\n style={[{ breakInside: \"avoid\" as const }, containerStyles]\n .flat()\n .filter(Boolean)}\n >\n <View style={styles.inlineRow}>\n <PDFText style={styles.inlineLabel}>{`${label}:`}</PDFText>\n <View style={styles.inlineLine} />\n {name ? <PDFText style={styles.inlineName}>{name}</PDFText> : null}\n </View>\n </View>\n );\n }\n\n if (variant === \"double\") {\n const [first, second] = signers ?? [\n { date: \"\", label: \"Authorized by\", name: \"\", title: \"\" },\n { date: \"\", label: \"Approved by\", name: \"\", title: \"\" },\n ];\n return (\n <View\n style={[{ breakInside: \"avoid\" as const }, containerStyles]\n .flat()\n .filter(Boolean)}\n >\n <View style={styles.doubleRow}>\n {renderSignerBlock(first, styles)}\n {renderSignerBlock(second, styles)}\n </View>\n </View>\n );\n }\n\n return (\n <View\n style={[{ breakInside: \"avoid\" as const }, containerStyles]\n .flat()\n .filter(Boolean)}\n >\n {renderSignerBlock({ date, label, name, title }, styles)}\n </View>\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/signature/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/stack.json b/public/r/takumi/stack.jsonindex 15f5ed0..25f0bdc 100644--- a/public/r/takumi/stack.json+++ b/public/r/takumi/stack.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/takumi/components/stack/stack.tsx",- "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type StackGap = \"none\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\nexport type StackDirection = \"vertical\" | \"horizontal\";\nexport type StackAlign = \"start\" | \"center\" | \"end\" | \"stretch\";\nexport type StackJustify = \"start\" | \"center\" | \"end\" | \"between\" | \"around\";\n\n/**\n * Flex layout container with gap and direction control.\n * Props - `gap` | `direction` | `align` | `justify` | `wrap` | `noWrap` | `children` | `style`\n * @see {@link StackProps}\n */\nexport interface StackProps extends PDFComponentProps {\n /**\n * @default 'md'\n */\n gap?: StackGap;\n /**\n * @default 'vertical'\n */\n direction?: StackDirection;\n /**\n * @default 'start'\n */\n align?: StackAlign;\n /**\n * @default 'start'\n */\n justify?: StackJustify;\n /**\n * @default false\n */\n wrap?: boolean;\n /**\n * @default false\n */\n noWrap?: boolean;\n}\n\nfunction createStackStyles(t: PdfcnTheme) {\n const { spacing } = t.primitives;\n return StyleSheet.create({\n alignCenter: { alignItems: \"center\" },\n alignEnd: { alignItems: \"flex-end\" },\n alignStart: { alignItems: \"flex-start\" },\n alignStretch: { alignItems: \"stretch\" },\n gapLg: { gap: spacing[6] },\n gapMd: { gap: spacing[4] },\n gapNone: { gap: spacing[0] },\n gapSm: { gap: spacing[2] },\n gapXl: { gap: spacing[8] },\n horizontal: { flexDirection: \"row\" },\n justifyAround: { justifyContent: \"space-around\" },\n justifyBetween: { justifyContent: \"space-between\" },\n justifyCenter: { justifyContent: \"center\" },\n justifyEnd: { justifyContent: \"flex-end\" },\n justifyStart: { justifyContent: \"flex-start\" },\n vertical: { flexDirection: \"column\" },\n wrap: { flexWrap: \"wrap\" },\n });\n}\n\nexport function Stack({\n gap = \"md\",\n direction = \"vertical\",\n align,\n justify,\n wrap,\n noWrap,\n children,\n style,\n}: StackProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createStackStyles(theme), [theme]);\n const gapMap = {\n lg: styles.gapLg,\n md: styles.gapMd,\n none: styles.gapNone,\n sm: styles.gapSm,\n xl: styles.gapXl,\n };\n const alignMap = {\n center: styles.alignCenter,\n end: styles.alignEnd,\n start: styles.alignStart,\n stretch: styles.alignStretch,\n };\n const justifyMap = {\n around: styles.justifyAround,\n between: styles.justifyBetween,\n center: styles.justifyCenter,\n end: styles.justifyEnd,\n start: styles.justifyStart,\n };\n const styleArray: Style[] = [\n direction === \"horizontal\" ? styles.horizontal : styles.vertical,\n gapMap[gap],\n ];\n if (align && align in alignMap) {styleArray.push(alignMap[align]);}\n if (justify && justify in justifyMap) {styleArray.push(justifyMap[justify]);}\n if (wrap) {styleArray.push(styles.wrap);}\n if (style) {styleArray.push(...[style].flat());}\n return <View style={styleArray}>{children}</View>;\n}\n",- "type": "registry:component"+ "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type StackGap = \"none\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\nexport type StackDirection = \"vertical\" | \"horizontal\";\nexport type StackAlign = \"start\" | \"center\" | \"end\" | \"stretch\";\nexport type StackJustify = \"start\" | \"center\" | \"end\" | \"between\" | \"around\";\n\n/**\n * Flex layout container with gap and direction control.\n * Props - `gap` | `direction` | `align` | `justify` | `wrap` | `noWrap` | `children` | `style`\n * @see {@link StackProps}\n */\nexport interface StackProps extends PDFComponentProps {\n /**\n * @default 'md'\n */\n gap?: StackGap;\n /**\n * @default 'vertical'\n */\n direction?: StackDirection;\n /**\n * @default 'start'\n */\n align?: StackAlign;\n /**\n * @default 'start'\n */\n justify?: StackJustify;\n /**\n * @default false\n */\n wrap?: boolean;\n /**\n * @default false\n */\n noWrap?: boolean;\n}\n\nconst createStackStyles = (t: PdfcnTheme) => {\n const { spacing } = t.primitives;\n return StyleSheet.create({\n alignCenter: { alignItems: \"center\" },\n alignEnd: { alignItems: \"flex-end\" },\n alignStart: { alignItems: \"flex-start\" },\n alignStretch: { alignItems: \"stretch\" },\n gapLg: { gap: spacing[6] },\n gapMd: { gap: spacing[4] },\n gapNone: { gap: spacing[0] },\n gapSm: { gap: spacing[2] },\n gapXl: { gap: spacing[8] },\n horizontal: { flexDirection: \"row\" },\n justifyAround: { justifyContent: \"space-around\" },\n justifyBetween: { justifyContent: \"space-between\" },\n justifyCenter: { justifyContent: \"center\" },\n justifyEnd: { justifyContent: \"flex-end\" },\n justifyStart: { justifyContent: \"flex-start\" },\n vertical: { flexDirection: \"column\" },\n wrap: { flexWrap: \"wrap\" },\n });\n};\n\nexport const Stack = ({\n gap = \"md\",\n direction = \"vertical\",\n align,\n justify,\n wrap,\n children,\n style,\n}: StackProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createStackStyles(theme), [theme]);\n const gapMap = {\n lg: styles.gapLg,\n md: styles.gapMd,\n none: styles.gapNone,\n sm: styles.gapSm,\n xl: styles.gapXl,\n };\n const alignMap = {\n center: styles.alignCenter,\n end: styles.alignEnd,\n start: styles.alignStart,\n stretch: styles.alignStretch,\n };\n const justifyMap = {\n around: styles.justifyAround,\n between: styles.justifyBetween,\n center: styles.justifyCenter,\n end: styles.justifyEnd,\n start: styles.justifyStart,\n };\n const styleArray: Style[] = [\n direction === \"horizontal\" ? styles.horizontal : styles.vertical,\n gapMap[gap],\n ];\n if (align && align in alignMap) {\n styleArray.push(alignMap[align]);\n }\n if (justify && justify in justifyMap) {\n styleArray.push(justifyMap[justify]);\n }\n if (wrap) {\n styleArray.push(styles.wrap);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return <View style={styleArray}>{children}</View>;\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/stack/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/table.json b/public/r/takumi/table.jsonindex 5370e19..80089dd 100644--- a/public/r/takumi/table.json+++ b/public/r/takumi/table.json@@ -13,23 +13,27 @@"files": [{"path": "registry/bases/takumi/components/table/table.styles.ts",- "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { StyleSheet } from \"../../lib/takumi-primitives\";\n\n/**\n * Creates all table styles derived from the active theme.\n * @param t - The resolved PdfcnTheme instance.\n */\nexport function createTableStyles(t: PdfcnTheme) {\n const { spacing, borderRadius, fontWeights, typography } = t.primitives;\n const borderColor = t.colors.border;\n\n const hairline = 0.5;\n const rule = 1;\n const thick = 1.5;\n\n const cellPadV = spacing[2] - 2;\n const cellPadH = spacing[2] + 2;\n const cellPadVCompact = spacing[0.5];\n const cellPadHCompact = spacing[2];\n\n const rowDivider = {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\" as const,\n borderBottomWidth: hairline,\n };\n\n return StyleSheet.create({\n cell: {\n flex: 1,\n justifyContent: \"center\",\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellBordered: {\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellBorderedBorder: {\n borderRightColor: borderColor,\n borderRightStyle: \"solid\",\n borderRightWidth: hairline,\n },\n\n cellCompact: {\n paddingHorizontal: cellPadHCompact,\n paddingVertical: cellPadVCompact,\n },\n\n cellFixed: {\n flexGrow: 0,\n flexShrink: 0,\n justifyContent: \"center\",\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellGridBorder: {\n borderRightColor: borderColor,\n borderRightStyle: \"solid\",\n borderRightWidth: hairline,\n },\n\n cellMinimal: {\n paddingHorizontal: spacing[2] - 2,\n paddingVertical: spacing[1] + 1,\n },\n\n cellPrimaryHeader: {\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellStriped: {\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellText: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n lineHeight: 1.2,\n },\n cellTextCompact: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n lineHeight: 1.2,\n },\n cellTextFooter: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: 1.2,\n },\n cellTextHeaderBordered: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.bold,\n lineHeight: 1.2,\n },\n cellTextHeaderCompact: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.semibold,\n letterSpacing: 0.6,\n lineHeight: 1.2,\n textTransform: \"uppercase\",\n },\n cellTextHeaderGrid: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: 1.2,\n },\n cellTextHeaderLine: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: 1.2,\n },\n\n cellTextHeaderMinimal: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.medium,\n lineHeight: 1.2,\n },\n cellTextHeaderPrimaryHeader: {\n color: t.colors.primaryForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.semibold,\n letterSpacing: 0.6,\n lineHeight: 1.2,\n textTransform: \"uppercase\",\n },\n cellTextHeaderStriped: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: 1.2,\n },\n row: {\n display: \"flex\",\n flexDirection: \"row\",\n },\n rowBordered: rowDivider,\n rowCompact: rowDivider,\n rowFooter: {\n borderTopColor: borderColor,\n borderTopStyle: \"solid\",\n borderTopWidth: rule,\n },\n\n rowFooterStriped: {\n backgroundColor: t.colors.muted,\n borderTopColor: borderColor,\n borderTopStyle: \"solid\",\n borderTopWidth: rule,\n },\n rowGrid: rowDivider,\n\n rowHeaderBordered: {\n backgroundColor: t.colors.muted,\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n },\n\n rowHeaderCompact: {\n backgroundColor: t.colors.muted,\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n rowHeaderGrid: {\n backgroundColor: t.colors.muted,\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n\n rowHeaderLine: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n rowHeaderMinimal: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n rowHeaderPrimaryHeader: {\n backgroundColor: t.colors.primary,\n },\n rowHeaderStriped: {\n backgroundColor: t.colors.muted,\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n rowLine: rowDivider,\n\n rowMinimal: rowDivider,\n rowPrimaryHeader: rowDivider,\n\n rowStripe: {\n backgroundColor: t.colors.muted,\n },\n\n rowStriped: {},\n table: {\n display: \"flex\",\n flexDirection: \"column\",\n marginBottom: t.spacing.componentGap,\n width: \"100%\",\n },\n tableBordered: {\n borderBottomLeftRadius: borderRadius.sm,\n borderBottomRightRadius: borderRadius.sm,\n borderColor: borderColor,\n borderStyle: \"solid\",\n borderTopLeftRadius: borderRadius.sm,\n borderTopRightRadius: borderRadius.sm,\n borderWidth: rule,\n overflow: \"hidden\" as const,\n },\n tableCompact: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n },\n tableGrid: {\n borderBottomLeftRadius: borderRadius.md,\n borderBottomRightRadius: borderRadius.md,\n borderColor: borderColor,\n borderStyle: \"solid\",\n borderTopLeftRadius: borderRadius.md,\n borderTopRightRadius: borderRadius.md,\n borderWidth: thick,\n overflow: \"hidden\" as const,\n },\n tableLine: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n },\n tableMinimal: {\n paddingVertical: spacing[2],\n },\n\n tablePrimaryHeader: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n },\n\n tableStriped: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n borderTopColor: borderColor,\n borderTopStyle: \"solid\",\n borderTopWidth: hairline,\n },\n });\n}\n",- "type": "registry:component"+ "content": "import type { PdfcnTheme } from \"@/registry/themes\";\n\nimport { StyleSheet } from \"../../lib/takumi-primitives\";\n\n/**\n * Creates all table styles derived from the active theme.\n * @param t - The resolved PdfcnTheme instance.\n */\nexport const createTableStyles = (t: PdfcnTheme) => {\n const { spacing, borderRadius, fontWeights, typography } = t.primitives;\n const borderColor = t.colors.border;\n\n const hairline = 0.5;\n const rule = 1;\n const thick = 1.5;\n\n const cellPadV = spacing[2] - 2;\n const cellPadH = spacing[2] + 2;\n // eslint-disable-next-line prefer-destructuring\n const cellPadVCompact = spacing[0.5];\n // eslint-disable-next-line prefer-destructuring\n const cellPadHCompact = spacing[2];\n\n const rowDivider = {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\" as const,\n borderBottomWidth: hairline,\n };\n\n return StyleSheet.create({\n cell: {\n flex: 1,\n justifyContent: \"center\",\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellBordered: {\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellBorderedBorder: {\n borderRightColor: borderColor,\n borderRightStyle: \"solid\",\n borderRightWidth: hairline,\n },\n\n cellCompact: {\n paddingHorizontal: cellPadHCompact,\n paddingVertical: cellPadVCompact,\n },\n\n cellFixed: {\n flexGrow: 0,\n flexShrink: 0,\n justifyContent: \"center\",\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellGridBorder: {\n borderRightColor: borderColor,\n borderRightStyle: \"solid\",\n borderRightWidth: hairline,\n },\n\n cellMinimal: {\n paddingHorizontal: spacing[2] - 2,\n paddingVertical: spacing[1] + 1,\n },\n\n cellPrimaryHeader: {\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellStriped: {\n paddingHorizontal: cellPadH,\n paddingVertical: cellPadV,\n },\n\n cellText: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n lineHeight: 1.2,\n },\n cellTextCompact: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n lineHeight: 1.2,\n },\n cellTextFooter: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: 1.2,\n },\n cellTextHeaderBordered: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.bold,\n lineHeight: 1.2,\n },\n cellTextHeaderCompact: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.semibold,\n letterSpacing: 0.6,\n lineHeight: 1.2,\n textTransform: \"uppercase\",\n },\n cellTextHeaderGrid: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: 1.2,\n },\n cellTextHeaderLine: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: 1.2,\n },\n\n cellTextHeaderMinimal: {\n color: t.colors.mutedForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.medium,\n lineHeight: 1.2,\n },\n cellTextHeaderPrimaryHeader: {\n color: t.colors.primaryForeground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: typography.xs,\n fontWeight: fontWeights.semibold,\n letterSpacing: 0.6,\n lineHeight: 1.2,\n textTransform: \"uppercase\",\n },\n cellTextHeaderStriped: {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n fontSize: t.typography.body.fontSize,\n fontWeight: fontWeights.semibold,\n lineHeight: 1.2,\n },\n row: {\n display: \"flex\",\n flexDirection: \"row\",\n },\n rowBordered: rowDivider,\n rowCompact: rowDivider,\n rowFooter: {\n borderTopColor: borderColor,\n borderTopStyle: \"solid\",\n borderTopWidth: rule,\n },\n\n rowFooterStriped: {\n backgroundColor: t.colors.muted,\n borderTopColor: borderColor,\n borderTopStyle: \"solid\",\n borderTopWidth: rule,\n },\n rowGrid: rowDivider,\n\n rowHeaderBordered: {\n backgroundColor: t.colors.muted,\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n },\n\n rowHeaderCompact: {\n backgroundColor: t.colors.muted,\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n rowHeaderGrid: {\n backgroundColor: t.colors.muted,\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n\n rowHeaderLine: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n rowHeaderMinimal: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n rowHeaderPrimaryHeader: {\n backgroundColor: t.colors.primary,\n },\n rowHeaderStriped: {\n backgroundColor: t.colors.muted,\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: rule,\n },\n rowLine: rowDivider,\n\n rowMinimal: rowDivider,\n rowPrimaryHeader: rowDivider,\n\n rowStripe: {\n backgroundColor: t.colors.muted,\n },\n\n rowStriped: {},\n table: {\n display: \"flex\",\n flexDirection: \"column\",\n marginBottom: t.spacing.componentGap,\n width: \"100%\",\n },\n tableBordered: {\n borderBottomLeftRadius: borderRadius.sm,\n borderBottomRightRadius: borderRadius.sm,\n borderColor,\n borderStyle: \"solid\",\n borderTopLeftRadius: borderRadius.sm,\n borderTopRightRadius: borderRadius.sm,\n borderWidth: rule,\n overflow: \"hidden\" as const,\n },\n tableCompact: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n },\n tableGrid: {\n borderBottomLeftRadius: borderRadius.md,\n borderBottomRightRadius: borderRadius.md,\n borderColor,\n borderStyle: \"solid\",\n borderTopLeftRadius: borderRadius.md,\n borderTopRightRadius: borderRadius.md,\n borderWidth: thick,\n overflow: \"hidden\" as const,\n },\n tableLine: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n },\n tableMinimal: {\n paddingVertical: spacing[2],\n },\n\n tablePrimaryHeader: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n },\n\n tableStriped: {\n borderBottomColor: borderColor,\n borderBottomStyle: \"solid\",\n borderBottomWidth: hairline,\n borderTopColor: borderColor,\n borderTopStyle: \"solid\",\n borderTopWidth: hairline,\n },\n });\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/table/table.styles.ts"},{"path": "registry/bases/takumi/components/table/table.tsx",- "content": "import { Children, cloneElement, isValidElement } from 'react';\nimport type { ReactElement, ReactNode } from 'react';\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, Text as PDFText } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\nimport { createTableStyles } from \"./table.styles\";\nimport type {\n TableCellProps,\n TableProps,\n TableRowProps,\n TableSectionProps,\n TableVariant,\n} from \"./table.types\";\n\nfunction processTableChildren(\n children: ReactNode,\n variant: TableVariant,\n zebraStripe: boolean\n): ReactNode {\n let bodyRowIndex = 0;\n\n return Children.map(children, (child) => {\n if (!isValidElement(child)) {return child;}\n\n if (\n child.type === TableHeader ||\n child.type === TableBody ||\n child.type === TableFooter\n ) {\n const isBody = child.type === TableBody;\n const sectionChild = child as ReactElement<TableSectionProps>;\n const sectionChildren = Children.map(\n sectionChild.props.children,\n (rowChild) => {\n if (isValidElement(rowChild) && rowChild.type === TableRow) {\n const rowProps: Partial<TableRowProps> = { variant };\n\n if (isBody && zebraStripe) {\n const isStripe = bodyRowIndex % 2 === 1;\n bodyRowIndex++;\n if (isStripe) {\n rowProps.stripe = true;\n }\n }\n\n return cloneElement(\n rowChild as ReactElement<TableRowProps>,\n rowProps\n );\n }\n return rowChild;\n }\n );\n\n return cloneElement(child, {}, sectionChildren);\n }\n\n if (child.type === TableRow) {\n return cloneElement(child as ReactElement<TableRowProps>, { variant });\n }\n\n return child;\n });\n}\n\nexport function TableHeader({ children, style }: TableSectionProps) {\n return <View style={style}>{children}</View>;\n}\n\nexport function TableBody({ children, style }: TableSectionProps) {\n return <View style={style}>{children}</View>;\n}\n\nexport function TableFooter({ children, style }: TableSectionProps) {\n return <View style={style}>{children}</View>;\n}\n\nexport function Table({\n children,\n style,\n variant = \"line\",\n zebraStripe = false,\n noWrap = false,\n}: TableProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createTableStyles(theme), [theme]);\n const tableStyles: Style[] = [styles.table];\n const effectiveZebra = variant === \"striped\" ? true : zebraStripe;\n\n tableStyles.push(\n {\n bordered: styles.tableBordered,\n compact: styles.tableCompact,\n grid: styles.tableGrid,\n line: styles.tableLine,\n minimal: styles.tableMinimal,\n \"primary-header\": styles.tablePrimaryHeader,\n striped: styles.tableStriped,\n }[variant]\n );\n\n const styleArray = style ? [...tableStyles, style] : tableStyles;\n const processedChildren = processTableChildren(\n children,\n variant,\n effectiveZebra\n );\n\n const inner = <View style={styleArray}>{processedChildren}</View>;\n return noWrap ? (\n <View style={[{ breakInside: \"avoid\" as const }].filter(Boolean)}>\n {inner}\n </View>\n ) : (\n inner\n );\n}\n\nexport function TableRow({\n header,\n footer,\n stripe,\n children,\n style,\n variant = \"line\",\n}: TableRowProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createTableStyles(theme), [theme]);\n const rowStyles: Style[] = [styles.row];\n\n rowStyles.push(\n {\n bordered: styles.rowBordered,\n compact: styles.rowCompact,\n grid: styles.rowGrid,\n line: styles.rowLine,\n minimal: styles.rowMinimal,\n \"primary-header\": styles.rowPrimaryHeader,\n striped: styles.rowStriped,\n }[variant]\n );\n\n if (header) {\n rowStyles.push(\n {\n bordered: styles.rowHeaderBordered,\n compact: styles.rowHeaderCompact,\n grid: styles.rowHeaderGrid,\n line: styles.rowHeaderLine,\n minimal: styles.rowHeaderMinimal,\n \"primary-header\": styles.rowHeaderPrimaryHeader,\n striped: styles.rowHeaderStriped,\n }[variant]\n );\n }\n\n if (footer) {\n if (variant === \"striped\") {rowStyles.push(styles.rowFooterStriped);}\n else {rowStyles.push(styles.rowFooter);}\n }\n\n if (stripe && !header && !footer) {\n rowStyles.push(styles.rowStripe);\n }\n\n const styleArray = style ? [...rowStyles, style] : rowStyles;\n const childArray = Children.toArray(children);\n const processedChildren = childArray.map((child, i) => {\n if (isValidElement(child) && child.type === TableCell) {\n return cloneElement(child as ReactElement<TableCellProps>, {\n _last: i === childArray.length - 1,\n footer,\n header,\n variant,\n });\n }\n return child;\n });\n\n return (\n <View\n style={[{ breakInside: \"avoid\" as const }, styleArray]\n .flat()\n .filter(Boolean)}\n >\n {processedChildren}\n </View>\n );\n}\n\nexport function TableCell({\n header,\n footer,\n align,\n width,\n children,\n style,\n variant = \"line\",\n _last,\n}: TableCellProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createTableStyles(theme), [theme]);\n const cellStyles: Style[] =\n width !== undefined\n ? [styles.cellFixed, { width } as Style]\n : [styles.cell];\n\n const cellVariantStyle = (\n {\n bordered: styles.cellBordered,\n compact: styles.cellCompact,\n minimal: styles.cellMinimal,\n \"primary-header\": styles.cellPrimaryHeader,\n striped: styles.cellStriped,\n } as Partial<Record<TableVariant, Style>>\n )[variant];\n if (cellVariantStyle) {cellStyles.push(cellVariantStyle);}\n\n if (variant === \"grid\" && !_last) {\n cellStyles.push(styles.cellGridBorder);\n } else if (variant === \"bordered\" && !_last) {\n cellStyles.push(styles.cellBorderedBorder);\n }\n\n if (align) {\n cellStyles.push({ textAlign: align } as Style);\n }\n\n const styleArray = style ? [...cellStyles, style] : cellStyles;\n\n let textStyle: Style = styles.cellText;\n if (header) {\n textStyle = {\n bordered: styles.cellTextHeaderBordered,\n compact: styles.cellTextHeaderCompact,\n grid: styles.cellTextHeaderGrid,\n line: styles.cellTextHeaderLine,\n minimal: styles.cellTextHeaderMinimal,\n \"primary-header\": styles.cellTextHeaderPrimaryHeader,\n striped: styles.cellTextHeaderStriped,\n }[variant];\n } else if (footer) {\n textStyle = styles.cellTextFooter;\n } else if (variant === \"compact\") {\n textStyle = styles.cellTextCompact;\n }\n\n const content =\n typeof children === \"string\" ? (\n <PDFText\n style={[\n textStyle,\n align ? { textAlign: align } : {},\n { margin: 0, padding: 0 },\n ]}\n >\n {children}\n </PDFText>\n ) : (\n children\n );\n\n return <View style={styleArray}>{content}</View>;\n}\n",- "type": "registry:component"+ "content": "import { Children, cloneElement, isValidElement } from \"react\";\nimport type { ReactElement, ReactNode } from \"react\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { View, Text as PDFText } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\nimport { createTableStyles } from \"./table.styles\";\nimport type {\n TableCellProps,\n TableProps,\n TableRowProps,\n TableSectionProps,\n TableVariant,\n} from \"./table.types\";\n\nexport const TableHeader = ({ children, style }: TableSectionProps) => (\n <View style={style}>{children}</View>\n);\n\nexport const TableBody = ({ children, style }: TableSectionProps) => (\n <View style={style}>{children}</View>\n);\n\nexport const TableFooter = ({ children, style }: TableSectionProps) => (\n <View style={style}>{children}</View>\n);\n\nexport const TableCell = ({\n header,\n footer,\n align,\n width,\n children,\n style,\n variant = \"line\",\n _last,\n}: TableCellProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createTableStyles(theme), [theme]);\n const cellStyles: Style[] =\n width === undefined\n ? [styles.cell]\n : [styles.cellFixed, { width } as Style];\n\n const cellVariantStyle = (\n {\n bordered: styles.cellBordered,\n compact: styles.cellCompact,\n minimal: styles.cellMinimal,\n \"primary-header\": styles.cellPrimaryHeader,\n striped: styles.cellStriped,\n } as Partial<Record<TableVariant, Style>>\n )[variant];\n if (cellVariantStyle) {\n cellStyles.push(cellVariantStyle);\n }\n\n if (variant === \"grid\" && !_last) {\n cellStyles.push(styles.cellGridBorder);\n } else if (variant === \"bordered\" && !_last) {\n cellStyles.push(styles.cellBorderedBorder);\n }\n\n if (align) {\n cellStyles.push({ textAlign: align } as Style);\n }\n\n const styleArray = style ? [...cellStyles, style] : cellStyles;\n\n let textStyle: Style = styles.cellText;\n if (header) {\n textStyle = {\n bordered: styles.cellTextHeaderBordered,\n compact: styles.cellTextHeaderCompact,\n grid: styles.cellTextHeaderGrid,\n line: styles.cellTextHeaderLine,\n minimal: styles.cellTextHeaderMinimal,\n \"primary-header\": styles.cellTextHeaderPrimaryHeader,\n striped: styles.cellTextHeaderStriped,\n }[variant];\n } else if (footer) {\n textStyle = styles.cellTextFooter;\n } else if (variant === \"compact\") {\n textStyle = styles.cellTextCompact;\n }\n\n const content =\n typeof children === \"string\" ? (\n <PDFText\n style={[\n textStyle,\n align ? { textAlign: align } : {},\n { margin: 0, padding: 0 },\n ]}\n >\n {children}\n </PDFText>\n ) : (\n children\n );\n\n return <View style={styleArray}>{content}</View>;\n};\n\nexport const TableRow = ({\n header,\n footer,\n stripe,\n children,\n style,\n variant = \"line\",\n}: TableRowProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createTableStyles(theme), [theme]);\n const rowStyles: Style[] = [\n styles.row,\n {\n bordered: styles.rowBordered,\n compact: styles.rowCompact,\n grid: styles.rowGrid,\n line: styles.rowLine,\n minimal: styles.rowMinimal,\n \"primary-header\": styles.rowPrimaryHeader,\n striped: styles.rowStriped,\n }[variant],\n ];\n\n if (header) {\n rowStyles.push(\n {\n bordered: styles.rowHeaderBordered,\n compact: styles.rowHeaderCompact,\n grid: styles.rowHeaderGrid,\n line: styles.rowHeaderLine,\n minimal: styles.rowHeaderMinimal,\n \"primary-header\": styles.rowHeaderPrimaryHeader,\n striped: styles.rowHeaderStriped,\n }[variant]\n );\n }\n\n if (footer) {\n if (variant === \"striped\") {\n rowStyles.push(styles.rowFooterStriped);\n } else {\n rowStyles.push(styles.rowFooter);\n }\n }\n\n if (stripe && !header && !footer) {\n rowStyles.push(styles.rowStripe);\n }\n\n const styleArray = style ? [...rowStyles, style] : rowStyles;\n const childArray = Children.toArray(children);\n const processedChildren = childArray.map((child, i) => {\n if (isValidElement(child) && child.type === TableCell) {\n return cloneElement(child as ReactElement<TableCellProps>, {\n _last: i === childArray.length - 1,\n footer,\n header,\n variant,\n });\n }\n return child;\n });\n\n return (\n <View\n style={[{ breakInside: \"avoid\" as const }, styleArray]\n .flat()\n .filter(Boolean)}\n >\n {processedChildren}\n </View>\n );\n};\n\nconst processTableChildren = (\n children: ReactNode,\n variant: TableVariant,\n zebraStripe: boolean\n): ReactNode => {\n let bodyRowIndex = 0;\n\n return Children.map(children, (child) => {\n if (!isValidElement(child)) {\n return child;\n }\n\n if (\n child.type === TableHeader ||\n child.type === TableBody ||\n child.type === TableFooter\n ) {\n const isBody = child.type === TableBody;\n const sectionChild = child as ReactElement<TableSectionProps>;\n const sectionChildren = Children.map(\n sectionChild.props.children,\n (rowChild) => {\n if (isValidElement(rowChild) && rowChild.type === TableRow) {\n const rowProps: Partial<TableRowProps> = { variant };\n\n if (isBody && zebraStripe) {\n const isStripe = bodyRowIndex % 2 === 1;\n bodyRowIndex += 1;\n if (isStripe) {\n rowProps.stripe = true;\n }\n }\n\n return cloneElement(\n rowChild as ReactElement<TableRowProps>,\n rowProps\n );\n }\n return rowChild;\n }\n );\n\n return cloneElement(child, {}, sectionChildren);\n }\n\n if (child.type === TableRow) {\n return cloneElement(child as ReactElement<TableRowProps>, { variant });\n }\n\n return child;\n });\n};\n\nexport const Table = ({\n children,\n style,\n variant = \"line\",\n zebraStripe = false,\n noWrap = false,\n}: TableProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createTableStyles(theme), [theme]);\n const tableStyles: Style[] = [styles.table];\n const effectiveZebra = variant === \"striped\" ? true : zebraStripe;\n\n tableStyles.push(\n {\n bordered: styles.tableBordered,\n compact: styles.tableCompact,\n grid: styles.tableGrid,\n line: styles.tableLine,\n minimal: styles.tableMinimal,\n \"primary-header\": styles.tablePrimaryHeader,\n striped: styles.tableStriped,\n }[variant]\n );\n\n const styleArray = style ? [...tableStyles, style] : tableStyles;\n const processedChildren = processTableChildren(\n children,\n variant,\n effectiveZebra\n );\n\n const inner = <View style={styleArray}>{processedChildren}</View>;\n return noWrap ? (\n <View style={[{ breakInside: \"avoid\" as const }].filter(Boolean)}>\n {inner}\n </View>\n ) : (\n inner\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/table/table.tsx"},{"path": "registry/bases/takumi/components/table/table.types.ts","content": "import type { PDFComponentProps } from \"@/registry/themes\";\n\n/** Table visual style variant. */\nexport type TableVariant =\n | \"line\"\n | \"grid\"\n | \"minimal\"\n | \"striped\"\n | \"compact\"\n | \"bordered\"\n | \"primary-header\";\n\n/**\n * Table container with visual style variants and optional zebra striping.\n * Props - `variant` | `zebraStripe` | `noWrap` | `children` | `style`\n * @see {@link TableProps}\n */\nexport interface TableProps extends PDFComponentProps {\n /**\n * @default 'line'\n */\n variant?: TableVariant;\n /**\n * @default false\n */\n zebraStripe?: boolean;\n /**\n * @default false\n */\n noWrap?: boolean;\n}\n\nexport type TableSectionProps = PDFComponentProps;\n\n/**\n * Table row with optional header, footer, and stripe states.\n * Props - `header` | `footer` | `stripe` | `variant` | `children` | `style`\n * @see {@link TableRowProps}\n */\nexport interface TableRowProps extends PDFComponentProps {\n header?: boolean;\n footer?: boolean;\n stripe?: boolean;\n variant?: TableVariant;\n}\n\n/**\n * Table cell with alignment, width, and header or footer text styling.\n * Props - `header` | `footer` | `align` | `width` | `variant` | `_last` | `children` | `style`\n * @see {@link TableCellProps}\n */\nexport interface TableCellProps extends PDFComponentProps {\n header?: boolean;\n footer?: boolean;\n align?: \"left\" | \"center\" | \"right\";\n width?: string | number;\n variant?: TableVariant;\n _last?: boolean;\n}\n",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/table/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/text.json b/public/r/takumi/text.jsonindex 0fc9935..1c7be23 100644--- a/public/r/takumi/text.json+++ b/public/r/takumi/text.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/takumi/components/text/text.tsx",- "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type TextVariant = \"xs\" | \"sm\" | \"base\" | \"lg\" | \"xl\" | \"2xl\" | \"3xl\";\nexport type TextWeight = \"normal\" | \"medium\" | \"semibold\" | \"bold\";\nexport type TextDecoration = \"underline\" | \"line-through\" | \"none\";\n\n/**\n * Body text with typography scale, alignment, and decoration options.\n * Props - `variant` | `align` | `color` | `weight` | `italic` | `decoration` | `transform` | `noMargin` | `children` | `style`\n * @see {@link TextProps}\n */\nexport interface TextProps extends PDFComponentProps {\n /**\n * @default 'base'\n */\n variant?: TextVariant;\n /**\n * @default 'left'\n */\n align?: \"left\" | \"center\" | \"right\" | \"justify\";\n color?: string;\n /**\n * @default 'normal'\n */\n weight?: TextWeight;\n /**\n * @default false\n */\n italic?: boolean;\n /**\n * @default 'none'\n */\n decoration?: TextDecoration;\n transform?: \"uppercase\" | \"lowercase\" | \"capitalize\";\n /**\n * @default false\n */\n noMargin?: boolean;\n}\n\nfunction createTextStyles(t: PdfcnTheme) {\n const { fontWeights, letterSpacing } = t.primitives;\n const base = {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n lineHeight: t.typography.body.lineHeight,\n marginBottom: t.spacing.paragraphGap,\n marginTop: 0,\n };\n return StyleSheet.create({\n \"2xl\": { ...base, fontSize: t.primitives.typography[\"2xl\"] },\n \"3xl\": { ...base, fontSize: t.primitives.typography[\"3xl\"] },\n base: { ...base, fontSize: t.primitives.typography.base },\n capitalize: { textTransform: \"capitalize\" },\n decorationNone: { textDecoration: \"none\" },\n italic: { fontStyle: \"italic\" },\n lg: { ...base, fontSize: t.primitives.typography.lg },\n lineThrough: { textDecoration: \"line-through\" },\n lowercase: { textTransform: \"lowercase\" },\n noMargin: { marginBottom: 0, marginTop: 0 },\n sm: { ...base, fontSize: t.primitives.typography.sm },\n text: { ...base, fontSize: t.typography.body.fontSize },\n underline: { textDecoration: \"underline\" },\n uppercase: {\n letterSpacing: letterSpacing.wider * 10,\n textTransform: \"uppercase\",\n },\n weightBold: { fontWeight: fontWeights.bold },\n weightMedium: { fontWeight: fontWeights.medium },\n weightNormal: { fontWeight: fontWeights.regular },\n weightSemibold: { fontWeight: fontWeights.semibold },\n xl: { ...base, fontSize: t.primitives.typography.xl },\n xs: { ...base, fontSize: t.primitives.typography.xs },\n });\n}\n\nexport function Text({\n variant,\n align,\n color,\n weight,\n italic,\n decoration,\n transform,\n noMargin,\n children,\n style,\n}: TextProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createTextStyles(theme), [theme]);\n const weightMap = {\n bold: styles.weightBold,\n medium: styles.weightMedium,\n normal: styles.weightNormal,\n semibold: styles.weightSemibold,\n };\n const decorationMap = {\n \"line-through\": styles.lineThrough,\n none: styles.decorationNone,\n underline: styles.underline,\n };\n const transformMap = {\n capitalize: styles.capitalize,\n lowercase: styles.lowercase,\n uppercase: styles.uppercase,\n };\n const styleArray: Style[] = [variant ? styles[variant] : styles.text];\n if (weight && weight in weightMap) {styleArray.push(weightMap[weight]);}\n if (italic) {styleArray.push(styles.italic);}\n if (decoration && decoration in decorationMap)\n {styleArray.push(decorationMap[decoration]);}\n if (transform && transform in transformMap)\n {styleArray.push(transformMap[transform]);}\n if (noMargin) {styleArray.push(styles.noMargin);}\n const semantic = {} as Style;\n if (align) {semantic.textAlign = align;}\n if (color) {semantic.color = resolveColor(color, theme.colors);}\n if (Object.keys(semantic).length > 0) {styleArray.push(semantic);}\n if (style) {styleArray.push(...[style].flat());}\n return <PDFText style={styleArray}>{children}</PDFText>;\n}\n",- "type": "registry:component"+ "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type TextVariant = \"xs\" | \"sm\" | \"base\" | \"lg\" | \"xl\" | \"2xl\" | \"3xl\";\nexport type TextWeight = \"normal\" | \"medium\" | \"semibold\" | \"bold\";\nexport type TextDecoration = \"underline\" | \"line-through\" | \"none\";\n\n/**\n * Body text with typography scale, alignment, and decoration options.\n * Props - `variant` | `align` | `color` | `weight` | `italic` | `decoration` | `transform` | `noMargin` | `children` | `style`\n * @see {@link TextProps}\n */\nexport interface TextProps extends PDFComponentProps {\n /**\n * @default 'base'\n */\n variant?: TextVariant;\n /**\n * @default 'left'\n */\n align?: \"left\" | \"center\" | \"right\" | \"justify\";\n color?: string;\n /**\n * @default 'normal'\n */\n weight?: TextWeight;\n /**\n * @default false\n */\n italic?: boolean;\n /**\n * @default 'none'\n */\n decoration?: TextDecoration;\n transform?: \"uppercase\" | \"lowercase\" | \"capitalize\";\n /**\n * @default false\n */\n noMargin?: boolean;\n}\n\nconst createTextStyles = (t: PdfcnTheme) => {\n const { fontWeights, letterSpacing } = t.primitives;\n const base = {\n color: t.colors.foreground,\n fontFamily: t.typography.body.fontFamily,\n lineHeight: t.typography.body.lineHeight,\n marginBottom: t.spacing.paragraphGap,\n marginTop: 0,\n };\n return StyleSheet.create({\n \"2xl\": { ...base, fontSize: t.primitives.typography[\"2xl\"] },\n \"3xl\": { ...base, fontSize: t.primitives.typography[\"3xl\"] },\n base: { ...base, fontSize: t.primitives.typography.base },\n capitalize: { textTransform: \"capitalize\" },\n decorationNone: { textDecoration: \"none\" },\n italic: { fontStyle: \"italic\" },\n lg: { ...base, fontSize: t.primitives.typography.lg },\n lineThrough: { textDecoration: \"line-through\" },\n lowercase: { textTransform: \"lowercase\" },\n noMargin: { marginBottom: 0, marginTop: 0 },\n sm: { ...base, fontSize: t.primitives.typography.sm },\n text: { ...base, fontSize: t.typography.body.fontSize },\n underline: { textDecoration: \"underline\" },\n uppercase: {\n letterSpacing: letterSpacing.wider * 10,\n textTransform: \"uppercase\",\n },\n weightBold: { fontWeight: fontWeights.bold },\n weightMedium: { fontWeight: fontWeights.medium },\n weightNormal: { fontWeight: fontWeights.regular },\n weightSemibold: { fontWeight: fontWeights.semibold },\n xl: { ...base, fontSize: t.primitives.typography.xl },\n xs: { ...base, fontSize: t.primitives.typography.xs },\n });\n};\n\nexport const Text = ({\n variant,\n align,\n color,\n weight,\n italic,\n decoration,\n transform,\n noMargin,\n children,\n style,\n}: TextProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createTextStyles(theme), [theme]);\n const weightMap = {\n bold: styles.weightBold,\n medium: styles.weightMedium,\n normal: styles.weightNormal,\n semibold: styles.weightSemibold,\n };\n const decorationMap = {\n \"line-through\": styles.lineThrough,\n none: styles.decorationNone,\n underline: styles.underline,\n };\n const transformMap = {\n capitalize: styles.capitalize,\n lowercase: styles.lowercase,\n uppercase: styles.uppercase,\n };\n const styleArray: Style[] = [variant ? styles[variant] : styles.text];\n if (weight && weight in weightMap) {\n styleArray.push(weightMap[weight]);\n }\n if (italic) {\n styleArray.push(styles.italic);\n }\n if (decoration && decoration in decorationMap) {\n styleArray.push(decorationMap[decoration]);\n }\n if (transform && transform in transformMap) {\n styleArray.push(transformMap[transform]);\n }\n if (noMargin) {\n styleArray.push(styles.noMargin);\n }\n const semantic = {} as Style;\n if (align) {\n semantic.textAlign = align;\n }\n if (color) {\n semantic.color = resolveColor(color, theme.colors);\n }\n if (Object.keys(semantic).length > 0) {\n styleArray.push(semantic);\n }\n if (style) {\n styleArray.push(...[style].flat());\n }\n return <PDFText style={styleArray}>{children}</PDFText>;\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/text/index.ts"}],"type": "registry:ui"diff --git a/public/r/takumi/utils.json b/public/r/takumi/utils.jsonindex 680a835..1419dac 100644--- a/public/r/takumi/utils.json+++ b/public/r/takumi/utils.json@@ -11,27 +11,32 @@{"path": "registry/bases/takumi/lib/pdfcn-theme.ts","content": "import { professionalTheme } from \"@/registry/themes\";\n\nexport const theme = professionalTheme;\n",- "type": "registry:lib"+ "type": "registry:lib",+ "target": "components/pdf/lib/pdfcn-theme.ts"},{"path": "registry/bases/takumi/lib/pdfcn-theme-context.tsx",- "content": "/* eslint-disable react-refresh/only-export-components */\n// Exports both a component (PdfcnThemeProvider) and hooks/context intentionally.\n// All PDF components import from a single file — splitting would break the public API.\n\nimport * as React from \"react\";\nimport { createContext, useContext, useMemo } from 'react';\nimport type { DependencyList, ReactNode } from 'react';\n\nimport { theme as defaultTheme } from \"./pdfcn-theme\";\n\nexport type PdfcnTheme = typeof defaultTheme;\n\nexport const PdfcnThemeContext = createContext<PdfcnTheme>(defaultTheme);\n\nexport interface PdfcnThemeProviderProps {\n theme?: PdfcnTheme;\n children: ReactNode;\n}\n\n/**\n * Detect whether React currently has an active dispatcher.\n * When components are invoked as plain functions in tests, dispatcher is null.\n */\nfunction hasActiveDispatcher(): boolean {\n const maybeInternals = React as unknown as {\n __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE?: {\n H?: unknown;\n };\n };\n\n const dispatcher =\n maybeInternals\n .__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE?.H;\n return dispatcher != null;\n}\n\nexport function PdfcnThemeProvider({\n theme,\n children,\n}: PdfcnThemeProviderProps) {\n const resolvedTheme = useMemo(() => theme ?? defaultTheme, [theme]);\n return (\n <PdfcnThemeContext.Provider value={resolvedTheme}>\n {children}\n </PdfcnThemeContext.Provider>\n );\n}\n\n/**\n * Regex patterns that indicate a hook was called outside a valid React render tree.\n * These errors are caught and suppressed so components fall back to safe defaults.\n */\nconst HOOK_ERROR_PATTERNS =\n /invalid hook call|useContext|useMemo|cannot read properties of null|dispatcher|renderWithHooks|resolveDispatcher|hooks can only be called|rendered fewer hooks/i;\n\n/**\n * Calls a React hook with a graceful fallback for non-render environments (e.g. unit tests).\n * Uses hasActiveDispatcher() as the primary guard; the try/catch is a safety net for edge\n * cases where the dispatcher check passes but the hook still cannot execute.\n */\nfunction callHook<T>(hook: () => T, fallback: T): T {\n if (!hasActiveDispatcher()) {return fallback;}\n try {\n return hook();\n } catch (error) {\n if (error instanceof Error && HOOK_ERROR_PATTERNS.test(error.message))\n {return fallback;}\n throw error;\n }\n}\n\n/**\n * Returns the active PdfcnTheme from context, or the default theme when called\n * outside a React render tree (e.g. unit tests).\n */\nexport function usePdfcnTheme(): PdfcnTheme {\n return callHook(() => useContext(PdfcnThemeContext), defaultTheme);\n}\n\n/**\n * Calls factory() and returns the result.\n * The deps parameter is accepted for API compatibility with existing callers.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function useSafeMemo<T>(factory: () => T, _deps: DependencyList): T {\n return factory();\n}\n",- "type": "registry:lib"+ "content": "\"use client\";\n\n/* eslint-disable react-refresh/only-export-components */\n// Exports both a component (PdfcnThemeProvider) and hooks/context intentionally.\n// All PDF components import from a single file — splitting would break the public API.\n\nimport * as React from \"react\";\nimport { createContext, useContext } from \"react\";\nimport type { DependencyList, ReactNode } from \"react\";\n\nimport { theme as defaultTheme } from \"./pdfcn-theme\";\n\nexport type PdfcnTheme = typeof defaultTheme;\n\nexport const PdfcnThemeContext = createContext<PdfcnTheme>(defaultTheme);\n\nexport interface PdfcnThemeProviderProps {\n theme?: PdfcnTheme;\n children: ReactNode;\n}\n\n/**\n * Detect whether React currently has an active dispatcher.\n * When components are invoked as plain functions in tests, dispatcher is null.\n */\nconst hasActiveDispatcher = (): boolean => {\n const maybeInternals = React as unknown as {\n __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE?: {\n H?: unknown;\n };\n };\n\n const dispatcher =\n maybeInternals\n .__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE?.H;\n return dispatcher != null;\n};\n\nexport const PdfcnThemeProvider = ({\n theme,\n children,\n}: PdfcnThemeProviderProps) => (\n <PdfcnThemeContext.Provider value={theme ?? defaultTheme}>\n {children}\n </PdfcnThemeContext.Provider>\n);\n\n/**\n * Regex patterns that indicate a hook was called outside a valid React render tree.\n * These errors are caught and suppressed so components fall back to safe defaults.\n */\nconst HOOK_ERROR_PATTERNS =\n /invalid hook call|minified react error #321|useContext|useMemo|cannot read properties of null|dispatcher|renderWithHooks|resolveDispatcher|hooks can only be called|rendered fewer hooks/i;\n\n/**\n * Calls a React hook with a graceful fallback for non-render environments (e.g. unit tests).\n * Uses hasActiveDispatcher() as the primary guard; the try/catch is a safety net for edge\n * cases where the dispatcher check passes but the hook still cannot execute.\n */\nconst callHook = <T,>(hook: () => T, fallback: T): T => {\n if (!hasActiveDispatcher()) {\n return fallback;\n }\n try {\n return hook();\n } catch (error) {\n if (error instanceof Error && HOOK_ERROR_PATTERNS.test(error.message)) {\n return fallback;\n }\n throw error;\n }\n};\n\n/**\n * Returns the active PdfcnTheme from context, or the default theme when called\n * outside a React render tree (e.g. unit tests).\n */\nexport const usePdfcnTheme = (): PdfcnTheme =>\n callHook(() => useContext(PdfcnThemeContext), defaultTheme);\n\n/**\n * Calls factory() and returns the result.\n * The deps parameter is accepted for API compatibility with existing callers.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport const useSafeMemo = <T,>(factory: () => T, _deps: DependencyList): T =>\n factory();\n",+ "type": "registry:lib",+ "target": "components/pdf/lib/pdfcn-theme-context.tsx"},{"path": "registry/bases/takumi/lib/resolve-color.ts",- "content": "import type { ColorTokens } from \"@/registry/themes\";\n\n/** Theme color token keys that can be used for the color prop */\nexport const THEME_COLOR_KEYS = [\n \"foreground\",\n \"background\",\n \"muted\",\n \"mutedForeground\",\n \"primary\",\n \"primaryForeground\",\n \"border\",\n \"accent\",\n \"destructive\",\n \"success\",\n \"warning\",\n \"info\",\n] as const satisfies (keyof ColorTokens)[];\n\n/** Resolves a color value: theme token key → hex, or raw CSS color as-is. */\nexport function resolveColor(value: string, colors: ColorTokens): string {\n const key = value as (typeof THEME_COLOR_KEYS)[number];\n return THEME_COLOR_KEYS.includes(key) ? colors[key] : value;\n}\n",- "type": "registry:lib"+ "content": "import type { ColorTokens } from \"@/registry/themes\";\n\n/** Theme color token keys that can be used for the color prop */\nexport const THEME_COLOR_KEYS = [\n \"foreground\",\n \"background\",\n \"muted\",\n \"mutedForeground\",\n \"primary\",\n \"primaryForeground\",\n \"border\",\n \"accent\",\n \"destructive\",\n \"success\",\n \"warning\",\n \"info\",\n] as const satisfies (keyof ColorTokens)[];\n\n/** Resolves a color value: theme token key → hex, or raw CSS color as-is. */\nexport const resolveColor = (value: string, colors: ColorTokens): string => {\n const key = value as (typeof THEME_COLOR_KEYS)[number];\n return THEME_COLOR_KEYS.includes(key) ? colors[key] : value;\n};\n",+ "type": "registry:lib",+ "target": "components/pdf/lib/resolve-color.ts"},{"path": "registry/bases/takumi/lib/takumi-primitives.tsx",- "content": "import type { ReactNode, ImgHTMLAttributes, AnchorHTMLAttributes } from \"react\";\n\nexport type Style = Record<string, unknown>;\n\nexport const StyleSheet = {\n create<T extends Record<string, Style>>(styles: T): T {\n return styles;\n },\n};\n\ntype StyleInput = Style | Style[] | false | null | undefined;\n\ninterface ViewProps {\n children?: ReactNode;\n style?: StyleInput;\n className?: string;\n wrap?: boolean;\n fixed?: boolean;\n break?: boolean;\n minPresenceAhead?: number;\n}\n\nfunction flatten(style?: StyleInput): Record<string, unknown> | undefined {\n if (!style) {return undefined;}\n if (Array.isArray(style)) {\n return Object.assign({}, ...style.filter(Boolean));\n }\n return style;\n}\n\nexport function View({ children, style, className, ...rest }: ViewProps) {\n const {\n wrap: _w,\n fixed: _f,\n break: br,\n minPresenceAhead: _m,\n ...dom\n } = rest as ViewProps & Record<string, unknown>;\n const merged = flatten(style) ?? {};\n if (br) {Object.assign(merged, { breakBefore: \"page\" });}\n return (\n <div\n className={className}\n style={merged as React.CSSProperties}\n {...(dom as object)}\n >\n {children}\n </div>\n );\n}\n\ninterface TextProps {\n children?: ReactNode;\n style?: StyleInput;\n className?: string;\n render?: (info: { pageNumber: number; totalPages: number }) => ReactNode;\n fixed?: boolean;\n href?: string;\n src?: string;\n}\n\nexport function Text({\n children,\n style,\n className,\n render: _render,\n href,\n src,\n ...rest\n}: TextProps) {\n const merged = flatten(style) as React.CSSProperties | undefined;\n const link = href ?? src;\n if (link) {\n return (\n <a href={link} className={className} style={merged} {...(rest as object)}>\n {children}\n </a>\n );\n }\n return (\n <span className={className} style={merged} {...(rest as object)}>\n {children}\n </span>\n );\n}\n\nexport function Image({\n src,\n style,\n ...rest\n}: {\n src: string | { uri: string };\n style?: StyleInput;\n} & Omit<ImgHTMLAttributes<HTMLImageElement>, \"src\" | \"style\">) {\n const resolved = typeof src === \"string\" ? src : src.uri;\n return (\n <img\n src={resolved}\n style={flatten(style) as React.CSSProperties}\n alt=\"\"\n {...rest}\n />\n );\n}\n\nexport function Link({\n src,\n children,\n style,\n ...rest\n}: {\n src: string;\n children?: ReactNode;\n style?: StyleInput;\n} & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, \"href\" | \"style\">) {\n return (\n <a href={src} style={flatten(style) as React.CSSProperties} {...rest}>\n {children}\n </a>\n );\n}\n\nexport function Document({\n children,\n title,\n style,\n}: {\n children?: ReactNode;\n title?: string;\n style?: StyleInput;\n}) {\n return (\n <div\n data-pdf-document={title}\n style={flatten(style) as React.CSSProperties}\n >\n {children}\n </div>\n );\n}\n\nexport function Page({\n children,\n size: _size,\n style,\n}: {\n children?: ReactNode;\n size?: string | { width: number; height: number };\n style?: StyleInput;\n}) {\n return (\n <div data-pdf-page style={flatten(style) as React.CSSProperties}>\n {children}\n </div>\n );\n}\n",- "type": "registry:lib"+ "content": "import type { ReactNode, ImgHTMLAttributes, AnchorHTMLAttributes } from \"react\";\n\nexport type Style = Record<string, unknown>;\n\nexport const StyleSheet = {\n create<T extends Record<string, Style>>(styles: T): T {\n return styles;\n },\n};\n\ntype StyleInput = Style | Style[] | false | null | undefined;\n\ninterface ViewProps {\n children?: ReactNode;\n style?: StyleInput;\n className?: string;\n wrap?: boolean;\n fixed?: boolean;\n break?: boolean;\n minPresenceAhead?: number;\n}\n\nconst flatten = (style?: StyleInput): Record<string, unknown> | undefined => {\n if (!style) {\n return undefined;\n }\n if (Array.isArray(style)) {\n return Object.assign({}, ...style.filter(Boolean));\n }\n return style;\n};\n\nexport const View = ({ children, style, className, ...rest }: ViewProps) => {\n const {\n wrap: _w,\n fixed: _f,\n break: br,\n minPresenceAhead: _m,\n ...dom\n } = rest as ViewProps & Record<string, unknown>;\n const merged = flatten(style) ?? {};\n if (br) {\n Object.assign(merged, { breakBefore: \"page\" });\n }\n return (\n <div\n className={className}\n style={merged as React.CSSProperties}\n {...(dom as object)}\n >\n {children}\n </div>\n );\n};\n\ninterface TextProps {\n children?: ReactNode;\n style?: StyleInput;\n className?: string;\n render?: (info: { pageNumber: number; totalPages: number }) => ReactNode;\n fixed?: boolean;\n href?: string;\n src?: string;\n}\n\nexport const Text = ({\n children,\n style,\n className,\n render: _render,\n href,\n src,\n ...rest\n}: TextProps) => {\n const merged = flatten(style) as React.CSSProperties | undefined;\n const link = href ?? src;\n if (link) {\n return (\n <a href={link} className={className} style={merged} {...(rest as object)}>\n {children}\n </a>\n );\n }\n return (\n <span className={className} style={merged} {...(rest as object)}>\n {children}\n </span>\n );\n};\n\nexport const Image = ({\n src,\n style,\n ...rest\n}: {\n src: string | { uri: string };\n style?: StyleInput;\n} & Omit<ImgHTMLAttributes<HTMLImageElement>, \"src\" | \"style\">) => {\n const resolved = typeof src === \"string\" ? src : src.uri;\n return (\n <img\n src={resolved}\n style={flatten(style) as React.CSSProperties}\n alt=\"\"\n {...rest}\n />\n );\n};\n\nexport const Link = ({\n src,\n children,\n style,\n ...rest\n}: {\n src: string;\n children?: ReactNode;\n style?: StyleInput;\n} & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, \"href\" | \"style\">) => (\n <a href={src} style={flatten(style) as React.CSSProperties} {...rest}>\n {children}\n </a>\n);\n\nexport const Document = ({\n children,\n title,\n style,\n}: {\n children?: ReactNode;\n title?: string;\n style?: StyleInput;\n}) => (\n <div data-pdf-document={title} style={flatten(style) as React.CSSProperties}>\n {children}\n </div>\n);\n\nexport const Page = ({\n children,\n size: _size,\n style,\n}: {\n children?: ReactNode;\n size?: string | { width: number; height: number };\n style?: StyleInput;\n}) => (\n <div data-pdf-page style={flatten(style) as React.CSSProperties}>\n {children}\n </div>\n);\n",+ "type": "registry:lib",+ "target": "components/pdf/lib/takumi-primitives.tsx"},{"path": "registry/bases/takumi/lib/takumi-svg.tsx",- "content": "import type { CSSProperties, ReactNode, SVGProps } from \"react\";\n\nexport function Svg({\n children,\n style,\n ...rest\n}: SVGProps<SVGSVGElement> & { style?: CSSProperties }) {\n return (\n <svg style={style} {...rest}>\n {children}\n </svg>\n );\n}\n\nexport function Rect(props: SVGProps<SVGRectElement>) {\n return <rect {...props} />;\n}\nexport function Circle(props: SVGProps<SVGCircleElement>) {\n return <circle {...props} />;\n}\nexport function G(props: SVGProps<SVGGElement>) {\n return <g {...props} />;\n}\nexport function Line(props: SVGProps<SVGLineElement>) {\n return <line {...props} />;\n}\nexport function Path(props: SVGProps<SVGPathElement>) {\n return <path {...props} />;\n}\nexport function SvgText({\n children,\n style,\n ...rest\n}: SVGProps<SVGTextElement> & { children?: ReactNode; style?: CSSProperties }) {\n return (\n <text style={style} {...rest}>\n {children}\n </text>\n );\n}\n",- "type": "registry:lib"+ "content": "import type { CSSProperties, ReactNode, SVGProps } from \"react\";\n\nexport const Svg = ({\n children,\n style,\n ...rest\n}: SVGProps<SVGSVGElement> & { style?: CSSProperties }) => (\n <svg style={style} {...rest}>\n {children}\n </svg>\n);\n\nexport const Rect = (props: SVGProps<SVGRectElement>) => <rect {...props} />;\nexport const Circle = (props: SVGProps<SVGCircleElement>) => (\n <circle {...props} />\n);\nexport const G = (props: SVGProps<SVGGElement>) => <g {...props} />;\nexport const Line = (props: SVGProps<SVGLineElement>) => <line {...props} />;\nexport const Path = (props: SVGProps<SVGPathElement>) => <path {...props} />;\nexport const SvgText = ({\n children,\n style,\n ...rest\n}: SVGProps<SVGTextElement> & {\n children?: ReactNode;\n style?: CSSProperties;\n}) => (\n <text style={style} {...rest}>\n {children}\n </text>\n);\n",+ "type": "registry:lib",+ "target": "components/pdf/lib/takumi-svg.tsx"}],"type": "registry:lib"diff --git a/public/r/takumi/watermark.json b/public/r/takumi/watermark.jsonindex 22e15a9..3cd6a9d 100644--- a/public/r/takumi/watermark.json+++ b/public/r/takumi/watermark.json@@ -13,13 +13,15 @@"files": [{"path": "registry/bases/takumi/components/watermark/watermark.tsx",- "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type WatermarkPosition =\n | \"center\"\n | \"top-left\"\n | \"top-right\"\n | \"bottom-left\"\n | \"bottom-right\";\n\n/**\n * Diagonal watermark overlaid across the full page using absolute positioning.\n * Props - `text` | `opacity` | `fontSize` | `color` | `angle` | `position` | `fixed` | `style`\n * @see {@link PdfWatermarkProps}\n */\nexport interface PdfWatermarkProps extends Omit<PDFComponentProps, \"children\"> {\n text: string;\n opacity?: number;\n fontSize?: number;\n color?: string;\n angle?: number;\n position?: WatermarkPosition;\n /**\n * @default true\n */\n fixed?: boolean;\n children?: never;\n}\n\nfunction createWatermarkStyles(t: PdfcnTheme) {\n const { fontWeights } = t.primitives;\n // Use page margins as corner insets so watermark position adapts to the active theme.\n const { marginTop, marginBottom, marginLeft, marginRight } = t.spacing.page;\n return StyleSheet.create({\n container: {\n alignItems: \"center\",\n bottom: 0,\n justifyContent: \"center\",\n left: 0,\n pointerEvents: \"none\",\n position: \"absolute\",\n right: 0,\n top: 0,\n zIndex: -1,\n },\n positionBottomLeft: {\n alignItems: \"flex-start\",\n justifyContent: \"flex-end\",\n paddingBottom: marginBottom,\n paddingLeft: marginLeft,\n },\n positionBottomRight: {\n alignItems: \"flex-end\",\n justifyContent: \"flex-end\",\n paddingBottom: marginBottom,\n paddingRight: marginRight,\n },\n positionCenter: { alignItems: \"center\", justifyContent: \"center\" },\n positionTopLeft: {\n alignItems: \"flex-start\",\n justifyContent: \"flex-start\",\n paddingLeft: marginLeft,\n paddingTop: marginTop,\n },\n positionTopRight: {\n alignItems: \"flex-end\",\n justifyContent: \"flex-start\",\n paddingRight: marginRight,\n paddingTop: marginTop,\n },\n text: {\n fontFamily: t.typography.heading.fontFamily,\n fontWeight: fontWeights.bold,\n letterSpacing: 4,\n textTransform: \"uppercase\",\n },\n });\n}\n\nexport function PdfWatermark({\n text,\n opacity = 0.15,\n fontSize = 60,\n color = \"mutedForeground\",\n angle = -45,\n position = \"center\",\n fixed = true,\n style,\n}: PdfWatermarkProps) {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createWatermarkStyles(theme), [theme]);\n const positionMap: Record<WatermarkPosition, Style> = {\n \"bottom-left\": styles.positionBottomLeft,\n \"bottom-right\": styles.positionBottomRight,\n center: styles.positionCenter,\n \"top-left\": styles.positionTopLeft,\n \"top-right\": styles.positionTopRight,\n };\n const containerStyles: Style[] = [styles.container, positionMap[position]];\n if (style) {containerStyles.push(...[style].flat());}\n const textStyles: Style[] = [\n styles.text,\n {\n color: resolveColor(color, theme.colors),\n fontSize,\n opacity,\n transform: `rotate(${angle}deg)`,\n },\n ];\n return (\n <View style={containerStyles}>\n <PDFText style={textStyles}>{text}</PDFText>\n </View>\n );\n}\n",- "type": "registry:component"+ "content": "import type { PDFComponentProps, PdfcnTheme } from \"@/registry/themes\";\n\nimport { usePdfcnTheme, useSafeMemo } from \"../../lib/pdfcn-theme-context\";\nimport { resolveColor } from \"../../lib/resolve-color\";\nimport { View, Text as PDFText, StyleSheet } from \"../../lib/takumi-primitives\";\nimport type { Style } from \"../../lib/takumi-primitives\";\n\nexport type WatermarkPosition =\n | \"center\"\n | \"top-left\"\n | \"top-right\"\n | \"bottom-left\"\n | \"bottom-right\";\n\n/**\n * Diagonal watermark overlaid across the full page using absolute positioning.\n * Props - `text` | `opacity` | `fontSize` | `color` | `angle` | `position` | `fixed` | `style`\n * @see {@link PdfWatermarkProps}\n */\nexport interface PdfWatermarkProps extends Omit<PDFComponentProps, \"children\"> {\n text: string;\n opacity?: number;\n fontSize?: number;\n color?: string;\n angle?: number;\n position?: WatermarkPosition;\n /**\n * @default true\n */\n fixed?: boolean;\n children?: never;\n}\n\nconst createWatermarkStyles = (t: PdfcnTheme) => {\n const { fontWeights } = t.primitives;\n // Use page margins as corner insets so watermark position adapts to the active theme.\n const { marginTop, marginBottom, marginLeft, marginRight } = t.spacing.page;\n return StyleSheet.create({\n container: {\n alignItems: \"center\",\n bottom: 0,\n justifyContent: \"center\",\n left: 0,\n pointerEvents: \"none\",\n position: \"absolute\",\n right: 0,\n top: 0,\n zIndex: -1,\n },\n positionBottomLeft: {\n alignItems: \"flex-start\",\n justifyContent: \"flex-end\",\n paddingBottom: marginBottom,\n paddingLeft: marginLeft,\n },\n positionBottomRight: {\n alignItems: \"flex-end\",\n justifyContent: \"flex-end\",\n paddingBottom: marginBottom,\n paddingRight: marginRight,\n },\n positionCenter: { alignItems: \"center\", justifyContent: \"center\" },\n positionTopLeft: {\n alignItems: \"flex-start\",\n justifyContent: \"flex-start\",\n paddingLeft: marginLeft,\n paddingTop: marginTop,\n },\n positionTopRight: {\n alignItems: \"flex-end\",\n justifyContent: \"flex-start\",\n paddingRight: marginRight,\n paddingTop: marginTop,\n },\n text: {\n fontFamily: t.typography.heading.fontFamily,\n fontWeight: fontWeights.bold,\n letterSpacing: 4,\n textTransform: \"uppercase\",\n },\n });\n};\n\nexport const PdfWatermark = ({\n text,\n opacity = 0.15,\n fontSize = 60,\n color = \"mutedForeground\",\n angle = -45,\n position = \"center\",\n style,\n}: PdfWatermarkProps) => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createWatermarkStyles(theme), [theme]);\n const positionMap: Record<WatermarkPosition, Style> = {\n \"bottom-left\": styles.positionBottomLeft,\n \"bottom-right\": styles.positionBottomRight,\n center: styles.positionCenter,\n \"top-left\": styles.positionTopLeft,\n \"top-right\": styles.positionTopRight,\n };\n const containerStyles: Style[] = [styles.container, positionMap[position]];\n if (style) {\n containerStyles.push(...[style].flat());\n }\n const textStyles: Style[] = [\n styles.text,\n {\n color: resolveColor(color, theme.colors),\n fontSize,\n opacity,\n transform: `rotate(${angle}deg)`,\n },\n ];\n return (\n <View style={containerStyles}>\n <PDFText style={textStyles}>{text}</PDFText>\n </View>\n );\n};\n",+ "type": "registry:component",+ "target": "components/pdf/components/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"+ "type": "registry:component",+ "target": "components/pdf/components/watermark/index.ts"}],"type": "registry:ui"diff --git a/registry.json b/registry.jsonindex 03d2aba..7da8cc0 100644--- a/registry.json+++ b/registry.json@@ -1,1931 +1,2511 @@{"$schema": "https://ui.shadcn.com/schema/registry.json",- "name": "pdfcn","homepage": "https://pdfcn.vercel.app","items": [{- "name": "takumi/utils",- "type": "registry:lib",- "title": "Takumi Utils",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Theme context and helpers for the takumi base","files": [{"path": "registry/bases/takumi/lib/pdfcn-theme.ts",- "type": "registry:lib"+ "type": "registry:lib",+ "target": "components/pdf/lib/pdfcn-theme.ts"},{"path": "registry/bases/takumi/lib/pdfcn-theme-context.tsx",- "type": "registry:lib"+ "type": "registry:lib",+ "target": "components/pdf/lib/pdfcn-theme-context.tsx"},{"path": "registry/bases/takumi/lib/resolve-color.ts",- "type": "registry:lib"+ "type": "registry:lib",+ "target": "components/pdf/lib/resolve-color.ts"},{"path": "registry/bases/takumi/lib/takumi-primitives.tsx",- "type": "registry:lib"+ "type": "registry:lib",+ "target": "components/pdf/lib/takumi-primitives.tsx"},{"path": "registry/bases/takumi/lib/takumi-svg.tsx",- "type": "registry:lib"+ "type": "registry:lib",+ "target": "components/pdf/lib/takumi-svg.tsx"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]+ "name": "takumi/utils",+ "title": "Takumi Utils",+ "type": "registry:lib"},{- "name": "takumi/alert",- "type": "registry:ui",- "title": "Alert",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Alert PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/alert/alert.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/alert/alert.tsx"},{"path": "registry/bases/takumi/components/alert/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/alert/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/alert",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Alert",+ "type": "registry:ui"},{- "name": "takumi/badge",- "type": "registry:ui",- "title": "Badge",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Badge PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/badge/badge.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/badge/badge.tsx"},{"path": "registry/bases/takumi/components/badge/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/badge/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/badge",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Badge",+ "type": "registry:ui"},{- "name": "takumi/card",- "type": "registry:ui",- "title": "Card",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Card PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/card/card.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/card/card.tsx"},{"path": "registry/bases/takumi/components/card/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/card/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/card",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Card",+ "type": "registry:ui"},{- "name": "takumi/data-table",- "type": "registry:ui",- "title": "Data Table",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Data Table PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/data-table/data-table.styles.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/data-table/data-table.styles.ts"},{"path": "registry/bases/takumi/components/data-table/data-table.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/data-table/data-table.tsx"},{"path": "registry/bases/takumi/components/data-table/data-table.types.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/data-table/data-table.types.ts"},{"path": "registry/bases/takumi/components/data-table/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/data-table/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils", "takumi/table"]+ "name": "takumi/data-table",+ "registryDependencies": [+ "takumi/utils",+ "takumi/table"+ ],+ "title": "Data Table",+ "type": "registry:ui"},{- "name": "takumi/divider",- "type": "registry:ui",- "title": "Divider",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Divider PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/divider/divider.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/divider/divider.tsx"},{"path": "registry/bases/takumi/components/divider/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/divider/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/divider",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Divider",+ "type": "registry:ui"},{- "name": "takumi/form",- "type": "registry:ui",- "title": "Form",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Form PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/form/form.styles.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/form/form.styles.ts"},{"path": "registry/bases/takumi/components/form/form.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/form/form.tsx"},{"path": "registry/bases/takumi/components/form/form.types.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/form/form.types.ts"},{"path": "registry/bases/takumi/components/form/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/form/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/form",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Form",+ "type": "registry:ui"},{- "name": "takumi/graph",- "type": "registry:ui",- "title": "Graph",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Graph PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/graph/graph.styles.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/graph/graph.styles.ts"},{"path": "registry/bases/takumi/components/graph/graph.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/graph/graph.tsx"},{"path": "registry/bases/takumi/components/graph/graph.types.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/graph/graph.types.ts"},{"path": "registry/bases/takumi/components/graph/graph.utils.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/graph/graph.utils.ts"},{"path": "registry/bases/takumi/components/graph/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/graph/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/graph",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Graph",+ "type": "registry:ui"},{- "name": "takumi/heading",- "type": "registry:ui",- "title": "Heading",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Heading PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/heading/heading.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/heading/heading.tsx"},{"path": "registry/bases/takumi/components/heading/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/heading/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/heading",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Heading",+ "type": "registry:ui"},{- "name": "takumi/keep-together",- "type": "registry:ui",- "title": "Keep Together",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/keep-together/keep-together.tsx"},{"path": "registry/bases/takumi/components/keep-together/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/keep-together/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/keep-together",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Keep Together",+ "type": "registry:ui"},{- "name": "takumi/key-value",- "type": "registry:ui",- "title": "Key Value",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/key-value/key-value.tsx"},{"path": "registry/bases/takumi/components/key-value/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/key-value/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/key-value",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Key Value",+ "type": "registry:ui"},{- "name": "takumi/link",- "type": "registry:ui",- "title": "Link",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Link PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/link/link.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/link/link.tsx"},{"path": "registry/bases/takumi/components/link/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/link/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/link",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Link",+ "type": "registry:ui"},{- "name": "takumi/list",- "type": "registry:ui",- "title": "List",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "List PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/list/list.styles.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/list/list.styles.ts"},{"path": "registry/bases/takumi/components/list/list.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/list/list.tsx"},{"path": "registry/bases/takumi/components/list/list.types.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/list/list.types.ts"},{"path": "registry/bases/takumi/components/list/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/list/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/list",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "List",+ "type": "registry:ui"},{- "name": "takumi/page-break",- "type": "registry:ui",- "title": "Page Break",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/page-break/page-break.tsx"},{"path": "registry/bases/takumi/components/page-break/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/page-break/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/page-break",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Page Break",+ "type": "registry:ui"},{- "name": "takumi/page-footer",- "type": "registry:ui",- "title": "Page Footer",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/page-footer/page-footer.tsx"},{"path": "registry/bases/takumi/components/page-footer/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/page-footer/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/page-footer",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Page Footer",+ "type": "registry:ui"},{- "name": "takumi/page-header",- "type": "registry:ui",- "title": "Page Header",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/page-header/page-header.tsx"},{"path": "registry/bases/takumi/components/page-header/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/page-header/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/page-header",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Page Header",+ "type": "registry:ui"},{- "name": "takumi/page-number",- "type": "registry:ui",- "title": "Page Number",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/page-number/page-number.tsx"},{"path": "registry/bases/takumi/components/page-number/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/page-number/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/page-number",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Page Number",+ "type": "registry:ui"},{- "name": "takumi/pdf-image",- "type": "registry:ui",- "title": "Pdf Image",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/pdf-image/pdf-image.tsx"},{"path": "registry/bases/takumi/components/pdf-image/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/pdf-image/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/pdf-image",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Pdf Image",+ "type": "registry:ui"},{- "name": "takumi/qrcode",- "type": "registry:ui",- "title": "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"+ "type": "registry:component",+ "target": "components/pdf/components/qrcode/qrcode.tsx"},{"path": "registry/bases/takumi/components/qrcode/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/qrcode/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers", "qrcode"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/qrcode",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Qrcode",+ "type": "registry:ui"},{- "name": "takumi/section",- "type": "registry:ui",- "title": "Section",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Section PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/section/section.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/section/section.tsx"},{"path": "registry/bases/takumi/components/section/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/section/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/section",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Section",+ "type": "registry:ui"},{- "name": "takumi/signature",- "type": "registry:ui",- "title": "Signature",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Signature PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/signature/signature.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/signature/signature.tsx"},{"path": "registry/bases/takumi/components/signature/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/signature/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/signature",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Signature",+ "type": "registry:ui"},{- "name": "takumi/stack",- "type": "registry:ui",- "title": "Stack",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Stack PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/stack/stack.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/stack/stack.tsx"},{"path": "registry/bases/takumi/components/stack/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/stack/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/stack",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Stack",+ "type": "registry:ui"},{- "name": "takumi/table",- "type": "registry:ui",- "title": "Table",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Table PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/table/table.styles.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/table/table.styles.ts"},{"path": "registry/bases/takumi/components/table/table.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/table/table.tsx"},{"path": "registry/bases/takumi/components/table/table.types.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/table/table.types.ts"},{"path": "registry/bases/takumi/components/table/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/table/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/table",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Table",+ "type": "registry:ui"},{- "name": "takumi/text",- "type": "registry:ui",- "title": "Text",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Text PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/text/text.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/text/text.tsx"},{"path": "registry/bases/takumi/components/text/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/text/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/text",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Text",+ "type": "registry:ui"},{- "name": "takumi/watermark",- "type": "registry:ui",- "title": "Watermark",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Watermark PDF component (takumi)","files": [{"path": "registry/bases/takumi/components/watermark/watermark.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/watermark/watermark.tsx"},{"path": "registry/bases/takumi/components/watermark/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/watermark/index.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/watermark",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Watermark",+ "type": "registry:ui"},{- "name": "takumi/invoice-classic",- "type": "registry:block",- "title": "Invoice Classic",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Invoice Classic PDF block (takumi)","files": [{"path": "registry/bases/takumi/blocks/invoice-classic/invoice-classic.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-classic/invoice-classic.tsx"},{"path": "registry/bases/takumi/blocks/invoice-classic/invoice-classic.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-classic/invoice-classic.types.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/invoice-classic",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Invoice Classic",+ "type": "registry:block"},{- "name": "takumi/invoice-consultant",- "type": "registry:block",- "title": "Invoice Consultant",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Invoice Consultant PDF block (takumi)","files": [{"path": "registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-consultant/invoice-consultant.tsx"},{"path": "registry/bases/takumi/blocks/invoice-consultant/invoice-consultant.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-consultant/invoice-consultant.types.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/invoice-consultant",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Invoice Consultant",+ "type": "registry:block"},{- "name": "takumi/invoice-corporate",- "type": "registry:block",- "title": "Invoice Corporate",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Invoice Corporate PDF block (takumi)","files": [{"path": "registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-corporate/invoice-corporate.tsx"},{"path": "registry/bases/takumi/blocks/invoice-corporate/invoice-corporate.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-corporate/invoice-corporate.types.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/invoice-corporate",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Invoice Corporate",+ "type": "registry:block"},{- "name": "takumi/invoice-creative",- "type": "registry:block",- "title": "Invoice Creative",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Invoice Creative PDF block (takumi)","files": [{"path": "registry/bases/takumi/blocks/invoice-creative/invoice-creative.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-creative/invoice-creative.tsx"},{"path": "registry/bases/takumi/blocks/invoice-creative/invoice-creative.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-creative/invoice-creative.types.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/invoice-creative",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Invoice Creative",+ "type": "registry:block"},{- "name": "takumi/invoice-minimal",- "type": "registry:block",- "title": "Invoice Minimal",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Invoice Minimal PDF block (takumi)","files": [{"path": "registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-minimal/invoice-minimal.tsx"},{"path": "registry/bases/takumi/blocks/invoice-minimal/invoice-minimal.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-minimal/invoice-minimal.types.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/invoice-minimal",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Invoice Minimal",+ "type": "registry:block"},{- "name": "takumi/invoice-modern",- "type": "registry:block",- "title": "Invoice Modern",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Invoice Modern PDF block (takumi)","files": [{"path": "registry/bases/takumi/blocks/invoice-modern/invoice-modern.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-modern/invoice-modern.tsx"},{"path": "registry/bases/takumi/blocks/invoice-modern/invoice-modern.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-modern/invoice-modern.types.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/invoice-modern",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Invoice Modern",+ "type": "registry:block"},{- "name": "takumi/report-financial",- "type": "registry:block",- "title": "Report Financial",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Report Financial PDF block (takumi)","files": [{"path": "registry/bases/takumi/blocks/report-financial/report-financial.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-financial/report-financial.tsx"},{"path": "registry/bases/takumi/blocks/report-financial/report-layout.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-financial/report-layout.tsx"},{"path": "registry/bases/takumi/blocks/report-financial/report.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-financial/report.types.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/report-financial",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Report Financial",+ "type": "registry:block"},{- "name": "takumi/report-marketing",- "type": "registry:block",- "title": "Report Marketing",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Report Marketing PDF block (takumi)","files": [{"path": "registry/bases/takumi/blocks/report-marketing/report-layout.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-marketing/report-layout.tsx"},{"path": "registry/bases/takumi/blocks/report-marketing/report-marketing.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-marketing/report-marketing.tsx"},{"path": "registry/bases/takumi/blocks/report-marketing/report.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-marketing/report.types.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/report-marketing",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Report Marketing",+ "type": "registry:block"},{- "name": "takumi/report-operations",- "type": "registry:block",- "title": "Report Operations",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Report Operations PDF block (takumi)","files": [{"path": "registry/bases/takumi/blocks/report-operations/report-layout.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-operations/report-layout.tsx"},{"path": "registry/bases/takumi/blocks/report-operations/report-operations.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-operations/report-operations.tsx"},{"path": "registry/bases/takumi/blocks/report-operations/report.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-operations/report.types.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/report-operations",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Report Operations",+ "type": "registry:block"},{- "name": "takumi/report-security",- "type": "registry:block",- "title": "Report Security",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "Report Security PDF block (takumi)","files": [{"path": "registry/bases/takumi/blocks/report-security/report-layout.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-security/report-layout.tsx"},{"path": "registry/bases/takumi/blocks/report-security/report-security.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-security/report-security.tsx"},{"path": "registry/bases/takumi/blocks/report-security/report.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-security/report.types.ts"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],- "registryDependencies": ["takumi/utils"]+ "name": "takumi/report-security",+ "registryDependencies": [+ "takumi/utils"+ ],+ "title": "Report Security",+ "type": "registry:block"},{- "name": "takumi/theme-professional",- "type": "registry:theme",- "title": "Professional Theme (takumi)",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "professional theme tokens for takumi","files": [{"path": "registry/themes/professional.ts",- "type": "registry:theme",- "target": "components/pdf/theme-professional.ts"+ "target": "components/pdf/theme-professional.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/takumi/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]+ "name": "takumi/theme-professional",+ "title": "Professional Theme (takumi)",+ "type": "registry:theme"},{- "name": "takumi/theme-modern",- "type": "registry:theme",- "title": "Modern Theme (takumi)",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "modern theme tokens for takumi","files": [{"path": "registry/themes/modern.ts",- "type": "registry:theme",- "target": "components/pdf/theme-modern.ts"+ "target": "components/pdf/theme-modern.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/takumi/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]+ "name": "takumi/theme-modern",+ "title": "Modern Theme (takumi)",+ "type": "registry:theme"},{- "name": "takumi/theme-minimal",- "type": "registry:theme",- "title": "Minimal Theme (takumi)",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "minimal theme tokens for takumi","files": [{"path": "registry/themes/minimal.ts",- "type": "registry:theme",- "target": "components/pdf/theme-minimal.ts"+ "target": "components/pdf/theme-minimal.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/takumi/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]+ "name": "takumi/theme-minimal",+ "title": "Minimal Theme (takumi)",+ "type": "registry:theme"},{- "name": "takumi/theme-executive",- "type": "registry:theme",- "title": "Executive Theme (takumi)",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "executive theme tokens for takumi","files": [{"path": "registry/themes/executive.ts",- "type": "registry:theme",- "target": "components/pdf/theme-executive.ts"+ "target": "components/pdf/theme-executive.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/takumi/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]+ "name": "takumi/theme-executive",+ "title": "Executive Theme (takumi)",+ "type": "registry:theme"},{- "name": "takumi/theme-corporate",- "type": "registry:theme",- "title": "Corporate Theme (takumi)",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "corporate theme tokens for takumi","files": [{"path": "registry/themes/corporate.ts",- "type": "registry:theme",- "target": "components/pdf/theme-corporate.ts"+ "target": "components/pdf/theme-corporate.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/takumi/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]+ "name": "takumi/theme-corporate",+ "title": "Corporate Theme (takumi)",+ "type": "registry:theme"},{- "name": "takumi/theme-elegant",- "type": "registry:theme",- "title": "Elegant Theme (takumi)",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "elegant theme tokens for takumi","files": [{"path": "registry/themes/elegant.ts",- "type": "registry:theme",- "target": "components/pdf/theme-elegant.ts"+ "target": "components/pdf/theme-elegant.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/takumi/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]+ "name": "takumi/theme-elegant",+ "title": "Elegant Theme (takumi)",+ "type": "registry:theme"},{- "name": "takumi/theme-vivid",- "type": "registry:theme",- "title": "Vivid Theme (takumi)",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "vivid theme tokens for takumi","files": [{"path": "registry/themes/vivid.ts",- "type": "registry:theme",- "target": "components/pdf/theme-vivid.ts"+ "target": "components/pdf/theme-vivid.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/takumi/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]+ "name": "takumi/theme-vivid",+ "title": "Vivid Theme (takumi)",+ "type": "registry:theme"},{- "name": "takumi/theme-forest",- "type": "registry:theme",- "title": "Forest Theme (takumi)",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "forest theme tokens for takumi","files": [{"path": "registry/themes/forest.ts",- "type": "registry:theme",- "target": "components/pdf/theme-forest.ts"+ "target": "components/pdf/theme-forest.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/takumi/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]+ "name": "takumi/theme-forest",+ "title": "Forest Theme (takumi)",+ "type": "registry:theme"},{- "name": "takumi/theme-blueprint",- "type": "registry:theme",- "title": "Blueprint Theme (takumi)",+ "dependencies": [+ "takumi-pdf",+ "@takumi-rs/helpers"+ ],"description": "blueprint theme tokens for takumi","files": [{"path": "registry/themes/blueprint.ts",- "type": "registry:theme",- "target": "components/pdf/theme-blueprint.ts"+ "target": "components/pdf/theme-blueprint.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/takumi/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["takumi-pdf", "@takumi-rs/helpers"]+ "name": "takumi/theme-blueprint",+ "title": "Blueprint Theme (takumi)",+ "type": "registry:theme"},{- "name": "forme/utils",- "type": "registry:lib",- "title": "Forme Utils",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Theme context and helpers for the forme base","files": [{"path": "registry/bases/forme/lib/pdfcn-theme.ts",- "type": "registry:lib"+ "type": "registry:lib",+ "target": "components/pdf/lib/pdfcn-theme.ts"},{"path": "registry/bases/forme/lib/pdfcn-theme-context.tsx",- "type": "registry:lib"+ "type": "registry:lib",+ "target": "components/pdf/lib/pdfcn-theme-context.tsx"},{"path": "registry/bases/forme/lib/resolve-color.ts",- "type": "registry:lib"+ "type": "registry:lib",+ "target": "components/pdf/lib/resolve-color.ts"},{"path": "registry/bases/forme/lib/forme-svg.tsx",- "type": "registry:lib"+ "type": "registry:lib",+ "target": "components/pdf/lib/forme-svg.tsx"},{"path": "registry/bases/forme/lib/maybe-fixed.tsx",- "type": "registry:lib"+ "type": "registry:lib",+ "target": "components/pdf/lib/maybe-fixed.tsx"}],- "dependencies": ["@formepdf/react", "@formepdf/core"]+ "name": "forme/utils",+ "title": "Forme Utils",+ "type": "registry:lib"},{- "name": "forme/alert",- "type": "registry:ui",- "title": "Alert",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Alert PDF component (forme)","files": [{"path": "registry/bases/forme/components/alert/alert.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/alert/alert.tsx"},{"path": "registry/bases/forme/components/alert/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/alert/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/alert",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Alert",+ "type": "registry:ui"},{- "name": "forme/badge",- "type": "registry:ui",- "title": "Badge",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Badge PDF component (forme)","files": [{"path": "registry/bases/forme/components/badge/badge.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/badge/badge.tsx"},{"path": "registry/bases/forme/components/badge/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/badge/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/badge",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Badge",+ "type": "registry:ui"},{- "name": "forme/card",- "type": "registry:ui",- "title": "Card",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Card PDF component (forme)","files": [{"path": "registry/bases/forme/components/card/card.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/card/card.tsx"},{"path": "registry/bases/forme/components/card/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/card/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/card",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Card",+ "type": "registry:ui"},{- "name": "forme/data-table",- "type": "registry:ui",- "title": "Data Table",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Data Table PDF component (forme)","files": [{"path": "registry/bases/forme/components/data-table/data-table.styles.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/data-table/data-table.styles.ts"},{"path": "registry/bases/forme/components/data-table/data-table.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/data-table/data-table.tsx"},{"path": "registry/bases/forme/components/data-table/data-table.types.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/data-table/data-table.types.ts"},{"path": "registry/bases/forme/components/data-table/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/data-table/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils", "forme/table"]+ "name": "forme/data-table",+ "registryDependencies": [+ "forme/utils",+ "forme/table"+ ],+ "title": "Data Table",+ "type": "registry:ui"},{- "name": "forme/divider",- "type": "registry:ui",- "title": "Divider",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Divider PDF component (forme)","files": [{"path": "registry/bases/forme/components/divider/divider.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/divider/divider.tsx"},{"path": "registry/bases/forme/components/divider/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/divider/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/divider",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Divider",+ "type": "registry:ui"},{- "name": "forme/form",- "type": "registry:ui",- "title": "Form",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Form PDF component (forme)","files": [{"path": "registry/bases/forme/components/form/form.styles.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/form/form.styles.ts"},{"path": "registry/bases/forme/components/form/form.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/form/form.tsx"},{"path": "registry/bases/forme/components/form/form.types.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/form/form.types.ts"},{"path": "registry/bases/forme/components/form/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/form/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/form",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Form",+ "type": "registry:ui"},{- "name": "forme/graph",- "type": "registry:ui",- "title": "Graph",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Graph PDF component (forme)","files": [{"path": "registry/bases/forme/components/graph/graph.styles.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/graph/graph.styles.ts"},{"path": "registry/bases/forme/components/graph/graph.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/graph/graph.tsx"},{"path": "registry/bases/forme/components/graph/graph.types.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/graph/graph.types.ts"},{"path": "registry/bases/forme/components/graph/graph.utils.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/graph/graph.utils.ts"},{"path": "registry/bases/forme/components/graph/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/graph/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/graph",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Graph",+ "type": "registry:ui"},{- "name": "forme/heading",- "type": "registry:ui",- "title": "Heading",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Heading PDF component (forme)","files": [{"path": "registry/bases/forme/components/heading/heading.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/heading/heading.tsx"},{"path": "registry/bases/forme/components/heading/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/heading/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/heading",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Heading",+ "type": "registry:ui"},{- "name": "forme/keep-together",- "type": "registry:ui",- "title": "Keep Together",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/keep-together/keep-together.tsx"},{"path": "registry/bases/forme/components/keep-together/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/keep-together/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/keep-together",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Keep Together",+ "type": "registry:ui"},{- "name": "forme/key-value",- "type": "registry:ui",- "title": "Key Value",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/key-value/key-value.tsx"},{"path": "registry/bases/forme/components/key-value/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/key-value/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/key-value",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Key Value",+ "type": "registry:ui"},{- "name": "forme/link",- "type": "registry:ui",- "title": "Link",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Link PDF component (forme)","files": [{"path": "registry/bases/forme/components/link/link.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/link/link.tsx"},{"path": "registry/bases/forme/components/link/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/link/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/link",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Link",+ "type": "registry:ui"},{- "name": "forme/list",- "type": "registry:ui",- "title": "List",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "List PDF component (forme)","files": [{"path": "registry/bases/forme/components/list/list.styles.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/list/list.styles.ts"},{"path": "registry/bases/forme/components/list/list.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/list/list.tsx"},{"path": "registry/bases/forme/components/list/list.types.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/list/list.types.ts"},{"path": "registry/bases/forme/components/list/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/list/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/list",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "List",+ "type": "registry:ui"},{- "name": "forme/page-break",- "type": "registry:ui",- "title": "Page Break",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/page-break/page-break.tsx"},{"path": "registry/bases/forme/components/page-break/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/page-break/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/page-break",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Page Break",+ "type": "registry:ui"},{- "name": "forme/page-footer",- "type": "registry:ui",- "title": "Page Footer",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/page-footer/page-footer.tsx"},{"path": "registry/bases/forme/components/page-footer/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/page-footer/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/page-footer",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Page Footer",+ "type": "registry:ui"},{- "name": "forme/page-header",- "type": "registry:ui",- "title": "Page Header",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/page-header/page-header.tsx"},{"path": "registry/bases/forme/components/page-header/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/page-header/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/page-header",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Page Header",+ "type": "registry:ui"},{- "name": "forme/page-number",- "type": "registry:ui",- "title": "Page Number",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/page-number/page-number.tsx"},{"path": "registry/bases/forme/components/page-number/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/page-number/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/page-number",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Page Number",+ "type": "registry:ui"},{- "name": "forme/pdf-image",- "type": "registry:ui",- "title": "Pdf Image",+ "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"+ "type": "registry:component",+ "target": "components/pdf/components/pdf-image/pdf-image.tsx"},{"path": "registry/bases/forme/components/pdf-image/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/pdf-image/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/pdf-image",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Pdf Image",+ "type": "registry:ui"},{- "name": "forme/qrcode",- "type": "registry:ui",- "title": "Qrcode",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core",+ "qrcode"+ ],"description": "Qrcode PDF component (forme)","files": [{"path": "registry/bases/forme/components/qrcode/qrcode.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/qrcode/qrcode.tsx"},{"path": "registry/bases/forme/components/qrcode/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/qrcode/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core", "qrcode"],- "registryDependencies": ["forme/utils"]+ "name": "forme/qrcode",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Qrcode",+ "type": "registry:ui"},{- "name": "forme/section",- "type": "registry:ui",- "title": "Section",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Section PDF component (forme)","files": [{"path": "registry/bases/forme/components/section/section.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/section/section.tsx"},{"path": "registry/bases/forme/components/section/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/section/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/section",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Section",+ "type": "registry:ui"},{- "name": "forme/signature",- "type": "registry:ui",- "title": "Signature",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Signature PDF component (forme)","files": [{"path": "registry/bases/forme/components/signature/signature.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/signature/signature.tsx"},{"path": "registry/bases/forme/components/signature/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/signature/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/signature",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Signature",+ "type": "registry:ui"},{- "name": "forme/stack",- "type": "registry:ui",- "title": "Stack",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Stack PDF component (forme)","files": [{"path": "registry/bases/forme/components/stack/stack.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/stack/stack.tsx"},{"path": "registry/bases/forme/components/stack/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/stack/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/stack",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Stack",+ "type": "registry:ui"},{- "name": "forme/table",- "type": "registry:ui",- "title": "Table",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Table PDF component (forme)","files": [{"path": "registry/bases/forme/components/table/table.styles.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/table/table.styles.ts"},{"path": "registry/bases/forme/components/table/table.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/table/table.tsx"},{"path": "registry/bases/forme/components/table/table.types.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/table/table.types.ts"},{"path": "registry/bases/forme/components/table/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/table/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/table",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Table",+ "type": "registry:ui"},{- "name": "forme/text",- "type": "registry:ui",- "title": "Text",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Text PDF component (forme)","files": [{"path": "registry/bases/forme/components/text/text.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/text/text.tsx"},{"path": "registry/bases/forme/components/text/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/text/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/text",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Text",+ "type": "registry:ui"},{- "name": "forme/watermark",- "type": "registry:ui",- "title": "Watermark",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Watermark PDF component (forme)","files": [{"path": "registry/bases/forme/components/watermark/watermark.tsx",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/watermark/watermark.tsx"},{"path": "registry/bases/forme/components/watermark/index.ts",- "type": "registry:component"+ "type": "registry:component",+ "target": "components/pdf/components/watermark/index.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/watermark",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Watermark",+ "type": "registry:ui"},{- "name": "forme/invoice-classic",- "type": "registry:block",- "title": "Invoice Classic",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Invoice Classic PDF block (forme)","files": [{"path": "registry/bases/forme/blocks/invoice-classic/invoice-classic.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-classic/invoice-classic.tsx"},{"path": "registry/bases/forme/blocks/invoice-classic/invoice-classic.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-classic/invoice-classic.types.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/invoice-classic",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Invoice Classic",+ "type": "registry:block"},{- "name": "forme/invoice-consultant",- "type": "registry:block",- "title": "Invoice Consultant",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Invoice Consultant PDF block (forme)","files": [{"path": "registry/bases/forme/blocks/invoice-consultant/invoice-consultant.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-consultant/invoice-consultant.tsx"},{"path": "registry/bases/forme/blocks/invoice-consultant/invoice-consultant.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-consultant/invoice-consultant.types.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/invoice-consultant",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Invoice Consultant",+ "type": "registry:block"},{- "name": "forme/invoice-corporate",- "type": "registry:block",- "title": "Invoice Corporate",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Invoice Corporate PDF block (forme)","files": [{"path": "registry/bases/forme/blocks/invoice-corporate/invoice-corporate.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-corporate/invoice-corporate.tsx"},{"path": "registry/bases/forme/blocks/invoice-corporate/invoice-corporate.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-corporate/invoice-corporate.types.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/invoice-corporate",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Invoice Corporate",+ "type": "registry:block"},{- "name": "forme/invoice-creative",- "type": "registry:block",- "title": "Invoice Creative",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Invoice Creative PDF block (forme)","files": [{"path": "registry/bases/forme/blocks/invoice-creative/invoice-creative.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-creative/invoice-creative.tsx"},{"path": "registry/bases/forme/blocks/invoice-creative/invoice-creative.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-creative/invoice-creative.types.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/invoice-creative",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Invoice Creative",+ "type": "registry:block"},{- "name": "forme/invoice-minimal",- "type": "registry:block",- "title": "Invoice Minimal",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Invoice Minimal PDF block (forme)","files": [{"path": "registry/bases/forme/blocks/invoice-minimal/invoice-minimal.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-minimal/invoice-minimal.tsx"},{"path": "registry/bases/forme/blocks/invoice-minimal/invoice-minimal.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-minimal/invoice-minimal.types.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/invoice-minimal",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Invoice Minimal",+ "type": "registry:block"},{- "name": "forme/invoice-modern",- "type": "registry:block",- "title": "Invoice Modern",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Invoice Modern PDF block (forme)","files": [{"path": "registry/bases/forme/blocks/invoice-modern/invoice-modern.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-modern/invoice-modern.tsx"},{"path": "registry/bases/forme/blocks/invoice-modern/invoice-modern.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/invoice-modern/invoice-modern.types.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/invoice-modern",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Invoice Modern",+ "type": "registry:block"},{- "name": "forme/report-financial",- "type": "registry:block",- "title": "Report Financial",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Report Financial PDF block (forme)","files": [{"path": "registry/bases/forme/blocks/report-financial/report-financial.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-financial/report-financial.tsx"},{"path": "registry/bases/forme/blocks/report-financial/report-layout.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-financial/report-layout.tsx"},{"path": "registry/bases/forme/blocks/report-financial/report.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-financial/report.types.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/report-financial",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Report Financial",+ "type": "registry:block"},{- "name": "forme/report-marketing",- "type": "registry:block",- "title": "Report Marketing",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Report Marketing PDF block (forme)","files": [{"path": "registry/bases/forme/blocks/report-marketing/report-layout.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-marketing/report-layout.tsx"},{"path": "registry/bases/forme/blocks/report-marketing/report-marketing.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-marketing/report-marketing.tsx"},{"path": "registry/bases/forme/blocks/report-marketing/report.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-marketing/report.types.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/report-marketing",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Report Marketing",+ "type": "registry:block"},{- "name": "forme/report-operations",- "type": "registry:block",- "title": "Report Operations",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Report Operations PDF block (forme)","files": [{"path": "registry/bases/forme/blocks/report-operations/report-layout.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-operations/report-layout.tsx"},{"path": "registry/bases/forme/blocks/report-operations/report-operations.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-operations/report-operations.tsx"},{"path": "registry/bases/forme/blocks/report-operations/report.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-operations/report.types.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/report-operations",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Report Operations",+ "type": "registry:block"},{- "name": "forme/report-security",- "type": "registry:block",- "title": "Report Security",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "Report Security PDF block (forme)","files": [{"path": "registry/bases/forme/blocks/report-security/report-layout.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-security/report-layout.tsx"},{"path": "registry/bases/forme/blocks/report-security/report-security.tsx",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-security/report-security.tsx"},{"path": "registry/bases/forme/blocks/report-security/report.types.ts",- "type": "registry:block"+ "type": "registry:block",+ "target": "components/pdf/blocks/report-security/report.types.ts"}],- "dependencies": ["@formepdf/react", "@formepdf/core"],- "registryDependencies": ["forme/utils"]+ "name": "forme/report-security",+ "registryDependencies": [+ "forme/utils"+ ],+ "title": "Report Security",+ "type": "registry:block"},{- "name": "forme/theme-professional",- "type": "registry:theme",- "title": "Professional Theme (forme)",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "professional theme tokens for forme","files": [{"path": "registry/themes/professional.ts",- "type": "registry:theme",- "target": "components/pdf/theme-professional.ts"+ "target": "components/pdf/theme-professional.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/forme/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["@formepdf/react", "@formepdf/core"]+ "name": "forme/theme-professional",+ "title": "Professional Theme (forme)",+ "type": "registry:theme"},{- "name": "forme/theme-modern",- "type": "registry:theme",- "title": "Modern Theme (forme)",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "modern theme tokens for forme","files": [{"path": "registry/themes/modern.ts",- "type": "registry:theme",- "target": "components/pdf/theme-modern.ts"+ "target": "components/pdf/theme-modern.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/forme/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["@formepdf/react", "@formepdf/core"]+ "name": "forme/theme-modern",+ "title": "Modern Theme (forme)",+ "type": "registry:theme"},{- "name": "forme/theme-minimal",- "type": "registry:theme",- "title": "Minimal Theme (forme)",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "minimal theme tokens for forme","files": [{"path": "registry/themes/minimal.ts",- "type": "registry:theme",- "target": "components/pdf/theme-minimal.ts"+ "target": "components/pdf/theme-minimal.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/forme/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["@formepdf/react", "@formepdf/core"]+ "name": "forme/theme-minimal",+ "title": "Minimal Theme (forme)",+ "type": "registry:theme"},{- "name": "forme/theme-executive",- "type": "registry:theme",- "title": "Executive Theme (forme)",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "executive theme tokens for forme","files": [{"path": "registry/themes/executive.ts",- "type": "registry:theme",- "target": "components/pdf/theme-executive.ts"+ "target": "components/pdf/theme-executive.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/forme/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["@formepdf/react", "@formepdf/core"]+ "name": "forme/theme-executive",+ "title": "Executive Theme (forme)",+ "type": "registry:theme"},{- "name": "forme/theme-corporate",- "type": "registry:theme",- "title": "Corporate Theme (forme)",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "corporate theme tokens for forme","files": [{"path": "registry/themes/corporate.ts",- "type": "registry:theme",- "target": "components/pdf/theme-corporate.ts"+ "target": "components/pdf/theme-corporate.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/forme/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["@formepdf/react", "@formepdf/core"]+ "name": "forme/theme-corporate",+ "title": "Corporate Theme (forme)",+ "type": "registry:theme"},{- "name": "forme/theme-elegant",- "type": "registry:theme",- "title": "Elegant Theme (forme)",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "elegant theme tokens for forme","files": [{"path": "registry/themes/elegant.ts",- "type": "registry:theme",- "target": "components/pdf/theme-elegant.ts"+ "target": "components/pdf/theme-elegant.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/forme/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["@formepdf/react", "@formepdf/core"]+ "name": "forme/theme-elegant",+ "title": "Elegant Theme (forme)",+ "type": "registry:theme"},{- "name": "forme/theme-vivid",- "type": "registry:theme",- "title": "Vivid Theme (forme)",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "vivid theme tokens for forme","files": [{"path": "registry/themes/vivid.ts",- "type": "registry:theme",- "target": "components/pdf/theme-vivid.ts"+ "target": "components/pdf/theme-vivid.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/forme/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["@formepdf/react", "@formepdf/core"]+ "name": "forme/theme-vivid",+ "title": "Vivid Theme (forme)",+ "type": "registry:theme"},{- "name": "forme/theme-forest",- "type": "registry:theme",- "title": "Forest Theme (forme)",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "forest theme tokens for forme","files": [{"path": "registry/themes/forest.ts",- "type": "registry:theme",- "target": "components/pdf/theme-forest.ts"+ "target": "components/pdf/theme-forest.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/forme/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["@formepdf/react", "@formepdf/core"]+ "name": "forme/theme-forest",+ "title": "Forest Theme (forme)",+ "type": "registry:theme"},{- "name": "forme/theme-blueprint",- "type": "registry:theme",- "title": "Blueprint Theme (forme)",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],"description": "blueprint theme tokens for forme","files": [{"path": "registry/themes/blueprint.ts",- "type": "registry:theme",- "target": "components/pdf/theme-blueprint.ts"+ "target": "components/pdf/theme-blueprint.ts",+ "type": "registry:theme"},{"path": "registry/themes/primitives.ts",- "type": "registry:theme",- "target": "components/pdf/primitives.ts"+ "target": "components/pdf/primitives.ts",+ "type": "registry:theme"},{"path": "registry/themes/theme-types.ts",- "type": "registry:theme",- "target": "components/pdf/theme-types.ts"+ "target": "components/pdf/theme-types.ts",+ "type": "registry:theme"},{"path": "registry/bases/forme/lib/pdfcn-theme.ts",- "type": "registry:lib",- "target": "components/pdf/pdfcn-theme.ts"+ "target": "components/pdf/pdfcn-theme.ts",+ "type": "registry:lib"}],- "dependencies": ["@formepdf/react", "@formepdf/core"]+ "name": "forme/theme-blueprint",+ "title": "Blueprint Theme (forme)",+ "type": "registry:theme"}- ]+ ],+ "name": "pdfcn"}diff --git a/registry/bases.ts b/registry/bases.tsindex 9328d66..f75e4a4 100644--- a/registry/bases.ts+++ b/registry/bases.ts@@ -1,3 +1,4 @@+import { FormeIcon, TakumiIcon } from "@/components/icons";import { formeRegistryBase } from "@/registry/bases/forme/registry";import { takumiRegistryBase } from "@/registry/bases/takumi/registry";@@ -7,6 +8,9 @@ export const BASES = [dependencies: ["takumi-pdf", "@takumi-rs/helpers"],description:"Paged selectable-text PDF from JSX/Tailwind via Takumi WASM — preview with react-pdf.",+ meta: {+ logo: TakumiIcon,+ },title: "Takumi PDF",type: "registry:style" as const,},@@ -15,6 +19,9 @@ export const BASES = [dependencies: ["@formepdf/react", "@formepdf/core"],description:"React PDF components rendered with Forme’s WASM layout engine — browser and server.",+ meta: {+ logo: FormeIcon,+ },title: "Forme PDF",type: "registry:style" as const,},diff --git a/registry/bases/forme/lib/pdfcn-theme-context.tsx b/registry/bases/forme/lib/pdfcn-theme-context.tsxindex 2aa7396..42fc442 100644--- a/registry/bases/forme/lib/pdfcn-theme-context.tsx+++ b/registry/bases/forme/lib/pdfcn-theme-context.tsx@@ -5,7 +5,7 @@// All PDF components import from a single file — splitting would break the public API.import * as React from "react";-import { createContext, useContext, useMemo } from "react";+import { createContext, useContext } from "react";import type { DependencyList, ReactNode } from "react";import { theme as defaultTheme } from "./pdfcn-theme";@@ -33,27 +33,24 @@ const hasActiveDispatcher = (): boolean => {const dispatcher =maybeInternals.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE?.H;- return dispatcher !== null;+ return dispatcher != null;};export const PdfcnThemeProvider = ({theme,children,-}: PdfcnThemeProviderProps) => {- const resolvedTheme = useMemo(() => theme ?? defaultTheme, [theme]);- return (- <PdfcnThemeContext.Provider value={resolvedTheme}>- {children}- </PdfcnThemeContext.Provider>- );-};+}: PdfcnThemeProviderProps) => (+ <PdfcnThemeContext.Provider value={theme ?? defaultTheme}>+ {children}+ </PdfcnThemeContext.Provider>+);/*** Regex patterns that indicate a hook was called outside a valid React render tree.* These errors are caught and suppressed so components fall back to safe defaults.*/const HOOK_ERROR_PATTERNS =- /invalid hook call|useContext|useMemo|cannot read properties of null|dispatcher|renderWithHooks|resolveDispatcher|hooks can only be called|rendered fewer hooks/i;+ /invalid hook call|minified react error #321|useContext|useMemo|cannot read properties of null|dispatcher|renderWithHooks|resolveDispatcher|hooks can only be called|rendered fewer hooks/i;/*** Calls a React hook with a graceful fallback for non-render environments (e.g. unit tests).diff --git a/registry/bases/takumi/lib/pdfcn-theme-context.tsx b/registry/bases/takumi/lib/pdfcn-theme-context.tsxindex 2aa7396..42fc442 100644--- a/registry/bases/takumi/lib/pdfcn-theme-context.tsx+++ b/registry/bases/takumi/lib/pdfcn-theme-context.tsx@@ -5,7 +5,7 @@// All PDF components import from a single file — splitting would break the public API.import * as React from "react";-import { createContext, useContext, useMemo } from "react";+import { createContext, useContext } from "react";import type { DependencyList, ReactNode } from "react";import { theme as defaultTheme } from "./pdfcn-theme";@@ -33,27 +33,24 @@ const hasActiveDispatcher = (): boolean => {const dispatcher =maybeInternals.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE?.H;- return dispatcher !== null;+ return dispatcher != null;};export const PdfcnThemeProvider = ({theme,children,-}: PdfcnThemeProviderProps) => {- const resolvedTheme = useMemo(() => theme ?? defaultTheme, [theme]);- return (- <PdfcnThemeContext.Provider value={resolvedTheme}>- {children}- </PdfcnThemeContext.Provider>- );-};+}: PdfcnThemeProviderProps) => (+ <PdfcnThemeContext.Provider value={theme ?? defaultTheme}>+ {children}+ </PdfcnThemeContext.Provider>+);/*** Regex patterns that indicate a hook was called outside a valid React render tree.* These errors are caught and suppressed so components fall back to safe defaults.*/const HOOK_ERROR_PATTERNS =- /invalid hook call|useContext|useMemo|cannot read properties of null|dispatcher|renderWithHooks|resolveDispatcher|hooks can only be called|rendered fewer hooks/i;+ /invalid hook call|minified react error #321|useContext|useMemo|cannot read properties of null|dispatcher|renderWithHooks|resolveDispatcher|hooks can only be called|rendered fewer hooks/i;/*** Calls a React hook with a graceful fallback for non-render environments (e.g. unit tests).diff --git a/scripts/build-registry.mjs b/scripts/build-registry.mjsindex dcbb7a0..69e4fb4 100644--- a/scripts/build-registry.mjs+++ b/scripts/build-registry.mjs@@ -47,7 +47,9 @@ const main = async () => {console.log(`Built ${registry.items.length} registry items → public/r`);};-main().catch((error) => {+try {+ await main();+} catch (error) {console.error(error);process.exit(1);-});+}diff --git a/scripts/fix-port.mjs b/scripts/fix-port.mjsindex 13336be..319456b 100644--- a/scripts/fix-port.mjs+++ b/scripts/fix-port.mjs@@ -3,7 +3,7 @@ import path from "node:path";const ROOT = process.cwd();-function walk(dir, out = []) {+const walk = (dir, out = []) => {if (!fs.existsSync(dir)) {return out;}@@ -16,9 +16,9 @@ function walk(dir, out = []) {}}return out;-}+};-function fixContent(content, base) {+const fixContent = (content, base) => {let c = content;c = c.replaceAll(/,\s*=\s*false,/g, ", fixed = false,");c = c.replaceAll(/,\s*=\s*true,/g, ", fixed = true,");@@ -27,10 +27,10 @@ function fixContent(content, base) {"");c = c.replaceAll(- '@react-pdf/renderer',+ "@react-pdf/renderer",base === "forme" ? "@formepdf/react" : "Takumi PDF primitives");- c = c.replaceAll('pdfx-theme', "pdfcn-theme");+ c = c.replaceAll("pdfx-theme", "pdfcn-theme");if (base === "takumi") {// style={[{ breakInside: "avoid" as const } style={foo}].filter(Boolean)}@@ -40,7 +40,7 @@ function fixContent(content, base) {);}return c;-}+};for (const base of ["takumi", "forme"]) {const baseDir = path.join(ROOT, `registry/bases/${base}`);@@ -61,14 +61,14 @@ import { Svg as FormeSvg } from "@formepdf/react";type AnyProps = Record<string, unknown> & { children?: ReactNode; style?: CSSProperties };-export function Svg({+export const Svg =({children,width,height,viewBox,style,...rest-}: AnyProps & { width?: number; height?: number; viewBox?: string }) {+}: AnyProps & { width?: number; height?: number; viewBox?: string }) => {return (<FormeSvgwidth={width as number}@@ -192,43 +192,44 @@ const qrTakumi = path.join("registry/bases/takumi/components/qrcode/qrcode.tsx");let qrt = fs.readFileSync(qrTakumi, "utf-8");-if (qrt.includes("@react-pdf") || qrt.includes("takumi-primitives")) {- // ensure Svg/Rect from takumi-svg- if (qrt.includes("Svg") && !qrt.includes("takumi-svg")) {- qrt = qrt.replace(- /import \{([^}]+)\} from "\.\.\/\.\.\/lib\/takumi-primitives";/,- (_m, imports) => {- const list = imports- .split(",")- .map((s) => s.trim())- .filter(Boolean);- const fromPrim = [];- const fromSvg = [];- for (const i of list) {- if (["Svg", "Rect", "Circle", "G", "Line", "Path"].includes(i)) {- fromSvg.push(i);- } else if (i === "Text as SvgText") {- fromSvg.push("SvgText");- } else {- fromPrim.push(i);- }- }- const linesOut = [];- if (fromPrim.length) {- linesOut.push(- `import { ${fromPrim.join(", ")} } from "../../lib/takumi-primitives";`- );+if (+ (qrt.includes("@react-pdf") || qrt.includes("takumi-primitives")) &&+ qrt.includes("Svg") &&+ !qrt.includes("takumi-svg")+) {+ qrt = qrt.replace(+ /import \{([^}]+)\} from "\.\.\/\.\.\/lib\/takumi-primitives";/,+ (_m, imports) => {+ const list = imports+ .split(",")+ .map((s) => s.trim())+ .filter(Boolean);+ const fromPrim = [];+ const fromSvg = [];+ for (const i of list) {+ if (["Svg", "Rect", "Circle", "G", "Line", "Path"].includes(i)) {+ fromSvg.push(i);+ } else if (i === "Text as SvgText") {+ fromSvg.push("SvgText");+ } else {+ fromPrim.push(i);}- if (fromSvg.length) {- linesOut.push(- `import { ${[...new Set(fromSvg)].join(", ")} } from "../../lib/takumi-svg";`- );- }- return linesOut.join("\n");}- );- fs.writeFileSync(qrTakumi, qrt);- }+ const linesOut = [];+ if (fromPrim.length) {+ linesOut.push(+ `import { ${fromPrim.join(", ")} } from "../../lib/takumi-primitives";`+ );+ }+ if (fromSvg.length) {+ linesOut.push(+ `import { ${[...new Set(fromSvg)].join(", ")} } from "../../lib/takumi-svg";`+ );+ }+ return linesOut.join("\n");+ }+ );+ fs.writeFileSync(qrTakumi, qrt);}const leftover = [];diff --git a/scripts/generate-docs.mjs b/scripts/generate-docs.mjsnew file mode 100644index 0000000..99d7623--- /dev/null+++ b/scripts/generate-docs.mjs@@ -0,0 +1,569 @@+/**+ * Generates base-scoped docs MDX matching the termcn page outline:+ * Preview → Installation (CLI/Manual) → Usage → API Reference+ *+ * Run: node scripts/generate-docs.mjs+ */+import fs from "node:fs";+import path from "node:path";++const ROOT = process.cwd();++const COMPONENTS = [+ "alert",+ "badge",+ "card",+ "data-table",+ "divider",+ "form",+ "graph",+ "heading",+ "keep-together",+ "key-value",+ "link",+ "list",+ "page-break",+ "page-footer",+ "page-header",+ "page-number",+ "pdf-image",+ "qrcode",+ "section",+ "signature",+ "stack",+ "table",+ "text",+ "watermark",+];++const BLOCKS = [+ "invoice-classic",+ "invoice-consultant",+ "invoice-corporate",+ "invoice-creative",+ "invoice-minimal",+ "invoice-modern",+ "report-financial",+ "report-marketing",+ "report-operations",+ "report-security",+];++const COMPONENT_EXPORTS = {+ alert: "PdfAlert",+ badge: "Badge",+ card: "PdfCard",+ "data-table": "DataTable",+ divider: "Divider",+ form: "PdfForm",+ graph: "PdfGraph",+ heading: "Heading",+ "keep-together": "KeepTogether",+ "key-value": "KeyValue",+ link: "Link",+ list: "PdfList",+ "page-break": "PageBreak",+ "page-footer": "PageFooter",+ "page-header": "PageHeader",+ "page-number": "PdfPageNumber",+ "pdf-image": "PdfImage",+ qrcode: "PdfQRCode",+ section: "Section",+ signature: "PdfSignatureBlock",+ stack: "Stack",+ table: "Table",+ text: "Text",+ watermark: "PdfWatermark",+};++const BLOCK_EXPORTS = {+ "invoice-classic": "InvoiceClassicDocument",+ "invoice-consultant": "InvoiceConsultantDocument",+ "invoice-corporate": "InvoiceCorporateDocument",+ "invoice-creative": "InvoiceCreativeDocument",+ "invoice-minimal": "InvoiceMinimalDocument",+ "invoice-modern": "InvoiceModernDocument",+ "report-financial": "FinancialReportDocument",+ "report-marketing": "MarketingReportDocument",+ "report-operations": "OperationsReportDocument",+ "report-security": "SecurityReportDocument",+};++const DESCRIPTIONS = {+ alert: "Alert box with info, success, warning, and error variants.",+ badge: "Compact status badge for labels and tags.",+ card: "Bordered content card with title and body.",+ "data-table": "Tabular data with columns and rows.",+ divider: "Horizontal rule to separate sections.",+ form: "Labeled form groups for PDF inputs.",+ graph: "Bar, line, and area charts drawn with SVG.",+ heading: "Document headings with typographic scale.",+ "invoice-classic": "Classic invoice document template.",+ "invoice-consultant": "Consultant-style invoice template.",+ "invoice-corporate": "Corporate invoice document template.",+ "invoice-creative": "Creative invoice document template.",+ "invoice-minimal": "Minimal invoice document template.",+ "invoice-modern": "Modern invoice document template.",+ "keep-together": "Keeps children on the same PDF page.",+ "key-value": "Definition list of keys and values.",+ link: "Clickable link styled for PDF documents.",+ list: "Ordered and unordered lists.",+ "page-break": "Forces a page break in the document.",+ "page-footer": "Repeating page footer.",+ "page-header": "Repeating page header.",+ "page-number": "Current page number marker.",+ "pdf-image": "Embedded image with fit options.",+ qrcode: "QR code generated from a string value.",+ "report-financial": "Financial report document template.",+ "report-marketing": "Marketing report document template.",+ "report-operations": "Operations report document template.",+ "report-security": "Security report document template.",+ section: "Section wrapper with optional title.",+ signature: "Signature block with name and label.",+ stack: "Vertical stack with spacing.",+ table: "Low-level table primitives.",+ text: "Body text with typography variants.",+ watermark: "Diagonal or centered watermark overlay.",+};++const USAGE = {+ alert: `<PdfAlert variant="info" title="Info">\n Alert body\n</PdfAlert>`,+ badge: `<Badge>Badge</Badge>`,+ card: `<PdfCard title="Card">Card body</PdfCard>`,+ "data-table": `<DataTable\n columns={[{ key: "name", header: "Name" }]}\n data={[{ name: "Widget" }]}\n/>`,+ divider: `<Divider />`,+ form: `<PdfForm\n title="Contact"\n groups={[{ fields: [{ label: "Email" }] }]}\n/>`,+ graph: `<PdfGraph\n variant="bar"\n data={[{ label: "Q1", value: 30 }]}\n/>`,+ heading: `<Heading level={1}>Heading</Heading>`,+ "keep-together": `<KeepTogether>\n <Text>Keep these lines together.</Text>\n</KeepTogether>`,+ "key-value": `<KeyValue items={[{ key: "Name", value: "Ada" }]} />`,+ link: `<Link href="https://example.com">Example</Link>`,+ list: `<PdfList items={[{ text: "Alpha" }, { text: "Beta" }]} />`,+ "page-break": `<PageBreak />`,+ "page-footer": `<PageFooter leftText="pdfcn" rightText="Confidential" />`,+ "page-header": `<PageHeader title="Company" subtitle="Invoice" />`,+ "page-number": `<PdfPageNumber />`,+ "pdf-image": `<PdfImage src="/logo.png" width={120} />`,+ qrcode: `<PdfQRCode value="https://pdfcn.dev" />`,+ section: `<Section>\n <Text>Section body</Text>\n</Section>`,+ signature: `<PdfSignatureBlock name="Jane Doe" label="Authorized Signature" />`,+ stack: `<Stack gap="md">\n <Text>One</Text>\n <Text>Two</Text>\n</Stack>`,+ table: `<Table>\n <TableHeader>\n <TableRow>\n <TableCell><Text>Item</Text></TableCell>\n </TableRow>\n </TableHeader>\n</Table>`,+ text: `<Text>Hello from pdfcn</Text>`,+ watermark: `<PdfWatermark text="DRAFT" />`,+};++const BASE_DEPS = {+ forme: "@formepdf/react @formepdf/core",+ takumi: "takumi-pdf @takumi-rs/helpers",+};++const TITLE_OVERRIDES = {+ "data-table": "Data Table",+ "keep-together": "Keep Together",+ "key-value": "Key Value",+ "page-break": "Page Break",+ "page-footer": "Page Footer",+ "page-header": "Page Header",+ "page-number": "Page Number",+ "pdf-image": "PDF Image",+ qrcode: "QR Code",+};++const titleCase = (slug) => {+ if (TITLE_OVERRIDES[slug]) {+ return TITLE_OVERRIDES[slug];+ }+ return slug+ .split("-")+ .map((p) => p.charAt(0).toUpperCase() + p.slice(1))+ .join(" ");+};++const ensureDir = (dir) => {+ fs.mkdirSync(dir, { recursive: true });+};++const write = (file, content) => {+ ensureDir(path.dirname(file));+ fs.writeFileSync(file, content);+};++const escapeMdx = (value) =>+ value.replaceAll("{", "{").replaceAll("}", "}");++const extractPropsTable = (sourcePath, exportName) => {+ if (!fs.existsSync(sourcePath)) {+ return null;+ }+ const src = fs.readFileSync(sourcePath, "utf-8");+ const interfaceMatch = src.match(+ new RegExp(+ `export interface (\\w*Props)\\s+(?:extends [^{]+)?\\{([\\s\\S]*?)\\n\\}`+ )+ );+ if (!interfaceMatch) {+ return null;+ }++ // eslint-disable-next-line prefer-destructuring+ const body = interfaceMatch[2];+ const rows = [];+ const propRegex = /(?:\/\*\*([\s\S]*?)\*\/\s*)?(\w+)(\?)?:\s*([^;]+);/g;+ let match = propRegex.exec(body);+ while (match) {+ const [, jsdoc, name, optional, typeRaw] = match;+ if (name === "style" || name === "wrap") {+ // keep them — common PDF props+ }+ const defaultMatch = jsdoc?.match(/@default\s+([^\n*]+)/);+ const type = typeRaw.replaceAll(/\s+/g, " ").trim();+ rows.push({+ default: escapeMdx(defaultMatch ? defaultMatch[1].trim() : "-"),+ name: `\`${name}\``,+ required: optional ? "No" : "Yes",+ type: `\`${escapeMdx(type)}\``,+ });+ match = propRegex.exec(body);+ }++ if (rows.length === 0) {+ return null;+ }++ const header = `| Prop | Type | Default |\n| ---- | ---- | ------- |`;+ const lines = rows.map(+ (row) => `| ${row.name} | ${row.type} | ${row.default} |`+ );+ return `## API Reference\n\n### ${exportName}\n\n${header}\n${lines.join("\n")}\n`;+};++const manualSources = (base, kind, name) => {+ const sources = [];+ if (kind === "component") {+ sources.push({+ src: `registry/bases/${base}/components/${name}/${name}.tsx`,+ title: `components/pdf/${name}.tsx`,+ });+ } else {+ const file = `${name}.tsx`;+ sources.push({+ src: `registry/bases/${base}/blocks/${name}/${file}`,+ title: `components/pdf/${name}.tsx`,+ });+ }++ sources.push(+ {+ src: `registry/bases/${base}/lib/pdfcn-theme-context.tsx`,+ title: "components/pdf/pdfcn-theme-context.tsx",+ },+ {+ src: `registry/bases/${base}/lib/pdfcn-theme.ts`,+ title: "components/pdf/pdfcn-theme.ts",+ },+ {+ src: `registry/bases/${base}/lib/resolve-color.ts`,+ title: "components/pdf/resolve-color.ts",+ }+ );++ if (base === "takumi") {+ sources.push(+ {+ src: `registry/bases/takumi/lib/takumi-primitives.tsx`,+ title: "components/pdf/takumi-primitives.tsx",+ },+ {+ src: `registry/bases/takumi/lib/takumi-svg.tsx`,+ title: "components/pdf/takumi-svg.tsx",+ }+ );+ }++ return sources+ .filter((s) => fs.existsSync(path.join(ROOT, s.src)))+ .map(+ (s) =>+ `<ComponentSource\n src="${s.src}"\n base="${base}"\n title="${s.title}"\n/>`+ )+ .join("\n\n");+};++const usageSnippet = (kind, name, exportName) => {+ if (kind === "block") {+ return `<${exportName} />`;+ }+ return USAGE[name] ?? `<${exportName} />`;+};++const componentMdx = (base, name) => {+ const exportName = COMPONENT_EXPORTS[name];+ const title = titleCase(name);+ const description =+ DESCRIPTIONS[name] ?? `${title} PDF component for the ${base} base.`;+ const deps = BASE_DEPS[base];+ const sourcePath = path.join(+ ROOT,+ `registry/bases/${base}/components/${name}/${name}.tsx`+ );+ const api = extractPropsTable(sourcePath, exportName) ?? "";+ const importExtra =+ name === "table"+ ? `{ Table, TableBody, TableCell, TableHeader, TableRow, Text }`+ : `{ ${exportName} }`;+ const keepTogetherImport =+ name === "keep-together" ||+ name === "section" ||+ name === "stack" ||+ name === "watermark"+ ? `\nimport { Text } from "@/components/pdf/text";`+ : "";++ return `---+title: "${title}"+description: "${description}"+---++<ComponentPreview base="${base}" name="${name}" hideCode />++## Installation++<CodeTabs>++<TabsList>+ <TabsTrigger value="cli">Command</TabsTrigger>+ <TabsTrigger value="manual">Manual</TabsTrigger>+</TabsList>++<TabsContent value="cli">++\`\`\`bash+npx shadcn@latest add @pdfcn/${base}/${name}+\`\`\`++</TabsContent>++<TabsContent value="manual">++<Steps>++<Step>Install the following dependencies:</Step>++\`\`\`bash+npm install ${deps}+\`\`\`++<Step>Copy and paste the following code into your project.</Step>++${manualSources(base, "component", name)}++<Step>Update the import paths to match your project setup.</Step>++</Steps>++</TabsContent>++</CodeTabs>++## Usage++\`\`\`tsx+import ${importExtra} from "@/components/pdf/${name}";${keepTogetherImport}+\`\`\`++\`\`\`tsx+${usageSnippet("component", name, exportName)}+\`\`\`++${api}`;+};++const blockMdx = (base, name) => {+ const exportName = BLOCK_EXPORTS[name];+ const title = titleCase(name);+ const description =+ DESCRIPTIONS[name] ?? `${title} PDF block for the ${base} base.`;+ const deps = BASE_DEPS[base];++ return `---+title: "${title}"+description: "${description}"+---++<ComponentPreview base="${base}" name="${name}" hideCode />++## Installation++<CodeTabs>++<TabsList>+ <TabsTrigger value="cli">Command</TabsTrigger>+ <TabsTrigger value="manual">Manual</TabsTrigger>+</TabsList>++<TabsContent value="cli">++\`\`\`bash+npx shadcn@latest add @pdfcn/${base}/${name}+\`\`\`++</TabsContent>++<TabsContent value="manual">++<Steps>++<Step>Install the following dependencies:</Step>++\`\`\`bash+npm install ${deps}+\`\`\`++<Step>Copy and paste the following code into your project.</Step>++${manualSources(base, "block", name)}++<Step>Update the import paths to match your project setup.</Step>++</Steps>++</TabsContent>++</CodeTabs>++## Usage++\`\`\`tsx+import { ${exportName} } from "@/components/pdf/${name}";+\`\`\`++\`\`\`tsx+<${exportName} />+\`\`\`+`;+};++const baseIndexMdx = (section, base, title) => {+ const folderName = section === "components" ? "Components" : "Blocks";+ const description =+ section === "components"+ ? `PDF UI primitives for the ${title} base.`+ : `Invoice and report templates for the ${title} base.`;++ return `---+title: "${title}"+description: "${description}"+---++<ComponentsList folderName="${folderName}" base="${base}" />+`;+};++const sectionIndexMdx = (section) => {+ if (section === "components") {+ return `---+title: "Components"+description: "PDF UI primitives available on Takumi and Forme bases."+---++Choose a base to browse components.++- [Takumi PDF](/docs/components/takumi)+- [Forme PDF](/docs/components/forme)+`;+ }++ return `---+title: "Blocks"+description: "Full PDF document templates — invoices and reports."+---++Choose a base to browse blocks.++- [Takumi PDF](/docs/blocks/takumi)+- [Forme PDF](/docs/blocks/forme)+`;+};++const writeMeta = (file, title, pages) => {+ write(file, `${JSON.stringify({ pages, title }, null, 2)}\n`);+};++const cleanFlatDocs = (section) => {+ const dir = path.join(ROOT, `content/docs/${section}`);+ for (const entry of fs.readdirSync(dir)) {+ if (entry.endsWith(".mdx") && entry !== "index.mdx") {+ fs.unlinkSync(path.join(dir, entry));+ }+ }+};++const main = () => {+ cleanFlatDocs("components");+ cleanFlatDocs("blocks");++ write(+ path.join(ROOT, "content/docs/components/index.mdx"),+ sectionIndexMdx("components")+ );+ write(+ path.join(ROOT, "content/docs/blocks/index.mdx"),+ sectionIndexMdx("blocks")+ );++ writeMeta(+ path.join(ROOT, "content/docs/components/meta.json"),+ "Components",+ ["index", "takumi", "forme"]+ );+ writeMeta(path.join(ROOT, "content/docs/blocks/meta.json"), "Blocks", [+ "index",+ "takumi",+ "forme",+ ]);++ for (const base of ["takumi", "forme"]) {+ const baseTitle = base === "takumi" ? "Takumi PDF" : "Forme PDF";++ write(+ path.join(ROOT, `content/docs/components/${base}/index.mdx`),+ baseIndexMdx("components", base, baseTitle)+ );+ writeMeta(+ path.join(ROOT, `content/docs/components/${base}/meta.json`),+ baseTitle,+ ["index", ...COMPONENTS]+ );++ for (const name of COMPONENTS) {+ write(+ path.join(ROOT, `content/docs/components/${base}/${name}.mdx`),+ componentMdx(base, name)+ );+ }++ write(+ path.join(ROOT, `content/docs/blocks/${base}/index.mdx`),+ baseIndexMdx("blocks", base, baseTitle)+ );+ writeMeta(+ path.join(ROOT, `content/docs/blocks/${base}/meta.json`),+ baseTitle,+ ["index", ...BLOCKS]+ );++ for (const name of BLOCKS) {+ write(+ path.join(ROOT, `content/docs/blocks/${base}/${name}.mdx`),+ blockMdx(base, name)+ );+ }+ }++ console.log(+ `Generated docs for ${COMPONENTS.length} components × 2 bases and ${BLOCKS.length} blocks × 2 bases`+ );+};++main();diff --git a/scripts/generate-registry.mjs b/scripts/generate-registry.mjsindex 3b53457..d884987 100644--- a/scripts/generate-registry.mjs+++ b/scripts/generate-registry.mjs@@ -72,40 +72,37 @@ const COMPONENT_EXPORTS = {watermark: "PdfWatermark",};-function titleCase(slug) {- return slug+const titleCase = (slug) =>+ slug.split("-").map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join(" ");-}-function demoForComponent(base, name) {+const demoForComponent = (base, name) => {const exportName =- COMPONENT_EXPORTS[name] ?? titleCase(name).replaceAll(' ', "");+ COMPONENT_EXPORTS[name] ?? titleCase(name).replaceAll(" ", "");const isForme = base === "forme";const wrappers = isForme? `import { Document, Page } from "@formepdf/react";-import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";import { ${exportName} } from "@/registry/bases/forme/components/${name}";-export default function Demo() {+const Demo =() => {return (<Document><Page size="A4" margin={48}>- <PdfcnThemeProvider>- <DemoBody />- </PdfcnThemeProvider>+ <DemoBody /></Page></Document>);}+export default Demo;`: `import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";import { PdfcnThemeProvider } from "@/registry/bases/takumi/lib/pdfcn-theme-context";import { ${exportName} } from "@/registry/bases/takumi/components/${name}";-export default function Demo() {+const Demo =() => {return (<Document><Page size="A4">@@ -116,6 +113,7 @@ export default function Demo() {</Document>);}+export default Demo;`;const bodies = {@@ -243,10 +241,11 @@ export default function Demo() {// table demo has its own imports - prepend carefullyif (name === "table") {+ const providerOpen = isForme ? "" : " <PdfcnThemeProvider>\n";+ const providerClose = isForme ? "" : " </PdfcnThemeProvider>\n";return `${isForme? `import { Document, Page } from "@formepdf/react";-import { PdfcnThemeProvider } from "@/registry/bases/forme/lib/pdfcn-theme-context";import { Table } from "@/registry/bases/forme/components/table";`: `import { Document, Page } from "@/registry/bases/takumi/lib/takumi-primitives";@@ -255,19 +254,18 @@ import { Table } from "@/registry/bases/takumi/components/table";`}import { TableBody, TableCell, TableHeader, TableRow, Text } from "@/registry/bases/${base}/components";-export default function Demo() {+const Demo =() => {return (<Document><Page size="A4"${isForme ? " margin={48}" : ""}>- <PdfcnThemeProvider>- <DemoBody />- </PdfcnThemeProvider>- </Page>+${providerOpen} <DemoBody />+${providerClose} </Page></Document>);}+export default Demo;-function DemoBody() {+const DemoBody =() => {return (<Table><TableHeader>@@ -291,6 +289,8 @@ function DemoBody() {// For stack/section demos need Text importconst needsText = ["stack",+ "section",+ "pdf-image","page-break","keep-together","watermark",@@ -303,9 +303,9 @@ function DemoBody() {`import { ${exportName} } from "@/registry/bases/${base}/components/${name}";`,`import { ${exportName} } from "@/registry/bases/${base}/components/${name}";\n${textImport}`)}\n${body}\n`;-}+};-function demoForBlock(base, name) {+const demoForBlock = (base, name) => {const exportMap = {"invoice-classic": "InvoiceClassicDocument","invoice-consultant": "InvoiceConsultantDocument",@@ -325,18 +325,19 @@ function demoForBlock(base, name) {`registry/bases/${base}/blocks/${name}/${name}.tsx`);const src = fs.readFileSync(file, "utf-8");- const match = src.match(/export function (\w+)/);+ const match = src.match(/export (?:const|function) (\w+)/);const fn = match?.[1] ?? exp;return `import { ${fn} } from "@/registry/bases/${base}/blocks/${name}/${name}";-export default function Demo() {+const Demo =() => {return <${fn} />;}+export default Demo;`;-}+};-function collectFiles(base, kind, name) {+const collectFiles = (base, kind, name) => {const dir = path.join(ROOT,`registry/bases/${base}/${kind === "block" ? "blocks" : "components"}/${name}`@@ -352,9 +353,9 @@ function collectFiles(base, kind, name) {path: `registry/bases/${base}/${kind === "block" ? "blocks" : "components"}/${name}/${f}`,type: kind === "block" ? "registry:block" : "registry:component",}));-}+};-function libFiles(base) {+const libFiles = (base) => {const files = ["pdfcn-theme.ts","pdfcn-theme-context.tsx",@@ -373,9 +374,9 @@ function libFiles(base) {path: `registry/bases/${base}/lib/${f}`,type: "registry:lib",}));-}+};-function main() {+const main = () => {const items = [];const demoImports = { forme: [], takumi: [] };@@ -511,7 +512,7 @@ function main() {let indexSrc = `import type { ComponentType } from "react";\nimport type { BaseName } from "@/registry/bases";\n\n`;for (const base of ["takumi", "forme"]) {for (const name of demoImports[base]) {- const ident = `${base}_${name.replaceAll('-', "_")}`;+ const ident = `${base}_${name.replaceAll("-", "_")}`;indexSrc += `import ${ident} from "@/examples/${base}/${name}";\n`;}}@@ -519,7 +520,7 @@ function main() {for (const base of ["takumi", "forme"]) {indexSrc += ` ${base}: {\n`;for (const name of demoImports[base]) {- const ident = `${base}_${name.replaceAll('-', "_")}`;+ const ident = `${base}_${name.replaceAll("-", "_")}`;indexSrc += ` "${name}": ${ident},\n`;}indexSrc += ` },\n`;@@ -530,6 +531,6 @@ function main() {console.log("items:", items.length);console.log("demos takumi:", demoImports.takumi.length);console.log("demos forme:", demoImports.forme.length);-}+};main();diff --git a/scripts/port-pdfx.mts b/scripts/port-pdfx.mtsindex fd5bb10..99cd3a5 100644--- a/scripts/port-pdfx.mts+++ b/scripts/port-pdfx.mts@@ -9,20 +9,18 @@ const ROOT = path.resolve(import.meta.dirname, "..");const SRC = path.join(ROOT, ".pdfx-ref/apps/www/src/registry");const SHARED = path.join(ROOT, ".pdfx-ref/packages/shared/src");-function ensureDir(dir: string) {+const ensureDir = (dir: string) => {fs.mkdirSync(dir, { recursive: true });-}+};-function write(file: string, content: string) {+const write = (file: string, content: string) => {ensureDir(path.dirname(file));fs.writeFileSync(file, content, "utf-8");-}+};-function read(file: string) {- return fs.readFileSync(file, "utf-8");-}+const read = (file: string) => fs.readFileSync(file, "utf-8");-function walk(dir: string, out: string[] = []): string[] {+const walk = (dir: string, out: string[] = []): string[] => {for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {const full = path.join(dir, entry.name);if (entry.isDirectory()) {@@ -32,10 +30,10 @@ function walk(dir: string, out: string[] = []): string[] {}}return out;-}+};-function renameShared(content: string) {- return content+const renameShared = (content: string) =>+ content.replaceAll("PdfxTheme", "PdfcnTheme").replaceAll("PDFx", "pdfcn").replaceAll("@pdfx/shared", "@/registry/themes")@@ -54,10 +52,9 @@ function renameShared(content: string) {.replaceAll("./blueprint.js", "./blueprint").replaceAll("from './types.js'", "from './component-types'").replaceAll('from "./types.js"', 'from "./component-types"');-}-function transformCommon(content: string) {- return content+const transformCommon = (content: string) =>+ content.replaceAll("@pdfx/shared", "@/registry/themes").replaceAll("PdfxTheme", "PdfcnTheme").replaceAll("usePdfxTheme", "usePdfcnTheme")@@ -75,9 +72,8 @@ function transformCommon(content: string) {/from ['"]\.\/pdfx-theme-context['"]/g,'from "./pdfcn-theme-context"');-}-function transformForme(content: string) {+const transformForme = (content: string) => {let out = transformCommon(content);out = out.replaceAll("@/registry/bases/PLACEHOLDER/components",@@ -153,9 +149,9 @@ function transformForme(content: string) {);return out;-}+};-function transformTakumi(content: string) {+const transformTakumi = (content: string) => {let out = transformCommon(content);out = out.replaceAll("@/registry/bases/PLACEHOLDER/components",@@ -283,9 +279,9 @@ function transformTakumi(content: string) {out = out.replaceAll(/\s+fixed\b(?!=)/g, "");return out;-}+};-function portLib(base: "takumi" | "forme") {+const portLib = (base: "takumi" | "forme") => {const libDir = path.join(ROOT, `registry/bases/${base}/lib`);ensureDir(libDir);@@ -328,7 +324,7 @@ type ViewProps = {minPresenceAhead?: number;};-function flatten(style?: ViewProps["style"]): CSSProperties | undefined {+const flatten =(style?: ViewProps["style"]): CSSProperties | undefined => {if (!style) return undefined;if (Array.isArray(style)) {return Object.assign({}, ...style.filter(Boolean));@@ -336,7 +332,7 @@ function flatten(style?: ViewProps["style"]): CSSProperties | undefined {return style;}-export function View({ children, style, className, ...rest }: ViewProps) {+export const View =({ children, style, className, ...rest }: ViewProps) => {const { wrap: _w, fixed: _f, break: br, minPresenceAhead: _m, ...dom } = rest as ViewProps & Record<string, unknown>;const merged = flatten(style) ?? {};if (br) Object.assign(merged, { breakBefore: "page" });@@ -356,7 +352,7 @@ type TextProps = {href?: string;};-export function Text({ children, style, className, render: _render, href, ...rest }: TextProps) {+export const Text =({ children, style, className, render: _render, href, ...rest }: TextProps) => {const merged = flatten(style);if (href) {return (@@ -372,15 +368,15 @@ export function Text({ children, style, className, render: _render, href, ...res);}-export function Image({+export const Image =({src,style,...rest-}: { src: string; style?: Style | Style[] } & ImgHTMLAttributes<HTMLImageElement>) {+}: { src: string; style?: Style | Style[] } & ImgHTMLAttributes<HTMLImageElement>) => {return <img src={src} style={flatten(style)} alt="" {...rest} />;}-export function Link({+export const Link =({src,children,style,@@ -389,7 +385,7 @@ export function Link({src: string;children?: ReactNode;style?: Style | Style[];-} & AnchorHTMLAttributes<HTMLAnchorElement>) {+} & AnchorHTMLAttributes<HTMLAnchorElement>) => {return (<a href={src} style={flatten(style)} {...rest}>{children}@@ -397,7 +393,7 @@ export function Link({);}-export function Document({+export const Document =({children,title,style,@@ -405,7 +401,7 @@ export function Document({children?: ReactNode;title?: string;style?: Style | Style[];-}) {+}) => {return (<div data-pdf-document={title} style={flatten(style)}>{children}@@ -413,7 +409,7 @@ export function Document({);}-export function Page({+export const Page =({children,size: _size,style,@@ -421,7 +417,7 @@ export function Page({children?: ReactNode;size?: string | { width: number; height: number };style?: Style | Style[];-}) {+}) => {return (<div data-pdf-page style={flatten(style)}>{children}@@ -435,11 +431,11 @@ export function Page({path.join(libDir, "takumi-svg.tsx"),`import type { CSSProperties, ReactNode, SVGProps } from "react";-export function Svg({+export const Svg =({children,style,...rest-}: SVGProps<SVGSVGElement> & { style?: CSSProperties }) {+}: SVGProps<SVGSVGElement> & { style?: CSSProperties }) => {return (<svg style={style} {...rest}>{children}@@ -447,26 +443,26 @@ export function Svg({);}-export function Rect(props: SVGProps<SVGRectElement>) {+export const Rect =(props: SVGProps<SVGRectElement>) => {return <rect {...props} />;}-export function Circle(props: SVGProps<SVGCircleElement>) {+export const Circle =(props: SVGProps<SVGCircleElement>) => {return <circle {...props} />;}-export function G(props: SVGProps<SVGGElement>) {+export const G =(props: SVGProps<SVGGElement>) => {return <g {...props} />;}-export function Line(props: SVGProps<SVGLineElement>) {+export const Line =(props: SVGProps<SVGLineElement>) => {return <line {...props} />;}-export function Path(props: SVGProps<SVGPathElement>) {+export const Path =(props: SVGProps<SVGPathElement>) => {return <path {...props} />;}-export function SvgText({+export const SvgText =({children,style,...rest-}: SVGProps<SVGTextElement> & { children?: ReactNode; style?: CSSProperties }) {+}: SVGProps<SVGTextElement> & { children?: ReactNode; style?: CSSProperties }) => {return (<text style={style} {...rest}>{children}@@ -476,9 +472,9 @@ export function SvgText({`);}-}+};-function portFile(rel: string, base: "takumi" | "forme") {+const portFile = (rel: string, base: "takumi" | "forme") => {const srcFile = path.join(SRC, rel);if (!fs.existsSync(srcFile)) {return;@@ -490,9 +486,9 @@ function portFile(rel: string, base: "takumi" | "forme") {.replaceAll("pdfx-theme", "pdfcn-theme").replaceAll("pdfx-theme-context", "pdfcn-theme-context");write(path.join(ROOT, `registry/bases/${base}`, destRel), transformed);-}+};-function main() {+const main = () => {// Shared themesconst themesDir = path.join(ROOT, "registry/themes");ensureDir(themesDir);@@ -649,7 +645,7 @@ export interface PageBreakProps extends Omit<PDFComponentProps, "children"> {children?: never;}-export function PageBreak(_props: PageBreakProps) {+export const PageBreak =(_props: PageBreakProps) => {return <FormePageBreak />;}`@@ -687,7 +683,7 @@ export interface KeepTogetherProps {style?: Style;}-export function KeepTogether({ children, style }: KeepTogetherProps) {+export const KeepTogether =({ children, style }: KeepTogetherProps) => {return (<View wrap={false} style={style as never}>{children}@@ -714,7 +710,7 @@ export interface KeepTogetherProps {style?: Style;}-export function KeepTogether({ children, style }: KeepTogetherProps) {+export const KeepTogether =({ children, style }: KeepTogetherProps) => {return (<View style={[{ breakInside: "avoid" }, style as never].filter(Boolean)}>{children}@@ -736,7 +732,7 @@ export interface PageBreakProps extends Omit<PDFComponentProps, "children"> {children?: never;}-export function PageBreak({ style }: PageBreakProps) {+export const PageBreak =({ style }: PageBreakProps) => {return <View style={[{ breakBefore: "page" }, style as never].filter(Boolean)} />;}`@@ -759,6 +755,6 @@ export function PageBreak({ style }: PageBreakProps) {"forme blocks:",fs.readdirSync(path.join(ROOT, "registry/bases/forme/blocks")).length);-}+};main();