@blocklet/payment-react 1.18.7 → 1.18.9

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.
Files changed (58) hide show
  1. package/es/checkout/donate.d.ts +2 -0
  2. package/es/checkout/donate.js +188 -89
  3. package/es/components/livemode.js +1 -1
  4. package/es/components/table.js +1 -1
  5. package/es/index.d.ts +2 -2
  6. package/es/index.js +3 -2
  7. package/es/libs/util.d.ts +1 -0
  8. package/es/libs/util.js +10 -1
  9. package/es/payment/amount.js +1 -1
  10. package/es/payment/form/index.js +1 -1
  11. package/es/payment/form/stripe/form.js +1 -1
  12. package/es/payment/product-card.js +2 -2
  13. package/es/payment/product-item.js +1 -1
  14. package/es/payment/product-skeleton.js +2 -2
  15. package/es/payment/skeleton/donation.js +1 -1
  16. package/es/payment/skeleton/overview.js +1 -1
  17. package/es/payment/skeleton/payment.js +1 -1
  18. package/es/payment/summary.js +1 -1
  19. package/es/theme/index.js +3 -2
  20. package/es/theme/typography.js +8 -8
  21. package/lib/checkout/donate.d.ts +2 -0
  22. package/lib/checkout/donate.js +194 -129
  23. package/lib/components/livemode.js +1 -1
  24. package/lib/components/table.js +1 -1
  25. package/lib/index.d.ts +2 -2
  26. package/lib/index.js +11 -2
  27. package/lib/libs/util.d.ts +1 -0
  28. package/lib/libs/util.js +7 -0
  29. package/lib/payment/amount.js +1 -1
  30. package/lib/payment/form/index.js +2 -2
  31. package/lib/payment/form/stripe/form.js +1 -1
  32. package/lib/payment/product-card.js +2 -2
  33. package/lib/payment/product-item.js +1 -1
  34. package/lib/payment/product-skeleton.js +2 -2
  35. package/lib/payment/skeleton/donation.js +1 -1
  36. package/lib/payment/skeleton/overview.js +1 -1
  37. package/lib/payment/skeleton/payment.js +1 -1
  38. package/lib/payment/summary.js +1 -1
  39. package/lib/theme/index.js +3 -2
  40. package/lib/theme/typography.js +8 -8
  41. package/package.json +8 -8
  42. package/src/checkout/donate.tsx +176 -112
  43. package/src/components/livemode.tsx +1 -1
  44. package/src/components/table.tsx +1 -1
  45. package/src/index.ts +2 -1
  46. package/src/libs/util.ts +11 -1
  47. package/src/payment/amount.tsx +1 -1
  48. package/src/payment/form/index.tsx +1 -1
  49. package/src/payment/form/stripe/form.tsx +1 -1
  50. package/src/payment/product-card.tsx +2 -2
  51. package/src/payment/product-item.tsx +1 -1
  52. package/src/payment/product-skeleton.tsx +2 -2
  53. package/src/payment/skeleton/donation.tsx +1 -1
  54. package/src/payment/skeleton/overview.tsx +1 -1
  55. package/src/payment/skeleton/payment.tsx +1 -1
  56. package/src/payment/summary.tsx +1 -1
  57. package/src/theme/index.tsx +2 -1
  58. package/src/theme/typography.ts +8 -8
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.DonateDetails = DonateDetails;
6
7
  module.exports = CheckoutDonate;
7
8
  var _jsxRuntime = require("react/jsx-runtime");
8
9
  var _Dialog = _interopRequireDefault(require("@arcblock/ux/lib/Dialog"));
@@ -13,7 +14,6 @@ var _omit = _interopRequireDefault(require("lodash/omit"));
13
14
  var _unionBy = _interopRequireDefault(require("lodash/unionBy"));
14
15
  var _react = require("react");
15
16
  var _iconsMaterial = require("@mui/icons-material");
16
- var _tx = _interopRequireDefault(require("../components/blockchain/tx"));
17
17
  var _api = _interopRequireDefault(require("../libs/api"));
18
18
  var _util = require("../libs/util");
19
19
  var _form = _interopRequireDefault(require("./form"));
