Daily Deal 2
Daily deal on a lit stage: the product photo centred on a dark band with short feature notes beside it. Below it sits a
Use it in a prompt
Use offer/daily-deal-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/daily-deal-2.tsx. - Import it and pass your copy and images (Props tab):
import { DailyDeal2 } from "@/components/funneldna/offer/daily-deal-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/daily-deal-2/component.tsx 618 lines
// layout: product-stage
// Daily deal on a lit stage: the product photo centred on a dark band with short feature notes beside it. Below it sits a
// reason-why deal card with a value reveal, a short founder letter, the countdown, real stock, a limit-aware quantity
// stepper with a live total and a guarantee commit line, all leading to one buy button. Phones can add a sticky buy bar (stickyBar).
import * as React from 'react';
import { AlertCircle, Check, Clock, Minus, Package, Plus, ShieldCheck } from 'lucide-react';
import { FX_HOST, Glow, Spot } from '../fx/fx';
export type DailyDeal2Note = {
title: string;
detail?: string;
/** Imported fx Spot asset (e.g. ../fx/spots/clock). A tick disc shows without one. */
spot?: string;
};
export type DailyDeal2Copy = {
salutation: string;
/** Letter heading with {reason}. The reason gets the marker stroke. */
reasonHeading: string;
wasLabel: string;
but: string;
nowUnit: string;
/** Savings line with {amount}. */
saving: string;
endsIn: string;
/** Line under the clock with {time}, shown in the offer’s time zone. */
endsAt: string;
ended: string;
/** Line under an ended clock with {time}. */
endedAt: string;
daysShort: string;
/** Stock line with {left} and {total}. */
stock: string;
/** Stock line with {left}. */
stockOnly: string;
soldOut: string;
quantity: string;
/** With {limit}. */
limit: string;
/** With {limit}. */
limitReached: string;
decrease: string;
increase: string;
/** With {quantity} and {unit}. */
totalFor: string;
unit: string;
units: string;
/** Commit line with {guarantee}. */
commit: string;
commitError: string;
endedLabel: string;
soldOutLabel: string;
};
export type DailyDeal2Order = { quantity: number; total?: number };
export type DailyDeal2Props = {
headline?: string;
lead?: string;
/** Product photo on a transparent background (product slot). */
productImage?: string;
productImageAlt?: string;
/** Up to four short feature notes set beside the product. */
notes?: DailyDeal2Note[];
/** Today’s price per unit, as a number in the currency below. */
price?: number;
/** Supplied regular price per unit. It shows first, struck, in the value reveal. */
regularPrice?: number;
/** ISO 4217 code, e.g. USD. */
currency?: string;
locale?: string;
/** The supplied reason the deal exists, e.g. “end of season overstock”. */
reason?: string;
/** Letter paragraphs after the salutation. */
letter?: string[];
signoff?: string;
signerName?: string;
signerRole?: string;
/** Supplied end time, ISO 8601 with offset. Omit it and no countdown shows. */
endsAt?: string;
/** IANA time zone the end time is shown in, e.g. America/Los_Angeles. */
timeZone?: string;
/** Supplied stock left at the deal price. Omit it and no stock line shows. */
stockLeft?: number;
stockTotal?: number;
/** Supplied per-customer limit. The stepper stops there. */
limit?: number;
/** Supplied guarantee, e.g. “30-day money-back guarantee”. Supplying it adds the commit line. */
guarantee?: string;
label?: string;
/** One reassurance line under the button. */
assurance?: string;
/** Phones only: also pin a total + buy bar to the bottom of the viewport while the section is on screen. */
stickyBar?: boolean;
/** Destination. Any {quantity} in it is replaced with the chosen quantity. */
href?: string;
onAction?: (order: DailyDeal2Order, event: React.MouseEvent<HTMLElement>) => void;
/** disabled previews the ended deal; error previews the unticked commit line. */
state?: 'default' | 'hover' | 'active' | 'disabled' | 'error';
className?: string;
copy?: Partial<DailyDeal2Copy>;
};
const DEFAULT_COPY: DailyDeal2Copy = {
salutation: 'Dear friend,',
reasonHeading: 'Why it’s cheaper today: {reason}',
wasLabel: 'The regular price',
but: 'But you won’t pay that today.',
nowUnit: 'each, today',
saving: 'That’s {amount} under the regular price.',
endsIn: 'Ends in',
endsAt: 'Today’s price ends {time}',
ended: 'This deal has ended',
endedAt: 'Today’s price ended {time}',
daysShort: 'd',
stock: '{left} of {total} left at this price',
stockOnly: '{left} left at this price',
soldOut: 'None left at this price',
quantity: 'How many?',
limit: 'Limit {limit} per customer',
limitReached: 'That’s the limit of {limit} per customer',
decrease: 'Remove one',
increase: 'Add one',
totalFor: 'Total for {quantity} {unit}',
unit: 'item',
units: 'items',
commit: 'I understand I’m covered by the {guarantee}.',
commitError: 'Tick the box above to continue.',
endedLabel: 'This deal has ended',
soldOutLabel: 'Sold out at this price',
};
const DEFAULT_MAX = 10;
export function DailyDeal2(props: DailyDeal2Props) {
const {
headline = 'Here’s today’s deal, and the reason it exists',
lead,
productImage,
productImageAlt = 'The product in today’s deal',
notes = [],
price,
regularPrice,
currency = 'USD',
locale = 'en-US',
reason,
letter = [],
signoff,
signerName,
signerRole,
endsAt,
timeZone,
stockLeft,
stockTotal,
limit,
guarantee,
label = 'Claim today’s price',
assurance,
stickyBar = false,
href,
onAction,
state = 'default',
className,
} = props;
const copy = { ...DEFAULT_COPY, ...props.copy };
const uid = React.useId();
const titleId = uid + '-title';
const qtyId = uid + '-qty';
const checkId = uid + '-check';
const errId = uid + '-err';
const checkRef = React.useRef<HTMLInputElement>(null);
const end = endsAt ? Date.parse(endsAt) : Number.NaN;
const hasClock = Number.isFinite(end);
const forcedEnded = state === 'disabled';
const [now, setNow] = React.useState(() => Date.now());
const live = hasClock && !forcedEnded && now < end;
React.useEffect(() => {
if (!live) return undefined;
const id = window.setInterval(() => setNow(Date.now()), 1000);
return () => window.clearInterval(id);
}, [live]);
const ended = forcedEnded || (hasClock && now >= end);
const left = typeof stockLeft === 'number' && Number.isFinite(stockLeft) && stockLeft >= 0 ? Math.floor(stockLeft) : undefined;
const hasStock = left !== undefined;
const soldOut = left !== undefined && left <= 0;
const closed = ended || soldOut;
const hasTotal = hasStock && typeof stockTotal === 'number' && stockTotal > 0;
const pct = hasTotal && left !== undefined ? Math.max(0, Math.min(1, left / (stockTotal as number))) : 0;
const hasLimit = typeof limit === 'number' && limit >= 1;
const cap = Math.max(1, Math.floor(Math.min(hasLimit ? (limit as number) : DEFAULT_MAX, left && left > 0 ? left : Number.POSITIVE_INFINITY)));
const [rawQty, setQty] = React.useState(1);
const qty = Math.min(Math.max(1, rawQty), cap);
const unitPrice = typeof price === 'number' && Number.isFinite(price) ? price : undefined;
const regular = typeof regularPrice === 'number' && Number.isFinite(regularPrice) ? regularPrice : undefined;
const total = unitPrice !== undefined ? Math.round(unitPrice * qty * 100) / 100 : undefined;
const money = (amount: number) => formatMoney(amount, currency, locale);
const showWas = unitPrice !== undefined && regular !== undefined && regular > unitPrice;
const [agreed, setAgreed] = React.useState(state !== 'error');
const [showError, setShowError] = React.useState(state === 'error');
React.useEffect(() => {
setAgreed(state !== 'error');
setShowError(state === 'error');
}, [state]);
const needsCommit = Boolean(guarantee) && !closed;
const parts = splitTime(live ? end - now : 0);
const digits = (parts.days > 0 ? parts.days + copy.daysShort + ' ' : '') + [parts.hours, parts.minutes, parts.seconds].map(pad).join(':');
const endText = hasClock ? formatEnd(end, locale, timeZone) : '';
const totalLabel = fill(copy.totalFor, { quantity: qty, unit: qty === 1 ? copy.unit : copy.units });
const handleBuy = (event: React.MouseEvent<HTMLElement>) => {
if (closed) {
event.preventDefault();
return;
}
if (needsCommit && !agreed) {
event.preventDefault();
setShowError(true);
checkRef.current?.focus();
return;
}
onAction?.({ quantity: qty, total }, event);
};
const renderBuy = (extra: string) => {
const cls = ['cf-dd2-btn', extra, state === 'hover' ? 'is-hover' : '', state === 'active' ? 'is-active' : ''].filter(Boolean).join(' ');
const text = ended ? copy.endedLabel : soldOut ? copy.soldOutLabel : label;
if (href && !closed) {
return (
<a className={cls} href={href.split('{quantity}').join(String(qty))} onClick={handleBuy}>
{text}
</a>
);
}
return (
<button type="button" className={cls} disabled={closed} onClick={handleBuy}>
{text}
</button>
);
};
const list = notes.slice(0, 4);
const half = Math.ceil(list.length / 2);
const leftNotes = list.slice(0, half);
const rightNotes = list.slice(half);
const renderNote = (note: DailyDeal2Note, i: number) => (
<li key={note.title + i} className="cf-dd2-note">
<span className="cf-dd2-art" aria-hidden="true">
{note.spot ? (
<Spot src={note.spot} size={64} shade="band" light="band-ink" />
) : (
<span className="cf-dd2-disc">
<Check size={20} strokeWidth={2.5} />
</span>
)}
</span>
<span className="cf-dd2-note-copy">
<h3 className="cf-dd2-note-title">{note.title}</h3>
{note.detail ? <p className="cf-dd2-note-detail">{note.detail}</p> : null}
</span>
</li>
);
const reasonParts = copy.reasonHeading.split('{reason}');
const showLetter = Boolean(reason) || letter.length > 0 || Boolean(signerName);
const rootClass = ['cf-dd2', closed ? 'is-closed' : '', className].filter(Boolean).join(' ');
const cardClass = ['cf-dd2-card', showLetter ? '' : 'is-solo'].filter(Boolean).join(' ');
return (
<section className={rootClass} aria-labelledby={titleId} style={{ ...FX_HOST, overflow: 'clip' }}>
<Glow />
<style>{CSS}</style>
<div className="cf-dd2-flow">
<header className="cf-dd2-head">
<h2 id={titleId} className="cf-dd2-title">
{headline}
</h2>
{lead ? <p className="cf-dd2-lead">{lead}</p> : null}
</header>
<div className="cf-dd2-stage">
<ul className="cf-dd2-notes is-left">{leftNotes.map(renderNote)}</ul>
<figure className="cf-dd2-product">
{productImage ? <img src={productImage} alt={productImageAlt} width={960} height={960} decoding="async" /> : null}
</figure>
<ul className="cf-dd2-notes is-right">{rightNotes.map((n, i) => renderNote(n, i + half))}</ul>
</div>
<div className={cardClass}>
{showLetter ? (
<div className="cf-dd2-letter">
{reason ? (
<h3 className="cf-dd2-why">
{reasonParts[0]}
<span className="cf-dd2-mark">{reason}</span>
{reasonParts.slice(1).join(reason)}
</h3>
) : null}
{letter.length > 0 ? <p className="cf-dd2-salute">{copy.salutation}</p> : null}
{letter.map((p, i) => (
<p key={i}>{p}</p>
))}
{signoff || signerName ? (
<div className="cf-dd2-sign">
{signoff ? <p>{signoff}</p> : null}
{signerName ? <span className="cf-dd2-signame">{signerName}</span> : null}
{signerRole ? <span className="cf-dd2-signrole">{signerRole}</span> : null}
</div>
) : null}
</div>
) : null}
<div className="cf-dd2-deal">
{unitPrice !== undefined ? (
<div className="cf-dd2-price">
{showWas ? (
<>
<p className="cf-dd2-was-label">{copy.wasLabel}</p>
<p className="cf-dd2-was">{money(regular as number)}</p>
<p className="cf-dd2-but">{copy.but}</p>
</>
) : null}
<p className="cf-dd2-now">
<span className="cf-dd2-now-price">{money(unitPrice)}</span>
<span className="cf-dd2-unit">{copy.nowUnit}</span>
</p>
{showWas ? <p className="cf-dd2-save">{fill(copy.saving, { amount: money((regular as number) - unitPrice) })}</p> : null}
</div>
) : null}
{hasClock || forcedEnded || hasStock ? (
<div className="cf-dd2-facts">
{hasClock || forcedEnded ? (
<div>
<p className="cf-dd2-row">
<Clock className="cf-dd2-ico" size={18} strokeWidth={2.5} aria-hidden="true" />
{ended ? (
<span>{copy.ended}</span>
) : (
<>
<span>{copy.endsIn}</span>
<span className="cf-dd2-digits" aria-hidden="true">
{digits}
</span>
</>
)}
</p>
{hasClock && !forcedEnded ? <p className="cf-dd2-end">{fill(ended ? copy.endedAt : copy.endsAt, { time: endText })}</p> : null}
</div>
) : null}
{hasStock && left !== undefined ? (
<div>
<p className="cf-dd2-row">
<Package className="cf-dd2-ico" size={18} strokeWidth={2.5} aria-hidden="true" />
<span>
{soldOut
? copy.soldOut
: hasTotal
? fill(copy.stock, { left: left.toLocaleString(locale), total: (stockTotal as number).toLocaleString(locale) })
: fill(copy.stockOnly, { left: left.toLocaleString(locale) })}
</span>
</p>
{hasTotal ? (
<div className="cf-dd2-meter" aria-hidden="true">
<span style={{ width: pct * 100 + '%' }} />
</div>
) : null}
</div>
) : null}
</div>
) : null}
<div className="cf-dd2-qty">
<div>
<span className="cf-dd2-qty-label" id={qtyId}>
{copy.quantity}
</span>
<div className="cf-dd2-stepper" role="group" aria-labelledby={qtyId}>
<button type="button" className="cf-dd2-step" aria-label={copy.decrease} disabled={closed || qty <= 1} onClick={() => setQty(qty - 1)}>
<Minus size={20} strokeWidth={2.5} aria-hidden="true" />
</button>
<span className="cf-dd2-count">{qty}</span>
<button type="button" className="cf-dd2-step" aria-label={copy.increase} disabled={closed || qty >= cap} onClick={() => setQty(qty + 1)}>
<Plus size={20} strokeWidth={2.5} aria-hidden="true" />
</button>
</div>
{hasLimit ? (
<p className={'cf-dd2-limit' + (qty >= (limit as number) ? ' is-max' : '')}>
{fill(qty >= (limit as number) ? copy.limitReached : copy.limit, { limit: limit as number })}
</p>
) : null}
</div>
{total !== undefined ? (
<p className="cf-dd2-total" aria-live="polite">
<span className="cf-dd2-total-label">{totalLabel}</span>
<span className="cf-dd2-total-value">{money(total)}</span>
</p>
) : null}
</div>
{needsCommit ? (
<div className={'cf-dd2-commit' + (showError ? ' is-invalid' : '')}>
<label className="cf-dd2-check" htmlFor={checkId}>
<input
ref={checkRef}
id={checkId}
type="checkbox"
checked={agreed}
aria-invalid={showError || undefined}
aria-describedby={showError ? errId : undefined}
onChange={(e) => {
setAgreed(e.target.checked);
if (e.target.checked) setShowError(false);
}}
/>
<span className="cf-dd2-box" aria-hidden="true">
<Check size={16} strokeWidth={3} />
</span>
<span className="cf-dd2-checktext">{fill(copy.commit, { guarantee: guarantee as string })}</span>
</label>
{showError ? (
<p id={errId} className="cf-dd2-err" role="alert">
<AlertCircle size={16} strokeWidth={2.5} aria-hidden="true" />
{copy.commitError}
</p>
) : null}
</div>
) : null}
<div className="cf-dd2-buy">
{renderBuy('is-card')}
{assurance ? (
<p className="cf-dd2-assure">
<ShieldCheck size={16} strokeWidth={2.5} aria-hidden="true" />
{assurance}
</p>
) : null}
</div>
</div>
</div>
{stickyBar ? (
<div className="cf-dd2-bar">
{total !== undefined ? (
<p className="cf-dd2-bar-total">
<span className="cf-dd2-bar-label">{totalLabel}</span>
<span className="cf-dd2-bar-value">{money(total)}</span>
</p>
) : null}
{renderBuy('is-bar')}
</div>
) : null}
</div>
</section>
);
}
export default DailyDeal2;
function fill(template: string, values: Record<string, string | number>) {
let out = template;
for (const [key, value] of Object.entries(values)) out = out.split('{' + key + '}').join(String(value));
return out;
}
function pad(n: number) {
return n < 10 ? '0' + n : String(n);
}
function splitTime(ms: number) {
const t = Math.max(0, Math.floor(ms / 1000));
return { days: Math.floor(t / 86400), hours: Math.floor((t % 86400) / 3600), minutes: Math.floor((t % 3600) / 60), seconds: t % 60 };
}
function formatMoney(amount: number, currency: string, locale: string) {
try {
const whole = Number.isInteger(amount);
return new Intl.NumberFormat(locale, { style: 'currency', currency, minimumFractionDigits: whole ? 0 : 2, maximumFractionDigits: 2 }).format(amount);
} catch {
return String(amount);
}
}
function formatEnd(ms: number, locale: string, timeZone?: string) {
const opts: Intl.DateTimeFormatOptions = { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit', timeZoneName: 'short' };
try {
return new Intl.DateTimeFormat(locale, { ...opts, timeZone }).format(new Date(ms));
} catch {
return new Intl.DateTimeFormat(locale, opts).format(new Date(ms));
}
}
const CSS = `
.cf-dd2{--dd2-gutter:clamp(16px,5vw,48px);--dd2-shadow:var(--shadow,oklch(0.22 0.03 260));--dd2-well:color-mix(in oklch,var(--ink) 4%,var(--card));--dd2-marker:var(--marker,#fae37c);--signature-font:var(--signature-face,var(--font-display));position:relative;background:var(--band);color:var(--band-ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) var(--dd2-gutter) clamp(64px,8.5vw,120px)}
.cf-dd2 *,.cf-dd2 *::before,.cf-dd2 *::after{box-sizing:border-box}
:where(.cf-dd2) :where(h2,h3,p,ul,figure){margin:0}
.cf-dd2-flow{position:relative;z-index:1;max-width:1120px;margin:0 auto;display:flex;flex-direction:column;gap:clamp(32px,4vw,48px)}
.cf-dd2-head{max-width:46rem;margin:0 auto;text-align:center}
.cf-dd2-title{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;color:var(--band-ink)}
.cf-dd2-lead{margin-top:16px;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;text-wrap:pretty;color:var(--band-ink)}
.cf-dd2-stage{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,480px) minmax(0,1fr);gap:clamp(24px,4vw,56px)}
.cf-dd2-notes{list-style:none;padding:0;display:flex;flex-direction:column;justify-content:space-around;gap:32px}
.cf-dd2-notes.is-left{align-items:flex-end;text-align:end}
.cf-dd2-notes.is-right{justify-content:center;align-items:flex-start;text-align:start}
.cf-dd2-note{max-width:270px;display:flex;flex-direction:column;gap:12px}
.cf-dd2-notes.is-left .cf-dd2-note{align-items:flex-end}
.cf-dd2-art{display:flex;flex:none;width:64px;height:64px;align-items:center;justify-content:center}
.cf-dd2-disc{width:40px;height:40px;border-radius:999px;display:grid;place-items:center;background:oklch(from var(--band-ink) l c h / .12);color:var(--band-ink)}
.cf-dd2-note-title{font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:-0.01em;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;text-wrap:balance;color:var(--band-ink)}
.cf-dd2-note-detail{margin-top:8px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;text-wrap:pretty;color:var(--band-ink)}
.cf-dd2-product{display:flex;align-items:center;justify-content:center;min-height:240px}
.cf-dd2-product img{display:block;width:100%;max-width:480px;height:auto;aspect-ratio:1/1;object-fit:contain;filter:drop-shadow(0 2px 3px oklch(from var(--dd2-shadow) l c h / .45)) drop-shadow(0 24px 22px oklch(from var(--dd2-shadow) l c h / .55))}
.cf-dd2-card{--dd2-ring:oklch(from var(--field-focus,var(--accent)) l c h / .6);display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);gap:clamp(24px,3vw,40px);align-items:start;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)}
.cf-dd2-card.is-solo{grid-template-columns:minmax(0,1fr);width:100%;max-width:40rem;margin-inline:auto}
.cf-dd2-letter{background:var(--dd2-well);border-radius:10px;padding:clamp(20px,2.6vw,28px);display:flex;flex-direction:column;gap:16px}
.cf-dd2-why{font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:-0.01em;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.25;text-wrap:balance;color:var(--ink)}
.cf-dd2-mark{background:linear-gradient(transparent 54%,var(--dd2-marker) 54%,var(--dd2-marker) 94%,transparent 94%);-webkit-box-decoration-break:clone;box-decoration-break:clone;padding:0 .12em;border-radius:.18em}
.cf-dd2-letter p{font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.6;text-wrap:pretty;color:var(--ink)}
.cf-dd2-letter .cf-dd2-salute{font-weight:700}
.cf-dd2-sign{display:flex;flex-direction:column;gap:4px;margin-top:4px}
.cf-dd2-sign>p{margin-bottom:8px}
.cf-dd2-signame{display:block;font-family:var(--signature-font);font-weight:var(--display-weight,800);letter-spacing:-0.01em;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;color:var(--signature-ink,var(--ink))}
.cf-dd2-signrole{display:block;font-size:15px;line-height:1.4;font-weight:600;color:var(--muted)}
.cf-dd2-deal{display:flex;flex-direction:column;gap:24px;min-width:0}
.cf-dd2-was-label{margin-bottom:12px;font-size:15px;line-height:1.4;font-weight:600;color:var(--muted)}
.cf-dd2-was{font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;font-variant-numeric:tabular-nums;color:var(--muted);text-decoration:line-through;text-decoration-color:var(--danger);text-decoration-thickness:.1em}
.cf-dd2-but{margin-top:12px;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:700;color:var(--ink);text-wrap:pretty}
.cf-dd2-now{margin-top:16px;display:flex;flex-wrap:wrap;align-items:baseline;column-gap:12px;row-gap:4px}
.cf-dd2-now-price{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;color:var(--ink)}
.cf-dd2-unit{font-size:15px;line-height:1.4;font-weight:600;color:var(--muted)}
.cf-dd2-save{margin-top:16px;font-size:15px;line-height:1.4;font-weight:700;color:var(--success)}
.cf-dd2.is-closed .cf-dd2-now-price{color:var(--muted)}
.cf-dd2-facts{background:var(--dd2-well);border-radius:10px;padding:16px;display:flex;flex-direction:column;gap:12px}
.cf-dd2-row{display:flex;align-items:center;flex-wrap:wrap;column-gap:8px;row-gap:4px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.4;font-weight:700;color:var(--ink)}
.cf-dd2-ico{flex:none;color:var(--ink)}
.cf-dd2-digits{font-family:var(--font-display);font-weight:800;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;font-variant-numeric:tabular-nums}
.cf-dd2-end{margin-top:4px;font-size:15px;line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
.cf-dd2-meter{margin-top:8px;height:8px;border-radius:999px;overflow:hidden;background:color-mix(in oklch,var(--ink) 12%,var(--card))}
.cf-dd2-meter>span{display:block;height:100%;border-radius:inherit;background:var(--accent-fill,var(--accent))}
.cf-dd2-qty{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:16px}
.cf-dd2-qty-label{display:block;margin-bottom:8px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.4;font-weight:700;color:var(--label-ink,var(--ink))}
.cf-dd2-stepper{display:inline-flex;height:56px;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));overflow:hidden}
.cf-dd2-step{appearance:none;border:0;margin:0;padding:0;width:56px;display:grid;place-items:center;background:transparent;color:var(--field-ink);cursor:pointer;transition:background .16s ease,color .16s ease}
.cf-dd2-step:hover:not(:disabled){background:color-mix(in oklch,var(--field-ink) 7%,var(--field))}
.cf-dd2-step:active:not(:disabled){background:color-mix(in oklch,var(--field-ink) 13%,var(--field))}
.cf-dd2-step:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .6);outline-offset:-3px}
.cf-dd2-step:disabled{cursor:not-allowed;color:color-mix(in oklch,var(--field-ink) 35%,var(--field))}
.cf-dd2-count{min-width:60px;padding:0 12px;display:grid;place-items:center;font-family:var(--font-display);font-weight:800;font-size:clamp(1.3125rem,1.8vw,1.625rem);font-variant-numeric:tabular-nums;border-inline:1px solid var(--field-border,color-mix(in oklch,var(--ink) 22%,transparent))}
.cf-dd2-limit{margin-top:8px;font-size:15px;line-height:1.4;font-weight:600;color:var(--muted)}
.cf-dd2-limit.is-max{color:var(--ink)}
.cf-dd2-total{display:flex;flex-direction:column;gap:4px;text-align:end}
.cf-dd2-total-label{font-size:15px;line-height:1.4;font-weight:600;color:var(--muted)}
.cf-dd2-total-value{font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;font-variant-numeric:tabular-nums;color:var(--ink)}
.cf-dd2-check{position:relative;display:flex;align-items:flex-start;gap:12px;cursor:pointer}
.cf-dd2-check input{position:absolute;top:0;left:0;width:26px;height:26px;margin:0;opacity:0;cursor:pointer}
.cf-dd2-box{flex:none;width:26px;height:26px;border-radius:7px;display:grid;place-items:center;background:var(--field);color:transparent;border:2px solid var(--field-border,color-mix(in oklch,var(--ink) 22%,transparent));transition:background .16s ease,border-color .16s ease}
.cf-dd2-check:hover .cf-dd2-box{border-color:color-mix(in oklch,var(--ink) 45%,transparent)}
.cf-dd2-commit.is-invalid .cf-dd2-box{border-color:var(--danger)}
.cf-dd2-check input:checked+.cf-dd2-box{background:var(--accent-fill,var(--accent));border-color:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card))}
.cf-dd2-check input:focus-visible+.cf-dd2-box{box-shadow:0 0 0 3px oklch(from var(--field-focus,var(--accent)) l c h / .35)}
.cf-dd2-checktext{font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.45;font-weight:600;color:var(--ink);text-wrap:pretty}
.cf-dd2-err{margin-top:8px;font-size:15px;line-height:1.4;font-weight:700;color:var(--danger)}
.cf-dd2-err svg{display:inline-block;vertical-align:-0.15em;margin-inline-end:.4em}
.cf-dd2-buy{display:flex;flex-direction:column;gap:12px}
.cf-dd2-assure{font-size:15px;line-height:1.4;font-weight:600;color:var(--muted);text-align:center;text-wrap:pretty}
.cf-dd2-assure svg{display:inline-block;vertical-align:-0.15em;margin-inline-end:.4em;color:var(--success)}
.cf-dd2-btn{--dd2-b:var(--button-bg,var(--cta));--dd2-b2:var(--button-bg-2,var(--cta-2));appearance:none;border:0;margin:0;width:100%;min-height:64px;padding:0 28px;display:inline-flex;align-items:center;justify-content:center;text-align:center;text-decoration:none;cursor:pointer;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;color:var(--button-ink,var(--cta-ink));text-shadow:var(--button-text-shadow,none);background:linear-gradient(oklch(from var(--dd2-b) calc(l + .04) c h),oklch(from var(--dd2-b2) calc(l - .02) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--dd2-b) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--dd2-b) calc(l - .16) c h),0 1px 2px oklch(from var(--dd2-shadow) l c h / .35),0 8px 16px -6px oklch(from var(--dd2-shadow) l c h / .45));transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-dd2-btn:hover:not(:disabled),.cf-dd2-btn.is-hover:not(:disabled){background:linear-gradient(oklch(from var(--dd2-b) calc(l - .01) c h),oklch(from var(--dd2-b2) calc(l - .07) c h));transform:translateY(-1px)}
.cf-dd2-btn:active:not(:disabled),.cf-dd2-btn.is-active:not(:disabled){transform:translateY(1px);box-shadow:inset 0 2px 4px oklch(from var(--dd2-b) calc(l - .22) c h / .55),inset 0 -2px 0 oklch(from var(--dd2-b) calc(l - .16) c h),0 1px 2px oklch(from var(--dd2-shadow) l c h / .3)}
.cf-dd2-btn:focus-visible{outline:3px solid var(--dd2-ring);outline-offset:3px}
.cf-dd2-btn:disabled{cursor:not-allowed;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));transform:none}
.cf-dd2-bar{display:none}
.cf-dd2-bar-total{display:flex;flex-direction:column;flex:none;min-width:0}
.cf-dd2-bar-label{font-size:15px;line-height:1.3;font-weight:600;color:var(--band-ink)}
.cf-dd2-bar-value{font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-variant-numeric:tabular-nums;color:var(--band-ink)}
@keyframes cf-dd2-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
.cf-dd2-head,.cf-dd2-product,.cf-dd2-card{animation:cf-dd2-rise .45s cubic-bezier(.2,.7,.2,1) both}
.cf-dd2-product{animation-delay:.07s}
.cf-dd2-card{animation-delay:.14s}
.cf-dd2-now{animation:cf-dd2-rise .45s cubic-bezier(.2,.7,.2,1) .28s both}
@media (max-width:960px) and (min-width:641px){
.cf-dd2-stage{grid-template-columns:repeat(3,minmax(0,1fr));row-gap:40px}
.cf-dd2-notes{display:contents}
.cf-dd2-product{grid-column:1/-1;grid-row:1}
.cf-dd2-product img{max-width:400px}
.cf-dd2-note,.cf-dd2-notes.is-left .cf-dd2-note{max-width:none;align-items:flex-start;text-align:start}
}
@media (max-width:860px){
.cf-dd2-card{grid-template-columns:minmax(0,1fr)}
.cf-dd2-deal{order:-1}
}
@media (max-width:640px){
.cf-dd2-flow{gap:24px}
.cf-dd2-stage,.cf-dd2-notes{display:contents}
.cf-dd2-head{order:0}
.cf-dd2-product{order:1;min-height:0}
.cf-dd2-product img{max-width:300px}
.cf-dd2-card{order:2}
.cf-dd2-note{order:3}
.cf-dd2-bar{order:4}
.cf-dd2-note,.cf-dd2-notes.is-left .cf-dd2-note{max-width:none;flex-direction:row;align-items:flex-start;text-align:start;gap:16px}
.cf-dd2-art{width:56px;height:56px}
.cf-dd2-qty>div{flex:1 1 100%}
.cf-dd2-total{flex:1 1 100%;flex-direction:row;align-items:baseline;justify-content:space-between;gap:12px;text-align:start}
.cf-dd2-bar{display:flex;position:sticky;bottom:0;z-index:3;align-items:center;gap:16px;margin:0 calc(var(--dd2-gutter) * -1);padding:12px var(--dd2-gutter) calc(12px + env(safe-area-inset-bottom,0px));background:oklch(from var(--band) calc(l + .03) c h);color:var(--band-ink);box-shadow:0 -6px 16px -6px oklch(from var(--dd2-shadow) l c h / .55);--dd2-ring:var(--band-ink)}
.cf-dd2-bar .cf-dd2-btn{flex:1 1 auto;width:auto;min-height:56px;padding:0 16px}
}
@media (prefers-reduced-motion:reduce){
.cf-dd2-head,.cf-dd2-product,.cf-dd2-card,.cf-dd2-now{animation:none}
.cf-dd2-btn,.cf-dd2-step,.cf-dd2-box{transition:none}
.cf-dd2-btn:hover:not(:disabled),.cf-dd2-btn.is-hover:not(:disabled),.cf-dd2-btn:active:not(:disabled),.cf-dd2-btn.is-active:not(:disabled){transform:none}
}
`;
pieces/offer/daily-deal-2/specimen.tsx 50 lines
import __studioImage77480bc5 from "../assets/a75dcfc66117fb39.webp";
import * as React from 'react';
import { DailyDeal2, type DailyDeal2Props } from '../daily-deal-2';
import defaults from '../../studio-defaults.json';
import { slot } from '../../slots';
import clock from '../../fx/spots/clock';
import calendar from '../../fx/spots/calendar';
import shield from '../../fx/spots/shield';
export const states = ['default', 'hover', 'active', 'disabled', 'error'];
export default function DailyDeal2Specimen({ state = 'default' }: { state?: DailyDeal2Props['state'] }) {
return (
<DailyDeal2
headline="Our cold-brew kit, at its end-of-season price"
lead="We made more Northbrew kits than the summer needed. Today one can be yours for well under the usual price."
productImage={slot(
'product',
__studioImage77480bc5,
)}
productImageAlt="Northbrew cold-brew kit: glass carafe with a steel filter and walnut lid, a pour bottle and a bag of coarse-ground coffee"
notes={[
{ title: 'Brews overnight', detail: 'Fill it, chill it and pour in the morning. No machine, no plug.', spot: clock },
{ title: 'A week per batch', detail: 'One carafe makes seven glasses of smooth cold brew.', spot: calendar },
{ title: 'Built to last', detail: 'Thick glass and a steel filter you rinse, never replace.', spot: shield },
]}
price={54}
regularPrice={89}
currency="USD"
reason="end of season overstock"
letter={[
'Every spring we brew-test a full season of kits. This year we simply made more than our shelves can hold.',
'Rather than pay to store them through winter, I’d rather they end up on your counter. Same carafe, same steel filter, same walnut lid.',
]}
signoff="Brew something good,"
signerName="Mara Lind"
signerRole="Founder, Northbrew"
endsAt="2026-12-31T23:59:00-08:00"
timeZone="America/Los_Angeles"
stockLeft={38}
stockTotal={120}
limit={3}
guarantee={defaults.sample.guarantee}
label="Send me my kit"
assurance="Secure checkout · Ships in 2 business days"
copy={{ nowUnit: 'per kit, today', unit: 'kit', units: 'kits' }}
state={state}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalDailyDeal2 |
string |
|
lead OptionalDailyDeal2 |
string |
|
productImage OptionalDailyDeal2 |
string |
|
productImageAlt OptionalDailyDeal2 |
string |
|
notes OptionalDailyDeal2 |
DailyDeal2Note[] |
|
price OptionalDailyDeal2 |
number |
|
regularPrice OptionalDailyDeal2 |
number |
|
currency OptionalDailyDeal2 |
string |
|
locale OptionalDailyDeal2 |
string |
|
reason OptionalDailyDeal2 |
string |
|
letter OptionalDailyDeal2 |
string[] |
|
signoff OptionalDailyDeal2 |
string |
|
signerName OptionalDailyDeal2 |
string |
|
signerRole OptionalDailyDeal2 |
string |
|
endsAt OptionalDailyDeal2 |
string |
|
timeZone OptionalDailyDeal2 |
string |
|
stockLeft OptionalDailyDeal2 |
number |
|
stockTotal OptionalDailyDeal2 |
number |
|
limit OptionalDailyDeal2 |
number |
|
guarantee OptionalDailyDeal2 |
string |
|
label OptionalDailyDeal2 |
string |
|
assurance OptionalDailyDeal2 |
string |
|
stickyBar OptionalDailyDeal2 |
boolean |
|
href OptionalDailyDeal2 |
string |
|
onAction OptionalDailyDeal2 |
(order: DailyDeal2Order, event: React.MouseEvent<HTMLElement>) => void |
|
state OptionalDailyDeal2 |
'default' | 'hover' | 'active' | 'disabled' | 'error' |
|
className OptionalDailyDeal2 |
string |
|
copy OptionalDailyDeal2 |
Partial<DailyDeal2Copy> |
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.
product- The main product shot or cover (ebook, kit, bottle).
-
321240b3188e2da4.webp
image/webp · 18.7 KB
-
7c36d7f4dd4ae594.webp
image/webp · 26.5 KB
-
7d6f1c81c93d8f71.webp
image/webp · 18.2 KB
-
a75dcfc66117fb39.webp
image/webp · 213 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB