Quote Request 1
Local quote request: every answer lands as a line on a live itemised ledger, and the bold free total ends in the one action, so finishing the request feels one step away.
Use it in a prompt
Use forms/quote-request 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/quote-request.tsx. - Import it and pass your copy and images (Props tab):
import { QuoteRequest } from "@/components/funneldna/forms/quote-request"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/quote-request/component.tsx 949 lines
// layout: ledger-receipt
// Local quote request: every answer lands as a line on a live itemised ledger, and the bold free total ends in the one action, so finishing the request feels one step away.
import * as React from "react";
import {
AlertCircle,
CalendarClock,
Check,
Clock,
Droplets,
Fan,
Hammer,
Home,
ImagePlus,
Loader2,
Lock,
Moon,
PaintRoller,
Sparkles,
Sun,
Sunrise,
Trees,
Wrench,
X,
Zap,
} from "lucide-react";
import type { LucideIcon } from "lucide-react";
export type QuoteServiceIcon = "roof" | "plumbing" | "electrical" | "painting" | "landscaping" | "handyman" | "cleaning" | "hvac" | "other";
export type QuoteTimeIcon = "morning" | "afternoon" | "evening" | "any";
export type QuoteService = { id: string; label: string; icon?: QuoteServiceIcon };
export type QuoteContactTime = { id: string; label: string; detail?: string; icon?: QuoteTimeIcon };
/** What onSubmit receives once every required answer is valid. Photos stay in the browser as File objects. */
export type QuoteRequestValues = {
service: string;
details: string;
photos: File[];
postcode: string;
contactTime: string;
name: string;
phone: string;
/** Present only when emailField is on. */
email?: string;
};
/** Every visible word. Placeholders in braces ({count}, {max}, {mb}, {name}, {done}, {total}) are replaced as text. */
export type QuoteRequestCopy = {
serviceTitle: string;
detailsTitle: string;
detailsPlaceholder: string;
detailsCount: string;
photosTitle: string;
photosHint: string;
photosDrop: string;
photosDropHint: string;
photosRemove: string;
photosLimit: string;
photosTooBig: string;
photosNotImage: string;
postcodeTitle: string;
postcodePlaceholder: string;
timeTitle: string;
contactTitle: string;
nameLabel: string;
namePlaceholder: string;
phoneLabel: string;
phonePlaceholder: string;
emailLabel: string;
emailPlaceholder: string;
optional: string;
ledgerTitle: string;
progress: string;
rowService: string;
rowDetails: string;
rowPhotos: string;
rowPostcode: string;
rowTime: string;
rowContact: string;
photosOptional: string;
photosCountOne: string;
photosCountMany: string;
empty: string;
doneSr: string;
todoSr: string;
subtotalLabel: string;
subtotalValue: string;
totalLabel: string;
totalValue: string;
sending: string;
errorService: string;
errorDetails: string;
errorPostcode: string;
errorTime: string;
errorName: string;
errorPhone: string;
errorEmail: string;
errorSummaryOne: string;
errorSummaryMany: string;
};
export type QuoteRequestProps = {
/** The section headline; wrap the key phrase in <span className="cf-qr-mark"> for the marker stroke. */
headline?: React.ReactNode;
/** Short paragraphs under the headline, each opening with a bold lead-in. */
intro?: { lead: string; text: string }[];
services?: QuoteService[];
contactTimes?: QuoteContactTime[];
/** Scene slot: a photo of the work or the visit. Hidden when empty. */
sceneImage?: string;
sceneAlt?: string;
ctaLabel?: string;
/** The business's own response-time promise, shown under the button. Hidden when empty. */
responseTime?: string;
privacy?: string;
detailsMax?: number;
maxPhotos?: number;
maxPhotoMB?: number;
/** Also ask for an email address (required when on), so follow-up emails can reach the requester. Off by default. */
emailField?: boolean;
copy?: Partial<QuoteRequestCopy>;
/** Called with validated values; return a promise to show the sending state until it settles. */
onSubmit?: (values: QuoteRequestValues) => void | PromiseLike<unknown>;
state?: "default" | "hover" | "active" | "disabled" | "error";
className?: string;
};
type FieldKey = "service" | "details" | "postcode" | "time" | "name" | "phone" | "email";
type LocalPhoto = { id: number; file: File; url: string };
export function QuoteRequest(props: QuoteRequestProps) {
const {
headline = DEFAULT_HEADLINE,
intro = DEFAULT_INTRO,
services = DEFAULT_SERVICES,
contactTimes = DEFAULT_TIMES,
sceneImage = "",
sceneAlt = "A tradesperson arriving at a home to look at the job",
ctaLabel = "Get my free quote",
responseTime = "",
privacy = "Your details are only used for this quote.",
detailsMax = 280,
maxPhotos = 5,
maxPhotoMB = 10,
emailField = false,
onSubmit,
state = "default",
className,
} = props;
const c: QuoteRequestCopy = { ...DEFAULT_COPY, ...props.copy };
const uid = React.useId();
const id = (s: string) => `qr${uid}-${s}`;
const [service, setService] = React.useState("");
const [details, setDetails] = React.useState("");
const [postcode, setPostcode] = React.useState("");
const [contactTime, setContactTime] = React.useState("");
const [name, setName] = React.useState("");
const [phone, setPhone] = React.useState("");
const [email, setEmail] = React.useState("");
const [photos, setPhotos] = React.useState<LocalPhoto[]>([]);
const [photoError, setPhotoError] = React.useState("");
const [dragging, setDragging] = React.useState(false);
const [touched, setTouched] = React.useState<Partial<Record<FieldKey, boolean>>>({});
const [submitted, setSubmitted] = React.useState(state === "error");
const [busy, setBusy] = React.useState(false);
const seq = React.useRef(0);
const mounted = React.useRef(true);
const photosRef = React.useRef<LocalPhoto[]>([]);
photosRef.current = photos;
const serviceRef = React.useRef<HTMLInputElement>(null);
const detailsRef = React.useRef<HTMLTextAreaElement>(null);
const postcodeRef = React.useRef<HTMLInputElement>(null);
const timeRef = React.useRef<HTMLInputElement>(null);
const nameRef = React.useRef<HTMLInputElement>(null);
const phoneRef = React.useRef<HTMLInputElement>(null);
const emailRef = React.useRef<HTMLInputElement>(null);
React.useEffect(() => {
setSubmitted(state === "error");
}, [state]);
React.useEffect(() => {
mounted.current = true;
return () => {
mounted.current = false;
photosRef.current.forEach((p) => URL.revokeObjectURL(p.url));
};
}, []);
const disabled = state === "disabled";
const errors = validate({ service, details, postcode, contactTime, name, phone, email }, c, emailField);
const errorKeys = FIELD_ORDER.filter((k) => errors[k]);
const shown = (k: FieldKey) => (submitted || touched[k] ? errors[k] : undefined);
const touch = (k: FieldKey) => () => setTouched((t) => (t[k] ? t : { ...t, [k]: true }));
const errId = (k: FieldKey) => id(`${k}-err`);
const describe = (k: FieldKey, extra?: string) =>
[extra, shown(k) ? errId(k) : undefined].filter(Boolean).join(" ") || undefined;
const addFiles = (list: FileList | null) => {
if (!list || disabled) return;
const room = maxPhotos - photos.length;
const next: LocalPhoto[] = [];
let message = "";
Array.from(list).forEach((file) => {
if (!file.type.startsWith("image/")) {
message = fill(c.photosNotImage, { name: file.name });
return;
}
if (file.size > maxPhotoMB * 1024 * 1024) {
message = fill(c.photosTooBig, { name: file.name, mb: maxPhotoMB });
return;
}
if (next.length >= room) {
message = fill(c.photosLimit, { max: maxPhotos });
return;
}
seq.current += 1;
next.push({ id: seq.current, file, url: URL.createObjectURL(file) });
});
setPhotoError(message);
if (next.length) setPhotos((p) => [...p, ...next]);
};
const removePhoto = (photoId: number) => {
const target = photos.find((p) => p.id === photoId);
if (target) URL.revokeObjectURL(target.url);
setPhotos((p) => p.filter((x) => x.id !== photoId));
setPhotoError("");
};
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
if (disabled || busy) return;
setSubmitted(true);
if (errorKeys.length) {
const refs: Record<FieldKey, React.RefObject<HTMLInputElement | HTMLTextAreaElement | null>> = {
service: serviceRef,
details: detailsRef,
postcode: postcodeRef,
time: timeRef,
name: nameRef,
phone: phoneRef,
email: emailRef,
};
refs[errorKeys[0]].current?.focus();
return;
}
const result = onSubmit?.({
service,
details: details.trim(),
photos: photos.map((p) => p.file),
postcode: postcode.trim().toUpperCase(),
contactTime,
name: name.trim(),
phone: phone.trim(),
...(emailField ? { email: email.trim() } : {}),
});
if (result && typeof (result as PromiseLike<unknown>).then === "function") {
setBusy(true);
const stop = () => {
if (mounted.current) setBusy(false);
};
(result as PromiseLike<unknown>).then(stop, stop);
}
};
const serviceLabel = services.find((s) => s.id === service)?.label ?? "";
const timeLabel = contactTimes.find((t) => t.id === contactTime)?.label ?? "";
const rows = [
{ key: "service", label: c.rowService, value: serviceLabel, done: !errors.service, anim: serviceLabel },
{ key: "details", label: c.rowDetails, value: details.replace(/\s+/g, " ").trim().slice(0, 80), done: !errors.details, anim: "on" },
{
key: "photos",
label: c.rowPhotos,
value: photos.length === 1 ? c.photosCountOne : fill(c.photosCountMany, { count: photos.length }),
done: photos.length > 0,
optional: true,
anim: String(photos.length),
},
{ key: "postcode", label: c.rowPostcode, value: postcode.trim().toUpperCase(), done: !errors.postcode, anim: "on" },
{ key: "time", label: c.rowTime, value: timeLabel, done: !errors.time, anim: timeLabel },
{ key: "contact", label: c.rowContact, value: name.trim(), done: !errors.name && !errors.phone && !errors.email, anim: "on" },
];
const required = rows.filter((r) => !r.optional);
const doneCount = required.filter((r) => r.done).length;
const complete = doneCount === required.length;
const pct = Math.round((doneCount / required.length) * 100);
const summary =
submitted && errorKeys.length
? errorKeys.length === 1
? c.errorSummaryOne
: fill(c.errorSummaryMany, { count: errorKeys.length })
: "";
const full = photos.length >= maxPhotos;
return (
<section className={cx("cf-qr", className)} aria-labelledby={id("title")}>
<style>{CSS}</style>
<div className="cf-qr-floor" aria-hidden="true" />
<div className="cf-qr-wrap">
<header className={cx("cf-qr-top", !sceneImage && "is-solo")}>
<div className="cf-qr-copy">
<h2 id={id("title")} className="cf-qr-h2">
{headline}
</h2>
{intro.length > 0 && (
<div className="cf-qr-intro">
{intro.map((p, i) => (
<p key={i}>
<strong>{p.lead}</strong> {p.text}
</p>
))}
</div>
)}
</div>
{sceneImage && (
<figure className="cf-qr-photo">
<img src={sceneImage} alt={sceneAlt} width={1200} height={800} decoding="async" />
</figure>
)}
</header>
<div className="cf-qr-card">
<form className="cf-qr-form" noValidate onSubmit={handleSubmit} aria-labelledby={id("title")}>
<fieldset className="cf-qr-shell" disabled={disabled}>
<div className="cf-qr-grid">
<div className="cf-qr-steps">
<fieldset className="cf-qr-step">
<legend className="cf-qr-head">
<span className="cf-qr-num" aria-hidden="true">1</span>
<span className="cf-qr-title">{c.serviceTitle}</span>
</legend>
<div className="cf-qr-tiles">
{services.map((s, i) => {
const Icon = SERVICE_ICONS[s.icon ?? "other"];
const on = service === s.id;
return (
<label key={s.id} className={cx("cf-qr-tile cf-qr-svc", on && "is-on", shown("service") && "is-bad")}>
<input
ref={i === 0 ? serviceRef : undefined}
className="cf-qr-sr"
type="radio"
name={id("service")}
value={s.id}
checked={on}
onChange={() => setService(s.id)}
aria-describedby={describe("service")}
/>
<span className="cf-qr-disc" aria-hidden="true">
<Icon size={20} strokeWidth={2.5} />
</span>
<span className="cf-qr-tl">{s.label}</span>
{on && (
<span className="cf-qr-pick" aria-hidden="true">
<Check size={12} strokeWidth={3} />
</span>
)}
</label>
);
})}
</div>
<FieldError id={errId("service")} message={shown("service")} />
</fieldset>
<div className="cf-qr-step">
<div className="cf-qr-head">
<span className="cf-qr-num" aria-hidden="true">2</span>
<label className="cf-qr-title" htmlFor={id("details")}>
{c.detailsTitle}
</label>
</div>
<textarea
ref={detailsRef}
id={id("details")}
className="cf-qr-input cf-qr-area"
rows={4}
maxLength={detailsMax}
value={details}
placeholder={c.detailsPlaceholder}
onChange={(e) => setDetails(e.target.value)}
onBlur={touch("details")}
aria-invalid={shown("details") ? true : undefined}
aria-describedby={describe("details", id("details-count"))}
/>
<div className="cf-qr-meta">
<FieldError id={errId("details")} message={shown("details")} />
<span id={id("details-count")} className="cf-qr-count">
{fill(c.detailsCount, { count: details.length, max: detailsMax })}
</span>
</div>
</div>
<fieldset className="cf-qr-step">
<legend className="cf-qr-head">
<span className="cf-qr-num" aria-hidden="true">3</span>
<span className="cf-qr-title">{c.photosTitle}</span>
<span className="cf-qr-tag">{c.optional}</span>
</legend>
<p className="cf-qr-hint" id={id("photos-hint")}>
{fill(c.photosHint, { max: maxPhotos, mb: maxPhotoMB })}
</p>
<label
htmlFor={id("photos")}
className={cx("cf-qr-drop", dragging && "is-drag", full && "is-full")}
onDragOver={(e) => {
e.preventDefault();
if (!disabled && !full) setDragging(true);
}}
onDragLeave={() => setDragging(false)}
onDrop={(e) => {
e.preventDefault();
setDragging(false);
if (!full) addFiles(e.dataTransfer.files);
}}
>
<input
id={id("photos")}
className="cf-qr-sr"
type="file"
accept="image/*"
multiple
disabled={full}
onChange={(e) => {
addFiles(e.target.files);
e.target.value = "";
}}
aria-describedby={[id("photos-hint"), photoError ? id("photos-err") : ""].filter(Boolean).join(" ")}
/>
<span className="cf-qr-disc" aria-hidden="true">
<ImagePlus size={20} strokeWidth={2.5} />
</span>
<span className="cf-qr-dt">
<span className="cf-qr-dl">{c.photosDrop}</span>
<span className="cf-qr-dh">{c.photosDropHint}</span>
</span>
</label>
{photos.length > 0 && (
<ul className="cf-qr-thumbs">
{photos.map((p) => (
<li key={p.id} className="cf-qr-thumb">
<img src={p.url} alt={p.file.name} />
<button
type="button"
className="cf-qr-x"
onClick={() => removePhoto(p.id)}
aria-label={fill(c.photosRemove, { name: p.file.name })}
>
<X size={16} strokeWidth={2.5} aria-hidden="true" />
</button>
</li>
))}
</ul>
)}
<FieldError id={id("photos-err")} message={photoError} />
</fieldset>
<div className="cf-qr-step">
<div className="cf-qr-head">
<span className="cf-qr-num" aria-hidden="true">4</span>
<label className="cf-qr-title" htmlFor={id("postcode")}>
{c.postcodeTitle}
</label>
</div>
<input
ref={postcodeRef}
id={id("postcode")}
className="cf-qr-input cf-qr-postcode"
type="text"
inputMode="text"
autoComplete="postal-code"
autoCapitalize="characters"
maxLength={10}
value={postcode}
placeholder={c.postcodePlaceholder}
onChange={(e) => setPostcode(e.target.value)}
onBlur={touch("postcode")}
aria-invalid={shown("postcode") ? true : undefined}
aria-describedby={describe("postcode")}
/>
<FieldError id={errId("postcode")} message={shown("postcode")} />
</div>
<fieldset className="cf-qr-step">
<legend className="cf-qr-head">
<span className="cf-qr-num" aria-hidden="true">5</span>
<span className="cf-qr-title">{c.timeTitle}</span>
</legend>
<div className="cf-qr-tiles cf-qr-times">
{contactTimes.map((t, i) => {
const Icon = TIME_ICONS[t.icon ?? "any"];
const on = contactTime === t.id;
return (
<label key={t.id} className={cx("cf-qr-tile cf-qr-time", on && "is-on", shown("time") && "is-bad")}>
<input
ref={i === 0 ? timeRef : undefined}
className="cf-qr-sr"
type="radio"
name={id("time")}
value={t.id}
checked={on}
onChange={() => setContactTime(t.id)}
aria-describedby={describe("time")}
/>
<Icon className="cf-qr-ti" size={20} strokeWidth={2.5} aria-hidden="true" />
<span className="cf-qr-tt">
<b>{t.label}</b>
{t.detail && <span>{t.detail}</span>}
</span>
{on && (
<span className="cf-qr-pick" aria-hidden="true">
<Check size={12} strokeWidth={3} />
</span>
)}
</label>
);
})}
</div>
<FieldError id={errId("time")} message={shown("time")} />
</fieldset>
<fieldset className="cf-qr-step">
<legend className="cf-qr-head">
<span className="cf-qr-num" aria-hidden="true">6</span>
<span className="cf-qr-title">{c.contactTitle}</span>
</legend>
<div className="cf-qr-pair">
<div className="cf-qr-field">
<label className="cf-qr-label" htmlFor={id("name")}>
{c.nameLabel}
</label>
<input
ref={nameRef}
id={id("name")}
className="cf-qr-input"
type="text"
autoComplete="name"
value={name}
placeholder={c.namePlaceholder}
onChange={(e) => setName(e.target.value)}
onBlur={touch("name")}
aria-invalid={shown("name") ? true : undefined}
aria-describedby={describe("name")}
/>
<FieldError id={errId("name")} message={shown("name")} />
</div>
<div className="cf-qr-field">
<label className="cf-qr-label" htmlFor={id("phone")}>
{c.phoneLabel}
</label>
<input
ref={phoneRef}
id={id("phone")}
className="cf-qr-input"
type="tel"
inputMode="tel"
autoComplete="tel"
value={phone}
placeholder={c.phonePlaceholder}
onChange={(e) => setPhone(e.target.value)}
onBlur={touch("phone")}
aria-invalid={shown("phone") ? true : undefined}
aria-describedby={describe("phone")}
/>
<FieldError id={errId("phone")} message={shown("phone")} />
</div>
{emailField && (
<div className="cf-qr-field cf-qr-wide">
<label className="cf-qr-label" htmlFor={id("email")}>
{c.emailLabel}
</label>
<input
ref={emailRef}
id={id("email")}
className="cf-qr-input"
type="email"
inputMode="email"
autoComplete="email"
value={email}
placeholder={c.emailPlaceholder}
onChange={(e) => setEmail(e.target.value)}
onBlur={touch("email")}
aria-invalid={shown("email") ? true : undefined}
aria-describedby={describe("email")}
/>
<FieldError id={errId("email")} message={shown("email")} />
</div>
)}
</div>
</fieldset>
</div>
<aside className="cf-qr-aside" aria-labelledby={id("ledger")}>
<div className="cf-qr-well">
<div className="cf-qr-lhead">
<h3 id={id("ledger")} className="cf-qr-h3">
{c.ledgerTitle}
</h3>
<span className={cx("cf-qr-chip", complete && "is-complete")} aria-live="polite">
{fill(c.progress, { done: doneCount, total: required.length })}
</span>
</div>
<div className={cx("cf-qr-bar", complete && "is-complete")} aria-hidden="true">
<span style={{ width: `${pct}%` }} />
</div>
<ul className="cf-qr-rows">
{rows.map((r) => {
const empty = !r.done;
const text = r.done ? r.value : r.optional ? c.photosOptional : c.empty;
return (
<li key={r.key} className={cx("cf-qr-row", r.done && "is-done")}>
<span className="cf-qr-badge" aria-hidden="true">
{r.done && <Check size={12} strokeWidth={3} />}
</span>
<span className="cf-qr-rl">{r.label}</span>
<span className="cf-qr-lead" aria-hidden="true" />
<span
key={r.done ? `on-${r.anim}` : "off"}
className={cx("cf-qr-rv", empty && "is-empty")}
aria-hidden={empty && !r.optional ? true : undefined}
>
{text}
</span>
<span className="cf-qr-sr">, {r.done ? c.doneSr : c.todoSr}</span>
</li>
);
})}
</ul>
<div className="cf-qr-sum">
<div className="cf-qr-row cf-qr-sub">
<span className="cf-qr-rl">{c.subtotalLabel}</span>
<span className="cf-qr-lead" aria-hidden="true" />
<span className="cf-qr-rv">{c.subtotalValue}</span>
</div>
<div className="cf-qr-row cf-qr-total">
<span className="cf-qr-rl">{c.totalLabel}</span>
<span className="cf-qr-lead" aria-hidden="true" />
<strong className="cf-qr-rv">{c.totalValue}</strong>
</div>
</div>
{summary && (
<p className="cf-qr-summary" role="alert">
<AlertCircle className="cf-qr-ico" size={16} strokeWidth={2.5} aria-hidden="true" />
{summary}
</p>
)}
<button
type="submit"
className={cx("cf-qr-btn", state === "hover" && "is-hover", state === "active" && "is-active", busy && "is-busy")}
aria-busy={busy || undefined}
>
{busy && <Loader2 className="cf-qr-spin" size={20} strokeWidth={2.5} aria-hidden="true" />}
<span>{busy ? c.sending : ctaLabel}</span>
</button>
{(responseTime || privacy) && (
<ul className="cf-qr-assure">
{responseTime && (
<li className="cf-qr-promise">
<Clock className="cf-qr-ico" size={18} strokeWidth={2.5} aria-hidden="true" />
{responseTime}
</li>
)}
{privacy && (
<li className="cf-qr-privacy">
<Lock className="cf-qr-ico" size={16} strokeWidth={2.5} aria-hidden="true" />
{privacy}
</li>
)}
</ul>
)}
</div>
</aside>
</div>
</fieldset>
</form>
</div>
</div>
</section>
);
}
export default QuoteRequest;
function FieldError({ id, message }: { id: string; message?: string }) {
if (!message) return null;
return (
<p id={id} className="cf-qr-err">
<AlertCircle className="cf-qr-ico" size={16} strokeWidth={2.5} aria-hidden="true" />
{message}
</p>
);
}
function cx(...parts: (string | false | null | undefined)[]) {
return parts.filter(Boolean).join(" ");
}
function fill(template: string, values: Record<string, string | number>) {
return template.replace(/\{(\w+)\}/g, (match, key: string) => (key in values ? String(values[key]) : match));
}
function validate(
v: { service: string; details: string; postcode: string; contactTime: string; name: string; phone: string; email: string },
c: QuoteRequestCopy,
askEmail = false,
): Partial<Record<FieldKey, string>> {
const e: Partial<Record<FieldKey, string>> = {};
if (!v.service) e.service = c.errorService;
if (v.details.trim().length < 10) e.details = c.errorDetails;
if (!/^[A-Za-z0-9][A-Za-z0-9 -]{1,8}[A-Za-z0-9]$/.test(v.postcode.trim())) e.postcode = c.errorPostcode;
if (!v.contactTime) e.time = c.errorTime;
if (v.name.trim().length < 2) e.name = c.errorName;
const digits = v.phone.replace(/\D/g, "").length;
if (digits < 7 || digits > 15) e.phone = c.errorPhone;
if (askEmail && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(v.email.trim())) e.email = c.errorEmail;
return e;
}
const FIELD_ORDER: FieldKey[] = ["service", "details", "postcode", "time", "name", "phone", "email"];
const SERVICE_ICONS: Record<QuoteServiceIcon, LucideIcon> = {
roof: Home,
plumbing: Droplets,
electrical: Zap,
painting: PaintRoller,
landscaping: Trees,
handyman: Hammer,
cleaning: Sparkles,
hvac: Fan,
other: Wrench,
};
const TIME_ICONS: Record<QuoteTimeIcon, LucideIcon> = {
morning: Sunrise,
afternoon: Sun,
evening: Moon,
any: CalendarClock,
};
const DEFAULT_HEADLINE = (
<>
Tell us about the job. Get your <span className="cf-qr-mark">free quote.</span>
</>
);
const DEFAULT_INTRO = [
{ lead: "It's free.", text: "Tell us what needs doing and get a quote for your exact job." },
{ lead: "Photos help.", text: "A few snaps of the job let us price it right the first time." },
{ lead: "We call when it suits you.", text: "Pick a time and that's when we'll be in touch." },
];
const DEFAULT_SERVICES: QuoteService[] = [
{ id: "roofing", label: "Roofing", icon: "roof" },
{ id: "plumbing", label: "Plumbing", icon: "plumbing" },
{ id: "electrical", label: "Electrical", icon: "electrical" },
{ id: "painting", label: "Painting", icon: "painting" },
{ id: "landscaping", label: "Landscaping", icon: "landscaping" },
{ id: "handyman", label: "Handyman", icon: "handyman" },
];
const DEFAULT_TIMES: QuoteContactTime[] = [
{ id: "morning", label: "Morning", detail: "8am – 12pm", icon: "morning" },
{ id: "afternoon", label: "Afternoon", detail: "12 – 5pm", icon: "afternoon" },
{ id: "evening", label: "Evening", detail: "5 – 8pm", icon: "evening" },
{ id: "any", label: "Any time", detail: "Whenever suits", icon: "any" },
];
const DEFAULT_COPY: QuoteRequestCopy = {
serviceTitle: "What needs doing?",
detailsTitle: "Tell us about the job",
detailsPlaceholder: "e.g. Two gutters leaking at the back of a single-storey house.",
detailsCount: "{count}/{max}",
photosTitle: "Show us the job",
photosHint: "Helps us price it right. Up to {max} photos, {mb} MB each.",
photosDrop: "Add photos",
photosDropHint: "Drag them here or tap to choose",
photosRemove: "Remove {name}",
photosLimit: "You can add up to {max} photos.",
photosTooBig: "{name} is over {mb} MB. Try a smaller photo.",
photosNotImage: "{name} isn't a photo. Choose a JPG, PNG or HEIC file.",
postcodeTitle: "Where's the job?",
postcodePlaceholder: "Zip or postcode, e.g. 90210",
timeTitle: "When should we call?",
contactTitle: "Who should we ask for?",
nameLabel: "Full name",
namePlaceholder: "Jane Smith",
phoneLabel: "Phone number",
phonePlaceholder: "(555) 123-4567",
emailLabel: "Email",
emailPlaceholder: "you@example.com",
optional: "Optional",
ledgerTitle: "Your free quote, line by line",
progress: "{done} of {total} done",
rowService: "Service",
rowDetails: "Job",
rowPhotos: "Photos",
rowPostcode: "Area",
rowTime: "Call me",
rowContact: "Ask for",
photosOptional: "Optional",
photosCountOne: "1 photo",
photosCountMany: "{count} photos",
empty: "—",
doneSr: "added",
todoSr: "still to add",
subtotalLabel: "Your custom quote",
subtotalValue: "Free",
totalLabel: "You pay today",
totalValue: "$0",
sending: "Sending your request…",
errorService: "Choose the service you need.",
errorDetails: "Add a line or two about the job.",
errorPostcode: "Enter a valid zip or postcode.",
errorTime: "Pick a time that suits you.",
errorName: "Enter your name.",
errorPhone: "Enter a phone number we can call.",
errorEmail: "Enter an email address we can reply to.",
errorSummaryOne: "Fix the highlighted answer to get your quote.",
errorSummaryMany: "Fix the {count} highlighted answers to get your quote.",
};
// Reduced motion keeps !important so every animated child settles, whatever its own selector weight.
const CSS = `
.cf-qr{--qr-gutter:clamp(16px,5vw,48px);--qr-hair:oklch(from var(--ink) l c h / .14);--qr-well:color-mix(in oklch, var(--ink) 4%, var(--card));--qr-sh:var(--shadow, oklch(0.22 0.03 260));--qr-marker:var(--marker, oklch(from var(--surface) calc(.24 + l * .66) .12 92 / .92));--qr-ease:cubic-bezier(.2,.7,.2,1);position:relative;isolation:isolate;overflow-x:clip;background:var(--surface);color:var(--ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) 0 clamp(64px,8.5vw,120px)}
.cf-qr *,.cf-qr *::before,.cf-qr *::after{box-sizing:border-box}
.cf-qr-floor{position:absolute;left:0;right:0;bottom:0;height:clamp(180px,24%,360px);background:var(--band);z-index:-1}
.cf-qr-wrap{max-width:calc(1120px + 2 * var(--qr-gutter));margin:0 auto;padding:0 var(--qr-gutter)}
.cf-qr-top{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);gap:clamp(32px,5vw,72px);align-items:start;margin-bottom:clamp(32px,4vw,48px);animation:cf-qr-rise .45s var(--qr-ease) both}
.cf-qr-top.is-solo{grid-template-columns:minmax(0,1fr)}
.cf-qr-h2{margin:0;font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-.025em);text-transform:var(--display-case,none);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06;color:var(--ink);text-wrap:balance}
.cf-qr-mark{background-image:linear-gradient(transparent 0 52%, var(--qr-marker) 52% 92%, transparent 92%);background-repeat:no-repeat;padding:0 .08em;margin:0 -.04em;border-radius:.1em .2em .14em .22em;-webkit-box-decoration-break:clone;box-decoration-break:clone}
.cf-qr-intro{margin-top:clamp(20px,2.5vw,28px);display:grid;gap:12px;max-width:60ch}
.cf-qr-intro p{margin:0;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--muted);text-wrap:pretty}
.cf-qr-intro strong{color:var(--ink);font-weight:800}
.cf-qr-photo{margin:0;border-radius:12px;overflow:hidden;aspect-ratio:3/2;background:var(--qr-well);animation:cf-qr-rise .45s var(--qr-ease) .07s both}
.cf-qr-photo img{display:block;width:100%;height:100%;object-fit:cover;object-position:50% 35%}
.cf-qr-card{position:relative;background:var(--card);color:var(--ink);border:1px solid var(--card-border, oklch(from var(--ink) l c h / .12));border-radius:var(--card-radius, var(--radius, 14px));box-shadow:var(--card-shadow, var(--shadow-lg, 0 2px 4px oklch(0.22 0.03 260 / .22), 0 12px 24px -8px oklch(0.22 0.03 260 / .32)));padding:clamp(20px,3vw,32px);animation:cf-qr-rise .45s var(--qr-ease) .14s both}
.cf-qr-form,.cf-qr-shell,.cf-qr-step{margin:0;padding:0;border:0;min-width:0}
.cf-qr-grid{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:clamp(24px,4vw,48px);align-items:start}
.cf-qr-steps{display:grid;gap:32px;min-width:0}
.cf-qr-head{display:flex;align-items:baseline;gap:12px;width:100%;padding:0;margin:0 0 12px}
.cf-qr-num{flex:none;min-width:1ch;font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1;color:var(--accent);font-variant-numeric:tabular-nums}
.cf-qr-title{font-family:var(--font-display);font-weight:800;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.2;letter-spacing:-.01em;color:var(--ink);text-wrap:balance}
.cf-qr-tag{margin-left:auto;align-self:center;display:inline-flex;align-items:center;min-height:28px;padding:4px 12px;border-radius:999px;background:color-mix(in oklch, var(--ink) 6%, var(--card));color:var(--ink);font-size:.875rem;font-weight:800;line-height:1.2;white-space:nowrap}
.cf-qr-hint{margin:-4px 0 12px;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--muted);text-wrap:pretty}
.cf-qr-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}
.cf-qr-tiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.cf-qr-times{grid-template-columns:repeat(2,minmax(0,1fr))}
.cf-qr-tile{position:relative;display:flex;align-items:center;gap:12px;min-height:64px;padding:12px 34px 12px 14px;border-radius:var(--radius,12px);background:var(--qr-well);color:var(--ink);box-shadow:inset 0 0 0 1px var(--qr-hair);cursor:pointer;-webkit-tap-highlight-color:transparent;transition:transform .16s ease,box-shadow .16s ease,background-color .16s ease}
.cf-qr-tile:hover{transform:translateY(-1px);box-shadow:inset 0 0 0 1px oklch(from var(--ink) l c h / .32),0 1px 2px oklch(from var(--qr-sh) l c h / .2)}
.cf-qr-tile:active{transform:translateY(0)}
.cf-qr-tile.is-bad{box-shadow:inset 0 0 0 1px var(--danger)}
.cf-qr-tile.is-on{background:color-mix(in oklch, var(--accent) 10%, var(--card));transform:translateY(-2px);box-shadow:inset 0 0 0 2px var(--accent),0 1px 2px oklch(from var(--qr-sh) l c h / .22),0 6px 14px -6px oklch(from var(--qr-sh) l c h / .38)}
.cf-qr-tile:has(input:focus-visible){outline:3px solid oklch(from var(--field-focus, var(--accent)) l c h / .5);outline-offset:2px}
.cf-qr-shell:disabled .cf-qr-tile{cursor:not-allowed;transform:none;box-shadow:inset 0 0 0 1px var(--qr-hair)}
.cf-qr-disc{flex:none;display:grid;place-items:center;width:40px;height:40px;border-radius:999px;background:color-mix(in oklch, var(--ink) 7%, var(--card));color:var(--accent);transition:background-color .16s ease,color .16s ease}
.cf-qr-tile.is-on .cf-qr-disc{background:var(--accent-fill, var(--accent));color:var(--accent-fill-ink, var(--card))}
.cf-qr-tl{font-size:1.0625rem;font-weight:700;line-height:1.2;text-wrap:balance}
.cf-qr-pick{position:absolute;top:8px;right:8px;display:grid;place-items:center;width:20px;height:20px;border-radius:999px;background:var(--accent-fill, var(--accent));color:var(--accent-fill-ink, var(--card));animation:cf-qr-pop .3s var(--qr-ease) both}
.cf-qr-time{gap:10px;min-height:60px;padding:10px 32px 10px 14px}
.cf-qr-ti{flex:none;color:var(--accent)}
.cf-qr-tt{display:grid;gap:2px;min-width:0}
.cf-qr-tt b{font-size:1.0625rem;font-weight:700;line-height:1.2}
.cf-qr-tt span{font-size:.875rem;font-weight:500;line-height:1.2;color:var(--ink)}
.cf-qr-input{display:block;width:100%;min-height:56px;padding:0 16px;font-family:var(--font-body);font-size:1.0625rem;font-weight:500;line-height:1.35;color:var(--field-ink);background:var(--field);border:1px solid var(--field-border, color-mix(in oklch, var(--ink) 22%, transparent));border-radius:var(--field-radius, var(--radius, 12px));transition:border-color .16s ease,box-shadow .16s ease}
.cf-qr-input::placeholder{color:color-mix(in oklch, var(--field-ink) 65%, var(--field));opacity:1}
.cf-qr-input:hover{border-color:color-mix(in oklch, var(--field-ink) 45%, var(--field))}
.cf-qr-input:focus-visible{outline:none;border-color:var(--field-focus, var(--accent));box-shadow:0 0 0 3px oklch(from var(--field-focus, var(--accent)) l c h / .35)}
.cf-qr-input[aria-invalid="true"]{border-color:var(--danger)}
.cf-qr-input[aria-invalid="true"]:focus-visible{box-shadow:0 0 0 3px oklch(from var(--danger) l c h / .3)}
.cf-qr-input:disabled{cursor:not-allowed;background:color-mix(in oklch, var(--field-ink) 5%, var(--field))}
.cf-qr-area{min-height:124px;padding:14px 16px;resize:vertical}
.cf-qr-postcode{max-width:320px}
.cf-qr-meta{display:flex;align-items:flex-start;gap:12px}
.cf-qr-count{margin:8px 0 0 auto;font-size:.875rem;font-weight:600;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.cf-qr-err{margin:8px 0 0;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--danger);text-wrap:pretty}
.cf-qr-ico{display:inline-block;vertical-align:-.15em;margin-inline-end:.4em}
.cf-qr-drop{display:flex;align-items:center;gap:14px;min-height:80px;padding:14px 16px;border-radius:var(--radius,12px);background:var(--qr-well);color:var(--ink);box-shadow:inset 0 0 0 1px var(--qr-hair);cursor:pointer;transition:box-shadow .16s ease,background-color .16s ease}
.cf-qr-drop:hover{box-shadow:inset 0 0 0 1px oklch(from var(--ink) l c h / .32)}
.cf-qr-drop.is-drag{background:color-mix(in oklch, var(--accent) 10%, var(--card));box-shadow:inset 0 0 0 2px var(--accent)}
.cf-qr-drop:has(input:focus-visible){outline:3px solid oklch(from var(--field-focus, var(--accent)) l c h / .5);outline-offset:2px}
.cf-qr-drop.is-full,.cf-qr-shell:disabled .cf-qr-drop{cursor:not-allowed;box-shadow:inset 0 0 0 1px var(--qr-hair)}
.cf-qr-dt{display:grid;gap:2px;min-width:0}
.cf-qr-dl{font-size:1.0625rem;font-weight:700;line-height:1.2}
.cf-qr-dh{font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--muted)}
.cf-qr-thumbs{list-style:none;margin:16px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:12px}
.cf-qr-thumb{position:relative;width:72px;height:72px}
.cf-qr-thumb img{display:block;width:100%;height:100%;object-fit:cover;border-radius:8px;animation:cf-qr-pop .3s var(--qr-ease) both}
.cf-qr-x{position:absolute;top:-8px;right:-8px;display:grid;place-items:center;width:28px;height:28px;padding:0;border:0;border-radius:999px;background:var(--band);color:var(--band-ink);box-shadow:var(--shadow-sm, 0 1px 3px oklch(0.22 0.03 260 / .3));cursor:pointer;transition:transform .16s ease,background-color .16s ease}
.cf-qr-x::before{content:"";position:absolute;inset:-8px}
.cf-qr-x:hover{background:oklch(from var(--band) calc(l + .08) c h);transform:scale(1.06)}
.cf-qr-x:active{transform:scale(.96)}
.cf-qr-x:focus-visible{outline:3px solid var(--field-focus, var(--accent));outline-offset:2px}
.cf-qr-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.cf-qr-wide{grid-column:1/-1}
.cf-qr-field{min-width:0}
.cf-qr-label{display:block;margin-bottom:8px;font-size:1.0625rem;font-weight:700;line-height:1.2;color:var(--ink)}
.cf-qr-aside{min-width:0}
.cf-qr-well{background:var(--qr-well);border-radius:var(--radius,12px);box-shadow:inset 0 0 0 1px oklch(from var(--ink) l c h / .07);padding:clamp(20px,2.4vw,28px)}
.cf-qr-lhead{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px}
.cf-qr-h3{margin:0;font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-.01em;color:var(--ink);text-wrap:balance}
.cf-qr-chip{display:inline-flex;align-items:center;min-height:28px;padding:4px 12px;border-radius:999px;background:color-mix(in oklch, var(--ink) 8%, var(--card));color:var(--ink);font-size:.875rem;font-weight:800;line-height:1.2;white-space:nowrap;font-variant-numeric:tabular-nums}
.cf-qr-chip.is-complete{background:var(--success-soft);color:var(--success)}
.cf-qr-bar{height:6px;margin:16px 0 20px;border-radius:999px;background:color-mix(in oklch, var(--ink) 10%, var(--card));overflow:hidden}
.cf-qr-bar span{display:block;height:100%;border-radius:inherit;background:var(--accent-fill, var(--accent));transition:width .45s var(--qr-ease),background-color .16s ease}
.cf-qr-bar.is-complete span{background:var(--success)}
.cf-qr-rows{list-style:none;margin:0;padding:0;display:grid;gap:12px}
.cf-qr-row{display:flex;align-items:center;gap:10px;min-height:28px;font-size:1.0625rem;line-height:1.3;color:var(--ink)}
.cf-qr-badge{flex:none;display:grid;place-items:center;width:20px;height:20px;border-radius:999px;box-shadow:inset 0 0 0 1.5px oklch(from var(--ink) l c h / .28);color:var(--success-ink, #fff)}
.cf-qr-row.is-done .cf-qr-badge{background:var(--success);box-shadow:none;animation:cf-qr-pop .3s var(--qr-ease) both}
.cf-qr-rl{flex:none;font-weight:500}
.cf-qr-lead{flex:1 1 16px;min-width:16px;height:1px;background:oklch(from var(--ink) l c h / .2);transform:translateY(.3em)}
.cf-qr-rv{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right;font-weight:700}
.cf-qr-rv.is-empty{font-weight:600;color:var(--muted)}
.cf-qr-row.is-done .cf-qr-rv{animation:cf-qr-rise .45s var(--qr-ease) both}
.cf-qr-sum{display:grid;gap:10px;margin-top:24px}
.cf-qr-sum .cf-qr-rl{flex:0 1 auto;min-width:0;overflow-wrap:break-word}
.cf-qr-sum .cf-qr-lead{min-width:8px}
.cf-qr-sum .cf-qr-rv{flex:none;overflow:visible;text-overflow:clip}
.cf-qr-sub .cf-qr-rl{font-weight:600}
.cf-qr-sub .cf-qr-rv{font-weight:800}
.cf-qr-total{min-height:48px}
.cf-qr-total .cf-qr-rl{font-family:var(--font-display);font-size:1.125rem;font-weight:800}
.cf-qr-total .cf-qr-lead{height:2px;background:oklch(from var(--ink) l c h / .3)}
.cf-qr-total .cf-qr-rv{overflow:visible;font-family:var(--font-display);font-size:2.5rem;line-height:1;font-weight:var(--display-weight,800);letter-spacing:-.03em;font-variant-numeric:tabular-nums}
.cf-qr-num,.cf-qr-chip,.cf-qr-count,.cf-qr-tt span,.cf-qr-total .cf-qr-rv{font-variant-numeric:lining-nums tabular-nums}
.cf-qr-summary{margin:20px 0 0;padding:10px 14px;border-radius:10px;background:var(--danger-soft);color:var(--danger);font-size:.9375rem;font-weight:700;line-height:1.4;text-wrap:pretty}
.cf-qr-btn{--qr-bb:var(--button-bg, var(--cta));appearance:none;border:0;margin-top:20px;width:100%;min-height:64px;padding:0 28px;display:inline-flex;align-items:center;justify-content:center;gap:10px;font-family:var(--button-font, var(--font-display));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;text-align:center;text-wrap:balance;color:var(--button-ink, var(--cta-ink));text-shadow:var(--button-text-shadow,none);border-radius:var(--button-radius, var(--radius, 12px));background:linear-gradient(oklch(from var(--qr-bb) calc(l + .04) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - .02) c h));box-shadow:var(--button-shadow, inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + .14) c h / .7), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - .16) c h), 0 1px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / .3), 0 8px 16px -6px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / .45));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-qr-btn:hover:not(:disabled),.cf-qr-btn.is-hover{transform:translateY(-1px);background:linear-gradient(oklch(from var(--qr-bb) calc(l - .01) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - .07) c h));box-shadow:inset 0 1px 0 oklch(from var(--qr-bb) calc(l + .12) c h / .6),inset 0 -3px 0 oklch(from var(--qr-bb) calc(l - .2) c h),0 1px 2px oklch(from var(--qr-sh) l c h / .32),0 10px 18px -6px oklch(from var(--qr-sh) l c h / .55)}
.cf-qr-btn:active:not(:disabled),.cf-qr-btn.is-active{transform:translateY(1px);background:linear-gradient(oklch(from var(--qr-bb) calc(l - .06) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - .08) c h));box-shadow:inset 0 2px 4px oklch(from var(--qr-bb) calc(l - .22) c h / .55),inset 0 -2px 0 oklch(from var(--qr-bb) calc(l - .18) c h),0 1px 2px oklch(from var(--qr-sh) l c h / .3)}
.cf-qr-btn:focus-visible{outline:3px solid var(--field-focus, var(--accent));outline-offset:3px}
.cf-qr-btn:disabled{cursor:not-allowed;transform:none;background:var(--button-2-bg, var(--secondary));color:var(--button-2-ink, var(--secondary-ink));text-shadow:none;box-shadow:var(--button-2-shadow, var(--shadow-sm))}
.cf-qr-btn.is-busy{cursor:progress}
.cf-qr-spin{flex:none;animation:cf-qr-spin .8s linear infinite}
.cf-qr-assure{list-style:none;margin:16px 0 0;padding:0;display:grid;gap:8px;text-align:center}
.cf-qr-assure li{font-size:.9375rem;line-height:1.4;text-wrap:pretty}
.cf-qr-promise{font-weight:700;color:var(--ink)}
.cf-qr-promise .cf-qr-ico{color:var(--accent)}
.cf-qr-privacy{font-weight:500;color:var(--muted)}
@media (min-width:901px){.cf-qr-aside{position:sticky;top:24px}}
@media (max-width:900px){.cf-qr-top{grid-template-columns:minmax(0,1fr);gap:24px}.cf-qr-photo{aspect-ratio:16/10}.cf-qr-grid{grid-template-columns:minmax(0,1fr)}.cf-qr-floor{height:220px}}
@media (max-width:720px){.cf-qr-tiles{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.cf-qr-tile{flex-direction:column;align-items:flex-start;gap:10px;padding:14px 14px 16px}.cf-qr-svc{min-height:104px}.cf-qr-time{min-height:96px}.cf-qr-time .cf-qr-ti{margin-top:2px}}
@media (max-width:560px){.cf-qr-card{padding:16px}.cf-qr-well{padding:20px 16px}.cf-qr-btn{padding:0 16px}.cf-qr-pair{grid-template-columns:minmax(0,1fr)}.cf-qr-postcode{max-width:none}}
@keyframes cf-qr-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes cf-qr-pop{from{transform:scale(.9)}to{transform:scale(1)}}
@keyframes cf-qr-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.cf-qr,.cf-qr *{animation:none !important;transition:none !important}.cf-qr-tile:hover,.cf-qr-tile.is-on,.cf-qr-btn:hover:not(:disabled),.cf-qr-btn.is-hover{transform:none}}
`;
pieces/forms/quote-request/specimen.tsx 23 lines
import __studioImage7ea9823c from "../assets/b9d1bb2c1c5b648d.webp";
import * as React from "react";
import QuoteRequest from "../quote-request";
import defaults from "../../studio-defaults.json";
import { slot } from "../../slots";
export const states = ["default", "hover", "active", "disabled", "error"] as const;
export default function QuoteRequestSpecimen({ state }: { state?: (typeof states)[number] }) {
const sample = defaults.sample;
return (
<QuoteRequest
state={state}
sceneImage={slot(
"scene",
__studioImage7ea9823c,
)}
sceneAlt="A tradesperson arriving at a family home to look at the job"
responseTime="Your quote arrives within 1 business day."
copy={{ nameLabel: sample.fields[0].label }}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalQuoteRequest |
React.ReactNode |
|
intro OptionalQuoteRequest |
{ lead: string; text: string }[] |
|
services OptionalQuoteRequest |
QuoteService[] |
|
contactTimes OptionalQuoteRequest |
QuoteContactTime[] |
|
sceneImage OptionalQuoteRequest |
string |
|
sceneAlt OptionalQuoteRequest |
string |
|
ctaLabel OptionalQuoteRequest |
string |
|
responseTime OptionalQuoteRequest |
string |
|
privacy OptionalQuoteRequest |
string |
|
detailsMax OptionalQuoteRequest |
number |
|
maxPhotos OptionalQuoteRequest |
number |
|
maxPhotoMB OptionalQuoteRequest |
number |
|
emailField OptionalQuoteRequest |
boolean |
|
copy OptionalQuoteRequest |
Partial<QuoteRequestCopy> |
|
onSubmit OptionalQuoteRequest |
(values: QuoteRequestValues) => void | PromiseLike<unknown> |
|
state OptionalQuoteRequest |
"default" | "hover" | "active" | "disabled" | "error" |
|
className OptionalQuoteRequest |
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-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.
scene- A wide atmosphere photo behind or beside the copy.
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
b9d1bb2c1c5b648d.webp
image/webp · 104 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB