Skip to content

Commit 0af7bb1

Browse files
committed
fix wrong transformation
1 parent d6cd77f commit 0af7bb1

File tree

11 files changed

+15
-14
lines changed

11 files changed

+15
-14
lines changed

packages/mui-material/src/Container/Container.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const Container = createContainer({
2020
];
2121
},
2222
}),
23-
useDefaultProps: (inProps) => useDefaultProps({ props: inProps, name: 'MuiContainer' }),
23+
useThemeProps: (inProps) => useDefaultProps({ props: inProps, name: 'MuiContainer' }),
2424
});
2525

2626
Container.propTypes /* remove-proptypes */ = {

packages/mui-material/src/Popper/Popper.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import refType from '@mui/utils/refType';
66
import HTMLElementType from '@mui/utils/HTMLElementType';
77
import PropTypes from 'prop-types';
88
import * as React from 'react';
9-
import { styled, Theme, useDefaultProps } from '../styles';
9+
import { styled, Theme } from '../styles';
10+
import { useDefaultProps } from '../DefaultPropsProvider';
1011

1112
export interface PopperProps extends Omit<BasePopperProps, 'direction'> {
1213
/**

packages/mui-material/src/Select/SelectInput.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ const SelectInput = React.forwardRef(function SelectInput(props, ref) {
516516
{/* So the vertical align positioning algorithm kicks in. */}
517517
{isEmpty(display) ? (
518518
// notranslate needed while Google Translate will not fix zero-width space issue
519-
<span className="notranslate"></span>
519+
<span className="notranslate">&#8203;</span>
520520
) : (
521521
display
522522
)}

packages/mui-material/src/Stack/Stack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const Stack = createStack({
1010
slot: 'Root',
1111
overridesResolver: (props, styles) => styles.root,
1212
}),
13-
useDefaultProps: (inProps) => useDefaultProps({ props: inProps, name: 'MuiStack' }),
13+
useThemeProps: (inProps) => useDefaultProps({ props: inProps, name: 'MuiStack' }),
1414
});
1515

1616
Stack.propTypes /* remove-proptypes */ = {

packages/mui-material/src/Unstable_Grid2/Grid2.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import PropTypes from 'prop-types';
33
import { createGrid as createGrid2 } from '@mui/system/Unstable_Grid';
44
import { OverridableComponent } from '@mui/types';
5-
import { styled, useDefaultProps } from '../styles';
5+
import { styled } from '../styles';
6+
import { useDefaultProps } from '../DefaultPropsProvider';
67
import { Grid2TypeMap } from './Grid2Props';
78

89
const Grid2 = createGrid2({

packages/mui-material/src/styles/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export {
7070
// eslint-disable-next-line @typescript-eslint/naming-convention
7171
export function experimental_sx(): any;
7272
export { default as useTheme } from './useTheme';
73-
export { default as useDefaultProps } from './useThemeProps';
73+
export { default as useThemeProps } from './useThemeProps';
7474
export * from './useThemeProps';
7575
export { default as styled } from './styled';
7676
/**
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
export default function shouldSkipGeneratingVar(keys: string[]) {
22
return (
3-
// ends with sxConfig
43
!!keys[0].match(/(cssVarPrefix|typography|mixins|breakpoints|direction|transitions)/) ||
5-
!!keys[0].match(/sxConfig$/) ||
4+
!!keys[0].match(/sxConfig$/) || // ends with sxConfig
65
(keys[0] === 'palette' && !!keys[1]?.match(/(mode|contrastThreshold|tonalOffset)/))
76
);
87
}

packages/mui-material/src/styles/useThemeProps.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export type ThemedProps<Theme, Name extends keyof any> = Theme extends {
1111
? Props
1212
: {};
1313

14-
export default function useDefaultProps<
14+
export default function useThemeProps<
1515
Theme extends ThemeWithProps,
1616
Props,
1717
Name extends keyof any,

packages/mui-material/src/styles/useThemeProps.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import systemUseThemeProps from '@mui/system/useThemeProps';
33
import defaultTheme from './defaultTheme';
44
import THEME_ID from './identifier';
55

6-
export default function useDefaultProps({ props, name }) {
6+
export default function useThemeProps({ props, name }) {
77
return systemUseThemeProps({ props, name, defaultTheme, themeId: THEME_ID });
88
}

packages/mui-material/src/styles/useThemeProps.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Theme, useDefaultProps } from '@mui/material/styles';
1+
import { Theme, useThemeProps } from '@mui/material/styles';
22
import { SliderProps } from '@mui/material/Slider';
33

44
function ThemedComponent() {
5-
const props = useDefaultProps<Theme, SliderProps, 'MuiSlider'>({
5+
const props = useThemeProps<Theme, SliderProps, 'MuiSlider'>({
66
props: { color: 'primary' },
77
name: 'MuiSlider',
88
});

0 commit comments

Comments
 (0)