Member Login 4
Member login: the door reminds members why they came back (what is new this week, the next live call counting down, the thread everyone is in) while the form gets them inside with a password or a one-tap email link.
Use it in a prompt
Use forms/member-login-4 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/forms/member-login-4.tsx. - Import it and pass your copy and images (Props tab):
import { MemberLogin4 } from "@/components/funneldna/forms/member-login-4"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/member-login-4/component.tsx 630 lines
// layout: path-to-action
// Member login: the door reminds members why they came back (what is new this week, the next live call counting down, the thread everyone is in) while the form gets them inside with a password or a one-tap email link.
import * as React from 'react';
import { AlertCircle, ArrowBigUp, Eye, EyeOff, Loader2, Mail } from 'lucide-react';
import { FX_HOST, Pattern, Spot } from '../fx/fx';
import rocket from '../fx/spots/rocket';
import clock from '../fx/spots/clock';
import community from '../fx/spots/community';
export type MemberLogin4Tile = {
/** Headline of the tile: the new resource or the thread */
title: React.ReactNode;
/** One supporting line (hidden on phones) */
detail?: React.ReactNode;
/** Small fact under the title, e.g. 'Added Monday' or '64 replies' */
meta?: React.ReactNode;
/** fx Spot illustration (an imported spot asset); a fitting default is used when absent */
spot?: string;
};
export type MemberLogin4Call = {
title: React.ReactNode;
/** ISO 8601 start of the real next call; the tile counts down to it */
startsAt: string;
/** Host line, e.g. 'Hosted by coach Marcus T.' */
host?: React.ReactNode;
spot?: string;
};
export type MemberLogin4Method = 'password' | 'magic';
/** What onSubmit receives */
export type MemberLogin4Values = {
method: MemberLogin4Method;
email: string;
password?: string;
remember: boolean;
};
export type MemberLogin4Copy = {
newLabel: string;
callLabel: string;
topicLabel: string;
days: string;
hours: string;
minutes: string;
seconds: string;
/** Screen-reader countdown; {days}, {hours}, {minutes} are replaced */
countdownSr: string;
/** Shown once the call's start time has passed */
callStarted: string;
/** Last stop on the path, leading across to the form; hidden when empty */
door: string;
emailLabel: string;
emailPlaceholder: string;
passwordLabel: string;
passwordPlaceholder: string;
showPassword: string;
hidePassword: string;
capsLock: string;
forgot: string;
remember: string;
/** Plain instruction right above the button; hidden when empty */
instruction: string;
signIn: string;
signingIn: string;
divider: string;
magic: string;
magicBusy: string;
magicNote: string;
emailRequired: string;
emailInvalid: string;
passwordRequired: string;
};
export type MemberLogin4Props = {
/** Headline on the colour band above the tiles */
headline?: React.ReactNode;
lead?: React.ReactNode;
/** Tile: the newest thing inside; hidden when absent */
newThisWeek?: MemberLogin4Tile;
/** Tile: the next live call with a countdown; hidden when absent or the date is invalid */
nextCall?: MemberLogin4Call;
/** Tile: the community's latest topic; hidden when absent */
latestTopic?: MemberLogin4Tile;
formTitle?: React.ReactNode;
formLead?: React.ReactNode;
defaultEmail?: string;
defaultRemember?: boolean;
/** Forgot-password page; without it the link calls onForgotPassword */
forgotHref?: string;
showMagicLink?: boolean;
/** Form-level message from the host, e.g. a rejected password */
error?: React.ReactNode;
/** The host is processing the submit: the pressed button shows a spinner */
busy?: boolean;
disabled?: boolean;
state?: 'default' | 'hover' | 'active' | 'disabled' | 'error';
onSubmit?: (values: MemberLogin4Values) => void;
/** Called with the email typed so far */
onForgotPassword?: (email: string) => void;
copy?: Partial<MemberLogin4Copy>;
className?: string;
};
export function MemberLogin4(props: MemberLogin4Props) {
const {
headline = 'Welcome back. Here’s what’s new inside.',
lead,
newThisWeek,
nextCall,
latestTopic,
formTitle = 'Sign in to your account',
formLead = 'Pick up right where you left off.',
defaultEmail = '',
defaultRemember = true,
forgotHref,
showMagicLink = true,
error,
busy = false,
disabled = false,
state = 'default',
onSubmit,
onForgotPassword,
copy: copyOverrides,
className,
} = props;
const copy: MemberLogin4Copy = { ...DEFAULT_COPY, ...copyOverrides };
const uid = React.useId();
const [email, setEmail] = React.useState(defaultEmail);
const [password, setPassword] = React.useState('');
const [remember, setRemember] = React.useState(defaultRemember);
const [reveal, setReveal] = React.useState(false);
const [caps, setCaps] = React.useState(false);
const [attempt, setAttempt] = React.useState<MemberLogin4Method | null>(null);
const [touched, setTouched] = React.useState({ email: false, password: false });
const [lastMethod, setLastMethod] = React.useState<MemberLogin4Method>('password');
const emailRef = React.useRef<HTMLInputElement>(null);
const passwordRef = React.useRef<HTMLInputElement>(null);
const locked = disabled || state === 'disabled';
const forced = state === 'error';
const errors = validate(email, password, attempt ?? 'password', copy);
const emailError = forced || attempt || touched.email ? errors.email : undefined;
const passwordError = forced || attempt === 'password' || touched.password ? errors.password : undefined;
const busyPassword = busy && lastMethod === 'password';
const busyMagic = busy && lastMethod === 'magic';
const ids = {
title: `${uid}-title`,
band: `${uid}-band`,
email: `${uid}-email`,
emailErr: `${uid}-email-err`,
password: `${uid}-password`,
passwordErr: `${uid}-password-err`,
caps: `${uid}-caps`,
};
const run = (method: MemberLogin4Method) => {
if (locked || busy) return;
setAttempt(method);
const errs = validate(email, password, method, copy);
if (errs.email) {
emailRef.current?.focus();
return;
}
if (errs.password) {
passwordRef.current?.focus();
return;
}
setLastMethod(method);
onSubmit?.({
method,
email: email.trim(),
password: method === 'password' ? password : undefined,
remember,
});
};
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
run('password');
};
const capsCheck = (e: React.KeyboardEvent<HTMLInputElement>) => {
setCaps(e.getModifierState('CapsLock'));
};
const forgot = () => onForgotPassword?.(email.trim());
const callTime = nextCall ? Date.parse(nextCall.startsAt) : NaN;
const tiles: { key: string; featured?: boolean; node: React.ReactNode }[] = [];
if (newThisWeek) tiles.push({ key: 'new', node: <InfoTile label={copy.newLabel} tile={newThisWeek} fallbackSpot={rocket} /> });
if (nextCall && Number.isFinite(callTime)) {
tiles.push({ key: 'call', featured: true, node: <CallTile call={nextCall} time={callTime} copy={copy} /> });
}
if (latestTopic) tiles.push({ key: 'topic', node: <InfoTile label={copy.topicLabel} tile={latestTopic} fallbackSpot={community} /> });
const hasBand = tiles.length > 0;
const passwordDescribed = [caps ? ids.caps : '', passwordError ? ids.passwordErr : ''].filter(Boolean).join(' ') || undefined;
const rootClass = [
'cf-member-login-4',
hasBand ? '' : 'ml4-solo',
state === 'hover' ? 'is-hover' : '',
state === 'active' ? 'is-active' : '',
className ?? '',
].filter(Boolean).join(' ');
return (
<div className={rootClass}>
<style>{CSS}</style>
<form className='ml4-form' noValidate onSubmit={handleSubmit} aria-labelledby={ids.title}>
<h2 id={ids.title} className='ml4-form-title'>{formTitle}</h2>
{formLead ? <p className='ml4-form-lead'>{formLead}</p> : null}
{error ? (
<p className='ml4-alert' role='alert'>
<AlertCircle className='ml4-ico-inline' size={16} strokeWidth={2.5} aria-hidden='true' />
{error}
</p>
) : null}
<fieldset className='ml4-fieldset' disabled={locked}>
<div className='ml4-field'>
<label htmlFor={ids.email} className='ml4-label'>{copy.emailLabel}</label>
<input
ref={emailRef}
id={ids.email}
className='ml4-input'
type='email'
name='email'
autoComplete='email'
inputMode='email'
autoCapitalize='none'
spellCheck={false}
placeholder={copy.emailPlaceholder}
value={email}
readOnly={busy}
onChange={(e) => setEmail(e.target.value)}
onBlur={() => {
if (email) setTouched((t) => ({ ...t, email: true }));
}}
aria-invalid={emailError ? true : undefined}
aria-describedby={emailError ? ids.emailErr : undefined}
/>
{emailError ? (
<p id={ids.emailErr} className='ml4-err'>
<AlertCircle className='ml4-ico-inline' size={16} strokeWidth={2.5} aria-hidden='true' />
{emailError}
</p>
) : null}
</div>
<div className='ml4-field'>
<div className='ml4-label-row'>
<label htmlFor={ids.password} className='ml4-label'>{copy.passwordLabel}</label>
{forgotHref ? (
<a className='ml4-link' href={forgotHref} onClick={forgot}>{copy.forgot}</a>
) : (
<button type='button' className='ml4-link' onClick={forgot}>{copy.forgot}</button>
)}
</div>
<div className='ml4-pass'>
<input
ref={passwordRef}
id={ids.password}
className='ml4-input'
type={reveal ? 'text' : 'password'}
name='password'
autoComplete='current-password'
placeholder={copy.passwordPlaceholder}
value={password}
readOnly={busy}
onChange={(e) => setPassword(e.target.value)}
onKeyDown={capsCheck}
onKeyUp={capsCheck}
onBlur={() => {
setCaps(false);
if (password) setTouched((t) => ({ ...t, password: true }));
}}
aria-invalid={passwordError ? true : undefined}
aria-describedby={passwordDescribed}
/>
<button
type='button'
className='ml4-eye'
aria-label={reveal ? copy.hidePassword : copy.showPassword}
aria-pressed={reveal}
onClick={() => setReveal((r) => !r)}
>
{reveal ? <EyeOff size={20} strokeWidth={2.5} aria-hidden='true' /> : <Eye size={20} strokeWidth={2.5} aria-hidden='true' />}
</button>
</div>
{caps ? (
<p id={ids.caps} className='ml4-caps' role='status'>
<ArrowBigUp className='ml4-ico-inline' size={16} strokeWidth={2.5} aria-hidden='true' />
{copy.capsLock}
</p>
) : null}
{passwordError ? (
<p id={ids.passwordErr} className='ml4-err'>
<AlertCircle className='ml4-ico-inline' size={16} strokeWidth={2.5} aria-hidden='true' />
{passwordError}
</p>
) : null}
</div>
<label className='ml4-check'>
<input
type='checkbox'
className='ml4-box'
name='remember'
checked={remember}
onChange={(e) => setRemember(e.target.checked)}
/>
<span>{copy.remember}</span>
</label>
{copy.instruction ? <p className='ml4-instruction'>{copy.instruction}</p> : null}
<button type='submit' className='ml4-btn ml4-btn-primary' disabled={busy} aria-busy={busyPassword || undefined}>
<span>
{busyPassword ? <Loader2 className='ml4-spin ml4-btn-ico' size={20} strokeWidth={2.5} aria-hidden='true' /> : null}
{busyPassword ? copy.signingIn : copy.signIn}
</span>
</button>
{showMagicLink ? (
<>
<div className='ml4-or'><span>{copy.divider}</span></div>
<button type='button' className='ml4-btn ml4-btn-2' disabled={busy} aria-busy={busyMagic || undefined} onClick={() => run('magic')}>
<span>
{busyMagic ? (
<Loader2 className='ml4-spin ml4-btn-ico' size={20} strokeWidth={2.5} aria-hidden='true' />
) : (
<Mail className='ml4-btn-ico' size={20} strokeWidth={2.5} aria-hidden='true' />
)}
{busyMagic ? copy.magicBusy : copy.magic}
</span>
</button>
{copy.magicNote ? <p className='ml4-note'>{copy.magicNote}</p> : null}
</>
) : null}
</fieldset>
</form>
{hasBand ? (
<aside className='ml4-band' style={FX_HOST} aria-labelledby={ids.band}>
<Pattern name='grid' fade='corner' />
<div className='ml4-band-inner'>
<h2 id={ids.band} className='ml4-headline'>{headline}</h2>
{lead ? <p className='ml4-lead'>{lead}</p> : null}
<ol className='ml4-path'>
{tiles.map((t, i) => (
<li key={t.key} className={t.featured ? 'ml4-stop is-featured' : 'ml4-stop'} style={{ '--i': i } as React.CSSProperties}>
{t.node}
</li>
))}
{copy.door ? (
<li className='ml4-stop ml4-door-item' style={{ '--i': tiles.length } as React.CSSProperties}>
<p className='ml4-door'>
<span>{copy.door}</span>
<span className='ml4-door-line' aria-hidden='true' />
</p>
</li>
) : null}
</ol>
</div>
</aside>
) : null}
</div>
);
}
export default MemberLogin4;
const DEFAULT_COPY: MemberLogin4Copy = {
newLabel: 'New this week',
callLabel: 'Next live call',
topicLabel: 'Hot in the community',
days: 'days',
hours: 'hrs',
minutes: 'min',
seconds: 'sec',
countdownSr: 'Starts in {days} days, {hours} hours and {minutes} minutes.',
callStarted: 'This call has started. Sign in to join it.',
door: 'Your seat is saved. Sign in to get back to it.',
emailLabel: 'Email address',
emailPlaceholder: 'you@example.com',
passwordLabel: 'Password',
passwordPlaceholder: 'Your password',
showPassword: 'Show password',
hidePassword: 'Hide password',
capsLock: 'Caps Lock is on',
forgot: 'Forgot password?',
remember: 'Keep me signed in on this device',
instruction: 'Enter your details, then click the button below to get back inside.',
signIn: 'Sign in',
signingIn: 'Signing you in…',
divider: 'or',
magic: 'Email me a sign-in link',
magicBusy: 'Sending your link…',
magicNote: 'No password needed. The link signs you in with one tap.',
emailRequired: 'Enter the email you joined with.',
emailInvalid: 'That email doesn’t look right. Check for a typo.',
passwordRequired: 'Enter your password, or use a sign-in link below.',
};
const EMAIL_RE = /^[^ @]+@[^ @]+[.][^ @]+$/;
function validate(email: string, password: string, method: MemberLogin4Method, copy: MemberLogin4Copy) {
const out: { email?: string; password?: string } = {};
const e = email.trim();
if (!e) out.email = copy.emailRequired;
else if (!EMAIL_RE.test(e)) out.email = copy.emailInvalid;
if (method === 'password' && !password) out.password = copy.passwordRequired;
return out;
}
function InfoTile({ label, tile, fallbackSpot }: { label: string; tile: MemberLogin4Tile; fallbackSpot: string }) {
return (
<article className='ml4-tile'>
<div className='ml4-text'>
<span className='ml4-chip'>{label}</span>
<h3 className='ml4-title'>{tile.title}</h3>
{tile.detail ? <p className='ml4-detail'>{tile.detail}</p> : null}
{tile.meta ? <p className='ml4-meta'>{tile.meta}</p> : null}
</div>
<div className='ml4-spot' aria-hidden='true'>
<Spot src={tile.spot ?? fallbackSpot} size={64} />
</div>
</article>
);
}
function CallTile({ call, time, copy }: { call: MemberLogin4Call; time: number; copy: MemberLogin4Copy }) {
const now = useNow(time);
const left = Math.max(0, time - now);
const started = left <= 0;
const d = Math.floor(left / 86400000);
const h = Math.floor(left / 3600000) % 24;
const m = Math.floor(left / 60000) % 60;
const s = Math.floor(left / 1000) % 60;
const units: [number, string][] = [
[d, copy.days],
[h, copy.hours],
[m, copy.minutes],
[s, copy.seconds],
];
return (
<article className='ml4-tile is-featured'>
<div className='ml4-text'>
<span className='ml4-chip is-featured'>{copy.callLabel}</span>
<h3 className='ml4-title'>{call.title}</h3>
<p className='ml4-meta'>
<time dateTime={call.startsAt} suppressHydrationWarning>{formatWhen(time)}</time>
{call.host ? <> · {call.host}</> : null}
</p>
</div>
<div className='ml4-spot' aria-hidden='true'>
<Spot src={call.spot ?? clock} size={64} />
</div>
{started ? (
<p className='ml4-started'>{copy.callStarted}</p>
) : (
<>
<span className='ml4-sr' suppressHydrationWarning>{fill(copy.countdownSr, { days: d, hours: h, minutes: m })}</span>
<div className='ml4-units' aria-hidden='true'>
{units.map(([value, label], i) => (
<span className='ml4-unit' key={label + i}>
<span className={i === 3 ? 'ml4-num is-tick' : 'ml4-num'} key={i === 3 ? value : 'n'} suppressHydrationWarning>
{String(value).padStart(2, '0')}
</span>
<span className='ml4-unit-label'>{label}</span>
</span>
))}
</div>
</>
)}
</article>
);
}
function useNow(target: number) {
const [now, setNow] = React.useState(() => Date.now());
React.useEffect(() => {
setNow(Date.now());
if (Date.now() >= target) return;
const id = window.setInterval(() => {
const t = Date.now();
setNow(t);
if (t >= target) window.clearInterval(id);
}, 1000);
return () => window.clearInterval(id);
}, [target]);
return now;
}
function formatWhen(time: number) {
try {
return new Intl.DateTimeFormat(undefined, {
weekday: 'short',
month: 'short',
day: 'numeric',
hour: 'numeric',
minute: '2-digit',
timeZoneName: 'short',
}).format(new Date(time));
} catch {
return new Date(time).toLocaleString();
}
}
function fill(template: string, values: Record<string, string | number>) {
let out = template;
for (const key of Object.keys(values)) out = out.split('{' + key + '}').join(String(values[key]));
return out;
}
const CSS = `
.cf-member-login-4{
--ml4-pad:clamp(20px,4vw,48px);--ml4-shadow:var(--shadow,oklch(0.22 0.03 260));
box-sizing:border-box;display:grid;grid-template-columns:minmax(0,1.08fr) minmax(0,1fr);width:100%;max-width:1120px;margin-inline:auto;
background:var(--card,#fff);color:var(--ink,#1a2233);font-family:var(--font-body);font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;
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(0.22 0.03 260 / 0.22),0 4px 10px -2px oklch(0.22 0.03 260 / 0.2)));overflow:hidden;
& *,& *::before,& *::after{box-sizing:border-box}
&.ml4-solo{grid-template-columns:minmax(0,1fr);max-width:36rem}
&.ml4-solo .ml4-form{grid-column:1}
& .ml4-form{grid-column:2;grid-row:1;min-width:0;padding:var(--ml4-pad)}
& .ml4-form-title{margin:0 0 12px;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(1.3125rem,1.8vw,1.625rem);line-height:1.15;text-wrap:balance}
& .ml4-form-lead{margin:0 0 24px;color:var(--muted);text-wrap:pretty}
& .ml4-alert{margin:0 0 20px;padding:12px 16px;border-radius:10px;background:var(--danger-soft);color:var(--danger);font-size:.9375rem;font-weight:600;line-height:1.4;text-wrap:pretty}
& .ml4-ico-inline{display:inline-block;vertical-align:-0.15em;margin-inline-end:.4em}
& .ml4-btn-ico{display:inline-block;vertical-align:-0.2em;margin-inline-end:10px}
& .ml4-fieldset{margin:0;padding:0;border:0;min-width:0}
& .ml4-field{margin:0 0 20px}
& .ml4-label-row{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 16px;margin-bottom:8px}
& .ml4-label{display:block;font-size:1.0625rem;font-weight:700;line-height:1.3;color:var(--label-ink,var(--ink))}
& .ml4-field > .ml4-label{margin-bottom:8px}
& .ml4-input{display:block;width:100%;min-height:56px;margin:0;padding:0 16px;font-family:var(--font-body);font-size:17px;line-height:1.3;color:var(--field-ink);background:var(--field,#fff);border:1px solid var(--field-border,color-mix(in oklch,var(--ink) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));box-shadow:inset 0 1px 2px oklch(from var(--ml4-shadow) l c h / 0.08);transition:border-color .16s ease,box-shadow .16s ease}
& .ml4-input::placeholder{color:color-mix(in oklch,var(--field-ink) 65%,var(--field));opacity:1}
& .ml4-input:hover:not(:disabled){border-color:color-mix(in oklch,var(--field-ink) 40%,var(--field))}
& .ml4-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.35)}
& .ml4-input[aria-invalid=true]{border-color:var(--danger)}
& .ml4-input[aria-invalid=true]:focus{box-shadow:0 0 0 3px oklch(from var(--danger) l c h / 0.3)}
& .ml4-input:disabled{cursor:not-allowed;background:color-mix(in oklch,var(--field-ink) 6%,var(--field));color:color-mix(in oklch,var(--field-ink) 72%,var(--field))}
& .ml4-pass{position:relative}
& .ml4-pass .ml4-input{padding-right:60px}
& .ml4-eye{position:absolute;top:50%;right:6px;transform:translateY(-50%);display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;border-radius:8px;background:transparent;color:var(--field-ink);cursor:pointer;transition:background .16s ease}
& .ml4-eye:hover:not(:disabled){background:color-mix(in oklch,var(--field-ink) 8%,var(--field))}
& .ml4-eye:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / 0.6);outline-offset:0}
& .ml4-eye:disabled{cursor:not-allowed}
& .ml4-err{margin:8px 0 0;color:var(--danger);font-size:.9375rem;font-weight:600;line-height:1.4;text-wrap:pretty}
& .ml4-caps{display:inline-block;margin:8px 0 0;padding:4px 12px;border-radius:999px;background:var(--warning-soft);color:var(--warning);font-size:.875rem;font-weight:800;line-height:1.4}
& .ml4-link{appearance:none;background:none;border:0;padding:8px 0;margin:-8px 0;font-family:var(--font-body);font-size:.9375rem;font-weight:700;line-height:1.3;color:var(--link,var(--accent));text-decoration:underline;text-decoration-color:oklch(from var(--link,var(--accent)) l c h / 0.45);text-underline-offset:.18em;cursor:pointer}
& .ml4-link:hover:not(:disabled){color:oklch(from var(--link,var(--accent)) calc(l - 0.08) c h);text-decoration-color:currentColor}
& .ml4-link:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / 0.6);outline-offset:2px;border-radius:4px}
& .ml4-link:disabled{color:var(--muted);cursor:not-allowed}
& .ml4-check{display:flex;align-items:flex-start;gap:12px;margin:0 0 24px;font-weight:600;line-height:1.4;cursor:pointer;text-wrap:pretty}
& .ml4-box{flex:0 0 auto;width:20px;height:20px;margin:2px 0 0;accent-color:var(--accent-fill,var(--accent));cursor:pointer}
& .ml4-box:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / 0.6);outline-offset:2px}
& .ml4-fieldset:disabled .ml4-check,& .ml4-box:disabled{cursor:not-allowed}
& .ml4-instruction{margin:0 0 12px;font-size:.9375rem;font-weight:600;line-height:1.4;text-wrap:pretty}
& .ml4-btn{appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:56px;margin:0;padding:0 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));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;cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
& .ml4-btn:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:3px}
& .ml4-btn-primary,& .ml4-btn-primary[aria-busy=true]{--ml4-b:var(--button-bg,var(--cta));--ml4-b2:var(--button-bg-2,var(--cta-2));color:var(--button-ink,var(--cta-ink));text-shadow:var(--button-text-shadow,none);background:linear-gradient(oklch(from var(--ml4-b) calc(l + 0.04) c h),oklch(from var(--ml4-b2) calc(l - 0.02) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--ml4-b) calc(l + 0.14) c h / 0.7),inset 0 -3px 0 oklch(from var(--ml4-b) calc(l - 0.16) c h),0 1px 2px oklch(from var(--ml4-shadow) l c h / 0.3),0 8px 16px -6px oklch(from var(--ml4-shadow) l c h / 0.45))}
& .ml4-btn-primary:hover:not(:disabled),&.is-hover .ml4-btn-primary:not(:disabled){background:linear-gradient(oklch(from var(--ml4-b) calc(l - 0.01) c h),oklch(from var(--ml4-b2) calc(l - 0.07) c h));box-shadow:inset 0 1px 0 oklch(from var(--ml4-b) calc(l + 0.1) c h / 0.6),inset 0 -3px 0 oklch(from var(--ml4-b) calc(l - 0.2) c h),0 1px 2px oklch(from var(--ml4-shadow) l c h / 0.32),0 10px 18px -6px oklch(from var(--ml4-shadow) l c h / 0.5);transform:translateY(-1px)}
& .ml4-btn-primary:active:not(:disabled),&.is-active .ml4-btn-primary:not(:disabled){transform:translateY(1px);box-shadow:inset 0 2px 4px oklch(from var(--ml4-b) calc(l - 0.2) c h / 0.5),inset 0 -2px 0 oklch(from var(--ml4-b) calc(l - 0.16) c h),0 1px 1px oklch(from var(--ml4-shadow) l c h / 0.3)}
& .ml4-btn-2,& .ml4-btn-2[aria-busy=true]{color:var(--button-2-ink,var(--secondary-ink));background:var(--button-2-bg,var(--secondary));border:1px solid var(--button-2-border,transparent);box-shadow:var(--button-2-shadow,var(--shadow-sm,0 1px 2px oklch(0.22 0.03 260 / 0.2)))}
& .ml4-btn-2:hover:not(:disabled){background:oklch(from var(--button-2-bg,var(--secondary)) calc(l - 0.03) c h)}
& .ml4-btn-2:active:not(:disabled){transform:translateY(1px);background:oklch(from var(--button-2-bg,var(--secondary)) calc(l - 0.06) c h)}
& .ml4-btn:disabled{cursor:not-allowed;background:var(--secondary);color:color-mix(in oklch,var(--secondary-ink) 72%,var(--secondary));text-shadow:none;box-shadow:none;transform:none}
& .ml4-btn[aria-busy=true]{cursor:progress}
& .ml4-spin{animation:ml4-spin .8s linear infinite}
& .ml4-or{display:flex;align-items:center;gap:12px;margin:24px 0;color:var(--muted);font-size:.875rem;font-weight:800;line-height:1.2;text-transform:uppercase;letter-spacing:.08em}
& .ml4-or::before,& .ml4-or::after{content:'';flex:1 1 0;height:1px;background:oklch(from var(--ink) l c h / 0.14)}
& .ml4-note{margin:12px 0 0;text-align:center;color:var(--muted);font-size:.9375rem;font-weight:500;line-height:1.4;text-wrap:pretty}
& .ml4-band{grid-column:1;grid-row:1;position:relative;min-width:0;padding:var(--ml4-pad);background:var(--band);color:var(--band-ink);isolation:isolate}
& .ml4-band-inner{position:relative;z-index:1}
& .ml4-headline{margin:0 0 16px;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;text-wrap:balance;color:var(--band-ink)}
& .ml4-lead{margin:0 0 32px;font-size:clamp(1.125rem,1.5vw,1.375rem);font-weight:500;line-height:1.4;color:var(--band-ink);text-wrap:pretty}
& .ml4-headline + .ml4-path{margin-top:32px}
& .ml4-path{list-style:none;margin:0;padding:0 0 0 32px;display:grid;gap:16px}
& .ml4-stop{position:relative;min-width:0;animation:ml4-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:min(calc(var(--i,0) * .07s),.28s)}
& .ml4-stop::before{content:'';position:absolute;left:-32px;top:22px;width:16px;height:16px;border-radius:999px;background:var(--band);box-shadow:inset 0 0 0 2px var(--band-ink)}
& .ml4-stop.is-featured::before{background:var(--band-ink)}
& .ml4-stop:not(:last-child)::after{content:'';position:absolute;left:-25px;top:38px;width:2px;height:100%;background:oklch(from var(--band-ink) l c h / 0.4);transform-origin:top;animation:ml4-draw .6s cubic-bezier(.2,.7,.2,1) both;animation-delay:min(calc(var(--i,0) * .07s + .1s),.38s)}
& .ml4-door{display:flex;align-items:center;gap:12px;min-height:60px;margin:0;font-weight:700;line-height:1.35;color:var(--band-ink);text-wrap:pretty}
& .ml4-door > span:first-child{min-width:0}
& .ml4-door-line{flex:1 1 24px;min-width:24px;height:2px;margin-right:calc(-1 * var(--ml4-pad));background:oklch(from var(--band-ink) l c h / 0.4);transform-origin:left;animation:ml4-drawx .6s cubic-bezier(.2,.7,.2,1) .35s both}
& .ml4-tile{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:0 16px;align-items:start;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(--shadow-sm,0 1px 2px oklch(0.22 0.03 260 / 0.2))}
& .ml4-tile.is-featured{border-color:color-mix(in oklch,var(--accent) 35%,var(--card));box-shadow:var(--shadow-lg,0 2px 4px oklch(0.22 0.03 260 / 0.22),0 12px 24px -8px oklch(0.22 0.03 260 / 0.32))}
& .ml4-text{min-width:0}
& .ml4-chip{display:inline-flex;align-items:center;min-height:28px;margin:0 0 12px;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}
& .ml4-chip.is-featured{background:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card))}
& .ml4-title{margin:0;font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:-0.01em;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;text-wrap:balance;color:var(--ink)}
& .ml4-detail{margin:8px 0 0;color:var(--muted);text-wrap:pretty}
& .ml4-meta{margin:8px 0 0;color:var(--muted);font-size:.9375rem;font-weight:600;line-height:1.4;text-wrap:pretty}
& .ml4-spot{display:flex;line-height:0}
& .ml4-units{grid-column:1 / -1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:16px}
& .ml4-unit{display:block;min-width:0;padding:12px 4px 10px;border-radius:10px;background:color-mix(in oklch,var(--ink) 4%,var(--card));text-align:center}
& .ml4-num{display:block;font-family:var(--font-display);font-weight:800;font-size:clamp(2rem,3.6vw,3.25rem);line-height:1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums;color:var(--ink)}
& .ml4-num.is-tick{animation:ml4-tick .3s cubic-bezier(.2,.7,.2,1) both}
& .ml4-unit-label{display:block;margin-top:8px;font-size:.875rem;font-weight:800;line-height:1.2;color:var(--ink)}
& .ml4-started{grid-column:1 / -1;margin:16px 0 0;padding:12px 16px;border-radius:10px;background:color-mix(in oklch,var(--ink) 4%,var(--card));font-weight:700;line-height:1.4;text-wrap:pretty}
& .ml4-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
@media (max-width:860px){
&{grid-template-columns:minmax(0,1fr)}
& .ml4-form,& .ml4-band{grid-column:1;grid-row:auto}
& .ml4-form-title{font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06}
& .ml4-headline{margin-bottom:16px;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15}
& .ml4-headline + .ml4-path{margin-top:16px}
& .ml4-lead,& .ml4-door-item,& .ml4-spot,& .ml4-detail{display:none}
& .ml4-path{padding-left:0;gap:8px}
& .ml4-stop::before,& .ml4-stop:not(:last-child)::after{display:none}
& .ml4-tile{grid-template-columns:minmax(0,1fr);padding:16px}
& .ml4-chip{margin-bottom:8px}
& .ml4-title{font-size:1.0625rem;line-height:1.3;letter-spacing:0}
& .ml4-meta{margin-top:4px}
& .ml4-units{gap:6px;margin-top:12px}
& .ml4-unit{padding:8px 4px}
& .ml4-num{font-size:clamp(1.3125rem,1.8vw,1.625rem)}
& .ml4-unit-label{margin-top:4px}
& .ml4-started{margin-top:12px}
}
@media (prefers-reduced-motion:reduce){
& .ml4-stop,& .ml4-stop:not(:last-child)::after,& .ml4-door-line,& .ml4-num.is-tick,& .ml4-spin{animation:none}
& .ml4-btn,& .ml4-input,& .ml4-eye{transition:none}
& .ml4-btn-primary:hover:not(:disabled),&.is-hover .ml4-btn-primary:not(:disabled),& .ml4-btn-primary:active:not(:disabled),&.is-active .ml4-btn-primary:not(:disabled),& .ml4-btn-2:active:not(:disabled){transform:none}
}
}
@keyframes ml4-rise{from{opacity:.82;transform:translateY(8px)}}
@keyframes ml4-draw{from{transform:scaleY(0)}}
@keyframes ml4-drawx{from{transform:scaleX(0)}}
@keyframes ml4-tick{from{opacity:.55;transform:translateY(-4px)}}
@keyframes ml4-spin{to{transform:rotate(360deg)}}
`;
pieces/forms/member-login-4/specimen.tsx 46 lines
import * as React from 'react';
import { MemberLogin4 } from '../member-login-4';
import defaults from '../../studio-defaults.json';
export const states = ['default', 'hover', 'active', 'disabled', 'error'];
type SpecimenState = 'default' | 'hover' | 'active' | 'disabled' | 'error';
// The community's weekly call: next Thursday at 6pm local time, so the countdown always has a real date to run to.
function nextCallStart(): string {
const d = new Date();
const ahead = (4 - d.getDay() + 7) % 7 || 7;
d.setDate(d.getDate() + ahead);
d.setHours(18, 0, 0, 0);
return d.toISOString();
}
export default function MemberLogin4Specimen({ state = 'default' }: { state?: SpecimenState }) {
const startsAt = React.useMemo(nextCallStart, []);
const emailLabel = defaults.sample.fields.find((f) => f.name === 'email')?.label ?? 'Email address';
return (
<MemberLogin4
key={state}
state={state}
headline='Welcome back. Here’s what’s new inside the Circle.'
lead='Three reasons to sign in before your next sales call.'
newThisWeek={{
title: 'The Objection Kill Sheet, version 3',
detail: 'Word-for-word answers to “it’s too expensive”, “send me some info” and “I need to think about it”.',
meta: 'Added Monday · in the Vault',
}}
nextCall={{
title: 'Live hot seat: reviving deals that went quiet',
startsAt,
host: 'Hosted by coach Marcus T.',
}}
latestTopic={{
title: '“What’s your opener when they say ‘I only have two minutes’?”',
meta: '64 replies · started by Priya K., Denver',
}}
formTitle='Sign in to The Closers Circle'
defaultEmail={state === 'error' ? 'dana.r@example' : ''}
copy={{ emailLabel }}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalMemberLogin4 |
React.ReactNode |
|
lead OptionalMemberLogin4 |
React.ReactNode |
|
newThisWeek OptionalMemberLogin4 |
MemberLogin4Tile |
|
nextCall OptionalMemberLogin4 |
MemberLogin4Call |
|
latestTopic OptionalMemberLogin4 |
MemberLogin4Tile |
|
formTitle OptionalMemberLogin4 |
React.ReactNode |
|
formLead OptionalMemberLogin4 |
React.ReactNode |
|
defaultEmail OptionalMemberLogin4 |
string |
|
defaultRemember OptionalMemberLogin4 |
boolean |
|
forgotHref OptionalMemberLogin4 |
string |
|
showMagicLink OptionalMemberLogin4 |
boolean |
|
error OptionalMemberLogin4 |
React.ReactNode |
|
busy OptionalMemberLogin4 |
boolean |
|
disabled OptionalMemberLogin4 |
boolean |
|
state OptionalMemberLogin4 |
'default' | 'hover' | 'active' | 'disabled' | 'error' |
|
onSubmit OptionalMemberLogin4 |
(values: MemberLogin4Values) => void |
|
onForgotPassword OptionalMemberLogin4 |
(email: string) => void |
|
copy OptionalMemberLogin4 |
Partial<MemberLogin4Copy> |
|
className OptionalMemberLogin4 |
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-border--field-focus--field-ink--field-radius- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
This piece reads no image slots.
-
5602e47ebdb81810.webp
image/webp · 35.6 KB
-
7c36d7f4dd4ae594.webp
image/webp · 26.5 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
d7814fce240ddf0e.webp
image/webp · 17.6 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB