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