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