Affiliate Signup 1
Become-a-partner signup for JV pages: a three-stop route (sign up, share the kit, earn on the sales you send) above the offer partners will share, set beside one bold partner form.
Use it in a prompt
Use jv/affiliate-signup 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/jv/affiliate-signup.tsx. - Import it and pass your copy and images (Props tab):
import { AffiliateSignup } from "@/components/funneldna/jv/affiliate-signup"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/jv/affiliate-signup/component.tsx 525 lines
// layout: route-map
// Become-a-partner signup for JV pages: a three-stop route (sign up, share the kit, earn on the sales you send) above the offer partners will share, set beside one bold partner form.
import * as React from "react";
import { AlertCircle, Loader2, Lock } from "lucide-react";
export type AffiliateSignupField = {
name: string;
label: string;
/** "url" accepts a site or a social handle, so it is not strictly validated. */
type?: "text" | "email" | "url";
autoComplete?: string;
/** Example answer; falls back to the matching copy placeholder for the field type. */
placeholder?: string;
/** Defaults to true. */
required?: boolean;
/** Spans both columns on wide layouts. */
full?: boolean;
};
export type AffiliateSignupStep = {
title: React.ReactNode;
/** "{product}" and "{price}" are replaced in plain-text details. */
detail: React.ReactNode;
};
export type AffiliateSignupProduct = { image: string; alt: string };
export type AffiliateSignupCopy = {
/** "{label}" is replaced with the field label in lower case. */
required: string;
invalidEmail: string;
optional: string;
/** Accessible name of the three-stop route list. */
routeLabel: string;
/** Default placeholder for name fields without their own. */
namePlaceholder: string;
/** Default placeholder for email fields without their own. */
emailPlaceholder: string;
/** Default placeholder for url fields without their own. */
urlPlaceholder: string;
/** Default placeholder for any other field without its own. */
textPlaceholder: string;
/** Half-typed email seeded into email fields in the error state. */
errorEmailSample: string;
};
export type AffiliateSignupProps = {
headline?: React.ReactNode;
/** Line before the numbered reasons; "{product}" and "{price}" are replaced. */
reasonsIntro?: React.ReactNode;
/** Three short reasons the audience says yes, numbered inline. */
reasons?: React.ReactNode[];
productName?: string;
/** What the partner's audience pays; shown on the starburst. */
price?: string;
/** Small word above the price on the starburst. */
priceLabel?: string;
/** Line under the product name on the offer stage; "{product}" and "{price}" are replaced. */
offerNote?: React.ReactNode;
/** The three route stops: sign up, share, earn. */
steps?: AffiliateSignupStep[];
/** Supplied commission, e.g. "50%". Leave out when the program hasn't set it. */
commission?: string;
commissionLabel?: string;
/** Product shots fanned on the offer stage beside the form (slots item-1 to item-3); the first sits in front. */
products?: AffiliateSignupProduct[];
/** Transparent starburst sticker art (slot stamp); a round price sticker is drawn when absent. */
burstImage?: string;
formTitle?: string;
fields?: AffiliateSignupField[];
buttonLabel?: string;
/** Button text while `loading` is true. */
loadingLabel?: string;
privacy?: string;
/** Validation, placeholder and accessible-label copy; merged over the defaults. */
copy?: Partial<AffiliateSignupCopy>;
/** Shows the spinner label and blocks resubmits. */
loading?: boolean;
disabled?: boolean;
state?: "default" | "hover" | "active" | "disabled" | "error";
/** Called with trimmed values once every required field is valid. */
onSubmit?: (values: Record<string, string>) => void;
className?: string;
};
export function AffiliateSignup(props: AffiliateSignupProps) {
const {
headline = DEFAULT_HEADLINE,
reasonsIntro = "Share {product} with your audience. Three reasons they'll say yes:",
reasons = DEFAULT_REASONS,
productName = "The Funnel Starter Kit",
price = "$47",
priceLabel = "just",
offerNote = "What your audience gets for {price}",
steps = DEFAULT_STEPS,
commission,
commissionLabel = "commission on each sale",
products = [],
burstImage,
formTitle = "Your partner details",
fields = DEFAULT_FIELDS,
buttonLabel = "Get My Partner Link",
loadingLabel = "Sending your details…",
privacy = "We respect your inbox. Unsubscribe anytime.",
copy,
loading = false,
disabled = false,
state = "default",
onSubmit,
className,
} = props;
const text: AffiliateSignupCopy = { ...DEFAULT_COPY, ...copy };
const map = { product: productName, price };
const uid = React.useId();
const [values, setValues] = React.useState<Record<string, string>>(() => seedValues(fields, state, text));
const [errors, setErrors] = React.useState<Record<string, string>>(() =>
state === "error" ? validate(fields, seedValues(fields, state, text), text) : {},
);
const [attempted, setAttempted] = React.useState(state === "error");
const inputs = React.useRef<Record<string, HTMLInputElement | null>>({});
const mounted = React.useRef(false);
React.useEffect(() => {
if (!mounted.current) {
mounted.current = true;
return;
}
const seeded = seedValues(fields, state, text);
setValues(seeded);
setErrors(state === "error" ? validate(fields, seeded, text) : {});
setAttempted(state === "error");
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [state]);
const isDisabled = disabled || state === "disabled";
const busy = loading && !isDisabled;
const change = (name: string) => (event: React.ChangeEvent<HTMLInputElement>) => {
const next = { ...values, [name]: event.target.value };
setValues(next);
if (attempted) setErrors(validate(fields, next, text));
};
const submit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault();
if (isDisabled || busy) return;
const found = validate(fields, values, text);
setErrors(found);
setAttempted(true);
const firstBad = fields.find((field) => found[field.name]);
if (firstBad) {
inputs.current[firstBad.name]?.focus();
return;
}
const clean: Record<string, string> = {};
for (const field of fields) clean[field.name] = (values[field.name] ?? "").trim();
onSubmit?.(clean);
};
const route = steps.slice(0, 3);
const shots = products.slice(0, 3);
const hasStage = shots.length > 0;
const buttonClass = ["as-btn", state === "hover" ? "is-hover" : "", state === "active" ? "is-active" : ""]
.filter(Boolean)
.join(" ");
return (
<div className={["cf-affiliate-signup", className].filter(Boolean).join(" ")}>
<style>{CSS}</style>
<header className="as-head">
<h2 className="as-headline">{headline}</h2>
<p className="as-lead">{fill(reasonsIntro, map)}</p>
<ol className="as-reasons">
{reasons.map((reason, i) => (
<li key={i}>
<span className="as-reason-num" aria-hidden="true">
{i + 1}
</span>
<span>{fill(reason, map)}</span>
</li>
))}
</ol>
</header>
<ol className="as-route" aria-label={text.routeLabel}>
{route.map((step, i) => {
const last = i === route.length - 1;
const stopClass = ["as-stop", i === 0 ? "is-start" : "", last ? "is-goal" : ""].filter(Boolean).join(" ");
return (
<li key={i} className={stopClass} style={{ "--i": i } as React.CSSProperties}>
{!last && <span className="as-road" aria-hidden="true" />}
<span className="as-disc" aria-hidden="true">
{i + 1}
</span>
<div className="as-stop-body">
<h3 className="as-stop-title">{step.title}</h3>
<p className="as-stop-detail">{fill(step.detail, map)}</p>
{last && commission && (
<p className="as-commission">
<span className="as-commission-figure">{commission}</span>
<span className="as-commission-label">{commissionLabel}</span>
</p>
)}
</div>
</li>
);
})}
</ol>
<div className={`as-offer${hasStage ? " has-stage" : ""}`}>
{hasStage && (
<figure className="as-stage">
<div className="as-fan">
{shots.map((product, j) => (
<img
key={j}
className={`as-fan-img as-fan-${FAN_POSITIONS[j]}`}
src={product.image}
alt={product.alt}
width={360}
height={360}
loading="lazy"
decoding="async"
/>
))}
<span className={`as-burst${burstImage ? "" : " is-plain"}`}>
{burstImage && (
<img className="as-burst-art" src={burstImage} alt="" width={240} height={240} decoding="async" />
)}
<span className="as-burst-text">
<span className="as-burst-label">{priceLabel}</span>
<span className="as-burst-price">{price}</span>
</span>
</span>
</div>
<figcaption className="as-stage-caption">
<span className="as-stage-name">{productName}</span>
<span className="as-stage-note">{fill(offerNote, map)}</span>
</figcaption>
</figure>
)}
<form className="as-card" noValidate onSubmit={submit} aria-labelledby={`${uid}-title`} aria-busy={busy || undefined}>
<div className="as-card-head">
<span className="as-card-disc" aria-hidden="true">
1
</span>
<h3 className="as-card-title" id={`${uid}-title`}>
{formTitle}
</h3>
</div>
<div className="as-fields">
{fields.map((field) => {
const id = `${uid}-${field.name}`;
const error = errors[field.name];
const required = field.required !== false;
return (
<div key={field.name} className={`as-field${field.full ? " is-full" : ""}${error ? " is-invalid" : ""}`}>
<label className="as-label" htmlFor={id}>
{field.label}
{!required && <span className="as-optional"> {text.optional}</span>}
</label>
<input
ref={(el) => {
inputs.current[field.name] = el;
}}
className="as-input"
id={id}
name={field.name}
type={field.type === "email" ? "email" : "text"}
inputMode={field.type === "email" ? "email" : field.type === "url" ? "url" : undefined}
autoComplete={field.autoComplete}
placeholder={placeholderFor(field, text)}
value={values[field.name] ?? ""}
onChange={change(field.name)}
required={required}
disabled={isDisabled}
aria-invalid={error ? true : undefined}
aria-describedby={error ? `${id}-error` : undefined}
/>
{error && (
<p className="as-error" id={`${id}-error`}>
<AlertCircle aria-hidden="true" className="as-error-icon" />
<span>{error}</span>
</p>
)}
</div>
);
})}
</div>
<button type="submit" className={buttonClass} disabled={isDisabled} aria-disabled={busy || undefined}>
{busy ? (
<>
<Loader2 aria-hidden="true" className="as-spin" />
<span>{loadingLabel}</span>
</>
) : (
<span>{buttonLabel}</span>
)}
</button>
<p className="as-privacy">
<Lock aria-hidden="true" className="as-privacy-icon" />
<span>{privacy}</span>
</p>
</form>
</div>
</div>
);
}
export default AffiliateSignup;
const DEFAULT_HEADLINE = (
<>
Become a partner and <mark>earn on the sales you send</mark>
</>
);
const DEFAULT_STEPS: AffiliateSignupStep[] = [
{ title: "Sign up", detail: "Add your name and email in the form below." },
{ title: "Share the kit", detail: "Send your audience to {product}." },
{ title: "Earn commissions", detail: "On each {price} sale your partner link sends." },
];
const DEFAULT_REASONS: React.ReactNode[] = [
"One clear {price} offer",
"The guide, workbook and checklist in one download",
"A 30-day money-back guarantee",
];
const DEFAULT_FIELDS: AffiliateSignupField[] = [
{ name: "name", label: "Full name", autoComplete: "name" },
{ name: "email", label: "Email address", type: "email", autoComplete: "email" },
{ name: "site", label: "Where you'll share it", type: "url", autoComplete: "url", required: false, full: true },
];
const DEFAULT_COPY: AffiliateSignupCopy = {
required: "Please add your {label} to continue.",
invalidEmail: "Check your email address, like you@example.com.",
optional: "(optional)",
routeLabel: "How the partner program works",
namePlaceholder: "Jane Smith",
emailPlaceholder: "you@example.com",
urlPlaceholder: "yoursite.com or @yourchannel",
textPlaceholder: "Type your answer",
errorEmailSample: "jane@",
};
/** Fan slot class per product index: the first shot sits in front. */
const FAN_POSITIONS = ["mid", "left", "right"];
const EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/;
function fill(value: React.ReactNode, map: Record<string, string>): React.ReactNode {
if (typeof value !== "string") return value;
return fillText(value, map);
}
function fillText(value: string, map: Record<string, string>): string {
return value.replace(/\{(\w+)\}/g, (match, key: string) => (key in map ? map[key] : match));
}
function placeholderFor(field: AffiliateSignupField, copy: AffiliateSignupCopy): string {
if (field.placeholder) return field.placeholder;
if (field.type === "email") return copy.emailPlaceholder;
if (field.type === "url") return copy.urlPlaceholder;
if (/name/i.test(field.name)) return copy.namePlaceholder;
return copy.textPlaceholder;
}
function seedValues(
fields: AffiliateSignupField[],
state: AffiliateSignupProps["state"],
copy: AffiliateSignupCopy,
): Record<string, string> {
const seeded: Record<string, string> = {};
for (const field of fields) seeded[field.name] = state === "error" && field.type === "email" ? copy.errorEmailSample : "";
return seeded;
}
function validate(
fields: AffiliateSignupField[],
values: Record<string, string>,
copy: AffiliateSignupCopy,
): Record<string, string> {
const found: Record<string, string> = {};
for (const field of fields) {
const value = (values[field.name] ?? "").trim();
if (field.required !== false && !value) {
found[field.name] = fillText(copy.required, { label: field.label.toLowerCase() });
} else if (field.type === "email" && value && !EMAIL.test(value)) {
found[field.name] = copy.invalidEmail;
}
}
return found;
}
const R = ".cf-affiliate-signup";
/*
* Theme exceptions (theme-contract.md section 3, image exception):
* text laid on the generated starburst art (slot "stamp") keeps a light ink and a deep red edge chosen for that art.
* Both are component-scoped and overridable: a theme or page that supplies different stamp art sets
* --burst-ink / --burst-edge. When no art is supplied the round sticker is drawn from the CTA tokens instead.
*/
const CSS = `
${R}{--as-shadow:var(--shadow,oklch(0.22 0.03 256));--as-disc:56px;--as-road:12px;--as-gap:2rem;--as-burst-ink:var(--burst-ink,oklch(0.99 0 0));--as-burst-edge:var(--burst-edge,oklch(0.32 0.13 28 / 0.65));width:100%;max-width:68rem;margin-inline:auto;font-family:var(--font-body);color:var(--ink);box-sizing:border-box}
${R} *,${R} *::before,${R} *::after{box-sizing:border-box}
${R} :where(h2,h3,p,ol,figure){margin:0}
${R} .as-head{max-width:54rem;margin-inline:auto;text-align:center}
${R} .as-headline{font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);letter-spacing:var(--display-tracking,-0.03em);font-size:clamp(2.25rem,1.3rem + 3.9vw,4.25rem);line-height:1.03;color:var(--ink);text-wrap:balance}
${R} .as-headline mark{color:inherit;background:linear-gradient(180deg,transparent 40%,var(--marker,oklch(0.92 0.13 96 / 0.72)) 40%,var(--marker,oklch(0.92 0.13 96 / 0.72)) 94%,transparent 94%);padding-inline:0.08em;-webkit-box-decoration-break:clone;box-decoration-break:clone}
${R} .as-lead{max-width:44rem;margin:clamp(1rem,0.7rem + 1vw,1.375rem) auto 0;font-size:clamp(1.125rem,1rem + 0.45vw,1.375rem);line-height:1.5;font-weight:500;color:var(--muted);text-wrap:pretty}
${R} .as-reasons{display:grid;grid-template-columns:minmax(0,max-content);justify-content:center;gap:0.625rem;max-width:56rem;margin:1.125rem auto 0;padding:0;list-style:none}
${R} .as-reasons li{display:flex;align-items:flex-start;gap:0.6rem;max-width:100%;text-align:left;font-size:clamp(1.0625rem,1rem + 0.3vw,1.1875rem);line-height:1.45;font-weight:700;color:var(--ink);text-wrap:pretty}
${R} .as-reason-num{display:inline-grid;place-items:center;flex:none;width:1.75rem;height:1.75rem;margin-top:-0.05rem;border-radius:999px;background:color-mix(in oklch,var(--ink) 8%,var(--surface));color:var(--ink);font-family:var(--font-display);font-size:0.9375rem;font-weight:800;line-height:1}
@media (min-width:880px){${R} .as-reasons{display:flex;flex-wrap:wrap;justify-content:center;gap:0.625rem 1.75rem}${R} .as-reasons li{align-items:center}${R} .as-reason-num{margin-top:0}}
${R} .as-route{position:relative;display:grid;gap:var(--as-gap);max-width:62rem;margin:clamp(2.75rem,1.75rem + 4vw,4.25rem) auto 0;padding:0;list-style:none}
${R} .as-stop{position:relative;display:grid;grid-template-columns:var(--as-disc) minmax(0,1fr);column-gap:1.125rem;align-items:start;align-content:start}
${R} .as-road{position:absolute;z-index:0;left:calc(var(--as-disc) / 2 - var(--as-road) / 2);top:calc(var(--as-disc) / 2);width:var(--as-road);height:calc(100% + var(--as-gap));border-radius:999px;background:var(--band);box-shadow:inset 0 1px 0 oklch(from var(--band) calc(l + 0.08) c h / 0.6)}
${R} .as-road::after{content:'';position:absolute;left:50%;top:0.5rem;bottom:0.5rem;width:2px;transform:translateX(-50%);background:repeating-linear-gradient(180deg,oklch(from var(--band-ink) l c h / 0.6) 0 8px,transparent 8px 16px)}
${R} .as-disc{position:relative;z-index:1;display:grid;place-items:center;width:var(--as-disc);height:var(--as-disc);border:3px solid var(--accent-fill,var(--accent));border-radius:999px;background:var(--card);color:var(--accent);font-family:var(--font-display);font-size:1.375rem;font-weight:800;line-height:1;box-shadow:var(--shadow-sm,0 1px 2px oklch(0.22 0.03 256 / 0.25))}
${R} .as-disc::after{content:'';position:absolute;inset:-3px;border:3px solid var(--accent-fill,var(--accent));border-radius:inherit;opacity:0;pointer-events:none}
${R} .is-goal .as-disc{border-color:var(--success);background:var(--success-soft,color-mix(in oklch,var(--success) 14%,var(--card)));color:var(--success)}
${R} .as-stop-body{min-width:0;padding-top:0.75rem}
${R} .as-stop-title{font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);letter-spacing:var(--display-tracking,-0.015em);font-size:clamp(1.3125rem,1.15rem + 0.55vw,1.5625rem);line-height:1.15;color:var(--ink);text-wrap:balance}
${R} .as-stop-detail{margin-top:0.5rem;font-size:1.0625rem;line-height:1.5;color:var(--muted);text-wrap:pretty}
${R} .as-commission{display:flex;flex-direction:column;gap:0.75rem;margin-top:1rem}
${R} .as-commission-figure{font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(2.5rem,2rem + 1.5vw,3.25rem);line-height:1;color:var(--success);font-variant-numeric:tabular-nums}
${R} .as-commission-label{font-size:0.9375rem;font-weight:600;color:var(--muted)}
@media (min-width:880px){
${R} .as-route{grid-template-columns:repeat(3,minmax(0,1fr));align-items:start}
${R} .as-stop{grid-template-columns:minmax(0,1fr);justify-items:center;row-gap:1.25rem;text-align:center}
${R} .as-road{left:50%;top:calc(var(--as-disc) / 2 - var(--as-road) / 2);width:calc(100% + var(--as-gap));height:var(--as-road)}
${R} .as-road::after{left:0.5rem;right:0.5rem;top:50%;bottom:auto;width:auto;height:2px;transform:translateY(-50%);background:repeating-linear-gradient(90deg,oklch(from var(--band-ink) l c h / 0.6) 0 10px,transparent 10px 20px)}
${R} .as-stop-body{width:100%;padding-top:0}
${R} .as-stop-detail{max-width:17.5rem;margin-inline:auto}
${R} .as-commission{align-items:center}
}
${R} .as-offer{display:grid;grid-template-columns:minmax(0,1fr);gap:clamp(1.25rem,0.75rem + 2vw,2.5rem);max-width:46rem;margin:clamp(2.75rem,1.75rem + 3.5vw,4rem) auto 0;align-items:stretch}
${R} .as-offer.has-stage{max-width:62rem}
@media (min-width:880px){${R} .as-offer.has-stage{grid-template-columns:minmax(0,0.88fr) minmax(0,1.12fr)}}
${R} .as-stage{display:grid;align-content:center;justify-items:center;gap:1.5rem;min-width:0;padding:clamp(2.25rem,1.75rem + 2vw,3rem) clamp(1rem,0.5rem + 2vw,2rem) clamp(1.5rem,1rem + 1.5vw,2.25rem);border-radius:var(--card-radius,calc(var(--radius,12px) + 6px));background:color-mix(in oklch,var(--ink) 4%,var(--surface));text-align:center}
${R} .as-fan{--as-m:clamp(8.5rem,5.5rem + 10vw,11.5rem);--as-s:calc(var(--as-m) * 0.84);--as-b:max(4.75rem,calc(var(--as-m) * 0.5));position:relative;width:min(100%,calc(var(--as-m) * 2.1));height:calc(var(--as-m) + 1rem)}
${R} .as-fan-img{position:absolute;bottom:0;width:var(--as-s);height:var(--as-s);border-radius:0.75rem;object-fit:cover;object-position:center;filter:drop-shadow(0 1px 1px oklch(from var(--as-shadow) l c h / 0.3)) drop-shadow(0 6px 8px oklch(from var(--as-shadow) l c h / 0.22));transition:transform 220ms cubic-bezier(.2,.7,.2,1)}
${R} .as-fan-left{left:0;z-index:1;transform:rotate(-8deg);transform-origin:bottom right}
${R} .as-fan-right{right:0;z-index:1;transform:rotate(8deg);transform-origin:bottom left}
${R} .as-fan-mid{left:50%;bottom:0.5rem;z-index:2;width:var(--as-m);height:var(--as-m);transform:translateX(-50%)}
${R} .as-burst{position:absolute;z-index:3;top:-1.75rem;left:calc(50% + var(--as-m) / 2 - var(--as-b) * 0.55);display:grid;place-items:center;width:var(--as-b);height:var(--as-b);padding:0;transform:rotate(-10deg);color:var(--as-burst-ink);text-align:center;line-height:1}
${R} .as-burst-art{position:absolute;top:-8%;left:-8%;width:116%;height:116%;object-fit:contain;object-position:center;filter:drop-shadow(0 1px 1px oklch(from var(--as-shadow) l c h / 0.35)) drop-shadow(0 4px 6px oklch(from var(--as-shadow) l c h / 0.25))}
/* One centred text stack: each line is trimmed to its cap height and baseline so the pair sits on the burst's optical centre, not on font ascent/descent space. */
${R} .as-burst-text{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0.32rem;width:100%;transform:translate(var(--as-burst-nudge-x,0),var(--as-burst-nudge-y,0));white-space:nowrap}
/* On the starburst art the stack shifts left so "just $47" sits inside the spikes' solid centre with room on the right; a page can tune it with --as-burst-nudge-x. */
${R} .as-burst:not(.is-plain) .as-burst-text{transform:translate(var(--as-burst-nudge-x,-7%),var(--as-burst-nudge-y,0))}
/* Text on the generated starburst art keeps a light ink and a deep red edge (image exception, overridable via --burst-ink / --burst-edge). */
${R} .as-burst-label,${R} .as-burst-price{display:block;line-height:1;text-align:center;text-box:trim-both cap alphabetic;text-shadow:0 1px 0 var(--as-burst-edge)}
${R} .as-burst-label{font-size:0.875rem;font-weight:700}
${R} .as-burst-price{font-family:var(--font-display);font-size:1.625rem;font-weight:var(--display-weight,800);letter-spacing:-0.02em;padding-inline-start:0.02em}
${R} .as-burst.is-plain{border-radius:999px;background:linear-gradient(oklch(from var(--cta) calc(l + 0.04) c h),oklch(from var(--cta) calc(l - 0.05) c h));color:var(--cta-ink);box-shadow:inset 0 -3px 0 oklch(from var(--cta) calc(l - 0.16) c h),var(--shadow-md,0 1px 2px oklch(0.22 0.03 256 / 0.22),0 4px 10px -2px oklch(0.22 0.03 256 / 0.2))}
${R} .as-burst.is-plain .as-burst-label,${R} .as-burst.is-plain .as-burst-price{text-shadow:var(--button-text-shadow,none)}
${R} .as-stage-caption{display:grid;gap:0.4rem;max-width:22rem}
${R} .as-stage-name{font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);letter-spacing:var(--display-tracking,-0.015em);font-size:clamp(1.25rem,1.1rem + 0.5vw,1.5rem);line-height:1.15;color:var(--ink);text-wrap:balance}
${R} .as-stage-note{font-size:1.0625rem;font-weight:500;line-height:1.45;color:var(--muted);text-wrap:pretty}
@media (hover:hover) and (prefers-reduced-motion:no-preference){
${R} .as-stage:hover .as-fan-left{transform:rotate(-12deg) translate(-0.35rem,0)}
${R} .as-stage:hover .as-fan-right{transform:rotate(12deg) translate(0.35rem,0)}
${R} .as-stage:hover .as-fan-mid{transform:translateX(-50%) translateY(-0.25rem)}
}
${R} .as-card{position:relative;min-width:0;padding:clamp(1.25rem,0.8rem + 2vw,2.25rem);border:1px solid var(--card-border,color-mix(in oklch,var(--ink) 12%,transparent));border-radius:var(--card-radius,calc(var(--radius,12px) + 6px));background:var(--card);color:var(--ink);box-shadow:var(--card-shadow,inset 0 1px 0 oklch(from var(--card) calc(l + 0.04) c h / 0.6),var(--shadow-lg,0 2px 4px oklch(0.22 0.03 256 / 0.22),0 12px 24px -8px oklch(0.22 0.03 256 / 0.32)))}
${R} .as-card-head{display:flex;align-items:center;gap:0.75rem;margin-bottom:1.5rem}
${R} .as-card-disc{display:grid;place-items:center;flex:none;width:2.25rem;height:2.25rem;border:2.5px solid var(--accent-fill,var(--accent));border-radius:999px;color:var(--accent);font-family:var(--font-display);font-size:1.0625rem;font-weight:800;line-height:1}
${R} .as-card-title{font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);letter-spacing:var(--display-tracking,-0.02em);font-size:clamp(1.5rem,1.3rem + 0.8vw,1.875rem);line-height:1.12;color:var(--ink);text-wrap:balance}
${R} .as-fields{display:grid;grid-template-columns:minmax(0,1fr);gap:1.125rem 1rem}
@media (min-width:640px){${R} .as-fields{grid-template-columns:repeat(2,minmax(0,1fr))}${R} .as-field.is-full{grid-column:1 / -1}}
${R} .as-field{display:grid;gap:0.5rem;min-width:0;align-content:start}
${R} .as-label{font-size:1.0625rem;font-weight:700;line-height:1.3;color:var(--label-ink,var(--ink))}
${R} .as-optional{font-weight:500;color:var(--muted)}
${R} .as-input{width:100%;min-height:3.5rem;padding:0.85rem 1rem;border:1.5px solid var(--field-border,color-mix(in oklch,var(--ink) 22%,transparent));border-radius:var(--field-radius,var(--radius,10px));background:var(--field);color:var(--field-ink);font:inherit;font-size:1.0625rem;font-weight:500;box-shadow:inset 0 1px 2px oklch(from var(--as-shadow) l c h / 0.08);transition:border-color 160ms ease,box-shadow 160ms ease}
${R} .as-input::placeholder{color:color-mix(in oklch,var(--field-ink) 65%,var(--field));opacity:1}
${R} .as-input:hover:not(:disabled){border-color:color-mix(in oklch,var(--ink) 38%,transparent)}
${R} .as-input:focus{outline:none;border-color:var(--field-focus,var(--accent));box-shadow:0 0 0 3px oklch(from var(--field-focus,var(--accent)) l c h / 0.25)}
${R} .is-invalid .as-input,${R} .is-invalid .as-input:hover:not(:disabled){border-color:var(--danger)}
${R} .is-invalid .as-input:focus{border-color:var(--danger);box-shadow:0 0 0 3px oklch(from var(--danger) l c h / 0.22)}
${R} .as-input:disabled{cursor:not-allowed;opacity:0.6}
${R} .as-error{display:flex;align-items:flex-start;gap:0.4rem;font-size:0.9375rem;font-weight:600;line-height:1.4;color:var(--danger);text-wrap:pretty}
${R} .as-error-icon{flex:none;width:1.05rem;height:1.05rem;margin-top:0.1rem}
${R} .as-btn{--as-b:var(--button-bg,var(--cta));display:flex;align-items:center;justify-content:center;gap:0.6rem;width:100%;min-height:4rem;margin-top:1.5rem;padding:0.9rem 1.5rem;border:1px solid oklch(from var(--as-b) calc(l - 0.12) c h);border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--as-b) calc(l + 0.04) c h),var(--button-bg-2,var(--cta-2)));color:var(--button-ink,var(--cta-ink));font-family:var(--button-font,var(--font-display));font-size:clamp(1.1875rem,1.05rem + 0.6vw,1.4375rem);font-weight:var(--button-weight,800);text-transform:var(--button-case,none);line-height:1.1;letter-spacing:-0.01em;text-align:center;text-wrap:balance;text-shadow:var(--button-text-shadow,none);cursor:pointer;box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--as-b) calc(l + 0.14) c h / 0.7),inset 0 -3px 0 oklch(from var(--as-b) calc(l - 0.16) c h),var(--shadow-md,0 1px 2px oklch(0.22 0.03 256 / 0.22),0 4px 10px -2px oklch(0.22 0.03 256 / 0.2)));transition:transform 140ms ease,background 140ms ease,box-shadow 140ms ease}
${R} .as-btn.is-hover,${R} .as-btn:not(:disabled):hover{background:linear-gradient(oklch(from var(--as-b) calc(l - 0.02) c h),oklch(from var(--as-b) calc(l - 0.1) c h));transform:translateY(-2px);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--as-b) calc(l + 0.1) c h / 0.6),inset 0 -3px 0 oklch(from var(--as-b) calc(l - 0.2) c h),var(--shadow-lg,0 2px 4px oklch(0.22 0.03 256 / 0.22),0 12px 24px -8px oklch(0.22 0.03 256 / 0.32)))}
${R} .as-btn.is-active,${R} .as-btn:not(:disabled):active{background:linear-gradient(oklch(from var(--as-b) calc(l - 0.1) c h),oklch(from var(--as-b) calc(l - 0.06) c h));transform:translateY(1px);box-shadow:inset 0 2px 3px oklch(from var(--as-b) calc(l - 0.25) c h / 0.5),var(--shadow-sm,0 1px 2px oklch(0.22 0.03 256 / 0.25))}
${R} .as-btn:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:3px}
${R} .as-btn:disabled{cursor:not-allowed;opacity:0.55;filter:saturate(0.7)}
${R} .as-btn[aria-disabled='true']{cursor:progress}
${R} .as-spin{flex:none;width:1.2em;height:1.2em}
${R} .as-privacy{display:block;margin-top:0.9rem;font-size:0.9375rem;line-height:1.4;color:var(--muted);text-align:center;text-wrap:pretty}
${R} .as-privacy-icon{display:inline-block;width:1rem;height:1rem;margin-inline-end:0.4rem;vertical-align:-0.15em}
@media (prefers-reduced-motion:no-preference){
${R} .as-road{transform-origin:top center;animation:cf-as-road-y 700ms cubic-bezier(.2,.7,.2,1) both;animation-delay:calc(var(--i) * 180ms + 150ms)}
${R} .as-stop-body{animation:cf-as-rise 450ms ease-out both;animation-delay:calc(var(--i) * 80ms)}
${R} .is-start .as-disc::after{animation:cf-as-pulse 1.8s ease-out 700ms 3}
${R} .as-spin{animation:cf-as-spin 0.9s linear infinite}
}
@media (prefers-reduced-motion:no-preference) and (min-width:880px){${R} .as-road{transform-origin:left center;animation-name:cf-as-road-x}}
@media (prefers-reduced-motion:reduce){${R} .as-fan-img,${R} .as-btn,${R} .as-input{transition:none}${R} .as-btn.is-hover,${R} .as-btn:not(:disabled):hover{transform:none}}
@keyframes cf-as-road-y{from{transform:scaleY(0)}to{transform:scaleY(1)}}
@keyframes cf-as-road-x{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@keyframes cf-as-rise{from{opacity:0.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes cf-as-pulse{0%{opacity:0.6;transform:scale(1)}100%{opacity:0;transform:scale(1.55)}}
@keyframes cf-as-spin{to{transform:rotate(360deg)}}
`;
pieces/jv/affiliate-signup/specimen.tsx 41 lines
import __studioImageca991cd1 from "../assets/95d85a1c3d97f0ce.webp";
import * as React from "react";
import { AffiliateSignup, type AffiliateSignupProps } from "../affiliate-signup";
import defaults from "../../studio-defaults.json";
import { slot } from "../../slots";
export const states = ["default", "hover", "active", "disabled", "error"];
export default function AffiliateSignupSpecimen({ state = "default" }: { state?: AffiliateSignupProps["state"] }) {
const sample = defaults.sample;
const products = sample.items.map((item, i) => ({
image: slot(`item-${i + 1}`, item.image),
alt: item.imageAlt,
}));
const fields: AffiliateSignupProps["fields"] = [
...sample.fields.map((field) => ({
name: field.name,
label: field.label,
autoComplete: field.autoComplete,
type: field.name === "email" ? ("email" as const) : ("text" as const),
})),
{ name: "site", label: "Where you'll share it", type: "url" as const, autoComplete: "url", required: false, full: true },
];
return (
<AffiliateSignup
state={state}
productName={sample.name}
price={sample.price}
products={products}
burstImage={slot("stamp", __studioImageca991cd1)}
reasons={[
`One clear ${sample.price} offer`,
"The guide, workbook and checklist in one download",
`A ${sample.guarantee}`,
]}
fields={fields}
privacy={sample.registration.privacy}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalAffiliateSignup |
React.ReactNode |
|
reasonsIntro OptionalAffiliateSignup |
React.ReactNode |
|
reasons OptionalAffiliateSignup |
React.ReactNode[] |
|
productName OptionalAffiliateSignup |
string |
|
price OptionalAffiliateSignup |
string |
|
priceLabel OptionalAffiliateSignup |
string |
|
offerNote OptionalAffiliateSignup |
React.ReactNode |
|
steps OptionalAffiliateSignup |
AffiliateSignupStep[] |
|
commission OptionalAffiliateSignup |
string |
|
commissionLabel OptionalAffiliateSignup |
string |
|
products OptionalAffiliateSignup |
AffiliateSignupProduct[] |
|
burstImage OptionalAffiliateSignup |
string |
|
formTitle OptionalAffiliateSignup |
string |
|
fields OptionalAffiliateSignup |
AffiliateSignupField[] |
|
buttonLabel OptionalAffiliateSignup |
string |
|
loadingLabel OptionalAffiliateSignup |
string |
|
privacy OptionalAffiliateSignup |
string |
|
copy OptionalAffiliateSignup |
Partial<AffiliateSignupCopy> |
|
loading OptionalAffiliateSignup |
boolean |
|
disabled OptionalAffiliateSignup |
boolean |
|
state OptionalAffiliateSignup |
"default" | "hover" | "active" | "disabled" | "error" |
|
onSubmit OptionalAffiliateSignup |
(values: Record<string, string>) => void |
|
className OptionalAffiliateSignup |
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.
--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-border--field-focus--field-ink--field-radius- 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.
item-*- One image per offer item (item-1, item-2…), shown in stacks and lists.
stamp- A stamp or badge graphic, on a transparent background.
-
95d85a1c3d97f0ce.webp
image/webp · 91.6 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB