Download Library 2
Post-purchase download library. The bundle's flat-lay sits beside its numbered stack, so the buyer sees everything they got. Beside it, a file manager updates the selected size with every pick, while "Download all (.zip)" stays the loudest action.
Use it in a prompt
Use checkout/download-library-2 from the FunnelDNA library. Follow the skill and theme contract. Ask me for the copy, images, and brand details you need; do not invent proof.
Paste into Claude or ChatGPT with FunnelDNA connected (MCP setup), or alongside the skill.
Use it in code
- Save
component.tsx(Code tab) ascomponents/funneldna/checkout/download-library-2.tsx. - Import it and pass your copy and images (Props tab):
import { DownloadLibrary2 } from "@/components/funneldna/checkout/download-library-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/checkout/download-library-2/component.tsx 502 lines
// layout: unboxing-flatlay
// Post-purchase download library. The bundle's flat-lay sits beside its numbered stack, so the buyer sees everything they got. Beside it, a file manager updates the selected size with every pick, while "Download all (.zip)" stays the loudest action.
import * as React from "react";
import { Check, ChevronDown, Download, Minus, ShieldCheck, Wrench } from "lucide-react";
import { FX_HOST, Pattern } from "../fx/fx";
export type DownloadFile = {
/** Stable id for selection; falls back to the file's position. */
id?: string;
name: string;
/** Size in bytes. */
size: number;
/** Direct download URL; without it the row button calls onDownloadFile. */
href?: string;
};
export type DownloadGroup = {
title: string;
detail?: string;
/** Value shown in the stack beside the photo, e.g. "$39". */
value?: string;
/** File type label, e.g. ".xmp". */
type: string;
/** Short install help for this file type, shown as an expander. */
help?: { title: string; steps: string[] };
files: DownloadFile[];
};
/** Templates use {count}, {selected}, {files}, {size} and {name}. */
export type DownloadLibrary2Copy = {
selectAll: string;
totalLine: string;
selectedLine: string;
nothingLine: string;
downloadSelected: string;
nothingSelected: string;
downloadAll: string;
zipNote: string;
downloadFile: string;
fileSingular: string;
filePlural: string;
/** Screen-reader label before the struck regular value. */
regularLabel: string;
empty: string;
/** Size units from bytes upward (base 1000). */
units: string[];
};
export type DownloadLibrary2Props = {
headline?: string;
/** Phrase inside the headline that gets the marker stroke. */
highlight?: string;
salutation?: string;
paragraphs?: string[];
signoff?: string;
signatureName?: string;
signatureRole?: string;
/** Flat-lay photo of the bundle (slot: scene). */
sceneImage?: string;
imageAlt?: string;
/** Heading over the numbered stack beside the photo. */
contentsHeading?: string;
valueLabel?: string;
regularPrice?: string;
paidLabel?: string;
price?: string;
guarantee?: string;
/** The bundle: each group is one stack item with its files. */
groups?: DownloadGroup[];
/** File ids ticked when the block first renders. */
initialSelected?: string[];
/** URL of the full bundle zip. */
href?: string;
/** Zip size in bytes; defaults to the sum of all files. */
zipSize?: number;
/** Called when "Download all (.zip)" is clicked. */
onAction?: () => void;
onDownloadSelected?: (files: DownloadFile[]) => void;
onDownloadFile?: (file: DownloadFile) => void;
copy?: Partial<DownloadLibrary2Copy>;
/** "hover"/"active" force the primary button state; "disabled" starts with nothing selected. */
state?: "default" | "hover" | "active" | "disabled";
className?: string;
};
const COPY: DownloadLibrary2Copy = {
selectAll: "Select all {count} {files}",
totalLine: "{count} {files} · {size}",
selectedLine: "{selected} of {count} {files} selected",
nothingLine: "No files selected yet",
downloadSelected: "Download selected ({selected})",
nothingSelected: "Pick files to download",
downloadAll: "Download all (.zip)",
zipNote: "Full bundle · {size}",
downloadFile: "Download {name}",
fileSingular: "file",
filePlural: "files",
regularLabel: "Regular value",
empty: "Your files appear here as soon as they are ready.",
units: ["B", "KB", "MB", "GB"],
};
const SIG_FONT = "https://fonts.googleapis.com/css2?family=Caveat:wght@600&display=swap";
const R = ".cf-download-library-2";
export function DownloadLibrary2(props: DownloadLibrary2Props) {
const {
headline = "Everything you bought is ready to download",
highlight = "ready to download",
salutation = "Dear friend,",
paragraphs = [
"Thank you for your order. Every file you paid for is listed here, ready to download.",
"Grab the full bundle in one zip, or pick only the files you need right now.",
],
signoff = "Enjoy,",
signatureName = "",
signatureRole = "",
sceneImage,
imageAlt = "",
contentsHeading = "Everything you got, ready to use",
valueLabel = "Total value",
regularPrice = "",
paidLabel = "You paid",
price = "",
guarantee = "",
groups = [],
initialSelected,
href,
zipSize,
onAction,
onDownloadSelected,
onDownloadFile,
state = "default",
className,
} = props;
const copy = { ...COPY, ...props.copy };
const uid = React.useId();
const headId = uid + "-h";
const stageId = uid + "-c";
const allRef = React.useRef<HTMLInputElement>(null);
const entries = React.useMemo(
() => groups.flatMap((g, gi) => g.files.map((file, fi) => ({ key: file.id ?? gi + "-" + fi, file }))),
[groups],
);
const startKey = (initialSelected ?? []).join("|");
const [picked, setPicked] = React.useState<Set<string>>(
() => new Set(state === "disabled" || !startKey ? [] : startKey.split("|")),
);
React.useEffect(() => {
setPicked(new Set(state === "disabled" || !startKey ? [] : startKey.split("|")));
}, [state, startKey]);
const chosen = entries.filter((e) => picked.has(e.key));
const count = entries.length;
const n = chosen.length;
const allOn = count > 0 && n === count;
const mixed = n > 0 && !allOn;
React.useEffect(() => {
if (allRef.current) allRef.current.indeterminate = mixed;
}, [mixed]);
const totalBytes = zipSize ?? entries.reduce((s, e) => s + e.file.size, 0);
const pickedBytes = chosen.reduce((s, e) => s + e.file.size, 0);
const size = (b: number) => formatBytes(b, copy.units);
const files = count === 1 ? copy.fileSingular : copy.filePlural;
const vars = { count, selected: n, files, size: size(totalBytes) };
const toggle = (key: string) =>
setPicked((prev) => {
const next = new Set(prev);
if (next.has(key)) next.delete(key);
else next.add(key);
return next;
});
const toggleAll = () => setPicked(allOn ? new Set() : new Set(entries.map((e) => e.key)));
const forced = state === "hover" ? " is-hover" : state === "active" ? " is-active" : "";
let rowIndex = 0;
return (
<section className={R.slice(1) + (className ? " " + className : "")} style={FX_HOST} aria-labelledby={headId}>
<Pattern name="grid" fade="corner" />
{signatureName ? <link rel="stylesheet" href={SIG_FONT} /> : null}
<style>{CSS}</style>
<div className="dl2-wrap">
<header className="dl2-head">
<h2 id={headId} className="dl2-h2">
{marked(headline, highlight)}
</h2>
<div className="dl2-letter">
{salutation ? <p className="dl2-salute">{salutation}</p> : null}
{paragraphs.map((p, i) => (
<p key={i}>{p}</p>
))}
{signoff || signatureName ? (
<div className="dl2-sign">
{signoff ? <p>{signoff}</p> : null}
{signatureName ? <p className="dl2-sig">{signatureName}</p> : null}
{signatureRole ? <p className="dl2-role">{signatureRole}</p> : null}
</div>
) : null}
</div>
</header>
<div className="dl2-stage" role="group" aria-labelledby={stageId}>
{sceneImage ? (
<img className="dl2-photo" src={sceneImage} alt={imageAlt} width={960} height={720} loading="lazy" decoding="async" />
) : null}
<h3 id={stageId} className="dl2-h3">
{contentsHeading}
</h3>
{groups.length ? (
<ol className="dl2-legend">
{groups.map((g, gi) => (
<li key={gi}>
<span className="dl2-lnum" aria-hidden="true">
{gi + 1}
</span>
<span>
<span className="dl2-ltitle">{g.title}</span>
{g.detail ? <span className="dl2-ldetail">{g.detail}</span> : null}
</span>
{g.value ? <span className="dl2-lvalue">{g.value}</span> : null}
</li>
))}
</ol>
) : null}
{price ? (
<p className="dl2-value">
{regularPrice ? (
<>
<span className="dl2-vlabel">{valueLabel}</span>
<del className="dl2-was">
<span className="dl2-sr">{copy.regularLabel} </span>
{regularPrice}
</del>
</>
) : null}
<span className="dl2-vlabel">{paidLabel}</span>
<strong className="dl2-paid">{price}</strong>
</p>
) : null}
</div>
<div className="dl2-files">
<div className="dl2-bar">
<label className="dl2-pick dl2-pick--all">
<Box ref={allRef} checked={allOn} onChange={toggleAll} disabled={count === 0} />
<span className="dl2-alllabel">{fill(copy.selectAll, vars)}</span>
</label>
<span className="dl2-total">{fill(copy.totalLine, vars)}</span>
</div>
{count === 0 ? (
<p className="dl2-empty">{copy.empty}</p>
) : (
groups.map((g, gi) => (
<div className="dl2-group" key={gi}>
<div className="dl2-ghead">
<span className="dl2-gnum" aria-hidden="true">
{gi + 1}
</span>
<h3 className="dl2-gtitle">{g.title}</h3>
<span className="dl2-chip">{g.type}</span>
</div>
{g.help ? (
<details className="dl2-help">
<summary>
<Wrench className="dl2-helpicon" strokeWidth={2.5} aria-hidden="true" />
<span>{g.help.title}</span>
<ChevronDown className="dl2-chev" strokeWidth={2.5} aria-hidden="true" />
</summary>
<ol>
{g.help.steps.map((s, si) => (
<li key={si}>{s}</li>
))}
</ol>
</details>
) : null}
<ul className="dl2-rows">
{g.files.map((file, fi) => {
const key = file.id ?? gi + "-" + fi;
const on = picked.has(key);
const i = rowIndex++;
const label = fill(copy.downloadFile, { name: file.name });
return (
<li
key={key}
className="dl2-row"
data-on={on ? "true" : "false"}
style={{ ["--i" as string]: i } as React.CSSProperties}
>
<label className="dl2-pick">
<Box checked={on} onChange={() => toggle(key)} />
<span className="dl2-info">
<span className="dl2-name">{file.name}</span>
<span className="dl2-sizem">{size(file.size)}</span>
</span>
</label>
<span className="dl2-size">{size(file.size)}</span>
{file.href ? (
<a className="dl2-filebtn" href={file.href} download aria-label={label} onClick={() => onDownloadFile?.(file)}>
<Download width={20} height={20} strokeWidth={2.5} aria-hidden="true" />
</a>
) : (
<button type="button" className="dl2-filebtn" aria-label={label} onClick={() => onDownloadFile?.(file)}>
<Download width={20} height={20} strokeWidth={2.5} aria-hidden="true" />
</button>
)}
</li>
);
})}
</ul>
</div>
))
)}
<div className="dl2-foot">
<div className="dl2-selbar">
<p className="dl2-sel" aria-live="polite">
{n > 0 ? (
<>
<span key={pickedBytes} className="dl2-selnum">
{size(pickedBytes)}
</span>
<span className="dl2-selmeta">{fill(copy.selectedLine, vars)}</span>
</>
) : (
<span className="dl2-selmeta">{copy.nothingLine}</span>
)}
</p>
<button
type="button"
className="dl2-second"
disabled={n === 0}
onClick={() => onDownloadSelected?.(chosen.map((e) => e.file))}
>
{n > 0 ? fill(copy.downloadSelected, vars) : copy.nothingSelected}
</button>
</div>
{href ? (
<a className={"dl2-primary" + forced} href={href} onClick={() => onAction?.()}>
{copy.downloadAll}
</a>
) : (
<button type="button" className={"dl2-primary" + forced} onClick={() => onAction?.()}>
{copy.downloadAll}
</button>
)}
<p className="dl2-note">
<ShieldCheck className="dl2-inline" strokeWidth={2.5} aria-hidden="true" />
{fill(copy.zipNote, vars)}
{guarantee ? " · " + guarantee : ""}
</p>
</div>
</div>
</div>
</section>
);
}
export default DownloadLibrary2;
const Box = React.forwardRef<HTMLInputElement, React.InputHTMLAttributes<HTMLInputElement>>(function Box(props, ref) {
return (
<span className="dl2-box">
<input ref={ref} type="checkbox" {...props} />
<Check className="dl2-tick dl2-tick--on" strokeWidth={3} aria-hidden="true" />
<Minus className="dl2-tick dl2-tick--mix" strokeWidth={3} aria-hidden="true" />
</span>
);
});
function marked(text: string, phrase?: string): React.ReactNode {
if (!phrase) return text;
const at = text.indexOf(phrase);
if (at < 0) return text;
return (
<>
{text.slice(0, at)}
<span className="dl2-mark">{phrase}</span>
{text.slice(at + phrase.length)}
</>
);
}
function fill(template: string, vars: Record<string, string | number>) {
return Object.keys(vars).reduce((s, k) => s.split("{" + k + "}").join(String(vars[k])), template);
}
function formatBytes(bytes: number, units: string[]) {
let value = Math.max(0, bytes);
let i = 0;
while (value >= 1000 && i < units.length - 1) {
value /= 1000;
i += 1;
}
const digits = i === 0 || value >= 100 ? 0 : 1;
return value.toFixed(digits) + " " + units[i];
}
const CSS = `
${R}{--dl2-x:clamp(16px,2.5vw,28px);--dl2-line:oklch(from var(--ink) l c h / .12);--dl2-well:color-mix(in oklch,var(--ink) 4%,var(--card));--dl2-shade:var(--shadow,oklch(.22 .03 260));--dl2-marker:oklch(from var(--marker,#fae37c) l c h / .8);--dl2-slash:oklch(from var(--danger,oklch(.5 .17 27)) max(l,.7) c h);position:relative;background:var(--surface);color:var(--ink);font-family:var(--font-body);font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px);overflow:hidden}
${R} *,${R} *::before,${R} *::after{box-sizing:border-box}
${R} .dl2-wrap{position:relative;z-index:1;max-width:1120px;margin:0 auto;display:grid;grid-template-columns:minmax(0,1fr);grid-template-areas:"stage" "head" "files";gap:32px}
${R} .dl2-head{grid-area:head;min-width:0}
${R} .dl2-h2{margin:0 0 clamp(12px,1.4vw,16px);font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-.025em);text-transform:var(--display-case,none);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06;text-wrap:balance;color:var(--ink)}
${R} .dl2-mark{background-image:linear-gradient(transparent 58%,var(--dl2-marker) 58%,var(--dl2-marker) 94%,transparent 94%);-webkit-box-decoration-break:clone;box-decoration-break:clone;padding:0 .08em;border-radius:.12em}
${R} .dl2-letter{max-width:64ch}
${R} .dl2-letter p{margin:0 0 12px;text-wrap:pretty}
${R} .dl2-letter .dl2-salute{font-weight:700}
${R} .dl2-sign{margin-top:20px}
${R} .dl2-sign p{margin:0}
${R} .dl2-letter .dl2-sig{margin-top:4px;font-family:var(--signature-font,var(--signature-face,"Caveat",var(--font-display)));font-weight:600;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;color:var(--signature-ink,var(--ink))}
${R} .dl2-letter .dl2-role{font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--muted)}
${R} .dl2-stage{grid-area:stage;align-self:start;min-width:0;background:var(--band);color:var(--band-ink);border-radius:var(--card-radius,var(--radius,14px));padding:clamp(20px,3vw,32px)}
${R} .dl2-photo{display:block;width:100%;height:auto;aspect-ratio:4/3;object-fit:cover;object-position:center;border-radius:12px;background:oklch(from var(--band-ink) l c h / .08)}
${R} .dl2-h3{margin:24px 0 8px;font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);letter-spacing:-.01em;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;text-wrap:balance;color:var(--band-ink)}
${R} .dl2-h3:first-child{margin-top:0}
${R} .dl2-legend{list-style:none;margin:0;padding:0}
${R} .dl2-legend li{display:grid;grid-template-columns:2rem minmax(0,1fr) auto;gap:12px;align-items:start;padding:14px 0;border-top:1px solid oklch(from var(--band-ink) l c h / .16)}
${R} .dl2-legend li:first-child{border-top:0}
${R} .dl2-lnum{font-family:var(--font-display);font-weight:800;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-variant-numeric:tabular-nums}
${R} .dl2-ltitle{display:block;font-weight:700;line-height:1.35;text-wrap:pretty}
${R} .dl2-ldetail{display:block;margin-top:4px;font-size:.9375rem;font-weight:500;line-height:1.4;text-wrap:pretty}
${R} .dl2-lvalue{display:inline-flex;align-items:center;min-height:28px;padding:4px 12px;border-radius:999px;background:oklch(from var(--band-ink) l c h / .12);color:var(--band-ink);font-size:.875rem;font-weight:800;line-height:1.2;font-variant-numeric:tabular-nums;white-space:nowrap}
${R} .dl2-value{margin:16px 0 0;display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 14px;padding:16px 20px;border-radius:10px;background:oklch(from var(--band-ink) l c h / .08)}
${R} .dl2-vlabel{font-size:.9375rem;font-weight:600;line-height:1.4}
${R} .dl2-was{position:relative;display:inline-block;padding:0 4px;text-decoration:none;font-family:var(--font-display);font-weight:800;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1;font-variant-numeric:tabular-nums}
${R} .dl2-was::after{content:"";position:absolute;left:-4px;right:-4px;top:50%;height:3px;margin-top:-1.5px;border-radius:3px;background:var(--dl2-slash);transform:rotate(-16deg)}
${R} .dl2-paid{font-family:var(--font-display);font-weight:800;font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;letter-spacing:-.03em;font-variant-numeric:tabular-nums}
${R} .dl2-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
${R} .dl2-files{grid-area:files;align-self:start;min-width:0;background:var(--card);color:var(--ink);border:1px solid var(--card-border,oklch(from var(--ink) l c h / .12));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-md,0 1px 2px oklch(.22 .03 260 / .22),0 4px 10px -2px oklch(.22 .03 260 / .2)));overflow:hidden}
${R} .dl2-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 16px;padding:12px var(--dl2-x);background:var(--dl2-well);border-bottom:1px solid var(--dl2-line)}
${R} .dl2-alllabel{font-weight:700;line-height:1.35}
${R} .dl2-total{font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted);font-variant-numeric:tabular-nums}
${R} .dl2-empty{margin:0;padding:24px var(--dl2-x);font-size:.9375rem;line-height:1.4;color:var(--muted)}
${R} .dl2-group+.dl2-group{border-top:1px solid var(--dl2-line)}
${R} .dl2-ghead{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;padding:20px var(--dl2-x) 8px}
${R} .dl2-gnum{min-width:1ch;font-family:var(--font-display);font-weight:800;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1;font-variant-numeric:tabular-nums;color:var(--accent)}
${R} .dl2-gtitle{margin:0;flex:1 1 10rem;min-width:0;font-family:var(--font-body);font-size:inherit;font-weight:700;line-height:1.35;color:var(--ink);text-wrap:pretty}
${R} .dl2-chip{display:inline-flex;align-items:center;min-height:28px;padding:4px 12px;border-radius:999px;background:color-mix(in oklch,var(--ink) 6%,var(--card));color:var(--ink);font-size:.875rem;font-weight:800;line-height:1.2}
${R} .dl2-help{margin:4px var(--dl2-x) 8px;border-radius:10px;background:var(--dl2-well)}
${R} .dl2-help summary{display:flex;align-items:center;gap:8px;min-height:44px;padding:8px 14px;border-radius:10px;cursor:pointer;list-style:none;font-size:.9375rem;font-weight:700;line-height:1.4;color:var(--ink);transition:background .16s ease}
${R} .dl2-help summary::-webkit-details-marker{display:none}
${R} .dl2-help summary:hover{background:color-mix(in oklch,var(--ink) 7%,var(--card))}
${R} .dl2-help summary:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .5);outline-offset:2px}
${R} .dl2-helpicon{flex:none;width:16px;height:16px;color:var(--accent)}
${R} .dl2-chev{flex:none;width:16px;height:16px;margin-left:auto;color:var(--muted);transition:transform .16s ease}
${R} .dl2-help[open] .dl2-chev{transform:rotate(180deg)}
${R} .dl2-help ol{margin:0;padding:0 16px 14px 2.4rem;font-size:.9375rem;line-height:1.5;color:var(--ink)}
${R} .dl2-help li{text-wrap:pretty}
${R} .dl2-help li+li{margin-top:4px}
${R} .dl2-rows{list-style:none;margin:0;padding:0 0 8px}
${R} .dl2-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:8px 16px;padding:4px var(--dl2-x);transition:background .16s ease;animation:cf-dl2-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:calc(min(var(--i,0),4) * .07s)}
${R} .dl2-row:hover{background:color-mix(in oklch,var(--ink) 3%,var(--card))}
${R} .dl2-row[data-on="true"]{background:color-mix(in oklch,var(--accent) 8%,var(--card))}
${R} .dl2-row[data-on="true"]:hover{background:color-mix(in oklch,var(--accent) 11%,var(--card))}
${R} .dl2-pick{display:flex;align-items:flex-start;gap:12px;min-width:0;min-height:44px;padding:10px 0;cursor:pointer}
${R} .dl2-pick--all{align-items:center;padding:4px 0}
${R} .dl2-info{min-width:0}
${R} .dl2-name{display:block;font-weight:600;line-height:1.5;color:var(--ink);overflow-wrap:anywhere;text-wrap:pretty}
${R} .dl2-sizem{display:none;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted);font-variant-numeric:tabular-nums}
${R} .dl2-size{min-width:4.5rem;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap;text-align:right}
${R} .dl2-box{position:relative;flex:none;display:inline-grid;place-items:center;width:24px;height:24px;margin-top:1px}
${R} .dl2-pick--all .dl2-box{margin-top:0}
${R} .dl2-box input{grid-area:1 / 1;-webkit-appearance:none;appearance:none;margin:0;width:24px;height:24px;border-radius:7px;border:2px solid color-mix(in oklch,var(--field-ink,var(--ink)) 45%,var(--field,#fff));background:var(--field,#fff);cursor:pointer;transition:background .16s ease,border-color .16s ease,box-shadow .16s ease}
${R} .dl2-box input:hover:not(:disabled){border-color:var(--accent-fill,var(--accent))}
${R} .dl2-box input:checked,${R} .dl2-box input:indeterminate{background:var(--accent-fill,var(--accent));border-color:var(--accent-fill,var(--accent))}
${R} .dl2-box input:focus-visible{outline:none;box-shadow:0 0 0 3px oklch(from var(--field-focus,var(--accent)) l c h / .4)}
${R} .dl2-box input:disabled{cursor:not-allowed;opacity:.5}
${R} .dl2-tick{grid-area:1 / 1;width:16px;height:16px;color:var(--accent-fill-ink,var(--card));pointer-events:none;opacity:0;transform:scale(.6);transition:opacity .16s ease,transform .16s ease}
${R} .dl2-box input:checked~.dl2-tick--on,${R} .dl2-box input:indeterminate~.dl2-tick--mix{opacity:1;transform:none}
${R} .dl2-box input:indeterminate~.dl2-tick--on{opacity:0}
${R} .dl2-filebtn{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:1px solid var(--button-2-border,transparent);border-radius:var(--button-radius,var(--radius,12px));background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));box-shadow:var(--button-2-shadow,var(--shadow-sm,0 1px 2px oklch(.22 .03 260 / .2)));cursor:pointer;text-decoration:none;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
${R} .dl2-filebtn:hover{background:oklch(from var(--button-2-bg,var(--secondary)) calc(l - .05) c h)}
${R} .dl2-filebtn:active{transform:translateY(1px);box-shadow:none}
${R} .dl2-filebtn:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .5);outline-offset:2px}
${R} .dl2-foot{display:grid;gap:16px;padding:20px var(--dl2-x) 24px;border-top:1px solid var(--dl2-line)}
${R} .dl2-selbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 16px}
${R} .dl2-sel{margin:0;display:flex;flex-wrap:wrap;align-items:baseline;align-content:center;gap:2px 10px;min-height:44px}
${R} .dl2-selnum{display:inline-block;font-family:var(--font-display);font-weight:800;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-.01em;font-variant-numeric:tabular-nums;color:var(--ink);animation:cf-dl2-pop .3s cubic-bezier(.2,.7,.2,1)}
${R} .dl2-selmeta{font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted)}
${R} .dl2-second{display:inline-flex;align-items:center;justify-content:center;min-height:56px;padding:0 24px;border:1px solid var(--button-2-border,transparent);border-radius:var(--button-radius,var(--radius,12px));background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));box-shadow:var(--button-2-shadow,var(--shadow-sm,0 1px 2px oklch(.22 .03 260 / .2)));font-family:var(--button-font,var(--font-display));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.15;white-space:nowrap;cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
${R} .dl2-second:hover:not(:disabled){background:oklch(from var(--button-2-bg,var(--secondary)) calc(l - .05) c h)}
${R} .dl2-second:active:not(:disabled){transform:translateY(1px);box-shadow:none}
${R} .dl2-second:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .5);outline-offset:3px}
${R} .dl2-second:disabled{cursor:not-allowed;opacity:.55;box-shadow:none}
${R} .dl2-primary{--dl2-btn:var(--button-bg,var(--cta));display:flex;align-items:center;justify-content:center;width:100%;min-height:64px;padding:0 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--dl2-btn) calc(l + .04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .02) c h));color:var(--button-ink,var(--cta-ink));font-family:var(--button-font,var(--font-display));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;text-align:center;text-decoration:none;text-shadow:var(--button-text-shadow,none);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--dl2-btn) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--dl2-btn) calc(l - .16) c h),0 1px 2px oklch(from var(--dl2-shade) l c h / .3),0 8px 16px -6px oklch(from var(--dl2-shade) l c h / .42));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
${R} .dl2-primary:hover,${R} .dl2-primary.is-hover{background:linear-gradient(oklch(from var(--dl2-btn) calc(l - .01) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .07) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--dl2-btn) calc(l + .12) c h / .6),inset 0 -3px 0 oklch(from var(--dl2-btn) calc(l - .18) c h),0 1px 2px oklch(from var(--dl2-shade) l c h / .34),0 10px 20px -6px oklch(from var(--dl2-shade) l c h / .5))}
${R} .dl2-primary:active,${R} .dl2-primary.is-active{transform:translateY(1px);background:linear-gradient(oklch(from var(--dl2-btn) calc(l - .04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .08) c h));box-shadow:inset 0 2px 4px oklch(from var(--dl2-shade) l c h / .35),inset 0 -2px 0 oklch(from var(--dl2-btn) calc(l - .16) c h)}
${R} .dl2-primary:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .55);outline-offset:3px}
${R} .dl2-note{margin:0;text-align:center;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--muted);text-wrap:pretty}
${R} .dl2-inline{display:inline-block;vertical-align:-.15em;margin-inline-end:.4em;width:16px;height:16px;color:var(--success)}
@keyframes cf-dl2-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes cf-dl2-pop{from{transform:scale(.9)}to{transform:none}}
@media (min-width:960px){${R} .dl2-wrap{grid-template-columns:minmax(0,5fr) minmax(0,7fr);grid-template-areas:"stage head" "stage files";grid-template-rows:auto 1fr;column-gap:clamp(32px,5vw,72px);row-gap:32px}}
@media (min-width:960px) and (min-height:880px){${R} .dl2-stage{position:sticky;top:24px}}
@media (max-width:600px){${R} .dl2-row{grid-template-columns:minmax(0,1fr) auto}${R} .dl2-size{display:none}${R} .dl2-sizem{display:block;margin-top:2px}${R} .dl2-selbar{flex-direction:column;align-items:stretch}${R} .dl2-second{width:100%;white-space:normal}}
@media (prefers-reduced-motion:reduce){${R} .dl2-row,${R} .dl2-selnum{animation:none}${R} .dl2-row,${R} .dl2-primary,${R} .dl2-second,${R} .dl2-filebtn,${R} .dl2-tick,${R} .dl2-box input,${R} .dl2-chev,${R} .dl2-help summary{transition:none}}
`;
pieces/checkout/download-library-2/specimen.tsx 96 lines
import __studioImage61247c78 from "../assets/a19340cc4f39f78c.webp";
import defaults from "../../studio-defaults.json";
import { slot } from "../../slots";
import { DownloadLibrary2, type DownloadGroup, type DownloadLibrary2Props } from "../download-library-2";
export const states = ["default", "hover", "active", "disabled"];
const groups: DownloadGroup[] = [
{
title: "Desktop presets",
detail: "40 looks in four packs, one click each.",
value: "$39",
type: ".xmp",
help: {
title: "How to install .xmp presets",
steps: [
"Unzip the pack you downloaded.",
"In your photo editor, open the Presets panel and click +.",
"Choose Import Presets and pick the .xmp files.",
],
},
files: [
{ id: "coastal", name: "Coastal Light, 10 presets", size: 18400000 },
{ id: "golden", name: "Golden Hour, 10 presets", size: 17900000 },
{ id: "fog", name: "Nordic Fog, 10 presets", size: 16200000 },
{ id: "film", name: "Film Matte, 10 presets", size: 19100000 },
],
},
{
title: "Mobile presets",
detail: "The same 40 looks for editing on your phone.",
value: "$29",
type: ".dng",
help: {
title: "How to add .dng presets on your phone",
steps: [
"Save the DNG files to your phone and open your mobile editor.",
"Import one DNG, open its menu and choose Create Preset.",
"Name it, save it, and apply it to any photo.",
],
},
files: [{ id: "mobile", name: "Mobile pack, 40 DNG files", size: 212600000 }],
},
{
title: "Video LUTs",
detail: "Match your clips to your photos.",
value: "$19",
type: ".cube",
help: {
title: "How to load .cube LUTs",
steps: [
"Unzip the LUT pack.",
"In your video editor, open the colour panel.",
"Browse to a .cube file and apply it to your clip.",
],
},
files: [{ id: "luts", name: "Aperture North LUTs, 12 looks", size: 4800000 }],
},
{
title: "Install and editing guide",
detail: "Setup and the five-minute edit, step by step.",
value: "$10",
type: ".pdf",
files: [{ id: "guide", name: "Install and editing guide", size: 9300000 }],
},
];
export default function DownloadLibrary2Specimen({ state = "default" }: { state?: DownloadLibrary2Props["state"] }) {
const sample = defaults.sample;
return (
<DownloadLibrary2
state={state}
headline="Your Aperture North presets are unpacked and ready"
highlight="unpacked and ready"
salutation="Hi friend,"
paragraphs={[
"Thank you for picking up the Aperture North bundle. Every pack you paid for is right here.",
"Start with the install guide, then try Coastal Light on a photo from your last trip. It takes about five minutes.",
]}
signoff="Happy editing,"
signatureName="Mara Lind"
signatureRole="Founder, Aperture North"
sceneImage={slot(
"scene",
__studioImage61247c78,
)}
imageAlt="The Aperture North bundle laid out: a camera, a phone showing an edited photo and prints in four colour grades"
contentsHeading="Four packs, ready to install tonight"
regularPrice={sample.regularPrice}
price={sample.price}
guarantee={sample.guarantee}
groups={groups}
initialSelected={["coastal", "golden", "guide"]}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalDownloadLibrary2 |
string |
|
highlight OptionalDownloadLibrary2 |
string |
|
salutation OptionalDownloadLibrary2 |
string |
|
paragraphs OptionalDownloadLibrary2 |
string[] |
|
signoff OptionalDownloadLibrary2 |
string |
|
signatureName OptionalDownloadLibrary2 |
string |
|
signatureRole OptionalDownloadLibrary2 |
string |
|
sceneImage OptionalDownloadLibrary2 |
string |
|
imageAlt OptionalDownloadLibrary2 |
string |
|
contentsHeading OptionalDownloadLibrary2 |
string |
|
valueLabel OptionalDownloadLibrary2 |
string |
|
regularPrice OptionalDownloadLibrary2 |
string |
|
paidLabel OptionalDownloadLibrary2 |
string |
|
price OptionalDownloadLibrary2 |
string |
|
guarantee OptionalDownloadLibrary2 |
string |
|
groups OptionalDownloadLibrary2 |
DownloadGroup[] |
|
initialSelected OptionalDownloadLibrary2 |
string[] |
|
href OptionalDownloadLibrary2 |
string |
|
zipSize OptionalDownloadLibrary2 |
number |
|
onAction OptionalDownloadLibrary2 |
() => void |
|
onDownloadSelected OptionalDownloadLibrary2 |
(files: DownloadFile[]) => void |
|
onDownloadFile OptionalDownloadLibrary2 |
(file: DownloadFile) => void |
|
copy OptionalDownloadLibrary2 |
Partial<DownloadLibrary2Copy> |
|
state OptionalDownloadLibrary2 |
"default" | "hover" | "active" | "disabled" |
|
className OptionalDownloadLibrary2 |
string |
Theme roles it reads
Set by the theme bar, a preset or your brand. Colours come from the base tokens (--surface, --ink, --cta…) every piece uses.
--button-bg--button-bg-2--button-case--button-font--button-ink--button-radius--button-shadow--button-text-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--button-2-bg--button-2-border--button-2-ink--button-2-shadow- Secondary button.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field--field-focus--field-ink- Form inputs: background, ink, border, radius and focus colour.
--marker- The highlighter colour behind key phrases.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
scene- A wide atmosphere photo behind or beside the copy.
-
a19340cc4f39f78c.webp
image/webp · 112 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB