diff --git a/packages/material-ui-icons/src/utils/createSvgIcon.d.ts b/packages/material-ui-icons/src/utils/createSvgIcon.d.ts index 9a9c973ff79cc1..b30877a075c2f2 100644 --- a/packages/material-ui-icons/src/utils/createSvgIcon.d.ts +++ b/packages/material-ui-icons/src/utils/createSvgIcon.d.ts @@ -1,5 +1,2 @@ -import SvgIcon from '@material-ui/core/SvgIcon'; - -declare function createSvgIcon(path: React.ReactNode, displayName: string): typeof SvgIcon; - -export default createSvgIcon; +export { default } from '@material-ui/core/createSvgIcon'; +export * from '@material-ui/core/createSvgIcon'; diff --git a/packages/material-ui-icons/src/utils/createSvgIcon.js b/packages/material-ui-icons/src/utils/createSvgIcon.js index 21e086a3ab170f..1633e7af3cc2b3 100644 --- a/packages/material-ui-icons/src/utils/createSvgIcon.js +++ b/packages/material-ui-icons/src/utils/createSvgIcon.js @@ -1,20 +1 @@ -import React from 'react'; -import SvgIcon from '@material-ui/core/SvgIcon'; - -export default function createSvgIcon(path, displayName) { - const Component = React.memo( - React.forwardRef((props, ref) => ( - - {path} - - )), - ); - - if (process.env.NODE_ENV !== 'production') { - Component.displayName = `${displayName}Icon`; - } - - Component.muiName = SvgIcon.muiName; - - return Component; -} +export { default } from '@material-ui/core/createSvgIcon'; diff --git a/packages/material-ui-lab/src/internal/svg-icons/Add.js b/packages/material-ui-lab/src/internal/svg-icons/Add.js index dc223900a21568..2336d1737df6ec 100644 --- a/packages/material-ui-lab/src/internal/svg-icons/Add.js +++ b/packages/material-ui-lab/src/internal/svg-icons/Add.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '@material-ui/core/createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui-lab/src/internal/svg-icons/ArrowDropDown.js b/packages/material-ui-lab/src/internal/svg-icons/ArrowDropDown.js index 6deb6bd0a37aa2..cea816c3f0e6d9 100644 --- a/packages/material-ui-lab/src/internal/svg-icons/ArrowDropDown.js +++ b/packages/material-ui-lab/src/internal/svg-icons/ArrowDropDown.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '@material-ui/core/createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui-lab/src/internal/svg-icons/Close.js b/packages/material-ui-lab/src/internal/svg-icons/Close.js index 942d756074f25d..03a32449aad8d5 100644 --- a/packages/material-ui-lab/src/internal/svg-icons/Close.js +++ b/packages/material-ui-lab/src/internal/svg-icons/Close.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '@material-ui/core/createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui-lab/src/internal/svg-icons/ErrorOutline.js b/packages/material-ui-lab/src/internal/svg-icons/ErrorOutline.js index ca178ffe959c40..fc6cb861d4e1de 100644 --- a/packages/material-ui-lab/src/internal/svg-icons/ErrorOutline.js +++ b/packages/material-ui-lab/src/internal/svg-icons/ErrorOutline.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '@material-ui/core/createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui-lab/src/internal/svg-icons/FirstPage.js b/packages/material-ui-lab/src/internal/svg-icons/FirstPage.js index 27102f886182ff..c4f08c91286572 100644 --- a/packages/material-ui-lab/src/internal/svg-icons/FirstPage.js +++ b/packages/material-ui-lab/src/internal/svg-icons/FirstPage.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '@material-ui/core/createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui-lab/src/internal/svg-icons/InfoOutlined.js b/packages/material-ui-lab/src/internal/svg-icons/InfoOutlined.js index b5e38004bcf43d..515adb3750058b 100644 --- a/packages/material-ui-lab/src/internal/svg-icons/InfoOutlined.js +++ b/packages/material-ui-lab/src/internal/svg-icons/InfoOutlined.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '@material-ui/core/createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui-lab/src/internal/svg-icons/LastPage.js b/packages/material-ui-lab/src/internal/svg-icons/LastPage.js index 20d190e998cb01..549c44537ce600 100644 --- a/packages/material-ui-lab/src/internal/svg-icons/LastPage.js +++ b/packages/material-ui-lab/src/internal/svg-icons/LastPage.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '@material-ui/core/createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui-lab/src/internal/svg-icons/NavigateBefore.js b/packages/material-ui-lab/src/internal/svg-icons/NavigateBefore.js index fc4ac139f53b96..934eb67d052feb 100644 --- a/packages/material-ui-lab/src/internal/svg-icons/NavigateBefore.js +++ b/packages/material-ui-lab/src/internal/svg-icons/NavigateBefore.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '@material-ui/core/createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui-lab/src/internal/svg-icons/NavigateNext.js b/packages/material-ui-lab/src/internal/svg-icons/NavigateNext.js index b35b7d1c89753a..7c7a3ef6c363a2 100644 --- a/packages/material-ui-lab/src/internal/svg-icons/NavigateNext.js +++ b/packages/material-ui-lab/src/internal/svg-icons/NavigateNext.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '@material-ui/core/createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui-lab/src/internal/svg-icons/ReportProblemOutlined.js b/packages/material-ui-lab/src/internal/svg-icons/ReportProblemOutlined.js index b82ed0671e5734..8bafd6f2cb6b9b 100644 --- a/packages/material-ui-lab/src/internal/svg-icons/ReportProblemOutlined.js +++ b/packages/material-ui-lab/src/internal/svg-icons/ReportProblemOutlined.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '@material-ui/core/createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui-lab/src/internal/svg-icons/Star.js b/packages/material-ui-lab/src/internal/svg-icons/Star.js index aa033c2e0d8426..b6c9c8c67d6245 100644 --- a/packages/material-ui-lab/src/internal/svg-icons/Star.js +++ b/packages/material-ui-lab/src/internal/svg-icons/Star.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '@material-ui/core/createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui-lab/src/internal/svg-icons/SuccessOutlined.js b/packages/material-ui-lab/src/internal/svg-icons/SuccessOutlined.js index 4568f218fb05dc..353648f94e4980 100644 --- a/packages/material-ui-lab/src/internal/svg-icons/SuccessOutlined.js +++ b/packages/material-ui-lab/src/internal/svg-icons/SuccessOutlined.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '@material-ui/core/createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui/src/createSvgIcon/createSvgIcon.d.ts b/packages/material-ui/src/createSvgIcon/createSvgIcon.d.ts new file mode 100644 index 00000000000000..9a9c973ff79cc1 --- /dev/null +++ b/packages/material-ui/src/createSvgIcon/createSvgIcon.d.ts @@ -0,0 +1,5 @@ +import SvgIcon from '@material-ui/core/SvgIcon'; + +declare function createSvgIcon(path: React.ReactNode, displayName: string): typeof SvgIcon; + +export default createSvgIcon; diff --git a/packages/material-ui-lab/src/internal/svg-icons/createSvgIcon.js b/packages/material-ui/src/createSvgIcon/createSvgIcon.js similarity index 76% rename from packages/material-ui-lab/src/internal/svg-icons/createSvgIcon.js rename to packages/material-ui/src/createSvgIcon/createSvgIcon.js index e98c7442ea6d6b..b6bd06e520c03f 100644 --- a/packages/material-ui-lab/src/internal/svg-icons/createSvgIcon.js +++ b/packages/material-ui/src/createSvgIcon/createSvgIcon.js @@ -1,6 +1,9 @@ -import * as React from 'react'; -import SvgIcon from '@material-ui/core/SvgIcon'; +import React from 'react'; +import SvgIcon from '../SvgIcon'; +/** + * Private module reserved for @material-ui/x packages. + */ export default function createSvgIcon(path, displayName) { const Component = React.memo( React.forwardRef((props, ref) => ( diff --git a/packages/material-ui/src/createSvgIcon/index.d.ts b/packages/material-ui/src/createSvgIcon/index.d.ts new file mode 100644 index 00000000000000..06ec076af7fc00 --- /dev/null +++ b/packages/material-ui/src/createSvgIcon/index.d.ts @@ -0,0 +1,2 @@ +export { default } from './createSvgIcon'; +export * from './createSvgIcon'; diff --git a/packages/material-ui/src/createSvgIcon/index.js b/packages/material-ui/src/createSvgIcon/index.js new file mode 100644 index 00000000000000..9a9702dc4e6d17 --- /dev/null +++ b/packages/material-ui/src/createSvgIcon/index.js @@ -0,0 +1 @@ +export { default } from './createSvgIcon'; diff --git a/packages/material-ui/src/internal/svg-icons/ArrowDownward.js b/packages/material-ui/src/internal/svg-icons/ArrowDownward.js index 68800536c9a77c..4e491475f2c624 100644 --- a/packages/material-ui/src/internal/svg-icons/ArrowDownward.js +++ b/packages/material-ui/src/internal/svg-icons/ArrowDownward.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '../../createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui/src/internal/svg-icons/ArrowDropDown.js b/packages/material-ui/src/internal/svg-icons/ArrowDropDown.js index 6deb6bd0a37aa2..4b3138c5cebe53 100644 --- a/packages/material-ui/src/internal/svg-icons/ArrowDropDown.js +++ b/packages/material-ui/src/internal/svg-icons/ArrowDropDown.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '../../createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui/src/internal/svg-icons/Cancel.js b/packages/material-ui/src/internal/svg-icons/Cancel.js index 494617a88e5a18..7eb647354a63c3 100644 --- a/packages/material-ui/src/internal/svg-icons/Cancel.js +++ b/packages/material-ui/src/internal/svg-icons/Cancel.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '../../createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui/src/internal/svg-icons/CheckBox.js b/packages/material-ui/src/internal/svg-icons/CheckBox.js index 3e7f5f58e73b91..49ee6d1d66869a 100644 --- a/packages/material-ui/src/internal/svg-icons/CheckBox.js +++ b/packages/material-ui/src/internal/svg-icons/CheckBox.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '../../createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui/src/internal/svg-icons/CheckBoxOutlineBlank.js b/packages/material-ui/src/internal/svg-icons/CheckBoxOutlineBlank.js index bc8f424eec52a7..e68489c05c89fb 100644 --- a/packages/material-ui/src/internal/svg-icons/CheckBoxOutlineBlank.js +++ b/packages/material-ui/src/internal/svg-icons/CheckBoxOutlineBlank.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '../../createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui/src/internal/svg-icons/CheckCircle.js b/packages/material-ui/src/internal/svg-icons/CheckCircle.js index 61c2cb61bbc28d..4d6c82623cd0a5 100644 --- a/packages/material-ui/src/internal/svg-icons/CheckCircle.js +++ b/packages/material-ui/src/internal/svg-icons/CheckCircle.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '../../createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui/src/internal/svg-icons/Close.js b/packages/material-ui/src/internal/svg-icons/Close.js index 942d756074f25d..4c2f51f4afc7a1 100644 --- a/packages/material-ui/src/internal/svg-icons/Close.js +++ b/packages/material-ui/src/internal/svg-icons/Close.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '../../createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui/src/internal/svg-icons/IndeterminateCheckBox.js b/packages/material-ui/src/internal/svg-icons/IndeterminateCheckBox.js index 7f68a2acbf4026..7716f676cb8198 100644 --- a/packages/material-ui/src/internal/svg-icons/IndeterminateCheckBox.js +++ b/packages/material-ui/src/internal/svg-icons/IndeterminateCheckBox.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '../../createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui/src/internal/svg-icons/KeyboardArrowLeft.js b/packages/material-ui/src/internal/svg-icons/KeyboardArrowLeft.js index 250b3f26376f4e..a026cb17d2d38b 100644 --- a/packages/material-ui/src/internal/svg-icons/KeyboardArrowLeft.js +++ b/packages/material-ui/src/internal/svg-icons/KeyboardArrowLeft.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '../../createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui/src/internal/svg-icons/KeyboardArrowRight.js b/packages/material-ui/src/internal/svg-icons/KeyboardArrowRight.js index dd661fc0adeb10..a169dca689e2bb 100644 --- a/packages/material-ui/src/internal/svg-icons/KeyboardArrowRight.js +++ b/packages/material-ui/src/internal/svg-icons/KeyboardArrowRight.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '../../createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui/src/internal/svg-icons/MoreHoriz.js b/packages/material-ui/src/internal/svg-icons/MoreHoriz.js index 42d76208275e9a..f8fbaa9d1c7353 100644 --- a/packages/material-ui/src/internal/svg-icons/MoreHoriz.js +++ b/packages/material-ui/src/internal/svg-icons/MoreHoriz.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '../../createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui/src/internal/svg-icons/Person.js b/packages/material-ui/src/internal/svg-icons/Person.js index a75080a35ac24d..5ccbde1a7bbd46 100644 --- a/packages/material-ui/src/internal/svg-icons/Person.js +++ b/packages/material-ui/src/internal/svg-icons/Person.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '../../createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui/src/internal/svg-icons/RadioButtonChecked.js b/packages/material-ui/src/internal/svg-icons/RadioButtonChecked.js index 6bb3ece001e588..384553d144a43b 100644 --- a/packages/material-ui/src/internal/svg-icons/RadioButtonChecked.js +++ b/packages/material-ui/src/internal/svg-icons/RadioButtonChecked.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '../../createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui/src/internal/svg-icons/RadioButtonUnchecked.js b/packages/material-ui/src/internal/svg-icons/RadioButtonUnchecked.js index 1f2b5745926628..294caaffd30635 100644 --- a/packages/material-ui/src/internal/svg-icons/RadioButtonUnchecked.js +++ b/packages/material-ui/src/internal/svg-icons/RadioButtonUnchecked.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '../../createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui/src/internal/svg-icons/Warning.js b/packages/material-ui/src/internal/svg-icons/Warning.js index 2a5105aa8ab3f4..0b3c0852036feb 100644 --- a/packages/material-ui/src/internal/svg-icons/Warning.js +++ b/packages/material-ui/src/internal/svg-icons/Warning.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import createSvgIcon from './createSvgIcon'; +import createSvgIcon from '../../createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui/src/internal/svg-icons/createSvgIcon.js b/packages/material-ui/src/internal/svg-icons/createSvgIcon.js deleted file mode 100644 index adee28002f0b3d..00000000000000 --- a/packages/material-ui/src/internal/svg-icons/createSvgIcon.js +++ /dev/null @@ -1,20 +0,0 @@ -import * as React from 'react'; -import SvgIcon from '../../SvgIcon'; - -export default function createSvgIcon(path, displayName) { - const Component = React.memo( - React.forwardRef((props, ref) => ( - - {path} - - )), - ); - - if (process.env.NODE_ENV !== 'production') { - Component.displayName = `${displayName}Icon`; - } - - Component.muiName = SvgIcon.muiName; - - return Component; -}