Job Application 2
Quick-apply hiring block: a sticky role card on a colour block beside one short form whose numbered steps run down a rail, with a tap-to-pick week grid that counts shifts live and one Apply button.
Use it in a prompt
Use forms/job-application-2 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-2.tsx. - Import it and pass your copy and images (Props tab):
import { JobApplication2 } from "@/components/funneldna/forms/job-application-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/job-application-2/component.tsx 1267 lines
// layout: number-rail
// Quick-apply hiring block: a sticky role card on a colour block beside one short form whose numbered steps run down a rail, with a tap-to-pick week grid that counts shifts live and one Apply button.
import React, { useEffect, useId, useRef, useState } from 'react';
import { Briefcase, Check, ChevronDown, CircleAlert, Clock3, FileText, Loader2, MapPin, Plus, Upload, X } from 'lucide-react';
import { Texture } from '../fx/fx';
import concrete from '../fx/textures/concrete';
export type JobApplication2Role = {
id: string;
title: string;
// hourly pay, number only: low end ('17') and optional high end ('21')
payFrom?: string;
payTo?: string;
// line under the pay figure; falls back to copy.payUnit
payUnit?: string;
// the shift pattern, one short line
shifts?: string;
// hours or contract type, one short line
type?: string;
// overrides the block location for this role
location?: string;
// role photo (slot: scene); falls back to sceneImage
image?: string;
imageAlt?: string;
};
export type JobApplication2Day = { id: string; label: string; short: string };
export type JobApplication2Period = { id: string; label: string; hint?: string };
export type JobApplication2Values = {
name: string;
phone: string;
email: string;
// id of the chosen role
role: string;
// chosen shifts as 'dayId:periodId'
availability: string[];
shifts: number;
// kept in memory only; the builder decides where it goes
resume: File | null;
};
export type JobApplication2Copy = typeof DEFAULT_COPY;
type FieldKey = 'name' | 'phone' | 'email' | 'role' | 'shifts' | 'resume';
type Form = Omit<JobApplication2Values, 'shifts' | 'resume'>;
type Touched = Partial<Record<FieldKey, boolean>>;
type Errors = Partial<Record<FieldKey, string>>;
type DemoState = 'default' | 'hover' | 'active' | 'disabled' | 'error';
export type JobApplication2Props = {
// employer name shown on the role card
employer?: string;
location?: string;
roles?: JobApplication2Role[];
days?: JobApplication2Day[];
periods?: JobApplication2Period[];
// slot: scene
sceneImage?: string;
sceneImageAlt?: string;
currency?: string;
// reasons after the no-resume line, numbered inline on the card
reasons?: string[];
// true makes the resume required and hides every no-resume line
resumeRequired?: boolean;
minShifts?: number;
// resume size limit in MB
maxFileMb?: number;
// shifts ticked on load, as 'dayId:periodId'
defaultAvailability?: string[];
// every visible word; templates use {employer}, {roles}, {count}, {min}, {max}, {day}, {period}, {name}, {items}, {n}
copy?: Partial<JobApplication2Copy>;
// shows the sending state on the button
submitting?: boolean;
disabled?: boolean;
state?: DemoState;
// called with validated values; the piece never sends data itself
onSubmit?: (values: JobApplication2Values) => void;
className?: string;
};
export function JobApplication2(props: JobApplication2Props) {
const {
employer = '',
location = '',
roles = DEFAULT_ROLES,
days = DEFAULT_DAYS,
periods = DEFAULT_PERIODS,
sceneImage,
sceneImageAlt = '',
currency = '$',
reasons = DEFAULT_REASONS,
resumeRequired = false,
minShifts = 1,
maxFileMb = 5,
defaultAvailability,
copy,
submitting = false,
disabled: disabledProp = false,
state = 'default',
onSubmit,
className,
} = props;
const c: JobApplication2Copy = {
...DEFAULT_COPY,
...copy,
missing: { ...DEFAULT_COPY.missing, ...copy?.missing },
sample: { ...DEFAULT_COPY.sample, ...copy?.sample },
};
const disabled = disabledProp || state === 'disabled';
const uid = useId();
const id = (key: string) => uid + '-' + key;
const [values, setValues] = useState<Form>(() => seed(state, roles, days, periods, c, defaultAvailability).values);
const [touched, setTouched] = useState<Touched>(() => seed(state, roles, days, periods, c, defaultAvailability).touched);
const [resume, setResume] = useState<File | null>(null);
const [fileError, setFileError] = useState('');
const [drag, setDrag] = useState(false);
const weekUsed = useRef(false);
const first = useRef(true);
useEffect(() => {
if (first.current) {
first.current = false;
return;
}
const s = seed(state, roles, days, periods, c, defaultAvailability);
setValues(s.values);
setTouched(s.touched);
setResume(null);
setFileError('');
weekUsed.current = false;
}, [state]);
const chosen = new Set(values.availability);
const count = values.availability.length;
const errors = validate(values, count, resume, minShifts, resumeRequired, c);
const valid = Object.keys(errors).length === 0;
const show = (key: FieldKey) => (touched[key] ? errors[key] : undefined);
const role = roles.find((r) => r.id === values.role) ?? roles[0];
const others = !values.role ? roles.slice(1).map((r) => r.title) : [];
const photo = role?.image ?? sceneImage;
const photoAlt = role?.image ? role.imageAlt ?? '' : sceneImageAlt;
const where = role?.location ?? location;
const allReasons = [...(resumeRequired ? [] : [c.noResume]), ...reasons].filter(Boolean);
const reasonsTitle = fill(c.reasonsTitle, { count: c.numberWords[allReasons.length - 1] ?? String(allReasons.length) });
const [pre, mark, post] = splitOnce(c.headline, c.emphasis);
const countParts = (count === 1 ? c.weekCountOne : c.weekCount).split('{count}');
const missingItems = (Object.keys(errors) as FieldKey[]).map((k) => c.missing[k]);
const done = {
you: !errors.name && !errors.phone && !errors.email,
role: !errors.role,
week: !errors.shifts,
resume: !!resume,
};
const shiftError = show('shifts');
const resumeError = fileError || show('resume');
let cellIndex = 0;
function set<K extends keyof Form>(key: K, value: Form[K]) {
setValues((p) => ({ ...p, [key]: value }));
}
function blur(key: FieldKey) {
setTouched((t) => (t[key] ? t : { ...t, [key]: true }));
}
function toggle(key: string) {
weekUsed.current = true;
setValues((p) => ({
...p,
availability: p.availability.includes(key) ? p.availability.filter((k) => k !== key) : [...p.availability, key],
}));
}
function weekBlur(e: React.FocusEvent<HTMLDivElement>) {
if (weekUsed.current && !e.currentTarget.contains(e.relatedTarget as Node | null)) blur('shifts');
}
function takeFile(file: File | undefined) {
if (!file) return;
const ext = file.name.split('.').pop()?.toLowerCase() ?? '';
if (!FILE_TYPES.includes(ext)) {
setFileError(c.errFileType);
return;
}
if (file.size > maxFileMb * 1024 * 1024) {
setFileError(fill(c.errFileSize, { max: String(maxFileMb) }));
return;
}
setFileError('');
setResume(file);
blur('resume');
}
function submit(e: React.FormEvent<HTMLFormElement>) {
e.preventDefault();
if (disabled || submitting) return;
if (!valid) {
setTouched({ name: true, phone: true, email: true, role: true, shifts: true, resume: true });
const firstKey = (Object.keys(errors) as FieldKey[])[0];
const target = document.getElementById(firstKey === 'shifts' ? id('cell-0') : id(firstKey));
target?.focus();
return;
}
onSubmit?.({ ...values, shifts: count, resume });
}
return (
<section className={'cf-ja2' + (className ? ' ' + className : '')} aria-labelledby={id('title')}>
<style>{CSS}</style>
<div className='cf-ja2__block' aria-hidden='true'>
<Texture src={concrete} tone='band-ink' />
</div>
<div className='cf-ja2__wrap'>
<div className='cf-ja2__main'>
<h2 id={id('title')} className='cf-ja2__h cf-ja2__rise'>
{pre}
{mark ? <span className='cf-ja2__mark'>{nobr(mark)}</span> : null}
{post}
</h2>
<p className='cf-ja2__lead cf-ja2__rise' style={vars({ '--i': '1' })}>{c.lead}</p>
<form className='cf-ja2__form' noValidate onSubmit={submit} aria-busy={submitting || undefined}>
<fieldset className='cf-ja2__fs' disabled={disabled}>
<Step n={1} i={2} titleId={id('s1')} title={c.stepYou} done={done.you} doneLabel={c.done}>
<div className='cf-ja2__fields'>
<TextField
full
id={id('name')}
name='name'
type='text'
autoComplete='name'
label={c.nameLabel}
placeholder={c.namePlaceholder}
value={values.name}
error={show('name')}
ok={!!touched.name && !errors.name}
onChange={(v) => set('name', v)}
onBlur={() => blur('name')}
/>
<TextField
id={id('phone')}
name='phone'
type='tel'
inputMode='tel'
autoComplete='tel'
label={c.phoneLabel}
placeholder={c.phonePlaceholder}
value={values.phone}
error={show('phone')}
ok={!!touched.phone && !errors.phone}
onChange={(v) => set('phone', v)}
onBlur={() => blur('phone')}
/>
<TextField
id={id('email')}
name='email'
type='email'
inputMode='email'
autoComplete='email'
label={c.emailLabel}
placeholder={c.emailPlaceholder}
value={values.email}
error={show('email')}
ok={!!touched.email && !errors.email}
onChange={(v) => set('email', v)}
onBlur={() => blur('email')}
/>
</div>
</Step>
<Step n={2} i={3} titleId={id('s2')} title={c.stepRole} done={done.role} doneLabel={c.done}>
<div className='cf-ja2__field'>
<label className='cf-ja2__label' htmlFor={id('role')}>{c.roleLabel}</label>
<div className='cf-ja2__control'>
<select
id={id('role')}
name='role'
className={'cf-ja2__input cf-ja2__select' + (values.role ? '' : ' is-empty')}
value={values.role}
aria-required='true'
aria-invalid={show('role') ? true : undefined}
aria-describedby={show('role') ? id('role-err') : undefined}
onChange={(e) => set('role', e.target.value)}
onBlur={() => blur('role')}
>
<option value='' disabled>{c.rolePlaceholder}</option>
{roles.map((r) => (
<option key={r.id} value={r.id}>{r.title}</option>
))}
</select>
<ChevronDown className='cf-ja2__chev' size={20} strokeWidth={2.5} aria-hidden='true' />
</div>
{show('role') ? (
<p id={id('role-err')} className='cf-ja2__err'>
<CircleAlert size={16} strokeWidth={2.5} aria-hidden='true' />
{show('role')}
</p>
) : null}
</div>
</Step>
<Step n={3} i={4} titleId={id('s3')} title={c.stepWeek} done={done.week} doneLabel={c.done}>
<div className='cf-ja2__weekbar'>
<p className='cf-ja2__count' id={id('count')} aria-live='polite'>
{countParts[0]}
<span key={count} className='cf-ja2__count-num'>{count}</span>
{countParts[1]}
</p>
<p className='cf-ja2__weekhint'>{c.weekHint}</p>
</div>
<div className={'cf-ja2__week' + (shiftError ? ' is-error' : '')} onBlur={weekBlur}>
<div
className='cf-ja2__grid'
role='group'
aria-labelledby={id('s3')}
aria-describedby={id('count') + (shiftError ? ' ' + id('shifts-err') : '')}
style={vars({ '--days': String(days.length), '--periods': String(periods.length) })}
>
{periods.map((p, pi) => (
<span key={p.id} className='cf-ja2__ph' aria-hidden='true' style={vars({ '--p': String(pi + 2) })}>
<span>{p.label}</span>
{p.hint ? <small>{p.hint}</small> : null}
</span>
))}
{days.map((d, di) => (
<React.Fragment key={d.id}>
<span className='cf-ja2__dh' aria-hidden='true' style={vars({ '--d': String(di + 2) })}>{d.short}</span>
{periods.map((p, pi) => {
const k = d.id + ':' + p.id;
const on = chosen.has(k);
const cid = id('cell-' + cellIndex++);
return (
<button
key={k}
id={cid}
type='button'
className={'cf-ja2__cell' + (on ? ' is-on' : '')}
style={vars({ '--d': String(di + 2), '--p': String(pi + 2) })}
aria-pressed={on}
aria-label={fill(c.cellLabel, { day: d.label, period: p.label })}
onClick={() => toggle(k)}
>
{on ? (
<Check size={20} strokeWidth={2.5} aria-hidden='true' />
) : (
<Plus className='cf-ja2__plus' size={20} strokeWidth={2.5} aria-hidden='true' />
)}
</button>
);
})}
</React.Fragment>
))}
</div>
</div>
{shiftError ? (
<p id={id('shifts-err')} className='cf-ja2__err'>
<CircleAlert size={16} strokeWidth={2.5} aria-hidden='true' />
{shiftError}
</p>
) : null}
</Step>
<Step
n={4}
i={5}
last
titleId={id('s4')}
title={resumeRequired ? c.stepResumeRequired : c.stepResume}
chip={resumeRequired ? undefined : c.optional}
done={done.resume}
doneLabel={c.done}
>
{!resumeRequired ? <p className='cf-ja2__noresume'>{c.uploadNoResume}</p> : null}
{resume ? (
<div className='cf-ja2__file'>
<FileText size={20} strokeWidth={2.5} aria-hidden='true' />
<span className='cf-ja2__file-name'>{resume.name}</span>
<span className='cf-ja2__file-size'>{fileSize(resume.size, c)}</span>
<button
type='button'
className='cf-ja2__remove'
aria-label={fill(c.remove, { name: resume.name })}
onClick={() => setResume(null)}
>
<X size={18} strokeWidth={2.5} aria-hidden='true' />
</button>
</div>
) : (
<label
className={'cf-ja2__drop' + (drag ? ' is-drag' : '')}
htmlFor={id('resume')}
onDragOver={(e) => {
e.preventDefault();
if (!disabled) setDrag(true);
}}
onDragLeave={() => setDrag(false)}
onDrop={(e) => {
e.preventDefault();
setDrag(false);
if (!disabled) takeFile(e.dataTransfer.files[0]);
}}
>
<span className='cf-ja2__drop-icon' aria-hidden='true'>
<Upload size={20} strokeWidth={2.5} />
</span>
<span className='cf-ja2__drop-text'>
<strong>{c.uploadTitle}</strong>
<span>{fill(c.uploadHint, { max: String(maxFileMb) })}</span>
</span>
<input
id={id('resume')}
name='resume'
type='file'
className='cf-ja2__sr'
accept={FILE_ACCEPT}
aria-invalid={resumeError ? true : undefined}
aria-describedby={resumeError ? id('resume-err') : undefined}
onChange={(e) => {
takeFile(e.target.files?.[0]);
e.target.value = '';
}}
/>
</label>
)}
{resumeError ? (
<p id={id('resume-err')} className='cf-ja2__err' role='alert'>
<CircleAlert size={16} strokeWidth={2.5} aria-hidden='true' />
{resumeError}
</p>
) : null}
</Step>
<div className='cf-ja2__action cf-ja2__rise' style={vars({ '--i': '6' })}>
<p className='cf-ja2__instruction'>{c.instruction}</p>
<button
type='submit'
className={
'cf-ja2__submit' +
(state === 'hover' ? ' is-hover' : '') +
(state === 'active' ? ' is-active' : '') +
(submitting ? ' is-busy' : '')
}
disabled={disabled || submitting}
aria-describedby={id('note')}
>
{submitting ? (
<>
<Loader2 className='cf-ja2__spin' size={20} strokeWidth={2.5} aria-hidden='true' />
<span>{c.sending}</span>
</>
) : (
<span>{c.submit}</span>
)}
</button>
<p className='cf-ja2__note' id={id('note')}>
{!valid && !disabled ? fill(c.missingLine, { items: missingItems.join(', ') }) : c.note}
</p>
</div>
</fieldset>
</form>
</div>
<aside className='cf-ja2__side' aria-label={c.cardLabel}>
<div className={'cf-ja2__card' + (photo ? '' : ' no-photo')}>
{photo ? (
<div className='cf-ja2__photo'>
<img key={photo} src={photo} alt={photoAlt} width={640} height={400} loading='lazy' decoding='async' />
</div>
) : null}
{photo ? (
<img className='cf-ja2__thumb' src={photo} alt='' width={56} height={56} loading='lazy' decoding='async' />
) : null}
<div className='cf-ja2__head'>
{employer ? <p className='cf-ja2__employer'>{fill(c.employerLine, { employer })}</p> : null}
<h3 className='cf-ja2__title'>{role?.title}</h3>
{others.length ? <p className='cf-ja2__also'>{fill(c.alsoHiring, { roles: others.join(', ') })}</p> : null}
</div>
{role?.payFrom ? (
<div className='cf-ja2__pay'>
<p className='cf-ja2__pay-fig'>
<sup>{currency}</sup>
{role.payFrom}
{role.payTo ? (
<>
<span className='cf-ja2__dash'>–</span>
{role.payTo}
</>
) : null}
</p>
<p className='cf-ja2__pay-unit'>{role.payUnit ?? c.payUnit}</p>
</div>
) : null}
{where || role?.shifts || role?.type ? (
<ul className='cf-ja2__facts'>
{where ? (
<li>
<MapPin size={18} strokeWidth={2.5} aria-hidden='true' />
<span>{where}</span>
</li>
) : null}
{role?.shifts ? (
<li>
<Clock3 size={18} strokeWidth={2.5} aria-hidden='true' />
<span>{role.shifts}</span>
</li>
) : null}
{role?.type ? (
<li>
<Briefcase size={18} strokeWidth={2.5} aria-hidden='true' />
<span>{role.type}</span>
</li>
) : null}
</ul>
) : null}
<div className='cf-ja2__weekcard'>
<div>
<p className='cf-ja2__weekcard-label'>{c.weekCardLabel}</p>
<p className='cf-ja2__weekcard-count'>{fill(count === 1 ? c.weekCardOne : c.weekCard, { count: String(count) })}</p>
</div>
<div className='cf-ja2__mini' aria-hidden='true' style={vars({ '--days': String(days.length) })}>
{days.map((d) => (
<span className='cf-ja2__mini-day' key={d.id}>
{periods.map((p) => (
<i key={p.id} className={chosen.has(d.id + ':' + p.id) ? 'is-on' : undefined} />
))}
<b>{d.short.slice(0, 1)}</b>
</span>
))}
</div>
</div>
{allReasons.length ? (
<div className='cf-ja2__reasons'>
<p className='cf-ja2__reasons-title'>{reasonsTitle}</p>
<ol className='cf-ja2__reasons-list'>
{allReasons.map((r, i) => (
<li key={i}>
<span className='cf-ja2__reason-n'>{i + 1}</span>
{r}
</li>
))}
</ol>
</div>
) : null}
</div>
</aside>
</div>
</section>
);
}
export default JobApplication2;
function Step(props: {
n: number;
i: number;
titleId: string;
title: string;
done: boolean;
doneLabel: string;
chip?: string;
last?: boolean;
children: React.ReactNode;
}) {
return (
<div
role='group'
aria-labelledby={props.titleId}
className={'cf-ja2__step cf-ja2__rise' + (props.done ? ' is-done' : '') + (props.last ? ' is-last' : '')}
style={vars({ '--i': String(props.i) })}
>
<span className='cf-ja2__num' aria-hidden='true'>{props.n}</span>
<div className='cf-ja2__step-head'>
<h3 id={props.titleId} className='cf-ja2__step-title'>{props.title}</h3>
{props.chip ? <span className='cf-ja2__chip'>{props.chip}</span> : null}
{props.done ? (
<span className='cf-ja2__done' role='img' aria-label={props.doneLabel}>
<Check size={15} strokeWidth={3} aria-hidden='true' />
</span>
) : null}
</div>
<div className='cf-ja2__step-body'>{props.children}</div>
</div>
);
}
function TextField(props: {
id: string;
name: string;
type: string;
label: string;
placeholder: string;
autoComplete: string;
inputMode?: React.InputHTMLAttributes<HTMLInputElement>['inputMode'];
value: string;
error?: string;
ok: boolean;
full?: boolean;
onChange: (value: string) => void;
onBlur: () => void;
}) {
const errId = props.id + '-err';
return (
<div className={'cf-ja2__field' + (props.full ? ' cf-ja2__field--full' : '')}>
<label className='cf-ja2__label' htmlFor={props.id}>{props.label}</label>
<div className='cf-ja2__control'>
<input
id={props.id}
name={props.name}
type={props.type}
inputMode={props.inputMode}
autoComplete={props.autoComplete}
placeholder={props.placeholder}
value={props.value}
className='cf-ja2__input'
aria-required='true'
aria-invalid={props.error ? true : undefined}
aria-describedby={props.error ? errId : undefined}
onChange={(e) => props.onChange(e.target.value)}
onBlur={props.onBlur}
/>
{props.ok ? <Check className='cf-ja2__ok' size={18} strokeWidth={2.5} aria-hidden='true' /> : null}
</div>
{props.error ? (
<p id={errId} className='cf-ja2__err'>
<CircleAlert size={16} strokeWidth={2.5} aria-hidden='true' />
{props.error}
</p>
) : null}
</div>
);
}
function seed(
state: DemoState,
roles: JobApplication2Role[],
days: JobApplication2Day[],
periods: JobApplication2Period[],
c: JobApplication2Copy,
initial?: string[],
): { values: Form; touched: Touched } {
const all: Touched = { name: true, phone: true, email: true, role: true, shifts: true };
if (state === 'hover' || state === 'active') {
const picks: string[] = [];
[[0, 0], [2, 1], [4, 2], [5, 0]].forEach(([d, p]) => {
const day = days[d];
const period = periods[p];
if (day && period) picks.push(day.id + ':' + period.id);
});
return {
values: { name: c.sample.name, phone: c.sample.phone, email: c.sample.email, role: roles[0]?.id ?? '', availability: picks },
touched: all,
};
}
if (state === 'error') {
return { values: { name: '', phone: c.sample.badPhone, email: c.sample.badEmail, role: '', availability: [] }, touched: all };
}
return { values: { name: '', phone: '', email: '', role: '', availability: initial ?? [] }, touched: {} };
}
function validate(v: Form, count: number, resume: File | null, minShifts: number, resumeRequired: boolean, c: JobApplication2Copy): Errors {
const e: Errors = {};
if (v.name.trim().length < 2) e.name = c.errName;
const digits = v.phone.replace(/[^0-9]/g, '').length;
if (digits < 10 || digits > 15) e.phone = c.errPhone;
if (!isEmail(v.email.trim())) e.email = c.errEmail;
if (!v.role) e.role = c.errRole;
if (count < minShifts) e.shifts = fill(c.errShifts, { min: String(minShifts) });
if (resumeRequired && !resume) e.resume = c.errResume;
return e;
}
function isEmail(value: string) {
const at = value.indexOf('@');
const dot = value.lastIndexOf('.');
return at > 0 && dot > at + 1 && dot < value.length - 1 && !value.includes(' ') && value.indexOf('@', at + 1) < 0;
}
function fill(template: string, values: Record<string, string>) {
return Object.keys(values).reduce((text, key) => text.split('{' + key + '}').join(values[key]), template);
}
function splitOnce(text: string, phrase: string): [string, string, string] {
const at = phrase ? text.indexOf(phrase) : -1;
if (at < 0) return [text, '', ''];
return [text.slice(0, at), phrase, text.slice(at + phrase.length)];
}
function fileSize(bytes: number, c: JobApplication2Copy) {
if (bytes < 1024 * 1024) return fill(c.sizeKb, { n: String(Math.max(1, Math.round(bytes / 1024))) });
return fill(c.sizeMb, { n: (bytes / (1024 * 1024)).toFixed(1) });
}
// keeps hyphenated words ("two-minute") from splitting across lines
function nobr(text: string) {
return text.split(/(\S*-\S*)/).map((part, i) =>
i % 2 ? (
<span key={i} className='cf-ja2__nobr'>
{part}
</span>
) : (
part
),
);
}
function vars(values: Record<string, string>) {
return values as unknown as React.CSSProperties;
}
const FILE_TYPES = ['pdf', 'doc', 'docx', 'jpg', 'jpeg', 'png', 'heic', 'webp'];
const FILE_ACCEPT = '.pdf,.doc,.docx,.jpg,.jpeg,.png,.heic,.webp';
const DEFAULT_ROLES: JobApplication2Role[] = [{ id: 'team-member', title: 'Team member' }];
const DEFAULT_REASONS = ['Tap the shifts that fit your week.', 'Everything fits on one screen.'];
const DEFAULT_DAYS: JobApplication2Day[] = [
{ id: 'mon', label: 'Monday', short: 'Mon' },
{ id: 'tue', label: 'Tuesday', short: 'Tue' },
{ id: 'wed', label: 'Wednesday', short: 'Wed' },
{ id: 'thu', label: 'Thursday', short: 'Thu' },
{ id: 'fri', label: 'Friday', short: 'Fri' },
{ id: 'sat', label: 'Saturday', short: 'Sat' },
{ id: 'sun', label: 'Sunday', short: 'Sun' },
];
const DEFAULT_PERIODS: JobApplication2Period[] = [
{ id: 'am', label: 'Morning' },
{ id: 'mid', label: 'Afternoon' },
{ id: 'pm', label: 'Evening' },
];
const DEFAULT_COPY = {
headline: 'Your next shift is a two-minute application away',
emphasis: 'two-minute application',
lead: 'Four quick steps on one screen. Tap the shifts that fit your week, then send it.',
cardLabel: 'About the role',
employerLine: '{employer} is hiring',
alsoHiring: 'Also hiring: {roles}',
payUnit: 'per hour',
weekCardLabel: 'Your week so far',
weekCard: '{count} shifts',
weekCardOne: '{count} shift',
reasonsTitle: '{count} reasons this takes two minutes',
numberWords: ['One', 'Two', 'Three', 'Four', 'Five', 'Six'],
noResume: 'No resume needed.',
stepYou: 'Tell us who you are',
stepRole: 'Pick the role you want',
stepWeek: 'Tap the shifts you can work',
stepResume: 'Add a resume if you have one',
stepResumeRequired: 'Add your resume',
optional: 'Optional',
done: 'Step complete',
nameLabel: 'Full name',
namePlaceholder: 'Jordan Lee',
phoneLabel: 'Mobile number',
phonePlaceholder: '(555) 123-4567',
emailLabel: 'Email',
emailPlaceholder: 'you@example.com',
roleLabel: 'Role',
rolePlaceholder: 'Choose your role…',
weekCount: 'Available {count} shifts a week',
weekCountOne: 'Available {count} shift a week',
weekHint: 'Tap a box to add or remove a shift.',
cellLabel: '{day} {period}',
uploadNoResume: 'No resume needed. Add one only if you already have it.',
uploadTitle: 'Drop your resume here or browse',
uploadHint: 'PDF, Word or photo, up to {max} MB',
remove: 'Remove {name}',
sizeKb: '{n} KB',
sizeMb: '{n} MB',
instruction: 'Click the button below to send your application.',
submit: 'Apply now',
sending: 'Sending…',
note: 'No account to create. No cover letter.',
missingLine: 'Still needed: {items}',
missing: {
name: 'your name',
phone: 'a phone number',
email: 'your email',
role: 'a role',
shifts: 'one shift',
resume: 'your resume',
},
errName: 'Please enter your name.',
errPhone: 'Enter a number we can call or text, like (555) 123-4567.',
errEmail: 'Enter an email like you@example.com.',
errRole: 'Choose the role you want.',
errShifts: 'Tap at least {min} shift you can work.',
errResume: 'Add your resume to apply.',
errFileType: 'Use a PDF, Word file or photo.',
errFileSize: 'That file is over {max} MB. Try a smaller one.',
sample: {
name: 'Jordan Lee',
phone: '(555) 201-3344',
email: 'jordan@example.com',
badPhone: '555 01',
badEmail: 'jordan@',
},
};
const CSS = `
.cf-ja2 {
--g: clamp(16px, 5vw, 48px);
--side: 360px;
--gap: clamp(32px, 5vw, 72px);
--rail: 64px;
--numsize: clamp(2.5rem, 4.2vw, 3.75rem);
--sh: var(--shadow, oklch(0.22 0.03 260));
--af: var(--accent-fill, var(--accent, #2563eb));
--hair: oklch(from var(--ink, #1b2333) l c h / 0.14);
position: relative;
isolation: isolate;
overflow: clip;
background: var(--surface, #ffffff);
color: var(--ink, #1b2333);
font-family: var(--font-body, system-ui, sans-serif);
padding: clamp(56px, 8vw, 112px) var(--g) clamp(64px, 8.5vw, 120px);
}
.cf-ja2 *, .cf-ja2 *::before, .cf-ja2 *::after { box-sizing: border-box; }
:where(.cf-ja2) :where(p, h2, h3, ol, ul) { margin: 0; }
.cf-ja2__block {
position: absolute;
top: 0;
bottom: 0;
left: 0;
z-index: -1;
width: calc((100% - min(1120px, 100% - 2 * var(--g))) / 2 + var(--side) + var(--gap) / 2);
overflow: hidden;
background: var(--band, #1d2b4f);
}
.cf-ja2__nobr { white-space: nowrap; }
.cf-ja2__wrap {
max-width: 1120px;
margin: 0 auto;
display: grid;
grid-template-columns: var(--side) minmax(0, 1fr);
column-gap: var(--gap);
align-items: start;
}
.cf-ja2__side { grid-column: 1; grid-row: 1; position: sticky; top: 24px; }
.cf-ja2__main { grid-column: 2; grid-row: 1; min-width: 0; }
.cf-ja2__card {
display: grid;
grid-template-columns: minmax(0, 1fr);
grid-template-areas: 'photo' 'head' 'pay' 'facts' 'week' 'reasons';
background: var(--card, #ffffff);
color: var(--ink, #1b2333);
border: 1px solid var(--card-border, oklch(from var(--ink, #1b2333) l c h / 0.12));
border-radius: var(--card-radius, var(--radius, 14px));
box-shadow: var(--card-shadow, var(--shadow-lg, 0 2px 4px oklch(from var(--sh) l c h / 0.22), 0 12px 24px -8px oklch(from var(--sh) l c h / 0.32)));
padding: clamp(20px, 3vw, 28px);
}
.cf-ja2__photo {
grid-area: photo;
margin-bottom: 20px;
aspect-ratio: 16 / 10;
border-radius: 12px;
overflow: hidden;
background: color-mix(in oklch, var(--ink, #1b2333) 6%, var(--card, #ffffff));
}
.cf-ja2__photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.cf-ja2__thumb { display: none; }
.cf-ja2__head { grid-area: head; min-width: 0; }
.cf-ja2__employer { font-size: 0.9375rem; line-height: 1.4; font-weight: 600; color: var(--muted, #4a5568); margin-bottom: 12px; }
.cf-ja2__title {
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;
}
.cf-ja2__also { margin-top: 8px; font-size: 0.9375rem; line-height: 1.4; font-weight: 600; color: var(--muted, #4a5568); }
.cf-ja2__pay { grid-area: pay; margin-top: 20px; }
.cf-ja2__pay-fig {
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
font-size: var(--numsize);
line-height: 1;
letter-spacing: -0.03em;
font-variant-numeric: lining-nums tabular-nums;
color: var(--ink, #1b2333);
white-space: nowrap;
}
.cf-ja2__pay-fig sup { font-size: 0.42em; line-height: 1; vertical-align: top; position: relative; top: 0.16em; margin-right: 0.06em; }
.cf-ja2__dash { margin: 0 0.04em; }
.cf-ja2__pay-unit { margin-top: 12px; font-size: 0.9375rem; line-height: 1.4; font-weight: 600; color: var(--muted, #4a5568); }
.cf-ja2__facts { grid-area: facts; list-style: none; padding: 0; margin-top: 20px; display: grid; gap: 10px; }
.cf-ja2__facts li { display: flex; align-items: flex-start; gap: 10px; font-size: 1rem; line-height: 1.45; font-weight: 500; text-wrap: pretty; }
.cf-ja2__facts svg { flex: none; margin-top: 2px; color: var(--accent, #2563eb); }
.cf-ja2__weekcard {
grid-area: week;
margin-top: 20px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 14px 16px;
border-radius: 10px;
background: color-mix(in oklch, var(--ink, #1b2333) 4%, var(--card, #ffffff));
}
.cf-ja2__weekcard-label { font-size: 0.9375rem; line-height: 1.4; font-weight: 600; color: var(--muted, #4a5568); white-space: nowrap; }
.cf-ja2__weekcard-count {
margin-top: 4px;
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
font-size: 1.3125rem;
line-height: 1.15;
font-variant-numeric: lining-nums tabular-nums;
}
.cf-ja2__mini { flex: none; display: grid; grid-template-columns: repeat(var(--days, 7), 14px); gap: 3px; }
.cf-ja2__mini-day { display: grid; gap: 3px; justify-items: center; }
.cf-ja2__mini-day i { display: block; width: 14px; height: 7px; border-radius: 3px; background: oklch(from var(--ink, #1b2333) l c h / 0.14); transition: background 0.16s ease; }
.cf-ja2__mini-day i.is-on { background: var(--af); }
.cf-ja2__mini-day b { margin-top: 3px; font-size: 0.875rem; line-height: 1; font-weight: 800; color: var(--muted, #4a5568); }
.cf-ja2__reasons { grid-area: reasons; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--hair); }
.cf-ja2__reasons-title {
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
font-size: 1.0625rem;
line-height: 1.3;
margin-bottom: 8px;
text-wrap: balance;
}
.cf-ja2__reasons-title { margin-bottom: 12px; }
.cf-ja2__reasons-list { list-style: none; padding: 0; display: grid; gap: 8px; font-size: 1rem; line-height: 1.45; text-wrap: pretty; }
.cf-ja2__reasons-list li { display: flex; align-items: baseline; gap: 10px; }
.cf-ja2__reason-n { flex: none; min-width: 1ch; font-family: var(--font-display, inherit); font-weight: 800; color: var(--accent, #2563eb); font-variant-numeric: lining-nums tabular-nums; }
.cf-ja2__h {
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(--ink, #1b2333);
margin-bottom: 16px;
}
.cf-ja2__mark {
background: linear-gradient(180deg, transparent 0 58%, oklch(from var(--marker, #fae37c) l c h / 0.8) 58% 94%, transparent 94%);
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
padding: 0 0.08em;
margin: 0 -0.04em;
border-radius: 0.12em 0.22em 0.14em 0.26em;
}
.cf-ja2__lead {
max-width: 60ch;
margin-bottom: 40px;
font-size: clamp(1.125rem, 1.5vw, 1.375rem);
line-height: 1.4;
font-weight: 500;
color: var(--muted, #4a5568);
text-wrap: pretty;
}
.cf-ja2__fs { border: 0; margin: 0; padding: 0; min-width: 0; }
.cf-ja2__step {
position: relative;
display: grid;
grid-template-columns: var(--rail) minmax(0, 1fr);
grid-template-areas: 'num head' 'num body';
column-gap: 20px;
padding-bottom: 44px;
}
.cf-ja2__step::before {
content: '';
position: absolute;
left: calc(var(--rail) / 2 - 1px);
top: calc(var(--numsize) + 16px);
bottom: 16px;
width: 2px;
border-radius: 2px;
background: var(--hair);
transition: background 0.3s ease;
}
.cf-ja2__step.is-done::before { background: var(--af); }
.cf-ja2__step.is-last::before { display: none; }
.cf-ja2__num {
grid-area: num;
align-self: start;
text-align: center;
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
font-size: var(--numsize);
line-height: 1;
letter-spacing: -0.03em;
font-variant-numeric: lining-nums tabular-nums;
color: var(--accent, #2563eb);
}
.cf-ja2__step-head { grid-area: head; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: var(--numsize); margin-bottom: 16px; }
.cf-ja2__step-title {
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;
}
.cf-ja2__chip {
display: inline-flex;
align-items: center;
min-height: 28px;
padding: 4px 12px;
border-radius: 999px;
background: color-mix(in oklch, var(--ink, #1b2333) 6%, var(--surface, #ffffff));
color: var(--ink, #1b2333);
font-size: 0.875rem;
line-height: 1.2;
font-weight: 800;
}
.cf-ja2__done {
flex: none;
display: inline-grid;
place-items: center;
width: 26px;
height: 26px;
border-radius: 999px;
background: var(--success, #15803d);
color: var(--on-status, #ffffff);
}
.cf-ja2__step-body { grid-area: body; min-width: 0; }
.cf-ja2__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cf-ja2__field--full { grid-column: 1 / -1; }
.cf-ja2__label { display: block; margin-bottom: 8px; font-size: 1rem; line-height: 1.3; font-weight: 700; color: var(--label-ink, var(--ink, #1b2333)); }
.cf-ja2__control { position: relative; }
.cf-ja2__input {
width: 100%;
height: 56px;
padding: 0 44px 0 16px;
font: inherit;
font-size: 1.0625rem;
color: var(--field-ink, #1b2333);
background: var(--field, #ffffff);
border: 1px solid var(--field-border, color-mix(in oklch, var(--ink, #1b2333) 22%, transparent));
border-radius: var(--field-radius, var(--radius, 12px));
outline: none;
appearance: none;
-webkit-appearance: none;
transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.cf-ja2__input::placeholder { color: color-mix(in oklch, var(--field-ink, #1b2333) 65%, var(--field, #ffffff)); opacity: 1; }
.cf-ja2__input:hover:not(:disabled) { border-color: color-mix(in oklch, var(--field-ink, #1b2333) 42%, transparent); }
.cf-ja2__input:focus { border-color: var(--field-focus, var(--accent, #2563eb)); box-shadow: 0 0 0 3px oklch(from var(--field-focus, var(--accent, #2563eb)) l c h / 0.35); }
.cf-ja2__input[aria-invalid='true'] { border-color: var(--danger, #b91c1c); }
.cf-ja2__input[aria-invalid='true']:focus { box-shadow: 0 0 0 3px oklch(from var(--danger, #b91c1c) l c h / 0.3); }
.cf-ja2__input:disabled { cursor: not-allowed; background: color-mix(in oklch, var(--field-ink, #1b2333) 5%, var(--field, #ffffff)); }
.cf-ja2__select { padding-right: 48px; cursor: pointer; }
.cf-ja2__select.is-empty { color: color-mix(in oklch, var(--field-ink, #1b2333) 65%, var(--field, #ffffff)); }
.cf-ja2__select option { color: var(--field-ink, #1b2333); background: var(--field, #ffffff); }
.cf-ja2__chev { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--field-ink, #1b2333); }
.cf-ja2__ok { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--success, #15803d); }
.cf-ja2__err { margin-top: 8px; font-size: 0.9375rem; line-height: 1.4; font-weight: 600; color: var(--danger, #b91c1c); text-wrap: pretty; }
.cf-ja2__err svg { display: inline-block; vertical-align: -0.15em; margin-inline-end: 0.4em; }
.cf-ja2__weekbar { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 16px; margin-bottom: 16px; }
.cf-ja2__count { font-size: 1.0625rem; line-height: 1.3; font-weight: 700; color: var(--ink, #1b2333); }
.cf-ja2__count-num {
display: inline-block;
min-width: 1ch;
margin: 0 0.18em;
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
font-size: 2.5rem;
line-height: 1;
letter-spacing: -0.03em;
font-variant-numeric: lining-nums tabular-nums;
color: var(--accent, #2563eb);
vertical-align: -0.12em;
}
.cf-ja2__weekhint { font-size: 0.9375rem; line-height: 1.4; font-weight: 500; color: var(--muted, #4a5568); }
.cf-ja2__week { container-type: inline-size; }
.cf-ja2__grid { display: grid; grid-template-columns: 112px repeat(var(--days, 7), minmax(0, 1fr)); gap: 6px; }
.cf-ja2__dh { grid-column: var(--d); grid-row: 1; align-self: end; text-align: center; padding-bottom: 4px; font-size: 0.875rem; line-height: 1.2; font-weight: 800; color: var(--muted, #4a5568); }
.cf-ja2__ph { grid-column: 1; grid-row: var(--p); align-self: center; display: grid; gap: 2px; padding-right: 8px; }
.cf-ja2__ph span { font-size: 0.9375rem; line-height: 1.25; font-weight: 700; color: var(--ink, #1b2333); }
.cf-ja2__ph small { font-size: 0.875rem; line-height: 1.25; font-weight: 500; color: var(--muted, #4a5568); }
.cf-ja2__cell {
grid-column: var(--d);
grid-row: var(--p);
min-height: 52px;
display: grid;
place-items: center;
padding: 0;
font: inherit;
border-radius: 10px;
border: 1px solid var(--hair);
background: color-mix(in oklch, var(--ink, #1b2333) 4%, var(--surface, #ffffff));
color: var(--accent-fill-ink, var(--card, #ffffff));
cursor: pointer;
-webkit-tap-highlight-color: transparent;
transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}
.cf-ja2__cell svg { width: 20px; height: 20px; }
.cf-ja2__plus { color: var(--muted, #4a5568); opacity: 0; transition: opacity 0.16s ease; }
.cf-ja2__cell:not(:disabled):hover { background: color-mix(in oklch, var(--ink, #1b2333) 9%, var(--surface, #ffffff)); border-color: oklch(from var(--ink, #1b2333) l c h / 0.3); }
.cf-ja2__cell:not(:disabled):hover .cf-ja2__plus, .cf-ja2__cell:focus-visible .cf-ja2__plus { opacity: 1; }
.cf-ja2__cell:not(:disabled):active { transform: scale(0.95); }
.cf-ja2__cell.is-on {
background: linear-gradient(oklch(from var(--af) calc(l + 0.04) c h), oklch(from var(--af) calc(l - 0.04) c h));
border-color: oklch(from var(--af) calc(l - 0.12) c h);
box-shadow: inset 0 1px 0 oklch(from var(--af) calc(l + 0.14) c h / 0.6), 0 1px 2px oklch(from var(--sh) l c h / 0.3), 0 4px 8px -4px oklch(from var(--sh) l c h / 0.35);
}
.cf-ja2__cell.is-on:not(:disabled):hover {
background: linear-gradient(oklch(from var(--af) calc(l - 0.01) c h), oklch(from var(--af) calc(l - 0.09) c h));
border-color: oklch(from var(--af) calc(l - 0.16) c h);
}
.cf-ja2__cell:focus-visible { outline: 3px solid var(--field-focus, var(--accent, #2563eb)); outline-offset: 2px; }
.cf-ja2__cell:disabled { cursor: not-allowed; }
.cf-ja2__week.is-error .cf-ja2__cell:not(.is-on) { border-color: oklch(from var(--danger, #b91c1c) l c h / 0.55); }
@container (max-width: 540px) {
.cf-ja2__grid { grid-template-columns: 56px repeat(var(--periods, 3), minmax(0, 1fr)); }
.cf-ja2__dh { grid-column: 1; grid-row: var(--d); align-self: center; text-align: left; padding-bottom: 0; font-size: 0.9375rem; color: var(--ink, #1b2333); }
.cf-ja2__ph { grid-column: var(--p); grid-row: 1; align-self: end; text-align: center; padding: 0 0 4px; }
.cf-ja2__cell { grid-column: var(--p); grid-row: var(--d); min-height: 48px; }
}
.cf-ja2__noresume { margin-bottom: 14px; font-size: 1rem; line-height: 1.5; font-weight: 500; color: var(--muted, #4a5568); text-wrap: pretty; }
.cf-ja2__drop {
position: relative;
display: flex;
align-items: center;
gap: 14px;
min-height: 76px;
padding: 14px 16px;
border-radius: var(--field-radius, var(--radius, 12px));
border: 1px solid var(--field-border, color-mix(in oklch, var(--ink, #1b2333) 22%, transparent));
background: color-mix(in oklch, var(--ink, #1b2333) 3%, var(--surface, #ffffff));
cursor: pointer;
transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.cf-ja2__drop:hover { border-color: oklch(from var(--ink, #1b2333) l c h / 0.4); background: color-mix(in oklch, var(--ink, #1b2333) 6%, var(--surface, #ffffff)); }
.cf-ja2__drop.is-drag { border-color: var(--accent, #2563eb); background: color-mix(in oklch, var(--accent, #2563eb) 10%, var(--surface, #ffffff)); }
.cf-ja2__drop:has(input:focus-visible) { border-color: var(--field-focus, var(--accent, #2563eb)); box-shadow: 0 0 0 3px oklch(from var(--field-focus, var(--accent, #2563eb)) l c h / 0.35); }
.cf-ja2__fs:disabled .cf-ja2__drop { cursor: not-allowed; }
.cf-ja2__drop-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; background: var(--af); color: var(--accent-fill-ink, var(--card, #ffffff)); }
.cf-ja2__drop-text { display: grid; gap: 2px; min-width: 0; }
.cf-ja2__drop-text strong { font-size: 1.0625rem; line-height: 1.3; font-weight: 700; color: var(--ink, #1b2333); }
.cf-ja2__drop-text span { font-size: 0.9375rem; line-height: 1.4; color: var(--muted, #4a5568); }
.cf-ja2__sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cf-ja2__file {
display: flex;
align-items: center;
gap: 12px;
min-height: 64px;
padding: 10px 10px 10px 16px;
border-radius: var(--field-radius, var(--radius, 12px));
border: 1px solid var(--hair);
background: color-mix(in oklch, var(--ink, #1b2333) 4%, var(--surface, #ffffff));
}
.cf-ja2__file > svg { flex: none; color: var(--accent, #2563eb); }
.cf-ja2__file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; font-weight: 700; }
.cf-ja2__file-size { flex: none; font-size: 0.9375rem; color: var(--muted, #4a5568); font-variant-numeric: tabular-nums; }
.cf-ja2__remove { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--ink, #1b2333); cursor: pointer; transition: background 0.16s ease; }
.cf-ja2__remove:hover { background: color-mix(in oklch, var(--ink, #1b2333) 8%, var(--surface, #ffffff)); }
.cf-ja2__remove:focus-visible { outline: 3px solid var(--field-focus, var(--accent, #2563eb)); outline-offset: 1px; }
.cf-ja2__action { margin-left: calc(var(--rail) + 20px); text-align: center; }
.cf-ja2__instruction { margin-bottom: 16px; font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.5; font-weight: 600; color: var(--ink, #1b2333); text-wrap: pretty; }
.cf-ja2__submit {
--bb: var(--button-bg, var(--cta, #d4382c));
--bb2: var(--button-bg-2, var(--cta-2, #b02a20));
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
width: 100%;
min-width: 0;
min-height: 72px;
margin: 0 auto;
padding: 0 28px;
border: 0;
border-radius: var(--button-radius, var(--radius, 12px));
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;
color: var(--button-ink, var(--cta-ink, #ffffff));
text-shadow: var(--button-text-shadow, none);
background: linear-gradient(oklch(from var(--bb) calc(l + 0.04) c h), oklch(from var(--bb2) calc(l - 0.02) c h));
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--bb) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--bb) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--sh) l c h / 0.3), 0 8px 16px -6px oklch(from var(--sh) l c h / 0.45));
cursor: pointer;
transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.cf-ja2__submit:not(:disabled):hover, .cf-ja2__submit.is-hover:not(:disabled) {
background: linear-gradient(oklch(from var(--bb) calc(l - 0.01) c h), oklch(from var(--bb2) calc(l - 0.07) c h));
box-shadow: inset 0 1px 0 oklch(from var(--bb) calc(l + 0.1) c h / 0.7), inset 0 -3px 0 oklch(from var(--bb) calc(l - 0.2) c h), 0 1px 2px oklch(from var(--sh) l c h / 0.32), 0 10px 20px -6px oklch(from var(--sh) l c h / 0.5);
}
.cf-ja2__submit:not(:disabled):active, .cf-ja2__submit.is-active:not(:disabled) {
transform: translateY(1px);
background: linear-gradient(oklch(from var(--bb) calc(l - 0.05) c h), oklch(from var(--bb2) calc(l - 0.08) c h));
box-shadow: inset 0 2px 4px oklch(from var(--bb) calc(l - 0.22) c h / 0.55), inset 0 -2px 0 oklch(from var(--bb) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--sh) l c h / 0.3);
}
.cf-ja2__submit:focus-visible { outline: 3px solid var(--field-focus, var(--accent, #2563eb)); outline-offset: 3px; }
.cf-ja2__submit:disabled {
cursor: not-allowed;
background: color-mix(in oklch, var(--ink, #1b2333) 8%, var(--surface, #ffffff));
color: var(--muted, #4a5568);
text-shadow: none;
box-shadow: inset 0 0 0 1px var(--hair);
}
.cf-ja2__submit.is-busy:disabled {
cursor: progress;
color: var(--button-ink, var(--cta-ink, #ffffff));
text-shadow: var(--button-text-shadow, none);
background: linear-gradient(oklch(from var(--bb) calc(l + 0.04) c h), oklch(from var(--bb2) calc(l - 0.02) c h));
box-shadow: inset 0 1px 0 oklch(from var(--bb) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--bb) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--sh) l c h / 0.3);
}
.cf-ja2__note { margin-top: 12px; font-size: 0.9375rem; line-height: 1.4; font-weight: 500; color: var(--muted, #4a5568); text-wrap: pretty; text-align: center; }
@media (max-width: 1100px) {
.cf-ja2 { --side: 320px; }
}
@media (max-width: 900px) {
.cf-ja2 { padding-top: 0; }
.cf-ja2__block { display: none; }
.cf-ja2__wrap { grid-template-columns: minmax(0, 1fr); row-gap: 40px; }
.cf-ja2__side { grid-column: 1; grid-row: 1; position: static; margin: 0 calc(-1 * var(--g)); padding: 20px var(--g) 24px; background: var(--band, #1d2b4f); }
.cf-ja2__main { grid-column: 1; grid-row: 2; }
.cf-ja2__card { grid-template-columns: 56px minmax(0, 1fr); grid-template-areas: 'thumb head' 'pay pay' 'facts facts'; column-gap: 14px; align-items: center; padding: 16px; }
.cf-ja2__card.no-photo { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'head' 'pay' 'facts'; }
.cf-ja2__photo, .cf-ja2__weekcard, .cf-ja2__reasons { display: none; }
.cf-ja2__thumb { display: block; grid-area: thumb; width: 56px; height: 56px; border-radius: 8px; object-fit: cover; }
.cf-ja2__employer { margin-bottom: 8px; }
.cf-ja2__also { margin-top: 4px; }
.cf-ja2__pay { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 14px; }
.cf-ja2__pay-fig { font-size: 2rem; }
.cf-ja2__pay-unit { margin-top: 0; }
.cf-ja2__facts { margin-top: 12px; gap: 8px; }
.cf-ja2__facts li { font-size: 0.9375rem; }
}
@media (max-width: 640px) {
.cf-ja2 { --numsize: 2.5rem; }
.cf-ja2__step { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: 'num head' 'body body'; column-gap: 12px; padding-bottom: 36px; }
.cf-ja2__step::before { display: none; }
.cf-ja2__fields { grid-template-columns: minmax(0, 1fr); }
.cf-ja2__action { margin-left: 0; }
.cf-ja2__submit { width: 100%; min-width: 0; }
}
@keyframes cf-ja2-rise { from { opacity: 0.82; transform: translateY(8px); } }
@keyframes cf-ja2-pop { from { transform: scale(0.9); } }
@keyframes cf-ja2-fade { from { opacity: 0.4; } }
@keyframes cf-ja2-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: no-preference) {
.cf-ja2__rise { animation: cf-ja2-rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: min(calc(var(--i, 0) * 0.07s), 0.28s); }
.cf-ja2__count-num, .cf-ja2__done { animation: cf-ja2-pop 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.cf-ja2__photo img { animation: cf-ja2-fade 0.45s ease both; }
.cf-ja2__spin { animation: cf-ja2-spin 0.8s linear infinite; }
}
@media (prefers-reduced-motion: reduce) {
.cf-ja2 *, .cf-ja2 *::before, .cf-ja2 *::after { transition: none; }
.cf-ja2__cell:not(:disabled):active, .cf-ja2__submit:not(:disabled):active, .cf-ja2__submit.is-active:not(:disabled) { transform: none; }
}
`;
pieces/forms/job-application-2/specimen.tsx 59 lines
import __studioImage03b8d6dd from "../assets/c16e1c445d4562eb.webp";
import __studioImage55c0487c from "../assets/74aa4e9ab6e2c484.webp";
import JobApplication2 from '../job-application-2';
import defaults from '../../studio-defaults.json';
import { slot } from '../../slots';
export const states = ['default', 'hover', 'active', 'disabled', 'error'];
type State = 'default' | 'hover' | 'active' | 'disabled' | 'error';
export default function JobApplication2Specimen({ state = 'default' }: { state?: State }) {
const baristaImage = slot(
'scene',
__studioImage03b8d6dd,
);
const cookImage = slot(
'scene',
__studioImage55c0487c,
);
const [nameField, emailField] = defaults.sample.fields;
return (
<JobApplication2
state={state}
employer='Copperleaf Café'
location='Riverside · 412 Alder Street'
currency='$'
roles={[
{
id: 'barista',
title: 'Barista',
payFrom: '17',
payTo: '21',
payUnit: 'per hour, plus tips',
shifts: 'Opens from 6am, closes by 9pm, weekend shifts open',
type: 'Part-time or full-time',
image: baristaImage,
imageAlt: 'A barista pouring latte art at the espresso machine',
},
{
id: 'line-cook',
title: 'Line cook',
payFrom: '19',
payTo: '24',
payUnit: 'per hour',
shifts: 'Brunch and dinner service, 7am to 10pm',
type: 'Part-time or full-time',
image: cookImage,
imageAlt: 'A line cook plating a brunch dish at the kitchen pass',
},
]}
periods={[
{ id: 'am', label: 'Morning', hint: '6–11am' },
{ id: 'mid', label: 'Afternoon', hint: '11am–4pm' },
{ id: 'pm', label: 'Evening', hint: '4–10pm' },
]}
copy={{ nameLabel: nameField.label, emailLabel: emailField.label }}
/>
);
}
| Name | Type | Details |
|---|---|---|
employer OptionalJobApplication2 |
string |
|
location OptionalJobApplication2 |
string |
|
roles OptionalJobApplication2 |
JobApplication2Role[] |
|
days OptionalJobApplication2 |
JobApplication2Day[] |
|
periods OptionalJobApplication2 |
JobApplication2Period[] |
|
sceneImage OptionalJobApplication2 |
string |
|
sceneImageAlt OptionalJobApplication2 |
string |
|
currency OptionalJobApplication2 |
string |
|
reasons OptionalJobApplication2 |
string[] |
|
resumeRequired OptionalJobApplication2 |
boolean |
|
minShifts OptionalJobApplication2 |
number |
|
maxFileMb OptionalJobApplication2 |
number |
|
defaultAvailability OptionalJobApplication2 |
string[] |
|
copy OptionalJobApplication2 |
Partial<JobApplication2Copy> |
|
submitting OptionalJobApplication2 |
boolean |
|
disabled OptionalJobApplication2 |
boolean |
|
state OptionalJobApplication2 |
DemoState |
|
onSubmit OptionalJobApplication2 |
(values: JobApplication2Values) => void |
|
className OptionalJobApplication2 |
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.
--marker- The highlighter colour behind key phrases.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
scene- A wide atmosphere photo behind or beside the copy.
-
74aa4e9ab6e2c484.webp
image/webp · 48.9 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
c16e1c445d4562eb.webp
image/webp · 39.2 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB
-
f211b3080387e46d.webp
image/webp · 105 KB