fix: fixbug theme

This commit is contained in:
熊潇 2025-04-03 22:50:43 +08:00
parent a857afbb2c
commit c7763cddc3
4 changed files with 12 additions and 13 deletions

View File

@ -15,10 +15,10 @@
"dependencies": { "dependencies": {
"@emotion/react": "^11.14.0", "@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0", "@emotion/styled": "^11.14.0",
"@mui/material": "^6.4.7", "@mui/material": "^7.0.1",
"react": "19.0.0", "react": "19.1.0",
"react-dom": "19.0.0", "react-dom": "19.1.0",
"react-hook-form": "^7.54.2" "react-hook-form": "^7.55.0"
}, },
"exports": { "exports": {
".": "./src/index.tsx", ".": "./src/index.tsx",
@ -26,7 +26,7 @@
}, },
"devDependencies": { "devDependencies": {
"clsx": "^2.1.1", "clsx": "^2.1.1",
"tailwind-merge": "^3.0.2" "tailwind-merge": "^3.1.0"
}, },
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"

View File

@ -1,4 +1,4 @@
import MuiButton, { ButtonProps } from '@mui/material/Button'; import { Button as MuiButton, ButtonProps } from '@mui/material';
export const Button = (props: ButtonProps) => { export const Button = (props: ButtonProps) => {
return <MuiButton {...props} />; return <MuiButton {...props} />;
@ -7,7 +7,7 @@ export const Button = (props: ButtonProps) => {
export const IconButton = (props: ButtonProps) => { export const IconButton = (props: ButtonProps) => {
const { variant = 'contained', color = 'primary', sx, children, ...rest } = props; const { variant = 'contained', color = 'primary', sx, children, ...rest } = props;
return ( return (
<MuiButton variant={variant} color={color} {...rest} sx={{ color: 'white', minWidth: '32px', padding: '8px', ...sx }}> <MuiButton variant={variant} color={color} {...rest} sx={{ color: 'white', minWidth: '24px', padding: '8px', ...sx }}>
{children} {children}
</MuiButton> </MuiButton>
); );
@ -16,8 +16,8 @@ export const IconButton = (props: ButtonProps) => {
export const IconButtonItem = (props: ButtonProps) => { export const IconButtonItem = (props: ButtonProps) => {
const { variant = 'contained', size = 'small', color = 'primary', sx, children, ...rest } = props; const { variant = 'contained', size = 'small', color = 'primary', sx, children, ...rest } = props;
return ( return (
<MuiButton {...props} > <MuiButton {...props}>
{/* <MuiButton variant={'contained'} size={size} color={color} {...rest} sx={{ color: 'white', ...sx }}> */} {/* <MuiButton variant={'contained'} size={size} color={color} {...rest} sx={{ color: 'white', ...sx }}> */}
{children} {children}
</MuiButton> </MuiButton>

View File

@ -7,7 +7,6 @@ type SelectProps = {
export const Select = React.forwardRef((props: SelectProps, ref) => { export const Select = React.forwardRef((props: SelectProps, ref) => {
const { options, ...rest } = props; const { options, ...rest } = props;
console.log(props, 'props');
return ( return (
<MuiSelect {...rest} ref={ref}> <MuiSelect {...rest} ref={ref}>
{options?.map((option) => ( {options?.map((option) => (

View File

@ -1,7 +1,7 @@
import { createTheme, Shadows, ThemeOptions } from '@mui/material/styles'; import { createTheme, Shadows, ThemeOptions } from '@mui/material';
import { useTheme as useMuiTheme, Theme } from '@mui/material/styles'; import { useTheme as useMuiTheme, Theme } from '@mui/material';
import { amber, red } from '@mui/material/colors'; import { amber, red } from '@mui/material/colors';
import { ThemeProvider } from '@mui/material/styles'; import { ThemeProvider } from '@mui/material';
const generateShadows = (color: string): Shadows => { const generateShadows = (color: string): Shadows => {
return [ return [
'none', 'none',