@blocklet/payment-react 1.18.7 → 1.18.8
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 -0
- package/es/checkout/donate.js +188 -89
- package/es/components/livemode.js +1 -1
- package/es/components/table.js +1 -1
- package/es/libs/util.d.ts +1 -0
- package/es/libs/util.js +10 -1
- package/es/payment/amount.js +1 -1
- package/es/payment/form/index.js +1 -1
- package/es/payment/form/stripe/form.js +1 -1
- package/es/payment/product-card.js +2 -2
- package/es/payment/product-item.js +1 -1
- package/es/payment/product-skeleton.js +2 -2
- package/es/payment/skeleton/donation.js +1 -1
- package/es/payment/skeleton/overview.js +1 -1
- package/es/payment/skeleton/payment.js +1 -1
- package/es/payment/summary.js +1 -1
- package/es/theme/index.js +3 -2
- package/es/theme/typography.js +8 -8
- package/lib/checkout/donate.d.ts +1 -0
- package/lib/checkout/donate.js +193 -129
- package/lib/components/livemode.js +1 -1
- package/lib/components/table.js +1 -1
- package/lib/libs/util.d.ts +1 -0
- package/lib/libs/util.js +7 -0
- package/lib/payment/amount.js +1 -1
- package/lib/payment/form/index.js +2 -2
- package/lib/payment/form/stripe/form.js +1 -1
- package/lib/payment/product-card.js +2 -2
- package/lib/payment/product-item.js +1 -1
- package/lib/payment/product-skeleton.js +2 -2
- package/lib/payment/skeleton/donation.js +1 -1
- package/lib/payment/skeleton/overview.js +1 -1
- package/lib/payment/skeleton/payment.js +1 -1
- package/lib/payment/summary.js +1 -1
- package/lib/theme/index.js +3 -2
- package/lib/theme/typography.js +8 -8
- package/package.json +8 -8
- package/src/checkout/donate.tsx +176 -112
- package/src/components/livemode.tsx +1 -1
- package/src/components/table.tsx +1 -1
- package/src/libs/util.ts +11 -1
- package/src/payment/amount.tsx +1 -1
- package/src/payment/form/index.tsx +1 -1
- package/src/payment/form/stripe/form.tsx +1 -1
- package/src/payment/product-card.tsx +2 -2
- package/src/payment/product-item.tsx +1 -1
- package/src/payment/product-skeleton.tsx +2 -2
- package/src/payment/skeleton/donation.tsx +1 -1
- package/src/payment/skeleton/overview.tsx +1 -1
- package/src/payment/skeleton/payment.tsx +1 -1
- package/src/payment/summary.tsx +1 -1
- package/src/theme/index.tsx +2 -1
- package/src/theme/typography.ts +8 -8
package/lib/checkout/donate.js
CHANGED
|
@@ -13,7 +13,6 @@ var _omit = _interopRequireDefault(require("lodash/omit"));
|
|
|
13
13
|
var _unionBy = _interopRequireDefault(require("lodash/unionBy"));
|
|
14
14
|
var _react = require("react");
|
|
15
15
|
var _iconsMaterial = require("@mui/icons-material");
|
|
16
|
-
var _tx = _interopRequireDefault(require("../components/blockchain/tx"));
|
|
17
16
|
var _api = _interopRequireDefault(require("../libs/api"));
|
|
18
17
|
var _util = require("../libs/util");
|
|
19
18
|
var _form = _interopRequireDefault(require("./form"));
|
|
@@ -54,55 +53,176 @@ const fetchSupporters = (target, livemode = true) => {
|
|
|
54
53
|
const emojiFont = {
|
|
55
54
|
fontFamily: 'Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
|
|
56
55
|
};
|
|
57
|
-
function
|
|
56
|
+
function DonateDetails({
|
|
58
57
|
supporters = [],
|
|
59
|
-
totalAmount = "0",
|
|
60
58
|
currency,
|
|
61
59
|
method
|
|
62
60
|
}) {
|
|
63
61
|
const {
|
|
64
|
-
|
|
62
|
+
locale
|
|
65
63
|
} = (0, _context.useLocaleContext)();
|
|
64
|
+
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Stack, {
|
|
65
|
+
sx: {
|
|
66
|
+
width: "100%",
|
|
67
|
+
minWidth: "256px",
|
|
68
|
+
maxWidth: "calc(100vw - 32px)",
|
|
69
|
+
maxHeight: "300px",
|
|
70
|
+
overflowX: "hidden",
|
|
71
|
+
overflowY: "auto",
|
|
72
|
+
margin: "0 auto"
|
|
73
|
+
},
|
|
74
|
+
children: supporters.map(x => /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
75
|
+
sx: {
|
|
76
|
+
padding: "6px",
|
|
77
|
+
"&:hover": {
|
|
78
|
+
backgroundColor: "var(--backgrounds-bg-highlight, #eff6ff)",
|
|
79
|
+
transition: "background-color 200ms linear",
|
|
80
|
+
cursor: "pointer"
|
|
81
|
+
},
|
|
82
|
+
borderBottom: "1px solid var(--stroke-border-base, #EFF1F5)",
|
|
83
|
+
display: "flex",
|
|
84
|
+
justifyContent: "space-between",
|
|
85
|
+
alignItems: "center"
|
|
86
|
+
},
|
|
87
|
+
onClick: () => {
|
|
88
|
+
const {
|
|
89
|
+
link,
|
|
90
|
+
text
|
|
91
|
+
} = (0, _util.getTxLink)(method, x.payment_details);
|
|
92
|
+
if (link && text) {
|
|
93
|
+
window.open(link, "_blank");
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
children: [/* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
97
|
+
direction: "row",
|
|
98
|
+
alignItems: "center",
|
|
99
|
+
spacing: 0.5,
|
|
100
|
+
sx: {
|
|
101
|
+
flex: 3,
|
|
102
|
+
overflow: "hidden"
|
|
103
|
+
},
|
|
104
|
+
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Avatar, {
|
|
105
|
+
src: (0, _util.getCustomerAvatar)(x.customer?.did, x?.updated_at ? new Date(x.updated_at).toISOString() : "", 20),
|
|
106
|
+
alt: x.customer?.name,
|
|
107
|
+
variant: "circular",
|
|
108
|
+
sx: {
|
|
109
|
+
width: 20,
|
|
110
|
+
height: 20
|
|
111
|
+
},
|
|
112
|
+
onClick: e => {
|
|
113
|
+
e.stopPropagation();
|
|
114
|
+
if (x.customer?.did) {
|
|
115
|
+
window.open((0, _util.getUserProfileLink)(x.customer?.did, locale), "_blank");
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}, x.id), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
119
|
+
sx: {
|
|
120
|
+
ml: "8px !important",
|
|
121
|
+
fontSize: "0.875rem",
|
|
122
|
+
fontWeight: "500",
|
|
123
|
+
overflow: "hidden",
|
|
124
|
+
whiteSpace: "nowrap",
|
|
125
|
+
textOverflow: "ellipsis"
|
|
126
|
+
},
|
|
127
|
+
onClick: e => {
|
|
128
|
+
e.stopPropagation();
|
|
129
|
+
if (x.customer?.did) {
|
|
130
|
+
window.open((0, _util.getUserProfileLink)(x.customer?.did, locale), "_blank");
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
children: x.customer?.name
|
|
134
|
+
})]
|
|
135
|
+
}), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
136
|
+
direction: "row",
|
|
137
|
+
alignItems: "center",
|
|
138
|
+
justifyContent: "flex-end",
|
|
139
|
+
spacing: 0.5,
|
|
140
|
+
sx: {
|
|
141
|
+
flex: 1
|
|
142
|
+
},
|
|
143
|
+
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Avatar, {
|
|
144
|
+
src: currency?.logo,
|
|
145
|
+
alt: currency?.symbol,
|
|
146
|
+
variant: "circular",
|
|
147
|
+
sx: {
|
|
148
|
+
width: 16,
|
|
149
|
+
height: 16
|
|
150
|
+
}
|
|
151
|
+
}, x.id), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
152
|
+
sx: {
|
|
153
|
+
color: "text.secondary"
|
|
154
|
+
},
|
|
155
|
+
children: (0, _util.formatBNStr)(x.amount_total, currency.decimal)
|
|
156
|
+
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
157
|
+
sx: {
|
|
158
|
+
color: "text.secondary"
|
|
159
|
+
},
|
|
160
|
+
children: currency.symbol
|
|
161
|
+
})]
|
|
162
|
+
})]
|
|
163
|
+
}, x.id))
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
function SupporterAvatar({
|
|
167
|
+
supporters = [],
|
|
168
|
+
totalAmount = "0",
|
|
169
|
+
currency,
|
|
170
|
+
method,
|
|
171
|
+
showDonateDetails = false
|
|
172
|
+
}) {
|
|
173
|
+
const [open, setOpen] = (0, _react.useState)(false);
|
|
66
174
|
const customers = (0, _unionBy.default)(supporters, "customer_did");
|
|
67
175
|
const customersNum = customers.length;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
flexDirection: "
|
|
176
|
+
if (customersNum === 0) return null;
|
|
177
|
+
return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
178
|
+
flexDirection: "row",
|
|
179
|
+
justifyContent: "center",
|
|
71
180
|
alignItems: "center",
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
},
|
|
78
|
-
gap: {
|
|
79
|
-
xs: 0.5,
|
|
80
|
-
sm: 1
|
|
81
|
-
},
|
|
82
|
-
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
83
|
-
component: "p",
|
|
84
|
-
color: "text.secondary",
|
|
85
|
-
children: customersNum === 0 ? /* @__PURE__ */(0, _jsxRuntime.jsx)("span", {
|
|
86
|
-
style: emojiFont,
|
|
87
|
-
children: t("payment.checkout.donation.empty")
|
|
88
|
-
}) : t("payment.checkout.donation.summary", {
|
|
89
|
-
total: customersNum,
|
|
90
|
-
symbol: currency.symbol,
|
|
91
|
-
totalAmount: (0, _util.formatAmount)(totalAmount || "0", currency.decimal)
|
|
92
|
-
})
|
|
93
|
-
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.AvatarGroup, {
|
|
94
|
-
total: customersNum,
|
|
95
|
-
max: 20,
|
|
96
|
-
children: customers.map(x => /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Avatar, {
|
|
97
|
-
title: x.customer?.name,
|
|
98
|
-
alt: x.customer?.name,
|
|
99
|
-
src: (0, _util.getCustomerAvatar)(x.customer?.did, x?.updated_at ? new Date(x.updated_at).toISOString() : "", 48),
|
|
100
|
-
variant: "circular",
|
|
181
|
+
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.AvatarGroup, {
|
|
182
|
+
max: 5,
|
|
183
|
+
children: customers.slice(0, 5).map(supporter => /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Avatar, {
|
|
184
|
+
src: (0, _util.getCustomerAvatar)(supporter.customer?.did, supporter?.updated_at ? new Date(supporter.updated_at).toISOString() : "", 24),
|
|
185
|
+
alt: supporter.customer?.name,
|
|
101
186
|
sx: {
|
|
102
|
-
width:
|
|
103
|
-
height:
|
|
187
|
+
width: "24px",
|
|
188
|
+
height: "24px"
|
|
104
189
|
}
|
|
105
|
-
},
|
|
190
|
+
}, supporter.customer?.id))
|
|
191
|
+
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
|
|
192
|
+
sx: {
|
|
193
|
+
fontSize: "14px",
|
|
194
|
+
color: "text.secondary",
|
|
195
|
+
pl: 1.5,
|
|
196
|
+
pr: 1,
|
|
197
|
+
ml: -1,
|
|
198
|
+
borderRadius: "8px",
|
|
199
|
+
backgroundColor: "#f4f4f5",
|
|
200
|
+
height: "24px",
|
|
201
|
+
...(showDonateDetails ? {
|
|
202
|
+
cursor: "pointer",
|
|
203
|
+
"&:hover": {
|
|
204
|
+
backgroundColor: "#e5e7eb"
|
|
205
|
+
}
|
|
206
|
+
} : {})
|
|
207
|
+
},
|
|
208
|
+
onClick: () => showDonateDetails && setOpen(true),
|
|
209
|
+
children: `${customersNum} supporter${customersNum > 1 ? "s" : ""} (${(0, _util.formatAmount)(totalAmount || "0", currency?.decimal)} ${currency.symbol})`
|
|
210
|
+
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_Dialog.default, {
|
|
211
|
+
open,
|
|
212
|
+
onClose: () => setOpen(false),
|
|
213
|
+
sx: {
|
|
214
|
+
".MuiDialogContent-root": {
|
|
215
|
+
width: "450px",
|
|
216
|
+
padding: "8px"
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
title: `${customersNum} supporter${customersNum > 1 ? "s" : ""}`,
|
|
220
|
+
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(DonateDetails, {
|
|
221
|
+
supporters,
|
|
222
|
+
currency,
|
|
223
|
+
method,
|
|
224
|
+
totalAmount
|
|
225
|
+
})
|
|
106
226
|
})]
|
|
107
227
|
});
|
|
108
228
|
}
|
|
@@ -112,11 +232,9 @@ function SupporterTable({
|
|
|
112
232
|
currency,
|
|
113
233
|
method
|
|
114
234
|
}) {
|
|
115
|
-
const {
|
|
116
|
-
t
|
|
117
|
-
} = (0, _context.useLocaleContext)();
|
|
118
235
|
const customers = (0, _unionBy.default)(supporters, "customer_did");
|
|
119
236
|
const customersNum = customers.length;
|
|
237
|
+
if (customersNum === 0) return null;
|
|
120
238
|
return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
121
239
|
display: "flex",
|
|
122
240
|
flexDirection: "column",
|
|
@@ -125,90 +243,16 @@ function SupporterTable({
|
|
|
125
243
|
xs: 0.5,
|
|
126
244
|
sm: 1
|
|
127
245
|
},
|
|
128
|
-
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
})
|
|
139
|
-
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Table, {
|
|
140
|
-
size: "small",
|
|
141
|
-
sx: {
|
|
142
|
-
width: "100%",
|
|
143
|
-
overflow: "hidden"
|
|
144
|
-
},
|
|
145
|
-
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.TableBody, {
|
|
146
|
-
children: supporters.map(x => /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.TableRow, {
|
|
147
|
-
sx: {
|
|
148
|
-
"> td": {
|
|
149
|
-
padding: "8px 16px 8px 0",
|
|
150
|
-
borderTop: "1px solid #e0e0e0",
|
|
151
|
-
borderBottom: "1px solid #e0e0e0"
|
|
152
|
-
},
|
|
153
|
-
"> td:last-of-type": {
|
|
154
|
-
paddingRight: "0"
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.TableCell, {
|
|
158
|
-
children: /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
159
|
-
direction: "row",
|
|
160
|
-
alignItems: "center",
|
|
161
|
-
spacing: 0.5,
|
|
162
|
-
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Avatar, {
|
|
163
|
-
src: (0, _util.getCustomerAvatar)(x.customer?.did, x?.updated_at ? new Date(x.updated_at).toISOString() : "", 48),
|
|
164
|
-
alt: x.customer?.name,
|
|
165
|
-
variant: "circular",
|
|
166
|
-
sx: {
|
|
167
|
-
width: 24,
|
|
168
|
-
height: 24
|
|
169
|
-
}
|
|
170
|
-
}, x.id), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Hidden, {
|
|
171
|
-
smDown: true,
|
|
172
|
-
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
173
|
-
children: x.customer?.name
|
|
174
|
-
})
|
|
175
|
-
})]
|
|
176
|
-
})
|
|
177
|
-
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.TableCell, {
|
|
178
|
-
align: "right",
|
|
179
|
-
children: /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
180
|
-
direction: "row",
|
|
181
|
-
alignItems: "center",
|
|
182
|
-
justifyContent: "flex-end",
|
|
183
|
-
spacing: 0.5,
|
|
184
|
-
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
185
|
-
fontWeight: 500,
|
|
186
|
-
component: "strong",
|
|
187
|
-
children: (0, _util.formatBNStr)(x.amount_total, currency.decimal)
|
|
188
|
-
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
189
|
-
component: "span",
|
|
190
|
-
children: currency.symbol
|
|
191
|
-
})]
|
|
192
|
-
})
|
|
193
|
-
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Hidden, {
|
|
194
|
-
smDown: true,
|
|
195
|
-
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.TableCell, {
|
|
196
|
-
align: "right",
|
|
197
|
-
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
198
|
-
children: (0, _util.formatDateTime)(x.created_at)
|
|
199
|
-
})
|
|
200
|
-
})
|
|
201
|
-
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.TableCell, {
|
|
202
|
-
align: "right",
|
|
203
|
-
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_tx.default, {
|
|
204
|
-
method,
|
|
205
|
-
details: x.payment_details,
|
|
206
|
-
mode: "customer",
|
|
207
|
-
align: "right"
|
|
208
|
-
})
|
|
209
|
-
})]
|
|
210
|
-
}, x.id))
|
|
211
|
-
})
|
|
246
|
+
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(SupporterAvatar, {
|
|
247
|
+
supporters,
|
|
248
|
+
totalAmount,
|
|
249
|
+
currency,
|
|
250
|
+
method
|
|
251
|
+
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(DonateDetails, {
|
|
252
|
+
supporters,
|
|
253
|
+
totalAmount,
|
|
254
|
+
currency,
|
|
255
|
+
method
|
|
212
256
|
})]
|
|
213
257
|
});
|
|
214
258
|
}
|
|
@@ -493,19 +537,39 @@ function CheckoutDonateInner({
|
|
|
493
537
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Button, {
|
|
494
538
|
size: donateSettings.appearance?.button?.size || "medium",
|
|
495
539
|
color: donateSettings.appearance?.button?.color || "primary",
|
|
496
|
-
variant: donateSettings.appearance?.button?.variant || "
|
|
540
|
+
variant: donateSettings.appearance?.button?.variant || "outlined",
|
|
541
|
+
sx: {
|
|
542
|
+
...(!donateSettings.appearance?.button?.variant ? {
|
|
543
|
+
color: "var(--foregrounds-fg-base, #010714)",
|
|
544
|
+
borderColor: "var(--stroke-button-secondary-border, #E5E7EB)",
|
|
545
|
+
"&:hover": {
|
|
546
|
+
backgroundColor: "var(--buttons-button-neutral-hover, #F3F4F6)",
|
|
547
|
+
borderColor: "var(--stroke-button-secondary-border, #E5E7EB)"
|
|
548
|
+
}
|
|
549
|
+
} : {}),
|
|
550
|
+
// @ts-ignore
|
|
551
|
+
...(donateSettings.appearance?.button?.sx || {})
|
|
552
|
+
},
|
|
497
553
|
...donateSettings.appearance?.button,
|
|
498
554
|
onClick: () => startDonate(),
|
|
499
555
|
children: /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
500
556
|
direction: "row",
|
|
501
557
|
alignItems: "center",
|
|
502
558
|
spacing: 0.5,
|
|
503
|
-
children: [donateSettings.appearance.button.icon
|
|
559
|
+
children: [donateSettings.appearance.button.icon && /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
560
|
+
sx: {
|
|
561
|
+
mr: 0.5,
|
|
562
|
+
display: "inline-flex",
|
|
563
|
+
alignItems: "center"
|
|
564
|
+
},
|
|
565
|
+
children: donateSettings.appearance.button.icon
|
|
566
|
+
}), typeof donateSettings.appearance.button.text === "string" ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
504
567
|
children: donateSettings.appearance.button.text
|
|
505
568
|
}) : donateSettings.appearance.button.text]
|
|
506
569
|
})
|
|
507
570
|
}), supporters.data && donateSettings.appearance.history.variant === "avatar" && /* @__PURE__ */(0, _jsxRuntime.jsx)(SupporterAvatar, {
|
|
508
|
-
...supporters.data
|
|
571
|
+
...supporters.data,
|
|
572
|
+
showDonateDetails: true
|
|
509
573
|
}), supporters.data && donateSettings.appearance.history.variant === "table" && /* @__PURE__ */(0, _jsxRuntime.jsx)(SupporterTable, {
|
|
510
574
|
...supporters.data
|
|
511
575
|
})]
|
package/lib/components/table.js
CHANGED
|
@@ -72,7 +72,7 @@ const Table = _react.default.memo(({
|
|
|
72
72
|
});
|
|
73
73
|
const Wrapped = (0, _system.styled)(_Datatable.default)`
|
|
74
74
|
${props => props?.hasRowLink ? `.MuiTableCell-root {
|
|
75
|
-
font-size:
|
|
75
|
+
font-size: 0.875rem !important;
|
|
76
76
|
}` : ""}
|
|
77
77
|
.MuiPaper-root {
|
|
78
78
|
border-radius: 8px;
|
package/lib/libs/util.d.ts
CHANGED
|
@@ -113,3 +113,4 @@ export declare function getInvoiceDescriptionAndReason(invoice: TInvoiceExpanded
|
|
|
113
113
|
};
|
|
114
114
|
export declare function getPaymentKitComponent(): any;
|
|
115
115
|
export declare function openDonationSettings(openInNewTab?: boolean): void;
|
|
116
|
+
export declare function getUserProfileLink(userDid: string, locale?: string): string;
|
package/lib/libs/util.js
CHANGED
|
@@ -45,6 +45,7 @@ exports.getStatementDescriptor = getStatementDescriptor;
|
|
|
45
45
|
exports.getSubscriptionAction = void 0;
|
|
46
46
|
exports.getSubscriptionStatusColor = getSubscriptionStatusColor;
|
|
47
47
|
exports.getTxLink = exports.getSubscriptionTimeSummary = void 0;
|
|
48
|
+
exports.getUserProfileLink = getUserProfileLink;
|
|
48
49
|
exports.getWebhookStatusColor = getWebhookStatusColor;
|
|
49
50
|
exports.getWordBreakStyle = getWordBreakStyle;
|
|
50
51
|
exports.hasDelegateTxHash = hasDelegateTxHash;
|
|
@@ -1109,4 +1110,10 @@ function openDonationSettings(openInNewTab = false) {
|
|
|
1109
1110
|
const mountPoint = paymentKit.mountPoint.endsWith("/") ? paymentKit.mountPoint.slice(0, -1) : paymentKit.mountPoint;
|
|
1110
1111
|
window.open(`${window.location.origin}${mountPoint}/integrations/donations`, openInNewTab ? "_blank" : "_self");
|
|
1111
1112
|
}
|
|
1113
|
+
}
|
|
1114
|
+
function getUserProfileLink(userDid, locale = "en") {
|
|
1115
|
+
return (0, _ufo.joinURL)(window.location.origin, (0, _ufo.withQuery)(".well-known/service/user", {
|
|
1116
|
+
locale,
|
|
1117
|
+
did: userDid
|
|
1118
|
+
}));
|
|
1112
1119
|
}
|
package/lib/payment/amount.js
CHANGED
|
@@ -65,7 +65,7 @@ function ProductCard({
|
|
|
65
65
|
variant: "body1",
|
|
66
66
|
title: description,
|
|
67
67
|
sx: {
|
|
68
|
-
fontSize: "0.
|
|
68
|
+
fontSize: "0.74375rem",
|
|
69
69
|
mb: 0.5,
|
|
70
70
|
lineHeight: 1.2,
|
|
71
71
|
textAlign: "left"
|
|
@@ -74,7 +74,7 @@ function ProductCard({
|
|
|
74
74
|
children: description
|
|
75
75
|
}), extra && /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
|
|
76
76
|
sx: {
|
|
77
|
-
fontSize: "0.
|
|
77
|
+
fontSize: "0.74375rem"
|
|
78
78
|
},
|
|
79
79
|
color: "text.lighter",
|
|
80
80
|
children: extra
|
|
@@ -98,7 +98,7 @@ function ProductItem({
|
|
|
98
98
|
children: primaryText
|
|
99
99
|
}), pricing.secondary && /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
100
100
|
sx: {
|
|
101
|
-
fontSize: "0.
|
|
101
|
+
fontSize: "0.74375rem",
|
|
102
102
|
color: "text.lighter"
|
|
103
103
|
},
|
|
104
104
|
children: pricing.secondary
|
|
@@ -37,7 +37,7 @@ function ProductSkeleton({
|
|
|
37
37
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
38
38
|
variant: "text",
|
|
39
39
|
sx: {
|
|
40
|
-
fontSize: "
|
|
40
|
+
fontSize: "0.875rem",
|
|
41
41
|
width: "60%"
|
|
42
42
|
}
|
|
43
43
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
@@ -62,7 +62,7 @@ function ProductSkeleton({
|
|
|
62
62
|
(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
63
63
|
variant: "text",
|
|
64
64
|
sx: {
|
|
65
|
-
fontSize: "
|
|
65
|
+
fontSize: "0.875rem",
|
|
66
66
|
width: "60%"
|
|
67
67
|
}
|
|
68
68
|
}, i))]
|
|
@@ -14,7 +14,7 @@ function DonationSkeleton() {
|
|
|
14
14
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
15
15
|
variant: "text",
|
|
16
16
|
sx: {
|
|
17
|
-
fontSize: "
|
|
17
|
+
fontSize: "1.75rem",
|
|
18
18
|
width: "40%"
|
|
19
19
|
}
|
|
20
20
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
@@ -14,7 +14,7 @@ function PaymentSkeleton() {
|
|
|
14
14
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
15
15
|
variant: "text",
|
|
16
16
|
sx: {
|
|
17
|
-
fontSize: "
|
|
17
|
+
fontSize: "1.75rem",
|
|
18
18
|
width: "40%"
|
|
19
19
|
}
|
|
20
20
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
package/lib/payment/summary.js
CHANGED
|
@@ -413,7 +413,7 @@ function PaymentSummary({
|
|
|
413
413
|
}), headlines.then && headlines.showThen && /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
414
414
|
component: "div",
|
|
415
415
|
sx: {
|
|
416
|
-
fontSize: "0.
|
|
416
|
+
fontSize: "0.7875rem",
|
|
417
417
|
color: "text.lighter",
|
|
418
418
|
textAlign: "right",
|
|
419
419
|
margin: "-2px 0 8px"
|
package/lib/theme/index.js
CHANGED
|
@@ -65,7 +65,7 @@ function PaymentThemeProvider({
|
|
|
65
65
|
},
|
|
66
66
|
styleOverrides: {
|
|
67
67
|
root: {
|
|
68
|
-
fontSize: "
|
|
68
|
+
fontSize: "0.875rem",
|
|
69
69
|
fontWeight: 500,
|
|
70
70
|
textTransform: "none",
|
|
71
71
|
boxShadow: "none"
|
|
@@ -113,7 +113,8 @@ function PaymentThemeProvider({
|
|
|
113
113
|
MuiTab: {
|
|
114
114
|
styleOverrides: {
|
|
115
115
|
root: {
|
|
116
|
-
textTransform: "none"
|
|
116
|
+
textTransform: "none",
|
|
117
|
+
fontSize: "0.875rem"
|
|
117
118
|
}
|
|
118
119
|
}
|
|
119
120
|
},
|
package/lib/theme/typography.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.typography = void 0;
|
|
7
7
|
const typography = exports.typography = {
|
|
8
8
|
h1: {
|
|
9
|
-
fontSize: "1.
|
|
9
|
+
fontSize: "1.5rem",
|
|
10
10
|
lineHeight: 1.2,
|
|
11
11
|
fontWeight: 800,
|
|
12
12
|
letterSpacing: "-.025em"
|
|
@@ -18,38 +18,38 @@ const typography = exports.typography = {
|
|
|
18
18
|
letterSpacing: "-.025em"
|
|
19
19
|
},
|
|
20
20
|
h3: {
|
|
21
|
-
fontSize: "1.
|
|
21
|
+
fontSize: "1.09375rem",
|
|
22
22
|
lineHeight: 1.4,
|
|
23
23
|
fontWeight: 600,
|
|
24
24
|
letterSpacing: "-.025em"
|
|
25
25
|
},
|
|
26
26
|
h4: {
|
|
27
|
-
fontSize: "1.
|
|
27
|
+
fontSize: "1.09375rem",
|
|
28
28
|
lineHeight: 1.5,
|
|
29
29
|
fontWeight: 600
|
|
30
30
|
},
|
|
31
31
|
h5: {
|
|
32
|
-
fontSize: "
|
|
32
|
+
fontSize: "0.875rem",
|
|
33
33
|
lineHeight: 1.75,
|
|
34
34
|
fontWeight: 400
|
|
35
35
|
},
|
|
36
36
|
h6: {
|
|
37
|
-
fontSize: "
|
|
37
|
+
fontSize: "0.875rem",
|
|
38
38
|
lineHeight: 1.75,
|
|
39
39
|
fontWeight: 400
|
|
40
40
|
},
|
|
41
41
|
subtitle1: {
|
|
42
|
-
fontSize: "
|
|
42
|
+
fontSize: "0.875rem",
|
|
43
43
|
lineHeight: 1.75,
|
|
44
44
|
fontWeight: 400
|
|
45
45
|
},
|
|
46
46
|
subtitle2: {
|
|
47
|
-
fontSize: "
|
|
47
|
+
fontSize: "0.875rem",
|
|
48
48
|
lineHeight: 1.75,
|
|
49
49
|
fontWeight: 400
|
|
50
50
|
},
|
|
51
51
|
body1: {
|
|
52
|
-
fontSize: "
|
|
52
|
+
fontSize: "0.875rem",
|
|
53
53
|
lineHeight: 1.75
|
|
54
54
|
},
|
|
55
55
|
fontWeightLight: 300,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/payment-react",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.8",
|
|
4
4
|
"description": "Reusable react components for payment kit v2",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -53,15 +53,15 @@
|
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@arcblock/did-connect": "^2.11.
|
|
57
|
-
"@arcblock/ux": "^2.11.
|
|
58
|
-
"@arcblock/ws": "^1.19.
|
|
59
|
-
"@blocklet/ui-react": "^2.11.
|
|
56
|
+
"@arcblock/did-connect": "^2.11.44",
|
|
57
|
+
"@arcblock/ux": "^2.11.44",
|
|
58
|
+
"@arcblock/ws": "^1.19.10",
|
|
59
|
+
"@blocklet/ui-react": "^2.11.44",
|
|
60
60
|
"@mui/icons-material": "^5.16.6",
|
|
61
61
|
"@mui/lab": "^5.0.0-alpha.173",
|
|
62
62
|
"@mui/material": "^5.16.6",
|
|
63
63
|
"@mui/system": "^5.16.6",
|
|
64
|
-
"@ocap/util": "^1.19.
|
|
64
|
+
"@ocap/util": "^1.19.10",
|
|
65
65
|
"@stripe/react-stripe-js": "^2.7.3",
|
|
66
66
|
"@stripe/stripe-js": "^2.4.0",
|
|
67
67
|
"@vitejs/plugin-legacy": "^5.4.1",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"@babel/core": "^7.25.2",
|
|
93
93
|
"@babel/preset-env": "^7.25.2",
|
|
94
94
|
"@babel/preset-react": "^7.24.7",
|
|
95
|
-
"@blocklet/payment-types": "1.18.
|
|
95
|
+
"@blocklet/payment-types": "1.18.8",
|
|
96
96
|
"@storybook/addon-essentials": "^7.6.20",
|
|
97
97
|
"@storybook/addon-interactions": "^7.6.20",
|
|
98
98
|
"@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": "0815493ffd53c977d2d14779703d85f2e0e34299"
|
|
127
127
|
}
|