{
  "$schema": "https://shadcn-vue.com/schema/registry-item.json",
  "name": "invoice-minimal",
  "type": "registry:block",
  "title": "Invoice Minimal",
  "description": "The Invoice Minimal document block with sample data.",
  "author": "pdfcn-vue",
  "dependencies": ["@formepdf/vue@^0.25.0", "vue@^3.4.0"],
  "registryDependencies": [
    "@pdfcn-vue/block-shared",
    "@pdfcn-vue/key-value",
    "@pdfcn-vue/page-footer",
    "@pdfcn-vue/page-header",
    "@pdfcn-vue/pdfcn-core",
    "@pdfcn-vue/section",
    "@pdfcn-vue/table",
    "@pdfcn-vue/text",
    "@pdfcn-vue/theme-provider"
  ],
  "files": [
    {
      "path": "registry/components/pdf/blocks/invoice-minimal/InvoiceMinimal.vue",
      "content": "<script setup lang=\"ts\">\n  import type { Style } from '@formepdf/vue';\n  import type { PdfcnTheme } from '@/lib/pdfcn/pdf-themes';\n  import type { InvoiceMinimalData } from '@/components/pdf/blocks/invoice-minimal/invoice-minimal.types';\n  import { Document, PAGE_NUMBER, Page, TOTAL_PAGES, View } from '@formepdf/vue';\n  import { computed } from 'vue';\n  import KeyValue from '@/components/pdf/KeyValue.vue';\n  import PageFooter from '@/components/pdf/PageFooter.vue';\n  import PageHeader from '@/components/pdf/PageHeader.vue';\n  import PdfcnThemeProvider from '@/components/pdf/PdfcnThemeProvider.vue';\n  import Section from '@/components/pdf/Section.vue';\n  import Table from '@/components/pdf/Table.vue';\n  import TableBody from '@/components/pdf/TableBody.vue';\n  import TableCell from '@/components/pdf/TableCell.vue';\n  import TableHeader from '@/components/pdf/TableHeader.vue';\n  import TableRow from '@/components/pdf/TableRow.vue';\n  import Text from '@/components/pdf/Text.vue';\n  import { usePdfcnTheme } from '@/lib/pdfcn/theme';\n  import { formatCurrency } from '@/components/pdf/blocks/shared/format';\n  import { sampleInvoiceMinimalData } from '@/components/pdf/blocks/invoice-minimal/invoice-minimal.sample';\n\n  const props = defineProps<{\n    data?: InvoiceMinimalData | undefined;\n    theme?: PdfcnTheme | undefined;\n  }>();\n\n  const invoice = computed(() => props.data ?? sampleInvoiceMinimalData);\n  const fallbackTheme = usePdfcnTheme();\n  const activeTheme = computed(() => props.theme ?? fallbackTheme.value);\n\n  const pageMargin = { bottom: 25, left: 56, right: 56, top: 56 };\n\n  const styles = computed(() => {\n    const current = activeTheme.value;\n    const baseLabel: Style = {\n      fontSize: 8,\n      fontWeight: 700,\n      letterSpacing: 0.8,\n      marginBottom: 4,\n      textTransform: 'uppercase',\n    };\n\n    return {\n      column: {\n        paddingRight: 20,\n        width: 251,\n      } satisfies Style,\n      detailsColumn: {\n        width: 232,\n      } satisfies Style,\n      infoLabel: {\n        ...baseLabel,\n        color: current.colors.primary,\n      } satisfies Style,\n      infoRow: {\n        flexDirection: 'row',\n        marginBottom: 28,\n      } satisfies Style,\n      invoiceStamp: {\n        alignSelf: 'flex-start',\n        borderColor: current.colors.primary,\n        borderRadius: current.primitives.borderRadius.sm,\n        borderWidth: 2,\n        paddingHorizontal: 12,\n        paddingVertical: 8,\n      } satisfies Style,\n      page: {\n        backgroundColor: current.colors.background,\n      } satisfies Style,\n      stampDate: {\n        color: current.colors.mutedForeground,\n        fontSize: 8,\n        textAlign: 'right',\n      } satisfies Style,\n      stampLabel: {\n        color: current.colors.primary,\n        fontSize: 7,\n        fontWeight: 700,\n        textAlign: 'right',\n      } satisfies Style,\n      stampNumber: {\n        color: current.colors.foreground,\n        fontSize: 14,\n        fontWeight: 700,\n        textAlign: 'right',\n      } satisfies Style,\n      summaryColumn: {\n        width: 240,\n      } satisfies Style,\n      summaryRow: {\n        flexDirection: 'row',\n        marginTop: 20,\n      } satisfies Style,\n      summarySpacer: {\n        flex: 1,\n      } satisfies Style,\n    };\n  });\n\n  const detailItems = computed(() => [\n    { key: 'Due Date', value: invoice.value.dueDate },\n    { key: 'Payment', value: invoice.value.paymentTerms.method },\n    { key: 'GST', value: invoice.value.paymentTerms.gst },\n  ]);\n\n  const summaryItems = computed(() => {\n    const current = activeTheme.value;\n    return [\n      { key: 'Subtotal', value: formatCurrency(invoice.value.summary.subtotal) },\n      { key: 'Tax (7%)', value: formatCurrency(invoice.value.summary.tax) },\n      {\n        key: 'Balance Due',\n        keyStyle: { fontSize: 12, fontWeight: 700 },\n        value: formatCurrency(invoice.value.summary.total),\n        valueStyle: {\n          color: current.colors.primary,\n          fontSize: 13,\n          fontWeight: 700,\n        },\n      },\n    ];\n  });\n\n  const documentTitle = computed(() => `Invoice ${invoice.value.invoiceNumber}`);\n  const footerRight = computed(() => `Page ${PAGE_NUMBER} of ${TOTAL_PAGES}`);\n  const companySubtitle = computed(\n    () => `${invoice.value.companyAddress}  ·  ${invoice.value.companyEmail}`,\n  );\n</script>\n\n<template>\n  <PdfcnThemeProvider :theme=\"activeTheme\">\n    <Document :title=\"documentTitle\">\n      <Page\n        size=\"A4\"\n        :margin=\"pageMargin\"\n      >\n        <PageFooter\n          :left-text=\"invoice.notes\"\n          :right-text=\"footerRight\"\n          sticky\n          :page-padding=\"25\"\n        />\n        <View :style=\"styles.page\">\n          <Section\n            no-wrap\n            :style=\"{\n              alignItems: 'flex-start',\n              flexDirection: 'row',\n              marginBottom: activeTheme.spacing.sectionGap,\n            }\"\n          >\n            <View :style=\"{ flex: 1 }\">\n              <PageHeader\n                variant=\"minimal\"\n                :title=\"invoice.companyName\"\n                :subtitle=\"companySubtitle\"\n                :margin-bottom=\"0\"\n              />\n            </View>\n            <View :style=\"styles.invoiceStamp\">\n              <Text\n                no-margin\n                transform=\"uppercase\"\n                :style=\"styles.stampLabel\"\n                >Invoice</Text\n              >\n              <Text\n                no-margin\n                :style=\"styles.stampNumber\"\n              >\n                {{ invoice.invoiceNumber }}\n              </Text>\n              <Text\n                no-margin\n                :style=\"styles.stampDate\"\n                >{{ invoice.invoiceDate }}</Text\n              >\n            </View>\n          </Section>\n          <View :style=\"styles.infoRow\">\n            <View :style=\"styles.column\">\n              <Text\n                no-margin\n                :style=\"styles.infoLabel\"\n                >Bill To</Text\n              >\n              <Text\n                variant=\"sm\"\n                no-margin\n                >{{ invoice.billTo.name }}</Text\n              >\n              <Text\n                variant=\"xs\"\n                no-margin\n                color=\"mutedForeground\"\n              >\n                {{ invoice.billTo.address }}\n              </Text>\n              <Text\n                variant=\"xs\"\n                no-margin\n                color=\"mutedForeground\"\n              >\n                {{ invoice.billTo.email }}\n              </Text>\n              <Text\n                variant=\"xs\"\n                no-margin\n                color=\"mutedForeground\"\n              >\n                {{ invoice.billTo.phone }}\n              </Text>\n            </View>\n            <View :style=\"styles.detailsColumn\">\n              <Text\n                no-margin\n                :style=\"styles.infoLabel\"\n                >Invoice Details</Text\n              >\n              <KeyValue\n                size=\"sm\"\n                :items=\"detailItems\"\n              />\n            </View>\n          </View>\n          <Table variant=\"compact\">\n            <TableHeader>\n              <TableRow header>\n                <TableCell text=\"Description\" />\n                <TableCell\n                  align=\"center\"\n                  text=\"Qty\"\n                />\n                <TableCell\n                  align=\"right\"\n                  text=\"Rate\"\n                />\n                <TableCell\n                  align=\"right\"\n                  text=\"Total\"\n                />\n              </TableRow>\n            </TableHeader>\n            <TableBody>\n              <TableRow\n                v-for=\"(item, index) in invoice.items\"\n                :key=\"index\"\n              >\n                <TableCell :text=\"item.description\" />\n                <TableCell\n                  align=\"center\"\n                  :text=\"`${item.quantity}`\"\n                />\n                <TableCell\n                  align=\"right\"\n                  :text=\"formatCurrency(item.unitPrice)\"\n                />\n                <TableCell\n                  align=\"right\"\n                  :text=\"formatCurrency(item.quantity * item.unitPrice)\"\n                />\n              </TableRow>\n            </TableBody>\n          </Table>\n          <View :style=\"styles.summaryRow\">\n            <View :style=\"styles.summarySpacer\" />\n            <View :style=\"styles.summaryColumn\">\n              <KeyValue\n                size=\"sm\"\n                divided\n                :divider-thickness=\"1\"\n                :items=\"summaryItems\"\n              />\n            </View>\n          </View>\n        </View>\n      </Page>\n    </Document>\n  </PdfcnThemeProvider>\n</template>\n",
      "type": "registry:block"
    },
    {
      "path": "registry/components/pdf/blocks/invoice-minimal/invoice-minimal.types.ts",
      "content": "import type { InvoiceBaseData } from '@/components/pdf/blocks/shared/invoice.types';\n\nexport type InvoiceMinimalData = InvoiceBaseData;\n",
      "type": "registry:lib"
    },
    {
      "path": "registry/components/pdf/blocks/invoice-minimal/invoice-minimal.sample.ts",
      "content": "import type { InvoiceMinimalData } from '@/components/pdf/blocks/invoice-minimal/invoice-minimal.types';\n\nexport const sampleInvoiceMinimalData: InvoiceMinimalData = {\n  billTo: {\n    address: '500 Enterprise Way, Building A',\n    email: 'finance@enterprisecorp.io',\n    name: 'Enterprise Corp',\n    phone: '+1 (555) 246-8135',\n  },\n  companyAddress: 'Nagpur, IN',\n  companyEmail: 'hello@pdfcn-vue.app',\n  companyName: 'pdfcn-vue',\n  dueDate: 'March 22, 2026',\n  invoiceDate: 'February 20, 2026',\n  invoiceNumber: 'INV-2026-003',\n  items: [\n    { description: 'Annual License Plan', quantity: 1, unitPrice: 25_000 },\n    { description: 'Support & Maintenance', quantity: 12, unitPrice: 1500 },\n    { description: 'Custom Integration', quantity: 1, unitPrice: 12_000 },\n  ],\n  notes: 'Invoice for annual enterprise subscription. Please retain for your records.',\n  paymentTerms: {\n    dueDate: 'March 22, 2026',\n    gst: 'GSTIN 123456789',\n    method: 'ACH Transfer / Check',\n  },\n  subtitle: 'Innovative PDF Solutions',\n  summary: {\n    subtotal: 55_000,\n    tax: 3850,\n    total: 58_850,\n  },\n};\n",
      "type": "registry:lib"
    }
  ],
  "categories": ["block"]
}
