Skip to content

armgit / pdfcn

Public Imported from GitHub
0

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

feat: enhance theming support with new routes, sidebar integration, and documentation for Takumi and Forme themes

Aniket-508920aef42720d
diff --git a/app/(app)/docs/[[...slug]]/page.tsx b/app/(app)/docs/[[...slug]]/page.tsx
index 1e4cd78..755cdcb 100644
--- a/app/(app)/docs/[[...slug]]/page.tsx
+++ b/app/(app)/docs/[[...slug]]/page.tsx
@@ -57,7 +57,9 @@ const buildBreadcrumbs = (
pageTitle: string,
pageUrl: string
) => {
- const items: { name: string; path: string }[] = [{ name: "Home", path: ROUTES.HOME }];
+ const items: { name: string; path: string }[] = [
+ { name: "Home", path: ROUTES.HOME },
+ ];
if (slugs.length === 0) {
items.push({ name: pageTitle, path: pageUrl });
diff --git a/components/docs-base-switcher.tsx b/components/docs-base-switcher.tsx
index 950175b..d758b1b 100644
--- a/components/docs-base-switcher.tsx
+++ b/components/docs-base-switcher.tsx
@@ -5,11 +5,12 @@ import { cn } from "@/lib/utils";
import { BASE_NAMES, BASES, getBase } from "@/registry/bases";
import type { BaseName } from "@/registry/bases";
-type DocsBaseSwitcherSection = "components" | "blocks";
+type DocsBaseSwitcherSection = "components" | "blocks" | "theming";
const DOCS_BASE_SWITCHER_SECTIONS = new Set<DocsBaseSwitcherSection>([
"components",
"blocks",
+ "theming",
]);
const isDocsBaseSwitcherSection = (
@@ -18,7 +19,7 @@ const isDocsBaseSwitcherSection = (
DOCS_BASE_SWITCHER_SECTIONS.has(section as DocsBaseSwitcherSection);
export const getDocsBaseSwitcherProps = (
- slug: string[] | undefined
+ slug?: string[]
): {
section: DocsBaseSwitcherSection;
base: string;
@@ -37,11 +38,7 @@ export const getDocsBaseSwitcherProps = (
return null;
}
- if (!rest.length) {
- return null;
- }
-
- return { base, section, slug: rest.join("/") };
+ return { base, section, slug: rest.length > 0 ? rest.join("/") : undefined };
};
export const DocsBaseSwitcher = ({
diff --git a/components/docs-sidebar.tsx b/components/docs-sidebar.tsx
index f48f902..afb14d1 100644
--- a/components/docs-sidebar.tsx
+++ b/components/docs-sidebar.tsx
@@ -16,10 +16,11 @@ import {
import { TOP_LEVEL_SECTIONS } from "@/constants/nav";
import { ROUTES } from "@/constants/routes";
import {
+ PAGES_NEW,
getDocsSidebarPanel,
isBlocksFolder,
isComponentsFolder,
- PAGES_NEW,
+ isThemesFolder,
} from "@/lib/docs";
import {
findBaseFolder,
@@ -147,6 +148,21 @@ const BlocksSidebarPanel = ({ pathname, tree }: SidebarPanelProps) => {
return <SidebarPageGroup label="Blocks" pages={pages} pathname={pathname} />;
};
+const ThemesSidebarPanel = ({ pathname, tree }: SidebarPanelProps) => {
+ const folder = findTopLevelFolder(tree, isThemesFolder);
+ if (!folder) {
+ return null;
+ }
+
+ const pages = getAllPagesFromFolder(folder)
+ .filter(
+ (page) => !page.url.endsWith("/themes") && !page.url.endsWith("/themes/")
+ )
+ .map((page) => ({ name: page.name, url: page.url }));
+
+ return <SidebarPageGroup label="Themes" pages={pages} pathname={pathname} />;
+};
+
export const DocsSidebar = ({
tree,
...props
@@ -164,6 +180,9 @@ export const DocsSidebar = ({
if (panel === "blocks") {
return <BlocksSidebarPanel {...panelProps} />;
}
+ if (panel === "themes") {
+ return <ThemesSidebarPanel {...panelProps} />;
+ }
return null;
};
diff --git a/components/theme-preview.tsx b/components/theme-preview.tsx
index 457173d..432b65c 100644
--- a/components/theme-preview.tsx
+++ b/components/theme-preview.tsx
@@ -10,34 +10,78 @@ import {
SelectValue,
} from "@/components/ui/select";
import { replacePreviewImageSources } from "@/examples/preview-assets";
+import { getTakumiPreviewOptions } from "@/examples/preview-config";
import { cn } from "@/lib/utils";
+import type { BaseName } from "@/registry/bases";
import { THEMES } from "@/registry/themes";
import type { RegistryThemeName } from "@/registry/themes";
+const TAKUMI_WASM_PATH = "/takumi_pdf_wasm_bg.wasm";
+const PREVIEW_LOGO_PATH = "/favicon.png";
+
+let takumiWasmReady: Promise<unknown> | undefined;
+
+const startTakumi = async (
+ initialize: (input: { module_or_path: string }) => Promise<unknown>
+) => {
+ try {
+ return await initialize({ module_or_path: TAKUMI_WASM_PATH });
+ } catch (error) {
+ takumiWasmReady = undefined;
+ throw error;
+ }
+};
+
+const initializeTakumi = (
+ initialize: (input: { module_or_path: string }) => Promise<unknown>
+) => {
+ takumiWasmReady ??= startTakumi(initialize);
+ return takumiWasmReady;
+};
+
+const loadPreviewLogo = async () => {
+ const response = await fetch(PREVIEW_LOGO_PATH);
+ if (!response.ok) {
+ throw new Error(`Unable to load preview logo (${response.status})`);
+ }
+
+ return {
+ sources: [
+ {
+ data: await response.arrayBuffer(),
+ src: PREVIEW_LOGO_PATH,
+ },
+ ],
+ };
+};
+
const THEMES_OPTIONS = [
- { value: "professional", label: "Professional" },
- { value: "modern", label: "Modern" },
- { value: "minimal", label: "Minimal" },
- { value: "executive", label: "Executive" },
- { value: "corporate", label: "Corporate" },
- { value: "elegant", label: "Elegant" },
- { value: "vivid", label: "Vivid" },
- { value: "forest", label: "Forest" },
- { value: "blueprint", label: "Blueprint" },
+ { label: "Professional", value: "professional" },
+ { label: "Modern", value: "modern" },
+ { label: "Minimal", value: "minimal" },
+ { label: "Executive", value: "executive" },
+ { label: "Corporate", value: "corporate" },
+ { label: "Elegant", value: "elegant" },
+ { label: "Vivid", value: "vivid" },
+ { label: "Forest", value: "forest" },
+ { label: "Blueprint", value: "blueprint" },
] as const;
interface ThemePreviewProps {
+ base?: BaseName;
name?: string;
className?: string;
height?: number;
}
export const ThemePreview = ({
+ base = "forme",
name = "invoice-classic",
className,
height = 640,
}: ThemePreviewProps) => {
- const [selectedTheme, setSelectedTheme] = useState<RegistryThemeName>("professional");
+ const [selectedTheme, setSelectedTheme] =
+ useState<RegistryThemeName>("professional");
const [pdfUrl, setPdfUrl] = useState<string | null>(null);
const [error, setError] = useState<string | null>(null);
const containerRef = useRef<HTMLDivElement>(null);
@@ -50,36 +94,80 @@ export const ThemePreview = ({
(async () => {
try {
- const [
- { InvoiceClassicDocument },
- { renderSerializedDoc },
- { serialize },
- ] = await Promise.all([
- import("@/registry/bases/forme/blocks/invoice-classic/invoice-classic"),
- import("@formepdf/core/browser"),
- import("@formepdf/react"),
- ]);
-
const theme = THEMES.find((t) => t.name === selectedTheme)?.theme;
- const document = replacePreviewImageSources(
- serialize(createElement(InvoiceClassicDocument, { theme }))
- );
- const buffer = await renderSerializedDoc(
- document as unknown as Record<string, unknown>
- );
- const pdfBytes = new Uint8Array(buffer);
-
- const source = new TextDecoder("latin1").decode(pdfBytes);
- const pageCounts = [...source.matchAll(/\/Count\s+(\d+)/g)].map((match) =>
- Number(match[1])
- );
- if (pageCounts.length > 0 && Math.max(...pageCounts) === 0) {
- throw new Error("PDF renderer returned a document with no pages");
+
+ if (base === "takumi") {
+ const [
+ { demos },
+ { default: initialize, render },
+ { fromJsx },
+ images,
+ ] = await Promise.all([
+ import("@/examples/__index__"),
+ import("takumi-pdf"),
+ import("@takumi-rs/helpers/jsx"),
+ loadPreviewLogo(),
+ ]);
+ const Demo = demos.takumi[name];
+ if (!Demo) {
+ throw new Error(`Unknown Takumi demo: ${name}`);
+ }
+
+ await initializeTakumi(initialize);
+ const { node, stylesheets } = await fromJsx(
+ createElement(Demo, { theme })
+ );
+ const buffer = await render(node, {
+ ...getTakumiPreviewOptions(name),
+ images,
+ stylesheets,
+ });
+ const pdfBytes = new Uint8Array(buffer);
+
+ const source = new TextDecoder("latin1").decode(pdfBytes);
+ const pageCounts = [...source.matchAll(/\/Count\s+(\d+)/g)].map(
+ (match) => Number(match[1])
+ );
+ if (pageCounts.length > 0 && Math.max(...pageCounts) === 0) {
+ throw new Error("PDF renderer returned a document with no pages");
+ }
+
+ nextPdfUrl = URL.createObjectURL(
+ new Blob([pdfBytes as BlobPart], { type: "application/pdf" })
+ );
+ } else {
+ const [{ demos }, { renderSerializedDoc }, { serialize }] =
+ await Promise.all([
+ import("@/examples/__index__"),
+ import("@formepdf/core/browser"),
+ import("@formepdf/react"),
+ ]);
+ const Demo = demos.forme[name];
+ if (!Demo) {
+ throw new Error(`Unknown Forme demo: ${name}`);
+ }
+
+ const document = replacePreviewImageSources(
+ serialize(createElement(Demo, { theme }))
+ );
+ const buffer = await renderSerializedDoc(
+ document as unknown as Record<string, unknown>
+ );
+ const pdfBytes = new Uint8Array(buffer);
+
+ const source = new TextDecoder("latin1").decode(pdfBytes);
+ const pageCounts = [...source.matchAll(/\/Count\s+(\d+)/g)].map(
+ (match) => Number(match[1])
+ );
+ if (pageCounts.length > 0 && Math.max(...pageCounts) === 0) {
+ throw new Error("PDF renderer returned a document with no pages");
+ }
+
+ nextPdfUrl = URL.createObjectURL(
+ new Blob([pdfBytes as BlobPart], { type: "application/pdf" })
+ );
}
- nextPdfUrl = URL.createObjectURL(
- new Blob([pdfBytes as BlobPart], { type: "application/pdf" })
- );
if (cancelled) {
URL.revokeObjectURL(nextPdfUrl);
return;
@@ -102,7 +190,7 @@ export const ThemePreview = ({
URL.revokeObjectURL(nextPdfUrl);
}
};
- }, [name, selectedTheme]);
+ }, [base, name, selectedTheme]);
return (
<div className={cn("not-prose", className)}>
@@ -113,7 +201,10 @@ export const ThemePreview = ({
<span className="size-2.5 rounded-full bg-emerald-400" />
</div>
<span className="text-sm text-muted-foreground">document.pdf</span>
- <Select value={selectedTheme} onValueChange={(v) => setSelectedTheme(v as RegistryThemeName)}>
+ <Select
+ value={selectedTheme}
+ onValueChange={(v) => setSelectedTheme(v as RegistryThemeName)}
+ >
<SelectTrigger className="h-8 w-[140px] bg-background text-sm font-medium">
<SelectValue placeholder="Theme" />
</SelectTrigger>
diff --git a/components/ui/select.tsx b/components/ui/select.tsx
index c0dc712..4b83067 100644
--- a/components/ui/select.tsx
+++ b/components/ui/select.tsx
@@ -1,27 +1,27 @@
-"use client"
+"use client";
-import * as React from "react"
-import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
-import { Select as SelectPrimitive } from "radix-ui"
+import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
+import { Select as SelectPrimitive } from "radix-ui";
+import * as React from "react";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
function Select({
...props
}: React.ComponentProps<typeof SelectPrimitive.Root>) {
- return <SelectPrimitive.Root data-slot="select" {...props} />
+ return <SelectPrimitive.Root data-slot="select" {...props} />;
}
function SelectGroup({
...props
}: React.ComponentProps<typeof SelectPrimitive.Group>) {
- return <SelectPrimitive.Group data-slot="select-group" {...props} />
+ return <SelectPrimitive.Group data-slot="select-group" {...props} />;
}
function SelectValue({
...props
}: React.ComponentProps<typeof SelectPrimitive.Value>) {
- return <SelectPrimitive.Value data-slot="select-value" {...props} />
+ return <SelectPrimitive.Value data-slot="select-value" {...props} />;
}
function SelectTrigger({
@@ -30,7 +30,7 @@ function SelectTrigger({
children,
...props
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
- size?: "sm" | "default"
+ size?: "sm" | "default";
}) {
return (
<SelectPrimitive.Trigger
@@ -47,7 +47,7 @@ function SelectTrigger({
<ChevronDownIcon className="size-4 opacity-50" />
</SelectPrimitive.Icon>
</SelectPrimitive.Trigger>
- )
+ );
}
function SelectContent({
@@ -84,7 +84,7 @@ function SelectContent({
<SelectScrollDownButton />
</SelectPrimitive.Content>
</SelectPrimitive.Portal>
- )
+ );
}
function SelectLabel({
@@ -97,7 +97,7 @@ function SelectLabel({
className={cn("px-2 py-1.5 text-xs text-muted-foreground", className)}
{...props}
/>
- )
+ );
}
function SelectItem({
@@ -124,7 +124,7 @@ function SelectItem({
</span>
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
</SelectPrimitive.Item>
- )
+ );
}
function SelectSeparator({
@@ -137,7 +137,7 @@ function SelectSeparator({
className={cn("pointer-events-none -mx-1 my-1 h-px bg-border", className)}
{...props}
/>
- )
+ );
}
function SelectScrollUpButton({
@@ -155,7 +155,7 @@ function SelectScrollUpButton({
>
<ChevronUpIcon className="size-4" />
</SelectPrimitive.ScrollUpButton>
- )
+ );
}
function SelectScrollDownButton({
@@ -173,7 +173,7 @@ function SelectScrollDownButton({
>
<ChevronDownIcon className="size-4" />
</SelectPrimitive.ScrollDownButton>
- )
+ );
}
export {
@@ -187,4 +187,4 @@ export {
SelectSeparator,
SelectTrigger,
SelectValue,
-}
+};
diff --git a/content/docs/meta.json b/content/docs/meta.json
index baf4e7a..90c8dcf 100644
--- a/content/docs/meta.json
+++ b/content/docs/meta.json
@@ -1,4 +1,4 @@
{
"title": "Documentation",
- "pages": ["(root)", "themes", "components", "blocks"]
+ "pages": ["(root)", "themes", "components", "blocks", "theming"]
}
diff --git a/content/docs/themes/forest.mdx b/content/docs/themes/forest.mdx
index 8eb730d..7fafbb2 100644
--- a/content/docs/themes/forest.mdx
+++ b/content/docs/themes/forest.mdx
@@ -3,12 +3,7 @@ title: "Forest"
description: "Natural deep greens, Merriweather headings, earthy and trustworthy."
---
-<ComponentPreview
- base="forme"
- name="invoice-classic"
- theme="forest"
- hideCode
-/>
+<ComponentPreview base="forme" name="invoice-classic" theme="forest" hideCode />
## Installation
@@ -31,10 +26,7 @@ npx shadcn@latest add @pdfcn/theme-forest
<Step>Copy and paste the following code into your project.</Step>
-<ComponentSource
- src="registry/themes/forest.ts"
- title="lib/themes/forest.ts"
-/>
+<ComponentSource src="registry/themes/forest.ts" title="lib/themes/forest.ts" />
<Step>Update the import paths to match your project setup.</Step>
diff --git a/content/docs/themes/meta.json b/content/docs/themes/meta.json
index 7e15d49..71ebeea 100644
--- a/content/docs/themes/meta.json
+++ b/content/docs/themes/meta.json
@@ -1,4 +1,15 @@
{
"title": "Themes",
- "pages": ["---", "professional", "modern", "minimal", "executive", "corporate", "elegant", "vivid", "forest", "blueprint"]
+ "pages": [
+ "---",
+ "professional",
+ "modern",
+ "minimal",
+ "executive",
+ "corporate",
+ "elegant",
+ "vivid",
+ "forest",
+ "blueprint"
+ ]
}
diff --git a/content/docs/themes/modern.mdx b/content/docs/themes/modern.mdx
index b16362f..e5ff45d 100644
--- a/content/docs/themes/modern.mdx
+++ b/content/docs/themes/modern.mdx
@@ -3,12 +3,7 @@ title: "Modern"
description: "All-Helvetica typography, slate-cool neutrals with subtle violet accent."
---
-<ComponentPreview
- base="forme"
- name="invoice-modern"
- theme="modern"
- hideCode
-/>
+<ComponentPreview base="forme" name="invoice-modern" theme="modern" hideCode />
## Installation
@@ -31,10 +26,7 @@ npx shadcn@latest add @pdfcn/theme-modern
<Step>Copy and paste the following code into your project.</Step>
-<ComponentSource
- src="registry/themes/modern.ts"
- title="lib/themes/modern.ts"
-/>
+<ComponentSource src="registry/themes/modern.ts" title="lib/themes/modern.ts" />
<Step>Update the import paths to match your project setup.</Step>
diff --git a/content/docs/themes/vivid.mdx b/content/docs/themes/vivid.mdx
index 287f553..ba6ea2c 100644
--- a/content/docs/themes/vivid.mdx
+++ b/content/docs/themes/vivid.mdx
@@ -3,12 +3,7 @@ title: "Vivid"
description: "Deep violet palette, Nunito rounded sans-serif, playful but professional."
---
-<ComponentPreview
- base="forme"
- name="invoice-creative"
- theme="vivid"
- hideCode
-/>
+<ComponentPreview base="forme" name="invoice-creative" theme="vivid" hideCode />
## Installation
@@ -31,10 +26,7 @@ npx shadcn@latest add @pdfcn/theme-vivid
<Step>Copy and paste the following code into your project.</Step>
-<ComponentSource
- src="registry/themes/vivid.ts"
- title="lib/themes/vivid.ts"
-/>
+<ComponentSource src="registry/themes/vivid.ts" title="lib/themes/vivid.ts" />
<Step>Update the import paths to match your project setup.</Step>
diff --git a/content/docs/theming.mdx b/content/docs/theming/forme/index.mdx
similarity index 78%
rename from content/docs/theming.mdx
rename to content/docs/theming/forme/index.mdx
index e3578cf..f0339ce 100644
--- a/content/docs/theming.mdx
+++ b/content/docs/theming/forme/index.mdx
@@ -1,12 +1,12 @@
---
title: Theming
-description: Configure PDF themes, colors, typography, and spacing.
+description: Configure PDF themes, colors, typography, and spacing for Forme.
---
import { ThemePreview } from "@/components/theme-preview";
import { ThemePreviewGrid } from "@/components/theme-preview-grid";
-<ThemePreview />
+<ThemePreview base="forme" />
## Installation
@@ -61,20 +61,20 @@ export function Invoice() {
All color values must be hex strings (e.g., `#1a1a1a`). React PDF supports hex, `rgb()`, and `hsl()` — but NOT `oklch`.
-| Token | Purpose |
-|-------|---------|
-| `foreground` | Primary text color |
-| `background` | Page background |
-| `muted` | Secondary backgrounds |
-| `mutedForeground` | Captions, footnotes |
-| `primary` | Brand/accent color |
+| Token | Purpose |
+| ------------------- | --------------------------- |
+| `foreground` | Primary text color |
+| `background` | Page background |
+| `muted` | Secondary backgrounds |
+| `mutedForeground` | Captions, footnotes |
+| `primary` | Brand/accent color |
| `primaryForeground` | Text on primary backgrounds |
-| `border` | Table borders, dividers |
-| `accent` | Call-to-action elements |
-| `destructive` | Error states |
-| `success` | Success states |
-| `warning` | Warning states |
-| `info` | Informational states |
+| `border` | Table borders, dividers |
+| `accent` | Call-to-action elements |
+| `destructive` | Error states |
+| `success` | Success states |
+| `warning` | Warning states |
+| `info` | Informational states |
## Primitive Tokens
diff --git a/content/docs/theming/forme/meta.json b/content/docs/theming/forme/meta.json
new file mode 100644
index 0000000..7077a39
--- /dev/null
+++ b/content/docs/theming/forme/meta.json
@@ -0,0 +1,4 @@
+{
+ "title": "Forme",
+ "pages": ["index"]
+}
diff --git a/content/docs/theming/meta.json b/content/docs/theming/meta.json
new file mode 100644
index 0000000..2bcf842
--- /dev/null
+++ b/content/docs/theming/meta.json
@@ -0,0 +1,4 @@
+{
+ "title": "Theming",
+ "pages": ["takumi", "forme"]
+}
diff --git a/content/docs/theming/takumi/index.mdx b/content/docs/theming/takumi/index.mdx
new file mode 100644
index 0000000..97384be
--- /dev/null
+++ b/content/docs/theming/takumi/index.mdx
@@ -0,0 +1,135 @@
+---
+title: Theming
+description: Configure PDF themes, colors, typography, and spacing for Takumi.
+---
+
+import { ThemePreview } from "@/components/theme-preview";
+import { ThemePreviewGrid } from "@/components/theme-preview-grid";
+
+<ThemePreview base="takumi" />
+
+## Installation
+
+<CodeTabs>
+
+<TabsList>
+ <TabsTrigger value="cli">Command</TabsTrigger>
+ <TabsTrigger value="manual">Manual</TabsTrigger>
+</TabsList>
+<TabsContent value="cli">
+
+```bash
+npx shadcn@latest add @pdfcn/theme-provider
+```
+
+</TabsContent>
+<TabsContent value="manual">
+
+<Steps>
+
+<Step>Copy and paste the following code into your project.</Step>
+
+<ComponentSource
+ src="registry/bases/takumi/lib/theme-provider.tsx"
+ title="components/theme-provider.tsx"
+/>
+
+<Step>Update the import paths to match your project setup.</Step>
+
+</Steps>
+
+</TabsContent>
+
+</CodeTabs>
+
+## Usage
+
+```tsx
+import { PdfcnThemeProvider } from "@/registry/bases/takumi/components";
+import { professionalTheme } from "@/registry/themes";
+
+export function Invoice() {
+ return (
+ <PdfcnThemeProvider theme={professionalTheme}>
+ {/* Your PDF content */}
+ </PdfcnThemeProvider>
+ );
+}
+```
+
+## Color Tokens
+
+All color values must be hex strings (e.g., `#1a1a1a`). React PDF supports hex, `rgb()`, and `hsl()` — but NOT `oklch`.
+
+| Token | Purpose |
+| ------------------- | --------------------------- |
+| `foreground` | Primary text color |
+| `background` | Page background |
+| `muted` | Secondary backgrounds |
+| `mutedForeground` | Captions, footnotes |
+| `primary` | Brand/accent color |
+| `primaryForeground` | Text on primary backgrounds |
+| `border` | Table borders, dividers |
+| `accent` | Call-to-action elements |
+| `destructive` | Error states |
+| `success` | Success states |
+| `warning` | Warning states |
+| `info` | Informational states |
+
+## Primitive Tokens
+
+Primitives define the raw design scales available to themes:
+
+- **Typography Scale** — Major Third (1.25) ratio with 12pt base
+- **Spacing Scale** — 4pt grid system
+- **Font Weights** — 400–700
+- **Line Heights** — 1.2–1.6
+- **Border Radius** — 0–8pt
+
+## Custom Themes
+
+Use the `PdfcnTheme` interface to create custom themes while preserving the complete theme shape.
+
+```tsx
+import type { PdfcnTheme } from "@/registry/themes";
+import { defaultPrimitives } from "@/registry/themes";
+
+export const oceanTheme: PdfcnTheme = {
+ name: "ocean",
+ primitives: defaultPrimitives,
+ colors: {
+ foreground: "#0f172a",
+ background: "#ffffff",
+ primary: "#0369a1",
+ accent: "#0ea5e9",
+ muted: "#f1f5f9",
+ border: "#e2e8f0",
+ mutedForeground: "#64748b",
+ primaryForeground: "#ffffff",
+ destructive: "#dc2626",
+ success: "#16a34a",
+ warning: "#d97706",
+ info: "#0ea5e9",
+ },
+ typography: {
+ body: { fontFamily: "Helvetica", fontSize: 11, lineHeight: 1.6 },
+ heading: {
+ fontFamily: "Times-Roman",
+ fontWeight: 700,
+ lineHeight: 1.25,
+ fontSize: { h1: 32, h2: 24, h3: 20, h4: 16, h5: 14, h6: 12 },
+ },
+ },
+ spacing: {
+ page: { marginTop: 56, marginRight: 48, marginBottom: 56, marginLeft: 48 },
+ sectionGap: 28,
+ paragraphGap: 10,
+ componentGap: 14,
+ },
+ page: { size: "A4", orientation: "portrait" },
+};
+```
+
+## Available Themes
+
+<ThemePreviewGrid />
diff --git a/content/docs/theming/takumi/meta.json b/content/docs/theming/takumi/meta.json
new file mode 100644
index 0000000..58c27d0
--- /dev/null
+++ b/content/docs/theming/takumi/meta.json
@@ -0,0 +1,4 @@
+{
+ "title": "Takumi",
+ "pages": ["index"]
+}
diff --git a/lib/docs.ts b/lib/docs.ts
index d3186af..0a3279c 100644
--- a/lib/docs.ts
+++ b/lib/docs.ts
@@ -16,7 +16,10 @@ export const isComponentsFolder = (folder: PageTreeFolder) =>
export const isBlocksFolder = (folder: PageTreeFolder) =>
folder.$id === "blocks" || folder.name === "Blocks";
-export type DocsSidebarPanel = "components" | "blocks";
+export const isThemesFolder = (folder: PageTreeFolder) =>
+ folder.$id === "themes" || folder.name === "Themes";
+
+export type DocsSidebarPanel = "components" | "blocks" | "themes";
const isPathWithin = (pathname: string, route: string) =>
pathname === route || pathname.startsWith(`${route}/`);
@@ -30,6 +33,9 @@ export const getDocsSidebarPanel = (
if (isPathWithin(pathname, ROUTES.DOCS_BLOCKS)) {
return "blocks";
}
+ if (isPathWithin(pathname, ROUTES.DOCS_THEMES)) {
+ return "themes";
+ }
return null;
};
diff --git a/lib/page-tree.ts b/lib/page-tree.ts
index 177fd1c..1bf4154 100644
--- a/lib/page-tree.ts
+++ b/lib/page-tree.ts
@@ -8,6 +8,7 @@ import {
EXCLUDED_SECTIONS,
isBlocksFolder,
isComponentsFolder,
+ isThemesFolder,
} from "@/lib/docs";
import { DEFAULT_BASE } from "@/registry/bases";
@@ -92,7 +93,7 @@ export const getFolderPages = (
export const getCurrentBase = (pathname: string): string => {
const baseScopedMatch = pathname.match(
- /\/docs\/(?:components|blocks)\/([^/]+)(?:\/|$)/
+ /\/docs\/(?:components|blocks|theming)\/([^/]+)(?:\/|$)/
);
if (baseScopedMatch) {
return baseScopedMatch[1];
@@ -155,6 +156,19 @@ export const getTreeGroups = (
pages,
});
}
+ } else if (isThemesFolder(item)) {
+ const pages = getAllPagesFromFolder(item).filter(
+ (page) =>
+ !page.url.endsWith("/themes") && !page.url.endsWith("/themes/")
+ );
+ if (pages.length > 0) {
+ groups.push({
+ label: "Themes",
+ pages,
+ });
+ }
+ } else if (item.$id === "theming" || item.name === "Theming") {
+ // Theming pages are accessed via the Sections nav
} else {
const pages = getFolderPages(item);
if (pages.length > 0) {
diff --git a/next.config.mjs b/next.config.mjs
index 6af5c90..5767a82 100644
--- a/next.config.mjs
+++ b/next.config.mjs
@@ -50,6 +50,11 @@ const nextConfig = {
permanent: true,
source: `${ROUTES.DOCS}/:path*.mdx`,
},
+ {
+ destination: `${ROUTES.DOCS_THEMING}/takumi`,
+ permanent: true,
+ source: ROUTES.DOCS_THEMING,
+ },
];
},
serverExternalPackages: [
diff --git a/registry.json b/registry.json
index a0ff2ec..b7b646d 100644
--- a/registry.json
+++ b/registry.json
@@ -3,10 +3,7 @@
"homepage": "https://pdfcn.vercel.app",
"items": [
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Theme context and helpers for the takumi base",
"files": [
{
@@ -40,10 +37,7 @@
"type": "registry:lib"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Alert PDF component (takumi)",
"files": [
{
@@ -58,17 +52,12 @@
}
],
"name": "takumi/alert",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Alert",
"type": "registry:ui"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Badge PDF component (takumi)",
"files": [
{
@@ -83,17 +72,12 @@
}
],
"name": "takumi/badge",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Badge",
"type": "registry:ui"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Card PDF component (takumi)",
"files": [
{
@@ -108,17 +92,12 @@
}
],
"name": "takumi/card",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Card",
"type": "registry:ui"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Data Table PDF component (takumi)",
"files": [
{
@@ -143,18 +122,12 @@
}
],
"name": "takumi/data-table",
- "registryDependencies": [
- "takumi/utils",
- "takumi/table"
- ],
+ "registryDependencies": ["takumi/utils", "takumi/table"],
"title": "Data Table",
"type": "registry:ui"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Divider PDF component (takumi)",
"files": [
{
@@ -169,17 +142,12 @@
}
],
"name": "takumi/divider",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Divider",
"type": "registry:ui"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Form PDF component (takumi)",
"files": [
{
@@ -204,17 +172,12 @@
}
],
"name": "takumi/form",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Form",
"type": "registry:ui"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Graph PDF component (takumi)",
"files": [
{
@@ -244,17 +207,12 @@
}
],
"name": "takumi/graph",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Graph",
"type": "registry:ui"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Heading PDF component (takumi)",
"files": [
{
@@ -269,17 +227,12 @@
}
],
"name": "takumi/heading",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Heading",
"type": "registry:ui"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Keep Together PDF component (takumi)",
"files": [
{
@@ -294,17 +247,12 @@
}
],
"name": "takumi/keep-together",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Keep Together",
"type": "registry:ui"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Key Value PDF component (takumi)",
"files": [
{
@@ -319,17 +267,12 @@
}
],
"name": "takumi/key-value",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Key Value",
"type": "registry:ui"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Link PDF component (takumi)",
"files": [
{
@@ -344,17 +287,12 @@
}
],
"name": "takumi/link",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Link",
"type": "registry:ui"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "List PDF component (takumi)",
"files": [
{
@@ -379,17 +317,12 @@
}
],
"name": "takumi/list",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "List",
"type": "registry:ui"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Page Break PDF component (takumi)",
"files": [
{
@@ -404,17 +337,12 @@
}
],
"name": "takumi/page-break",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Page Break",
"type": "registry:ui"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Page Footer PDF component (takumi)",
"files": [
{
@@ -429,17 +357,12 @@
}
],
"name": "takumi/page-footer",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Page Footer",
"type": "registry:ui"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Page Header PDF component (takumi)",
"files": [
{
@@ -454,17 +377,12 @@
}
],
"name": "takumi/page-header",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Page Header",
"type": "registry:ui"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Page Number PDF component (takumi)",
"files": [
{
@@ -479,17 +397,12 @@
}
],
"name": "takumi/page-number",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Page Number",
"type": "registry:ui"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Pdf Image PDF component (takumi)",
"files": [
{
@@ -504,18 +417,12 @@
}
],
"name": "takumi/pdf-image",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Pdf Image",
"type": "registry:ui"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers",
- "qrcode"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers", "qrcode"],
"description": "Qrcode PDF component (takumi)",
"files": [
{
@@ -530,17 +437,12 @@
}
],
"name": "takumi/qrcode",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Qrcode",
"type": "registry:ui"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Section PDF component (takumi)",
"files": [
{
@@ -555,17 +457,12 @@
}
],
"name": "takumi/section",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Section",
"type": "registry:ui"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Signature PDF component (takumi)",
"files": [
{
@@ -580,17 +477,12 @@
}
],
"name": "takumi/signature",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Signature",
"type": "registry:ui"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Stack PDF component (takumi)",
"files": [
{
@@ -605,17 +497,12 @@
}
],
"name": "takumi/stack",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Stack",
"type": "registry:ui"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Table PDF component (takumi)",
"files": [
{
@@ -640,17 +527,12 @@
}
],
"name": "takumi/table",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Table",
"type": "registry:ui"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Text PDF component (takumi)",
"files": [
{
@@ -665,17 +547,12 @@
}
],
"name": "takumi/text",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Text",
"type": "registry:ui"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Watermark PDF component (takumi)",
"files": [
{
@@ -690,17 +567,12 @@
}
],
"name": "takumi/watermark",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Watermark",
"type": "registry:ui"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Invoice Classic PDF block (takumi)",
"files": [
{
@@ -715,17 +587,12 @@
}
],
"name": "takumi/invoice-classic",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Invoice Classic",
"type": "registry:block"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Invoice Consultant PDF block (takumi)",
"files": [
{
@@ -740,17 +607,12 @@
}
],
"name": "takumi/invoice-consultant",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Invoice Consultant",
"type": "registry:block"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Invoice Corporate PDF block (takumi)",
"files": [
{
@@ -765,17 +627,12 @@
}
],
"name": "takumi/invoice-corporate",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Invoice Corporate",
"type": "registry:block"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Invoice Creative PDF block (takumi)",
"files": [
{
@@ -790,17 +647,12 @@
}
],
"name": "takumi/invoice-creative",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Invoice Creative",
"type": "registry:block"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Invoice Minimal PDF block (takumi)",
"files": [
{
@@ -815,17 +667,12 @@
}
],
"name": "takumi/invoice-minimal",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Invoice Minimal",
"type": "registry:block"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Invoice Modern PDF block (takumi)",
"files": [
{
@@ -840,17 +687,12 @@
}
],
"name": "takumi/invoice-modern",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Invoice Modern",
"type": "registry:block"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Report Financial PDF block (takumi)",
"files": [
{
@@ -870,17 +712,12 @@
}
],
"name": "takumi/report-financial",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Report Financial",
"type": "registry:block"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Report Marketing PDF block (takumi)",
"files": [
{
@@ -900,17 +737,12 @@
}
],
"name": "takumi/report-marketing",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Report Marketing",
"type": "registry:block"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Report Operations PDF block (takumi)",
"files": [
{
@@ -930,17 +762,12 @@
}
],
"name": "takumi/report-operations",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Report Operations",
"type": "registry:block"
},
{
- "dependencies": [
- "takumi-pdf",
- "@takumi-rs/helpers"
- ],
+ "dependencies": ["takumi-pdf", "@takumi-rs/helpers"],
"description": "Report Security PDF block (takumi)",
"files": [
{
@@ -960,9 +787,7 @@
}
],
"name": "takumi/report-security",
- "registryDependencies": [
- "takumi/utils"
- ],
+ "registryDependencies": ["takumi/utils"],
"title": "Report Security",
"type": "registry:block"
},
@@ -1174,10 +999,7 @@
"type": "registry:theme"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Theme context and helpers for the forme base",
"files": [
{
@@ -1216,10 +1038,7 @@
"type": "registry:lib"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Alert PDF component (forme)",
"files": [
{
@@ -1234,17 +1053,12 @@
}
],
"name": "forme/alert",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Alert",
"type": "registry:ui"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Badge PDF component (forme)",
"files": [
{
@@ -1259,17 +1073,12 @@
}
],
"name": "forme/badge",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Badge",
"type": "registry:ui"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Card PDF component (forme)",
"files": [
{
@@ -1284,17 +1093,12 @@
}
],
"name": "forme/card",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Card",
"type": "registry:ui"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Data Table PDF component (forme)",
"files": [
{
@@ -1319,18 +1123,12 @@
}
],
"name": "forme/data-table",
- "registryDependencies": [
- "forme/utils",
- "forme/table"
- ],
+ "registryDependencies": ["forme/utils", "forme/table"],
"title": "Data Table",
"type": "registry:ui"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Divider PDF component (forme)",
"files": [
{
@@ -1345,17 +1143,12 @@
}
],
"name": "forme/divider",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Divider",
"type": "registry:ui"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Form PDF component (forme)",
"files": [
{
@@ -1380,17 +1173,12 @@
}
],
"name": "forme/form",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Form",
"type": "registry:ui"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Graph PDF component (forme)",
"files": [
{
@@ -1420,17 +1208,12 @@
}
],
"name": "forme/graph",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Graph",
"type": "registry:ui"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Heading PDF component (forme)",
"files": [
{
@@ -1445,17 +1228,12 @@
}
],
"name": "forme/heading",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Heading",
"type": "registry:ui"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Keep Together PDF component (forme)",
"files": [
{
@@ -1470,17 +1248,12 @@
}
],
"name": "forme/keep-together",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Keep Together",
"type": "registry:ui"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Key Value PDF component (forme)",
"files": [
{
@@ -1495,17 +1268,12 @@
}
],
"name": "forme/key-value",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Key Value",
"type": "registry:ui"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Link PDF component (forme)",
"files": [
{
@@ -1520,17 +1288,12 @@
}
],
"name": "forme/link",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Link",
"type": "registry:ui"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "List PDF component (forme)",
"files": [
{
@@ -1555,17 +1318,12 @@
}
],
"name": "forme/list",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "List",
"type": "registry:ui"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Page Break PDF component (forme)",
"files": [
{
@@ -1580,17 +1338,12 @@
}
],
"name": "forme/page-break",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Page Break",
"type": "registry:ui"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Page Footer PDF component (forme)",
"files": [
{
@@ -1605,17 +1358,12 @@
}
],
"name": "forme/page-footer",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Page Footer",
"type": "registry:ui"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Page Header PDF component (forme)",
"files": [
{
@@ -1630,17 +1378,12 @@
}
],
"name": "forme/page-header",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Page Header",
"type": "registry:ui"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Page Number PDF component (forme)",
"files": [
{
@@ -1655,17 +1398,12 @@
}
],
"name": "forme/page-number",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Page Number",
"type": "registry:ui"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Pdf Image PDF component (forme)",
"files": [
{
@@ -1680,18 +1418,12 @@
}
],
"name": "forme/pdf-image",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Pdf Image",
"type": "registry:ui"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core",
- "qrcode"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core", "qrcode"],
"description": "Qrcode PDF component (forme)",
"files": [
{
@@ -1706,17 +1438,12 @@
}
],
"name": "forme/qrcode",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Qrcode",
"type": "registry:ui"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Section PDF component (forme)",
"files": [
{
@@ -1731,17 +1458,12 @@
}
],
"name": "forme/section",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Section",
"type": "registry:ui"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Signature PDF component (forme)",
"files": [
{
@@ -1756,17 +1478,12 @@
}
],
"name": "forme/signature",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Signature",
"type": "registry:ui"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Stack PDF component (forme)",
"files": [
{
@@ -1781,17 +1498,12 @@
}
],
"name": "forme/stack",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Stack",
"type": "registry:ui"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Table PDF component (forme)",
"files": [
{
@@ -1816,17 +1528,12 @@
}
],
"name": "forme/table",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Table",
"type": "registry:ui"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Text PDF component (forme)",
"files": [
{
@@ -1841,17 +1548,12 @@
}
],
"name": "forme/text",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Text",
"type": "registry:ui"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Watermark PDF component (forme)",
"files": [
{
@@ -1866,17 +1568,12 @@
}
],
"name": "forme/watermark",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Watermark",
"type": "registry:ui"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Invoice Classic PDF block (forme)",
"files": [
{
@@ -1891,17 +1588,12 @@
}
],
"name": "forme/invoice-classic",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Invoice Classic",
"type": "registry:block"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Invoice Consultant PDF block (forme)",
"files": [
{
@@ -1916,17 +1608,12 @@
}
],
"name": "forme/invoice-consultant",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Invoice Consultant",
"type": "registry:block"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Invoice Corporate PDF block (forme)",
"files": [
{
@@ -1941,17 +1628,12 @@
}
],
"name": "forme/invoice-corporate",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Invoice Corporate",
"type": "registry:block"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Invoice Creative PDF block (forme)",
"files": [
{
@@ -1966,17 +1648,12 @@
}
],
"name": "forme/invoice-creative",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Invoice Creative",
"type": "registry:block"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Invoice Minimal PDF block (forme)",
"files": [
{
@@ -1991,17 +1668,12 @@
}
],
"name": "forme/invoice-minimal",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Invoice Minimal",
"type": "registry:block"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Invoice Modern PDF block (forme)",
"files": [
{
@@ -2016,17 +1688,12 @@
}
],
"name": "forme/invoice-modern",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Invoice Modern",
"type": "registry:block"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Report Financial PDF block (forme)",
"files": [
{
@@ -2046,17 +1713,12 @@
}
],
"name": "forme/report-financial",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Report Financial",
"type": "registry:block"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Report Marketing PDF block (forme)",
"files": [
{
@@ -2076,17 +1738,12 @@
}
],
"name": "forme/report-marketing",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Report Marketing",
"type": "registry:block"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Report Operations PDF block (forme)",
"files": [
{
@@ -2106,17 +1763,12 @@
}
],
"name": "forme/report-operations",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Report Operations",
"type": "registry:block"
},
{
- "dependencies": [
- "@formepdf/react",
- "@formepdf/core"
- ],
+ "dependencies": ["@formepdf/react", "@formepdf/core"],
"description": "Report Security PDF block (forme)",
"files": [
{
@@ -2136,12 +1788,10 @@
}
],
"name": "forme/report-security",
- "registryDependencies": [
- "forme/utils"
- ],
+ "registryDependencies": ["forme/utils"],
"title": "Report Security",
"type": "registry:block"
}
],
"name": "pdfcn"
-}
\ No newline at end of file
+}
diff --git a/registry/bases/forme/lib/themes.ts b/registry/bases/forme/lib/themes.ts
index 94e0aaa..4f0a9f3 100644
--- a/registry/bases/forme/lib/themes.ts
+++ b/registry/bases/forme/lib/themes.ts
@@ -1,7 +1,4 @@
-export type {
- PDFComponentProps,
- Style,
-} from "@/registry/themes";
+export type { PDFComponentProps, Style } from "@/registry/themes";
export type {
PdfcnTheme,
PrimitiveTokens,
diff --git a/registry/bases/takumi/lib/themes.ts b/registry/bases/takumi/lib/themes.ts
index 94e0aaa..4f0a9f3 100644
--- a/registry/bases/takumi/lib/themes.ts
+++ b/registry/bases/takumi/lib/themes.ts
@@ -1,7 +1,4 @@
-export type {
- PDFComponentProps,
- Style,
-} from "@/registry/themes";
+export type { PDFComponentProps, Style } from "@/registry/themes";
export type {
PdfcnTheme,
PrimitiveTokens,
diff --git a/registry/config.ts b/registry/config.ts
index 3f586a7..fcf3fd3 100644
--- a/registry/config.ts
+++ b/registry/config.ts
@@ -3,10 +3,7 @@ import { z } from "zod";
import { BASE_NAMES, BASES, DEFAULT_BASE } from "@/registry/bases";
import type { Base, BaseName } from "@/registry/bases";
import { THEME_NAMES, THEMES } from "@/registry/themes";
-import type {
- RegistryTheme,
- RegistryThemeName,
-} from "@/registry/themes";
+import type { RegistryTheme, RegistryThemeName } from "@/registry/themes";
export { BASES, type Base, type BaseName, DEFAULT_BASE };
export { THEMES, type RegistryTheme, type RegistryThemeName };