Reorganize repo structure and standards references

This commit is contained in:
david committed 2026-06-29 05:03:42 +02:00
1 parent 3cb93a81be
commit be2054274d
5885 files changed
+2588 -195

No files matched your search

@@ -0,0 +1,90 @@
import type { CSSProperties, ReactNode } from "react";
import { BaseLayout } from "../_layout/BaseLayout.js";
import { Button } from "../_layout/Button.js";
import { Eyebrow } from "../_layout/Eyebrow.js";
import type { MailBrand } from "../_layout/theme.js";
/**
* Shared visual scaffold for all transactional templates.
*
* Every transactional email follows the same shape: eyebrow → headline →
* intro paragraph → CTA → optional outro paragraph → support sign-off.
* Concentrating that into one component keeps per-template files small
* and ensures brand-theme application is uniform.
*/
export interface TransactionalScaffoldProps {
readonly brand: MailBrand;
readonly subject: string;
readonly previewText?: string;
readonly eyebrow: string;
readonly title: string;
readonly intro: ReactNode;
readonly actionUrl: string;
readonly actionLabel: string;
readonly outro?: ReactNode;
readonly children?: ReactNode;
readonly unsubscribeUrl?: string;
readonly signoffThanks?: string;
}
const titleStyle = (brand: MailBrand): CSSProperties => ({
margin: "8px 0 16px",
fontSize: "28px",
lineHeight: 1.2,
color: brand.textColor,
fontWeight: 700,
});
const paragraphStyle = (brand: MailBrand): CSSProperties => ({
margin: "0 0 24px",
fontSize: "16px",
lineHeight: 1.6,
color: brand.textColor,
});
const outroStyle = (brand: MailBrand): CSSProperties => ({
margin: "24px 0 0",
fontSize: "14px",
lineHeight: 1.6,
color: brand.mutedTextColor,
});
const signoffStyle = (brand: MailBrand): CSSProperties => ({
margin: "24px 0 0",
fontSize: "14px",
lineHeight: 1.6,
color: brand.textColor,
});
export function TransactionalScaffold({
brand,
subject,
previewText,
eyebrow,
title,
intro,
actionUrl,
actionLabel,
outro,
children,
unsubscribeUrl,
signoffThanks,
}: TransactionalScaffoldProps) {
return (
<BaseLayout brand={brand} title={subject} previewText={previewText ?? subject} unsubscribeUrl={unsubscribeUrl}>
<Eyebrow brand={brand}>{eyebrow}</Eyebrow>
<h1 style={titleStyle(brand)}>{title}</h1>
<p style={paragraphStyle(brand)}>{intro}</p>
<Button brand={brand} href={actionUrl}>
{actionLabel}
</Button>
{outro ? <p style={outroStyle(brand)}>{outro}</p> : null}
{children}
<p style={signoffStyle(brand)}>
{signoffThanks ?? "Thanks,"}
<br />-<br />
{brand.supportFromName}
</p>
</BaseLayout>
);
}