Member Login 3
Member login, the welcome-back photo card: a calm practice room fills the frame, numbered notes future-pace the member back onto the mat, and one raised card breaks the photo's edge to sign them in or create their account.
Use it in a prompt
Use forms/member-login-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/forms/member-login-3.tsx. - Import it and pass your copy and images (Props tab):
import { MemberLogin3 } from "@/components/funneldna/forms/member-login-3"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/member-login-3/component.tsx 675 lines
// layout: annotated-board
// Member login, the welcome-back photo card: a calm practice room fills the frame, numbered notes future-pace the member back onto the mat, and one raised card breaks the photo's edge to sign them in or create their account.
import * as React from 'react';
import { AlertCircle, Eye, EyeOff, Loader2, Play } from 'lucide-react';
import spa from '../fx/backdrops/spa';
export type MemberLogin3Mode = 'signin' | 'create';
/** What onSubmit receives: the mode plus only the fields that mode asks for */
export type MemberLogin3Values = {
mode: MemberLogin3Mode;
email: string;
password: string;
/** Only when mode is 'create' */
name?: string;
};
export type MemberLogin3Module = {
/** The module or lesson the member last opened */
name: React.ReactNode;
/** Where they are in it, e.g. 'Module 4 · Lesson 3 of 6' */
detail?: React.ReactNode;
/** 0 to 1; draws a progress bar when supplied */
progress?: number;
};
export type MemberLogin3Copy = {
/** Accessible name of the Sign in / Create account switch */
modeLabel: string;
signInTab: string;
createTab: string;
signInTitle: string;
signInLead: string;
createTitle: string;
createLead: string;
nameLabel: string;
namePlaceholder: string;
emailLabel: string;
emailPlaceholder: string;
passwordLabel: string;
passwordPlaceholder: string;
/** '{min}' is replaced with minPasswordLength */
newPasswordPlaceholder: string;
confirmLabel: string;
confirmPlaceholder: string;
showPassword: string;
hidePassword: string;
forgot: string;
signInAction: string;
createAction: string;
signInBusy: string;
createBusy: string;
/** Under the disabled button while sign-in fields are incomplete */
signInHint: string;
/** Under the disabled button while create fields are incomplete */
createHint: string;
/** Under the enabled button; hidden when empty */
readyNote: string;
resumeLabel: string;
/** '{percent}' is replaced with the progress percentage */
progressLabel: string;
nameRequired: string;
emailRequired: string;
emailInvalid: string;
passwordRequired: string;
/** '{min}' is replaced with minPasswordLength */
passwordShort: string;
confirmRequired: string;
passwordMismatch: string;
};
export type MemberLogin3Props = {
/** Text wordmark over the photo when no logo image is supplied (wide layouts only) */
brandName?: React.ReactNode;
/** logo slot: the academy's wordmark on a transparent background */
logoImage?: string;
logoAlt?: string;
/** Future-pacing headline over the photo */
headline?: React.ReactNode;
lead?: React.ReactNode;
/** Line above the numbered notes; hidden when empty */
reasonsTitle?: React.ReactNode;
/** Numbered notes laid along the photo's edge; keep each one short */
reasons?: React.ReactNode[];
/** scene slot: the practice room photo */
sceneImage?: string;
sceneAlt?: string;
/** The member's last module; the 'Pick up where you left off' line shows only when supplied */
lastModule?: MemberLogin3Module;
defaultMode?: MemberLogin3Mode;
/** Prefill, e.g. a remembered email */
defaultValues?: Partial<Record<'name' | 'email' | 'password' | 'confirm', string>>;
/** Minimum password length when creating an account */
minPasswordLength?: number;
/** 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. a rejected password */
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: MemberLogin3Values) => void;
onModeChange?: (mode: MemberLogin3Mode) => void;
copy?: Partial<MemberLogin3Copy>;
className?: string;
};
export function MemberLogin3(props: MemberLogin3Props) {
const {
brandName,
logoImage,
logoAlt = '',
headline = 'Your mat is right where you left it',
lead = 'Sign in, press play, and you’re one class away from feeling like yourself again.',
reasonsTitle = 'Three reasons to roll out your mat today',
reasons = DEFAULT_REASONS,
sceneImage = spa,
sceneAlt = '',
lastModule,
defaultMode = 'signin',
defaultValues,
minPasswordLength = 8,
forgotHref,
onForgotPassword,
error,
busy = false,
disabled = false,
state = 'default',
onSubmit,
onModeChange,
copy: copyOverrides,
className,
} = props;
const copy: MemberLogin3Copy = { ...DEFAULT_COPY, ...copyOverrides };
const uid = React.useId();
const [mode, setMode] = React.useState<MemberLogin3Mode>(defaultMode);
const [values, setValues] = React.useState<FieldValues>(() => ({
name: defaultValues?.name ?? '',
email: defaultValues?.email ?? '',
password: defaultValues?.password ?? '',
confirm: defaultValues?.confirm ?? '',
}));
const [touched, setTouched] = React.useState<Flags>(NO_FLAGS);
const [tried, setTried] = React.useState(false);
const [reveal, setReveal] = React.useState(false);
const locked = disabled || state === 'disabled';
const isCreate = mode === 'create';
const forced = state === 'error';
const min = String(minPasswordLength);
const errors = validate(values, mode, minPasswordLength, copy);
const invalid = FIELDS.some((f) => Boolean(errors[f]));
const confirmLive =
isCreate && values.password.length > 0 && values.confirm.length >= values.password.length;
const shown = (f: Field): string | undefined => {
const message = errors[f];
if (!message) return undefined;
if (forced || tried) return message;
if (f === 'confirm' && confirmLive && message === copy.passwordMismatch) return message;
return touched[f] && values[f].trim() ? message : undefined;
};
const ids = {
cardTitle: `${uid}-card-title`,
name: `${uid}-name`,
email: `${uid}-email`,
password: `${uid}-password`,
confirm: `${uid}-confirm`,
hint: `${uid}-hint`,
};
const errId = (f: Field) => `${uid}-${f}-error`;
const update = (f: Field) => (e: React.ChangeEvent<HTMLInputElement>) => {
const next = e.target.value;
setValues((prev) => ({ ...prev, [f]: next }));
};
const blur = (f: Field) => () => setTouched((prev) => (prev[f] ? prev : { ...prev, [f]: true }));
const changeMode = (next: MemberLogin3Mode) => {
if (locked || next === mode) return;
setMode(next);
setReveal(false);
setTried(false);
setTouched((prev) => ({ ...prev, name: false, password: false, confirm: false }));
onModeChange?.(next);
};
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
if (locked || busy) return;
if (invalid) {
setTouched(ALL_FLAGS);
setTried(true);
const first = FIELDS.find((f) => Boolean(errors[f]));
if (first) document.getElementById(ids[first])?.focus();
return;
}
onSubmit?.({
mode,
email: values.email.trim(),
password: values.password,
...(isCreate ? { name: values.name.trim() } : {}),
});
};
const forgot =
!isCreate && (forgotHref || onForgotPassword) ? (
forgotHref ? (
<a className='cf-ml3-link' href={forgotHref}>
{copy.forgot}
</a>
) : (
<button type='button' className='cf-ml3-link' onClick={() => onForgotPassword?.(values.email.trim())}>
{copy.forgot}
</button>
)
) : null;
const toggle = (
<button
type='button'
className='cf-ml3-eye'
aria-label={reveal ? copy.hidePassword : copy.showPassword}
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>
);
const percent =
lastModule && typeof lastModule.progress === 'number' && Number.isFinite(lastModule.progress)
? Math.round(Math.min(1, Math.max(0, lastModule.progress)) * 100)
: null;
const hint = invalid ? (isCreate ? copy.createHint : copy.signInHint) : copy.readyNote;
const buttonClass = [
'cf-ml3-btn',
state === 'hover' ? 'is-hover' : '',
state === 'active' ? 'is-active' : '',
]
.filter(Boolean)
.join(' ');
return (
<div className={['cf-ml3', className].filter(Boolean).join(' ')} data-mode={mode}>
<style>{CSS}</style>
<div className='cf-ml3-stage'>
<div className='cf-ml3-photo'>
<img src={sceneImage} alt={sceneAlt} width={1600} height={1000} decoding='async' />
</div>
<div className='cf-ml3-side'>
{logoImage || brandName ? (
<div className='cf-ml3-brand'>
{logoImage ? (
<img src={logoImage} alt={logoAlt || (typeof brandName === 'string' ? brandName : '')} />
) : (
<span>{brandName}</span>
)}
</div>
) : null}
<div className='cf-ml3-intro'>
{headline ? <h2 className='cf-ml3-h'>{headline}</h2> : null}
{lead ? <p className='cf-ml3-lead'>{lead}</p> : null}
</div>
{reasons.length > 0 ? (
<div className='cf-ml3-reasons'>
{reasonsTitle ? <p className='cf-ml3-reasons-title'>{reasonsTitle}</p> : null}
<ol className='cf-ml3-notes'>
{reasons.map((reason, i) => (
<li key={i} className='cf-ml3-note' style={{ '--i': i } as React.CSSProperties}>
<span className='cf-ml3-note-num' aria-hidden='true'>
{i + 1}
</span>
<span>{reason}</span>
</li>
))}
</ol>
</div>
) : null}
</div>
<div className='cf-ml3-card'>
<h3 id={ids.cardTitle} className='cf-ml3-card-h'>
{isCreate ? copy.createTitle : copy.signInTitle}
</h3>
<p className='cf-ml3-card-lead'>{isCreate ? copy.createLead : copy.signInLead}</p>
<form className='cf-ml3-form' noValidate onSubmit={handleSubmit} aria-labelledby={ids.cardTitle}>
<fieldset className='cf-ml3-fieldset' disabled={locked}>
<div className='cf-ml3-seg' role='radiogroup' aria-label={copy.modeLabel} data-mode={mode}>
<span className='cf-ml3-seg-thumb' aria-hidden='true' />
{MODES.map((m) => (
<label key={m} className='cf-ml3-seg-opt' data-selected={m === mode ? 'true' : 'false'}>
<input
className='cf-ml3-sr'
type='radio'
name={`${uid}-mode`}
value={m}
checked={m === mode}
onChange={() => changeMode(m)}
/>
<span>{m === 'create' ? copy.createTab : copy.signInTab}</span>
</label>
))}
</div>
<div className='cf-ml3-fields'>
<Reveal open={isCreate} pad='below'>
<TextField
id={ids.name}
label={copy.nameLabel}
value={values.name}
onChange={update('name')}
onBlur={blur('name')}
placeholder={copy.namePlaceholder}
autoComplete='name'
error={shown('name')}
errorId={errId('name')}
disabled={!isCreate}
/>
</Reveal>
<TextField
id={ids.email}
label={copy.emailLabel}
type='email'
inputMode='email'
value={values.email}
onChange={update('email')}
onBlur={blur('email')}
placeholder={copy.emailPlaceholder}
autoComplete='email'
error={shown('email')}
errorId={errId('email')}
/>
<TextField
id={ids.password}
label={copy.passwordLabel}
type={reveal ? 'text' : 'password'}
value={values.password}
onChange={update('password')}
onBlur={blur('password')}
placeholder={isCreate ? fill(copy.newPasswordPlaceholder, { min }) : copy.passwordPlaceholder}
autoComplete={isCreate ? 'new-password' : 'current-password'}
error={shown('password')}
errorId={errId('password')}
aside={forgot}
trailing={toggle}
/>
<Reveal open={isCreate} pad='above'>
<TextField
id={ids.confirm}
label={copy.confirmLabel}
type={reveal ? 'text' : 'password'}
value={values.confirm}
onChange={update('confirm')}
onBlur={blur('confirm')}
placeholder={copy.confirmPlaceholder}
autoComplete='new-password'
error={shown('confirm')}
errorId={errId('confirm')}
disabled={!isCreate}
/>
</Reveal>
</div>
{error ? (
<div className='cf-ml3-alert' role='alert'>
<AlertCircle className='cf-ml3-ico' size={16} strokeWidth={2.5} aria-hidden='true' />
{error}
</div>
) : null}
<button
type='submit'
className={buttonClass}
disabled={locked}
aria-busy={busy || undefined}
aria-describedby={hint ? ids.hint : undefined}
>
{busy ? (
<>
<Loader2 className='cf-ml3-spin' size={20} strokeWidth={2.5} aria-hidden='true' />
<span>{isCreate ? copy.createBusy : copy.signInBusy}</span>
</>
) : (
<span>{isCreate ? copy.createAction : copy.signInAction}</span>
)}
</button>
{hint ? (
<p id={ids.hint} className='cf-ml3-hint' aria-live='polite'>
{hint}
</p>
) : null}
</fieldset>
</form>
{lastModule ? (
<Reveal open={!isCreate} pad='above-lg'>
<div className='cf-ml3-well'>
<span className='cf-ml3-disc' aria-hidden='true'>
<Play size={20} strokeWidth={2.5} fill='currentColor' />
</span>
<div className='cf-ml3-resume'>
<p className='cf-ml3-resume-label'>{copy.resumeLabel}</p>
<p className='cf-ml3-resume-name'>{lastModule.name}</p>
{lastModule.detail ? <p className='cf-ml3-resume-detail'>{lastModule.detail}</p> : null}
{percent !== null ? (
<div
className='cf-ml3-bar'
role='progressbar'
aria-valuemin={0}
aria-valuemax={100}
aria-valuenow={percent}
aria-label={fill(copy.progressLabel, { percent: String(percent) })}
>
<span style={{ width: `${percent}%` }} />
</div>
) : null}
</div>
</div>
</Reveal>
) : null}
</div>
</div>
</div>
);
}
export default MemberLogin3;
type Field = 'name' | 'email' | 'password' | 'confirm';
type FieldValues = Record<Field, string>;
type Flags = Record<Field, boolean>;
const FIELDS: Field[] = ['name', 'email', 'password', 'confirm'];
const MODES = ['signin', 'create'] as const;
const NO_FLAGS: Flags = { name: false, email: false, password: false, confirm: false };
const ALL_FLAGS: Flags = { name: true, email: true, password: true, confirm: true };
const EMAIL_RE = /^[^ @]+@[^ @]+[.][^ @]{2,}$/;
const DEFAULT_REASONS: React.ReactNode[] = [
'Ten minutes still counts as practice.',
'Everything you saved is waiting inside.',
'Tomorrow feels easier after one class today.',
];
const DEFAULT_COPY: MemberLogin3Copy = {
modeLabel: 'Choose how to continue',
signInTab: 'Sign in',
createTab: 'Create account',
signInTitle: 'Welcome back',
signInLead: 'Sign in and press play on your next class.',
createTitle: 'Start your practice',
createLead: 'Make your account, then roll out your mat.',
nameLabel: 'Full name',
namePlaceholder: 'Jane Smith',
emailLabel: 'Email address',
emailPlaceholder: 'you@example.com',
passwordLabel: 'Password',
passwordPlaceholder: 'Your password',
newPasswordPlaceholder: 'At least {min} characters',
confirmLabel: 'Confirm password',
confirmPlaceholder: 'Type it once more',
showPassword: 'Show password',
hidePassword: 'Hide password',
forgot: 'Forgot password?',
signInAction: 'Sign in and press play',
createAction: 'Create my account',
signInBusy: 'Signing you in…',
createBusy: 'Creating your account…',
signInHint: 'Enter your email and password to sign in.',
createHint: 'Fill in all four fields to create your account.',
readyNote: 'You’re all set. Tap the button to continue.',
resumeLabel: 'Pick up where you left off',
progressLabel: '{percent}% complete',
nameRequired: 'Enter your name so we know what to call you.',
emailRequired: 'Enter your email address.',
emailInvalid: 'That email looks incomplete. It should read like you@example.com.',
passwordRequired: 'Enter your password.',
passwordShort: 'Use at least {min} characters.',
confirmRequired: 'Type your password again to confirm it.',
passwordMismatch: 'These passwords don’t match yet. Check both and try again.',
};
function validate(v: FieldValues, mode: MemberLogin3Mode, minLength: number, copy: MemberLogin3Copy) {
const out: Partial<Record<Field, string>> = {};
const email = v.email.trim();
if (!email) out.email = copy.emailRequired;
else if (!EMAIL_RE.test(email)) out.email = copy.emailInvalid;
if (!v.password) out.password = copy.passwordRequired;
else if (mode === 'create' && v.password.length < minLength)
out.password = fill(copy.passwordShort, { min: String(minLength) });
if (mode === 'create') {
if (!v.name.trim()) out.name = copy.nameRequired;
if (!v.confirm) out.confirm = copy.confirmRequired;
else if (v.confirm !== v.password) out.confirm = copy.passwordMismatch;
}
return out;
}
function fill(template: string, vars: Record<string, string>) {
return Object.keys(vars).reduce((text, key) => text.split('{' + key + '}').join(vars[key]), template);
}
function Reveal(p: { open: boolean; pad: 'above' | 'below' | 'above-lg'; children: React.ReactNode }) {
return (
<div className='cf-ml3-reveal' data-open={p.open ? 'true' : 'false'} aria-hidden={p.open ? undefined : true}>
<div className='cf-ml3-reveal-in'>
<div className={`cf-ml3-pad-${p.pad}`}>{p.children}</div>
</div>
</div>
);
}
function TextField(p: {
id: string;
label: React.ReactNode;
value: string;
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
onBlur: () => void;
placeholder: string;
autoComplete: string;
errorId: string;
error?: string;
type?: string;
inputMode?: React.HTMLAttributes<HTMLInputElement>['inputMode'];
disabled?: boolean;
aside?: React.ReactNode;
trailing?: React.ReactNode;
}) {
return (
<div className='cf-ml3-field'>
<div className='cf-ml3-label-row'>
<label htmlFor={p.id} className='cf-ml3-label'>
{p.label}
</label>
{p.aside}
</div>
<div className={p.trailing ? 'cf-ml3-control has-trailing' : 'cf-ml3-control'}>
<input
id={p.id}
className='cf-ml3-input'
type={p.type ?? 'text'}
inputMode={p.inputMode}
value={p.value}
onChange={p.onChange}
onBlur={p.onBlur}
placeholder={p.placeholder}
autoComplete={p.autoComplete}
autoCapitalize={p.type === 'email' ? 'none' : undefined}
spellCheck={false}
disabled={p.disabled}
aria-invalid={p.error ? true : undefined}
aria-describedby={p.error ? p.errorId : undefined}
/>
{p.trailing}
</div>
{p.error ? (
<p id={p.errorId} className='cf-ml3-err' aria-live='polite'>
<AlertCircle className='cf-ml3-ico' size={16} strokeWidth={2.5} aria-hidden='true' />
{p.error}
</p>
) : null}
</div>
);
}
const CSS = `
.cf-ml3{--ml3-overhang:64px;--ml3-ease:cubic-bezier(.2,.7,.2,1);--ml3-shadow:var(--shadow, oklch(0.22 0.03 260));width:100%;max-width:1120px;margin-inline:auto;font-family:var(--font-body);color:var(--ink);box-sizing:border-box}
.cf-ml3 *,.cf-ml3 *::before,.cf-ml3 *::after{box-sizing:border-box}
.cf-ml3-stage{position:relative;display:grid;grid-template-columns:minmax(0,1fr) minmax(360px,440px);column-gap:clamp(24px,4vw,56px)}
.cf-ml3-photo{position:absolute;inset:0 0 var(--ml3-overhang) 0;border-radius:12px;overflow:hidden;background:color-mix(in oklch, var(--ink) 8%, var(--surface))}
.cf-ml3-photo img{display:block;width:100%;height:100%;object-fit:cover;object-position:center}
.cf-ml3-photo::after{content:'';position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg, oklch(from var(--band) l c h / .92) 0%, oklch(from var(--band) l c h / .88) 50%, oklch(from var(--band) l c h / .5) 68%, oklch(from var(--band) l c h / 0) 86%)}
.cf-ml3-side{position:relative;z-index:1;grid-column:1;grid-row:1;display:flex;flex-direction:column;min-height:560px;padding:clamp(32px,4.5vw,56px) 0 0 clamp(24px,4vw,48px);color:var(--band-ink)}
.cf-ml3-brand{display:flex;align-items:center;gap:12px;margin-bottom:24px;font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:1.125rem;line-height:1.2;letter-spacing:-.01em}
.cf-ml3-brand img{display:block;height:32px;width:auto;object-fit:contain}
.cf-ml3-intro{max-width:30rem}
.cf-ml3-h{margin:0;font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-.025em);text-transform:var(--display-case,none);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06;text-wrap:balance}
.cf-ml3-lead{margin:16px 0 0;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;text-wrap:pretty}
.cf-ml3-reasons{margin-top:auto;padding-top:32px}
.cf-ml3-reasons-title{margin:0 0 12px;font-size:.9375rem;font-weight:700;line-height:1.4;text-wrap:pretty}
.cf-ml3-notes{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px;align-items:stretch}
.cf-ml3-note{display:flex;flex-direction:column;gap:8px;padding:16px 20px;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(--shadow-md, 0 1px 2px oklch(from var(--ml3-shadow) l c h / .22), 0 4px 10px -2px oklch(from var(--ml3-shadow) l c h / .2));font-size:1rem;font-weight:600;line-height:1.4;text-wrap:pretty;animation:cf-ml3-rise .45s var(--ml3-ease) both;animation-delay:min(calc(var(--i, 0) * .07s), .28s)}
.cf-ml3-note-num{font-family:var(--font-display);font-weight:800;font-size:1.625rem;line-height:1;letter-spacing:-.03em;font-variant-numeric:tabular-nums;color:var(--accent)}
.cf-ml3-card{position:relative;z-index:2;grid-column:2;grid-row:1;align-self:end;margin:40px clamp(16px,2.5vw,32px) 0 0;padding:clamp(20px,3vw,32px);background:var(--card);color:var(--ink);border:1px solid oklch(from var(--accent) l c h / .28);border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow, var(--shadow-lg, 0 2px 4px oklch(from var(--ml3-shadow) l c h / .22), 0 12px 24px -8px oklch(from var(--ml3-shadow) l c h / .32)));animation:cf-ml3-rise .45s var(--ml3-ease) both}
.cf-ml3-card-h{margin:0;font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);letter-spacing:-.01em;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;text-wrap:balance}
.cf-ml3-card-lead{margin:12px 0 0;color:var(--muted);font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;text-wrap:pretty}
.cf-ml3-form{margin:0}
.cf-ml3-fieldset{border:0;margin:24px 0 0;padding:0;min-width:0}
.cf-ml3-seg{position:relative;display:grid;grid-template-columns:1fr 1fr;padding:4px;border-radius:var(--radius,12px);background:color-mix(in oklch, var(--ink) 5%, var(--card));box-shadow:inset 0 0 0 1px oklch(from var(--ink) l c h / .08)}
.cf-ml3-seg-thumb{position:absolute;top:4px;bottom:4px;left:4px;width:calc(50% - 4px);border-radius:calc(var(--radius,12px) - 4px);background:color-mix(in oklch, var(--accent) 10%, var(--card));box-shadow:inset 0 0 0 1px oklch(from var(--accent) l c h / .45), var(--shadow-sm, 0 1px 1px oklch(from var(--ml3-shadow) l c h / .18), 0 1px 3px oklch(from var(--ml3-shadow) l c h / .14));transition:transform .28s var(--ml3-ease)}
.cf-ml3-seg[data-mode='create'] .cf-ml3-seg-thumb{transform:translateX(100%)}
.cf-ml3-seg-opt{position:relative;z-index:1;display:flex;min-height:44px;cursor:pointer}
.cf-ml3-seg-opt>span{display:flex;align-items:center;justify-content:center;width:100%;padding:8px 12px;border-radius:calc(var(--radius,12px) - 4px);font-size:1rem;font-weight:700;line-height:1.2;text-align:center;color:var(--muted);transition:color .16s ease}
.cf-ml3-seg-opt[data-selected='true']>span,.cf-ml3-seg-opt:hover>span{color:var(--ink)}
.cf-ml3-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}
.cf-ml3-sr:focus-visible+span{outline:3px solid oklch(from var(--field-focus, var(--accent)) l c h / .55);outline-offset:1px}
.cf-ml3-fieldset:disabled .cf-ml3-seg-opt{cursor:not-allowed}
.cf-ml3-fieldset:disabled .cf-ml3-seg-opt:hover>span{color:var(--muted)}
.cf-ml3-fieldset:disabled .cf-ml3-seg-opt[data-selected='true']>span{color:var(--ink)}
.cf-ml3-fields{margin-top:24px}
.cf-ml3-field+.cf-ml3-field{margin-top:16px}
.cf-ml3-reveal{display:grid;grid-template-rows:0fr;opacity:0;visibility:hidden;transition:grid-template-rows .36s var(--ml3-ease),opacity .24s ease,visibility 0s linear .36s}
.cf-ml3-reveal[data-open='true']{grid-template-rows:1fr;opacity:1;visibility:visible;transition:grid-template-rows .36s var(--ml3-ease),opacity .3s ease .06s,visibility 0s}
.cf-ml3-reveal-in{min-height:0;overflow:hidden;margin-inline:-4px;padding-inline:4px}
.cf-ml3-pad-below{padding:4px 0 16px}
.cf-ml3-pad-above{padding:16px 0 4px}
.cf-ml3-pad-above-lg{padding-top:24px}
.cf-ml3-label-row{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 12px;margin-bottom:8px}
.cf-ml3-label{font-size:1rem;font-weight:700;line-height:1.3;color:var(--label-ink, var(--ink))}
.cf-ml3-control{position:relative}
.cf-ml3-input{display:block;width:100%;height:56px;margin:0;padding:0 16px;font:inherit;font-size:1.0625rem;color:var(--field-ink);background:var(--field);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(--ml3-shadow) l c h / .06);appearance:none;-webkit-appearance:none;transition:border-color .16s ease,box-shadow .16s ease}
.cf-ml3-control.has-trailing .cf-ml3-input{padding-right:56px}
.cf-ml3-input::placeholder{color:color-mix(in oklch, var(--field-ink) 65%, var(--field));opacity:1}
.cf-ml3-input:hover:not(:disabled){border-color:color-mix(in oklch, var(--ink) 38%, transparent)}
.cf-ml3-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-ml3-input[aria-invalid='true']{border-color:var(--danger)}
.cf-ml3-input[aria-invalid='true']:focus{border-color:var(--danger);box-shadow:0 0 0 3px oklch(from var(--danger) l c h / .3)}
.cf-ml3-input:disabled{cursor:not-allowed;background:color-mix(in oklch, var(--field-ink) 5%, var(--field))}
.cf-ml3-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:color-mix(in oklch, var(--field-ink) 70%, var(--field));cursor:pointer;transition:background .16s ease,color .16s ease}
.cf-ml3-eye:hover:not(:disabled){background:color-mix(in oklch, var(--field-ink) 7%, var(--field));color:var(--field-ink)}
.cf-ml3-eye:focus-visible{outline:3px solid oklch(from var(--field-focus, var(--accent)) l c h / .55);outline-offset:-2px}
.cf-ml3-eye:disabled{cursor:not-allowed}
.cf-ml3-err{margin:8px 0 0;color:var(--danger);font-size:.9375rem;font-weight:600;line-height:1.4;text-wrap:pretty}
.cf-ml3-ico{display:inline-block;vertical-align:-.15em;margin-inline-end:.4em}
.cf-ml3-link{padding:0;border:0;background:none;font:inherit;font-size:.9375rem;font-weight:600;line-height:1.3;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}
.cf-ml3-link:hover{color:oklch(from var(--link, var(--accent)) calc(l - .08) c h);text-decoration-color:currentColor}
.cf-ml3-link:focus-visible{outline:3px solid oklch(from var(--field-focus, var(--accent)) l c h / .55);outline-offset:2px;border-radius:4px}
.cf-ml3-alert{margin-top:16px;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}
.cf-ml3-btn{margin-top:24px;display:inline-flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:56px;padding:8px 16px;border:0;cursor:pointer;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.4vw,1.25rem);line-height:1.15;text-align:center;text-wrap:balance;color:var(--button-ink, var(--cta-ink));text-shadow:var(--button-text-shadow, none);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));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(--ml3-shadow) l c h / .3), 0 8px 16px -6px oklch(from var(--ml3-shadow) l c h / .45));transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-ml3-btn:hover:not(:disabled),.cf-ml3-btn.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));box-shadow:inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + .12) c h / .6), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - .2) c h), 0 1px 2px oklch(from var(--ml3-shadow) l c h / .34), 0 10px 18px -6px oklch(from var(--ml3-shadow) l c h / .52)}
.cf-ml3-btn:active:not(:disabled),.cf-ml3-btn.is-active:not(:disabled){transform:translateY(1px);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 - .08) c h));box-shadow:inset 0 2px 4px oklch(from var(--button-bg, var(--cta)) calc(l - .22) c h / .45), inset 0 -2px 0 oklch(from var(--button-bg, var(--cta)) calc(l - .16) c h), 0 1px 1px oklch(from var(--ml3-shadow) l c h / .3)}
.cf-ml3-btn:focus-visible{outline:3px solid oklch(from var(--field-focus, var(--accent)) l c h / .55);outline-offset:3px}
.cf-ml3-btn[aria-busy='true']{cursor:progress}
.cf-ml3-btn:disabled{cursor:not-allowed;background:color-mix(in oklch, var(--ink) 7%, var(--card));color:var(--muted);text-shadow:none;box-shadow:inset 0 0 0 1px oklch(from var(--ink) l c h / .14);transform:none}
.cf-ml3-spin{flex:none;animation:cf-ml3-spin .8s linear infinite}
.cf-ml3-hint{margin:12px 0 0;text-align:center;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--muted);text-wrap:pretty}
.cf-ml3-well{display:grid;grid-template-columns:40px minmax(0,1fr);gap:14px;align-items:start;padding:16px;border-radius:10px;background:color-mix(in oklch, var(--ink) 4%, var(--card))}
.cf-ml3-disc{display:grid;place-items:center;width:40px;height:40px;border-radius:999px;background:var(--accent-fill, var(--accent));color:var(--accent-fill-ink, var(--card))}
.cf-ml3-disc svg{margin-left:2px}
.cf-ml3-resume{min-width:0}
.cf-ml3-resume-label{margin:0;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted)}
.cf-ml3-resume-name{margin:2px 0 0;font-family:var(--font-display);font-weight:800;font-size:1.0625rem;line-height:1.3;color:var(--ink);text-wrap:pretty}
.cf-ml3-resume-detail{margin:4px 0 0;font-size:.9375rem;line-height:1.4;color:var(--muted)}
.cf-ml3-bar{margin-top:10px;height:6px;border-radius:999px;overflow:hidden;background:color-mix(in oklch, var(--ink) 10%, var(--card))}
.cf-ml3-bar span{display:block;height:100%;border-radius:inherit;background:var(--accent-fill, var(--accent))}
@media (max-width:899px){
.cf-ml3-stage{display:flex;flex-direction:column}
.cf-ml3-photo{position:relative;inset:auto;height:clamp(180px,42vw,300px)}
.cf-ml3-photo::after{display:none}
.cf-ml3-card{order:2;align-self:stretch;margin:-56px 0 0}
.cf-ml3-side{order:3;min-height:0;padding:32px 0 0;color:var(--ink)}
.cf-ml3-brand{display:none}
.cf-ml3-intro{max-width:none}
.cf-ml3-reasons{margin-top:0;padding-top:24px}
.cf-ml3-notes{grid-template-columns:1fr}
.cf-ml3-note{flex-direction:row;align-items:baseline;gap:12px}
}
@keyframes cf-ml3-rise{from{opacity:.82;transform:translateY(8px)}}
@keyframes cf-ml3-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion: reduce){
.cf-ml3-card,.cf-ml3-note,.cf-ml3-spin{animation:none}
.cf-ml3-reveal,.cf-ml3-reveal[data-open='true'],.cf-ml3-seg-thumb,.cf-ml3-seg-opt>span,.cf-ml3-input,.cf-ml3-eye,.cf-ml3-btn{transition:none}
.cf-ml3-btn:active:not(:disabled),.cf-ml3-btn.is-active:not(:disabled){transform:none}
}
`;
pieces/forms/member-login-3/specimen.tsx 46 lines
import __studioImage286dd298 from "../assets/e7e4eb61ff2ad352.webp";
import * as React from 'react';
import { MemberLogin3 } from '../member-login-3';
import defaults from '../../studio-defaults.json';
import { slot } from '../../slots';
export const states = ['default', 'hover', 'active', 'disabled', 'error'] as const;
type SpecimenState = (typeof states)[number];
export default function MemberLogin3Specimen({ state = 'default' }: { state?: SpecimenState }) {
const emailField = defaults.sample.fields.find((f) => f.name === 'email');
const ready = state === 'hover' || state === 'active';
const errored = state === 'error';
const values = errored
? { name: 'Maya Ortiz', email: 'maya@example', password: 'sunrise-24', confirm: 'sunrise-42' }
: ready
? { email: 'maya@example.com', password: 'sunrise-flow-24' }
: {};
return (
<MemberLogin3
key={state}
state={state}
brandName='Flowstate Yoga Academy'
headline='Your mat is right where you left it'
lead='Sign in, press play, and you’re one class away from feeling like yourself again.'
reasonsTitle='Three reasons to roll out your mat today'
reasons={[
'Twenty minutes still counts.',
'Your saved classes are waiting.',
'Tomorrow starts easier after tonight’s flow.',
]}
sceneImage={slot(
'scene',
__studioImage286dd298
)}
sceneAlt='A calm, sunlit practice room with two yoga mats rolled out on a wooden floor'
lastModule={{ name: 'Hip Openers for Desk Days', detail: 'Module 4 · Lesson 3 of 6', progress: 0.5 }}
defaultMode={errored ? 'create' : 'signin'}
defaultValues={values}
onForgotPassword={() => {}}
copy={{ emailLabel: emailField?.label ?? 'Email address' }}
/>
);
}
| Name | Type | Details |
|---|---|---|
brandName OptionalMemberLogin3 |
React.ReactNode |
|
logoImage OptionalMemberLogin3 |
string |
|
logoAlt OptionalMemberLogin3 |
string |
|
headline OptionalMemberLogin3 |
React.ReactNode |
|
lead OptionalMemberLogin3 |
React.ReactNode |
|
reasonsTitle OptionalMemberLogin3 |
React.ReactNode |
|
reasons OptionalMemberLogin3 |
React.ReactNode[] |
|
sceneImage OptionalMemberLogin3 |
string |
|
sceneAlt OptionalMemberLogin3 |
string |
|
lastModule OptionalMemberLogin3 |
MemberLogin3Module |
|
defaultMode OptionalMemberLogin3 |
MemberLogin3Mode |
|
defaultValues OptionalMemberLogin3 |
Partial<Record<'name' | 'email' | 'password' | 'confirm', string>> |
|
minPasswordLength OptionalMemberLogin3 |
number |
|
forgotHref OptionalMemberLogin3 |
string |
|
onForgotPassword OptionalMemberLogin3 |
(email: string) => void |
|
error OptionalMemberLogin3 |
React.ReactNode |
|
busy OptionalMemberLogin3 |
boolean |
|
disabled OptionalMemberLogin3 |
boolean |
|
state OptionalMemberLogin3 |
'default' | 'hover' | 'active' | 'disabled' | 'error' |
|
onSubmit OptionalMemberLogin3 |
(values: MemberLogin3Values) => void |
|
onModeChange OptionalMemberLogin3 |
(mode: MemberLogin3Mode) => void |
|
copy OptionalMemberLogin3 |
Partial<MemberLogin3Copy> |
|
className OptionalMemberLogin3 |
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.
-
8ce62e067659355c.webp
image/webp · 25.6 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
e7e4eb61ff2ad352.webp
image/webp · 75.6 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB