@blocklet/payment-react 1.13.231 → 1.13.233

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.
@@ -12,7 +12,7 @@ export default function TxLink(props) {
12
12
  if (!props.details || props.mode === "customer" && props.method.type === "stripe") {
13
13
  return /* @__PURE__ */ jsx(Typography, { component: "small", color: "text.secondary", children: t("common.none") });
14
14
  }
15
- const { text, link, gas } = getTxLink(props.method, props.details);
15
+ const { text, link } = getTxLink(props.method, props.details);
16
16
  if (link) {
17
17
  return /* @__PURE__ */ jsx(Link, { href: link, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ jsxs(
18
18
  Stack,
@@ -23,10 +23,7 @@ export default function TxLink(props) {
23
23
  justifyContent: props.align === "left" ? "flex-start" : "flex-end",
24
24
  spacing: 1,
25
25
  children: [
26
- /* @__PURE__ */ jsxs(Typography, { component: "span", color: "primary", children: [
27
- text.length > 40 ? [text.slice(0, 8), text.slice(-8)].join("...") : text,
28
- gas
29
- ] }),
26
+ /* @__PURE__ */ jsx(Typography, { component: "span", color: "primary", children: text.length > 40 ? [text.slice(0, 8), text.slice(-8)].join("...") : text }),
30
27
  /* @__PURE__ */ jsx(OpenInNewOutlined, { fontSize: "small" })
31
28
  ]
32
29
  }
@@ -4,11 +4,11 @@ export default function PaymentAmount({ amount, sx }) {
4
4
  return /* @__PURE__ */ jsx(
5
5
  Typography,
6
6
  {
7
+ component: "div",
7
8
  sx: {
8
9
  my: 0.5,
9
10
  fontWeight: 600,
10
11
  fontSize: "2.5rem",
11
- lineHeight: "1.3",
12
12
  letterSpacing: "-0.03rem",
13
13
  fontVariantNumeric: "tabular-nums",
14
14
  ...sx
@@ -243,7 +243,7 @@ export default function PaymentForm({
243
243
  return /* @__PURE__ */ jsxs(Fragment, { children: [
244
244
  /* @__PURE__ */ jsx(Fade, { in: true, children: /* @__PURE__ */ jsxs(Stack, { className: "cko-payment-contact", children: [
245
245
  /* @__PURE__ */ jsxs(Stack, { direction: "row", sx: { mb: 1 }, alignItems: "center", justifyContent: "space-between", children: [
246
- /* @__PURE__ */ jsx(Typography, { sx: { color: "text.primary", fontWeight: 600 }, children: t("payment.checkout.contact") }),
246
+ /* @__PURE__ */ jsx(Typography, { sx: { color: "text.secondary", fontWeight: 600 }, children: t("payment.checkout.contact") }),
247
247
  isColumnLayout || mode !== "standalone" ? null : /* @__PURE__ */ jsx(UserButtons, {})
248
248
  ] }),
249
249
  /* @__PURE__ */ jsxs(Stack, { direction: "column", className: "cko-payment-form", spacing: 0, children: [
@@ -300,7 +300,7 @@ export default function PaymentForm({
300
300
  ] }) }),
301
301
  /* @__PURE__ */ jsx(AddressForm, { mode: checkoutSession.billing_address_collection, stripe: method?.type === "stripe" }),
302
302
  /* @__PURE__ */ jsx(Fade, { in: true, children: /* @__PURE__ */ jsxs(Stack, { direction: "column", alignItems: "flex-start", className: "cko-payment-methods", children: [
303
- /* @__PURE__ */ jsx(Typography, { sx: { mb: 1, color: "text.primary", fontWeight: 600 }, children: t("payment.checkout.method") }),
303
+ /* @__PURE__ */ jsx(Typography, { sx: { color: "text.secondary", fontWeight: 600 }, children: t("payment.checkout.method") }),
304
304
  /* @__PURE__ */ jsx(Stack, { direction: "row", sx: { width: "100%" }, children: /* @__PURE__ */ jsx(
305
305
  Controller,
306
306
  {
@@ -249,7 +249,7 @@ export function PaymentInner({
249
249
  }
250
250
  )
251
251
  ] }) }),
252
- /* @__PURE__ */ jsxs(Stack, { className: "cko-payment", direction: "column", spacing: { xs: 2, sm: 4 }, children: [
252
+ /* @__PURE__ */ jsxs(Stack, { className: "cko-payment", direction: "column", spacing: { xs: 2, sm: 3 }, children: [
253
253
  completed && /* @__PURE__ */ jsx(
254
254
  PaymentSuccess,
255
255
  {
@@ -388,7 +388,7 @@ export const Root = styled(Box)`
388
388
  .cko-container {
389
389
  flex-direction: column;
390
390
  align-items: center;
391
- gap: 24px;
391
+ gap: 32px;
392
392
  min-width: 350px;
393
393
  max-width: 400px;
394
394
  }
@@ -142,10 +142,10 @@ export default function PaymentSummary({
142
142
  }
143
143
  };
144
144
  return /* @__PURE__ */ jsx(Fade, { in: true, children: /* @__PURE__ */ jsxs(Stack, { className: "cko-product", direction: "column", ...rest, children: [
145
- /* @__PURE__ */ jsxs(Stack, { className: "cko-product-summary", direction: "column", alignItems: "flex-start", sx: { mb: { xs: 0, sm: 3 } }, children: [
146
- /* @__PURE__ */ jsx(Typography, { sx: { fontWeight: 500, fontSize: "1.15rem", color: "text.secondary" }, children: action || headlines.action }),
145
+ /* @__PURE__ */ jsxs(Stack, { className: "cko-product-summary", direction: "column", alignItems: "flex-start", sx: { mb: { xs: 1, sm: 3 } }, children: [
146
+ /* @__PURE__ */ jsx(Typography, { component: "div", sx: { fontWeight: 500, fontSize: "1.15rem", color: "text.secondary" }, children: action || headlines.action }),
147
147
  /* @__PURE__ */ jsx(PaymentAmount, { amount: headlines.amount }),
148
- headlines.then && /* @__PURE__ */ jsx(Typography, { sx: { fontSize: "0.9rem", color: "text.secondary" }, children: headlines.then })
148
+ headlines.then && /* @__PURE__ */ jsx(Typography, { component: "div", sx: { fontSize: "0.9rem", color: "text.secondary" }, children: headlines.then })
149
149
  ] }),
150
150
  /* @__PURE__ */ jsx(Stack, { spacing: { xs: 1, sm: 2 }, children: items.map(
151
151
  (x) => x.price.custom_unit_amount && onChangeAmount && donationSettings ? /* @__PURE__ */ jsx(
@@ -26,8 +26,7 @@ function TxLink(props) {
26
26
  }
27
27
  const {
28
28
  text,
29
- link,
30
- gas
29
+ link
31
30
  } = (0, _util.getTxLink)(props.method, props.details);
32
31
  if (link) {
33
32
  return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Link, {
@@ -40,10 +39,10 @@ function TxLink(props) {
40
39
  alignItems: "center",
41
40
  justifyContent: props.align === "left" ? "flex-start" : "flex-end",
42
41
  spacing: 1,
43
- children: [/* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Typography, {
42
+ children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
44
43
  component: "span",
45
44
  color: "primary",
46
- children: [text.length > 40 ? [text.slice(0, 8), text.slice(-8)].join("...") : text, gas]
45
+ children: text.length > 40 ? [text.slice(0, 8), text.slice(-8)].join("...") : text
47
46
  }), /* @__PURE__ */(0, _jsxRuntime.jsx)(_iconsMaterial.OpenInNewOutlined, {
48
47
  fontSize: "small"
49
48
  })]
@@ -11,11 +11,11 @@ function PaymentAmount({
11
11
  sx
12
12
  }) {
13
13
  return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
14
+ component: "div",
14
15
  sx: {
15
16
  my: 0.5,
16
17
  fontWeight: 600,
17
18
  fontSize: "2.5rem",
18
- lineHeight: "1.3",
19
19
  letterSpacing: "-0.03rem",
20
20
  fontVariantNumeric: "tabular-nums",
21
21
  ...sx
@@ -316,7 +316,7 @@ function PaymentForm({
316
316
  justifyContent: "space-between",
317
317
  children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
318
318
  sx: {
319
- color: "text.primary",
319
+ color: "text.secondary",
320
320
  fontWeight: 600
321
321
  },
322
322
  children: t("payment.checkout.contact")
@@ -382,8 +382,7 @@ function PaymentForm({
382
382
  className: "cko-payment-methods",
383
383
  children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
384
384
  sx: {
385
- mb: 1,
386
- color: "text.primary",
385
+ color: "text.secondary",
387
386
  fontWeight: 600
388
387
  },
389
388
  children: t("payment.checkout.method")
@@ -330,7 +330,7 @@ function PaymentInner({
330
330
  direction: "column",
331
331
  spacing: {
332
332
  xs: 2,
333
- sm: 4
333
+ sm: 3
334
334
  },
335
335
  children: [completed && /* @__PURE__ */(0, _jsxRuntime.jsx)(_success.default, {
336
336
  mode,
@@ -465,7 +465,7 @@ const Root = exports.Root = (0, _system.styled)(_material.Box)`
465
465
  .cko-container {
466
466
  flex-direction: column;
467
467
  align-items: center;
468
- gap: 24px;
468
+ gap: 32px;
469
469
  min-width: 350px;
470
470
  max-width: 400px;
471
471
  }
@@ -177,11 +177,12 @@ function PaymentSummary({
177
177
  alignItems: "flex-start",
178
178
  sx: {
179
179
  mb: {
180
- xs: 0,
180
+ xs: 1,
181
181
  sm: 3
182
182
  }
183
183
  },
184
184
  children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
185
+ component: "div",
185
186
  sx: {
186
187
  fontWeight: 500,
187
188
  fontSize: "1.15rem",
@@ -191,6 +192,7 @@ function PaymentSummary({
191
192
  }), /* @__PURE__ */(0, _jsxRuntime.jsx)(_amount.default, {
192
193
  amount: headlines.amount
193
194
  }), headlines.then && /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
195
+ component: "div",
194
196
  sx: {
195
197
  fontSize: "0.9rem",
196
198
  color: "text.secondary"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/payment-react",
3
- "version": "1.13.231",
3
+ "version": "1.13.233",
4
4
  "description": "Reusable react components for payment kit v2",
5
5
  "keywords": [
6
6
  "react",
@@ -90,7 +90,7 @@
90
90
  "@babel/core": "^7.24.4",
91
91
  "@babel/preset-env": "^7.24.4",
92
92
  "@babel/preset-react": "^7.24.1",
93
- "@blocklet/payment-types": "1.13.231",
93
+ "@blocklet/payment-types": "1.13.233",
94
94
  "@storybook/addon-essentials": "^7.6.17",
95
95
  "@storybook/addon-interactions": "^7.6.17",
96
96
  "@storybook/addon-links": "^7.6.17",
@@ -119,5 +119,5 @@
119
119
  "vite-plugin-babel": "^1.2.0",
120
120
  "vite-plugin-node-polyfills": "^0.21.0"
121
121
  },
122
- "gitHead": "256dbf9b77d59252cbb5db1832544ce5c7dfa4f4"
122
+ "gitHead": "854b8c4502657675e5d08279d2efca31bafa0a88"
123
123
  }
@@ -26,7 +26,7 @@ export default function TxLink(props: {
26
26
  );
27
27
  }
28
28
 
29
- const { text, link, gas } = getTxLink(props.method, props.details);
29
+ const { text, link } = getTxLink(props.method, props.details);
30
30
 
31
31
  if (link) {
32
32
  return (
@@ -39,7 +39,6 @@ export default function TxLink(props: {
39
39
  spacing={1}>
40
40
  <Typography component="span" color="primary">
41
41
  {text.length > 40 ? [text.slice(0, 8), text.slice(-8)].join('...') : text}
42
- {gas}
43
42
  </Typography>
44
43
  <OpenInNewOutlined fontSize="small" />
45
44
  </Stack>
@@ -5,11 +5,11 @@ type Props = { amount: string; sx?: any };
5
5
  export default function PaymentAmount({ amount, sx }: Props) {
6
6
  return (
7
7
  <Typography
8
+ component="div"
8
9
  sx={{
9
10
  my: 0.5,
10
11
  fontWeight: 600,
11
12
  fontSize: '2.5rem',
12
- lineHeight: '1.3',
13
13
  letterSpacing: '-0.03rem',
14
14
  fontVariantNumeric: 'tabular-nums',
15
15
  ...sx,
@@ -305,7 +305,7 @@ export default function PaymentForm({
305
305
  <Fade in>
306
306
  <Stack className="cko-payment-contact">
307
307
  <Stack direction="row" sx={{ mb: 1 }} alignItems="center" justifyContent="space-between">
308
- <Typography sx={{ color: 'text.primary', fontWeight: 600 }}>{t('payment.checkout.contact')}</Typography>
308
+ <Typography sx={{ color: 'text.secondary', fontWeight: 600 }}>{t('payment.checkout.contact')}</Typography>
309
309
  {isColumnLayout || mode !== 'standalone' ? null : <UserButtons />}
310
310
  </Stack>
311
311
  <Stack direction="column" className="cko-payment-form" spacing={0}>
@@ -359,7 +359,7 @@ export default function PaymentForm({
359
359
  <AddressForm mode={checkoutSession.billing_address_collection as string} stripe={method?.type === 'stripe'} />
360
360
  <Fade in>
361
361
  <Stack direction="column" alignItems="flex-start" className="cko-payment-methods">
362
- <Typography sx={{ mb: 1, color: 'text.primary', fontWeight: 600 }}>{t('payment.checkout.method')}</Typography>
362
+ <Typography sx={{ color: 'text.secondary', fontWeight: 600 }}>{t('payment.checkout.method')}</Typography>
363
363
  <Stack direction="row" sx={{ width: '100%' }}>
364
364
  <Controller
365
365
  name="payment_currency"
@@ -295,7 +295,7 @@ export function PaymentInner({
295
295
  />
296
296
  </Stack>
297
297
  </Fade>
298
- <Stack className="cko-payment" direction="column" spacing={{ xs: 2, sm: 4 }}>
298
+ <Stack className="cko-payment" direction="column" spacing={{ xs: 2, sm: 3 }}>
299
299
  {completed && (
300
300
  <PaymentSuccess
301
301
  mode={mode}
@@ -443,7 +443,7 @@ export const Root = styled(Box)<{ mode: LiteralUnion<'standalone' | 'inline' | '
443
443
  .cko-container {
444
444
  flex-direction: column;
445
445
  align-items: center;
446
- gap: 24px;
446
+ gap: 32px;
447
447
  min-width: 350px;
448
448
  max-width: 400px;
449
449
  }
@@ -176,13 +176,15 @@ export default function PaymentSummary({
176
176
  return (
177
177
  <Fade in>
178
178
  <Stack className="cko-product" direction="column" {...rest}>
179
- <Stack className="cko-product-summary" direction="column" alignItems="flex-start" sx={{ mb: { xs: 0, sm: 3 } }}>
180
- <Typography sx={{ fontWeight: 500, fontSize: '1.15rem', color: 'text.secondary' }}>
179
+ <Stack className="cko-product-summary" direction="column" alignItems="flex-start" sx={{ mb: { xs: 1, sm: 3 } }}>
180
+ <Typography component="div" sx={{ fontWeight: 500, fontSize: '1.15rem', color: 'text.secondary' }}>
181
181
  {action || headlines.action}
182
182
  </Typography>
183
183
  <PaymentAmount amount={headlines.amount} />
184
184
  {headlines.then && (
185
- <Typography sx={{ fontSize: '0.9rem', color: 'text.secondary' }}>{headlines.then}</Typography>
185
+ <Typography component="div" sx={{ fontSize: '0.9rem', color: 'text.secondary' }}>
186
+ {headlines.then}
187
+ </Typography>
186
188
  )}
187
189
  </Stack>
188
190
  <Stack spacing={{ xs: 1, sm: 2 }}>