Bundle Picker 10
Supply picker for physical products: 1, 3 or 6 units as bento tiles with a price-per-unit ladder from the supplied
Use it in a prompt
Use offer/bundle-picker-10 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-10.tsx. - Import it and pass your copy and images (Props tab):
import { BundlePicker10 } from "@/components/funneldna/offer/bundle-picker-10"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/bundle-picker-10/component.tsx 956 lines
// layout: bento-grid
// Supply picker for physical products: 1, 3 or 6 units as bento tiles with a price-per-unit ladder from the supplied
// prices, so the bigger supply reads as the better deal, and one dominant order block whose button names the chosen supply.
'use client'
import * as React from 'react'
import { AlertCircle, Check, Loader2, Lock, ShieldCheck, TrendingDown } from 'lucide-react'
// Official payment-network marks keep their brand colours (documented theme exception, SVG only).
import { AmericanExpress, Discover, Mastercard, Visa } from 'react-svg-credit-card-payment-icons/icons/flat-rounded'
export type BundlePicker10Package = {
/** Number of units in the package, e.g. 1, 3, 6. */
units: number
/** Total price of the package in the chosen currency. */
price: number
/** Cut-out photo of this exact package (one bottle, three, six) on a transparent background. */
image?: string
/** Alt text for the package photo; defaults to copy.imageAlt. */
imageAlt?: string
/** Value posted for this package; defaults to the unit count. */
id?: string
}
export type BundlePicker10State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type BundlePicker10Context = {
units: number
unitWord: string
total: string
perUnit: string
savings: string
}
/**
* Copy templates. Named placeholders are replaced as text:
* {unit} (singular, lower case), {unitOther} (plural, lower case), {units} (count), {unitWord} (singular or plural
* for the count), {total}, {perUnit}, {savings} and {guarantee}.
*/
export type BundlePicker10Copy = {
/** Screen-reader legend for the package choices. */
legend: string
perUnit: string
save: string
singlePrice: string
orderTitle: string
oneTime: string
savingsLine: string
singleLine: string
ladderTitle: string
ladderRow: string
/** Button text, used when no buttonLabel function is supplied. */
button: string
commit: string
commitError: string
guaranteeNote: string
/** Accessible name of the payment-mark list. */
payments: string
/** Polite live-region announcement after a choice. */
live: string
/** Fallback alt text for the order-block photo. */
imageAlt: string
}
export type BundlePicker10Props = {
headline?: string
/** Phrase inside the headline that gets the marker stroke. */
highlight?: string
/** Supporting line under the headline. */
lead?: string
packages?: BundlePicker10Package[]
/** Unit names shown on tiles, the order block and the button. */
unit?: { one: string; other: string }
/** Index chosen on load; defaults to the best-value package. */
defaultSelected?: number
/** ISO currency code for every price. */
currency?: string
/** Locale used to format prices. */
locale?: string
/** Button text built from the chosen package; takes precedence over copy.button. */
buttonLabel?: (ctx: BundlePicker10Context) => string
/** Button text while onSubmit is pending. */
loadingLabel?: string
/** Shown only on the package whose price per unit is lowest by the supplied prices. */
bestValueLabel?: string
/** Guarantee name, filled into {guarantee}. */
guarantee?: string
/** Reassurance next to the payment marks. */
secureLabel?: string
showPaymentMarks?: boolean
/** Accessible names for the official payment marks. */
paymentLabels?: Partial<Record<'Visa' | 'Mastercard' | 'American Express' | 'Discover', string>>
/** Shown when onSubmit rejects. */
errorMessage?: string
/** Forces a preview state; 'error' starts with the guarantee box unticked and its message shown. */
state?: BundlePicker10State
/** Called whenever a package is chosen. */
onSelect?: (pkg: BundlePicker10Package, index: number) => void
/** Called with the chosen package once the guarantee box is ticked. */
onSubmit?: (pkg: BundlePicker10Package, index: number) => void | Promise<void>
copy?: Partial<BundlePicker10Copy>
className?: string
style?: React.CSSProperties
}
export function BundlePicker10(props: BundlePicker10Props) {
const {
headline = 'Choose your supply and watch the price per bottle drop',
highlight = 'price per bottle drop',
lead = 'Pick 1, 3 or 6 bottles. The bigger your supply, the less you pay for each bottle.',
packages = DEFAULT_PACKAGES,
unit = { one: 'Bottle', other: 'Bottles' },
defaultSelected,
currency = 'USD',
locale = 'en-US',
buttonLabel,
loadingLabel = 'Adding to your order…',
bestValueLabel = 'Best value',
guarantee = '30-day money-back guarantee',
secureLabel = 'Secure checkout',
showPaymentMarks = true,
paymentLabels,
errorMessage = 'We couldn’t add that to your order. Please try again.',
state,
onSelect,
onSubmit,
copy,
className,
style,
} = props
const text = { ...DEFAULT_COPY, ...copy }
const uid = React.useId()
const group = `${uid}-supply`
const ids = { title: `${uid}-title`, order: `${uid}-order`, commitError: `${uid}-commit-error` }
const money = React.useCallback((n: number) => formatMoney(n, locale, currency), [locale, currency])
const one = unit.one.toLowerCase()
const other = unit.other.toLowerCase()
const wordFor = (n: number) => (n === 1 ? unit.one : unit.other)
const rows = React.useMemo(() => {
const valid = packages.filter((p) => p.units > 0)
const base = valid.reduce<BundlePicker10Package | undefined>((m, p) => (!m || p.units < m.units ? p : m), undefined)
const baseUnit = base ? base.price / base.units : 0
return packages.map((p) => {
const per = p.units > 0 ? p.price / p.units : p.price
const raw = baseUnit * p.units - p.price
return { per, savings: raw > 0.005 ? raw : 0, baseUnit }
})
}, [packages])
const bestIndex = React.useMemo(() => {
if (rows.length < 2) return -1
const min = Math.min(...rows.map((r) => r.per))
const hits = rows.filter((r) => Math.abs(r.per - min) < 0.005)
if (hits.length !== 1 || !(min < rows[0].baseUnit - 0.005)) return -1
return rows.findIndex((r) => Math.abs(r.per - 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<'idle' | 'loading' | 'error'>('idle')
const [commit, setCommit] = React.useState(state !== 'error')
const [fieldError, setFieldError] = React.useState(state === 'error')
React.useEffect(() => {
setCommit(state !== 'error')
setFieldError(state === 'error')
setStatus('idle')
}, [state])
const alive = React.useRef(true)
React.useEffect(() => {
alive.current = true
return () => {
alive.current = false
}
}, [])
const commitRef = React.useRef<HTMLInputElement>(null)
const disabled = state === 'disabled'
const loading = status === 'loading'
const index = Math.min(Math.max(selected, 0), Math.max(packages.length - 1, 0))
const pkg = packages[index]
const row = rows[index]
if (!pkg || !row) return null
const choose = (i: number) => {
if (disabled || loading) return
setSelected(i)
if (status === 'error') setStatus('idle')
onSelect?.(packages[i], i)
}
const toggleCommit = (e: React.ChangeEvent<HTMLInputElement>) => {
setCommit(e.target.checked)
if (e.target.checked) setFieldError(false)
}
const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault()
if (disabled || loading) return
if (!commit) {
setFieldError(true)
commitRef.current?.focus()
return
}
if (!onSubmit) return
setStatus('loading')
try {
await onSubmit(pkg, index)
if (alive.current) setStatus('idle')
} catch {
if (alive.current) setStatus('error')
}
}
const total = money(pkg.price)
const unitWord = wordFor(pkg.units)
const ctx: BundlePicker10Context = {
units: pkg.units,
unitWord,
total: total.text,
perUnit: money(row.per).text,
savings: money(row.savings).text,
}
const vars = {
units: pkg.units,
unitWord,
unit: one,
unitOther: other,
total: total.text,
perUnit: ctx.perUnit,
savings: ctx.savings,
guarantee,
}
const label = buttonLabel ? buttonLabel(ctx) : fill(text.button, vars)
const maxPer = Math.max(...rows.map((r) => r.per), 0.0001)
const forced = state === 'hover' ? ' is-hover' : state === 'active' ? ' is-active' : ''
return (
<form
className={['cf-bp10', className].filter(Boolean).join(' ')}
style={{ ...style, ['--bp10-n' as string]: String(packages.length) } as React.CSSProperties}
onSubmit={handleSubmit}
noValidate
aria-labelledby={ids.title}
aria-busy={loading || undefined}
>
<style>{CSS}</style>
<div className='cf-bp10-tile cf-bp10-promise'>
<h2 id={ids.title} className='cf-bp10-headline'>
<Marked text={headline} phrase={highlight} />
</h2>
{lead ? <p className='cf-bp10-lead'>{lead}</p> : null}
</div>
<fieldset className='cf-bp10-opts' disabled={disabled || loading}>
<legend className='cf-bp10-sr'>{text.legend}</legend>
{packages.map((p, i) => {
const r = rows[i]
const on = i === index
return (
<label key={p.id ?? `${p.units}-${i}`} className={`cf-bp10-opt${on ? ' is-on' : ''}`}>
<input
className='cf-bp10-opt-input'
type='radio'
name={group}
value={p.id ?? String(p.units)}
checked={on}
onChange={() => choose(i)}
/>
{i === bestIndex ? <span className='cf-bp10-badge'>{bestValueLabel}</span> : null}
<span className='cf-bp10-dot' aria-hidden='true'>
<Check size={13} strokeWidth={3.5} />
</span>
{p.image ? (
<img className='cf-bp10-opt-img' src={p.image} alt='' width={136} height={136} loading='lazy' decoding='async' />
) : (
<span className='cf-bp10-opt-gap' aria-hidden='true' />
)}
<span className='cf-bp10-opt-qty'>
{p.units} {wordFor(p.units)}
</span>
<span className='cf-bp10-opt-per'>
<b>{money(r.per).text}</b>
<span>{fill(text.perUnit, { unit: one })}</span>
</span>
<span className={r.savings > 0 ? 'cf-bp10-opt-save' : 'cf-bp10-opt-base'}>
{r.savings > 0 ? fill(text.save, { savings: money(r.savings).text }) : text.singlePrice}
</span>
</label>
)
})}
</fieldset>
<div className='cf-bp10-order' role='group' aria-labelledby={ids.order}>
{pkg.image ? (
<div className='cf-bp10-stage'>
<img
key={`img-${index}`}
className='cf-bp10-stage-img'
src={pkg.image}
alt={pkg.imageAlt ?? fill(text.imageAlt, vars)}
width={300}
height={300}
decoding='async'
/>
</div>
) : null}
<h3 id={ids.order} className='cf-bp10-order-title'>
{fill(text.orderTitle, vars)}
</h3>
<p key={`price-${index}`} className='cf-bp10-price'>
<span className='cf-bp10-price-sym'>{total.symbol}</span>
<span className='cf-bp10-price-fig'>{total.figure}</span>
</p>
<p className='cf-bp10-onetime'>{text.oneTime}</p>
<p className='cf-bp10-saveline'>
{row.savings > 0 ? (
<>
<TrendingDown size={18} aria-hidden='true' />
<span>{fillRich(text.savingsLine, vars, 'savings', <strong>{ctx.savings}</strong>)}</span>
</>
) : (
<span>{fill(text.singleLine, vars)}</span>
)}
</p>
<div className='cf-bp10-commit'>
<label className='cf-bp10-commit-row'>
<input
ref={commitRef}
className='cf-bp10-commit-input'
type='checkbox'
checked={commit}
onChange={toggleCommit}
disabled={disabled || loading}
aria-invalid={fieldError || undefined}
aria-describedby={fieldError ? ids.commitError : undefined}
/>
<span className='cf-bp10-commit-box' aria-hidden='true'>
<Check size={16} strokeWidth={3.5} />
</span>
<span className='cf-bp10-commit-text'>{fill(text.commit, vars)}</span>
</label>
{fieldError ? (
<p id={ids.commitError} className='cf-bp10-alert' role='alert'>
<AlertCircle size={18} aria-hidden='true' />
<span>{text.commitError}</span>
</p>
) : null}
</div>
<button type='submit' className={`cf-bp10-btn${forced}`} disabled={disabled} aria-disabled={loading || undefined}>
{loading ? (
<>
<Loader2 className='cf-bp10-spin' size={22} aria-hidden='true' />
<span>{loadingLabel}</span>
</>
) : (
<span>{label}</span>
)}
</button>
{status === 'error' ? (
<p className='cf-bp10-alert cf-bp10-alert-submit' role='alert'>
<AlertCircle size={18} aria-hidden='true' />
<span>{errorMessage}</span>
</p>
) : null}
<div className='cf-bp10-trust'>
<span className='cf-bp10-secure'>
<Lock size={15} aria-hidden='true' />
{secureLabel}
</span>
{showPaymentMarks ? (
<ul className='cf-bp10-cards' aria-label={text.payments}>
{MARKS.map(([name, PayMark]) => (
<li key={name}>
<PayMark width={36} aria-label={paymentLabels?.[name] ?? name} />
</li>
))}
</ul>
) : null}
</div>
</div>
<div className='cf-bp10-tile cf-bp10-ladder'>
<h3 className='cf-bp10-ladder-title'>{fill(text.ladderTitle, { unit: one })}</h3>
<ul className='cf-bp10-bars'>
{packages.map((p, i) => {
const r = rows[i]
const width = Math.max(8, Math.round((r.per / maxPer) * 100))
return (
<li key={p.id ?? `${p.units}-bar-${i}`} className={`cf-bp10-bar${i === index ? ' is-on' : ''}`}>
<span className='cf-bp10-bar-lbl'>{fill(text.ladderRow, { units: p.units, unitWord: p.units === 1 ? one : other })}</span>
<span className='cf-bp10-track' aria-hidden='true'>
<span className='cf-bp10-fill' style={{ width: `${width}%` }} />
</span>
<span className='cf-bp10-val'>{money(r.per).text}</span>
</li>
)
})}
</ul>
<p className='cf-bp10-guarantee'>
<ShieldCheck size={20} aria-hidden='true' />
<span>{fill(text.guaranteeNote, vars)}</span>
</p>
</div>
<p className='cf-bp10-sr' aria-live='polite'>
{fill(text.live, vars)}
</p>
</form>
)
}
export default BundlePicker10
const DEFAULT_PACKAGES: BundlePicker10Package[] = [
{ units: 1, price: 47 },
{ units: 3, price: 117 },
{ units: 6, price: 198 },
]
const DEFAULT_COPY: BundlePicker10Copy = {
legend: 'Choose your supply',
perUnit: 'per {unit}',
save: 'Save {savings}',
singlePrice: 'Single price',
orderTitle: '{units} {unitWord}',
oneTime: 'one-time payment',
savingsLine: 'You save {savings} vs. {units} single {unitOther}',
singleLine: 'Standard single-{unit} price',
ladderTitle: 'Your price per {unit}',
ladderRow: '{units} {unitWord}',
button: 'Send Me {units} {unitWord}',
commit: 'I understand I’m covered by the {guarantee}.',
commitError: 'Tick the box to confirm, then press the button again.',
guaranteeNote: '{guarantee} on every supply',
payments: 'Accepted cards',
live: '{units} {unitWord} selected, {total} total',
imageAlt: '{units} {unitWord}',
}
const MARKS = [
['Visa', Visa],
['Mastercard', Mastercard],
['American Express', AmericanExpress],
['Discover', Discover],
] as const
function Marked({ text, phrase }: { text: string; phrase?: string }) {
const at = phrase ? text.indexOf(phrase) : -1
if (!phrase || at < 0) return <>{text}</>
return (
<>
{text.slice(0, at)}
<span className='cf-bp10-mark'>{phrase}</span>
{text.slice(at + phrase.length)}
</>
)
}
function fill(template: string, vars: Record<string, string | number>) {
return template.replace(/\{(\w+)\}/g, (match, key: string) => (key in vars ? String(vars[key]) : match))
}
function fillRich(template: string, vars: Record<string, string | number>, key: string, node: React.ReactNode) {
const token = `{${key}}`
const [head, ...rest] = template.split(token)
if (!rest.length) return fill(template, vars)
return (
<>
{fill(head, vars)}
{node}
{fill(rest.join(token), vars)}
</>
)
}
function formatMoney(n: number, locale: string, currency: string) {
const whole = Math.abs(n - Math.round(n)) < 0.005
const value = whole ? Math.round(n) : n
const f = new Intl.NumberFormat(locale, {
style: 'currency',
currency,
minimumFractionDigits: whole ? 0 : 2,
maximumFractionDigits: whole ? 0 : 2,
})
const parts = f.formatToParts(value)
const symbol = parts.filter((p) => p.type === 'currency').map((p) => p.value).join('')
const figure = parts.filter((p) => p.type !== 'currency' && p.type !== 'literal').map((p) => p.value).join('')
return { text: f.format(value), symbol, figure }
}
const CSS = `
.cf-bp10 {
--bp10-gap: 14px;
--bp10-r: var(--card-radius, var(--radius, 14px));
--bp10-line: var(--card-border, color-mix(in oklch, var(--ink, #172033) 12%, transparent));
--bp10-marker: var(--marker, #fae37cb8);
--bp10-shadow: var(--shadow, oklch(0.22 0.03 256));
--bp10-sm: var(--shadow-sm, 0 1px 2px oklch(from var(--bp10-shadow) l c h / 0.18), 0 2px 6px -2px oklch(from var(--bp10-shadow) l c h / 0.16));
--bp10-md: var(--shadow-md, 0 1px 2px oklch(from var(--bp10-shadow) l c h / 0.22), 0 6px 12px -4px oklch(from var(--bp10-shadow) l c h / 0.22));
--bp10-lg: var(--shadow-lg, 0 2px 4px oklch(from var(--bp10-shadow) l c h / 0.22), 0 14px 26px -10px oklch(from var(--bp10-shadow) l c h / 0.34));
position: relative;
box-sizing: border-box;
width: 100%;
max-width: 1120px;
margin-inline: auto;
display: grid;
gap: var(--bp10-gap);
grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
grid-template-rows: auto auto 1fr;
grid-template-areas: 'promise order' 'opts order' 'ladder order';
font-family: var(--font-body, system-ui, sans-serif);
color: var(--ink, #172033);
-webkit-font-smoothing: antialiased;
}
.cf-bp10 *, .cf-bp10 *::before, .cf-bp10 *::after { box-sizing: border-box; }
.cf-bp10 :where(h2, h3, p, ul, li, fieldset, legend) { margin: 0; padding: 0; }
.cf-bp10 :where(ul) { list-style: none; }
.cf-bp10-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cf-bp10-tile {
background: var(--card, #ffffff);
border: 1px solid var(--bp10-line);
border-radius: var(--bp10-r);
box-shadow: var(--card-shadow, var(--bp10-sm));
}
.cf-bp10-promise {
grid-area: promise;
display: flex;
flex-direction: column;
justify-content: center;
padding: clamp(1.5rem, 3vw, 2.375rem);
}
.cf-bp10-headline {
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
text-transform: var(--display-case, none);
letter-spacing: var(--display-tracking, -0.022em);
font-size: clamp(2rem, 3.3vw, 2.875rem);
line-height: 1.04;
color: var(--ink, #172033);
text-wrap: balance;
}
.cf-bp10-mark {
background-image: linear-gradient(transparent 50%, var(--bp10-marker) 50%, var(--bp10-marker) 93%, transparent 93%);
padding-inline: 0.1em;
margin-inline: -0.05em;
border-radius: 0.12em 0.32em 0.18em 0.4em;
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
}
.cf-bp10-lead {
margin-top: 0.875rem;
max-width: 46ch;
font-size: 1.0625rem;
font-weight: 500;
line-height: 1.5;
color: var(--muted, #4a5568);
text-wrap: pretty;
}
.cf-bp10-opts {
grid-area: opts;
min-width: 0;
border: 0;
padding-top: 14px;
display: grid;
grid-template-columns: repeat(var(--bp10-n, 3), minmax(0, 1fr));
gap: var(--bp10-gap);
}
.cf-bp10-opt {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
padding: 18px 12px 16px;
background: var(--card, #ffffff);
border: 1px solid var(--bp10-line);
border-radius: var(--bp10-r);
box-shadow: var(--card-shadow, var(--bp10-sm));
cursor: pointer;
transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}
.cf-bp10-opt:hover {
transform: translateY(-2px);
border-color: color-mix(in oklch, var(--ink, #172033) 30%, transparent);
box-shadow: var(--bp10-md);
}
.cf-bp10-opt.is-on {
background: color-mix(in oklch, var(--accent-fill, var(--accent, #2563eb)) 9%, var(--card, #ffffff));
border-color: var(--accent, #2563eb);
box-shadow: 0 0 0 1px var(--accent, #2563eb), var(--bp10-md);
}
.cf-bp10-opt:has(.cf-bp10-opt-input:focus-visible) {
outline: 3px solid var(--field-focus, var(--accent, #2563eb));
outline-offset: 3px;
}
.cf-bp10-opts:disabled .cf-bp10-opt { cursor: not-allowed; opacity: 0.6; transform: none; }
.cf-bp10-opt-input {
position: absolute;
opacity: 0;
width: 1px;
height: 1px;
margin: 0;
pointer-events: none;
accent-color: var(--field-focus, var(--accent, #2563eb));
}
.cf-bp10-dot {
position: absolute;
top: 14px;
left: 12px;
width: 22px;
height: 22px;
display: grid;
place-items: center;
border-radius: 50%;
border: 2px solid color-mix(in oklch, var(--ink, #172033) 30%, var(--card, #ffffff));
background: var(--card, #ffffff);
color: transparent;
transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.cf-bp10-opt.is-on .cf-bp10-dot {
background: var(--accent, #2563eb);
border-color: var(--accent, #2563eb);
color: var(--card, #ffffff);
}
.cf-bp10-badge {
position: absolute;
top: 0;
left: 50%;
translate: -50% -50%;
z-index: 1;
padding: 0.3rem 0.8rem;
border-radius: 999px;
background: var(--band, #1d2b4a);
color: var(--band-ink, #ffffff);
font-size: 0.875rem;
font-weight: 800;
line-height: 1.15;
white-space: nowrap;
box-shadow: var(--bp10-sm);
}
.cf-bp10-opt-img {
display: block;
width: 80%;
max-width: 136px;
aspect-ratio: 1;
height: auto;
object-fit: contain;
margin: 4px auto 8px;
filter: drop-shadow(0 1px 1px oklch(from var(--bp10-shadow) l c h / 0.22)) drop-shadow(0 8px 8px oklch(from var(--bp10-shadow) l c h / 0.18));
transition: transform 0.25s ease;
}
.cf-bp10-opt:hover .cf-bp10-opt-img { transform: scale(1.04); }
.cf-bp10-opt-gap { display: block; height: 24px; }
.cf-bp10-opt-qty {
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
text-transform: var(--display-case, none);
font-size: 1.1875rem;
line-height: 1.15;
color: var(--ink, #172033);
}
.cf-bp10-opt-per { display: grid; margin-top: 6px; color: var(--ink, #172033); }
.cf-bp10-opt-per b {
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
font-size: 1.25rem;
line-height: 1.1;
font-variant-numeric: tabular-nums;
}
.cf-bp10-opt-per span { font-size: 0.875rem; font-weight: 600; color: var(--muted, #4a5568); }
.cf-bp10-opt-save, .cf-bp10-opt-base { margin-top: 6px; font-size: 0.875rem; line-height: 1.3; }
.cf-bp10-opt-save { color: var(--success, #1e7a3c); font-weight: 800; }
.cf-bp10-opt-base { color: var(--muted, #4a5568); font-weight: 600; }
.cf-bp10-order {
grid-area: order;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
padding: clamp(1.5rem, 3vw, 2.375rem);
background: var(--band, #1d2b4a);
color: var(--band-ink, #ffffff);
border-radius: var(--bp10-r);
box-shadow: var(--bp10-lg), inset 0 1px 0 oklch(from var(--band, #1d2b4a) calc(l + 0.1) c h / 0.7);
}
.cf-bp10-stage { flex: 1 1 auto; display: grid; place-items: center; width: 100%; min-height: 180px; }
.cf-bp10-stage-img {
display: block;
width: min(300px, 74%);
aspect-ratio: 1;
height: auto;
object-fit: contain;
filter: drop-shadow(0 2px 2px oklch(from var(--bp10-shadow) calc(l - 0.08) c h / 0.4)) drop-shadow(0 14px 12px oklch(from var(--bp10-shadow) calc(l - 0.08) c h / 0.42));
animation: cf-bp10-in 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.cf-bp10-order-title {
margin-top: 10px;
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
text-transform: var(--display-case, none);
font-size: 1.5rem;
line-height: 1.15;
color: var(--band-ink, #ffffff);
}
.cf-bp10-price {
display: flex;
align-items: flex-start;
justify-content: center;
margin-top: 6px;
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
color: var(--band-ink, #ffffff);
font-variant-numeric: lining-nums;
animation: cf-bp10-rise 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.cf-bp10-price-sym { font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1; margin-top: 0.55rem; margin-right: 0.06em; }
.cf-bp10-price-fig { font-size: clamp(4rem, 7.4vw, 5.75rem); line-height: 0.95; letter-spacing: -0.035em; }
.cf-bp10-onetime {
margin-top: 12px;
font-size: 0.9375rem;
font-weight: 600;
letter-spacing: 0.02em;
color: color-mix(in oklab, var(--band-ink, #ffffff) 82%, var(--band, #1d2b4a));
}
.cf-bp10-saveline {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
margin-top: 10px;
font-size: 1rem;
line-height: 1.4;
color: var(--band-ink, #ffffff);
text-wrap: pretty;
}
.cf-bp10-saveline svg { flex: none; }
.cf-bp10-saveline strong { font-weight: 800; }
.cf-bp10-commit { width: 100%; max-width: 430px; margin-top: 22px; text-align: left; }
.cf-bp10-commit-row {
position: relative;
display: flex;
align-items: flex-start;
gap: 12px;
cursor: pointer;
font-size: 1rem;
font-weight: 600;
line-height: 1.4;
color: var(--band-ink, #ffffff);
text-wrap: pretty;
}
.cf-bp10-commit-input {
position: absolute;
top: 0;
left: 0;
opacity: 0;
width: 1px;
height: 1px;
margin: 0;
accent-color: var(--field-focus, var(--accent, #2563eb));
color: var(--field-ink, var(--ink, #172033));
}
.cf-bp10-commit-box {
flex: none;
width: 24px;
height: 24px;
display: grid;
place-items: center;
border-radius: 6px;
background: var(--field, var(--card, #ffffff));
border: 2px solid color-mix(in oklab, var(--band-ink, #ffffff) 60%, var(--band, #1d2b4a));
color: transparent;
transition: color 0.15s ease, border-color 0.15s ease;
}
.cf-bp10-commit-input:checked + .cf-bp10-commit-box { color: var(--success, #1e7a3c); border-color: var(--field, var(--card, #ffffff)); }
.cf-bp10-commit-input:focus-visible + .cf-bp10-commit-box { outline: 3px solid var(--band-ink, #ffffff); outline-offset: 2px; }
.cf-bp10-commit-input[aria-invalid='true'] + .cf-bp10-commit-box { border-color: var(--danger-soft, #fbe3e1); }
.cf-bp10-commit-input:disabled + .cf-bp10-commit-box { opacity: 0.6; }
.cf-bp10-alert {
display: flex;
align-items: flex-start;
gap: 8px;
margin-top: 10px;
padding: 0.625rem 0.875rem;
border-radius: calc(var(--bp10-r) * 0.6);
background: var(--danger-soft, #fbe3e1);
color: var(--danger, #b42318);
font-size: 0.9375rem;
font-weight: 600;
line-height: 1.4;
text-align: left;
}
.cf-bp10-alert svg { flex: none; margin-top: 1px; }
.cf-bp10-alert-submit { width: 100%; max-width: 430px; }
.cf-bp10-btn {
margin-top: 18px;
width: 100%;
max-width: 430px;
min-height: 66px;
padding: 0.9rem 1.25rem;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.6rem;
border: 1px solid oklch(from var(--button-bg, var(--cta, #d4322c)) calc(l - 0.12) c h);
border-radius: var(--button-radius, var(--radius, 12px));
background: linear-gradient(oklch(from var(--button-bg, var(--cta, #d4322c)) calc(l + 0.04) c h), var(--button-bg-2, var(--cta-2, #b3241f)));
color: var(--button-ink, var(--cta-ink, #ffffff));
font-family: var(--button-font, var(--font-display, inherit));
font-weight: var(--button-weight, 800);
text-transform: var(--button-case, none);
font-size: clamp(1.125rem, 1.6vw, 1.375rem);
line-height: 1.15;
text-wrap: balance;
text-shadow: var(--button-text-shadow, none);
cursor: pointer;
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--button-bg, var(--cta, #d4322c)) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta, #d4322c)) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--bp10-shadow) calc(l - 0.1) c h / 0.55), 0 6px 12px -4px oklch(from var(--bp10-shadow) calc(l - 0.1) c h / 0.55));
transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.cf-bp10-btn:hover:not(:disabled), .cf-bp10-btn.is-hover:not(:disabled) {
transform: translateY(-1px);
background: linear-gradient(oklch(from var(--button-bg, var(--cta, #d4322c)) calc(l - 0.01) c h), oklch(from var(--button-bg-2, var(--cta-2, #b3241f)) calc(l - 0.05) c h));
}
.cf-bp10-btn:active:not(:disabled), .cf-bp10-btn.is-active:not(:disabled) {
transform: translateY(1px);
background: linear-gradient(oklch(from var(--button-bg, var(--cta, #d4322c)) calc(l - 0.06) c h), oklch(from var(--button-bg-2, var(--cta-2, #b3241f)) calc(l - 0.08) c h));
box-shadow: inset 0 2px 3px oklch(from var(--button-bg-2, var(--cta-2, #b3241f)) calc(l - 0.2) c h / 0.6), 0 1px 1px oklch(from var(--bp10-shadow) calc(l - 0.1) c h / 0.45);
}
.cf-bp10-btn:focus-visible { outline: 3px solid var(--band-ink, #ffffff); outline-offset: 3px; }
.cf-bp10-btn:disabled {
cursor: not-allowed;
background: var(--button-2-bg, var(--secondary, #e6e9f0));
color: var(--button-2-ink, var(--secondary-ink, #172033));
border-color: var(--button-2-border, transparent);
text-shadow: none;
box-shadow: none;
transform: none;
}
.cf-bp10-btn[aria-disabled='true'] { cursor: progress; }
.cf-bp10-spin { animation: cf-bp10-spin 0.9s linear infinite; }
.cf-bp10-trust {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
gap: 10px 14px;
margin-top: 16px;
}
.cf-bp10-secure {
display: inline-flex;
align-items: center;
gap: 6px;
font-size: 0.875rem;
font-weight: 600;
color: color-mix(in oklab, var(--band-ink, #ffffff) 86%, var(--band, #1d2b4a));
}
.cf-bp10-cards { display: flex; gap: 6px; }
.cf-bp10-cards li { display: flex; }
.cf-bp10-cards svg { display: block; height: auto; }
.cf-bp10-ladder {
grid-area: ladder;
display: flex;
flex-direction: column;
gap: 14px;
padding: 1.5rem clamp(1.25rem, 2.6vw, 2rem);
}
.cf-bp10-ladder-title {
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
text-transform: var(--display-case, none);
font-size: 1.1875rem;
line-height: 1.2;
color: var(--ink, #172033);
}
.cf-bp10-bars { display: grid; gap: 10px; }
.cf-bp10-bar {
display: grid;
grid-template-columns: 5.75rem minmax(0, 1fr) auto;
align-items: center;
gap: 12px;
font-size: 0.9375rem;
font-weight: 600;
color: var(--muted, #4a5568);
}
.cf-bp10-bar.is-on { color: var(--ink, #172033); font-weight: 800; }
.cf-bp10-track { display: block; height: 12px; border-radius: 999px; overflow: hidden; background: color-mix(in oklch, var(--ink, #172033) 7%, var(--card, #ffffff)); }
.cf-bp10-fill {
display: block;
height: 100%;
border-radius: inherit;
background: color-mix(in oklch, var(--ink, #172033) 30%, var(--card, #ffffff));
transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.2s ease;
}
.cf-bp10-bar.is-on .cf-bp10-fill { background: var(--accent-fill, var(--accent, #2563eb)); }
.cf-bp10-val { min-width: 3.25rem; text-align: right; font-variant-numeric: tabular-nums; }
.cf-bp10-guarantee {
margin-top: auto;
display: flex;
align-items: center;
gap: 8px;
padding-top: 2px;
font-size: 0.9375rem;
font-weight: 600;
line-height: 1.4;
color: var(--ink, #172033);
}
.cf-bp10-guarantee svg { flex: none; color: var(--success, #1e7a3c); }
@keyframes cf-bp10-in { from { opacity: 0.35; transform: translateY(8px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes cf-bp10-rise { from { opacity: 0.6; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes cf-bp10-spin { to { transform: rotate(360deg); } }
@media (max-width: 860px) {
.cf-bp10 {
grid-template-columns: minmax(0, 1fr);
grid-template-rows: none;
grid-template-areas: 'promise' 'opts' 'order' 'ladder';
}
.cf-bp10-stage { min-height: 0; }
.cf-bp10-stage-img { width: min(240px, 68%); }
}
@media (max-width: 520px) {
.cf-bp10 { --bp10-gap: 10px; }
.cf-bp10-promise { padding: 1.375rem 1.25rem; }
.cf-bp10-headline { font-size: 1.875rem; }
.cf-bp10-opt { padding: 16px 8px 12px; }
.cf-bp10-dot { top: 10px; left: 9px; width: 20px; height: 20px; }
.cf-bp10-opt-img { width: 82%; margin-top: 8px; }
.cf-bp10-opt-qty { font-size: 1rem; }
.cf-bp10-opt-per b { font-size: 1.0625rem; }
.cf-bp10-order { padding: 1.5rem 1.125rem; }
.cf-bp10-bar { grid-template-columns: 5rem minmax(0, 1fr) auto; gap: 10px; }
}
/* Last in the sheet: every animation/transition above is a single-class selector, so source order wins without !important. */
@media (prefers-reduced-motion: reduce) {
.cf-bp10 *, .cf-bp10 *::before, .cf-bp10 *::after { animation: none; transition: none; }
.cf-bp10-opt:hover, .cf-bp10-opt:hover .cf-bp10-opt-img, .cf-bp10-btn:hover:not(:disabled), .cf-bp10-btn.is-hover:not(:disabled), .cf-bp10-btn:active:not(:disabled), .cf-bp10-btn.is-active:not(:disabled) { transform: none; }
}
`
pieces/offer/bundle-picker-10/specimen.tsx 44 lines
import __studioImage3d41af85 from "../assets/f116d5293e6bc9fd.webp";
import __studioImageebe7f50c from "../assets/8d8c97e8ad342863.webp";
import __studioImage359c9849 from "../assets/10bfad0c72e90655.webp";
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
import { BundlePicker10 } from '../bundle-picker-10'
import type { BundlePicker10State } from '../bundle-picker-10'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
const sample = defaults.sample
const singlePrice = Number(sample.price.replace(/[^0-9.]/g, '')) || 47
export default function BundlePicker10Specimen({ state }: { state?: BundlePicker10State }) {
return (
<BundlePicker10
state={state}
guarantee={sample.guarantee}
packages={[
{
id: 'supply-1',
units: 1,
price: singlePrice,
image: slot('item-1', __studioImage3d41af85),
imageAlt: 'One white supplement bottle',
},
{
id: 'supply-3',
units: 3,
price: 117,
image: slot('item-2', __studioImageebe7f50c),
imageAlt: 'Three white supplement bottles grouped together',
},
{
id: 'supply-6',
units: 6,
price: 198,
image: slot('item-3', __studioImage359c9849),
imageAlt: 'Six white supplement bottles in two rows',
},
]}
/>
)
}
| Name | Type | Details |
|---|---|---|
headline OptionalBundlePicker10 |
string |
|
highlight OptionalBundlePicker10 |
string |
|
lead OptionalBundlePicker10 |
string |
|
packages OptionalBundlePicker10 |
BundlePicker10Package[] |
|
unit OptionalBundlePicker10 |
{ one: string; other: string } |
|
defaultSelected OptionalBundlePicker10 |
number |
|
currency OptionalBundlePicker10 |
string |
|
locale OptionalBundlePicker10 |
string |
|
buttonLabel OptionalBundlePicker10 |
(ctx: BundlePicker10Context) => string |
|
loadingLabel OptionalBundlePicker10 |
string |
|
bestValueLabel OptionalBundlePicker10 |
string |
|
guarantee OptionalBundlePicker10 |
string |
|
secureLabel OptionalBundlePicker10 |
string |
|
showPaymentMarks OptionalBundlePicker10 |
boolean |
|
paymentLabels OptionalBundlePicker10 |
Partial<Record<'Visa' | 'Mastercard' | 'American Express' | 'Discover', string>> |
|
errorMessage OptionalBundlePicker10 |
string |
|
state OptionalBundlePicker10 |
BundlePicker10State |
|
onSelect OptionalBundlePicker10 |
(pkg: BundlePicker10Package, index: number) => void |
|
onSubmit OptionalBundlePicker10 |
(pkg: BundlePicker10Package, index: number) => void | Promise<void> |
|
copy OptionalBundlePicker10 |
Partial<BundlePicker10Copy> |
|
className OptionalBundlePicker10 |
string |
|
style OptionalBundlePicker10 |
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.
--button-2-bg--button-2-border--button-2-ink- 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-focus--field-ink- 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.
-
10bfad0c72e90655.webp
image/webp · 117 KB
-
8d8c97e8ad342863.webp
image/webp · 74 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB
-
f116d5293e6bc9fd.webp
image/webp · 60.8 KB