@blocklet/payment-react 1.18.37 → 1.18.38
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.js +11 -12
- package/es/components/blockchain/tx.js +1 -1
- package/es/components/country-select.js +5 -4
- package/es/components/over-due-invoice-payment.js +7 -5
- package/es/components/pricing-table.js +8 -7
- package/es/components/table.js +9 -7
- package/es/history/invoice/list.js +1 -1
- package/es/payment/donation-form.js +4 -5
- package/es/payment/form/address.js +2 -2
- package/es/payment/form/currency.js +6 -17
- package/es/payment/form/index.js +1 -1
- package/es/payment/form/phone.js +2 -2
- package/es/payment/index.js +18 -17
- package/es/payment/product-item.js +6 -6
- package/es/payment/product-skeleton.js +2 -1
- package/es/payment/success.js +3 -4
- package/es/theme/index.css +37 -0
- package/es/theme/index.d.ts +4 -3
- package/es/theme/index.js +264 -240
- package/es/theme/types.d.ts +76 -0
- package/es/theme/types.js +2 -0
- package/es/theme/typography.js +1 -5
- package/lib/checkout/donate.js +11 -12
- package/lib/components/blockchain/tx.js +3 -1
- package/lib/components/country-select.js +7 -4
- package/lib/components/over-due-invoice-payment.js +6 -4
- package/lib/components/pricing-table.js +10 -7
- package/lib/components/table.js +23 -7
- package/lib/history/invoice/list.js +1 -1
- package/lib/payment/donation-form.js +9 -5
- package/lib/payment/form/address.js +2 -2
- package/lib/payment/form/currency.js +14 -17
- package/lib/payment/form/index.js +1 -1
- package/lib/payment/form/phone.js +2 -2
- package/lib/payment/index.js +41 -17
- package/lib/payment/product-item.js +6 -6
- package/lib/payment/product-skeleton.js +2 -1
- package/lib/payment/success.js +3 -4
- package/lib/theme/index.css +37 -0
- package/lib/theme/index.d.ts +4 -3
- package/lib/theme/index.js +257 -232
- package/lib/theme/types.d.ts +76 -0
- package/lib/theme/types.js +4 -0
- package/lib/theme/typography.js +1 -5
- package/package.json +9 -8
- package/src/checkout/donate.tsx +11 -12
- package/src/components/blockchain/tx.tsx +1 -1
- package/src/components/country-select.tsx +5 -4
- package/src/components/over-due-invoice-payment.tsx +7 -5
- package/src/components/pricing-table.tsx +11 -9
- package/src/components/table.tsx +9 -7
- package/src/history/invoice/list.tsx +1 -1
- package/src/payment/donation-form.tsx +4 -5
- package/src/payment/form/address.tsx +2 -2
- package/src/payment/form/currency.tsx +6 -17
- package/src/payment/form/index.tsx +1 -1
- package/src/payment/form/phone.tsx +2 -2
- package/src/payment/index.tsx +18 -25
- package/src/payment/product-item.tsx +6 -6
- package/src/payment/product-skeleton.tsx +2 -1
- package/src/payment/success.tsx +3 -4
- package/src/theme/index.css +37 -0
- package/src/theme/index.tsx +263 -237
- package/src/theme/types.ts +78 -0
- package/src/theme/typography.ts +0 -5
- package/src/types/index.ts +1 -0
package/src/theme/index.tsx
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import React from 'react';
|
|
1
|
+
import { createTheme, Box, CssBaseline, ThemeOptions, type Palette } from '@mui/material';
|
|
2
|
+
import type { Shape } from '@mui/system';
|
|
3
|
+
import { create as createBlockletTheme, deepmerge } from '@arcblock/ux/lib/Theme';
|
|
4
|
+
import { deepmergeAll } from '@arcblock/ux/lib/Util';
|
|
5
|
+
import { Shadows, ThemeProvider, useTheme } from '@mui/material/styles';
|
|
6
|
+
import React, { useMemo } from 'react';
|
|
7
7
|
|
|
8
|
-
import { typography } from './typography';
|
|
9
8
|
import './index.css';
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
import './types';
|
|
10
|
+
import { typography } from './typography';
|
|
11
|
+
import { type PaymentThemeOptions } from '../types';
|
|
13
12
|
|
|
14
13
|
PaymentThemeProvider.defaultProps = {
|
|
15
14
|
theme: {},
|
|
@@ -25,269 +24,294 @@ export function PaymentThemeProvider({
|
|
|
25
24
|
// Add defaultProps for customTheme
|
|
26
25
|
const { sx: themeSX = {}, ...restTheme } = customTheme || {};
|
|
27
26
|
const parentTheme = useTheme();
|
|
28
|
-
const rootStyle = getComputedStyle(document.documentElement);
|
|
29
27
|
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
'
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
'.MuiOutlinedInput-notchedOutline': {
|
|
44
|
-
borderColor: 'var(--stroke-border-base, #EFF1F5)',
|
|
45
|
-
},
|
|
46
|
-
'.MuiInputBase-input': {
|
|
47
|
-
fontSize: '14px',
|
|
48
|
-
minHeight: '1.65em',
|
|
49
|
-
lineHeight: '1.65em',
|
|
50
|
-
},
|
|
51
|
-
'&.Mui-focused .MuiOutlinedInput-notchedOutline': {
|
|
52
|
-
borderWidth: '1px',
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
MuiButton: {
|
|
58
|
-
defaultProps: {
|
|
59
|
-
size: 'small',
|
|
60
|
-
},
|
|
61
|
-
styleOverrides: {
|
|
62
|
-
root: {
|
|
63
|
-
fontSize: '0.875rem',
|
|
64
|
-
fontWeight: 500,
|
|
65
|
-
textTransform: 'none',
|
|
66
|
-
boxShadow: 'none',
|
|
67
|
-
},
|
|
68
|
-
containedPrimary: {
|
|
69
|
-
backgroundColor: 'var(--buttons-button-inverted, #010714)',
|
|
70
|
-
color: 'var(--foregrounds-fg-on-color, #fff)',
|
|
71
|
-
'&:hover': {
|
|
72
|
-
backgroundColor: 'var(--buttons-button-inverted-hover, #1f2937)',
|
|
73
|
-
},
|
|
28
|
+
const mergeTheme = useMemo(() => {
|
|
29
|
+
const blockletTheme = parentTheme.themeName === 'ArcBlock' ? parentTheme : createBlockletTheme();
|
|
30
|
+
const { mode } = blockletTheme.palette;
|
|
31
|
+
|
|
32
|
+
// payment 在 blockletTheme 上扩展自己的配置
|
|
33
|
+
let paymentThemeOptions: ThemeOptions = deepmerge(blockletTheme, {
|
|
34
|
+
palette: {
|
|
35
|
+
chip: {
|
|
36
|
+
success: {
|
|
37
|
+
text: mode === 'dark' ? '#10b981' : '#047857',
|
|
38
|
+
background: mode === 'dark' ? '#022c22' : '#d1fae5',
|
|
39
|
+
border: mode === 'dark' ? '#064e3b' : '#a7f3d0',
|
|
74
40
|
},
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
'
|
|
79
|
-
backgroundColor: 'var(--buttons-button-neutral-hover, #F3F4F6)',
|
|
80
|
-
borderColor: 'var(--stroke-button-secondary-border, #E5E7EB)',
|
|
81
|
-
},
|
|
41
|
+
default: {
|
|
42
|
+
text: mode === 'dark' ? '#adb1b8' : '#4b5563',
|
|
43
|
+
background: mode === 'dark' ? '#2e3035' : '#f3f4f6',
|
|
44
|
+
border: mode === 'dark' ? '#3c3f44' : '#e5e7eb',
|
|
82
45
|
},
|
|
83
|
-
|
|
84
|
-
|
|
46
|
+
secondary: {
|
|
47
|
+
text: mode === 'dark' ? '#8b5cf6' : '#6d28d9',
|
|
48
|
+
background: mode === 'dark' ? '#2e1064' : '#ede9fe',
|
|
49
|
+
border: mode === 'dark' ? '#3c3f44' : '#ddd6fe',
|
|
85
50
|
},
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
size: 'small',
|
|
91
|
-
},
|
|
92
|
-
styleOverrides: {
|
|
93
|
-
root: {
|
|
94
|
-
textTransform: 'none',
|
|
51
|
+
error: {
|
|
52
|
+
text: mode === 'dark' ? '#ff6369' : '#be123c',
|
|
53
|
+
background: mode === 'dark' ? '#4c0519' : '#ffe4e6',
|
|
54
|
+
border: mode === 'dark' ? '#881337' : '#fecdd3',
|
|
95
55
|
},
|
|
96
|
-
|
|
97
|
-
|
|
56
|
+
warning: {
|
|
57
|
+
text: mode === 'dark' ? '#f59e0b' : '#b45309',
|
|
58
|
+
background: mode === 'dark' ? '#451a03' : '#fef4c7',
|
|
59
|
+
border: mode === 'dark' ? '#78350f' : '#fde68a',
|
|
98
60
|
},
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
root: {
|
|
104
|
-
textTransform: 'none',
|
|
61
|
+
info: {
|
|
62
|
+
text: mode === 'dark' ? '#3b82f6' : '#1d4ed8',
|
|
63
|
+
background: mode === 'dark' ? '#172554' : '#dbeafe',
|
|
64
|
+
border: mode === 'dark' ? '#1e3a8a' : '#bfdbfe',
|
|
105
65
|
},
|
|
106
66
|
},
|
|
107
67
|
},
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
68
|
+
typography,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const {
|
|
72
|
+
palette,
|
|
73
|
+
shape: { borderRadius },
|
|
74
|
+
shadows,
|
|
75
|
+
} = paymentThemeOptions as { palette: Palette; shape: Shape; shadows: Shadows };
|
|
76
|
+
|
|
77
|
+
// 继续扩展
|
|
78
|
+
paymentThemeOptions = deepmergeAll([
|
|
79
|
+
paymentThemeOptions,
|
|
80
|
+
{
|
|
81
|
+
palette: {
|
|
82
|
+
text: {
|
|
83
|
+
lighter: palette.grey[400],
|
|
84
|
+
link: palette.secondary.main,
|
|
113
85
|
},
|
|
114
86
|
},
|
|
115
87
|
},
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
88
|
+
{
|
|
89
|
+
components: {
|
|
90
|
+
MuiOutlinedInput: {
|
|
91
|
+
styleOverrides: {
|
|
92
|
+
root: {
|
|
93
|
+
borderRadius,
|
|
94
|
+
backgroundColor: palette.grey[50],
|
|
95
|
+
'&.Mui-disabled': {
|
|
96
|
+
backgroundColor: palette.grey[100],
|
|
97
|
+
},
|
|
98
|
+
'.MuiOutlinedInput-notchedOutline': {
|
|
99
|
+
borderColor: palette.grey[100],
|
|
100
|
+
},
|
|
101
|
+
'.MuiInputBase-input': {
|
|
102
|
+
fontSize: '14px',
|
|
103
|
+
minHeight: '1.65em',
|
|
104
|
+
lineHeight: '1.65em',
|
|
105
|
+
},
|
|
106
|
+
'&.Mui-focused .MuiOutlinedInput-notchedOutline': {
|
|
107
|
+
borderWidth: '1px',
|
|
108
|
+
},
|
|
109
|
+
'&.MuiInputBase-root:hover .MuiOutlinedInput-notchedOutline': {
|
|
110
|
+
borderColor: `${palette.primary.main}`,
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
},
|
|
124
114
|
},
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
115
|
+
MuiButton: {
|
|
116
|
+
defaultProps: {
|
|
117
|
+
size: 'small',
|
|
118
|
+
},
|
|
119
|
+
styleOverrides: {
|
|
120
|
+
root: {
|
|
121
|
+
fontSize: '0.875rem',
|
|
122
|
+
fontWeight: 500,
|
|
123
|
+
textTransform: 'none',
|
|
124
|
+
boxShadow: 'none',
|
|
125
|
+
},
|
|
126
|
+
sizeSmall: {
|
|
127
|
+
height: 32,
|
|
128
|
+
},
|
|
129
|
+
outlinedPrimary: {
|
|
130
|
+
borderColor: palette.grey[100],
|
|
131
|
+
'&:hover': {
|
|
132
|
+
borderColor: palette.grey[100],
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
},
|
|
131
136
|
},
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
boxShadow:
|
|
145
|
-
'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
|
+
MuiIconButton: {
|
|
138
|
+
defaultProps: {
|
|
139
|
+
size: 'small',
|
|
140
|
+
},
|
|
141
|
+
styleOverrides: {
|
|
142
|
+
root: {
|
|
143
|
+
textTransform: 'none',
|
|
144
|
+
},
|
|
145
|
+
colorPrimary: {
|
|
146
|
+
backgroundColor: palette.background.default,
|
|
147
|
+
},
|
|
148
|
+
},
|
|
146
149
|
},
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
MuiToggleButton: {
|
|
151
|
+
styleOverrides: {
|
|
152
|
+
root: {
|
|
153
|
+
textTransform: 'none',
|
|
154
|
+
},
|
|
155
|
+
},
|
|
152
156
|
},
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
157
|
+
MuiTab: {
|
|
158
|
+
styleOverrides: {
|
|
159
|
+
root: {
|
|
160
|
+
textTransform: 'none',
|
|
161
|
+
fontSize: '0.875rem',
|
|
162
|
+
},
|
|
156
163
|
},
|
|
157
164
|
},
|
|
158
|
-
|
|
159
|
-
|
|
165
|
+
MuiTooltip: {
|
|
166
|
+
defaultProps: {
|
|
167
|
+
enterTouchDelay: 3000,
|
|
168
|
+
leaveTouchDelay: 100,
|
|
169
|
+
},
|
|
170
|
+
styleOverrides: {
|
|
171
|
+
tooltip: {
|
|
172
|
+
fontSize: '0.875rem',
|
|
173
|
+
},
|
|
174
|
+
},
|
|
160
175
|
},
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
root: {
|
|
171
|
-
color: 'var(--stroke-border-base, #EFF1F5)',
|
|
172
|
-
'&:hover': {
|
|
173
|
-
background: 'none',
|
|
176
|
+
MuiPopover: {
|
|
177
|
+
styleOverrides: {
|
|
178
|
+
root: {
|
|
179
|
+
zIndex: 1200,
|
|
180
|
+
},
|
|
181
|
+
paper: {
|
|
182
|
+
border: `1px solid ${palette.divider}`,
|
|
183
|
+
boxShadow: shadows[2],
|
|
184
|
+
},
|
|
174
185
|
},
|
|
175
|
-
|
|
176
|
-
|
|
186
|
+
},
|
|
187
|
+
MuiCssBaseline: {
|
|
188
|
+
styleOverrides: {
|
|
189
|
+
'.base-card': {
|
|
190
|
+
padding: '20px',
|
|
191
|
+
borderRadius: 1.5 * borderRadius, // 12px
|
|
192
|
+
background: palette.background.default,
|
|
193
|
+
border: `1px solid ${palette.divider}`,
|
|
194
|
+
boxShadow: shadows[1],
|
|
195
|
+
},
|
|
196
|
+
'.base-label': {
|
|
197
|
+
color: palette.grey.A700,
|
|
198
|
+
fontSize: '16px',
|
|
199
|
+
fontWeight: '500',
|
|
200
|
+
lineHeight: '24px',
|
|
201
|
+
},
|
|
202
|
+
'.base-dialog': {
|
|
203
|
+
'.MuiPaper-root>.MuiDialogContent-root': {
|
|
204
|
+
paddingTop: '0',
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
a: {
|
|
208
|
+
textDecoration: 'none !important',
|
|
209
|
+
},
|
|
177
210
|
},
|
|
178
211
|
},
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
212
|
+
MuiRadio: {
|
|
213
|
+
styleOverrides: {
|
|
214
|
+
root: {
|
|
215
|
+
color: palette.grey[200],
|
|
216
|
+
'&:hover': {
|
|
217
|
+
background: 'none',
|
|
218
|
+
},
|
|
219
|
+
'&.Mui-checked': {
|
|
220
|
+
color: palette.primary.main,
|
|
221
|
+
},
|
|
222
|
+
},
|
|
187
223
|
},
|
|
188
224
|
},
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
225
|
+
MuiCheckbox: {
|
|
226
|
+
styleOverrides: {
|
|
227
|
+
root: {
|
|
228
|
+
color: palette.primary.main,
|
|
229
|
+
'&.Mui-checked': {
|
|
230
|
+
color: palette.primary.main,
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
},
|
|
195
234
|
},
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
},
|
|
202
|
-
styleOverrides: {
|
|
203
|
-
root: () => ({
|
|
204
|
-
fontSize: '0.875rem',
|
|
205
|
-
backgroundColor: 'var(--backgrounds-bg-field, #F9FAFB)',
|
|
206
|
-
}),
|
|
207
|
-
},
|
|
208
|
-
},
|
|
209
|
-
MuiInputLabel: {
|
|
210
|
-
defaultProps: {
|
|
211
|
-
size: 'small',
|
|
212
|
-
},
|
|
213
|
-
styleOverrides: {
|
|
214
|
-
root: () => ({
|
|
215
|
-
fontSize: '0.875rem',
|
|
216
|
-
}),
|
|
217
|
-
},
|
|
218
|
-
},
|
|
219
|
-
MuiChip: {
|
|
220
|
-
styleOverrides: {
|
|
221
|
-
root: {
|
|
222
|
-
borderRadius: 'var(--radius-S, 4px)',
|
|
223
|
-
border: '1px solid transparent',
|
|
224
|
-
'&.MuiChip-filledSuccess': {
|
|
225
|
-
color: 'var(--tags-tag-green-text, #007C52)',
|
|
226
|
-
backgroundColor: 'var(--tags-tag-green-bg, #B7FEE3)',
|
|
227
|
-
borderColor: 'var(--tags-tag-green-border, #63F9CB)',
|
|
235
|
+
MuiDivider: {
|
|
236
|
+
styleOverrides: {
|
|
237
|
+
root: {
|
|
238
|
+
borderColor: palette.grey[100],
|
|
239
|
+
},
|
|
228
240
|
},
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
241
|
+
},
|
|
242
|
+
MuiInputBase: {
|
|
243
|
+
defaultProps: {
|
|
244
|
+
size: 'small',
|
|
233
245
|
},
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
246
|
+
styleOverrides: {
|
|
247
|
+
root: {
|
|
248
|
+
fontSize: '0.875rem',
|
|
249
|
+
backgroundColor: palette.grey[50],
|
|
250
|
+
},
|
|
238
251
|
},
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
252
|
+
},
|
|
253
|
+
MuiInputLabel: {
|
|
254
|
+
defaultProps: {
|
|
255
|
+
size: 'small',
|
|
243
256
|
},
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
257
|
+
styleOverrides: {
|
|
258
|
+
root: {
|
|
259
|
+
fontSize: '0.875rem',
|
|
260
|
+
},
|
|
248
261
|
},
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
262
|
+
},
|
|
263
|
+
MuiChip: {
|
|
264
|
+
styleOverrides: {
|
|
265
|
+
root: {
|
|
266
|
+
borderRadius: borderRadius * 0.5,
|
|
267
|
+
border: '1px solid transparent',
|
|
268
|
+
'&.MuiChip-filledSuccess': {
|
|
269
|
+
color: palette.chip.success.text,
|
|
270
|
+
backgroundColor: palette.chip.success.background,
|
|
271
|
+
borderColor: palette.chip.success.border,
|
|
272
|
+
},
|
|
273
|
+
'&.MuiChip-filledDefault': {
|
|
274
|
+
color: palette.chip.default.text,
|
|
275
|
+
backgroundColor: palette.chip.default.background,
|
|
276
|
+
borderColor: palette.chip.default.border,
|
|
277
|
+
},
|
|
278
|
+
'&.MuiChip-filledSecondary': {
|
|
279
|
+
color: palette.chip.secondary.text,
|
|
280
|
+
backgroundColor: palette.chip.secondary.background,
|
|
281
|
+
borderColor: palette.chip.secondary.border,
|
|
282
|
+
},
|
|
283
|
+
'&.MuiChip-filledError': {
|
|
284
|
+
color: palette.chip.error.text,
|
|
285
|
+
backgroundColor: palette.chip.error.background,
|
|
286
|
+
borderColor: palette.chip.error.border,
|
|
287
|
+
},
|
|
288
|
+
'&.MuiChip-filledWarning': {
|
|
289
|
+
color: palette.chip.warning.text,
|
|
290
|
+
backgroundColor: palette.chip.warning.background,
|
|
291
|
+
borderColor: palette.chip.warning.border,
|
|
292
|
+
},
|
|
293
|
+
'&.MuiChip-filledPrimary,&.MuiChip-filledInfo': {
|
|
294
|
+
color: palette.chip.info.text,
|
|
295
|
+
backgroundColor: palette.chip.info.background,
|
|
296
|
+
borderColor: palette.chip.info.border,
|
|
297
|
+
},
|
|
298
|
+
},
|
|
253
299
|
},
|
|
254
300
|
},
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
301
|
+
MuiDialog: {
|
|
302
|
+
styleOverrides: {
|
|
303
|
+
root: {
|
|
304
|
+
zIndex: 1200,
|
|
305
|
+
},
|
|
306
|
+
},
|
|
261
307
|
},
|
|
262
308
|
},
|
|
263
309
|
},
|
|
264
|
-
|
|
265
|
-
|
|
310
|
+
restTheme,
|
|
311
|
+
]);
|
|
266
312
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
cloneDeep({
|
|
270
|
-
...parentTheme,
|
|
271
|
-
typography,
|
|
272
|
-
palette: {
|
|
273
|
-
primary: {
|
|
274
|
-
main: rootStyle.getPropertyValue('--foregrounds-fg-base').trim() || '#030712',
|
|
275
|
-
},
|
|
276
|
-
text: {
|
|
277
|
-
primary: rootStyle.getPropertyValue('--foregrounds-fg-base').trim() || '#030712',
|
|
278
|
-
secondary: rootStyle.getPropertyValue('--foregrounds-fg-subtle').trim() || '#4b5563',
|
|
279
|
-
lighter: rootStyle.getPropertyValue('--foregrounds-fg-muted').trim() || '#9ca3af',
|
|
280
|
-
link: rootStyle.getPropertyValue('--foregrounds-fg-interactive').trim() || '#0086FF',
|
|
281
|
-
},
|
|
282
|
-
error: {
|
|
283
|
-
main: rootStyle.getPropertyValue('--foregrounds-fg-danger').trim() || '#FF003B',
|
|
284
|
-
},
|
|
285
|
-
},
|
|
286
|
-
...themeOverrides,
|
|
287
|
-
}),
|
|
288
|
-
restTheme
|
|
289
|
-
)
|
|
290
|
-
);
|
|
313
|
+
return createTheme(paymentThemeOptions);
|
|
314
|
+
}, [parentTheme, restTheme]);
|
|
291
315
|
|
|
292
316
|
return (
|
|
293
317
|
<ThemeProvider theme={mergeTheme}>
|
|
@@ -296,3 +320,5 @@ export function PaymentThemeProvider({
|
|
|
296
320
|
</ThemeProvider>
|
|
297
321
|
);
|
|
298
322
|
}
|
|
323
|
+
|
|
324
|
+
export { typography };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// Extend MUI Theme Types
|
|
2
|
+
import '@blocklet/theme';
|
|
3
|
+
import '@mui/material/styles';
|
|
4
|
+
|
|
5
|
+
declare module '@mui/material/styles' {
|
|
6
|
+
interface Palette {
|
|
7
|
+
chip: {
|
|
8
|
+
success: {
|
|
9
|
+
text: string;
|
|
10
|
+
background: string;
|
|
11
|
+
border: string;
|
|
12
|
+
};
|
|
13
|
+
default: {
|
|
14
|
+
text: string;
|
|
15
|
+
background: string;
|
|
16
|
+
border: string;
|
|
17
|
+
};
|
|
18
|
+
secondary: {
|
|
19
|
+
text: string;
|
|
20
|
+
background: string;
|
|
21
|
+
border: string;
|
|
22
|
+
};
|
|
23
|
+
error: {
|
|
24
|
+
text: string;
|
|
25
|
+
background: string;
|
|
26
|
+
border: string;
|
|
27
|
+
};
|
|
28
|
+
warning: {
|
|
29
|
+
text: string;
|
|
30
|
+
background: string;
|
|
31
|
+
border: string;
|
|
32
|
+
};
|
|
33
|
+
info: {
|
|
34
|
+
text: string;
|
|
35
|
+
background: string;
|
|
36
|
+
border: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
interface PaletteOptions {
|
|
41
|
+
chip?: {
|
|
42
|
+
success?: {
|
|
43
|
+
text?: string;
|
|
44
|
+
background?: string;
|
|
45
|
+
border?: string;
|
|
46
|
+
};
|
|
47
|
+
default?: {
|
|
48
|
+
text?: string;
|
|
49
|
+
background?: string;
|
|
50
|
+
border?: string;
|
|
51
|
+
};
|
|
52
|
+
secondary?: {
|
|
53
|
+
text?: string;
|
|
54
|
+
background?: string;
|
|
55
|
+
border?: string;
|
|
56
|
+
};
|
|
57
|
+
error?: {
|
|
58
|
+
text?: string;
|
|
59
|
+
background?: string;
|
|
60
|
+
border?: string;
|
|
61
|
+
};
|
|
62
|
+
warning?: {
|
|
63
|
+
text?: string;
|
|
64
|
+
background?: string;
|
|
65
|
+
border?: string;
|
|
66
|
+
};
|
|
67
|
+
info?: {
|
|
68
|
+
text?: string;
|
|
69
|
+
background?: string;
|
|
70
|
+
border?: string;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
interface TypeText {
|
|
75
|
+
lighter?: string;
|
|
76
|
+
link?: string;
|
|
77
|
+
}
|
|
78
|
+
}
|
package/src/theme/typography.ts
CHANGED
package/src/types/index.ts
CHANGED