@blocklet/payment-react 1.25.10 → 1.26.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 (160) hide show
  1. package/es/checkout-v2/checkout-v2.d.ts +2 -0
  2. package/es/checkout-v2/checkout-v2.js +121 -0
  3. package/es/checkout-v2/components/dialogs/checkout-dialogs.d.ts +1 -0
  4. package/es/checkout-v2/components/dialogs/checkout-dialogs.js +106 -0
  5. package/es/checkout-v2/components/left/billing-toggle.d.ts +6 -0
  6. package/es/checkout-v2/components/left/billing-toggle.js +118 -0
  7. package/es/checkout-v2/components/left/cross-sell-card.d.ts +10 -0
  8. package/es/checkout-v2/components/left/cross-sell-card.js +167 -0
  9. package/es/checkout-v2/components/left/product-item-card.d.ts +26 -0
  10. package/es/checkout-v2/components/left/product-item-card.js +571 -0
  11. package/es/checkout-v2/components/left/promotion-input.d.ts +19 -0
  12. package/es/checkout-v2/components/left/promotion-input.js +178 -0
  13. package/es/checkout-v2/components/left/staking-breakdown.d.ts +9 -0
  14. package/es/checkout-v2/components/left/staking-breakdown.js +48 -0
  15. package/es/checkout-v2/components/left/trial-info.d.ts +13 -0
  16. package/es/checkout-v2/components/left/trial-info.js +48 -0
  17. package/es/checkout-v2/components/right/currency-grid.d.ts +8 -0
  18. package/es/checkout-v2/components/right/currency-grid.js +48 -0
  19. package/es/checkout-v2/components/right/customer-info-card.d.ts +17 -0
  20. package/es/checkout-v2/components/right/customer-info-card.js +156 -0
  21. package/es/checkout-v2/components/right/status-feedback.d.ts +7 -0
  22. package/es/checkout-v2/components/right/status-feedback.js +17 -0
  23. package/es/checkout-v2/components/right/submit-button.d.ts +10 -0
  24. package/es/checkout-v2/components/right/submit-button.js +29 -0
  25. package/es/checkout-v2/components/right/subscription-disclaimer.d.ts +11 -0
  26. package/es/checkout-v2/components/right/subscription-disclaimer.js +8 -0
  27. package/es/checkout-v2/components/shared/exchange-rate-footer.d.ts +23 -0
  28. package/es/checkout-v2/components/shared/exchange-rate-footer.js +182 -0
  29. package/es/checkout-v2/components/shared/scenario-badge.d.ts +6 -0
  30. package/es/checkout-v2/components/shared/scenario-badge.js +47 -0
  31. package/es/checkout-v2/components/shared/total-display.d.ts +7 -0
  32. package/es/checkout-v2/components/shared/total-display.js +84 -0
  33. package/es/checkout-v2/index.d.ts +2 -0
  34. package/es/checkout-v2/index.js +1 -0
  35. package/es/checkout-v2/layouts/checkout-layout.d.ts +7 -0
  36. package/es/checkout-v2/layouts/checkout-layout.js +226 -0
  37. package/es/checkout-v2/panels/left/composite-panel.d.ts +1 -0
  38. package/es/checkout-v2/panels/left/composite-panel.js +423 -0
  39. package/es/checkout-v2/panels/left/credit-topup-panel.d.ts +1 -0
  40. package/es/checkout-v2/panels/left/credit-topup-panel.js +615 -0
  41. package/es/checkout-v2/panels/left/scenario-router.d.ts +1 -0
  42. package/es/checkout-v2/panels/left/scenario-router.js +19 -0
  43. package/es/checkout-v2/panels/right/payment-panel.d.ts +1 -0
  44. package/es/checkout-v2/panels/right/payment-panel.js +644 -0
  45. package/es/checkout-v2/types.d.ts +15 -0
  46. package/es/checkout-v2/types.js +0 -0
  47. package/es/checkout-v2/utils/format.d.ts +59 -0
  48. package/es/checkout-v2/utils/format.js +125 -0
  49. package/es/checkout-v2/utils/scenario-detector.d.ts +3 -0
  50. package/es/checkout-v2/utils/scenario-detector.js +17 -0
  51. package/es/checkout-v2/views/error-view.d.ts +7 -0
  52. package/es/checkout-v2/views/error-view.js +269 -0
  53. package/es/checkout-v2/views/loading-view.d.ts +5 -0
  54. package/es/checkout-v2/views/loading-view.js +158 -0
  55. package/es/checkout-v2/views/success-view.d.ts +29 -0
  56. package/es/checkout-v2/views/success-view.js +614 -0
  57. package/es/components/phone-field.d.ts +14 -0
  58. package/es/components/phone-field.js +96 -0
  59. package/es/index.d.ts +3 -1
  60. package/es/index.js +3 -1
  61. package/es/locales/en.js +45 -6
  62. package/es/locales/zh.js +45 -6
  63. package/es/payment/form/index.js +10 -1
  64. package/lib/checkout-v2/checkout-v2.d.ts +2 -0
  65. package/lib/checkout-v2/checkout-v2.js +151 -0
  66. package/lib/checkout-v2/components/dialogs/checkout-dialogs.d.ts +1 -0
  67. package/lib/checkout-v2/components/dialogs/checkout-dialogs.js +131 -0
  68. package/lib/checkout-v2/components/left/billing-toggle.d.ts +6 -0
  69. package/lib/checkout-v2/components/left/billing-toggle.js +126 -0
  70. package/lib/checkout-v2/components/left/cross-sell-card.d.ts +10 -0
  71. package/lib/checkout-v2/components/left/cross-sell-card.js +257 -0
  72. package/lib/checkout-v2/components/left/product-item-card.d.ts +26 -0
  73. package/lib/checkout-v2/components/left/product-item-card.js +738 -0
  74. package/lib/checkout-v2/components/left/promotion-input.d.ts +19 -0
  75. package/lib/checkout-v2/components/left/promotion-input.js +220 -0
  76. package/lib/checkout-v2/components/left/staking-breakdown.d.ts +9 -0
  77. package/lib/checkout-v2/components/left/staking-breakdown.js +96 -0
  78. package/lib/checkout-v2/components/left/trial-info.d.ts +13 -0
  79. package/lib/checkout-v2/components/left/trial-info.js +82 -0
  80. package/lib/checkout-v2/components/right/currency-grid.d.ts +8 -0
  81. package/lib/checkout-v2/components/right/currency-grid.js +96 -0
  82. package/lib/checkout-v2/components/right/customer-info-card.d.ts +17 -0
  83. package/lib/checkout-v2/components/right/customer-info-card.js +246 -0
  84. package/lib/checkout-v2/components/right/status-feedback.d.ts +7 -0
  85. package/lib/checkout-v2/components/right/status-feedback.js +30 -0
  86. package/lib/checkout-v2/components/right/submit-button.d.ts +10 -0
  87. package/lib/checkout-v2/components/right/submit-button.js +35 -0
  88. package/lib/checkout-v2/components/right/subscription-disclaimer.d.ts +11 -0
  89. package/lib/checkout-v2/components/right/subscription-disclaimer.js +33 -0
  90. package/lib/checkout-v2/components/shared/exchange-rate-footer.d.ts +23 -0
  91. package/lib/checkout-v2/components/shared/exchange-rate-footer.js +282 -0
  92. package/lib/checkout-v2/components/shared/scenario-badge.d.ts +6 -0
  93. package/lib/checkout-v2/components/shared/scenario-badge.js +57 -0
  94. package/lib/checkout-v2/components/shared/total-display.d.ts +7 -0
  95. package/lib/checkout-v2/components/shared/total-display.js +154 -0
  96. package/lib/checkout-v2/index.d.ts +2 -0
  97. package/lib/checkout-v2/index.js +13 -0
  98. package/lib/checkout-v2/layouts/checkout-layout.d.ts +7 -0
  99. package/lib/checkout-v2/layouts/checkout-layout.js +308 -0
  100. package/lib/checkout-v2/panels/left/composite-panel.d.ts +1 -0
  101. package/lib/checkout-v2/panels/left/composite-panel.js +515 -0
  102. package/lib/checkout-v2/panels/left/credit-topup-panel.d.ts +1 -0
  103. package/lib/checkout-v2/panels/left/credit-topup-panel.js +799 -0
  104. package/lib/checkout-v2/panels/left/scenario-router.d.ts +1 -0
  105. package/lib/checkout-v2/panels/left/scenario-router.js +29 -0
  106. package/lib/checkout-v2/panels/right/payment-panel.d.ts +1 -0
  107. package/lib/checkout-v2/panels/right/payment-panel.js +906 -0
  108. package/lib/checkout-v2/types.d.ts +15 -0
  109. package/lib/checkout-v2/types.js +1 -0
  110. package/lib/checkout-v2/utils/format.d.ts +59 -0
  111. package/lib/checkout-v2/utils/format.js +158 -0
  112. package/lib/checkout-v2/utils/scenario-detector.d.ts +3 -0
  113. package/lib/checkout-v2/utils/scenario-detector.js +23 -0
  114. package/lib/checkout-v2/views/error-view.d.ts +7 -0
  115. package/lib/checkout-v2/views/error-view.js +321 -0
  116. package/lib/checkout-v2/views/loading-view.d.ts +5 -0
  117. package/lib/checkout-v2/views/loading-view.js +168 -0
  118. package/lib/checkout-v2/views/success-view.d.ts +29 -0
  119. package/lib/checkout-v2/views/success-view.js +735 -0
  120. package/lib/components/phone-field.d.ts +14 -0
  121. package/lib/components/phone-field.js +130 -0
  122. package/lib/index.d.ts +3 -1
  123. package/lib/index.js +8 -0
  124. package/lib/locales/en.js +45 -6
  125. package/lib/locales/zh.js +45 -6
  126. package/lib/payment/form/index.js +10 -1
  127. package/package.json +4 -3
  128. package/src/checkout-v2/checkout-v2.tsx +155 -0
  129. package/src/checkout-v2/components/dialogs/checkout-dialogs.tsx +134 -0
  130. package/src/checkout-v2/components/left/billing-toggle.tsx +122 -0
  131. package/src/checkout-v2/components/left/cross-sell-card.tsx +170 -0
  132. package/src/checkout-v2/components/left/product-item-card.tsx +634 -0
  133. package/src/checkout-v2/components/left/promotion-input.tsx +207 -0
  134. package/src/checkout-v2/components/left/staking-breakdown.tsx +57 -0
  135. package/src/checkout-v2/components/left/trial-info.tsx +63 -0
  136. package/src/checkout-v2/components/right/currency-grid.tsx +59 -0
  137. package/src/checkout-v2/components/right/customer-info-card.tsx +214 -0
  138. package/src/checkout-v2/components/right/status-feedback.tsx +35 -0
  139. package/src/checkout-v2/components/right/submit-button.tsx +37 -0
  140. package/src/checkout-v2/components/right/subscription-disclaimer.tsx +27 -0
  141. package/src/checkout-v2/components/shared/exchange-rate-footer.tsx +221 -0
  142. package/src/checkout-v2/components/shared/scenario-badge.tsx +51 -0
  143. package/src/checkout-v2/components/shared/total-display.tsx +112 -0
  144. package/src/checkout-v2/index.ts +2 -0
  145. package/src/checkout-v2/layouts/checkout-layout.tsx +232 -0
  146. package/src/checkout-v2/panels/left/composite-panel.tsx +465 -0
  147. package/src/checkout-v2/panels/left/credit-topup-panel.tsx +681 -0
  148. package/src/checkout-v2/panels/left/scenario-router.tsx +22 -0
  149. package/src/checkout-v2/panels/right/payment-panel.tsx +703 -0
  150. package/src/checkout-v2/types.ts +18 -0
  151. package/src/checkout-v2/utils/format.ts +204 -0
  152. package/src/checkout-v2/utils/scenario-detector.ts +30 -0
  153. package/src/checkout-v2/views/error-view.tsx +293 -0
  154. package/src/checkout-v2/views/loading-view.tsx +162 -0
  155. package/src/checkout-v2/views/success-view.tsx +770 -0
  156. package/src/components/phone-field.tsx +119 -0
  157. package/src/index.ts +3 -0
  158. package/src/locales/en.tsx +45 -4
  159. package/src/locales/zh.tsx +43 -4
  160. package/src/payment/form/index.tsx +16 -1
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ module.exports = BillingToggle;
7
+ var _jsxRuntime = require("react/jsx-runtime");
8
+ var _TrendingDown = _interopRequireDefault(require("@mui/icons-material/TrendingDown"));
9
+ var _material = require("@mui/material");
10
+ var _context = require("@arcblock/ux/lib/Locale/context");
11
+ var _format = require("../../utils/format");
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ function BillingToggle({
14
+ billingInterval
15
+ }) {
16
+ const {
17
+ t
18
+ } = (0, _context.useLocaleContext)();
19
+ if (!billingInterval?.available?.length || billingInterval.available.length <= 1) {
20
+ return null;
21
+ }
22
+ const best = billingInterval.available.reduce((a, b) => Number(b.savings || 0) > Number(a.savings || 0) ? b : a);
23
+ return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
24
+ direction: "row",
25
+ alignItems: "center",
26
+ spacing: 2,
27
+ sx: {
28
+ mb: 3
29
+ },
30
+ children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Stack, {
31
+ direction: "row",
32
+ alignItems: "center",
33
+ sx: {
34
+ bgcolor: "background.paper",
35
+ borderRadius: "9999px",
36
+ border: "1px solid",
37
+ borderColor: "divider",
38
+ p: "4px",
39
+ display: "inline-flex",
40
+ boxShadow: theme => theme.palette.mode === "dark" ? "0 1px 2px 0 rgba(0,0,0,0.3)" : "0 1px 2px 0 rgba(0,0,0,0.05)"
41
+ },
42
+ children: billingInterval.available.map(option => {
43
+ const isSelected = option.interval === billingInterval.current;
44
+ const selectedSx = {
45
+ bgcolor: th => th.palette.mode === "dark" ? "rgba(156,106,222,0.25)" : "rgba(156,106,222,0.15)",
46
+ color: "primary.main",
47
+ backdropFilter: "blur(8px)",
48
+ WebkitBackdropFilter: "blur(8px)",
49
+ boxShadow: th => th.palette.mode === "dark" ? "0 2px 8px rgba(156,106,222,0.2), inset 0 1px 0 rgba(255,255,255,0.06)" : "0 2px 8px rgba(156,106,222,0.15), inset 0 1px 0 rgba(255,255,255,0.5)",
50
+ border: "1px solid",
51
+ borderColor: th => th.palette.mode === "dark" ? "rgba(156,106,222,0.3)" : "rgba(156,106,222,0.2)"
52
+ };
53
+ const unselectedSx = {
54
+ color: "text.secondary",
55
+ border: "1px solid transparent",
56
+ "&:hover": {
57
+ color: "text.primary"
58
+ }
59
+ };
60
+ return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
61
+ onClick: () => {
62
+ if (option.interval !== billingInterval.current && !billingInterval.switching) {
63
+ billingInterval.switch(option.interval);
64
+ }
65
+ },
66
+ sx: {
67
+ px: 3.5,
68
+ py: 1,
69
+ borderRadius: "9999px",
70
+ cursor: "pointer",
71
+ transition: "all 0.3s ease",
72
+ userSelect: "none",
73
+ ...(isSelected ? selectedSx : unselectedSx)
74
+ },
75
+ children: billingInterval.switching && isSelected ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.CircularProgress, {
76
+ size: 14,
77
+ color: "inherit",
78
+ sx: {
79
+ my: "1px"
80
+ }
81
+ }) : /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
82
+ component: "span",
83
+ sx: {
84
+ fontSize: 14,
85
+ fontWeight: 700,
86
+ color: "inherit",
87
+ lineHeight: 1
88
+ },
89
+ children: t(_format.INTERVAL_LOCALE_KEY[option.interval] || option.interval)
90
+ })
91
+ }, option.interval);
92
+ })
93
+ }), best.savings && Number(best.savings) > 0 && /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
94
+ direction: "row",
95
+ alignItems: "center",
96
+ spacing: 0.75,
97
+ sx: {
98
+ px: 1.5,
99
+ py: 0.75,
100
+ bgcolor: theme => theme.palette.mode === "dark" ? "rgba(18,184,134,0.1)" : "#ebfef5",
101
+ color: "#12b886",
102
+ fontSize: 11,
103
+ fontWeight: 700,
104
+ borderRadius: "9999px",
105
+ border: "1px solid",
106
+ borderColor: theme => theme.palette.mode === "dark" ? "rgba(18,184,134,0.2)" : "#d3f9e8",
107
+ textTransform: "uppercase",
108
+ letterSpacing: "0.05em"
109
+ },
110
+ children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_TrendingDown.default, {
111
+ sx: {
112
+ fontSize: 14
113
+ }
114
+ }), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Typography, {
115
+ component: "span",
116
+ sx: {
117
+ fontSize: "inherit",
118
+ fontWeight: "inherit",
119
+ color: "inherit",
120
+ lineHeight: 1
121
+ },
122
+ children: ["SAVE ", best.savings, "%"]
123
+ })]
124
+ })]
125
+ });
126
+ }
@@ -0,0 +1,10 @@
1
+ import type { TPaymentCurrency, TPrice } from '@blocklet/payment-types';
2
+ interface CrossSellCardProps {
3
+ crossSellItem: TPrice;
4
+ currency: TPaymentCurrency | null;
5
+ exchangeRate: string | null;
6
+ crossSellRequired: boolean;
7
+ onAdd: () => Promise<void>;
8
+ }
9
+ export default function CrossSellCard({ crossSellItem, currency, exchangeRate, crossSellRequired, onAdd, }: CrossSellCardProps): import("react").JSX.Element | null;
10
+ export {};
@@ -0,0 +1,257 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ module.exports = CrossSellCard;
7
+ var _jsxRuntime = require("react/jsx-runtime");
8
+ var _AddShoppingCart = _interopRequireDefault(require("@mui/icons-material/AddShoppingCart"));
9
+ var _ShoppingCartCheckout = _interopRequireDefault(require("@mui/icons-material/ShoppingCartCheckout"));
10
+ var _material = require("@mui/material");
11
+ var _context = require("@arcblock/ux/lib/Locale/context");
12
+ var _format = require("../../utils/format");
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ function CrossSellCard({
15
+ crossSellItem,
16
+ currency,
17
+ exchangeRate,
18
+ crossSellRequired,
19
+ onAdd
20
+ }) {
21
+ const {
22
+ t
23
+ } = (0, _context.useLocaleContext)();
24
+ if (!crossSellItem) return null;
25
+ const {
26
+ product
27
+ } = crossSellItem;
28
+ const productImage = product?.images?.[0] || "";
29
+ const productName = product?.name || t("payment.checkout.cross_sell.add");
30
+ const {
31
+ recurring
32
+ } = crossSellItem;
33
+ const intervalKey = recurring?.interval ? _format.INTERVAL_LOCALE_KEY[recurring.interval] : null;
34
+ const rawDescription = product?.description || "";
35
+ const subtitle = (() => {
36
+ if (rawDescription && rawDescription !== productName) return rawDescription;
37
+ return intervalKey ? t(intervalKey) : "";
38
+ })();
39
+ return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
40
+ sx: {
41
+ position: "relative"
42
+ },
43
+ children: [crossSellRequired && /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Chip, {
44
+ label: (0, _format.tSafe)(t, "payment.checkout.cross_sell.recommended", "RECOMMENDED"),
45
+ size: "small",
46
+ sx: {
47
+ position: "absolute",
48
+ top: 0,
49
+ right: 40,
50
+ transform: "translateY(-50%)",
51
+ zIndex: 1,
52
+ height: 22,
53
+ fontSize: 9,
54
+ fontWeight: 900,
55
+ letterSpacing: "0.12em",
56
+ bgcolor: "primary.main",
57
+ color: "#fff",
58
+ boxShadow: "0 4px 12px rgba(45,124,243,0.2)",
59
+ "& .MuiChip-label": {
60
+ px: 1.5
61
+ }
62
+ }
63
+ }), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
64
+ sx: {
65
+ p: {
66
+ xs: 2,
67
+ md: 3
68
+ },
69
+ bgcolor: "background.paper",
70
+ borderRadius: {
71
+ xs: "16px",
72
+ md: "24px"
73
+ },
74
+ border: "2px dashed",
75
+ borderColor: theme => theme.palette.mode === "dark" ? "rgba(255,255,255,0.15)" : "rgba(45,124,243,0.25)",
76
+ boxShadow: theme => theme.palette.mode === "dark" ? "0 12px 40px -8px rgba(0,0,0,0.3)" : "0 12px 40px -8px rgba(0,0,0,0.06)",
77
+ transition: "all 0.3s ease",
78
+ cursor: "pointer",
79
+ "&:hover": {
80
+ borderColor: "primary.main",
81
+ boxShadow: "0 12px 40px -8px rgba(0,0,0,0.1)"
82
+ }
83
+ },
84
+ onClick: onAdd,
85
+ children: /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
86
+ direction: "row",
87
+ spacing: {
88
+ xs: 1.5,
89
+ md: 2.5
90
+ },
91
+ sx: {
92
+ alignItems: "center",
93
+ width: "100%"
94
+ },
95
+ children: [productImage ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Avatar, {
96
+ src: productImage,
97
+ variant: "rounded",
98
+ sx: {
99
+ width: {
100
+ xs: 44,
101
+ md: 64
102
+ },
103
+ height: {
104
+ xs: 44,
105
+ md: 64
106
+ },
107
+ borderRadius: {
108
+ xs: "12px",
109
+ md: "16px"
110
+ },
111
+ flexShrink: 0
112
+ }
113
+ }) : /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Avatar, {
114
+ variant: "rounded",
115
+ sx: {
116
+ width: {
117
+ xs: 44,
118
+ md: 64
119
+ },
120
+ height: {
121
+ xs: 44,
122
+ md: 64
123
+ },
124
+ borderRadius: {
125
+ xs: "12px",
126
+ md: "16px"
127
+ },
128
+ bgcolor: theme => theme.palette.mode === "dark" ? "rgba(255,255,255,0.06)" : "#eff6ff",
129
+ flexShrink: 0
130
+ },
131
+ children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_ShoppingCartCheckout.default, {
132
+ sx: {
133
+ fontSize: {
134
+ xs: 22,
135
+ md: 28
136
+ },
137
+ color: "primary.main",
138
+ opacity: 0.45
139
+ }
140
+ })
141
+ }), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
142
+ sx: {
143
+ flex: 1,
144
+ minWidth: 0
145
+ },
146
+ children: [/* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
147
+ direction: "row",
148
+ justifyContent: "space-between",
149
+ alignItems: "flex-start",
150
+ sx: {
151
+ mb: 0.25
152
+ },
153
+ children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
154
+ sx: {
155
+ fontWeight: 800,
156
+ fontSize: {
157
+ xs: 15,
158
+ md: 18
159
+ },
160
+ color: "text.primary",
161
+ lineHeight: 1.3
162
+ },
163
+ children: productName
164
+ }), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
165
+ alignItems: "flex-end",
166
+ sx: {
167
+ flexShrink: 0,
168
+ ml: {
169
+ xs: 1,
170
+ md: 2
171
+ }
172
+ },
173
+ children: [/* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Typography, {
174
+ sx: {
175
+ fontWeight: 800,
176
+ color: "text.primary",
177
+ whiteSpace: "nowrap",
178
+ fontSize: {
179
+ xs: 15,
180
+ md: 18
181
+ }
182
+ },
183
+ children: [(0, _format.formatDynamicUnitPrice)(crossSellItem, currency, exchangeRate), " ", currency?.symbol]
184
+ }), exchangeRate && crossSellItem.base_amount && /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Typography, {
185
+ sx: {
186
+ fontSize: 10,
187
+ color: "text.disabled",
188
+ fontWeight: 700,
189
+ lineHeight: 1
190
+ },
191
+ children: ["\u2248 $", Number(crossSellItem.base_amount || 0).toFixed(2)]
192
+ })]
193
+ })]
194
+ }), subtitle && /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
195
+ sx: {
196
+ fontSize: {
197
+ xs: 12,
198
+ md: 14
199
+ },
200
+ color: "text.secondary",
201
+ fontWeight: 500,
202
+ lineHeight: 1.4
203
+ },
204
+ noWrap: true,
205
+ children: subtitle
206
+ }), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
207
+ sx: {
208
+ pt: {
209
+ xs: 1.5,
210
+ md: 2
211
+ }
212
+ },
213
+ children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Button, {
214
+ size: "small",
215
+ variant: "outlined",
216
+ startIcon: /* @__PURE__ */(0, _jsxRuntime.jsx)(_AddShoppingCart.default, {
217
+ sx: {
218
+ fontSize: "14px !important"
219
+ }
220
+ }),
221
+ sx: {
222
+ textTransform: "none",
223
+ fontSize: {
224
+ xs: 11,
225
+ md: 12
226
+ },
227
+ fontWeight: 700,
228
+ borderRadius: "8px",
229
+ border: "1px solid",
230
+ borderColor: "divider",
231
+ color: "primary.main",
232
+ bgcolor: "background.paper",
233
+ boxShadow: 1,
234
+ px: 1.5,
235
+ py: 0.5,
236
+ transition: "all 0.2s",
237
+ "&:hover": {
238
+ bgcolor: "primary.main",
239
+ color: "#fff",
240
+ borderColor: "primary.main"
241
+ },
242
+ "&:active": {
243
+ transform: "scale(0.95)"
244
+ }
245
+ },
246
+ onClick: e => {
247
+ e.stopPropagation();
248
+ onAdd();
249
+ },
250
+ children: (0, _format.tSafe)(t, "payment.checkout.cross_sell.addToOrder", "Add to order")
251
+ })
252
+ })]
253
+ })]
254
+ })
255
+ })]
256
+ });
257
+ }
@@ -0,0 +1,26 @@
1
+ import type { TLineItemExpanded, TPaymentCurrency } from '@blocklet/payment-types';
2
+ interface ProductItemCardProps {
3
+ item: TLineItemExpanded & {
4
+ adjustable_quantity?: {
5
+ enabled: boolean;
6
+ minimum?: number;
7
+ maximum?: number;
8
+ };
9
+ };
10
+ currency: TPaymentCurrency | null;
11
+ discounts: any[];
12
+ exchangeRate: string | null;
13
+ onQuantityChange: (itemId: string, qty: number) => Promise<void>;
14
+ onUpsell: (fromId: string, toId: string) => Promise<void>;
15
+ onDownsell: (priceId: string) => Promise<void>;
16
+ trialActive: boolean;
17
+ trialDays: number;
18
+ t: (key: string, params?: any) => string;
19
+ recommended?: boolean;
20
+ hideUpsell?: boolean;
21
+ isRateLoading?: boolean;
22
+ showFeatures?: boolean;
23
+ children?: React.ReactNode;
24
+ }
25
+ export default function ProductItemCard({ item, currency, discounts, exchangeRate, onQuantityChange, onUpsell, onDownsell, trialActive, trialDays, t, recommended, hideUpsell, isRateLoading, showFeatures, children, }: ProductItemCardProps): import("react").JSX.Element;
26
+ export {};