Property Listing 2
Cabin stay calculator: walks the guest through their stay hour by hour, down a path that ends at a sticky
Use it in a prompt
Use offer/property-listing-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/offer/property-listing-2.tsx. - Import it and pass your copy and images (Props tab):
import { PropertyListing2 } from "@/components/funneldna/offer/property-listing-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/property-listing-2/component.tsx 744 lines
// layout: path-to-action
// Cabin stay calculator: walks the guest through their stay hour by hour, down a path that ends at a sticky
// booking card with a live total (nightly rate x nights + cleaning fee) and one action: check availability.
import * as React from "react";
import {
AlertCircle,
BedDouble,
Car,
Check,
Coffee,
CookingPot,
Dog,
Flame,
MapPin,
Minus,
Mountain,
Plus,
Sailboat,
ShieldCheck,
Users,
WashingMachine,
Waves,
Wifi,
} from "lucide-react";
import type { LucideIcon } from "lucide-react";
export type ListingIcon =
| "wifi"
| "fire"
| "lake"
| "kayak"
| "bed"
| "parking"
| "coffee"
| "kitchen"
| "laundry"
| "pets"
| "guests"
| "pin"
| "view"
| "check";
export type ListingStop = {
/** Days after check-in (0 = arrival day), or "last" for check-out day. */
day: number | "last";
time: string;
/** One sentence the guest can picture. */
line: string;
/** Optional single-word line for emphasis, e.g. "Rested." */
punch?: string;
image?: string;
imageAlt?: string;
};
export type StayRequest = { checkIn: string; checkOut: string; nights: number; guests: number; total: number };
export type PropertyListing2Copy = typeof COPY;
export type PropertyListing2Props = {
headline?: React.ReactNode;
/** One-sentence paragraphs under the headline. */
lead?: string[];
facts?: { icon: ListingIcon; label: string }[];
/** Path heading before the dates are valid. */
pathTitle?: string;
/** Path heading once the dates are valid; {from} and {to} become weekday names. */
pathTitleDates?: string;
stops?: ListingStop[];
amenitiesTitle?: string;
amenities?: { icon: ListingIcon; label: string }[];
rulesTitle?: string;
rules?: { label: string; value: string }[];
pathEndLine?: string;
pathEndButton?: string;
nightlyRate?: number;
cleaningFee?: number;
/** Currency symbol placed before every amount. */
currency?: string;
minStay?: number;
maxStay?: number;
maxGuests?: number;
/** Nights already booked, as YYYY-MM-DD. */
bookedDates?: string[];
/** First bookable check-in (YYYY-MM-DD); defaults to today. */
earliestDate?: string;
/** What the same nights cost elsewhere, shown beside the total. */
alternative?: { label: string; nightly: number };
defaultCheckIn?: string;
defaultCheckOut?: string;
defaultGuests?: number;
copy?: Partial<PropertyListing2Copy>;
onAction?: (stay: StayRequest) => void;
className?: string;
};
export function PropertyListing2(props: PropertyListing2Props) {
const {
headline = DEFAULT_HEADLINE,
lead = DEFAULT_LEAD,
facts = DEFAULT_FACTS,
pathTitle = "Your weekend, hour by hour",
pathTitleDates = "Your {from} to {to}, hour by hour",
stops = DEFAULT_STOPS,
amenitiesTitle = "Everything's already here when you walk in",
amenities = DEFAULT_AMENITIES,
rulesTitle = "A few house rules keep the lake quiet",
rules = DEFAULT_RULES,
pathEndLine = "That's your weekend. Now pick the dates.",
pathEndButton = "Choose your dates",
nightlyRate = 189,
cleaningFee = 95,
currency = "$",
minStay = 2,
maxStay,
maxGuests = 4,
bookedDates = NO_DATES,
earliestDate,
alternative,
defaultCheckIn = "",
defaultCheckOut = "",
defaultGuests = 2,
copy,
onAction,
className,
} = props;
const t: PropertyListing2Copy = { ...COPY, ...copy };
const uid = React.useId();
const id = (part: string) => `${uid}-${part}`;
const min = Math.max(1, Math.floor(minStay));
const maxG = Math.max(1, Math.floor(maxGuests));
const [checkIn, setCheckIn] = React.useState(defaultCheckIn);
const [checkOut, setCheckOut] = React.useState(defaultCheckOut);
const [guests, setGuests] = React.useState(() => clamp(defaultGuests, 1, maxG));
const [open, setOpen] = React.useState(false);
const checkInRef = React.useRef<HTMLInputElement>(null);
const today = React.useMemo(() => (isISO(earliestDate) ? earliestDate : localISO(new Date())), [earliestDate]);
const booked = React.useMemo(() => new Set(bookedDates), [bookedDates]);
const g = clamp(guests, 1, maxG);
const money = (n: number) =>
currency + n.toLocaleString("en-US", { minimumFractionDigits: n % 1 ? 2 : 0, maximumFractionDigits: 2 });
const nightsWord = (n: number) => (n === 1 ? t.nightOne : fill(t.nightMany, { n }));
const guestsWord = (n: number) => (n === 1 ? t.guestOne : fill(t.guestMany, { n }));
const v = checkStay(checkIn, checkOut, today, min, maxStay, booked, t, nightsWord);
const total = v.valid ? v.nights * nightlyRate + cleaningFee : 0;
const span = v.valid ? v.nights : min;
const hasIn = isISO(checkIn);
const minChip = fill(t.minimumChip, { min });
const pathHeading = v.valid ? fill(pathTitleDates, { from: weekday(checkIn), to: weekday(checkOut) }) : pathTitle;
const stopLabel = (stop: ListingStop) => {
const day = stop.day === "last" ? span : clamp(stop.day, 0, span);
const name = hasIn ? weekday(addDays(checkIn, day)) : fill(t.dayFallback, { n: day + 1 });
return `${name} · ${stop.time}`;
};
const onCheckIn = (e: React.ChangeEvent<HTMLInputElement>) => {
const next = e.target.value;
setCheckIn(next);
if (isISO(next) && !isISO(checkOut)) setCheckOut(addDays(next, min));
};
const goToDates = () => {
setOpen(true);
requestAnimationFrame(() => checkInRef.current?.focus());
};
const submit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
if (!v.valid) return;
onAction?.({ checkIn, checkOut, nights: v.nights, guests: g, total });
};
return (
<section className={cx("cf-property-listing-2", className)} aria-labelledby={id("h")}>
<style>{CSS}</style>
<div className="plx-wrap">
<header className="plx-head">
<h2 className="plx-h2" id={id("h")}>
{headline}
</h2>
{lead.length > 0 ? (
<div className="plx-lead">
{lead.map((line) => (
<p key={line}>{line}</p>
))}
</div>
) : null}
{facts.length > 0 ? (
<ul className="plx-facts">
{facts.map((fact) => (
<li key={fact.label} className="plx-chip">
<ListingGlyph name={fact.icon} size={16} />
<span>{fact.label}</span>
</li>
))}
</ul>
) : null}
</header>
<div className="plx-grid">
<div className="plx-main">
<h3 className="plx-pathtitle">{pathHeading}</h3>
<p className="plx-hint">{t.swipeHint}</p>
<div className="plx-path">
<ol className="plx-stops" tabIndex={0} aria-label={pathHeading}>
{stops.map((stop, i) => (
<li
key={`${stop.time}-${i}`}
className={cx("plx-item plx-stop", !stop.image && "is-text")}
style={{ "--i": i } as React.CSSProperties}
>
<span className="plx-dot" aria-hidden="true" />
<span className="plx-seg" aria-hidden="true">
<span className="plx-segfill" />
</span>
<p className="plx-time">{stopLabel(stop)}</p>
<p className="plx-line">{stop.line}</p>
{stop.image ? (
<div className="plx-photo">
<img src={stop.image} alt={stop.imageAlt ?? ""} width={960} height={600} loading="lazy" decoding="async" />
</div>
) : null}
{stop.punch ? <p className="plx-punch">{stop.punch}</p> : null}
</li>
))}
</ol>
{amenities.length > 0 || rules.length > 0 ? (
<div className="plx-item plx-info">
<span className="plx-dot" aria-hidden="true" />
<span className="plx-seg" aria-hidden="true">
<span className="plx-segfill" />
</span>
{amenities.length > 0 ? (
<>
<h3 className="plx-sub">{amenitiesTitle}</h3>
<ul className="plx-amen">
{amenities.map((item) => (
<li key={item.label}>
<ListingGlyph name={item.icon} size={20} />
<span>{item.label}</span>
</li>
))}
</ul>
</>
) : null}
{rules.length > 0 ? (
<>
<h3 className={cx("plx-sub", amenities.length > 0 && "plx-sub--rules")}>{rulesTitle}</h3>
<dl className="plx-rules">
{rules.map((rule) => (
<div className="plx-rule" key={rule.label}>
<dt>{rule.label}</dt>
<dd>{rule.value}</dd>
</div>
))}
</dl>
</>
) : null}
</div>
) : null}
<div className="plx-item plx-end">
<span className="plx-dot is-end" aria-hidden="true" />
<p className="plx-endline">{pathEndLine}</p>
<button type="button" className="plx-btn" onClick={goToDates}>
{pathEndButton}
</button>
</div>
</div>
</div>
<div className="plx-aside">
<form className={cx("plx-card", open && "is-open")} onSubmit={submit} noValidate aria-label={t.cardLabel}>
<div className="plx-bar">
<div aria-live="polite">
<span className="plx-barnum">
{v.valid ? (
money(total)
) : (
<>
{money(nightlyRate)} <small>{t.perNight}</small>
</>
)}
</span>
<span className="plx-barsub">{v.valid ? `${nightsWord(v.nights)} · ${guestsWord(g)}` : minChip}</span>
</div>
<button
type="button"
className={cx("plx-btn plx-btn--bar", open && "is-quiet")}
aria-expanded={open}
aria-controls={id("body")}
onClick={() => setOpen((o) => !o)}
>
{open ? t.sheetClose : v.valid ? t.sheetReview : t.sheetOpen}
</button>
</div>
<div className="plx-body" id={id("body")}>
<div className="plx-price" aria-live="polite">
{v.valid ? (
<>
<p className="plx-total">
<span className="plx-num" key={`total-${total}`}>
{money(total)}
</span>
<span className="plx-for">{fill(t.totalFor, { nights: nightsWord(v.nights) })}</span>
</p>
{alternative ? (
<p className="plx-alt">
{richFill(t.alternative, {
amount: <strong>{money(alternative.nightly * v.nights)}</strong>,
label: alternative.label,
})}
</p>
) : null}
</>
) : (
<>
<p className="plx-total">
<span className="plx-num" key="rate">
{money(nightlyRate)}
</span>
<span className="plx-for">{t.perNight}</span>
<span className="plx-chip plx-chip--card">{minChip}</span>
</p>
<p className="plx-alt">{t.chooseDates}</p>
</>
)}
</div>
<div className="plx-dates">
<div className="plx-field">
<label className="plx-label" htmlFor={id("in")}>
{t.checkIn}
</label>
<input
ref={checkInRef}
id={id("in")}
className="plx-input"
type="date"
value={checkIn}
min={today}
onChange={onCheckIn}
aria-invalid={v.field === "in" ? true : undefined}
aria-describedby={v.field === "in" ? id("err") : undefined}
/>
</div>
<div className="plx-field">
<label className="plx-label" htmlFor={id("out")}>
{t.checkOut}
</label>
<input
id={id("out")}
className="plx-input"
type="date"
value={checkOut}
min={hasIn ? addDays(checkIn, 1) : today}
onChange={(e) => setCheckOut(e.target.value)}
aria-invalid={v.field === "out" ? true : undefined}
aria-describedby={v.field === "out" ? id("err") : undefined}
/>
</div>
</div>
{v.error ? (
<p className="plx-error" id={id("err")} role="alert">
<AlertCircle className="plx-inl" size={16} strokeWidth={2.5} aria-hidden="true" />
{v.error}
</p>
) : null}
<div className="plx-guests" role="group" aria-labelledby={id("glabel")}>
<div>
<span className="plx-glabel" id={id("glabel")}>
{t.guests}
</span>
<span className="plx-ghint">{fill(t.guestsHint, { max: maxG })}</span>
</div>
<div className="plx-stepper">
<button
type="button"
className="plx-step"
aria-label={t.removeGuest}
disabled={g <= 1}
onClick={() => setGuests(clamp(g - 1, 1, maxG))}
>
<Minus size={20} strokeWidth={2.5} aria-hidden="true" />
</button>
<output className="plx-gval" aria-live="polite">
{g}
</output>
<button
type="button"
className="plx-step"
aria-label={t.addGuest}
disabled={g >= maxG}
onClick={() => setGuests(clamp(g + 1, 1, maxG))}
>
<Plus size={20} strokeWidth={2.5} aria-hidden="true" />
</button>
</div>
</div>
{v.valid ? (
<ul className="plx-rows">
<li>
<span>{fill(t.nightsRow, { rate: money(nightlyRate), nights: nightsWord(v.nights) })}</span>
<span>{money(v.nights * nightlyRate)}</span>
</li>
{cleaningFee > 0 ? (
<li>
<span>{t.cleaningRow}</span>
<span>{money(cleaningFee)}</span>
</li>
) : null}
</ul>
) : null}
<p className="plx-instr">{t.instruction}</p>
<button type="submit" className="plx-btn plx-submit" disabled={!v.valid}>
{t.button}
</button>
{t.note ? (
<p className="plx-note">
<ShieldCheck className="plx-inl" size={16} strokeWidth={2.5} aria-hidden="true" />
{t.note}
</p>
) : null}
</div>
</form>
</div>
</div>
</div>
</section>
);
}
export default PropertyListing2;
function ListingGlyph({ name, size }: { name: ListingIcon; size: number }) {
const Icon = ICONS[name] ?? Check;
return <Icon size={size} strokeWidth={2.5} aria-hidden="true" />;
}
type StayCheck = { valid: boolean; nights: number; error: string; field: "in" | "out" | null };
function checkStay(
checkIn: string,
checkOut: string,
today: string,
min: number,
max: number | undefined,
booked: Set<string>,
t: PropertyListing2Copy,
nightsWord: (n: number) => string,
): StayCheck {
const none: StayCheck = { valid: false, nights: 0, error: "", field: null };
if (isISO(checkIn) && checkIn < today) return { ...none, error: fill(t.errPast, { date: shortDate(today) }), field: "in" };
if (!isISO(checkIn) || !isISO(checkOut)) return none;
const nights = daysBetween(checkIn, checkOut);
if (nights <= 0) return { ...none, error: t.errOrder, field: "out" };
if (nights < min) {
return { ...none, error: fill(t.errMin, { nights: nightsWord(min), date: shortDate(addDays(checkIn, min)) }), field: "out" };
}
if (max && nights > max) return { ...none, error: fill(t.errMax, { nights: nightsWord(max) }), field: "out" };
for (let i = 0; i < Math.min(nights, 366); i += 1) {
const night = addDays(checkIn, i);
if (booked.has(night)) return { ...none, error: fill(t.errBooked, { date: shortDate(night) }), field: i === 0 ? "in" : "out" };
}
return { valid: true, nights, error: "", field: null };
}
const DAY_MS = 86400000;
function isISO(value?: string): value is string {
return typeof value === "string" && /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/.test(value) && !Number.isNaN(toUTC(value));
}
function toUTC(iso: string) {
const [y, m, d] = iso.split("-").map(Number);
return Date.UTC(y, m - 1, d);
}
function addDays(iso: string, n: number) {
return new Date(toUTC(iso) + n * DAY_MS).toISOString().slice(0, 10);
}
function daysBetween(a: string, b: string) {
return Math.round((toUTC(b) - toUTC(a)) / DAY_MS);
}
function weekday(iso: string) {
return new Date(toUTC(iso)).toLocaleDateString("en-US", { weekday: "long", timeZone: "UTC" });
}
function shortDate(iso: string) {
return new Date(toUTC(iso)).toLocaleDateString("en-US", { weekday: "short", month: "short", day: "numeric", timeZone: "UTC" });
}
function localISO(d: Date) {
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
}
function pad(n: number) {
return String(n).padStart(2, "0");
}
function clamp(n: number, lo: number, hi: number) {
return Math.min(hi, Math.max(lo, n));
}
function fill(tpl: string, vars: Record<string, string | number>) {
return tpl.replace(/[{]([a-zA-Z]+)[}]/g, (match, key: string) => (key in vars ? String(vars[key]) : match));
}
function richFill(tpl: string, vars: Record<string, React.ReactNode>) {
return tpl.split(/([{][a-zA-Z]+[}])/g).map((part, i) => {
const key = part.startsWith("{") && part.endsWith("}") ? part.slice(1, -1) : "";
return key && key in vars ? <React.Fragment key={i}>{vars[key]}</React.Fragment> : part;
});
}
function cx(...parts: (string | false | null | undefined)[]) {
return parts.filter(Boolean).join(" ");
}
const ICONS: Record<ListingIcon, LucideIcon> = {
wifi: Wifi,
fire: Flame,
lake: Waves,
kayak: Sailboat,
bed: BedDouble,
parking: Car,
coffee: Coffee,
kitchen: CookingPot,
laundry: WashingMachine,
pets: Dog,
guests: Users,
pin: MapPin,
view: Mountain,
check: Check,
};
const COPY = {
cardLabel: "Book your stay",
perNight: "/ night",
minimumChip: "{min}-night minimum",
totalFor: "total for {nights}",
chooseDates: "Choose your dates to see your total.",
alternative: "vs. {amount} for {label}, same nights",
checkIn: "Check-in",
checkOut: "Check-out",
guests: "Guests",
guestsHint: "Up to {max}",
addGuest: "Add a guest",
removeGuest: "Remove a guest",
nightsRow: "{rate} × {nights}",
cleaningRow: "Cleaning fee",
instruction: "Pick your dates, then click the button below to check availability.",
button: "Check availability",
note: "No charge to check dates.",
errPast: "Check-in can't be before {date}.",
errOrder: "Check-out has to be after check-in.",
errMin: "The minimum stay is {nights}. Pick {date} or later for check-out.",
errMax: "Stays can be up to {nights}.",
errBooked: "{date} is already booked. Try different dates.",
nightOne: "1 night",
nightMany: "{n} nights",
guestOne: "1 guest",
guestMany: "{n} guests",
sheetOpen: "Choose dates",
sheetReview: "Review stay",
sheetClose: "Hide",
swipeHint: "Swipe through your weekend",
dayFallback: "Day {n}",
};
const NO_DATES: string[] = [];
const DEFAULT_HEADLINE = (
<>
Your next weekend: a dock, a wood stove and <span className="plx-em">nowhere to be</span>
</>
);
const DEFAULT_LEAD = [
"Larkspur Ridge is a two-bedroom cabin right on the water.",
"Pick your dates and your total adds up as you go.",
];
const DEFAULT_FACTS: { icon: ListingIcon; label: string }[] = [
{ icon: "bed", label: "2 bedrooms + loft" },
{ icon: "guests", label: "Sleeps 4" },
{ icon: "lake", label: "Private dock" },
{ icon: "pin", label: "North shore, Larkspur Lake" },
];
const DEFAULT_STOPS: ListingStop[] = [
{ day: 0, time: "4:00 pm", line: "You pull off the gravel drive and the lake is right there." },
{ day: 0, time: "6:30 pm", line: "You sit at the end of the dock while the sun drops behind the ridge." },
{ day: 0, time: "9:00 pm", line: "The wood stove is going and nobody reaches for a screen." },
{ day: 1, time: "7:15 am", line: "You wake up in the loft to the sound of water on the rocks." },
{ day: 1, time: "10:00 am", line: "Kayaks off the dock. Coffee waiting on the porch." },
{ day: "last", time: "11:00 am", line: "You lock up and drive home slower than you came.", punch: "Rested." },
];
const DEFAULT_AMENITIES: { icon: ListingIcon; label: string }[] = [
{ icon: "wifi", label: "Fast Wi-Fi" },
{ icon: "fire", label: "Wood stove, firewood stacked" },
{ icon: "kayak", label: "Two kayaks and life vests" },
{ icon: "kitchen", label: "Full kitchen" },
{ icon: "coffee", label: "Pour-over coffee setup" },
{ icon: "parking", label: "Parking for 2 cars" },
{ icon: "laundry", label: "Washer and dryer" },
{ icon: "pets", label: "Dogs welcome (up to 2)" },
];
const DEFAULT_RULES = [
{ label: "Check-in", value: "After 4:00 pm" },
{ label: "Check-out", value: "By 11:00 am" },
{ label: "Quiet hours", value: "10 pm to 7 am" },
{ label: "Parties or events", value: "Not allowed" },
{ label: "Smoking", value: "Outside only" },
];
const R = ".cf-property-listing-2";
const CSS = `
${R}{--plx-gutter:clamp(16px,5vw,48px);background:var(--surface);color:var(--ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) var(--plx-gutter) clamp(64px,8.5vw,120px);overflow-x:clip}
${R} *,${R} *::before,${R} *::after{box-sizing:border-box}
${R} :where(h2,h3,p,ul,ol,dl,dd){margin:0}
${R} :where(ul,ol){list-style:none;padding:0}
${R} .plx-wrap{max-width:1120px;margin:0 auto}
${R} .plx-head{max-width:46rem;margin-bottom:clamp(40px,5vw,64px)}
${R} .plx-h2{font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06;text-wrap:balance;margin-bottom:16px}
${R} .plx-em{color:var(--accent)}
${R} .plx-lead{display:grid;gap:8px}
${R} .plx-lead p{font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;text-wrap:pretty}
${R} .plx-facts{display:flex;flex-wrap:wrap;gap:8px;margin-top:24px}
${R} .plx-chip{display:inline-flex;align-items:center;gap:8px;min-height:32px;padding:4px 12px;border-radius:999px;background:color-mix(in oklch,var(--ink) 6%,var(--surface));color:var(--ink);font-size:.875rem;font-weight:800;line-height:1.2}
${R} .plx-chip svg{color:var(--accent);flex:none}
${R} .plx-chip--card{background:color-mix(in oklch,var(--ink) 6%,var(--card))}
${R} .plx-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(320px,400px);gap:clamp(32px,5vw,72px);align-items:start}
${R} .plx-main{min-width:0}
${R} .plx-aside{align-self:stretch}
${R} .plx-pathtitle,${R} .plx-sub,${R} .plx-endline,${R} .plx-punch{font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);letter-spacing:-0.01em;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;text-wrap:balance}
${R} .plx-pathtitle{margin-bottom:32px}
${R} .plx-hint{display:none}
${R} .plx-path{position:relative;padding-left:44px}
${R} .plx-stops{display:grid;gap:40px}
${R} .plx-stops:focus-visible{outline:3px solid var(--accent);outline-offset:6px;border-radius:12px}
${R} .plx-item{position:relative}
${R} .plx-stop{display:flex;flex-direction:column;animation:plx-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:min(calc(var(--i,0) * .07s),.28s)}
${R} .plx-dot{position:absolute;left:-44px;top:0;width:24px;height:24px;border-radius:50%;background:var(--surface);border:3px solid var(--accent-fill,var(--accent))}
${R} .plx-dot.is-end{background:var(--accent-fill,var(--accent))}
${R} .plx-seg{position:absolute;left:-33px;top:28px;bottom:-36px;width:2px;border-radius:2px;background:oklch(from var(--ink) l c h / .14);overflow:clip}
${R} .plx-segfill{position:absolute;inset:0;background:var(--accent-fill,var(--accent));transform-origin:top}
${R} .plx-time{font-size:.9375rem;line-height:1.4;font-weight:800;color:var(--accent);font-variant-numeric:tabular-nums;margin-bottom:8px}
${R} .plx-line{font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;text-wrap:pretty;max-width:36em}
${R} .plx-punch{margin-top:12px}
${R} .plx-photo{margin-top:16px;border-radius:12px;overflow:hidden;aspect-ratio:16/10;background:color-mix(in oklch,var(--ink) 6%,var(--surface))}
${R} .plx-photo img{display:block;width:100%;height:100%;object-fit:cover;object-position:center}
${R} .plx-info,${R} .plx-end{margin-top:40px}
${R} .plx-sub{margin-bottom:16px}
${R} .plx-sub--rules{margin-top:40px}
${R} .plx-amen{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px 24px}
${R} .plx-amen li{display:flex;align-items:flex-start;gap:12px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5}
${R} .plx-amen svg{color:var(--accent);flex:none;margin-top:3px}
${R} .plx-rules{border-radius:10px;background:color-mix(in oklch,var(--ink) 4%,var(--surface));padding:4px 20px}
${R} .plx-rule{display:flex;justify-content:space-between;align-items:baseline;gap:16px;padding:12px 0;border-top:1px solid oklch(from var(--ink) l c h / .1)}
${R} .plx-rule:first-child{border-top:0}
${R} .plx-rule dt{font-size:.9375rem;font-weight:600;line-height:1.4}
${R} .plx-rule dd{font-size:1.0625rem;font-weight:800;line-height:1.4;text-align:right}
${R} .plx-endline{margin-bottom:16px}
${R} .plx-end .plx-btn{width:100%;min-height:64px}
${R} .plx-card{position:sticky;top:24px;background:var(--card);color:var(--ink);border:1px solid color-mix(in oklch,var(--accent) 30%,var(--card));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(.22 .03 260 / .22),0 12px 24px -8px oklch(.22 .03 260 / .32)));padding:clamp(20px,3vw,32px)}
${R} .plx-bar{display:none}
${R} .plx-total{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px}
${R} .plx-num{display:inline-block;font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums;animation:plx-pop .3s cubic-bezier(.2,.7,.2,1) both}
${R} .plx-for{font-size:1.0625rem;font-weight:600;color:var(--muted)}
${R} .plx-total .plx-chip{align-self:center}
${R} .plx-alt{margin-top:12px;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted);text-wrap:pretty}
${R} .plx-alt strong{color:var(--ink);font-weight:800}
${R} .plx-dates{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px;margin-top:24px}
${R} .plx-field{min-width:0}
${R} .plx-label{display:block;font-size:1rem;font-weight:700;line-height:1.2;color:var(--label-ink,var(--ink));margin-bottom:8px}
${R} .plx-input{display:block;width:100%;min-width:0;min-height:56px;padding:0 12px;font-family:var(--font-body);font-size:1.0625rem;color:var(--field-ink);background:var(--field);border:1px solid var(--field-border,color-mix(in oklch,var(--ink) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));-webkit-appearance:none;appearance:none;transition:border-color .16s ease,box-shadow .16s ease}
${R} .plx-input::-webkit-date-and-time-value{text-align:left}
${R} .plx-input:hover{border-color:color-mix(in oklch,var(--field-ink) 45%,var(--field))}
${R} .plx-input:focus{outline:none;border-color:var(--field-focus,var(--accent));box-shadow:0 0 0 3px oklch(from var(--field-focus,var(--accent)) l c h / .35)}
${R} .plx-input[aria-invalid=true]{border-color:var(--danger);box-shadow:0 0 0 3px oklch(from var(--danger) l c h / .2)}
${R} .plx-error{margin-top:12px;color:var(--danger);font-size:.9375rem;line-height:1.4;font-weight:600;text-wrap:pretty}
${R} .plx-inl{display:inline-block;vertical-align:-0.15em;margin-inline-end:.4em}
${R} .plx-guests{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:16px;min-height:56px;padding:6px 6px 6px 14px;background:var(--field);color:var(--field-ink);border:1px solid var(--field-border,color-mix(in oklch,var(--ink) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px))}
${R} .plx-glabel{display:block;font-size:1rem;font-weight:700;line-height:1.2}
${R} .plx-ghint{display:block;font-size:.9375rem;font-weight:500;line-height:1.4;color:color-mix(in oklch,var(--field-ink) 72%,var(--field))}
${R} .plx-stepper{display:flex;align-items:center;gap:4px}
${R} .plx-step{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:1px solid var(--button-2-border,transparent);border-radius:calc(var(--field-radius,var(--radius,12px)) - 4px);background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));box-shadow:var(--button-2-shadow,var(--shadow-sm));cursor:pointer;transition:transform .16s ease,background .16s ease}
${R} .plx-step:hover:not(:disabled){background:oklch(from var(--button-2-bg,var(--secondary)) calc(l - .04) c h)}
${R} .plx-step:active:not(:disabled){transform:translateY(1px)}
${R} .plx-step:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:2px}
${R} .plx-step:disabled{opacity:.45;cursor:not-allowed;box-shadow:none}
${R} .plx-gval{min-width:2.5ch;text-align:center;font-family:var(--font-display);font-weight:800;font-size:clamp(1.125rem,1.5vw,1.375rem);font-variant-numeric:tabular-nums}
${R} .plx-rows{margin-top:20px;padding:4px 16px;border-radius:10px;background:color-mix(in oklch,var(--ink) 4%,var(--card))}
${R} .plx-rows li{display:flex;justify-content:space-between;gap:12px;padding:8px 0;font-size:1rem;line-height:1.4}
${R} .plx-rows li + li{border-top:1px solid oklch(from var(--ink) l c h / .1)}
${R} .plx-rows span:last-child{font-weight:800;font-variant-numeric:tabular-nums}
${R} .plx-instr{margin-top:24px;font-size:1rem;line-height:1.5;font-weight:500;text-wrap:pretty}
${R} .plx-submit{width:100%;margin-top:12px}
${R} .plx-note{margin-top:12px;text-align:center;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted);text-wrap:pretty}
${R} .plx-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:56px;padding:0 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));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;white-space:nowrap;color:var(--button-ink,var(--cta-ink));text-shadow:var(--button-text-shadow,none);background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l + .04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .02) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h),0 1px 2px oklch(from var(--shadow,oklch(.22 .03 260)) l c h / .3),0 8px 16px -6px oklch(from var(--shadow,oklch(.22 .03 260)) l c h / .45));cursor:pointer;-webkit-tap-highlight-color:transparent;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
${R} .plx-btn:hover:not(:disabled){background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - .01) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .07) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + .1) c h / .6),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .2) c h),0 1px 2px oklch(from var(--shadow,oklch(.22 .03 260)) l c h / .32),0 10px 20px -6px oklch(from var(--shadow,oklch(.22 .03 260)) l c h / .5))}
${R} .plx-btn:active:not(:disabled){transform:translateY(1px);box-shadow:inset 0 2px 4px oklch(from var(--button-bg,var(--cta)) calc(l - .22) c h / .5),inset 0 -2px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h),0 1px 2px oklch(from var(--shadow,oklch(.22 .03 260)) l c h / .3)}
${R} .plx-btn:focus-visible{outline:3px solid var(--button-bg,var(--cta));outline-offset:3px}
${R} .plx-btn:disabled{background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));text-shadow:none;box-shadow:none;cursor:not-allowed}
${R} .plx-btn.is-quiet,${R} .plx-btn.is-quiet:hover:not(:disabled){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))}
${R} .plx-btn.is-quiet:hover:not(:disabled){background:oklch(from var(--button-2-bg,var(--secondary)) calc(l - .04) c h)}
${R} .plx-btn.is-quiet:active:not(:disabled){box-shadow:none}
@media (max-width:959px){
${R} .plx-grid{grid-template-columns:minmax(0,1fr)}
${R} .plx-aside{display:contents}
${R} .plx-card{top:auto;bottom:8px;z-index:5;margin-top:40px;padding:12px 12px 12px 16px}
${R} .plx-card.is-open{padding:16px}
${R} .plx-bar{display:flex;align-items:center;justify-content:space-between;gap:12px}
${R} .plx-barnum{display:block;font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:1.625rem;line-height:1.1;letter-spacing:-0.02em;font-variant-numeric:tabular-nums}
${R} .plx-barnum small{font-family:var(--font-body);font-size:.9375rem;font-weight:600;letter-spacing:0;color:var(--muted)}
${R} .plx-barsub{display:block;margin-top:2px;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
${R} .plx-bar > div{flex:1 1 auto;min-width:0}
${R} .plx-btn--bar{flex:none;min-height:48px;padding:0 18px;font-size:1rem}
${R} .plx-body{display:none}
${R} .plx-card.is-open .plx-body{display:block;max-height:min(68vh,560px);overflow-y:auto;overscroll-behavior:contain;margin-top:12px;padding:4px 2px 2px}
${R} .plx-price{display:none}
${R} .plx-dates{margin-top:8px}
${R} .plx-pathtitle{margin-bottom:8px}
${R} .plx-hint{display:block;margin-bottom:16px;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted)}
${R} .plx-path{padding-left:0}
${R} .plx-dot,${R} .plx-seg{display:none}
${R} .plx-stops{display:flex;gap:12px;overflow-x:auto;scroll-snap-type:x mandatory;margin-inline:calc(var(--plx-gutter) * -1);padding:0 var(--plx-gutter) 8px;scroll-padding-inline:var(--plx-gutter);scrollbar-width:none}
${R} .plx-stops::-webkit-scrollbar{display:none}
${R} .plx-stop{flex:0 0 min(80%,320px);scroll-snap-align:start}
${R} .plx-stop .plx-photo{order:-1;margin:0 0 12px;aspect-ratio:4/3}
${R} .plx-stop.is-text{justify-content:space-between;gap:16px;padding:20px;border-radius:12px;background:color-mix(in oklch,var(--ink) 5%,var(--surface))}
${R} .plx-stop.is-text .plx-time{font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);letter-spacing:-0.01em;font-size:1.3125rem;line-height:1.15;margin-bottom:0;text-wrap:balance}
${R} .plx-line{font-size:1.125rem}
}
@supports (animation-timeline: view()){@media (prefers-reduced-motion: no-preference){${R} .plx-segfill{animation:plx-fill linear both;animation-timeline:view();animation-range:entry 100% cover 60%}}}
@media (prefers-reduced-motion: reduce){${R} .plx-stop,${R} .plx-num{animation:none}${R} .plx-btn,${R} .plx-step,${R} .plx-input{transition:none}}
@keyframes plx-rise{from{opacity:.82;transform:translateY(8px)}}
@keyframes plx-pop{from{opacity:.82;transform:translateY(4px)}}
@keyframes plx-fill{from{transform:scaleY(0)}to{transform:scaleY(1)}}
`;
pieces/offer/property-listing-2/specimen.tsx 87 lines
import __studioImage6034769e from "../assets/bea5506d98298c17.webp";
import __studioImage67782b33 from "../assets/d95b6563d88c9e5a.webp";
import __studioImage1059806e from "../assets/b26f428aed45872e.webp";
import * as React from "react";
import { PropertyListing2 } from "../property-listing-2";
import type { ListingStop } from "../property-listing-2";
import { slot } from "../../slots";
export const states = ["default", "error", "disabled"];
export default function PropertyListing2Specimen({ state = "default" }: { state?: string }) {
const friday = React.useMemo(() => nextFriday(), []);
const stops: ListingStop[] = [
{ day: 0, time: "4:00 pm", line: "You pull off the gravel drive and the lake is right there." },
{
day: 0,
time: "6:30 pm",
line: "You sit at the end of the dock while the sun drops behind the ridge.",
image: slot(
"item-1",
__studioImage6034769e,
),
imageAlt: "Wooden dock with two chairs reaching into a calm lake at sunset",
},
{
day: 0,
time: "9:00 pm",
line: "The wood stove is going and nobody reaches for a screen.",
image: slot(
"item-2",
__studioImage67782b33,
),
imageAlt: "Wood stove burning in the cabin's pine-walled living room",
},
{
day: 1,
time: "7:15 am",
line: "You wake up in the loft to the sound of water on the rocks.",
image: slot(
"item-3",
__studioImage1059806e,
),
imageAlt: "Sleeping loft with a white bed under a triangular window facing the lake",
},
{ day: 1, time: "10:00 am", line: "Kayaks off the dock. Coffee waiting on the porch." },
{ day: "last", time: "11:00 am", line: "You lock up and drive home slower than you came.", punch: "Rested." },
];
const dates =
state === "disabled"
? {}
: { defaultCheckIn: iso(friday), defaultCheckOut: iso(addDays(friday, state === "error" ? 1 : 2)) };
return (
<PropertyListing2
key={state}
{...dates}
defaultGuests={state === "error" ? 4 : state === "disabled" ? 1 : 2}
nightlyRate={189}
cleaningFee={95}
minStay={2}
maxStay={14}
maxGuests={4}
bookedDates={[iso(addDays(friday, 14)), iso(addDays(friday, 15))]}
alternative={{ label: "two lake-view hotel rooms", nightly: 310 }}
stops={stops}
/>
);
}
function nextFriday() {
const d = new Date();
d.setHours(12, 0, 0, 0);
d.setDate(d.getDate() + ((5 - d.getDay() + 7) % 7) + 7);
return d;
}
function addDays(d: Date, n: number) {
const next = new Date(d);
next.setDate(next.getDate() + n);
return next;
}
function iso(d: Date) {
return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`;
}
| Name | Type | Details |
|---|---|---|
headline OptionalPropertyListing2 |
React.ReactNode |
|
lead OptionalPropertyListing2 |
string[] |
|
facts OptionalPropertyListing2 |
{ icon: ListingIcon; label: string }[] |
|
pathTitle OptionalPropertyListing2 |
string |
|
pathTitleDates OptionalPropertyListing2 |
string |
|
stops OptionalPropertyListing2 |
ListingStop[] |
|
amenitiesTitle OptionalPropertyListing2 |
string |
|
amenities OptionalPropertyListing2 |
{ icon: ListingIcon; label: string }[] |
|
rulesTitle OptionalPropertyListing2 |
string |
|
rules OptionalPropertyListing2 |
{ label: string; value: string }[] |
|
pathEndLine OptionalPropertyListing2 |
string |
|
pathEndButton OptionalPropertyListing2 |
string |
|
nightlyRate OptionalPropertyListing2 |
number |
|
cleaningFee OptionalPropertyListing2 |
number |
|
currency OptionalPropertyListing2 |
string |
|
minStay OptionalPropertyListing2 |
number |
|
maxStay OptionalPropertyListing2 |
number |
|
maxGuests OptionalPropertyListing2 |
number |
|
bookedDates OptionalPropertyListing2 |
string[] |
|
earliestDate OptionalPropertyListing2 |
string |
|
alternative OptionalPropertyListing2 |
{ label: string; nightly: number } |
|
defaultCheckIn OptionalPropertyListing2 |
string |
|
defaultCheckOut OptionalPropertyListing2 |
string |
|
defaultGuests OptionalPropertyListing2 |
number |
|
copy OptionalPropertyListing2 |
Partial<PropertyListing2Copy> |
|
onAction OptionalPropertyListing2 |
(stay: StayRequest) => void |
|
className OptionalPropertyListing2 |
string |
Theme roles it reads
Set by the theme bar, a preset or your brand. Colours come from the base tokens (--surface, --ink, --cta…) every piece uses.
--button-bg--button-bg-2--button-case--button-font--button-ink--button-radius--button-shadow--button-text-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--button-2-bg--button-2-border--button-2-ink--button-2-shadow- Secondary button.
--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field--field-border--field-focus--field-ink--field-radius- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
item-1- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-2- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-3- One image per offer item (item-1, item-2…), shown in stacks and lists.
-
b26f428aed45872e.webp
image/webp · 92.5 KB
-
bea5506d98298c17.webp
image/webp · 73.4 KB
-
d95b6563d88c9e5a.webp
image/webp · 68.8 KB