@quantaroute/checkout 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +27 -0
- package/dist/lib/index.d.ts +15 -0
- package/dist/lib/quantaroute-checkout.es.js +186 -186
- package/dist/lib/quantaroute-checkout.umd.js +86 -86
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/CheckoutWidget.tsx +82 -3
- package/src/components/PaymentStep.tsx +15 -5
- package/src/core/types.ts +15 -0
- package/src/index.ts +2 -0
- package/src/styles/checkout.css +542 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,20 @@ Release dates are from git history where available; earlier versions are estimat
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.7.0](https://github.com/quantaroute/checkout/compare/v1.6.0...v1.7.0) — 2026-06-28
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **Mobile-first checkout presentation** — new `mobilePresentation` prop (`auto`, `sheet`, `card`) for storefront modals and drawers
|
|
15
|
+
- **Mobile labeled stepper** — compact Mobile/Address/Pay progress on small screens while preserving desktop dot progress
|
|
16
|
+
- **`mobileStepLabels`** prop for merchant-specific step label copy
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Improved mobile shell styling: sticky branded header, safe-area-aware actions, larger touch targets, softer saved-address cards, compact lazy verification banner, and mobile payment option rows
|
|
21
|
+
- Demo app includes a mobile preview frame to inspect the sheet treatment
|
|
22
|
+
- README documents the host-app boundary: cart state, order summary, coupons, platform APIs, and checkout interception stay outside the npm package
|
|
23
|
+
|
|
10
24
|
## [1.6.0](https://github.com/quantaroute/checkout/compare/v1.5.0...v1.6.0) — 2026-06-23
|
|
11
25
|
|
|
12
26
|
### Added
|
package/README.md
CHANGED
|
@@ -533,6 +533,8 @@ WHERE id = 'your-merchant-uuid';
|
|
|
533
533
|
| `brandColor` | `string` (hex) | `#0ea5e9` | all |
|
|
534
534
|
| `logoUrl` | `string` (URL) | – | all |
|
|
535
535
|
| `headerBanner` | `ReactNode` | – | web only |
|
|
536
|
+
| `mobilePresentation` | `'auto' \| 'sheet' \| 'card'` | `'auto'` | web |
|
|
537
|
+
| `mobileStepLabels` | `{ auth?: string; address?: string; payment?: string }` | Mobile/Address/Pay | web |
|
|
536
538
|
|
|
537
539
|
|
|
538
540
|
```tsx
|
|
@@ -541,10 +543,35 @@ WHERE id = 'your-merchant-uuid';
|
|
|
541
543
|
brandColor="#7c3aed"
|
|
542
544
|
logoUrl="https://yourbrand.com/logo.png"
|
|
543
545
|
headerBanner={<p>🚚 Free shipping on orders over ₹499</p>}
|
|
546
|
+
mobilePresentation="sheet"
|
|
547
|
+
mobileStepLabels={{ auth: 'Mobile', address: 'Address', payment: 'Pay' }}
|
|
544
548
|
onComplete={...}
|
|
545
549
|
/>
|
|
546
550
|
```
|
|
547
551
|
|
|
552
|
+
### Mobile-first storefront shells
|
|
553
|
+
|
|
554
|
+
Use `mobilePresentation="sheet"` when the widget is mounted inside a mobile drawer or storefront modal. It keeps the package focused on auth, saved addresses, DigiPin verification, and optional payment while your host app owns cart-specific UI.
|
|
555
|
+
|
|
556
|
+
```tsx
|
|
557
|
+
<CheckoutWidget
|
|
558
|
+
apiKey={geocodingKey}
|
|
559
|
+
merchantId={merchantId}
|
|
560
|
+
supabaseFunctionBaseUrl={functionsUrl}
|
|
561
|
+
enablePhoneAuth
|
|
562
|
+
enablePayment={merchantPaymentMode === 'byo_razorpay'}
|
|
563
|
+
paymentAmountPaise={cartTotalPaiseAfterDiscounts}
|
|
564
|
+
codCartTotalPaise={cartTotalPaiseAfterDiscounts}
|
|
565
|
+
mobilePresentation="sheet"
|
|
566
|
+
mobileStepLabels={{ auth: 'Mobile', address: 'Address', payment: 'Pay' }}
|
|
567
|
+
onCheckoutEvent={(event) => syncHostShellStep(event.step)}
|
|
568
|
+
onComplete={(address) => saveDeliveryAddress(address)}
|
|
569
|
+
onPaymentComplete={(result) => completeOrder(result)}
|
|
570
|
+
/>
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
The host app should keep order summary, product lines, coupons, cart state, platform APIs, and checkout-button interception outside this package. Pass only the final totals and callbacks into the widget.
|
|
574
|
+
|
|
548
575
|
### Analytics (client-side)
|
|
549
576
|
|
|
550
577
|
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -172,6 +172,14 @@ export declare interface CheckoutEvent {
|
|
|
172
172
|
/** All step-transition event types emitted by the widget. */
|
|
173
173
|
export declare type CheckoutEventType = 'phone_step_viewed' | 'otp_sent' | 'phone_verified' | 'email_step_viewed' | 'email_otp_sent' | 'email_verified' | 'auth_skipped' | 'saved_addresses_viewed' | 'saved_address_selected' | 'verify_address_step_viewed' | 'map_step_viewed' | 'location_confirmed' | 'form_step_viewed' | 'address_completed' | 'widget_reset' | 'payment_step_viewed' | 'payment_method_selected' | 'session_abandoned';
|
|
174
174
|
|
|
175
|
+
export declare type CheckoutMobilePresentation = 'auto' | 'sheet' | 'card';
|
|
176
|
+
|
|
177
|
+
export declare interface CheckoutMobileStepLabels {
|
|
178
|
+
auth?: string;
|
|
179
|
+
address?: string;
|
|
180
|
+
payment?: string;
|
|
181
|
+
}
|
|
182
|
+
|
|
175
183
|
declare type CheckoutPlatform = 'web' | 'ios' | 'android';
|
|
176
184
|
|
|
177
185
|
/**
|
|
@@ -221,6 +229,13 @@ export declare interface CheckoutWidgetProps {
|
|
|
221
229
|
mapHeight?: string | number;
|
|
222
230
|
/** Widget header title. Defaults to 'Add Delivery Address'. */
|
|
223
231
|
title?: string;
|
|
232
|
+
/**
|
|
233
|
+
* Mobile visual treatment. `auto` applies the improved mobile layout below 480px,
|
|
234
|
+
* `sheet` is for storefront drawers/modals, and `card` preserves the compact card feel.
|
|
235
|
+
*/
|
|
236
|
+
mobilePresentation?: CheckoutMobilePresentation;
|
|
237
|
+
/** Override the compact mobile step labels (e.g. Mobile / Address / Pay). */
|
|
238
|
+
mobileStepLabels?: CheckoutMobileStepLabels;
|
|
224
239
|
/**
|
|
225
240
|
* URL to an India boundary GeoJSON file (FeatureCollection).
|
|
226
241
|
* When provided, a thin grey outline is drawn on the map for legal compliance.
|