@blocklet/payment-react 1.18.55 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/checkout/donate.d.ts +1 -15
- package/es/checkout/donate.js +301 -189
- package/es/checkout/form.d.ts +1 -15
- package/es/checkout/form.js +5 -13
- package/es/checkout/table.js +3 -3
- package/es/components/blockchain/gas.d.ts +1 -5
- package/es/components/blockchain/gas.js +10 -2
- package/es/components/blockchain/tx.d.ts +1 -8
- package/es/components/blockchain/tx.js +28 -7
- package/es/components/confirm.d.ts +1 -10
- package/es/components/confirm.js +4 -10
- package/es/components/country-select.d.ts +3 -2
- package/es/components/country-select.js +375 -352
- package/es/components/input.d.ts +11 -20
- package/es/components/input.js +46 -43
- package/es/components/lazy-loader.js +1 -2
- package/es/components/link.d.ts +2 -9
- package/es/components/link.js +9 -6
- package/es/components/livemode.d.ts +2 -8
- package/es/components/livemode.js +1 -5
- package/es/components/loading-button.d.ts +6 -1
- package/es/components/loading-button.js +56 -66
- package/es/components/over-due-invoice-payment.d.ts +0 -18
- package/es/components/over-due-invoice-payment.js +138 -95
- package/es/components/payment-beneficiaries.d.ts +2 -7
- package/es/components/payment-beneficiaries.js +86 -40
- package/es/components/pricing-item.d.ts +0 -5
- package/es/components/pricing-item.js +1 -4
- package/es/components/pricing-table.d.ts +2 -10
- package/es/components/pricing-table.js +8 -7
- package/es/components/resume-subscription.d.ts +0 -10
- package/es/components/resume-subscription.js +42 -21
- package/es/components/truncated-text.d.ts +2 -9
- package/es/components/truncated-text.js +0 -5
- package/es/contexts/donate.d.ts +0 -7
- package/es/contexts/donate.js +10 -8
- package/es/contexts/payment.d.ts +1 -4
- package/es/contexts/payment.js +7 -2
- package/es/history/invoice/list.d.ts +2 -18
- package/es/history/invoice/list.js +151 -73
- package/es/history/payment/list.js +115 -38
- package/es/hooks/keyboard.d.ts +1 -1
- package/es/hooks/keyboard.js +2 -4
- package/es/libs/cached-request.js +2 -4
- package/es/libs/phone-validator.js +1 -2
- package/es/libs/util.js +2 -4
- package/es/libs/validator.js +2 -4
- package/es/payment/amount.d.ts +2 -7
- package/es/payment/amount.js +1 -5
- package/es/payment/donation-form.d.ts +2 -10
- package/es/payment/donation-form.js +196 -160
- package/es/payment/error.d.ts +2 -8
- package/es/payment/error.js +40 -20
- package/es/payment/footer.d.ts +2 -3
- package/es/payment/footer.js +19 -6
- package/es/payment/form/addon.js +14 -4
- package/es/payment/form/address.d.ts +2 -9
- package/es/payment/form/address.js +3 -6
- package/es/payment/form/currency.js +45 -25
- package/es/payment/form/index.d.ts +2 -8
- package/es/payment/form/index.js +107 -65
- package/es/payment/form/phone.js +2 -4
- package/es/payment/form/stripe/form.d.ts +2 -8
- package/es/payment/form/stripe/form.js +1 -3
- package/es/payment/header.js +38 -16
- package/es/payment/index.d.ts +2 -9
- package/es/payment/index.js +5 -14
- package/es/payment/product-card.d.ts +2 -11
- package/es/payment/product-card.js +84 -50
- package/es/payment/product-donation.js +175 -114
- package/es/payment/product-item.d.ts +2 -9
- package/es/payment/product-item.js +185 -142
- package/es/payment/product-skeleton.js +2 -2
- package/es/payment/skeleton/donation.js +27 -7
- package/es/payment/skeleton/overview.js +22 -2
- package/es/payment/skeleton/payment.js +33 -5
- package/es/payment/success.d.ts +2 -9
- package/es/payment/success.js +41 -14
- package/es/payment/summary.d.ts +2 -17
- package/es/payment/summary.js +184 -111
- package/es/theme/index.d.ts +0 -5
- package/es/theme/index.js +2 -5
- package/es/theme/typography.d.ts +2 -2
- package/lib/checkout/donate.d.ts +1 -15
- package/lib/checkout/donate.js +75 -54
- package/lib/checkout/form.d.ts +1 -15
- package/lib/checkout/form.js +7 -15
- package/lib/checkout/table.js +4 -4
- package/lib/components/blockchain/gas.d.ts +1 -5
- package/lib/components/blockchain/gas.js +3 -2
- package/lib/components/blockchain/tx.d.ts +1 -8
- package/lib/components/blockchain/tx.js +11 -7
- package/lib/components/confirm.d.ts +1 -10
- package/lib/components/confirm.js +5 -11
- package/lib/components/country-select.d.ts +3 -2
- package/lib/components/country-select.js +23 -22
- package/lib/components/input.d.ts +11 -20
- package/lib/components/input.js +20 -23
- package/lib/components/lazy-loader.js +1 -1
- package/lib/components/link.d.ts +2 -9
- package/lib/components/link.js +3 -8
- package/lib/components/livemode.d.ts +2 -8
- package/lib/components/livemode.js +3 -7
- package/lib/components/loading-button.d.ts +6 -1
- package/lib/components/loading-button.js +9 -17
- package/lib/components/over-due-invoice-payment.d.ts +0 -18
- package/lib/components/over-due-invoice-payment.js +31 -33
- package/lib/components/payment-beneficiaries.d.ts +2 -7
- package/lib/components/payment-beneficiaries.js +12 -11
- package/lib/components/pricing-item.d.ts +0 -5
- package/lib/components/pricing-item.js +2 -5
- package/lib/components/pricing-table.d.ts +2 -10
- package/lib/components/pricing-table.js +5 -11
- package/lib/components/resume-subscription.d.ts +0 -10
- package/lib/components/resume-subscription.js +16 -16
- package/lib/components/table.js +1 -1
- package/lib/components/truncated-text.d.ts +2 -9
- package/lib/components/truncated-text.js +1 -6
- package/lib/contexts/donate.d.ts +0 -7
- package/lib/contexts/donate.js +4 -7
- package/lib/contexts/payment.d.ts +1 -4
- package/lib/contexts/payment.js +4 -7
- package/lib/history/invoice/list.d.ts +2 -18
- package/lib/history/invoice/list.js +49 -37
- package/lib/history/payment/list.js +30 -16
- package/lib/hooks/keyboard.d.ts +1 -1
- package/lib/hooks/mobile.js +1 -1
- package/lib/hooks/subscription.js +1 -1
- package/lib/index.js +2 -2
- package/lib/libs/api.js +1 -1
- package/lib/libs/dayjs.js +1 -1
- package/lib/libs/phone-validator.js +0 -2
- package/lib/libs/theme.js +1 -1
- package/lib/libs/util.js +1 -1
- package/lib/libs/validator.js +1 -1
- package/lib/locales/en.js +1 -1
- package/lib/locales/index.js +1 -1
- package/lib/locales/zh.js +1 -1
- package/lib/payment/amount.d.ts +2 -7
- package/lib/payment/amount.js +2 -6
- package/lib/payment/donation-form.d.ts +2 -10
- package/lib/payment/donation-form.js +33 -38
- package/lib/payment/error.d.ts +2 -8
- package/lib/payment/error.js +11 -13
- package/lib/payment/footer.d.ts +2 -3
- package/lib/payment/footer.js +5 -5
- package/lib/payment/form/addon.js +5 -3
- package/lib/payment/form/address.d.ts +2 -9
- package/lib/payment/form/address.js +5 -8
- package/lib/payment/form/currency.js +3 -3
- package/lib/payment/form/index.d.ts +2 -8
- package/lib/payment/form/index.js +19 -15
- package/lib/payment/form/phone.js +1 -1
- package/lib/payment/form/stripe/form.d.ts +2 -8
- package/lib/payment/form/stripe/form.js +3 -6
- package/lib/payment/header.js +8 -4
- package/lib/payment/index.d.ts +2 -9
- package/lib/payment/index.js +7 -16
- package/lib/payment/product-card.d.ts +2 -11
- package/lib/payment/product-card.js +13 -20
- package/lib/payment/product-donation.js +71 -66
- package/lib/payment/product-item.d.ts +2 -9
- package/lib/payment/product-item.js +24 -25
- package/lib/payment/product-skeleton.js +2 -2
- package/lib/payment/skeleton/donation.js +8 -4
- package/lib/payment/skeleton/overview.js +6 -2
- package/lib/payment/skeleton/payment.js +9 -3
- package/lib/payment/success.d.ts +2 -9
- package/lib/payment/success.js +12 -15
- package/lib/payment/summary.d.ts +2 -17
- package/lib/payment/summary.js +44 -45
- package/lib/theme/index.d.ts +0 -5
- package/lib/theme/index.js +2 -5
- package/lib/theme/typography.d.ts +2 -2
- package/package.json +40 -40
- package/src/checkout/donate.tsx +103 -35
- package/src/checkout/form.tsx +5 -14
- package/src/checkout/table.tsx +3 -3
- package/src/components/blockchain/gas.tsx +5 -3
- package/src/components/blockchain/tx.tsx +22 -8
- package/src/components/confirm.tsx +4 -11
- package/src/components/country-select.tsx +391 -378
- package/src/components/input.tsx +49 -45
- package/src/components/link.tsx +9 -7
- package/src/components/livemode.tsx +2 -6
- package/src/components/loading-button.tsx +63 -76
- package/src/components/over-due-invoice-payment.tsx +43 -28
- package/src/components/payment-beneficiaries.tsx +33 -14
- package/src/components/pricing-item.tsx +1 -4
- package/src/components/pricing-table.tsx +8 -8
- package/src/components/resume-subscription.tsx +20 -14
- package/src/components/table.tsx +2 -2
- package/src/components/truncated-text.tsx +0 -6
- package/src/contexts/donate.tsx +6 -7
- package/src/contexts/payment.tsx +7 -3
- package/src/history/invoice/list.tsx +74 -35
- package/src/history/payment/list.tsx +53 -16
- package/src/hooks/keyboard.ts +1 -1
- package/src/payment/amount.tsx +1 -6
- package/src/payment/donation-form.tsx +47 -29
- package/src/payment/error.tsx +16 -8
- package/src/payment/footer.tsx +11 -3
- package/src/payment/form/addon.tsx +6 -1
- package/src/payment/form/address.tsx +3 -7
- package/src/payment/form/currency.tsx +12 -2
- package/src/payment/form/index.tsx +30 -12
- package/src/payment/form/stripe/form.tsx +1 -5
- package/src/payment/header.tsx +14 -2
- package/src/payment/index.tsx +10 -21
- package/src/payment/product-card.tsx +41 -18
- package/src/payment/product-donation.tsx +85 -47
- package/src/payment/product-item.tsx +46 -24
- package/src/payment/product-skeleton.tsx +3 -2
- package/src/payment/skeleton/donation.tsx +12 -2
- package/src/payment/skeleton/overview.tsx +12 -2
- package/src/payment/skeleton/payment.tsx +16 -3
- package/src/payment/success.tsx +26 -15
- package/src/payment/summary.tsx +74 -42
- package/src/theme/index.tsx +5 -8
- package/src/theme/typography.ts +2 -2
|
@@ -13,19 +13,14 @@ import {
|
|
|
13
13
|
} from "../libs/util.js";
|
|
14
14
|
import ProductCard from "./product-card.js";
|
|
15
15
|
import dayjs from "../libs/dayjs.js";
|
|
16
|
-
ProductItem.defaultProps = {
|
|
17
|
-
mode: "normal",
|
|
18
|
-
children: null,
|
|
19
|
-
trialEnd: 0
|
|
20
|
-
};
|
|
21
16
|
export default function ProductItem({
|
|
22
17
|
item,
|
|
23
18
|
items,
|
|
24
19
|
trialInDays,
|
|
25
20
|
trialEnd = 0,
|
|
26
21
|
currency,
|
|
27
|
-
mode,
|
|
28
|
-
children,
|
|
22
|
+
mode = "normal",
|
|
23
|
+
children = null,
|
|
29
24
|
onUpsell,
|
|
30
25
|
onDownsell
|
|
31
26
|
}) {
|
|
@@ -43,140 +38,188 @@ export default function ProductItem({
|
|
|
43
38
|
}
|
|
44
39
|
return pricing.primary;
|
|
45
40
|
}, [trialInDays, trialEnd, pricing, item, locale]);
|
|
46
|
-
return /* @__PURE__ */ jsxs(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
{
|
|
124
|
-
label: t("payment.checkout.upsell.off", { saving }),
|
|
125
|
-
variant: "outlined",
|
|
126
|
-
sx: {
|
|
127
|
-
ml: 1,
|
|
128
|
-
borderColor: "chip.warning.border",
|
|
129
|
-
backgroundColor: "chip.warning.background",
|
|
130
|
-
color: "chip.warning.text"
|
|
131
|
-
}
|
|
41
|
+
return /* @__PURE__ */ jsxs(
|
|
42
|
+
Stack,
|
|
43
|
+
{
|
|
44
|
+
direction: "column",
|
|
45
|
+
spacing: 1,
|
|
46
|
+
className: "product-item",
|
|
47
|
+
sx: {
|
|
48
|
+
alignItems: "flex-start",
|
|
49
|
+
width: "100%"
|
|
50
|
+
},
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ jsxs(
|
|
53
|
+
Stack,
|
|
54
|
+
{
|
|
55
|
+
direction: "column",
|
|
56
|
+
className: "product-item-content",
|
|
57
|
+
sx: {
|
|
58
|
+
alignItems: "flex-start",
|
|
59
|
+
width: "100%"
|
|
60
|
+
},
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ jsxs(
|
|
63
|
+
Stack,
|
|
64
|
+
{
|
|
65
|
+
direction: "row",
|
|
66
|
+
spacing: 0.5,
|
|
67
|
+
sx: {
|
|
68
|
+
alignItems: "center",
|
|
69
|
+
flexWrap: "wrap",
|
|
70
|
+
justifyContent: "space-between",
|
|
71
|
+
width: "100%"
|
|
72
|
+
},
|
|
73
|
+
children: [
|
|
74
|
+
/* @__PURE__ */ jsx(
|
|
75
|
+
ProductCard,
|
|
76
|
+
{
|
|
77
|
+
logo: item.price.product?.images[0],
|
|
78
|
+
name: item.price.product?.name,
|
|
79
|
+
extra: /* @__PURE__ */ jsx(
|
|
80
|
+
Box,
|
|
81
|
+
{
|
|
82
|
+
sx: {
|
|
83
|
+
display: "flex",
|
|
84
|
+
alignItems: "center"
|
|
85
|
+
},
|
|
86
|
+
children: item.price.type === "recurring" && item.price.recurring ? [pricing.quantity, t("common.billed", { rule: `${formatRecurring(item.upsell_price?.recurring || item.price.recurring, true, "per", locale)} ${metered}` })].filter(Boolean).join(", ") : pricing.quantity
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
/* @__PURE__ */ jsxs(
|
|
92
|
+
Stack,
|
|
93
|
+
{
|
|
94
|
+
direction: "column",
|
|
95
|
+
sx: {
|
|
96
|
+
alignItems: "flex-end",
|
|
97
|
+
flex: 1
|
|
98
|
+
},
|
|
99
|
+
children: [
|
|
100
|
+
/* @__PURE__ */ jsx(Typography, { sx: { color: "text.primary", fontWeight: 500, whiteSpace: "nowrap" }, gutterBottom: true, children: primaryText }),
|
|
101
|
+
pricing.secondary && /* @__PURE__ */ jsx(Typography, { sx: { fontSize: "0.74375rem", color: "text.lighter" }, children: pricing.secondary })
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
formatQuantityInventory(item.price, item.quantity, locale) ? /* @__PURE__ */ jsx(
|
|
109
|
+
Status,
|
|
110
|
+
{
|
|
111
|
+
label: formatQuantityInventory(item.price, item.quantity, locale),
|
|
112
|
+
variant: "outlined",
|
|
113
|
+
sx: {
|
|
114
|
+
mt: 1,
|
|
115
|
+
borderColor: "chip.error.border",
|
|
116
|
+
backgroundColor: "chip.error.background",
|
|
117
|
+
color: "chip.error.text"
|
|
132
118
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
119
|
+
}
|
|
120
|
+
) : null,
|
|
121
|
+
children
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
canUpsell && !item.upsell_price_id && item.price.upsell?.upsells_to && /* @__PURE__ */ jsxs(
|
|
126
|
+
Stack,
|
|
127
|
+
{
|
|
128
|
+
direction: "row",
|
|
129
|
+
className: "product-item-upsell",
|
|
130
|
+
sx: {
|
|
131
|
+
alignItems: "center",
|
|
132
|
+
justifyContent: "space-between",
|
|
133
|
+
width: "100%"
|
|
134
|
+
},
|
|
135
|
+
children: [
|
|
136
|
+
/* @__PURE__ */ jsxs(
|
|
137
|
+
Typography,
|
|
138
|
+
{
|
|
139
|
+
component: "label",
|
|
140
|
+
htmlFor: "upsell-switch",
|
|
141
|
+
sx: {
|
|
142
|
+
fontSize: 12,
|
|
143
|
+
cursor: "pointer",
|
|
144
|
+
color: "text.secondary"
|
|
145
|
+
},
|
|
146
|
+
children: [
|
|
147
|
+
/* @__PURE__ */ jsx(
|
|
148
|
+
Switch,
|
|
149
|
+
{
|
|
150
|
+
id: "upsell-switch",
|
|
151
|
+
sx: { mr: 1 },
|
|
152
|
+
variant: "success",
|
|
153
|
+
checked: false,
|
|
154
|
+
onChange: () => onUpsell(item.price_id, item.price.upsell?.upsells_to_id)
|
|
155
|
+
}
|
|
156
|
+
),
|
|
157
|
+
t("payment.checkout.upsell.save", {
|
|
158
|
+
recurring: formatRecurring(item.price.upsell.upsells_to.recurring, true, "per", locale)
|
|
159
|
+
}),
|
|
160
|
+
/* @__PURE__ */ jsx(
|
|
161
|
+
Status,
|
|
162
|
+
{
|
|
163
|
+
label: t("payment.checkout.upsell.off", { saving }),
|
|
164
|
+
variant: "outlined",
|
|
165
|
+
sx: {
|
|
166
|
+
ml: 1,
|
|
167
|
+
borderColor: "chip.warning.border",
|
|
168
|
+
backgroundColor: "chip.warning.background",
|
|
169
|
+
color: "chip.warning.text"
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
)
|
|
173
|
+
]
|
|
174
|
+
}
|
|
175
|
+
),
|
|
176
|
+
/* @__PURE__ */ jsx(Typography, { component: "span", sx: { fontSize: 12 }, children: formatPrice(item.price.upsell.upsells_to, currency, item.price.product?.unit_label, 1, true, locale) })
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
),
|
|
180
|
+
canUpsell && item.upsell_price_id && /* @__PURE__ */ jsxs(
|
|
181
|
+
Stack,
|
|
182
|
+
{
|
|
183
|
+
direction: "row",
|
|
184
|
+
className: "product-item-upsell",
|
|
185
|
+
sx: {
|
|
186
|
+
alignItems: "center",
|
|
187
|
+
justifyContent: "space-between",
|
|
188
|
+
width: "100%"
|
|
189
|
+
},
|
|
190
|
+
children: [
|
|
191
|
+
/* @__PURE__ */ jsxs(
|
|
192
|
+
Typography,
|
|
193
|
+
{
|
|
194
|
+
component: "label",
|
|
195
|
+
htmlFor: "upsell-switch",
|
|
196
|
+
sx: {
|
|
197
|
+
fontSize: 12,
|
|
198
|
+
cursor: "pointer",
|
|
199
|
+
color: "text.secondary"
|
|
200
|
+
},
|
|
201
|
+
children: [
|
|
202
|
+
/* @__PURE__ */ jsx(
|
|
203
|
+
Switch,
|
|
204
|
+
{
|
|
205
|
+
id: "upsell-switch",
|
|
206
|
+
sx: { mr: 1 },
|
|
207
|
+
variant: "success",
|
|
208
|
+
checked: true,
|
|
209
|
+
onChange: () => onDownsell(item.upsell_price_id)
|
|
210
|
+
}
|
|
211
|
+
),
|
|
212
|
+
t("payment.checkout.upsell.revert", {
|
|
213
|
+
recurring: t(`common.${formatRecurring(item.price.recurring)}`)
|
|
214
|
+
})
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
),
|
|
218
|
+
/* @__PURE__ */ jsx(Typography, { component: "span", sx: { fontSize: 12 }, children: formatPrice(item.price, currency, item.price.product?.unit_label, 1, true, locale) })
|
|
219
|
+
]
|
|
220
|
+
}
|
|
221
|
+
)
|
|
222
|
+
]
|
|
223
|
+
}
|
|
224
|
+
);
|
|
182
225
|
}
|
|
@@ -5,10 +5,10 @@ export default function ProductSkeleton({ count }) {
|
|
|
5
5
|
Stack,
|
|
6
6
|
{
|
|
7
7
|
direction: "column",
|
|
8
|
-
alignItems: "center",
|
|
9
|
-
padding: 4,
|
|
10
8
|
spacing: 1,
|
|
11
9
|
sx: {
|
|
10
|
+
alignItems: "center",
|
|
11
|
+
padding: 4,
|
|
12
12
|
width: 320,
|
|
13
13
|
border: "1px solid",
|
|
14
14
|
borderColor: "grey.100",
|
|
@@ -19,12 +19,32 @@ export default function DonationSkeleton() {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
),
|
|
22
|
-
/* @__PURE__ */ jsxs(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
/* @__PURE__ */ jsxs(
|
|
23
|
+
Stack,
|
|
24
|
+
{
|
|
25
|
+
direction: "row",
|
|
26
|
+
spacing: 2,
|
|
27
|
+
sx: {
|
|
28
|
+
justifyContent: "space-between"
|
|
29
|
+
},
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ jsx(Skeleton, { variant: "text", sx: { fontSize: "1.5rem", width: "40%" } }),
|
|
32
|
+
/* @__PURE__ */ jsxs(
|
|
33
|
+
Box,
|
|
34
|
+
{
|
|
35
|
+
sx: {
|
|
36
|
+
display: "flex",
|
|
37
|
+
alignItems: "center",
|
|
38
|
+
gap: 2
|
|
39
|
+
},
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Skeleton, { height: 60, width: 80 }) }),
|
|
42
|
+
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Skeleton, { height: 60, width: 120 }) })
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
)
|
|
29
49
|
] }) });
|
|
30
50
|
}
|
|
@@ -2,9 +2,29 @@ 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(
|
|
5
|
+
/* @__PURE__ */ jsx(
|
|
6
|
+
Stack,
|
|
7
|
+
{
|
|
8
|
+
direction: "row",
|
|
9
|
+
spacing: 2,
|
|
10
|
+
sx: {
|
|
11
|
+
alignItems: "center"
|
|
12
|
+
},
|
|
13
|
+
children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", sx: { fontSize: "1.75rem", width: "40%" } })
|
|
14
|
+
}
|
|
15
|
+
),
|
|
6
16
|
/* @__PURE__ */ jsx(Skeleton, { sx: { mt: 2 }, variant: "rounded", height: 100 }),
|
|
7
|
-
/* @__PURE__ */ jsx(
|
|
17
|
+
/* @__PURE__ */ jsx(
|
|
18
|
+
Typography,
|
|
19
|
+
{
|
|
20
|
+
component: "div",
|
|
21
|
+
variant: "h4",
|
|
22
|
+
sx: {
|
|
23
|
+
mt: 2
|
|
24
|
+
},
|
|
25
|
+
children: /* @__PURE__ */ jsx(Skeleton, {})
|
|
26
|
+
}
|
|
27
|
+
),
|
|
8
28
|
/* @__PURE__ */ jsx(Typography, { component: "div", variant: "h2", children: /* @__PURE__ */ jsx(Skeleton, {}) })
|
|
9
29
|
] }) });
|
|
10
30
|
}
|
|
@@ -4,12 +4,40 @@ export default function PaymentSkeleton() {
|
|
|
4
4
|
return /* @__PURE__ */ jsx(Fade, { in: true, children: /* @__PURE__ */ jsxs(Stack, { direction: "column", children: [
|
|
5
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
|
-
/* @__PURE__ */ jsxs(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
/* @__PURE__ */ jsxs(
|
|
8
|
+
Box,
|
|
9
|
+
{
|
|
10
|
+
sx: {
|
|
11
|
+
mt: 1
|
|
12
|
+
},
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ jsx(
|
|
15
|
+
Typography,
|
|
16
|
+
{
|
|
17
|
+
component: "div",
|
|
18
|
+
variant: "h4",
|
|
19
|
+
sx: {
|
|
20
|
+
mb: -1
|
|
21
|
+
},
|
|
22
|
+
children: /* @__PURE__ */ jsx(Skeleton, {})
|
|
23
|
+
}
|
|
24
|
+
),
|
|
25
|
+
/* @__PURE__ */ jsx(Typography, { component: "div", children: /* @__PURE__ */ jsx(Skeleton, { height: 60 }) })
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
),
|
|
11
29
|
/* @__PURE__ */ jsxs(Box, { children: [
|
|
12
|
-
/* @__PURE__ */ jsx(
|
|
30
|
+
/* @__PURE__ */ jsx(
|
|
31
|
+
Typography,
|
|
32
|
+
{
|
|
33
|
+
component: "div",
|
|
34
|
+
variant: "h4",
|
|
35
|
+
sx: {
|
|
36
|
+
mb: -1
|
|
37
|
+
},
|
|
38
|
+
children: /* @__PURE__ */ jsx(Skeleton, {})
|
|
39
|
+
}
|
|
40
|
+
),
|
|
13
41
|
/* @__PURE__ */ jsx(Typography, { component: "div", children: /* @__PURE__ */ jsx(Skeleton, { height: 60 }) })
|
|
14
42
|
] }),
|
|
15
43
|
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Skeleton, { height: 60 }) })
|
package/es/payment/success.d.ts
CHANGED
|
@@ -7,12 +7,5 @@ type Props = {
|
|
|
7
7
|
subscriptionId?: string;
|
|
8
8
|
subscriptions?: any[];
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var defaultProps: {
|
|
13
|
-
invoiceId: string;
|
|
14
|
-
subscriptionId: string;
|
|
15
|
-
subscriptions: never[];
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
export default PaymentSuccess;
|
|
10
|
+
export default function PaymentSuccess({ mode, message, action, payee, invoiceId, subscriptionId, subscriptions, }: Props): import("react").JSX.Element;
|
|
11
|
+
export {};
|
package/es/payment/success.js
CHANGED
|
@@ -9,9 +9,9 @@ export default function PaymentSuccess({
|
|
|
9
9
|
message,
|
|
10
10
|
action,
|
|
11
11
|
payee,
|
|
12
|
-
invoiceId,
|
|
13
|
-
subscriptionId,
|
|
14
|
-
subscriptions
|
|
12
|
+
invoiceId = "",
|
|
13
|
+
subscriptionId = "",
|
|
14
|
+
subscriptions = []
|
|
15
15
|
}) {
|
|
16
16
|
const { t } = useLocaleContext();
|
|
17
17
|
const { prefix } = usePaymentContext();
|
|
@@ -81,15 +81,26 @@ export default function PaymentSuccess({
|
|
|
81
81
|
next = /* @__PURE__ */ jsx(Button, { variant: "outlined", color: "primary", sx: { mt: 2 }, children: /* @__PURE__ */ jsx(Link, { href: joinURL(prefix, `/customer/subscription/${subscriptionId}`), children: t("payment.checkout.next.subscription", { payee }) }) });
|
|
82
82
|
}
|
|
83
83
|
} else if (invoiceId) {
|
|
84
|
-
next = /* @__PURE__ */ jsx(
|
|
84
|
+
next = /* @__PURE__ */ jsx(
|
|
85
|
+
Typography,
|
|
86
|
+
{
|
|
87
|
+
sx: {
|
|
88
|
+
textAlign: "center",
|
|
89
|
+
mt: 2
|
|
90
|
+
},
|
|
91
|
+
children: /* @__PURE__ */ jsx(Link, { href: joinURL(prefix, `/customer/invoice/${invoiceId}`), children: t("payment.checkout.next.invoice", { payee }) })
|
|
92
|
+
}
|
|
93
|
+
);
|
|
85
94
|
}
|
|
86
95
|
return /* @__PURE__ */ jsx(Grow, { in: true, children: /* @__PURE__ */ jsxs(
|
|
87
96
|
Stack,
|
|
88
97
|
{
|
|
89
98
|
direction: "column",
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
99
|
+
sx: {
|
|
100
|
+
alignItems: "center",
|
|
101
|
+
justifyContent: mode === "standalone" ? "center" : "flex-start",
|
|
102
|
+
height: mode === "standalone" ? "fit-content" : 300
|
|
103
|
+
},
|
|
93
104
|
children: [
|
|
94
105
|
/* @__PURE__ */ jsx(Div, { children: /* @__PURE__ */ jsxs("div", { className: "check-icon", children: [
|
|
95
106
|
/* @__PURE__ */ jsx("span", { className: "icon-line line-tip" }),
|
|
@@ -97,18 +108,34 @@ export default function PaymentSuccess({
|
|
|
97
108
|
/* @__PURE__ */ jsx("div", { className: "icon-circle" }),
|
|
98
109
|
/* @__PURE__ */ jsx("div", { className: "icon-fix" })
|
|
99
110
|
] }) }),
|
|
100
|
-
/* @__PURE__ */ jsx(
|
|
101
|
-
|
|
111
|
+
/* @__PURE__ */ jsx(
|
|
112
|
+
Typography,
|
|
113
|
+
{
|
|
114
|
+
variant: "h5",
|
|
115
|
+
sx: {
|
|
116
|
+
color: "text.primary",
|
|
117
|
+
mb: 3
|
|
118
|
+
},
|
|
119
|
+
children: message
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
/* @__PURE__ */ jsx(
|
|
123
|
+
Typography,
|
|
124
|
+
{
|
|
125
|
+
variant: "body1",
|
|
126
|
+
sx: {
|
|
127
|
+
color: "text.secondary",
|
|
128
|
+
textAlign: "center",
|
|
129
|
+
fontSize: "14px"
|
|
130
|
+
},
|
|
131
|
+
children: t("payment.checkout.completed.tip", { payee })
|
|
132
|
+
}
|
|
133
|
+
),
|
|
102
134
|
next
|
|
103
135
|
]
|
|
104
136
|
}
|
|
105
137
|
) });
|
|
106
138
|
}
|
|
107
|
-
PaymentSuccess.defaultProps = {
|
|
108
|
-
invoiceId: "",
|
|
109
|
-
subscriptionId: "",
|
|
110
|
-
subscriptions: []
|
|
111
|
-
};
|
|
112
139
|
const Div = styled("div")`
|
|
113
140
|
width: 80px;
|
|
114
141
|
height: 115px;
|
package/es/payment/summary.d.ts
CHANGED
|
@@ -16,20 +16,5 @@ type Props = {
|
|
|
16
16
|
donationSettings?: DonationSettings;
|
|
17
17
|
action?: string;
|
|
18
18
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var defaultProps: {
|
|
22
|
-
onUpsell: any;
|
|
23
|
-
onDownsell: any;
|
|
24
|
-
onApplyCrossSell: any;
|
|
25
|
-
onCancelCrossSell: any;
|
|
26
|
-
onChangeAmount: any;
|
|
27
|
-
checkoutSessionId: string;
|
|
28
|
-
crossSellBehavior: string;
|
|
29
|
-
showStaking: boolean;
|
|
30
|
-
donationSettings: null;
|
|
31
|
-
action: string;
|
|
32
|
-
trialEnd: number;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export default PaymentSummary;
|
|
19
|
+
export default function PaymentSummary({ items, currency, trialInDays, billingThreshold, onUpsell, onDownsell, onApplyCrossSell, onCancelCrossSell, onChangeAmount, checkoutSessionId, crossSellBehavior, showStaking, donationSettings, action, trialEnd, ...rest }: Props): import("react").JSX.Element;
|
|
20
|
+
export {};
|