@blocklet/payment-react 1.18.55 → 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/checkout/table.js
CHANGED
|
@@ -75,8 +75,8 @@ function CheckoutTableInner({ id, mode, onPaid, onError, onChange, extraParams,
|
|
|
75
75
|
Stack,
|
|
76
76
|
{
|
|
77
77
|
direction: "column",
|
|
78
|
-
alignItems: "center",
|
|
79
78
|
sx: {
|
|
79
|
+
alignItems: "center",
|
|
80
80
|
overflow: {
|
|
81
81
|
xs: "auto",
|
|
82
82
|
md: "hidden"
|
|
@@ -112,9 +112,9 @@ function CheckoutTableInner({ id, mode, onPaid, onError, onChange, extraParams,
|
|
|
112
112
|
/* @__PURE__ */ jsx(
|
|
113
113
|
Typography,
|
|
114
114
|
{
|
|
115
|
-
color: "text.primary",
|
|
116
|
-
fontWeight: 600,
|
|
117
115
|
sx: {
|
|
116
|
+
color: "text.primary",
|
|
117
|
+
fontWeight: 600,
|
|
118
118
|
lineHeight: "32px",
|
|
119
119
|
fontSize: "24px"
|
|
120
120
|
},
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import type { PaymentDetails, TPaymentMethod } from '@blocklet/payment-types';
|
|
2
|
-
|
|
2
|
+
export default function TxGas(props: {
|
|
3
3
|
details: PaymentDetails;
|
|
4
4
|
method: TPaymentMethod;
|
|
5
5
|
}): import("react").JSX.Element;
|
|
6
|
-
declare namespace TxGas {
|
|
7
|
-
var defaultProps: {};
|
|
8
|
-
}
|
|
9
|
-
export default TxGas;
|
|
@@ -4,7 +4,6 @@ import { Typography } from "@mui/material";
|
|
|
4
4
|
import { fromUnitToToken } from "@ocap/util";
|
|
5
5
|
import { usePaymentContext } from "../../contexts/payment.js";
|
|
6
6
|
import { getTxLink } from "../../libs/util.js";
|
|
7
|
-
TxGas.defaultProps = {};
|
|
8
7
|
export default function TxGas(props) {
|
|
9
8
|
const { t } = useLocaleContext();
|
|
10
9
|
const { settings } = usePaymentContext();
|
|
@@ -21,5 +20,14 @@ export default function TxGas(props) {
|
|
|
21
20
|
")"
|
|
22
21
|
] });
|
|
23
22
|
}
|
|
24
|
-
return /* @__PURE__ */ jsx(
|
|
23
|
+
return /* @__PURE__ */ jsx(
|
|
24
|
+
Typography,
|
|
25
|
+
{
|
|
26
|
+
component: "small",
|
|
27
|
+
sx: {
|
|
28
|
+
color: "text.secondary"
|
|
29
|
+
},
|
|
30
|
+
children: t("common.none")
|
|
31
|
+
}
|
|
32
|
+
);
|
|
25
33
|
}
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import type { PaymentDetails, TPaymentMethod } from '@blocklet/payment-types';
|
|
2
|
-
|
|
2
|
+
export default function TxLink(rawProps: {
|
|
3
3
|
details: PaymentDetails;
|
|
4
4
|
method: TPaymentMethod;
|
|
5
5
|
mode?: 'customer' | 'dashboard';
|
|
6
6
|
align?: 'left' | 'right';
|
|
7
7
|
}): import("react").JSX.Element;
|
|
8
|
-
declare namespace TxLink {
|
|
9
|
-
var defaultProps: {
|
|
10
|
-
mode: string;
|
|
11
|
-
align: string;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export default TxLink;
|
|
@@ -4,14 +4,26 @@ import { OpenInNewOutlined } from "@mui/icons-material";
|
|
|
4
4
|
import { Link, Stack, Typography } from "@mui/material";
|
|
5
5
|
import { styled } from "@mui/system";
|
|
6
6
|
import { getTxLink } from "../../libs/util.js";
|
|
7
|
-
TxLink
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
export default function TxLink(rawProps) {
|
|
8
|
+
const props = Object.assign(
|
|
9
|
+
{
|
|
10
|
+
mode: "dashboard",
|
|
11
|
+
align: "left"
|
|
12
|
+
},
|
|
13
|
+
rawProps
|
|
14
|
+
);
|
|
12
15
|
const { t } = useLocaleContext();
|
|
13
16
|
if (!props.details || props.mode === "customer" && props.method.type === "stripe") {
|
|
14
|
-
return /* @__PURE__ */ jsx(
|
|
17
|
+
return /* @__PURE__ */ jsx(
|
|
18
|
+
Typography,
|
|
19
|
+
{
|
|
20
|
+
component: "small",
|
|
21
|
+
sx: {
|
|
22
|
+
color: "text.secondary"
|
|
23
|
+
},
|
|
24
|
+
children: t("common.none")
|
|
25
|
+
}
|
|
26
|
+
);
|
|
15
27
|
}
|
|
16
28
|
const { text, link } = getTxLink(props.method, props.details);
|
|
17
29
|
if (link && text) {
|
|
@@ -30,7 +42,16 @@ export default function TxLink(props) {
|
|
|
30
42
|
}
|
|
31
43
|
) });
|
|
32
44
|
}
|
|
33
|
-
return /* @__PURE__ */ jsx(
|
|
45
|
+
return /* @__PURE__ */ jsx(
|
|
46
|
+
Typography,
|
|
47
|
+
{
|
|
48
|
+
component: "small",
|
|
49
|
+
sx: {
|
|
50
|
+
color: "text.secondary"
|
|
51
|
+
},
|
|
52
|
+
children: t("common.none")
|
|
53
|
+
}
|
|
54
|
+
);
|
|
34
55
|
}
|
|
35
56
|
const Root = styled(Stack)`
|
|
36
57
|
@media (max-width: 600px) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EventHandler } from 'react';
|
|
2
|
-
|
|
2
|
+
export default function ConfirmDialog({ onConfirm, onCancel, title, message, confirm, color, cancel, loading, }: {
|
|
3
3
|
onConfirm: EventHandler<any>;
|
|
4
4
|
onCancel: EventHandler<any>;
|
|
5
5
|
title: string | React.ReactNode;
|
|
@@ -9,12 +9,3 @@ declare function ConfirmDialog({ onConfirm, onCancel, title, message, confirm, c
|
|
|
9
9
|
cancel?: boolean | string | React.ReactNode;
|
|
10
10
|
loading?: boolean;
|
|
11
11
|
}): import("react").JSX.Element;
|
|
12
|
-
declare namespace ConfirmDialog {
|
|
13
|
-
var defaultProps: {
|
|
14
|
-
loading: boolean;
|
|
15
|
-
confirm: string;
|
|
16
|
-
cancel: string;
|
|
17
|
-
color: string;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
export default ConfirmDialog;
|
package/es/components/confirm.js
CHANGED
|
@@ -7,10 +7,10 @@ export default function ConfirmDialog({
|
|
|
7
7
|
onCancel,
|
|
8
8
|
title,
|
|
9
9
|
message,
|
|
10
|
-
confirm,
|
|
11
|
-
color,
|
|
12
|
-
cancel,
|
|
13
|
-
loading
|
|
10
|
+
confirm = "",
|
|
11
|
+
color = "error",
|
|
12
|
+
cancel = "",
|
|
13
|
+
loading = false
|
|
14
14
|
}) {
|
|
15
15
|
const { t } = useLocaleContext();
|
|
16
16
|
return /* @__PURE__ */ jsx(
|
|
@@ -30,9 +30,3 @@ export default function ConfirmDialog({
|
|
|
30
30
|
}
|
|
31
31
|
);
|
|
32
32
|
}
|
|
33
|
-
ConfirmDialog.defaultProps = {
|
|
34
|
-
loading: false,
|
|
35
|
-
confirm: "",
|
|
36
|
-
cancel: "",
|
|
37
|
-
color: "error"
|
|
38
|
-
};
|
|
@@ -7,5 +7,6 @@ export type CountrySelectProps = {
|
|
|
7
7
|
sx?: SxProps;
|
|
8
8
|
showDialCode?: boolean;
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
export default function CountrySelect({ ref, value, onChange, name, sx, showDialCode, }: CountrySelectProps & {
|
|
11
|
+
ref?: React.RefObject<HTMLDivElement>;
|
|
12
|
+
}): import("react").JSX.Element;
|