Skip to content

Commit 0ea37b6

Browse files
sbddesignmartinsaposnic
authored andcommitted
feat(mdk-checkout): rebrand checkout UI to match DESIGN.md (MDK-891) (#792)
* feat(mdk-checkout): rebrand checkout UI to match DESIGN.md (MDK-891) Restyles the hosted checkout component (all states: unconfirmed, pending payment, payment received, expired, error) to match the moneydevkit.com landing-page brand defined in DESIGN.md: dark teal-tinted Terminal Field background, square corners, italic Source Serif display headings, Geist Mono uppercase labels with prompt-mark prefixes, teal-edged QR frame, and ghost-style buttons with leading "›". Adds a /preview route in mdk-nextjs-demo that renders each checkout state with mocked Checkout data so the rebrand can be QA'd without MDK_ACCESS_TOKEN / MDK_MNEMONIC. Demo deps switched to workspace:* and Source Serif 4 / Geist / Geist Mono are loaded via next/font. Inner state components (UnconfirmedCheckout, PendingPaymentCheckout, PaymentReceivedCheckout, ExpiredCheckout) and the CheckoutLayout chrome are exported from @moneydevkit/core/client so the preview harness can render them directly. * feat(mdk-checkout): show fiat headline for USD-priced checkouts (MDK-891) PendingPaymentCheckout now reads checkout.currency: USD-priced checkouts get a "$5.00"-style headline with the sats amount tucked into View Details, while SAT-priced checkouts keep the sats headline and gain a faint "≈ $5.00" subtitle. Also hard-codes USD when formatting invoice.fiatAmount in View Details (Intl.NumberFormat doesn't accept "SAT"), matching the convention already used by PaymentReceivedCheckout. Adds a "Pending QR (SAT)" tab to the demo preview route so both modes can be verified side-by-side. * feat(mdk-checkout): adopt BIP-177 ₿ prefix for sat amounts (MDK-891) Display-only change. All user-facing sat values render as "₿6,487" instead of "6,487 sats" -- the symbol hugs the number the same way "$" hugs a USD amount. View Details labels become "Amount (₿)" and the UNCONFIRMED state's custom-amount input switches its SAT marker from a trailing "sats" suffix to a leading "₿" prefix to mirror the USD "$" prefix. No backend, API contract, or stored data changes -- formatSats and the underlying sat values are untouched. * chore(mdk-checkout): drop › prefix from View Details trigger (MDK-891) * feat(mdk-checkout): inline fiat conversion next to ₿ headline (MDK-891) For SAT-priced checkouts, render the fiat conversion on the same baseline as the ₿ headline -- same italic Source Serif, same size, weight 300, faint color, 1.5rem gap -- instead of stacking it underneath as a ≈$x.xx mono subtitle. Also tunes the demo preview mock so SAT-priced uses a round ₿6,000 with the odd $4.62 conversion that round sat amount actually implies, mirroring the existing USD-priced mock ($5.00 / odd sats). Loads Source Serif 4 weight 300 in next/font for the lighter fiat treatment. * feat(mdk-checkout): swap "Powered by moneydevkit" wordmark for SVG logo (MDK-891) Replaces the underlined "moneydevkit" text in the checkout footer with an inlined SVG of the moneydevkit wordmark. The SVG uses currentColor on all fills (and the rotated half-circle gradient stops), so it inherits the parent link's color and picks up the existing .mdk-link hover-to-teal transition. "Powered by" is now sentence-cased and rendered in Geist Sans (--mdk-font-body) at 11px in mdk-faint, instead of mono uppercase via the mdk-label class. Logo height is 1.25em of the surrounding text. Applied to both CheckoutLayout and CheckoutError footers. * feat(mdk-checkout): split logo hover so wordmark stays white (MDK-891) Tags the symbol and wordmark groups with mdk-logo-symbol and mdk-logo-wordmark classes. The symbol keeps inheriting the parent link's currentColor (muted → teal on hover); the wordmark is pinned to mdk-fg only while the link is hovered, so the moneydevkit text reads in Signal White next to a teal symbol instead of the whole logo turning teal. * refactor(mdk-checkout): move title + description inside the panel (MDK-891) Title and description now live inside the same mdk-panel as the amount, QR, and View Details, rather than floating above it. Title size dropped to clamp(1.15rem, 2.2vw, 1.45rem) so it doesn't tower over the amount. Demo preview mocks tweaked: title is now "Tip for Cindy" (no em-dash amount suffix, since the amount renders elsewhere) and the description is "Thanks for supporting my work" -- both USD and SAT tabs use the same strings. * feat(mdk-checkout): style QR with MDK teal gradient via qr-code-styling (MDK-891) Swaps the qrcode.react SVG renderer for @liquid-js/qr-code-styling in PendingPaymentCheckout. New StyledQRCode wrapper mounts the library's QR into a sized div via useEffect and updates on prop change. Visual treatment: - 240×240 (down from 320) - small-square dot shape - 45° linear gradient from Phosphor Teal → Deep Signal Teal on dots, corner squares, and corner dots (sourced from DESIGN.md, expressed as oklch) - Black QR background to match the surrounding mdk-qr-frame - Frame border now Phosphor Teal at 25% alpha with a 2px corner radius; frame background also dropped to black so the QR has no white halo Layout: outer CheckoutLayout/CheckoutError wrapper changed from a fixed 380px width to `width: 100%, max-width: 327px` so the panel fits a 375px iPhone SE viewport with 24px gutters on each side and scales down on narrower viewports. * feat(mdk-checkout): add Cash App + Strike pay-with buttons (MDK-891) Below the invoice copy field, the pending-payment screen now offers two deep-link launchers: - Pay with Cash App -> https://cash.app/launch/lightning/<invoice> - Pay with Strike -> strike:<invoice> Icon glyphs (Cash App "$" mark, Strike lightning mark) inlined as React components in WalletIcons.tsx, extracted from the Money Dev Kit Figma design system. Both use currentColor so the parent button text color drives the fill. Brand buttons share a new .mdk-wallet-button base (Geist Sans 14px medium, sentence case, 2px radius, subtle hover lift) with two brand modifiers: Cash App green (#00E013) bg with white text, and Strike black bg with the MDK hard-line border + white text. In preview mode the buttons resolve to a placeholder invoice string so demo clicks won't try to launch real wallets with a bad payload. * feat(mdk-checkout): chunked teal/gray invoice display (MDK-891) Replaces the truncated single-line invoice string in the copy field with a five-segment display: first 4 chars in teal, next 4 muted, a four-period divider, then the final 8 chars split into two more 4-char chunks (muted + teal). The trailing chunks are sliced from the end (.slice(-8, -4) and .slice(-4)) so each is always exactly four characters regardless of total invoice length. The <code> element is now a flexbox with justify-content: space-between so the five segments distribute evenly across the copy field instead of clustering on the left. The four-period divider is rendered as four individual spans inside an inline-flex container with a 0.25em gap, giving consistent visual spacing between the dots that doesn't depend on font kerning. Falls back to the raw string for any invoice shorter than 16 characters (real Lightning invoices are always well over that). * refactor(mdk-checkout): move View Details below pay-with buttons (MDK-891) The View Details collapsible (line items, fiat/sat conversion, exchange rate, expires-in) used to sit between the amount headline and the QR code. It now lives beneath the Pay with Strike button, so the primary flow above the fold reads amount -> QR -> invoice copy -> pay-with buttons, and the breakdown stays one tap away without breaking up the scan-and-pay path. * fix(mdk-checkout): align QR frame width with sibling controls (MDK-891) The QR frame was shrink-wrapping the 240px QR, ending up narrower than the copy field and pay-with buttons that use w-full inside the same panel. The frame now stretches to w-full and StyledQRCode's wrapper is width:100% / aspect-ratio 1/1 so the QR scales up to fill it. The SVG is still rendered at the library's native 240px resolution and CSS scales the vector to fit, which keeps the QR crisp and scannable while making the left/right edges line up across the QR frame, invoice copy field, and both pay-with buttons. * feat(mdk-checkout): flash QR on copy tap (MDK-891) Adds a brief white flash overlay on the QR frame each time the invoice is copied to clipboard. A copyFlashKey state increments on every successful copy and is used as the React key on the .mdk-qr-flash overlay, so the element re-mounts and the 520ms ease-out keyframe (peak 45% opacity at ~18%, fade back to 0) re-fires on every consecutive tap without waiting for the previous flash to clear. * style(mdk-checkout): tighten checkout rhythm and shrink details affordance (MDK-891) A handful of small visual tunings on the pending payment screen: - Invoice copy field now sits below the Pay with Strike button instead of above Cash App. Its padding switches from p-3 to a flat 0.75rem / 1rem so it renders at the same height as the pay-with buttons, and the elements align edge-to-edge top to bottom. - "View Details" trigger text drops from 13px to 11px and its ChevronDown caret shrinks from w-3/h-3 to w-2.5/h-2.5, with the gap between them tightened from gap-2 to gap-1.5 so the smaller pieces stay visually paired. - Vertical rhythm around the amount headline tightens: the title/description block (CheckoutLayout) and the amount wrapper (PendingPaymentCheckout) both drop from mb-6 to mb-3, halving the gap above and below the amount. - Checkout description copy goes from font-weight 400 to 300, a hair lighter so the title carries the visual weight. * feat(mdk-checkout): add light-mode theme variant (MDK-891) Adds a light-mode variant to the checkout component, controlled by a new `theme` prop on MdkCheckoutProvider and the public Checkout component. The provider now exposes MdkTheme ('dark' | 'light'), sets data-theme on its .mdk-checkout wrapper, and ships a useMdkTheme hook for child components. CSS tokens get a [data-theme="light"] override block in mdk-styles.css that flips neutrals (bg, fg, muted, faint, line) toward a teal-tinted paper palette and drops the teal hues from oklch(0.88 / 0.74) down to oklch(0.55 / 0.42) so the brand color keeps AA contrast on white. The QR frame's hardcoded #000 background is now a --mdk-qr-bg token; teal borders use color-mix so they re-tint per theme. StyledQRCode is theme-aware via useMdkTheme: dark mode keeps the bright Phosphor->Deep teal gradient on black; light mode swaps to a darker teal gradient on white, applied through the library's .update() so the QR re-renders cleanly on toggle. Glow effects (the teal text-shadow on the title/amount/"Payment received" headlines, and the soft 25%-alpha QR frame border) read as a luminous glow on the dark canvas but as a smudgy drop-shadow against white. In light mode the text-shadow is removed entirely and the QR frame border alpha bumps from 25% to 70% so it lands as a crisp teal hairline. The demo preview page gains a Dark / Light toggle row underneath the state tabs that swaps the MdkCheckoutProvider's theme prop in state, so reviewers can flip between the two variants on the same URL. * feat(mdk-checkout): polish Received, Unconfirmed, Expired states (MDK-891) Tightens copy and microtypography across the non-pending checkout states: Unconfirmed - Drop the leading "›" from the customer-data form labels and collapse the space before the required-asterisk, so labels read "EMAIL*" / "NAME*" instead of "› EMAIL *". Received - Drop the leading "›" from the "Thank you for your business" footer, bump its line-height to 1.6, and bind "your" + "business" with a non-breaking space so they wrap together. - Strip trailing colons from Amount and Checkout ID labels. - Consolidate the two separate "Amount Fiat" + "Amount (₿)" rows into a single "Amount" row that places the sats amount (muted) to the left of the USD amount (fg), baseline-aligned. - Replace the long full-id span with a chunked checkout ID: first 4 chars + four-period divider + last 4 chars at 11px in mdk-text-muted, preceded by a 14px white copy-to-clipboard icon button that flips teal on copy. Expired - Drop the "This checkout session has expired." sentence to font-weight 300 so the headline restart copy carries more visual weight than the explanation. * style(mdk-checkout): drop status-icon frame border to 25% alpha (MDK-891) The teal-on-Received and amber-on-Expired status icon containers had full-opacity borders that competed with the icon glyph for attention. Switching both border-colors to color-mix(... 25%, transparent) leaves a soft halo so the icon inside reads as the focal element. Picks up both themes automatically via the existing --mdk-teal and --mdk-amber tokens. * chore(mdk-nextjs-demo): redesign preview chrome with sticky control bar (MDK-891) The preview page now puts the checkout component at center stage: - Controls move from the top of the page to a sticky full-width bar at the bottom, backed by var(--mdk-bg-2) with a var(--mdk-line-soft) top divider so it reads as a separate surface from the simulated host page. - Buttons in the bar are roughly half their previous height (0.3rem / 0.65rem padding, 11px Geist Mono uppercase) and group under tiny 10px faint labels (STATE / THEME / BG), separated by thin vertical line dividers. - A new BG cluster lets reviewers preview the checkout against three host-page surfaces, theme-scoped so dark themes get three dark surfaces and light themes get three light surfaces. The selected slot id (1 / 2 / 3) is preserved when the theme toggles so the same slot can be compared across themes. Dark surface slots: 1. MDK Terminal Field (default teal-tinted dark) 2. Purple -> red 135deg gradient (saturated brand) 3. Deep navy (developer-tool brand pages) Light surface slots: 1. MDK Paper (default teal-tinted near-white) 2. White -> cyan 135deg gradient (soft consumer-app brand) 3. Warm cream (publication / content-app surfaces) The control bar itself keeps using var(--mdk-bg-2) regardless of the BG override so it remains a stable preview-tool affordance and doesn't blend into the simulated host surface. * refactor(mdk-checkout): move Powered by footer inside the panel (MDK-891) "Powered by [moneydevkit logo]" used to sit in its own div under the mdk-panel container. It now lives inside the panel, after {children} with mt-4 breathing room. Applied to both CheckoutLayout and CheckoutError so the chrome stays consistent. * feat(mdk-checkout): self-host brand fonts via Fontsource (MDK-891) Bundles the checkout's brand typography directly into the SDK so a consumer dropping in <Checkout /> gets the correct fonts without having to wire up next/font (or anything else) themselves. Adds three runtime deps to @moneydevkit/core: - @fontsource-variable/geist - @fontsource-variable/geist-mono - @fontsource/source-serif-4 (italic 300/500/700) mdk-styles.css now @imports those packages at the top so consumer bundlers (Next.js / Vite / webpack) resolve the woff2 files from node_modules. The font-family fallback strings in --mdk-font-body and --mdk-font-mono switch from "Geist Sans" / "Geist Mono" to the Fontsource family names "Geist Variable" / "Geist Mono Variable" so the bundled fonts actually take effect. Consumers who prefer to load fonts themselves (e.g. via next/font for SSR optimization) can still override by setting --font-source-serif / --font-geist-sans / --font-geist-mono on a parent element -- the var() lookups are unchanged so user-set variables win over the bundled fonts. The demo's app/layout.tsx drops its Source Serif / Geist / Geist Mono next/font loaders since the SDK now ships them itself; Space Grotesk stays for the demo's marketing pages. * fix(e2e): update selectors for rebranded checkout component Rebrand renamed post-payment text to "Payment received" and dropped the "Checkout ID:" label, breaking the workspace e2e scripts. Accept both old and new payment-confirmed phrasing, and read the checkout id from the URL instead of scraping the success screen. Also drop the demo /preview page when building against the legacy pinned SDK - it imports rebrand-era exports (CheckoutLayout, MdkCheckoutProvider, ...) absent from @moneydevkit/core@0.15.0, which broke the legacy build. * revert(mdk-nextjs-demo): restore demo to published SDK pins The rebrand lives in @moneydevkit/core, not the demo. The demo's switch to workspace:* and the new /preview QA harness broke vercel-deploy: Vercel runs pnpm install on the demo folder standalone, where workspace:* cannot resolve, and /preview imports rebrand-era /client exports absent from any published SDK. Revert the demo to staging's 0.10.0 pins and drop /preview. e2e still exercises the rebrand SDK via its own npm pkg set workspace:* override. --------- Co-authored-by: Martin Saposnic <martinsaposnic@gmail.com>
1 parent be18dbc commit 0ea37b6

