@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.
Files changed (137) hide show
  1. package/README.md +77 -0
  2. package/es/checkout/donate.d.ts +4 -2
  3. package/es/checkout/donate.js +13 -10
  4. package/es/checkout/form.d.ts +1 -1
  5. package/es/checkout/form.js +50 -4
  6. package/es/checkout/table.d.ts +1 -1
  7. package/es/checkout/table.js +11 -1
  8. package/es/components/blockchain/tx.js +2 -1
  9. package/es/components/country-select.d.ts +16 -0
  10. package/es/components/country-select.js +82 -0
  11. package/es/components/input.d.ts +21 -21
  12. package/es/components/input.js +43 -42
  13. package/es/components/livemode.js +1 -0
  14. package/es/components/pricing-table.js +0 -2
  15. package/es/components/status.js +2 -3
  16. package/es/components/table.d.ts +2 -0
  17. package/es/components/table.js +186 -0
  18. package/es/contexts/payment.d.ts +2 -0
  19. package/es/contexts/payment.js +5 -2
  20. package/es/history/invoice/list.d.ts +3 -1
  21. package/es/history/invoice/list.js +215 -48
  22. package/es/hooks/mobile.d.ts +4 -0
  23. package/es/hooks/mobile.js +10 -0
  24. package/es/index.d.ts +5 -1
  25. package/es/index.js +7 -1
  26. package/es/libs/util.d.ts +21 -8
  27. package/es/libs/util.js +92 -28
  28. package/es/locales/en.js +22 -7
  29. package/es/locales/index.d.ts +0 -1
  30. package/es/locales/index.js +10 -1
  31. package/es/locales/zh.js +21 -6
  32. package/es/payment/error.js +2 -2
  33. package/es/payment/footer.js +1 -1
  34. package/es/payment/form/address.d.ts +9 -2
  35. package/es/payment/form/address.js +69 -69
  36. package/es/payment/form/currency.js +39 -25
  37. package/es/payment/form/index.d.ts +1 -1
  38. package/es/payment/form/index.js +83 -81
  39. package/es/payment/form/phone.js +15 -51
  40. package/es/payment/index.d.ts +3 -10
  41. package/es/payment/index.js +295 -224
  42. package/es/payment/product-card.js +4 -4
  43. package/es/payment/product-donation.js +9 -3
  44. package/es/payment/product-item.d.ts +2 -2
  45. package/es/payment/product-item.js +120 -81
  46. package/es/payment/summary.js +188 -118
  47. package/es/theme/index.css +240 -0
  48. package/es/theme/index.d.ts +14 -0
  49. package/es/theme/index.js +256 -0
  50. package/es/theme/typography.d.ts +2 -0
  51. package/es/theme/typography.js +53 -0
  52. package/es/types/index.d.ts +16 -0
  53. package/lib/checkout/donate.d.ts +4 -2
  54. package/lib/checkout/donate.js +23 -2
  55. package/lib/checkout/form.d.ts +1 -1
  56. package/lib/checkout/form.js +60 -15
  57. package/lib/checkout/table.d.ts +1 -1
  58. package/lib/checkout/table.js +22 -1
  59. package/lib/components/blockchain/tx.js +4 -1
  60. package/lib/components/country-select.d.ts +16 -0
  61. package/lib/components/country-select.js +115 -0
  62. package/lib/components/input.d.ts +21 -21
  63. package/lib/components/input.js +21 -12
  64. package/lib/components/livemode.js +1 -0
  65. package/lib/components/pricing-table.js +0 -2
  66. package/lib/components/status.js +2 -3
  67. package/lib/components/table.d.ts +2 -0
  68. package/lib/components/table.js +220 -0
  69. package/lib/contexts/payment.d.ts +2 -0
  70. package/lib/contexts/payment.js +4 -1
  71. package/lib/history/invoice/list.d.ts +3 -1
  72. package/lib/history/invoice/list.js +290 -62
  73. package/lib/hooks/mobile.d.ts +4 -0
  74. package/lib/hooks/mobile.js +17 -0
  75. package/lib/index.d.ts +5 -1
  76. package/lib/index.js +36 -0
  77. package/lib/libs/util.d.ts +21 -8
  78. package/lib/libs/util.js +115 -37
  79. package/lib/locales/en.js +22 -7
  80. package/lib/locales/index.d.ts +0 -1
  81. package/lib/locales/index.js +14 -3
  82. package/lib/locales/zh.js +21 -6
  83. package/lib/payment/error.js +5 -1
  84. package/lib/payment/footer.js +1 -1
  85. package/lib/payment/form/address.d.ts +9 -2
  86. package/lib/payment/form/address.js +67 -59
  87. package/lib/payment/form/currency.js +31 -24
  88. package/lib/payment/form/index.d.ts +1 -1
  89. package/lib/payment/form/index.js +92 -93
  90. package/lib/payment/form/phone.js +11 -59
  91. package/lib/payment/index.d.ts +3 -10
  92. package/lib/payment/index.js +302 -225
  93. package/lib/payment/product-card.js +5 -4
  94. package/lib/payment/product-donation.js +11 -7
  95. package/lib/payment/product-item.d.ts +2 -2
  96. package/lib/payment/product-item.js +38 -19
  97. package/lib/payment/summary.js +219 -127
  98. package/lib/theme/index.css +240 -0
  99. package/lib/theme/index.d.ts +14 -0
  100. package/lib/theme/index.js +273 -0
  101. package/lib/theme/typography.d.ts +2 -0
  102. package/lib/theme/typography.js +59 -0
  103. package/lib/types/index.d.ts +16 -0
  104. package/package.json +14 -11
  105. package/src/checkout/donate.tsx +25 -11
  106. package/src/checkout/form.tsx +63 -15
  107. package/src/checkout/table.tsx +20 -1
  108. package/src/components/blockchain/tx.tsx +2 -1
  109. package/src/components/country-select.tsx +93 -0
  110. package/src/components/input.tsx +49 -46
  111. package/src/components/livemode.tsx +1 -0
  112. package/src/components/pricing-table.tsx +0 -2
  113. package/src/components/status.tsx +1 -2
  114. package/src/components/table.tsx +200 -0
  115. package/src/contexts/payment.tsx +6 -1
  116. package/src/history/invoice/list.tsx +254 -49
  117. package/src/hooks/mobile.ts +13 -0
  118. package/src/index.ts +7 -0
  119. package/src/libs/util.ts +120 -31
  120. package/src/locales/en.tsx +18 -4
  121. package/src/locales/index.tsx +10 -3
  122. package/src/locales/zh.tsx +17 -3
  123. package/src/payment/error.tsx +2 -2
  124. package/src/payment/footer.tsx +1 -1
  125. package/src/payment/form/address.tsx +56 -47
  126. package/src/payment/form/currency.tsx +29 -23
  127. package/src/payment/form/index.tsx +89 -76
  128. package/src/payment/form/phone.tsx +14 -51
  129. package/src/payment/index.tsx +298 -231
  130. package/src/payment/product-card.tsx +4 -4
  131. package/src/payment/product-donation.tsx +9 -4
  132. package/src/payment/product-item.tsx +49 -20
  133. package/src/payment/summary.tsx +191 -108
  134. package/src/theme/index.css +240 -0
  135. package/src/theme/index.tsx +271 -0
  136. package/src/theme/typography.ts +56 -0
  137. package/src/types/index.ts +17 -0
@@ -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
+ }
@@ -0,0 +1,273 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.PaymentThemeProvider = PaymentThemeProvider;
7
+ Object.defineProperty(exports, "typography", {
8
+ enumerable: true,
9
+ get: function () {
10
+ return _typography.typography;
11
+ }
12
+ });
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
+ var _styles = require("@mui/material/styles");
15
+ var _Theme = require("@arcblock/ux/lib/Theme");
16
+ var _lodash = require("lodash");
17
+ var _material = require("@mui/material");
18
+ var _typography = require("./typography");
19
+ require("./index.css");
20
+ PaymentThemeProvider.defaultProps = {
21
+ theme: {}
22
+ };
23
+ function PaymentThemeProvider({
24
+ children,
25
+ theme: customTheme = {}
26
+ }) {
27
+ const {
28
+ sx: themeSX = {},
29
+ ...restTheme
30
+ } = customTheme || {};
31
+ const parentTheme = (0, _styles.useTheme)();
32
+ const rootStyle = getComputedStyle(document.documentElement);
33
+ const themeOverrides = {
34
+ shape: {
35
+ borderRadius: 8
36
+ },
37
+ components: {
38
+ MuiOutlinedInput: {
39
+ styleOverrides: {
40
+ root: {
41
+ borderRadius: "var(--radius-m, 8px)",
42
+ backgroundColor: "var(--backgrounds-bg-field)",
43
+ "&.Mui-disabled": {
44
+ backgroundColor: "var(--backgrounds-bg-disabled)"
45
+ },
46
+ ".MuiOutlinedInput-notchedOutline": {
47
+ borderColor: "var(--stroke-border-base, #EFF1F5)"
48
+ },
49
+ ".MuiInputBase-input": {
50
+ fontSize: "14px",
51
+ minHeight: "1.65em",
52
+ lineHeight: "1.65em"
53
+ }
54
+ }
55
+ }
56
+ },
57
+ MuiButton: {
58
+ defaultProps: {
59
+ size: "small"
60
+ },
61
+ styleOverrides: {
62
+ root: {
63
+ fontSize: "1rem",
64
+ fontWeight: 500,
65
+ textTransform: "none"
66
+ },
67
+ containedPrimary: {
68
+ backgroundColor: "var(--buttons-button-inverted, #010714)",
69
+ color: "var(--foregrounds-fg-on-color, #fff)",
70
+ "&:hover": {
71
+ backgroundColor: "var(--buttons-button-inverted-hover, #1f2937)"
72
+ }
73
+ },
74
+ outlinedPrimary: {
75
+ color: "var(--foregrounds-fg-base, #010714)",
76
+ borderColor: "var(--stroke-button-secondary-border, #E5E7EB)",
77
+ "&:hover": {
78
+ backgroundColor: "var(--buttons-button-neutral-hover, #F3F4F6)",
79
+ borderColor: "var(--stroke-button-secondary-border, #E5E7EB)"
80
+ }
81
+ },
82
+ sizeSmall: {
83
+ height: 32
84
+ }
85
+ }
86
+ },
87
+ MuiIconButton: {
88
+ defaultProps: {
89
+ size: "small"
90
+ },
91
+ styleOverrides: {
92
+ root: {
93
+ textTransform: "none"
94
+ },
95
+ colorPrimary: {
96
+ backgroundColor: "#fff"
97
+ }
98
+ }
99
+ },
100
+ MuiToggleButton: {
101
+ styleOverrides: {
102
+ root: {
103
+ textTransform: "none"
104
+ }
105
+ }
106
+ },
107
+ MuiTab: {
108
+ styleOverrides: {
109
+ root: {
110
+ textTransform: "none"
111
+ }
112
+ }
113
+ },
114
+ MuiTooltip: {
115
+ defaultProps: {
116
+ enterTouchDelay: 3e3,
117
+ leaveTouchDelay: 100
118
+ }
119
+ },
120
+ MuiPopover: {
121
+ styleOverrides: {
122
+ paper: ({
123
+ theme
124
+ }) => ({
125
+ border: `1px solid ${theme.palette.divider}`,
126
+ boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"
127
+ })
128
+ }
129
+ },
130
+ MuiCssBaseline: {
131
+ styleOverrides: {
132
+ ".base-card": {
133
+ padding: "20px",
134
+ borderRadius: "var(--radius-l)",
135
+ background: "var(--backgrounds-bg-base)",
136
+ boxShadow: "0px 0px 0px 1px var(--shadows-card-rest-1, rgba(2, 7, 19, 0.08)), 0px 1px 2px -1px var(--shadows-card-rest-2, rgba(2, 7, 19, 0.08)), 0px 2px 4px 0px var(--shadows-card-rest-3, rgba(2, 7, 19, 0.04))"
137
+ },
138
+ ".base-label": {
139
+ color: "var(--foregrounds-fg-base, #010714)",
140
+ fontSize: "16px",
141
+ fontWeight: "500",
142
+ lineHeight: "24px"
143
+ },
144
+ a: {
145
+ textDecoration: "none !important"
146
+ }
147
+ }
148
+ },
149
+ // MuiButtonBase: {
150
+ // styleOverrides: {
151
+ // }
152
+ // },
153
+ MuiRadio: {
154
+ styleOverrides: {
155
+ root: {
156
+ color: "var(--stroke-border-base, #EFF1F5)",
157
+ "&:hover": {
158
+ background: "none"
159
+ },
160
+ "&.Mui-checked": {
161
+ color: "var(--foregrounds-fg-interactive, #0086FF)"
162
+ }
163
+ }
164
+ }
165
+ },
166
+ MuiCheckbox: {
167
+ styleOverrides: {
168
+ root: {
169
+ color: "var(--backgrounds-bg-interactive, #0086FF)",
170
+ "&.Mui-checked": {
171
+ color: "var(--foregrounds-fg-interactive, #0086FF)"
172
+ }
173
+ }
174
+ }
175
+ },
176
+ MuiDivider: {
177
+ styleOverrides: {
178
+ root: {
179
+ borderColor: "var(--stroke-border-base, #EFF1F5)"
180
+ }
181
+ }
182
+ },
183
+ MuiInputBase: {
184
+ defaultProps: {
185
+ size: "small"
186
+ },
187
+ styleOverrides: {
188
+ root: () => ({
189
+ fontSize: "0.875rem",
190
+ backgroundColor: "var(--backgrounds-bg-field, #F9FAFB)"
191
+ })
192
+ }
193
+ },
194
+ MuiInputLabel: {
195
+ defaultProps: {
196
+ size: "small"
197
+ },
198
+ styleOverrides: {
199
+ root: () => ({
200
+ fontSize: "0.875rem"
201
+ })
202
+ }
203
+ },
204
+ MuiChip: {
205
+ styleOverrides: {
206
+ root: {
207
+ borderRadius: "var(--radius-S, 4px)",
208
+ border: "1px solid transparent",
209
+ "&.MuiChip-filledSuccess": {
210
+ color: "var(--tags-tag-green-text, #007C52)",
211
+ backgroundColor: "var(--tags-tag-green-bg, #B7FEE3)",
212
+ borderColor: "var(--tags-tag-green-border, #63F9CB)"
213
+ },
214
+ "&.MuiChip-filledDefault": {
215
+ color: "var(--tags-tag-neutral-text, #007C52)",
216
+ backgroundColor: "var(--tags-tag-neutral-bg, #B7FEE3)",
217
+ borderColor: "var(--tags-tag-neutral-border, #E5E7EB)"
218
+ },
219
+ "&.MuiChip-filledSecondary": {
220
+ color: "var(--tags-tag-purple-text, #8118EB)",
221
+ backgroundColor: " var(--tags-tag-purple-bg, #EFE9FF)",
222
+ borderColor: "var(--tags-tag-purple-border, #E1D6FF)"
223
+ },
224
+ "&.MuiChip-filledError": {
225
+ color: "var(--tags-tag-red-text, #E40031)",
226
+ backgroundColor: "var(--tags-tag-red-bg, #FFE2E6)",
227
+ borderColor: "var(--tags-tag-red-border, #FFC8D3)"
228
+ },
229
+ "&.MuiChip-filledWarning": {
230
+ color: "var(--tags-tag-orange-text, #D24000)",
231
+ backgroundColor: "var(--tags-tag-orange-bg, #FFF4BC)",
232
+ borderColor: "var(--tags-tag-orange-border, #FFE467)"
233
+ },
234
+ "&.MuiChip-filledPrimary,&.MuiChip-filledInfo": {
235
+ color: "var(--tags-tag-blue-text, #0051E9)",
236
+ backgroundColor: "var(--tags-tag-blue-bg, #D2ECFF)",
237
+ borderColor: "var(--tags-tag-blue-border, #AFDDFF)"
238
+ }
239
+ }
240
+ }
241
+ }
242
+ }
243
+ };
244
+ const mergeTheme = (0, _Theme.create)((0, _lodash.merge)((0, _lodash.cloneDeep)({
245
+ ...parentTheme,
246
+ typography: _typography.typography,
247
+ palette: {
248
+ primary: {
249
+ main: rootStyle.getPropertyValue("--foregrounds-fg-base").trim() || "#030712"
250
+ },
251
+ text: {
252
+ primary: rootStyle.getPropertyValue("--foregrounds-fg-base").trim() || "#030712",
253
+ secondary: rootStyle.getPropertyValue("--foregrounds-fg-subtle").trim() || "#4b5563",
254
+ lighter: rootStyle.getPropertyValue("--foregrounds-fg-muted").trim() || "#9ca3af",
255
+ link: rootStyle.getPropertyValue("--foregrounds-fg-interactive").trim() || "#0086FF"
256
+ },
257
+ error: {
258
+ main: rootStyle.getPropertyValue("--foregrounds-fg-danger").trim() || "#FF003B"
259
+ }
260
+ },
261
+ ...themeOverrides
262
+ }), restTheme));
263
+ return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_styles.ThemeProvider, {
264
+ theme: mergeTheme,
265
+ children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.CssBaseline, {}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
266
+ sx: {
267
+ height: "100%",
268
+ ...themeSX
269
+ },
270
+ children
271
+ })]
272
+ });
273
+ }
@@ -0,0 +1,2 @@
1
+ import type { TypographyOptions } from '@mui/material/styles/createTypography';
2
+ export declare const typography: TypographyOptions;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.typography = void 0;
7
+ const typography = exports.typography = {
8
+ h1: {
9
+ fontSize: "1.875rem",
10
+ lineHeight: 1.2,
11
+ fontWeight: 800,
12
+ letterSpacing: "-.025em"
13
+ },
14
+ h2: {
15
+ fontSize: "1.5rem",
16
+ lineHeight: 1.3333333,
17
+ fontWeight: 700,
18
+ letterSpacing: "-.025em"
19
+ },
20
+ h3: {
21
+ fontSize: "1.25rem",
22
+ lineHeight: 1.4,
23
+ fontWeight: 600,
24
+ letterSpacing: "-.025em"
25
+ },
26
+ h4: {
27
+ fontSize: "1.125rem",
28
+ lineHeight: 1.5,
29
+ fontWeight: 600
30
+ },
31
+ h5: {
32
+ fontSize: "1rem",
33
+ lineHeight: 1.75,
34
+ fontWeight: 400
35
+ },
36
+ h6: {
37
+ fontSize: "1rem",
38
+ lineHeight: 1.75,
39
+ fontWeight: 400
40
+ },
41
+ subtitle1: {
42
+ fontSize: "1rem",
43
+ lineHeight: 1.75,
44
+ fontWeight: 400
45
+ },
46
+ subtitle2: {
47
+ fontSize: "1rem",
48
+ lineHeight: 1.75,
49
+ fontWeight: 400
50
+ },
51
+ body1: {
52
+ fontSize: "1rem",
53
+ lineHeight: 1.75
54
+ },
55
+ fontWeightLight: 300,
56
+ fontWeightRegular: 400,
57
+ fontWeightMedium: 500,
58
+ fontWeightBold: 700
59
+ };
@@ -1,4 +1,5 @@
1
1
  import type { TCheckoutSessionExpanded, TCustomer, TPaymentIntent, TPaymentLink, TPaymentMethodExpanded } from '@blocklet/payment-types';
