pay-sdk-react 1.1.13 → 1.2.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/README.md +465 -84
- package/README.zh-CN.md +466 -85
- package/dist/css/index.css +86 -6
- package/dist/css/index.min.css +1 -1
- package/dist/es/Airwallex/airwallex-button.js +48 -16
- package/dist/es/Airwallex/airwallex-checkout-button.d.ts +4 -0
- package/dist/es/Airwallex/airwallex-checkout-button.js +73 -0
- package/dist/es/Airwallex/airwallex-managed.d.ts +4 -0
- package/dist/es/Airwallex/airwallex-managed.js +87 -0
- package/dist/es/Airwallex/airwallex-modal.js +7 -3
- package/dist/es/Airwallex/airwallex-popup.js +7 -3
- package/dist/es/Airwallex/airwallex.d.ts +1 -3
- package/dist/es/Airwallex/airwallex.js +10 -1
- package/dist/es/Airwallex/hooks/useAirwallexCheckout.d.ts +7 -0
- package/dist/es/Airwallex/hooks/useAirwallexCheckout.js +155 -0
- package/dist/es/Airwallex/index.d.ts +4 -0
- package/dist/es/Airwallex/index.js +5 -1
- package/dist/es/Airwallex/interface.d.ts +146 -0
- package/dist/es/Airwallex/style/index.css +2 -2
- package/dist/es/Airwallex/style/index.min.css +1 -1
- package/dist/es/Alipay/alipay-button.js +26 -7
- package/dist/es/Alipay/alipay.js +39 -12
- package/dist/es/Alipay/interface.d.ts +26 -1
- package/dist/es/Alipay/style/index.css +2 -2
- package/dist/es/Alipay/style/index.min.css +1 -1
- package/dist/es/MAlipay/style/index.css +2 -2
- package/dist/es/MAlipay/style/index.min.css +1 -1
- package/dist/es/MPix/index.d.ts +2 -0
- package/dist/es/MPix/index.js +2 -0
- package/dist/es/MPix/interface.d.ts +44 -0
- package/dist/es/MPix/interface.js +1 -0
- package/dist/es/MPix/m-pix-button.d.ts +6 -0
- package/dist/es/MPix/m-pix-button.js +159 -0
- package/dist/es/MPix/style/index.css +256 -0
- package/dist/es/MPix/style/index.d.ts +1 -0
- package/dist/es/MPix/style/index.js +1 -0
- package/dist/es/MPix/style/index.min.css +1 -0
- package/dist/es/MWeChat/style/index.css +2 -2
- package/dist/es/MWeChat/style/index.min.css +1 -1
- package/dist/es/PayButton/index.js +12 -0
- package/dist/es/PayButton/interface.d.ts +28 -2
- package/dist/es/Paypal/index.d.ts +2 -0
- package/dist/es/Paypal/index.js +3 -1
- package/dist/es/Paypal/interface.d.ts +40 -0
- package/dist/es/Paypal/paypal-button.js +24 -3
- package/dist/es/Paypal/paypal-smart-button.d.ts +4 -0
- package/dist/es/Paypal/paypal-smart-button.js +48 -0
- package/dist/es/Payssion/interface.d.ts +7 -0
- package/dist/es/Payssion/payssion-button.js +25 -4
- package/dist/es/Pix/index.d.ts +11 -0
- package/dist/es/Pix/index.js +10 -0
- package/dist/es/Pix/interface.d.ts +147 -0
- package/dist/es/Pix/interface.js +1 -0
- package/dist/es/Pix/pix-button.d.ts +6 -0
- package/dist/es/Pix/pix-button.js +99 -0
- package/dist/es/Pix/pix-enhanced.d.ts +4 -0
- package/dist/es/Pix/pix-enhanced.js +182 -0
- package/dist/es/Pix/pix-modal.d.ts +6 -0
- package/dist/es/Pix/pix-modal.js +57 -0
- package/dist/es/Pix/pix.d.ts +4 -0
- package/dist/es/Pix/pix.js +125 -0
- package/dist/es/Pix/style/index.css +80 -0
- package/dist/es/Pix/style/index.d.ts +1 -0
- package/dist/es/Pix/style/index.js +1 -0
- package/dist/es/Pix/style/index.min.css +1 -0
- package/dist/es/Stripe/hooks/useStripeCheckout.d.ts +7 -0
- package/dist/es/Stripe/hooks/useStripeCheckout.js +86 -0
- package/dist/es/Stripe/index.d.ts +4 -0
- package/dist/es/Stripe/index.js +5 -1
- package/dist/es/Stripe/interface.d.ts +120 -0
- package/dist/es/Stripe/stripe-button.js +32 -10
- package/dist/es/Stripe/stripe-checkout-button.d.ts +4 -0
- package/dist/es/Stripe/stripe-checkout-button.js +70 -0
- package/dist/es/Stripe/stripe-modal.js +19 -2
- package/dist/es/Stripe/stripe-popup.js +13 -2
- package/dist/es/Stripe/stripe.js +38 -4
- package/dist/es/Stripe/style/index.css +2 -2
- package/dist/es/Stripe/style/index.min.css +1 -1
- package/dist/es/Wechat/interface.d.ts +13 -0
- package/dist/es/Wechat/style/index.css +2 -2
- package/dist/es/Wechat/style/index.min.css +1 -1
- package/dist/es/Wechat/wechat-button.js +26 -7
- package/dist/es/Wechat/wechat-content.d.ts +4 -0
- package/dist/es/Wechat/wechat-content.js +61 -0
- package/dist/es/Wechat/wechat.d.ts +1 -1
- package/dist/es/Wechat/wechat.js +5 -1
- package/dist/es/confirm-modal/style/index.css +2 -2
- package/dist/es/confirm-modal/style/index.min.css +1 -1
- package/dist/es/hooks/useLatestCallback.d.ts +1 -0
- package/dist/es/hooks/useLatestCallback.js +8 -0
- package/dist/es/hooks/useManagedOrder.d.ts +8 -0
- package/dist/es/hooks/useManagedOrder.js +67 -0
- package/dist/es/hooks/usePaymentExecution.d.ts +13 -0
- package/dist/es/hooks/usePaymentExecution.js +176 -0
- package/dist/es/hooks/usePaymentQr.d.ts +6 -0
- package/dist/es/hooks/usePaymentQr.js +52 -0
- package/dist/es/hooks/usePaymentRedirect.d.ts +5 -0
- package/dist/es/hooks/usePaymentRedirect.js +83 -0
- package/dist/es/icons/IconCheck/index.d.ts +4 -0
- package/dist/es/icons/IconCheck/index.js +22 -0
- package/dist/es/icons/IconCopy/index.d.ts +4 -0
- package/dist/es/icons/IconCopy/index.js +27 -0
- package/dist/es/icons/IconPix/index.d.ts +4 -0
- package/dist/es/icons/IconPix/index.js +33 -0
- package/dist/es/icons/index.d.ts +3 -0
- package/dist/es/icons/index.js +4 -1
- package/dist/es/index.d.ts +50 -6
- package/dist/es/index.js +28 -1
- package/dist/es/pay-modal/interface.d.ts +22 -2
- package/dist/es/pay-modal/pay-modal.js +36 -16
- package/dist/es/pay-modal/style/index.css +2 -2
- package/dist/es/pay-modal/style/index.min.css +1 -1
- package/dist/es/shared/entitys/payment.d.ts +227 -0
- package/dist/es/shared/entitys/payment.js +75 -0
- package/dist/es/shared/enums/index.d.ts +1 -78
- package/dist/es/shared/enums/index.js +1 -81
- package/dist/es/shared/enums/payment.d.ts +162 -0
- package/dist/es/shared/enums/payment.js +168 -0
- package/dist/es/shared/index.d.ts +2 -0
- package/dist/es/shared/index.js +2 -1
- package/dist/lib/Airwallex/airwallex-button.js +31 -10
- package/dist/lib/Airwallex/airwallex-checkout-button.js +52 -0
- package/dist/lib/Airwallex/airwallex-managed.js +86 -0
- package/dist/lib/Airwallex/airwallex-modal.js +4 -2
- package/dist/lib/Airwallex/airwallex-popup.js +4 -2
- package/dist/lib/Airwallex/airwallex.js +9 -1
- package/dist/lib/Airwallex/hooks/useAirwallexCheckout.js +83 -0
- package/dist/lib/Airwallex/index.js +18 -1
- package/dist/lib/Airwallex/style/index.css +2 -2
- package/dist/lib/Airwallex/style/index.min.css +1 -1
- package/dist/lib/Alipay/alipay-button.js +21 -6
- package/dist/lib/Alipay/alipay.js +36 -9
- package/dist/lib/Alipay/style/index.css +2 -2
- package/dist/lib/Alipay/style/index.min.css +1 -1
- package/dist/lib/MAlipay/style/index.css +2 -2
- package/dist/lib/MAlipay/style/index.min.css +1 -1
- package/dist/lib/MPix/index.js +28 -0
- package/dist/lib/MPix/interface.js +5 -0
- package/dist/lib/MPix/m-pix-button.js +127 -0
- package/dist/lib/MPix/style/index.css +256 -0
- package/dist/lib/MPix/style/index.js +3 -0
- package/dist/lib/MPix/style/index.min.css +1 -0
- package/dist/lib/MWeChat/style/index.css +2 -2
- package/dist/lib/MWeChat/style/index.min.css +1 -1
- package/dist/lib/PayButton/index.js +12 -0
- package/dist/lib/Paypal/index.js +17 -1
- package/dist/lib/Paypal/paypal-button.js +19 -2
- package/dist/lib/Paypal/paypal-smart-button.js +45 -0
- package/dist/lib/Payssion/payssion-button.js +20 -3
- package/dist/lib/Pix/index.js +43 -0
- package/dist/lib/Pix/interface.js +5 -0
- package/dist/lib/Pix/pix-button.js +83 -0
- package/dist/lib/Pix/pix-enhanced.js +143 -0
- package/dist/lib/Pix/pix-modal.js +50 -0
- package/dist/lib/Pix/pix.js +97 -0
- package/dist/lib/Pix/style/index.css +80 -0
- package/dist/lib/Pix/style/index.js +3 -0
- package/dist/lib/Pix/style/index.min.css +1 -0
- package/dist/lib/Stripe/hooks/useStripeCheckout.js +41 -0
- package/dist/lib/Stripe/index.js +18 -1
- package/dist/lib/Stripe/stripe-button.js +28 -10
- package/dist/lib/Stripe/stripe-checkout-button.js +50 -0
- package/dist/lib/Stripe/stripe-modal.js +12 -1
- package/dist/lib/Stripe/stripe-popup.js +12 -1
- package/dist/lib/Stripe/stripe.js +30 -1
- package/dist/lib/Stripe/style/index.css +2 -2
- package/dist/lib/Stripe/style/index.min.css +1 -1
- package/dist/lib/Wechat/style/index.css +2 -2
- package/dist/lib/Wechat/style/index.min.css +1 -1
- package/dist/lib/Wechat/wechat-button.js +21 -6
- package/dist/lib/Wechat/wechat-content.js +65 -0
- package/dist/lib/Wechat/wechat.js +3 -1
- package/dist/lib/confirm-modal/style/index.css +2 -2
- package/dist/lib/confirm-modal/style/index.min.css +1 -1
- package/dist/lib/hooks/useLatestCallback.js +13 -0
- package/dist/lib/hooks/useManagedOrder.js +29 -0
- package/dist/lib/hooks/usePaymentExecution.js +113 -0
- package/dist/lib/hooks/usePaymentQr.js +51 -0
- package/dist/lib/hooks/usePaymentRedirect.js +87 -0
- package/dist/lib/icons/IconCheck/index.js +27 -0
- package/dist/lib/icons/IconCopy/index.js +32 -0
- package/dist/lib/icons/IconPix/index.js +38 -0
- package/dist/lib/icons/index.js +25 -1
- package/dist/lib/index.js +86 -1
- package/dist/lib/pay-modal/pay-modal.js +33 -16
- package/dist/lib/pay-modal/style/index.css +2 -2
- package/dist/lib/pay-modal/style/index.min.css +1 -1
- package/dist/lib/shared/entitys/payment.js +61 -0
- package/dist/lib/shared/enums/index.js +11 -81
- package/dist/lib/shared/enums/payment.js +172 -0
- package/dist/lib/shared/index.js +12 -1
- package/dist/umd/pay-sdk-react.umd.js +10455 -11463
- package/dist/umd/pay-sdk-react.umd.js.map +1 -1
- package/package.json +44 -25
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
import { OpenPayUrlMode, PaymentErrorCode } from '../shared/enums';
|
|
5
|
+
import { PaymentExecutionError } from '../shared/entitys/payment';
|
|
6
|
+
import { useLatestCallback } from './useLatestCallback';
|
|
7
|
+
var nextWindowId = 0;
|
|
8
|
+
export var usePaymentRedirect = function usePaymentRedirect() {
|
|
9
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
10
|
+
var latest = useRef(options);
|
|
11
|
+
latest.current = options;
|
|
12
|
+
var owned = useRef(null);
|
|
13
|
+
var monitor = useRef();
|
|
14
|
+
var name = useRef();
|
|
15
|
+
var clearMonitor = function clearMonitor() {
|
|
16
|
+
if (monitor.current !== undefined) clearInterval(monitor.current);
|
|
17
|
+
monitor.current = undefined;
|
|
18
|
+
};
|
|
19
|
+
var close = useLatestCallback(function () {
|
|
20
|
+
var _owned$current;
|
|
21
|
+
clearMonitor();
|
|
22
|
+
(_owned$current = owned.current) === null || _owned$current === void 0 || _owned$current.close();
|
|
23
|
+
owned.current = null;
|
|
24
|
+
});
|
|
25
|
+
var open = useLatestCallback(function (rawUrl) {
|
|
26
|
+
var _latest$current$openM, _latest$current$onOpe, _latest$current2;
|
|
27
|
+
if (typeof window === 'undefined') throw new PaymentExecutionError(PaymentErrorCode.BrowserUnavailable, 'A browser is required.');
|
|
28
|
+
var url;
|
|
29
|
+
try {
|
|
30
|
+
url = new URL(rawUrl, window.location.href);
|
|
31
|
+
} catch (_unused) {
|
|
32
|
+
throw new PaymentExecutionError(PaymentErrorCode.InvalidParameters, 'Invalid payment URL.');
|
|
33
|
+
}
|
|
34
|
+
if (!(rawUrl !== null && rawUrl !== void 0 && rawUrl.trim()) || !['https:', 'http:'].includes(url.protocol)) {
|
|
35
|
+
throw new PaymentExecutionError(PaymentErrorCode.InvalidParameters, 'Payment URL must use HTTP or HTTPS.');
|
|
36
|
+
}
|
|
37
|
+
var mode = (_latest$current$openM = latest.current.openMode) !== null && _latest$current$openM !== void 0 ? _latest$current$openM : OpenPayUrlMode.Href;
|
|
38
|
+
if (mode === OpenPayUrlMode.Window) {
|
|
39
|
+
var _latest$current$windo;
|
|
40
|
+
close();
|
|
41
|
+
if (!name.current) name.current = "pay_sdk_".concat(++nextWindowId);
|
|
42
|
+
var child = window.open(url.href, (_latest$current$windo = latest.current.windowName) !== null && _latest$current$windo !== void 0 ? _latest$current$windo : name.current, latest.current.windowFeatures);
|
|
43
|
+
if (!child) throw new PaymentExecutionError(PaymentErrorCode.WindowBlocked, 'The payment window was blocked.');
|
|
44
|
+
owned.current = child;
|
|
45
|
+
monitor.current = setInterval(function () {
|
|
46
|
+
var _owned$current2;
|
|
47
|
+
if ((_owned$current2 = owned.current) !== null && _owned$current2 !== void 0 && _owned$current2.closed) {
|
|
48
|
+
var _latest$current$onWin, _latest$current;
|
|
49
|
+
clearMonitor();
|
|
50
|
+
owned.current = null;
|
|
51
|
+
(_latest$current$onWin = (_latest$current = latest.current).onWindowClose) === null || _latest$current$onWin === void 0 || _latest$current$onWin.call(_latest$current);
|
|
52
|
+
}
|
|
53
|
+
}, 500);
|
|
54
|
+
} else if (mode === OpenPayUrlMode.Replace) {
|
|
55
|
+
window.location.replace(url.href);
|
|
56
|
+
} else if (mode === OpenPayUrlMode.Href) {
|
|
57
|
+
window.location.assign(url.href);
|
|
58
|
+
} else {
|
|
59
|
+
throw new PaymentExecutionError(PaymentErrorCode.InvalidParameters, 'Unsupported opening mode.');
|
|
60
|
+
}
|
|
61
|
+
(_latest$current$onOpe = (_latest$current2 = latest.current).onOpen) === null || _latest$current$onOpe === void 0 || _latest$current$onOpe.call(_latest$current2, url.href);
|
|
62
|
+
});
|
|
63
|
+
useEffect(function () {
|
|
64
|
+
var onMessage = function onMessage(event) {
|
|
65
|
+
var _config$allowedMessag, _config$onMessage;
|
|
66
|
+
var config = latest.current;
|
|
67
|
+
if (!owned.current || event.source !== owned.current || !((_config$allowedMessag = config.allowedMessageOrigins) !== null && _config$allowedMessag !== void 0 && _config$allowedMessag.includes(event.origin)) || !config.messageValidator) return;
|
|
68
|
+
if (config.messageValidator(event)) (_config$onMessage = config.onMessage) === null || _config$onMessage === void 0 || _config$onMessage.call(config, event);
|
|
69
|
+
};
|
|
70
|
+
window.addEventListener('message', onMessage);
|
|
71
|
+
return function () {
|
|
72
|
+
var _owned$current3;
|
|
73
|
+
window.removeEventListener('message', onMessage);
|
|
74
|
+
clearMonitor();
|
|
75
|
+
if (latest.current.closeWindowOnUnmount !== false) (_owned$current3 = owned.current) === null || _owned$current3 === void 0 || _owned$current3.close();
|
|
76
|
+
owned.current = null;
|
|
77
|
+
};
|
|
78
|
+
}, []);
|
|
79
|
+
return {
|
|
80
|
+
open: open,
|
|
81
|
+
close: close
|
|
82
|
+
};
|
|
83
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import omit from '../../utils/omit';
|
|
4
|
+
import { getPrefixCls } from '../../utils/getPrefixCls';
|
|
5
|
+
var classPrefix = getPrefixCls('icon');
|
|
6
|
+
var IconCheck = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
7
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
8
|
+
ref: ref,
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
fill: "none",
|
|
11
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
12
|
+
stroke: "currentColor",
|
|
13
|
+
strokeWidth: "2",
|
|
14
|
+
strokeLinecap: "round",
|
|
15
|
+
strokeLinejoin: "round",
|
|
16
|
+
className: "".concat(classPrefix, " ").concat(classPrefix, "-check")
|
|
17
|
+
}, omit(props, ['className'])), /*#__PURE__*/React.createElement("path", {
|
|
18
|
+
d: "M5 13l4 4L19 7"
|
|
19
|
+
}));
|
|
20
|
+
});
|
|
21
|
+
IconCheck.displayName = 'IconCheck';
|
|
22
|
+
export default IconCheck;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import omit from '../../utils/omit';
|
|
4
|
+
import { getPrefixCls } from '../../utils/getPrefixCls';
|
|
5
|
+
var classPrefix = getPrefixCls('icon');
|
|
6
|
+
var IconCopy = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
7
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
8
|
+
ref: ref,
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
fill: "none",
|
|
11
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
12
|
+
stroke: "currentColor",
|
|
13
|
+
strokeWidth: "2",
|
|
14
|
+
className: "".concat(classPrefix, " ").concat(classPrefix, "-copy")
|
|
15
|
+
}, omit(props, ['className'])), /*#__PURE__*/React.createElement("rect", {
|
|
16
|
+
x: "9",
|
|
17
|
+
y: "9",
|
|
18
|
+
width: "13",
|
|
19
|
+
height: "13",
|
|
20
|
+
rx: "2"
|
|
21
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
22
|
+
d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1",
|
|
23
|
+
strokeLinecap: "round"
|
|
24
|
+
}));
|
|
25
|
+
});
|
|
26
|
+
IconCopy.displayName = 'IconCopy';
|
|
27
|
+
export default IconCopy;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import omit from '../../utils/omit';
|
|
4
|
+
import { getPrefixCls } from '../../utils/getPrefixCls';
|
|
5
|
+
var classPrefix = getPrefixCls('icon');
|
|
6
|
+
var IconPix = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
7
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
8
|
+
ref: ref,
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
width: "1em",
|
|
11
|
+
height: "1em",
|
|
12
|
+
fill: "currentColor",
|
|
13
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
+
className: "".concat(classPrefix, " ").concat(classPrefix, "-pix")
|
|
15
|
+
}, omit(props, ['className'])), /*#__PURE__*/React.createElement("path", {
|
|
16
|
+
d: "M18.5 4.87a8.5 8.5 0 0 1 0 14.26L13.23 23a1.5 1.5 0 0 1-2.46 0L5.5 19.13A8.5 8.5 0 0 1 5.5 4.87L10.77 1a1.5 1.5 0 0 1 2.46 0l5.27 3.87z",
|
|
17
|
+
fill: "#32BCAD"
|
|
18
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
19
|
+
d: "M13.23 1a1.5 1.5 0 0 0-2.46 0L5.5 4.87a8.5 8.5 0 0 0 0 14.26l5.27 3.87a1.5 1.5 0 0 0 2.46 0l5.27-3.87a8.5 8.5 0 0 0 0-14.26L13.23 1z",
|
|
20
|
+
fill: "none",
|
|
21
|
+
stroke: "#32BCAD",
|
|
22
|
+
strokeWidth: "0.5"
|
|
23
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
24
|
+
d: "M9.5 7.5h5l-5 9h5",
|
|
25
|
+
fill: "none",
|
|
26
|
+
stroke: "#fff",
|
|
27
|
+
strokeWidth: "1.8",
|
|
28
|
+
strokeLinecap: "round",
|
|
29
|
+
strokeLinejoin: "round"
|
|
30
|
+
}));
|
|
31
|
+
});
|
|
32
|
+
IconPix.displayName = 'IconPix';
|
|
33
|
+
export default IconPix;
|
package/dist/es/icons/index.d.ts
CHANGED
|
@@ -7,3 +7,6 @@ export { default as IconStripeText } from './IconStripeText';
|
|
|
7
7
|
export { default as IconAlipay } from './IconAlipay';
|
|
8
8
|
export { default as IconWechatPay } from './IconWechatPay';
|
|
9
9
|
export { default as IconPayssionPay } from './IconPayssionPay';
|
|
10
|
+
export { default as IconPix } from './IconPix';
|
|
11
|
+
export { default as IconCopy } from './IconCopy';
|
|
12
|
+
export { default as IconCheck } from './IconCheck';
|
package/dist/es/icons/index.js
CHANGED
|
@@ -6,4 +6,7 @@ export { default as IconStripe } from './IconStripe';
|
|
|
6
6
|
export { default as IconStripeText } from './IconStripeText';
|
|
7
7
|
export { default as IconAlipay } from './IconAlipay';
|
|
8
8
|
export { default as IconWechatPay } from './IconWechatPay';
|
|
9
|
-
export { default as IconPayssionPay } from './IconPayssionPay';
|
|
9
|
+
export { default as IconPayssionPay } from './IconPayssionPay';
|
|
10
|
+
export { default as IconPix } from './IconPix';
|
|
11
|
+
export { default as IconCopy } from './IconCopy';
|
|
12
|
+
export { default as IconCheck } from './IconCheck';
|
package/dist/es/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export type { PaypalButtonProps, PaypalButtonRef, CreateOrderPaypalFn, PaypalSec
|
|
|
3
3
|
export { PaypalButton } from './Paypal';
|
|
4
4
|
export type { BasesStripeProps, StripeProps, StripePopupProps, StripePopupRef, StripeButtonProps, StripeButtonRef, CreateOrderStripeFn, StripeModalRef, } from './Stripe/interface';
|
|
5
5
|
import { StripeButton, StripePopup, StripeModal } from './Stripe';
|
|
6
|
+
import { StripeCheckoutButton } from './Stripe';
|
|
6
7
|
declare const Stripe: import("react").NamedExoticComponent<Omit<import("./Stripe").BasesStripeProps & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
7
8
|
children?: import("react").ReactNode;
|
|
8
9
|
} & import("react").RefAttributes<HTMLElement>, "ref"> & {
|
|
@@ -12,6 +13,7 @@ declare const Stripe: import("react").NamedExoticComponent<Omit<import("./Stripe
|
|
|
12
13
|
children?: import("react").ReactNode;
|
|
13
14
|
} & import("react").RefAttributes<HTMLElement>>;
|
|
14
15
|
} & {
|
|
16
|
+
CheckoutButton: import("react").MemoExoticComponent<(props: import("./Stripe").StripeCheckoutButtonProps) => import("react/jsx-runtime").JSX.Element>;
|
|
15
17
|
Button: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Stripe").StripeButtonProps & {
|
|
16
18
|
children?: import("react").ReactNode;
|
|
17
19
|
} & import("react").RefAttributes<import("./Stripe").StripeButtonRef>>>;
|
|
@@ -22,6 +24,7 @@ declare const Stripe: import("react").NamedExoticComponent<Omit<import("./Stripe
|
|
|
22
24
|
children?: import("react").ReactNode;
|
|
23
25
|
} & import("react").RefAttributes<import("./Stripe").StripePopupRef>>>;
|
|
24
26
|
} & {
|
|
27
|
+
CheckoutButton: typeof StripeCheckoutButton;
|
|
25
28
|
Button: typeof StripeButton;
|
|
26
29
|
Popup: typeof StripePopup;
|
|
27
30
|
Modal: typeof StripeModal;
|
|
@@ -30,15 +33,13 @@ export { Stripe };
|
|
|
30
33
|
export { StripeButton, StripePopup, StripeModal };
|
|
31
34
|
export type { AirwallexProps, AirwallexPopupProps, AirwallexPopupRef, AirwallexButtonProps, AirwallexButtonRef, CreateOrderAirwallexEmbeddedFn, CreateOrderAirwallexRedirectFn, AirwallexModalProps, AirwallexModalRef, } from './Airwallex/interface';
|
|
32
35
|
import { AirwallexButton, AirwallexPopup, AirwallexModal } from './Airwallex';
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
} & import("react").RefAttributes<HTMLElement>, "ref"> & {
|
|
36
|
+
import { AirwallexCheckoutButton } from './Airwallex';
|
|
37
|
+
declare const Airwallex: import("react").NamedExoticComponent<Omit<import("./Airwallex").AirwallexProps & import("react").RefAttributes<HTMLElement>, "ref"> & {
|
|
36
38
|
ref?: import("react").RefObject<HTMLElement> | ((instance: HTMLElement | null) => void) | null | undefined;
|
|
37
39
|
}> & {
|
|
38
|
-
readonly type: import("react").ForwardRefExoticComponent<import("./Airwallex").AirwallexProps &
|
|
39
|
-
children?: import("react").ReactNode;
|
|
40
|
-
} & import("react").RefAttributes<HTMLElement>>;
|
|
40
|
+
readonly type: import("react").ForwardRefExoticComponent<import("./Airwallex").AirwallexProps & import("react").RefAttributes<HTMLElement>>;
|
|
41
41
|
} & {
|
|
42
|
+
CheckoutButton: import("react").MemoExoticComponent<(props: import("./Airwallex").AirwallexCheckoutButtonProps) => import("react/jsx-runtime").JSX.Element>;
|
|
42
43
|
Button: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("react").PropsWithChildren<import("./Airwallex").AirwallexButtonProps> & import("react").RefAttributes<import("./Airwallex").AirwallexButtonRef>>>;
|
|
43
44
|
Popup: import("react").ForwardRefExoticComponent<import("./Airwallex").AirwallexPopupProps & {
|
|
44
45
|
children?: import("react").ReactNode;
|
|
@@ -47,6 +48,7 @@ declare const Airwallex: import("react").NamedExoticComponent<Omit<import("./Air
|
|
|
47
48
|
children?: import("react").ReactNode;
|
|
48
49
|
} & import("react").RefAttributes<import("./Airwallex").AirwallexPopupRef>>;
|
|
49
50
|
} & {
|
|
51
|
+
CheckoutButton: typeof AirwallexCheckoutButton;
|
|
50
52
|
Button: typeof AirwallexButton;
|
|
51
53
|
Popup: typeof AirwallexPopup;
|
|
52
54
|
Modal: typeof AirwallexModal;
|
|
@@ -86,6 +88,8 @@ export { AlipayButton, AlipayModal };
|
|
|
86
88
|
export type { WechatProps, WechatModalProps, WechatButtonProps, WechatButtonRef, WechatModalRef, } from './Wechat/interface';
|
|
87
89
|
import { WechatButton, WechatModal } from './Wechat';
|
|
88
90
|
declare const Wechat: import("react").NamedExoticComponent<import("./Wechat").WechatProps> & {
|
|
91
|
+
readonly type: (props: import("./Wechat").WechatProps) => import("react/jsx-runtime").JSX.Element;
|
|
92
|
+
} & {
|
|
89
93
|
Button: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Wechat").WechatButtonProps & {
|
|
90
94
|
children?: import("react").ReactNode;
|
|
91
95
|
} & import("react").RefAttributes<import("./Wechat").WechatButtonRef>>>;
|
|
@@ -98,7 +102,47 @@ declare const Wechat: import("react").NamedExoticComponent<import("./Wechat").We
|
|
|
98
102
|
};
|
|
99
103
|
export { Wechat };
|
|
100
104
|
export { WechatButton, WechatModal };
|
|
105
|
+
export type { PixProps, PixButtonProps, PixButtonRef, CreateOrderPixFn, PixModalProps, PixModalRef, } from './Pix/interface';
|
|
106
|
+
import { PixButton, PixModal } from './Pix';
|
|
107
|
+
declare const Pix: import("react").NamedExoticComponent<import("./Pix").PixProps> & {
|
|
108
|
+
readonly type: (props: import("./Pix").PixProps) => import("react/jsx-runtime").JSX.Element;
|
|
109
|
+
} & {
|
|
110
|
+
Button: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Pix").PixButtonProps & {
|
|
111
|
+
children?: import("react").ReactNode;
|
|
112
|
+
} & import("react").RefAttributes<import("./Pix").PixButtonRef>>>;
|
|
113
|
+
Modal: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Pix").PixModalProps & {
|
|
114
|
+
children?: import("react").ReactNode;
|
|
115
|
+
} & import("react").RefAttributes<import("./Pix").PixModalRef>>>;
|
|
116
|
+
} & {
|
|
117
|
+
Button: typeof PixButton;
|
|
118
|
+
Modal: typeof PixModal;
|
|
119
|
+
};
|
|
120
|
+
export { Pix };
|
|
121
|
+
export { PixButton, PixModal };
|
|
122
|
+
export type { MPixButtonProps, MPixButtonRef, CreateOrderMPixFn, MPixFormData, } from './MPix/interface';
|
|
123
|
+
export { MPixButton } from './MPix';
|
|
101
124
|
export type { PayButtonProps, GenericPayButtonRef, } from './PayButton/interface';
|
|
102
125
|
import PayButton from './PayButton';
|
|
103
126
|
export { PayButton };
|
|
104
127
|
export * from './shared';
|
|
128
|
+
export { StripeCheckoutButton, useStripeCheckout } from './Stripe';
|
|
129
|
+
export type { UseStripeCheckoutOptions, UseStripeCheckoutReturn, StripeCheckoutButtonProps, StripeCheckoutTarget, } from './Stripe';
|
|
130
|
+
export { AirwallexCheckoutButton, useAirwallexCheckout } from './Airwallex';
|
|
131
|
+
export type { UseAirwallexCheckoutOptions, UseAirwallexCheckoutReturn, AirwallexCheckoutButtonProps, AirwallexCheckoutTarget, AirwallexHostedOptions, } from './Airwallex';
|
|
132
|
+
import { PaypalSmartButton, PaypalProvider } from './Paypal';
|
|
133
|
+
/**
|
|
134
|
+
* @zh PayPal 独立入口保留原 URL 按钮。
|
|
135
|
+
* @en PayPal namespace keeps the legacy URL button.
|
|
136
|
+
* @since 1.2.0
|
|
137
|
+
*/
|
|
138
|
+
export declare const Paypal: {
|
|
139
|
+
Button: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./Paypal").PaypalButtonProps & {
|
|
140
|
+
children?: import("react").ReactNode;
|
|
141
|
+
} & import("react").RefAttributes<import("./Paypal").PaypalButtonRef>>>;
|
|
142
|
+
SmartButton: import("react").MemoExoticComponent<({ scriptOptions, ...props }: import("./Paypal").PaypalSmartButtonProps) => import("react/jsx-runtime").JSX.Element>;
|
|
143
|
+
Provider: import("react").FC<import("@paypal/react-paypal-js").ScriptProviderProps>;
|
|
144
|
+
};
|
|
145
|
+
export { PaypalSmartButton, PaypalProvider };
|
|
146
|
+
export type { PaypalSmartButtonProps } from './Paypal';
|
|
147
|
+
export type { PayModalProps, PayModalSlot } from './pay-modal';
|
|
148
|
+
export type { StripeCheckoutEvents } from './Stripe';
|
package/dist/es/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export { PaypalButton } from './Paypal';
|
|
2
2
|
import StripeDefault from './Stripe';
|
|
3
3
|
import { StripeButton, StripePopup, StripeModal } from './Stripe';
|
|
4
|
+
import { StripeCheckoutButton } from './Stripe';
|
|
4
5
|
var Stripe = Object.assign({}, StripeDefault, {
|
|
6
|
+
CheckoutButton: StripeCheckoutButton,
|
|
5
7
|
Button: StripeButton,
|
|
6
8
|
Popup: StripePopup,
|
|
7
9
|
Modal: StripeModal
|
|
@@ -10,7 +12,9 @@ export { Stripe };
|
|
|
10
12
|
export { StripeButton, StripePopup, StripeModal };
|
|
11
13
|
import AirwallexDefault from './Airwallex';
|
|
12
14
|
import { AirwallexButton, AirwallexPopup, AirwallexModal } from './Airwallex';
|
|
15
|
+
import { AirwallexCheckoutButton } from './Airwallex';
|
|
13
16
|
var Airwallex = Object.assign({}, AirwallexDefault, {
|
|
17
|
+
CheckoutButton: AirwallexCheckoutButton,
|
|
14
18
|
Button: AirwallexButton,
|
|
15
19
|
Popup: AirwallexPopup,
|
|
16
20
|
Modal: AirwallexModal
|
|
@@ -42,6 +46,29 @@ var Wechat = Object.assign({}, WechatDefault, {
|
|
|
42
46
|
});
|
|
43
47
|
export { Wechat };
|
|
44
48
|
export { WechatButton, WechatModal };
|
|
49
|
+
import PixDefault from './Pix';
|
|
50
|
+
import { PixButton, PixModal } from './Pix';
|
|
51
|
+
var Pix = Object.assign({}, PixDefault, {
|
|
52
|
+
Button: PixButton,
|
|
53
|
+
Modal: PixModal
|
|
54
|
+
});
|
|
55
|
+
export { Pix };
|
|
56
|
+
export { PixButton, PixModal };
|
|
57
|
+
export { MPixButton } from './MPix';
|
|
45
58
|
import PayButton from './PayButton';
|
|
46
59
|
export { PayButton };
|
|
47
|
-
export * from './shared';
|
|
60
|
+
export * from './shared';
|
|
61
|
+
export { StripeCheckoutButton, useStripeCheckout } from './Stripe';
|
|
62
|
+
export { AirwallexCheckoutButton, useAirwallexCheckout } from './Airwallex';
|
|
63
|
+
import { PaypalButton as PaypalLegacyButton, PaypalSmartButton, PaypalProvider } from './Paypal';
|
|
64
|
+
/**
|
|
65
|
+
* @zh PayPal 独立入口保留原 URL 按钮。
|
|
66
|
+
* @en PayPal namespace keeps the legacy URL button.
|
|
67
|
+
* @since 1.2.0
|
|
68
|
+
*/
|
|
69
|
+
export var Paypal = {
|
|
70
|
+
Button: PaypalLegacyButton,
|
|
71
|
+
SmartButton: PaypalSmartButton,
|
|
72
|
+
Provider: PaypalProvider
|
|
73
|
+
};
|
|
74
|
+
export { PaypalSmartButton, PaypalProvider };
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
import type { PaymentAppearance } from '../shared/entitys/payment';
|
|
1
2
|
import React, { ReactNode } from 'react';
|
|
2
3
|
import { ButtonProps } from '../Button';
|
|
3
|
-
|
|
4
|
+
/**
|
|
5
|
+
* @zh 弹窗语义区域。
|
|
6
|
+
* @en Modal semantic slots.
|
|
7
|
+
* @since 1.2.0
|
|
8
|
+
*/
|
|
9
|
+
export type PayModalSlot = 'root' | 'mask' | 'content' | 'close' | 'icon' | 'title' | 'description' | 'body' | 'footer';
|
|
10
|
+
export interface PayModalProps extends PaymentAppearance<PayModalSlot> {
|
|
4
11
|
/**
|
|
5
12
|
* @zh 是否显示弹窗
|
|
6
13
|
* @en Whether to show the modal
|
|
@@ -14,8 +21,9 @@ export interface PayModalProps {
|
|
|
14
21
|
/**
|
|
15
22
|
* @zh 标题
|
|
16
23
|
* @en Title
|
|
24
|
+
* @remarks Unreleased:兼容扩展为 ReactNode / Compatibly expanded to ReactNode.
|
|
17
25
|
*/
|
|
18
|
-
title?:
|
|
26
|
+
title?: React.ReactNode;
|
|
19
27
|
/**
|
|
20
28
|
* @zh 描述
|
|
21
29
|
* @en Description
|
|
@@ -40,6 +48,18 @@ export interface PayModalProps {
|
|
|
40
48
|
* @zh 是否显示右上角关闭按钮,默认 true
|
|
41
49
|
*/
|
|
42
50
|
showClose?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* @zh 自定义关闭图标;未传保留原图标。
|
|
53
|
+
* @en Custom close icon; omitted keeps the original.
|
|
54
|
+
* @since 1.2.0
|
|
55
|
+
*/
|
|
56
|
+
closeIcon?: ReactNode;
|
|
57
|
+
/**
|
|
58
|
+
* @zh 关闭入口无障碍文案。
|
|
59
|
+
* @en Accessible close label.
|
|
60
|
+
* @since 1.2.0
|
|
61
|
+
*/
|
|
62
|
+
closeLabel?: string;
|
|
43
63
|
/**
|
|
44
64
|
* @zh 点击蒙层是否关闭弹窗,默认 false
|
|
45
65
|
* @en Whether to close the modal when clicking the mask, default is false
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
2
|
var _excluded = ["className", "children"],
|
|
2
3
|
_excluded2 = ["className", "children"];
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
3
9
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
10
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
5
11
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
@@ -30,7 +36,14 @@ var PayModal = function PayModal(props) {
|
|
|
30
36
|
style = props.style,
|
|
31
37
|
contentClassName = props.contentClassName,
|
|
32
38
|
contentStyle = props.contentStyle,
|
|
33
|
-
container = props.container
|
|
39
|
+
container = props.container,
|
|
40
|
+
_props$classNames = props.classNames,
|
|
41
|
+
slots = _props$classNames === void 0 ? {} : _props$classNames,
|
|
42
|
+
_props$styles = props.styles,
|
|
43
|
+
styles = _props$styles === void 0 ? {} : _props$styles,
|
|
44
|
+
closeIcon = props.closeIcon,
|
|
45
|
+
_props$closeLabel = props.closeLabel,
|
|
46
|
+
closeLabel = _props$closeLabel === void 0 ? '关闭' : _props$closeLabel;
|
|
34
47
|
var _ref = retryButtonProps || {},
|
|
35
48
|
retryButtonClassName = _ref.className,
|
|
36
49
|
_ref$children = _ref.children,
|
|
@@ -58,8 +71,8 @@ var PayModal = function PayModal(props) {
|
|
|
58
71
|
};
|
|
59
72
|
}
|
|
60
73
|
}, [visible, container]);
|
|
61
|
-
var classNames = cs(classPrefix, className);
|
|
62
|
-
var contentClassNames = cs("".concat(classPrefix, "__content"), contentClassName);
|
|
74
|
+
var classNames = cs(classPrefix, className, slots.root);
|
|
75
|
+
var contentClassNames = cs("".concat(classPrefix, "__content"), contentClassName, slots.content);
|
|
63
76
|
var handleMaskClose = useCallback(function () {
|
|
64
77
|
if (maskClosable) onClose === null || onClose === void 0 || onClose();
|
|
65
78
|
}, [maskClosable, onClose]);
|
|
@@ -73,31 +86,38 @@ var PayModal = function PayModal(props) {
|
|
|
73
86
|
}, finishButtonPropsRest), finishButtonChildren);
|
|
74
87
|
var footerContent = isFunction(footer) ? footer(retryButtonNode, finishButtonNode) : footer || /*#__PURE__*/React.createElement(React.Fragment, null, retryButtonNode, finishButtonNode);
|
|
75
88
|
return /*#__PURE__*/React.createElement("div", {
|
|
76
|
-
className: "".concat(classPrefix, "__actions")
|
|
89
|
+
className: cs("".concat(classPrefix, "__actions"), slots.footer),
|
|
90
|
+
style: styles.footer
|
|
77
91
|
}, footerContent);
|
|
78
92
|
};
|
|
79
93
|
if (!visible || !el.current) return null;
|
|
80
94
|
var modalContent = /*#__PURE__*/React.createElement("div", {
|
|
81
95
|
className: classNames,
|
|
82
|
-
style: style
|
|
96
|
+
style: _objectSpread(_objectSpread({}, style), styles.root)
|
|
83
97
|
}, /*#__PURE__*/React.createElement("div", {
|
|
84
|
-
className: "".concat(classPrefix, "__mask"),
|
|
98
|
+
className: cs("".concat(classPrefix, "__mask"), slots.mask),
|
|
99
|
+
style: styles.mask,
|
|
85
100
|
onClick: handleMaskClose
|
|
86
101
|
}), /*#__PURE__*/React.createElement("div", {
|
|
87
102
|
className: contentClassNames,
|
|
88
|
-
style: contentStyle
|
|
103
|
+
style: _objectSpread(_objectSpread({}, contentStyle), styles.content)
|
|
89
104
|
}, showClose && /*#__PURE__*/React.createElement("button", {
|
|
90
|
-
className: "".concat(classPrefix, "__close"),
|
|
105
|
+
className: cs("".concat(classPrefix, "__close"), slots.close),
|
|
106
|
+
style: styles.close,
|
|
91
107
|
onClick: onClose,
|
|
92
|
-
"aria-label":
|
|
93
|
-
},
|
|
94
|
-
className: "".concat(classPrefix, "__icon")
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
108
|
+
"aria-label": closeLabel
|
|
109
|
+
}, closeIcon === undefined ? '×' : closeIcon), icon && /*#__PURE__*/React.createElement("div", {
|
|
110
|
+
className: cs("".concat(classPrefix, "__icon"), slots.icon),
|
|
111
|
+
style: styles.icon
|
|
112
|
+
}, icon), title !== undefined && title !== null && title !== false && title !== '' ? /*#__PURE__*/React.createElement("div", {
|
|
113
|
+
className: cs("".concat(classPrefix, "__title"), slots.title),
|
|
114
|
+
style: styles.title
|
|
115
|
+
}, title) : null, desc && /*#__PURE__*/React.createElement("div", {
|
|
116
|
+
className: cs("".concat(classPrefix, "__desc"), slots.description),
|
|
117
|
+
style: styles.description
|
|
99
118
|
}, desc), children && /*#__PURE__*/React.createElement("div", {
|
|
100
|
-
className: "".concat(classPrefix, "__content-wrapper")
|
|
119
|
+
className: cs("".concat(classPrefix, "__content-wrapper"), slots.body),
|
|
120
|
+
style: styles.body
|
|
101
121
|
}, children), renderFooter()));
|
|
102
122
|
return /*#__PURE__*/ReactDOM.createPortal(modalContent, el.current);
|
|
103
123
|
};
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
max-width: 80vw;
|
|
29
29
|
box-shadow: 0 4px 24px #0001;
|
|
30
30
|
text-align: center;
|
|
31
|
-
max-height:
|
|
31
|
+
max-height: 80vh;
|
|
32
32
|
display: flex;
|
|
33
33
|
flex-direction: column;
|
|
34
34
|
}
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
z-index: 1;
|
|
69
69
|
text-align: center;
|
|
70
70
|
overflow-y: auto;
|
|
71
|
-
flex: 1;
|
|
71
|
+
flex: 0 1 auto;
|
|
72
72
|
min-height: 0;
|
|
73
73
|
}
|
|
74
74
|
.pay-modal__actions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.pay-modal{position:fixed;z-index:9999;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.pay-modal__mask{position:absolute;left:0;top:0;right:0;bottom:0;background:rgba(0,0,0,.55);z-index:0}.pay-modal__content{position:relative;z-index:1;background:#fff;border-radius:16px;padding:42px 20px 20px;min-width:280px;max-width:80vw;box-shadow:0 4px 24px #0001;text-align:center;max-height:
|
|
1
|
+
.pay-modal{position:fixed;z-index:9999;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.pay-modal__mask{position:absolute;left:0;top:0;right:0;bottom:0;background:rgba(0,0,0,.55);z-index:0}.pay-modal__content{position:relative;z-index:1;background:#fff;border-radius:16px;padding:42px 20px 20px;min-width:280px;max-width:80vw;box-shadow:0 4px 24px #0001;text-align:center;max-height:80vh;display:flex;flex-direction:column}.pay-modal__close{position:absolute;right:12px;top:12px;background:0 0;border:none;font-size:32px;font-weight:500;line-height:32px;cursor:pointer;text-align:left}.pay-modal__icon{display:flex;justify-content:center;margin-bottom:8px;font-size:40px}.pay-modal__title{font-size:20px;font-weight:700;color:#222;margin-bottom:12px}.pay-modal__desc{color:#222;font-size:15px;margin-bottom:24px;line-height:1.7;text-align:left}.pay-modal__content-wrapper{position:relative;z-index:1;text-align:center;overflow-y:auto;flex:0 1 auto;min-height:0}.pay-modal__actions{display:flex;justify-content:center;gap:16px;margin-top:16px}.pay-modal__btn{min-width:96px;padding:8px 0;border-radius:24px;border:none;font-size:15px;font-weight:600;cursor:pointer;transition:background .2s}.pay-modal__btn--retry{background:#fff;color:#f25a5a;border:1.5px solid #f25a5a}.pay-modal__btn--finish{background:#f25a5a;color:#fff;border:none}
|