13 files changed

Lines changed: 1461 additions & 492 deletions

packages/core/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@
5151
"test": "npm run build && tsx --tsconfig tsconfig.test.json --experimental-test-module-mocks --test $(find tests -name '*.test.ts')"
5252
},
5353
"dependencies": {
54+
"@fontsource-variable/geist": "^5.2.9",
55+
"@fontsource-variable/geist-mono": "^5.2.8",
56+
"@fontsource/source-serif-4": "^5.2.9",
5457
"@hookform/resolvers": "^5.0.1",
58+
"@liquid-js/qr-code-styling": "^5.5.0",
5559
"@moneydevkit/api-contract": "workspace:*",
5660
"@moneydevkit/lightning-js": "0.1.84",
5761
"@orpc/client": "1.13.6",

packages/core/src/client.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
export * from './components/Checkout'
2+
export { default as UnconfirmedCheckout } from './components/checkout/UnconfirmedCheckout'
3+
export { default as PendingPaymentCheckout } from './components/checkout/PendingPaymentCheckout'
4+
export { default as PaymentReceivedCheckout } from './components/checkout/PaymentReceivedCheckout'
5+
export { default as ExpiredCheckout } from './components/checkout/ExpiredCheckout'
26
export * from './hooks/useCheckout'
37
export * from './hooks/useCheckoutSuccess'
48
export * from './hooks/useProducts'

packages/core/src/components/Checkout.tsx

Lines changed: 103 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -5,53 +5,78 @@ import { CHECKOUT_ID_QUERY_PARAM } from '../constants'
55
import '../mdk-styles.css'
66
import { clientCreateCheckout, clientGetCheckout } from '../client-actions'
77
import { log } from '../logging'
8-
import { MdkCheckoutProvider } from '../providers'
8+
import { MdkCheckoutProvider, type MdkTheme } from '../providers'
99
import ExpiredCheckout from './checkout/ExpiredCheckout'
1010
import PaymentReceivedCheckout from './checkout/PaymentReceivedCheckout'
1111
import PendingPaymentCheckout from './checkout/PendingPaymentCheckout'
1212
import UnconfirmedCheckout from './checkout/UnconfirmedCheckout'
13+
import { MoneyDevKitLogo } from './MoneyDevKitLogo'
1314

1415
const POLLING_STATUSES = new Set<CheckoutType['status']>(['UNCONFIRMED', 'CONFIRMED', 'PENDING_PAYMENT'])
1516

1617
export interface CheckoutProps {
1718
id?: string
19+
theme?: MdkTheme
1820
}
1921

20-
interface CheckoutLayoutProps {
22+
export interface CheckoutLayoutProps {
2123
checkout?: CheckoutType
2224
children: ReactNode
2325
}
2426

25-
function CheckoutLayout({ checkout, children }: CheckoutLayoutProps) {
27+
export function CheckoutLayout({ checkout, children }: CheckoutLayoutProps) {
2628
const title = checkout?.userMetadata?.title
2729
const description = checkout?.userMetadata?.description
2830
return (
29-
<div className="w-fit mx-auto" style={{ width: '380px' }}>
30-
{(title || description) && (
31-
<div className="text-center mb-6">
32-
{title && (
33-
<h2 className="text-2xl font-semibold text-white mb-2 font-sans tracking-tight">
34-
{title}
35-
</h2>
36-
)}
37-
{description && (
38-
<p className="text-gray-300">{description}</p>
39-
)}
40-
</div>
41-
)}
42-
<div className="bg-gray-800 rounded-2xl p-6 text-white font-sans">{children}</div>
43-
<div className="text-center mt-6">
44-
<p className="text-xs text-gray-500 font-sans">
45-
Powered by{' '}
46-
<a
47-
href="https://www.moneydevkit.com"
48-
target="_blank"
49-
rel="noopener noreferrer"
50-
className="text-gray-400 hover:text-white transition-colors underline decoration-gray-600 hover:decoration-white"
31+
<div className="w-fit mx-auto" style={{ width: '100%', maxWidth: '327px' }}>
32+
<div className="mdk-panel mdk-corner p-6">
33+
{(title || description) && (
34+
<div className="text-center mb-3">
35+
{title && (
36+
<h2
37+
className="mdk-display mdk-glow-teal mb-2"
38+
style={{ fontSize: 'clamp(1.15rem, 2.2vw, 1.45rem)' }}
39+
>
40+
{title}
41+
</h2>
42+
)}
43+
{description && (
44+
<p
45+
className="mdk-body mdk-text-muted"
46+
style={{ fontSize: '14px', fontWeight: 300 }}
47+
>
48+
{description}
49+
</p>
50+
)}
51+
</div>
52+
)}
53+
{children}
54+
<div className="text-center mt-4">
55+
<p
56+
className="mdk-text-faint"
57+
style={{
58+
fontFamily: 'var(--mdk-font-body)',
59+
fontSize: '11px',
60+
display: 'inline-flex',
61+
alignItems: 'center',
62+
justifyContent: 'center',
63+
gap: '0.5rem',
64+
lineHeight: 1,
65+
}}
5166
>
52-
moneydevkit
53-
</a>
54-
</p>
67+
<span>Powered by</span>
68+
<a
69+
href="https://www.moneydevkit.com"
70+
target="_blank"
71+
rel="noopener noreferrer"
72+
className="mdk-link"
73+
style={{ display: 'inline-flex', alignItems: 'center' }}
74+
aria-label="moneydevkit"
75+
>
76+
<MoneyDevKitLogo style={{ height: '1.25em', width: 'auto', display: 'block' }} />
77+
</a>
78+
</p>
79+
</div>
5580
</div>
5681
</div>
5782
)
@@ -64,14 +89,17 @@ interface CheckoutUrlError {
6489

6590
function CheckoutError({ error }: { error: CheckoutUrlError }) {
6691
return (
67-
<div className="flex justify-center min-h-screen p-4 pt-8 bg-gradient-to-br from-slate-900 via-gray-900 to-slate-800">
92+
<div className="mdk-page flex justify-center min-h-screen p-4 pt-8">
6893
<div className="w-full max-w-md">
69-
<div className="w-fit mx-auto" style={{ width: '380px' }}>
70-
<div className="bg-gray-800 rounded-2xl p-6 text-white font-sans">
94+
<div className="w-fit mx-auto" style={{ width: '100%', maxWidth: '327px' }}>
95+
<div className="mdk-panel mdk-corner p-6">
7196
<div className="text-center">
72-
<div className="w-16 h-16 mx-auto mb-4 rounded-full bg-red-500/20 flex items-center justify-center">
97+
<div
98+
className="mdk-status-icon-frame is-error mb-4"
99+
style={{ width: '64px', height: '64px' }}
100+
>
73101
<svg
74-
className="w-8 h-8 text-red-500"
102+
className="w-8 h-8 mdk-text-amber"
75103
fill="none"
76104
stroke="currentColor"
77105
viewBox="0 0 24 24"
@@ -84,22 +112,37 @@ function CheckoutError({ error }: { error: CheckoutUrlError }) {
84112
/>
85113
</svg>
86114
</div>
87-
<h2 className="text-xl font-semibold mb-2">Unable to create checkout</h2>
88-
<p className="text-gray-400">{error.message}</p>
115+
<h2 className="mdk-title mb-2" style={{ fontSize: '1.4rem' }}>
116+
Unable to create checkout
117+
</h2>
118+
<p className="mdk-body mdk-text-muted">{error.message}</p>
89119
</div>
90-
</div>
91-
<div className="text-center mt-6">
92-
<p className="text-xs text-gray-500 font-sans">
93-
Powered by{' '}
94-
<a
95-
href="https://www.moneydevkit.com"
96-
target="_blank"
97-
rel="noopener noreferrer"
98-
className="text-gray-400 hover:text-white transition-colors underline decoration-gray-600 hover:decoration-white"
120+
<div className="text-center mt-4">
121+
<p
122+
className="mdk-text-faint"
123+
style={{
124+
fontFamily: 'var(--mdk-font-body)',
125+
fontSize: '11px',
126+
display: 'inline-flex',
127+
alignItems: 'center',
128+
justifyContent: 'center',
129+
gap: '0.5rem',
130+
lineHeight: 1,
131+
}}
99132
>
100-
moneydevkit
101-
</a>
102-
</p>
133+
<span>Powered by</span>
134+
<a
135+
href="https://www.moneydevkit.com"
136+
target="_blank"
137+
rel="noopener noreferrer"
138+
className="mdk-link"
139+
style={{ display: 'inline-flex', alignItems: 'center' }}
140+
aria-label="moneydevkit"
141+
>
142+
<MoneyDevKitLogo style={{ height: '1.25em', width: 'auto', display: 'block' }} />
143+
</a>
144+
</p>
145+
</div>
103146
</div>
104147
</div>
105148
</div>
@@ -263,14 +306,17 @@ function CheckoutInternal({ id }: CheckoutProps) {
263306

264307
if (!checkout) {
265308
return (
266-
<div className="flex items-center justify-center min-h-screen">
267-
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-white" />
309+
<div className="mdk-page flex items-center justify-center min-h-screen">
310+
<div
311+
className="animate-spin rounded-full h-8 w-8 mdk-border-line"
312+
style={{ borderStyle: 'solid', borderWidth: '2px', borderTopColor: 'var(--mdk-teal)' }}
313+
/>
268314
</div>
269315
)
270316
}
271317

272318
return (
273-
<div className="flex justify-center min-h-screen p-4 pt-8 bg-gradient-to-br from-slate-900 via-gray-900 to-slate-800">
319+
<div className="mdk-page flex justify-center min-h-screen p-4 pt-8">
274320
<div className="w-full max-w-md">
275321
{(() => {
276322
if (paymentReceived) {
@@ -292,8 +338,11 @@ function CheckoutInternal({ id }: CheckoutProps) {
292338
return (
293339
<CheckoutLayout checkout={checkout}>
294340
<div className="text-center">
295-
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-white mx-auto mb-4" />
296-
<p className="text-gray-300">Generating invoice...</p>
341+
<div
342+
className="animate-spin rounded-full h-8 w-8 mx-auto mb-4"
343+
style={{ borderStyle: 'solid', borderWidth: '2px', borderColor: 'var(--mdk-line)', borderTopColor: 'var(--mdk-teal)' }}
344+
/>
345+
<p className="mdk-label">Generating invoice…</p>
297346
</div>
298347
</CheckoutLayout>
299348
)
@@ -322,9 +371,9 @@ function CheckoutInternal({ id }: CheckoutProps) {
322371
)
323372
}
324373

325-
export function Checkout(props: CheckoutProps) {
374+
export function Checkout({ theme, ...props }: CheckoutProps) {
326375
return (
327-
<MdkCheckoutProvider>
376+
<MdkCheckoutProvider theme={theme}>
328377
<CheckoutInternal {...props} />
329378
</MdkCheckoutProvider>
330379
)

0 commit comments

Comments
 (0)