@blocklet/payment-react 1.19.1 → 1.19.2
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/components/label.js +2 -1
- package/es/history/credit/transactions-list.js +0 -1
- package/es/payment/form/address.js +2 -1
- package/es/payment/form/index.js +2 -1
- package/lib/components/label.js +3 -1
- package/lib/history/credit/transactions-list.js +0 -1
- package/lib/payment/form/address.js +6 -5
- package/lib/payment/form/index.js +4 -3
- package/package.json +3 -3
- package/src/components/label.tsx +2 -1
- package/src/history/credit/transactions-list.tsx +0 -1
- package/src/payment/form/address.tsx +2 -1
- package/src/payment/form/index.tsx +2 -1
package/es/components/label.js
CHANGED
|
@@ -17,6 +17,7 @@ export default function CustomFormLabel({
|
|
|
17
17
|
display: "flex",
|
|
18
18
|
alignItems: "center",
|
|
19
19
|
gap: 0.5,
|
|
20
|
+
fontSize: "0.875rem",
|
|
20
21
|
fontWeight: 500,
|
|
21
22
|
color: "text.primary",
|
|
22
23
|
"&.MuiFormLabel-root": {
|
|
@@ -31,7 +32,7 @@ export default function CustomFormLabel({
|
|
|
31
32
|
children: [
|
|
32
33
|
children,
|
|
33
34
|
required && /* @__PURE__ */ jsx(Typography, { component: "span", color: "error", children: "*" }),
|
|
34
|
-
tooltip && (typeof tooltip === "string" ? /* @__PURE__ */ jsx(Tooltip, { title: tooltip, children: /* @__PURE__ */ jsx(InfoOutlined, { fontSize: "small", sx: { opacity: 0.7 } }) }) : tooltip)
|
|
35
|
+
tooltip && (typeof tooltip === "string" ? /* @__PURE__ */ jsx(Tooltip, { title: tooltip, children: /* @__PURE__ */ jsx(InfoOutlined, { fontSize: "small", sx: { opacity: 0.7, fontSize: "1rem" } }) }) : tooltip)
|
|
35
36
|
]
|
|
36
37
|
}
|
|
37
38
|
),
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
3
|
-
import { Fade,
|
|
3
|
+
import { Fade, InputAdornment, Stack } from "@mui/material";
|
|
4
4
|
import { Controller, useFormContext, useWatch } from "react-hook-form";
|
|
5
5
|
import FormInput from "../../components/input.js";
|
|
6
|
+
import FormLabel from "../../components/label.js";
|
|
6
7
|
import CountrySelect from "../../components/country-select.js";
|
|
7
8
|
import { getFieldValidation, validatePostalCode } from "../../libs/validator.js";
|
|
8
9
|
export default function AddressForm({ mode, stripe, sx = {}, fieldValidation = {}, errorPosition = "right" }) {
|
package/es/payment/form/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import "react-international-phone/style.css";
|
|
3
3
|
import { useLocaleContext } from "@arcblock/ux/lib/Locale/context";
|
|
4
4
|
import Toast from "@arcblock/ux/lib/Toast";
|
|
5
|
-
import { Box, Button, CircularProgress, Divider, Fade,
|
|
5
|
+
import { Box, Button, CircularProgress, Divider, Fade, Stack, Tooltip, Typography } from "@mui/material";
|
|
6
6
|
import { useMemoizedFn, useSetState } from "ahooks";
|
|
7
7
|
import pWaitFor from "p-wait-for";
|
|
8
8
|
import { useEffect, useMemo, useRef } from "react";
|
|
@@ -15,6 +15,7 @@ import DID from "@arcblock/ux/lib/DID";
|
|
|
15
15
|
import isEmpty from "lodash/isEmpty";
|
|
16
16
|
import { HelpOutline, OpenInNew } from "@mui/icons-material";
|
|
17
17
|
import FormInput from "../../components/input.js";
|
|
18
|
+
import FormLabel from "../../components/label.js";
|
|
18
19
|
import { usePaymentContext } from "../../contexts/payment.js";
|
|
19
20
|
import { useSubscription } from "../../hooks/subscription.js";
|
|
20
21
|
import api from "../../libs/api.js";
|
package/lib/components/label.js
CHANGED
|
@@ -25,6 +25,7 @@ function CustomFormLabel({
|
|
|
25
25
|
display: "flex",
|
|
26
26
|
alignItems: "center",
|
|
27
27
|
gap: 0.5,
|
|
28
|
+
fontSize: "0.875rem",
|
|
28
29
|
fontWeight: 500,
|
|
29
30
|
color: "text.primary",
|
|
30
31
|
"&.MuiFormLabel-root": {
|
|
@@ -45,7 +46,8 @@ function CustomFormLabel({
|
|
|
45
46
|
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_iconsMaterial.InfoOutlined, {
|
|
46
47
|
fontSize: "small",
|
|
47
48
|
sx: {
|
|
48
|
-
opacity: 0.7
|
|
49
|
+
opacity: 0.7,
|
|
50
|
+
fontSize: "1rem"
|
|
49
51
|
}
|
|
50
52
|
})
|
|
51
53
|
}) : tooltip)]
|
|
@@ -111,7 +111,6 @@ const TransactionsTable = _react.default.memo(props => {
|
|
|
111
111
|
label: t("common.creditAmount"),
|
|
112
112
|
name: "credit_amount",
|
|
113
113
|
align: "right",
|
|
114
|
-
width: 120,
|
|
115
114
|
options: {
|
|
116
115
|
customBodyRenderLite: (_, index) => {
|
|
117
116
|
const transaction = data?.list[index];
|
|
@@ -9,6 +9,7 @@ var _context = require("@arcblock/ux/lib/Locale/context");
|
|
|
9
9
|
var _material = require("@mui/material");
|
|
10
10
|
var _reactHookForm = require("react-hook-form");
|
|
11
11
|
var _input = _interopRequireDefault(require("../../components/input"));
|
|
12
|
+
var _label = _interopRequireDefault(require("../../components/label"));
|
|
12
13
|
var _countrySelect = _interopRequireDefault(require("../../components/country-select"));
|
|
13
14
|
var _validator = require("../../libs/validator");
|
|
14
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -40,7 +41,7 @@ function AddressForm({
|
|
|
40
41
|
direction: "column",
|
|
41
42
|
className: "cko-payment-form",
|
|
42
43
|
spacing: 0,
|
|
43
|
-
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(
|
|
44
|
+
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_label.default, {
|
|
44
45
|
className: "base-label",
|
|
45
46
|
children: t("payment.checkout.billing.line1")
|
|
46
47
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_input.default, {
|
|
@@ -52,7 +53,7 @@ function AddressForm({
|
|
|
52
53
|
errorPosition,
|
|
53
54
|
variant: "outlined",
|
|
54
55
|
placeholder: t("payment.checkout.billing.line1")
|
|
55
|
-
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(
|
|
56
|
+
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_label.default, {
|
|
56
57
|
className: "base-label",
|
|
57
58
|
children: t("payment.checkout.billing.city")
|
|
58
59
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_input.default, {
|
|
@@ -64,7 +65,7 @@ function AddressForm({
|
|
|
64
65
|
errorPosition,
|
|
65
66
|
variant: "outlined",
|
|
66
67
|
placeholder: t("payment.checkout.billing.city")
|
|
67
|
-
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(
|
|
68
|
+
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_label.default, {
|
|
68
69
|
className: "base-label",
|
|
69
70
|
children: t("payment.checkout.billing.state")
|
|
70
71
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_input.default, {
|
|
@@ -76,7 +77,7 @@ function AddressForm({
|
|
|
76
77
|
errorPosition,
|
|
77
78
|
variant: "outlined",
|
|
78
79
|
placeholder: t("payment.checkout.billing.state")
|
|
79
|
-
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(
|
|
80
|
+
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_label.default, {
|
|
80
81
|
className: "base-label",
|
|
81
82
|
children: t("payment.checkout.billing.postal_code")
|
|
82
83
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_input.default, {
|
|
@@ -131,7 +132,7 @@ function AddressForm({
|
|
|
131
132
|
direction: "column",
|
|
132
133
|
className: "cko-payment-form",
|
|
133
134
|
spacing: 0,
|
|
134
|
-
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(
|
|
135
|
+
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_label.default, {
|
|
135
136
|
className: "base-label",
|
|
136
137
|
children: t("payment.checkout.billing.postal_code")
|
|
137
138
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Stack, {
|
|
@@ -22,6 +22,7 @@ var _DID = _interopRequireDefault(require("@arcblock/ux/lib/DID"));
|
|
|
22
22
|
var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
23
23
|
var _iconsMaterial = require("@mui/icons-material");
|
|
24
24
|
var _input = _interopRequireDefault(require("../../components/input"));
|
|
25
|
+
var _label = _interopRequireDefault(require("../../components/label"));
|
|
25
26
|
var _payment = require("../../contexts/payment");
|
|
26
27
|
var _subscription = require("../../hooks/subscription");
|
|
27
28
|
var _api = _interopRequireDefault(require("../../libs/api"));
|
|
@@ -756,7 +757,7 @@ function PaymentForm({
|
|
|
756
757
|
overflow: "auto",
|
|
757
758
|
py: 1
|
|
758
759
|
},
|
|
759
|
-
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(
|
|
760
|
+
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_label.default, {
|
|
760
761
|
className: "base-label",
|
|
761
762
|
children: t("payment.checkout.customer.name")
|
|
762
763
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_input.default, {
|
|
@@ -767,7 +768,7 @@ function PaymentForm({
|
|
|
767
768
|
required: t("payment.checkout.required"),
|
|
768
769
|
...(0, _validator.getFieldValidation)("customer_name", checkoutSession.metadata?.page_info?.field_validation, locale)
|
|
769
770
|
}
|
|
770
|
-
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(
|
|
771
|
+
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_label.default, {
|
|
771
772
|
className: "base-label",
|
|
772
773
|
children: t("payment.checkout.customer.email")
|
|
773
774
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_input.default, {
|
|
@@ -780,7 +781,7 @@ function PaymentForm({
|
|
|
780
781
|
...(0, _validator.getFieldValidation)("customer_email", checkoutSession.metadata?.page_info?.field_validation, locale)
|
|
781
782
|
}
|
|
782
783
|
}), checkoutSession.phone_number_collection?.enabled && /* @__PURE__ */(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
783
|
-
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(
|
|
784
|
+
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_label.default, {
|
|
784
785
|
className: "base-label",
|
|
785
786
|
children: t("payment.checkout.customer.phone")
|
|
786
787
|
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_phone.default, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/payment-react",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.2",
|
|
4
4
|
"description": "Reusable react components for payment kit v2",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"@babel/core": "^7.27.4",
|
|
95
95
|
"@babel/preset-env": "^7.27.2",
|
|
96
96
|
"@babel/preset-react": "^7.27.1",
|
|
97
|
-
"@blocklet/payment-types": "1.19.
|
|
97
|
+
"@blocklet/payment-types": "1.19.2",
|
|
98
98
|
"@storybook/addon-essentials": "^7.6.20",
|
|
99
99
|
"@storybook/addon-interactions": "^7.6.20",
|
|
100
100
|
"@storybook/addon-links": "^7.6.20",
|
|
@@ -125,5 +125,5 @@
|
|
|
125
125
|
"vite-plugin-babel": "^1.3.1",
|
|
126
126
|
"vite-plugin-node-polyfills": "^0.23.0"
|
|
127
127
|
},
|
|
128
|
-
"gitHead": "
|
|
128
|
+
"gitHead": "741c897204afc412721a942201516932bff59235"
|
|
129
129
|
}
|
package/src/components/label.tsx
CHANGED
|
@@ -18,6 +18,7 @@ export default function CustomFormLabel({
|
|
|
18
18
|
display: 'flex',
|
|
19
19
|
alignItems: 'center',
|
|
20
20
|
gap: 0.5,
|
|
21
|
+
fontSize: '0.875rem',
|
|
21
22
|
fontWeight: 500,
|
|
22
23
|
color: 'text.primary',
|
|
23
24
|
'&.MuiFormLabel-root': {
|
|
@@ -38,7 +39,7 @@ export default function CustomFormLabel({
|
|
|
38
39
|
{tooltip &&
|
|
39
40
|
(typeof tooltip === 'string' ? (
|
|
40
41
|
<Tooltip title={tooltip}>
|
|
41
|
-
<InfoOutlined fontSize="small" sx={{ opacity: 0.7 }} />
|
|
42
|
+
<InfoOutlined fontSize="small" sx={{ opacity: 0.7, fontSize: '1rem' }} />
|
|
42
43
|
</Tooltip>
|
|
43
44
|
) : (
|
|
44
45
|
tooltip
|
|
@@ -141,7 +141,6 @@ const TransactionsTable = React.memo((props: Props) => {
|
|
|
141
141
|
label: t('common.creditAmount'),
|
|
142
142
|
name: 'credit_amount',
|
|
143
143
|
align: 'right',
|
|
144
|
-
width: 120,
|
|
145
144
|
options: {
|
|
146
145
|
customBodyRenderLite: (_: string, index: number) => {
|
|
147
146
|
const transaction = data?.list[index] as TCreditTransactionExpanded;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
2
|
-
import { Fade,
|
|
2
|
+
import { Fade, InputAdornment, Stack } from '@mui/material';
|
|
3
3
|
import type { SxProps } from '@mui/material';
|
|
4
4
|
import { Controller, useFormContext, useWatch } from 'react-hook-form';
|
|
5
5
|
import FormInput from '../../components/input';
|
|
6
|
+
import FormLabel from '../../components/label';
|
|
6
7
|
import CountrySelect from '../../components/country-select';
|
|
7
8
|
import { getFieldValidation, validatePostalCode } from '../../libs/validator';
|
|
8
9
|
|
|
@@ -5,7 +5,7 @@ import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
|
5
5
|
// import { useTheme } from '@arcblock/ux/lib/Theme';
|
|
6
6
|
import Toast from '@arcblock/ux/lib/Toast';
|
|
7
7
|
import type { TCheckoutSession, TCustomer, TPaymentIntent, TPaymentMethodExpanded } from '@blocklet/payment-types';
|
|
8
|
-
import { Box, Button, CircularProgress, Divider, Fade,
|
|
8
|
+
import { Box, Button, CircularProgress, Divider, Fade, Stack, Tooltip, Typography } from '@mui/material';
|
|
9
9
|
import { useMemoizedFn, useSetState } from 'ahooks';
|
|
10
10
|
import pWaitFor from 'p-wait-for';
|
|
11
11
|
import { useEffect, useMemo, useRef } from 'react';
|
|
@@ -19,6 +19,7 @@ import DID from '@arcblock/ux/lib/DID';
|
|
|
19
19
|
import isEmpty from 'lodash/isEmpty';
|
|
20
20
|
import { HelpOutline, OpenInNew } from '@mui/icons-material';
|
|
21
21
|
import FormInput from '../../components/input';
|
|
22
|
+
import FormLabel from '../../components/label';
|
|
22
23
|
import { usePaymentContext } from '../../contexts/payment';
|
|
23
24
|
import { useSubscription } from '../../hooks/subscription';
|
|
24
25
|
import api from '../../libs/api';
|