diff --git a/packages/material-ui-codemod/src/v1.0.0/import-path.js b/packages/material-ui-codemod/src/v1.0.0/import-path.js index b6b1d5b1193b19..2fb9129c7f7174 100644 --- a/packages/material-ui-codemod/src/v1.0.0/import-path.js +++ b/packages/material-ui-codemod/src/v1.0.0/import-path.js @@ -58,7 +58,6 @@ const entryModuleToFlatten = [ 'TablePagination', 'TableRow', 'Tabs', - 'withMobileDialog', 'withWidth', 'Zoom', ]; diff --git a/packages/material-ui-codemod/src/v1.0.0/import-path.test/actual.js b/packages/material-ui-codemod/src/v1.0.0/import-path.test/actual.js index 45ea49170814d3..4dc0b3f4bf1705 100644 --- a/packages/material-ui-codemod/src/v1.0.0/import-path.test/actual.js +++ b/packages/material-ui-codemod/src/v1.0.0/import-path.test/actual.js @@ -15,7 +15,6 @@ import List, { } from '@material-ui/core/List'; import Dialog, { DialogTitle } from '@material-ui/core/Dialog'; import { - withMobileDialog, DialogActions, DialogContent, DialogContentText, diff --git a/packages/material-ui-codemod/src/v1.0.0/import-path.test/expected.js b/packages/material-ui-codemod/src/v1.0.0/import-path.test/expected.js index 75dcb51858d689..118e7494839804 100644 --- a/packages/material-ui-codemod/src/v1.0.0/import-path.test/expected.js +++ b/packages/material-ui-codemod/src/v1.0.0/import-path.test/expected.js @@ -22,7 +22,6 @@ import Dialog from '@material-ui/core/Dialog'; import DialogContentText from '@material-ui/core/DialogContentText'; import DialogContent from '@material-ui/core/DialogContent'; import DialogActions from '@material-ui/core/DialogActions'; -import withMobileDialog from '@material-ui/core/withMobileDialog'; import Slide from '@material-ui/core/Slide'; import RadioGroup from '@material-ui/core/RadioGroup'; import Radio from '@material-ui/core/Radio'; diff --git a/packages/material-ui-codemod/src/v4.0.0/optimal-imports.test/actual.js b/packages/material-ui-codemod/src/v4.0.0/optimal-imports.test/actual.js index 8c029483ee2999..045f9e06c85fa5 100644 --- a/packages/material-ui-codemod/src/v4.0.0/optimal-imports.test/actual.js +++ b/packages/material-ui-codemod/src/v4.0.0/optimal-imports.test/actual.js @@ -24,7 +24,6 @@ import Dialog from '@material-ui/core/Dialog'; import DialogContentText from '@material-ui/core/DialogContentText'; import DialogContent from '@material-ui/core/DialogContent'; import DialogActions from '@material-ui/core/DialogActions'; -import withMobileDialog from '@material-ui/core/withMobileDialog'; import Slide from '@material-ui/core/Slide'; import RadioGroup from '@material-ui/core/RadioGroup'; import Radio from '@material-ui/core/Radio'; diff --git a/packages/material-ui-codemod/src/v4.0.0/optimal-imports.test/expected.js b/packages/material-ui-codemod/src/v4.0.0/optimal-imports.test/expected.js index 9190fca48d9460..5888f7193bc55e 100644 --- a/packages/material-ui-codemod/src/v4.0.0/optimal-imports.test/expected.js +++ b/packages/material-ui-codemod/src/v4.0.0/optimal-imports.test/expected.js @@ -22,7 +22,6 @@ import Dialog from '@material-ui/core/Dialog'; import DialogContentText from '@material-ui/core/DialogContentText'; import DialogContent from '@material-ui/core/DialogContent'; import DialogActions from '@material-ui/core/DialogActions'; -import withMobileDialog from '@material-ui/core/withMobileDialog'; import Slide from '@material-ui/core/Slide'; import RadioGroup from '@material-ui/core/RadioGroup'; import Radio from '@material-ui/core/Radio'; diff --git a/packages/material-ui-codemod/src/v4.0.0/top-level-imports.test/actual.js b/packages/material-ui-codemod/src/v4.0.0/top-level-imports.test/actual.js index 75de417f482faa..ec2c42016f6092 100644 --- a/packages/material-ui-codemod/src/v4.0.0/top-level-imports.test/actual.js +++ b/packages/material-ui-codemod/src/v4.0.0/top-level-imports.test/actual.js @@ -22,7 +22,6 @@ import Dialog from '@material-ui/core/Dialog'; import DialogContentText from '@material-ui/core/DialogContentText'; import DialogContent from '@material-ui/core/DialogContent'; import DialogActions from '@material-ui/core/DialogActions'; -import withMobileDialog from '@material-ui/core/withMobileDialog'; import Slide from '@material-ui/core/Slide'; import RadioGroup from '@material-ui/core/RadioGroup'; import Radio from '@material-ui/core/Radio'; diff --git a/packages/material-ui-codemod/src/v4.0.0/top-level-imports.test/expected.js b/packages/material-ui-codemod/src/v4.0.0/top-level-imports.test/expected.js index d76e6c6ede9131..0a20d299011d6d 100644 --- a/packages/material-ui-codemod/src/v4.0.0/top-level-imports.test/expected.js +++ b/packages/material-ui-codemod/src/v4.0.0/top-level-imports.test/expected.js @@ -24,7 +24,6 @@ import { DialogContentText, DialogContent, DialogActions, - withMobileDialog, Slide, RadioGroup, Radio, diff --git a/packages/material-ui/src/index.d.ts b/packages/material-ui/src/index.d.ts index db51828d6ebd66..3b56f6a6bf09d9 100644 --- a/packages/material-ui/src/index.d.ts +++ b/packages/material-ui/src/index.d.ts @@ -461,9 +461,6 @@ export * from './useMediaQuery'; export { default as useScrollTrigger } from './useScrollTrigger'; export * from './useScrollTrigger'; -export { default as withMobileDialog } from './withMobileDialog'; -export * from './withMobileDialog'; - export { default as withWidth } from './withWidth'; export * from './withWidth'; diff --git a/packages/material-ui/src/index.js b/packages/material-ui/src/index.js index 80ec328be0eab4..ec611e06df670b 100644 --- a/packages/material-ui/src/index.js +++ b/packages/material-ui/src/index.js @@ -390,9 +390,6 @@ export * from './usePagination'; export { default as useScrollTrigger } from './useScrollTrigger'; export * from './useScrollTrigger'; -export { default as withMobileDialog } from './withMobileDialog'; -export * from './withMobileDialog'; - export { default as withWidth } from './withWidth'; export * from './withWidth'; diff --git a/packages/material-ui/src/withMobileDialog/index.d.ts b/packages/material-ui/src/withMobileDialog/index.d.ts deleted file mode 100644 index 3f116cf10d3ea9..00000000000000 --- a/packages/material-ui/src/withMobileDialog/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from './withMobileDialog'; -export * from './withMobileDialog'; diff --git a/packages/material-ui/src/withMobileDialog/index.js b/packages/material-ui/src/withMobileDialog/index.js deleted file mode 100644 index 3903fa3b5fce6f..00000000000000 --- a/packages/material-ui/src/withMobileDialog/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './withMobileDialog'; diff --git a/packages/material-ui/src/withMobileDialog/withMobileDialog.d.ts b/packages/material-ui/src/withMobileDialog/withMobileDialog.d.ts deleted file mode 100644 index 2bbe60bcff0f62..00000000000000 --- a/packages/material-ui/src/withMobileDialog/withMobileDialog.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { PropInjector } from '@material-ui/types'; -import { Breakpoint } from '../styles/createBreakpoints'; -import { WithWidth } from '../withWidth'; - -export interface WithMobileDialogOptions { - breakpoint: Breakpoint; -} - -export interface WithMobileDialog extends WithWidth { - fullScreen: boolean; -} - -/** - * @deprecated - */ -export interface InjectedProps extends WithMobileDialog {} - -export default function withMobileDialog

( - options?: WithMobileDialogOptions -): PropInjector>; diff --git a/packages/material-ui/src/withMobileDialog/withMobileDialog.js b/packages/material-ui/src/withMobileDialog/withMobileDialog.js deleted file mode 100644 index 95a9ff074eaa55..00000000000000 --- a/packages/material-ui/src/withMobileDialog/withMobileDialog.js +++ /dev/null @@ -1,24 +0,0 @@ -import * as React from 'react'; -import PropTypes from 'prop-types'; -import withWidth, { isWidthDown } from '../withWidth'; - -/** - * Dialog will responsively be full screen *at or below* the given breakpoint - * (defaults to 'sm' for mobile devices). - * Notice that this Higher-order Component is incompatible with server-side rendering. - */ -const withMobileDialog = (options = {}) => (Component) => { - const { breakpoint = 'sm' } = options; - - function WithMobileDialog(props) { - return ; - } - - WithMobileDialog.propTypes = { - width: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl']).isRequired, - }; - - return withWidth()(WithMobileDialog); -}; - -export default withMobileDialog; diff --git a/packages/material-ui/src/withMobileDialog/withMobileDialog.spec.tsx b/packages/material-ui/src/withMobileDialog/withMobileDialog.spec.tsx deleted file mode 100644 index 126ca0eff01667..00000000000000 --- a/packages/material-ui/src/withMobileDialog/withMobileDialog.spec.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import * as React from 'react'; -import withMobileDialog, { WithMobileDialog } from '@material-ui/core/withMobileDialog'; - -interface SimpleProps extends WithMobileDialog { - note: string; - title: string; -} - -function Component(props: SimpleProps) { - const { fullScreen, note, title } = props; - return ( -

- {title} is fullscreen? {fullScreen} -
- {note} -
- ); -} - -Component.defaultProps = { - note: 'nothing special', -}; - -// @ts-expect-error Missing fullscreen, width -; - -const ResponsiveComponent = withMobileDialog()(Component); - -; diff --git a/packages/material-ui/src/withMobileDialog/withMobileDialog.test.js b/packages/material-ui/src/withMobileDialog/withMobileDialog.test.js deleted file mode 100644 index 560d113b11d1b6..00000000000000 --- a/packages/material-ui/src/withMobileDialog/withMobileDialog.test.js +++ /dev/null @@ -1,68 +0,0 @@ -import * as React from 'react'; -import { expect } from 'chai'; -import { createShallow } from 'test/utils'; -import Dialog from '../Dialog'; -import withMobileDialog from './withMobileDialog'; - -describe('withMobileDialog', () => { - let shallow; - const defaultProps = { - open: false, - }; - - before(() => { - shallow = createShallow({ dive: true }); - }); - - function isFullScreen(breakpoints, width) { - breakpoints.forEach((breakpoint) => { - it(`is for width: ${width} < ${breakpoint}`, () => { - const ResponsiveDialog = withMobileDialog({ breakpoint })(Dialog); - const wrapper = shallow( - - foo - , - ); - expect(wrapper.props().fullScreen).to.equal(true); - }); - }); - } - - function isNotFullScreen(breakpoints, width) { - breakpoints.forEach((breakpoint) => { - it(`is not for width: ${width} >= ${breakpoint}`, () => { - const ResponsiveDialog = withMobileDialog({ breakpoint })(Dialog); - const wrapper = shallow( - - foo - , - ); - expect(wrapper.props().fullScreen).to.equal(false); - }); - }); - } - - describe('screen width: xs', () => { - isFullScreen(['sm', 'md', 'lg', 'xl'], 'xs'); - isNotFullScreen(['xs'], 'xs'); - }); - - describe('screen width: sm (default)', () => { - isFullScreen(['md', 'lg', 'xl'], 'sm'); - isNotFullScreen(['xs', 'sm'], 'sm'); - }); - - describe('screen width: md', () => { - isFullScreen(['lg', 'xl'], 'md'); - isNotFullScreen(['xs', 'sm', 'md'], 'md'); - }); - - describe('screen width: lg', () => { - isFullScreen(['xl'], 'lg'); - isNotFullScreen(['xs', 'sm', 'md', 'lg'], 'lg'); - }); - - describe('screen width: xl', () => { - isNotFullScreen(['xs', 'sm', 'md', 'lg', 'xl'], 'xl'); - }); -});