Add Ledger and Band template families with decor primitives

Crimson Grid, Tangerine Ledger, Slate Band and Teal Swoosh are rebuilt from
the reference PDFs with grid and band tables that survive page breaks,
full-bleed fixed bands, pennant tabs, gradient corner swooshes with
keep-outs, Carbon icon circles, and the user's logo in the measured slot
(knockout or white chip on the dark Slate band). Adds static Poppins
500-700 and Inter fonts. Thumbnails regenerated for all eight templates;
the item-count sweeps run in their own test file.
This commit is contained in:
2026-10-04 08:34:18 +05:30
parent aa7a407944
commit 9de9a6ffee
57 changed files with 4078 additions and 217 deletions
+8 -3
View File
@@ -31,7 +31,7 @@ export function InvoicePage({ frame, model, template, children }: InvoicePagePro
const marginBottom = pad.bottom - frame.footerReserve;
const ruleY = frame.page.height - marginBottom - chromeHeight(chrome.role ?? "footer") - 6.6;
const bandLeft = `${model.docTitle} ${model.meta.number} · ${model.meta.date}`;
const items: DecorItem[] = [...(decor.everyPage?.(frame) ?? [])];
const items: DecorItem[] = [...(decor.everyPage?.(frame, model) ?? [])];
if (chrome.rule) {
items.push({ x: pad.left, y: ruleY, width: frame.contentWidth, height: 0.6, children: <View style={{ height: 0.6, backgroundColor: chrome.rule }} /> });
}
@@ -42,6 +42,8 @@ export function InvoicePage({ frame, model, template, children }: InvoicePagePro
pad: { ...pad, left: pad.left + inset.left, right: pad.right + inset.right },
contentWidth: frame.contentWidth - inset.left - inset.right,
};
const bandInset = chrome.bandInset ?? inset;
const bandBox = { left: pad.left + bandInset.left, width: frame.contentWidth - bandInset.left - bandInset.right };
return (
<Page
size={frame.page.size}
@@ -57,12 +59,15 @@ export function InvoicePage({ frame, model, template, children }: InvoicePagePro
<AvailableWidthProvider width={frame.contentWidth}>{children}</AvailableWidthProvider>
<PageChrome
frame={chromeFrame}
footerLeft={model.supplier.name}
footerLeft={chrome.footerName === false ? undefined : model.supplier.name}
footerLeftWidth={chrome.leftWidth}
footerCenter={model.footerText}
role={chrome.role}
color={chrome.color}
band={{ left: bandLeft, right: "continued" }}
band={{ left: bandLeft, ...(chrome.bandRight === false ? {} : { right: "continued" }) }}
bandBox={bandBox}
bandColor={chrome.bandColor}
bottom={chrome.bottom}
decor={items}
/>
</Page>