@sazito/checkout 0.2.0 → 0.2.1
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/dist/chunks/{labels-DJ_RnkCQ.cjs → labels-BlZiVd3n.cjs} +82 -43
- package/dist/chunks/labels-BlZiVd3n.cjs.map +1 -0
- package/dist/chunks/{labels-ByA_yGKl.js → labels-CTR6b-KZ.js} +82 -43
- package/dist/chunks/labels-CTR6b-KZ.js.map +1 -0
- package/dist/chunks/{use-checkout-CQBSONj1.cjs → use-checkout-BEaLKgNa.cjs} +2 -2
- package/dist/chunks/{use-checkout-CQBSONj1.cjs.map → use-checkout-BEaLKgNa.cjs.map} +1 -1
- package/dist/chunks/{use-checkout-gAjnCzae.js → use-checkout-DwHd4uFh.js} +2 -2
- package/dist/chunks/{use-checkout-gAjnCzae.js.map → use-checkout-DwHd4uFh.js.map} +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +1 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +1 -1
- package/dist/next/index.cjs +5 -5
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.js +6 -6
- package/dist/next/index.js.map +1 -1
- package/dist/react/index.cjs +2 -2
- package/dist/react/index.js +2 -2
- package/dist/styles.css +12 -97
- package/package.json +1 -1
- package/dist/chunks/labels-ByA_yGKl.js.map +0 -1
- package/dist/chunks/labels-DJ_RnkCQ.cjs.map +0 -1
package/dist/next/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { isValidElement, cloneElement, useMemo, useState, useRef, useEffect, useCallback } from 'react';
|
|
4
|
-
import { u as useCheckout, b as useSazitoClient, C as CheckoutProvider } from '../chunks/use-checkout-
|
|
5
|
-
export { S as SazitoProvider } from '../chunks/use-checkout-
|
|
6
|
-
import { m as formatPercent, E as sortCartItemsNewestFirst, H as toPersianDigits, r as isDigitalServiceGroup, t as isValidIranianMobile, z as normalizeIranianPhone, A as paymentMethodInfo, l as formatNumber } from '../chunks/labels-
|
|
4
|
+
import { u as useCheckout, b as useSazitoClient, C as CheckoutProvider } from '../chunks/use-checkout-DwHd4uFh.js';
|
|
5
|
+
export { S as SazitoProvider } from '../chunks/use-checkout-DwHd4uFh.js';
|
|
6
|
+
import { m as formatPercent, E as sortCartItemsNewestFirst, H as toPersianDigits, r as isDigitalServiceGroup, t as isValidIranianMobile, z as normalizeIranianPhone, A as paymentMethodInfo, l as formatNumber } from '../chunks/labels-CTR6b-KZ.js';
|
|
7
7
|
import '@sazito/client-sdk';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -755,8 +755,8 @@ function themeVars(theme) {
|
|
|
755
755
|
vars['--szc-font'] = theme.fontFamily;
|
|
756
756
|
return vars;
|
|
757
757
|
}
|
|
758
|
-
function
|
|
759
|
-
return (jsxs("div", { className: "szc-
|
|
758
|
+
function CheckoutLoading({ label }) {
|
|
759
|
+
return (jsxs("div", { className: "szc-checkout-loading", role: "status", "aria-live": "polite", children: [jsx(Spinner, { className: "szc-checkout-loading__spinner" }), jsx("span", { children: label })] }));
|
|
760
760
|
}
|
|
761
761
|
function SazitoCheckout({ theme, continueShoppingUrl, className, renderNextButton, renderBackButton, renderEmptyCart, }) {
|
|
762
762
|
const { state, actions, t, summary, money } = useCheckout();
|
|
@@ -831,7 +831,7 @@ function SazitoCheckout({ theme, continueShoppingUrl, className, renderNextButto
|
|
|
831
831
|
? CardIcon
|
|
832
832
|
: ClipboardIcon;
|
|
833
833
|
const mobileHead = (jsxs("div", { className: "szc-mobile-head", children: [footerVisible && backVisible ? (jsx("button", { type: "button", className: "szc-mobile-head__back", "aria-label": t.back, onClick: backOnClick, children: jsx("svg", { className: "szc-back-arrow", viewBox: "0 0 16 16", width: "18", height: "18", fill: "none", "aria-hidden": "true", children: jsx("path", { d: "M9.5 3.5 5 8l4.5 4.5", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }) }) })) : (jsx("span", {})), jsxs("span", { className: "szc-mobile-head__title", children: [jsx("span", { className: "szc-mobile-head__dot", children: jsx(HeadIcon, {}) }), headTitle] }), flowIndex >= 0 ? (jsx("span", { className: "szc-mobile-head__count", children: t.stepOf(formatNumber(flowIndex + 1, state.locale), formatNumber(flowSteps.length, state.locale)) })) : (jsx("span", {}))] }));
|
|
834
|
-
return (jsxs("div", { className: `szc-root${className ? ` ${className}` : ''}`, dir: direction, style: themeVars(theme), children: [mobileHead, jsx(Stepper, {}), bootstrapping ? (jsx(
|
|
834
|
+
return (jsxs("div", { className: `szc-root${className ? ` ${className}` : ''}`, dir: direction, style: themeVars(theme), children: [mobileHead, jsx(Stepper, {}), bootstrapping ? (jsx(CheckoutLoading, { label: t.loading })) : fatal ? (jsx(ErrorBanner, { message: error.message })) : isResult ? (jsx("div", { className: "szc-result-wrap", children: jsx(ResultStep, { continueShoppingUrl: continueShoppingUrl }) })) : (jsx(Fragment, { children: jsxs("div", { className: `szc-layout${cartEmpty ? ' szc-layout--full' : ''}`, children: [jsxs("main", { className: "szc-main", children: [error ? jsx(ErrorBanner, { message: error.message }) : null, step === 'cart' ? jsx(CartStep, { continueShoppingUrl: continueShoppingUrl, renderEmpty: renderEmptyCart }) : null, step === 'shipping' ? jsx(ShippingStep, {}) : null, step === 'payment' ? jsx(PaymentStep, {}) : null, actionsVisible && backButtonNode ? (jsx("div", { className: "szc-back-row", children: backButtonNode })) : null] }), !cartEmpty ? (jsxs("div", { className: "szc-side", children: [jsx(OrderSummary, {}), actionsVisible ? jsx("div", { className: "szc-side__cta", children: nextButtonNode }) : null] })) : null] }) })), actionsVisible ? (jsx("div", { className: "szc-footer-bar", children: jsxs("div", { className: "szc-footer", children: [jsxs("div", { className: "szc-footer__total", children: [jsx("span", { className: "szc-footer__total-label", children: t.total }), jsx("span", { className: "szc-footer__total-value", children: money(summary.total) })] }), jsx("div", { className: "szc-footer__actions", children: nextButtonNode })] }) })) : null] }));
|
|
835
835
|
}
|
|
836
836
|
|
|
837
837
|
function SazitoCheckoutPage({ credentials, config, paymentReturnParams, className, renderNextButton, renderBackButton, renderEmptyCart, }) {
|