@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
@@ -5,6 +5,7 @@ export type DonateHistory = {
5
5
  supporters: TCheckoutSessionExpanded[];
6
6
  currency: TPaymentCurrency;
7
7
  method: TPaymentMethod;
8
+ total?: number;
8
9
  totalAmount: string;
9
10
  };
10
11
  export type CheckoutDonateSettings = {
@@ -48,6 +49,7 @@ export type DonateProps = Pick<CheckoutProps, 'onPaid' | 'onError'> & {
48
49
  theme?: 'default' | 'inherit' | PaymentThemeOptions;
49
50
  children?: (openDialog: () => void, donateTotalAmount: string, supporters: DonateHistory, loading?: boolean, donateSettings?: DonationSettings) => React.ReactNode;
50
51
  };
52
+ export declare function DonateDetails({ supporters, currency, method }: DonateHistory): import("react").JSX.Element;
51
53
  declare function CheckoutDonate(props: DonateProps): import("react").JSX.Element;
52
54
  declare namespace CheckoutDonate {
53
55
  var defaultProps: {
@@ -7,14 +7,9 @@ import {
7
7
  Box,
8
8
  Button,
9
9
  CircularProgress,
10
- Hidden,
11
10
  IconButton,
12
11
  Popover,
13
12
  Stack,
14
- Table,
15
- TableBody,
16
- TableCell,
17
- TableRow,
18
13
  Typography,
19
14
  Tooltip
20
15
  } from "@mui/material";
@@ -23,13 +18,13 @@ import omit from "lodash/omit";
23
18
  import uniqBy from "lodash/unionBy";
24
19
  import { useEffect, useRef, useState } from "react";
25
20
  import { Settings } from "@mui/icons-material";
26
- import TxLink from "../components/blockchain/tx.js";
27
21
  import api from "../libs/api.js";
28
22
  import {
29
23
  formatAmount,
30
24
  formatBNStr,
31
- formatDateTime,
32
25
  getCustomerAvatar,
26
+ getTxLink,
27
+ getUserProfileLink,
33
28
  lazyLoad,
34
29
  openDonationSettings
35
30
  } from "../libs/util.js";
@@ -65,98 +60,190 @@ const fetchSupporters = (target, livemode = true) => {
65
60
  const emojiFont = {
66
61
  fontFamily: 'Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
67
62
  };
68
- function SupporterAvatar({ supporters = [], totalAmount = "0", currency, method }) {
69
- const { t } = useLocaleContext();
70
- const customers = uniqBy(supporters, "customer_did");
71
- const customersNum = customers.length;
72
- return /* @__PURE__ */ jsxs(
73
- Box,
63
+ export function DonateDetails({ supporters = [], currency, method }) {
64
+ const { locale } = useLocaleContext();
65
+ return /* @__PURE__ */ jsx(
66
+ Stack,
74
67
  {
75
- display: "flex",
76
- flexDirection: "column",
77
- alignItems: "center",
78
68
  sx: {
79
- ".MuiAvatar-root": {
80
- width: "32px",
81
- height: "32px"
82
- }
69
+ width: "100%",
70
+ minWidth: "256px",
71
+ maxWidth: "calc(100vw - 32px)",
72
+ maxHeight: "300px",
73
+ overflowX: "hidden",
74
+ overflowY: "auto",
75
+ margin: "0 auto"
83
76
  },
84
- gap: {
85
- xs: 0.5,
86
- sm: 1
87
- },
88
- children: [
89
- /* @__PURE__ */ jsx(Typography, { component: "p", color: "text.secondary", children: customersNum === 0 ? /* @__PURE__ */ jsx("span", { style: emojiFont, children: t("payment.checkout.donation.empty") }) : t("payment.checkout.donation.summary", {
90
- total: customersNum,
91
- symbol: currency.symbol,
92
- totalAmount: formatAmount(totalAmount || "0", currency.decimal)
93
- }) }),
94
- /* @__PURE__ */ jsx(AvatarGroup, { total: customersNum, max: 20, children: customers.map((x) => /* @__PURE__ */ jsx(
95
- Avatar,
96
- {
97
- title: x.customer?.name,
98
- alt: x.customer?.name,
99
- src: getCustomerAvatar(x.customer?.did, x?.updated_at ? new Date(x.updated_at).toISOString() : "", 48),
100
- variant: "circular",
101
- sx: { width: 32, height: 32 }
77
+ children: supporters.map((x) => /* @__PURE__ */ jsxs(
78
+ Box,
79
+ {
80
+ sx: {
81
+ padding: "6px",
82
+ "&:hover": {
83
+ backgroundColor: "var(--backgrounds-bg-highlight, #eff6ff)",
84
+ transition: "background-color 200ms linear",
85
+ cursor: "pointer"
86
+ },
87
+ borderBottom: "1px solid var(--stroke-border-base, #EFF1F5)",
88
+ display: "flex",
89
+ justifyContent: "space-between",
90
+ alignItems: "center"
102
91
  },
103
- x.id
104
- )) })
105
- ]
92
+ onClick: () => {
93
+ const { link, text } = getTxLink(method, x.payment_details);
94
+ if (link && text) {
95
+ window.open(link, "_blank");
96
+ }
97
+ },
98
+ children: [
99
+ /* @__PURE__ */ jsxs(
100
+ Stack,
101
+ {
102
+ direction: "row",
103
+ alignItems: "center",
104
+ spacing: 0.5,
105
+ sx: {
106
+ flex: 3,
107
+ overflow: "hidden"
108
+ },
109
+ children: [
110
+ /* @__PURE__ */ jsx(
111
+ Avatar,
112
+ {
113
+ src: getCustomerAvatar(x.customer?.did, x?.updated_at ? new Date(x.updated_at).toISOString() : "", 20),
114
+ alt: x.customer?.name,
115
+ variant: "circular",
116
+ sx: { width: 20, height: 20 },
117
+ onClick: (e) => {
118
+ e.stopPropagation();
119
+ if (x.customer?.did) {
120
+ window.open(getUserProfileLink(x.customer?.did, locale), "_blank");
121
+ }
122
+ }
123
+ },
124
+ x.id
125
+ ),
126
+ /* @__PURE__ */ jsx(
127
+ Typography,
128
+ {
129
+ sx: {
130
+ ml: "8px !important",
131
+ fontSize: "0.875rem",
132
+ fontWeight: "500",
133
+ overflow: "hidden",
134
+ whiteSpace: "nowrap",
135
+ textOverflow: "ellipsis"
136
+ },
137
+ onClick: (e) => {
138
+ e.stopPropagation();
139
+ if (x.customer?.did) {
140
+ window.open(getUserProfileLink(x.customer?.did, locale), "_blank");
141
+ }
142
+ },
143
+ children: x.customer?.name
144
+ }
145
+ )
146
+ ]
147
+ }
148
+ ),
149
+ /* @__PURE__ */ jsxs(Stack, { direction: "row", alignItems: "center", justifyContent: "flex-end", spacing: 0.5, sx: { flex: 1 }, children: [
150
+ /* @__PURE__ */ jsx(
151
+ Avatar,
152
+ {
153
+ src: currency?.logo,
154
+ alt: currency?.symbol,
155
+ variant: "circular",
156
+ sx: { width: 16, height: 16 }
157
+ },
158
+ x.id
159
+ ),
160
+ /* @__PURE__ */ jsx(Typography, { sx: { color: "text.secondary" }, children: formatBNStr(x.amount_total, currency.decimal) }),
161
+ /* @__PURE__ */ jsx(Typography, { sx: { color: "text.secondary" }, children: currency.symbol })
162
+ ] })
163
+ ]
164
+ },
165
+ x.id
166
+ ))
106
167
  }
107
168
  );
108
169
  }
109
- function SupporterTable({ supporters = [], totalAmount = "0", currency, method }) {
110
- const { t } = useLocaleContext();
170
+ function SupporterAvatar({
171
+ supporters = [],
172
+ totalAmount = "0",
173
+ currency,
174
+ method,
175
+ showDonateDetails = false
176
+ }) {
177
+ const [open, setOpen] = useState(false);
111
178
  const customers = uniqBy(supporters, "customer_did");
112
179
  const customersNum = customers.length;
113
- return /* @__PURE__ */ jsxs(Box, { display: "flex", flexDirection: "column", alignItems: "center", gap: { xs: 0.5, sm: 1 }, children: [
114
- /* @__PURE__ */ jsx(Typography, { component: "p", color: "text.secondary", children: customersNum === 0 ? /* @__PURE__ */ jsx("span", { style: emojiFont, children: t("payment.checkout.donation.empty") }) : t("payment.checkout.donation.summary", {
115
- total: customersNum,
116
- symbol: currency.symbol,
117
- totalAmount: formatAmount(totalAmount || "0", currency.decimal)
118
- }) }),
119
- /* @__PURE__ */ jsx(Table, { size: "small", sx: { width: "100%", overflow: "hidden" }, children: /* @__PURE__ */ jsx(TableBody, { children: supporters.map((x) => /* @__PURE__ */ jsxs(
120
- TableRow,
180
+ if (customersNum === 0)
181
+ return null;
182
+ return /* @__PURE__ */ jsxs(Stack, { flexDirection: "row", justifyContent: "center", alignItems: "center", children: [
183
+ /* @__PURE__ */ jsx(AvatarGroup, { max: 5, children: customers.slice(0, 5).map((supporter) => /* @__PURE__ */ jsx(
184
+ Avatar,
121
185
  {
186
+ src: getCustomerAvatar(
187
+ supporter.customer?.did,
188
+ supporter?.updated_at ? new Date(supporter.updated_at).toISOString() : "",
189
+ 24
190
+ ),
191
+ alt: supporter.customer?.name,
122
192
  sx: {
123
- "> td": {
124
- padding: "8px 16px 8px 0",
125
- borderTop: "1px solid #e0e0e0",
126
- borderBottom: "1px solid #e0e0e0"
127
- },
128
- "> td:last-of-type": {
129
- paddingRight: "0"
193
+ width: "24px",
194
+ height: "24px"
195
+ }
196
+ },
197
+ supporter.customer?.id
198
+ )) }),
199
+ /* @__PURE__ */ jsx(
200
+ Box,
201
+ {
202
+ sx: {
203
+ fontSize: "14px",
204
+ color: "text.secondary",
205
+ pl: 1.5,
206
+ pr: 1,
207
+ ml: -1,
208
+ borderRadius: "8px",
209
+ backgroundColor: "#f4f4f5",
210
+ height: "24px",
211
+ ...showDonateDetails ? {
212
+ cursor: "pointer",
213
+ "&:hover": {
214
+ backgroundColor: "#e5e7eb"
215
+ }
216
+ } : {}
217
+ },
218
+ onClick: () => showDonateDetails && setOpen(true),
219
+ children: `${customersNum} supporter${customersNum > 1 ? "s" : ""} (${formatAmount(totalAmount || "0", currency?.decimal)} ${currency.symbol})`
220
+ }
221
+ ),
222
+ /* @__PURE__ */ jsx(
223
+ Dialog,
224
+ {
225
+ open,
226
+ onClose: () => setOpen(false),
227
+ sx: {
228
+ ".MuiDialogContent-root": {
229
+ width: "450px",
230
+ padding: "8px"
130
231
  }
131
232
  },
132
- children: [
133
- /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsxs(Stack, { direction: "row", alignItems: "center", spacing: 0.5, children: [
134
- /* @__PURE__ */ jsx(
135
- Avatar,
136
- {
137
- src: getCustomerAvatar(
138
- x.customer?.did,
139
- x?.updated_at ? new Date(x.updated_at).toISOString() : "",
140
- 48
141
- ),
142
- alt: x.customer?.name,
143
- variant: "circular",
144
- sx: { width: 24, height: 24 }
145
- },
146
- x.id
147
- ),
148
- /* @__PURE__ */ jsx(Hidden, { smDown: true, children: /* @__PURE__ */ jsx(Typography, { children: x.customer?.name }) })
149
- ] }) }),
150
- /* @__PURE__ */ jsx(TableCell, { align: "right", children: /* @__PURE__ */ jsxs(Stack, { direction: "row", alignItems: "center", justifyContent: "flex-end", spacing: 0.5, children: [
151
- /* @__PURE__ */ jsx(Typography, { fontWeight: 500, component: "strong", children: formatBNStr(x.amount_total, currency.decimal) }),
152
- /* @__PURE__ */ jsx(Typography, { component: "span", children: currency.symbol })
153
- ] }) }),
154
- /* @__PURE__ */ jsx(Hidden, { smDown: true, children: /* @__PURE__ */ jsx(TableCell, { align: "right", children: /* @__PURE__ */ jsx(Typography, { children: formatDateTime(x.created_at) }) }) }),
155
- /* @__PURE__ */ jsx(TableCell, { align: "right", children: /* @__PURE__ */ jsx(TxLink, { method, details: x.payment_details, mode: "customer", align: "right" }) })
156
- ]
157
- },
158
- x.id
159
- )) }) })
233
+ title: `${customersNum} supporter${customersNum > 1 ? "s" : ""}`,
234
+ children: /* @__PURE__ */ jsx(DonateDetails, { supporters, currency, method, totalAmount })
235
+ }
236
+ )
237
+ ] });
238
+ }
239
+ function SupporterTable({ supporters = [], totalAmount = "0", currency, method }) {
240
+ const customers = uniqBy(supporters, "customer_did");
241
+ const customersNum = customers.length;
242
+ if (customersNum === 0)
243
+ return null;
244
+ return /* @__PURE__ */ jsxs(Box, { display: "flex", flexDirection: "column", alignItems: "center", gap: { xs: 0.5, sm: 1 }, children: [
245
+ /* @__PURE__ */ jsx(SupporterAvatar, { supporters, totalAmount, currency, method }),
246
+ /* @__PURE__ */ jsx(DonateDetails, { supporters, totalAmount, currency, method })
160
247
  ] });
161
248
  }
162
249
  function SupporterSimple({ supporters = [], totalAmount = "0", currency, method }) {
@@ -404,16 +491,28 @@ function CheckoutDonateInner({
404
491
  {
405
492
  size: donateSettings.appearance?.button?.size || "medium",
406
493
  color: donateSettings.appearance?.button?.color || "primary",
407
- variant: donateSettings.appearance?.button?.variant || "contained",
494
+ variant: donateSettings.appearance?.button?.variant || "outlined",
495
+ sx: {
496
+ ...!donateSettings.appearance?.button?.variant ? {
497
+ color: "var(--foregrounds-fg-base, #010714)",
498
+ borderColor: "var(--stroke-button-secondary-border, #E5E7EB)",
499
+ "&:hover": {
500
+ backgroundColor: "var(--buttons-button-neutral-hover, #F3F4F6)",
501
+ borderColor: "var(--stroke-button-secondary-border, #E5E7EB)"
502
+ }
503
+ } : {},
504
+ // @ts-ignore
505
+ ...donateSettings.appearance?.button?.sx || {}
506
+ },
408
507
  ...donateSettings.appearance?.button,
409
508
  onClick: () => startDonate(),
410
509
  children: /* @__PURE__ */ jsxs(Stack, { direction: "row", alignItems: "center", spacing: 0.5, children: [
411
- donateSettings.appearance.button.icon,
510
+ donateSettings.appearance.button.icon && /* @__PURE__ */ jsx(Typography, { sx: { mr: 0.5, display: "inline-flex", alignItems: "center" }, children: donateSettings.appearance.button.icon }),
412
511
  typeof donateSettings.appearance.button.text === "string" ? /* @__PURE__ */ jsx(Typography, { children: donateSettings.appearance.button.text }) : donateSettings.appearance.button.text
413
512
  ] })
414
513
  }
415
514
  ),
416
- supporters.data && donateSettings.appearance.history.variant === "avatar" && /* @__PURE__ */ jsx(SupporterAvatar, { ...supporters.data }),
515
+ supporters.data && donateSettings.appearance.history.variant === "avatar" && /* @__PURE__ */ jsx(SupporterAvatar, { ...supporters.data, showDonateDetails: true }),
417
516
  supporters.data && donateSettings.appearance.history.variant === "table" && /* @__PURE__ */ jsx(SupporterTable, { ...supporters.data })
418
517
  ]
419
518
  }
@@ -14,7 +14,7 @@ export default function Livemode({ color, backgroundColor, sx }) {
14
14
  height: 18,
15
15
  lineHeight: 1.2,
16
16
  textTransform: "uppercase",
17
- fontSize: "0.8rem",
17
+ fontSize: "0.7rem",
18
18
  fontWeight: "bold",
19
19
  borderRadius: "4px",
20
20
  backgroundColor,
@@ -52,7 +52,7 @@ const Table = React.memo(
52
52
  );
53
53
  const Wrapped = styled(Datatable)`
54
54
  ${(props) => props?.hasRowLink ? `.MuiTableCell-root {
55
- font-size: 1rem !important;
55
+ font-size: 0.875rem !important;
56
56
  }` : ""}
57
57
  .MuiPaper-root {
58
58
  border-radius: 8px;
package/es/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/es/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import CheckoutDonate from "./checkout/donate.js";
1
+ import CheckoutDonate, { DonateDetails } from "./checkout/donate.js";
2
2
  import CheckoutForm from "./checkout/form.js";
3
3
  import CheckoutTable from "./checkout/table.js";
4
4
  import TxGas from "./components/blockchain/gas.js";
@@ -76,5 +76,6 @@ export {
76
76
  Link,
77
77
  OverdueInvoicePayment,
78
78
  PaymentBeneficiaries,
79
- LoadingButton
79
+ LoadingButton,
80
+ DonateDetails
80
81
  };
package/es/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/es/libs/util.js CHANGED
@@ -4,7 +4,7 @@ import trimEnd from "lodash/trimEnd";
4
4
  import numbro from "numbro";
5
5
  import stringWidth from "string-width";
6
6
  import { defaultCountries } from "react-international-phone";
7
- import { joinURL } from "ufo";
7
+ import { joinURL, withQuery } from "ufo";
8
8
  import { t } from "../locales/index.js";
9
9
  import dayjs from "./dayjs.js";
10
10
  export const PAYMENT_KIT_DID = "z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk";
@@ -924,3 +924,12 @@ export function openDonationSettings(openInNewTab = false) {
924
924
  window.open(`${window.location.origin}${mountPoint}/integrations/donations`, openInNewTab ? "_blank" : "_self");
925
925
  }
926
926
  }
927
+ export function getUserProfileLink(userDid, locale = "en") {
928
+ return joinURL(
929
+ window.location.origin,
930
+ withQuery(".well-known/service/user", {
931
+ locale,
932
+ did: userDid
933
+ })
934
+ );
935
+ }
@@ -8,7 +8,7 @@ export default function PaymentAmount({ amount, sx }) {
8
8
  sx: {
9
9
  my: 0.5,
10
10
  fontWeight: 600,
11
- fontSize: "2.5rem",
11
+ fontSize: "2.1875rem",
12
12
  letterSpacing: "-0.03rem",
13
13
  fontVariantNumeric: "tabular-nums",
14
14
  ...sx
@@ -497,7 +497,7 @@ export default function PaymentForm({
497
497
  children: state.submitting || state.paying ? t("payment.checkout.processing") : buttonText
498
498
  }
499
499
  ) }),
500
- ["subscription", "setup"].includes(checkoutSession.mode) && /* @__PURE__ */ jsx(Typography, { sx: { mt: 2.5, color: "text.lighter", fontSize: "0.9rem", lineHeight: "1.1rem" }, children: t("payment.checkout.confirm", { payee }) })
500
+ ["subscription", "setup"].includes(checkoutSession.mode) && /* @__PURE__ */ jsx(Typography, { sx: { mt: 2.5, color: "text.lighter", fontSize: "0.7875rem", lineHeight: "0.9625rem" }, children: t("payment.checkout.confirm", { payee }) })
501
501
  ] }) }),
502
502
  state.customerLimited && /* @__PURE__ */ jsx(
503
503
  ConfirmDialog,
@@ -102,7 +102,7 @@ function StripeCheckoutForm({
102
102
  LoadingButton,
103
103
  {
104
104
  fullWidth: true,
105
- sx: { mt: 2, mb: 1, borderRadius: 0, fontSize: "1.1rem" },
105
+ sx: { mt: 2, mb: 1, borderRadius: 0, fontSize: "0.875rem" },
106
106
  type: "submit",
107
107
  disabled: state.confirming || !state.loaded,
108
108
  loading: state.confirming,
@@ -34,12 +34,12 @@ export default function ProductCard({ size, variant, name, logo, description, ex
34
34
  {
35
35
  variant: "body1",
36
36
  title: description,
37
- sx: { fontSize: "0.85rem", mb: 0.5, lineHeight: 1.2, textAlign: "left" },
37
+ sx: { fontSize: "0.74375rem", mb: 0.5, lineHeight: 1.2, textAlign: "left" },
38
38
  color: "text.lighter",
39
39
  children: description
40
40
  }
41
41
  ),
42
- extra && /* @__PURE__ */ jsx(Box, { sx: { fontSize: "0.85rem" }, color: "text.lighter", children: extra })
42
+ extra && /* @__PURE__ */ jsx(Box, { sx: { fontSize: "0.74375rem" }, color: "text.lighter", children: extra })
43
43
  ]
44
44
  }
45
45
  )
@@ -65,7 +65,7 @@ export default function ProductItem({
65
65
  ),
66
66
  /* @__PURE__ */ jsxs(Stack, { direction: "column", alignItems: "flex-end", flex: 1, children: [
67
67
  /* @__PURE__ */ jsx(Typography, { sx: { color: "text.primary", fontWeight: 500, whiteSpace: "nowrap" }, gutterBottom: true, children: primaryText }),
68
- pricing.secondary && /* @__PURE__ */ jsx(Typography, { sx: { fontSize: "0.85rem", color: "text.lighter" }, children: pricing.secondary })
68
+ pricing.secondary && /* @__PURE__ */ jsx(Typography, { sx: { fontSize: "0.74375rem", color: "text.lighter" }, children: pricing.secondary })
69
69
  ] })
70
70
  ]
71
71
  }
@@ -21,12 +21,12 @@ export default function ProductSkeleton({ count }) {
21
21
  },
22
22
  children: [
23
23
  /* @__PURE__ */ jsx(Typography, { component: "div", variant: "h4", sx: { width: "50%" }, children: /* @__PURE__ */ jsx(Skeleton, {}) }),
24
- /* @__PURE__ */ jsx(Skeleton, { variant: "text", sx: { fontSize: "1rem", width: "60%" } }),
24
+ /* @__PURE__ */ jsx(Skeleton, { variant: "text", sx: { fontSize: "0.875rem", width: "60%" } }),
25
25
  /* @__PURE__ */ jsx(Typography, { component: "div", variant: "h3", sx: { width: "60%" }, children: /* @__PURE__ */ jsx(Skeleton, {}) }),
26
26
  /* @__PURE__ */ jsx(Typography, { component: "div", variant: "h3", sx: { width: "100%" }, children: /* @__PURE__ */ jsx(Skeleton, {}) }),
27
27
  Array.from({ length: count }).map((_, i) => (
28
28
  // eslint-disable-next-line react/no-array-index-key
29
- /* @__PURE__ */ jsx(Skeleton, { variant: "text", sx: { fontSize: "1rem", width: "60%" } }, i)
29
+ /* @__PURE__ */ jsx(Skeleton, { variant: "text", sx: { fontSize: "0.875rem", width: "60%" } }, i)
30
30
  ))
31
31
  ]
32
32
  }
@@ -2,7 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Box, Divider, Fade, Skeleton, Stack } from "@mui/material";
3
3
  export default function DonationSkeleton() {
4
4
  return /* @__PURE__ */ jsx(Fade, { in: true, children: /* @__PURE__ */ jsxs(Stack, { direction: "column", children: [
5
- /* @__PURE__ */ jsx(Skeleton, { variant: "text", sx: { fontSize: "2rem", width: "40%" } }),
5
+ /* @__PURE__ */ jsx(Skeleton, { variant: "text", sx: { fontSize: "1.75rem", width: "40%" } }),
6
6
  /* @__PURE__ */ jsx(Skeleton, { sx: { mt: 2 }, variant: "rounded", height: 40 }),
7
7
  /* @__PURE__ */ jsx(
8
8
  Divider,
@@ -2,7 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Fade, Skeleton, Stack, Typography } from "@mui/material";
3
3
  export default function OverviewSkeleton() {
4
4
  return /* @__PURE__ */ jsx(Fade, { in: true, children: /* @__PURE__ */ jsxs(Stack, { direction: "column", children: [
5
- /* @__PURE__ */ jsx(Stack, { direction: "row", alignItems: "center", spacing: 2, children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", sx: { fontSize: "2rem", width: "40%" } }) }),
5
+ /* @__PURE__ */ jsx(Stack, { direction: "row", alignItems: "center", spacing: 2, children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", sx: { fontSize: "1.75rem", width: "40%" } }) }),
6
6
  /* @__PURE__ */ jsx(Skeleton, { sx: { mt: 2 }, variant: "rounded", height: 100 }),
7
7
  /* @__PURE__ */ jsx(Typography, { mt: 2, component: "div", variant: "h4", children: /* @__PURE__ */ jsx(Skeleton, {}) }),
8
8
  /* @__PURE__ */ jsx(Typography, { component: "div", variant: "h2", children: /* @__PURE__ */ jsx(Skeleton, {}) })
@@ -2,7 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Box, Fade, Skeleton, Stack, Typography } from "@mui/material";
3
3
  export default function PaymentSkeleton() {
4
4
  return /* @__PURE__ */ jsx(Fade, { in: true, children: /* @__PURE__ */ jsxs(Stack, { direction: "column", children: [
5
- /* @__PURE__ */ jsx(Skeleton, { variant: "text", sx: { fontSize: "2rem", width: "40%" } }),
5
+ /* @__PURE__ */ jsx(Skeleton, { variant: "text", sx: { fontSize: "1.75rem", width: "40%" } }),
6
6
  /* @__PURE__ */ jsx(Skeleton, { sx: { mt: 2 }, variant: "rounded", height: 68 }),
7
7
  /* @__PURE__ */ jsxs(Box, { mt: 1, children: [
8
8
  /* @__PURE__ */ jsx(Typography, { component: "div", variant: "h4", mb: -1, children: /* @__PURE__ */ jsx(Skeleton, {}) }),
@@ -309,7 +309,7 @@ export default function PaymentSummary({
309
309
  Typography,
310
310
  {
311
311
  component: "div",
312
- sx: { fontSize: "0.9rem", color: "text.lighter", textAlign: "right", margin: "-2px 0 8px" },
312
+ sx: { fontSize: "0.7875rem", color: "text.lighter", textAlign: "right", margin: "-2px 0 8px" },
313
313
  children: headlines.then
314
314
  }
315
315
  )
package/es/theme/index.js CHANGED
@@ -50,7 +50,7 @@ export function PaymentThemeProvider({
50
50
  },
51
51
  styleOverrides: {
52
52
  root: {
53
- fontSize: "1rem",
53
+ fontSize: "0.875rem",
54
54
  fontWeight: 500,
55
55
  textTransform: "none",
56
56
  boxShadow: "none"
@@ -98,7 +98,8 @@ export function PaymentThemeProvider({
98
98
  MuiTab: {
99
99
  styleOverrides: {
100
100
  root: {
101
- textTransform: "none"
101
+ textTransform: "none",
102
+ fontSize: "0.875rem"
102
103
  }
103
104
  }
104
105
  },
@@ -1,6 +1,6 @@
1
1
  export const typography = {
2
2
  h1: {
3
- fontSize: "1.875rem",
3
+ fontSize: "1.5rem",
4
4
  lineHeight: 1.2,
5
5
  fontWeight: 800,
6
6
  letterSpacing: "-.025em"
@@ -12,38 +12,38 @@ export const typography = {
12
12
  letterSpacing: "-.025em"
13
13
  },
14
14
  h3: {
15
- fontSize: "1.25rem",
15
+ fontSize: "1.09375rem",
16
16
  lineHeight: 1.4,
17
17
  fontWeight: 600,
18
18
  letterSpacing: "-.025em"
19
19
  },
20
20
  h4: {
21
- fontSize: "1.125rem",
21
+ fontSize: "1.09375rem",
22
22
  lineHeight: 1.5,
23
23
  fontWeight: 600
24
24
  },
25
25
  h5: {
26
- fontSize: "1rem",
26
+ fontSize: "0.875rem",
27
27
  lineHeight: 1.75,
28
28
  fontWeight: 400
29
29
  },
30
30
  h6: {
31
- fontSize: "1rem",
31
+ fontSize: "0.875rem",
32
32
  lineHeight: 1.75,
33
33
  fontWeight: 400
34
34
  },
35
35
  subtitle1: {
36
- fontSize: "1rem",
36
+ fontSize: "0.875rem",
37
37
  lineHeight: 1.75,
38
38
  fontWeight: 400
39
39
  },
40
40
  subtitle2: {
41
- fontSize: "1rem",
41
+ fontSize: "0.875rem",
42
42
  lineHeight: 1.75,
43
43
  fontWeight: 400
44
44
  },
45
45
  body1: {
46
- fontSize: "1rem",
46
+ fontSize: "0.875rem",
47
47
  lineHeight: 1.75
48
48
  },
49
49
  fontWeightLight: 300,
@@ -5,6 +5,7 @@ export type DonateHistory = {
5
5
  supporters: TCheckoutSessionExpanded[];
6
6
  currency: TPaymentCurrency;
7
7
  method: TPaymentMethod;
8
+ total?: number;
8
9
  totalAmount: string;
9
10
  };
10
11
  export type CheckoutDonateSettings = {
@@ -48,6 +49,7 @@ export type DonateProps = Pick<CheckoutProps, 'onPaid' | 'onError'> & {
48
49
  theme?: 'default' | 'inherit' | PaymentThemeOptions;
49
50
  children?: (openDialog: () => void, donateTotalAmount: string, supporters: DonateHistory, loading?: boolean, donateSettings?: DonationSettings) => React.ReactNode;
50
51
  };
52
+ export declare function DonateDetails({ supporters, currency, method }: DonateHistory): import("react").JSX.Element;
51
53
  declare function CheckoutDonate(props: DonateProps): import("react").JSX.Element;
52
54
  declare namespace CheckoutDonate {
53
55
  var defaultProps: {