Member Login 5
First-time buyer door: a route runs from 'order placed' to the first result, and this form is the you-are-here stop. New buyers set a password against live rules (every tick moves them down the road); returning members sign in. onSubmit carries the mode.
Use it in a prompt
Use forms/member-login-5 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-5.tsx. - Import it and pass your copy and images (Props tab):
import { MemberLogin5 } from "@/components/funneldna/forms/member-login-5"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/member-login-5/component.tsx 673 lines
// layout: route-map
// First-time buyer door: a route runs from 'order placed' to the first result, and this form is the you-are-here stop. New buyers set a password against live rules (every tick moves them down the road); returning members sign in. onSubmit carries the mode.
import * as React from 'react';
import { AlertCircle, Check, Eye, EyeOff, KeyRound, Loader2, Lock, Sparkles } from 'lucide-react';
export type MemberLogin5Mode = 'sign-in' | 'first-time';
/** What onSubmit receives: the mode tells the host to sign the member in or to create the password */
export type MemberLogin5Values = { mode: MemberLogin5Mode; email: string; password: string };
export type MemberLogin5Milestone = {
label: React.ReactNode;
/** One supporting line (hidden on phones) */
detail?: React.ReactNode;
};
export type MemberLogin5Rule = {
label: React.ReactNode;
/** True when the typed password meets the rule */
test: (password: string) => boolean;
};
export type MemberLogin5Copy = {
tabsLabel: string;
tabSignIn: string;
tabFirstTime: string;
firstTitle: string;
firstLead: string;
signInTitle: string;
signInLead: string;
orderEmailLabel: string;
orderEmailHint: string;
emailLabel: string;
emailPlaceholder: string;
newPasswordLabel: string;
newPasswordPlaceholder: string;
passwordLabel: string;
passwordPlaceholder: string;
showPassword: string;
hidePassword: string;
forgot: string;
strengthLabel: string;
strengthEmpty: string;
strengthWeak: string;
strengthFair: string;
strengthGood: string;
strengthStrong: string;
rulesTitle: string;
/** Screen-reader status after a rule that is met */
ruleMet: string;
/** Screen-reader status after a rule that is not met yet */
ruleUnmet: string;
firstAction: string;
/** Benefit line inside the button, under the action */
firstActionSub: string;
signInAction: string;
signInActionSub: string;
busyAction: string;
/** Shown under the locked button until every rule passes; hidden when empty */
rulesPending: string;
toFirstPrompt: string;
toFirstLink: string;
toSignInPrompt: string;
toSignInLink: string;
routeLabel: string;
youAreHere: string;
/** Screen-reader status after a completed stop */
stopDone: string;
emailRequired: string;
emailInvalid: string;
passwordRequired: string;
};
export type MemberLogin5Props = {
headline?: React.ReactNode;
lead?: React.ReactNode;
/** Stops on the route, from the purchase to the result */
milestones?: MemberLogin5Milestone[];
/** Index of the you-are-here stop (this form) */
current?: number;
/** scene slot: a flat-lay photo of the kit, shown beside the form on wide screens */
sceneImage?: string;
sceneImageAlt?: string;
/** Plain caption under the photo; hidden when empty */
sceneCaption?: React.ReactNode;
/** Rules a new password must meet; the button unlocks when all pass */
rules?: MemberLogin5Rule[];
defaultMode?: MemberLogin5Mode;
defaultEmail?: string;
/** Forgot-password page; without it the link calls onForgotPassword */
forgotHref?: string;
/** Called with the email typed so far */
onForgotPassword?: (email: string) => void;
/** Form-level message from the host, e.g. no order found for that email */
error?: React.ReactNode;
/** The host is processing the submit: the button shows a spinner */
busy?: boolean;
disabled?: boolean;
state?: 'default' | 'hover' | 'active' | 'disabled' | 'error';
onSubmit?: (values: MemberLogin5Values) => void;
onModeChange?: (mode: MemberLogin5Mode) => void;
copy?: Partial<MemberLogin5Copy>;
className?: string;
};
const MODES: MemberLogin5Mode[] = ['sign-in', 'first-time'];
export function MemberLogin5(props: MemberLogin5Props) {
const {
headline = DEFAULT_HEADLINE,
lead = 'New here? Use your order email and set a password. That’s the whole step.',
milestones = DEFAULT_MILESTONES,
current = 1,
sceneImage,
sceneImageAlt = '',
sceneCaption,
rules = DEFAULT_RULES,
defaultMode = 'first-time',
defaultEmail = '',
forgotHref,
onForgotPassword,
error,
busy = false,
disabled = false,
state = 'default',
onSubmit,
onModeChange,
copy: overrides,
className,
} = props;
const copy: MemberLogin5Copy = { ...DEFAULT_COPY, ...overrides };
const uid = React.useId();
const ids = {
title: `${uid}-title`,
panel: `${uid}-panel`,
email: `${uid}-email`,
emailHint: `${uid}-email-hint`,
emailError: `${uid}-email-error`,
password: `${uid}-password`,
passwordError: `${uid}-password-error`,
strength: `${uid}-strength`,
rules: `${uid}-rules`,
pending: `${uid}-pending`,
};
const [mode, setMode] = React.useState<MemberLogin5Mode>(defaultMode);
const [email, setEmail] = React.useState(defaultEmail);
const [password, setPassword] = React.useState('');
const [reveal, setReveal] = React.useState(false);
const [touched, setTouched] = React.useState(false);
const [tried, setTried] = React.useState(false);
const emailRef = React.useRef<HTMLInputElement>(null);
const passwordRef = React.useRef<HTMLInputElement>(null);
const tabRefs = React.useRef<Array<HTMLButtonElement | null>>([]);
const locked = disabled || state === 'disabled';
const first = mode === 'first-time';
const forced = state === 'error';
const trimmed = email.trim();
const emailError = !trimmed ? copy.emailRequired : isEmail(trimmed) ? '' : copy.emailInvalid;
const passwordError = !first && !password ? copy.passwordRequired : '';
const shownEmailError = forced || tried || touched ? emailError : '';
const shownPasswordError = forced || tried ? passwordError : '';
const met = rules.map((rule) => rule.test(password));
const metCount = met.filter(Boolean).length;
const allMet = metCount === rules.length;
const blocked = first && !allMet;
const level = !password ? 0 : Math.max(1, Math.min(4, Math.round((metCount / Math.max(1, rules.length)) * 4)));
const levelText = [copy.strengthEmpty, copy.strengthWeak, copy.strengthFair, copy.strengthGood, copy.strengthStrong][level];
const emailOk = !emailError;
const progress = first
? ((emailOk ? 1 : 0) + metCount) / (1 + rules.length)
: ((emailOk ? 1 : 0) + (password ? 1 : 0)) / 2;
const here = Math.max(0, Math.min(current, milestones.length - 1));
const changeMode = (next: MemberLogin5Mode) => {
if (next === mode || locked) return;
setMode(next);
setPassword('');
setReveal(false);
setTried(false);
onModeChange?.(next);
};
const onTabKey = (e: React.KeyboardEvent<HTMLButtonElement>, index: number) => {
let next = -1;
if (e.key === 'ArrowRight' || e.key === 'ArrowLeft' || e.key === 'ArrowDown' || e.key === 'ArrowUp') next = (index + 1) % MODES.length;
else if (e.key === 'Home') next = 0;
else if (e.key === 'End') next = MODES.length - 1;
if (next < 0) return;
e.preventDefault();
changeMode(MODES[next]);
tabRefs.current[next]?.focus();
};
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
if (locked || busy) return;
setTried(true);
if (emailError) {
emailRef.current?.focus();
return;
}
if ((!first && passwordError) || (first && !allMet)) {
passwordRef.current?.focus();
return;
}
onSubmit?.({ mode, email: trimmed, password });
};
const ctaClass = `cf-ml5__cta${state === 'hover' ? ' is-hover' : ''}${state === 'active' ? ' is-active' : ''}`;
const emailDescribedBy = [first && !shownEmailError ? ids.emailHint : '', shownEmailError ? ids.emailError : ''].filter(Boolean).join(' ') || undefined;
const passwordDescribedBy = first ? `${ids.strength} ${ids.rules}` : shownPasswordError ? ids.passwordError : undefined;
return (
<div
className={`cf-ml5${sceneImage ? ' has-kit' : ''}${className ? ` ${className}` : ''}`}
role='group'
aria-labelledby={ids.title}
>
<style>{CSS}</style>
<header className='cf-ml5__head'>
<h2 id={ids.title} className='cf-ml5__headline'>{headline}</h2>
{lead ? <p className='cf-ml5__lead'>{lead}</p> : null}
</header>
<ol className='cf-ml5__route' aria-label={copy.routeLabel}>
{milestones.map((stop, i) => {
const status = i < here ? 'done' : i === here ? 'current' : 'todo';
const fill = i < here ? 1 : i === here ? progress : 0;
const ready = i === here + 1 && progress >= 1;
return (
<li
key={i}
className={`cf-ml5__stop is-${status}${ready ? ' is-ready' : ''}`}
aria-current={status === 'current' ? 'step' : undefined}
style={{ '--p': fill } as React.CSSProperties}
>
<span className='cf-ml5__node' aria-hidden='true'>
{status === 'done' ? (
<Check size={20} strokeWidth={3} />
) : status === 'current' ? (
<KeyRound size={18} strokeWidth={2.5} />
) : (
<span className='cf-ml5__pip' />
)}
</span>
{i < milestones.length - 1 ? (
<span className='cf-ml5__seg' aria-hidden='true'>
<span className='cf-ml5__segfill' />
</span>
) : null}
<span className='cf-ml5__stoptext'>
<span className='cf-ml5__stoplabel'>
{stop.label}
{status === 'done' && copy.stopDone ? <span className='cf-ml5__sr'>, {copy.stopDone}</span> : null}
</span>
{status === 'current' && copy.youAreHere ? <span className='cf-ml5__here'>{copy.youAreHere}</span> : null}
{stop.detail ? <span className='cf-ml5__stopdetail'>{stop.detail}</span> : null}
</span>
</li>
);
})}
</ol>
<div className='cf-ml5__card'>
<div className='cf-ml5__tabs' role='tablist' aria-label={copy.tabsLabel}>
{MODES.map((m, i) => {
const selected = m === mode;
const Icon = m === 'first-time' ? Sparkles : KeyRound;
return (
<button
key={m}
ref={(el) => {
tabRefs.current[i] = el;
}}
type='button'
role='tab'
id={`${uid}-tab-${m}`}
aria-selected={selected}
aria-controls={ids.panel}
tabIndex={selected ? 0 : -1}
disabled={locked}
className={`cf-ml5__tab${selected ? ' is-selected' : ''}`}
onClick={() => changeMode(m)}
onKeyDown={(e) => onTabKey(e, i)}
>
<Icon className='cf-ml5__tabicon' size={18} strokeWidth={2.5} aria-hidden='true' />
<span>{m === 'first-time' ? copy.tabFirstTime : copy.tabSignIn}</span>
</button>
);
})}
</div>
<div key={mode} className='cf-ml5__panel' role='tabpanel' id={ids.panel} aria-labelledby={`${uid}-tab-${mode}`}>
<h3 className='cf-ml5__title'>{first ? copy.firstTitle : copy.signInTitle}</h3>
<p className='cf-ml5__sub'>{first ? copy.firstLead : copy.signInLead}</p>
{error ? (
<div className='cf-ml5__alert' role='alert'>
<AlertCircle className='cf-ml5__inlineicon' size={16} strokeWidth={2.5} aria-hidden='true' />
{error}
</div>
) : null}
<form noValidate onSubmit={handleSubmit}>
<fieldset className='cf-ml5__fieldset' disabled={locked}>
<div className='cf-ml5__field'>
<label htmlFor={ids.email} className='cf-ml5__label'>
{first ? copy.orderEmailLabel : copy.emailLabel}
</label>
<input
ref={emailRef}
id={ids.email}
name='email'
type='email'
inputMode='email'
autoComplete='email'
placeholder={copy.emailPlaceholder}
value={email}
onChange={(e) => setEmail(e.target.value)}
onBlur={() => {
if (email.trim()) setTouched(true);
}}
aria-invalid={shownEmailError ? true : undefined}
aria-describedby={emailDescribedBy}
className={`cf-ml5__input${shownEmailError ? ' is-invalid' : ''}`}
/>
{first && !shownEmailError && copy.orderEmailHint ? (
<p id={ids.emailHint} className='cf-ml5__hint'>{copy.orderEmailHint}</p>
) : null}
<FieldError id={ids.emailError} message={shownEmailError} />
</div>
<div className='cf-ml5__field'>
<div className='cf-ml5__labelrow'>
<label htmlFor={ids.password} className='cf-ml5__label'>
{first ? copy.newPasswordLabel : copy.passwordLabel}
</label>
{!first ? (
forgotHref ? (
<a className='cf-ml5__link cf-ml5__link--small' href={forgotHref}>{copy.forgot}</a>
) : (
<button type='button' className='cf-ml5__link cf-ml5__link--small' onClick={() => onForgotPassword?.(trimmed)}>
{copy.forgot}
</button>
)
) : null}
</div>
<div className='cf-ml5__control'>
<input
ref={passwordRef}
id={ids.password}
name='password'
type={reveal ? 'text' : 'password'}
autoComplete={first ? 'new-password' : 'current-password'}
placeholder={first ? copy.newPasswordPlaceholder : copy.passwordPlaceholder}
value={password}
onChange={(e) => setPassword(e.target.value)}
aria-invalid={shownPasswordError ? true : undefined}
aria-describedby={passwordDescribedBy}
className={`cf-ml5__input cf-ml5__input--reveal${shownPasswordError ? ' is-invalid' : ''}`}
/>
<button
type='button'
className='cf-ml5__reveal'
aria-label={reveal ? copy.hidePassword : copy.showPassword}
aria-pressed={reveal}
aria-controls={ids.password}
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>
{!first ? <FieldError id={ids.passwordError} message={shownPasswordError} /> : null}
{first ? (
<>
<div className='cf-ml5__meter' data-level={level}>
<div className='cf-ml5__bars' aria-hidden='true'>
{[1, 2, 3, 4].map((n) => (
<span key={n} className={`cf-ml5__bar${n <= level ? ' is-on' : ''}`} />
))}
</div>
<p className='cf-ml5__strength' id={ids.strength} aria-live='polite'>
<span>{copy.strengthLabel}</span>
<strong>{levelText}</strong>
</p>
</div>
<div className='cf-ml5__rules' id={ids.rules}>
<p className='cf-ml5__rulestitle'>{copy.rulesTitle}</p>
<ul>
{rules.map((rule, i) => (
<li key={i} className={`cf-ml5__rule${met[i] ? ' is-met' : ''}`}>
<span className='cf-ml5__badge' aria-hidden='true'>
{met[i] ? <Check size={14} strokeWidth={3} /> : null}
</span>
<span>
{rule.label}
<span className='cf-ml5__sr'>, {met[i] ? copy.ruleMet : copy.ruleUnmet}</span>
</span>
</li>
))}
</ul>
</div>
</>
) : null}
</div>
<button
type='submit'
className={ctaClass}
disabled={locked || blocked}
aria-busy={busy || undefined}
aria-describedby={blocked && copy.rulesPending ? ids.pending : undefined}
>
{busy ? (
<span className='cf-ml5__ctamain'>
<Loader2 className='cf-ml5__spin' size={20} strokeWidth={2.5} aria-hidden='true' />
{copy.busyAction}
</span>
) : (
<>
<span className='cf-ml5__ctamain'>{first ? copy.firstAction : copy.signInAction}</span>
{(first ? copy.firstActionSub : copy.signInActionSub) ? (
<span className='cf-ml5__ctasub'>{first ? copy.firstActionSub : copy.signInActionSub}</span>
) : null}
</>
)}
</button>
{blocked && !locked && copy.rulesPending ? (
<p id={ids.pending} className='cf-ml5__pending'>
<Lock className='cf-ml5__inlineicon' size={16} strokeWidth={2.5} aria-hidden='true' />
{copy.rulesPending}
</p>
) : null}
</fieldset>
</form>
<p className='cf-ml5__switch'>
{first ? copy.toSignInPrompt : copy.toFirstPrompt}{' '}
<button type='button' className='cf-ml5__link' disabled={locked} onClick={() => changeMode(first ? 'sign-in' : 'first-time')}>
{first ? copy.toSignInLink : copy.toFirstLink}
</button>
</p>
</div>
</div>
{sceneImage ? (
<figure className='cf-ml5__kit'>
<div className='cf-ml5__kitframe'>
<img src={sceneImage} alt={sceneImageAlt} width={800} height={1000} loading='lazy' decoding='async' />
</div>
{sceneCaption ? <figcaption>{sceneCaption}</figcaption> : null}
</figure>
) : null}
</div>
);
}
export default MemberLogin5;
function FieldError({ id, message }: { id: string; message: string }) {
if (!message) return null;
return (
<p id={id} className='cf-ml5__error'>
<AlertCircle className='cf-ml5__inlineicon' size={16} strokeWidth={2.5} aria-hidden='true' />
{message}
</p>
);
}
function isEmail(value: string) {
return /^[^@ ]+@[^@ ]+[.][^@ .]{2,}$/.test(value);
}
const DEFAULT_HEADLINE = (
<>
Your order is in. <span className='cf-ml5__em'>Your first lesson is one step away.</span>
</>
);
const DEFAULT_MILESTONES: MemberLogin5Milestone[] = [
{ label: 'Order placed', detail: 'You’re confirmed.' },
{ label: 'Open your account', detail: 'Set a password. One step.' },
{ label: 'Start lesson one', detail: 'Your course opens inside.' },
{ label: 'Your first result', detail: 'Made with what you ordered.' },
];
const DEFAULT_RULES: MemberLogin5Rule[] = [
{ label: 'At least 8 characters', test: (p) => p.length >= 8 },
{ label: 'One capital letter', test: (p) => /[A-Z]/.test(p) },
{ label: 'One number', test: (p) => /[0-9]/.test(p) },
{ label: 'One symbol, like ! or #', test: (p) => /[^A-Za-z0-9]/.test(p) },
];
const DEFAULT_COPY: MemberLogin5Copy = {
tabsLabel: 'How are you getting in?',
tabSignIn: 'I have an account',
tabFirstTime: 'First time here',
firstTitle: 'Set your password and step inside',
firstLead: 'Use the email from your order. No account number needed.',
signInTitle: 'Welcome back',
signInLead: 'Pick up right where you left off.',
orderEmailLabel: 'Email from your order',
orderEmailHint: 'It’s the address on your receipt.',
emailLabel: 'Email',
emailPlaceholder: 'you@example.com',
newPasswordLabel: 'Create a password',
newPasswordPlaceholder: 'At least 8 characters',
passwordLabel: 'Password',
passwordPlaceholder: 'Your password',
showPassword: 'Show password',
hidePassword: 'Hide password',
forgot: 'Forgot password?',
strengthLabel: 'Strength',
strengthEmpty: 'Start typing',
strengthWeak: 'Weak',
strengthFair: 'Fair',
strengthGood: 'Good',
strengthStrong: 'Strong',
rulesTitle: 'Tick these off and you’re in',
ruleMet: 'done',
ruleUnmet: 'not yet',
firstAction: 'Create my password',
firstActionSub: 'Takes you straight inside',
signInAction: 'Sign me in',
signInActionSub: 'Back to where you left off',
busyAction: 'One moment…',
rulesPending: 'Tick every rule above to unlock the button.',
toFirstPrompt: 'First time here?',
toFirstLink: 'Set your password',
toSignInPrompt: 'Already set one?',
toSignInLink: 'Sign in',
routeLabel: 'Your route inside',
youAreHere: 'You’re here',
stopDone: 'done',
emailRequired: 'Enter your email address.',
emailInvalid: 'That email looks incomplete. Check for a typo.',
passwordRequired: 'Enter your password.',
};
const CSS = `
.cf-ml5{--ml5-gap:clamp(32px,5vw,48px);width:100%;max-width:1120px;margin-inline:auto;display:grid;grid-template-columns:minmax(0,1fr);grid-template-areas:'head' 'route' 'card';row-gap:28px;align-items:start;color:var(--ink);font-family:var(--font-body);font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;box-sizing:border-box}
.cf-ml5 *,.cf-ml5 *::before,.cf-ml5 *::after{box-sizing:border-box}
.cf-ml5__sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.cf-ml5__head{grid-area:head;max-width:52rem}
.cf-ml5__headline{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;text-wrap:balance;color:var(--ink)}
.cf-ml5__em{color:var(--accent)}
.cf-ml5__lead{margin:16px 0 0;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--muted);max-width:60ch;text-wrap:pretty}
.cf-ml5__route{grid-area:route;list-style:none;margin:0;padding:0;display:flex;align-items:flex-start}
.cf-ml5__stop{position:relative;flex:1 1 0;min-width:0;display:grid;justify-items:center;row-gap:8px;text-align:center}
.cf-ml5__node{position:relative;z-index:1;width:40px;height:40px;border-radius:999px;display:grid;place-items:center;background:var(--card);border:2px solid color-mix(in oklch,var(--ink) 20%,var(--surface));color:var(--muted);transition:background .16s ease,border-color .16s ease}
.cf-ml5__pip{width:8px;height:8px;border-radius:999px;background:color-mix(in oklch,var(--ink) 32%,var(--card));transition:background .16s ease}
.cf-ml5__stop.is-done .cf-ml5__node{background:var(--success);border-color:var(--success);color:var(--success-ink,#fff)}
.cf-ml5__stop.is-current .cf-ml5__node{background:var(--accent-fill,var(--accent));border-color:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card));outline:2px solid var(--accent-fill,var(--accent));outline-offset:3px}
.cf-ml5__stop.is-ready .cf-ml5__node{border-color:var(--accent-fill,var(--accent));animation:cf-ml5-pop .3s ease both}
.cf-ml5__stop.is-ready .cf-ml5__pip{background:var(--accent-fill,var(--accent))}
.cf-ml5__seg{position:absolute;z-index:0;top:18.5px;left:calc(50% + 28px);right:calc(-50% + 28px);height:3px;border-radius:999px;background:color-mix(in oklch,var(--ink) 12%,var(--surface));overflow:hidden}
.cf-ml5__segfill{position:absolute;inset:0;border-radius:inherit;background:var(--accent-fill,var(--accent));transform:scaleX(var(--p,0));transform-origin:left center;transition:transform .45s cubic-bezier(.2,.7,.2,1)}
.cf-ml5__stop.is-done .cf-ml5__segfill{background:var(--success)}
.cf-ml5__stoptext{display:grid;gap:4px;min-width:0}
.cf-ml5__stoplabel{font-family:var(--font-display);font-weight:800;font-size:.875rem;line-height:1.2;color:var(--ink);text-wrap:balance;overflow-wrap:break-word}
.cf-ml5__here{font-size:.875rem;font-weight:800;line-height:1.2;color:var(--accent)}
.cf-ml5__stopdetail{display:none;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
.cf-ml5__card{grid-area:card;min-width:0;background:var(--card);color:var(--ink);border:1px solid var(--card-border,oklch(from var(--ink) l c h / .12));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .22),0 12px 24px -8px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .32)));padding:clamp(20px,3vw,32px)}
.cf-ml5__tabs{display:flex;gap:4px;padding:4px;margin:0 0 28px;border-radius:calc(var(--radius,12px) + 2px);background:color-mix(in oklch,var(--ink) 6%,var(--card));box-shadow:inset 0 0 0 1px oklch(from var(--ink) l c h / .06)}
.cf-ml5__tab{flex:1 1 0;min-width:0;min-height:48px;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:6px 12px;border:0;border-radius:calc(var(--radius,12px) - 2px);background:transparent;font-family:var(--font-body);font-size:.9375rem;font-weight:700;line-height:1.2;text-align:center;text-wrap:balance;color:color-mix(in oklch,var(--ink) 78%,var(--card));cursor:pointer;transition:background .16s ease,color .16s ease,box-shadow .16s ease}
.cf-ml5__tab:hover:not(:disabled){color:var(--ink)}
.cf-ml5__tab:hover:not(:disabled):not(.is-selected){background:color-mix(in oklch,var(--ink) 10%,var(--card))}
.cf-ml5__tab.is-selected{background:color-mix(in oklch,var(--accent) 10%,var(--card));color:var(--ink);font-weight:800;box-shadow:inset 0 0 0 1px oklch(from var(--accent) l c h / .45),var(--shadow-sm,0 1px 3px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .2))}
.cf-ml5__tab.is-selected .cf-ml5__tabicon{color:var(--accent)}
.cf-ml5__tab:focus-visible{outline:2px solid var(--field-focus,var(--accent));outline-offset:2px}
.cf-ml5__tab:disabled{cursor:not-allowed}
.cf-ml5__tabicon{flex:none}
.cf-ml5__panel{animation:cf-ml5-rise .45s cubic-bezier(.2,.7,.2,1) both}
.cf-ml5__title{margin:0 0 8px;font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;text-wrap:balance;color:var(--ink)}
.cf-ml5__sub{margin:0 0 24px;color:var(--muted);text-wrap:pretty}
.cf-ml5__alert{margin:0 0 20px;padding:12px 14px;border-radius:10px;background:var(--danger-soft);color:var(--danger);font-size:.9375rem;font-weight:600;line-height:1.4;text-wrap:pretty}
.cf-ml5__inlineicon{display:inline-block;vertical-align:-0.15em;margin-inline-end:.4em}
.cf-ml5__fieldset{margin:0;padding:0;border:0;min-width:0}
.cf-ml5__field{display:grid;gap:8px;margin:0 0 20px}
.cf-ml5__labelrow{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 12px}
.cf-ml5__label{font-size:1rem;font-weight:700;line-height:1.3;color:var(--label-ink,var(--ink))}
.cf-ml5__control{position:relative}
.cf-ml5__input{display:block;width:100%;height:56px;padding:0 16px;font-family:var(--font-body);font-size:1.0625rem;background:var(--field);color:var(--field-ink);border:1px solid var(--field-border,color-mix(in oklch,var(--ink) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));transition:border-color .16s ease,box-shadow .16s ease}
.cf-ml5__input--reveal{padding-right:58px}
.cf-ml5__input::placeholder{color:color-mix(in oklch,var(--field-ink) 65%,var(--field));opacity:1}
.cf-ml5__input:hover:not(:disabled){border-color:color-mix(in oklch,var(--ink) 38%,transparent)}
.cf-ml5__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 / .35)}
.cf-ml5__input.is-invalid{border-color:var(--danger)}
.cf-ml5__input.is-invalid:focus{box-shadow:0 0 0 3px oklch(from var(--danger) l c h / .3)}
.cf-ml5__input:disabled{cursor:not-allowed;background:color-mix(in oklch,var(--field-ink) 5%,var(--field))}
.cf-ml5__reveal{position:absolute;top:6px;right:6px;width:44px;height:44px;display:grid;place-items:center;padding:0;border:0;border-radius:8px;background:transparent;color:color-mix(in oklch,var(--field-ink) 72%,var(--field));cursor:pointer;transition:background .16s ease,color .16s ease}
.cf-ml5__reveal:hover:not(:disabled){background:color-mix(in oklch,var(--field-ink) 6%,var(--field));color:var(--field-ink)}
.cf-ml5__reveal:focus-visible{outline:2px solid var(--field-focus,var(--accent));outline-offset:-2px}
.cf-ml5__reveal:disabled{cursor:not-allowed}
.cf-ml5__hint{margin:0;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--muted)}
.cf-ml5__error{margin:0;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--danger);text-wrap:pretty}
.cf-ml5__meter{display:grid;gap:8px;margin-top:4px}
.cf-ml5__meter[data-level='1']{--ml5-level:var(--danger)}
.cf-ml5__meter[data-level='2']{--ml5-level:var(--warning)}
.cf-ml5__meter[data-level='3'],.cf-ml5__meter[data-level='4']{--ml5-level:var(--success)}
.cf-ml5__bars{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.cf-ml5__bar{height:6px;border-radius:999px;background:color-mix(in oklch,var(--ink) 10%,var(--card));transition:background .2s ease}
.cf-ml5__bar.is-on{background:var(--ml5-level,var(--muted))}
.cf-ml5__strength{margin:0;display:flex;justify-content:space-between;gap:12px;font-size:.9375rem;font-weight:600;line-height:1.3;color:var(--muted)}
.cf-ml5__strength strong{font-weight:800;color:var(--ml5-level,var(--muted))}
.cf-ml5__rules{margin-top:12px;padding:14px 16px;border-radius:10px;background:color-mix(in oklch,var(--ink) 4%,var(--card))}
.cf-ml5__rulestitle{margin:0 0 12px;font-size:.875rem;font-weight:800;line-height:1.2;color:var(--ink)}
.cf-ml5__rules ul{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.cf-ml5__rule{display:flex;align-items:flex-start;gap:10px;font-size:.9375rem;font-weight:600;line-height:1.4;color:color-mix(in oklch,var(--ink) 80%,var(--card));transition:color .16s ease}
.cf-ml5__rule.is-met{color:var(--ink)}
.cf-ml5__badge{flex:none;width:22px;height:22px;margin-top:-1px;border-radius:999px;display:grid;place-items:center;background:var(--card);border:2px solid color-mix(in oklch,var(--ink) 30%,var(--card));color:var(--success-ink,#fff);transition:background .16s ease,border-color .16s ease}
.cf-ml5__rule.is-met .cf-ml5__badge{background:var(--success);border-color:var(--success);animation:cf-ml5-pop .3s ease both}
.cf-ml5__cta{width:100%;min-height:64px;margin-top:8px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:10px 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l + .04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .02) c h));color:var(--button-ink,var(--cta-ink));font-family:var(--button-font,var(--font-display));text-transform:var(--button-case,none);text-shadow:var(--button-text-shadow,none);text-align:center;cursor:pointer;box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h),0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .3),0 8px 16px -6px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .45));transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-ml5__ctamain{display:inline-flex;align-items:center;justify-content:center;gap:8px;font-size:clamp(1.125rem,1.55vw,1.375rem);font-weight:var(--button-weight,800);line-height:1.15;text-wrap:balance}
.cf-ml5__ctasub{font-family:var(--font-body);font-size:.9375rem;font-weight:500;line-height:1.3;text-transform:none;text-wrap:pretty}
.cf-ml5__cta:not(:disabled):hover,.cf-ml5__cta.is-hover:not(:disabled){background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - .01) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .07) c h));transform:translateY(-1px);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h),0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .32),0 10px 18px -6px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .52))}
.cf-ml5__cta:not(:disabled):active,.cf-ml5__cta.is-active:not(:disabled){transform:translateY(1px);background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - .05) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .08) c h));box-shadow:inset 0 2px 4px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .35),inset 0 -2px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h)}
.cf-ml5__cta:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:3px}
.cf-ml5__cta:disabled{cursor:not-allowed;background:color-mix(in oklch,var(--ink) 8%,var(--card));color:color-mix(in oklch,var(--ink) 72%,var(--card));text-shadow:none;transform:none;box-shadow:inset 0 0 0 1px oklch(from var(--ink) l c h / .16)}
.cf-ml5__cta[aria-busy='true']{cursor:progress}
.cf-ml5__spin{animation:cf-ml5-spin .8s linear infinite}
.cf-ml5__pending{margin:12px 0 0;text-align:center;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--muted);text-wrap:pretty}
.cf-ml5__switch{margin:20px 0 0;text-align:center;font-size:.9375rem;line-height:1.4;color:var(--muted);text-wrap:pretty}
.cf-ml5__link{padding:0;border:0;background:none;font:inherit;font-weight:700;color:var(--link,var(--accent));text-decoration:underline;text-decoration-color:oklch(from var(--link,var(--accent)) l c h / .45);text-underline-offset:.18em;cursor:pointer;border-radius:4px}
.cf-ml5__link--small{font-size:.9375rem}
.cf-ml5__link:hover:not(:disabled){color:oklch(from var(--link,var(--accent)) calc(l - .08) c h);text-decoration-color:currentColor}
.cf-ml5__link:focus-visible{outline:2px solid var(--field-focus,var(--accent));outline-offset:2px}
.cf-ml5__link:disabled{cursor:not-allowed}
.cf-ml5__kit{grid-area:kit;display:none;margin:0;position:sticky;top:24px;min-width:0}
.cf-ml5__kitframe{position:relative;isolation:isolate}
.cf-ml5__kitframe::before{content:'';position:absolute;z-index:-1;inset:24px 24px -16px -16px;border-radius:14px;background:color-mix(in oklch,var(--ink) 5%,var(--surface))}
.cf-ml5__kitframe img{display:block;width:100%;height:auto;aspect-ratio:4/5;object-fit:cover;object-position:center;border-radius:12px}
.cf-ml5__kit figcaption{margin-top:28px;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--muted);text-wrap:pretty}
@media (max-width:719.98px){
.cf-ml5__here{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
}
@media (max-width:479.98px){
.cf-ml5__tabicon{display:none}
.cf-ml5__tab{padding:6px 8px}
}
@media (min-width:720px){
.cf-ml5{grid-template-columns:200px minmax(0,560px);grid-template-areas:'head head' 'route card';column-gap:var(--ml5-gap);row-gap:40px}
.cf-ml5__route{flex-direction:column;padding-top:8px}
.cf-ml5__stop{flex:none;width:100%;grid-template-columns:40px minmax(0,1fr);column-gap:14px;justify-items:start;text-align:left;padding-bottom:40px}
.cf-ml5__stop:last-child{padding-bottom:0}
.cf-ml5__seg{top:48px;bottom:8px;left:18.5px;right:auto;width:3px;height:auto}
.cf-ml5__segfill{transform:scaleY(var(--p,0));transform-origin:center top}
.cf-ml5__stoptext{padding-top:9px}
.cf-ml5__stoplabel{font-size:1.0625rem}
.cf-ml5__stopdetail{display:block}
.cf-ml5__tab{font-size:1rem}
}
@media (min-width:1024px){
.cf-ml5.has-kit{grid-template-columns:200px minmax(0,480px) minmax(0,1fr);grid-template-areas:'head head head' 'route card kit'}
.cf-ml5.has-kit .cf-ml5__kit{display:block}
}
@keyframes cf-ml5-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes cf-ml5-pop{from{transform:scale(.9)}to{transform:scale(1)}}
@keyframes cf-ml5-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){
.cf-ml5 *,.cf-ml5 *::before,.cf-ml5 *::after{animation:none !important;transition:none !important}
.cf-ml5__cta:not(:disabled):hover,.cf-ml5__cta.is-hover:not(:disabled),.cf-ml5__cta:not(:disabled):active,.cf-ml5__cta.is-active:not(:disabled){transform:none}
}
`;
pieces/forms/member-login-5/specimen.tsx 52 lines
import __studioImage11119141 from "../assets/7665f956cec80390.webp";
import { MemberLogin5 } from '../member-login-5';
import type { MemberLogin5Props } from '../member-login-5';
import { slot } from '../../slots';
export const states = ['default', 'hover', 'active', 'disabled', 'error'];
type SpecimenState = NonNullable<MemberLogin5Props['state']>;
export default function MemberLogin5Specimen({ state = 'default' }: { state?: SpecimenState }) {
const returning = state === 'hover' || state === 'active';
return (
<MemberLogin5
key={state}
state={state}
defaultMode={returning ? 'sign-in' : 'first-time'}
defaultEmail={returning ? 'jordan.reyes@example.com' : state === 'error' ? 'jordan.reyes@example' : ''}
headline={
<>
Your clay kit is on its way. <span className='cf-ml5__em'>Lesson one doesn’t have to wait.</span>
</>
}
lead='No account to hunt for. Use your order email, set a password, and the studio opens.'
milestones={[
{ label: 'Order placed', detail: 'Course and clay kit confirmed.' },
{ label: 'Open your studio', detail: 'Set a password. One step.' },
{ label: 'Lesson 1: centering', detail: 'Clay on the wheel, steady and true.' },
{ label: 'Your first bowl', detail: 'Thrown and trimmed by your hands.' },
]}
current={1}
sceneImage={slot(
'scene',
__studioImage11119141
)}
sceneImageAlt='Kiln & Co. pottery kit laid out from above: clay, wooden rib, trimming tools, sponge and two glaze jars'
sceneCaption='Your kit, laid out for lesson one: clay, tools, sponge and two starter glazes.'
error={state === 'error' ? 'We couldn’t find an order for that email. Try the address on your Kiln & Co. receipt.' : undefined}
forgotHref='#reset-password'
copy={{
firstTitle: 'Set a password, then start lesson one',
firstLead: 'Use the email from your Kiln & Co. order. No account number needed.',
signInTitle: 'Welcome back to the studio',
signInLead: 'Your lessons are right where you left them.',
firstAction: 'Create my password',
firstActionSub: 'Opens lesson one right after',
signInAction: 'Open my studio',
signInActionSub: 'Back to your last lesson',
routeLabel: 'Your route to your first bowl',
}}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalMemberLogin5 |
React.ReactNode |
|
lead OptionalMemberLogin5 |
React.ReactNode |
|
milestones OptionalMemberLogin5 |
MemberLogin5Milestone[] |
|
current OptionalMemberLogin5 |
number |
|
sceneImage OptionalMemberLogin5 |
string |
|
sceneImageAlt OptionalMemberLogin5 |
string |
|
sceneCaption OptionalMemberLogin5 |
React.ReactNode |
|
rules OptionalMemberLogin5 |
MemberLogin5Rule[] |
|
defaultMode OptionalMemberLogin5 |
MemberLogin5Mode |
|
defaultEmail OptionalMemberLogin5 |
string |
|
forgotHref OptionalMemberLogin5 |
string |
|
onForgotPassword OptionalMemberLogin5 |
(email: string) => void |
|
error OptionalMemberLogin5 |
React.ReactNode |
|
busy OptionalMemberLogin5 |
boolean |
|
disabled OptionalMemberLogin5 |
boolean |
|
state OptionalMemberLogin5 |
'default' | 'hover' | 'active' | 'disabled' | 'error' |
|
onSubmit OptionalMemberLogin5 |
(values: MemberLogin5Values) => void |
|
onModeChange OptionalMemberLogin5 |
(mode: MemberLogin5Mode) => void |
|
copy OptionalMemberLogin5 |
Partial<MemberLogin5Copy> |
|
className OptionalMemberLogin5 |
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.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
scene- A wide atmosphere photo behind or beside the copy.
-
7665f956cec80390.webp
image/webp · 74.3 KB