-
+
Privacy Policy
•
-
+
Terms of Service
diff --git a/docs/data/material/getting-started/templates/marketing-page/components/Footer.tsx b/docs/data/material/getting-started/templates/marketing-page/components/Footer.tsx
index ac3557d3cac8e1..5000b1047e1682 100644
--- a/docs/data/material/getting-started/templates/marketing-page/components/Footer.tsx
+++ b/docs/data/material/getting-started/templates/marketing-page/components/Footer.tsx
@@ -16,10 +16,14 @@ function Copyright() {
return (
{'Copyright © '}
-
+
Sitemark
-
{new Date().getFullYear()}
);
@@ -100,19 +104,49 @@ export default function Footer() {
Product
-
+
Features
-
+
Testimonials
-
+
Highlights
-
+
Pricing
-
+
FAQs
@@ -126,13 +160,31 @@ export default function Footer() {
Company
-
+
About us
-
+
Careers
-
+
Press
@@ -146,13 +198,31 @@ export default function Footer() {
Legal
-
+
Terms
-
+
Privacy
-
+
Contact
@@ -168,13 +238,25 @@ export default function Footer() {
}}
>
-
+
Privacy Policy
•
-
+
Terms of Service
diff --git a/docs/data/material/getting-started/templates/marketing-page/components/Hero.js b/docs/data/material/getting-started/templates/marketing-page/components/Hero.js
index 6e8195bb8e0e81..4354e3cf0460e8 100644
--- a/docs/data/material/getting-started/templates/marketing-page/components/Hero.js
+++ b/docs/data/material/getting-started/templates/marketing-page/components/Hero.js
@@ -133,8 +133,7 @@ export default function Hero() {
By clicking "Start now" you agree to our
diff --git a/docs/data/material/getting-started/templates/marketing-page/components/Hero.tsx b/docs/data/material/getting-started/templates/marketing-page/components/Hero.tsx
index 73b44060b5bd74..5ae37d166b096d 100644
--- a/docs/data/material/getting-started/templates/marketing-page/components/Hero.tsx
+++ b/docs/data/material/getting-started/templates/marketing-page/components/Hero.tsx
@@ -134,8 +134,7 @@ export default function Hero() {
By clicking "Start now" you agree to our
diff --git a/docs/data/material/getting-started/templates/sign-in/SignIn.js b/docs/data/material/getting-started/templates/sign-in/SignIn.js
index d3e90b5e98bed2..3fae4d347d0c5e 100644
--- a/docs/data/material/getting-started/templates/sign-in/SignIn.js
+++ b/docs/data/material/getting-started/templates/sign-in/SignIn.js
@@ -117,7 +117,7 @@ export default function SignIn(props) {
return (
-
+
diff --git a/docs/data/material/getting-started/templates/sign-in/SignIn.tsx b/docs/data/material/getting-started/templates/sign-in/SignIn.tsx
index c01c9ff6280bb2..a45199953b74cc 100644
--- a/docs/data/material/getting-started/templates/sign-in/SignIn.tsx
+++ b/docs/data/material/getting-started/templates/sign-in/SignIn.tsx
@@ -117,7 +117,7 @@ export default function SignIn(props: { disableCustomTheme?: boolean }) {
return (
-
+
diff --git a/docs/data/material/getting-started/templates/sign-up/SignUp.js b/docs/data/material/getting-started/templates/sign-up/SignUp.js
index feef4ced252b37..e4f60935ee0280 100644
--- a/docs/data/material/getting-started/templates/sign-up/SignUp.js
+++ b/docs/data/material/getting-started/templates/sign-up/SignUp.js
@@ -122,7 +122,7 @@ export default function SignUp(props) {
-
+
-
+
= FreeSolo extends
: Value;
```
-### Grid
-
-The Grid component no longer supports [system props](/material-ui/customization/how-to-customize/#the-sx-prop).
-Use the `sx` prop instead:
-
-```diff
--
-+
-```
-
-This also fixes an issue where props like `color` were consumed by the Grid instead of being forwarded to the component rendered via the `component` prop:
-
-```jsx
-// `color` is now correctly forwarded to Button
-
- hello
-
-```
-
### GridLegacy
The `GridLegacy` component is **removed**, use the `Grid` component instead.
@@ -2195,3 +2176,57 @@ The following deprecated props have been removed from the `Typography` component
-
+
```
+
+#### System props removed
+
+Use the [system-props codemod](/material-ui/migration/migrating-from-deprecated-apis/#system-props) below to migrate the code as described in the following section:
+
+```bash
+npx @mui/codemod@latest v9.0.0/system-props
+```
+
+The deprecated system props have been removed from the following components:
+
+- `Box`
+- `DialogContentText`
+- `Grid`
+- `Link`
+- `Stack`
+- `Typography`
+- `TimelineContent`
+- `TimelineOppositeContent`
+
+```diff
+-
++
+
+-
++
+
+-
++
+
+-
++
+
+-
++
+
+-
++
+
+-
++
+
+-
++
+```
+
+This also fixes an issue where props like `color` were consumed by the component instead of being forwarded to the element rendered via the `component` prop:
+
+```jsx
+// `color` is now correctly forwarded to Button
+
+ hello
+
+```
diff --git a/docs/data/system/components/stack/stack.md b/docs/data/system/components/stack/stack.md
index 792859d611a9c2..27bbcb706f4f0e 100644
--- a/docs/data/system/components/stack/stack.md
+++ b/docs/data/system/components/stack/stack.md
@@ -72,18 +72,15 @@ Below is an interactive demo that lets you explore the visual results of the dif
{{"demo": "InteractiveStack.js", "hideToolbar": true, "bg": true}}
-## System props
+## sx prop
-:::info
-System props are deprecated and will be removed in the next major release. Please use the `sx` prop instead.
+Use the [`sx` prop](/system/getting-started/the-sx-prop/) to quickly customize any Stack instance using a superset of CSS that has access to all the style functions and theme-aware properties exposed in the MUI System package.
+Below is an example of how to apply center align items using this prop:
-```diff
--
-+
+```jsx
+
```
-:::
-
## Limitations
### Margin on the children
diff --git a/docs/data/system/properties/properties.md b/docs/data/system/properties/properties.md
index 787aa37b2b53de..faf4b298c516ae 100644
--- a/docs/data/system/properties/properties.md
+++ b/docs/data/system/properties/properties.md
@@ -105,14 +105,14 @@ Let's take one row from [the table above](#properties-reference-table), for exam
and detail each column:
- **System keys**.
- The column lists the key(s) by which you can use this property with the `sx` prop (or as a system function).
+ The column lists the key(s) by which you can use this property with the `sx` prop.
```jsx
// or
-
+
// or
-
+
```
- **CSS properties**.
diff --git a/docs/src/components/action/Item.tsx b/docs/src/components/action/Item.tsx
index fd14761cf66da9..da92a5b5a936ff 100644
--- a/docs/src/components/action/Item.tsx
+++ b/docs/src/components/action/Item.tsx
@@ -101,7 +101,7 @@ export default function Item({
{icon}
-
+
{title}
{description && (
diff --git a/docs/src/components/home/ElementPointer.tsx b/docs/src/components/home/ElementPointer.tsx
index 7ae9e4d0ee2a50..25a9103d0a8578 100644
--- a/docs/src/components/home/ElementPointer.tsx
+++ b/docs/src/components/home/ElementPointer.tsx
@@ -103,8 +103,7 @@ export default function PointerContainer({
}}
>
{data.name}
diff --git a/docs/src/components/home/MaterialDesignDemo.tsx b/docs/src/components/home/MaterialDesignDemo.tsx
index 07a4f6bff71017..06dc4f1991ddce 100644
--- a/docs/src/components/home/MaterialDesignDemo.tsx
+++ b/docs/src/components/home/MaterialDesignDemo.tsx
@@ -15,7 +15,7 @@ export const componentCode = `
alt="Yosemite National Park"
image="/static/images/cards/yosemite.jpeg"
/>
-
+
Yosemite National Park, California, USA
@@ -53,9 +53,11 @@ export default function MaterialDesignDemo(props: CardProps) {
image="/static/images/cards/yosemite.jpeg"
sx={{ borderRadius: 0.5 }}
/>
-
+
- Yosemite National Park, California, USA
+
+ Yosemite National Park, California, USA
+
-
+
{name}
{chip}
-
+
{description}
diff --git a/docs/src/components/pricing/MultiAppSwitch.tsx b/docs/src/components/pricing/MultiAppSwitch.tsx
index 913f19978e935d..006897527457d9 100644
--- a/docs/src/components/pricing/MultiAppSwitch.tsx
+++ b/docs/src/components/pricing/MultiAppSwitch.tsx
@@ -35,10 +35,10 @@ export default function MultiAppSwitch() {
label={
-
+
{MultiAppDescription}
diff --git a/docs/src/components/pricing/PricingCards.tsx b/docs/src/components/pricing/PricingCards.tsx
index 37b739b4b45e37..255ca4b03103be 100644
--- a/docs/src/components/pricing/PricingCards.tsx
+++ b/docs/src/components/pricing/PricingCards.tsx
@@ -539,7 +539,7 @@ function PricingCardWrapper({ plan, highlighted = false }: PricingCardWrapperPro
{plan !== 'community' && plan !== 'enterprise' && }
-
+
{plan !== 'community' && (
Everything in {getPreviousPlanName(plan)} plan and...
diff --git a/docs/src/components/pricing/PricingList.tsx b/docs/src/components/pricing/PricingList.tsx
index 04445a3e8c8edb..151fa5d172df6a 100644
--- a/docs/src/components/pricing/PricingList.tsx
+++ b/docs/src/components/pricing/PricingList.tsx
@@ -48,7 +48,7 @@ const Plan = React.forwardRef<
)}
{plan !== 'community' && plan !== 'enterprise' && }
-
+
{features.map((feature, index) => (
))}
diff --git a/docs/src/components/productMaterial/MaterialComponents.tsx b/docs/src/components/productMaterial/MaterialComponents.tsx
index 24ad2d6b57acad..23a719b26494c8 100644
--- a/docs/src/components/productMaterial/MaterialComponents.tsx
+++ b/docs/src/components/productMaterial/MaterialComponents.tsx
@@ -166,9 +166,8 @@ export default function MaterialComponents() {
)}
{demo === 'Text Field' && (
@@ -239,10 +238,8 @@ export default function MaterialComponents() {
)}
{demo === 'Tooltip' && (
- Top
+ Top
*': { display: 'inline-block' } }}>
- Left
+ Left
- Right
+ Right
- Bottom
+ Bottom
)}
diff --git a/docs/src/components/productMaterial/MaterialStyling.tsx b/docs/src/components/productMaterial/MaterialStyling.tsx
index bc770176d0cb76..3be44ca4be4997 100644
--- a/docs/src/components/productMaterial/MaterialStyling.tsx
+++ b/docs/src/components/productMaterial/MaterialStyling.tsx
@@ -34,10 +34,10 @@ const code = `
}}
/>
-
+
123 Main St, Phoenix, AZ, USA
-
+
$280k - $310k
-
+
-
+
Contemplative Reptile
Sounds of Nature
-
+
diff --git a/docs/src/modules/components/MuiProductSelector.tsx b/docs/src/modules/components/MuiProductSelector.tsx
index d53d15681efb12..ac700f3db4b5a9 100644
--- a/docs/src/modules/components/MuiProductSelector.tsx
+++ b/docs/src/modules/components/MuiProductSelector.tsx
@@ -115,14 +115,12 @@ function ProductItem({
-
+
{name}
{chip}
-
- {description}
-
+ {description}
);
diff --git a/docs/src/pages/premium-themes/onepirate/modules/form/FormFeedback.js b/docs/src/pages/premium-themes/onepirate/modules/form/FormFeedback.js
index 6e0ba31a98cb5f..74b0e5536ef55d 100644
--- a/docs/src/pages/premium-themes/onepirate/modules/form/FormFeedback.js
+++ b/docs/src/pages/premium-themes/onepirate/modules/form/FormFeedback.js
@@ -31,7 +31,7 @@ function FormFeedback(props) {
return (
- {children}
+ {children}
);
}
diff --git a/docs/src/pages/premium-themes/onepirate/modules/form/FormFeedback.tsx b/docs/src/pages/premium-themes/onepirate/modules/form/FormFeedback.tsx
index df439207d3cf6f..b59800449da27d 100644
--- a/docs/src/pages/premium-themes/onepirate/modules/form/FormFeedback.tsx
+++ b/docs/src/pages/premium-themes/onepirate/modules/form/FormFeedback.tsx
@@ -36,7 +36,7 @@ export default function FormFeedback(props: FormFeedbackProps) {
return (
- {children}
+ {children}
);
}
diff --git a/docs/src/pages/premium-themes/onepirate/modules/views/ProductCategories.js b/docs/src/pages/premium-themes/onepirate/modules/views/ProductCategories.js
index 56bc2de60a1216..293d72d207857e 100644
--- a/docs/src/pages/premium-themes/onepirate/modules/views/ProductCategories.js
+++ b/docs/src/pages/premium-themes/onepirate/modules/views/ProductCategories.js
@@ -143,8 +143,8 @@ export default function ProductCategories() {
{image.title}
diff --git a/docs/src/pages/premium-themes/onepirate/modules/views/ProductCategories.tsx b/docs/src/pages/premium-themes/onepirate/modules/views/ProductCategories.tsx
index 56bc2de60a1216..293d72d207857e 100644
--- a/docs/src/pages/premium-themes/onepirate/modules/views/ProductCategories.tsx
+++ b/docs/src/pages/premium-themes/onepirate/modules/views/ProductCategories.tsx
@@ -143,8 +143,8 @@ export default function ProductCategories() {
{image.title}
diff --git a/docs/src/pages/premium-themes/onepirate/modules/views/ProductHero.js b/docs/src/pages/premium-themes/onepirate/modules/views/ProductHero.js
index 0bb844b7965d75..545fc57d3233a9 100644
--- a/docs/src/pages/premium-themes/onepirate/modules/views/ProductHero.js
+++ b/docs/src/pages/premium-themes/onepirate/modules/views/ProductHero.js
@@ -20,14 +20,18 @@ export default function ProductHero() {
src={backgroundImage}
alt="increase priority"
/>
-
+
Upgrade your Sundays
Enjoy secret offers up to -70% off the best luxury hotels every Sunday.
@@ -41,7 +45,7 @@ export default function ProductHero() {
>
Register
-
+
Discover the experience
diff --git a/docs/src/pages/premium-themes/onepirate/modules/views/ProductHero.tsx b/docs/src/pages/premium-themes/onepirate/modules/views/ProductHero.tsx
index 0bb844b7965d75..545fc57d3233a9 100644
--- a/docs/src/pages/premium-themes/onepirate/modules/views/ProductHero.tsx
+++ b/docs/src/pages/premium-themes/onepirate/modules/views/ProductHero.tsx
@@ -20,14 +20,18 @@ export default function ProductHero() {
src={backgroundImage}
alt="increase priority"
/>
-
+
Upgrade your Sundays
Enjoy secret offers up to -70% off the best luxury hotels every Sunday.
@@ -41,7 +45,7 @@ export default function ProductHero() {
>
Register
-
+
Discover the experience
diff --git a/docs/src/pages/premium-themes/paperbase/Header.js b/docs/src/pages/premium-themes/paperbase/Header.js
index 59a184c8f6486d..42c2c13c780420 100644
--- a/docs/src/pages/premium-themes/paperbase/Header.js
+++ b/docs/src/pages/premium-themes/paperbase/Header.js
@@ -78,7 +78,13 @@ function Header(props) {
-
+
Authentication
diff --git a/docs/src/pages/premium-themes/paperbase/Header.tsx b/docs/src/pages/premium-themes/paperbase/Header.tsx
index 570302e566e07b..15b33822c67ad9 100644
--- a/docs/src/pages/premium-themes/paperbase/Header.tsx
+++ b/docs/src/pages/premium-themes/paperbase/Header.tsx
@@ -81,7 +81,13 @@ export default function Header(props: HeaderProps) {
-
+
Authentication
diff --git a/packages/mui-codemod/README.md b/packages/mui-codemod/README.md
index 9c1539a5f676f3..382f002d20ed70 100644
--- a/packages/mui-codemod/README.md
+++ b/packages/mui-codemod/README.md
@@ -2521,6 +2521,30 @@ npx @mui/codemod@next deprecations/table-sort-label-classes
npx @mui/codemod@next deprecations/typography-props
```
+### v9.0.0
+
+#### `system-props`
+
+```bash
+npx @mui/codemod@next v9.0.0/system-props
+```
+
+Remove system props from Box, Stack, Typography, Link, Grid, DialogContentText, TimelineContent, and TimelineOppositeContent components and move them to the `sx` prop.
+
+Compared to the v6 codemod, the v9 version also handles:
+
+- `color="inherit"` on Typography (moved to `sx`)
+- `color="text.secondary"` on Link (moved to `sx`, while keeping named colors like `"primary"` and `"inherit"` as component props)
+- DialogContentText, TimelineContent, and TimelineOppositeContent components
+
+```diff
+-
++
+
+-
++
+```
+
### v7.0.0
#### `theme-color-functions`
diff --git a/packages/mui-codemod/src/v9.0.0/system-props/index.js b/packages/mui-codemod/src/v9.0.0/system-props/index.js
new file mode 100644
index 00000000000000..d1fe754e407b16
--- /dev/null
+++ b/packages/mui-codemod/src/v9.0.0/system-props/index.js
@@ -0,0 +1 @@
+export { default } from './removeSystemProps';
diff --git a/packages/mui-codemod/src/v9.0.0/system-props/removeSystemProps.js b/packages/mui-codemod/src/v9.0.0/system-props/removeSystemProps.js
new file mode 100644
index 00000000000000..493199b2dd6391
--- /dev/null
+++ b/packages/mui-codemod/src/v9.0.0/system-props/removeSystemProps.js
@@ -0,0 +1,319 @@
+// from `packages/mui-system/src/styleFunctionSx/defaultSxConfig.js`
+const defaultSxConfig = {
+ // borders
+ border: {},
+ borderTop: {},
+ borderRight: {},
+ borderBottom: {},
+ borderLeft: {},
+ borderColor: {},
+ borderTopColor: {},
+ borderRightColor: {},
+ borderBottomColor: {},
+ borderLeftColor: {},
+ outline: {},
+ outlineColor: {},
+ borderRadius: {},
+ color: {},
+ bgcolor: {},
+ backgroundColor: {},
+ p: {},
+ pt: {},
+ pr: {},
+ pb: {},
+ pl: {},
+ px: {},
+ py: {},
+ padding: {},
+ paddingTop: {},
+ paddingRight: {},
+ paddingBottom: {},
+ paddingLeft: {},
+ paddingX: {},
+ paddingY: {},
+ paddingInline: {},
+ paddingInlineStart: {},
+ paddingInlineEnd: {},
+ paddingBlock: {},
+ paddingBlockStart: {},
+ paddingBlockEnd: {},
+
+ m: {},
+ mt: {},
+ mr: {},
+ mb: {},
+ ml: {},
+ mx: {},
+ my: {},
+ margin: {},
+ marginTop: {},
+ marginRight: {},
+ marginBottom: {},
+ marginLeft: {},
+ marginX: {},
+ marginY: {},
+ marginInline: {},
+ marginInlineStart: {},
+ marginInlineEnd: {},
+ marginBlock: {},
+ marginBlockStart: {},
+ marginBlockEnd: {},
+
+ // display
+ displayPrint: {},
+ display: {},
+ overflow: {},
+ textOverflow: {},
+ visibility: {},
+ whiteSpace: {},
+
+ // flexbox
+ flexBasis: {},
+ flexDirection: {},
+ flexWrap: {},
+ justifyContent: {},
+ alignItems: {},
+ alignContent: {},
+ order: {},
+ flex: {},
+ flexGrow: {},
+ flexShrink: {},
+ alignSelf: {},
+ justifyItems: {},
+ justifySelf: {},
+
+ // grid
+ gap: {},
+ rowGap: {},
+ columnGap: {},
+ gridColumn: {},
+ gridRow: {},
+ gridAutoFlow: {},
+ gridAutoColumns: {},
+ gridAutoRows: {},
+ gridTemplateColumns: {},
+ gridTemplateRows: {},
+ gridTemplateAreas: {},
+ gridArea: {},
+
+ // positions
+ position: {},
+ zIndex: {},
+ top: {},
+ right: {},
+ bottom: {},
+ left: {},
+
+ // shadows
+ boxShadow: {},
+
+ // sizing
+ width: {},
+ maxWidth: {},
+ minWidth: {},
+ height: {},
+ maxHeight: {},
+ minHeight: {},
+ boxSizing: {},
+
+ // typography
+ font: {},
+ fontFamily: {},
+ fontSize: {},
+ fontStyle: {},
+ fontWeight: {},
+ letterSpacing: {},
+ textTransform: {},
+ lineHeight: {},
+ textAlign: {},
+ typography: {},
+};
+const systemProps = Object.keys(defaultSxConfig);
+const components = [
+ 'Box',
+ 'Stack',
+ 'Typography',
+ 'Link',
+ 'Grid',
+ 'Grid2',
+ 'DialogContentText',
+ 'TimelineContent',
+ 'TimelineOppositeContent',
+];
+
+/**
+ * @param {import('jscodeshift').FileInfo} file
+ * @param {import('jscodeshift').API} api
+ */
+export default function removeSystemProps(file, api, options) {
+ if (file.path?.endsWith('.json') || file.path?.endsWith('.d.ts')) {
+ return file.source;
+ }
+ const j = api.jscodeshift;
+ const root = j(file.source);
+ const printOptions = options.printOptions;
+
+ const deprecatedElements = [];
+ const typographyColorMatcher = {
+ matcher: (key, val) =>
+ key !== 'color' ||
+ val.value === 'inherit' ||
+ val.value?.includes('.') ||
+ val.value === 'divider' ||
+ val.value?.startsWith('#') ||
+ val.value?.match(/\(.*\)/),
+ };
+ const customReplacement = {
+ Typography: typographyColorMatcher,
+ // These components extend Typography
+ DialogContentText: typographyColorMatcher,
+ TimelineContent: typographyColorMatcher,
+ TimelineOppositeContent: typographyColorMatcher,
+ Link: {
+ // Same as Typography but keep color="inherit" as a Link component prop (controls underline behavior)
+ matcher: (key, val) =>
+ key !== 'color' ||
+ val.value?.includes('.') ||
+ val.value === 'divider' ||
+ val.value?.startsWith('#') ||
+ val.value?.match(/\(.*\)/),
+ },
+ };
+ const elementReplacement = {};
+
+ root
+ .find(j.ImportDeclaration, (decl) => decl.source.value.includes('@mui'))
+ .forEach((decl) => {
+ decl.node.specifiers.forEach((spec) => {
+ if (spec.type === 'ImportSpecifier') {
+ const name = spec.imported.name;
+ if (components.includes(name)) {
+ deprecatedElements.push(spec.local.name);
+ if (customReplacement[name]) {
+ elementReplacement[spec.local.name] = customReplacement[name];
+ }
+ }
+ }
+ if (spec.type === 'ImportDefaultSpecifier') {
+ const name = decl.node.source.value.split('/').pop();
+ if (components.includes(name)) {
+ deprecatedElements.push(spec.local.name);
+ if (customReplacement[name]) {
+ elementReplacement[spec.local.name] = customReplacement[name];
+ }
+ }
+ }
+ });
+ });
+
+ root
+ .find(j.JSXElement, {
+ openingElement: {
+ name: {
+ name: (name) => {
+ return deprecatedElements.includes(name);
+ },
+ },
+ },
+ })
+ .forEach((el) => {
+ const sx = j.objectExpression([]);
+ const elementName = el.value?.openingElement?.name?.name;
+
+ const sxNodes = j(el)
+ .find(j.JSXAttribute)
+ .filter((path) => path.parent.parent.node === el.node && path.node.name.name === 'sx');
+
+ const sxNodesArray = sxNodes.nodes() || [];
+ const existingSxValue = sxNodesArray[0]?.value?.expression;
+
+ let spreadElement = null;
+ el.node.openingElement.attributes.forEach((attr) => {
+ if (attr.type === 'JSXSpreadAttribute') {
+ spreadElement = attr;
+ }
+ });
+
+ const attrToPrune = ['sx'];
+ el.node.openingElement.attributes.forEach((attr) => {
+ if (
+ attr.type === 'JSXSpreadAttribute' ||
+ !attr.value ||
+ !systemProps.includes(attr?.name?.name)
+ ) {
+ return;
+ }
+ const key = attr?.name?.name;
+ const literal = attr?.value;
+ const val = literal.type === 'JSXExpressionContainer' ? literal.expression : literal;
+ const shouldPrune =
+ !elementReplacement[elementName] || elementReplacement[elementName].matcher(key, val);
+ if (key && val) {
+ if (shouldPrune) {
+ sx.properties.push(j.property('init', j.identifier(key), val));
+ attrToPrune.push(key);
+ }
+ }
+ });
+
+ if (sx.properties.length) {
+ el.node.openingElement.attributes = el.node.openingElement.attributes.filter(
+ (attr) => attr.type !== 'JSXAttribute' || !attrToPrune.includes(attr?.name?.name),
+ );
+
+ let finalSx;
+ if (!existingSxValue) {
+ finalSx = sx;
+ } else if (existingSxValue?.type === 'ObjectExpression') {
+ sx.properties.push(...existingSxValue.properties);
+ finalSx = sx;
+ } else if (existingSxValue?.type === 'ArrayExpression') {
+ existingSxValue.elements = [sx, ...existingSxValue.elements];
+ finalSx = existingSxValue;
+ } else {
+ finalSx = j.arrayExpression([
+ sx,
+ existingSxValue.type === 'Identifier'
+ ? j.spreadElement(
+ j.conditionalExpression(
+ j.callExpression(
+ j.memberExpression(j.identifier('Array'), j.identifier('isArray')),
+ [existingSxValue],
+ ),
+ existingSxValue,
+ j.arrayExpression([existingSxValue]),
+ ),
+ )
+ : existingSxValue,
+ ]);
+ }
+
+ if (spreadElement && spreadElement.argument.type === 'Identifier') {
+ if (finalSx.type === 'ObjectExpression') {
+ const propSx = j.memberExpression(spreadElement.argument, j.identifier('sx'));
+ finalSx = j.arrayExpression([
+ finalSx,
+ j.spreadElement(
+ j.conditionalExpression(
+ j.callExpression(
+ j.memberExpression(j.identifier('Array'), j.identifier('isArray')),
+ [propSx],
+ ),
+ propSx,
+ j.arrayExpression([propSx]),
+ ),
+ ),
+ ]);
+ } else if (finalSx.type === 'ArrayExpression') {
+ finalSx.elements.push(j.memberExpression(spreadElement.argument, j.identifier('sx')));
+ }
+ }
+
+ el.node.openingElement.attributes.push(
+ j.jsxAttribute(j.jsxIdentifier('sx'), j.jsxExpressionContainer(finalSx)),
+ );
+ }
+ });
+
+ return root.toSource(printOptions);
+}
diff --git a/packages/mui-codemod/src/v9.0.0/system-props/removeSystemProps.test.js b/packages/mui-codemod/src/v9.0.0/system-props/removeSystemProps.test.js
new file mode 100644
index 00000000000000..57ff14b9ca570c
--- /dev/null
+++ b/packages/mui-codemod/src/v9.0.0/system-props/removeSystemProps.test.js
@@ -0,0 +1,35 @@
+import path from 'path';
+import { expect } from 'chai';
+import { jscodeshift } from '../../../testUtils';
+import transform from './removeSystemProps';
+import readFile from '../../util/readFile';
+
+function read(fileName) {
+ return readFile(path.join(__dirname, fileName));
+}
+
+describe('@mui/codemod', () => {
+ describe('v9.0.0 - removeSystemProps', () => {
+ it('transforms props as needed', () => {
+ const actual = transform(
+ { source: read('./test-cases/system-props.actual.js') },
+ { jscodeshift },
+ {},
+ );
+
+ const expected = read('./test-cases/system-props.expected.js');
+ expect(actual).to.equal(expected, 'The transformed version should be correct');
+ });
+
+ it('should be idempotent', () => {
+ const actual = transform(
+ { source: read('./test-cases/system-props.expected.js') },
+ { jscodeshift },
+ {},
+ );
+
+ const expected = read('./test-cases/system-props.expected.js');
+ expect(actual).to.equal(expected, 'The transformed version should be correct');
+ });
+ });
+});
diff --git a/packages/mui-codemod/src/v9.0.0/system-props/test-cases/system-props.actual.js b/packages/mui-codemod/src/v9.0.0/system-props/test-cases/system-props.actual.js
new file mode 100644
index 00000000000000..0ff5e8b0b8c9ba
--- /dev/null
+++ b/packages/mui-codemod/src/v9.0.0/system-props/test-cases/system-props.actual.js
@@ -0,0 +1,65 @@
+import { Box as Boxxx, Grid as Griddd, Grid2 as Griddd2 } from '@mui/material';
+import Typography from '@mui/material/Typography';
+import Typographyyy from '@mui/material/Typography';
+import Stackkk from '@mui/material/Stack';
+import Link from '@mui/material/Link';
+import DialogContentText from '@mui/material/DialogContentText';
+import TimelineContent from '@mui/lab/TimelineContent';
+import TimelineOppositeContent from '@mui/lab/TimelineOppositeContent';
+
+ ;
+ ;
+
+ ;
+ ;
+
+const sx = { display: 'flex' };
+const ml = 2;
+ ;
+ ;
+ ;
+ ;
+ ;
+
+ $
+
+ }
+ sx={{ alignItems: 'flex-start' }}
+>
+ 25
+;
+function Copyright(props) {
+ return (
+
+ {'Copyright © '}
+
+ Your Website
+ {' '}
+ {new Date().getFullYear()}
+ {'.'}
+
+ );
+}
+
+ ;
+
+ ;
+
+ Sitemark;
+ Features;
+ Primary Link;
+
+Some content ;
+Inherited ;
+Primary ;
+
+09:30 am ;
+Eat ;
+
+// Dynamic color values (expression, not string literal)
+Dynamic ;
+ Dynamic Link;
diff --git a/packages/mui-codemod/src/v9.0.0/system-props/test-cases/system-props.expected.js b/packages/mui-codemod/src/v9.0.0/system-props/test-cases/system-props.expected.js
new file mode 100644
index 00000000000000..977a1a31dc5d07
--- /dev/null
+++ b/packages/mui-codemod/src/v9.0.0/system-props/test-cases/system-props.expected.js
@@ -0,0 +1,127 @@
+import { Box as Boxxx, Grid as Griddd, Grid2 as Griddd2 } from '@mui/material';
+import Typography from '@mui/material/Typography';
+import Typographyyy from '@mui/material/Typography';
+import Stackkk from '@mui/material/Stack';
+import Link from '@mui/material/Link';
+import DialogContentText from '@mui/material/DialogContentText';
+import TimelineContent from '@mui/lab/TimelineContent';
+import TimelineOppositeContent from '@mui/lab/TimelineOppositeContent';
+
+ ;
+ ;
+
+ ;
+ ;
+
+const sx = { display: 'flex' };
+const ml = 2;
+ ;
+ ;
+ ;
+ ;
+ ;
+
+ $
+
+ }
+ sx={{
+ fontSize: "xl4",
+ lineHeight: 1,
+ alignItems: 'flex-start'
+ }}>
+ 25
+;
+function Copyright(props) {
+ return (
+
+ {'Copyright © '}
+
+ Your Website
+ {' '}
+ {new Date().getFullYear()}
+ {'.'}
+
+ );
+}
+
+ ;
+
+ ;
+
+ Sitemark;
+ Features;
+ Primary Link;
+
+Some content ;
+Inherited ;
+Primary ;
+
+09:30 am ;
+Eat ;
+
+// Dynamic color values (expression, not string literal)
+Dynamic ;
+ Dynamic Link;
diff --git a/packages/mui-docs/src/DocsApp/AnalyticsProvider.tsx b/packages/mui-docs/src/DocsApp/AnalyticsProvider.tsx
index fb8d5d207290e5..877a9ab063fa2b 100644
--- a/packages/mui-docs/src/DocsApp/AnalyticsProvider.tsx
+++ b/packages/mui-docs/src/DocsApp/AnalyticsProvider.tsx
@@ -130,14 +130,14 @@ export function CookieConsentDialog() {
Cookie Preferences
We use cookies to understand site usage and improve our content. This includes
third-party analytics.
diff --git a/packages/mui-docs/src/InfoCard/InfoCard.tsx b/packages/mui-docs/src/InfoCard/InfoCard.tsx
index 0b30c41b5103d8..fe7627480843a7 100644
--- a/packages/mui-docs/src/InfoCard/InfoCard.tsx
+++ b/packages/mui-docs/src/InfoCard/InfoCard.tsx
@@ -90,18 +90,23 @@ export function InfoCard(props: InfoCardProps) {
{svg && svg}
{icon && }
{title}
-
+
{description}
diff --git a/packages/mui-material-pigment-css/package.json b/packages/mui-material-pigment-css/package.json
index c5e47f4a9f0e08..e75796bfd30e43 100644
--- a/packages/mui-material-pigment-css/package.json
+++ b/packages/mui-material-pigment-css/package.json
@@ -53,7 +53,6 @@
"generateAtomics": "@pigment-css/react/exports/generateAtomics",
"css": "@pigment-css/react/exports/css",
"createUseThemeProps": "@pigment-css/react/exports/createUseThemeProps",
- "internal_createExtendSxProp": "@pigment-css/react/exports/internal_createExtendSxProp",
"globalCss": "@pigment-css/react/exports/globalCss",
"useTheme": "@pigment-css/react/exports/useTheme"
}
diff --git a/packages/mui-material/src/Box/Box.spec.tsx b/packages/mui-material/src/Box/Box.spec.tsx
index 36b3cb4b2711cd..0a96426d0dfc9f 100644
--- a/packages/mui-material/src/Box/Box.spec.tsx
+++ b/packages/mui-material/src/Box/Box.spec.tsx
@@ -29,13 +29,14 @@ const defaultTheme = createTheme({});
const CustomBox = createBox({ defaultTheme });
expectType(CustomBox);
-// @ts-expect-error System's Box has different type than Material UI's Box
expectType(CustomBox);
function ColorTest() {
theme.vars.palette.common.black}
- sx={(theme) => ({ backgroundColor: theme.vars.palette.background.default })}
+ sx={(theme) => ({
+ color: theme.vars.palette.common.black,
+ backgroundColor: theme.vars.palette.background.default,
+ })}
/>;
}
diff --git a/packages/mui-material/src/Box/Box.test.js b/packages/mui-material/src/Box/Box.test.js
index ec713584ca8c40..7ef7219ceb1fab 100644
--- a/packages/mui-material/src/Box/Box.test.js
+++ b/packages/mui-material/src/Box/Box.test.js
@@ -35,7 +35,7 @@ describe(' ', () => {
const { container } = render(
-
+
,
);
diff --git a/packages/mui-material/src/CardHeader/CardHeader.js b/packages/mui-material/src/CardHeader/CardHeader.js
index 246511a9f7e314..9d3690cfcd5aa8 100644
--- a/packages/mui-material/src/CardHeader/CardHeader.js
+++ b/packages/mui-material/src/CardHeader/CardHeader.js
@@ -214,7 +214,7 @@ CardHeader.propTypes /* remove-proptypes */ = {
* The props used for each slot inside.
* @default {}
*/
- slotProps: PropTypes.shape({
+ slotProps: PropTypes /* @typescript-to-proptypes-ignore */.shape({
action: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
avatar: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
content: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
diff --git a/packages/mui-material/src/DialogContentText/DialogContentText.spec.tsx b/packages/mui-material/src/DialogContentText/DialogContentText.spec.tsx
index ccde4cc2f73f80..28b6b5afbab135 100644
--- a/packages/mui-material/src/DialogContentText/DialogContentText.spec.tsx
+++ b/packages/mui-material/src/DialogContentText/DialogContentText.spec.tsx
@@ -11,19 +11,16 @@ const dialogContentTextTest = () => {
{/* @ts-expect-error */}
-
-
-
-
-
+
+
+
+
+
- {/* TODO: system props did not catch this error. Add @ts-expect-error after it is fixed. */}
-
-
-
- {/* TODO: system props did not catch this error. Add @ts-expect-error after it is fixed. */}
-
+
+
+
{/* @ts-expect-error */}
{/* @ts-expect-error */}
diff --git a/packages/mui-material/src/Link/Link.d.ts b/packages/mui-material/src/Link/Link.d.ts
index 62857374359735..85ad4b1af99686 100644
--- a/packages/mui-material/src/Link/Link.d.ts
+++ b/packages/mui-material/src/Link/Link.d.ts
@@ -19,7 +19,7 @@ export interface LinkOwnProps extends DistributiveOmit
* The color of the link.
* @default 'primary'
*/
- color?: TypographyOwnProps['color'] | undefined;
+ color?: TypographyOwnProps['color'] | 'inherit' | undefined;
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
diff --git a/packages/mui-material/src/ListItemText/ListItemText.js b/packages/mui-material/src/ListItemText/ListItemText.js
index b5c2f33d3bd4bf..8b81317e5d2955 100644
--- a/packages/mui-material/src/ListItemText/ListItemText.js
+++ b/packages/mui-material/src/ListItemText/ListItemText.js
@@ -195,7 +195,7 @@ ListItemText.propTypes /* remove-proptypes */ = {
* The props used for each slot inside.
* @default {}
*/
- slotProps: PropTypes.shape({
+ slotProps: PropTypes /* @typescript-to-proptypes-ignore */.shape({
primary: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
secondary: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
diff --git a/packages/mui-material/src/ListItemText/ListItemText.spec.tsx b/packages/mui-material/src/ListItemText/ListItemText.spec.tsx
index 4b1b4c79bd15ed..a1ff1530e90bfa 100644
--- a/packages/mui-material/src/ListItemText/ListItemText.spec.tsx
+++ b/packages/mui-material/src/ListItemText/ListItemText.spec.tsx
@@ -29,7 +29,7 @@ function typographyPropsTest() {
slotProps={{
primary: {
color: 'primary',
- display: 'block',
+ sx: { display: 'block' },
gutterBottom: true,
noWrap: true,
variantMapping: { h1: 'h1' },
@@ -62,7 +62,7 @@ function secondaryTypographyPropsTest() {
slotProps={{
secondary: {
color: 'primary',
- display: 'block',
+ sx: { display: 'block' },
gutterBottom: true,
noWrap: true,
variantMapping: { h1: 'h1' },
diff --git a/packages/mui-material/src/Stack/Stack.d.ts b/packages/mui-material/src/Stack/Stack.d.ts
index a79d66b589a0c8..bd93d89c5e599e 100644
--- a/packages/mui-material/src/Stack/Stack.d.ts
+++ b/packages/mui-material/src/Stack/Stack.d.ts
@@ -1,9 +1,9 @@
import * as React from 'react';
-import { ResponsiveStyleValue, SxProps, SystemProps } from '@mui/system';
+import { ResponsiveStyleValue, SxProps } from '@mui/system';
import { OverrideProps, OverridableComponent } from '../OverridableComponent';
import { Theme } from '../styles/createTheme';
-export interface StackOwnProps extends SystemProps {
+export interface StackOwnProps {
/**
* The content of the component.
*/
diff --git a/packages/mui-material/src/Typography/Typography.d.ts b/packages/mui-material/src/Typography/Typography.d.ts
index c9659133af7be9..5a8968281a71fd 100644
--- a/packages/mui-material/src/Typography/Typography.d.ts
+++ b/packages/mui-material/src/Typography/Typography.d.ts
@@ -1,6 +1,6 @@
import * as React from 'react';
import { OverridableStringUnion } from '@mui/types';
-import { SxProps, SystemProps } from '@mui/system';
+import { SxProps } from '@mui/system';
import { Theme, TypeText } from '../styles';
import { OverrideProps, OverridableComponent } from '../OverridableComponent';
import { TypographyVariant } from '../styles/createTypography';
@@ -10,7 +10,7 @@ export interface TypographyPropsVariantOverrides {}
export interface TypographyPropsColorOverrides {}
-export interface TypographyOwnProps extends Omit, 'color'> {
+export interface TypographyOwnProps {
/**
* Set the text-align on the component.
* @default 'inherit'
@@ -41,7 +41,7 @@ export interface TypographyOwnProps extends Omit, 'color'> {
TypographyPropsColorOverrides
>
| (string & {})
- | undefined; // to work with v5 color prop type which allows any string
+ | undefined;
/**
* If `true`, the text will have a bottom margin.
* @default false
diff --git a/packages/mui-material/src/Typography/Typography.js b/packages/mui-material/src/Typography/Typography.js
index a342b4b22d2d33..cc7ffe5839ecc8 100644
--- a/packages/mui-material/src/Typography/Typography.js
+++ b/packages/mui-material/src/Typography/Typography.js
@@ -3,27 +3,13 @@ import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import composeClasses from '@mui/utils/composeClasses';
-import { styled, internal_createExtendSxProp } from '../zero-styled';
+import { styled } from '../zero-styled';
import memoTheme from '../utils/memoTheme';
import { useDefaultProps } from '../DefaultPropsProvider';
import capitalize from '../utils/capitalize';
import createSimplePaletteValueFilter from '../utils/createSimplePaletteValueFilter';
import { getTypographyUtilityClass } from './typographyClasses';
-const v6Colors = {
- primary: true,
- secondary: true,
- error: true,
- info: true,
- success: true,
- warning: true,
- textPrimary: true,
- textSecondary: true,
- textDisabled: true,
-};
-
-const extendSxProp = internal_createExtendSxProp();
-
const useUtilityClasses = (ownerState) => {
const { align, gutterBottom, noWrap, variant, classes } = ownerState;
@@ -130,15 +116,10 @@ const defaultVariantMapping = {
};
const Typography = React.forwardRef(function Typography(inProps, ref) {
- const { color, ...themeProps } = useDefaultProps({ props: inProps, name: 'MuiTypography' });
- const isSxColor = !v6Colors[color];
- // TODO: Remove `extendSxProp` in v7
- const props = extendSxProp({
- ...themeProps,
- ...(isSxColor && { color }),
- });
+ const props = useDefaultProps({ props: inProps, name: 'MuiTypography' });
const {
+ color,
align = 'inherit',
className,
component,
diff --git a/packages/mui-material/src/Typography/Typography.test.js b/packages/mui-material/src/Typography/Typography.test.js
index 7ceb426ff33ede..89ed203e88987e 100644
--- a/packages/mui-material/src/Typography/Typography.test.js
+++ b/packages/mui-material/src/Typography/Typography.test.js
@@ -105,8 +105,8 @@ describe(' ', () => {
});
});
- it('combines system properties with the sx prop', () => {
- const { container } = render( );
+ it('applies system properties via the sx prop', () => {
+ const { container } = render( );
// @ts-ignore issue with typings on `toHaveComputedStyle`
expect(container.firstChild).toHaveComputedStyle({
diff --git a/packages/mui-material/src/Typography/typography.spec.tsx b/packages/mui-material/src/Typography/typography.spec.tsx
index c2a8be36a0960e..48dee62047c683 100644
--- a/packages/mui-material/src/Typography/typography.spec.tsx
+++ b/packages/mui-material/src/Typography/typography.spec.tsx
@@ -27,20 +27,17 @@ const typographyTest = () => {
-
-
-
-
-
+
+
+
+
+
- {/* TODO: system props did not catch this error. Add @ts-expect-error after it is fixed. */}
-
-
-
- {/* TODO: system props did not catch this error. Add @ts-expect-error after it is fixed. */}
-
+
+
+
{/* @ts-expect-error */}
{/* @ts-expect-error */}
diff --git a/packages/mui-system/src/Box/Box.d.ts b/packages/mui-system/src/Box/Box.d.ts
index e0a0729d2d7adc..8146375fceb91e 100644
--- a/packages/mui-system/src/Box/Box.d.ts
+++ b/packages/mui-system/src/Box/Box.d.ts
@@ -50,7 +50,7 @@ export type SystemProps = {
| ((theme: Theme) => ResponsiveStyleValue);
};
-export interface BoxOwnProps extends SystemProps {
+export interface BoxOwnProps {
children?: React.ReactNode;
ref?: React.Ref | undefined;
/**
diff --git a/packages/mui-system/src/Box/Box.spec.tsx b/packages/mui-system/src/Box/Box.spec.tsx
index 5a117ea0ad6430..a4b72182bb6cb1 100644
--- a/packages/mui-system/src/Box/Box.spec.tsx
+++ b/packages/mui-system/src/Box/Box.spec.tsx
@@ -49,7 +49,7 @@ function ThemeCallbackTest() {
theme.palette.primary.main }} />;
({ background: theme.palette.primary.main }) }} />;
({ background: theme.palette.primary.main }) }} />;
- theme.breakpoints.values.sm} />;
+ theme.breakpoints.values.sm }} />;
}
function CssVariablesWithNestedSelectors() {
@@ -118,5 +118,5 @@ function StyledBoxWithSx() {
}
function LogicalPropertiesTest() {
- ;
+ ;
}
diff --git a/packages/mui-system/src/Box/Box.test.js b/packages/mui-system/src/Box/Box.test.js
index aa67706388cffb..28306aab416343 100644
--- a/packages/mui-system/src/Box/Box.test.js
+++ b/packages/mui-system/src/Box/Box.test.js
@@ -33,9 +33,11 @@ describe(' ', () => {
const elementRef = React.createRef();
render(
,
);
@@ -59,7 +61,7 @@ describe(' ', () => {
it.skipIf(isJsdom())('respect properties order when generating the CSS', function test() {
const { container: testCaseBorderColorWins } = render(
- ,
+ ,
);
expect(testCaseBorderColorWins.firstChild).toHaveComputedStyle({
@@ -78,7 +80,7 @@ describe(' ', () => {
});
const { container: testCaseBorderWins } = render(
- ,
+ ,
);
expect(testCaseBorderWins.firstChild).toHaveComputedStyle({
@@ -102,14 +104,16 @@ describe(' ', () => {
function test() {
const { container: testCaseBorderPositionColorWins } = render(
,
);
@@ -130,14 +134,16 @@ describe(' ', () => {
const { container: testCaseBorderPositionWins } = render(
,
);
@@ -261,16 +267,6 @@ describe(' ', () => {
},
);
- it('combines system properties with the sx prop', () => {
- const { container } = render( );
-
- expect(container.firstChild).toHaveComputedStyle({
- marginTop: '16px',
- marginRight: '40px',
- marginBottom: '16px',
- });
- });
-
it('adds the utility mui class', () => {
render( );
@@ -290,7 +286,7 @@ describe(' ', () => {
const { container } = render(
- ,
+ ,
,
);
diff --git a/packages/mui-system/src/Stack/StackProps.ts b/packages/mui-system/src/Stack/StackProps.ts
index 97af1b4c8adf6e..1e97b9734b1f38 100644
--- a/packages/mui-system/src/Stack/StackProps.ts
+++ b/packages/mui-system/src/Stack/StackProps.ts
@@ -1,7 +1,6 @@
import * as React from 'react';
import { OverrideProps } from '@mui/types';
import { ResponsiveStyleValue, SxProps } from '../styleFunctionSx';
-import { SystemProps } from '../Box';
import { Theme } from '../createTheme';
export interface StackBaseProps {
@@ -45,7 +44,7 @@ export interface StackTypeMap<
* The system prop, which allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps | undefined;
- } & SystemProps;
+ };
defaultComponent: DefaultComponent;
}
diff --git a/packages/mui-system/src/Stack/createStack.tsx b/packages/mui-system/src/Stack/createStack.tsx
index ef22f09266afec..6d86179a554bb3 100644
--- a/packages/mui-system/src/Stack/createStack.tsx
+++ b/packages/mui-system/src/Stack/createStack.tsx
@@ -8,7 +8,6 @@ import generateUtilityClass from '@mui/utils/generateUtilityClass';
import composeClasses from '@mui/utils/composeClasses';
import systemStyled from '../styled';
import useThemePropsSystem from '../useThemeProps';
-import { extendSxProp } from '../styleFunctionSx';
import createTheme from '../createTheme';
import { CreateMUIStyled } from '../createStyled';
import { StackTypeMap, StackOwnerState } from './StackProps';
@@ -183,7 +182,6 @@ export default function createStack(
const themeProps = useThemeProps<
typeof inProps & { component?: React.ElementType | undefined }
>(inProps);
- const props = extendSxProp(themeProps) as Omit; // `color` type conflicts with html color attribute.
const {
component = 'div',
direction = 'column',
@@ -193,7 +191,7 @@ export default function createStack(
className,
useFlexGap = false,
...other
- } = props;
+ } = themeProps;
const ownerState = {
direction,
diff --git a/packages/mui-system/src/createBox/createBox.js b/packages/mui-system/src/createBox/createBox.js
index 94f8783396d889..400ba2c9b8b073 100644
--- a/packages/mui-system/src/createBox/createBox.js
+++ b/packages/mui-system/src/createBox/createBox.js
@@ -2,7 +2,7 @@
import * as React from 'react';
import clsx from 'clsx';
import styled from '@mui/styled-engine';
-import styleFunctionSx, { extendSxProp } from '../styleFunctionSx';
+import styleFunctionSx from '../styleFunctionSx';
import useTheme from '../useTheme';
export default function createBox(options = {}) {
@@ -13,7 +13,7 @@ export default function createBox(options = {}) {
const Box = React.forwardRef(function Box(inProps, ref) {
const theme = useTheme(defaultTheme);
- const { className, component = 'div', ...other } = extendSxProp(inProps);
+ const { className, component = 'div', ...other } = inProps;
return (
theme.palette.primary.main }} />;
({ background: theme.palette.primary.main }) }} />;
({ background: theme.palette.primary.main }) }} />;
- theme.breakpoints.values.sm} />;
+ theme.breakpoints.values.sm }} />;
}
diff --git a/packages/mui-system/src/createBox/createBox.test.js b/packages/mui-system/src/createBox/createBox.test.js
index ebbb3950cf14af..9ac83ac81b3909 100644
--- a/packages/mui-system/src/createBox/createBox.test.js
+++ b/packages/mui-system/src/createBox/createBox.test.js
@@ -16,7 +16,7 @@ describe('createBox', () => {
it('should use defaultTheme if provided', () => {
const Box = createBox({ defaultTheme: { palette: { primary: { main: 'rgb(255, 0, 0)' } } } });
- const { container } = render(Content );
+ const { container } = render(Content );
expect(container.firstChild).toHaveComputedStyle({ color: 'rgb(255, 0, 0)' });
});
@@ -25,7 +25,7 @@ describe('createBox', () => {
const { container } = render(
- Content
+ Content
,
);
expect(container.firstChild).toHaveComputedStyle({ color: 'rgb(0, 255, 0)' });
diff --git a/test/integration/material-ui/components.spec.tsx b/test/integration/material-ui/components.spec.tsx
index bc08a487883ee4..43490ec1c49d31 100644
--- a/test/integration/material-ui/components.spec.tsx
+++ b/test/integration/material-ui/components.spec.tsx
@@ -94,7 +94,7 @@ function AppBarTest() {
-
+
Title
Login