Beautiful pdf components, built on Takumi and Forme. 100% Free, Zero config, one command setup.
feat(registry): add event-ticket, gift-certificate, medical-intake-form and shipping-label blocks for forme (#50)
Aniket Pawar46384aaca8ac
diff --git a/apps/web/components/web-mcp/pdf-tool.tsx b/apps/web/components/web-mcp/pdf-tool.tsxindex ea4220a..f77111f 100644--- a/apps/web/components/web-mcp/pdf-tool.tsx+++ b/apps/web/components/web-mcp/pdf-tool.tsx@@ -5,12 +5,15 @@ import { useWebMCP } from "use-webmcp-tool";import { SITE } from "@/constants/site";const BLOCK_NAMES = [+ "event-ticket",+ "gift-certificate","invoice-classic","invoice-consultant","invoice-corporate","invoice-creative","invoice-minimal","invoice-modern",+ "medical-intake-form","meeting-minutes","packing-slip","press-release",@@ -18,6 +21,7 @@ const BLOCK_NAMES = ["report-marketing","report-operations","report-security",+ "shipping-label",];export const GeneratePdfTool = () => {diff --git a/apps/web/content/docs/blocks/forme/event-ticket.mdx b/apps/web/content/docs/blocks/forme/event-ticket.mdxnew file mode 100644index 0000000..7cc4bc7--- /dev/null+++ b/apps/web/content/docs/blocks/forme/event-ticket.mdx@@ -0,0 +1,152 @@+---+title: "Event Ticket"+description: "Print-ready event admission ticket with event details, seat info, QR code scan-in area, and branding strip."+---++<ComponentPreview base="forme" name="event-ticket" hideCode />++## Installation++<CodeTabs>++<TabsList>+ <TabsTrigger value="cli">Command</TabsTrigger>+ <TabsTrigger value="manual">Manual</TabsTrigger>+</TabsList>++<TabsContent value="cli">++```bash+npx shadcn@latest add @pdfcn/forme/event-ticket+```++</TabsContent>++<TabsContent value="manual">++<Steps>++<Step>Install the following dependencies:</Step>++```bash+npm install @formepdf/react @formepdf/core qrcode+```++<Step>Copy and paste the following code into your project.</Step>++<ComponentSource+ src="registry/bases/forme/blocks/event-ticket/event-ticket.tsx"+ base="forme"+ title="components/pdf/blocks/event-ticket/event-ticket.tsx"+/>++<ComponentSource+ src="registry/bases/forme/blocks/event-ticket/event-ticket.types.ts"+ base="forme"+ title="components/pdf/blocks/event-ticket/event-ticket.types.ts"+/>++<ComponentSource+ src="registry/bases/forme/components/theme-provider.tsx"+ base="forme"+ title="components/pdf/theme-provider.tsx"+/>++<ComponentSource+ src="registry/bases/forme/lib/resolve-color.ts"+ base="forme"+ title="lib/resolve-color.ts"+/>++<ComponentSource+ src="registry/bases/forme/lib/pdf-primitives.tsx"+ base="forme"+ title="lib/pdf-primitives.tsx"+/>++<ComponentSource+ src="registry/bases/forme/lib/pdf-svg.tsx"+ base="forme"+ title="lib/pdf-svg.tsx"+/>++<ComponentSource+ src="registry/themes/professional.ts"+ base="forme"+ title="lib/pdf-themes/professional.ts"+/>++<ComponentSource+ src="registry/themes/primitives.ts"+ base="forme"+ title="lib/pdf-themes/primitives.ts"+/>++<ComponentSource+ src="registry/types/pdf-themes.ts"+ base="forme"+ title="types/pdf-themes.ts"+/>++<ComponentSource+ src="registry/types/pdf-components.ts"+ base="forme"+ title="types/pdf-components.ts"+/>++<Step>Update the import paths to match your project setup.</Step>++</Steps>++</TabsContent>++</CodeTabs>++## Usage++```tsx+import { EventTicketDocument } from "@/components/pdf/event-ticket";+```++```tsx+<EventTicketDocument+ data={{+ eventName: "ShadCN Labs Conf",+ eventDate: "May 15, 2026",+ eventTime: "9:00 AM",+ venue: "Convention Center",+ address: "123 Main St, Las Vegas, NV",+ doorsOpen: "8:00 AM",+ ticketType: "VIP",+ ticketNumber: "TKT-00142",+ seat: { section: "A", row: "3", number: "12" },+ organizer: "ShadCN Labs",+ socialLinks: [+ { platform: "X", url: "x.com/shadcn" },+ { platform: "Instagram", url: "instagram.com/shadcn" },+ ],+ accentColor: "#52525b",+ }}+/>+```++### With a pre-rendered QR image++Provide `qrCodeUrl` to render an image instead of the generated QR code:++```tsx+<EventTicketDocument+ data={{+ // ...+ ticketNumber: "TKT-00142",+ qrCodeUrl: "https://example.com/qr/TKT-00142.png",+ }}+/>+```++## Props++| Prop | Type | Description |+| ------- | ----------------- | -------------------------------------------------------------------------------- |+| `data` | `EventTicketData` | Ticket content: event, venue, times, seat, ticket type/number, and footer fields |+| `theme` | `PdfcnTheme` | Optional theme override |diff --git a/apps/web/content/docs/blocks/forme/gift-certificate.mdx b/apps/web/content/docs/blocks/forme/gift-certificate.mdxnew file mode 100644index 0000000..ca75ae3--- /dev/null+++ b/apps/web/content/docs/blocks/forme/gift-certificate.mdx@@ -0,0 +1,107 @@+---+title: "Gift Certificate"+description: "Printable gift certificate template with decorative styling."+---++<ComponentPreview base="forme" name="gift-certificate" hideCode />++## Installation++<CodeTabs>++<TabsList>+ <TabsTrigger value="cli">Command</TabsTrigger>+ <TabsTrigger value="manual">Manual</TabsTrigger>+</TabsList>++<TabsContent value="cli">++```bash+npx shadcn@latest add @pdfcn/forme/gift-certificate+```++</TabsContent>++<TabsContent value="manual">++<Steps>++<Step>Install the following dependencies:</Step>++```bash+npm install @formepdf/react @formepdf/core+```++<Step>Copy and paste the following code into your project.</Step>++<ComponentSource+ src="registry/bases/forme/blocks/gift-certificate/gift-certificate.tsx"+ base="forme"+ title="components/pdf/blocks/gift-certificate/gift-certificate.tsx"+/>++<ComponentSource+ src="registry/bases/forme/blocks/gift-certificate/gift-certificate.types.ts"+ base="forme"+ title="components/pdf/blocks/gift-certificate/gift-certificate.types.ts"+/>++<ComponentSource+ src="registry/bases/forme/components/theme-provider.tsx"+ base="forme"+ title="components/pdf/theme-provider.tsx"+/>++<ComponentSource+ src="registry/bases/forme/lib/resolve-color.ts"+ base="forme"+ title="lib/resolve-color.ts"+/>++<ComponentSource+ src="registry/bases/forme/lib/pdf-primitives.tsx"+ base="forme"+ title="lib/pdf-primitives.tsx"+/>++<ComponentSource+ src="registry/themes/professional.ts"+ base="forme"+ title="lib/pdf-themes/professional.ts"+/>++<ComponentSource+ src="registry/themes/primitives.ts"+ base="forme"+ title="lib/pdf-themes/primitives.ts"+/>++<ComponentSource+ src="registry/types/pdf-themes.ts"+ base="forme"+ title="types/pdf-themes.ts"+/>++<ComponentSource+ src="registry/types/pdf-components.ts"+ base="forme"+ title="types/pdf-components.ts"+/>++<Step>Update the import paths to match your project setup.</Step>++</Steps>++</TabsContent>++</CodeTabs>++## Usage++```tsx+import { GiftCertificateDocument } from "@/components/pdf/gift-certificate";+```++```tsx+<GiftCertificateDocument />+```diff --git a/apps/web/content/docs/blocks/forme/medical-intake-form.mdx b/apps/web/content/docs/blocks/forme/medical-intake-form.mdxnew file mode 100644index 0000000..3dcef0d--- /dev/null+++ b/apps/web/content/docs/blocks/forme/medical-intake-form.mdx@@ -0,0 +1,152 @@+---+title: "Medical Intake Form"+description: "Printable patient intake and registration form with personal, insurance, medical history, and consent sections."+---++<ComponentPreview base="forme" name="medical-intake-form" hideCode />++## Installation++<CodeTabs>++<TabsList>+ <TabsTrigger value="cli">Command</TabsTrigger>+ <TabsTrigger value="manual">Manual</TabsTrigger>+</TabsList>++<TabsContent value="cli">++```bash+npx shadcn@latest add @pdfcn/forme/medical-intake-form+```++</TabsContent>++<TabsContent value="manual">++<Steps>++<Step>Install the following dependencies:</Step>++```bash+npm install @formepdf/react @formepdf/core+```++<Step>Copy and paste the following code into your project.</Step>++<ComponentSource+ src="registry/bases/forme/blocks/medical-intake-form/medical-intake-form.tsx"+ base="forme"+ title="components/pdf/blocks/medical-intake-form/medical-intake-form.tsx"+/>++<ComponentSource+ src="registry/bases/forme/blocks/medical-intake-form/medical-intake-form.types.ts"+ base="forme"+ title="components/pdf/blocks/medical-intake-form/medical-intake-form.types.ts"+/>++<ComponentSource+ src="registry/bases/forme/components/theme-provider.tsx"+ base="forme"+ title="components/pdf/theme-provider.tsx"+/>++<ComponentSource+ src="registry/bases/forme/lib/resolve-color.ts"+ base="forme"+ title="lib/resolve-color.ts"+/>++<ComponentSource+ src="registry/bases/forme/lib/pdf-primitives.tsx"+ base="forme"+ title="lib/pdf-primitives.tsx"+/>++<ComponentSource+ src="registry/themes/professional.ts"+ base="forme"+ title="lib/pdf-themes/professional.ts"+/>++<ComponentSource+ src="registry/themes/primitives.ts"+ base="forme"+ title="lib/pdf-themes/primitives.ts"+/>++<ComponentSource+ src="registry/types/pdf-themes.ts"+ base="forme"+ title="types/pdf-themes.ts"+/>++<ComponentSource+ src="registry/types/pdf-components.ts"+ base="forme"+ title="types/pdf-components.ts"+/>++<Step>Update the import paths to match your project setup.</Step>++</Steps>++</TabsContent>++</CodeTabs>++## Usage++```tsx+import { MedicalIntakeFormDocument } from "@/components/pdf/blocks/medical-intake-form/medical-intake-form";+```++```tsx+<MedicalIntakeFormDocument+ clinicName="Sunrise Family Medicine"+ clinicAddress="200 Health Plaza, Denver, CO 80202"+ clinicPhone="(303) 555-0180"+ accentColor="#0d9488"+/>+```++## Sections++Every section is rendered by default and can be hidden by setting its prop to `false`.++```tsx+<MedicalIntakeFormDocument+ clinicName="Sunrise Family Medicine"+ personalInfo+ emergencyContact+ insurance+ medicalHistory+ medications+ allergies+ reasonForVisit+ consent+/>+```++| Prop | Section |+| ------------------ | ------------------------------------------------------------- |+| `personalInfo` | Name, date of birth, gender, phone, email, and address fields |+| `emergencyContact` | Contact name, relationship, and phone fields |+| `insurance` | Provider, policy, group, and subscriber fields |+| `medicalHistory` | Condition checklist with allergy and medication prompts |+| `medications` | Medication, dosage, frequency, and prescribing doctor table |+| `allergies` | Allergen, reaction, and severity table |+| `reasonForVisit` | Free-text area for symptoms and reason for the visit |+| `consent` | HIPAA authorization, treatment consent, and signature lines |++## Props++| Prop | Type | Description |+| --------------- | ------------ | ----------------------------------------------------------- |+| `clinicName` | `string` | Clinic name shown in the header and consent text |+| `clinicLogo` | `string` | Optional logo image source |+| `clinicAddress` | `string` | Address shown in the header and footer |+| `clinicPhone` | `string` | Phone number shown in the header and footer |+| `accentColor` | `string` | Theme token or CSS color used for section rules and accents |+| `theme` | `PdfcnTheme` | Theme override for the whole document |diff --git a/apps/web/content/docs/blocks/forme/meta.json b/apps/web/content/docs/blocks/forme/meta.jsonindex 08e258e..fc484b0 100644--- a/apps/web/content/docs/blocks/forme/meta.json+++ b/apps/web/content/docs/blocks/forme/meta.json@@ -2,19 +2,23 @@"pages": ["index","event-agenda",+ "event-ticket",+ "gift-certificate","invoice-classic","invoice-consultant","invoice-corporate","invoice-creative","invoice-minimal","invoice-modern",+ "medical-intake-form","meeting-minutes","packing-slip","press-release","report-financial","report-marketing","report-operations",- "report-security"+ "report-security",+ "shipping-label"],"title": "Forme"}diff --git a/apps/web/content/docs/blocks/forme/shipping-label.mdx b/apps/web/content/docs/blocks/forme/shipping-label.mdxnew file mode 100644index 0000000..d6fc802--- /dev/null+++ b/apps/web/content/docs/blocks/forme/shipping-label.mdx@@ -0,0 +1,165 @@+---+title: "Shipping Label"+description: "Print-ready 4x6 shipping label with sender, recipient, barcode area, and carrier info."+---++<ComponentPreview base="forme" name="shipping-label" hideCode />++## Installation++<CodeTabs>++<TabsList>+ <TabsTrigger value="cli">Command</TabsTrigger>+ <TabsTrigger value="manual">Manual</TabsTrigger>+</TabsList>++<TabsContent value="cli">++```bash+npx shadcn@latest add @pdfcn/forme/shipping-label+```++</TabsContent>++<TabsContent value="manual">++<Steps>++<Step>Install the following dependencies:</Step>++```bash+npm install @formepdf/react @formepdf/core qrcode+```++<Step>Copy and paste the following code into your project.</Step>++<ComponentSource+ src="registry/bases/forme/blocks/shipping-label/shipping-label.tsx"+ base="forme"+ title="components/pdf/blocks/shipping-label/shipping-label.tsx"+/>++<ComponentSource+ src="registry/bases/forme/components/qrcode/qrcode.tsx"+ base="forme"+ title="components/pdf/qrcode/qrcode.tsx"+/>++<ComponentSource+ src="registry/bases/forme/components/text/text.tsx"+ base="forme"+ title="components/pdf/text/text.tsx"+/>++<ComponentSource+ src="registry/bases/forme/components/theme-provider.tsx"+ base="forme"+ title="components/pdf/theme-provider.tsx"+/>++<ComponentSource+ src="registry/bases/forme/lib/pdf-primitives.tsx"+ base="forme"+ title="lib/pdf-primitives.tsx"+/>++<ComponentSource+ src="registry/bases/forme/lib/pdf-svg.tsx"+ base="forme"+ title="lib/pdf-svg.tsx"+/>++<ComponentSource+ src="registry/bases/forme/lib/resolve-color.ts"+ base="forme"+ title="lib/resolve-color.ts"+/>++<ComponentSource+ src="registry/themes/professional.ts"+ base="forme"+ title="lib/pdf-themes/professional.ts"+/>++<ComponentSource+ src="registry/themes/primitives.ts"+ base="forme"+ title="lib/pdf-themes/primitives.ts"+/>++<ComponentSource+ src="registry/types/pdf-themes.ts"+ base="forme"+ title="types/pdf-themes.ts"+/>++<ComponentSource+ src="registry/types/pdf-components.ts"+ base="forme"+ title="types/pdf-components.ts"+/>++<Step>Update the import paths to match your project setup.</Step>++</Steps>++</TabsContent>++</CodeTabs>++## Usage++```tsx+import { ShippingLabelDocument } from "@/components/pdf/shipping-label";+```++```tsx+<ShippingLabelDocument+ data={{+ carrier: "UPS",+ serviceLevel: "Ground",+ trackingNumber: "1Z999AA10123456784",+ from: {+ name: "Acme Warehouse",+ address: "100 Industrial Blvd",+ city: "Seattle",+ state: "WA",+ zip: "98101",+ },+ to: {+ name: "Jane Doe",+ address: "456 Oak Ave, Apt 12",+ city: "Portland",+ state: "OR",+ zip: "97201",+ phone: "(503) 555-0142",+ },+ weight: "4.2 lbs",+ dimensions: '12" x 8" x 6"',+ handlingLabels: ["FRAGILE"],+ accentColor: "#1d4ed8",+ }}+/>+```++### With a carrier barcode image++Provide `barcodeUrl` to render a full-width barcode image instead of the QR code:++```tsx+<ShippingLabelDocument+ data={{+ // ...+ trackingNumber: "1Z999AA10123456784",+ barcodeUrl: "https://example.com/barcodes/1Z999AA10123456784.png",+ }}+/>+```++## Props++| Prop | Type | Description |+| ------- | ------------------- | ---------------------------------------------------------------- |+| `data` | `ShippingLabelData` | Label content: addresses, carrier, tracking, and package details |+| `theme` | `PdfcnTheme` | Optional theme override |diff --git a/apps/web/examples/__index__.ts b/apps/web/examples/__index__.tsindex 0c76a38..6a253f8 100644--- a/apps/web/examples/__index__.ts+++ b/apps/web/examples/__index__.ts@@ -6,7 +6,9 @@ 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_event_agenda from "@/examples/forme/event-agenda";+import forme_event_ticket from "@/examples/forme/event-ticket";import forme_form from "@/examples/forme/form";+import forme_gift_certificate from "@/examples/forme/gift-certificate";import forme_graph from "@/examples/forme/graph";import forme_heading from "@/examples/forme/heading";import forme_invoice_classic from "@/examples/forme/invoice-classic";@@ -19,6 +21,7 @@ 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_medical_intake_form from "@/examples/forme/medical-intake-form";import forme_meeting_minutes from "@/examples/forme/meeting-minutes";import forme_packing_slip from "@/examples/forme/packing-slip";import forme_page_break from "@/examples/forme/page-break";@@ -33,6 +36,7 @@ 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_shipping_label from "@/examples/forme/shipping-label";import forme_signature from "@/examples/forme/signature";import forme_stack from "@/examples/forme/stack";import forme_table from "@/examples/forme/table";@@ -92,7 +96,9 @@ export const demos: Record<BaseName, DemoMap> = {"data-table": forme_data_table,divider: forme_divider,"event-agenda": forme_event_agenda,+ "event-ticket": forme_event_ticket,form: forme_form,+ "gift-certificate": forme_gift_certificate,graph: forme_graph,heading: forme_heading,"invoice-classic": forme_invoice_classic,@@ -105,6 +111,7 @@ export const demos: Record<BaseName, DemoMap> = {"key-value": forme_key_value,link: forme_link,list: forme_list,+ "medical-intake-form": forme_medical_intake_form,"meeting-minutes": forme_meeting_minutes,"packing-slip": forme_packing_slip,"page-break": forme_page_break,@@ -119,6 +126,7 @@ export const demos: Record<BaseName, DemoMap> = {"report-operations": forme_report_operations,"report-security": forme_report_security,section: forme_section,+ "shipping-label": forme_shipping_label,signature: forme_signature,stack: forme_stack,table: forme_table,diff --git a/apps/web/examples/forme/event-ticket.tsx b/apps/web/examples/forme/event-ticket.tsxnew file mode 100644index 0000000..a120ee1--- /dev/null+++ b/apps/web/examples/forme/event-ticket.tsx@@ -0,0 +1,4 @@+import { EventTicketDocument } from "@/registry/bases/forme/blocks/event-ticket/event-ticket";++const Demo = () => <EventTicketDocument />;+export default Demo;diff --git a/apps/web/examples/forme/gift-certificate.tsx b/apps/web/examples/forme/gift-certificate.tsxnew file mode 100644index 0000000..722ee73--- /dev/null+++ b/apps/web/examples/forme/gift-certificate.tsx@@ -0,0 +1,4 @@+import { GiftCertificateDocument } from "@/registry/bases/forme/blocks/gift-certificate/gift-certificate";++const Demo = () => <GiftCertificateDocument />;+export default Demo;diff --git a/apps/web/examples/forme/medical-intake-form.tsx b/apps/web/examples/forme/medical-intake-form.tsxnew file mode 100644index 0000000..5294011--- /dev/null+++ b/apps/web/examples/forme/medical-intake-form.tsx@@ -0,0 +1,11 @@+import { MedicalIntakeFormDocument } from "@/registry/bases/forme/blocks/medical-intake-form/medical-intake-form";++const Demo = () => (+ <MedicalIntakeFormDocument+ accentColor="#0d9488"+ clinicAddress="200 Health Plaza, Denver, CO 80202"+ clinicName="Sunrise Family Medicine"+ clinicPhone="(303) 555-0180"+ />+);+export default Demo;diff --git a/apps/web/examples/forme/shipping-label.tsx b/apps/web/examples/forme/shipping-label.tsxnew file mode 100644index 0000000..b4da46b--- /dev/null+++ b/apps/web/examples/forme/shipping-label.tsx@@ -0,0 +1,4 @@+import { ShippingLabelDocument } from "@/registry/bases/forme/blocks/shipping-label/shipping-label";++const Demo = () => <ShippingLabelDocument />;+export default Demo;diff --git a/apps/web/public/r/forme/event-ticket.json b/apps/web/public/r/forme/event-ticket.jsonnew file mode 100644index 0000000..eaaa2cb--- /dev/null+++ b/apps/web/public/r/forme/event-ticket.json@@ -0,0 +1,32 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "forme/event-ticket",+ "title": "Event Ticket",+ "description": "Event Ticket PDF block (forme)",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core",+ "qrcode"+ ],+ "registryDependencies": [+ "@pdfcn/forme/pdf-image",+ "@pdfcn/forme/qrcode",+ "@pdfcn/forme/text",+ "@pdfcn/forme/utils"+ ],+ "files": [+ {+ "path": "registry/bases/forme/blocks/event-ticket/event-ticket.tsx",+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport { PdfImage } from \"@/registry/bases/forme/components/pdf-image/pdf-image\";\nimport { PdfQRCode } from \"@/registry/bases/forme/components/qrcode/qrcode\";\nimport { Text } from \"@/registry/bases/forme/components/text/text\";\nimport {\n PdfcnThemeProvider,\n usePdfcnTheme,\n} from \"@/registry/bases/forme/components/theme-provider\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-themes\";\n\nimport type { EventTicketData } from \"./event-ticket.types\";\n\n// Sample data — replace with your own props or data source\nconst sampleData: EventTicketData = {\n accentColor: \"#52525b\",\n address: \"123 Main St, Las Vegas, NV\",\n doorsOpen: \"8:00 AM\",\n eventDate: \"May 15, 2026\",\n eventName: \"ShadCN Labs Conf\",\n eventTime: \"9:00 AM\",\n logoUrl: \"/favicon.png\",\n organizer: \"ShadCN Labs\",\n seat: { number: \"12\", row: \"3\", section: \"A\" },\n socialLinks: [\n { platform: \"X\", url: \"x.com/shadcn\" },\n { platform: \"Instagram\", url: \"instagram.com/shadcn\" },\n ],\n terms: \"Ticket is non-transferable. All sales final. No re-entry.\",\n ticketNumber: \"TKT-00142\",\n ticketType: \"VIP\",\n venue: \"Convention Center\",\n};\n\n// Standard event ticket, 7\" x 3.5\", expressed in PDF points (72 dpi)\nconst TICKET_SIZE = { height: 252, width: 504 };\n\nconst STUB_WIDTH = 120;\n\nconst STRIPE_WIDTH = 8;\n\nconst NOTCH_RADIUS = 8;\n\n// Forme renders neither dashed borders nor dashed SVG strokes, so the\n// perforation is painted as a stack of short dashes along the stub seam.\nconst PERFORATION_WIDTH = 1.5;\n\nconst PERFORATION_DASH = 4;\n\nconst PERFORATION_GAP = 3;\n\nconst perforationOffsets: number[] = [];\nfor (\n let offset = 0;\n offset < TICKET_SIZE.height;\n offset += PERFORATION_DASH + PERFORATION_GAP\n) {\n perforationOffsets.push(offset);\n}\n\nconst hexRgb = (color: string): [number, number, number] | null => {\n const hex = color.trim().replace(/^#/, \"\");\n\n if (/^[0-9a-f]{3}$/i.test(hex)) {\n return [\n Number.parseInt(hex[0] + hex[0], 16),\n Number.parseInt(hex[1] + hex[1], 16),\n Number.parseInt(hex[2] + hex[2], 16),\n ];\n }\n\n if (/^[0-9a-f]{6}([0-9a-f]{2})?$/i.test(hex)) {\n return [\n Number.parseInt(hex.slice(0, 2), 16),\n Number.parseInt(hex.slice(2, 4), 16),\n Number.parseInt(hex.slice(4, 6), 16),\n ];\n }\n\n return null;\n};\n\nconst inkOnAccent = (accent: string, light: string, dark: string) => {\n const rgb = hexRgb(accent);\n\n if (!rgb) {\n return dark;\n }\n\n const [r, g, b] = rgb;\n const luminance = (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255;\n\n return luminance > 0.55 ? dark : light;\n};\n\nconst socialHandle = (url: string) => {\n const clean = url\n .replace(/^https?:\\/\\//i, \"\")\n .replace(/^www\\./i, \"\")\n .replace(/\\/$/, \"\");\n const parts = clean.split(\"/\").filter(Boolean);\n const handle = parts.at(-1);\n\n if (parts.length > 1 && handle) {\n return handle.startsWith(\"@\") ? handle : `@${handle}`;\n }\n\n return clean;\n};\n\nconst EventTicketContent = ({ data }: { data: EventTicketData }) => {\n const theme = usePdfcnTheme();\n const paper = theme.colors.background;\n const ink = theme.colors.foreground;\n const quiet = theme.colors.mutedForeground;\n\n const accent = resolveColor(\n data.accentColor ?? theme.colors.primary,\n theme.colors\n );\n const onAccent = inkOnAccent(accent, paper, ink);\n\n const styles = StyleSheet.create({\n admit: {\n color: onAccent,\n fontSize: 7,\n fontWeight: \"bold\",\n letterSpacing: 2,\n textTransform: \"uppercase\",\n },\n body: {\n flex: 1,\n height: TICKET_SIZE.height,\n justifyContent: \"space-between\",\n paddingBottom: 16,\n paddingLeft: 20,\n paddingRight: 18,\n paddingTop: 18,\n },\n brand: {\n alignItems: \"center\",\n flexDirection: \"row\",\n gap: 8,\n marginBottom: 14,\n },\n fact: {\n flexShrink: 1,\n minWidth: 0,\n paddingRight: 12,\n },\n facts: {\n flexDirection: \"row\",\n },\n footer: {\n alignItems: \"center\",\n flexDirection: \"row\",\n gap: 12,\n marginTop: 10,\n },\n label: {\n color: quiet,\n fontSize: 7,\n fontWeight: \"bold\",\n letterSpacing: 1.2,\n marginBottom: 3,\n textTransform: \"uppercase\",\n },\n logo: { borderRadius: 3, height: 14, width: 14 },\n notchBottom: {\n backgroundColor: paper,\n borderRadius: NOTCH_RADIUS,\n bottom: -NOTCH_RADIUS,\n height: NOTCH_RADIUS * 2,\n left: TICKET_SIZE.width - STUB_WIDTH - NOTCH_RADIUS,\n position: \"absolute\",\n width: NOTCH_RADIUS * 2,\n },\n notchTop: {\n backgroundColor: paper,\n borderRadius: NOTCH_RADIUS,\n height: NOTCH_RADIUS * 2,\n left: TICKET_SIZE.width - STUB_WIDTH - NOTCH_RADIUS,\n position: \"absolute\",\n top: -NOTCH_RADIUS,\n width: NOTCH_RADIUS * 2,\n },\n organizer: {\n color: quiet,\n // Forme ignores `marginLeft: \"auto\"`, so the organizer line absorbs the\n // free space and pushes the ticket-type pill to the right edge.\n flexGrow: 1,\n fontSize: 8,\n fontWeight: \"bold\",\n letterSpacing: 1.1,\n textTransform: \"uppercase\",\n },\n page: {\n alignItems: \"stretch\",\n backgroundColor: paper,\n flexDirection: \"row\",\n height: TICKET_SIZE.height,\n overflow: \"hidden\",\n position: \"relative\",\n width: TICKET_SIZE.width,\n },\n perforation: {\n height: TICKET_SIZE.height,\n left: TICKET_SIZE.width - STUB_WIDTH - PERFORATION_WIDTH / 2,\n position: \"absolute\",\n top: 0,\n width: PERFORATION_WIDTH,\n },\n perforationDash: {\n backgroundColor: paper,\n height: PERFORATION_DASH,\n marginBottom: PERFORATION_GAP,\n width: PERFORATION_WIDTH,\n },\n pill: {\n backgroundColor: accent,\n borderRadius: 9,\n paddingHorizontal: 8,\n paddingVertical: 3,\n },\n pillText: {\n color: onAccent,\n fontSize: 7,\n fontWeight: \"bold\",\n letterSpacing: 1.2,\n textTransform: \"uppercase\",\n },\n qr: {\n backgroundColor: \"#ffffff\",\n borderRadius: 6,\n padding: 5,\n },\n serial: {\n color: onAccent,\n fontSize: 7,\n fontWeight: \"bold\",\n letterSpacing: 1.1,\n textTransform: \"uppercase\",\n },\n socialItem: {\n alignItems: \"center\",\n flexDirection: \"row\",\n gap: 4,\n },\n socialLabel: {\n color: quiet,\n fontSize: 6.5,\n fontWeight: \"bold\",\n letterSpacing: 0.4,\n textTransform: \"uppercase\",\n },\n socialList: {\n alignItems: \"center\",\n flexDirection: \"row\",\n gap: 8,\n },\n socialValue: {\n color: quiet,\n fontSize: 6.5,\n },\n stripe: {\n backgroundColor: accent,\n height: TICKET_SIZE.height,\n width: STRIPE_WIDTH,\n },\n stub: {\n alignItems: \"center\",\n backgroundColor: accent,\n height: TICKET_SIZE.height,\n justifyContent: \"space-between\",\n paddingBottom: 14,\n paddingHorizontal: 12,\n paddingTop: 16,\n width: STUB_WIDTH,\n },\n terms: {\n color: quiet,\n flex: 1,\n fontSize: 6.5,\n lineHeight: 1.4,\n paddingRight: 8,\n },\n title: {\n color: ink,\n fontSize: 26,\n fontWeight: \"bold\",\n letterSpacing: -0.6,\n lineHeight: 1.08,\n marginBottom: 8,\n },\n value: {\n color: ink,\n fontSize: 12,\n fontWeight: \"bold\",\n },\n venue: {\n color: quiet,\n fontSize: 10,\n lineHeight: 1.4,\n },\n });\n\n return (\n <Document title={`${data.eventName} ${data.ticketNumber}`}>\n <Page margin={0} size={TICKET_SIZE}>\n <View style={styles.page as never}>\n <View style={styles.stripe} />\n\n <View style={styles.body}>\n <View>\n <View style={styles.brand}>\n {data.logoUrl && (\n <PdfImage\n fit=\"contain\"\n src={data.logoUrl}\n style={styles.logo}\n />\n )}\n <Text noMargin style={styles.organizer}>\n {data.organizer ?? \"Event ticket\"}\n </Text>\n <View style={styles.pill}>\n <Text noMargin style={styles.pillText}>\n {data.ticketType}\n </Text>\n </View>\n </View>\n <Text noMargin style={styles.title}>\n {data.eventName}\n </Text>\n <Text noMargin style={styles.venue}>\n {data.venue}\n </Text>\n <Text noMargin style={styles.venue}>\n {data.address}\n </Text>\n </View>\n\n <View>\n <View style={styles.facts}>\n <View style={styles.fact}>\n <Text noMargin style={styles.label}>\n Date\n </Text>\n <Text noMargin style={styles.value}>\n {data.eventDate}\n </Text>\n </View>\n <View style={styles.fact}>\n <Text noMargin style={styles.label}>\n Time\n </Text>\n <Text noMargin style={styles.value}>\n {data.eventTime}\n </Text>\n </View>\n {data.doorsOpen && (\n <View style={styles.fact}>\n <Text noMargin style={styles.label}>\n Doors\n </Text>\n <Text noMargin style={styles.value}>\n {data.doorsOpen}\n </Text>\n </View>\n )}\n {data.seat && (\n <View style={styles.fact}>\n <Text noMargin style={styles.label}>\n Seat\n </Text>\n <Text noMargin style={styles.value}>\n {`${data.seat.section}–${data.seat.row}–${data.seat.number}`}\n </Text>\n </View>\n )}\n </View>\n {(data.terms ||\n (data.socialLinks && data.socialLinks.length > 0)) && (\n <View style={styles.footer}>\n {data.terms && (\n <Text noMargin style={styles.terms}>\n {data.terms}\n </Text>\n )}\n {data.socialLinks && data.socialLinks.length > 0 && (\n <View style={styles.socialList}>\n {data.socialLinks.map((link) => (\n <View\n key={`${link.platform}-${link.url}`}\n style={styles.socialItem}\n >\n <Text noMargin style={styles.socialLabel}>\n {link.platform}\n </Text>\n <Text noMargin style={styles.socialValue}>\n {socialHandle(link.url)}\n </Text>\n </View>\n ))}\n </View>\n )}\n </View>\n )}\n </View>\n </View>\n\n <View style={styles.stub}>\n <Text noMargin style={styles.admit}>\n Admit one\n </Text>\n <View style={styles.qr}>\n {data.qrCodeUrl ? (\n <PdfImage\n fit=\"contain\"\n height={68}\n src={data.qrCodeUrl}\n width={68}\n />\n ) : (\n <PdfQRCode\n backgroundColor=\"#ffffff\"\n color=\"#000000\"\n size={68}\n value={data.ticketNumber}\n />\n )}\n </View>\n <Text noMargin style={styles.serial}>\n {data.ticketNumber}\n </Text>\n </View>\n\n <View style={styles.perforation}>\n {perforationOffsets.map((offset) => (\n <View\n key={`perforation-${offset}`}\n style={styles.perforationDash}\n />\n ))}\n </View>\n\n <View style={styles.notchTop} />\n <View style={styles.notchBottom} />\n </View>\n </Page>\n </Document>\n );\n};\n\nexport const EventTicketDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: EventTicketData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <EventTicketContent data={data} />\n </PdfcnThemeProvider>\n);\n",+ "type": "registry:block",+ "target": "components/pdf/blocks/event-ticket/event-ticket.tsx"+ },+ {+ "path": "registry/bases/forme/blocks/event-ticket/event-ticket.types.ts",+ "content": "export interface EventTicketSeat {\n number: string;\n row: string;\n section: string;\n}\n\nexport interface EventTicketSocialLink {\n platform: string;\n url: string;\n}\n\nexport interface EventTicketData {\n accentColor?: string;\n address: string;\n doorsOpen?: string;\n eventName: string;\n eventDate: string;\n eventTime: string;\n logoUrl?: string;\n organizer?: string;\n qrCodeUrl?: string;\n seat?: EventTicketSeat;\n socialLinks?: EventTicketSocialLink[];\n terms?: string;\n ticketNumber: string;\n ticketType: string;\n venue: string;\n}\n",+ "type": "registry:block",+ "target": "components/pdf/blocks/event-ticket/event-ticket.types.ts"+ }+ ],+ "type": "registry:block"+}\ No newline at end of filediff --git a/apps/web/public/r/forme/gift-certificate.json b/apps/web/public/r/forme/gift-certificate.jsonnew file mode 100644index 0000000..bfbd9b0--- /dev/null+++ b/apps/web/public/r/forme/gift-certificate.json@@ -0,0 +1,31 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "forme/gift-certificate",+ "title": "Gift Certificate",+ "description": "Gift Certificate PDF block (forme)",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/pdf-image",+ "@pdfcn/forme/section",+ "@pdfcn/forme/text"+ ],+ "files": [+ {+ "path": "registry/bases/forme/blocks/gift-certificate/gift-certificate.tsx",+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport { PdfImage } from \"@/registry/bases/forme/components/pdf-image/pdf-image\";\nimport { Section } from \"@/registry/bases/forme/components/section/section\";\nimport { Text } from \"@/registry/bases/forme/components/text/text\";\nimport {\n PdfcnThemeProvider,\n usePdfcnTheme,\n} from \"@/registry/bases/forme/components/theme-provider\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-themes\";\n\nimport type { GiftCertificateData } from \"./gift-certificate.types\";\n\n// Sample data — replace with your own props or data source\nconst sampleData: GiftCertificateData = {\n accentColor: \"#000000\",\n amount: 50,\n certificateCode: \"PDFCN-GC-2026-00891\",\n companyLogo: \"/favicon.png\",\n companyName: \"pdfcn\",\n currency: \"USD\",\n expiryDate: \"March 31, 2027\",\n message: \"Happy Birthday! Enjoy a coffee on us.\",\n recipientName: \"Sarah\",\n redemptionInstructions: \"Present this certificate at any pdfcn location.\",\n senderName: \"Mom & Dad\",\n terms: \"No cash value. Non-refundable. One use per visit.\",\n};\n\nconst GiftCertificateContent = ({ data }: { data: GiftCertificateData }) => {\n const theme = usePdfcnTheme();\n const accentColor = data.accentColor || \"#000000\";\n const currencySymbol = data.currency === \"USD\" ? \"$\" : data.currency || \"$\";\n\n const styles = StyleSheet.create({\n amount: {\n color: accentColor,\n fontSize: 36,\n fontWeight: \"bold\",\n },\n amountContainer: {\n alignItems: \"center\",\n backgroundColor: theme.colors.muted,\n borderColor: accentColor,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"solid\",\n borderWidth: 2,\n marginBottom: 10,\n marginTop: 10,\n paddingHorizontal: 20,\n paddingVertical: 12,\n },\n code: {\n color: theme.colors.foreground,\n fontFamily: \"Courier\",\n fontSize: 13,\n fontWeight: \"bold\",\n letterSpacing: 1.2,\n },\n codeBox: {\n alignItems: \"center\",\n backgroundColor: theme.colors.background,\n borderColor: theme.colors.border,\n borderRadius: theme.primitives.borderRadius.sm,\n borderStyle: \"solid\",\n borderWidth: 1,\n marginBottom: 8,\n marginTop: 8,\n paddingHorizontal: 14,\n paddingVertical: 8,\n },\n decorativeBorder: {\n borderColor: accentColor,\n borderRadius: theme.primitives.borderRadius.lg,\n borderStyle: \"solid\",\n borderWidth: 3,\n padding: 16,\n position: \"relative\",\n },\n fieldLabel: {\n color: theme.colors.mutedForeground,\n fontSize: 9,\n fontWeight: \"bold\",\n letterSpacing: 1,\n marginBottom: 4,\n textTransform: \"uppercase\",\n },\n fieldValue: {\n color: theme.colors.foreground,\n fontSize: 14,\n fontWeight: 500,\n },\n header: {\n alignItems: \"center\",\n marginBottom: 8,\n },\n innerBorder: {\n borderColor: accentColor,\n borderRadius: theme.primitives.borderRadius.md,\n borderStyle: \"dashed\",\n borderWidth: 1,\n padding: 18,\n },\n instructionsBox: {\n marginTop: 8,\n },\n logo: {\n height: 28,\n marginBottom: 6,\n width: 28,\n },\n messageBox: {\n backgroundColor: theme.colors.muted,\n borderRadius: theme.primitives.borderRadius.sm,\n marginBottom: 8,\n marginTop: 8,\n padding: 10,\n },\n page: {\n backgroundColor: theme.colors.background,\n },\n termsText: {\n color: theme.colors.mutedForeground,\n fontSize: 8,\n lineHeight: 1.4,\n textAlign: \"center\",\n },\n title: {\n color: accentColor,\n fontSize: 22,\n fontWeight: \"bold\",\n letterSpacing: 2,\n textAlign: \"center\",\n textTransform: \"uppercase\",\n },\n });\n\n return (\n <Document title={`Gift Certificate ${data.certificateCode}`}>\n <Page margin={24} size=\"A4\">\n <View style={styles.page as never}>\n <View style={styles.decorativeBorder as never}>\n <View style={styles.innerBorder as never}>\n <Section noWrap style={styles.header}>\n {data.companyLogo && (\n <PdfImage\n src={data.companyLogo ?? \"/favicon.png\"}\n style={styles.logo}\n />\n )}\n <Text style={styles.title} noMargin>\n Gift Certificate\n </Text>\n {data.companyName && (\n <Text\n style={{\n color: theme.colors.foreground,\n fontSize: 13,\n fontWeight: 500,\n marginTop: 4,\n textAlign: \"center\",\n }}\n noMargin\n >\n {data.companyName}\n </Text>\n )}\n </Section>\n\n <Section noWrap style={styles.amountContainer}>\n <Text style={styles.amount} noMargin>\n {currencySymbol}\n {data.amount.toFixed(2)}\n </Text>\n </Section>\n\n <Section\n noWrap\n style={{\n flexDirection: \"row\",\n gap: 28,\n marginBottom: 8,\n }}\n >\n <View style={{ flex: 1 }}>\n <Text style={styles.fieldLabel} noMargin>\n To\n </Text>\n <Text style={styles.fieldValue} noMargin>\n {data.recipientName}\n </Text>\n </View>\n <View style={{ flex: 1 }}>\n <Text style={styles.fieldLabel} noMargin>\n From\n </Text>\n <Text style={styles.fieldValue} noMargin>\n {data.senderName}\n </Text>\n </View>\n </Section>\n\n {data.message && (\n <Section noWrap style={styles.messageBox}>\n <Text\n style={{\n color: theme.colors.foreground,\n fontSize: 10,\n fontStyle: \"italic\",\n lineHeight: 1.4,\n textAlign: \"center\",\n }}\n noMargin\n >\n \"{data.message}\"\n </Text>\n </Section>\n )}\n\n <Section noWrap style={styles.codeBox}>\n <Text style={styles.fieldLabel} noMargin>\n Certificate Code\n </Text>\n <Text style={styles.code} noMargin>\n {data.certificateCode}\n </Text>\n </Section>\n\n <Section\n noWrap\n style={{\n alignItems: \"center\",\n marginBottom: 8,\n }}\n >\n <Text style={styles.fieldLabel} noMargin>\n Valid Until\n </Text>\n <Text\n style={{\n color: accentColor,\n fontSize: 12,\n fontWeight: \"bold\",\n }}\n noMargin\n >\n {data.expiryDate}\n </Text>\n </Section>\n\n {data.redemptionInstructions && (\n <Section noWrap style={styles.instructionsBox}>\n <Text\n style={{\n color: theme.colors.foreground,\n fontSize: 9,\n lineHeight: 1.3,\n textAlign: \"center\",\n }}\n noMargin\n >\n {data.redemptionInstructions}\n </Text>\n </Section>\n )}\n\n {data.terms && (\n <Section\n noWrap\n style={{\n marginTop: 10,\n }}\n >\n <Text style={styles.termsText} noMargin>\n {data.terms}\n </Text>\n </Section>\n )}\n </View>\n </View>\n </View>\n </Page>\n </Document>\n );\n};\n\nexport const GiftCertificateDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: GiftCertificateData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <GiftCertificateContent data={data} />\n </PdfcnThemeProvider>\n);\n",+ "type": "registry:block",+ "target": "components/pdf/blocks/gift-certificate/gift-certificate.tsx"+ },+ {+ "path": "registry/bases/forme/blocks/gift-certificate/gift-certificate.types.ts",+ "content": "export interface GiftCertificateData {\n companyName: string;\n companyLogo?: string;\n amount: number;\n currency?: string;\n recipientName: string;\n senderName: string;\n message?: string;\n certificateCode: string;\n expiryDate: string;\n redemptionInstructions?: string;\n terms?: string;\n companyContact?: string;\n accentColor?: string;\n renderingBase?: \"takumi\" | \"forme\";\n}\n",+ "type": "registry:block",+ "target": "components/pdf/blocks/gift-certificate/gift-certificate.types.ts"+ }+ ],+ "type": "registry:block"+}\ No newline at end of filediff --git a/apps/web/public/r/forme/medical-intake-form.json b/apps/web/public/r/forme/medical-intake-form.jsonnew file mode 100644index 0000000..cc360a3--- /dev/null+++ b/apps/web/public/r/forme/medical-intake-form.json@@ -0,0 +1,37 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "forme/medical-intake-form",+ "title": "Medical Intake Form",+ "description": "Medical Intake Form PDF block (forme)",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core"+ ],+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/form",+ "@pdfcn/forme/list",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/pdf-image",+ "@pdfcn/forme/section",+ "@pdfcn/forme/signature",+ "@pdfcn/forme/table",+ "@pdfcn/forme/text"+ ],+ "files": [+ {+ "path": "registry/bases/forme/blocks/medical-intake-form/medical-intake-form.tsx",+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport { PdfForm } from \"@/registry/bases/forme/components/form/form\";\nimport { PdfList } from \"@/registry/bases/forme/components/list/list\";\nimport { PageFooter } from \"@/registry/bases/forme/components/page-footer/page-footer\";\nimport { PageHeader } from \"@/registry/bases/forme/components/page-header/page-header\";\nimport { PdfImage } from \"@/registry/bases/forme/components/pdf-image/pdf-image\";\nimport { Section } from \"@/registry/bases/forme/components/section/section\";\nimport { PdfSignatureBlock } from \"@/registry/bases/forme/components/signature/signature\";\nimport {\n Table,\n TableBody,\n TableCell,\n TableHeader,\n TableRow,\n} from \"@/registry/bases/forme/components/table/table\";\nimport { Text } from \"@/registry/bases/forme/components/text/text\";\nimport {\n PdfcnThemeProvider,\n usePdfcnTheme,\n useSafeMemo,\n} from \"@/registry/bases/forme/components/theme-provider\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-themes\";\n\nimport type { MedicalIntakeFormProps } from \"./medical-intake-form.types\";\n\nconst FORM_VERSION = \"Form v1.0 · Revised 09/2026\";\nconst FORM_STYLE = { marginBottom: 0 };\n\nconst SECOND_PAGE_MARGIN_BOTTOM = 44;\nconst SECOND_PAGE_MARGIN_TOP = 24;\n\nconst MEDICAL_CONDITIONS = [\n \"Diabetes\",\n \"High Blood Pressure\",\n \"Heart Disease\",\n \"Asthma\",\n \"COPD\",\n \"Cancer\",\n \"Stroke\",\n \"Thyroid Disorder\",\n \"Kidney Disease\",\n \"Liver Disease\",\n \"Seizures / Epilepsy\",\n \"Other\",\n];\n\nconst CONSENT_ACKNOWLEDGMENTS = [\n { checked: false, text: \"I have read and understand the consent above.\" },\n { checked: false, text: \"I have received the Notice of Privacy Practices.\" },\n];\n\nconst MEDICATION_ROWS = [\n \"medication-1\",\n \"medication-2\",\n \"medication-3\",\n \"medication-4\",\n];\n\nconst ALLERGY_ROWS = [\"allergy-1\", \"allergy-2\", \"allergy-3\"];\n\nconst BLANK_CELL = <View style={{ minHeight: 14 }} />;\n\nconst blankChecklist = (labels: string[]) =>\n labels.map((text) => ({ checked: false, text }));\n\nconst createIntakeStyles = (t: PdfcnTheme) =>\n StyleSheet.create({\n column: { flex: 1 },\n consentText: {\n fontSize: t.primitives.typography.xs,\n lineHeight: 1.4,\n marginBottom: 6,\n },\n labelText: { fontSize: 9, fontWeight: \"bold\", letterSpacing: 0.6 },\n page: { backgroundColor: t.colors.background },\n pageTwoHeader: {\n alignItems: \"flex-end\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n marginBottom: 8,\n },\n reasonBox: {\n borderColor: t.colors.border,\n borderRadius: t.primitives.borderRadius.sm,\n borderStyle: \"solid\",\n borderWidth: 1,\n height: 40,\n minHeight: 40,\n },\n row: { flexDirection: \"row\", gap: 20 },\n section: { marginBottom: 4 },\n sectionRule: {\n borderBottomStyle: \"solid\",\n borderBottomWidth: 1,\n marginBottom: 4,\n paddingBottom: 2,\n },\n signature: { marginBottom: 0, marginTop: 8 },\n title: { fontSize: 13, fontWeight: \"bold\" },\n });\n\nconst useIntakeStyles = () => {\n const theme = usePdfcnTheme();\n const styles = useSafeMemo(() => createIntakeStyles(theme), [theme]);\n return { styles, theme };\n};\n\nconst SectionLabel = ({ accent, label }: { accent: string; label: string }) => {\n const { styles } = useIntakeStyles();\n\n return (\n <View style={{ ...styles.sectionRule, borderBottomColor: accent } as never}>\n <Text noMargin style={styles.labelText} transform=\"uppercase\">\n {label}\n </Text>\n </View>\n );\n};\n\nconst IntakeHeader = ({\n clinicAddress,\n clinicLogo,\n clinicName,\n clinicPhone,\n}: Pick<\n MedicalIntakeFormProps,\n \"clinicAddress\" | \"clinicLogo\" | \"clinicName\" | \"clinicPhone\"\n>) => (\n <PageHeader\n logo={\n clinicLogo ? (\n <PdfImage\n height={48}\n src={clinicLogo}\n style={{ margin: 0 }}\n width={48}\n />\n ) : undefined\n }\n marginBottom={16}\n rightSubText={clinicAddress}\n rightText={clinicPhone}\n subtitle=\"Patient Intake Form\"\n title={clinicName}\n variant=\"logo-left\"\n />\n);\n\nconst SecondPageHeader = ({\n clinicName,\n clinicPhone,\n}: Pick<MedicalIntakeFormProps, \"clinicName\" | \"clinicPhone\">) => {\n const { styles } = useIntakeStyles();\n\n return (\n <View style={styles.pageTwoHeader as never}>\n <Text noMargin style={styles.title}>\n {`${clinicName} — Patient Intake Form (continued)`}\n </Text>\n <Text color=\"mutedForeground\" noMargin variant=\"xs\">\n {clinicPhone}\n </Text>\n </View>\n );\n};\n\nconst IntakeFooter = ({\n clinicAddress,\n clinicPhone,\n page,\n pagePadding,\n totalPages,\n}: Pick<MedicalIntakeFormProps, \"clinicAddress\" | \"clinicPhone\"> & {\n page: number;\n pagePadding: number;\n totalPages: number;\n}) => (\n <PageFooter\n address={clinicAddress}\n leftText={FORM_VERSION}\n pagePadding={pagePadding}\n phone={clinicPhone}\n rightText={`Page ${page} of ${totalPages}`}\n sticky\n variant=\"three-column\"\n />\n);\n\nconst PersonalInfoSection = () => (\n <PdfForm\n groups={[\n {\n fields: [\n { height: 14, label: \"Full Name\" },\n { height: 14, hint: \"DD / MM / YYYY\", label: \"Date of Birth\" },\n { height: 14, label: \"Gender\" },\n { height: 14, hint: \"+1 (555) 000-0000\", label: \"Phone Number\" },\n { height: 14, label: \"Email Address\" },\n ],\n layout: \"two-column\",\n title: \"Patient Information\",\n },\n {\n fields: [\n { height: 14, label: \"Street Address\", width: \"100%\" },\n { height: 14, label: \"City\" },\n { height: 14, label: \"State / Province\" },\n { height: 14, label: \"Postal Code\" },\n ],\n layout: \"two-column\",\n title: \"Address\",\n },\n ]}\n style={FORM_STYLE}\n variant=\"underline\"\n />\n);\n\nconst EmergencyContactSection = () => (\n <PdfForm\n groups={[\n {\n fields: [\n { height: 14, label: \"Emergency Contact Name\" },\n { height: 14, label: \"Relationship\" },\n { height: 14, label: \"Phone Number\" },\n ],\n layout: \"two-column\",\n title: \"Emergency Contact\",\n },\n ]}\n style={FORM_STYLE}\n variant=\"underline\"\n />\n);\n\nconst InsuranceSection = () => (\n <PdfForm\n groups={[\n {\n fields: [\n { height: 14, label: \"Insurance Provider\" },\n { height: 14, label: \"Policy Number\" },\n { height: 14, label: \"Group Number\" },\n { height: 14, label: \"Subscriber Name\" },\n ],\n layout: \"two-column\",\n title: \"Insurance\",\n },\n ]}\n style={FORM_STYLE}\n variant=\"underline\"\n />\n);\n\nconst MedicalHistorySection = ({ accent }: { accent: string }) => {\n const { styles } = useIntakeStyles();\n\n return (\n <View style={styles.section as never}>\n <SectionLabel accent={accent} label=\"Medical History\" />\n <View style={styles.row as never}>\n <View style={styles.column as never}>\n <PdfList\n gap=\"xs\"\n items={blankChecklist(MEDICAL_CONDITIONS.slice(0, 4))}\n variant=\"checklist\"\n />\n </View>\n <View style={styles.column as never}>\n <PdfList\n gap=\"xs\"\n items={blankChecklist(MEDICAL_CONDITIONS.slice(4, 8))}\n variant=\"checklist\"\n />\n </View>\n <View style={styles.column as never}>\n <PdfList\n gap=\"xs\"\n items={blankChecklist(MEDICAL_CONDITIONS.slice(8))}\n variant=\"checklist\"\n />\n </View>\n </View>\n </View>\n );\n};\n\nconst MedicationsSection = ({ accent }: { accent: string }) => {\n const { styles } = useIntakeStyles();\n\n return (\n <View style={styles.section as never}>\n <SectionLabel accent={accent} label=\"Current Medications\" />\n <Table variant=\"grid\">\n <TableHeader>\n <TableRow header>\n <TableCell>Medication</TableCell>\n <TableCell>Dosage</TableCell>\n <TableCell>Frequency</TableCell>\n <TableCell>Prescribing Doctor</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {MEDICATION_ROWS.map((row) => (\n <TableRow key={row}>\n <TableCell>{BLANK_CELL}</TableCell>\n <TableCell>{BLANK_CELL}</TableCell>\n <TableCell>{BLANK_CELL}</TableCell>\n <TableCell>{BLANK_CELL}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </View>\n );\n};\n\nconst AllergiesSection = ({ accent }: { accent: string }) => {\n const { styles } = useIntakeStyles();\n\n return (\n <View style={styles.section as never}>\n <SectionLabel accent={accent} label=\"Allergies\" />\n <Table variant=\"grid\">\n <TableHeader>\n <TableRow header>\n <TableCell>Allergen</TableCell>\n <TableCell>Reaction</TableCell>\n <TableCell>Severity</TableCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {ALLERGY_ROWS.map((row) => (\n <TableRow key={row}>\n <TableCell>{BLANK_CELL}</TableCell>\n <TableCell>{BLANK_CELL}</TableCell>\n <TableCell>{BLANK_CELL}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </View>\n );\n};\n\nconst ReasonForVisitSection = ({ accent }: { accent: string }) => {\n const { styles } = useIntakeStyles();\n\n return (\n <View style={styles.section as never}>\n <SectionLabel accent={accent} label=\"Reason for Visit\" />\n <View style={styles.reasonBox as never} />\n </View>\n );\n};\n\nconst ConsentSection = ({\n accent,\n accentColor,\n clinicName,\n}: Pick<MedicalIntakeFormProps, \"accentColor\" | \"clinicName\"> & {\n accent: string;\n}) => {\n const { styles } = useIntakeStyles();\n\n return (\n <View style={styles.section as never}>\n <SectionLabel accent={accent} label=\"Consent & Authorization\" />\n <Section\n accentColor={accentColor}\n padding=\"sm\"\n spacing=\"none\"\n variant=\"highlight\"\n >\n <Text color=\"mutedForeground\" noMargin style={styles.consentText}>\n {`I authorize ${clinicName} to provide treatment and to release the information required to process insurance claims for this visit, and I acknowledge that I have received the Notice of Privacy Practices (HIPAA) explaining how my health information may be used.`}\n </Text>\n <PdfList gap=\"xs\" items={CONSENT_ACKNOWLEDGMENTS} variant=\"checklist\" />\n </Section>\n <PdfSignatureBlock\n signers={[{ label: \"Patient / Guardian Signature\" }, { label: \"Date\" }]}\n style={styles.signature}\n variant=\"double\"\n />\n </View>\n );\n};\n\ntype IntakeSections = Required<\n Pick<\n MedicalIntakeFormProps,\n | \"allergies\"\n | \"consent\"\n | \"emergencyContact\"\n | \"insurance\"\n | \"medicalHistory\"\n | \"medications\"\n | \"personalInfo\"\n | \"reasonForVisit\"\n >\n>;\n\nconst resolveSections = (props: MedicalIntakeFormProps): IntakeSections => ({\n allergies: props.allergies ?? true,\n consent: props.consent ?? true,\n emergencyContact: props.emergencyContact ?? true,\n insurance: props.insurance ?? true,\n medicalHistory: props.medicalHistory ?? true,\n medications: props.medications ?? true,\n personalInfo: props.personalInfo ?? true,\n reasonForVisit: props.reasonForVisit ?? true,\n});\n\nconst hasSecondPage = (sections: IntakeSections) =>\n sections.allergies ||\n sections.consent ||\n sections.medications ||\n sections.reasonForVisit;\n\nconst FirstPage = ({\n clinicAddress,\n clinicLogo,\n clinicName,\n clinicPhone,\n sections,\n totalPages,\n}: Pick<\n MedicalIntakeFormProps,\n \"clinicAddress\" | \"clinicLogo\" | \"clinicName\" | \"clinicPhone\"\n> & {\n sections: IntakeSections;\n totalPages: number;\n}) => {\n const { styles, theme } = useIntakeStyles();\n const margin = {\n bottom: theme.spacing.page.marginBottom,\n left: theme.spacing.page.marginLeft,\n right: theme.spacing.page.marginRight,\n top: theme.spacing.page.marginTop,\n };\n\n return (\n <Page margin={margin} size=\"A4\">\n <IntakeFooter\n clinicAddress={clinicAddress}\n clinicPhone={clinicPhone}\n page={1}\n pagePadding={margin.bottom}\n totalPages={totalPages}\n />\n <View style={styles.page as never}>\n <IntakeHeader\n clinicAddress={clinicAddress}\n clinicLogo={clinicLogo}\n clinicName={clinicName}\n clinicPhone={clinicPhone}\n />\n {sections.personalInfo ? <PersonalInfoSection /> : null}\n {sections.emergencyContact ? <EmergencyContactSection /> : null}\n {sections.insurance ? <InsuranceSection /> : null}\n </View>\n </Page>\n );\n};\n\nconst SecondPage = ({\n accent,\n accentColor,\n clinicAddress,\n clinicName,\n clinicPhone,\n sections,\n totalPages,\n}: Pick<\n MedicalIntakeFormProps,\n \"accentColor\" | \"clinicAddress\" | \"clinicName\" | \"clinicPhone\"\n> & {\n accent: string;\n sections: IntakeSections;\n totalPages: number;\n}) => {\n const { styles, theme } = useIntakeStyles();\n const margin = {\n bottom: SECOND_PAGE_MARGIN_BOTTOM,\n left: theme.spacing.page.marginLeft,\n right: theme.spacing.page.marginRight,\n top: SECOND_PAGE_MARGIN_TOP,\n };\n\n return (\n <Page margin={margin} size=\"A4\">\n <IntakeFooter\n clinicAddress={clinicAddress}\n clinicPhone={clinicPhone}\n page={2}\n pagePadding={margin.bottom}\n totalPages={totalPages}\n />\n <View style={styles.page as never}>\n <SecondPageHeader clinicName={clinicName} clinicPhone={clinicPhone} />\n {sections.medicalHistory ? (\n <MedicalHistorySection accent={accent} />\n ) : null}\n {sections.medications ? <MedicationsSection accent={accent} /> : null}\n {sections.allergies ? <AllergiesSection accent={accent} /> : null}\n {sections.reasonForVisit ? (\n <ReasonForVisitSection accent={accent} />\n ) : null}\n {sections.consent ? (\n <ConsentSection\n accent={accent}\n accentColor={accentColor}\n clinicName={clinicName}\n />\n ) : null}\n </View>\n </Page>\n );\n};\n\nconst MedicalIntakeFormContent = (props: MedicalIntakeFormProps) => {\n const { theme } = useIntakeStyles();\n const sections = resolveSections(props);\n const accent = props.accentColor\n ? resolveColor(props.accentColor, theme.colors)\n : theme.colors.primary;\n const totalPages = hasSecondPage(sections) ? 2 : 1;\n\n return (\n <Document title={`${props.clinicName} — Patient Intake Form`}>\n <FirstPage\n clinicAddress={props.clinicAddress}\n clinicLogo={props.clinicLogo}\n clinicName={props.clinicName}\n clinicPhone={props.clinicPhone}\n sections={sections}\n totalPages={totalPages}\n />\n {totalPages > 1 ? (\n <SecondPage\n accent={accent}\n accentColor={props.accentColor}\n clinicAddress={props.clinicAddress}\n clinicName={props.clinicName}\n clinicPhone={props.clinicPhone}\n sections={sections}\n totalPages={totalPages}\n />\n ) : null}\n </Document>\n );\n};\n\n/**\n * Print-ready medical intake form with patient, emergency contact, insurance,\n * medical history, medication, allergy, reason for visit, and consent\n * sections. Every section can be hidden through its boolean prop, and all\n * fields are left blank for the patient to complete by hand.\n */\nexport const MedicalIntakeFormDocument = ({\n theme,\n ...props\n}: MedicalIntakeFormProps) => (\n <PdfcnThemeProvider theme={theme}>\n <MedicalIntakeFormContent {...props} />\n </PdfcnThemeProvider>\n);\n",+ "type": "registry:block",+ "target": "components/pdf/blocks/medical-intake-form/medical-intake-form.tsx"+ },+ {+ "path": "registry/bases/forme/blocks/medical-intake-form/medical-intake-form.types.ts",+ "content": "import type { PdfcnTheme } from \"@/registry/types/pdf-themes\";\n\n/**\n * Medical intake form properties.\n * Props - `clinicName` | `clinicLogo` | `clinicAddress` | `clinicPhone` |\n * `personalInfo` | `emergencyContact` | `insurance` | `medicalHistory` |\n * `medications` | `allergies` | `reasonForVisit` | `consent` | `accentColor` | `theme`\n * @see {@link MedicalIntakeFormDocument}\n */\nexport interface MedicalIntakeFormProps {\n clinicName: string;\n clinicLogo?: string;\n clinicAddress?: string;\n clinicPhone?: string;\n /**\n * @default true\n */\n personalInfo?: boolean;\n /**\n * @default true\n */\n emergencyContact?: boolean;\n /**\n * @default true\n */\n insurance?: boolean;\n /**\n * @default true\n */\n medicalHistory?: boolean;\n /**\n * @default true\n */\n medications?: boolean;\n /**\n * @default true\n */\n allergies?: boolean;\n /**\n * @default true\n */\n reasonForVisit?: boolean;\n /**\n * @default true\n */\n consent?: boolean;\n /**\n * Theme color token (e.g. `\"primary\"`) or raw CSS color (e.g. `\"#0d9488\"`)\n * applied to section rules, table accents, and the consent callout.\n */\n accentColor?: string;\n theme?: PdfcnTheme;\n}\n",+ "type": "registry:block",+ "target": "components/pdf/blocks/medical-intake-form/medical-intake-form.types.ts"+ }+ ],+ "type": "registry:block"+}\ No newline at end of filediff --git a/apps/web/public/r/forme/shipping-label.json b/apps/web/public/r/forme/shipping-label.jsonnew file mode 100644index 0000000..fb8a0fd--- /dev/null+++ b/apps/web/public/r/forme/shipping-label.json@@ -0,0 +1,31 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "forme/shipping-label",+ "title": "Shipping Label",+ "description": "Shipping Label PDF block (forme)",+ "dependencies": [+ "@formepdf/react",+ "@formepdf/core",+ "qrcode"+ ],+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/qrcode",+ "@pdfcn/forme/text"+ ],+ "files": [+ {+ "path": "registry/bases/forme/blocks/shipping-label/shipping-label.tsx",+ "content": "import { Document, Page, StyleSheet, View } from \"@formepdf/react\";\n\nimport { PdfQRCode } from \"@/registry/bases/forme/components/qrcode/qrcode\";\nimport { Text } from \"@/registry/bases/forme/components/text/text\";\nimport {\n PdfcnThemeProvider,\n usePdfcnTheme,\n} from \"@/registry/bases/forme/components/theme-provider\";\nimport { Image } from \"@/registry/bases/forme/lib/pdf-primitives\";\nimport { resolveColor } from \"@/registry/bases/forme/lib/resolve-color\";\nimport type { PdfcnTheme } from \"@/registry/types/pdf-themes\";\n\nimport type {\n ShippingLabelAddress,\n ShippingLabelData,\n} from \"./shipping-label.types\";\n\n// Sample data — replace with your own props or data source\nconst sampleData: ShippingLabelData = {\n carrier: \"UPS\",\n dimensions: '12\" x 8\" x 6\"',\n from: {\n address: \"456 Industrial Blvd\",\n city: \"Los Angeles\",\n country: \"USA\",\n name: \"ACME Corporation\",\n state: \"CA\",\n zip: \"90001\",\n },\n handlingLabels: [\"FRAGILE\", \"THIS SIDE UP\"],\n packageCount: 1,\n postage: \"$18.40\",\n serviceLevel: \"Ground\",\n to: {\n address: \"123 Main Street, Apt 4B\",\n city: \"New York\",\n country: \"USA\",\n name: \"John Doe\",\n phone: \"(503) 555-0142\",\n state: \"NY\",\n zip: \"10001\",\n },\n trackingNumber: \"TRACK123456789US\",\n weight: \"2.5 kg\",\n};\n\n// Standard 4\" x 6\" shipping label, expressed in PDF points (72 dpi)\nconst LABEL_SIZE = { height: 432, width: 288 };\n\n// Quiet zone kept clear of the printed label frame, plus the frame itself\nconst LABEL_MARGIN = 8;\nconst LABEL_BORDER = 2;\nconst LABEL_PADDING = 10;\n\n// Forme scales an image with the Image element's own width/height (style\n// dimensions only size the box), so the barcode is measured in points from\n// the label's content box instead of a percentage width.\nconst BARCODE_WIDTH =\n LABEL_SIZE.width - 2 * (LABEL_MARGIN + LABEL_BORDER + LABEL_PADDING);\nconst BARCODE_HEIGHT = 72;\n\nconst formatCityLine = (party: ShippingLabelAddress) => {\n const cityStateZip = `${party.city}, ${party.state} ${party.zip}`;\n return party.country ? `${cityStateZip}, ${party.country}` : cityStateZip;\n};\n\n// Shared address block — same treatment for both parties (10pt, bold name).\n// Forme's serializer drops components that return a Fragment, so the lines are\n// wrapped in a View; inside the column parent the stacking is identical.\nconst AddressLines = ({\n party,\n}: {\n party: ShippingLabelAddress & { phone?: string };\n}) => (\n <View>\n <Text noMargin variant=\"xs\" weight=\"bold\">\n {party.name}\n </Text>\n <Text noMargin variant=\"xs\">\n {party.address}\n </Text>\n <Text noMargin variant=\"xs\">\n {formatCityLine(party)}\n </Text>\n {party.phone && (\n <Text noMargin variant=\"xs\" color=\"mutedForeground\">\n {party.phone}\n </Text>\n )}\n </View>\n);\n\nconst ShippingLabelContent = ({ data }: { data: ShippingLabelData }) => {\n const theme = usePdfcnTheme();\n\n const accent = resolveColor(\n data.accentColor ?? theme.colors.primary,\n theme.colors\n );\n\n const detailRows = [\n ...(data.weight ? [{ key: \"Weight\", value: data.weight }] : []),\n ...(data.dimensions ? [{ key: \"Dimensions\", value: data.dimensions }] : []),\n ...(typeof data.packageCount === \"number\"\n ? [{ key: \"Packages\", value: `${data.packageCount}` }]\n : []),\n { key: \"Postage\", value: data.postage ?? \"PAID\" },\n ];\n\n const styles = StyleSheet.create({\n addresses: { flex: 1, flexDirection: \"row\" },\n badgesRow: {\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: 6,\n marginTop: 8,\n },\n barcodeArea: { alignItems: \"center\", marginTop: 10 },\n carrierName: { fontSize: 16, fontWeight: \"bold\" },\n fromColumn: { flex: 1, paddingLeft: 12 },\n handlingTag: {\n alignItems: \"center\",\n backgroundColor: theme.colors.foreground,\n justifyContent: \"center\",\n paddingHorizontal: 8,\n paddingVertical: 4,\n },\n handlingTagText: {\n color: theme.colors.background,\n fontSize: 8,\n fontWeight: \"bold\",\n letterSpacing: 1,\n textTransform: \"uppercase\",\n },\n headerRow: {\n alignItems: \"center\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n },\n label: {\n borderColor: theme.colors.foreground,\n borderWidth: LABEL_BORDER,\n flex: 1,\n padding: LABEL_PADDING,\n },\n page: {\n backgroundColor: theme.colors.background,\n flex: 1,\n flexDirection: \"column\",\n height: LABEL_SIZE.height - LABEL_MARGIN * 2,\n overflow: \"hidden\",\n },\n rule: {\n backgroundColor: theme.colors.foreground,\n height: 2,\n marginVertical: 6,\n },\n sectionLabel: {\n color: accent,\n fontSize: 8,\n fontWeight: \"bold\",\n letterSpacing: 1,\n marginBottom: 4,\n textTransform: \"uppercase\",\n },\n serviceRight: { alignItems: \"flex-end\" },\n shipToColumn: {\n borderRightColor: theme.colors.foreground,\n borderRightWidth: 2,\n flex: 1.4,\n paddingRight: 12,\n },\n table: {\n borderColor: theme.colors.foreground,\n borderWidth: 2,\n },\n tableKey: {\n color: theme.colors.mutedForeground,\n fontSize: 8,\n fontWeight: \"bold\",\n letterSpacing: 0.5,\n textTransform: \"uppercase\",\n width: 84,\n },\n tableRow: {\n alignItems: \"center\",\n borderBottomColor: theme.colors.border,\n borderBottomWidth: 1,\n flexDirection: \"row\",\n paddingHorizontal: 8,\n paddingVertical: 3,\n },\n tableRowLast: {\n alignItems: \"center\",\n flexDirection: \"row\",\n paddingHorizontal: 8,\n paddingVertical: 3,\n },\n tableValue: { flex: 1 },\n trackingText: {\n fontWeight: \"bold\",\n letterSpacing: 2,\n marginTop: 6,\n textTransform: \"uppercase\",\n },\n });\n\n return (\n <Document title={`Shipping Label ${data.trackingNumber}`}>\n <Page size={LABEL_SIZE} margin={LABEL_MARGIN}>\n <View style={styles.page as never}>\n <View style={styles.label}>\n <View style={styles.headerRow}>\n <Text noMargin style={styles.carrierName}>\n {data.carrier}\n </Text>\n <View style={styles.serviceRight}>\n <Text noMargin style={styles.sectionLabel}>\n {data.serviceLevel}\n </Text>\n </View>\n </View>\n\n <View style={styles.rule} />\n\n <View style={styles.addresses}>\n <View style={styles.shipToColumn}>\n <Text noMargin style={styles.sectionLabel}>\n Ship To\n </Text>\n <AddressLines party={data.to} />\n </View>\n <View style={styles.fromColumn}>\n <Text noMargin style={styles.sectionLabel}>\n From\n </Text>\n <AddressLines party={data.from} />\n </View>\n </View>\n\n <View style={styles.rule} />\n\n <View style={styles.table}>\n {detailRows.map((row, index) => (\n <View\n key={row.key}\n style={\n index === detailRows.length - 1\n ? styles.tableRowLast\n : styles.tableRow\n }\n >\n <Text noMargin style={styles.tableKey}>\n {row.key}\n </Text>\n <Text noMargin style={styles.tableValue} variant=\"xs\">\n {row.value}\n </Text>\n </View>\n ))}\n </View>\n\n {data.handlingLabels && data.handlingLabels.length > 0 && (\n <View style={styles.badgesRow}>\n {data.handlingLabels.map((label, index) => (\n <View key={`${label}-${index}`} style={styles.handlingTag}>\n <Text noMargin style={styles.handlingTagText}>\n {label}\n </Text>\n </View>\n ))}\n </View>\n )}\n\n <View style={styles.barcodeArea}>\n {data.barcodeUrl ? (\n <Image\n height={BARCODE_HEIGHT}\n src={data.barcodeUrl}\n width={BARCODE_WIDTH}\n />\n ) : (\n <PdfQRCode\n backgroundColor=\"#ffffff\"\n color=\"#000000\"\n size={80}\n value={data.trackingNumber}\n />\n )}\n <Text\n noMargin\n style={styles.trackingText}\n variant=\"xs\"\n weight=\"bold\"\n >\n {data.trackingNumber}\n </Text>\n </View>\n </View>\n </View>\n </Page>\n </Document>\n );\n};\n\nexport const ShippingLabelDocument = ({\n theme,\n data = sampleData,\n}: {\n theme?: PdfcnTheme;\n data?: ShippingLabelData;\n}) => (\n <PdfcnThemeProvider theme={theme}>\n <ShippingLabelContent data={data} />\n </PdfcnThemeProvider>\n);\n",+ "type": "registry:block",+ "target": "components/pdf/blocks/shipping-label/shipping-label.tsx"+ },+ {+ "path": "registry/bases/forme/blocks/shipping-label/shipping-label.types.ts",+ "content": "export interface ShippingLabelAddress {\n name: string;\n address: string;\n city: string;\n state: string;\n zip: string;\n country?: string;\n}\n\nexport interface ShippingLabelDestination extends ShippingLabelAddress {\n phone?: string;\n}\n\nexport interface ShippingLabelData {\n from: ShippingLabelAddress;\n to: ShippingLabelDestination;\n carrier: string;\n serviceLevel: string;\n trackingNumber: string;\n barcodeUrl?: string;\n weight?: string;\n dimensions?: string;\n packageCount?: number;\n handlingLabels?: string[];\n postage?: string;\n accentColor?: string;\n}\n",+ "type": "registry:block",+ "target": "components/pdf/blocks/shipping-label/shipping-label.types.ts"+ }+ ],+ "type": "registry:block"+}\ No newline at end of filediff --git a/apps/web/public/r/registry.json b/apps/web/public/r/registry.jsonindex 8f66d88..7718401 100644--- a/apps/web/public/r/registry.json+++ b/apps/web/public/r/registry.json@@ -1954,6 +1954,111 @@"title": "Press Release","type": "registry:block"},+ {+ "dependencies": ["@formepdf/react", "@formepdf/core"],+ "description": "Gift Certificate PDF block (forme)",+ "files": [+ {+ "path": "registry/bases/forme/blocks/gift-certificate/gift-certificate.tsx",+ "type": "registry:block",+ "target": "components/pdf/blocks/gift-certificate/gift-certificate.tsx"+ },+ {+ "path": "registry/bases/forme/blocks/gift-certificate/gift-certificate.types.ts",+ "type": "registry:block",+ "target": "components/pdf/blocks/gift-certificate/gift-certificate.types.ts"+ }+ ],+ "name": "forme/gift-certificate",+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/pdf-image",+ "@pdfcn/forme/section",+ "@pdfcn/forme/text"+ ],+ "title": "Gift Certificate",+ "type": "registry:block"+ },+ {+ "dependencies": ["@formepdf/react", "@formepdf/core"],+ "description": "Medical Intake Form PDF block (forme)",+ "files": [+ {+ "path": "registry/bases/forme/blocks/medical-intake-form/medical-intake-form.tsx",+ "type": "registry:block",+ "target": "components/pdf/blocks/medical-intake-form/medical-intake-form.tsx"+ },+ {+ "path": "registry/bases/forme/blocks/medical-intake-form/medical-intake-form.types.ts",+ "type": "registry:block",+ "target": "components/pdf/blocks/medical-intake-form/medical-intake-form.types.ts"+ }+ ],+ "name": "forme/medical-intake-form",+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/form",+ "@pdfcn/forme/list",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/pdf-image",+ "@pdfcn/forme/section",+ "@pdfcn/forme/signature",+ "@pdfcn/forme/table",+ "@pdfcn/forme/text"+ ],+ "title": "Medical Intake Form",+ "type": "registry:block"+ },+ {+ "dependencies": ["@formepdf/react", "@formepdf/core", "qrcode"],+ "description": "Shipping Label PDF block (forme)",+ "files": [+ {+ "path": "registry/bases/forme/blocks/shipping-label/shipping-label.tsx",+ "type": "registry:block",+ "target": "components/pdf/blocks/shipping-label/shipping-label.tsx"+ },+ {+ "path": "registry/bases/forme/blocks/shipping-label/shipping-label.types.ts",+ "type": "registry:block",+ "target": "components/pdf/blocks/shipping-label/shipping-label.types.ts"+ }+ ],+ "name": "forme/shipping-label",+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/qrcode",+ "@pdfcn/forme/text"+ ],+ "title": "Shipping Label",+ "type": "registry:block"+ },+ {+ "dependencies": ["@formepdf/react", "@formepdf/core", "qrcode"],+ "description": "Event Ticket PDF block (forme)",+ "files": [+ {+ "path": "registry/bases/forme/blocks/event-ticket/event-ticket.tsx",+ "type": "registry:block",+ "target": "components/pdf/blocks/event-ticket/event-ticket.tsx"+ },+ {+ "path": "registry/bases/forme/blocks/event-ticket/event-ticket.types.ts",+ "type": "registry:block",+ "target": "components/pdf/blocks/event-ticket/event-ticket.types.ts"+ }+ ],+ "name": "forme/event-ticket",+ "registryDependencies": [+ "@pdfcn/forme/pdf-image",+ "@pdfcn/forme/qrcode",+ "@pdfcn/forme/text",+ "@pdfcn/forme/utils"+ ],+ "title": "Event Ticket",+ "type": "registry:block"+ },{"dependencies": ["@formepdf/react", "@formepdf/core"],"description": "Report Financial PDF block (forme)",diff --git a/apps/web/registry.json b/apps/web/registry.jsonindex 8f66d88..7718401 100644--- a/apps/web/registry.json+++ b/apps/web/registry.json@@ -1954,6 +1954,111 @@"title": "Press Release","type": "registry:block"},+ {+ "dependencies": ["@formepdf/react", "@formepdf/core"],+ "description": "Gift Certificate PDF block (forme)",+ "files": [+ {+ "path": "registry/bases/forme/blocks/gift-certificate/gift-certificate.tsx",+ "type": "registry:block",+ "target": "components/pdf/blocks/gift-certificate/gift-certificate.tsx"+ },+ {+ "path": "registry/bases/forme/blocks/gift-certificate/gift-certificate.types.ts",+ "type": "registry:block",+ "target": "components/pdf/blocks/gift-certificate/gift-certificate.types.ts"+ }+ ],+ "name": "forme/gift-certificate",+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/pdf-image",+ "@pdfcn/forme/section",+ "@pdfcn/forme/text"+ ],+ "title": "Gift Certificate",+ "type": "registry:block"+ },+ {+ "dependencies": ["@formepdf/react", "@formepdf/core"],+ "description": "Medical Intake Form PDF block (forme)",+ "files": [+ {+ "path": "registry/bases/forme/blocks/medical-intake-form/medical-intake-form.tsx",+ "type": "registry:block",+ "target": "components/pdf/blocks/medical-intake-form/medical-intake-form.tsx"+ },+ {+ "path": "registry/bases/forme/blocks/medical-intake-form/medical-intake-form.types.ts",+ "type": "registry:block",+ "target": "components/pdf/blocks/medical-intake-form/medical-intake-form.types.ts"+ }+ ],+ "name": "forme/medical-intake-form",+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/form",+ "@pdfcn/forme/list",+ "@pdfcn/forme/page-footer",+ "@pdfcn/forme/page-header",+ "@pdfcn/forme/pdf-image",+ "@pdfcn/forme/section",+ "@pdfcn/forme/signature",+ "@pdfcn/forme/table",+ "@pdfcn/forme/text"+ ],+ "title": "Medical Intake Form",+ "type": "registry:block"+ },+ {+ "dependencies": ["@formepdf/react", "@formepdf/core", "qrcode"],+ "description": "Shipping Label PDF block (forme)",+ "files": [+ {+ "path": "registry/bases/forme/blocks/shipping-label/shipping-label.tsx",+ "type": "registry:block",+ "target": "components/pdf/blocks/shipping-label/shipping-label.tsx"+ },+ {+ "path": "registry/bases/forme/blocks/shipping-label/shipping-label.types.ts",+ "type": "registry:block",+ "target": "components/pdf/blocks/shipping-label/shipping-label.types.ts"+ }+ ],+ "name": "forme/shipping-label",+ "registryDependencies": [+ "@pdfcn/forme/utils",+ "@pdfcn/forme/qrcode",+ "@pdfcn/forme/text"+ ],+ "title": "Shipping Label",+ "type": "registry:block"+ },+ {+ "dependencies": ["@formepdf/react", "@formepdf/core", "qrcode"],+ "description": "Event Ticket PDF block (forme)",+ "files": [+ {+ "path": "registry/bases/forme/blocks/event-ticket/event-ticket.tsx",+ "type": "registry:block",+ "target": "components/pdf/blocks/event-ticket/event-ticket.tsx"+ },+ {+ "path": "registry/bases/forme/blocks/event-ticket/event-ticket.types.ts",+ "type": "registry:block",+ "target": "components/pdf/blocks/event-ticket/event-ticket.types.ts"+ }+ ],+ "name": "forme/event-ticket",+ "registryDependencies": [+ "@pdfcn/forme/pdf-image",+ "@pdfcn/forme/qrcode",+ "@pdfcn/forme/text",+ "@pdfcn/forme/utils"+ ],+ "title": "Event Ticket",+ "type": "registry:block"+ },{"dependencies": ["@formepdf/react", "@formepdf/core"],"description": "Report Financial PDF block (forme)",diff --git a/apps/web/registry/bases/forme/blocks/event-ticket/event-ticket.tsx b/apps/web/registry/bases/forme/blocks/event-ticket/event-ticket.tsxnew file mode 100644index 0000000..d2da1bd--- /dev/null+++ b/apps/web/registry/bases/forme/blocks/event-ticket/event-ticket.tsx@@ -0,0 +1,466 @@+import { Document, Page, StyleSheet, View } from "@formepdf/react";++import { PdfImage } from "@/registry/bases/forme/components/pdf-image/pdf-image";+import { PdfQRCode } from "@/registry/bases/forme/components/qrcode/qrcode";+import { Text } from "@/registry/bases/forme/components/text/text";+import {+ PdfcnThemeProvider,+ usePdfcnTheme,+} from "@/registry/bases/forme/components/theme-provider";+import { resolveColor } from "@/registry/bases/forme/lib/resolve-color";+import type { PdfcnTheme } from "@/registry/types/pdf-themes";++import type { EventTicketData } from "./event-ticket.types";++// Sample data — replace with your own props or data source+const sampleData: EventTicketData = {+ accentColor: "#52525b",+ address: "123 Main St, Las Vegas, NV",+ doorsOpen: "8:00 AM",+ eventDate: "May 15, 2026",+ eventName: "ShadCN Labs Conf",+ eventTime: "9:00 AM",+ logoUrl: "/favicon.png",+ organizer: "ShadCN Labs",+ seat: { number: "12", row: "3", section: "A" },+ socialLinks: [+ { platform: "X", url: "x.com/shadcn" },+ { platform: "Instagram", url: "instagram.com/shadcn" },+ ],+ terms: "Ticket is non-transferable. All sales final. No re-entry.",+ ticketNumber: "TKT-00142",+ ticketType: "VIP",+ venue: "Convention Center",+};++// Standard event ticket, 7" x 3.5", expressed in PDF points (72 dpi)+const TICKET_SIZE = { height: 252, width: 504 };++const STUB_WIDTH = 120;++const STRIPE_WIDTH = 8;++const NOTCH_RADIUS = 8;++// Forme renders neither dashed borders nor dashed SVG strokes, so the+// perforation is painted as a stack of short dashes along the stub seam.+const PERFORATION_WIDTH = 1.5;++const PERFORATION_DASH = 4;++const PERFORATION_GAP = 3;++const perforationOffsets: number[] = [];+for (+ let offset = 0;+ offset < TICKET_SIZE.height;+ offset += PERFORATION_DASH + PERFORATION_GAP+) {+ perforationOffsets.push(offset);+}++const hexRgb = (color: string): [number, number, number] | null => {+ const hex = color.trim().replace(/^#/, "");++ if (/^[0-9a-f]{3}$/i.test(hex)) {+ return [+ Number.parseInt(hex[0] + hex[0], 16),+ Number.parseInt(hex[1] + hex[1], 16),+ Number.parseInt(hex[2] + hex[2], 16),+ ];+ }++ if (/^[0-9a-f]{6}([0-9a-f]{2})?$/i.test(hex)) {+ return [+ Number.parseInt(hex.slice(0, 2), 16),+ Number.parseInt(hex.slice(2, 4), 16),+ Number.parseInt(hex.slice(4, 6), 16),+ ];+ }++ return null;+};++const inkOnAccent = (accent: string, light: string, dark: string) => {+ const rgb = hexRgb(accent);++ if (!rgb) {+ return dark;+ }++ const [r, g, b] = rgb;+ const luminance = (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255;++ return luminance > 0.55 ? dark : light;+};++const socialHandle = (url: string) => {+ const clean = url+ .replace(/^https?:\/\//i, "")+ .replace(/^www\./i, "")+ .replace(/\/$/, "");+ const parts = clean.split("/").filter(Boolean);+ const handle = parts.at(-1);++ if (parts.length > 1 && handle) {+ return handle.startsWith("@") ? handle : `@${handle}`;+ }++ return clean;+};++const EventTicketContent = ({ data }: { data: EventTicketData }) => {+ const theme = usePdfcnTheme();+ const paper = theme.colors.background;+ const ink = theme.colors.foreground;+ const quiet = theme.colors.mutedForeground;++ const accent = resolveColor(+ data.accentColor ?? theme.colors.primary,+ theme.colors+ );+ const onAccent = inkOnAccent(accent, paper, ink);++ const styles = StyleSheet.create({+ admit: {+ color: onAccent,+ fontSize: 7,+ fontWeight: "bold",+ letterSpacing: 2,+ textTransform: "uppercase",+ },+ body: {+ flex: 1,+ height: TICKET_SIZE.height,+ justifyContent: "space-between",+ paddingBottom: 16,+ paddingLeft: 20,+ paddingRight: 18,+ paddingTop: 18,+ },+ brand: {+ alignItems: "center",+ flexDirection: "row",+ gap: 8,+ marginBottom: 14,+ },+ fact: {+ flexShrink: 1,+ minWidth: 0,+ paddingRight: 12,+ },+ facts: {+ flexDirection: "row",+ },+ footer: {+ alignItems: "center",+ flexDirection: "row",+ gap: 12,+ marginTop: 10,+ },+ label: {+ color: quiet,+ fontSize: 7,+ fontWeight: "bold",+ letterSpacing: 1.2,+ marginBottom: 3,+ textTransform: "uppercase",+ },+ logo: { borderRadius: 3, height: 14, width: 14 },+ notchBottom: {+ backgroundColor: paper,+ borderRadius: NOTCH_RADIUS,+ bottom: -NOTCH_RADIUS,+ height: NOTCH_RADIUS * 2,+ left: TICKET_SIZE.width - STUB_WIDTH - NOTCH_RADIUS,+ position: "absolute",+ width: NOTCH_RADIUS * 2,+ },+ notchTop: {+ backgroundColor: paper,+ borderRadius: NOTCH_RADIUS,+ height: NOTCH_RADIUS * 2,+ left: TICKET_SIZE.width - STUB_WIDTH - NOTCH_RADIUS,+ position: "absolute",+ top: -NOTCH_RADIUS,+ width: NOTCH_RADIUS * 2,+ },+ organizer: {+ color: quiet,+ // Forme ignores `marginLeft: "auto"`, so the organizer line absorbs the+ // free space and pushes the ticket-type pill to the right edge.+ flexGrow: 1,+ fontSize: 8,+ fontWeight: "bold",+ letterSpacing: 1.1,+ textTransform: "uppercase",+ },+ page: {+ alignItems: "stretch",+ backgroundColor: paper,+ flexDirection: "row",+ height: TICKET_SIZE.height,+ overflow: "hidden",+ position: "relative",+ width: TICKET_SIZE.width,+ },+ perforation: {+ height: TICKET_SIZE.height,+ left: TICKET_SIZE.width - STUB_WIDTH - PERFORATION_WIDTH / 2,+ position: "absolute",+ top: 0,+ width: PERFORATION_WIDTH,+ },+ perforationDash: {+ backgroundColor: paper,+ height: PERFORATION_DASH,+ marginBottom: PERFORATION_GAP,+ width: PERFORATION_WIDTH,+ },+ pill: {+ backgroundColor: accent,+ borderRadius: 9,+ paddingHorizontal: 8,+ paddingVertical: 3,+ },+ pillText: {+ color: onAccent,+ fontSize: 7,+ fontWeight: "bold",+ letterSpacing: 1.2,+ textTransform: "uppercase",+ },+ qr: {+ backgroundColor: "#ffffff",+ borderRadius: 6,+ padding: 5,+ },+ serial: {+ color: onAccent,+ fontSize: 7,+ fontWeight: "bold",+ letterSpacing: 1.1,+ textTransform: "uppercase",+ },+ socialItem: {+ alignItems: "center",+ flexDirection: "row",+ gap: 4,+ },+ socialLabel: {+ color: quiet,+ fontSize: 6.5,+ fontWeight: "bold",+ letterSpacing: 0.4,+ textTransform: "uppercase",+ },+ socialList: {+ alignItems: "center",+ flexDirection: "row",+ gap: 8,+ },+ socialValue: {+ color: quiet,+ fontSize: 6.5,+ },+ stripe: {+ backgroundColor: accent,+ height: TICKET_SIZE.height,+ width: STRIPE_WIDTH,+ },+ stub: {+ alignItems: "center",+ backgroundColor: accent,+ height: TICKET_SIZE.height,+ justifyContent: "space-between",+ paddingBottom: 14,+ paddingHorizontal: 12,+ paddingTop: 16,+ width: STUB_WIDTH,+ },+ terms: {+ color: quiet,+ flex: 1,+ fontSize: 6.5,+ lineHeight: 1.4,+ paddingRight: 8,+ },+ title: {+ color: ink,+ fontSize: 26,+ fontWeight: "bold",+ letterSpacing: -0.6,+ lineHeight: 1.08,+ marginBottom: 8,+ },+ value: {+ color: ink,+ fontSize: 12,+ fontWeight: "bold",+ },+ venue: {+ color: quiet,+ fontSize: 10,+ lineHeight: 1.4,+ },+ });++ return (+ <Document title={`${data.eventName} ${data.ticketNumber}`}>+ <Page margin={0} size={TICKET_SIZE}>+ <View style={styles.page as never}>+ <View style={styles.stripe} />++ <View style={styles.body}>+ <View>+ <View style={styles.brand}>+ {data.logoUrl && (+ <PdfImage+ fit="contain"+ src={data.logoUrl}+ style={styles.logo}+ />+ )}+ <Text noMargin style={styles.organizer}>+ {data.organizer ?? "Event ticket"}+ </Text>+ <View style={styles.pill}>+ <Text noMargin style={styles.pillText}>+ {data.ticketType}+ </Text>+ </View>+ </View>+ <Text noMargin style={styles.title}>+ {data.eventName}+ </Text>+ <Text noMargin style={styles.venue}>+ {data.venue}+ </Text>+ <Text noMargin style={styles.venue}>+ {data.address}+ </Text>+ </View>++ <View>+ <View style={styles.facts}>+ <View style={styles.fact}>+ <Text noMargin style={styles.label}>+ Date+ </Text>+ <Text noMargin style={styles.value}>+ {data.eventDate}+ </Text>+ </View>+ <View style={styles.fact}>+ <Text noMargin style={styles.label}>+ Time+ </Text>+ <Text noMargin style={styles.value}>+ {data.eventTime}+ </Text>+ </View>+ {data.doorsOpen && (+ <View style={styles.fact}>+ <Text noMargin style={styles.label}>+ Doors+ </Text>+ <Text noMargin style={styles.value}>+ {data.doorsOpen}+ </Text>+ </View>+ )}+ {data.seat && (+ <View style={styles.fact}>+ <Text noMargin style={styles.label}>+ Seat+ </Text>+ <Text noMargin style={styles.value}>+ {`${data.seat.section}–${data.seat.row}–${data.seat.number}`}+ </Text>+ </View>+ )}+ </View>+ {(data.terms ||+ (data.socialLinks && data.socialLinks.length > 0)) && (+ <View style={styles.footer}>+ {data.terms && (+ <Text noMargin style={styles.terms}>+ {data.terms}+ </Text>+ )}+ {data.socialLinks && data.socialLinks.length > 0 && (+ <View style={styles.socialList}>+ {data.socialLinks.map((link) => (+ <View+ key={`${link.platform}-${link.url}`}+ style={styles.socialItem}+ >+ <Text noMargin style={styles.socialLabel}>+ {link.platform}+ </Text>+ <Text noMargin style={styles.socialValue}>+ {socialHandle(link.url)}+ </Text>+ </View>+ ))}+ </View>+ )}+ </View>+ )}+ </View>+ </View>++ <View style={styles.stub}>+ <Text noMargin style={styles.admit}>+ Admit one+ </Text>+ <View style={styles.qr}>+ {data.qrCodeUrl ? (+ <PdfImage+ fit="contain"+ height={68}+ src={data.qrCodeUrl}+ width={68}+ />+ ) : (+ <PdfQRCode+ backgroundColor="#ffffff"+ color="#000000"+ size={68}+ value={data.ticketNumber}+ />+ )}+ </View>+ <Text noMargin style={styles.serial}>+ {data.ticketNumber}+ </Text>+ </View>++ <View style={styles.perforation}>+ {perforationOffsets.map((offset) => (+ <View+ key={`perforation-${offset}`}+ style={styles.perforationDash}+ />+ ))}+ </View>++ <View style={styles.notchTop} />+ <View style={styles.notchBottom} />+ </View>+ </Page>+ </Document>+ );+};++export const EventTicketDocument = ({+ theme,+ data = sampleData,+}: {+ theme?: PdfcnTheme;+ data?: EventTicketData;+}) => (+ <PdfcnThemeProvider theme={theme}>+ <EventTicketContent data={data} />+ </PdfcnThemeProvider>+);diff --git a/apps/web/registry/bases/forme/blocks/event-ticket/event-ticket.types.ts b/apps/web/registry/bases/forme/blocks/event-ticket/event-ticket.types.tsnew file mode 100644index 0000000..20e88e8--- /dev/null+++ b/apps/web/registry/bases/forme/blocks/event-ticket/event-ticket.types.ts@@ -0,0 +1,28 @@+export interface EventTicketSeat {+ number: string;+ row: string;+ section: string;+}++export interface EventTicketSocialLink {+ platform: string;+ url: string;+}++export interface EventTicketData {+ accentColor?: string;+ address: string;+ doorsOpen?: string;+ eventName: string;+ eventDate: string;+ eventTime: string;+ logoUrl?: string;+ organizer?: string;+ qrCodeUrl?: string;+ seat?: EventTicketSeat;+ socialLinks?: EventTicketSocialLink[];+ terms?: string;+ ticketNumber: string;+ ticketType: string;+ venue: string;+}diff --git a/apps/web/registry/bases/forme/blocks/gift-certificate/gift-certificate.tsx b/apps/web/registry/bases/forme/blocks/gift-certificate/gift-certificate.tsxnew file mode 100644index 0000000..2e4e046--- /dev/null+++ b/apps/web/registry/bases/forme/blocks/gift-certificate/gift-certificate.tsx@@ -0,0 +1,297 @@+import { Document, Page, StyleSheet, View } from "@formepdf/react";++import { PdfImage } from "@/registry/bases/forme/components/pdf-image/pdf-image";+import { Section } from "@/registry/bases/forme/components/section/section";+import { Text } from "@/registry/bases/forme/components/text/text";+import {+ PdfcnThemeProvider,+ usePdfcnTheme,+} from "@/registry/bases/forme/components/theme-provider";+import type { PdfcnTheme } from "@/registry/types/pdf-themes";++import type { GiftCertificateData } from "./gift-certificate.types";++// Sample data — replace with your own props or data source+const sampleData: GiftCertificateData = {+ accentColor: "#000000",+ amount: 50,+ certificateCode: "PDFCN-GC-2026-00891",+ companyLogo: "/favicon.png",+ companyName: "pdfcn",+ currency: "USD",+ expiryDate: "March 31, 2027",+ message: "Happy Birthday! Enjoy a coffee on us.",+ recipientName: "Sarah",+ redemptionInstructions: "Present this certificate at any pdfcn location.",+ senderName: "Mom & Dad",+ terms: "No cash value. Non-refundable. One use per visit.",+};++const GiftCertificateContent = ({ data }: { data: GiftCertificateData }) => {+ const theme = usePdfcnTheme();+ const accentColor = data.accentColor || "#000000";+ const currencySymbol = data.currency === "USD" ? "$" : data.currency || "$";++ const styles = StyleSheet.create({+ amount: {+ color: accentColor,+ fontSize: 36,+ fontWeight: "bold",+ },+ amountContainer: {+ alignItems: "center",+ backgroundColor: theme.colors.muted,+ borderColor: accentColor,+ borderRadius: theme.primitives.borderRadius.md,+ borderStyle: "solid",+ borderWidth: 2,+ marginBottom: 10,+ marginTop: 10,+ paddingHorizontal: 20,+ paddingVertical: 12,+ },+ code: {+ color: theme.colors.foreground,+ fontFamily: "Courier",+ fontSize: 13,+ fontWeight: "bold",+ letterSpacing: 1.2,+ },+ codeBox: {+ alignItems: "center",+ backgroundColor: theme.colors.background,+ borderColor: theme.colors.border,+ borderRadius: theme.primitives.borderRadius.sm,+ borderStyle: "solid",+ borderWidth: 1,+ marginBottom: 8,+ marginTop: 8,+ paddingHorizontal: 14,+ paddingVertical: 8,+ },+ decorativeBorder: {+ borderColor: accentColor,+ borderRadius: theme.primitives.borderRadius.lg,+ borderStyle: "solid",+ borderWidth: 3,+ padding: 16,+ position: "relative",+ },+ fieldLabel: {+ color: theme.colors.mutedForeground,+ fontSize: 9,+ fontWeight: "bold",+ letterSpacing: 1,+ marginBottom: 4,+ textTransform: "uppercase",+ },+ fieldValue: {+ color: theme.colors.foreground,+ fontSize: 14,+ fontWeight: 500,+ },+ header: {+ alignItems: "center",+ marginBottom: 8,+ },+ innerBorder: {+ borderColor: accentColor,+ borderRadius: theme.primitives.borderRadius.md,+ borderStyle: "dashed",+ borderWidth: 1,+ padding: 18,+ },+ instructionsBox: {+ marginTop: 8,+ },+ logo: {+ height: 28,+ marginBottom: 6,+ width: 28,+ },+ messageBox: {+ backgroundColor: theme.colors.muted,+ borderRadius: theme.primitives.borderRadius.sm,+ marginBottom: 8,+ marginTop: 8,+ padding: 10,+ },+ page: {+ backgroundColor: theme.colors.background,+ },+ termsText: {+ color: theme.colors.mutedForeground,+ fontSize: 8,+ lineHeight: 1.4,+ textAlign: "center",+ },+ title: {+ color: accentColor,+ fontSize: 22,+ fontWeight: "bold",+ letterSpacing: 2,+ textAlign: "center",+ textTransform: "uppercase",+ },+ });++ return (+ <Document title={`Gift Certificate ${data.certificateCode}`}>+ <Page margin={24} size="A4">+ <View style={styles.page as never}>+ <View style={styles.decorativeBorder as never}>+ <View style={styles.innerBorder as never}>+ <Section noWrap style={styles.header}>+ {data.companyLogo && (+ <PdfImage+ src={data.companyLogo ?? "/favicon.png"}+ style={styles.logo}+ />+ )}+ <Text style={styles.title} noMargin>+ Gift Certificate+ </Text>+ {data.companyName && (+ <Text+ style={{+ color: theme.colors.foreground,+ fontSize: 13,+ fontWeight: 500,+ marginTop: 4,+ textAlign: "center",+ }}+ noMargin+ >+ {data.companyName}+ </Text>+ )}+ </Section>++ <Section noWrap style={styles.amountContainer}>+ <Text style={styles.amount} noMargin>+ {currencySymbol}+ {data.amount.toFixed(2)}+ </Text>+ </Section>++ <Section+ noWrap+ style={{+ flexDirection: "row",+ gap: 28,+ marginBottom: 8,+ }}+ >+ <View style={{ flex: 1 }}>+ <Text style={styles.fieldLabel} noMargin>+ To+ </Text>+ <Text style={styles.fieldValue} noMargin>+ {data.recipientName}+ </Text>+ </View>+ <View style={{ flex: 1 }}>+ <Text style={styles.fieldLabel} noMargin>+ From+ </Text>+ <Text style={styles.fieldValue} noMargin>+ {data.senderName}+ </Text>+ </View>+ </Section>++ {data.message && (+ <Section noWrap style={styles.messageBox}>+ <Text+ style={{+ color: theme.colors.foreground,+ fontSize: 10,+ fontStyle: "italic",+ lineHeight: 1.4,+ textAlign: "center",+ }}+ noMargin+ >+ "{data.message}"+ </Text>+ </Section>+ )}++ <Section noWrap style={styles.codeBox}>+ <Text style={styles.fieldLabel} noMargin>+ Certificate Code+ </Text>+ <Text style={styles.code} noMargin>+ {data.certificateCode}+ </Text>+ </Section>++ <Section+ noWrap+ style={{+ alignItems: "center",+ marginBottom: 8,+ }}+ >+ <Text style={styles.fieldLabel} noMargin>+ Valid Until+ </Text>+ <Text+ style={{+ color: accentColor,+ fontSize: 12,+ fontWeight: "bold",+ }}+ noMargin+ >+ {data.expiryDate}+ </Text>+ </Section>++ {data.redemptionInstructions && (+ <Section noWrap style={styles.instructionsBox}>+ <Text+ style={{+ color: theme.colors.foreground,+ fontSize: 9,+ lineHeight: 1.3,+ textAlign: "center",+ }}+ noMargin+ >+ {data.redemptionInstructions}+ </Text>+ </Section>+ )}++ {data.terms && (+ <Section+ noWrap+ style={{+ marginTop: 10,+ }}+ >+ <Text style={styles.termsText} noMargin>+ {data.terms}+ </Text>+ </Section>+ )}+ </View>+ </View>+ </View>+ </Page>+ </Document>+ );+};++export const GiftCertificateDocument = ({+ theme,+ data = sampleData,+}: {+ theme?: PdfcnTheme;+ data?: GiftCertificateData;+}) => (+ <PdfcnThemeProvider theme={theme}>+ <GiftCertificateContent data={data} />+ </PdfcnThemeProvider>+);diff --git a/apps/web/registry/bases/forme/blocks/gift-certificate/gift-certificate.types.ts b/apps/web/registry/bases/forme/blocks/gift-certificate/gift-certificate.types.tsnew file mode 100644index 0000000..1f2589d--- /dev/null+++ b/apps/web/registry/bases/forme/blocks/gift-certificate/gift-certificate.types.ts@@ -0,0 +1,16 @@+export interface GiftCertificateData {+ companyName: string;+ companyLogo?: string;+ amount: number;+ currency?: string;+ recipientName: string;+ senderName: string;+ message?: string;+ certificateCode: string;+ expiryDate: string;+ redemptionInstructions?: string;+ terms?: string;+ companyContact?: string;+ accentColor?: string;+ renderingBase?: "takumi" | "forme";+}diff --git a/apps/web/registry/bases/forme/blocks/medical-intake-form/medical-intake-form.tsx b/apps/web/registry/bases/forme/blocks/medical-intake-form/medical-intake-form.tsxnew file mode 100644index 0000000..afc5e27--- /dev/null+++ b/apps/web/registry/bases/forme/blocks/medical-intake-form/medical-intake-form.tsx@@ -0,0 +1,570 @@+import { Document, Page, StyleSheet, View } from "@formepdf/react";++import { PdfForm } from "@/registry/bases/forme/components/form/form";+import { PdfList } from "@/registry/bases/forme/components/list/list";+import { PageFooter } from "@/registry/bases/forme/components/page-footer/page-footer";+import { PageHeader } from "@/registry/bases/forme/components/page-header/page-header";+import { PdfImage } from "@/registry/bases/forme/components/pdf-image/pdf-image";+import { Section } from "@/registry/bases/forme/components/section/section";+import { PdfSignatureBlock } from "@/registry/bases/forme/components/signature/signature";+import {+ Table,+ TableBody,+ TableCell,+ TableHeader,+ TableRow,+} from "@/registry/bases/forme/components/table/table";+import { Text } from "@/registry/bases/forme/components/text/text";+import {+ PdfcnThemeProvider,+ usePdfcnTheme,+ useSafeMemo,+} from "@/registry/bases/forme/components/theme-provider";+import { resolveColor } from "@/registry/bases/forme/lib/resolve-color";+import type { PdfcnTheme } from "@/registry/types/pdf-themes";++import type { MedicalIntakeFormProps } from "./medical-intake-form.types";++const FORM_VERSION = "Form v1.0 · Revised 09/2026";+const FORM_STYLE = { marginBottom: 0 };++const SECOND_PAGE_MARGIN_BOTTOM = 44;+const SECOND_PAGE_MARGIN_TOP = 24;++const MEDICAL_CONDITIONS = [+ "Diabetes",+ "High Blood Pressure",+ "Heart Disease",+ "Asthma",+ "COPD",+ "Cancer",+ "Stroke",+ "Thyroid Disorder",+ "Kidney Disease",+ "Liver Disease",+ "Seizures / Epilepsy",+ "Other",+];++const CONSENT_ACKNOWLEDGMENTS = [+ { checked: false, text: "I have read and understand the consent above." },+ { checked: false, text: "I have received the Notice of Privacy Practices." },+];++const MEDICATION_ROWS = [+ "medication-1",+ "medication-2",+ "medication-3",+ "medication-4",+];++const ALLERGY_ROWS = ["allergy-1", "allergy-2", "allergy-3"];++const BLANK_CELL = <View style={{ minHeight: 14 }} />;++const blankChecklist = (labels: string[]) =>+ labels.map((text) => ({ checked: false, text }));++const createIntakeStyles = (t: PdfcnTheme) =>+ StyleSheet.create({+ column: { flex: 1 },+ consentText: {+ fontSize: t.primitives.typography.xs,+ lineHeight: 1.4,+ marginBottom: 6,+ },+ labelText: { fontSize: 9, fontWeight: "bold", letterSpacing: 0.6 },+ page: { backgroundColor: t.colors.background },+ pageTwoHeader: {+ alignItems: "flex-end",+ flexDirection: "row",+ justifyContent: "space-between",+ marginBottom: 8,+ },+ reasonBox: {+ borderColor: t.colors.border,+ borderRadius: t.primitives.borderRadius.sm,+ borderStyle: "solid",+ borderWidth: 1,+ height: 40,+ minHeight: 40,+ },+ row: { flexDirection: "row", gap: 20 },+ section: { marginBottom: 4 },+ sectionRule: {+ borderBottomStyle: "solid",+ borderBottomWidth: 1,+ marginBottom: 4,+ paddingBottom: 2,+ },+ signature: { marginBottom: 0, marginTop: 8 },+ title: { fontSize: 13, fontWeight: "bold" },+ });++const useIntakeStyles = () => {+ const theme = usePdfcnTheme();+ const styles = useSafeMemo(() => createIntakeStyles(theme), [theme]);+ return { styles, theme };+};++const SectionLabel = ({ accent, label }: { accent: string; label: string }) => {+ const { styles } = useIntakeStyles();++ return (+ <View style={{ ...styles.sectionRule, borderBottomColor: accent } as never}>+ <Text noMargin style={styles.labelText} transform="uppercase">+ {label}+ </Text>+ </View>+ );+};++const IntakeHeader = ({+ clinicAddress,+ clinicLogo,+ clinicName,+ clinicPhone,+}: Pick<+ MedicalIntakeFormProps,+ "clinicAddress" | "clinicLogo" | "clinicName" | "clinicPhone"+>) => (+ <PageHeader+ logo={+ clinicLogo ? (+ <PdfImage+ height={48}+ src={clinicLogo}+ style={{ margin: 0 }}+ width={48}+ />+ ) : undefined+ }+ marginBottom={16}+ rightSubText={clinicAddress}+ rightText={clinicPhone}+ subtitle="Patient Intake Form"+ title={clinicName}+ variant="logo-left"+ />+);++const SecondPageHeader = ({+ clinicName,+ clinicPhone,+}: Pick<MedicalIntakeFormProps, "clinicName" | "clinicPhone">) => {+ const { styles } = useIntakeStyles();++ return (+ <View style={styles.pageTwoHeader as never}>+ <Text noMargin style={styles.title}>+ {`${clinicName} — Patient Intake Form (continued)`}+ </Text>+ <Text color="mutedForeground" noMargin variant="xs">+ {clinicPhone}+ </Text>+ </View>+ );+};++const IntakeFooter = ({+ clinicAddress,+ clinicPhone,+ page,+ pagePadding,+ totalPages,+}: Pick<MedicalIntakeFormProps, "clinicAddress" | "clinicPhone"> & {+ page: number;+ pagePadding: number;+ totalPages: number;+}) => (+ <PageFooter+ address={clinicAddress}+ leftText={FORM_VERSION}+ pagePadding={pagePadding}+ phone={clinicPhone}+ rightText={`Page ${page} of ${totalPages}`}+ sticky+ variant="three-column"+ />+);++const PersonalInfoSection = () => (+ <PdfForm+ groups={[+ {+ fields: [+ { height: 14, label: "Full Name" },+ { height: 14, hint: "DD / MM / YYYY", label: "Date of Birth" },+ { height: 14, label: "Gender" },+ { height: 14, hint: "+1 (555) 000-0000", label: "Phone Number" },+ { height: 14, label: "Email Address" },+ ],+ layout: "two-column",+ title: "Patient Information",+ },+ {+ fields: [+ { height: 14, label: "Street Address", width: "100%" },+ { height: 14, label: "City" },+ { height: 14, label: "State / Province" },+ { height: 14, label: "Postal Code" },+ ],+ layout: "two-column",+ title: "Address",+ },+ ]}+ style={FORM_STYLE}+ variant="underline"+ />+);++const EmergencyContactSection = () => (+ <PdfForm+ groups={[+ {+ fields: [+ { height: 14, label: "Emergency Contact Name" },+ { height: 14, label: "Relationship" },+ { height: 14, label: "Phone Number" },+ ],+ layout: "two-column",+ title: "Emergency Contact",+ },+ ]}+ style={FORM_STYLE}+ variant="underline"+ />+);++const InsuranceSection = () => (+ <PdfForm+ groups={[+ {+ fields: [+ { height: 14, label: "Insurance Provider" },+ { height: 14, label: "Policy Number" },+ { height: 14, label: "Group Number" },+ { height: 14, label: "Subscriber Name" },+ ],+ layout: "two-column",+ title: "Insurance",+ },+ ]}+ style={FORM_STYLE}+ variant="underline"+ />+);++const MedicalHistorySection = ({ accent }: { accent: string }) => {+ const { styles } = useIntakeStyles();++ return (+ <View style={styles.section as never}>+ <SectionLabel accent={accent} label="Medical History" />+ <View style={styles.row as never}>+ <View style={styles.column as never}>+ <PdfList+ gap="xs"+ items={blankChecklist(MEDICAL_CONDITIONS.slice(0, 4))}+ variant="checklist"+ />+ </View>+ <View style={styles.column as never}>+ <PdfList+ gap="xs"+ items={blankChecklist(MEDICAL_CONDITIONS.slice(4, 8))}+ variant="checklist"+ />+ </View>+ <View style={styles.column as never}>+ <PdfList+ gap="xs"+ items={blankChecklist(MEDICAL_CONDITIONS.slice(8))}+ variant="checklist"+ />+ </View>+ </View>+ </View>+ );+};++const MedicationsSection = ({ accent }: { accent: string }) => {+ const { styles } = useIntakeStyles();++ return (+ <View style={styles.section as never}>+ <SectionLabel accent={accent} label="Current Medications" />+ <Table variant="grid">+ <TableHeader>+ <TableRow header>+ <TableCell>Medication</TableCell>+ <TableCell>Dosage</TableCell>+ <TableCell>Frequency</TableCell>+ <TableCell>Prescribing Doctor</TableCell>+ </TableRow>+ </TableHeader>+ <TableBody>+ {MEDICATION_ROWS.map((row) => (+ <TableRow key={row}>+ <TableCell>{BLANK_CELL}</TableCell>+ <TableCell>{BLANK_CELL}</TableCell>+ <TableCell>{BLANK_CELL}</TableCell>+ <TableCell>{BLANK_CELL}</TableCell>+ </TableRow>+ ))}+ </TableBody>+ </Table>+ </View>+ );+};++const AllergiesSection = ({ accent }: { accent: string }) => {+ const { styles } = useIntakeStyles();++ return (+ <View style={styles.section as never}>+ <SectionLabel accent={accent} label="Allergies" />+ <Table variant="grid">+ <TableHeader>+ <TableRow header>+ <TableCell>Allergen</TableCell>+ <TableCell>Reaction</TableCell>+ <TableCell>Severity</TableCell>+ </TableRow>+ </TableHeader>+ <TableBody>+ {ALLERGY_ROWS.map((row) => (+ <TableRow key={row}>+ <TableCell>{BLANK_CELL}</TableCell>+ <TableCell>{BLANK_CELL}</TableCell>+ <TableCell>{BLANK_CELL}</TableCell>+ </TableRow>+ ))}+ </TableBody>+ </Table>+ </View>+ );+};++const ReasonForVisitSection = ({ accent }: { accent: string }) => {+ const { styles } = useIntakeStyles();++ return (+ <View style={styles.section as never}>+ <SectionLabel accent={accent} label="Reason for Visit" />+ <View style={styles.reasonBox as never} />+ </View>+ );+};++const ConsentSection = ({+ accent,+ accentColor,+ clinicName,+}: Pick<MedicalIntakeFormProps, "accentColor" | "clinicName"> & {+ accent: string;+}) => {+ const { styles } = useIntakeStyles();++ return (+ <View style={styles.section as never}>+ <SectionLabel accent={accent} label="Consent & Authorization" />+ <Section+ accentColor={accentColor}+ padding="sm"+ spacing="none"+ variant="highlight"+ >+ <Text color="mutedForeground" noMargin style={styles.consentText}>+ {`I authorize ${clinicName} to provide treatment and to release the information required to process insurance claims for this visit, and I acknowledge that I have received the Notice of Privacy Practices (HIPAA) explaining how my health information may be used.`}+ </Text>+ <PdfList gap="xs" items={CONSENT_ACKNOWLEDGMENTS} variant="checklist" />+ </Section>+ <PdfSignatureBlock+ signers={[{ label: "Patient / Guardian Signature" }, { label: "Date" }]}+ style={styles.signature}+ variant="double"+ />+ </View>+ );+};++type IntakeSections = Required<+ Pick<+ MedicalIntakeFormProps,+ | "allergies"+ | "consent"+ | "emergencyContact"+ | "insurance"+ | "medicalHistory"+ | "medications"+ | "personalInfo"+ | "reasonForVisit"+ >+>;++const resolveSections = (props: MedicalIntakeFormProps): IntakeSections => ({+ allergies: props.allergies ?? true,+ consent: props.consent ?? true,+ emergencyContact: props.emergencyContact ?? true,+ insurance: props.insurance ?? true,+ medicalHistory: props.medicalHistory ?? true,+ medications: props.medications ?? true,+ personalInfo: props.personalInfo ?? true,+ reasonForVisit: props.reasonForVisit ?? true,+});++const hasSecondPage = (sections: IntakeSections) =>+ sections.allergies ||+ sections.consent ||+ sections.medications ||+ sections.reasonForVisit;++const FirstPage = ({+ clinicAddress,+ clinicLogo,+ clinicName,+ clinicPhone,+ sections,+ totalPages,+}: Pick<+ MedicalIntakeFormProps,+ "clinicAddress" | "clinicLogo" | "clinicName" | "clinicPhone"+> & {+ sections: IntakeSections;+ totalPages: number;+}) => {+ const { styles, theme } = useIntakeStyles();+ const margin = {+ bottom: theme.spacing.page.marginBottom,+ left: theme.spacing.page.marginLeft,+ right: theme.spacing.page.marginRight,+ top: theme.spacing.page.marginTop,+ };++ return (+ <Page margin={margin} size="A4">+ <IntakeFooter+ clinicAddress={clinicAddress}+ clinicPhone={clinicPhone}+ page={1}+ pagePadding={margin.bottom}+ totalPages={totalPages}+ />+ <View style={styles.page as never}>+ <IntakeHeader+ clinicAddress={clinicAddress}+ clinicLogo={clinicLogo}+ clinicName={clinicName}+ clinicPhone={clinicPhone}+ />+ {sections.personalInfo ? <PersonalInfoSection /> : null}+ {sections.emergencyContact ? <EmergencyContactSection /> : null}+ {sections.insurance ? <InsuranceSection /> : null}+ </View>+ </Page>+ );+};++const SecondPage = ({+ accent,+ accentColor,+ clinicAddress,+ clinicName,+ clinicPhone,+ sections,+ totalPages,+}: Pick<+ MedicalIntakeFormProps,+ "accentColor" | "clinicAddress" | "clinicName" | "clinicPhone"+> & {+ accent: string;+ sections: IntakeSections;+ totalPages: number;+}) => {+ const { styles, theme } = useIntakeStyles();+ const margin = {+ bottom: SECOND_PAGE_MARGIN_BOTTOM,+ left: theme.spacing.page.marginLeft,+ right: theme.spacing.page.marginRight,+ top: SECOND_PAGE_MARGIN_TOP,+ };++ return (+ <Page margin={margin} size="A4">+ <IntakeFooter+ clinicAddress={clinicAddress}+ clinicPhone={clinicPhone}+ page={2}+ pagePadding={margin.bottom}+ totalPages={totalPages}+ />+ <View style={styles.page as never}>+ <SecondPageHeader clinicName={clinicName} clinicPhone={clinicPhone} />+ {sections.medicalHistory ? (+ <MedicalHistorySection accent={accent} />+ ) : null}+ {sections.medications ? <MedicationsSection accent={accent} /> : null}+ {sections.allergies ? <AllergiesSection accent={accent} /> : null}+ {sections.reasonForVisit ? (+ <ReasonForVisitSection accent={accent} />+ ) : null}+ {sections.consent ? (+ <ConsentSection+ accent={accent}+ accentColor={accentColor}+ clinicName={clinicName}+ />+ ) : null}+ </View>+ </Page>+ );+};++const MedicalIntakeFormContent = (props: MedicalIntakeFormProps) => {+ const { theme } = useIntakeStyles();+ const sections = resolveSections(props);+ const accent = props.accentColor+ ? resolveColor(props.accentColor, theme.colors)+ : theme.colors.primary;+ const totalPages = hasSecondPage(sections) ? 2 : 1;++ return (+ <Document title={`${props.clinicName} — Patient Intake Form`}>+ <FirstPage+ clinicAddress={props.clinicAddress}+ clinicLogo={props.clinicLogo}+ clinicName={props.clinicName}+ clinicPhone={props.clinicPhone}+ sections={sections}+ totalPages={totalPages}+ />+ {totalPages > 1 ? (+ <SecondPage+ accent={accent}+ accentColor={props.accentColor}+ clinicAddress={props.clinicAddress}+ clinicName={props.clinicName}+ clinicPhone={props.clinicPhone}+ sections={sections}+ totalPages={totalPages}+ />+ ) : null}+ </Document>+ );+};++/**+ * Print-ready medical intake form with patient, emergency contact, insurance,+ * medical history, medication, allergy, reason for visit, and consent+ * sections. Every section can be hidden through its boolean prop, and all+ * fields are left blank for the patient to complete by hand.+ */+export const MedicalIntakeFormDocument = ({+ theme,+ ...props+}: MedicalIntakeFormProps) => (+ <PdfcnThemeProvider theme={theme}>+ <MedicalIntakeFormContent {...props} />+ </PdfcnThemeProvider>+);diff --git a/apps/web/registry/bases/forme/blocks/medical-intake-form/medical-intake-form.types.ts b/apps/web/registry/bases/forme/blocks/medical-intake-form/medical-intake-form.types.tsnew file mode 100644index 0000000..3041812--- /dev/null+++ b/apps/web/registry/bases/forme/blocks/medical-intake-form/medical-intake-form.types.ts@@ -0,0 +1,53 @@+import type { PdfcnTheme } from "@/registry/types/pdf-themes";++/**+ * Medical intake form properties.+ * Props - `clinicName` | `clinicLogo` | `clinicAddress` | `clinicPhone` |+ * `personalInfo` | `emergencyContact` | `insurance` | `medicalHistory` |+ * `medications` | `allergies` | `reasonForVisit` | `consent` | `accentColor` | `theme`+ * @see {@link MedicalIntakeFormDocument}+ */+export interface MedicalIntakeFormProps {+ clinicName: string;+ clinicLogo?: string;+ clinicAddress?: string;+ clinicPhone?: string;+ /**+ * @default true+ */+ personalInfo?: boolean;+ /**+ * @default true+ */+ emergencyContact?: boolean;+ /**+ * @default true+ */+ insurance?: boolean;+ /**+ * @default true+ */+ medicalHistory?: boolean;+ /**+ * @default true+ */+ medications?: boolean;+ /**+ * @default true+ */+ allergies?: boolean;+ /**+ * @default true+ */+ reasonForVisit?: boolean;+ /**+ * @default true+ */+ consent?: boolean;+ /**+ * Theme color token (e.g. `"primary"`) or raw CSS color (e.g. `"#0d9488"`)+ * applied to section rules, table accents, and the consent callout.+ */+ accentColor?: string;+ theme?: PdfcnTheme;+}diff --git a/apps/web/registry/bases/forme/blocks/shipping-label/shipping-label.tsx b/apps/web/registry/bases/forme/blocks/shipping-label/shipping-label.tsxnew file mode 100644index 0000000..1428b4c--- /dev/null+++ b/apps/web/registry/bases/forme/blocks/shipping-label/shipping-label.tsx@@ -0,0 +1,316 @@+import { Document, Page, StyleSheet, View } from "@formepdf/react";++import { PdfQRCode } from "@/registry/bases/forme/components/qrcode/qrcode";+import { Text } from "@/registry/bases/forme/components/text/text";+import {+ PdfcnThemeProvider,+ usePdfcnTheme,+} from "@/registry/bases/forme/components/theme-provider";+import { Image } from "@/registry/bases/forme/lib/pdf-primitives";+import { resolveColor } from "@/registry/bases/forme/lib/resolve-color";+import type { PdfcnTheme } from "@/registry/types/pdf-themes";++import type {+ ShippingLabelAddress,+ ShippingLabelData,+} from "./shipping-label.types";++// Sample data — replace with your own props or data source+const sampleData: ShippingLabelData = {+ carrier: "UPS",+ dimensions: '12" x 8" x 6"',+ from: {+ address: "456 Industrial Blvd",+ city: "Los Angeles",+ country: "USA",+ name: "ACME Corporation",+ state: "CA",+ zip: "90001",+ },+ handlingLabels: ["FRAGILE", "THIS SIDE UP"],+ packageCount: 1,+ postage: "$18.40",+ serviceLevel: "Ground",+ to: {+ address: "123 Main Street, Apt 4B",+ city: "New York",+ country: "USA",+ name: "John Doe",+ phone: "(503) 555-0142",+ state: "NY",+ zip: "10001",+ },+ trackingNumber: "TRACK123456789US",+ weight: "2.5 kg",+};++// Standard 4" x 6" shipping label, expressed in PDF points (72 dpi)+const LABEL_SIZE = { height: 432, width: 288 };++// Quiet zone kept clear of the printed label frame, plus the frame itself+const LABEL_MARGIN = 8;+const LABEL_BORDER = 2;+const LABEL_PADDING = 10;++// Forme scales an image with the Image element's own width/height (style+// dimensions only size the box), so the barcode is measured in points from+// the label's content box instead of a percentage width.+const BARCODE_WIDTH =+ LABEL_SIZE.width - 2 * (LABEL_MARGIN + LABEL_BORDER + LABEL_PADDING);+const BARCODE_HEIGHT = 72;++const formatCityLine = (party: ShippingLabelAddress) => {+ const cityStateZip = `${party.city}, ${party.state} ${party.zip}`;+ return party.country ? `${cityStateZip}, ${party.country}` : cityStateZip;+};++// Shared address block — same treatment for both parties (10pt, bold name).+// Forme's serializer drops components that return a Fragment, so the lines are+// wrapped in a View; inside the column parent the stacking is identical.+const AddressLines = ({+ party,+}: {+ party: ShippingLabelAddress & { phone?: string };+}) => (+ <View>+ <Text noMargin variant="xs" weight="bold">+ {party.name}+ </Text>+ <Text noMargin variant="xs">+ {party.address}+ </Text>+ <Text noMargin variant="xs">+ {formatCityLine(party)}+ </Text>+ {party.phone && (+ <Text noMargin variant="xs" color="mutedForeground">+ {party.phone}+ </Text>+ )}+ </View>+);++const ShippingLabelContent = ({ data }: { data: ShippingLabelData }) => {+ const theme = usePdfcnTheme();++ const accent = resolveColor(+ data.accentColor ?? theme.colors.primary,+ theme.colors+ );++ const detailRows = [+ ...(data.weight ? [{ key: "Weight", value: data.weight }] : []),+ ...(data.dimensions ? [{ key: "Dimensions", value: data.dimensions }] : []),+ ...(typeof data.packageCount === "number"+ ? [{ key: "Packages", value: `${data.packageCount}` }]+ : []),+ { key: "Postage", value: data.postage ?? "PAID" },+ ];++ const styles = StyleSheet.create({+ addresses: { flex: 1, flexDirection: "row" },+ badgesRow: {+ flexDirection: "row",+ flexWrap: "wrap",+ gap: 6,+ marginTop: 8,+ },+ barcodeArea: { alignItems: "center", marginTop: 10 },+ carrierName: { fontSize: 16, fontWeight: "bold" },+ fromColumn: { flex: 1, paddingLeft: 12 },+ handlingTag: {+ alignItems: "center",+ backgroundColor: theme.colors.foreground,+ justifyContent: "center",+ paddingHorizontal: 8,+ paddingVertical: 4,+ },+ handlingTagText: {+ color: theme.colors.background,+ fontSize: 8,+ fontWeight: "bold",+ letterSpacing: 1,+ textTransform: "uppercase",+ },+ headerRow: {+ alignItems: "center",+ flexDirection: "row",+ justifyContent: "space-between",+ },+ label: {+ borderColor: theme.colors.foreground,+ borderWidth: LABEL_BORDER,+ flex: 1,+ padding: LABEL_PADDING,+ },+ page: {+ backgroundColor: theme.colors.background,+ flex: 1,+ flexDirection: "column",+ height: LABEL_SIZE.height - LABEL_MARGIN * 2,+ overflow: "hidden",+ },+ rule: {+ backgroundColor: theme.colors.foreground,+ height: 2,+ marginVertical: 6,+ },+ sectionLabel: {+ color: accent,+ fontSize: 8,+ fontWeight: "bold",+ letterSpacing: 1,+ marginBottom: 4,+ textTransform: "uppercase",+ },+ serviceRight: { alignItems: "flex-end" },+ shipToColumn: {+ borderRightColor: theme.colors.foreground,+ borderRightWidth: 2,+ flex: 1.4,+ paddingRight: 12,+ },+ table: {+ borderColor: theme.colors.foreground,+ borderWidth: 2,+ },+ tableKey: {+ color: theme.colors.mutedForeground,+ fontSize: 8,+ fontWeight: "bold",+ letterSpacing: 0.5,+ textTransform: "uppercase",+ width: 84,+ },+ tableRow: {+ alignItems: "center",+ borderBottomColor: theme.colors.border,+ borderBottomWidth: 1,+ flexDirection: "row",+ paddingHorizontal: 8,+ paddingVertical: 3,+ },+ tableRowLast: {+ alignItems: "center",+ flexDirection: "row",+ paddingHorizontal: 8,+ paddingVertical: 3,+ },+ tableValue: { flex: 1 },+ trackingText: {+ fontWeight: "bold",+ letterSpacing: 2,+ marginTop: 6,+ textTransform: "uppercase",+ },+ });++ return (+ <Document title={`Shipping Label ${data.trackingNumber}`}>+ <Page size={LABEL_SIZE} margin={LABEL_MARGIN}>+ <View style={styles.page as never}>+ <View style={styles.label}>+ <View style={styles.headerRow}>+ <Text noMargin style={styles.carrierName}>+ {data.carrier}+ </Text>+ <View style={styles.serviceRight}>+ <Text noMargin style={styles.sectionLabel}>+ {data.serviceLevel}+ </Text>+ </View>+ </View>++ <View style={styles.rule} />++ <View style={styles.addresses}>+ <View style={styles.shipToColumn}>+ <Text noMargin style={styles.sectionLabel}>+ Ship To+ </Text>+ <AddressLines party={data.to} />+ </View>+ <View style={styles.fromColumn}>+ <Text noMargin style={styles.sectionLabel}>+ From+ </Text>+ <AddressLines party={data.from} />+ </View>+ </View>++ <View style={styles.rule} />++ <View style={styles.table}>+ {detailRows.map((row, index) => (+ <View+ key={row.key}+ style={+ index === detailRows.length - 1+ ? styles.tableRowLast+ : styles.tableRow+ }+ >+ <Text noMargin style={styles.tableKey}>+ {row.key}+ </Text>+ <Text noMargin style={styles.tableValue} variant="xs">+ {row.value}+ </Text>+ </View>+ ))}+ </View>++ {data.handlingLabels && data.handlingLabels.length > 0 && (+ <View style={styles.badgesRow}>+ {data.handlingLabels.map((label, index) => (+ <View key={`${label}-${index}`} style={styles.handlingTag}>+ <Text noMargin style={styles.handlingTagText}>+ {label}+ </Text>+ </View>+ ))}+ </View>+ )}++ <View style={styles.barcodeArea}>+ {data.barcodeUrl ? (+ <Image+ height={BARCODE_HEIGHT}+ src={data.barcodeUrl}+ width={BARCODE_WIDTH}+ />+ ) : (+ <PdfQRCode+ backgroundColor="#ffffff"+ color="#000000"+ size={80}+ value={data.trackingNumber}+ />+ )}+ <Text+ noMargin+ style={styles.trackingText}+ variant="xs"+ weight="bold"+ >+ {data.trackingNumber}+ </Text>+ </View>+ </View>+ </View>+ </Page>+ </Document>+ );+};++export const ShippingLabelDocument = ({+ theme,+ data = sampleData,+}: {+ theme?: PdfcnTheme;+ data?: ShippingLabelData;+}) => (+ <PdfcnThemeProvider theme={theme}>+ <ShippingLabelContent data={data} />+ </PdfcnThemeProvider>+);diff --git a/apps/web/registry/bases/forme/blocks/shipping-label/shipping-label.types.ts b/apps/web/registry/bases/forme/blocks/shipping-label/shipping-label.types.tsnew file mode 100644index 0000000..dd74a22--- /dev/null+++ b/apps/web/registry/bases/forme/blocks/shipping-label/shipping-label.types.ts@@ -0,0 +1,27 @@+export interface ShippingLabelAddress {+ name: string;+ address: string;+ city: string;+ state: string;+ zip: string;+ country?: string;+}++export interface ShippingLabelDestination extends ShippingLabelAddress {+ phone?: string;+}++export interface ShippingLabelData {+ from: ShippingLabelAddress;+ to: ShippingLabelDestination;+ carrier: string;+ serviceLevel: string;+ trackingNumber: string;+ barcodeUrl?: string;+ weight?: string;+ dimensions?: string;+ packageCount?: number;+ handlingLabels?: string[];+ postage?: string;+ accentColor?: string;+}