One Step Order 2
Sticky-receipt checkout for physical products: the buyer fills three quiet groups while the receipt beside them recounts subtotal, shipping and total live as the quantity changes, and ends in the one action.
Use it in a prompt
Use checkout/one-step-order-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/checkout/one-step-order-2.tsx. - Import it and pass your copy and images (Props tab):
import { OneStepOrder2 } from "@/components/funneldna/checkout/one-step-order-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/checkout/one-step-order-2/component.tsx 792 lines
// layout: ledger-receipt
// Sticky-receipt checkout for physical products: the buyer fills three quiet groups while the receipt beside them recounts subtotal, shipping and total live as the quantity changes, and ends in the one action.
'use client'
import * as React from 'react'
import { AlertCircle, Check, ChevronDown, CreditCard, Loader2, Lock, Minus, Plus, ShoppingBag, Truck } from 'lucide-react'
import { AmericanExpress, Discover, Mastercard, Visa } from 'react-svg-credit-card-payment-icons/icons/flat-rounded'
import { FX_HOST, Texture } from '../fx/fx'
import concrete from '../fx/textures/concrete'
export type OneStepOrder2State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type OneStepOrder2Network = 'visa' | 'mastercard' | 'amex' | 'discover'
export type OneStepOrder2Values = {
email: string
name: string
address: string
city: string
region: string
postal: string
card: string
exp: string
cvc: string
}
/** The receipt exactly as the buyer saw it when they ordered (display text). */
export type OneStepOrder2Order = { quantity: number; subtotal: string; shipping: string; total: string }
type Field = keyof OneStepOrder2Values
type Errors = Partial<Record<Field, string>>
type Touched = Partial<Record<Field, boolean>>
type Dir = '' | 'up' | 'down'
const ORDER_COPY = {
contactTitle: 'Where should we send your receipt?',
shippingTitle: 'Where should your order go?',
paymentTitle: 'How would you like to pay?',
emailLabel: 'Email address',
emailPlaceholder: 'you@example.com',
nameLabel: 'Full name',
namePlaceholder: 'Jane Smith',
addressLabel: 'Street address',
addressPlaceholder: '418 Alder Street, Apt 2',
cityLabel: 'City',
cityPlaceholder: 'Portland',
regionLabel: 'State / region',
regionPlaceholder: 'OR',
postalLabel: 'ZIP / postcode',
postalPlaceholder: '97205',
cardLabel: 'Card number',
cardPlaceholder: '1234 1234 1234 1234',
expLabel: 'Expiry',
expPlaceholder: 'MM / YY',
cvcLabel: 'Security code',
cvcPlaceholder: '123',
emailError: 'Enter a valid email address, like you@example.com.',
nameError: 'Enter the name for the delivery.',
addressError: 'Enter your street address.',
cityError: 'Enter your city.',
regionError: 'Enter your state or region.',
postalError: 'Enter your ZIP or postcode.',
cardError: 'Check your card number.',
expError: 'Enter a future expiry date as MM / YY.',
cvcError: 'Enter the {digits}-digit code on your card.',
networksLabel: 'Cards accepted',
summaryLabel: 'Order summary',
showSummary: 'Show order summary',
hideSummary: 'Hide order summary',
quantityLabel: 'Quantity',
decreaseLabel: 'Remove one',
increaseLabel: 'Add one more',
eachLabel: '{price} each',
subtotalLabel: 'Subtotal',
shippingLabel: 'Shipping',
freeLabel: 'Free',
totalLabel: 'Total',
freeNudgeOne: 'Add 1 more and shipping is free.',
freeNudgeMany: 'Add {count} more and shipping is free.',
freeReached: 'Shipping is on us.',
remainingOne: '1 detail to go',
remainingMany: '{count} details to go',
totalAnnounce: 'Quantity {quantity}. Total {total}.',
loadingLabel: 'Placing order…',
failMessage: 'We couldn’t place your order. Please try again.',
}
export type OneStepOrder2Copy = typeof ORDER_COPY
export type OneStepOrder2Props = {
/** Labels, placeholders and validation copy. Templates replace {price}, {count}, {quantity}, {total} and {digits} as text. */
copy?: Partial<OneStepOrder2Copy>
/** Receives the validated local values and the receipt. The block never sends or charges anything. A returned promise shows the loading label; a rejection shows copy.failMessage. */
onSubmit?: (values: Readonly<OneStepOrder2Values>, order: OneStepOrder2Order) => void | Promise<void>
/** Starting field values, for example a known email. */
defaultValues?: Partial<OneStepOrder2Values>
headline?: string
/** One continuous phrase inside the headline that gets the marker stroke. */
highlight?: string
/** One-sentence lines under the headline; a single-word line is set bold. */
punch?: string[]
productName?: string
/** Short line under the product name, for example what is in the set. */
productDetail?: string
/** Slot product: the finished product shot on a transparent background. */
productImage?: string
productImageAlt?: string
/** Supplied price of one unit, for example $89. */
price?: string
/** Supplied shipping per order, for example $12. */
shipping?: string
/** Quantity from which shipping is free. Only when that is the real policy. */
freeShippingFrom?: number
/** One honest line on why it ships the way it does. */
shippingReason?: string
defaultQuantity?: number
minQuantity?: number
maxQuantity?: number
/** Small line under the total. */
priceNote?: string
/** The question the button answers. */
question?: string
label?: string
/** Reassurance line under the button. Only true terms. */
sublabel?: string
/** Only list the networks the real processor accepts. */
networks?: OneStepOrder2Network[]
/** Shown under the button while checkout is unavailable. */
disabledMessage?: string
state?: OneStepOrder2State
disabled?: boolean
className?: string
}
export function OneStepOrder2({
copy: copyOverrides,
onSubmit,
defaultValues,
headline = 'Your Ember Peak set, ready for your stove',
highlight = 'ready for your stove',
punch = ['Choose how many sets.', 'Tell us where they go and how you’ll pay.', 'Done.'],
productName = 'Ember Peak Skillet Set',
productDetail,
productImage,
productImageAlt = '',
price = '$89',
shipping = '$12',
freeShippingFrom,
shippingReason = 'Cast iron is heavy, so every order ships in one padded carton.',
defaultQuantity = 1,
minQuantity = 1,
maxQuantity = 6,
priceNote = 'one-time payment',
question = 'Ready to start cooking on cast iron?',
label = 'I’m ready, ship it',
sublabel = 'Secure checkout',
networks = ['visa', 'mastercard', 'amex', 'discover'],
disabledMessage = 'Checkout is unavailable right now.',
state = 'default',
disabled = false,
className,
}: OneStepOrder2Props) {
const copy = { ...ORDER_COPY, ...Object.fromEntries(Object.entries(copyOverrides ?? {}).filter(([, v]) => v !== undefined)) } as OneStepOrder2Copy
const uid = 'cfo' + React.useId().replace(/[^a-zA-Z0-9]/g, '')
const formId = uid + '-form'
const headId = uid + '-head'
const bodyId = uid + '-body'
const hintId = uid + '-hint'
const barHintId = uid + '-barhint'
const min = Math.max(1, Math.floor(minQuantity))
const max = Math.max(min, Math.floor(maxQuantity))
const [qty, setQty] = React.useState(() => clampN(defaultQuantity, min, max))
const [dir, setDir] = React.useState<Dir>('')
const [open, setOpen] = React.useState(false)
const [values, setValues] = React.useState<OneStepOrder2Values>(() => prefill(state, defaultValues))
const [touched, setTouched] = React.useState<Touched>(() => (state === 'error' ? ALL_TOUCHED : {}))
const [busy, setBusy] = React.useState(false)
const [failed, setFailed] = React.useState(false)
const request = React.useRef(0)
const refs = React.useRef<Partial<Record<Field, HTMLInputElement | null>>>({})
React.useEffect(() => {
request.current++
setValues(prefill(state, defaultValues))
setTouched(state === 'error' ? ALL_TOUCHED : {})
setBusy(false)
setFailed(false)
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [state])
React.useEffect(() => () => { request.current++ }, [])
const locked = disabled || state === 'disabled'
const all = validate(values, copy)
const remaining = FIELDS.filter(f => all[f]).length
// The action stays live and loud: an incomplete form is answered on click (first missing field gets focus), never by a greyed-out CTA.
const submitDisabled = locked
const force = state === 'hover' ? ' is-hover' : state === 'active' ? ' is-active' : ''
const unit = parseMoney(price)
const ship = parseMoney(shipping)
const sym = symbolOf(price)
const dec = hasCents(price) || hasCents(shipping) ? 2 : 0
const free = freeShippingFrom != null && qty >= freeShippingFrom
const isFree = free || ship === 0
const shipN = isFree || ship === null ? 0 : ship
const subtotalText = unit === null ? price : money(unit * qty, sym, dec)
const shippingText = isFree ? copy.freeLabel : ship === null ? shipping : money(ship, sym, dec)
const totalText = unit === null ? price : money(unit * qty + shipN, sym, dec)
const showNudge = freeShippingFrom != null && freeShippingFrom > min && freeShippingFrom <= max && ship !== 0
const left = freeShippingFrom != null ? freeShippingFrom - qty : 0
const brand = detectBrand(digits(values.card))
const BrandIcon = brand ? NETS[brand].Icon : null
const hint = locked ? disabledMessage : remaining ? (remaining === 1 ? copy.remainingOne : tpl(copy.remainingMany, { count: String(remaining) })) : ''
function update(field: Field, raw: string) {
const v = field === 'card' ? formatCard(raw) : field === 'exp' ? formatExp(raw) : field === 'cvc' ? digits(raw).slice(0, 4) : raw
setValues(prev => ({ ...prev, [field]: v }))
if (failed) setFailed(false)
}
function blur(field: Field) {
if (values[field].trim()) setTouched(prev => (prev[field] ? prev : { ...prev, [field]: true }))
}
function step(delta: 1 | -1) {
const next = clampN(qty + delta, min, max)
if (next === qty || locked) return
setDir(delta > 0 ? 'up' : 'down')
setQty(next)
}
async function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
event.preventDefault()
if (locked || busy) return
if (remaining) {
setTouched(ALL_TOUCHED)
const first = FIELDS.find(f => all[f])
if (first) refs.current[first]?.focus()
return
}
setFailed(false)
if (!onSubmit) return
const req = ++request.current
try {
const result = onSubmit({ ...values }, { quantity: qty, subtotal: subtotalText, shipping: shippingText, total: totalText })
if (!result || typeof (result as Promise<void>).then !== 'function') return
setBusy(true)
await result
if (req === request.current) setBusy(false)
} catch {
if (req === request.current) {
setFailed(true)
setBusy(false)
}
}
}
const fp = (name: Field) => ({
id: uid + '-' + name,
name,
label: copy[(name + 'Label') as keyof OneStepOrder2Copy],
placeholder: copy[(name + 'Placeholder') as keyof OneStepOrder2Copy],
value: values[name],
error: touched[name] ? all[name] : undefined,
onChange: update,
onBlur: blur,
inputRef: (el: HTMLInputElement | null) => { refs.current[name] = el },
})
const banner = failed ? (
<p className='cfo-banner' role='alert'>
<AlertCircle className='cfo-inl' size={16} strokeWidth={2.5} aria-hidden='true' />
{copy.failMessage}
</p>
) : null
const sub = sublabel ? (
<p className='cfo-sub'>
<Lock className='cfo-inl' size={16} strokeWidth={2.5} aria-hidden='true' />
{sublabel}
</p>
) : null
const renderButton = (describedBy?: string) => (
<button
type='submit'
form={formId}
className={'cfo-btn' + force}
disabled={submitDisabled}
aria-disabled={busy || undefined}
aria-busy={busy || undefined}
aria-describedby={describedBy}
>
{busy ? (
<>
<Loader2 className='cfo-spin' size={20} strokeWidth={2.5} aria-hidden='true' />
<span>{copy.loadingLabel}</span>
</>
) : (
<span>{label}</span>
)}
</button>
)
const nudge = showNudge ? (
free ? (
<p className='cfo-nudge is-ok'>
<Check className='cfo-inl' size={16} strokeWidth={2.5} aria-hidden='true' />
{copy.freeReached}
</p>
) : (
<p className='cfo-nudge'>
<Truck className='cfo-inl' size={16} strokeWidth={2.5} aria-hidden='true' />
{left === 1 ? copy.freeNudgeOne : tpl(copy.freeNudgeMany, { count: String(left) })}
</p>
)
) : null
return (
<section className={[ROOT, className].filter(Boolean).join(' ')} aria-labelledby={headId}>
<style>{CSS}</style>
<div className='cfo-bg' aria-hidden='true'>
<div style={{ ...FX_HOST, position: 'absolute', inset: 0 }}>
<Texture src={concrete} tone='ink' />
</div>
</div>
<div className='cfo-wrap'>
<div className='cfo-grid'>
<header className='cfo-head'>
<h2 className='cfo-h' id={headId}>{withMark(headline, highlight)}</h2>
{punch.length ? (
<div className='cfo-punch'>
{punch.map((line, i) => (
<p key={i} className={line.trim().includes(' ') ? undefined : 'cfo-word'}>{line}</p>
))}
</div>
) : null}
</header>
<aside className='cfo-aside' aria-label={copy.summaryLabel}>
<div className={'cfo-receipt' + (open ? ' is-open' : '')}>
<button type='button' className='cfo-toggle' aria-expanded={open} aria-controls={bodyId} onClick={() => setOpen(o => !o)}>
<span className='cfo-toggle-l'>
<ShoppingBag size={20} strokeWidth={2.5} aria-hidden='true' />
<span>{open ? copy.hideSummary : copy.showSummary}</span>
<ChevronDown className='cfo-chev' size={18} strokeWidth={2.5} aria-hidden='true' />
</span>
<span className='cfo-toggle-total'><Roll value={totalText} dir={dir} /></span>
</button>
<div className='cfo-body' id={bodyId}>
{productImage ? <img className='cfo-shot' src={productImage} alt={productImageAlt} width={640} height={640} /> : null}
<div className='cfo-item'>
<div>
<h3 className='cfo-name'>{productName}</h3>
{productDetail ? <p className='cfo-detail'>{productDetail}</p> : null}
<p className='cfo-each'>{tpl(copy.eachLabel, { price })}</p>
</div>
<div className='cfo-step' role='group' aria-label={copy.quantityLabel}>
<button type='button' className='cfo-step-btn' aria-label={copy.decreaseLabel} disabled={locked || qty <= min} onClick={() => step(-1)}>
<Minus size={18} strokeWidth={2.5} aria-hidden='true' />
</button>
<span className='cfo-qty'><Roll value={String(qty)} dir={dir} /></span>
<button type='button' className='cfo-step-btn' aria-label={copy.increaseLabel} disabled={locked || qty >= max} onClick={() => step(1)}>
<Plus size={18} strokeWidth={2.5} aria-hidden='true' />
</button>
</div>
</div>
{nudge}
<dl className='cfo-ledger'>
<div className='cfo-line'>
<dt>{copy.subtotalLabel}</dt>
<dd><Roll value={subtotalText} dir={dir} /></dd>
</div>
<div className='cfo-line'>
<dt>{copy.shippingLabel}</dt>
<dd className={isFree ? 'cfo-free' : undefined}><Roll value={shippingText} dir={dir} /></dd>
</div>
</dl>
{shippingReason ? <p className='cfo-reason'>{shippingReason}</p> : null}
<div className='cfo-total'>
<span className='cfo-total-label'>{copy.totalLabel}</span>
<span className='cfo-total-fig'>
<span className='cfo-big'><SupPrice value={totalText} dir={dir} /></span>
{priceNote ? <span className='cfo-note'>{priceNote}</span> : null}
</span>
</div>
<div className='cfo-act'>
{question ? <p className='cfo-q'>{question}</p> : null}
{banner}
{renderButton(hint ? hintId : undefined)}
<div className='cfo-foot'>
{hint ? <p className='cfo-hint' id={hintId}>{hint}</p> : null}
{sub}
</div>
</div>
</div>
</div>
</aside>
<form id={formId} className='cfo-form' noValidate onSubmit={handleSubmit}>
<fieldset className='cfo-group' disabled={locked}>
<legend className='cfo-legend'>
<h3 className='cfo-gtitle'><span className='cfo-num' aria-hidden='true'>1</span><span>{copy.contactTitle}</span></h3>
</legend>
<div className='cfo-fields'>
<OrderField {...fp('email')} type='email' inputMode='email' autoComplete='email' />
</div>
</fieldset>
<fieldset className='cfo-group' disabled={locked}>
<legend className='cfo-legend'>
<h3 className='cfo-gtitle'><span className='cfo-num' aria-hidden='true'>2</span><span>{copy.shippingTitle}</span></h3>
</legend>
<div className='cfo-fields'>
<OrderField {...fp('name')} autoComplete='shipping name' />
<OrderField {...fp('address')} autoComplete='shipping address-line1' />
<div className='cfo-row cfo-row-3'>
<OrderField {...fp('city')} autoComplete='shipping address-level2' />
<OrderField {...fp('region')} autoComplete='shipping address-level1' />
<OrderField {...fp('postal')} autoComplete='shipping postal-code' />
</div>
</div>
</fieldset>
<fieldset className='cfo-group' disabled={locked}>
<legend className='cfo-legend'>
<h3 className='cfo-gtitle'><span className='cfo-num' aria-hidden='true'>3</span><span>{copy.paymentTitle}</span></h3>
</legend>
{networks.length ? (
<ul className='cfo-nets' aria-label={copy.networksLabel}>
{networks.map(n => {
const { name, Icon } = NETS[n]
return (
<li key={n}>
<span aria-hidden='true'><Icon /></span>
<span className='cfo-sr'>{name}</span>
</li>
)
})}
</ul>
) : null}
<div className='cfo-fields'>
<OrderField
{...fp('card')}
inputMode='numeric'
autoComplete='cc-number'
icon={BrandIcon ? <BrandIcon /> : <CreditCard size={20} strokeWidth={2.5} />}
iconBrand={Boolean(BrandIcon)}
/>
<div className='cfo-row'>
<OrderField {...fp('exp')} inputMode='numeric' autoComplete='cc-exp' />
<OrderField {...fp('cvc')} inputMode='numeric' autoComplete='cc-csc' />
</div>
</div>
</fieldset>
</form>
<div className='cfo-endq'>
{question ? <p className='cfo-q'>{question}</p> : null}
{banner}
{sub}
</div>
<div className='cfo-bar'>
<span className='cfo-bar-t'>
<span className='cfo-bar-l' id={hint ? barHintId : undefined}>{hint || copy.totalLabel}</span>
<span className='cfo-bar-fig'><Roll value={totalText} dir={dir} /></span>
</span>
{renderButton(hint ? barHintId : undefined)}
</div>
</div>
</div>
<p className='cfo-sr' role='status'>{dir ? tpl(copy.totalAnnounce, { quantity: String(qty), total: totalText }) : ''}</p>
</section>
)
}
export default OneStepOrder2
const ROOT = 'cf-one-step-order-2'
const NETS = {
visa: { name: 'Visa', Icon: Visa },
mastercard: { name: 'Mastercard', Icon: Mastercard },
amex: { name: 'American Express', Icon: AmericanExpress },
discover: { name: 'Discover', Icon: Discover },
}
const FIELDS: Field[] = ['email', 'name', 'address', 'city', 'region', 'postal', 'card', 'exp', 'cvc']
const EMPTY: OneStepOrder2Values = { email: '', name: '', address: '', city: '', region: '', postal: '', card: '', exp: '', cvc: '' }
const VALID_PREFILL: OneStepOrder2Values = { email: 'dana@example.com', name: 'Dana Ruiz', address: '418 Alder Street', city: 'Portland', region: 'OR', postal: '97205', card: '4242 4242 4242 4242', exp: '08 / 30', cvc: '123' }
const ERROR_PREFILL: OneStepOrder2Values = { email: 'dana@example', name: 'Dana Ruiz', address: '418 Alder Street', city: '', region: 'OR', postal: '97', card: '4242 4242 4242 4241', exp: '13 / 24', cvc: '12' }
const ALL_TOUCHED = Object.fromEntries(FIELDS.map(f => [f, true])) as Touched
type OrderFieldProps = {
id: string
name: Field
label: string
placeholder: string
value: string
error?: string
onChange: (field: Field, value: string) => void
onBlur: (field: Field) => void
inputRef: (el: HTMLInputElement | null) => void
type?: string
inputMode?: React.HTMLAttributes<HTMLInputElement>['inputMode']
autoComplete?: string
icon?: React.ReactNode
iconBrand?: boolean
}
function OrderField(p: OrderFieldProps) {
const errId = p.id + '-err'
return (
<div className='cfo-field'>
<label className='cfo-label' htmlFor={p.id}>{p.label}</label>
<div className='cfo-control'>
<input
ref={p.inputRef}
id={p.id}
name={p.name}
className={'cfo-input' + (p.icon ? ' has-icon' : '')}
type={p.type ?? 'text'}
inputMode={p.inputMode}
autoComplete={p.autoComplete}
placeholder={p.placeholder}
value={p.value}
onChange={e => p.onChange(p.name, e.target.value)}
onBlur={() => p.onBlur(p.name)}
aria-invalid={p.error ? true : undefined}
aria-describedby={p.error ? errId : undefined}
required
/>
{p.icon ? <span className={'cfo-ficon' + (p.iconBrand ? ' is-brand' : '')} aria-hidden='true'>{p.icon}</span> : null}
</div>
{p.error ? (
<p className='cfo-err' id={errId}>
<AlertCircle className='cfo-inl' size={16} strokeWidth={2.5} aria-hidden='true' />
{p.error}
</p>
) : null}
</div>
)
}
/** A number that rolls in from the direction the quantity moved. The real value renders first; motion only moves it. */
function Roll({ value, dir }: { value: string; dir: Dir }) {
return <span key={value} className={'cfo-roll' + (dir ? ' cfo-roll-' + dir : '')}>{value}</span>
}
function SupPrice({ value, dir }: { value: string; dir: Dir }) {
const m = /^([^0-9]*)([0-9,]+)(?:[.]([0-9]+))?(.*)$/.exec(value)
return (
<span key={value} className={'cfo-roll' + (dir ? ' cfo-roll-' + dir : '')}>
<span className='cfo-sp' aria-hidden='true'>
{m ? (
<>
{m[1].trim() ? <span className='cfo-sup'>{m[1].trim()}</span> : null}
<span>{m[2]}</span>
{m[3] ? <span className='cfo-sup'>.{m[3]}</span> : null}
{m[4] ? <span>{m[4]}</span> : null}
</>
) : (
value
)}
</span>
<span className='cfo-sr'>{value}</span>
</span>
)
}
function withMark(text: string, phrase?: string): React.ReactNode {
const i = phrase ? text.indexOf(phrase) : -1
if (!phrase || i < 0) return text
return (
<>
{text.slice(0, i)}
<span className='cfo-mark'>{phrase}</span>
{text.slice(i + phrase.length)}
</>
)
}
function prefill(state: OneStepOrder2State, defaults?: Partial<OneStepOrder2Values>): OneStepOrder2Values {
if (state === 'error') return { ...ERROR_PREFILL }
if (state === 'hover' || state === 'active') return { ...VALID_PREFILL }
const given = Object.fromEntries(Object.entries(defaults ?? {}).filter(([, v]) => typeof v === 'string'))
return { ...EMPTY, ...given }
}
function validate(v: OneStepOrder2Values, copy: OneStepOrder2Copy): Errors {
const e: Errors = {}
if (!/^[^ @]+@[^ @]+[.][^ @]{2,}$/.test(v.email.trim())) e.email = copy.emailError
if (v.name.trim().length < 2) e.name = copy.nameError
if (v.address.trim().length < 4) e.address = copy.addressError
if (v.city.trim().length < 2) e.city = copy.cityError
if (v.region.trim().length < 2) e.region = copy.regionError
if (v.postal.replace(/ /g, '').length < 3) e.postal = copy.postalError
const card = digits(v.card)
if (card.length < 13 || card.length > 19 || !luhn(card)) e.card = copy.cardError
if (!expOk(v.exp)) e.exp = copy.expError
const need = detectBrand(card) === 'amex' ? 4 : 3
if (digits(v.cvc).length !== need) e.cvc = tpl(copy.cvcError, { digits: String(need) })
return e
}
function tpl(s: string, vars: Record<string, string>) {
return s.replace(/[{]([a-zA-Z]+)[}]/g, (whole, key: string) => (key in vars ? vars[key] : whole))
}
function digits(s: string) {
return s.replace(/[^0-9]/g, '')
}
function luhn(n: string) {
let sum = 0
let dbl = false
for (let i = n.length - 1; i >= 0; i--) {
let d = Number(n[i])
if (dbl) {
d *= 2
if (d > 9) d -= 9
}
sum += d
dbl = !dbl
}
return sum % 10 === 0
}
function detectBrand(card: string): OneStepOrder2Network | null {
if (/^4/.test(card)) return 'visa'
if (/^(5[1-5]|2[2-7])/.test(card)) return 'mastercard'
if (/^3[47]/.test(card)) return 'amex'
if (/^6(011|5)/.test(card)) return 'discover'
return null
}
function expOk(exp: string) {
const m = /^([0-9]{2}) *[/] *([0-9]{2})$/.exec(exp.trim())
if (!m) return false
const month = Number(m[1])
if (month < 1 || month > 12) return false
return new Date(2000 + Number(m[2]), month, 1).getTime() > Date.now()
}
function formatCard(raw: string) {
return digits(raw).slice(0, 19).replace(/([0-9]{4})(?=[0-9])/g, '$1 ')
}
function formatExp(raw: string) {
const d = digits(raw).slice(0, 4)
return d.length > 2 ? d.slice(0, 2) + ' / ' + d.slice(2) : d
}
function parseMoney(s?: string): number | null {
if (!s) return null
const n = s.replace(/[^0-9.]/g, '')
if (!n) return null
const v = Number(n)
return Number.isFinite(v) ? v : null
}
function hasCents(s?: string) {
return /[.][0-9]{1,2} *$/.test(s ?? '')
}
function symbolOf(s?: string) {
return (/^[^0-9]*/.exec(s ?? '')?.[0] ?? '').trim() || '$'
}
function money(n: number, sym: string, dec: number) {
return sym + n.toLocaleString('en-US', { minimumFractionDigits: dec, maximumFractionDigits: dec })
}
function clampN(n: number, lo: number, hi: number) {
return Math.min(hi, Math.max(lo, Math.round(n)))
}
const CSS = `
& { --g: clamp(16px, 5vw, 48px); --pb: clamp(64px, 8.5vw, 120px); --sh: var(--shadow, oklch(0.22 0.03 260)); position: relative; isolation: isolate; overflow-x: clip; background: var(--surface); color: var(--ink); font-family: var(--font-body); font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.5; padding: clamp(56px, 8vw, 112px) var(--g) var(--pb); }
& *, & *::before, & *::after { box-sizing: border-box; }
& :where(h2, h3, p, dl, dd, ul, fieldset, legend) { margin: 0; padding: 0; }
& ul { list-style: none; }
& fieldset { border: 0; min-width: 0; }
& :where(button, input) { font: inherit; }
& .cfo-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
& .cfo-wrap { position: relative; z-index: 1; max-width: 1120px; margin-inline: auto; }
& .cfo-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); grid-template-areas: 'head aside' 'form aside'; column-gap: clamp(32px, 5vw, 72px); align-items: start; }
& .cfo-head { grid-area: head; padding-bottom: 32px; }
& .cfo-h { 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; color: var(--ink); text-wrap: balance; }
& .cfo-mark { background: linear-gradient(transparent 56%, oklch(from var(--marker, #fae37c) l c h / 0.75) 56% 94%, transparent 94%); -webkit-box-decoration-break: clone; box-decoration-break: clone; padding-inline: 0.06em; }
& .cfo-punch { display: grid; gap: 4px; margin-top: 16px; }
& .cfo-punch p { font-size: clamp(1.125rem, 1.5vw, 1.375rem); line-height: 1.4; font-weight: 500; color: var(--muted); text-wrap: pretty; }
& .cfo-punch .cfo-word { color: var(--ink); font-family: var(--font-display); font-weight: 800; }
& .cfo-form { grid-area: form; display: grid; gap: 0; container-type: inline-size; background: var(--card); color: var(--ink); border: 1px solid var(--card-border, oklch(from var(--ink) l c h / 0.12)); border-radius: var(--card-radius, var(--radius, 14px)); box-shadow: var(--card-shadow, var(--shadow-md, 0 1px 2px oklch(from var(--sh) l c h / 0.22), 0 4px 10px -2px oklch(from var(--sh) l c h / 0.2))); }
& .cfo-group { padding: clamp(20px, 3vw, 32px); }
& .cfo-group + .cfo-group { border-top: 1px solid oklch(from var(--ink) l c h / 0.1); }
& .cfo-group:disabled { cursor: not-allowed; }
& .cfo-legend { float: left; width: 100%; margin-bottom: 20px; }
& .cfo-legend + * { clear: both; }
& .cfo-gtitle { display: flex; align-items: baseline; gap: 12px; 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; color: var(--ink); text-wrap: balance; }
& .cfo-num { flex: none; color: var(--accent); font-variant-numeric: tabular-nums; }
& .cfo-fields { display: grid; gap: 16px; }
& .cfo-row { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
& .cfo-row-3 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
@container (max-width: 520px) { & .cfo-row-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } & .cfo-row-3 > :first-child { grid-column: 1 / -1; } }
& .cfo-field { display: grid; gap: 8px; align-content: start; min-width: 0; }
& .cfo-label { font-size: 1rem; font-weight: 700; line-height: 1.3; color: var(--label-ink, var(--ink)); }
& .cfo-control { position: relative; }
& .cfo-input { display: block; width: 100%; height: 56px; padding: 0 16px; border: 1px solid var(--field-border, color-mix(in oklch, var(--ink) 22%, transparent)); border-radius: var(--field-radius, var(--radius, 12px)); background: var(--field); color: var(--field-ink); font-size: 1.0625rem; box-shadow: inset 0 1px 2px oklch(from var(--sh) l c h / 0.08); transition: border-color 0.16s ease, box-shadow 0.16s ease; }
& .cfo-input.has-icon { padding-right: 56px; }
& .cfo-input::placeholder { color: color-mix(in oklch, var(--field-ink) 65%, var(--field)); opacity: 1; }
& .cfo-input:hover:not(:disabled) { border-color: color-mix(in oklch, var(--field-ink) 45%, var(--field)); }
& .cfo-input:focus-visible { outline: none; border-color: var(--field-focus, var(--accent)); box-shadow: 0 0 0 3px oklch(from var(--field-focus, var(--accent)) l c h / 0.35); }
& .cfo-input[aria-invalid='true'] { border-color: var(--danger); }
& .cfo-input[aria-invalid='true']:focus-visible { box-shadow: 0 0 0 3px oklch(from var(--danger) l c h / 0.3); }
& .cfo-input:disabled { background: color-mix(in oklch, var(--field-ink) 6%, var(--field)); cursor: not-allowed; }
& .cfo-ficon { position: absolute; top: 50%; right: 16px; display: flex; transform: translateY(-50%); color: color-mix(in oklch, var(--field-ink) 60%, var(--field)); pointer-events: none; }
& .cfo-ficon.is-brand svg { width: 34px; height: auto; }
& .cfo-err { font-size: 0.9375rem; font-weight: 600; line-height: 1.4; color: var(--danger); text-wrap: pretty; }
& .cfo-inl { display: inline-block; vertical-align: -0.15em; margin-inline-end: 0.4em; }
& .cfo-nets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
& .cfo-nets li > span:first-child { display: block; }
& .cfo-nets svg { display: block; width: 40px; height: auto; }
& .cfo-aside { grid-area: aside; position: sticky; top: 24px; }
& .cfo-receipt { container-type: inline-size; background: var(--card); color: var(--ink); border: 1px solid var(--card-border, oklch(from var(--accent) l c h / 0.28)); border-radius: var(--card-radius, var(--radius, 14px)); box-shadow: var(--card-shadow, var(--shadow-lg, 0 2px 4px oklch(from var(--sh) l c h / 0.22), 0 12px 24px -8px oklch(from var(--sh) l c h / 0.32))); }
& .cfo-toggle { display: none; width: 100%; min-height: 60px; padding: 0 20px; border: 0; border-radius: inherit; background: transparent; color: var(--ink); font-size: 1rem; font-weight: 700; line-height: 1.2; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; text-align: left; transition: background-color 0.16s ease; }
& .cfo-toggle:hover { background: color-mix(in oklch, var(--ink) 4%, var(--card)); }
& .cfo-toggle:focus-visible { outline: 3px solid var(--field-focus, var(--accent)); outline-offset: -3px; }
& .cfo-toggle-l { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
& .cfo-chev { flex: none; transition: transform 0.16s ease; }
& .cfo-receipt.is-open .cfo-chev { transform: rotate(180deg); }
& .cfo-toggle-total { flex: none; font-family: var(--font-display); font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
& .cfo-body { display: grid; gap: 16px; padding: clamp(20px, 3vw, 28px); }
& .cfo-shot { display: block; width: 100%; height: 170px; object-fit: contain; filter: drop-shadow(0 2px 3px oklch(from var(--sh) l c h / 0.28)) drop-shadow(0 16px 18px oklch(from var(--sh) l c h / 0.2)); }
& .cfo-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; }
@container (max-width: 400px) { & .cfo-item { grid-template-columns: minmax(0, 1fr); } }
& .cfo-name { font-family: var(--font-display); font-weight: 800; font-size: 1.3125rem; line-height: 1.15; letter-spacing: -0.01em; color: var(--ink); text-wrap: balance; }
& .cfo-detail { margin-top: 4px; font-size: 0.9375rem; line-height: 1.4; color: var(--muted); text-wrap: pretty; }
& .cfo-each { margin-top: 4px; font-size: 0.9375rem; font-weight: 700; line-height: 1.4; font-variant-numeric: tabular-nums; }
& .cfo-step { display: inline-flex; align-items: center; justify-self: start; gap: 2px; padding: 4px; border-radius: var(--field-radius, var(--radius, 12px)); background: color-mix(in oklch, var(--ink) 6%, var(--card)); }
& .cfo-step-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: max(0px, calc(var(--field-radius, var(--radius, 12px)) - 4px)); background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm, 0 1px 1px oklch(from var(--sh) l c h / 0.18), 0 1px 3px oklch(from var(--sh) l c h / 0.14)); cursor: pointer; transition: background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease; }
& .cfo-step-btn:hover:not(:disabled) { background: color-mix(in oklch, var(--ink) 6%, var(--card)); }
& .cfo-step-btn:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
& .cfo-step-btn:focus-visible { outline: 3px solid var(--field-focus, var(--accent)); outline-offset: 2px; }
& .cfo-step-btn:disabled { background: transparent; box-shadow: none; color: color-mix(in oklch, var(--ink) 35%, var(--card)); cursor: not-allowed; }
& .cfo-qty { min-width: 40px; text-align: center; font-family: var(--font-display); font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
& .cfo-nudge { font-size: 0.9375rem; font-weight: 600; line-height: 1.4; color: var(--muted); text-wrap: pretty; }
& .cfo-nudge.is-ok { color: var(--success); }
& .cfo-ledger { display: grid; gap: 10px; }
& .cfo-line { display: flex; align-items: baseline; gap: 12px; }
& .cfo-line::before { content: ''; order: 1; flex: 1 1 24px; border-bottom: 1px solid oklch(from var(--ink) l c h / 0.2); transform: translateY(-0.2em); }
& .cfo-line dt { order: 0; font-weight: 600; }
& .cfo-line dd { order: 2; font-weight: 800; font-variant-numeric: tabular-nums; }
& .cfo-line dd.cfo-free { color: var(--success); }
& .cfo-reason { margin-top: -4px; font-size: 0.9375rem; line-height: 1.45; color: var(--muted); text-wrap: pretty; }
& .cfo-total { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-radius: 10px; background: color-mix(in oklch, var(--ink) 4%, var(--card)); }
& .cfo-total-label { font-family: var(--font-display); font-size: 1.3125rem; font-weight: 800; line-height: 1.15; }
& .cfo-total-fig { display: grid; justify-items: end; text-align: right; }
& .cfo-big { font-family: var(--font-display); font-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); }
& .cfo-sp { display: inline-flex; align-items: flex-start; }
& .cfo-sup { font-size: 0.42em; line-height: 1; margin-top: 0.14em; letter-spacing: 0; }
& .cfo-sup:first-child { margin-right: 0.06em; }
& .cfo-sp > span:not(.cfo-sup) + .cfo-sup { margin-left: 0.04em; }
& .cfo-note { margin-top: 12px; font-size: 0.9375rem; font-weight: 600; line-height: 1.2; color: var(--muted); }
& .cfo-act { display: grid; gap: 12px; margin-top: 4px; }
& .cfo-q { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.125rem, 1.5vw, 1.375rem); line-height: 1.25; color: var(--ink); text-wrap: balance; }
& .cfo-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 64px; padding: 0 28px; border: 0; border-radius: var(--button-radius, var(--radius, 12px)); background: linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l + 0.04) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.02) c h)); color: var(--button-ink, var(--cta-ink)); font-family: var(--button-font, var(--font-display)); font-weight: var(--button-weight, 800); font-size: clamp(1.125rem, 1.55vw, 1.375rem); line-height: 1.15; text-transform: var(--button-case, none); text-align: center; 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)) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--sh) l c h / 0.3), 0 8px 16px -6px oklch(from var(--sh) l c h / 0.45)); transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease; }
& .cfo-btn:hover:not(:disabled), & .cfo-btn.is-hover:not(:disabled) { background: linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l - 0.01) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.07) c h)); box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.1) c h / 0.6), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.2) c h), 0 1px 2px oklch(from var(--sh) l c h / 0.32), 0 10px 18px -6px oklch(from var(--sh) l c h / 0.5)); }
& .cfo-btn:active:not(:disabled), & .cfo-btn.is-active:not(:disabled) { transform: translateY(1px); background: linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l - 0.05) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.08) c h)); box-shadow: inset 0 2px 3px oklch(from var(--button-bg, var(--cta)) calc(l - 0.22) c h / 0.55), inset 0 -2px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h), 0 1px 1px oklch(from var(--sh) l c h / 0.3); }
& .cfo-btn:focus-visible { outline: 3px solid var(--field-focus, var(--accent)); outline-offset: 3px; }
& .cfo-btn[aria-busy='true'] { cursor: progress; }
& .cfo-btn:disabled { background: color-mix(in oklch, var(--ink) 9%, var(--card)); color: color-mix(in oklch, var(--ink) 72%, var(--card)); box-shadow: none; text-shadow: none; cursor: not-allowed; transform: none; }
& .cfo-foot { display: grid; gap: 6px; text-align: center; font-size: 0.9375rem; font-weight: 600; line-height: 1.4; }
& .cfo-hint { color: var(--ink); }
& .cfo-sub { color: var(--muted); font-size: 0.9375rem; font-weight: 600; line-height: 1.4; text-wrap: pretty; }
& .cfo-banner { padding: 12px 16px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 0.9375rem; font-weight: 700; line-height: 1.4; text-wrap: pretty; }
& .cfo-endq, & .cfo-bar { display: none; }
& .cfo-endq .cfo-sub { text-wrap: balance; }
& .cfo-bar-t { display: grid; flex: none; min-width: 0; }
& .cfo-bar-l { font-size: 0.875rem; font-weight: 700; line-height: 1.2; color: var(--muted); white-space: nowrap; }
& .cfo-bar-fig { font-family: var(--font-display); font-size: 1.625rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
& .cfo-bar .cfo-btn { flex: 1 1 auto; width: auto; min-width: 0; min-height: 56px; padding: 0 16px; font-size: 1.125rem; white-space: nowrap; }
& .cfo-bar .cfo-btn > span { overflow: hidden; text-overflow: ellipsis; }
& .cfo-roll { display: inline-block; }
& .cfo-roll-up { animation: cfo-roll-up 0.26s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
& .cfo-roll-down { animation: cfo-roll-down 0.26s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes cfo-roll-up { from { transform: translateY(0.4em); opacity: 0.35; } to { transform: none; opacity: 1; } }
@keyframes cfo-roll-down { from { transform: translateY(-0.4em); opacity: 0.35; } to { transform: none; opacity: 1; } }
& .cfo-spin { flex: none; animation: cfo-spin 0.8s linear infinite; }
@keyframes cfo-spin { to { transform: rotate(360deg); } }
& .cfo-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (min-width: 901px) and (max-height: 860px) { & .cfo-shot { height: 120px; } & .cfo-body { gap: 12px; } }
@media (min-width: 901px) and (max-height: 720px) { & .cfo-aside { position: static; } }
@media (max-width: 900px) {
& .cfo-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'head' 'aside' 'form' 'endq' 'bar'; }
& .cfo-head { padding-bottom: 24px; }
& .cfo-aside { position: static; margin-bottom: 24px; }
& .cfo-receipt { box-shadow: var(--card-shadow, var(--shadow-md, 0 1px 2px oklch(from var(--sh) l c h / 0.22), 0 4px 10px -2px oklch(from var(--sh) l c h / 0.2))); }
& .cfo-toggle { display: flex; }
& .cfo-body { display: none; padding-top: 4px; }
& .cfo-receipt.is-open .cfo-body { display: grid; }
& .cfo-shot { height: 150px; }
& .cfo-act { display: none; }
& .cfo-endq { grid-area: endq; display: grid; gap: 12px; margin-top: 24px; text-align: center; }
& .cfo-bar { grid-area: bar; position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 12px; margin: 24px calc(var(--g) * -1) calc(var(--pb) * -1); padding: 12px var(--g) calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--card); color: var(--ink); box-shadow: 0 -1px 2px oklch(from var(--sh) l c h / 0.14), 0 -8px 16px -8px oklch(from var(--sh) l c h / 0.3); }
}
@media (prefers-reduced-motion: reduce) {
& .cfo-roll-up, & .cfo-roll-down, & .cfo-spin { animation: none; }
& .cfo-btn, & .cfo-input, & .cfo-step-btn, & .cfo-toggle, & .cfo-chev { transition: none; }
}
`.replace(/&/g, '.' + ROOT)
pieces/checkout/one-step-order-2/specimen.tsx 35 lines
import __studioImage7c4aeded from "../assets/b3fbfd40587b9d17.webp";
import * as React from 'react'
import { OneStepOrder2 } from '../one-step-order-2'
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
export default function OneStepOrder2Specimen({ state = 'default' }: { state?: 'default' | 'hover' | 'active' | 'disabled' | 'error' }) {
return (
<OneStepOrder2
state={state}
headline='Your Ember Peak set, ready for your stove'
highlight='ready for your stove'
punch={['Choose how many sets.', 'Tell us where they go and how you’ll pay.', 'Done.']}
productName='Ember Peak Skillet Set'
productDetail='10-inch and 12-inch pre-seasoned cast-iron skillets'
productImage={slot('product', __studioImage7c4aeded)}
productImageAlt='Two black Ember Peak cast-iron skillets, the 10-inch nested inside the 12-inch'
price='$89'
shipping='$12'
freeShippingFrom={2}
maxQuantity={6}
shippingReason='Cast iron is heavy, so it ships in a padded carton. Two sets share one carton, so from two sets shipping is on us.'
question='Ready to start cooking on cast iron?'
label='I’m ready, ship it'
sublabel={`Secure checkout · ${defaults.sample.guarantee}`}
copy={{
shippingTitle: 'Where should your skillets go?',
freeNudgeOne: 'Add 1 more set and shipping is free.',
freeNudgeMany: 'Add {count} more sets and shipping is free.',
}}
/>
)
}
| Name | Type | Details |
|---|---|---|
copy OptionalOneStepOrder2 |
Partial<OneStepOrder2Copy> |
|
onSubmit OptionalOneStepOrder2 |
(values: Readonly<OneStepOrder2Values>, order: OneStepOrder2Order) => void | Promise<void> |
|
defaultValues OptionalOneStepOrder2 |
Partial<OneStepOrder2Values> |
|
headline OptionalOneStepOrder2 |
string |
Default 'Your Ember Peak set, ready for your stove'
|
highlight OptionalOneStepOrder2 |
string |
Default 'ready for your stove'
|
punch OptionalOneStepOrder2 |
string[] |
Default ['Choose how many sets.', 'Tell us where they go and how you’ll pay.', 'Done.']
|
productName OptionalOneStepOrder2 |
string |
Default 'Ember Peak Skillet Set'
|
productDetail OptionalOneStepOrder2 |
string |
|
productImage OptionalOneStepOrder2 |
string |
|
productImageAlt OptionalOneStepOrder2 |
string |
Default ''
|
price OptionalOneStepOrder2 |
string |
Default '$89'
|
shipping OptionalOneStepOrder2 |
string |
Default '$12'
|
freeShippingFrom OptionalOneStepOrder2 |
number |
|
shippingReason OptionalOneStepOrder2 |
string |
Default 'Cast iron is heavy, so every order ships in one padded carton.'
|
defaultQuantity OptionalOneStepOrder2 |
number |
Default 1
|
minQuantity OptionalOneStepOrder2 |
number |
Default 1
|
maxQuantity OptionalOneStepOrder2 |
number |
Default 6
|
priceNote OptionalOneStepOrder2 |
string |
Default 'one-time payment'
|
question OptionalOneStepOrder2 |
string |
Default 'Ready to start cooking on cast iron?'
|
label OptionalOneStepOrder2 |
string |
Default 'I’m ready, ship it'
|
sublabel OptionalOneStepOrder2 |
string |
Default 'Secure checkout'
|
networks OptionalOneStepOrder2 |
OneStepOrder2Network[] |
Default ['visa', 'mastercard', 'amex', 'discover']
|
disabledMessage OptionalOneStepOrder2 |
string |
Default 'Checkout is unavailable right now.'
|
state OptionalOneStepOrder2 |
OneStepOrder2State |
Default 'default'
|
disabled OptionalOneStepOrder2 |
boolean |
Default false
|
className OptionalOneStepOrder2 |
string |
Theme roles it reads
Set by the theme bar, a preset or your brand. Colours come from the base tokens (--surface, --ink, --cta…) every piece uses.
--button-bg--button-bg-2--button-case--button-font--button-ink--button-radius--button-shadow--button-text-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--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).
-
b3fbfd40587b9d17.webp
image/webp · 92.4 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB
-
f211b3080387e46d.webp
image/webp · 105 KB