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