Job Application 1
Job application block: five short interview questions on a dark stage, a running answer transcript, and a review where the last answer is the send button.
Use it in a prompt
Use forms/job-application 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/job-application.tsx. - Import it and pass your copy and images (Props tab):
import { JobApplication } from "@/components/funneldna/forms/job-application"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/job-application/component.tsx 980 lines
// layout: interview-qa
// Job application block: five short interview questions on a dark stage, a running answer transcript, and a review where the last answer is the send button.
import React, { useEffect, useId, useRef, useState } from 'react';
import { motion, useReducedMotion } from 'motion/react';
import { Check, ChevronDown, CircleAlert, FileText, Loader2, PencilLine, UploadCloud, X } from 'lucide-react';
export type JobRole = {
id: string;
title: string;
// one short line under the title
detail?: string;
};
export type JobApplicationValues = {
name: string;
email: string;
phone: string;
location: string;
// id of the chosen role
role: string;
experience: string;
// the project-you-are-proud-of answer
story: string;
portfolio: string;
// kept in memory only; the builder decides where it goes
resume: File | null;
start: string;
schedule: string;
days: string[];
confirm: boolean;
};
export type JobApplicationStep = {
// lower-case phrase used in the Still-to-come line and edit labels
label: string;
question: string;
hint: string;
};
export type JobApplicationCopy = typeof DEFAULT_COPY;
export type JobApplicationProps = {
headline?: string;
// phrase inside the headline that gets the marker stroke
emphasis?: string;
lead?: string;
// italic aside in the hiring lead’s voice
aside?: string;
// slot: presenter-cutout (transparent background)
presenterImage?: string;
presenterImageAlt?: string;
presenterName?: string;
presenterRole?: string;
roles?: JobRole[];
experienceOptions?: string[];
startOptions?: string[];
scheduleOptions?: string[];
dayOptions?: string[];
// resume size limit in MB
maxFileMb?: number;
// minimum characters for the project answer
minStoryLength?: number;
// every visible word; templates use {n}, {total}, {items}, {label}, {count}, {min}, {max}, {name}, {days}
copy?: Partial<JobApplicationCopy>;
// shows the sending state on the final button
submitting?: boolean;
disabled?: boolean;
state?: 'default' | 'hover' | 'active' | 'disabled' | 'error';
// called with validated values; the piece never sends data itself
onSubmit?: (values: JobApplicationValues) => void;
onStepChange?: (step: number) => void;
className?: string;
};
export function JobApplication(props: JobApplicationProps) {
const {
headline = 'Apply in five short answers',
emphasis = 'five short answers',
lead = 'No cover letter and no account to create. Answer each question, add your resume, then send it all in one go.',
aside = '(Honestly? One real sentence about your work tells us more than a polished cover letter.)',
presenterImage,
presenterImageAlt = '',
presenterName = '',
presenterRole = '',
roles = DEFAULT_ROLES,
experienceOptions = DEFAULT_EXPERIENCE,
startOptions = DEFAULT_START,
scheduleOptions = DEFAULT_SCHEDULE,
dayOptions = DEFAULT_DAYS,
maxFileMb = 5,
minStoryLength = 40,
copy,
submitting = false,
disabled: disabledProp = false,
state = 'default',
onSubmit,
onStepChange,
className,
} = props;
const c: JobApplicationCopy = { ...DEFAULT_COPY, ...copy, steps: copy?.steps ?? DEFAULT_COPY.steps };
const rules: Rules = { maxFileMb, minStoryLength };
const disabled = disabledProp || state === 'disabled';
const last = c.steps.length - 1;
const [step, setStep] = useState(0);
const [values, setValues] = useState<JobApplicationValues>(() => (state === 'error' ? ERROR_VALUES : EMPTY_VALUES));
const [errors, setErrors] = useState<Errors>(() => (state === 'error' ? validateStep(0, ERROR_VALUES, c, rules) : {}));
const [returnToReview, setReturnToReview] = useState(false);
const [dragOver, setDragOver] = useState(false);
const formRef = useRef<HTMLFormElement>(null);
const headRef = useRef<HTMLHeadingElement>(null);
const moved = useRef(false);
const focusKey = useRef<string | null>(null);
const firstState = useRef(true);
const reduce = useReducedMotion();
const uid = useId();
const id = (key: string) => `${uid}-${key}`;
const errId = (key: string) => id(`${key}-err`);
const move = reduce ? { duration: 0 } : { duration: 0.45, ease: EASE };
useEffect(() => {
if (firstState.current) {
firstState.current = false;
return;
}
const v = state === 'error' ? ERROR_VALUES : EMPTY_VALUES;
setStep(0);
setReturnToReview(false);
setValues(v);
setErrors(state === 'error' ? validateStep(0, v, c, rules) : {});
}, [state]);
useEffect(() => {
if (moved.current) headRef.current?.focus();
onStepChange?.(step);
}, [step]);
useEffect(() => {
const key = focusKey.current;
if (!key) return;
focusKey.current = null;
const box = formRef.current?.querySelector<HTMLElement>(`[data-field='${key}']`);
const target = box && box.matches('input, select, textarea') ? box : box?.querySelector<HTMLElement>('input, select, textarea, button');
target?.focus();
}, [errors]);
function update<K extends keyof JobApplicationValues>(key: K, value: JobApplicationValues[K]) {
setValues((prev) => ({ ...prev, [key]: value }));
setErrors((prev) => {
if (!prev[key]) return prev;
const next = { ...prev };
delete next[key];
return next;
});
}
function fail(errs: Errors) {
focusKey.current = Object.keys(errs)[0] ?? null;
setErrors(errs);
}
function go(to: number) {
moved.current = true;
setErrors({});
setStep(to);
}
function next() {
const errs = validateStep(step, values, c, rules);
if (Object.keys(errs).length) return fail(errs);
if (returnToReview) {
setReturnToReview(false);
go(last);
} else go(step + 1);
}
function back() {
if (returnToReview) {
setReturnToReview(false);
go(last);
} else go(Math.max(0, step - 1));
}
function editStep(to: number, fromReview: boolean) {
setReturnToReview(fromReview);
go(to);
}
function submitAll() {
for (let s = 0; s <= last; s++) {
const errs = validateStep(s, values, c, rules);
if (Object.keys(errs).length) {
if (s !== step) {
setReturnToReview(s !== last);
go(s);
}
return fail(errs);
}
}
onSubmit?.(values);
}
function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
event.preventDefault();
if (disabled || submitting) return;
if (step === last) submitAll();
else next();
}
function takeFile(file?: File | null) {
if (!file || disabled) return;
const problem = checkFile(file, c, rules);
if (problem) {
setValues((prev) => ({ ...prev, resume: null }));
setErrors((prev) => ({ ...prev, resume: problem }));
return;
}
update('resume', file);
}
function toggleDay(day: string) {
const has = values.days.includes(day);
update('days', dayOptions.filter((d) => (d === day ? !has : values.days.includes(d))));
}
const current = c.steps[step];
const isReview = step === last;
const upcoming = c.steps.slice(step + 1).map((s) => s.label);
const btnState = state === 'hover' ? ' is-hover' : state === 'active' ? ' is-active' : '';
const storyLen = values.story.trim().length;
let body: React.ReactNode = null;
if (step === 0) {
body = (
<div className='cf-ja-grid'>
<TextField wide id={id('name')} field='name' label={c.nameLabel} placeholder={c.namePlaceholder} autoComplete='name' value={values.name} error={errors.name} onChange={(v) => update('name', v)} />
<TextField id={id('email')} field='email' type='email' inputMode='email' label={c.emailLabel} placeholder={c.emailPlaceholder} autoComplete='email' value={values.email} error={errors.email} onChange={(v) => update('email', v)} />
<TextField id={id('phone')} field='phone' type='tel' inputMode='tel' label={c.phoneLabel} placeholder={c.phonePlaceholder} autoComplete='tel' value={values.phone} error={errors.phone} onChange={(v) => update('phone', v)} />
<TextField wide id={id('location')} field='location' label={c.locationLabel} optional={c.optional} placeholder={c.locationPlaceholder} autoComplete='address-level2' value={values.location} onChange={(v) => update('location', v)} />
</div>
);
} else if (step === 1) {
body = (
<div className='cf-ja-field'>
<div className={`cf-ja-tiles${errors.role ? ' is-bad' : ''}`} role='radiogroup' aria-labelledby={id('q')} aria-describedby={errors.role ? errId('role') : undefined} data-field='role'>
{roles.map((r) => {
const on = values.role === r.id;
return (
<label key={r.id} className={`cf-ja-tile${on ? ' is-on' : ''}`}>
<input className='cf-ja-sr' type='radio' name={id('role')} value={r.id} checked={on} onChange={() => update('role', r.id)} aria-invalid={errors.role ? true : undefined} />
<span className='cf-ja-dot' aria-hidden='true'>{on ? <Check size={14} strokeWidth={3} /> : null}</span>
<span className='cf-ja-ttl'>{r.title}</span>
{r.detail ? <span className='cf-ja-tdet'>{r.detail}</span> : null}
</label>
);
})}
</div>
{errors.role ? <ErrorLine id={errId('role')} text={errors.role} /> : null}
</div>
);
} else if (step === 2) {
body = (
<div className='cf-ja-stack'>
<div className='cf-ja-field'>
<label className='cf-ja-label' htmlFor={id('experience')}>{c.experienceLabel}</label>
<div className='cf-ja-select'>
<select id={id('experience')} data-field='experience' className='cf-ja-input' required value={values.experience} onChange={(e) => update('experience', e.target.value)} aria-invalid={errors.experience ? true : undefined} aria-describedby={errors.experience ? errId('experience') : undefined}>
<option value='' disabled>{c.experiencePlaceholder}</option>
{experienceOptions.map((o) => (
<option key={o} value={o}>{o}</option>
))}
</select>
<ChevronDown className='cf-ja-chev' size={20} strokeWidth={2.5} aria-hidden='true' />
</div>
{errors.experience ? <ErrorLine id={errId('experience')} text={errors.experience} /> : null}
</div>
<div className='cf-ja-field'>
<label className='cf-ja-label' htmlFor={id('story')}>{c.storyLabel}</label>
<textarea id={id('story')} data-field='story' className='cf-ja-input cf-ja-area' rows={5} value={values.story} placeholder={c.storyPlaceholder} onChange={(e) => update('story', e.target.value)} aria-invalid={errors.story ? true : undefined} aria-describedby={`${id('count')}${errors.story ? ` ${errId('story')}` : ''}`} />
<div className='cf-ja-meta'>
{errors.story ? <ErrorLine id={errId('story')} text={errors.story} /> : null}
<p id={id('count')} className={`cf-ja-counter${storyLen >= minStoryLength ? ' is-met' : ''}`}>{fill(c.storyCount, { count: storyLen, min: minStoryLength })}</p>
</div>
</div>
<TextField id={id('portfolio')} field='portfolio' type='url' inputMode='url' label={c.portfolioLabel} optional={c.optional} placeholder={c.portfolioPlaceholder} autoComplete='url' value={values.portfolio} error={errors.portfolio} onChange={(v) => update('portfolio', v)} />
</div>
);
} else if (step === 3) {
const file = values.resume;
body = (
<div className='cf-ja-field'>
{file ? (
<div className='cf-ja-file' data-field='resume'>
<span className='cf-ja-disc' aria-hidden='true'><FileText size={20} strokeWidth={2.5} /></span>
<span className='cf-ja-fmeta'>
<span className='cf-ja-fname'>{file.name}</span>
<span className='cf-ja-fsub'>
<span className='cf-ja-badge cf-ja-badge--sm' aria-hidden='true'><Check size={12} strokeWidth={3} /></span>
{c.fileReady} · {formatBytes(file.size)}
</span>
</span>
<button type='button' className='cf-ja-iconbtn' aria-label={fill(c.removeFile, { name: file.name })} onClick={() => update('resume', null)}>
<X size={20} strokeWidth={2.5} aria-hidden='true' />
</button>
</div>
) : (
<label
className={`cf-ja-drop${dragOver ? ' is-over' : ''}${errors.resume ? ' is-bad' : ''}`}
onDragOver={(e) => {
e.preventDefault();
if (!disabled) setDragOver(true);
}}
onDragLeave={() => setDragOver(false)}
onDrop={(e) => {
e.preventDefault();
setDragOver(false);
takeFile(e.dataTransfer.files?.[0]);
}}
>
<input
className='cf-ja-sr'
type='file'
accept={ACCEPT}
data-field='resume'
onChange={(e) => {
takeFile(e.target.files?.[0]);
e.target.value = '';
}}
aria-invalid={errors.resume ? true : undefined}
aria-describedby={errors.resume ? errId('resume') : undefined}
/>
<span className='cf-ja-disc cf-ja-disc--lg' aria-hidden='true'><UploadCloud size={24} strokeWidth={2.5} /></span>
<span className='cf-ja-droptitle'>{c.dropTitle}</span>
<span className='cf-ja-dropor'>
{c.dropOr}
<span className='cf-ja-fake'>{c.dropButton}</span>
</span>
<span className='cf-ja-dropnote'>{fill(c.dropNote, { max: maxFileMb })}</span>
</label>
)}
{errors.resume ? <ErrorLine id={errId('resume')} text={errors.resume} /> : null}
</div>
);
} else if (step === 4) {
body = (
<div className='cf-ja-stack'>
<ChipGroup name={id('start')} field='start' legend={c.startLegend} options={startOptions} isOn={(o) => values.start === o} onPick={(o) => update('start', o)} error={errors.start} errorId={errId('start')} />
<ChipGroup name={id('schedule')} field='schedule' legend={c.scheduleLegend} options={scheduleOptions} isOn={(o) => values.schedule === o} onPick={(o) => update('schedule', o)} error={errors.schedule} errorId={errId('schedule')} />
<ChipGroup multi name={id('days')} field='days' legend={c.daysLegend} options={dayOptions} isOn={(o) => values.days.includes(o)} onPick={toggleDay} error={errors.days} errorId={errId('days')} />
</div>
);
} else {
body = (
<dl className='cf-ja-review'>
{c.steps.slice(0, last).map((s, i) => (
<div key={i} className='cf-ja-rrow'>
<dt className='cf-ja-rq'>
<span className='cf-ja-rnum'>{i + 1}</span>
{s.question}
</dt>
<dd className='cf-ja-ra'>{answerFor(i, values, roles, c, true) || c.missing}</dd>
<dd className='cf-ja-redit'>
<button type='button' className='cf-ja-link' onClick={() => editStep(i, true)} aria-label={fill(c.editLabel, { label: s.label })}>
<PencilLine size={16} strokeWidth={2.5} aria-hidden='true' />
{c.edit}
</button>
</dd>
</div>
))}
<div className='cf-ja-rrow cf-ja-rrow--final'>
<dt className='cf-ja-rq'>
<span className='cf-ja-rnum'>{last + 1}</span>
{c.finalQuestion}
</dt>
<dd className='cf-ja-ra'>
<label className={`cf-ja-confirm${values.confirm ? ' is-on' : ''}${errors.confirm ? ' is-bad' : ''}`} data-field='confirm'>
<input className='cf-ja-sr' type='checkbox' checked={values.confirm} onChange={(e) => update('confirm', e.target.checked)} aria-invalid={errors.confirm ? true : undefined} aria-describedby={errors.confirm ? errId('confirm') : undefined} />
<span className='cf-ja-box' aria-hidden='true'>{values.confirm ? <Check size={16} strokeWidth={3} /> : null}</span>
<span>{c.confirmLabel}</span>
</label>
{errors.confirm ? <ErrorLine id={errId('confirm')} text={errors.confirm} /> : null}
<div className='cf-ja-nav cf-ja-nav--final'>
<button type='button' className='cf-ja-btn2' onClick={back}>{c.back}</button>
<button type='submit' className={`cf-ja-btn cf-ja-btn--big${btnState}`} disabled={submitting} aria-busy={submitting || undefined}>
{submitting ? (
<span className='cf-ja-btnmain'>
<Loader2 className='cf-ja-spin' size={20} strokeWidth={2.5} aria-hidden='true' />
{c.submitting}
</span>
) : (
<>
<span className='cf-ja-btnmain'>{c.submit}</span>
<span className='cf-ja-btnsub'>{c.submitSub}</span>
</>
)}
</button>
</div>
</dd>
</div>
</dl>
);
}
return (
<section className={`cf-ja${className ? ` ${className}` : ''}`} aria-labelledby={id('title')}>
<style>{CSS}</style>
<div className='cf-ja-stage'>
<header className='cf-ja-head'>
<h2 id={id('title')} className='cf-ja-h2'>{renderHeadline(headline, emphasis)}</h2>
{lead ? <p className='cf-ja-lead'>{lead}</p> : null}
{aside ? (
<p className='cf-ja-aside'>
<em>{aside}</em>
{presenterName ? (
<span className='cf-ja-by'>
{c.asideBy}
{presenterName}
{presenterRole ? `, ${presenterRole}` : ''}
</span>
) : null}
</p>
) : null}
</header>
</div>
<div className='cf-ja-cardwrap'>
<form ref={formRef} className='cf-ja-card' noValidate onSubmit={handleSubmit} aria-labelledby={id('title')}>
<fieldset className='cf-ja-fs' disabled={disabled}>
<div className='cf-ja-progress'>
<p className='cf-ja-count' aria-live='polite'>
{isReview ? fill(c.reviewProgress, { total: last }) : fill(c.progress, { n: step + 1, total: last })}
</p>
<div className='cf-ja-bar' role='progressbar' aria-label={c.progressLabel} aria-valuemin={0} aria-valuemax={last} aria-valuenow={isReview ? last : step}>
{c.steps.slice(0, last).map((s, i) => (
<span key={i} className='cf-ja-seg'>
<motion.span className='cf-ja-segfill' initial={false} animate={{ scaleX: isReview || i < step ? 1 : i === step ? 0.4 : 0 }} transition={move} />
</span>
))}
</div>
</div>
{!isReview && step > 0 ? (
<ol className='cf-ja-trans' aria-label={c.transcriptLabel}>
{c.steps.slice(0, step).map((s, i) => {
const said = answerFor(i, values, roles, c, false);
return (
<motion.li key={i} initial={reduce ? false : { opacity: 0.82, y: 8 }} animate={{ opacity: 1, y: 0 }} transition={move}>
<button type='button' className='cf-ja-trow' onClick={() => editStep(i, false)} aria-label={`${fill(c.editLabel, { label: s.label })}: ${said}`}>
<span className='cf-ja-badge' aria-hidden='true'><Check size={14} strokeWidth={3} /></span>
<span className='cf-ja-tans'>{said || c.missing}</span>
<span className='cf-ja-tedit' aria-hidden='true'>{c.edit}</span>
</button>
</motion.li>
);
})}
</ol>
) : null}
<motion.div key={step} className='cf-ja-q' initial={reduce || !moved.current ? false : { opacity: 0.82, y: 8 }} animate={{ opacity: 1, y: 0 }} transition={move}>
<div className='cf-ja-qhead'>
{presenterImage ? <img className='cf-ja-avatar' src={presenterImage} alt={presenterImageAlt} width={64} height={64} /> : null}
<div className='cf-ja-qtext'>
<h3 ref={headRef} id={id('q')} tabIndex={-1} className='cf-ja-question' aria-describedby={id('hint')}>{current.question}</h3>
<p id={id('hint')} className='cf-ja-hint'>{fill(current.hint, { max: maxFileMb })}</p>
</div>
</div>
<div className='cf-ja-body'>{body}</div>
</motion.div>
{!isReview ? (
<div className='cf-ja-nav cf-ja-nav--step'>
{!returnToReview && upcoming.length ? (
<p className='cf-ja-up'>{fill(c.upcoming, { items: joinList(upcoming, c.and) })}</p>
) : null}
{step > 0 || returnToReview ? (
<button type='button' className='cf-ja-btn2' onClick={back}>{c.back}</button>
) : null}
<button type='submit' className={`cf-ja-btn${btnState}`}>
{returnToReview ? c.saveReview : step === last - 1 ? c.toReview : c.next}
</button>
</div>
) : null}
</fieldset>
</form>
</div>
</section>
);
}
export default JobApplication;
type Rules = { maxFileMb: number; minStoryLength: number };
type Errors = Partial<Record<keyof JobApplicationValues, string>>;
const EASE = [0.2, 0.7, 0.2, 1] as const;
const FILE_TYPES = ['pdf', 'doc', 'docx'];
const ACCEPT = '.pdf,.doc,.docx';
const EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/;
const PHONE = /^[+\d\s().-]+$/;
const URL_LIKE = /^https?:\/\/[^\s.]+\.\S+/;
const EMPTY_VALUES: JobApplicationValues = {
name: '',
email: '',
phone: '',
location: '',
role: '',
experience: '',
story: '',
portfolio: '',
resume: null,
start: '',
schedule: '',
days: [],
confirm: false,
};
const ERROR_VALUES: JobApplicationValues = { ...EMPTY_VALUES, email: 'dana@' };
const DEFAULT_ROLES: JobRole[] = [
{ id: 'marketing', title: 'Marketing', detail: 'Campaigns, copy and funnels' },
{ id: 'operations', title: 'Operations', detail: 'Systems, support and delivery' },
{ id: 'sales', title: 'Sales', detail: 'Calls, follow-up and onboarding' },
];
const DEFAULT_EXPERIENCE = ['Less than 1 year', '1–2 years', '3–5 years', '6–9 years', '10+ years'];
const DEFAULT_START = ['Right away', 'In 2 weeks', 'In a month', 'Later than a month'];
const DEFAULT_SCHEDULE = ['Full-time', 'Part-time', 'Contract'];
const DEFAULT_DAYS = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'];
const DEFAULT_STEPS: JobApplicationStep[] = [
{ label: 'your contact details', question: 'First, who are we talking to?', hint: 'We only use this to reply about your application.' },
{ label: 'the role you want', question: 'Which role is the one for you?', hint: 'Pick the closest fit. You can mention anything else later.' },
{ label: 'your experience', question: 'What have you done that you’re proud of?', hint: 'Two or three honest sentences beat a list of buzzwords.' },
{ label: 'your resume', question: 'Add your resume.', hint: 'PDF or Word, up to {max} MB. Nothing is sent until you press send at the end.' },
{ label: 'your availability', question: 'When could you start, and when can we talk?', hint: 'Pick what’s true today. Plans change, and that’s fine.' },
{ label: 'a final review', question: 'Here’s your application. Look right?', hint: 'Tap Edit beside any answer to change it.' },
];
const DEFAULT_COPY = {
steps: DEFAULT_STEPS,
progress: 'Question {n} of {total}',
reviewProgress: 'All {total} answers in. One click left.',
progressLabel: 'Application progress',
upcoming: 'Still to come: {items}.',
and: 'and',
transcriptLabel: 'Your answers so far',
edit: 'Edit',
editLabel: 'Change {label}',
missing: 'Not answered yet',
asideBy: '— ',
nameLabel: 'Full name',
namePlaceholder: 'Jane Smith',
emailLabel: 'Email address',
emailPlaceholder: 'you@example.com',
phoneLabel: 'Phone',
phonePlaceholder: '(555) 123-4567',
locationLabel: 'City and country',
locationPlaceholder: 'Austin, USA',
optional: '(optional)',
experienceLabel: 'Years of relevant experience',
experiencePlaceholder: 'Choose a range…',
storyLabel: 'A project you’re proud of, and the part you played',
storyPlaceholder: 'I rewrote the sales page for a course launch, then tested three headlines…',
storyCount: '{count} characters · {min} minimum',
portfolioLabel: 'Portfolio or LinkedIn',
portfolioPlaceholder: 'https://yourportfolio.com',
dropTitle: 'Drop your resume here',
dropOr: 'or',
dropButton: 'Choose a file',
dropNote: 'PDF, DOC or DOCX · up to {max} MB',
fileReady: 'Ready to send',
removeFile: 'Remove {name}',
startLegend: 'Earliest start date',
scheduleLegend: 'Preferred schedule',
daysLegend: 'Good days for a first call',
callDays: 'calls on {days}',
finalQuestion: 'Ready to send it?',
confirmLabel: 'My answers are accurate, and you can contact me about this role.',
next: 'Next question',
toReview: 'Review my answers',
saveReview: 'Save and review',
back: 'Back',
submit: 'Send my application',
submitSub: 'No cover letter · one click',
submitting: 'Sending…',
errName: 'Enter your full name.',
errEmail: 'Enter your email address.',
errEmailFormat: 'That email looks incomplete. Try you@example.com.',
errPhone: 'Enter a phone number we can reach you on.',
errPhoneFormat: 'Use at least 7 digits; spaces, dashes and + are fine.',
errRole: 'Choose the role you’re applying for.',
errExperience: 'Choose your years of experience.',
errStory: 'Tell us a little more: at least {min} characters.',
errPortfolio: 'Start the link with https://, or leave it blank.',
errResume: 'Add your resume to continue.',
errFileType: 'Use a PDF, DOC or DOCX file.',
errFileSize: 'That file is over {max} MB. Try a smaller copy.',
errStart: 'Choose when you could start.',
errSchedule: 'Choose a schedule.',
errDays: 'Pick at least one day for a call.',
errConfirm: 'Tick the box to confirm your answers.',
};
function validateStep(step: number, v: JobApplicationValues, c: JobApplicationCopy, r: Rules): Errors {
const e: Errors = {};
if (step === 0) {
if (!v.name.trim()) e.name = c.errName;
if (!v.email.trim()) e.email = c.errEmail;
else if (!EMAIL.test(v.email.trim())) e.email = c.errEmailFormat;
if (!v.phone.trim()) e.phone = c.errPhone;
else if (!PHONE.test(v.phone.trim()) || v.phone.replace(/\D/g, '').length < 7) e.phone = c.errPhoneFormat;
}
if (step === 1 && !v.role) e.role = c.errRole;
if (step === 2) {
if (!v.experience) e.experience = c.errExperience;
if (v.story.trim().length < r.minStoryLength) e.story = fill(c.errStory, { min: r.minStoryLength });
if (v.portfolio.trim() && !URL_LIKE.test(v.portfolio.trim())) e.portfolio = c.errPortfolio;
}
if (step === 3) {
if (!v.resume) e.resume = c.errResume;
else {
const problem = checkFile(v.resume, c, r);
if (problem) e.resume = problem;
}
}
if (step === 4) {
if (!v.start) e.start = c.errStart;
if (!v.schedule) e.schedule = c.errSchedule;
if (!v.days.length) e.days = c.errDays;
}
if (step === 5 && !v.confirm) e.confirm = c.errConfirm;
return e;
}
function checkFile(file: File, c: JobApplicationCopy, r: Rules): string {
const ext = file.name.split('.').pop()?.toLowerCase() ?? '';
if (!FILE_TYPES.includes(ext)) return c.errFileType;
if (file.size > r.maxFileMb * 1024 * 1024) return fill(c.errFileSize, { max: r.maxFileMb });
return '';
}
function answerFor(index: number, v: JobApplicationValues, roles: JobRole[], c: JobApplicationCopy, full: boolean): string {
const sep = ' · ';
switch (index) {
case 0:
return full
? [v.name, [v.email, v.phone, v.location].filter(Boolean).join(sep)].filter(Boolean).join('\n')
: [v.name, v.email, v.phone].filter(Boolean).join(sep);
case 1:
return roles.find((r) => r.id === v.role)?.title ?? '';
case 2:
return full
? [v.experience, v.story.trim(), v.portfolio.trim()].filter(Boolean).join('\n')
: [v.experience, v.story.trim()].filter(Boolean).join(sep);
case 3:
return v.resume ? (full ? `${v.resume.name} (${formatBytes(v.resume.size)})` : v.resume.name) : '';
case 4:
return [v.start, v.schedule, v.days.length ? fill(c.callDays, { days: v.days.join(', ') }) : ''].filter(Boolean).join(sep);
default:
return '';
}
}
function formatBytes(bytes: number) {
if (bytes < 1024 * 1024) return `${Math.max(1, Math.round(bytes / 1024))} KB`;
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
}
function fill(template: string, vars: Record<string, string | number>) {
return template.replace(/\{(\w+)\}/g, (match, key: string) => (key in vars ? String(vars[key]) : match));
}
function joinList(items: string[], and: string) {
if (items.length <= 1) return items[0] ?? '';
return `${items.slice(0, -1).join(', ')} ${and} ${items[items.length - 1]}`;
}
function renderHeadline(text: string, phrase: string) {
const at = phrase ? text.indexOf(phrase) : -1;
if (at < 0) return text;
return (
<>
{text.slice(0, at)}
<span className='cf-ja-em'>{phrase}</span>
{text.slice(at + phrase.length)}
</>
);
}
type TextFieldProps = {
id: string;
field: string;
label: string;
optional?: string;
value: string;
placeholder: string;
error?: string;
onChange: (value: string) => void;
type?: string;
autoComplete?: string;
inputMode?: React.HTMLAttributes<HTMLInputElement>['inputMode'];
wide?: boolean;
};
function TextField(p: TextFieldProps) {
const errorId = `${p.id}-err`;
return (
<div className={`cf-ja-field${p.wide ? ' is-wide' : ''}`}>
<label className='cf-ja-label' htmlFor={p.id}>
{p.label}
{p.optional ? <span className='cf-ja-opt'> {p.optional}</span> : null}
</label>
<input
id={p.id}
data-field={p.field}
className='cf-ja-input'
type={p.type ?? 'text'}
value={p.value}
placeholder={p.placeholder}
autoComplete={p.autoComplete}
inputMode={p.inputMode}
onChange={(e) => p.onChange(e.target.value)}
aria-invalid={p.error ? true : undefined}
aria-describedby={p.error ? errorId : undefined}
/>
{p.error ? <ErrorLine id={errorId} text={p.error} /> : null}
</div>
);
}
function ErrorLine({ id, text }: { id: string; text: string }) {
return (
<p id={id} className='cf-ja-err' role='alert'>
<CircleAlert className='cf-ja-erricon' size={16} strokeWidth={2.5} aria-hidden='true' />
{text}
</p>
);
}
type ChipGroupProps = {
name: string;
field: string;
legend: string;
options: string[];
isOn: (option: string) => boolean;
onPick: (option: string) => void;
multi?: boolean;
error?: string;
errorId: string;
};
function ChipGroup(p: ChipGroupProps) {
return (
<fieldset className={`cf-ja-group${p.error ? ' is-bad' : ''}`} data-field={p.field} aria-describedby={p.error ? p.errorId : undefined}>
<legend className='cf-ja-label cf-ja-legend'>{p.legend}</legend>
<div className='cf-ja-chips'>
{p.options.map((o) => {
const on = p.isOn(o);
return (
<label key={o} className={`cf-ja-chip${on ? ' is-on' : ''}`}>
<input className='cf-ja-sr' type={p.multi ? 'checkbox' : 'radio'} name={p.name} value={o} checked={on} onChange={() => p.onPick(o)} aria-invalid={p.error ? true : undefined} />
{on ? <Check className='cf-ja-chipcheck' size={18} strokeWidth={2.5} aria-hidden='true' /> : null}
{o}
</label>
);
})}
</div>
{p.error ? <ErrorLine id={p.errorId} text={p.error} /> : null}
</fieldset>
);
}
// Theme notes:
// - Every colour is a token or an OKLCH recipe on a token; hex appears only as the last var() fallback.
// - Documented exceptions: the white tick glyph on solid success badges (contract: status badges use #fff glyphs)
// and the #fae37c marker default.
// - The presenter cutout's fade mask is alpha-only: it is built from the ink token at alpha 1 and alpha 0, so no fixed colour is painted.
// - Inputs, selects and textareas read --field, --field-ink, --field-border, --field-radius and --field-focus directly.
// - Quiet text/icon buttons (transcript rows, Edit links, remove-file) read the button role: their corner follows
// --button-radius (capped at the approved 8px), the remove-file hover uses the secondary button pair.
// - The secondary button (Back, Choose a file) falls back to var(--shadow-sm): plain depth, no inset lip.
const CSS = `
.cf-ja {
--ja-ink: var(--ink, oklch(0.21 0.034 263));
--ja-muted: var(--muted, oklch(0.45 0.03 258));
--ja-card: var(--card, #fff);
--ja-band: var(--band, oklch(0.27 0.067 256));
--ja-band-ink: var(--band-ink, #fff);
--ja-accent: var(--accent, oklch(0.5 0.17 257));
--ja-link: var(--link, var(--accent, oklch(0.5 0.17 257)));
--ja-fill: var(--accent-fill, var(--accent, oklch(0.5 0.17 257)));
--ja-fill-ink: var(--accent-fill-ink, var(--card, #fff));
--ja-danger: var(--danger, oklch(0.5 0.17 27));
--ja-success: var(--success, oklch(0.5 0.14 150));
--ja-field: var(--field, #fff);
--ja-field-ink: var(--field-ink, oklch(0.21 0.034 263));
--ja-field-border: var(--field-border, color-mix(in oklch, var(--ink, oklch(0.21 0.034 263)) 22%, transparent));
--ja-focus: var(--field-focus, var(--accent, oklch(0.5 0.17 257)));
--ja-btn: var(--button-bg, var(--cta, oklch(0.58 0.21 29)));
--ja-btn-2: var(--button-bg-2, var(--cta-2, oklch(0.51 0.21 29)));
--ja-btn-ink: var(--button-ink, var(--cta-ink, #fff));
--ja-btn-radius: var(--button-radius, var(--radius, 12px));
--ja-2: var(--button-2-bg, var(--secondary, oklch(0.93 0.015 263)));
--ja-card-radius: var(--card-radius, var(--radius, 14px));
--ja-field-radius: var(--field-radius, var(--radius, 12px));
--ja-shadow: var(--shadow, oklch(0.22 0.03 256));
--ja-marker: oklch(from var(--marker, #fae37c) l c h / 0.95);
--ja-well: color-mix(in oklch, var(--ja-ink) 4%, var(--ja-card));
--ja-line: oklch(from var(--ja-ink) l c h / 0.14);
--ja-pick: color-mix(in oklch, var(--ja-accent) 10%, var(--ja-card));
--ja-ring: 0 0 0 3px oklch(from var(--ja-focus) l c h / 0.35);
--ja-gutter: clamp(16px, 5vw, 48px);
position: relative;
background: var(--surface, #fff);
color: var(--ja-ink);
font-family: var(--font-body, system-ui, sans-serif);
font-size: clamp(1.0625rem, 1.25vw, 1.125rem);
line-height: 1.5;
padding-bottom: clamp(64px, 8.5vw, 120px);
}
.cf-ja *, .cf-ja *::before, .cf-ja *::after { box-sizing: border-box; }
.cf-ja-stage { background: var(--ja-band); color: var(--ja-band-ink); padding: clamp(56px, 8vw, 112px) var(--ja-gutter) clamp(136px, 14vw, 184px); }
.cf-ja-head { max-width: 46rem; margin: 0 auto; text-align: center; display: flex; flex-direction: column; align-items: center; }
.cf-ja-h2 { margin: 0; font-family: var(--font-display, inherit); 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(--ja-band-ink); }
.cf-ja-em { color: oklch(from var(--ja-marker) clamp(0.18, calc((0.66 - l) * 100), 0.98) 0 0); background-image: linear-gradient(var(--ja-marker), var(--ja-marker)); background-repeat: no-repeat; background-size: 100% 84%; background-position: 0 70%; border-radius: 0.12em 0.3em 0.18em 0.34em; -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 0.12em; margin: 0 -0.04em; }
.cf-ja-lead { margin: 16px 0 0; max-width: 60ch; font-size: clamp(1.125rem, 1.5vw, 1.375rem); line-height: 1.4; font-weight: 500; color: var(--ja-band-ink); text-wrap: pretty; }
.cf-ja-aside { margin: 20px 0 0; max-width: 54ch; line-height: 1.5; color: var(--ja-band-ink); text-wrap: pretty; }
.cf-ja-aside em { font-style: italic; }
.cf-ja-by { display: block; margin-top: 6px; font-size: 0.9375rem; line-height: 1.4; font-weight: 700; font-style: normal; }
.cf-ja-cardwrap { position: relative; box-sizing: content-box; max-width: 760px; margin: calc(-1 * clamp(88px, 10vw, 128px)) auto 0; padding: 0 var(--ja-gutter); }
.cf-ja-card { position: relative; margin: 0; background: var(--ja-card); color: var(--ja-ink); border: 1px solid var(--card-border, oklch(from var(--ja-ink) l c h / 0.12)); border-radius: var(--ja-card-radius); box-shadow: var(--card-shadow, var(--shadow-lg, 0 2px 4px oklch(from var(--ja-shadow) l c h / 0.22), 0 12px 24px -8px oklch(from var(--ja-shadow) l c h / 0.32))); padding: clamp(20px, 3vw, 32px); }
.cf-ja-fs { border: 0; margin: 0; padding: 0; min-width: 0; }
.cf-ja-progress { display: grid; gap: 12px; margin-bottom: 24px; }
.cf-ja-count { margin: 0; font-size: 0.9375rem; line-height: 1.4; font-weight: 700; color: var(--ja-muted); font-variant-numeric: tabular-nums; }
.cf-ja-bar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.cf-ja-seg { display: block; height: 6px; border-radius: 999px; overflow: hidden; background: color-mix(in oklch, var(--ja-ink) 10%, var(--ja-card)); }
.cf-ja-segfill { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--ja-fill); transform-origin: left center; }
.cf-ja-trans { list-style: none; margin: 0 0 24px; padding: 6px; display: grid; gap: 2px; background: var(--ja-well); border-radius: 10px; }
.cf-ja-trow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-radius: min(var(--button-radius, var(--radius, 8px)), 8px); background: transparent; font: inherit; text-align: left; color: var(--ja-ink); cursor: pointer; transition: background-color .16s ease; }
.cf-ja-trow:hover { background: color-mix(in oklch, var(--ja-ink) 7%, var(--ja-card)); }
.cf-ja-trow:focus-visible { outline: 3px solid oklch(from var(--ja-focus) l c h / 0.5); outline-offset: 1px; }
.cf-ja-tans { font-size: 0.9375rem; line-height: 1.4; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-ja-tedit { font-size: 0.9375rem; font-weight: 700; color: var(--ja-link); text-decoration: underline; text-decoration-color: oklch(from var(--ja-link) l c h / 0.45); text-underline-offset: 0.18em; }
.cf-ja-trow:hover .cf-ja-tedit { color: oklch(from var(--ja-link) calc(l - 0.08) c h); text-decoration-color: currentColor; }
.cf-ja-badge { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; background: var(--ja-success); color: var(--success-ink, #fff); flex: 0 0 auto; }
.cf-ja-badge--sm { width: 18px; height: 18px; vertical-align: -0.22em; margin-inline-end: 0.4em; }
.cf-ja-qhead { display: flex; align-items: flex-start; gap: 16px; }
.cf-ja-avatar { flex: 0 0 auto; width: 64px; height: 64px; object-fit: contain; object-position: center bottom; border-radius: 0; -webkit-mask-image: linear-gradient(to bottom, oklch(from var(--ja-ink) l c h / 1) 72%, oklch(from var(--ja-ink) l c h / 0) 100%); mask-image: linear-gradient(to bottom, oklch(from var(--ja-ink) l c h / 1) 72%, oklch(from var(--ja-ink) l c h / 0) 100%); filter: drop-shadow(0 1px 2px oklch(from var(--ja-shadow) l c h / 0.22)); }
.cf-ja-qtext { min-width: 0; padding-top: 4px; }
.cf-ja-question { margin: 0; font-family: var(--font-display, inherit); 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(--ja-ink); }
.cf-ja-question:focus { outline: none; }
.cf-ja-hint { margin: 8px 0 0; font-size: 0.9375rem; line-height: 1.4; font-weight: 500; color: var(--ja-muted); text-wrap: pretty; }
.cf-ja-body { margin-top: 24px; }
.cf-ja-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; }
.cf-ja-stack { display: grid; gap: 24px; }
.cf-ja-field { display: grid; gap: 8px; min-width: 0; align-content: start; }
.cf-ja-field.is-wide { grid-column: 1 / -1; }
.cf-ja-label { display: block; padding: 0; font-size: 1rem; line-height: 1.3; font-weight: 700; color: var(--label-ink, var(--ja-ink)); }
.cf-ja-opt { font-weight: 500; color: var(--ja-muted); }
.cf-ja-input { display: block; width: 100%; height: 56px; margin: 0; padding: 0 16px; font: inherit; font-size: 1.0625rem; line-height: 1.3; color: var(--field-ink, oklch(0.21 0.034 263)); background: var(--field, #fff); border: 1px solid var(--field-border, color-mix(in oklch, var(--ink, oklch(0.21 0.034 263)) 22%, transparent)); border-radius: var(--field-radius, var(--radius, 12px)); box-shadow: inset 0 1px 2px oklch(from var(--ja-shadow) l c h / 0.08); -webkit-appearance: none; appearance: none; transition: border-color .16s ease, box-shadow .16s ease; }
.cf-ja-input::placeholder { color: color-mix(in oklch, var(--ja-field-ink) 65%, var(--ja-field)); opacity: 1; }
.cf-ja-input:hover { border-color: color-mix(in oklch, var(--ja-ink) 40%, transparent); }
.cf-ja-input:focus { outline: none; border-color: var(--field-focus, var(--accent, oklch(0.5 0.17 257))); box-shadow: var(--ja-ring); }
.cf-ja-input[aria-invalid=true] { border-color: var(--ja-danger); }
.cf-ja-input[aria-invalid=true]:focus { box-shadow: 0 0 0 3px oklch(from var(--ja-danger) l c h / 0.3); }
.cf-ja-input:disabled { cursor: not-allowed; opacity: 0.7; }
.cf-ja-area { height: auto; min-height: 148px; padding: 14px 16px; line-height: 1.5; resize: vertical; }
.cf-ja-select { position: relative; }
.cf-ja-select .cf-ja-input { padding-right: 48px; cursor: pointer; }
.cf-ja-select .cf-ja-input:invalid { color: color-mix(in oklch, var(--ja-field-ink) 65%, var(--ja-field)); }
.cf-ja-select option { color: var(--ja-field-ink); background: var(--ja-field); }
.cf-ja-chev { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--ja-field-ink); pointer-events: none; }
.cf-ja-err { margin: 0; font-size: 0.9375rem; line-height: 1.4; font-weight: 600; color: var(--ja-danger); text-wrap: pretty; }
.cf-ja-erricon { display: inline-block; vertical-align: -0.18em; margin-inline-end: 0.4em; }
.cf-ja-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cf-ja-counter { margin: 0 0 0 auto; font-size: 0.9375rem; line-height: 1.4; font-weight: 600; color: var(--ja-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cf-ja-counter.is-met { color: var(--ja-success); }
.cf-ja-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; accent-color: var(--field-focus, var(--accent, oklch(0.5 0.17 257))); }
.cf-ja-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.cf-ja-tile { position: relative; display: grid; align-content: start; gap: 4px; min-height: 96px; padding: 16px 16px 16px 52px; background: var(--ja-card); border: 1px solid oklch(from var(--ja-ink) l c h / 0.16); border-radius: var(--ja-field-radius); cursor: pointer; transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.cf-ja-tile:hover { border-color: oklch(from var(--ja-ink) l c h / 0.34); transform: translateY(-1px); }
.cf-ja-tile.is-on { background: var(--ja-pick); border-color: var(--ja-accent); box-shadow: var(--shadow-md, 0 1px 2px oklch(from var(--ja-shadow) l c h / 0.22), 0 4px 10px -2px oklch(from var(--ja-shadow) l c h / 0.2)); }
.cf-ja-tile:has(.cf-ja-sr:focus-visible) { outline: 3px solid oklch(from var(--ja-focus) l c h / 0.5); outline-offset: 2px; }
.cf-ja-tiles.is-bad .cf-ja-tile { border-color: oklch(from var(--ja-danger) l c h / 0.6); }
.cf-ja-dot { position: absolute; left: 16px; top: 17px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 999px; border: 2px solid oklch(from var(--ja-ink) l c h / 0.32); background: var(--ja-field); color: var(--ja-fill-ink); transition: background-color .16s ease, border-color .16s ease; }
.cf-ja-tile.is-on .cf-ja-dot { background: var(--ja-fill); border-color: var(--ja-fill); }
.cf-ja-ttl { font-size: 1.0625rem; line-height: 1.3; font-weight: 800; color: var(--ja-ink); }
.cf-ja-tdet { font-size: 0.9375rem; line-height: 1.4; color: var(--ja-muted); text-wrap: pretty; }
.cf-ja-tile.is-on .cf-ja-tdet { color: var(--ja-ink); }
.cf-ja-group { border: 0; margin: 0; padding: 0; min-width: 0; }
.cf-ja-legend { margin: 0 0 10px; }
.cf-ja-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cf-ja-group .cf-ja-err { margin-top: 8px; }
.cf-ja-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 18px; border-radius: 999px; background: var(--ja-well); border: 1px solid oklch(from var(--ja-ink) l c h / 0.14); font-size: 1rem; line-height: 1.2; font-weight: 700; color: var(--ja-ink); cursor: pointer; transition: background-color .16s ease, border-color .16s ease; }
.cf-ja-chip:hover { background: color-mix(in oklch, var(--ja-ink) 7%, var(--ja-card)); border-color: oklch(from var(--ja-ink) l c h / 0.34); }
.cf-ja-chip.is-on { background: var(--ja-pick); border-color: var(--ja-accent); }
.cf-ja-chip:has(.cf-ja-sr:focus-visible) { outline: 3px solid oklch(from var(--ja-focus) l c h / 0.5); outline-offset: 2px; }
.cf-ja-group.is-bad .cf-ja-chip:not(.is-on) { border-color: oklch(from var(--ja-danger) l c h / 0.6); }
.cf-ja-chipcheck { color: var(--ja-accent); }
.cf-ja-drop { position: relative; display: grid; justify-items: center; text-align: center; gap: 8px; padding: 32px 20px; border: 1.5px solid oklch(from var(--ja-ink) l c h / 0.2); border-radius: var(--ja-card-radius); background: var(--ja-well); cursor: pointer; transition: background-color .16s ease, border-color .16s ease; }
.cf-ja-drop:hover { border-color: oklch(from var(--ja-ink) l c h / 0.38); }
.cf-ja-drop.is-over { background: var(--ja-pick); border-color: var(--ja-accent); }
.cf-ja-drop.is-bad { border-color: var(--ja-danger); }
.cf-ja-drop:has(.cf-ja-sr:focus-visible) { outline: 3px solid oklch(from var(--ja-focus) l c h / 0.5); outline-offset: 2px; }
.cf-ja-disc { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; background: var(--ja-fill); color: var(--ja-fill-ink); flex: 0 0 auto; }
.cf-ja-disc--lg { width: 56px; height: 56px; margin-bottom: 4px; }
.cf-ja-droptitle { font-family: var(--font-display, inherit); font-weight: var(--display-weight, 800); font-size: clamp(1.3125rem, 1.8vw, 1.625rem); line-height: 1.15; letter-spacing: -0.01em; color: var(--ja-ink); text-wrap: balance; }
.cf-ja-dropor { display: inline-flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; font-size: 1rem; color: var(--ja-muted); }
.cf-ja-fake { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: var(--ja-btn-radius); border: 1px solid var(--button-2-border, transparent); background: var(--ja-2); color: var(--button-2-ink, var(--secondary-ink, oklch(0.21 0.034 263))); font-family: var(--button-font, var(--font-display, inherit)); font-weight: var(--button-weight, 800); text-transform: var(--button-case, none); box-shadow: var(--button-2-shadow, var(--shadow-sm, 0 1px 2px oklch(from var(--ja-shadow) l c h / 0.2))); transition: background-color .16s ease; }
.cf-ja-drop:hover .cf-ja-fake { background: oklch(from var(--ja-2) calc(l - 0.04) c h); }
.cf-ja-dropnote { font-size: 0.9375rem; line-height: 1.4; font-weight: 500; color: var(--ja-muted); }
.cf-ja-file { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 16px; border-radius: var(--ja-card-radius); background: var(--ja-well); border: 1px solid oklch(from var(--ja-ink) l c h / 0.1); }
.cf-ja-fmeta { display: grid; gap: 4px; min-width: 0; }
.cf-ja-fname { font-size: 1.0625rem; line-height: 1.3; font-weight: 800; color: var(--ja-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-ja-fsub { font-size: 0.9375rem; line-height: 1.4; font-weight: 600; color: var(--ja-ink); }
.cf-ja-iconbtn { --ja-ib-bg: var(--button-2-bg, var(--secondary, oklch(0.93 0.015 263))); --ja-ib-ink: var(--button-2-ink, var(--secondary-ink, oklch(0.21 0.034 263))); display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--ja-muted); cursor: pointer; transition: background-color .16s ease, color .16s ease; }
.cf-ja-iconbtn:hover { background: var(--ja-ib-bg); color: var(--ja-ib-ink); }
.cf-ja-iconbtn:focus-visible { outline: 3px solid oklch(from var(--ja-focus) l c h / 0.5); outline-offset: 2px; }
.cf-ja-review { margin: 0; display: grid; }
.cf-ja-rrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; row-gap: 6px; padding: 18px 0; border-bottom: 1px solid var(--ja-line); }
.cf-ja-rrow:first-child { padding-top: 0; }
.cf-ja-rrow--final { border-bottom: 0; padding-bottom: 0; }
.cf-ja-rq { grid-column: 1; margin: 0; font-size: 1.0625rem; line-height: 1.35; font-weight: 800; color: var(--ja-ink); text-wrap: balance; }
.cf-ja-rnum { margin-inline-end: 0.5em; font-family: var(--font-display, inherit); font-variant-numeric: tabular-nums; color: var(--ja-accent); }
.cf-ja-ra { grid-column: 1; margin: 0; font-size: 1.0625rem; line-height: 1.5; color: var(--ja-ink); white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.cf-ja-rrow--final .cf-ja-ra { grid-column: 1 / -1; display: grid; gap: 8px; margin-top: 10px; white-space: normal; overflow: visible; -webkit-line-clamp: unset; }
.cf-ja-redit { grid-column: 2; grid-row: 1 / span 2; margin: 0; align-self: start; }
.cf-ja-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: -10px -10px 0 0; padding: 0 10px; border: 0; border-radius: min(var(--button-radius, var(--radius, 8px)), 8px); background: transparent; font: inherit; font-size: 0.9375rem; font-weight: 700; color: var(--ja-link); text-decoration: underline; text-decoration-color: oklch(from var(--ja-link) l c h / 0.45); text-underline-offset: 0.18em; cursor: pointer; }
.cf-ja-link:hover { color: oklch(from var(--ja-link) calc(l - 0.08) c h); text-decoration-color: currentColor; }
.cf-ja-link:focus-visible { outline: 3px solid oklch(from var(--ja-focus) l c h / 0.5); outline-offset: 1px; }
.cf-ja-confirm { position: relative; display: flex; align-items: flex-start; gap: 12px; font-size: 1rem; line-height: 1.45; font-weight: 500; color: var(--ja-ink); cursor: pointer; text-wrap: pretty; }
.cf-ja-box { flex: 0 0 auto; display: grid; place-items: center; width: 24px; height: 24px; margin-top: 1px; border-radius: 6px; border: 2px solid oklch(from var(--ja-ink) l c h / 0.35); background: var(--field, var(--card, #fff)); color: var(--accent-fill-ink, var(--card, #fff)); transition: background-color .16s ease, border-color .16s ease; }
.cf-ja-confirm.is-on .cf-ja-box { background: var(--accent-fill, var(--accent, oklch(0.5 0.17 257))); border-color: var(--accent-fill, var(--accent, oklch(0.5 0.17 257))); color: var(--accent-fill-ink, var(--card, #fff)); }
.cf-ja-confirm.is-bad .cf-ja-box { border-color: var(--ja-danger); }
.cf-ja-confirm:has(.cf-ja-sr:focus-visible) .cf-ja-box { outline: 3px solid oklch(from var(--ja-focus) l c h / 0.5); outline-offset: 2px; }
.cf-ja-nav { display: flex; align-items: stretch; gap: 12px; margin-top: 32px; }
.cf-ja-nav .cf-ja-btn { margin-left: auto; min-width: min(100%, 240px); }
.cf-ja-nav--step { align-items: center; gap: 12px 16px; padding-top: 24px; border-top: 1px solid var(--ja-line); }
.cf-ja-nav--step .cf-ja-btn2, .cf-ja-nav--step .cf-ja-btn { align-self: stretch; }
.cf-ja-up + .cf-ja-btn2 { margin-left: auto; }
.cf-ja-up + .cf-ja-btn2 + .cf-ja-btn { margin-left: 0; }
.cf-ja-nav--final { margin-top: 16px; }
.cf-ja-nav--final .cf-ja-btn { flex: 1; margin-left: 0; }
.cf-ja-up { flex: 1 1 0; min-width: 0; max-width: 40ch; margin: 0; font-size: 0.9375rem; line-height: 1.4; font-weight: 500; color: var(--ja-muted); text-align: left; text-wrap: balance; }
.cf-ja-btn { -webkit-appearance: none; appearance: none; border: 0; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; padding: 0 28px; border-radius: var(--ja-btn-radius); font-family: var(--button-font, var(--font-display, inherit)); 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; color: var(--ja-btn-ink); text-shadow: var(--button-text-shadow, none); text-align: center; white-space: nowrap; cursor: pointer; background: linear-gradient(oklch(from var(--ja-btn) calc(l + 0.04) c h), oklch(from var(--ja-btn-2) calc(l - 0.02) c h)); box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--ja-btn) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--ja-btn) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--ja-shadow) l c h / 0.3), 0 8px 16px -6px oklch(from var(--ja-shadow) l c h / 0.45)); transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.cf-ja-btn:hover:not(:disabled), .cf-ja-btn.is-hover:not(:disabled) { background: linear-gradient(oklch(from var(--ja-btn) calc(l - 0.01) c h), oklch(from var(--ja-btn-2) calc(l - 0.07) c h)); transform: translateY(-1px); box-shadow: inset 0 1px 0 oklch(from var(--ja-btn) calc(l + 0.1) c h / 0.6), inset 0 -3px 0 oklch(from var(--ja-btn) calc(l - 0.2) c h), 0 1px 2px oklch(from var(--ja-shadow) l c h / 0.34), 0 10px 18px -6px oklch(from var(--ja-shadow) l c h / 0.5); }
.cf-ja-btn:active:not(:disabled), .cf-ja-btn.is-active:not(:disabled) { transform: translateY(1px); background: linear-gradient(oklch(from var(--ja-btn) calc(l - 0.05) c h), oklch(from var(--ja-btn-2) calc(l - 0.08) c h)); box-shadow: inset 0 2px 4px oklch(from var(--ja-btn) calc(l - 0.22) c h / 0.55), inset 0 -2px 0 oklch(from var(--ja-btn) calc(l - 0.18) c h), 0 1px 1px oklch(from var(--ja-shadow) l c h / 0.3); }
.cf-ja-btn:focus-visible { outline: 3px solid oklch(from var(--ja-focus) l c h / 0.55); outline-offset: 3px; }
.cf-ja-btn:disabled { cursor: not-allowed; opacity: 0.55; box-shadow: none; }
.cf-ja-btn[aria-busy=true] { cursor: progress; opacity: 0.9; }
.cf-ja-btn--big { min-height: 72px; padding: 12px 28px; }
.cf-ja-btnmain { display: inline-flex; align-items: center; gap: 10px; }
.cf-ja-btnsub { font-family: var(--font-body, inherit); font-size: 0.9375rem; line-height: 1.3; font-weight: 600; text-transform: none; letter-spacing: 0; }
.cf-ja-btn2 { -webkit-appearance: none; appearance: none; display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 24px; border: 1px solid var(--button-2-border, transparent); border-radius: var(--ja-btn-radius); background: var(--ja-2); color: var(--button-2-ink, var(--secondary-ink, oklch(0.21 0.034 263))); font-family: var(--button-font, var(--font-display, inherit)); 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; white-space: nowrap; cursor: pointer; box-shadow: var(--button-2-shadow, var(--shadow-sm, 0 1px 2px oklch(from var(--ja-shadow) l c h / 0.2))); transition: background-color .16s ease, transform .16s ease; }
.cf-ja-btn2:hover:not(:disabled) { background: oklch(from var(--ja-2) calc(l - 0.04) c h); }
.cf-ja-btn2:active:not(:disabled) { transform: translateY(1px); }
.cf-ja-btn2:focus-visible { outline: 3px solid oklch(from var(--ja-focus) l c h / 0.55); outline-offset: 3px; }
.cf-ja-btn2:disabled { cursor: not-allowed; opacity: 0.55; }
.cf-ja-fs:disabled .cf-ja-tile, .cf-ja-fs:disabled .cf-ja-chip, .cf-ja-fs:disabled .cf-ja-drop, .cf-ja-fs:disabled .cf-ja-confirm, .cf-ja-fs:disabled .cf-ja-trow { cursor: not-allowed; opacity: 0.6; transform: none; }
.cf-ja-spin { animation: cf-ja-spin .8s linear infinite; }
@keyframes cf-ja-spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) {
.cf-ja-grid { grid-template-columns: 1fr; }
.cf-ja-trans { display: none; }
.cf-ja-qhead { gap: 12px; }
.cf-ja-avatar { width: 52px; height: 52px; }
.cf-ja-tile { min-height: 0; }
.cf-ja-drop { padding: 24px 16px; }
.cf-ja-nav .cf-ja-btn2 { padding: 0 18px; }
.cf-ja-nav .cf-ja-btn { flex: 1; min-width: 0; padding: 0 18px; }
.cf-ja-nav--final { flex-direction: column-reverse; }
.cf-ja-nav--final .cf-ja-btn { padding: 12px 18px; }
.cf-ja-nav--step { flex-wrap: wrap; padding-top: 20px; }
.cf-ja-up { order: 3; flex: 1 1 100%; max-width: none; text-align: left; text-wrap: pretty; }
.cf-ja-up + .cf-ja-btn2 { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
.cf-ja *, .cf-ja *::before, .cf-ja *::after { transition-duration: 0s; animation: none; }
.cf-ja-tile:hover, .cf-ja-btn:hover:not(:disabled), .cf-ja-btn.is-hover:not(:disabled) { transform: none; }
}
`;
pieces/forms/job-application/specimen.tsx 30 lines
import __studioImagecebfe6f4 from "../assets/6de2ddb0e92cfcd9.webp";
import React from 'react';
import { JobApplication } from '../job-application';
import defaults from '../../studio-defaults.json';
import { slot } from '../../slots';
export const states = ['default', 'hover', 'active', 'disabled', 'error'] as const;
export default function JobApplicationSpecimen({ state = 'default' }: { state?: (typeof states)[number] }) {
const sample = defaults.sample;
return (
<JobApplication
state={state}
headline='Apply to the Funnel Starter team in five short answers'
emphasis='five short answers'
lead={`Join the small team behind ${sample.name}. No cover letter, no account: tell us who you are, what you’ve built and when you can start.`}
aside='(I know, five questions feels too short. One honest answer tells me more than a cover letter ever has.)'
presenterImage={slot('presenter-cutout', __studioImagecebfe6f4)}
presenterImageAlt='Maya Chen, Head of Talent'
presenterName='Maya Chen'
presenterRole='Head of Talent'
roles={[
{ id: 'copywriter', title: 'Funnel Copywriter', detail: 'Sales pages, emails and offers' },
{ id: 'builder', title: 'Funnel Builder', detail: 'Pages, checkouts and integrations' },
{ id: 'success', title: 'Customer Success Lead', detail: 'Onboarding and support for kit owners' },
]}
onSubmit={() => {}}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalJobApplication |
string |
|
emphasis OptionalJobApplication |
string |
|
lead OptionalJobApplication |
string |
|
aside OptionalJobApplication |
string |
|
presenterImage OptionalJobApplication |
string |
|
presenterImageAlt OptionalJobApplication |
string |
|
presenterName OptionalJobApplication |
string |
|
presenterRole OptionalJobApplication |
string |
|
roles OptionalJobApplication |
JobRole[] |
|
experienceOptions OptionalJobApplication |
string[] |
|
startOptions OptionalJobApplication |
string[] |
|
scheduleOptions OptionalJobApplication |
string[] |
|
dayOptions OptionalJobApplication |
string[] |
|
maxFileMb OptionalJobApplication |
number |
|
minStoryLength OptionalJobApplication |
number |
|
copy OptionalJobApplication |
Partial<JobApplicationCopy> |
|
submitting OptionalJobApplication |
boolean |
|
disabled OptionalJobApplication |
boolean |
|
state OptionalJobApplication |
'default' | 'hover' | 'active' | 'disabled' | 'error' |
|
onSubmit OptionalJobApplication |
(values: JobApplicationValues) => void |
|
onStepChange OptionalJobApplication |
(step: number) => void |
|
className OptionalJobApplication |
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.
--marker- The highlighter colour behind key phrases.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
presenter-cutout- The presenter on a transparent background.
-
6de2ddb0e92cfcd9.webp
image/webp · 226 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB