Repository: mui/material-ui (TypeScript)
Date: 2019-11-10 16:17:20+00:00
Task type: Feature

Issue:
typescript definitions not available on root of @material-ui/core
Why can I do:

```ts
import { IconButton } from '@material-ui/core'
```

but not:

```ts
import { IconButtonProps } from '@material-ui/core'
```

instead I have to do

```ts
import { IconButtonProps } from '@material-ui/core/IconButton'
```

It would be much more consistent if types were exported in the same places as their associated components.



Issue discussion:

Solution patch:
diff --git a/packages/material-ui-codemod/src/v4.0.0/top-level-imports.js b/packages/material-ui-codemod/src/v4.0.0/top-level-imports.js
--- a/packages/material-ui-codemod/src/v4.0.0/top-level-imports.js
+++ b/packages/material-ui-codemod/src/v4.0.0/top-level-imports.js
@@ -1,23 +1,19 @@
-import { dirname } from 'path';
-import getJSExports from '../util/getJSExports';
 import addImports from 'jscodeshift-add-imports';
 
-// istanbul ignore next
-if (process.env.NODE_ENV === 'test') {
-  const resolve = require.resolve;
-  require.resolve = source =>
-    resolve(source.replace(/^@material-ui\/core\/es/, '../../../material-ui/src'));
-}
-
 export default function transformer(fileInfo, api, options) {
   const j = api.jscodeshift;
   const importModule = options.importModule || '@material-ui/core';
   const targetModule = options.targetModule || '@material-ui/core';
-  const whitelist = getJSExports(
-    require.resolve(`${importModule}/es`, {
-      paths: [dirname(fileInfo.path)],
-    }),
-  );
+
+  let requirePath = importModule;
+
+  if (process.env.NODE_ENV === 'test') {
+    requirePath = requirePath.replace(/^@material-ui\/core/, '../../../material-ui/src');
+  }
+
+  // eslint-disable-next-line global-require, import/no-dynamic-require
+  const whitelist = require(requirePath);
+
   const printOptions = options.printOptions || {
     quote: 'single',
     trailingComma: true,
@@ -41,13 +37,12 @@ export default function transformer(fileInfo, api, options) {
     path.node.specifiers.forEach((specifier, index) => {
       if (specifier.importKind && specifier.importKind !== 'value') return;
       if (specifier.type === 'ImportNamespaceSpecifier') return;
-      const localName = specifier.local.name;
+
       switch (specifier.type) {
-        case 'ImportNamespaceSpecifier':
-          return;
         case 'ImportDefaultSpecifier': {
+          const localName = specifier.local.name;
           const moduleName = match[1];
-          if (!whitelist.has(moduleName)) return;
+          if (whitelist[moduleName] == null) return;
           resultSpecifiers.push(
             j.importSpecifier(j.identifier(moduleName), j.identifier(localName)),
           );
@@ -55,7 +50,7 @@ export default function transformer(fileInfo, api, options) {
           break;
         }
         case 'ImportSpecifier':
-          if (!whitelist.has(specifier.imported.name)) return;
+          if (whitelist[specifier.imported.name] == null) return;
           resultSpecifiers.push(specifier);
           path.get('specifiers', index).prune();
           break;
diff --git a/packages/material-ui-lab/src/Autocomplete/Autocomplete.d.ts b/packages/material-ui-lab/src/Autocomplete/Autocomplete.d.ts
--- a/packages/material-ui-lab/src/Autocomplete/Autocomplete.d.ts
+++ b/packages/material-ui-lab/src/Autocomplete/Autocomplete.d.ts
@@ -1,6 +1,8 @@
 import * as React from 'react';
 import { StandardProps } from '@material-ui/core';
-import { UseAutocompleteProps, CreateFilterOptions } from '../useAutocomplete';
+import { UseAutocompleteProps, CreateFilterOptions, createFilterOptions } from '../useAutocomplete';
+
+export { createFilterOptions };
 
 export interface PopperProps extends React.HTMLAttributes<HTMLElement> {
   anchorEl?: HTMLElement;
@@ -8,8 +10,6 @@ export interface PopperProps extends React.HTMLAttributes<HTMLElement> {
   popperRef: React.Ref<unknown>;
 }
 
-export const createFilterOptions: CreateFilterOptions;
-
 export interface RenderOptionState {
   inputValue: string;
   selected: boolean;
diff --git a/packages/material-ui-lab/src/index.d.ts b/packages/material-ui-lab/src/index.d.ts
--- a/packages/material-ui-lab/src/index.d.ts
+++ b/packages/material-ui-lab/src/index.d.ts
@@ -1,11 +1,32 @@
 export { default as Autocomplete } from './Autocomplete';
+export * from './Autocomplete';
+
 export { default as Rating } from './Rating';
+export * from './Rating';
+
 export { default as Skeleton } from './Skeleton';
+export * from './Skeleton';
+
 export { default as SpeedDial } from './SpeedDial';
+export * from './SpeedDial';
+
 export { default as SpeedDialAction } from './SpeedDialAction';
+export * from './SpeedDialAction';
+
 export { default as SpeedDialIcon } from './SpeedDialIcon';
+export * from './SpeedDialIcon';
+
 export { default as ToggleButton } from './ToggleButton';
+export * from './ToggleButton';
+
 export { default as ToggleButtonGroup } from './ToggleButtonGroup';
-export { default as TreeView } from './TreeView';
+export * from './ToggleButtonGroup';
+
 export { default as TreeItem } from './TreeItem';
-export { default as useAutocomplete, createFilterOptions } from './useAutocomplete';
+export * from './TreeItem';
+
+export { default as TreeView } from './TreeView';
+export * from './TreeView';
+
+export { default as useAutocomplete } from './useAutocomplete';
+export * from './useAutocomplete';
diff --git a/packages/material-ui-lab/src/index.js b/packages/material-ui-lab/src/index.js
--- a/packages/material-ui-lab/src/index.js
+++ b/packages/material-ui-lab/src/index.js
@@ -1,11 +1,33 @@
+/* eslint-disable import/export */
 export { default as Autocomplete } from './Autocomplete';
+export * from './Autocomplete';
+
 export { default as Rating } from './Rating';
+export * from './Rating';
+
 export { default as Skeleton } from './Skeleton';
+export * from './Skeleton';
+
 export { default as SpeedDial } from './SpeedDial';
+export * from './SpeedDial';
+
 export { default as SpeedDialAction } from './SpeedDialAction';
+export * from './SpeedDialAction';
+
 export { default as SpeedDialIcon } from './SpeedDialIcon';
+export * from './SpeedDialIcon';
+
 export { default as ToggleButton } from './ToggleButton';
+export * from './ToggleButton';
+
 export { default as ToggleButtonGroup } from './ToggleButtonGroup';
+export * from './ToggleButtonGroup';
+
 export { default as TreeItem } from './TreeItem';
+export * from './TreeItem';
+
 export { default as TreeView } from './TreeView';
-export { default as useAutocomplete, createFilterOptions } from './useAutocomplete';
+export * from './TreeView';
+
+// createFilterOptions is exported from Autocomplete
+export { default as useAutocomplete } from './useAutocomplete';
diff --git a/packages/material-ui-styles/src/index.d.ts b/packages/material-ui-styles/src/index.d.ts
--- a/packages/material-ui-styles/src/index.d.ts
+++ b/packages/material-ui-styles/src/index.d.ts
@@ -1,14 +1,40 @@
 export { default as createGenerateClassName } from './createGenerateClassName';
+export * from './createGenerateClassName';
+
 export { default as createStyles } from './createStyles';
+export * from './createStyles';
+
 export { default as getThemeProps } from './getThemeProps';
+export * from './getThemeProps';
+
 export { default as jssPreset } from './jssPreset';
+export * from './jssPreset';
+
 export { default as makeStyles } from './makeStyles';
+export * from './makeStyles';
+
 export { default as mergeClasses } from './mergeClasses';
+export * from './mergeClasses';
+
 export { default as ServerStyleSheets } from './ServerStyleSheets';
+export * from './ServerStyleSheets';
+
 export { default as styled } from './styled';
+export * from './styled';
+
 export { default as StylesProvider } from './StylesProvider';
+export * from './StylesProvider';
+
 export { default as ThemeProvider } from './ThemeProvider';
-export { default as useTheme } from '@material-ui/styles/useTheme';
-export { default as withStyles, CSSProperties, StyleRules, WithStyles } from './withStyles';
-export { default as withTheme, WithTheme, withThemeCreator } from './withTheme';
+export * from './ThemeProvider';
+
+export { default as useTheme } from './useTheme';
+export * from './useTheme';
+
+export { default as withStyles } from './withStyles';
+export * from './withStyles';
+
+export { default as withTheme } from './withTheme';
+export * from './withTheme';
+
 export { DefaultTheme } from './defaultTheme';
diff --git a/packages/material-ui-styles/src/index.js b/packages/material-ui-styles/src/index.js
--- a/packages/material-ui-styles/src/index.js
+++ b/packages/material-ui-styles/src/index.js
@@ -1,3 +1,4 @@
+/* eslint-disable import/export */
 import { ponyfillGlobal } from '@material-ui/utils';
 
 /* Warning if there are several instances of @material-ui/styles */
@@ -25,15 +26,40 @@ if (
 }
 
 export { default as createGenerateClassName } from './createGenerateClassName';
+export * from './createGenerateClassName';
+
 export { default as createStyles } from './createStyles';
+export * from './createStyles';
+
 export { default as getThemeProps } from './getThemeProps';
+export * from './getThemeProps';
+
 export { default as jssPreset } from './jssPreset';
+export * from './jssPreset';
+
 export { default as makeStyles } from './makeStyles';
+export * from './makeStyles';
+
 export { default as mergeClasses } from './mergeClasses';
+export * from './mergeClasses';
+
 export { default as ServerStyleSheets } from './ServerStyleSheets';
+export * from './ServerStyleSheets';
+
 export { default as styled } from './styled';
+export * from './styled';
+
 export { default as StylesProvider } from './StylesProvider';
+export * from './StylesProvider';
+
 export { default as ThemeProvider } from './ThemeProvider';
+export * from './ThemeProvider';
+
 export { default as useTheme } from './useTheme';
+export * from './useTheme';
+
 export { default as withStyles } from './withStyles';
-export { default as withTheme, withThemeCreator } from './withTheme';
+export * from './withStyles';
+
+export { default as withTheme } from './withTheme';
+export * from './withTheme';
diff --git a/packages/material-ui/src/TableCell/TableCell.d.ts b/packages/material-ui/src/TableCell/TableCell.d.ts
--- a/packages/material-ui/src/TableCell/TableCell.d.ts
+++ b/packages/material-ui/src/TableCell/TableCell.d.ts
@@ -1,5 +1,8 @@
 import * as React from 'react';
 import { StandardProps } from '..';
+import { Padding, Size } from '../Table';
+
+export { Padding, Size };
 
 /**
  * `<TableCell>` will be rendered as an `<th>`or `<td>` depending
@@ -22,10 +25,6 @@ export interface TableCellProps
 export type TableCellBaseProps = React.ThHTMLAttributes<HTMLTableHeaderCellElement> &
   React.TdHTMLAttributes<HTMLTableDataCellElement>;
 
-export type Padding = 'default' | 'checkbox' | 'none';
-
-export type Size = 'small' | 'medium';
-
 export type SortDirection = 'asc' | 'desc' | false;
 
 export type TableCellClassKey =
diff --git a/packages/material-ui/src/index.d.ts b/packages/material-ui/src/index.d.ts
--- a/packages/material-ui/src/index.d.ts
+++ b/packages/material-ui/src/index.d.ts
@@ -54,137 +54,346 @@ export namespace PropTypes {
 import * as colors from './colors';
 
 export { colors };
-export {
-  createGenerateClassName,
-  createMuiTheme,
-  createStyles,
-  jssPreset,
-  makeStyles,
-  MuiThemeProvider,
-  responsiveFontSizes,
-  ServerStyleSheets,
-  styled,
-  StyleRulesCallback,
-  StylesProvider,
-  Theme,
-  useTheme,
-  withStyles,
-  WithStyles,
-  withTheme,
-  WithTheme,
-} from './styles';
+export * from './styles';
 
 export { default as AppBar } from './AppBar';
+export * from './AppBar';
+
 export { default as Avatar } from './Avatar';
+export * from './Avatar';
+
 export { default as Backdrop } from './Backdrop';
+export * from './Backdrop';
+
 export { default as Badge } from './Badge';
+export * from './Badge';
+
 export { default as BottomNavigation } from './BottomNavigation';
+export * from './BottomNavigation';
+
 export { default as BottomNavigationAction } from './BottomNavigationAction';
+export * from './BottomNavigationAction';
+
 export { default as Box } from './Box';
+export * from './Box';
+
 export { default as Breadcrumbs } from './Breadcrumbs';
+export * from './Breadcrumbs';
+
 export { default as Button } from './Button';
+export * from './Button';
+
 export { default as ButtonBase } from './ButtonBase';
+export * from './ButtonBase';
+
 export { default as ButtonGroup } from './ButtonGroup';
+export * from './ButtonGroup';
+
 export { default as Card } from './Card';
+export * from './Card';
+
 export { default as CardActionArea } from './CardActionArea';
+export * from './CardActionArea';
+
 export { default as CardActions } from './CardActions';
+export * from './CardActions';
+
 export { default as CardContent } from './CardContent';
+export * from './CardContent';
+
 export { default as CardHeader } from './CardHeader';
+export * from './CardHeader';
+
 export { default as CardMedia } from './CardMedia';
+export * from './CardMedia';
+
 export { default as Checkbox } from './Checkbox';
+export * from './Checkbox';
+
 export { default as Chip } from './Chip';
+export * from './Chip';
+
 export { default as CircularProgress } from './CircularProgress';
+export * from './CircularProgress';
+
 export { default as ClickAwayListener } from './ClickAwayListener';
+export * from './ClickAwayListener';
+
 export { default as Collapse } from './Collapse';
+export * from './Collapse';
+
 export { default as Container } from './Container';
+export * from './Container';
+
 export { default as CssBaseline } from './CssBaseline';
+export * from './CssBaseline';
+
 export { default as Dialog } from './Dialog';
+export * from './Dialog';
+
 export { default as DialogActions } from './DialogActions';
+export * from './DialogActions';
+
 export { default as DialogContent } from './DialogContent';
+export * from './DialogContent';
+
 export { default as DialogContentText } from './DialogContentText';
+export * from './DialogContentText';
+
 export { default as DialogTitle } from './DialogTitle';
+export * from './DialogTitle';
+
 export { default as Divider } from './Divider';
+export * from './Divider';
+
 export { default as Drawer } from './Drawer';
+export * from './Drawer';
+
 export { default as ExpansionPanel } from './ExpansionPanel';
+export * from './ExpansionPanel';
+
 export { default as ExpansionPanelActions } from './ExpansionPanelActions';
+export * from './ExpansionPanelActions';
+
 export { default as ExpansionPanelDetails } from './ExpansionPanelDetails';
+export * from './ExpansionPanelDetails';
+
 export { default as ExpansionPanelSummary } from './ExpansionPanelSummary';
+export * from './ExpansionPanelSummary';
+
 export { default as Fab } from './Fab';
+export * from './Fab';
+
 export { default as Fade } from './Fade';
+export * from './Fade';
+
 export { default as FilledInput } from './FilledInput';
+export * from './FilledInput';
+
 export { default as FormControl } from './FormControl';
+export * from './FormControl';
+
 export { default as FormControlLabel } from './FormControlLabel';
+export * from './FormControlLabel';
+
 export { default as FormGroup } from './FormGroup';
+export * from './FormGroup';
+
 export { default as FormHelperText } from './FormHelperText';
+export * from './FormHelperText';
+
 export { default as FormLabel } from './FormLabel';
+export * from './FormLabel';
+
 export { default as Grid } from './Grid';
+export * from './Grid';
+
 export { default as GridList } from './GridList';
+export * from './GridList';
+
 export { default as GridListTile } from './GridListTile';
+export * from './GridListTile';
+
 export { default as GridListTileBar } from './GridListTileBar';
+export * from './GridListTileBar';
+
 export { default as Grow } from './Grow';
+export * from './Grow';
+
 export { default as Hidden } from './Hidden';
+export * from './Hidden';
+
 export { default as Icon } from './Icon';
+export * from './Icon';
+
 export { default as IconButton } from './IconButton';
+export * from './IconButton';
+
 export { default as Input } from './Input';
+export * from './Input';
+
 export { default as InputAdornment } from './InputAdornment';
+export * from './InputAdornment';
+
 export { default as InputBase } from './InputBase';
+export * from './InputBase';
+
 export { default as InputLabel } from './InputLabel';
+export * from './InputLabel';
+
 export { default as LinearProgress } from './LinearProgress';
+export * from './LinearProgress';
+
 export { default as Link } from './Link';
+export * from './Link';
+
 export { default as List } from './List';
+export * from './List';
+
 export { default as ListItem } from './ListItem';
+export * from './ListItem';
+
 export { default as ListItemAvatar } from './ListItemAvatar';
+export * from './ListItemAvatar';
+
 export { default as ListItemIcon } from './ListItemIcon';
+export * from './ListItemIcon';
+
 export { default as ListItemSecondaryAction } from './ListItemSecondaryAction';
+export * from './ListItemSecondaryAction';
+
 export { default as ListItemText } from './ListItemText';
+export * from './ListItemText';
+
 export { default as ListSubheader } from './ListSubheader';
+export * from './ListSubheader';
+
 export { default as Menu } from './Menu';
+export * from './Menu';
+
 export { default as MenuItem } from './MenuItem';
+export * from './MenuItem';
+
 export { default as MenuList } from './MenuList';
+export * from './MenuList';
+
 export { default as MobileStepper } from './MobileStepper';
-export { default as Modal, ModalManager } from './Modal';
+export * from './MobileStepper';
+
+export { default as Modal } from './Modal';
+export * from './Modal';
+
 export { default as NativeSelect } from './NativeSelect';
+export * from './NativeSelect';
+
 export { default as NoSsr } from './NoSsr';
+export * from './NoSsr';
+
 export { default as OutlinedInput } from './OutlinedInput';
+export * from './OutlinedInput';
+
 export { default as Paper } from './Paper';
+export * from './Paper';
+
 export { default as Popover } from './Popover';
+export * from './Popover';
+
 export { default as Popper } from './Popper';
+export * from './Popper';
+
 export { default as Portal } from './Portal';
+export * from './Portal';
+
 export { default as Radio } from './Radio';
+export * from './Radio';
+
 export { default as RadioGroup } from './RadioGroup';
+export * from './RadioGroup';
+
 export { default as RootRef } from './RootRef';
+export * from './RootRef';
+
 export { default as Select } from './Select';
+export * from './Select';
+
 export { default as Slide } from './Slide';
+export * from './Slide';
+
 export { default as Slider } from './Slider';
+export * from './Slider';
+
 export { default as Snackbar } from './Snackbar';
+export * from './Snackbar';
+
 export { default as SnackbarContent } from './SnackbarContent';
+export * from './SnackbarContent';
+
 export { default as Step } from './Step';
+export * from './Step';
+
 export { default as StepButton } from './StepButton';
+export * from './StepButton';
+
 export { default as StepConnector } from './StepConnector';
+export * from './StepConnector';
+
 export { default as StepContent } from './StepContent';
+export * from './StepContent';
+
 export { default as StepIcon } from './StepIcon';
+export * from './StepIcon';
+
 export { default as StepLabel } from './StepLabel';
+export * from './StepLabel';
+
 export { default as Stepper } from './Stepper';
+export * from './Stepper';
+
 export { default as SvgIcon } from './SvgIcon';
+export * from './SvgIcon';
+
 export { default as SwipeableDrawer } from './SwipeableDrawer';
+export * from './SwipeableDrawer';
+
 export { default as Switch } from './Switch';
+export * from './Switch';
+
 export { default as Tab } from './Tab';
+export * from './Tab';
+
 export { default as Table } from './Table';
+export * from './Table';
+
 export { default as TableBody } from './TableBody';
+export * from './TableBody';
+
 export { default as TableCell } from './TableCell';
+export * from './TableCell';
+
 export { default as TableFooter } from './TableFooter';
+export * from './TableFooter';
+
 export { default as TableHead } from './TableHead';
+export * from './TableHead';
+
 export { default as TablePagination } from './TablePagination';
+export * from './TablePagination';
+
 export { default as TableRow } from './TableRow';
+export * from './TableRow';
+
 export { default as TableSortLabel } from './TableSortLabel';
-export { default as TextareaAutosize } from './TextareaAutosize';
+export * from './TableSortLabel';
+
 export { default as Tabs } from './Tabs';
+export * from './Tabs';
+
 export { default as TextField } from './TextField';
+export * from './TextField';
+
+export { default as TextareaAutosize } from './TextareaAutosize';
+export * from './TextareaAutosize';
+
 export { default as Toolbar } from './Toolbar';
+export * from './Toolbar';
+
 export { default as Tooltip } from './Tooltip';
+export * from './Tooltip';
+
 export { default as Typography } from './Typography';
+export * from './Typography';
+
 export { default as useMediaQuery } from './useMediaQuery';
+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';
+
 export { default as Zoom } from './Zoom';
+export * from './Zoom';
diff --git a/packages/material-ui/src/index.js b/packages/material-ui/src/index.js
--- a/packages/material-ui/src/index.js
+++ b/packages/material-ui/src/index.js
@@ -1,134 +1,347 @@
+/* eslint-disable import/export */
 import * as colors from './colors';
 
 export { colors };
-export {
-  createGenerateClassName,
-  createMuiTheme,
-  createStyles,
-  jssPreset,
-  makeStyles,
-  MuiThemeProvider,
-  responsiveFontSizes,
-  ServerStyleSheets,
-  styled,
-  StylesProvider,
-  ThemeProvider,
-  useTheme,
-  withStyles,
-  withTheme,
-} from './styles';
+export * from './styles';
 
 export { default as AppBar } from './AppBar';
+export * from './AppBar';
+
 export { default as Avatar } from './Avatar';
+export * from './Avatar';
+
 export { default as Backdrop } from './Backdrop';
+export * from './Backdrop';
+
 export { default as Badge } from './Badge';
+export * from './Badge';
+
 export { default as BottomNavigation } from './BottomNavigation';
+export * from './BottomNavigation';
+
 export { default as BottomNavigationAction } from './BottomNavigationAction';
+export * from './BottomNavigationAction';
+
 export { default as Box } from './Box';
+export * from './Box';
+
 export { default as Breadcrumbs } from './Breadcrumbs';
+export * from './Breadcrumbs';
+
 export { default as Button } from './Button';
+export * from './Button';
+
 export { default as ButtonBase } from './ButtonBase';
+export * from './ButtonBase';
+
 export { default as ButtonGroup } from './ButtonGroup';
+export * from './ButtonGroup';
+
 export { default as Card } from './Card';
+export * from './Card';
+
 export { default as CardActionArea } from './CardActionArea';
+export * from './CardActionArea';
+
 export { default as CardActions } from './CardActions';
+export * from './CardActions';
+
 export { default as CardContent } from './CardContent';
+export * from './CardContent';
+
 export { default as CardHeader } from './CardHeader';
+export * from './CardHeader';
+
 export { default as CardMedia } from './CardMedia';
+export * from './CardMedia';
+
 export { default as Checkbox } from './Checkbox';
+export * from './Checkbox';
+
 export { default as Chip } from './Chip';
+export * from './Chip';
+
 export { default as CircularProgress } from './CircularProgress';
+export * from './CircularProgress';
+
 export { default as ClickAwayListener } from './ClickAwayListener';
+export * from './ClickAwayListener';
+
 export { default as Collapse } from './Collapse';
+export * from './Collapse';
+
 export { default as Container } from './Container';
+export * from './Container';
+
 export { default as CssBaseline } from './CssBaseline';
+export * from './CssBaseline';
+
 export { default as Dialog } from './Dialog';
+export * from './Dialog';
+
 export { default as DialogActions } from './DialogActions';
+export * from './DialogActions';
+
 export { default as DialogContent } from './DialogContent';
+export * from './DialogContent';
+
 export { default as DialogContentText } from './DialogContentText';
+export * from './DialogContentText';
+
 export { default as DialogTitle } from './DialogTitle';
+export * from './DialogTitle';
+
 export { default as Divider } from './Divider';
+export * from './Divider';
+
 export { default as Drawer } from './Drawer';
+export * from './Drawer';
+
 export { default as ExpansionPanel } from './ExpansionPanel';
+export * from './ExpansionPanel';
+
 export { default as ExpansionPanelActions } from './ExpansionPanelActions';
+export * from './ExpansionPanelActions';
+
 export { default as ExpansionPanelDetails } from './ExpansionPanelDetails';
+export * from './ExpansionPanelDetails';
+
 export { default as ExpansionPanelSummary } from './ExpansionPanelSummary';
+export * from './ExpansionPanelSummary';
+
 export { default as Fab } from './Fab';
+export * from './Fab';
+
 export { default as Fade } from './Fade';
+export * from './Fade';
+
 export { default as FilledInput } from './FilledInput';
+export * from './FilledInput';
+
 export { default as FormControl } from './FormControl';
+export * from './FormControl';
+
 export { default as FormControlLabel } from './FormControlLabel';
+export * from './FormControlLabel';
+
 export { default as FormGroup } from './FormGroup';
+export * from './FormGroup';
+
 export { default as FormHelperText } from './FormHelperText';
+export * from './FormHelperText';
+
 export { default as FormLabel } from './FormLabel';
+export * from './FormLabel';
+
 export { default as Grid } from './Grid';
+export * from './Grid';
+
 export { default as GridList } from './GridList';
+export * from './GridList';
+
 export { default as GridListTile } from './GridListTile';
+export * from './GridListTile';
+
 export { default as GridListTileBar } from './GridListTileBar';
+export * from './GridListTileBar';
+
 export { default as Grow } from './Grow';
+export * from './Grow';
+
 export { default as Hidden } from './Hidden';
+export * from './Hidden';
+
 export { default as Icon } from './Icon';
+export * from './Icon';
+
 export { default as IconButton } from './IconButton';
+export * from './IconButton';
+
 export { default as Input } from './Input';
+export * from './Input';
+
 export { default as InputAdornment } from './InputAdornment';
+export * from './InputAdornment';
+
 export { default as InputBase } from './InputBase';
+export * from './InputBase';
+
 export { default as InputLabel } from './InputLabel';
+export * from './InputLabel';
+
 export { default as LinearProgress } from './LinearProgress';
+export * from './LinearProgress';
+
 export { default as Link } from './Link';
+export * from './Link';
+
 export { default as List } from './List';
+export * from './List';
+
 export { default as ListItem } from './ListItem';
+export * from './ListItem';
+
 export { default as ListItemAvatar } from './ListItemAvatar';
+export * from './ListItemAvatar';
+
 export { default as ListItemIcon } from './ListItemIcon';
+export * from './ListItemIcon';
+
 export { default as ListItemSecondaryAction } from './ListItemSecondaryAction';
+export * from './ListItemSecondaryAction';
+
 export { default as ListItemText } from './ListItemText';
+export * from './ListItemText';
+
 export { default as ListSubheader } from './ListSubheader';
+export * from './ListSubheader';
+
 export { default as Menu } from './Menu';
+export * from './Menu';
+
 export { default as MenuItem } from './MenuItem';
+export * from './MenuItem';
+
 export { default as MenuList } from './MenuList';
+export * from './MenuList';
+
 export { default as MobileStepper } from './MobileStepper';
-export { default as Modal, ModalManager } from './Modal';
+export * from './MobileStepper';
+
+export { default as Modal } from './Modal';
+export * from './Modal';
+
 export { default as NativeSelect } from './NativeSelect';
+export * from './NativeSelect';
+
 export { default as NoSsr } from './NoSsr';
+export * from './NoSsr';
+
 export { default as OutlinedInput } from './OutlinedInput';
+export * from './OutlinedInput';
+
 export { default as Paper } from './Paper';
+export * from './Paper';
+
 export { default as Popover } from './Popover';
+export * from './Popover';
+
 export { default as Popper } from './Popper';
+export * from './Popper';
+
 export { default as Portal } from './Portal';
+export * from './Portal';
+
 export { default as Radio } from './Radio';
+export * from './Radio';
+
 export { default as RadioGroup } from './RadioGroup';
+export * from './RadioGroup';
+
 export { default as RootRef } from './RootRef';
+export * from './RootRef';
+
 export { default as Select } from './Select';
+export * from './Select';
+
 export { default as Slide } from './Slide';
+export * from './Slide';
+
 export { default as Slider } from './Slider';
+export * from './Slider';
+
 export { default as Snackbar } from './Snackbar';
+export * from './Snackbar';
+
 export { default as SnackbarContent } from './SnackbarContent';
+export * from './SnackbarContent';
+
 export { default as Step } from './Step';
+export * from './Step';
+
 export { default as StepButton } from './StepButton';
+export * from './StepButton';
+
 export { default as StepConnector } from './StepConnector';
+export * from './StepConnector';
+
 export { default as StepContent } from './StepContent';
+export * from './StepContent';
+
 export { default as StepIcon } from './StepIcon';
+export * from './StepIcon';
+
 export { default as StepLabel } from './StepLabel';
+export * from './StepLabel';
+
 export { default as Stepper } from './Stepper';
+export * from './Stepper';
+
 export { default as SvgIcon } from './SvgIcon';
+export * from './SvgIcon';
+
 export { default as SwipeableDrawer } from './SwipeableDrawer';
+export * from './SwipeableDrawer';
+
 export { default as Switch } from './Switch';
+export * from './Switch';
+
 export { default as Tab } from './Tab';
+export * from './Tab';
+
 export { default as Table } from './Table';
+export * from './Table';
+
 export { default as TableBody } from './TableBody';
+export * from './TableBody';
+
 export { default as TableCell } from './TableCell';
+export * from './TableCell';
+
 export { default as TableFooter } from './TableFooter';
+export * from './TableFooter';
+
 export { default as TableHead } from './TableHead';
+export * from './TableHead';
+
 export { default as TablePagination } from './TablePagination';
+export * from './TablePagination';
+
 export { default as TableRow } from './TableRow';
+export * from './TableRow';
+
 export { default as TableSortLabel } from './TableSortLabel';
+export * from './TableSortLabel';
+
 export { default as Tabs } from './Tabs';
+export * from './Tabs';
+
 export { default as TextField } from './TextField';
+export * from './TextField';
+
 export { default as TextareaAutosize } from './TextareaAutosize';
+export * from './TextareaAutosize';
+
 export { default as Toolbar } from './Toolbar';
+export * from './Toolbar';
+
 export { default as Tooltip } from './Tooltip';
+export * from './Tooltip';
+
 export { default as Typography } from './Typography';
+export * from './Typography';
+
 export { default as useMediaQuery } from './useMediaQuery';
+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';
+
 export { default as Zoom } from './Zoom';
+export * from './Zoom';


Test patch:
diff --git a/packages/material-ui-codemod/src/v4.0.0/top-level-imports.test.js b/packages/material-ui-codemod/src/v4.0.0/top-level-imports.test.js
--- a/packages/material-ui-codemod/src/v4.0.0/top-level-imports.test.js
+++ b/packages/material-ui-codemod/src/v4.0.0/top-level-imports.test.js
@@ -17,7 +17,10 @@ describe('@material-ui/codemod', () => {
     describe('top-level-imports', () => {
       it('convert path as needed', () => {
         const actual = transform(
-          { source: read('./top-level-imports.test/actual.js'), path: require.resolve('./top-level-imports.test/actual.js') },
+          {
+            source: read('./top-level-imports.test/actual.js'),
+            path: require.resolve('./top-level-imports.test/actual.js'),
+          },
           { jscodeshift: jscodeshift },
           {},
         );
@@ -33,7 +36,10 @@ describe('@material-ui/codemod', () => {
 
       it('should be idempotent', () => {
         const actual = transform(
-          { source: read('./top-level-imports.test/expected.js'), path: require.resolve('./top-level-imports.test/expected.js')  },
+          {
+            source: read('./top-level-imports.test/expected.js'),
+            path: require.resolve('./top-level-imports.test/expected.js'),
+          },
           { jscodeshift: jscodeshift },
           {},
         );
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
--- 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
@@ -54,7 +54,8 @@ import InputLabel from '@material-ui/core/InputLabel';
 import Input from '@material-ui/core/Input';
 import Grow from '@material-ui/core/Grow';
 import TableFooter from '@material-ui/core/TableFooter';
-import withWidth, { isWidthUp } from '@material-ui/core/withWidth';
+import withWidth from '@material-ui/core/withWidth';
+import { isWidthUp } from '@material-ui/core/withWidth';
 import Zoom from '@material-ui/core/Zoom';
 import ClickAwayListener from '@material-ui/core/ClickAwayListener';
 import ListSubheader from '@material-ui/core/ListSubheader';
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
--- 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
@@ -1,5 +1,4 @@
 import React from 'react';
-import { isWidthUp } from '@material-ui/core/withWidth';
 
 import {
   withStyles,
@@ -58,6 +57,7 @@ import {
   Grow,
   TableFooter,
   withWidth,
+  isWidthUp,
   Zoom,
   ClickAwayListener,
   ListSubheader,