@ebubekirylmaz/link-test 1.2.49 → 1.2.51
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/package.json
CHANGED
package/src/theme/index.jsx
CHANGED
|
@@ -23,8 +23,9 @@ export default function ThemeProvider({ children }) {
|
|
|
23
23
|
const contrast = createContrast(settings.themeContrast, settings.themeMode);
|
|
24
24
|
const presets = createPresets(settings.themeColorPresets);
|
|
25
25
|
|
|
26
|
-
const
|
|
27
|
-
|
|
26
|
+
const theme = useMemo(() => {
|
|
27
|
+
// 1. Define the base configuration
|
|
28
|
+
const baseOptions = {
|
|
28
29
|
palette: {
|
|
29
30
|
...palette(settings.themeMode),
|
|
30
31
|
...presets.palette,
|
|
@@ -38,56 +39,54 @@ export default function ThemeProvider({ children }) {
|
|
|
38
39
|
shadows: shadows(settings.themeMode),
|
|
39
40
|
shape: { borderRadius: 8 },
|
|
40
41
|
typography,
|
|
41
|
-
}
|
|
42
|
-
[
|
|
43
|
-
settings.themeMode,
|
|
44
|
-
settings.themeDirection,
|
|
45
|
-
presets.palette,
|
|
46
|
-
presets.customShadows,
|
|
47
|
-
contrast.palette,
|
|
48
|
-
]
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
const theme = createTheme(memoizedValue);
|
|
52
|
-
|
|
53
|
-
theme.components = merge(componentsOverrides(theme), contrast.components, {
|
|
54
|
-
MuiCssBaseline: {
|
|
55
|
-
styleOverrides: {
|
|
56
|
-
body: {
|
|
57
|
-
scrollbarColor:
|
|
58
|
-
theme.palette.mode === "dark"
|
|
59
|
-
? `${theme.palette.grey[700]} ${theme.palette.background.default}`
|
|
60
|
-
: `${theme.palette.grey[500]} ${theme.palette.background.default}`,
|
|
61
|
-
scrollbarWidth: "thin",
|
|
62
|
-
|
|
63
|
-
"&::-webkit-scrollbar": {
|
|
64
|
-
width: 10,
|
|
65
|
-
height: 10,
|
|
66
|
-
},
|
|
42
|
+
};
|
|
67
43
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
"&::-webkit-scrollbar-thumb": {
|
|
73
|
-
backgroundColor:
|
|
74
|
-
theme.palette.mode === "dark"
|
|
75
|
-
? theme.palette.grey[700]
|
|
76
|
-
: theme.palette.grey[500],
|
|
77
|
-
borderRadius: 8,
|
|
78
|
-
border: `2px solid ${theme.palette.background.default}`,
|
|
79
|
-
},
|
|
44
|
+
// 2. Create a temporary theme instance to generate overrides
|
|
45
|
+
// (Overrides often need access to the palette/spacing of the theme)
|
|
46
|
+
const tempTheme = createTheme(baseOptions);
|
|
80
47
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
48
|
+
// 3. Merge components into the configuration
|
|
49
|
+
baseOptions.components = merge(
|
|
50
|
+
componentsOverrides(tempTheme),
|
|
51
|
+
contrast.components,
|
|
52
|
+
{
|
|
53
|
+
MuiCssBaseline: {
|
|
54
|
+
styleOverrides: {
|
|
55
|
+
body: {
|
|
56
|
+
scrollbarColor:
|
|
57
|
+
tempTheme.palette.mode === "dark"
|
|
58
|
+
? `${tempTheme.palette.grey[700]} ${tempTheme.palette.background.default}`
|
|
59
|
+
: `${tempTheme.palette.grey[500]} ${tempTheme.palette.background.default}`,
|
|
60
|
+
scrollbarWidth: "thin",
|
|
61
|
+
"&::-webkit-scrollbar": { width: 10, height: 10 },
|
|
62
|
+
"&::-webkit-scrollbar-track": {
|
|
63
|
+
backgroundColor: tempTheme.palette.background.default,
|
|
64
|
+
},
|
|
65
|
+
"&::-webkit-scrollbar-thumb": {
|
|
66
|
+
backgroundColor:
|
|
67
|
+
tempTheme.palette.mode === "dark"
|
|
68
|
+
? tempTheme.palette.grey[700]
|
|
69
|
+
: tempTheme.palette.grey[500],
|
|
70
|
+
borderRadius: 8,
|
|
71
|
+
border: `2px solid ${tempTheme.palette.background.default}`,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
86
74
|
},
|
|
87
75
|
},
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
// 4. Return the final, complete theme
|
|
80
|
+
return createTheme(baseOptions);
|
|
81
|
+
}, [
|
|
82
|
+
settings.themeMode,
|
|
83
|
+
settings.themeDirection,
|
|
84
|
+
settings.themeContrast, // Added this to the dependency array
|
|
85
|
+
presets.palette,
|
|
86
|
+
presets.customShadows,
|
|
87
|
+
contrast.palette,
|
|
88
|
+
contrast.components,
|
|
89
|
+
]);
|
|
91
90
|
|
|
92
91
|
return (
|
|
93
92
|
<MuiThemeProvider theme={theme}>
|