@blocklet/payment-react 1.18.56 → 1.19.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/es/checkout/donate.d.ts +1 -15
- package/es/checkout/donate.js +301 -189
- package/es/checkout/form.d.ts +1 -15
- package/es/checkout/form.js +5 -13
- package/es/checkout/table.js +3 -3
- package/es/components/blockchain/gas.d.ts +1 -5
- package/es/components/blockchain/gas.js +10 -2
- package/es/components/blockchain/tx.d.ts +1 -8
- package/es/components/blockchain/tx.js +29 -10
- package/es/components/confirm.d.ts +1 -10
- package/es/components/confirm.js +4 -10
- package/es/components/country-select.d.ts +3 -2
- package/es/components/country-select.js +375 -352
- package/es/components/date-range-picker.d.ts +13 -0
- package/es/components/date-range-picker.js +279 -0
- package/es/components/input.d.ts +14 -20
- package/es/components/input.js +51 -44
- package/es/components/label.d.ts +7 -0
- package/es/components/label.js +49 -0
- package/es/components/lazy-loader.js +1 -2
- package/es/components/link.d.ts +2 -9
- package/es/components/link.js +9 -6
- package/es/components/livemode.d.ts +2 -8
- package/es/components/livemode.js +1 -5
- package/es/components/loading-button.d.ts +6 -1
- package/es/components/loading-button.js +56 -66
- package/es/components/over-due-invoice-payment.d.ts +0 -18
- package/es/components/over-due-invoice-payment.js +138 -95
- package/es/components/payment-beneficiaries.d.ts +2 -7
- package/es/components/payment-beneficiaries.js +86 -40
- package/es/components/pricing-item.d.ts +0 -5
- package/es/components/pricing-item.js +1 -4
- package/es/components/pricing-table.d.ts +2 -10
- package/es/components/pricing-table.js +8 -7
- package/es/components/resume-subscription.d.ts +0 -10
- package/es/components/resume-subscription.js +42 -21
- package/es/components/truncated-text.d.ts +2 -9
- package/es/components/truncated-text.js +0 -5
- package/es/contexts/donate.d.ts +0 -7
- package/es/contexts/donate.js +10 -8
- package/es/contexts/payment.d.ts +1 -4
- package/es/contexts/payment.js +7 -2
- package/es/history/credit/grants-list.d.ts +14 -0
- package/es/history/credit/grants-list.js +215 -0
- package/es/history/credit/transactions-list.d.ts +13 -0
- package/es/history/credit/transactions-list.js +255 -0
- package/es/history/invoice/list.d.ts +2 -18
- package/es/history/invoice/list.js +172 -74
- package/es/history/payment/list.js +115 -38
- package/es/hooks/keyboard.d.ts +1 -1
- package/es/hooks/keyboard.js +2 -4
- package/es/index.d.ts +5 -1
- package/es/index.js +10 -1
- package/es/libs/cached-request.js +2 -4
- package/es/libs/phone-validator.js +1 -2
- package/es/libs/util.d.ts +2 -0
- package/es/libs/util.js +14 -4
- package/es/libs/validator.js +2 -4
- package/es/locales/en.js +20 -2
- package/es/locales/zh.js +20 -2
- package/es/payment/amount.d.ts +2 -7
- package/es/payment/amount.js +1 -5
- package/es/payment/donation-form.d.ts +2 -10
- package/es/payment/donation-form.js +196 -160
- package/es/payment/error.d.ts +2 -8
- package/es/payment/error.js +40 -20
- package/es/payment/footer.d.ts +2 -3
- package/es/payment/footer.js +19 -6
- package/es/payment/form/addon.js +14 -4
- package/es/payment/form/address.d.ts +2 -9
- package/es/payment/form/address.js +3 -6
- package/es/payment/form/currency.js +45 -25
- package/es/payment/form/index.d.ts +2 -8
- package/es/payment/form/index.js +151 -71
- package/es/payment/form/phone.js +2 -4
- package/es/payment/form/stripe/form.d.ts +2 -8
- package/es/payment/form/stripe/form.js +1 -3
- package/es/payment/header.js +38 -16
- package/es/payment/index.d.ts +2 -9
- package/es/payment/index.js +23 -17
- package/es/payment/product-card.d.ts +2 -11
- package/es/payment/product-card.js +84 -50
- package/es/payment/product-donation.js +175 -114
- package/es/payment/product-item.d.ts +9 -9
- package/es/payment/product-item.js +320 -145
- package/es/payment/product-skeleton.js +2 -2
- package/es/payment/skeleton/donation.js +27 -7
- package/es/payment/skeleton/overview.js +22 -2
- package/es/payment/skeleton/payment.js +33 -5
- package/es/payment/success.d.ts +2 -9
- package/es/payment/success.js +41 -14
- package/es/payment/summary.d.ts +4 -17
- package/es/payment/summary.js +193 -111
- package/es/theme/index.d.ts +0 -5
- package/es/theme/index.js +2 -5
- package/es/theme/typography.d.ts +2 -2
- package/lib/checkout/donate.d.ts +1 -15
- package/lib/checkout/donate.js +75 -54
- package/lib/checkout/form.d.ts +1 -15
- package/lib/checkout/form.js +7 -15
- package/lib/checkout/table.js +4 -4
- package/lib/components/blockchain/gas.d.ts +1 -5
- package/lib/components/blockchain/gas.js +3 -2
- package/lib/components/blockchain/tx.d.ts +1 -8
- package/lib/components/blockchain/tx.js +15 -10
- package/lib/components/confirm.d.ts +1 -10
- package/lib/components/confirm.js +5 -11
- package/lib/components/country-select.d.ts +3 -2
- package/lib/components/country-select.js +23 -22
- package/lib/components/date-range-picker.d.ts +13 -0
- package/lib/components/date-range-picker.js +329 -0
- package/lib/components/input.d.ts +14 -20
- package/lib/components/input.js +28 -27
- package/lib/components/label.d.ts +7 -0
- package/lib/components/label.js +60 -0
- package/lib/components/lazy-loader.js +1 -1
- package/lib/components/link.d.ts +2 -9
- package/lib/components/link.js +3 -8
- package/lib/components/livemode.d.ts +2 -8
- package/lib/components/livemode.js +3 -7
- package/lib/components/loading-button.d.ts +6 -1
- package/lib/components/loading-button.js +9 -17
- package/lib/components/over-due-invoice-payment.d.ts +0 -18
- package/lib/components/over-due-invoice-payment.js +31 -33
- package/lib/components/payment-beneficiaries.d.ts +2 -7
- package/lib/components/payment-beneficiaries.js +12 -11
- package/lib/components/pricing-item.d.ts +0 -5
- package/lib/components/pricing-item.js +2 -5
- package/lib/components/pricing-table.d.ts +2 -10
- package/lib/components/pricing-table.js +5 -11
- package/lib/components/resume-subscription.d.ts +0 -10
- package/lib/components/resume-subscription.js +16 -16
- package/lib/components/table.js +1 -1
- package/lib/components/truncated-text.d.ts +2 -9
- package/lib/components/truncated-text.js +1 -6
- package/lib/contexts/donate.d.ts +0 -7
- package/lib/contexts/donate.js +4 -7
- package/lib/contexts/payment.d.ts +1 -4
- package/lib/contexts/payment.js +4 -7
- package/lib/history/credit/grants-list.d.ts +14 -0
- package/lib/history/credit/grants-list.js +277 -0
- package/lib/history/credit/transactions-list.d.ts +13 -0
- package/lib/history/credit/transactions-list.js +301 -0
- package/lib/history/invoice/list.d.ts +2 -18
- package/lib/history/invoice/list.js +73 -37
- package/lib/history/payment/list.js +30 -16
- package/lib/hooks/keyboard.d.ts +1 -1
- package/lib/hooks/mobile.js +1 -1
- package/lib/hooks/subscription.js +1 -1
- package/lib/index.d.ts +5 -1
- package/lib/index.js +41 -2
- package/lib/libs/api.js +1 -1
- package/lib/libs/dayjs.js +1 -1
- package/lib/libs/phone-validator.js +0 -2
- package/lib/libs/theme.js +1 -1
- package/lib/libs/util.d.ts +2 -0
- package/lib/libs/util.js +15 -1
- package/lib/libs/validator.js +1 -1
- package/lib/locales/en.js +21 -3
- package/lib/locales/index.js +1 -1
- package/lib/locales/zh.js +21 -3
- package/lib/payment/amount.d.ts +2 -7
- package/lib/payment/amount.js +2 -6
- package/lib/payment/donation-form.d.ts +2 -10
- package/lib/payment/donation-form.js +33 -38
- package/lib/payment/error.d.ts +2 -8
- package/lib/payment/error.js +11 -13
- package/lib/payment/footer.d.ts +2 -3
- package/lib/payment/footer.js +5 -5
- package/lib/payment/form/addon.js +5 -3
- package/lib/payment/form/address.d.ts +2 -9
- package/lib/payment/form/address.js +5 -8
- package/lib/payment/form/currency.js +3 -3
- package/lib/payment/form/index.d.ts +2 -8
- package/lib/payment/form/index.js +64 -21
- package/lib/payment/form/phone.js +1 -1
- package/lib/payment/form/stripe/form.d.ts +2 -8
- package/lib/payment/form/stripe/form.js +3 -6
- package/lib/payment/header.js +8 -4
- package/lib/payment/index.d.ts +2 -9
- package/lib/payment/index.js +27 -18
- package/lib/payment/product-card.d.ts +2 -11
- package/lib/payment/product-card.js +13 -20
- package/lib/payment/product-donation.js +71 -66
- package/lib/payment/product-item.d.ts +9 -9
- package/lib/payment/product-item.js +168 -29
- package/lib/payment/product-skeleton.js +2 -2
- package/lib/payment/skeleton/donation.js +8 -4
- package/lib/payment/skeleton/overview.js +6 -2
- package/lib/payment/skeleton/payment.js +9 -3
- package/lib/payment/success.d.ts +2 -9
- package/lib/payment/success.js +12 -15
- package/lib/payment/summary.d.ts +4 -17
- package/lib/payment/summary.js +53 -45
- package/lib/theme/index.d.ts +0 -5
- package/lib/theme/index.js +2 -5
- package/lib/theme/typography.d.ts +2 -2
- package/package.json +40 -40
- package/src/checkout/donate.tsx +103 -35
- package/src/checkout/form.tsx +5 -14
- package/src/checkout/table.tsx +3 -3
- package/src/components/blockchain/gas.tsx +5 -3
- package/src/components/blockchain/tx.tsx +19 -11
- package/src/components/confirm.tsx +4 -11
- package/src/components/country-select.tsx +391 -378
- package/src/components/date-range-picker.tsx +310 -0
- package/src/components/input.tsx +61 -46
- package/src/components/label.tsx +58 -0
- package/src/components/link.tsx +9 -7
- package/src/components/livemode.tsx +2 -6
- package/src/components/loading-button.tsx +63 -76
- package/src/components/over-due-invoice-payment.tsx +43 -28
- package/src/components/payment-beneficiaries.tsx +33 -14
- package/src/components/pricing-item.tsx +1 -4
- package/src/components/pricing-table.tsx +8 -8
- package/src/components/resume-subscription.tsx +20 -14
- package/src/components/table.tsx +2 -2
- package/src/components/truncated-text.tsx +0 -6
- package/src/contexts/donate.tsx +6 -7
- package/src/contexts/payment.tsx +7 -3
- package/src/history/credit/grants-list.tsx +276 -0
- package/src/history/credit/transactions-list.tsx +317 -0
- package/src/history/invoice/list.tsx +92 -36
- package/src/history/payment/list.tsx +53 -16
- package/src/hooks/keyboard.ts +1 -1
- package/src/index.ts +9 -0
- package/src/libs/util.ts +14 -0
- package/src/locales/en.tsx +20 -0
- package/src/locales/zh.tsx +19 -0
- package/src/payment/amount.tsx +1 -6
- package/src/payment/donation-form.tsx +47 -29
- package/src/payment/error.tsx +16 -8
- package/src/payment/footer.tsx +11 -3
- package/src/payment/form/addon.tsx +6 -1
- package/src/payment/form/address.tsx +3 -7
- package/src/payment/form/currency.tsx +12 -2
- package/src/payment/form/index.tsx +121 -45
- package/src/payment/form/stripe/form.tsx +1 -5
- package/src/payment/header.tsx +14 -2
- package/src/payment/index.tsx +27 -22
- package/src/payment/product-card.tsx +41 -18
- package/src/payment/product-donation.tsx +85 -47
- package/src/payment/product-item.tsx +198 -28
- package/src/payment/product-skeleton.tsx +3 -2
- package/src/payment/skeleton/donation.tsx +12 -2
- package/src/payment/skeleton/overview.tsx +12 -2
- package/src/payment/skeleton/payment.tsx +16 -3
- package/src/payment/success.tsx +26 -15
- package/src/payment/summary.tsx +87 -44
- package/src/theme/index.tsx +5 -8
- package/src/theme/typography.ts +2 -2
package/es/payment/success.js
CHANGED
|
@@ -9,9 +9,9 @@ export default function PaymentSuccess({
|
|
|
9
9
|
message,
|
|
10
10
|
action,
|
|
11
11
|
payee,
|
|
12
|
-
invoiceId,
|
|
13
|
-
subscriptionId,
|
|
14
|
-
subscriptions
|
|
12
|
+
invoiceId = "",
|
|
13
|
+
subscriptionId = "",
|
|
14
|
+
subscriptions = []
|
|
15
15
|
}) {
|
|
16
16
|
const { t } = useLocaleContext();
|
|
17
17
|
const { prefix } = usePaymentContext();
|
|
@@ -81,15 +81,26 @@ export default function PaymentSuccess({
|
|
|
81
81
|
next = /* @__PURE__ */ jsx(Button, { variant: "outlined", color: "primary", sx: { mt: 2 }, children: /* @__PURE__ */ jsx(Link, { href: joinURL(prefix, `/customer/subscription/${subscriptionId}`), children: t("payment.checkout.next.subscription", { payee }) }) });
|
|
82
82
|
}
|
|
83
83
|
} else if (invoiceId) {
|
|
84
|
-
next = /* @__PURE__ */ jsx(
|
|
84
|
+
next = /* @__PURE__ */ jsx(
|
|
85
|
+
Typography,
|
|
86
|
+
{
|
|
87
|
+
sx: {
|
|
88
|
+
textAlign: "center",
|
|
89
|
+
mt: 2
|
|
90
|
+
},
|
|
91
|
+
children: /* @__PURE__ */ jsx(Link, { href: joinURL(prefix, `/customer/invoice/${invoiceId}`), children: t("payment.checkout.next.invoice", { payee }) })
|
|
92
|
+
}
|
|
93
|
+
);
|
|
85
94
|
}
|
|
86
95
|
return /* @__PURE__ */ jsx(Grow, { in: true, children: /* @__PURE__ */ jsxs(
|
|
87
96
|
Stack,
|
|
88
97
|
{
|
|
89
98
|
direction: "column",
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
99
|
+
sx: {
|
|
100
|
+
alignItems: "center",
|
|
101
|
+
justifyContent: mode === "standalone" ? "center" : "flex-start",
|
|
102
|
+
height: mode === "standalone" ? "fit-content" : 300
|
|
103
|
+
},
|
|
93
104
|
children: [
|
|
94
105
|
/* @__PURE__ */ jsx(Div, { children: /* @__PURE__ */ jsxs("div", { className: "check-icon", children: [
|
|
95
106
|
/* @__PURE__ */ jsx("span", { className: "icon-line line-tip" }),
|
|
@@ -97,18 +108,34 @@ export default function PaymentSuccess({
|
|
|
97
108
|
/* @__PURE__ */ jsx("div", { className: "icon-circle" }),
|
|
98
109
|
/* @__PURE__ */ jsx("div", { className: "icon-fix" })
|
|
99
110
|
] }) }),
|
|
100
|
-
/* @__PURE__ */ jsx(
|
|
101
|
-
|
|
111
|
+
/* @__PURE__ */ jsx(
|
|
112
|
+
Typography,
|
|
113
|
+
{
|
|
114
|
+
variant: "h5",
|
|
115
|
+
sx: {
|
|
116
|
+
color: "text.primary",
|
|
117
|
+
mb: 3
|
|
118
|
+
},
|
|
119
|
+
children: message
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
/* @__PURE__ */ jsx(
|
|
123
|
+
Typography,
|
|
124
|
+
{
|
|
125
|
+
variant: "body1",
|
|
126
|
+
sx: {
|
|
127
|
+
color: "text.secondary",
|
|
128
|
+
textAlign: "center",
|
|
129
|
+
fontSize: "14px"
|
|
130
|
+
},
|
|
131
|
+
children: t("payment.checkout.completed.tip", { payee })
|
|
132
|
+
}
|
|
133
|
+
),
|
|
102
134
|
next
|
|
103
135
|
]
|
|
104
136
|
}
|
|
105
137
|
) });
|
|
106
138
|
}
|
|
107
|
-
PaymentSuccess.defaultProps = {
|
|
108
|
-
invoiceId: "",
|
|
109
|
-
subscriptionId: "",
|
|
110
|
-
subscriptions: []
|
|
111
|
-
};
|
|
112
139
|
const Div = styled("div")`
|
|
113
140
|
width: 80px;
|
|
114
141
|
height: 115px;
|
package/es/payment/summary.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ type Props = {
|
|
|
8
8
|
showStaking?: boolean;
|
|
9
9
|
onUpsell?: Function;
|
|
10
10
|
onDownsell?: Function;
|
|
11
|
+
onQuantityChange?: Function;
|
|
11
12
|
onChangeAmount?: Function;
|
|
12
13
|
onApplyCrossSell?: Function;
|
|
13
14
|
onCancelCrossSell?: Function;
|
|
@@ -15,21 +16,7 @@ type Props = {
|
|
|
15
16
|
crossSellBehavior?: string;
|
|
16
17
|
donationSettings?: DonationSettings;
|
|
17
18
|
action?: string;
|
|
19
|
+
completed?: boolean;
|
|
18
20
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var defaultProps: {
|
|
22
|
-
onUpsell: any;
|
|
23
|
-
onDownsell: any;
|
|
24
|
-
onApplyCrossSell: any;
|
|
25
|
-
onCancelCrossSell: any;
|
|
26
|
-
onChangeAmount: any;
|
|
27
|
-
checkoutSessionId: string;
|
|
28
|
-
crossSellBehavior: string;
|
|
29
|
-
showStaking: boolean;
|
|
30
|
-
donationSettings: null;
|
|
31
|
-
action: string;
|
|
32
|
-
trialEnd: number;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export default PaymentSummary;
|
|
21
|
+
export default function PaymentSummary({ items, currency, trialInDays, billingThreshold, onUpsell, onDownsell, onQuantityChange, onApplyCrossSell, onCancelCrossSell, onChangeAmount, checkoutSessionId, crossSellBehavior, showStaking, donationSettings, action, trialEnd, completed, ...rest }: Props): import("react").JSX.Element;
|
|
22
|
+
export {};
|
package/es/payment/summary.js
CHANGED
|
@@ -66,35 +66,24 @@ function getStakingSetup(items, currency, billingThreshold = 0) {
|
|
|
66
66
|
}
|
|
67
67
|
return "0";
|
|
68
68
|
}
|
|
69
|
-
PaymentSummary.defaultProps = {
|
|
70
|
-
onUpsell: noop,
|
|
71
|
-
onDownsell: noop,
|
|
72
|
-
onApplyCrossSell: noop,
|
|
73
|
-
onCancelCrossSell: noop,
|
|
74
|
-
onChangeAmount: noop,
|
|
75
|
-
checkoutSessionId: "",
|
|
76
|
-
crossSellBehavior: "",
|
|
77
|
-
showStaking: false,
|
|
78
|
-
donationSettings: null,
|
|
79
|
-
action: "",
|
|
80
|
-
trialEnd: 0
|
|
81
|
-
};
|
|
82
69
|
export default function PaymentSummary({
|
|
83
70
|
items,
|
|
84
71
|
currency,
|
|
85
72
|
trialInDays,
|
|
86
73
|
billingThreshold,
|
|
87
|
-
onUpsell,
|
|
88
|
-
onDownsell,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
74
|
+
onUpsell = noop,
|
|
75
|
+
onDownsell = noop,
|
|
76
|
+
onQuantityChange = noop,
|
|
77
|
+
onApplyCrossSell = noop,
|
|
78
|
+
onCancelCrossSell = noop,
|
|
79
|
+
onChangeAmount = noop,
|
|
80
|
+
checkoutSessionId = "",
|
|
81
|
+
crossSellBehavior = "",
|
|
82
|
+
showStaking = false,
|
|
83
|
+
donationSettings = void 0,
|
|
84
|
+
action = "",
|
|
97
85
|
trialEnd = 0,
|
|
86
|
+
completed = false,
|
|
98
87
|
...rest
|
|
99
88
|
}) {
|
|
100
89
|
const { t, locale } = useLocaleContext();
|
|
@@ -124,6 +113,10 @@ export default function PaymentSummary({
|
|
|
124
113
|
await onUpsell(from, to);
|
|
125
114
|
runAsync();
|
|
126
115
|
};
|
|
116
|
+
const handleQuantityChange = async (itemId, quantity) => {
|
|
117
|
+
await onQuantityChange(itemId, quantity);
|
|
118
|
+
runAsync();
|
|
119
|
+
};
|
|
127
120
|
const handleDownsell = async (from) => {
|
|
128
121
|
await onDownsell(from);
|
|
129
122
|
runAsync();
|
|
@@ -179,86 +172,131 @@ export default function PaymentSummary({
|
|
|
179
172
|
currency,
|
|
180
173
|
onUpsell: handleUpsell,
|
|
181
174
|
onDownsell: handleDownsell,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
175
|
+
adjustableQuantity: x.adjustable_quantity,
|
|
176
|
+
completed,
|
|
177
|
+
onQuantityChange: handleQuantityChange,
|
|
178
|
+
children: x.cross_sell && /* @__PURE__ */ jsxs(
|
|
179
|
+
Stack,
|
|
180
|
+
{
|
|
181
|
+
direction: "row",
|
|
182
|
+
sx: {
|
|
183
|
+
alignItems: "center",
|
|
184
|
+
justifyContent: "space-between",
|
|
185
|
+
width: 1
|
|
186
|
+
},
|
|
187
|
+
children: [
|
|
188
|
+
/* @__PURE__ */ jsx(Typography, {}),
|
|
189
|
+
/* @__PURE__ */ jsx(
|
|
190
|
+
LoadingButton,
|
|
191
|
+
{
|
|
192
|
+
size: "small",
|
|
193
|
+
loadingPosition: "end",
|
|
194
|
+
endIcon: null,
|
|
195
|
+
color: "error",
|
|
196
|
+
variant: "text",
|
|
197
|
+
loading: state.loading,
|
|
198
|
+
onClick: handleCancelCrossSell,
|
|
199
|
+
children: t("payment.checkout.cross_sell.remove")
|
|
200
|
+
}
|
|
201
|
+
)
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
)
|
|
198
205
|
},
|
|
199
206
|
`${x.price_id}-${currency.id}`
|
|
200
207
|
)
|
|
201
208
|
) }),
|
|
202
|
-
data && items.some((x) => x.price_id === data.id) === false && /* @__PURE__ */ jsx(Grow, { in: true, children: /* @__PURE__ */ jsx(
|
|
203
|
-
|
|
209
|
+
data && items.some((x) => x.price_id === data.id) === false && /* @__PURE__ */ jsx(Grow, { in: true, children: /* @__PURE__ */ jsx(
|
|
210
|
+
Stack,
|
|
204
211
|
{
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
212
|
+
sx: {
|
|
213
|
+
mt: 1
|
|
214
|
+
},
|
|
215
|
+
children: /* @__PURE__ */ jsx(
|
|
216
|
+
ProductItem,
|
|
217
|
+
{
|
|
218
|
+
item: { quantity: 1, price: data, price_id: data.id, cross_sell: true },
|
|
219
|
+
items,
|
|
220
|
+
trialInDays,
|
|
221
|
+
currency,
|
|
222
|
+
trialEnd,
|
|
223
|
+
onUpsell: noop,
|
|
224
|
+
onDownsell: noop,
|
|
225
|
+
children: /* @__PURE__ */ jsxs(
|
|
226
|
+
Stack,
|
|
227
|
+
{
|
|
228
|
+
direction: "row",
|
|
229
|
+
sx: {
|
|
230
|
+
alignItems: "center",
|
|
231
|
+
justifyContent: "space-between",
|
|
232
|
+
width: 1
|
|
233
|
+
},
|
|
234
|
+
children: [
|
|
235
|
+
/* @__PURE__ */ jsx(Typography, { children: crossSellBehavior === "required" && /* @__PURE__ */ jsx(Status, { label: t("payment.checkout.required"), color: "info", variant: "outlined", sx: { mr: 1 } }) }),
|
|
236
|
+
/* @__PURE__ */ jsx(
|
|
237
|
+
LoadingButton,
|
|
238
|
+
{
|
|
239
|
+
size: "small",
|
|
240
|
+
loadingPosition: "end",
|
|
241
|
+
endIcon: null,
|
|
242
|
+
color: crossSellBehavior === "required" ? "info" : "info",
|
|
243
|
+
variant: crossSellBehavior === "required" ? "text" : "text",
|
|
244
|
+
loading: state.loading,
|
|
245
|
+
onClick: handleApplyCrossSell,
|
|
246
|
+
children: t("payment.checkout.cross_sell.add")
|
|
247
|
+
}
|
|
248
|
+
)
|
|
249
|
+
]
|
|
250
|
+
}
|
|
251
|
+
)
|
|
252
|
+
}
|
|
253
|
+
)
|
|
228
254
|
}
|
|
229
|
-
) })
|
|
255
|
+
) })
|
|
230
256
|
]
|
|
231
257
|
}
|
|
232
258
|
);
|
|
233
259
|
return /* @__PURE__ */ jsx(Fade, { in: true, children: /* @__PURE__ */ jsxs(Stack, { className: "cko-product", direction: "column", ...rest, children: [
|
|
234
|
-
/* @__PURE__ */ jsxs(
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
{
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
260
|
+
/* @__PURE__ */ jsxs(
|
|
261
|
+
Box,
|
|
262
|
+
{
|
|
263
|
+
sx: {
|
|
264
|
+
display: "flex",
|
|
265
|
+
alignItems: "center",
|
|
266
|
+
mb: 2.5
|
|
267
|
+
},
|
|
268
|
+
children: [
|
|
269
|
+
/* @__PURE__ */ jsx(
|
|
270
|
+
Typography,
|
|
271
|
+
{
|
|
272
|
+
title: t("payment.checkout.orderSummary"),
|
|
273
|
+
sx: {
|
|
274
|
+
color: "text.primary",
|
|
275
|
+
fontSize: {
|
|
276
|
+
xs: "18px",
|
|
277
|
+
md: "24px"
|
|
278
|
+
},
|
|
279
|
+
fontWeight: "700",
|
|
280
|
+
lineHeight: "32px"
|
|
281
|
+
},
|
|
282
|
+
children: action || t("payment.checkout.orderSummary")
|
|
283
|
+
}
|
|
284
|
+
),
|
|
285
|
+
!settings.livemode && /* @__PURE__ */ jsx(Livemode, {})
|
|
286
|
+
]
|
|
287
|
+
}
|
|
288
|
+
),
|
|
253
289
|
isMobile && !donationSettings ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
254
290
|
/* @__PURE__ */ jsxs(
|
|
255
291
|
Stack,
|
|
256
292
|
{
|
|
257
|
-
justifyContent: "space-between",
|
|
258
|
-
flexDirection: "row",
|
|
259
|
-
alignItems: "center",
|
|
260
|
-
mb: 1.5,
|
|
261
293
|
onClick: () => setState({ expanded: !state.expanded }),
|
|
294
|
+
sx: {
|
|
295
|
+
justifyContent: "space-between",
|
|
296
|
+
flexDirection: "row",
|
|
297
|
+
alignItems: "center",
|
|
298
|
+
mb: 1.5
|
|
299
|
+
},
|
|
262
300
|
children: [
|
|
263
301
|
/* @__PURE__ */ jsx(Typography, { children: t("payment.checkout.productListTotal", { total: items.length }) }),
|
|
264
302
|
/* @__PURE__ */ jsx(ExpandMore, { expand: state.expanded, "aria-expanded": state.expanded, "aria-label": "show more", children: /* @__PURE__ */ jsx(ExpandMoreIcon, {}) })
|
|
@@ -269,33 +307,77 @@ export default function PaymentSummary({
|
|
|
269
307
|
] }) : ProductCardList,
|
|
270
308
|
/* @__PURE__ */ jsx(Divider, { sx: { mt: 2.5, mb: 2.5 } }),
|
|
271
309
|
staking > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
272
|
-
/* @__PURE__ */ jsxs(
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
310
|
+
/* @__PURE__ */ jsxs(
|
|
311
|
+
Stack,
|
|
312
|
+
{
|
|
313
|
+
direction: "row",
|
|
314
|
+
spacing: 1,
|
|
315
|
+
sx: {
|
|
316
|
+
justifyContent: "space-between",
|
|
317
|
+
alignItems: "center"
|
|
318
|
+
},
|
|
319
|
+
children: [
|
|
320
|
+
/* @__PURE__ */ jsxs(
|
|
321
|
+
Stack,
|
|
322
|
+
{
|
|
323
|
+
direction: "row",
|
|
324
|
+
spacing: 0.5,
|
|
325
|
+
sx: {
|
|
326
|
+
alignItems: "center"
|
|
327
|
+
},
|
|
328
|
+
children: [
|
|
329
|
+
/* @__PURE__ */ jsx(Typography, { sx: { color: "text.secondary" }, children: t("payment.checkout.paymentRequired") }),
|
|
330
|
+
/* @__PURE__ */ jsx(Tooltip, { title: t("payment.checkout.stakingConfirm"), placement: "top", sx: { maxWidth: "150px" }, children: /* @__PURE__ */ jsx(HelpOutline, { fontSize: "small", sx: { color: "text.lighter" } }) })
|
|
331
|
+
]
|
|
332
|
+
}
|
|
333
|
+
),
|
|
334
|
+
/* @__PURE__ */ jsx(Typography, { children: headlines.amount })
|
|
335
|
+
]
|
|
336
|
+
}
|
|
337
|
+
),
|
|
338
|
+
/* @__PURE__ */ jsxs(
|
|
339
|
+
Stack,
|
|
340
|
+
{
|
|
341
|
+
direction: "row",
|
|
342
|
+
spacing: 1,
|
|
343
|
+
sx: {
|
|
344
|
+
justifyContent: "space-between",
|
|
345
|
+
alignItems: "center"
|
|
346
|
+
},
|
|
347
|
+
children: [
|
|
348
|
+
/* @__PURE__ */ jsxs(
|
|
349
|
+
Stack,
|
|
350
|
+
{
|
|
351
|
+
direction: "row",
|
|
352
|
+
spacing: 0.5,
|
|
353
|
+
sx: {
|
|
354
|
+
alignItems: "center"
|
|
355
|
+
},
|
|
356
|
+
children: [
|
|
357
|
+
/* @__PURE__ */ jsx(Typography, { sx: { color: "text.secondary" }, children: t("payment.checkout.staking.title") }),
|
|
358
|
+
/* @__PURE__ */ jsx(Tooltip, { title: t("payment.checkout.staking.tooltip"), placement: "top", sx: { maxWidth: "150px" }, children: /* @__PURE__ */ jsx(HelpOutline, { fontSize: "small", sx: { color: "text.lighter" } }) })
|
|
359
|
+
]
|
|
360
|
+
}
|
|
361
|
+
),
|
|
362
|
+
/* @__PURE__ */ jsxs(Typography, { children: [
|
|
363
|
+
formatAmount(staking, currency.decimal),
|
|
364
|
+
" ",
|
|
365
|
+
currency.symbol
|
|
366
|
+
] })
|
|
367
|
+
]
|
|
368
|
+
}
|
|
369
|
+
)
|
|
290
370
|
] }),
|
|
291
371
|
/* @__PURE__ */ jsxs(
|
|
292
372
|
Stack,
|
|
293
373
|
{
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
374
|
+
sx: {
|
|
375
|
+
display: "flex",
|
|
376
|
+
justifyContent: "space-between",
|
|
377
|
+
flexDirection: "row",
|
|
378
|
+
alignItems: "center",
|
|
379
|
+
width: "100%"
|
|
380
|
+
},
|
|
299
381
|
children: [
|
|
300
382
|
/* @__PURE__ */ jsxs(Box, { className: "base-label", children: [
|
|
301
383
|
t("common.total"),
|
package/es/theme/index.d.ts
CHANGED
|
@@ -7,9 +7,4 @@ export declare function PaymentThemeProvider({ children, theme: customTheme, }:
|
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
theme?: PaymentThemeOptions;
|
|
9
9
|
}): JSX.Element;
|
|
10
|
-
export declare namespace PaymentThemeProvider {
|
|
11
|
-
var defaultProps: {
|
|
12
|
-
theme: {};
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
10
|
export { typography };
|
package/es/theme/index.js
CHANGED
|
@@ -7,9 +7,6 @@ import { useMemo } from "react";
|
|
|
7
7
|
import "./index.css";
|
|
8
8
|
import "./types";
|
|
9
9
|
import { typography } from "./typography.js";
|
|
10
|
-
PaymentThemeProvider.defaultProps = {
|
|
11
|
-
theme: {}
|
|
12
|
-
};
|
|
13
10
|
export function PaymentThemeProvider({
|
|
14
11
|
children,
|
|
15
12
|
theme: customTheme = {}
|
|
@@ -261,7 +258,7 @@ export function PaymentThemeProvider({
|
|
|
261
258
|
backgroundColor: palette.chip.default.background,
|
|
262
259
|
borderColor: palette.chip.default.border
|
|
263
260
|
},
|
|
264
|
-
"&.MuiChip-
|
|
261
|
+
"&.MuiChip-filled.MuiChip-colorSecondary": {
|
|
265
262
|
color: palette.chip.secondary.text,
|
|
266
263
|
backgroundColor: palette.chip.secondary.background,
|
|
267
264
|
borderColor: palette.chip.secondary.border
|
|
@@ -276,7 +273,7 @@ export function PaymentThemeProvider({
|
|
|
276
273
|
backgroundColor: palette.chip.warning.background,
|
|
277
274
|
borderColor: palette.chip.warning.border
|
|
278
275
|
},
|
|
279
|
-
"&.MuiChip-
|
|
276
|
+
"&.MuiChip-filled.MuiChip-colorPrimary,&.MuiChip-filledInfo": {
|
|
280
277
|
color: palette.chip.info.text,
|
|
281
278
|
backgroundColor: palette.chip.info.background,
|
|
282
279
|
borderColor: palette.chip.info.border
|
package/es/theme/typography.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const typography:
|
|
1
|
+
import type { TypographyStyleOptions } from '@mui/material/styles/createTypography';
|
|
2
|
+
export declare const typography: TypographyStyleOptions;
|
package/lib/checkout/donate.d.ts
CHANGED
|
@@ -50,18 +50,4 @@ export type DonateProps = Pick<CheckoutProps, 'onPaid' | 'onError'> & {
|
|
|
50
50
|
children?: (openDialog: () => void, donateTotalAmount: string, supporters: DonateHistory, loading?: boolean, donateSettings?: DonationSettings) => React.ReactNode;
|
|
51
51
|
};
|
|
52
52
|
export declare function DonateDetails({ supporters, currency, method }: DonateHistory): import("react").JSX.Element;
|
|
53
|
-
|
|
54
|
-
declare namespace CheckoutDonate {
|
|
55
|
-
var defaultProps: {
|
|
56
|
-
theme: string;
|
|
57
|
-
livemode: undefined;
|
|
58
|
-
timeout: number;
|
|
59
|
-
mode: string;
|
|
60
|
-
inlineOptions: {
|
|
61
|
-
button: {
|
|
62
|
-
text: string;
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
export default CheckoutDonate;
|
|
53
|
+
export default function CheckoutDonate(rawProps: DonateProps): import("react").JSX.Element;
|