@blocklet/payment-react 1.14.21 → 1.14.23
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/README.md +77 -0
- package/es/checkout/donate.d.ts +4 -2
- package/es/checkout/donate.js +13 -10
- package/es/checkout/form.d.ts +1 -1
- package/es/checkout/form.js +50 -4
- package/es/checkout/table.d.ts +1 -1
- package/es/checkout/table.js +11 -1
- package/es/components/blockchain/tx.js +2 -1
- package/es/components/country-select.d.ts +16 -0
- package/es/components/country-select.js +82 -0
- package/es/components/input.d.ts +21 -21
- package/es/components/input.js +43 -42
- package/es/components/livemode.js +1 -0
- package/es/components/pricing-table.js +0 -2
- package/es/components/status.js +2 -3
- package/es/components/table.d.ts +2 -0
- package/es/components/table.js +186 -0
- package/es/contexts/payment.d.ts +2 -0
- package/es/contexts/payment.js +5 -2
- package/es/history/invoice/list.d.ts +3 -1
- package/es/history/invoice/list.js +215 -48
- package/es/hooks/mobile.d.ts +4 -0
- package/es/hooks/mobile.js +10 -0
- package/es/index.d.ts +5 -1
- package/es/index.js +7 -1
- package/es/libs/util.d.ts +21 -8
- package/es/libs/util.js +92 -28
- package/es/locales/en.js +22 -7
- package/es/locales/index.d.ts +0 -1
- package/es/locales/index.js +10 -1
- package/es/locales/zh.js +21 -6
- package/es/payment/error.js +2 -2
- package/es/payment/footer.js +1 -1
- package/es/payment/form/address.d.ts +9 -2
- package/es/payment/form/address.js +69 -69
- package/es/payment/form/currency.js +39 -25
- package/es/payment/form/index.d.ts +1 -1
- package/es/payment/form/index.js +83 -81
- package/es/payment/form/phone.js +15 -51
- package/es/payment/index.d.ts +3 -10
- package/es/payment/index.js +295 -224
- package/es/payment/product-card.js +4 -4
- package/es/payment/product-donation.js +9 -3
- package/es/payment/product-item.d.ts +2 -2
- package/es/payment/product-item.js +120 -81
- package/es/payment/summary.js +188 -118
- package/es/theme/index.css +240 -0
- package/es/theme/index.d.ts +14 -0
- package/es/theme/index.js +256 -0
- package/es/theme/typography.d.ts +2 -0
- package/es/theme/typography.js +53 -0
- package/es/types/index.d.ts +16 -0
- package/lib/checkout/donate.d.ts +4 -2
- package/lib/checkout/donate.js +23 -2
- package/lib/checkout/form.d.ts +1 -1
- package/lib/checkout/form.js +60 -15
- package/lib/checkout/table.d.ts +1 -1
- package/lib/checkout/table.js +22 -1
- package/lib/components/blockchain/tx.js +4 -1
- package/lib/components/country-select.d.ts +16 -0
- package/lib/components/country-select.js +115 -0
- package/lib/components/input.d.ts +21 -21
- package/lib/components/input.js +21 -12
- package/lib/components/livemode.js +1 -0
- package/lib/components/pricing-table.js +0 -2
- package/lib/components/status.js +2 -3
- package/lib/components/table.d.ts +2 -0
- package/lib/components/table.js +220 -0
- package/lib/contexts/payment.d.ts +2 -0
- package/lib/contexts/payment.js +4 -1
- package/lib/history/invoice/list.d.ts +3 -1
- package/lib/history/invoice/list.js +290 -62
- package/lib/hooks/mobile.d.ts +4 -0
- package/lib/hooks/mobile.js +17 -0
- package/lib/index.d.ts +5 -1
- package/lib/index.js +36 -0
- package/lib/libs/util.d.ts +21 -8
- package/lib/libs/util.js +115 -37
- package/lib/locales/en.js +22 -7
- package/lib/locales/index.d.ts +0 -1
- package/lib/locales/index.js +14 -3
- package/lib/locales/zh.js +21 -6
- package/lib/payment/error.js +5 -1
- package/lib/payment/footer.js +1 -1
- package/lib/payment/form/address.d.ts +9 -2
- package/lib/payment/form/address.js +67 -59
- package/lib/payment/form/currency.js +31 -24
- package/lib/payment/form/index.d.ts +1 -1
- package/lib/payment/form/index.js +92 -93
- package/lib/payment/form/phone.js +11 -59
- package/lib/payment/index.d.ts +3 -10
- package/lib/payment/index.js +302 -225
- package/lib/payment/product-card.js +5 -4
- package/lib/payment/product-donation.js +11 -7
- package/lib/payment/product-item.d.ts +2 -2
- package/lib/payment/product-item.js +38 -19
- package/lib/payment/summary.js +219 -127
- package/lib/theme/index.css +240 -0
- package/lib/theme/index.d.ts +14 -0
- package/lib/theme/index.js +273 -0
- package/lib/theme/typography.d.ts +2 -0
- package/lib/theme/typography.js +59 -0
- package/lib/types/index.d.ts +16 -0
- package/package.json +14 -11
- package/src/checkout/donate.tsx +25 -11
- package/src/checkout/form.tsx +63 -15
- package/src/checkout/table.tsx +20 -1
- package/src/components/blockchain/tx.tsx +2 -1
- package/src/components/country-select.tsx +93 -0
- package/src/components/input.tsx +49 -46
- package/src/components/livemode.tsx +1 -0
- package/src/components/pricing-table.tsx +0 -2
- package/src/components/status.tsx +1 -2
- package/src/components/table.tsx +200 -0
- package/src/contexts/payment.tsx +6 -1
- package/src/history/invoice/list.tsx +254 -49
- package/src/hooks/mobile.ts +13 -0
- package/src/index.ts +7 -0
- package/src/libs/util.ts +120 -31
- package/src/locales/en.tsx +18 -4
- package/src/locales/index.tsx +10 -3
- package/src/locales/zh.tsx +17 -3
- package/src/payment/error.tsx +2 -2
- package/src/payment/footer.tsx +1 -1
- package/src/payment/form/address.tsx +56 -47
- package/src/payment/form/currency.tsx +29 -23
- package/src/payment/form/index.tsx +89 -76
- package/src/payment/form/phone.tsx +14 -51
- package/src/payment/index.tsx +298 -231
- package/src/payment/product-card.tsx +4 -4
- package/src/payment/product-donation.tsx +9 -4
- package/src/payment/product-item.tsx +49 -20
- package/src/payment/summary.tsx +191 -108
- package/src/theme/index.css +240 -0
- package/src/theme/index.tsx +271 -0
- package/src/theme/typography.ts +56 -0
- package/src/types/index.ts +17 -0
package/es/payment/summary.js
CHANGED
|
@@ -1,35 +1,43 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
3
|
-
import {
|
|
3
|
+
import { HelpOutline } from "@mui/icons-material";
|
|
4
4
|
import { LoadingButton } from "@mui/lab";
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import {
|
|
6
|
+
Box,
|
|
7
|
+
Divider,
|
|
8
|
+
Fade,
|
|
9
|
+
Grow,
|
|
10
|
+
Stack,
|
|
11
|
+
Tooltip,
|
|
12
|
+
Typography,
|
|
13
|
+
Collapse,
|
|
14
|
+
IconButton
|
|
15
|
+
} from "@mui/material";
|
|
16
|
+
import { BN, fromTokenToUnit, fromUnitToToken } from "@ocap/util";
|
|
7
17
|
import { useRequest, useSetState } from "ahooks";
|
|
8
18
|
import noop from "lodash/noop";
|
|
9
19
|
import useBus from "use-bus";
|
|
20
|
+
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
|
21
|
+
import { styled } from "@mui/material/styles";
|
|
10
22
|
import Status from "../components/status.js";
|
|
11
23
|
import api from "../libs/api.js";
|
|
12
24
|
import { formatAmount, formatCheckoutHeadlines, getPriceUintAmountByCurrency } from "../libs/util.js";
|
|
13
25
|
import PaymentAmount from "./amount.js";
|
|
14
26
|
import ProductDonation from "./product-donation.js";
|
|
15
27
|
import ProductItem from "./product-item.js";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
100% {
|
|
30
|
-
transform: rotate(0deg);
|
|
31
|
-
}
|
|
32
|
-
`;
|
|
28
|
+
import Livemode from "../components/livemode.js";
|
|
29
|
+
import { usePaymentContext } from "../contexts/payment.js";
|
|
30
|
+
import { useMobile } from "../hooks/mobile.js";
|
|
31
|
+
const ExpandMore = styled((props) => {
|
|
32
|
+
const { expand, ...other } = props;
|
|
33
|
+
return /* @__PURE__ */ jsx(IconButton, { ...other });
|
|
34
|
+
})(({ theme, expand }) => ({
|
|
35
|
+
transform: !expand ? "rotate(0deg)" : "rotate(180deg)",
|
|
36
|
+
marginLeft: "auto",
|
|
37
|
+
transition: theme.transitions.create("transform", {
|
|
38
|
+
duration: theme.transitions.duration.shortest
|
|
39
|
+
})
|
|
40
|
+
}));
|
|
33
41
|
async function fetchCrossSell(id) {
|
|
34
42
|
try {
|
|
35
43
|
const { data } = await api.get(`/api/checkout-sessions/${id}/cross-sell`);
|
|
@@ -95,12 +103,18 @@ export default function PaymentSummary({
|
|
|
95
103
|
...rest
|
|
96
104
|
}) {
|
|
97
105
|
const { t, locale } = useLocaleContext();
|
|
98
|
-
const
|
|
106
|
+
const { isMobile } = useMobile();
|
|
107
|
+
const settings = usePaymentContext();
|
|
108
|
+
const [state, setState] = useSetState({ loading: false, shake: false, expanded: items?.length < 3 });
|
|
99
109
|
const { data, runAsync } = useRequest(
|
|
100
110
|
() => checkoutSessionId ? fetchCrossSell(checkoutSessionId) : Promise.resolve(null)
|
|
101
111
|
);
|
|
102
112
|
const headlines = formatCheckoutHeadlines(items, currency, trialInDays, locale);
|
|
103
113
|
const staking = showStaking ? getStakingSetup(items, currency, billingThreshold) : "0";
|
|
114
|
+
const totalAmount = fromUnitToToken(
|
|
115
|
+
new BN(fromTokenToUnit(headlines.actualAmount, currency?.decimal)).add(new BN(staking)).toString(),
|
|
116
|
+
currency?.decimal
|
|
117
|
+
);
|
|
104
118
|
useBus(
|
|
105
119
|
"error.REQUIRE_CROSS_SELL",
|
|
106
120
|
() => {
|
|
@@ -141,124 +155,180 @@ export default function PaymentSummary({
|
|
|
141
155
|
setState({ loading: false });
|
|
142
156
|
}
|
|
143
157
|
};
|
|
158
|
+
const ProductCardList = /* @__PURE__ */ jsxs(
|
|
159
|
+
Stack,
|
|
160
|
+
{
|
|
161
|
+
className: "cko-product-list",
|
|
162
|
+
sx: {
|
|
163
|
+
flex: "0 1 auto",
|
|
164
|
+
overflow: "auto"
|
|
165
|
+
},
|
|
166
|
+
children: [
|
|
167
|
+
/* @__PURE__ */ jsx(Stack, { spacing: { xs: 1, sm: 2 }, children: items.map(
|
|
168
|
+
(x) => x.price.custom_unit_amount && onChangeAmount && donationSettings ? /* @__PURE__ */ jsx(
|
|
169
|
+
ProductDonation,
|
|
170
|
+
{
|
|
171
|
+
item: x,
|
|
172
|
+
settings: donationSettings,
|
|
173
|
+
onChange: onChangeAmount,
|
|
174
|
+
currency
|
|
175
|
+
},
|
|
176
|
+
`${x.price_id}-${currency.id}`
|
|
177
|
+
) : /* @__PURE__ */ jsx(
|
|
178
|
+
ProductItem,
|
|
179
|
+
{
|
|
180
|
+
item: x,
|
|
181
|
+
items,
|
|
182
|
+
trialInDays,
|
|
183
|
+
currency,
|
|
184
|
+
onUpsell: handleUpsell,
|
|
185
|
+
onDownsell: handleDownsell,
|
|
186
|
+
children: x.cross_sell && /* @__PURE__ */ jsxs(Stack, { direction: "row", alignItems: "center", justifyContent: "space-between", sx: { width: 1 }, children: [
|
|
187
|
+
/* @__PURE__ */ jsx(Typography, {}),
|
|
188
|
+
/* @__PURE__ */ jsx(
|
|
189
|
+
LoadingButton,
|
|
190
|
+
{
|
|
191
|
+
size: "small",
|
|
192
|
+
loadingPosition: "end",
|
|
193
|
+
color: "error",
|
|
194
|
+
variant: "text",
|
|
195
|
+
loading: state.loading,
|
|
196
|
+
onClick: handleCancelCrossSell,
|
|
197
|
+
children: t("payment.checkout.cross_sell.remove")
|
|
198
|
+
}
|
|
199
|
+
)
|
|
200
|
+
] })
|
|
201
|
+
},
|
|
202
|
+
`${x.price_id}-${currency.id}`
|
|
203
|
+
)
|
|
204
|
+
) }),
|
|
205
|
+
data && items.some((x) => x.price_id === data.id) === false && /* @__PURE__ */ jsx(Grow, { in: true, children: /* @__PURE__ */ jsx(Stack, { mt: 1, children: /* @__PURE__ */ jsx(
|
|
206
|
+
ProductItem,
|
|
207
|
+
{
|
|
208
|
+
item: { quantity: 1, price: data, price_id: data.id, cross_sell: true },
|
|
209
|
+
items,
|
|
210
|
+
trialInDays,
|
|
211
|
+
currency,
|
|
212
|
+
onUpsell: noop,
|
|
213
|
+
onDownsell: noop,
|
|
214
|
+
children: /* @__PURE__ */ jsxs(Stack, { direction: "row", alignItems: "center", justifyContent: "space-between", sx: { width: 1 }, children: [
|
|
215
|
+
/* @__PURE__ */ jsx(Typography, { children: crossSellBehavior === "required" && /* @__PURE__ */ jsx(Status, { label: t("payment.checkout.required"), color: "info", variant: "outlined", sx: { mr: 1 } }) }),
|
|
216
|
+
/* @__PURE__ */ jsx(
|
|
217
|
+
LoadingButton,
|
|
218
|
+
{
|
|
219
|
+
size: "small",
|
|
220
|
+
loadingPosition: "end",
|
|
221
|
+
color: crossSellBehavior === "required" ? "info" : "info",
|
|
222
|
+
variant: crossSellBehavior === "required" ? "text" : "text",
|
|
223
|
+
loading: state.loading,
|
|
224
|
+
onClick: handleApplyCrossSell,
|
|
225
|
+
children: t("payment.checkout.cross_sell.add")
|
|
226
|
+
}
|
|
227
|
+
)
|
|
228
|
+
] })
|
|
229
|
+
}
|
|
230
|
+
) }) })
|
|
231
|
+
]
|
|
232
|
+
}
|
|
233
|
+
);
|
|
144
234
|
return /* @__PURE__ */ jsx(Fade, { in: true, children: /* @__PURE__ */ jsxs(Stack, { className: "cko-product", direction: "column", ...rest, children: [
|
|
145
|
-
/* @__PURE__ */ jsxs(
|
|
235
|
+
/* @__PURE__ */ jsxs(Box, { display: "flex", alignItems: "center", sx: { mb: 2.5 }, children: [
|
|
146
236
|
/* @__PURE__ */ jsx(
|
|
147
237
|
Typography,
|
|
148
238
|
{
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
239
|
+
title: t("payment.checkout.orderSummary"),
|
|
240
|
+
sx: {
|
|
241
|
+
color: "text.primary",
|
|
242
|
+
fontSize: {
|
|
243
|
+
xs: "18px",
|
|
244
|
+
md: "24px"
|
|
245
|
+
},
|
|
246
|
+
fontWeight: "700",
|
|
247
|
+
lineHeight: "32px"
|
|
248
|
+
},
|
|
249
|
+
children: action || t("payment.checkout.orderSummary")
|
|
154
250
|
}
|
|
155
251
|
),
|
|
156
|
-
/* @__PURE__ */ jsx(
|
|
157
|
-
headlines.then && /* @__PURE__ */ jsx(Typography, { component: "div", sx: { fontSize: "0.9rem", color: "text.secondary" }, children: headlines.then })
|
|
252
|
+
!settings.livemode && /* @__PURE__ */ jsx(Livemode, {})
|
|
158
253
|
] }),
|
|
159
|
-
/* @__PURE__ */
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
{
|
|
163
|
-
item: x,
|
|
164
|
-
settings: donationSettings,
|
|
165
|
-
onChange: onChangeAmount,
|
|
166
|
-
currency
|
|
167
|
-
},
|
|
168
|
-
`${x.price_id}-${currency.id}`
|
|
169
|
-
) : /* @__PURE__ */ jsx(
|
|
170
|
-
ProductItem,
|
|
254
|
+
isMobile ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
255
|
+
/* @__PURE__ */ jsxs(
|
|
256
|
+
Stack,
|
|
171
257
|
{
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
258
|
+
justifyContent: "space-between",
|
|
259
|
+
flexDirection: "row",
|
|
260
|
+
alignItems: "center",
|
|
261
|
+
mb: 1.5,
|
|
262
|
+
onClick: () => setState({ expanded: !state.expanded }),
|
|
263
|
+
children: [
|
|
264
|
+
/* @__PURE__ */ jsx(Typography, { children: t("payment.checkout.productListTotal", { total: items.length }) }),
|
|
265
|
+
/* @__PURE__ */ jsx(ExpandMore, { expand: state.expanded, "aria-expanded": state.expanded, "aria-label": "show more", children: /* @__PURE__ */ jsx(ExpandMoreIcon, {}) })
|
|
266
|
+
]
|
|
267
|
+
}
|
|
268
|
+
),
|
|
269
|
+
/* @__PURE__ */ jsx(Collapse, { in: state.expanded || !isMobile, timeout: "auto", unmountOnExit: true, children: ProductCardList })
|
|
270
|
+
] }) : ProductCardList,
|
|
271
|
+
/* @__PURE__ */ jsx(Divider, { sx: { mt: 2.5, mb: 2.5 } }),
|
|
272
|
+
staking > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
273
|
+
/* @__PURE__ */ jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 1, children: [
|
|
274
|
+
/* @__PURE__ */ jsxs(Stack, { direction: "row", alignItems: "center", spacing: 0.5, children: [
|
|
275
|
+
/* @__PURE__ */ jsx(Typography, { sx: { color: "text.secondary" }, children: t("payment.checkout.paymentRequired") }),
|
|
276
|
+
/* @__PURE__ */ jsx(
|
|
277
|
+
Tooltip,
|
|
180
278
|
{
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
loading: state.loading,
|
|
186
|
-
onClick: handleCancelCrossSell,
|
|
187
|
-
children: t("payment.checkout.cross_sell.remove")
|
|
279
|
+
title: /* @__PURE__ */ jsx(Typography, { children: t("payment.checkout.stakingConfirm") }),
|
|
280
|
+
placement: "top",
|
|
281
|
+
sx: { maxWidth: "150px" },
|
|
282
|
+
children: /* @__PURE__ */ jsx(HelpOutline, { fontSize: "small", sx: { color: "text.lighter" } })
|
|
188
283
|
}
|
|
189
284
|
)
|
|
190
|
-
},
|
|
191
|
-
|
|
192
|
-
)
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
{
|
|
197
|
-
direction: "column",
|
|
198
|
-
alignItems: "flex-end",
|
|
199
|
-
spacing: 0.5,
|
|
200
|
-
sx: {
|
|
201
|
-
border: "1px solid #eee",
|
|
202
|
-
borderRadius: 1,
|
|
203
|
-
padding: 1,
|
|
204
|
-
animation: state.shake ? `${shake} 0.2s 5 ease-in-out` : "none",
|
|
205
|
-
mt: { xs: 1, sm: 2 }
|
|
206
|
-
},
|
|
207
|
-
children: [
|
|
285
|
+
] }),
|
|
286
|
+
/* @__PURE__ */ jsx(Typography, { children: headlines.amount })
|
|
287
|
+
] }),
|
|
288
|
+
/* @__PURE__ */ jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 1, children: [
|
|
289
|
+
/* @__PURE__ */ jsxs(Stack, { direction: "row", alignItems: "center", spacing: 0.5, children: [
|
|
290
|
+
/* @__PURE__ */ jsx(Typography, { sx: { color: "text.secondary" }, children: t("payment.checkout.staking.title") }),
|
|
208
291
|
/* @__PURE__ */ jsx(
|
|
209
|
-
|
|
292
|
+
Tooltip,
|
|
210
293
|
{
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
onUpsell: noop,
|
|
216
|
-
onDownsell: noop
|
|
294
|
+
title: /* @__PURE__ */ jsx(Typography, { children: t("payment.checkout.staking.tooltip") }),
|
|
295
|
+
placement: "top",
|
|
296
|
+
sx: { maxWidth: "150px" },
|
|
297
|
+
children: /* @__PURE__ */ jsx(HelpOutline, { fontSize: "small", sx: { color: "text.lighter" } })
|
|
217
298
|
}
|
|
218
|
-
)
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
loading: state.loading,
|
|
229
|
-
onClick: handleApplyCrossSell,
|
|
230
|
-
children: t("payment.checkout.cross_sell.add")
|
|
231
|
-
}
|
|
232
|
-
)
|
|
233
|
-
] })
|
|
234
|
-
]
|
|
235
|
-
}
|
|
236
|
-
) }),
|
|
237
|
-
staking > 0 && /* @__PURE__ */ jsxs(
|
|
299
|
+
)
|
|
300
|
+
] }),
|
|
301
|
+
/* @__PURE__ */ jsxs(Typography, { children: [
|
|
302
|
+
formatAmount(staking, currency.decimal),
|
|
303
|
+
" ",
|
|
304
|
+
currency.symbol
|
|
305
|
+
] })
|
|
306
|
+
] })
|
|
307
|
+
] }),
|
|
308
|
+
/* @__PURE__ */ jsxs(
|
|
238
309
|
Stack,
|
|
239
310
|
{
|
|
240
|
-
|
|
311
|
+
display: "flex",
|
|
241
312
|
justifyContent: "space-between",
|
|
313
|
+
flexDirection: "row",
|
|
242
314
|
alignItems: "center",
|
|
243
|
-
|
|
244
|
-
sx: {
|
|
245
|
-
border: "1px solid #eee",
|
|
246
|
-
borderRadius: 1,
|
|
247
|
-
padding: 1,
|
|
248
|
-
mt: { xs: 1, sm: 2 }
|
|
249
|
-
},
|
|
315
|
+
sx: { width: "100%" },
|
|
250
316
|
children: [
|
|
251
|
-
/* @__PURE__ */ jsxs(
|
|
252
|
-
|
|
253
|
-
|
|
317
|
+
/* @__PURE__ */ jsxs(Box, { className: "base-label", children: [
|
|
318
|
+
t("common.total"),
|
|
319
|
+
" "
|
|
254
320
|
] }),
|
|
255
|
-
/* @__PURE__ */
|
|
256
|
-
formatAmount(staking, currency.decimal),
|
|
257
|
-
" ",
|
|
258
|
-
currency.symbol
|
|
259
|
-
] })
|
|
321
|
+
/* @__PURE__ */ jsx(PaymentAmount, { amount: `${totalAmount} ${currency.symbol}`, sx: { fontSize: "16px" } })
|
|
260
322
|
]
|
|
261
323
|
}
|
|
324
|
+
),
|
|
325
|
+
headlines.then && headlines.showThen && /* @__PURE__ */ jsx(
|
|
326
|
+
Typography,
|
|
327
|
+
{
|
|
328
|
+
component: "div",
|
|
329
|
+
sx: { fontSize: "0.9rem", color: "text.lighter", textAlign: "right", margin: "-2px 0 8px" },
|
|
330
|
+
children: headlines.then
|
|
331
|
+
}
|
|
262
332
|
)
|
|
263
333
|
] }) });
|
|
264
334
|
}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/* Light Theme */
|
|
3
|
+
/* Color */
|
|
4
|
+
--backgrounds-bg-base: #ffffff;
|
|
5
|
+
--backgrounds-bg-base-hover: #f9fafb;
|
|
6
|
+
--backgrounds-bg-base-pressed: #f3f4f6;
|
|
7
|
+
--backgrounds-bg-component: #f1f3f5;
|
|
8
|
+
--backgrounds-bg-component-hover: #e5e7eb;
|
|
9
|
+
--backgrounds-bg-disabled: #f3f4f6;
|
|
10
|
+
--backgrounds-bg-field: #f9fafb;
|
|
11
|
+
--backgrounds-bg-field-hover: #f3f4f6;
|
|
12
|
+
--backgrounds-bg-glass: #ffffffb8;
|
|
13
|
+
--backgrounds-bg-highlight: #eff6ff;
|
|
14
|
+
--backgrounds-bg-highlight-hover: #dbeafe;
|
|
15
|
+
--backgrounds-bg-interactive: #3b82f6;
|
|
16
|
+
--backgrounds-bg-interactive-hover: #2563eb;
|
|
17
|
+
--backgrounds-bg-overlay: #03071266;
|
|
18
|
+
--backgrounds-bg-subtle: #f9fafb;
|
|
19
|
+
--backgrounds-bg-subtle-hover: #f3f4f6;
|
|
20
|
+
--backgrounds-bg-subtle-pressed: #e5e7eb;
|
|
21
|
+
--backgrounds-bg-switch-off: #e5e7eb;
|
|
22
|
+
--backgrounds-bg-switch-off-hover: #d1d5db;
|
|
23
|
+
--buttons-button-danger: #e11d48;
|
|
24
|
+
--buttons-button-danger-hover: #be123c;
|
|
25
|
+
--buttons-button-danger-pressed: #9f1239;
|
|
26
|
+
--buttons-button-inverted: #030712;
|
|
27
|
+
--buttons-button-inverted-hover: #111827;
|
|
28
|
+
--buttons-button-inverted-pressed: #1f2937;
|
|
29
|
+
--buttons-button-neutral: #ffffff;
|
|
30
|
+
--buttons-button-neutral-hover: #f3f4f6;
|
|
31
|
+
--buttons-button-neutral-pressed: #e5e7eb;
|
|
32
|
+
--buttons-button-transparent: #ffffff00;
|
|
33
|
+
--buttons-button-transparent-hover: #f3f4f6;
|
|
34
|
+
--buttons-button-transparent-pressed: #e5e7eb;
|
|
35
|
+
--foregrounds-fg-base: #030712;
|
|
36
|
+
--foregrounds-fg-danger: #e11d48;
|
|
37
|
+
--foregrounds-fg-disabled: #d1d5db;
|
|
38
|
+
--foregrounds-fg-interactive: #3b82f6;
|
|
39
|
+
--foregrounds-fg-interactive-hover: #2563eb;
|
|
40
|
+
--foregrounds-fg-muted: #9ca3af;
|
|
41
|
+
--foregrounds-fg-on-color: #ffffff;
|
|
42
|
+
--foregrounds-fg-on-inverted: #ffffff;
|
|
43
|
+
--foregrounds-fg-subtle: #4b5563;
|
|
44
|
+
--others-spacer: #ffffff00;
|
|
45
|
+
--shadows-card-hover-1: #03071214;
|
|
46
|
+
--shadows-card-hover-2: #03071214;
|
|
47
|
+
--shadows-card-hover-3: #0307121a;
|
|
48
|
+
--shadows-card-rest-1: #03071214;
|
|
49
|
+
--shadows-card-rest-2: #03071214;
|
|
50
|
+
--shadows-card-rest-3: #0307120a;
|
|
51
|
+
--shadows-danger-1: #e11d48;
|
|
52
|
+
--shadows-error-2: #e11d4826;
|
|
53
|
+
--shadows-flyout-1: #03071214;
|
|
54
|
+
--shadows-flyout-2: #03071214;
|
|
55
|
+
--shadows-interactive-with-active-1: #3b82f6;
|
|
56
|
+
--shadows-interactive-with-active-2: #3b82f633;
|
|
57
|
+
--shadows-interactive-with-shadow-1: #1e3a8a80;
|
|
58
|
+
--shadows-interactive-with-shadow-2: #3b82f6;
|
|
59
|
+
--shadows-modal-1: #ffffff;
|
|
60
|
+
--shadows-modal-2: #e5e7eb66;
|
|
61
|
+
--shadows-modal-3: #03071214;
|
|
62
|
+
--shadows-modal-4: #03071214;
|
|
63
|
+
--shadows-modal-5: #03071214;
|
|
64
|
+
--shadows-switch-background-1: #0307120a;
|
|
65
|
+
--shadows-switch-background-2: #0307120a;
|
|
66
|
+
--shadows-switch-background-3: #0307120f;
|
|
67
|
+
--shadows-switch-background-4: #03071205;
|
|
68
|
+
--shadows-switch-background-5: #0307120a;
|
|
69
|
+
--shadows-switch-handle-1: #ffffff;
|
|
70
|
+
--shadows-switch-handle-2: #ffffff;
|
|
71
|
+
--shadows-switch-handle-3: #03071205;
|
|
72
|
+
--shadows-switch-handle-4: #03071205;
|
|
73
|
+
--shadows-switch-handle-5: #0307120a;
|
|
74
|
+
--shadows-switch-handle-6: #0307121f;
|
|
75
|
+
--shadows-switch-handle-7: #03071214;
|
|
76
|
+
--shadows-tooltip-1: #03071214;
|
|
77
|
+
--shadows-tooltip-2: #03071214;
|
|
78
|
+
--stroke-border-base: #eff1f5;
|
|
79
|
+
--stroke-border-error: #e11d48;
|
|
80
|
+
--stroke-border-interactive: #3b82f6;
|
|
81
|
+
--stroke-border-loud: #030712;
|
|
82
|
+
--stroke-border-strong: #d1d5db;
|
|
83
|
+
--stroke-sep: #eff1f5;
|
|
84
|
+
--tags-tag-blue-bg: #dbeafe;
|
|
85
|
+
--tags-tag-blue-bg-hover: #bfdbfe;
|
|
86
|
+
--tags-tag-blue-border: #bfdbfe;
|
|
87
|
+
--tags-tag-blue-icon: #2563eb;
|
|
88
|
+
--tags-tag-blue-text: #1d4ed8;
|
|
89
|
+
--tags-tag-green-bg: #d1fae5;
|
|
90
|
+
--tags-tag-green-bg-hover: #a7f3d0;
|
|
91
|
+
--tags-tag-green-border: #a7f3d0;
|
|
92
|
+
--tags-tag-green-icon: #059669;
|
|
93
|
+
--tags-tag-green-text: #047857;
|
|
94
|
+
--tags-tag-neutral-bg: #f3f4f6;
|
|
95
|
+
--tags-tag-neutral-bg-hover: #e5e7eb;
|
|
96
|
+
--tags-tag-neutral-border: #e5e7eb;
|
|
97
|
+
--tags-tag-neutral-icon: #6b7280;
|
|
98
|
+
--tags-tag-neutral-text: #4b5563;
|
|
99
|
+
--tags-tag-orange-bg: #fef4c7;
|
|
100
|
+
--tags-tag-orange-bg-hover: #fde68a;
|
|
101
|
+
--tags-tag-orange-border: #fde68a;
|
|
102
|
+
--tags-tag-orange-icon: #d97706;
|
|
103
|
+
--tags-tag-orange-text: #b45309;
|
|
104
|
+
--tags-tag-purple-bg: #ede9fe;
|
|
105
|
+
--tags-tag-purple-bg-hover: #ddd6fe;
|
|
106
|
+
--tags-tag-purple-border: #ddd6fe;
|
|
107
|
+
--tags-tag-purple-icon: #7c3aed;
|
|
108
|
+
--tags-tag-purple-text: #6d28d9;
|
|
109
|
+
--tags-tag-red-bg: #ffe4e6;
|
|
110
|
+
--tags-tag-red-bg-hover: #fecdd3;
|
|
111
|
+
--tags-tag-red-border: #fecdd3;
|
|
112
|
+
--tags-tag-red-icon: #e11d48;
|
|
113
|
+
--tags-tag-red-text: #be123c;
|
|
114
|
+
/* Number */
|
|
115
|
+
--radius-s: 0.25rem;
|
|
116
|
+
--radius-m: 0.5rem;
|
|
117
|
+
--radius-l: 0.75rem;
|
|
118
|
+
--radius-round: 624.9375rem;
|
|
119
|
+
--stroke-button-secondary-border: #e5e7eb;
|
|
120
|
+
}
|
|
121
|
+
[data-theme='dark'] {
|
|
122
|
+
/* Dark Theme */
|
|
123
|
+
/* Color */
|
|
124
|
+
--backgrounds-bg-base: #1b1b1f;
|
|
125
|
+
--backgrounds-bg-base-hover: #27282d;
|
|
126
|
+
--backgrounds-bg-base-pressed: #2e3035;
|
|
127
|
+
--backgrounds-bg-component: #27282d;
|
|
128
|
+
--backgrounds-bg-component-hover: #27282d;
|
|
129
|
+
--backgrounds-bg-disabled: #27282d;
|
|
130
|
+
--backgrounds-bg-field: #27282d;
|
|
131
|
+
--backgrounds-bg-field-hover: #2e3035;
|
|
132
|
+
--backgrounds-bg-glass: #1b1b1fb8;
|
|
133
|
+
--backgrounds-bg-highlight: #172554;
|
|
134
|
+
--backgrounds-bg-highlight-hover: #1e3a8a;
|
|
135
|
+
--backgrounds-bg-interactive: #60a5fa;
|
|
136
|
+
--backgrounds-bg-interactive-hover: #60a5fa;
|
|
137
|
+
--backgrounds-bg-overlay: #18181ab2;
|
|
138
|
+
--backgrounds-bg-subtle: #18181a;
|
|
139
|
+
--backgrounds-bg-subtle-hover: #1b1b1f;
|
|
140
|
+
--backgrounds-bg-subtle-pressed: #27282d;
|
|
141
|
+
--backgrounds-bg-switch-off: #35373c;
|
|
142
|
+
--backgrounds-bg-switch-off-hover: #464b50;
|
|
143
|
+
--buttons-button-danger: #9f1239;
|
|
144
|
+
--buttons-button-danger-hover: #be123c;
|
|
145
|
+
--buttons-button-danger-pressed: #e11d48;
|
|
146
|
+
--buttons-button-inverted: #edeef0;
|
|
147
|
+
--buttons-button-inverted-hover: #ffffff;
|
|
148
|
+
--buttons-button-inverted-pressed: #edeef0;
|
|
149
|
+
--buttons-button-neutral: #27282d;
|
|
150
|
+
--buttons-button-neutral-hover: #35373c;
|
|
151
|
+
--buttons-button-neutral-pressed: #3c3f44;
|
|
152
|
+
--buttons-button-transparent: #ffffff00;
|
|
153
|
+
--buttons-button-transparent-hover: #27282d;
|
|
154
|
+
--buttons-button-transparent-pressed: #2e3035;
|
|
155
|
+
--foregrounds-fg-base: #edeef0;
|
|
156
|
+
--foregrounds-fg-danger: #fb7185;
|
|
157
|
+
--foregrounds-fg-disabled: #3c3f44;
|
|
158
|
+
--foregrounds-fg-interactive: #60a5fa;
|
|
159
|
+
--foregrounds-fg-interactive-hover: #3b82f6;
|
|
160
|
+
--foregrounds-fg-muted: #696e77;
|
|
161
|
+
--foregrounds-fg-on-color: #ffffff;
|
|
162
|
+
--foregrounds-fg-on-inverted: #0a0a0a;
|
|
163
|
+
--foregrounds-fg-subtle: #adb1b8;
|
|
164
|
+
--others-spacer: #ffffff;
|
|
165
|
+
--shadows-card-hover-1: #ffffff1a;
|
|
166
|
+
--shadows-card-hover-2: #ffffff29;
|
|
167
|
+
--shadows-card-hover-3: #00000066;
|
|
168
|
+
--shadows-card-rest-1: #ffffff1a;
|
|
169
|
+
--shadows-card-rest-2: #ffffff29;
|
|
170
|
+
--shadows-card-rest-3: #00000066;
|
|
171
|
+
--shadows-danger-1: #f43f5e1a;
|
|
172
|
+
--shadows-error-2: #e11d4840;
|
|
173
|
+
--shadows-flyout-1: #ffffff1a;
|
|
174
|
+
--shadows-flyout-2: #00000052;
|
|
175
|
+
--shadows-interactive-with-active-1: #60a5fa;
|
|
176
|
+
--shadows-interactive-with-active-2: #3b82f640;
|
|
177
|
+
--shadows-interactive-with-shadow-1: #dbeafe80;
|
|
178
|
+
--shadows-interactive-with-shadow-2: #60a5fa;
|
|
179
|
+
--shadows-modal-1: #171717;
|
|
180
|
+
--shadows-modal-2: #2e303566;
|
|
181
|
+
--shadows-modal-3: #ffffff1a;
|
|
182
|
+
--shadows-modal-4: #00000052;
|
|
183
|
+
--shadows-modal-5: #00000052;
|
|
184
|
+
--shadows-switch-background-1: #0000001a;
|
|
185
|
+
--shadows-switch-background-2: #0000001a;
|
|
186
|
+
--shadows-switch-background-3: #ffffff29;
|
|
187
|
+
--shadows-switch-background-4: #0000001a;
|
|
188
|
+
--shadows-switch-background-5: #00000033;
|
|
189
|
+
--shadows-switch-handle-1: #ffffff;
|
|
190
|
+
--shadows-switch-handle-2: #ffffff;
|
|
191
|
+
--shadows-switch-handle-3: #00000029;
|
|
192
|
+
--shadows-switch-handle-4: #0000001a;
|
|
193
|
+
--shadows-switch-handle-5: #0000001a;
|
|
194
|
+
--shadows-switch-handle-6: #0000001a;
|
|
195
|
+
--shadows-switch-handle-7: #0000001a;
|
|
196
|
+
--shadows-tooltip-1: #ffffff1a;
|
|
197
|
+
--shadows-tooltip-2: #00000052;
|
|
198
|
+
--stroke-border-base: #2e3035;
|
|
199
|
+
--stroke-border-error: #f43f5e;
|
|
200
|
+
--stroke-border-interactive: #60a5fa;
|
|
201
|
+
--stroke-border-loud: #edeef0;
|
|
202
|
+
--stroke-border-strong: #35373c;
|
|
203
|
+
--stroke-sep: #2e3035;
|
|
204
|
+
--tags-tag-blue-bg: #172554;
|
|
205
|
+
--tags-tag-blue-bg-hover: #1e2a8a;
|
|
206
|
+
--tags-tag-blue-border: #1e3a8a;
|
|
207
|
+
--tags-tag-blue-icon: #1d4ed8;
|
|
208
|
+
--tags-tag-blue-text: #3b82f6;
|
|
209
|
+
--tags-tag-green-bg: #022c22;
|
|
210
|
+
--tags-tag-green-bg-hover: #064e3b;
|
|
211
|
+
--tags-tag-green-border: #064e3b;
|
|
212
|
+
--tags-tag-green-icon: #047857;
|
|
213
|
+
--tags-tag-green-text: #10b981;
|
|
214
|
+
--tags-tag-neutral-bg: #2e3035;
|
|
215
|
+
--tags-tag-neutral-bg-hover: #35373c;
|
|
216
|
+
--tags-tag-neutral-border: #3c3f44;
|
|
217
|
+
--tags-tag-neutral-icon: #7d828a;
|
|
218
|
+
--tags-tag-neutral-text: #adb1b8;
|
|
219
|
+
--tags-tag-orange-bg: #451a03;
|
|
220
|
+
--tags-tag-orange-bg-hover: #78350f;
|
|
221
|
+
--tags-tag-orange-border: #78350f;
|
|
222
|
+
--tags-tag-orange-icon: #b45309;
|
|
223
|
+
--tags-tag-orange-text: #f59e0b;
|
|
224
|
+
--tags-tag-purple-bg: #2e1064;
|
|
225
|
+
--tags-tag-purple-bg-hover: #4c1d95;
|
|
226
|
+
--tags-tag-purple-border: #3c3f44;
|
|
227
|
+
--tags-tag-purple-icon: #6d28d9;
|
|
228
|
+
--tags-tag-purple-text: #8b5cf6;
|
|
229
|
+
--tags-tag-red-bg: #4c0519;
|
|
230
|
+
--tags-tag-red-bg-hover: #881337;
|
|
231
|
+
--tags-tag-red-border: #881337;
|
|
232
|
+
--tags-tag-red-icon: #f43f5e;
|
|
233
|
+
--tags-tag-red-text: #ff6369;
|
|
234
|
+
/* number */
|
|
235
|
+
--radius-s: 0.25rem;
|
|
236
|
+
--radius-m: 0.5rem;
|
|
237
|
+
--radius-l: 0.75rem;
|
|
238
|
+
--radius-round: 624.9375rem;
|
|
239
|
+
--stroke-button-secondary-border: #27282d;
|
|
240
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { typography } from './typography';
|
|
3
|
+
import './index.css';
|
|
4
|
+
import { PaymentThemeOptions } from '../types';
|
|
5
|
+
export { typography };
|
|
6
|
+
export declare function PaymentThemeProvider({ children, theme: customTheme, }: {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
theme?: PaymentThemeOptions;
|
|
9
|
+
}): JSX.Element;
|
|
10
|
+
export declare namespace PaymentThemeProvider {
|
|
11
|
+
var defaultProps: {
|
|
12
|
+
theme: {};
|
|
13
|
+
};
|
|
14
|
+
}
|