@@ -54,55 +54,176 @@ const fetchSupporters = (target, livemode = true) => {
54
54
  const emojiFont = {
55
55
  fontFamily: 'Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
56
56
  };
57
- function SupporterAvatar({
57
+ function DonateDetails({
58
58
  supporters = [],
59
- totalAmount = "0",
60
59
  currency,
61
60
  method
62
61
  }) {
63
62
  const {
64
- t
63
+ locale
65
64
  } = (0, _context.useLocaleContext)();
65
+ return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Stack, {
66
+ sx: {
67
+ width: "100%",
68
+ minWidth: "256px",
69
+ maxWidth: "calc(100vw - 32px)",
70
+ maxHeight: "300px",
71
+ overflowX: "hidden",
72
+ overflowY: "auto",
73
+ margin: "0 auto"
74
+ },
75
+ children: supporters.map(x => /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
76
+ sx: {
77
+ padding: "6px",
78
+ "&:hover": {
79
+ backgroundColor: "var(--backgrounds-bg-highlight, #eff6ff)",
80
+ transition: "background-color 200ms linear",
81
+ cursor: "pointer"
82
+ },
83
+ borderBottom: "1px solid var(--stroke-border-base, #EFF1F5)",
84
+ display: "flex",
85
+ justifyContent: "space-between",
86
+ alignItems: "center"
87
+ },
88
+ onClick: () => {
89
+ const {
90
+ link,
91
+ text
92
+ } = (0, _util.getTxLink)(method, x.payment_details);
93
+ if (link && text) {
94
+ window.open(link, "_blank");
95
+ }
96
+ },
97
+ children: [/* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
98
+ direction: "row",
99
+ alignItems: "center",
100
+ spacing: 0.5,
101
+ sx: {
102
+ flex: 3,
103
+ overflow: "hidden"
104
+ },
105
+ children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Avatar, {
106
+ src: (0, _util.getCustomerAvatar)(x.customer?.did, x?.updated_at ? new Date(x.updated_at).toISOString() : "", 20),
107
+ alt: x.customer?.name,
108
+ variant: "circular",
109
+ sx: {
110
+ width: 20,
111
+ height: 20
112
+ },
113
+ onClick: e => {
114
+ e.stopPropagation();
115
+ if (x.customer?.did) {
116
+ window.open((0, _util.getUserProfileLink)(x.customer?.did, locale), "_blank");
117
+ }
118
+ }
119
+ }, x.id), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
120
+ sx: {
121
+ ml: "8px !important",
122
+ fontSize: "0.875rem",
123
+ fontWeight: "500",
124
+ overflow: "hidden",
125
+ whiteSpace: "nowrap",
126
+ textOverflow: "ellipsis"
127
+ },
128
+ onClick: e => {
129
+ e.stopPropagation();
130
+ if (x.customer?.did) {
131
+ window.open((0, _util.getUserProfileLink)(x.customer?.did, locale), "_blank");
132
+ }
133
+ },
134
+ children: x.customer?.name
135
+ })]
136
+ }), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
137
+ direction: "row",
138
+ alignItems: "center",
139
+ justifyContent: "flex-end",
140
+ spacing: 0.5,
141
+ sx: {
142
+ flex: 1
143
+ },
144
+ children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Avatar, {
145
+ src: currency?.logo,
146
+ alt: currency?.symbol,
147
+ variant: "circular",
148
+ sx: {
149
+ width: 16,
150
+ height: 16
151
+ }
152
+ }, x.id), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
153
+ sx: {
154
+ color: "text.secondary"
155
+ },
156
+ children: (0, _util.formatBNStr)(x.amount_total, currency.decimal)
157
+ }), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
158
+ sx: {
159
+ color: "text.secondary"
160
+ },
161
+ children: currency.symbol
162
+ })]
163
+ })]
164
+ }, x.id))
165
+ });
166
+ }
167
+ function SupporterAvatar({
168
+ supporters = [],
169
+ totalAmount = "0",
170
+ currency,
171
+ method,
172
+ showDonateDetails = false
173
+ }) {
174
+ const [open, setOpen] = (0, _react.useState)(false);
66
175
  const customers = (0, _unionBy.default)(supporters, "customer_did");
67
176
  const customersNum = customers.length;
68
- return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
69
- display: "flex",
70
- flexDirection: "column",
177
+ if (customersNum === 0) return null;
178
+ return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
179
+ flexDirection: "row",
180
+ justifyContent: "center",
71
181
  alignItems: "center",
72
- sx: {
73
- ".MuiAvatar-root": {
74
- width: "32px",
75
- height: "32px"
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",
182
+ children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.AvatarGroup, {
183
+ max: 5,
184
+ children: customers.slice(0, 5).map(supporter => /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Avatar, {
185
+ src: (0, _util.getCustomerAvatar)(supporter.customer?.did, supporter?.updated_at ? new Date(supporter.updated_at).toISOString() : "", 24),
186
+ alt: supporter.customer?.name,
101
187
  sx: {
102
- width: 32,
103
- height: 32
188
+ width: "24px",
189
+ height: "24px"
104
190
  }
105
- }, x.id))
191
+ }, supporter.customer?.id))
192
+ }), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
193
+ sx: {
194
+ fontSize: "14px",
195
+ color: "text.secondary",
196
+ pl: 1.5,
197
+ pr: 1,
198
+ ml: -1,
199
+ borderRadius: "8px",
200
+ backgroundColor: "#f4f4f5",
201
+ height: "24px",
202
+ ...(showDonateDetails ? {
203
+ cursor: "pointer",
204
+ "&:hover": {
205
+ backgroundColor: "#e5e7eb"
206
+ }
207
+ } : {})
208
+ },
209
+ onClick: () => showDonateDetails && setOpen(true),
210
+ children: `${customersNum} supporter${customersNum > 1 ? "s" : ""} (${(0, _util.formatAmount)(totalAmount || "0", currency?.decimal)} ${currency.symbol})`
211
+ }), /* @__PURE__ */(0, _jsxRuntime.jsx)(_Dialog.default, {
212
+ open,
213
+ onClose: () => setOpen(false),
214
+ sx: {
215
+ ".MuiDialogContent-root": {
216
+ width: "450px",
217
+ padding: "8px"
218
+ }
219
+ },
220
+ title: `${customersNum} supporter${customersNum > 1 ? "s" : ""}`,
221
+ children: /* @__PURE__ */(0, _jsxRuntime.jsx)(DonateDetails, {
222
+ supporters,
223
+ currency,
224
+ method,
225
+ totalAmount
226
+ })
106
227
  })]
107
228
  });
108
229
  }
@@ -112,11 +233,9 @@ function SupporterTable({
112
233
  currency,
113
234
  method
114
235
  }) {
115
- const {
116
- t
117
- } = (0, _context.useLocaleContext)();
118
236
  const customers = (0, _unionBy.default)(supporters, "customer_did");
119
237
  const customersNum = customers.length;
238
+ if (customersNum === 0) return null;
120
239
  return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
121
240
  display: "flex",
122
241
  flexDirection: "column",
@@ -125,90 +244,16 @@ function SupporterTable({
125
244
  xs: 0.5,
126
245
  sm: 1
127
246
  },
128
- children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
129
- component: "p",
130
- color: "text.secondary",
131
- children: customersNum === 0 ? /* @__PURE__ */(0, _jsxRuntime.jsx)("span", {
132
- style: emojiFont,
133
- children: t("payment.checkout.donation.empty")
134
- }) : t("payment.checkout.donation.summary", {
135
- total: customersNum,
136
- symbol: currency.symbol,
137
- totalAmount: (0, _util.formatAmount)(totalAmount || "0", currency.decimal)
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
- })
247
+ children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(SupporterAvatar, {
248
+ supporters,
249
+ totalAmount,
250
+ currency,
251
+ method
252
+ }), /* @__PURE__ */(0, _jsxRuntime.jsx)(DonateDetails, {
253
+ supporters,
254
+ totalAmount,
255
+ currency,
256
+ method
212
257
  })]
213
258
  });
214
259
  }
@@ -493,19 +538,39 @@ function CheckoutDonateInner({
493
538
  children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Button, {
494
539
  size: donateSettings.appearance?.button?.size || "medium",
495
540
  color: donateSettings.appearance?.button?.color || "primary",
496
- variant: donateSettings.appearance?.button?.variant || "contained",
541
+ variant: donateSettings.appearance?.button?.variant || "outlined",
542
+ sx: {
543
+ ...(!donateSettings.appearance?.button?.variant ? {
544
+ color: "var(--foregrounds-fg-base, #010714)",
545
+ borderColor: "var(--stroke-button-secondary-border, #E5E7EB)",
546
+ "&:hover": {
547
+ backgroundColor: "var(--buttons-button-neutral-hover, #F3F4F6)",
548
+ borderColor: "var(--stroke-button-secondary-border, #E5E7EB)"
549
+ }
550
+ } : {}),
551
+ // @ts-ignore
552
+ ...(donateSettings.appearance?.button?.sx || {})
553
+ },
497
554
  ...donateSettings.appearance?.button,
498
555
  onClick: () => startDonate(),
499
556
  children: /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
500
557
  direction: "row",
501
558
  alignItems: "center",
502
559
  spacing: 0.5,
503
- children: [donateSettings.appearance.button.icon, typeof donateSettings.appearance.button.text === "string" ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
560
+ children: [donateSettings.appearance.button.icon && /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
561
+ sx: {
562
+ mr: 0.5,
563
+ display: "inline-flex",
564
+ alignItems: "center"
565
+ },
566
+ children: donateSettings.appearance.button.icon
567
+ }), typeof donateSettings.appearance.button.text === "string" ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
504
568
  children: donateSettings.appearance.button.text
505
569
  }) : donateSettings.appearance.button.text]
506
570
  })
