Customer Portal 3
Coaching client hub: a segmented call schedule opens the next group call as big local-time numerals with a real countdown and the join action, framed by the coach, replays, invoices and support so high-ticket clients keep showing up.
Use it in a prompt
Use checkout/customer-portal-3 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/customer-portal-3.tsx. - Import it and pass your copy and images (Props tab):
import { CustomerPortal3 } from "@/components/funneldna/checkout/customer-portal-3"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/checkout/customer-portal-3/component.tsx 966 lines
// layout: segmented-stepper
// Coaching client hub: a segmented call schedule opens the next group call as big local-time numerals with a real countdown and the join action, framed by the coach, replays, invoices and support so high-ticket clients keep showing up.
import * as React from "react";
import { AlertCircle, CalendarPlus, Check, Clock, Mail, Phone, Play, Target } from "lucide-react";
import { FX_HOST, Glow, Pattern, Spot } from "../fx/fx";
import phoneSpot from "../fx/spots/phone";
import calendarSpot from "../fx/spots/calendar";
export type HubSession = {
id: string;
title: string;
start?: string; // ISO date-time of the real start; numerals and countdown hide without it
durationMinutes?: number; // sets the end time (60 when missing) and the duration note
milestone?: React.ReactNode; // the milestone this call moves the client toward
joinHref?: string; // meeting link
calendarHref?: string; // .ics or calendar link; a Google Calendar link is built when missing
replayHref?: string; // offered once the call has ended
done?: boolean; // mark the call finished before its end time
};
export type HubCoach = {
name: string;
role?: string;
note?: React.ReactNode; // one short line in the coach's voice
image?: string; // presenter slot
imageAlt?: string;
href?: string; // message link; without it the action calls onCoach
};
export type HubRecording = {
title: string;
date?: string;
duration?: string;
href?: string; // replay link; without it the row calls onRecording
};
export type HubInvoiceStatus = "paid" | "due" | "overdue" | "refunded";
export type HubInvoice = {
id: string;
label: string;
date?: string; // shown as given, e.g. "Paid Oct 31"
amount: string;
status: HubInvoiceStatus;
href?: string; // receipt link; without it the link calls onReceipt
payHref?: string; // checkout for a due or overdue invoice; without it the button calls onPay
};
export type HubSupport = {
email?: string;
phone?: string;
hours?: string;
href?: string; // help desk link; without it the button calls onSupport
};
export type CustomerPortal3Copy = {
sessionsLabel: string;
callLabel: string; // "{n}" placeholder
nextFlag: string;
tba: string;
tbaShort: string;
liveLabel: string;
milestoneLead: string;
startsIn: string;
units: { days: string; hours: string; minutes: string; seconds: string };
zoneNote: string; // "{zone}" placeholder
duration: string; // "{minutes}" placeholder
joinLabel: string;
joinNote: string;
joinPending: string;
calendarLabel: string;
endedNote: string;
replayLabel: string;
coachNext: string; // "{date}" placeholder
coachAction: string; // "{name}" placeholder (coach's first name)
recordingsTitle: string;
recordingsNote: string; // "{count}" placeholder
recordingsNoteOne: string;
recordingsEmpty: string;
invoicesTitle: string;
invoicesNote: string;
invoicesEmpty: string;
invoiceStatus: Record<HubInvoiceStatus, string>;
receiptLabel: string;
receiptAria: string; // "{label}" placeholder
payInstruction: string;
payLabel: string;
payNote: string; // "{amount}" placeholder
supportTitle: string;
supportNote: string;
supportLabel: string;
psPrefix: string;
};
export type CustomerPortal3CopyInput = Partial<Omit<CustomerPortal3Copy, "units" | "invoiceStatus">> & {
units?: Partial<CustomerPortal3Copy["units"]>;
invoiceStatus?: Partial<Record<HubInvoiceStatus, string>>;
};
export type CustomerPortal3Props = {
headline?: string;
highlight?: string; // phrase inside the headline that gets the marker stroke
lead?: string;
sessions?: HubSession[]; // the group calls, in order
defaultSession?: string; // session id to open first; defaults to the next upcoming call
coach?: HubCoach;
recordings?: HubRecording[];
invoices?: HubInvoice[];
support?: HubSupport;
ps?: React.ReactNode; // P.S. line under the join action
timeZone?: string; // IANA zone override; defaults to the visitor's zone
locale?: string;
onAction?: (session: HubSession) => void; // join click
onAddToCalendar?: (session: HubSession) => void;
onReplay?: (session: HubSession) => void;
onCoach?: (coach: HubCoach) => void;
onRecording?: (recording: HubRecording, index: number) => void;
onReceipt?: (invoice: HubInvoice) => void;
onPay?: (invoice: HubInvoice) => void;
onSupport?: (support: HubSupport) => void;
copy?: CustomerPortal3CopyInput;
state?: "default" | "hover" | "active" | "disabled";
className?: string;
};
const DEFAULT_COPY: CustomerPortal3Copy = {
sessionsLabel: "Your group calls",
callLabel: "Call {n}",
nextFlag: "Next",
tba: "Date and time coming soon",
tbaShort: "Date TBA",
liveLabel: "Live now",
milestoneLead: "Next milestone:",
startsIn: "Starts in",
units: { days: "Days", hours: "Hrs", minutes: "Min", seconds: "Sec" },
zoneNote: "Shown in your local time ({zone})",
duration: "{minutes} min",
joinLabel: "Join the Call",
joinNote: "Opens your meeting room in one click.",
joinPending: "Your join link appears here before the call.",
calendarLabel: "Add to Calendar",
endedNote: "This call has ended.",
replayLabel: "Watch the Replay",
coachNext: "Leads your next call · {date}",
coachAction: "Message {name}",
recordingsTitle: "Catch every call you missed",
recordingsNote: "{count} replays ready to watch",
recordingsNoteOne: "1 replay ready to watch",
recordingsEmpty: "No recordings yet. Replays from your group calls will show up here.",
invoicesTitle: "Your investment, all in one place",
invoicesNote: "Every installment and receipt, kept here.",
invoicesEmpty: "No invoices yet.",
invoiceStatus: { paid: "Paid", due: "Due", overdue: "Overdue", refunded: "Refunded" },
receiptLabel: "Receipt",
receiptAria: "Receipt for {label}",
payInstruction: "Click the button below to pay your open invoice.",
payLabel: "Pay Now",
payNote: "{amount} · Secure checkout",
supportTitle: "Stuck between calls? We're here",
supportNote: "Questions about your program, access or billing go straight to the team.",
supportLabel: "Contact Support",
psPrefix: "P.S.",
};
export function CustomerPortal3(props: CustomerPortal3Props) {
const {
headline = "Your next call is set. Show up ready.",
highlight = "next call",
lead = "Join your group call, catch up on every replay and keep your account in order, all from one page.",
sessions = [],
defaultSession,
coach,
recordings = [],
invoices = [],
support,
ps,
timeZone,
locale,
onAction,
onAddToCalendar,
onReplay,
onCoach,
onRecording,
onReceipt,
onPay,
onSupport,
state = "default",
className,
} = props;
const copy = mergeCopy(props.copy);
const uid = React.useId();
const [now, setNow] = React.useState(() => Date.now());
const [picked, setPicked] = React.useState(() => firstIndex(sessions, defaultSession, Date.now()));
const trackRef = React.useRef<HTMLDivElement>(null);
const tabRefs = React.useRef<(HTMLButtonElement | null)[]>([]);
const index = Math.min(Math.max(picked, 0), Math.max(sessions.length - 1, 0));
const active: HubSession | undefined = sessions[index];
const times = active ? timesOf(active) : EMPTY_TIMES;
const endAt = times.end ? times.end.getTime() : 0;
React.useEffect(() => {
if (!endAt || Date.now() >= endAt) return;
const id = window.setInterval(() => {
const t = Date.now();
setNow(t);
if (t >= endAt) window.clearInterval(id);
}, 1000);
return () => window.clearInterval(id);
}, [endAt]);
React.useEffect(() => {
const track = trackRef.current;
const tab = tabRefs.current[index];
if (!track || !tab) return;
const left = tab.offsetLeft - 4;
const right = tab.offsetLeft + tab.offsetWidth + 4;
if (left >= track.scrollLeft && right <= track.scrollLeft + track.clientWidth) return;
const still = typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
track.scrollTo({ left: Math.max(0, left), behavior: still ? "auto" : "smooth" });
}, [index]);
const zone = timeZone ?? localZone();
const nextIdx = sessions.findIndex((s) => !isEnded(s, now));
const ended = active ? isEnded(active, now) : false;
const live = !!(times.start && times.end && !ended && now >= times.start.getTime());
const when = times.start ? partsOf(times.start, zone, locale) : null;
const zoneLabel = when ? when.zoneShort || cityOf(zone) : "";
const cd = times.start && !ended && !live ? countdown(times.start.getTime() - now, copy.units) : null;
const forcedDisabled = state === "disabled";
const joinable = !!active && !forcedDisabled && !!(active.joinHref || onAction);
const onTabKey = (e: React.KeyboardEvent<HTMLButtonElement>, i: number) => {
const last = sessions.length - 1;
let to = -1;
if (e.key === "ArrowRight") to = i === last ? 0 : i + 1;
else if (e.key === "ArrowLeft") to = i === 0 ? last : i - 1;
else if (e.key === "Home") to = 0;
else if (e.key === "End") to = last;
if (to < 0) return;
e.preventDefault();
setPicked(to);
tabRefs.current[to]?.focus();
};
let coachNext = "";
if (nextIdx >= 0) {
const nt = timesOf(sessions[nextIdx]);
if (nt.start) {
const p = partsOf(nt.start, zone, locale);
coachNext = fill(copy.coachNext, { date: p.short + ", " + p.time + (p.period ? " " + p.period : "") });
}
}
let joinEl: React.ReactNode = null;
let calEl: React.ReactNode = null;
let replayEl: React.ReactNode = null;
if (active) {
const s = active;
if (!ended) {
joinEl = joinable && s.joinHref ? (
<a className="cp3-btn cp3-btn--lg" href={s.joinHref} target="_blank" rel="noopener noreferrer" onClick={onAction ? () => onAction(s) : undefined}>
{copy.joinLabel}
</a>
) : (
<button type="button" className="cp3-btn cp3-btn--lg" disabled={!joinable} onClick={joinable && onAction ? () => onAction(s) : undefined}>
{copy.joinLabel}
</button>
);
if (times.start && times.end) {
const inner = (
<>
<CalendarPlus size={20} strokeWidth={2.5} aria-hidden="true" />
{copy.calendarLabel}
</>
);
calEl = onAddToCalendar ? (
<button type="button" className="cp3-btn cp3-btn--2 cp3-btn--lg" onClick={() => onAddToCalendar(s)}>
{inner}
</button>
) : (
<a className="cp3-btn cp3-btn--2 cp3-btn--lg" href={s.calendarHref ?? googleLink(s, times.start, times.end)} target="_blank" rel="noopener noreferrer">
{inner}
</a>
);
}
} else if (s.replayHref || onReplay) {
replayEl = s.replayHref ? (
<a className="cp3-btn cp3-btn--lg" href={s.replayHref} onClick={onReplay ? () => onReplay(s) : undefined}>
{copy.replayLabel}
</a>
) : (
<button type="button" className="cp3-btn cp3-btn--lg" onClick={() => onReplay?.(s)}>
{copy.replayLabel}
</button>
);
}
}
const openInvoice = invoices.find((inv) => inv.status === "overdue") ?? invoices.find((inv) => inv.status === "due");
let payEl: React.ReactNode = null;
if (openInvoice && (openInvoice.payHref || onPay)) {
const inv = openInvoice;
const inner = (
<>
<span>{copy.payLabel}</span>
<span className="cp3-btn-sub">{fill(copy.payNote, { amount: inv.amount })}</span>
</>
);
payEl = inv.payHref ? (
<a className="cp3-btn cp3-btn--two" href={inv.payHref} onClick={onPay ? () => onPay(inv) : undefined}>
{inner}
</a>
) : (
<button type="button" className="cp3-btn cp3-btn--two" onClick={() => onPay?.(inv)}>
{inner}
</button>
);
}
let coachEl: React.ReactNode = null;
if (coach) {
const c = coach;
const label = fill(copy.coachAction, { name: c.name.split(" ")[0] });
const icon = <Mail className="cp3-ic" size={18} strokeWidth={2.5} aria-hidden="true" />;
coachEl = c.href ? (
<a className="cp3-link" href={c.href} onClick={onCoach ? () => onCoach(c) : undefined}>
{icon}
{label}
</a>
) : onCoach ? (
<button type="button" className="cp3-link" onClick={() => onCoach(c)}>
{icon}
{label}
</button>
) : null;
}
let supportEl: React.ReactNode = null;
if (support && (support.href || onSupport)) {
const sp = support;
supportEl = sp.href ? (
<a className="cp3-btn cp3-btn--2" href={sp.href} onClick={onSupport ? () => onSupport(sp) : undefined}>
{copy.supportLabel}
</a>
) : (
<button type="button" className="cp3-btn cp3-btn--2" onClick={() => onSupport?.(sp)}>
{copy.supportLabel}
</button>
);
}
return (
<section className={["cf-cp3", className].filter(Boolean).join(" ")} style={FX_HOST} data-state={state} aria-labelledby={uid + "-h"}>
<style>{CSS}</style>
<Pattern name="grid" fade="top" />
<div className="cp3-wrap">
<header className="cp3-head">
<h2 className="cp3-h2" id={uid + "-h"}>
{renderHeadline(headline, highlight)}
</h2>
{lead ? <p className="cp3-lead">{lead}</p> : null}
</header>
<div className="cp3-grid">
{active ? (
<article className="cp3-tile cp3-next" style={FX_HOST} aria-labelledby={uid + "-title"}>
<Glow />
<div className="cp3-next-in">
<div className="cp3-seg" role="tablist" aria-label={copy.sessionsLabel} ref={trackRef}>
{sessions.map((s, i) => {
const t = timesOf(s);
const done = isEnded(s, now);
const selected = i === index;
return (
<button
key={s.id}
ref={(el) => {
tabRefs.current[i] = el;
}}
type="button"
role="tab"
id={uid + "-tab-" + i}
aria-selected={selected}
aria-controls={uid + "-panel"}
tabIndex={selected ? 0 : -1}
className="cp3-tab"
onClick={() => setPicked(i)}
onKeyDown={(e) => onTabKey(e, i)}
>
<span className="cp3-tab-top">
{done ? (
<span className="cp3-tick" aria-hidden="true">
<Check size={12} strokeWidth={3} />
</span>
) : null}
{fill(copy.callLabel, { n: String(i + 1) })}
{i === nextIdx ? <span className="cp3-flag">{copy.nextFlag}</span> : null}
</span>
<span className="cp3-tab-date">{t.start ? partsOf(t.start, zone, locale).tabDate : copy.tbaShort}</span>
</button>
);
})}
</div>
<div key={active.id} className="cp3-panel" role="tabpanel" id={uid + "-panel"} aria-labelledby={uid + "-tab-" + index}>
<div className="cp3-intro">
<div className="cp3-title-row">
<h3 className="cp3-h3" id={uid + "-title"}>
{active.title}
</h3>
{live ? (
<span className="cp3-live">
<span className="cp3-live-dot" aria-hidden="true" />
{copy.liveLabel}
</span>
) : null}
</div>
{active.milestone ? (
<p className="cp3-milestone">
<Target className="cp3-ic" size={18} strokeWidth={2.5} aria-hidden="true" />
<strong>{copy.milestoneLead}</strong> {active.milestone}
</p>
) : null}
</div>
{when ? (
<div className="cp3-when-wrap">
<time className="cp3-when" dateTime={times.start ? times.start.toISOString() : undefined}>
<span className="cp3-when-g">
<span className="cp3-num">{when.day}</span>
<span className="cp3-when-sub">
<b>{when.weekday}</b>
<span>{when.month}</span>
</span>
</span>
<span className="cp3-when-g">
<span className="cp3-num">{when.time}</span>
<span className="cp3-when-sub">
<b>{when.period || zoneLabel}</b>
{when.period ? <span>{zoneLabel}</span> : null}
</span>
</span>
</time>
<p className="cp3-zone">
<Clock className="cp3-ic" size={16} strokeWidth={2.5} aria-hidden="true" />
{fill(copy.zoneNote, { zone: zoneLabel })}
{active.durationMinutes ? " · " + fill(copy.duration, { minutes: String(active.durationMinutes) }) : ""}
</p>
</div>
) : (
<p className="cp3-tba">{copy.tba}</p>
)}
{cd ? (
<div className="cp3-count">
<p className="cp3-count-label" id={uid + "-cd"}>
{copy.startsIn}
</p>
<ul className="cp3-cells" aria-labelledby={uid + "-cd"}>
{cd.map((u) => (
<li key={u.k} className="cp3-cell">
<span className="cp3-cell-n">
<span key={u.v} className="cp3-tickv">
{u.v}
</span>
</span>
<span className="cp3-cell-u">{u.label}</span>
</li>
))}
</ul>
</div>
) : null}
<div className="cp3-actions">
{ended ? replayEl : joinEl}
{ended ? null : calEl}
<p className="cp3-act-note">{ended ? copy.endedNote : joinable ? copy.joinNote : copy.joinPending}</p>
</div>
{ps ? (
<p className="cp3-ps">
<strong>{copy.psPrefix}</strong> {ps}
</p>
) : null}
</div>
</div>
</article>
) : null}
{coach ? (
<article className="cp3-tile cp3-coach" aria-labelledby={uid + "-coach"}>
{coach.image ? (
<div className="cp3-photo">
<img src={coach.image} alt={coach.imageAlt ?? coach.name} loading="lazy" decoding="async" />
</div>
) : null}
<div className="cp3-tile-head">
<h3 className="cp3-h3" id={uid + "-coach"}>
{coach.name}
</h3>
{coach.role ? <p className="cp3-note">{coach.role}</p> : null}
</div>
{coach.note ? <p className="cp3-say">{coach.note}</p> : null}
{coachNext ? (
<p className="cp3-meta">
<Clock className="cp3-ic" size={16} strokeWidth={2.5} aria-hidden="true" />
{coachNext}
</p>
) : null}
{coachEl}
</article>
) : null}
<article className="cp3-tile cp3-rec" aria-labelledby={uid + "-rec"}>
<div className="cp3-tile-head">
<h3 className="cp3-h3" id={uid + "-rec"}>
{copy.recordingsTitle}
</h3>
{recordings.length ? (
<p className="cp3-note">
{recordings.length === 1 ? copy.recordingsNoteOne : fill(copy.recordingsNote, { count: String(recordings.length) })}
</p>
) : null}
</div>
{recordings.length ? (
<ul className="cp3-list">
{recordings.map((r, i) => (
<li key={r.title + i}>
<RecordingRow item={r} index={i} onRecording={onRecording} />
</li>
))}
</ul>
) : (
<div className="cp3-empty">
<span className="cp3-spot">
<Spot src={calendarSpot} size={64} />
</span>
<p>{copy.recordingsEmpty}</p>
</div>
)}
</article>
<article className="cp3-tile cp3-inv-tile" aria-labelledby={uid + "-inv"}>
<div className="cp3-tile-head">
<h3 className="cp3-h3" id={uid + "-inv"}>
{copy.invoicesTitle}
</h3>
{invoices.length ? <p className="cp3-note">{copy.invoicesNote}</p> : null}
</div>
{invoices.length ? (
<ul className="cp3-invs">
{invoices.map((inv) => {
const aria = fill(copy.receiptAria, { label: inv.label });
const receipt =
inv.status === "paid" && inv.href ? (
<a className="cp3-link cp3-link--sm" href={inv.href} aria-label={aria} onClick={onReceipt ? () => onReceipt(inv) : undefined}>
{copy.receiptLabel}
</a>
) : inv.status === "paid" && onReceipt ? (
<button type="button" className="cp3-link cp3-link--sm" aria-label={aria} onClick={() => onReceipt(inv)}>
{copy.receiptLabel}
</button>
) : null;
return (
<li className="cp3-inv" key={inv.id}>
<span className="cp3-inv-main">
<span className="cp3-row-t">{inv.label}</span>
{inv.date || receipt ? (
<span className="cp3-row-m">
{inv.date}
{inv.date && receipt ? " · " : null}
{receipt}
</span>
) : null}
</span>
<span className="cp3-amt">{inv.amount}</span>
<span className={"cp3-chip cp3-chip--" + inv.status}>
{inv.status === "paid" ? (
<Check size={16} strokeWidth={3} aria-hidden="true" />
) : inv.status === "overdue" ? (
<AlertCircle size={16} strokeWidth={2.5} aria-hidden="true" />
) : null}
{copy.invoiceStatus[inv.status]}
</span>
</li>
);
})}
</ul>
) : (
<p className="cp3-note">{copy.invoicesEmpty}</p>
)}
{payEl ? (
<div className="cp3-pay">
<p className="cp3-pay-say">{copy.payInstruction}</p>
{payEl}
</div>
) : null}
</article>
{support ? (
<article className="cp3-tile cp3-sup" aria-labelledby={uid + "-sup"}>
<div className="cp3-sup-in">
<span className="cp3-spot">
<Spot src={phoneSpot} size={72} />
</span>
<div className="cp3-tile-head">
<h3 className="cp3-h3" id={uid + "-sup"}>
{copy.supportTitle}
</h3>
<p className="cp3-note">{copy.supportNote}</p>
</div>
{support.email || support.phone || support.hours ? (
<ul className="cp3-contact">
{support.email ? (
<li>
<Mail className="cp3-ic" size={18} strokeWidth={2.5} aria-hidden="true" />
<a className="cp3-link" href={"mailto:" + support.email}>
{support.email.split("@").map((part, i) => (
<React.Fragment key={i}>
{i ? (
<>
<wbr />@
</>
) : null}
{part}
</React.Fragment>
))}
</a>
</li>
) : null}
{support.phone ? (
<li>
<Phone className="cp3-ic" size={18} strokeWidth={2.5} aria-hidden="true" />
<a className="cp3-link" href={"tel:" + support.phone.replace(/[^+0-9]/g, "")}>
{support.phone}
</a>
</li>
) : null}
{support.hours ? <li className="cp3-note">{support.hours}</li> : null}
</ul>
) : null}
{supportEl}
</div>
</article>
) : null}
</div>
</div>
</section>
);
}
export default CustomerPortal3;
function RecordingRow({ item, index, onRecording }: { item: HubRecording; index: number; onRecording?: (recording: HubRecording, index: number) => void }) {
const inner = (
<>
<span className="cp3-disc" aria-hidden="true">
<Play size={20} strokeWidth={2.5} />
</span>
<span className="cp3-row-body">
<span className="cp3-row-t">{item.title}</span>
{item.date ? <span className="cp3-row-m">{item.date}</span> : null}
</span>
{item.duration ? <span className="cp3-row-end">{item.duration}</span> : null}
</>
);
if (item.href) {
return (
<a className="cp3-row" href={item.href} onClick={onRecording ? () => onRecording(item, index) : undefined}>
{inner}
</a>
);
}
if (onRecording) {
return (
<button type="button" className="cp3-row" onClick={() => onRecording(item, index)}>
{inner}
</button>
);
}
return <div className="cp3-row cp3-row--static">{inner}</div>;
}
const EMPTY_TIMES: { start: Date | null; end: Date | null } = { start: null, end: null };
function timesOf(s: HubSession): { start: Date | null; end: Date | null } {
const t = s.start ? Date.parse(s.start) : NaN;
if (!Number.isFinite(t)) return EMPTY_TIMES;
return { start: new Date(t), end: new Date(t + (s.durationMinutes ?? 60) * 60000) };
}
function isEnded(s: HubSession, now: number) {
if (s.done) return true;
const t = timesOf(s);
return !!t.end && now >= t.end.getTime();
}
function firstIndex(sessions: HubSession[], id: string | undefined, now: number) {
if (id) {
const i = sessions.findIndex((s) => s.id === id);
if (i >= 0) return i;
}
const n = sessions.findIndex((s) => !isEnded(s, now));
return n >= 0 ? n : Math.max(sessions.length - 1, 0);
}
function localZone(): string | undefined {
try {
return Intl.DateTimeFormat().resolvedOptions().timeZone;
} catch {
return undefined;
}
}
function cityOf(zone?: string) {
if (!zone) return "";
const last = zone.split("/").pop() ?? zone;
return last.split("_").join(" ");
}
function partsOf(date: Date, zone: string | undefined, locale: string | undefined) {
const make = (o: Intl.DateTimeFormatOptions) => {
try {
return new Intl.DateTimeFormat(locale, zone ? { ...o, timeZone: zone } : o);
} catch {
return new Intl.DateTimeFormat(undefined, o);
}
};
const timeParts = make({ hour: "numeric", minute: "2-digit" }).formatToParts(date);
const zoneParts = make({ hour: "numeric", timeZoneName: "short" }).formatToParts(date);
return {
day: make({ day: "numeric" }).format(date),
weekday: make({ weekday: "short" }).format(date),
month: make({ month: "short" }).format(date),
time: timeParts
.filter((p) => p.type !== "dayPeriod")
.map((p) => p.value)
.join("")
.trim(),
period: timeParts.find((p) => p.type === "dayPeriod")?.value ?? "",
zoneShort: zoneParts.find((p) => p.type === "timeZoneName")?.value ?? "",
short: make({ weekday: "short", month: "short", day: "numeric" }).format(date),
tabDate: make({ month: "short", day: "numeric" }).format(date),
};
}
function countdown(ms: number, units: CustomerPortal3Copy["units"]) {
const total = Math.max(0, Math.floor(ms / 1000));
const pad = (n: number) => String(n).padStart(2, "0");
return [
{ k: "d", v: pad(Math.floor(total / 86400)), label: units.days },
{ k: "h", v: pad(Math.floor((total % 86400) / 3600)), label: units.hours },
{ k: "m", v: pad(Math.floor((total % 3600) / 60)), label: units.minutes },
{ k: "s", v: pad(total % 60), label: units.seconds },
];
}
function googleLink(s: HubSession, start: Date, end: Date) {
const stamp = (d: Date) => d.toISOString().slice(0, 19).replace(/[-:]/g, "") + "Z";
const q = ["action=TEMPLATE", "text=" + encodeURIComponent(s.title), "dates=" + stamp(start) + "/" + stamp(end)];
if (s.joinHref) q.push("location=" + encodeURIComponent(s.joinHref));
return "https://calendar.google.com/calendar/render?" + q.join("&");
}
function fill(text: string, vars: Record<string, string>) {
return Object.keys(vars).reduce((out, k) => out.split("{" + k + "}").join(vars[k]), text);
}
function mergeCopy(input?: CustomerPortal3CopyInput): CustomerPortal3Copy {
return {
...DEFAULT_COPY,
...input,
units: { ...DEFAULT_COPY.units, ...input?.units },
invoiceStatus: { ...DEFAULT_COPY.invoiceStatus, ...input?.invoiceStatus },
};
}
function renderHeadline(text: string, hl?: string) {
if (!hl) return text;
const at = text.indexOf(hl);
if (at < 0) return text;
return (
<>
{text.slice(0, at)}
<span className="cp3-mark">{hl}</span>
{text.slice(at + hl.length)}
</>
);
}
const CSS = `
.cf-cp3 {
--cp3-shadow: var(--shadow, oklch(0.22 0.03 260));
--cp3-soft: color-mix(in oklch, var(--band-ink) 80%, var(--band));
--cp3-hair: oklch(from var(--ink) l c h / 0.12);
--cp3-well: color-mix(in oklch, var(--ink) 4%, var(--card));
--cp3-ring: var(--field-focus, var(--accent));
--cp3-marker: color-mix(in oklch, var(--marker, #fae37c) 62%, var(--surface));
position: relative;
overflow: hidden;
background: var(--surface);
color: var(--ink);
font-family: var(--font-body);
padding: clamp(56px, 8vw, 112px) clamp(16px, 5vw, 48px) clamp(64px, 8.5vw, 120px);
}
.cf-cp3 *, .cf-cp3 *::before, .cf-cp3 *::after { box-sizing: border-box; }
.cf-cp3 .cp3-wrap { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; }
.cf-cp3 .cp3-head { display: grid; gap: 16px; max-width: 46rem; margin-bottom: clamp(32px, 4vw, 48px); }
.cf-cp3 .cp3-h2 { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight, 800); letter-spacing: var(--display-tracking, -0.025em); text-transform: var(--display-case, none); font-size: clamp(2rem, 3.6vw, 3.25rem); line-height: 1.06; color: var(--ink); text-wrap: balance; }
.cf-cp3 .cp3-mark { background: linear-gradient(transparent 52%, var(--cp3-marker) 52%, var(--cp3-marker) 94%, transparent 94%); -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 0.06em; border-radius: 3px; }
.cf-cp3 .cp3-lead { margin: 0; max-width: 60ch; font-size: clamp(1.125rem, 1.5vw, 1.375rem); line-height: 1.4; font-weight: 500; color: var(--muted); text-wrap: pretty; }
.cf-cp3 .cp3-grid { display: grid; gap: clamp(12px, 1.6vw, 20px); grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-areas: 'next next next next coach coach' 'rec rec rec inv inv inv' 'support support support support support support'; }
.cf-cp3 .cp3-next { grid-area: next; }
.cf-cp3 .cp3-coach { grid-area: coach; }
.cf-cp3 .cp3-sup { grid-area: support; container: cp3sup / inline-size; }
.cf-cp3 .cp3-rec { grid-area: rec; container: cp3rec / inline-size; }
.cf-cp3 .cp3-inv-tile { grid-area: inv; container: cp3inv / inline-size; }
.cf-cp3 .cp3-tile { position: relative; min-width: 0; display: flex; flex-direction: column; gap: 16px; padding: clamp(20px, 3vw, 32px); background: var(--card); color: var(--ink); border: 1px solid var(--card-border, oklch(from var(--ink) l c h / 0.12)); border-radius: var(--card-radius, var(--radius, 14px)); box-shadow: var(--card-shadow, var(--shadow-md, 0 1px 2px oklch(from var(--cp3-shadow) l c h / 0.22), 0 4px 10px -2px oklch(from var(--cp3-shadow) l c h / 0.2))); }
.cf-cp3 .cp3-tile-head { display: grid; gap: 8px; }
.cf-cp3 .cp3-h3 { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight, 800); letter-spacing: -0.01em; text-transform: var(--display-case, none); font-size: clamp(1.3125rem, 1.8vw, 1.625rem); line-height: 1.15; text-wrap: balance; }
.cf-cp3 .cp3-note { margin: 0; font-size: 0.9375rem; line-height: 1.4; font-weight: 500; color: var(--muted); text-wrap: pretty; }
.cf-cp3 .cp3-ic { display: inline-block; vertical-align: -0.15em; margin-inline-end: 0.4em; flex: none; }
.cf-cp3 .cp3-next { --cp3-ring: var(--band-ink); overflow: hidden; background: var(--band); color: var(--band-ink); border-color: oklch(from var(--band-ink) l c h / 0.1); box-shadow: var(--shadow-lg, 0 2px 4px oklch(from var(--cp3-shadow) l c h / 0.22), 0 12px 24px -8px oklch(from var(--cp3-shadow) l c h / 0.32)); }
.cf-cp3 .cp3-next-in { position: relative; z-index: 1; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: clamp(20px, 2.4vw, 28px); }
.cf-cp3 .cp3-seg { position: relative; display: flex; gap: 4px; padding: 4px; border-radius: calc(var(--radius, 12px) + 4px); background: oklch(from var(--band-ink) l c h / 0.1); overflow-x: auto; scroll-snap-type: x proximity; overscroll-behavior-x: contain; scrollbar-width: none; }
.cf-cp3 .cp3-seg::-webkit-scrollbar { display: none; }
.cf-cp3 .cp3-tab { flex: 1 0 auto; min-width: 104px; min-height: 56px; display: grid; align-content: center; gap: 4px; padding: 8px 14px; scroll-snap-align: start; border: 0; border-radius: var(--radius, 12px); background: transparent; color: var(--band-ink); font: inherit; text-align: left; cursor: pointer; transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease; }
.cf-cp3 .cp3-tab:hover { background: oklch(from var(--band-ink) l c h / 0.12); }
.cf-cp3 .cp3-tab:active { background: oklch(from var(--band-ink) l c h / 0.18); }
.cf-cp3 .cp3-tab[aria-selected='true'] { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm, 0 1px 2px oklch(from var(--cp3-shadow) l c h / 0.25)); }
.cf-cp3 .cp3-tab:focus-visible { outline: 3px solid var(--band-ink); outline-offset: -3px; }
.cf-cp3 .cp3-tab[aria-selected='true']:focus-visible { outline-color: var(--field-focus, var(--accent)); }
.cf-cp3 .cp3-tab-top { display: inline-flex; align-items: center; gap: 6px; font-size: 0.875rem; font-weight: 800; line-height: 1.2; white-space: nowrap; }
.cf-cp3 .cp3-tab-date { font-size: 0.875rem; font-weight: 500; line-height: 1.2; color: var(--cp3-soft); white-space: nowrap; }
.cf-cp3 .cp3-tab[aria-selected='true'] .cp3-tab-date { color: var(--muted); }
.cf-cp3 .cp3-tick { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 999px; background: var(--success); color: var(--card); flex: none; }
.cf-cp3 .cp3-flag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; background: var(--accent-fill, var(--accent)); color: var(--accent-fill-ink, var(--card)); font-size: 0.875rem; font-weight: 800; line-height: 1.2; }
.cf-cp3 .cp3-panel { flex: 1; display: flex; flex-direction: column; gap: clamp(20px, 2.4vw, 28px); animation: cp3-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.cf-cp3 .cp3-intro { display: grid; gap: 12px; }
.cf-cp3 .cp3-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.cf-cp3 .cp3-next .cp3-h3 { color: var(--band-ink); }
.cf-cp3 .cp3-milestone { margin: 0; font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.5; color: var(--cp3-soft); text-wrap: pretty; }
.cf-cp3 .cp3-milestone strong { color: var(--band-ink); font-weight: 800; }
.cf-cp3 .cp3-live { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 4px 12px; border-radius: 999px; background: var(--success); color: var(--card); font-size: 0.875rem; font-weight: 800; line-height: 1.2; }
.cf-cp3 .cp3-live-dot { width: 8px; height: 8px; border-radius: 999px; background: currentColor; }
.cf-cp3 .cp3-when-wrap { display: grid; gap: clamp(28px, 3.4vw, 48px); }
.cf-cp3 .cp3-when { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px clamp(24px, 4vw, 48px); }
.cf-cp3 .cp3-when-g { display: inline-flex; align-items: flex-end; gap: 12px; }
.cf-cp3 .cp3-num { font-family: var(--font-display); font-weight: var(--display-weight, 800); letter-spacing: -0.035em; font-variant-numeric: tabular-nums; font-size: clamp(3rem, 6.4vw, 5.5rem); line-height: 1; color: var(--band-ink); white-space: nowrap; }
.cf-cp3 .cp3-when-sub { display: grid; gap: 2px; padding-bottom: 0.2em; font-size: clamp(1.125rem, 1.5vw, 1.375rem); line-height: 1.1; white-space: nowrap; }
.cf-cp3 .cp3-when-sub b { font-weight: 800; color: var(--band-ink); }
.cf-cp3 .cp3-when-sub span { font-weight: 600; color: var(--cp3-soft); }
.cf-cp3 .cp3-zone { margin: 0; font-size: 0.9375rem; line-height: 1.4; font-weight: 500; color: var(--cp3-soft); }
.cf-cp3 .cp3-tba { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight, 800); font-size: clamp(1.3125rem, 1.8vw, 1.625rem); line-height: 1.15; color: var(--band-ink); }
.cf-cp3 .cp3-count { display: grid; gap: 12px; }
.cf-cp3 .cp3-count-label { margin: 0; font-size: 0.9375rem; font-weight: 700; line-height: 1.4; color: var(--cp3-soft); }
.cf-cp3 .cp3-cells { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-width: 460px; margin: 0; padding: 0; list-style: none; }
.cf-cp3 .cp3-cell { display: grid; justify-items: center; gap: 18px; padding: 10px 8px 10px; border-radius: 10px; background: oklch(from var(--band-ink) l c h / 0.1); }
.cf-cp3 .cp3-cell-n { font-family: var(--font-display); font-weight: var(--display-weight, 800); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; font-size: clamp(1.75rem, 2.6vw, 2.25rem); line-height: 1.2; color: var(--band-ink); }
.cf-cp3 .cp3-cell-u { font-size: 0.875rem; font-weight: 700; line-height: 1.2; color: var(--cp3-soft); }
.cf-cp3 .cp3-tickv { display: inline-block; animation: cp3-tick 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.cf-cp3 .cp3-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cf-cp3 .cp3-act-note { flex-basis: 100%; margin: 0; font-size: 0.9375rem; line-height: 1.4; font-weight: 500; color: var(--cp3-soft); }
.cf-cp3 .cp3-ps { margin: auto 0 0; font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.5; color: var(--band-ink); text-wrap: pretty; }
.cf-cp3 .cp3-ps strong { font-weight: 800; }
.cf-cp3 .cp3-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 28px; border: 0; border-radius: var(--button-radius, var(--radius, 12px)); background: linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l + 0.04) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.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); white-space: nowrap; cursor: pointer; box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--cp3-shadow) l c h / 0.3), 0 8px 16px -6px oklch(from var(--cp3-shadow) l c h / 0.45)); transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease; }
.cf-cp3 .cp3-btn--lg { min-height: 64px; }
.cf-cp3 .cp3-btn:hover:not(:disabled), .cf-cp3[data-state='hover'] .cp3-btn:not(:disabled):not(.cp3-btn--2) { background: linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l - 0.01) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.07) c h)); box-shadow: inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.12) c h / 0.6), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.2) c h), 0 1px 2px oklch(from var(--cp3-shadow) l c h / 0.34), 0 10px 18px -6px oklch(from var(--cp3-shadow) l c h / 0.55); }
.cf-cp3 .cp3-btn:active:not(:disabled), .cf-cp3[data-state='active'] .cp3-btn:not(:disabled):not(.cp3-btn--2) { transform: translateY(1px); background: linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l - 0.04) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.09) c h)); box-shadow: inset 0 2px 4px oklch(from var(--button-bg, var(--cta)) calc(l - 0.22) c h / 0.5), inset 0 -2px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--cp3-shadow) l c h / 0.3); }
.cf-cp3 .cp3-btn:focus-visible { outline: 3px solid var(--cp3-ring); outline-offset: 3px; }
.cf-cp3 .cp3-btn--2 { background: var(--button-2-bg, var(--secondary)); color: var(--button-2-ink, var(--secondary-ink)); border: 1px solid var(--button-2-border, transparent); box-shadow: var(--button-2-shadow, var(--shadow-sm)); text-shadow: none; }
.cf-cp3 .cp3-btn--2:hover:not(:disabled), .cf-cp3[data-state='hover'] .cp3-btn--2:not(:disabled) { background: oklch(from var(--button-2-bg, var(--secondary)) calc(l - 0.04) c h); box-shadow: var(--button-2-shadow, var(--shadow-sm)); }
.cf-cp3 .cp3-btn--2:active:not(:disabled), .cf-cp3[data-state='active'] .cp3-btn--2:not(:disabled) { transform: translateY(1px); background: oklch(from var(--button-2-bg, var(--secondary)) calc(l - 0.07) c h); box-shadow: var(--button-2-shadow, var(--shadow-sm)); }
.cf-cp3 .cp3-next .cp3-btn--2 { background: color-mix(in oklch, var(--band-ink) 14%, var(--band)); color: var(--band-ink); border-color: oklch(from var(--band-ink) l c h / 0.22); box-shadow: var(--shadow-sm, 0 1px 2px oklch(from var(--cp3-shadow) l c h / 0.25)); }
.cf-cp3 .cp3-next .cp3-btn--2:hover:not(:disabled), .cf-cp3[data-state='hover'] .cp3-next .cp3-btn--2:not(:disabled) { background: color-mix(in oklch, var(--band-ink) 20%, var(--band)); box-shadow: var(--shadow-sm, 0 1px 2px oklch(from var(--cp3-shadow) l c h / 0.25)); }
.cf-cp3 .cp3-next .cp3-btn--2:active:not(:disabled), .cf-cp3[data-state='active'] .cp3-next .cp3-btn--2:not(:disabled) { background: color-mix(in oklch, var(--band-ink) 26%, var(--band)); box-shadow: var(--shadow-sm, 0 1px 2px oklch(from var(--cp3-shadow) l c h / 0.25)); }
.cf-cp3 .cp3-btn:disabled { cursor: not-allowed; background: var(--secondary); color: var(--secondary-ink); box-shadow: none; text-shadow: none; transform: none; }
.cf-cp3 .cp3-next .cp3-btn:disabled { background: oklch(from var(--band-ink) l c h / 0.14); color: var(--cp3-soft); }
.cf-cp3 .cp3-btn--two { flex-direction: column; gap: 2px; min-height: 64px; padding: 10px 28px; }
.cf-cp3 .cp3-btn-sub { font-family: var(--font-body); font-size: 0.9375rem; font-weight: 600; letter-spacing: 0; text-transform: none; }
.cf-cp3 .cp3-photo { position: relative; flex: 1 1 180px; min-height: 180px; border-radius: 12px; overflow: hidden; background: var(--cp3-well); }
.cf-cp3 .cp3-photo img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.cf-cp3 .cp3-coach .cp3-tile-head { gap: 4px; }
.cf-cp3 .cp3-say { margin: 0; font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.5; font-weight: 500; color: var(--ink); text-wrap: pretty; }
.cf-cp3 .cp3-meta { margin: 0; font-size: 0.9375rem; line-height: 1.4; font-weight: 600; color: var(--muted); }
.cf-cp3 .cp3-link { align-self: flex-start; padding: 0; border: 0; background: none; font: inherit; font-size: 1.0625rem; font-weight: 700; line-height: 1.4; color: var(--link, var(--accent)); text-align: left; text-decoration: underline; text-decoration-color: oklch(from var(--link, var(--accent)) l c h / 0.45); text-underline-offset: 0.18em; overflow-wrap: anywhere; cursor: pointer; }
.cf-cp3 .cp3-link:hover { color: oklch(from var(--link, var(--accent)) calc(l - 0.08) c h); text-decoration-color: currentColor; }
.cf-cp3 .cp3-link:focus-visible { outline: 3px solid oklch(from var(--field-focus, var(--accent)) l c h / 0.45); outline-offset: 3px; border-radius: 4px; }
.cf-cp3 .cp3-link--sm { font-size: 0.9375rem; }
.cf-cp3 .cp3-list { display: grid; gap: 2px; margin: 0 -12px; padding: 0; list-style: none; }
.cf-cp3 .cp3-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: start; gap: 4px 16px; width: 100%; padding: 12px; border: 0; border-radius: var(--button-radius, var(--radius, 12px)); background: transparent; color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer; transition: background 0.16s ease; }
.cf-cp3 .cp3-row--static { cursor: default; }
.cf-cp3 a.cp3-row:hover, .cf-cp3 button.cp3-row:hover { background: var(--cp3-well); }
.cf-cp3 a.cp3-row:active, .cf-cp3 button.cp3-row:active { background: color-mix(in oklch, var(--ink) 8%, var(--card)); }
.cf-cp3 .cp3-row:focus-visible { outline: 3px solid oklch(from var(--field-focus, var(--accent)) l c h / 0.5); outline-offset: -3px; }
.cf-cp3 .cp3-disc { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; background: color-mix(in oklch, var(--ink) 6%, var(--card)); color: var(--accent); transition: background 0.16s ease, color 0.16s ease; }
.cf-cp3 a.cp3-row:hover .cp3-disc, .cf-cp3 button.cp3-row:hover .cp3-disc { background: var(--accent-fill, var(--accent)); color: var(--accent-fill-ink, var(--card)); }
.cf-cp3 .cp3-row-body { display: grid; gap: 2px; min-width: 0; padding-top: 1px; }
.cf-cp3 .cp3-row-t { font-size: 1.0625rem; font-weight: 700; line-height: 1.3; color: var(--ink); text-wrap: pretty; }
.cf-cp3 .cp3-row-m { font-size: 0.9375rem; font-weight: 500; line-height: 1.4; color: var(--muted); }
.cf-cp3 .cp3-row-end { padding-top: 2px; font-size: 0.9375rem; font-weight: 700; line-height: 1.3; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
@container cp3rec (max-width: 420px) {
.cf-cp3 .cp3-row { grid-template-columns: 40px minmax(0, 1fr); }
.cf-cp3 .cp3-row-end { grid-column: 2; padding-top: 0; font-weight: 600; }
}
.cf-cp3 .cp3-empty { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 10px; background: var(--cp3-well); }
.cf-cp3 .cp3-empty p { margin: 0; font-size: 1.0625rem; line-height: 1.5; font-weight: 500; text-wrap: pretty; }
.cf-cp3 .cp3-spot { display: block; flex: none; line-height: 0; }
.cf-cp3 .cp3-invs { margin: 0; padding: 0; list-style: none; }
.cf-cp3 .cp3-inv { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: 'main amt chip'; align-items: start; gap: 6px 14px; padding: 14px 0; border-bottom: 1px solid var(--cp3-hair); }
.cf-cp3 .cp3-inv:first-child { padding-top: 4px; }
.cf-cp3 .cp3-inv:last-child { border-bottom: 0; }
.cf-cp3 .cp3-inv-main { grid-area: main; display: grid; gap: 2px; min-width: 0; }
.cf-cp3 .cp3-amt { grid-area: amt; padding-top: 1px; font-size: 1.0625rem; font-weight: 800; line-height: 1.3; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cf-cp3 .cp3-chip { grid-area: chip; justify-self: end; display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 4px 12px; border-radius: 999px; background: color-mix(in oklch, var(--ink) 6%, var(--card)); color: var(--ink); font-size: 0.875rem; font-weight: 800; line-height: 1.2; white-space: nowrap; }
.cf-cp3 .cp3-chip--paid { background: var(--success); color: var(--card); }
.cf-cp3 .cp3-chip--overdue { background: var(--danger); color: var(--card); }
.cf-cp3 .cp3-chip--due { background: var(--warning-soft); color: var(--warning); }
@container cp3inv (max-width: 400px) {
.cf-cp3 .cp3-inv { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'main amt' 'main chip'; }
}
.cf-cp3 .cp3-pay { margin-top: auto; display: grid; justify-items: stretch; gap: 16px; padding: 20px; border-radius: 10px; background: var(--cp3-well); text-align: center; }
.cf-cp3 .cp3-pay-say { margin: 0; font-size: 1.0625rem; font-weight: 600; line-height: 1.45; text-wrap: pretty; }
.cf-cp3 .cp3-contact { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 1.0625rem; line-height: 1.4; }
.cf-cp3 .cp3-contact li > svg { color: var(--muted); }
.cf-cp3 .cp3-sup-in { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.cf-cp3 .cp3-sup .cp3-btn { margin-top: auto; align-self: stretch; }
@container cp3sup (min-width: 760px) {
.cf-cp3 .cp3-sup-in { display: grid; grid-template-columns: auto minmax(0, 1.25fr) minmax(0, 1fr) auto; align-items: center; gap: 16px 32px; }
.cf-cp3 .cp3-sup .cp3-btn { margin-top: 0; justify-self: end; }
}
@media (max-width: 1000px) {
.cf-cp3 .cp3-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: 'next next' 'coach rec' 'inv inv' 'support support'; }
}
@media (max-width: 680px) {
.cf-cp3 .cp3-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'next' 'coach' 'rec' 'inv' 'support'; }
.cf-cp3 .cp3-photo { flex: none; aspect-ratio: 4 / 3; min-height: 0; }
.cf-cp3 .cp3-actions .cp3-btn, .cf-cp3 .cp3-pay .cp3-btn, .cf-cp3 .cp3-sup .cp3-btn { width: 100%; }
.cf-cp3 .cp3-pay { justify-items: stretch; }
.cf-cp3 .cp3-sup .cp3-btn { align-self: stretch; }
}
@media (max-width: 420px) {
.cf-cp3 .cp3-cells { gap: 6px; }
.cf-cp3 .cp3-cell { padding: 10px 4px 8px; }
.cf-cp3 .cp3-tab { min-width: 96px; padding: 8px 12px; }
}
@keyframes cp3-in { from { opacity: 0.82; transform: translateY(8px); } }
@keyframes cp3-tick { from { opacity: 0.55; transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) {
.cf-cp3 .cp3-panel, .cf-cp3 .cp3-tickv { animation: none; }
.cf-cp3 .cp3-btn, .cf-cp3 .cp3-tab, .cf-cp3 .cp3-row, .cf-cp3 .cp3-disc { transition: none; }
.cf-cp3 .cp3-btn:active:not(:disabled), .cf-cp3[data-state='active'] .cp3-btn:not(:disabled) { transform: none; }
}
`;
pieces/checkout/customer-portal-3/specimen.tsx 75 lines
import __studioImage791c625c from "../assets/c2ba6f92a8b47d31.webp";
import * as React from "react";
import { CustomerPortal3 } from "../customer-portal-3";
import defaults from "../../studio-defaults.json";
import { slot } from "../../slots";
export const states = ["default", "hover", "active", "disabled"];
type SpecimenState = "default" | "hover" | "active" | "disabled";
const HOUR = 60 * 60 * 1000;
const DAY = 24 * HOUR;
const noop = () => {};
export default function CustomerPortal3Specimen({ state = "default" }: { state?: SpecimenState }) {
const [base] = React.useState(() => {
const d = new Date();
d.setMinutes(0, 0, 0);
return d.getTime() + 2 * DAY + 3 * HOUR;
});
const at = (offset: number) => new Date(base + offset).toISOString();
const day = (offset: number) => new Date(base + offset).toLocaleDateString(undefined, { month: "short", day: "numeric" });
return (
<CustomerPortal3
state={state}
headline="Your next call is set. Show up ready."
highlight="next call"
lead="Welcome back, Jordan. Your Momentum Mastermind calls, replays and account live here, so every week moves you one milestone closer."
sessions={[
{ id: "call-1", title: "Kickoff: Your 12-Month Map", start: at(-21 * DAY), durationMinutes: 90, milestone: "Lock in your one big goal for the year" },
{ id: "call-2", title: "Offer Teardown", start: at(-14 * DAY), durationMinutes: 90, milestone: "Sharpen the promise of your core offer" },
{ id: "call-3", title: "Pricing Your Premium Tier", start: at(-7 * DAY), durationMinutes: 90, milestone: "Set a price you can say out loud" },
{ id: "call-4", title: "Launch Week Hot Seats", start: at(0), durationMinutes: 90, milestone: "Open the cart on your premium offer" },
{ id: "call-5", title: "Sales Call Clinic", start: at(7 * DAY), durationMinutes: 90, milestone: "Close your first premium client" },
{ id: "call-6", title: "Quarter Review", milestone: "Plan your next 90 days with the group" },
]}
coach={{
name: "Maya Torres",
role: "Founder and lead coach",
note: "“Hot seats go to whoever shows up with a real number. Bring yours.”",
image: slot(
"presenter",
__studioImage791c625c
),
imageAlt: "Portrait of Maya Torres, lead coach of Momentum Mastermind",
}}
recordings={[
{ title: "Call 3 · Pricing Your Premium Tier", date: day(-7 * DAY), duration: "88 min" },
{ title: "Call 2 · Offer Teardown", date: day(-14 * DAY), duration: "92 min" },
{ title: "Call 1 · Kickoff: Your 12-Month Map", date: day(-21 * DAY), duration: "95 min" },
{ title: `Bonus · ${defaults.sample.registration.name} replay`, duration: "48 min" },
]}
invoices={[
{ id: "INV-1042", label: "Mastermind · Installment 1 of 3", date: `Paid ${day(-64 * DAY)}`, amount: "$2,500", status: "paid" },
{ id: "INV-1043", label: "Mastermind · Installment 2 of 3", date: `Paid ${day(-34 * DAY)}`, amount: "$2,500", status: "paid" },
{ id: "INV-1044", label: "Mastermind · Installment 3 of 3", date: `Due ${day(-4 * DAY)}`, amount: "$2,500", status: "overdue" },
]}
support={{
email: "support@momentummastermind.com",
phone: "(555) 014-2290",
hours: "Mon–Fri, 9am–5pm ET. Replies within one business day.",
}}
ps="Can't make it live? The replay lands in your recordings, so you never lose a week."
onAction={noop}
onAddToCalendar={noop}
onReplay={noop}
onCoach={noop}
onRecording={noop}
onReceipt={noop}
onPay={noop}
onSupport={noop}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalCustomerPortal3 |
string |
|
highlight OptionalCustomerPortal3 |
string |
|
lead OptionalCustomerPortal3 |
string |
|
sessions OptionalCustomerPortal3 |
HubSession[] |
|
defaultSession OptionalCustomerPortal3 |
string |
|
coach OptionalCustomerPortal3 |
HubCoach |
|
recordings OptionalCustomerPortal3 |
HubRecording[] |
|
invoices OptionalCustomerPortal3 |
HubInvoice[] |
|
support OptionalCustomerPortal3 |
HubSupport |
|
ps OptionalCustomerPortal3 |
React.ReactNode |
|
timeZone OptionalCustomerPortal3 |
string |
|
locale OptionalCustomerPortal3 |
string |
|
onAction OptionalCustomerPortal3 |
(session: HubSession) => void |
|
onAddToCalendar OptionalCustomerPortal3 |
(session: HubSession) => void |
|
onReplay OptionalCustomerPortal3 |
(session: HubSession) => void |
|
onCoach OptionalCustomerPortal3 |
(coach: HubCoach) => void |
|
onRecording OptionalCustomerPortal3 |
(recording: HubRecording, index: number) => void |
|
onReceipt OptionalCustomerPortal3 |
(invoice: HubInvoice) => void |
|
onPay OptionalCustomerPortal3 |
(invoice: HubInvoice) => void |
|
onSupport OptionalCustomerPortal3 |
(support: HubSupport) => void |
|
copy OptionalCustomerPortal3 |
CustomerPortal3CopyInput |
|
state OptionalCustomerPortal3 |
"default" | "hover" | "active" | "disabled" |
|
className OptionalCustomerPortal3 |
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-focus- 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.
presenter- A photo of the host, coach or founder.
-
09bc3d4486616844.webp
image/webp · 23.2 KB
-
321240b3188e2da4.webp
image/webp · 18.7 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
c2ba6f92a8b47d31.webp
image/webp · 42 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB