diff --git a/docs/data/material/components/grid/AutoGridNoWrap.js b/docs/data/material/components/grid/AutoGridNoWrap.js index cc49b0780d1ddb..6609fbed48508b 100644 --- a/docs/data/material/components/grid/AutoGridNoWrap.js +++ b/docs/data/material/components/grid/AutoGridNoWrap.js @@ -24,7 +24,7 @@ export default function AutoGridNoWrap() { return ( - + W @@ -34,7 +34,7 @@ export default function AutoGridNoWrap() { - + W @@ -44,7 +44,7 @@ export default function AutoGridNoWrap() { - + W diff --git a/docs/data/material/components/grid/AutoGridNoWrap.tsx b/docs/data/material/components/grid/AutoGridNoWrap.tsx index cc49b0780d1ddb..6609fbed48508b 100644 --- a/docs/data/material/components/grid/AutoGridNoWrap.tsx +++ b/docs/data/material/components/grid/AutoGridNoWrap.tsx @@ -24,7 +24,7 @@ export default function AutoGridNoWrap() { return ( - + W @@ -34,7 +34,7 @@ export default function AutoGridNoWrap() { - + W @@ -44,7 +44,7 @@ export default function AutoGridNoWrap() { - + W diff --git a/docs/data/material/components/skeleton/YouTube.js b/docs/data/material/components/skeleton/YouTube.js index 852bde546b6ac4..16c9833c9afdf5 100644 --- a/docs/data/material/components/skeleton/YouTube.js +++ b/docs/data/material/components/skeleton/YouTube.js @@ -33,7 +33,7 @@ function Media(props) { const { loading = false } = props; return ( - + {(loading ? Array.from(new Array(3)) : data).map((item, index) => ( {item ? ( diff --git a/docs/data/material/components/skeleton/YouTube.tsx b/docs/data/material/components/skeleton/YouTube.tsx index 7a0e7230d85026..dff86e1facffb5 100644 --- a/docs/data/material/components/skeleton/YouTube.tsx +++ b/docs/data/material/components/skeleton/YouTube.tsx @@ -36,7 +36,7 @@ function Media(props: MediaProps) { const { loading = false } = props; return ( - + {(loading ? Array.from(new Array(3)) : data).map((item, index) => ( {item ? ( diff --git a/docs/data/material/migration/migrating-from-deprecated-apis/migrating-from-deprecated-apis.md b/docs/data/material/migration/migrating-from-deprecated-apis/migrating-from-deprecated-apis.md index dd449af5f953e1..7c4f6d7ce0b278 100644 --- a/docs/data/material/migration/migrating-from-deprecated-apis/migrating-from-deprecated-apis.md +++ b/docs/data/material/migration/migrating-from-deprecated-apis/migrating-from-deprecated-apis.md @@ -1166,25 +1166,6 @@ The ListItemSecondaryAction component was deprecated in favor of the `secondaryA ``` -## Grid - -Use the [codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#grid-props) below to migrate the code as described in the following sections: - -```bash -npx @mui/codemod@next deprecations/grid-props -``` - -### wrap prop - -The Grid's `wrap` prop was deprecated in favor of `flexWrap` MUI System prop: - -```diff - -``` - ## ImageListItemBar Use the [codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#image-list-item-bar-classes) below to migrate the code as described in the following sections: diff --git a/docs/pages/material-ui/api/grid.json b/docs/pages/material-ui/api/grid.json index 3e5fa15e9b0f58..336d50f41e3bac 100644 --- a/docs/pages/material-ui/api/grid.json +++ b/docs/pages/material-ui/api/grid.json @@ -71,9 +71,7 @@ "name": "enum", "description": "'nowrap'
| 'wrap-reverse'
| 'wrap'" }, - "default": "'wrap'", - "deprecated": true, - "deprecationInfo": "Use flexWrap instead. This prop will be removed in v7. See Migrating from deprecated APIs for more details." + "default": "'wrap'" }, "xl": { "type": { diff --git a/packages/mui-codemod/README.md b/packages/mui-codemod/README.md index 2786b3c83c0eb2..88fd2f03ea78bf 100644 --- a/packages/mui-codemod/README.md +++ b/packages/mui-codemod/README.md @@ -1103,19 +1103,6 @@ npx @mui/codemod@next deprecations/form-control-label-props npx @mui/codemod@next deprecations/list-item-props ``` -#### `grid-props` - -```diff - -``` - -```bash -npx @mui/codemod@next deprecations/grid-props -``` - #### `image-list-item-bar-classes` JS transforms: diff --git a/packages/mui-codemod/src/deprecations/all/deprecations-all.js b/packages/mui-codemod/src/deprecations/all/deprecations-all.js index eef74aec86bcd4..c1dd70ef2392c4 100644 --- a/packages/mui-codemod/src/deprecations/all/deprecations-all.js +++ b/packages/mui-codemod/src/deprecations/all/deprecations-all.js @@ -10,7 +10,6 @@ import transformCircularProgressClasses from '../circular-progress-classes'; import transformDividerProps from '../divider-props'; import transformFilledInputProps from '../filled-input-props'; import transformFormControlLabelProps from '../form-control-label-props'; -import transformGridProps from '../grid-props'; import transformImageListItemBarClasses from '../image-list-item-bar-classes'; import transformInputBaseProps from '../input-base-props'; import transformInputProps from '../input-props'; @@ -41,7 +40,6 @@ export default function deprecationsAll(file, api, options) { file.source = transformDividerProps(file, api, options); file.source = transformFilledInputProps(file, api, options); file.source = transformFormControlLabelProps(file, api, options); - file.source = transformGridProps(file, api, options); file.source = transformImageListItemBarClasses(file, api, options); file.source = transformInputBaseProps(file, api, options); file.source = transformInputProps(file, api, options); diff --git a/packages/mui-codemod/src/deprecations/grid-props/grid-props.js b/packages/mui-codemod/src/deprecations/grid-props/grid-props.js deleted file mode 100644 index 328b30e9b657da..00000000000000 --- a/packages/mui-codemod/src/deprecations/grid-props/grid-props.js +++ /dev/null @@ -1,42 +0,0 @@ -import findComponentJSX from '../../util/findComponentJSX'; - -/** - * @param {import('jscodeshift').FileInfo} file - * @param {import('jscodeshift').API} api - */ -export default function transformer(file, api, options) { - const j = api.jscodeshift; - const root = j(file.source); - const printOptions = options.printOptions; - - const filterJSXAttr = (attr, name) => attr.type === 'JSXAttribute' && attr.name.name === name; - - findComponentJSX(j, { root, componentName: 'Grid' }, (gridElement) => { - const attrs = gridElement.node.openingElement.attributes; - const wrapPropIndex = attrs.findIndex((attr) => filterJSXAttr(attr, 'wrap')); - - if (wrapPropIndex !== -1) { - if (attrs.findIndex((attr) => filterJSXAttr(attr, 'flexWrap')) !== -1) { - attrs.splice(wrapPropIndex, 1); - } else { - attrs[wrapPropIndex].name.name = 'flexWrap'; - } - } - }); - - root.find(j.ObjectProperty, { key: { name: 'MuiGrid' } }).forEach((path) => { - const defaultProps = path.value.value.properties.find(({ key }) => key.name === 'defaultProps'); - const props = defaultProps.value.properties; - const wrapPropIndex = props.findIndex((prop) => prop.key.name === 'wrap'); - - if (wrapPropIndex !== -1) { - if (props.findIndex((prop) => prop.key.name === 'flexWrap') !== -1) { - props.splice(wrapPropIndex, 1); - } else { - props[wrapPropIndex].key.name = 'flexWrap'; - } - } - }); - - return root.toSource(printOptions); -} diff --git a/packages/mui-codemod/src/deprecations/grid-props/grid-props.test.js b/packages/mui-codemod/src/deprecations/grid-props/grid-props.test.js deleted file mode 100644 index 9e44307050e920..00000000000000 --- a/packages/mui-codemod/src/deprecations/grid-props/grid-props.test.js +++ /dev/null @@ -1,16 +0,0 @@ -import { describeJscodeshiftTransform } from '../../../testUtils'; -import transform from './grid-props'; - -describe('@mui/codemod', () => { - describe('deprecations', () => { - describeJscodeshiftTransform({ - transform, - transformName: 'grid-props', - dirname: __dirname, - testCases: [ - { actual: '/test-cases/actual.js', expected: '/test-cases/expected.js' }, - { actual: '/test-cases/theme.actual.js', expected: '/test-cases/theme.expected.js' }, - ], - }); - }); -}); diff --git a/packages/mui-codemod/src/deprecations/grid-props/index.js b/packages/mui-codemod/src/deprecations/grid-props/index.js deleted file mode 100644 index 35a6d621882e1f..00000000000000 --- a/packages/mui-codemod/src/deprecations/grid-props/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './grid-props'; diff --git a/packages/mui-codemod/src/deprecations/grid-props/test-cases/actual.js b/packages/mui-codemod/src/deprecations/grid-props/test-cases/actual.js deleted file mode 100644 index bcddfdd74106fd..00000000000000 --- a/packages/mui-codemod/src/deprecations/grid-props/test-cases/actual.js +++ /dev/null @@ -1,11 +0,0 @@ -import Grid from '@mui/material/Grid'; -import { Grid as MyGrid } from '@mui/material'; - -; -; - -; -; - -// should skip non MUI components -; diff --git a/packages/mui-codemod/src/deprecations/grid-props/test-cases/expected.js b/packages/mui-codemod/src/deprecations/grid-props/test-cases/expected.js deleted file mode 100644 index 666e3fccfca565..00000000000000 --- a/packages/mui-codemod/src/deprecations/grid-props/test-cases/expected.js +++ /dev/null @@ -1,11 +0,0 @@ -import Grid from '@mui/material/Grid'; -import { Grid as MyGrid } from '@mui/material'; - -; -; - -; -; - -// should skip non MUI components -; diff --git a/packages/mui-codemod/src/deprecations/grid-props/test-cases/theme.actual.js b/packages/mui-codemod/src/deprecations/grid-props/test-cases/theme.actual.js deleted file mode 100644 index 86d9e8f604e87e..00000000000000 --- a/packages/mui-codemod/src/deprecations/grid-props/test-cases/theme.actual.js +++ /dev/null @@ -1,24 +0,0 @@ -fn({ - MuiGrid: { - defaultProps: { - wrap: 'wrap' - }, - }, -}); - -fn({ - MuiGrid: { - defaultProps: { - wrap: 'wrap-reverse' - }, - }, -}); - -fn({ - MuiGrid: { - defaultProps: { - wrap: 'wrap-reverse', - flexWrap: 'wrap' - }, - }, -}); diff --git a/packages/mui-codemod/src/deprecations/grid-props/test-cases/theme.expected.js b/packages/mui-codemod/src/deprecations/grid-props/test-cases/theme.expected.js deleted file mode 100644 index e64036c5678295..00000000000000 --- a/packages/mui-codemod/src/deprecations/grid-props/test-cases/theme.expected.js +++ /dev/null @@ -1,23 +0,0 @@ -fn({ - MuiGrid: { - defaultProps: { - flexWrap: 'wrap' - }, - }, -}); - -fn({ - MuiGrid: { - defaultProps: { - flexWrap: 'wrap-reverse' - }, - }, -}); - -fn({ - MuiGrid: { - defaultProps: { - flexWrap: 'wrap' - }, - }, -}); diff --git a/packages/mui-material/src/Grid/Grid.d.ts b/packages/mui-material/src/Grid/Grid.d.ts index 8621d3f06a2090..136532ff8b9db9 100644 --- a/packages/mui-material/src/Grid/Grid.d.ts +++ b/packages/mui-material/src/Grid/Grid.d.ts @@ -139,7 +139,6 @@ export interface GridOwnProps extends SystemProps, Breakpoints { * Defines the `flex-wrap` style property. * It's applied for all screen sizes. * @default 'wrap' - * @deprecated Use `flexWrap` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details. */ wrap?: GridWrap; /** diff --git a/packages/mui-material/src/Grid/Grid.js b/packages/mui-material/src/Grid/Grid.js index ec8f82bda71359..8a9ae2b068bf65 100644 --- a/packages/mui-material/src/Grid/Grid.js +++ b/packages/mui-material/src/Grid/Grid.js @@ -595,7 +595,6 @@ Grid.propTypes /* remove-proptypes */ = { * Defines the `flex-wrap` style property. * It's applied for all screen sizes. * @default 'wrap' - * @deprecated Use `flexWrap` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details. */ wrap: PropTypes.oneOf(['nowrap', 'wrap-reverse', 'wrap']), /**