507
571
  }), supporters.data && donateSettings.appearance.history.variant === "avatar" && /* @__PURE__ */(0, _jsxRuntime.jsx)(SupporterAvatar, {
508
- ...supporters.data
572
+ ...supporters.data,
573
+ showDonateDetails: true
509
574
  }), supporters.data && donateSettings.appearance.history.variant === "table" && /* @__PURE__ */(0, _jsxRuntime.jsx)(SupporterTable, {
510
575
  ...supporters.data
511
576
  })]
@@ -24,7 +24,7 @@ function Livemode({
24
24
  height: 18,
25
25
  lineHeight: 1.2,
26
26
  textTransform: "uppercase",
27
- fontSize: "0.8rem",
27
+ fontSize: "0.7rem",
28
28
  fontWeight: "bold",
29
29
  borderRadius: "4px",
30
30
  backgroundColor,
@@ -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: 1rem !important;
75
+ font-size: 0.875rem !important;
76
76
  }` : ""}
77
77
  .MuiPaper-root {
78
78
  border-radius: 8px;
package/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import CheckoutDonate from './checkout/donate';
1
+ import CheckoutDonate, { DonateDetails } from './checkout/donate';
2
2
  import CheckoutForm from './checkout/form';
3
3
  import CheckoutTable from './checkout/table';
4
4
  import TxGas from './components/blockchain/gas';
@@ -43,4 +43,4 @@ export * from './hooks/mobile';
43
43
  export * from './hooks/table';
44
44
  export * from './hooks/scroll';
45
45
  export { translations, createTranslator } from './locales';
46
- export { createLazyComponent, api, dayjs, FormInput, PhoneInput, AddressForm, StripeForm, Status, Livemode, Switch, ConfirmDialog, CheckoutForm, CheckoutTable, CheckoutDonate, CurrencySelector, Payment, PaymentSummary, PricingTable, ProductSkeleton, Amount, CustomerInvoiceList, CustomerPaymentList, TxLink, TxGas, SafeGuard, PricingItem, CountrySelect, Table, TruncatedText, Link, OverdueInvoicePayment, PaymentBeneficiaries, LoadingButton, };
46
+ export { createLazyComponent, api, dayjs, FormInput, PhoneInput, AddressForm, StripeForm, Status, Livemode, Switch, ConfirmDialog, CheckoutForm, CheckoutTable, CheckoutDonate, CurrencySelector, Payment, PaymentSummary, PricingTable, ProductSkeleton, Amount, CustomerInvoiceList, CustomerPaymentList, TxLink, TxGas, SafeGuard, PricingItem, CountrySelect, Table, TruncatedText, Link, OverdueInvoicePayment, PaymentBeneficiaries, LoadingButton, DonateDetails, };
package/lib/index.js CHANGED
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  var _exportNames = {
7
7
  CheckoutDonate: true,
8
+ DonateDetails: true,
8
9
  CheckoutForm: true,
9
10
  CheckoutTable: true,
10
11
  TxGas: true,
@@ -101,6 +102,12 @@ Object.defineProperty(exports, "CustomerPaymentList", {
101
102
  return _list2.default;
102
103
  }
103
104
  });
105
+ Object.defineProperty(exports, "DonateDetails", {
106
+ enumerable: true,
107
+ get: function () {
108
+ return _donate.DonateDetails;
109
+ }
110
+ });
104
111
  Object.defineProperty(exports, "FormInput", {
105
112
  enumerable: true,
106
113
  get: function () {
@@ -257,7 +264,7 @@ Object.defineProperty(exports, "translations", {
257
264
  return _locales.translations;
258
265
  }
259
266
  });
260
- var _donate = _interopRequireDefault(require("./checkout/donate"));
267
+ var _donate = _interopRequireWildcard(require("./checkout/donate"));
261
268
  var _form = _interopRequireDefault(require("./checkout/form"));
262
269
  var _table = _interopRequireDefault(require("./checkout/table"));
263
270
  var _gas = _interopRequireDefault(require("./components/blockchain/gas"));
@@ -412,4 +419,6 @@ Object.keys(_scroll).forEach(function (key) {
412
419
  });
413
420
  });
414
421
  var _locales = require("./locales");
415
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
422
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
423
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
424
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -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
  }
@@ -15,7 +15,7 @@ function PaymentAmount({
15
15
  sx: {
16
16
  my: 0.5,
17
17
  fontWeight: 600,
18
- fontSize: "2.5rem",
18
+ fontSize: "2.1875rem",
19
19
  letterSpacing: "-0.03rem",
20
20
  fontVariantNumeric: "tabular-nums",
21
21
  ...sx
@@ -564,8 +564,8 @@ function PaymentForm({
564
564
  sx: {
565
565
  mt: 2.5,
566
566
  color: "text.lighter",
567
- fontSize: "0.9rem",
568
- lineHeight: "1.1rem"
567
+ fontSize: "0.7875rem",
568
+ lineHeight: "0.9625rem"
569
569
  },
570
570
  children: t("payment.checkout.confirm", {
571
571
  payee
@@ -143,7 +143,7 @@ function StripeCheckoutForm({
143
143
  mt: 2,
144
144
  mb: 1,
145
145
  borderRadius: 0,
146
- fontSize: "1.1rem"
146
+ fontSize: "0.875rem"
147
147
  },
148
148
  type: "submit",
149
149
  disabled: state.confirming || !state.loaded,
@@ -65,7 +65,7 @@ function ProductCard({
65
65
  variant: "body1",
66
66
  title: description,
67
67
  sx: {
68
- fontSize: "0.85rem",
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.85rem"
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.85rem",
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: "1rem",
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: "1rem",
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: "2rem",
17
+ fontSize: "1.75rem",
18
18
  width: "40%"
19
19
  }
20
20
  }), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Skeleton, {
@@ -18,7 +18,7 @@ function OverviewSkeleton() {
18
18
  children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Skeleton, {
19
19
  variant: "text",
20
20
  sx: {
21
- fontSize: "2rem",
21
+ fontSize: "1.75rem",
22
22
  width: "40%"
23
23
  }
24
24
  })
@@ -14,7 +14,7 @@ function PaymentSkeleton() {
14
14
  children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Skeleton, {
15
15
  variant: "text",
16
16
  sx: {
17
- fontSize: "2rem",
17
+ fontSize: "1.75rem",
18
18
  width: "40%"
19
19
  }
20
20
  }), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Skeleton, {
@@ -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.9rem",
416
+ fontSize: "0.7875rem",
417
417
  color: "text.lighter",
418
418
  textAlign: "right",
419
419
  margin: "-2px 0 8px"
@@ -65,7 +65,7 @@ function PaymentThemeProvider({
65
65
  },
66
66
  styleOverrides: {
67
67
  root: {
68
- fontSize: "1rem",
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
  },