Bundle Picker 7
Shows package choices and their calculated savings as an order ledger.
Use it in a prompt
Use offer/bundle-picker-7 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/bundle-picker-7.tsx. - Import it and pass your copy and images (Props tab):
import { BundlePicker7 } from "@/components/funneldna/offer/bundle-picker-7"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/bundle-picker-7/component.tsx 547 lines
// Shows package choices and their calculated savings as an order ledger.
// layout: ledger-receipt
'use client'
import * as React from 'react'
import { AlertCircle, Loader2, Lock, ShieldCheck } from 'lucide-react'
import { AmericanExpress, Discover, Mastercard, Visa } from 'react-svg-credit-card-payment-icons/icons/flat-rounded'
export type LedgerPackage = {
/** Number of units in the package, e.g. 1, 3, 6. */
units: number
/** Total price of the package in the chosen currency. */
price: number
/** Photo of this exact package (one bottle, three, six) on a plain light background. */
image?: string
imageAlt?: string
/** Value posted for this package; defaults to the unit count. */
id?: string
}
export type LedgerState = 'default' | 'hover' | 'active' | 'disabled' | 'loading' | 'error' | 'success'
export type LedgerContext = {
units: number
unitWord: string
total: string
perUnit: string
savings: string
regularUnit: string
}
export type BundlePicker7Props = {
headline?: string
/** Phrase inside the headline that gets the marker stroke. */
highlight?: string
lead?: string
packages?: LedgerPackage[]
unit?: { one: string; other: string }
/** Index chosen on load; defaults to the best-value package. */
defaultSelected?: number
currency?: string
locale?: string
legend?: string
columnLabels?: { pkg: string; price: string }
buttonLabel?: (ctx: LedgerContext) => string
loadingLabel?: string
bestValueLabel?: string
perUnitLabel?: string
standardLabel?: string
saveWord?: string
regularLabel?: (ctx: LedgerContext) => string
savingsLabel?: (pct: number) => string
totalLabel?: string
guarantee?: string
secureLabel?: string
showPaymentMarks?: boolean
errorMessage?: string
/** Deprecated: ignored. The builder wires what happens after the action. */
successTitle?: (ctx: LedgerContext) => string
/** Deprecated: ignored. The builder wires what happens after the action. */
successBody?: string
/** Deprecated: ignored. The builder wires what happens after the action. */
changeLabel?: string
/** "success" is accepted for older callers and renders as default. */
state?: LedgerState
onSelect?: (pkg: LedgerPackage, index: number) => void
/** Called on submit with the selected package. Without it the button does nothing visible. */
onSubmit?: (pkg: LedgerPackage, index: number) => void | Promise<void>
/** The perUnit template uses {unit}. */
copy?: Partial<{ perUnit: string; regularPrice: string; payments: string }>
paymentLabels?: Partial<Record<'Visa' | 'Mastercard' | 'American Express' | 'Discover', string>>
className?: string
style?: React.CSSProperties
}
export function BundlePicker7({
headline = 'Pick your supply and lock in the lowest price per bottle',
highlight = 'lowest price per bottle',
lead = 'Choose one package below. Your order total adds itself up as you go.',
packages = DEFAULT_PACKAGES,
unit = { one: 'Bottle', other: 'Bottles' },
defaultSelected,
currency = 'USD',
locale = 'en-US',
legend = 'Choose your package',
columnLabels = { pkg: 'Your package', price: 'Price' },
buttonLabel = ({ units, unitWord }) => `Yes! Send Me ${units} ${unitWord}`,
loadingLabel = 'Adding to your order…',
bestValueLabel = 'Best value!',
perUnitLabel,
standardLabel = 'Standard price',
saveWord = 'You save',
regularLabel = ({ units, unitWord, regularUnit }) => `${units} ${unitWord} at ${regularUnit} each`,
savingsLabel = (pct) => `Bundle savings (${pct}% off)`,
totalLabel = 'Your total today',
guarantee = '30-day money-back guarantee',
secureLabel = '',
showPaymentMarks = true,
errorMessage = 'We couldn’t add that to your order. Please try again.',
state,
onSelect,
onSubmit,
copy,
paymentLabels,
className,
style,
}: BundlePicker7Props) {
const text = { perUnit: 'per {unit}', regularPrice: 'Regular price ', payments: 'Accepted cards', ...copy }
const uid = React.useId()
const titleId = `${uid}-title`
const groupName = `${uid}-pkg`
const perUnitWord = perUnitLabel ?? text.perUnit.replaceAll('{unit}', () => unit.one.toLowerCase())
const money = React.useCallback(
(n: number) => {
const whole = Math.abs(n - Math.round(n)) < 0.005
return new Intl.NumberFormat(locale, {
style: 'currency',
currency,
minimumFractionDigits: whole ? 0 : 2,
maximumFractionDigits: whole ? 0 : 2,
}).format(whole ? Math.round(n) : n)
},
[locale, currency]
)
const rows = React.useMemo(() => {
const valid = packages.filter((p) => p.units > 0)
const base = valid.reduce<LedgerPackage | undefined>((m, p) => (!m || p.units < m.units ? p : m), undefined)
const baseUnit = base ? base.price / base.units : 0
return packages.map((p) => {
const perUnit = p.units > 0 ? p.price / p.units : p.price
const compare = baseUnit * p.units
const raw = compare - p.price
const savings = raw > 0.005 ? raw : 0
const pct = savings > 0 && compare > 0 ? Math.round((savings / compare) * 100) : 0
return { perUnit, compare: savings > 0 ? compare : p.price, savings, pct, baseUnit }
})
}, [packages])
const bestIndex = React.useMemo(() => {
if (rows.length < 2) return -1
const min = Math.min(...rows.map((x) => x.perUnit))
const hits = rows.filter((x) => Math.abs(x.perUnit - min) < 0.005)
if (hits.length !== 1 || !(min < rows[0].baseUnit - 0.005)) return -1
return rows.findIndex((x) => Math.abs(x.perUnit - min) < 0.005)
}, [rows])
const [selected, setSelected] = React.useState(() => {
if (typeof defaultSelected === 'number' && defaultSelected >= 0 && defaultSelected < packages.length) return defaultSelected
return bestIndex >= 0 ? bestIndex : 0
})
const [status, setStatus] = React.useState<Status>(() => statusFrom(state))
React.useEffect(() => {
setStatus(statusFrom(state))
}, [state])
const alive = React.useRef(true)
React.useEffect(() => {
alive.current = true
return () => {
alive.current = false
}
}, [])
const sel = Math.min(Math.max(selected, 0), Math.max(packages.length - 1, 0))
const disabled = state === 'disabled'
const loading = status === 'loading'
const forced = state === 'hover' || state === 'active' ? state : undefined
const hasImg = packages.some((p) => !!p.image)
const word = (n: number) => (n === 1 ? unit.one : unit.other)
const pkg = packages[sel]
const r = rows[sel]
if (!pkg || !r) return null
const ctx: LedgerContext = {
units: pkg.units,
unitWord: word(pkg.units),
total: money(pkg.price),
perUnit: money(r.perUnit),
savings: money(r.savings),
regularUnit: r.savings > 0 ? money(r.baseUnit) : money(r.perUnit),
}
const choose = (i: number) => {
if (disabled || loading) return
setSelected(i)
if (status === 'error') setStatus('idle')
onSelect?.(packages[i], i)
}
const submit = async (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault()
if (disabled || loading || !onSubmit) return
setStatus('loading')
try {
await onSubmit(pkg, sel)
if (alive.current) setStatus('idle')
} catch {
if (alive.current) setStatus('error')
}
}
return (
<form
className={['bp7 cf-bundle-picker-7', className].filter(Boolean).join(' ')}
style={style}
onSubmit={submit}
aria-labelledby={titleId}
noValidate
data-force={forced}
data-status={status}
data-disabled={disabled ? '' : undefined}
data-noimg={hasImg ? undefined : ''}
>
<style>{CSS}</style>
<div className='bp7-sheet'>
<header className='bp7-head'>
<h2 id={titleId} className='bp7-title'>
{withMarker(headline, highlight)}
</h2>
{lead ? <p className='bp7-lead'>{lead}</p> : null}
</header>
<fieldset className='bp7-fs' disabled={disabled || loading}>
<legend className='bp7-vh'>{legend}</legend>
<div className='bp7-colhead' aria-hidden='true'>
<span>{columnLabels.pkg}</span>
<span className='bp7-colprice'>{columnLabels.price}</span>
</div>
<ul className='bp7-rows' role='list'>
{packages.map((p, i) => {
const row = rows[i]
const on = i === sel
return (
<li key={p.id ?? `${p.units}-${i}`}>
<label className='bp7-row' data-on={on ? '' : undefined}>
<input
className='bp7-radio'
type='radio'
name={groupName}
value={p.id ?? String(p.units)}
checked={on}
onChange={() => choose(i)}
/>
<span className='bp7-bubble' aria-hidden='true' />
{hasImg ? (
<span className='bp7-shot'>
{p.image ? (
<img src={p.image} alt={p.imageAlt ?? ''} loading='lazy' decoding='async' draggable={false} />
) : null}
</span>
) : null}
<span className='bp7-qty'>
<span className='bp7-num' aria-hidden='true'>
{p.units}
</span>
<span className='bp7-qtxt'>
<span className='bp7-unit'>
<span className='bp7-vh'>{p.units} </span>
{word(p.units)}
</span>
<span className='bp7-per'>
<b>{money(row.perUnit)}</b> {perUnitWord}
</span>
{i === bestIndex ? <span className='bp7-note'>{bestValueLabel}</span> : null}
</span>
<span className='bp7-dots' aria-hidden='true' />
</span>
<span className='bp7-price'>
{row.savings > 0 ? (
<s className='bp7-was'>
<span className='bp7-vh'>{text.regularPrice}</span>
{money(row.compare)}
</s>
) : null}
<span className='bp7-amt'>{money(p.price)}</span>
{row.savings > 0 ? (
<span className='bp7-save'>
{saveWord} {money(row.savings)}
</span>
) : (
<span className='bp7-std'>{standardLabel}</span>
)}
</span>
</label>
</li>
)
})}
</ul>
</fieldset>
<div className='bp7-sum' aria-live='polite'>
<div className='bp7-line'>
<span className='bp7-lbl'>{regularLabel(ctx)}</span>
<span className='bp7-leader' aria-hidden='true' />
<span className='bp7-val'>{money(r.compare)}</span>
</div>
{r.savings > 0 ? (
<div className='bp7-line' data-k='save'>
<span className='bp7-lbl'>{savingsLabel(r.pct)}</span>
<span className='bp7-leader' aria-hidden='true' />
<span className='bp7-val'>−{money(r.savings)}</span>
</div>
) : null}
<div className='bp7-line' data-k='total'>
<span className='bp7-lbl'>{totalLabel}</span>
<span className='bp7-leader' aria-hidden='true' />
<span className='bp7-val bp7-pop' key={`t-${sel}`}>
{money(pkg.price)}
</span>
</div>
</div>
<div className='bp7-act'>
{(
<>
<button
type='submit'
className='bp7-cta'
disabled={disabled}
aria-disabled={loading || undefined}
aria-busy={loading || undefined}
>
{loading ? (
<>
<Loader2 className='bp7-spin' size={24} strokeWidth={2.75} aria-hidden='true' />
<span>{loadingLabel}</span>
</>
) : (
<>
<span className='bp7-cta-txt'>{buttonLabel(ctx)}</span>
</>
)}
</button>
{status === 'error' ? (
<p className='bp7-err' role='alert'>
<AlertCircle size={20} strokeWidth={2.5} aria-hidden='true' />
<span>{errorMessage}</span>
</p>
) : null}
</>
)}
<p className='bp7-assure'>
{secureLabel ? (
<span>
<Lock size={17} strokeWidth={2.5} aria-hidden='true' />
{secureLabel}
</span>
) : null}
<span>
<ShieldCheck size={18} strokeWidth={2.5} aria-hidden='true' />
{guarantee}
</span>
</p>
{showPaymentMarks ? (
<ul className='bp7-pay' aria-label={text.payments}>
{PAY.map(([label, Card]) => (
<li key={label}>
<Card width={40} aria-label={paymentLabels?.[label] ?? label} />
</li>
))}
</ul>
) : null}
</div>
</div>
</form>
)
}
export default BundlePicker7
export const BundlePickerLedger = BundlePicker7
export type BundlePickerLedgerProps = BundlePicker7Props
type Status = 'idle' | 'loading' | 'error'
const DEFAULT_PACKAGES: LedgerPackage[] = [
{ units: 1, price: 47 },
{ units: 3, price: 129 },
{ units: 6, price: 234 },
]
const PAY = [
['Visa', Visa],
['Mastercard', Mastercard],
['American Express', AmericanExpress],
['Discover', Discover],
] as const
function statusFrom(state?: LedgerState): Status {
if (state === 'loading' || state === 'error') return state
return 'idle'
}
function withMarker(text: string, phrase?: string) {
if (!phrase) return text
const at = text.indexOf(phrase)
if (at < 0) return text
return (
<>
{text.slice(0, at)}
<span className='bp7-mark'>{phrase}</span>
{text.slice(at + phrase.length)}
</>
)
}
// Reduced-motion !important preserves the existing animation and transition cascade.
const CSS = `
.cf-bundle-picker-7{
--bp7-ink:var(--ink,#101828);
--bp7-navy:var(--ink);
--bp7-muted:var(--muted,#4a5565);
--bp7-paper:color-mix(in oklch, var(--ink) 4%, var(--card));
--bp7-paper-2:color-mix(in oklch, var(--ink) 8%, var(--card));
--bp7-rule:oklch(from var(--bp7-ink) l c h / 0.32);
--bp7-strip:color-mix(in oklch,var(--bp7-ink) 7%,var(--bp7-paper));
--bp7-wash:color-mix(in oklch, var(--accent-fill, var(--accent)) 12%, var(--card));
--bp7-save:var(--success);
--bp7-red:var(--danger);
--bp7-pen:var(--accent,#0f5fc2);
--bp7-marker:var(--marker, color-mix(in oklch, var(--accent) 12%, var(--card)));
--bp7-d:var(--font-display,'Roboto Slab',Georgia,serif);
--bp7-b:var(--font-body,'Source Serif 4',Georgia,serif);
--bp7-m:var(--font-body);
--bp7-s:var(--signature-font, 'Caveat', 'Segoe Print', cursive);
position:relative;isolation:isolate;box-sizing:border-box;
container-type:inline-size;container-name:bp7;
width:100%;max-width:820px;margin-inline:auto;
color:var(--bp7-ink);font-family:var(--font-body);font-size:17px;line-height:1.5;
-webkit-font-smoothing:antialiased;
}
.cf-bundle-picker-7 *,.cf-bundle-picker-7 *::before,.cf-bundle-picker-7 *::after{box-sizing:border-box}
.cf-bundle-picker-7::before{content:'';position:absolute;inset:12px 4px -10px 14px;z-index:-1;border-radius:6px;background:var(--bp7-paper-2);transform:rotate(1.3deg);box-shadow:var(--shadow-sm, 0 1px 1px oklch(0.22 0.03 260 / 0.18), 0 1px 3px oklch(0.22 0.03 260 / 0.14))}
:where(.cf-bundle-picker-7) .bp7-sheet{position:relative;padding:38px 40px 32px;border-radius:var(--card-radius, var(--radius, 6px));border:1px solid oklch(from var(--card-border, var(--bp7-ink)) l c h / 0.14);background-color:var(--bp7-paper);background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .32 0 0 0 0 .24 0 0 0 0 .12 0 0 0 .1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");box-shadow:var(--card-shadow, inset 0 1px 0 oklch(from var(--card) calc(l + 0.04) c h / .65),var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 260 / 0.2)))}
:where(.cf-bundle-picker-7) .bp7-vh{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
:where(.cf-bundle-picker-7) .bp7-head{text-align:center;margin:0 0 26px}
:where(.cf-bundle-picker-7) .bp7-title{margin:0 auto;font-family:var(--font-display);font-weight:var(--display-weight, 900);font-size:clamp(1.875rem,4.4vw,2.875rem);line-height:1.06;letter-spacing:var(--display-tracking, -.015em);color:var(--bp7-navy);text-wrap:balance;text-transform:var(--display-case, none)}
:where(.cf-bundle-picker-7) .bp7-mark{padding:0 .12em;margin:0 -.03em;background-image:linear-gradient(var(--bp7-marker),var(--bp7-marker));background-repeat:no-repeat;background-size:100% .6em;background-position:0 88%;border-radius:.22em .5em .3em .55em;-webkit-box-decoration-break:clone;box-decoration-break:clone}
:where(.cf-bundle-picker-7) .bp7-lead{margin:16px auto 0;max-width:44ch;font-size:1.125rem;font-weight:500;line-height:1.5;color:var(--bp7-muted);text-wrap:pretty}
:where(.cf-bundle-picker-7) .bp7-fs{margin:0;padding:0;border:0;min-width:0}
:where(.cf-bundle-picker-7) .bp7-colhead{display:flex;justify-content:space-between;gap:12px;padding:10px 18px;background:var(--bp7-strip);border-bottom:1.5px solid oklch(from var(--bp7-ink) l c h / 0.55);border-radius:4px 4px 0 0;font-family:var(--font-display);font-weight:var(--display-weight, 700);font-size:.875rem;line-height:1.2;letter-spacing:.1em;text-transform:uppercase;color:var(--bp7-muted)}
:where(.cf-bundle-picker-7) .bp7-rows{list-style:none;margin:0;padding:0}
:where(.cf-bundle-picker-7) .bp7-rows>li{margin:0;padding:0}
:where(.cf-bundle-picker-7) .bp7-row{position:relative;display:grid;grid-template-columns:28px 108px minmax(0,1fr) 128px;grid-template-areas:'bub shot qty price';align-items:start;column-gap:18px;padding:18px;border-bottom:1.5px dashed var(--bp7-rule);cursor:pointer;transition:background-color .2s ease,box-shadow .2s ease}
.cf-bundle-picker-7[data-noimg] .bp7-row{grid-template-columns:28px minmax(0,1fr) 128px;grid-template-areas:'bub qty price'}
.cf-bundle-picker-7:not([data-disabled]) .bp7-row:not([data-on]):hover{background:color-mix(in oklch,var(--bp7-wash) 55%,var(--bp7-paper))}
:where(.cf-bundle-picker-7) .bp7-row[data-on]{background:var(--bp7-wash);box-shadow:inset 0 0 0 2px var(--bp7-navy);border-bottom-color:transparent}
:where(.cf-bundle-picker-7) .bp7-row:has(.bp7-radio:focus-visible){outline:3px solid var(--bp7-pen);outline-offset:-3px}
:where(.cf-bundle-picker-7) .bp7-radio{position:absolute;opacity:0;width:1px;height:1px;margin:0;pointer-events:none;accent-color:var(--field-focus, var(--accent))}
:where(.cf-bundle-picker-7) .bp7-bubble{grid-area:bub;display:grid;place-items:center;width:28px;height:28px;margin-top:14px;border-radius:var(--field-radius, var(--radius, 50%));border:2px solid var(--bp7-navy);background:var(--field, var(--card));box-shadow:inset 0 1px 2px oklch(from var(--surface) min(0.24, calc(l - 0.12)) c h / .12);transition:transform .15s ease;border-color:var(--field-border, var(--ink))}
:where(.cf-bundle-picker-7) .bp7-bubble::after{content:'';width:14px;height:14px;border-radius:50%;background:var(--field-ink, var(--ink));transform:scale(0);transition:transform .18s cubic-bezier(.3,1.6,.5,1)}
:where(.cf-bundle-picker-7) .bp7-row[data-on] .bp7-bubble::after{transform:scale(1)}
:where(.cf-bundle-picker-7) .bp7-row:active .bp7-bubble{transform:scale(.92)}
:where(.cf-bundle-picker-7) .bp7-shot{grid-area:shot;display:grid;place-items:center;width:108px;height:92px}
:where(.cf-bundle-picker-7) .bp7-shot img{display:block;max-width:100%;max-height:100%;object-fit:contain;mix-blend-mode:normal;transition:transform .3s ease}
:where(.cf-bundle-picker-7) .bp7-row:hover .bp7-shot img,:where(.cf-bundle-picker-7) .bp7-row[data-on] .bp7-shot img{transform:translateY(-2px) scale(1.03)}
:where(.cf-bundle-picker-7) .bp7-qty{grid-area:qty;position:relative;display:flex;align-items:flex-start;gap:16px;min-width:0}
:where(.cf-bundle-picker-7) .bp7-num{position:relative;flex:none;min-width:1.15ch;padding:2px 6px 0;font-family:var(--font-display);font-weight:var(--display-weight, 900);font-size:3.25rem;line-height:1;text-align:center;color:var(--bp7-navy);font-variant-numeric:tabular-nums;text-transform:var(--display-case, none)}
:where(.cf-bundle-picker-7) .bp7-qtxt{display:flex;flex-direction:column;min-width:0;padding-top:4px}
:where(.cf-bundle-picker-7) .bp7-unit{font-family:var(--font-display);font-weight:var(--display-weight, 800);font-size:1.375rem;line-height:1.15;color:var(--bp7-navy);text-transform:var(--display-case, none)}
:where(.cf-bundle-picker-7) .bp7-per{margin-top:6px;font-size:1rem;font-weight:500;line-height:1.35;color:var(--bp7-muted);white-space:nowrap}
:where(.cf-bundle-picker-7) .bp7-per b{font-family:var(--font-body);font-weight:700;color:var(--bp7-ink)}
:where(.cf-bundle-picker-7) .bp7-dots{flex:1;min-width:20px;margin-top:34px;border-bottom:2.5px dotted var(--bp7-rule)}
:where(.cf-bundle-picker-7) .bp7-note{position:absolute;right:2px;top:-2px;font-family:var(--signature-font, var(--signature-face, var(--font-display)));font-weight:700;font-size:1.625rem;line-height:1;color:var(--bp7-red);transform:rotate(-5deg);white-space:nowrap}
:where(.cf-bundle-picker-7) .bp7-price{grid-area:price;display:flex;flex-direction:column;align-items:flex-end;text-align:right;padding-top:2px}
:where(.cf-bundle-picker-7) .bp7-was{font-family:var(--font-body);font-size:1rem;line-height:1.3;color:var(--danger);text-decoration:line-through;text-decoration-color:var(--bp7-red);text-decoration-thickness:2px}
:where(.cf-bundle-picker-7) .bp7-amt{font-family:var(--font-body);font-weight:700;font-size:1.875rem;line-height:1.1;color:var(--bp7-ink);font-variant-numeric:tabular-nums}
:where(.cf-bundle-picker-7) .bp7-save,:where(.cf-bundle-picker-7) .bp7-std{margin-top:12px;font-size:1rem;line-height:1.3;white-space:nowrap}
:where(.cf-bundle-picker-7) .bp7-save{font-weight:700;color:var(--bp7-save);background:var(--success-soft)}
:where(.cf-bundle-picker-7) .bp7-std{font-weight:500;color:var(--bp7-muted)}
:where(.cf-bundle-picker-7) .bp7-sum{margin-top:22px;padding:0 18px}
:where(.cf-bundle-picker-7) .bp7-line{display:flex;align-items:baseline;gap:10px;padding:4px 0;font-size:1.0625rem;line-height:1.4}
:where(.cf-bundle-picker-7) .bp7-lbl{min-width:0;text-wrap:pretty}
:where(.cf-bundle-picker-7) .bp7-leader{flex:1;min-width:16px;border-bottom:2px dotted var(--bp7-rule);transform:translateY(-.28em)}
:where(.cf-bundle-picker-7) .bp7-val{flex:none;font-family:var(--font-body);font-weight:700;white-space:nowrap;font-variant-numeric:tabular-nums}
:where(.cf-bundle-picker-7) .bp7-line[data-k='save']{color:var(--bp7-save);font-weight:600;background:var(--success-soft)}
:where(.cf-bundle-picker-7) .bp7-line[data-k='total']{margin-top:10px;padding:10px 0 12px;border-bottom:4px double var(--bp7-navy);color:var(--bp7-navy)}
:where(.cf-bundle-picker-7) .bp7-line[data-k='total'] .bp7-lbl{font-family:var(--font-display);font-weight:var(--display-weight, 900);font-size:1.375rem;line-height:1.2}
:where(.cf-bundle-picker-7) .bp7-line[data-k='total'] .bp7-val{font-size:2rem;line-height:1.1}
:where(.cf-bundle-picker-7) .bp7-line[data-k='total'] .bp7-leader{border-bottom-color:oklch(from var(--bp7-navy) l c h / 0.45)}
:where(.cf-bundle-picker-7) .bp7-pop{animation:bp7-pop .35s ease both}
:where(.cf-bundle-picker-7) .bp7-act{margin-top:26px;display:flex;flex-direction:column;align-items:center;gap:14px}
:where(.cf-bundle-picker-7) .bp7-cta{position:relative;width:100%;max-width:580px;min-height:68px;display:inline-flex;align-items:center;justify-content:center;gap:12px;padding:14px 24px;border:1px solid color-mix(in oklch,var(--button-bg-2, var(--cta-2,#b42318)) 80%,var(--ink));border-radius:var(--button-radius, var(--radius,10px));background:linear-gradient(180deg,var(--button-bg,var(--cta)),var(--button-bg-2,oklch(from var(--button-bg,var(--cta)) calc(l - 0.05) c h)));color:var(--button-ink, var(--cta-ink,#ffffff));font-family:var(--button-font, var(--font-display));font-weight:var(--button-weight, 800);font-size:clamp(1.25rem,2.6vw,1.625rem);line-height:1.15;letter-spacing:-.005em;text-align:center;text-shadow:var(--button-text-shadow, 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.2) c h / 0.75));cursor:pointer;box-shadow:var(--button-shadow, inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.12) c h / 0.5),inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h),var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 260 / 0.2)));transition:transform .15s ease,box-shadow .15s ease,filter .15s ease;text-transform:var(--button-case, none)}
:where(.cf-bundle-picker-7) .bp7-cta-txt{text-wrap:balance}
:where(.cf-bundle-picker-7) .bp7-cta:hover,.cf-bundle-picker-7[data-force='hover'] .bp7-cta{transform:translateY(-2px);filter:none;box-shadow:var(--button-shadow, inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.12) c h / 0.5),inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h),var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 260 / 0.2)));background:oklch(from var(--button-bg,var(--cta)) calc(l - 0.06) c h)}
:where(.cf-bundle-picker-7) .bp7-cta:active,.cf-bundle-picker-7[data-force='active'] .bp7-cta{transform:translateY(2px);filter:none;box-shadow:var(--button-shadow, inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.12) c h / 0.5),inset 0 -1px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h),var(--shadow-sm, 0 1px 1px oklch(0.22 0.03 260 / 0.18), 0 1px 3px oklch(0.22 0.03 260 / 0.14)));background:oklch(from var(--button-bg,var(--cta)) calc(l - 0.06) c h)}
:where(.cf-bundle-picker-7) .bp7-cta:focus-visible{outline:3px solid var(--bp7-pen);outline-offset:3px}
:where(.cf-bundle-picker-7) .bp7-cta[aria-busy='true']{cursor:progress;transform:none;filter:saturate(.9)}
:where(.cf-bundle-picker-7) .bp7-cta:disabled{cursor:not-allowed;transform:none;filter:none;background:var(--ink);border-color:var(--ink);text-shadow:none;box-shadow:var(--button-shadow, inset 0 -3px 0 oklch(from var(--surface) min(0.24, calc(l - 0.12)) c h / .15))}
:where(.cf-bundle-picker-7) .bp7-spin{flex:none;animation:bp7-spin .8s linear infinite}
:where(.cf-bundle-picker-7) .bp7-err{display:flex;align-items:flex-start;gap:10px;width:100%;max-width:580px;margin:0;padding:12px 16px;border-radius:8px;background:var(--danger-soft);border:1.5px solid oklch(from var(--bp7-red) l c h / 0.45);color:var(--danger);font-size:1rem;font-weight:600;line-height:1.4;text-wrap:pretty;animation:bp7-pop .3s ease both}
:where(.cf-bundle-picker-7) .bp7-err svg{flex:none;margin-top:1px}
:where(.cf-bundle-picker-7) .bp7-assure{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 18px;margin:0;font-style:italic;font-size:1.0625rem;line-height:1.4;color:var(--bp7-muted)}
:where(.cf-bundle-picker-7) .bp7-assure span{display:inline-flex;align-items:center;gap:7px}
:where(.cf-bundle-picker-7) .bp7-assure svg{flex:none;color:var(--bp7-navy)}
:where(.cf-bundle-picker-7) .bp7-pay{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;list-style:none;margin:0;padding:0}
:where(.cf-bundle-picker-7) .bp7-pay li{margin:0}
:where(.cf-bundle-picker-7) .bp7-pay svg{display:block;width:40px;height:auto}
.cf-bundle-picker-7[data-disabled] .bp7-row{cursor:not-allowed}
.cf-bundle-picker-7[data-disabled] .bp7-rows,.cf-bundle-picker-7[data-disabled] .bp7-sum{opacity:.55;filter:grayscale(.5)}
@keyframes bp7-pop{from{opacity:.55;transform:translateY(3px)}to{opacity:1;transform:none}}
@keyframes bp7-spin{to{transform:rotate(360deg)}}
@container bp7 (max-width:720px){
:where(.cf-bundle-picker-7) .bp7-sheet{padding:26px 16px 22px}
:where(.cf-bundle-picker-7) .bp7-head{margin-bottom:20px}
:where(.cf-bundle-picker-7) .bp7-lead{font-size:1.0625rem}
:where(.cf-bundle-picker-7) .bp7-colhead{padding:9px 12px}
:where(.cf-bundle-picker-7) .bp7-colprice{display:none}
:where(.cf-bundle-picker-7) .bp7-row{grid-template-columns:24px 76px minmax(0,1fr);grid-template-areas:'bub shot qty' 'bub shot price';column-gap:12px;padding:14px 12px}
.cf-bundle-picker-7[data-noimg] .bp7-row{grid-template-columns:24px minmax(0,1fr);grid-template-areas:'bub qty' 'bub price'}
:where(.cf-bundle-picker-7) .bp7-bubble{width:24px;height:24px;margin-top:10px;border-color:var(--field-border, var(--ink))}
:where(.cf-bundle-picker-7) .bp7-bubble::after{width:12px;height:12px}
:where(.cf-bundle-picker-7) .bp7-shot{width:76px;height:76px}
:where(.cf-bundle-picker-7) .bp7-qty{gap:12px}
:where(.cf-bundle-picker-7) .bp7-num{font-size:2.5rem;text-transform:var(--display-case, none)}
:where(.cf-bundle-picker-7) .bp7-unit{font-size:1.1875rem;text-transform:var(--display-case, none)}
:where(.cf-bundle-picker-7) .bp7-per{font-size:.9375rem;white-space:normal;text-wrap:pretty}
:where(.cf-bundle-picker-7) .bp7-dots{display:none}
:where(.cf-bundle-picker-7) .bp7-note{position:static;display:inline-block;align-self:flex-start;margin-top:6px;font-size:1.375rem;transform:rotate(-3deg)}
:where(.cf-bundle-picker-7) .bp7-price{flex-direction:row;flex-wrap:wrap;align-items:baseline;justify-content:flex-start;column-gap:10px;row-gap:2px;padding-top:10px;text-align:left}
:where(.cf-bundle-picker-7) .bp7-amt{order:-1;font-size:1.5rem}
:where(.cf-bundle-picker-7) .bp7-save,:where(.cf-bundle-picker-7) .bp7-std{margin-top:0;flex-basis:100%}
:where(.cf-bundle-picker-7) .bp7-sum{padding:0 2px;margin-top:18px}
:where(.cf-bundle-picker-7) .bp7-line{font-size:1rem}
:where(.cf-bundle-picker-7) .bp7-line[data-k='total'] .bp7-lbl{font-size:1.1875rem}
:where(.cf-bundle-picker-7) .bp7-line[data-k='total'] .bp7-val{font-size:1.625rem}
:where(.cf-bundle-picker-7) .bp7-cta{min-height:62px;padding:12px 16px;gap:10px;text-transform:var(--button-case, none);font-family:var(--button-font, var(--font-body))}
}
@media (max-width:480px){
.cf-bundle-picker-7::before{inset:10px 4px -8px 10px;transform:rotate(1deg)}
}
@media (prefers-reduced-motion:reduce){
.cf-bundle-picker-7 *,.cf-bundle-picker-7 *::before,.cf-bundle-picker-7 *::after{animation:none !important;transition:none !important}
:where(.cf-bundle-picker-7) .bp7-cta:hover,.cf-bundle-picker-7[data-force='hover'] .bp7-cta,:where(.cf-bundle-picker-7) .bp7-cta:active,.cf-bundle-picker-7[data-force='active'] .bp7-cta{transform:none}
:where(.cf-bundle-picker-7) .bp7-row:hover .bp7-shot img,:where(.cf-bundle-picker-7) .bp7-row[data-on] .bp7-shot img{transform:none}
}
`
pieces/offer/bundle-picker-7/specimen.tsx 52 lines
import { slot } from "../../slots";
import __studioImaged16de49b from "../assets/ead22084945b1e67.webp";
import __studioImagedb2ec227 from "../assets/911930370aa93e00.webp";
import __studioImage28ef026c from "../assets/0c5d6c5621019f9e.webp";
import * as React from 'react'
import BundlePicker7 from '../bundle-picker-7'
import defaults from '../../studio-defaults.json'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
type SpecimenState = 'default' | 'hover' | 'active' | 'disabled' | 'error'
function amount(v: string) {
const n = Number(String(v).replace(/[^0-9.]/g, ''))
return Number.isFinite(n) && n > 0 ? n : 47
}
export default function BundlePicker7Specimen({ state = 'default' }: { state?: SpecimenState }) {
const sample = defaults.sample
const single = amount(sample.price)
const guarantee = sample.guarantee.charAt(0).toUpperCase() + sample.guarantee.slice(1)
return (
<div>
<BundlePicker7
state={state}
guarantee={guarantee}
secureLabel='Secure checkout'
packages={[
{
units: 1,
price: single,
image: slot("item-1", __studioImaged16de49b),
imageAlt: 'One amber supplement bottle',
},
{
units: 3,
price: 129,
image: slot("item-2", __studioImagedb2ec227),
imageAlt: 'Three amber supplement bottles',
},
{
units: 6,
price: 234,
image: slot("item-3", __studioImage28ef026c),
imageAlt: 'Six amber supplement bottles',
},
]}
/>
</div>
)
}
| Name | Type | Details |
|---|---|---|
headline OptionalBundlePicker7 |
string |
Default 'Pick your supply and lock in the lowest price per bottle'
|
highlight OptionalBundlePicker7 |
string |
Default 'lowest price per bottle'
|
lead OptionalBundlePicker7 |
string |
Default 'Choose one package below. Your order total adds itself up as you go.'
|
packages OptionalBundlePicker7 |
LedgerPackage[] |
Default DEFAULT_PACKAGES
|
unit OptionalBundlePicker7 |
{ one: string; other: string } |
Default { one: 'Bottle', other: 'Bottles' }
|
defaultSelected OptionalBundlePicker7 |
number |
|
currency OptionalBundlePicker7 |
string |
Default 'USD'
|
locale OptionalBundlePicker7 |
string |
Default 'en-US'
|
legend OptionalBundlePicker7 |
string |
Default 'Choose your package'
|
columnLabels OptionalBundlePicker7 |
{ pkg: string; price: string } |
Default { pkg: 'Your package', price: 'Price' }
|
buttonLabel OptionalBundlePicker7 |
(ctx: LedgerContext) => string |
Default ({ units, unitWord }) => `Yes! Send Me ${units} ${unitWord}`
|
loadingLabel OptionalBundlePicker7 |
string |
Default 'Adding to your order…'
|
bestValueLabel OptionalBundlePicker7 |
string |
Default 'Best value!'
|
perUnitLabel OptionalBundlePicker7 |
string |
|
standardLabel OptionalBundlePicker7 |
string |
Default 'Standard price'
|
saveWord OptionalBundlePicker7 |
string |
Default 'You save'
|
regularLabel OptionalBundlePicker7 |
(ctx: LedgerContext) => string |
Default ({ units, unitWord, regularUnit }) => `${units} ${unitWord} at ${regularUnit} each`
|
savingsLabel OptionalBundlePicker7 |
(pct: number) => string |
Default (pct) => `Bundle savings (${pct}% off)`
|
totalLabel OptionalBundlePicker7 |
string |
Default 'Your total today'
|
guarantee OptionalBundlePicker7 |
string |
Default '30-day money-back guarantee'
|
secureLabel OptionalBundlePicker7 |
string |
Default ''
|
showPaymentMarks OptionalBundlePicker7 |
boolean |
Default true
|
errorMessage OptionalBundlePicker7 |
string |
Default 'We couldn’t add that to your order. Please try again.'
|
successTitle OptionalBundlePicker7 |
(ctx: LedgerContext) => string |
|
successBody OptionalBundlePicker7 |
string |
|
changeLabel OptionalBundlePicker7 |
string |
|
state OptionalBundlePicker7 |
LedgerState |
|
onSelect OptionalBundlePicker7 |
(pkg: LedgerPackage, index: number) => void |
|
onSubmit OptionalBundlePicker7 |
(pkg: LedgerPackage, index: number) => void | Promise<void> |
|
copy OptionalBundlePicker7 |
Partial<{ perUnit: string; regularPrice: string; payments: string }> |
|
paymentLabels OptionalBundlePicker7 |
Partial<Record<'Visa' | 'Mastercard' | 'American Express' | 'Discover', string>> |
|
className OptionalBundlePicker7 |
string |
|
style OptionalBundlePicker7 |
React.CSSProperties |
|
headline OptionalBundlePickerLedger |
string |
|
highlight OptionalBundlePickerLedger |
string |
|
lead OptionalBundlePickerLedger |
string |
|
packages OptionalBundlePickerLedger |
LedgerPackage[] |
|
unit OptionalBundlePickerLedger |
{ one: string; other: string } |
|
defaultSelected OptionalBundlePickerLedger |
number |
|
currency OptionalBundlePickerLedger |
string |
|
locale OptionalBundlePickerLedger |
string |
|
legend OptionalBundlePickerLedger |
string |
|
columnLabels OptionalBundlePickerLedger |
{ pkg: string; price: string } |
|
buttonLabel OptionalBundlePickerLedger |
(ctx: LedgerContext) => string |
|
loadingLabel OptionalBundlePickerLedger |
string |
|
bestValueLabel OptionalBundlePickerLedger |
string |
|
perUnitLabel OptionalBundlePickerLedger |
string |
|
standardLabel OptionalBundlePickerLedger |
string |
|
saveWord OptionalBundlePickerLedger |
string |
|
regularLabel OptionalBundlePickerLedger |
(ctx: LedgerContext) => string |
|
savingsLabel OptionalBundlePickerLedger |
(pct: number) => string |
|
totalLabel OptionalBundlePickerLedger |
string |
|
guarantee OptionalBundlePickerLedger |
string |
|
secureLabel OptionalBundlePickerLedger |
string |
|
showPaymentMarks OptionalBundlePickerLedger |
boolean |
|
errorMessage OptionalBundlePickerLedger |
string |
|
successTitle OptionalBundlePickerLedger |
(ctx: LedgerContext) => string |
|
successBody OptionalBundlePickerLedger |
string |
|
changeLabel OptionalBundlePickerLedger |
string |
|
state OptionalBundlePickerLedger |
LedgerState |
|
onSelect OptionalBundlePickerLedger |
(pkg: LedgerPackage, index: number) => void |
|
onSubmit OptionalBundlePickerLedger |
(pkg: LedgerPackage, index: number) => void | Promise<void> |
|
copy OptionalBundlePickerLedger |
Partial<{ perUnit: string; regularPrice: string; payments: string }> |
|
paymentLabels OptionalBundlePickerLedger |
Partial<Record<'Visa' | 'Mastercard' | 'American Express' | 'Discover', string>> |
|
className OptionalBundlePickerLedger |
string |
|
style OptionalBundlePickerLedger |
React.CSSProperties |
Theme roles it reads
Set by the theme bar, a preset or your brand. Colours come from the base tokens (--surface, --ink, --cta…) every piece uses.
--button-bg--button-bg-2--button-case--button-font--button-ink--button-radius--button-shadow--button-text-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field--field-border--field-focus--field-ink--field-radius- Form inputs: background, ink, border, radius and focus colour.
--marker- The highlighter colour behind key phrases.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
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.
-
0c5d6c5621019f9e.webp
image/webp · 106 KB
-
911930370aa93e00.webp
image/webp · 74.5 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
ead22084945b1e67.webp
image/webp · 57 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB