@blocklet/payment-react 1.13.294 → 1.13.295

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.
@@ -8,8 +8,9 @@ export type DonateHistory = {
8
8
  method: TPaymentMethod;
9
9
  totalAmount: string;
10
10
  };
11
- export interface ButtonType extends Omit<MUIButtonProps, 'text'> {
12
- text: string;
11
+ export interface ButtonType extends Omit<MUIButtonProps, 'text' | 'icon'> {
12
+ text: string | React.ReactNode;
13
+ icon: React.ReactNode;
13
14
  }
14
15
  export type DonateProps = Pick<CheckoutProps, 'onPaid' | 'onError'> & {
15
16
  settings: DonationSettings;
@@ -297,10 +297,10 @@ export default function CheckoutDonate({
297
297
  }
298
298
  ),
299
299
  /* @__PURE__ */ jsxs(Box, { display: "flex", alignItems: "center", flexDirection: "column", gap: 2, children: [
300
- /* @__PURE__ */ jsxs(Button, { ...inlineOptions.button, onClick: () => setState({ open: true }), children: [
301
- settings.appearance.button.icon,
302
- inlineOptions?.button?.text
303
- ] }),
300
+ /* @__PURE__ */ jsx(Button, { ...inlineOptions.button, onClick: () => setState({ open: true }), children: /* @__PURE__ */ jsxs(Stack, { direction: "row", alignItems: "center", spacing: 0.5, children: [
301
+ inlineOptions?.button?.icon,
302
+ typeof inlineOptions?.button?.text === "string" ? /* @__PURE__ */ jsx(Typography, { sx: { whiteSpace: "nowrap" }, children: inlineOptions?.button?.text }) : inlineOptions?.button?.text
303
+ ] }) }),
304
304
  /* @__PURE__ */ jsx(SupporterSimple, { ...supporters.data })
305
305
  ] })
306
306
  ]
@@ -8,8 +8,9 @@ export type DonateHistory = {
8
8
  method: TPaymentMethod;
9
9
  totalAmount: string;
10
10
  };
11
- export interface ButtonType extends Omit<MUIButtonProps, 'text'> {
12
- text: string;
11
+ export interface ButtonType extends Omit<MUIButtonProps, 'text' | 'icon'> {
12
+ text: string | React.ReactNode;
13
+ icon: React.ReactNode;
13
14
  }
14
15
  export type DonateProps = Pick<CheckoutProps, 'onPaid' | 'onError'> & {
15
16
  settings: DonationSettings;
@@ -371,12 +371,22 @@ function CheckoutDonate({
371
371
  alignItems: "center",
372
372
  flexDirection: "column",
373
373
  gap: 2,
374
- children: [/* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Button, {
374
+ children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Button, {
375
375
  ...inlineOptions.button,
376
376
  onClick: () => setState({
377
377
  open: true
378
378
  }),
379
- children: [settings.appearance.button.icon, inlineOptions?.button?.text]
379
+ children: /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
380
+ direction: "row",
381
+ alignItems: "center",
382
+ spacing: 0.5,
383
+ children: [inlineOptions?.button?.icon, typeof inlineOptions?.button?.text === "string" ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
384
+ sx: {
385
+ whiteSpace: "nowrap"
386
+ },
387
+ children: inlineOptions?.button?.text
388
+ }) : inlineOptions?.button?.text]
389
+ })
380
390
  }), /* @__PURE__ */(0, _jsxRuntime.jsx)(SupporterSimple, {
381
391
  ...supporters.data
382
392
  })]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/payment-react",
3
- "version": "1.13.294",
3
+ "version": "1.13.295",
4
4
  "description": "Reusable react components for payment kit v2",
5
5
  "keywords": [
6
6
  "react",
@@ -91,7 +91,7 @@
91
91
  "@babel/core": "^7.24.7",
92
92
  "@babel/preset-env": "^7.24.7",
93
93
  "@babel/preset-react": "^7.24.7",
94
- "@blocklet/payment-types": "1.13.294",
94
+ "@blocklet/payment-types": "1.13.295",
95
95
  "@storybook/addon-essentials": "^7.6.19",
96
96
  "@storybook/addon-interactions": "^7.6.19",
97
97
  "@storybook/addon-links": "^7.6.19",
@@ -120,5 +120,5 @@
120
120
  "vite-plugin-babel": "^1.2.0",
121
121
  "vite-plugin-node-polyfills": "^0.21.0"
122
122
  },
123
- "gitHead": "94e507a512252badd0ee5b537cba5a1d52cc061b"
123
+ "gitHead": "034b1a233fd2f4386c0fba0fcf7835944dea32ed"
124
124
  }
@@ -45,8 +45,9 @@ export type DonateHistory = {
45
45
  totalAmount: string;
46
46
  };
47
47
 
48
- export interface ButtonType extends Omit<MUIButtonProps, 'text'> {
49
- text: string;
48
+ export interface ButtonType extends Omit<MUIButtonProps, 'text' | 'icon'> {
49
+ text: string | React.ReactNode;
50
+ icon: React.ReactNode;
50
51
  }
51
52
 
52
53
  export type DonateProps = Pick<CheckoutProps, 'onPaid' | 'onError'> & {
@@ -384,8 +385,14 @@ export default function CheckoutDonate({
384
385
  )}
385
386
  <Box display="flex" alignItems="center" flexDirection="column" gap={2}>
386
387
  <Button {...inlineOptions.button} onClick={() => setState({ open: true })}>
387
- {settings.appearance.button.icon}
388
- {inlineOptions?.button?.text}
388
+ <Stack direction="row" alignItems="center" spacing={0.5}>
389
+ {inlineOptions?.button?.icon}
390
+ {typeof inlineOptions?.button?.text === 'string' ? (
391
+ <Typography sx={{ whiteSpace: 'nowrap' }}>{inlineOptions?.button?.text}</Typography>
392
+ ) : (
393
+ inlineOptions?.button?.text
394
+ )}
395
+ </Stack>
389
396
  </Button>
390
397
  <SupporterSimple {...(supporters.data as DonateHistory)} />
391
398
  </Box>