@blocklet/payment-react 1.18.56 → 1.19.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/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 +28 -7
- 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/input.d.ts +11 -20
- package/es/components/input.js +46 -43
- 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/invoice/list.d.ts +2 -18
- package/es/history/invoice/list.js +151 -73
- 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/libs/cached-request.js +2 -4
- package/es/libs/phone-validator.js +1 -2
- package/es/libs/util.js +2 -4
- package/es/libs/validator.js +2 -4
- 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 +107 -65
- 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 +5 -14
- 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 +2 -9
- package/es/payment/product-item.js +185 -142
- 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 +2 -17
- package/es/payment/summary.js +184 -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 +11 -7
- 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/input.d.ts +11 -20
- package/lib/components/input.js +20 -23
- 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/invoice/list.d.ts +2 -18
- package/lib/history/invoice/list.js +49 -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.js +2 -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.js +1 -1
- package/lib/libs/validator.js +1 -1
- package/lib/locales/en.js +1 -1
- package/lib/locales/index.js +1 -1
- package/lib/locales/zh.js +1 -1
- 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 +19 -15
- 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 +7 -16
- 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 +2 -9
- package/lib/payment/product-item.js +24 -25
- 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 +2 -17
- package/lib/payment/summary.js +44 -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 +22 -8
- package/src/components/confirm.tsx +4 -11
- package/src/components/country-select.tsx +391 -378
- package/src/components/input.tsx +49 -45
- 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/invoice/list.tsx +74 -35
- package/src/history/payment/list.tsx +53 -16
- package/src/hooks/keyboard.ts +1 -1
- 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 +30 -12
- package/src/payment/form/stripe/form.tsx +1 -5
- package/src/payment/header.tsx +14 -2
- package/src/payment/index.tsx +10 -21
- package/src/payment/product-card.tsx +41 -18
- package/src/payment/product-donation.tsx +85 -47
- package/src/payment/product-item.tsx +46 -24
- 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 +74 -42
- package/src/theme/index.tsx +5 -8
- package/src/theme/typography.ts +2 -2
package/es/payment/summary.js
CHANGED
|
@@ -66,34 +66,21 @@ 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
|
-
onApplyCrossSell,
|
|
90
|
-
onCancelCrossSell,
|
|
91
|
-
onChangeAmount,
|
|
92
|
-
checkoutSessionId,
|
|
93
|
-
crossSellBehavior,
|
|
94
|
-
showStaking,
|
|
95
|
-
donationSettings,
|
|
96
|
-
action,
|
|
74
|
+
onUpsell = noop,
|
|
75
|
+
onDownsell = noop,
|
|
76
|
+
onApplyCrossSell = noop,
|
|
77
|
+
onCancelCrossSell = noop,
|
|
78
|
+
onChangeAmount = noop,
|
|
79
|
+
checkoutSessionId = "",
|
|
80
|
+
crossSellBehavior = "",
|
|
81
|
+
showStaking = false,
|
|
82
|
+
donationSettings = void 0,
|
|
83
|
+
action = "",
|
|
97
84
|
trialEnd = 0,
|
|
98
85
|
...rest
|
|
99
86
|
}) {
|
|
@@ -179,86 +166,128 @@ export default function PaymentSummary({
|
|
|
179
166
|
currency,
|
|
180
167
|
onUpsell: handleUpsell,
|
|
181
168
|
onDownsell: handleDownsell,
|
|
182
|
-
children: x.cross_sell && /* @__PURE__ */ jsxs(
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
{
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
169
|
+
children: x.cross_sell && /* @__PURE__ */ jsxs(
|
|
170
|
+
Stack,
|
|
171
|
+
{
|
|
172
|
+
direction: "row",
|
|
173
|
+
sx: {
|
|
174
|
+
alignItems: "center",
|
|
175
|
+
justifyContent: "space-between",
|
|
176
|
+
width: 1
|
|
177
|
+
},
|
|
178
|
+
children: [
|
|
179
|
+
/* @__PURE__ */ jsx(Typography, {}),
|
|
180
|
+
/* @__PURE__ */ jsx(
|
|
181
|
+
LoadingButton,
|
|
182
|
+
{
|
|
183
|
+
size: "small",
|
|
184
|
+
loadingPosition: "end",
|
|
185
|
+
endIcon: null,
|
|
186
|
+
color: "error",
|
|
187
|
+
variant: "text",
|
|
188
|
+
loading: state.loading,
|
|
189
|
+
onClick: handleCancelCrossSell,
|
|
190
|
+
children: t("payment.checkout.cross_sell.remove")
|
|
191
|
+
}
|
|
192
|
+
)
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
)
|
|
198
196
|
},
|
|
199
197
|
`${x.price_id}-${currency.id}`
|
|
200
198
|
)
|
|
201
199
|
) }),
|
|
202
|
-
data && items.some((x) => x.price_id === data.id) === false && /* @__PURE__ */ jsx(Grow, { in: true, children: /* @__PURE__ */ jsx(
|
|
203
|
-
|
|
200
|
+
data && items.some((x) => x.price_id === data.id) === false && /* @__PURE__ */ jsx(Grow, { in: true, children: /* @__PURE__ */ jsx(
|
|
201
|
+
Stack,
|
|
204
202
|
{
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
203
|
+
sx: {
|
|
204
|
+
mt: 1
|
|
205
|
+
},
|
|
206
|
+
children: /* @__PURE__ */ jsx(
|
|
207
|
+
ProductItem,
|
|
208
|
+
{
|
|
209
|
+
item: { quantity: 1, price: data, price_id: data.id, cross_sell: true },
|
|
210
|
+
items,
|
|
211
|
+
trialInDays,
|
|
212
|
+
currency,
|
|
213
|
+
trialEnd,
|
|
214
|
+
onUpsell: noop,
|
|
215
|
+
onDownsell: noop,
|
|
216
|
+
children: /* @__PURE__ */ jsxs(
|
|
217
|
+
Stack,
|
|
218
|
+
{
|
|
219
|
+
direction: "row",
|
|
220
|
+
sx: {
|
|
221
|
+
alignItems: "center",
|
|
222
|
+
justifyContent: "space-between",
|
|
223
|
+
width: 1
|
|
224
|
+
},
|
|
225
|
+
children: [
|
|
226
|
+
/* @__PURE__ */ jsx(Typography, { children: crossSellBehavior === "required" && /* @__PURE__ */ jsx(Status, { label: t("payment.checkout.required"), color: "info", variant: "outlined", sx: { mr: 1 } }) }),
|
|
227
|
+
/* @__PURE__ */ jsx(
|
|
228
|
+
LoadingButton,
|
|
229
|
+
{
|
|
230
|
+
size: "small",
|
|
231
|
+
loadingPosition: "end",
|
|
232
|
+
endIcon: null,
|
|
233
|
+
color: crossSellBehavior === "required" ? "info" : "info",
|
|
234
|
+
variant: crossSellBehavior === "required" ? "text" : "text",
|
|
235
|
+
loading: state.loading,
|
|
236
|
+
onClick: handleApplyCrossSell,
|
|
237
|
+
children: t("payment.checkout.cross_sell.add")
|
|
238
|
+
}
|
|
239
|
+
)
|
|
240
|
+
]
|
|
241
|
+
}
|
|
242
|
+
)
|
|
243
|
+
}
|
|
244
|
+
)
|
|
228
245
|
}
|
|
229
|
-
) })
|
|
246
|
+
) })
|
|
230
247
|
]
|
|
231
248
|
}
|
|
232
249
|
);
|
|
233
250
|
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
|
-
|
|
251
|
+
/* @__PURE__ */ jsxs(
|
|
252
|
+
Box,
|
|
253
|
+
{
|
|
254
|
+
sx: {
|
|
255
|
+
display: "flex",
|
|
256
|
+
alignItems: "center",
|
|
257
|
+
mb: 2.5
|
|
258
|
+
},
|
|
259
|
+
children: [
|
|
260
|
+
/* @__PURE__ */ jsx(
|
|
261
|
+
Typography,
|
|
262
|
+
{
|
|
263
|
+
title: t("payment.checkout.orderSummary"),
|
|
264
|
+
sx: {
|
|
265
|
+
color: "text.primary",
|
|
266
|
+
fontSize: {
|
|
267
|
+
xs: "18px",
|
|
268
|
+
md: "24px"
|
|
269
|
+
},
|
|
270
|
+
fontWeight: "700",
|
|
271
|
+
lineHeight: "32px"
|
|
272
|
+
},
|
|
273
|
+
children: action || t("payment.checkout.orderSummary")
|
|
274
|
+
}
|
|
275
|
+
),
|
|
276
|
+
!settings.livemode && /* @__PURE__ */ jsx(Livemode, {})
|
|
277
|
+
]
|
|
278
|
+
}
|
|
279
|
+
),
|
|
253
280
|
isMobile && !donationSettings ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
254
281
|
/* @__PURE__ */ jsxs(
|
|
255
282
|
Stack,
|
|
256
283
|
{
|
|
257
|
-
justifyContent: "space-between",
|
|
258
|
-
flexDirection: "row",
|
|
259
|
-
alignItems: "center",
|
|
260
|
-
mb: 1.5,
|
|
261
284
|
onClick: () => setState({ expanded: !state.expanded }),
|
|
285
|
+
sx: {
|
|
286
|
+
justifyContent: "space-between",
|
|
287
|
+
flexDirection: "row",
|
|
288
|
+
alignItems: "center",
|
|
289
|
+
mb: 1.5
|
|
290
|
+
},
|
|
262
291
|
children: [
|
|
263
292
|
/* @__PURE__ */ jsx(Typography, { children: t("payment.checkout.productListTotal", { total: items.length }) }),
|
|
264
293
|
/* @__PURE__ */ jsx(ExpandMore, { expand: state.expanded, "aria-expanded": state.expanded, "aria-label": "show more", children: /* @__PURE__ */ jsx(ExpandMoreIcon, {}) })
|
|
@@ -269,33 +298,77 @@ export default function PaymentSummary({
|
|
|
269
298
|
] }) : ProductCardList,
|
|
270
299
|
/* @__PURE__ */ jsx(Divider, { sx: { mt: 2.5, mb: 2.5 } }),
|
|
271
300
|
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
|
-
|
|
301
|
+
/* @__PURE__ */ jsxs(
|
|
302
|
+
Stack,
|
|
303
|
+
{
|
|
304
|
+
direction: "row",
|
|
305
|
+
spacing: 1,
|
|
306
|
+
sx: {
|
|
307
|
+
justifyContent: "space-between",
|
|
308
|
+
alignItems: "center"
|
|
309
|
+
},
|
|
310
|
+
children: [
|
|
311
|
+
/* @__PURE__ */ jsxs(
|
|
312
|
+
Stack,
|
|
313
|
+
{
|
|
314
|
+
direction: "row",
|
|
315
|
+
spacing: 0.5,
|
|
316
|
+
sx: {
|
|
317
|
+
alignItems: "center"
|
|
318
|
+
},
|
|
319
|
+
children: [
|
|
320
|
+
/* @__PURE__ */ jsx(Typography, { sx: { color: "text.secondary" }, children: t("payment.checkout.paymentRequired") }),
|
|
321
|
+
/* @__PURE__ */ jsx(Tooltip, { title: t("payment.checkout.stakingConfirm"), placement: "top", sx: { maxWidth: "150px" }, children: /* @__PURE__ */ jsx(HelpOutline, { fontSize: "small", sx: { color: "text.lighter" } }) })
|
|
322
|
+
]
|
|
323
|
+
}
|
|
324
|
+
),
|
|
325
|
+
/* @__PURE__ */ jsx(Typography, { children: headlines.amount })
|
|
326
|
+
]
|
|
327
|
+
}
|
|
328
|
+
),
|
|
329
|
+
/* @__PURE__ */ jsxs(
|
|
330
|
+
Stack,
|
|
331
|
+
{
|
|
332
|
+
direction: "row",
|
|
333
|
+
spacing: 1,
|
|
334
|
+
sx: {
|
|
335
|
+
justifyContent: "space-between",
|
|
336
|
+
alignItems: "center"
|
|
337
|
+
},
|
|
338
|
+
children: [
|
|
339
|
+
/* @__PURE__ */ jsxs(
|
|
340
|
+
Stack,
|
|
341
|
+
{
|
|
342
|
+
direction: "row",
|
|
343
|
+
spacing: 0.5,
|
|
344
|
+
sx: {
|
|
345
|
+
alignItems: "center"
|
|
346
|
+
},
|
|
347
|
+
children: [
|
|
348
|
+
/* @__PURE__ */ jsx(Typography, { sx: { color: "text.secondary" }, children: t("payment.checkout.staking.title") }),
|
|
349
|
+
/* @__PURE__ */ jsx(Tooltip, { title: t("payment.checkout.staking.tooltip"), placement: "top", sx: { maxWidth: "150px" }, children: /* @__PURE__ */ jsx(HelpOutline, { fontSize: "small", sx: { color: "text.lighter" } }) })
|
|
350
|
+
]
|
|
351
|
+
}
|
|
352
|
+
),
|
|
353
|
+
/* @__PURE__ */ jsxs(Typography, { children: [
|
|
354
|
+
formatAmount(staking, currency.decimal),
|
|
355
|
+
" ",
|
|
356
|
+
currency.symbol
|
|
357
|
+
] })
|
|
358
|
+
]
|
|
359
|
+
}
|
|
360
|
+
)
|
|
290
361
|
] }),
|
|
291
362
|
/* @__PURE__ */ jsxs(
|
|
292
363
|
Stack,
|
|
293
364
|
{
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
365
|
+
sx: {
|
|
366
|
+
display: "flex",
|
|
367
|
+
justifyContent: "space-between",
|
|
368
|
+
flexDirection: "row",
|
|
369
|
+
alignItems: "center",
|
|
370
|
+
width: "100%"
|
|
371
|
+
},
|
|
299
372
|
children: [
|
|
300
373
|
/* @__PURE__ */ jsxs(Box, { className: "base-label", children: [
|
|
301
374
|
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;
|
package/lib/checkout/donate.js
CHANGED
|
@@ -22,7 +22,7 @@ var _payment = require("../contexts/payment");
|
|
|
22
22
|
var _livemode = _interopRequireDefault(require("../components/livemode"));
|
|
23
23
|
var _mobile = require("../hooks/mobile");
|
|
24
24
|
var _donate = require("../contexts/donate");
|
|
25
|
-
function _interopRequireDefault(
|
|
25
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
26
26
|
const donationCache = {};
|
|
27
27
|
const createOrUpdateDonation = (settings, livemode = true) => {
|
|
28
28
|
const donationKey = `${settings.target}-${livemode}`;
|
|
@@ -98,9 +98,9 @@ function DonateDetails({
|
|
|
98
98
|
},
|
|
99
99
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
100
100
|
direction: "row",
|
|
101
|
-
alignItems: "center",
|
|
102
101
|
spacing: 0.5,
|
|
103
102
|
sx: {
|
|
103
|
+
alignItems: "center",
|
|
104
104
|
flex: 3,
|
|
105
105
|
overflow: "hidden"
|
|
106
106
|
},
|
|
@@ -143,10 +143,10 @@ function DonateDetails({
|
|
|
143
143
|
})]
|
|
144
144
|
}), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
145
145
|
direction: "row",
|
|
146
|
-
alignItems: "center",
|
|
147
|
-
justifyContent: "flex-end",
|
|
148
146
|
spacing: 0.5,
|
|
149
147
|
sx: {
|
|
148
|
+
alignItems: "center",
|
|
149
|
+
justifyContent: "flex-end",
|
|
150
150
|
flex: 1
|
|
151
151
|
},
|
|
152
152
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Avatar, {
|
|
@@ -184,9 +184,11 @@ function SupporterAvatar({
|
|
|
184
184
|
const customersNum = customers.length;
|
|
185
185
|
if (customersNum === 0) return null;
|
|
186
186
|
return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
187
|
+
sx: {
|
|
188
|
+
flexDirection: "row",
|
|
189
|
+
justifyContent: "center",
|
|
190
|
+
alignItems: "center"
|
|
191
|
+
},
|
|
190
192
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.AvatarGroup, {
|
|
191
193
|
max: 5,
|
|
192
194
|
sx: {
|
|
@@ -262,12 +264,14 @@ function SupporterTable({
|
|
|
262
264
|
const customersNum = customers.length;
|
|
263
265
|
if (customersNum === 0) return null;
|
|
264
266
|
return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
267
|
+
sx: {
|
|
268
|
+
display: "flex",
|
|
269
|
+
flexDirection: "column",
|
|
270
|
+
alignItems: "center",
|
|
271
|
+
gap: {
|
|
272
|
+
xs: 0.5,
|
|
273
|
+
sm: 1
|
|
274
|
+
}
|
|
271
275
|
},
|
|
272
276
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(SupporterAvatar, {
|
|
273
277
|
supporters,
|
|
@@ -294,16 +298,20 @@ function SupporterSimple({
|
|
|
294
298
|
const customers = (0, _uniqBy.default)(supporters, "customer_id");
|
|
295
299
|
const customersNum = customers.length;
|
|
296
300
|
return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
301
|
+
sx: {
|
|
302
|
+
display: "flex",
|
|
303
|
+
flexDirection: "column",
|
|
304
|
+
alignItems: "center",
|
|
305
|
+
gap: {
|
|
306
|
+
xs: 0.5,
|
|
307
|
+
sm: 1
|
|
308
|
+
}
|
|
303
309
|
},
|
|
304
310
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
305
311
|
component: "p",
|
|
306
|
-
|
|
312
|
+
sx: {
|
|
313
|
+
color: "text.secondary"
|
|
314
|
+
},
|
|
307
315
|
children: customersNum === 0 ? /* @__PURE__ */(0, _jsxRuntime.jsx)("span", {
|
|
308
316
|
style: emojiFont,
|
|
309
317
|
children: t("payment.checkout.donation.empty")
|
|
@@ -485,8 +493,10 @@ function CheckoutDonateInner({
|
|
|
485
493
|
onClick: handlePopoverOpen,
|
|
486
494
|
children: /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
487
495
|
direction: "row",
|
|
488
|
-
alignItems: "center",
|
|
489
496
|
spacing: 0.5,
|
|
497
|
+
sx: {
|
|
498
|
+
alignItems: "center"
|
|
499
|
+
},
|
|
490
500
|
children: [donateSettings.appearance.button.icon, typeof donateSettings.appearance.button.text === "string" ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
491
501
|
sx: {
|
|
492
502
|
whiteSpace: "nowrap"
|
|
@@ -527,17 +537,21 @@ function CheckoutDonateInner({
|
|
|
527
537
|
},
|
|
528
538
|
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.CircularProgress, {})
|
|
529
539
|
}), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
540
|
+
sx: {
|
|
541
|
+
display: "flex",
|
|
542
|
+
alignItems: "center",
|
|
543
|
+
flexDirection: "column",
|
|
544
|
+
gap: 2
|
|
545
|
+
},
|
|
534
546
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Button, {
|
|
535
547
|
...inlineOptions.button,
|
|
536
548
|
onClick: () => startDonate(),
|
|
537
549
|
children: /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
538
550
|
direction: "row",
|
|
539
|
-
alignItems: "center",
|
|
540
551
|
spacing: 0.5,
|
|
552
|
+
sx: {
|
|
553
|
+
alignItems: "center"
|
|
554
|
+
},
|
|
541
555
|
children: [inlineOptions?.button?.icon, typeof inlineText === "string" ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
542
556
|
sx: {
|
|
543
557
|
whiteSpace: "nowrap"
|
|
@@ -554,17 +568,17 @@ function CheckoutDonateInner({
|
|
|
554
568
|
});
|
|
555
569
|
const defaultRender = /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
556
570
|
sx: {
|
|
571
|
+
display: "flex",
|
|
572
|
+
flexDirection: "column",
|
|
573
|
+
alignItems: "center",
|
|
574
|
+
gap: {
|
|
575
|
+
xs: 1,
|
|
576
|
+
sm: 2
|
|
577
|
+
},
|
|
557
578
|
width: "100%",
|
|
558
579
|
minWidth: 300,
|
|
559
580
|
maxWidth: 720
|
|
560
581
|
},
|
|
561
|
-
display: "flex",
|
|
562
|
-
flexDirection: "column",
|
|
563
|
-
alignItems: "center",
|
|
564
|
-
gap: {
|
|
565
|
-
xs: 1,
|
|
566
|
-
sm: 2
|
|
567
|
-
},
|
|
568
582
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Button, {
|
|
569
583
|
size: donateSettings.appearance?.button?.size || "medium",
|
|
570
584
|
color: donateSettings.appearance?.button?.color || "primary",
|
|
@@ -581,8 +595,10 @@ function CheckoutDonateInner({
|
|
|
581
595
|
onClick: () => startDonate(),
|
|
582
596
|
children: /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
583
597
|
direction: "row",
|
|
584
|
-
alignItems: "center",
|
|
585
598
|
spacing: 0.5,
|
|
599
|
+
sx: {
|
|
600
|
+
alignItems: "center"
|
|
601
|
+
},
|
|
586
602
|
children: [donateSettings.appearance.button.icon && /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
587
603
|
sx: {
|
|
588
604
|
mr: 0.5,
|
|
@@ -622,9 +638,11 @@ function CheckoutDonateInner({
|
|
|
622
638
|
children: [renderInnerView(), donation.data && /* @__PURE__ */(0, _jsxRuntime.jsx)(_Dialog.default, {
|
|
623
639
|
open: state.open,
|
|
624
640
|
title: /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
641
|
+
sx: {
|
|
642
|
+
display: "flex",
|
|
643
|
+
alignItems: "center",
|
|
644
|
+
gap: 0.5
|
|
645
|
+
},
|
|
628
646
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
629
647
|
variant: "h3",
|
|
630
648
|
sx: {
|
|
@@ -658,10 +676,10 @@ function CheckoutDonateInner({
|
|
|
658
676
|
}),
|
|
659
677
|
maxWidth: "md",
|
|
660
678
|
toolbar: isMobile ? null : /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
661
|
-
display: "flex",
|
|
662
|
-
alignItems: "center",
|
|
663
|
-
gap: 1,
|
|
664
679
|
sx: {
|
|
680
|
+
display: "flex",
|
|
681
|
+
alignItems: "center",
|
|
682
|
+
gap: 1,
|
|
665
683
|
color: "text.secondary"
|
|
666
684
|
},
|
|
667
685
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.AvatarGroup, {
|
|
@@ -749,11 +767,25 @@ function CheckoutDonateInner({
|
|
|
749
767
|
})]
|
|
750
768
|
});
|
|
751
769
|
}
|
|
752
|
-
function CheckoutDonate(
|
|
770
|
+
function CheckoutDonate(rawProps) {
|
|
771
|
+
const props = Object.assign({
|
|
772
|
+
theme: "default",
|
|
773
|
+
livemode: void 0,
|
|
774
|
+
inlineOptions: {
|
|
775
|
+
button: {
|
|
776
|
+
text: "Tip"
|
|
777
|
+
}
|
|
778
|
+
},
|
|
779
|
+
timeout: 5e3,
|
|
780
|
+
mode: "default"
|
|
781
|
+
}, rawProps);
|
|
753
782
|
const {
|
|
754
783
|
livemode
|
|
755
784
|
} = (0, _payment.usePaymentContext)();
|
|
756
|
-
const content =
|
|
785
|
+
const content =
|
|
786
|
+
// eslint-disable-next-line react/prop-types
|
|
787
|
+
/* @__PURE__ */
|
|
788
|
+
(0, _jsxRuntime.jsx)(CheckoutDonateInner, {
|
|
757
789
|
...props,
|
|
758
790
|
livemode: props.livemode === void 0 ? livemode : props.livemode
|
|
759
791
|
});
|
|
@@ -769,15 +801,4 @@ function CheckoutDonate(props) {
|
|
|
769
801
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_theme.PaymentThemeProvider, {
|
|
770
802
|
children: content
|
|
771
803
|
});
|
|
772
|
-
}
|
|
773
|
-
CheckoutDonate.defaultProps = {
|
|
774
|
-
theme: "default",
|
|
775
|
-
livemode: void 0,
|
|
776
|
-
timeout: 5e3,
|
|
777
|
-
mode: "default",
|
|
778
|
-
inlineOptions: {
|
|
779
|
-
button: {
|
|
780
|
-
text: "Tip"
|
|
781
|
-
}
|
|
782
|
-
}
|
|
783
|
-
};
|
|
804
|
+
}
|
package/lib/checkout/form.d.ts
CHANGED
|
@@ -1,16 +1,2 @@
|
|
|
1
1
|
import type { CheckoutProps } from '../types';
|
|
2
|
-
|
|
3
|
-
declare namespace CheckoutForm {
|
|
4
|
-
var defaultProps: {
|
|
5
|
-
onPaid: any;
|
|
6
|
-
onError: {
|
|
7
|
-
(...data: any[]): void;
|
|
8
|
-
(message?: any, ...optionalParams: any[]): void;
|
|
9
|
-
};
|
|
10
|
-
mode: string;
|
|
11
|
-
action: string;
|
|
12
|
-
extraParams: {};
|
|
13
|
-
formType: string;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export default CheckoutForm;
|
|
2
|
+
export default function CheckoutForm({ id, mode, onPaid, onError, onChange, goBack, extraParams, action, theme, formType, ...restProps }: CheckoutProps): import("react").JSX.Element;
|