2
+ import { SxProps, ThemeOptions } from '@mui/material';
2
3
  import { LiteralUnion } from 'type-fest';
3
4
  export type CheckoutContext = {
4
5
  checkoutSession: TCheckoutSessionExpanded;
@@ -8,6 +9,7 @@ export type CheckoutContext = {
8
9
  customer?: TCustomer;
9
10
  mode: LiteralUnion<'standalone' | 'inline' | 'popup', string>;
10
11
  action?: string;
12
+ showCheckoutSummary?: boolean;
11
13
  };
12
14
  export type CheckoutFormData = {
13
15
  customer_name: string;
@@ -24,11 +26,15 @@ export type CheckoutFormData = {
24
26
  postal_code: string;
25
27
  };
26
28
  };
29
+ export type PaymentThemeOptions = ThemeOptions & {
30
+ sx?: SxProps;
31
+ };
27
32
  export type CheckoutProps = Partial<CheckoutCallbacks> & {
28
33
  id: string;
29
34
  extraParams?: Record<string, any>;
30
35
  action?: string;
31
36
  mode?: LiteralUnion<'standalone' | 'inline' | 'popup' | 'inline-minimal' | 'popup-minimal', string>;
37
+ theme?: 'default' | 'inherit' | PaymentThemeOptions;
32
38
  };
33
39
  export type CheckoutCallbacks = {
34
40
  onPaid: (res: CheckoutContext) => void;
@@ -42,3 +48,13 @@ export type PricingRenderProps = {
42
48
  quantity: string;
43
49
  totalAmount: string;
44
50
  };
51
+ export type ActionProps = {
52
+ [key: string]: {
53
+ color?: string;
54
+ variant?: string;
55
+ sx?: {
56
+ [key: string]: any;
57
+ };
58
+ text?: string;
59
+ };
60
+ };