@blocklet/payment-react 1.14.23 → 1.14.24
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.js +26 -3
- package/es/payment/product-donation.js +24 -14
- package/es/payment/summary.js +1 -1
- package/lib/checkout/donate.js +19 -4
- package/lib/payment/product-donation.js +3 -2
- package/lib/payment/summary.js +1 -1
- package/package.json +3 -3
- package/src/checkout/donate.tsx +25 -2
- package/src/payment/product-donation.tsx +7 -2
- package/src/payment/summary.tsx +1 -1
package/es/checkout/donate.js
CHANGED
|
@@ -211,7 +211,16 @@ function useDonation(settings, livemode = true, mode = "default") {
|
|
|
211
211
|
setState
|
|
212
212
|
};
|
|
213
213
|
}
|
|
214
|
-
function CheckoutDonateInner({
|
|
214
|
+
function CheckoutDonateInner({
|
|
215
|
+
settings,
|
|
216
|
+
livemode,
|
|
217
|
+
timeout,
|
|
218
|
+
onPaid,
|
|
219
|
+
onError,
|
|
220
|
+
mode,
|
|
221
|
+
inlineOptions = {},
|
|
222
|
+
theme
|
|
223
|
+
}) {
|
|
215
224
|
const { state, setState, donation, supporters } = useDonation(settings, livemode, mode);
|
|
216
225
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
217
226
|
const [popoverOpen, setPopoverOpen] = useState(false);
|
|
@@ -340,15 +349,29 @@ function CheckoutDonateInner({ settings, livemode, timeout, onPaid, onError, mod
|
|
|
340
349
|
maxWidth: "md",
|
|
341
350
|
showCloseButton: true,
|
|
342
351
|
disableEscapeKeyDown: true,
|
|
352
|
+
sx: {
|
|
353
|
+
".MuiDialogContent-root": {
|
|
354
|
+
padding: {
|
|
355
|
+
xs: 0,
|
|
356
|
+
md: "0 16px 0"
|
|
357
|
+
},
|
|
358
|
+
borderTop: "1px solid var(--stroke-border-base, #EFF1F5)",
|
|
359
|
+
width: {
|
|
360
|
+
xs: "100%",
|
|
361
|
+
md: 900
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
},
|
|
343
365
|
onClose: (e, reason) => setState({ open: reason === "backdropClick" }),
|
|
344
|
-
children: /* @__PURE__ */ jsx(Box, { sx: {
|
|
366
|
+
children: /* @__PURE__ */ jsx(Box, { sx: { height: "100%", width: "100%" }, children: /* @__PURE__ */ jsx(
|
|
345
367
|
CheckoutForm,
|
|
346
368
|
{
|
|
347
369
|
id: donation.data?.id,
|
|
348
370
|
onPaid: handlePaid,
|
|
349
371
|
onError,
|
|
350
372
|
action: settings.appearance?.button?.text,
|
|
351
|
-
mode: "inline"
|
|
373
|
+
mode: "inline",
|
|
374
|
+
theme
|
|
352
375
|
}
|
|
353
376
|
) })
|
|
354
377
|
}
|
|
@@ -79,20 +79,30 @@ export default function ProductDonation({
|
|
|
79
79
|
textAlign: "center",
|
|
80
80
|
...state.selected === amount && !state.custom ? { borderColor: "primary.main" } : {}
|
|
81
81
|
},
|
|
82
|
-
children: /* @__PURE__ */ jsx(CardActionArea, { onClick: () => handleSelect(amount), children: /* @__PURE__ */ jsxs(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
82
|
+
children: /* @__PURE__ */ jsx(CardActionArea, { onClick: () => handleSelect(amount), children: /* @__PURE__ */ jsxs(
|
|
83
|
+
Stack,
|
|
84
|
+
{
|
|
85
|
+
direction: "row",
|
|
86
|
+
sx: { py: 1, px: 0.5 },
|
|
87
|
+
spacing: 0.5,
|
|
88
|
+
alignItems: "flex-end",
|
|
89
|
+
justifyContent: "center",
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ jsx(
|
|
92
|
+
Typography,
|
|
93
|
+
{
|
|
94
|
+
component: "strong",
|
|
95
|
+
lineHeight: 1,
|
|
96
|
+
variant: "h3",
|
|
97
|
+
sx: { fontVariantNumeric: "tabular-nums", fontWeight: 400 },
|
|
98
|
+
children: amount
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
/* @__PURE__ */ jsx(Typography, { component: "small", lineHeight: 1, fontSize: 12, children: "ABT" }),
|
|
102
|
+
" "
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
) })
|
|
96
106
|
},
|
|
97
107
|
amount
|
|
98
108
|
)) }),
|
package/es/payment/summary.js
CHANGED
|
@@ -251,7 +251,7 @@ export default function PaymentSummary({
|
|
|
251
251
|
),
|
|
252
252
|
!settings.livemode && /* @__PURE__ */ jsx(Livemode, {})
|
|
253
253
|
] }),
|
|
254
|
-
isMobile ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
254
|
+
isMobile && !donationSettings ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
255
255
|
/* @__PURE__ */ jsxs(
|
|
256
256
|
Stack,
|
|
257
257
|
{
|
package/lib/checkout/donate.js
CHANGED
|
@@ -293,7 +293,8 @@ function CheckoutDonateInner({
|
|
|
293
293
|
onPaid,
|
|
294
294
|
onError,
|
|
295
295
|
mode,
|
|
296
|
-
inlineOptions = {}
|
|
296
|
+
inlineOptions = {},
|
|
297
|
+
theme
|
|
297
298
|
}) {
|
|
298
299
|
const {
|
|
299
300
|
state,
|
|
@@ -446,20 +447,34 @@ function CheckoutDonateInner({
|
|
|
446
447
|
maxWidth: "md",
|
|
447
448
|
showCloseButton: true,
|
|
448
449
|
disableEscapeKeyDown: true,
|
|
450
|
+
sx: {
|
|
451
|
+
".MuiDialogContent-root": {
|
|
452
|
+
padding: {
|
|
453
|
+
xs: 0,
|
|
454
|
+
md: "0 16px 0"
|
|
455
|
+
},
|
|
456
|
+
borderTop: "1px solid var(--stroke-border-base, #EFF1F5)",
|
|
457
|
+
width: {
|
|
458
|
+
xs: "100%",
|
|
459
|
+
md: 900
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
},
|
|
449
463
|
onClose: (e, reason) => setState({
|
|
450
464
|
open: reason === "backdropClick"
|
|
451
465
|
}),
|
|
452
466
|
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
|
|
453
467
|
sx: {
|
|
454
|
-
|
|
455
|
-
|
|
468
|
+
height: "100%",
|
|
469
|
+
width: "100%"
|
|
456
470
|
},
|
|
457
471
|
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_form.default, {
|
|
458
472
|
id: donation.data?.id,
|
|
459
473
|
onPaid: handlePaid,
|
|
460
474
|
onError,
|
|
461
475
|
action: settings.appearance?.button?.text,
|
|
462
|
-
mode: "inline"
|
|
476
|
+
mode: "inline",
|
|
477
|
+
theme
|
|
463
478
|
})
|
|
464
479
|
})
|
|
465
480
|
})]
|
|
@@ -151,7 +151,8 @@ function ProductDonation({
|
|
|
151
151
|
children: /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
152
152
|
direction: "row",
|
|
153
153
|
sx: {
|
|
154
|
-
py: 1
|
|
154
|
+
py: 1,
|
|
155
|
+
px: 0.5
|
|
155
156
|
},
|
|
156
157
|
spacing: 0.5,
|
|
157
158
|
alignItems: "flex-end",
|
|
@@ -159,7 +160,7 @@ function ProductDonation({
|
|
|
159
160
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
160
161
|
component: "strong",
|
|
161
162
|
lineHeight: 1,
|
|
162
|
-
variant: "
|
|
163
|
+
variant: "h3",
|
|
163
164
|
sx: {
|
|
164
165
|
fontVariantNumeric: "tabular-nums",
|
|
165
166
|
fontWeight: 400
|
package/lib/payment/summary.js
CHANGED
|
@@ -289,7 +289,7 @@ function PaymentSummary({
|
|
|
289
289
|
},
|
|
290
290
|
children: action || t("payment.checkout.orderSummary")
|
|
291
291
|
}), !settings.livemode && /* @__PURE__ */(0, _jsxRuntime.jsx)(_livemode.default, {})]
|
|
292
|
-
}), isMobile ? /* @__PURE__ */(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
292
|
+
}), isMobile && !donationSettings ? /* @__PURE__ */(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
293
293
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
294
294
|
justifyContent: "space-between",
|
|
295
295
|
flexDirection: "row",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/payment-react",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.24",
|
|
4
4
|
"description": "Reusable react components for payment kit v2",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"@babel/core": "^7.25.2",
|
|
94
94
|
"@babel/preset-env": "^7.25.2",
|
|
95
95
|
"@babel/preset-react": "^7.24.7",
|
|
96
|
-
"@blocklet/payment-types": "1.14.
|
|
96
|
+
"@blocklet/payment-types": "1.14.24",
|
|
97
97
|
"@storybook/addon-essentials": "^7.6.20",
|
|
98
98
|
"@storybook/addon-interactions": "^7.6.20",
|
|
99
99
|
"@storybook/addon-links": "^7.6.20",
|
|
@@ -123,5 +123,5 @@
|
|
|
123
123
|
"vite-plugin-babel": "^1.2.0",
|
|
124
124
|
"vite-plugin-node-polyfills": "^0.21.0"
|
|
125
125
|
},
|
|
126
|
-
"gitHead": "
|
|
126
|
+
"gitHead": "34ddc3ea5d4e166304a4966a926bfc35796193b1"
|
|
127
127
|
}
|
package/src/checkout/donate.tsx
CHANGED
|
@@ -301,7 +301,16 @@ function useDonation(settings: DonationSettings, livemode: boolean = true, mode
|
|
|
301
301
|
};
|
|
302
302
|
}
|
|
303
303
|
|
|
304
|
-
function CheckoutDonateInner({
|
|
304
|
+
function CheckoutDonateInner({
|
|
305
|
+
settings,
|
|
306
|
+
livemode,
|
|
307
|
+
timeout,
|
|
308
|
+
onPaid,
|
|
309
|
+
onError,
|
|
310
|
+
mode,
|
|
311
|
+
inlineOptions = {},
|
|
312
|
+
theme,
|
|
313
|
+
}: DonateProps) {
|
|
305
314
|
// eslint-disable-line
|
|
306
315
|
const { state, setState, donation, supporters } = useDonation(settings, livemode, mode);
|
|
307
316
|
|
|
@@ -442,14 +451,28 @@ function CheckoutDonateInner({ settings, livemode, timeout, onPaid, onError, mod
|
|
|
442
451
|
maxWidth="md"
|
|
443
452
|
showCloseButton
|
|
444
453
|
disableEscapeKeyDown
|
|
454
|
+
sx={{
|
|
455
|
+
'.MuiDialogContent-root': {
|
|
456
|
+
padding: {
|
|
457
|
+
xs: 0,
|
|
458
|
+
md: '0 16px 0',
|
|
459
|
+
},
|
|
460
|
+
borderTop: '1px solid var(--stroke-border-base, #EFF1F5)',
|
|
461
|
+
width: {
|
|
462
|
+
xs: '100%',
|
|
463
|
+
md: 900,
|
|
464
|
+
},
|
|
465
|
+
},
|
|
466
|
+
}}
|
|
445
467
|
onClose={(e: any, reason: string) => setState({ open: reason === 'backdropClick' })}>
|
|
446
|
-
<Box sx={{
|
|
468
|
+
<Box sx={{ height: '100%', width: '100%' }}>
|
|
447
469
|
<CheckoutForm
|
|
448
470
|
id={donation.data?.id}
|
|
449
471
|
onPaid={handlePaid}
|
|
450
472
|
onError={onError}
|
|
451
473
|
action={settings.appearance?.button?.text}
|
|
452
474
|
mode="inline"
|
|
475
|
+
theme={theme}
|
|
453
476
|
/>
|
|
454
477
|
</Box>
|
|
455
478
|
</Dialog>
|
|
@@ -99,11 +99,16 @@ export default function ProductDonation({
|
|
|
99
99
|
...(state.selected === amount && !state.custom ? { borderColor: 'primary.main' } : {}),
|
|
100
100
|
}}>
|
|
101
101
|
<CardActionArea onClick={() => handleSelect(amount)}>
|
|
102
|
-
<Stack
|
|
102
|
+
<Stack
|
|
103
|
+
direction="row"
|
|
104
|
+
sx={{ py: 1, px: 0.5 }}
|
|
105
|
+
spacing={0.5}
|
|
106
|
+
alignItems="flex-end"
|
|
107
|
+
justifyContent="center">
|
|
103
108
|
<Typography
|
|
104
109
|
component="strong"
|
|
105
110
|
lineHeight={1}
|
|
106
|
-
variant="
|
|
111
|
+
variant="h3"
|
|
107
112
|
sx={{ fontVariantNumeric: 'tabular-nums', fontWeight: 400 }}>
|
|
108
113
|
{amount}
|
|
109
114
|
</Typography>
|
package/src/payment/summary.tsx
CHANGED