From 527cf515ccd54f12769c5234e7069bd109badcf9 Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 19 Sep 2020 20:45:51 +0100 Subject: [PATCH 01/18] [Alert] Move from lab to core --- docs/pages/api-docs/alert-title.md | 8 ++++---- docs/pages/api-docs/alert.md | 8 ++++---- docs/src/pages/components/alert/ActionAlerts.js | 2 +- docs/src/pages/components/alert/ActionAlerts.tsx | 2 +- docs/src/pages/components/alert/ColorAlerts.js | 2 +- docs/src/pages/components/alert/ColorAlerts.tsx | 2 +- docs/src/pages/components/alert/FilledAlerts.js | 2 +- docs/src/pages/components/alert/FilledAlerts.tsx | 2 +- docs/src/pages/components/alert/IconAlerts.js | 2 +- docs/src/pages/components/alert/IconAlerts.tsx | 2 +- docs/src/pages/components/alert/OutlinedAlerts.js | 2 +- docs/src/pages/components/alert/OutlinedAlerts.tsx | 2 +- docs/src/pages/components/alert/SimpleAlerts.js | 2 +- docs/src/pages/components/alert/SimpleAlerts.tsx | 2 +- docs/src/pages/components/alert/TransitionAlerts.js | 2 +- docs/src/pages/components/alert/TransitionAlerts.tsx | 2 +- .../pages/components/snackbars/CustomizedSnackbars.js | 2 +- .../pages/components/snackbars/CustomizedSnackbars.tsx | 2 +- packages/material-ui-lab/src/index.d.ts | 6 ------ packages/material-ui-lab/src/index.js | 6 ------ packages/material-ui-lab/src/index.test.js | 2 +- .../src/themeAugmentation/components.d.ts | 9 --------- .../src/themeAugmentation/overrides.d.ts | 4 ---- .../material-ui-lab/src/themeAugmentation/props.d.ts | 4 ---- .../src/Alert/Alert.d.ts | 4 ++-- .../src/Alert/Alert.js | 10 ++++++---- .../src/Alert/Alert.test.js | 2 +- .../src/Alert/index.d.ts | 0 .../src/Alert/index.js | 0 .../src/AlertTitle/AlertTitle.d.ts | 2 +- .../src/AlertTitle/AlertTitle.js | 4 ++-- .../src/AlertTitle/AlertTitle.test.js | 0 .../src/AlertTitle/index.d.ts | 0 .../src/AlertTitle/index.js | 0 packages/material-ui/src/index.d.ts | 6 ++++++ packages/material-ui/src/index.js | 6 ++++++ packages/material-ui/src/index.test.js | 2 +- .../src/internal/svg-icons/ErrorOutline.js | 2 +- .../src/internal/svg-icons/InfoOutlined.js | 2 +- .../src/internal/svg-icons/ReportProblemOutlined.js | 2 +- .../src/internal/svg-icons/SuccessOutlined.js | 2 +- 41 files changed, 54 insertions(+), 69 deletions(-) rename packages/{material-ui-lab => material-ui}/src/Alert/Alert.d.ts (97%) rename packages/{material-ui-lab => material-ui}/src/Alert/Alert.js (97%) rename packages/{material-ui-lab => material-ui}/src/Alert/Alert.test.js (90%) rename packages/{material-ui-lab => material-ui}/src/Alert/index.d.ts (100%) rename packages/{material-ui-lab => material-ui}/src/Alert/index.js (100%) rename packages/{material-ui-lab => material-ui}/src/AlertTitle/AlertTitle.d.ts (89%) rename packages/{material-ui-lab => material-ui}/src/AlertTitle/AlertTitle.js (92%) rename packages/{material-ui-lab => material-ui}/src/AlertTitle/AlertTitle.test.js (100%) rename packages/{material-ui-lab => material-ui}/src/AlertTitle/index.d.ts (100%) rename packages/{material-ui-lab => material-ui}/src/AlertTitle/index.js (100%) rename packages/{material-ui-lab => material-ui}/src/internal/svg-icons/ErrorOutline.js (84%) rename packages/{material-ui-lab => material-ui}/src/internal/svg-icons/InfoOutlined.js (85%) rename packages/{material-ui-lab => material-ui}/src/internal/svg-icons/ReportProblemOutlined.js (80%) rename packages/{material-ui-lab => material-ui}/src/internal/svg-icons/SuccessOutlined.js (86%) diff --git a/docs/pages/api-docs/alert-title.md b/docs/pages/api-docs/alert-title.md index 20c0a61d2461e0..a6ae550cdab655 100644 --- a/docs/pages/api-docs/alert-title.md +++ b/docs/pages/api-docs/alert-title.md @@ -1,5 +1,5 @@ --- -filename: /packages/material-ui-lab/src/AlertTitle/AlertTitle.js +filename: /packages/material-ui/src/AlertTitle/AlertTitle.js --- @@ -11,9 +11,9 @@ filename: /packages/material-ui-lab/src/AlertTitle/AlertTitle.js ## Import ```js -import AlertTitle from '@material-ui/lab/AlertTitle'; +import AlertTitle from '@material-ui/core/AlertTitle'; // or -import { AlertTitle } from '@material-ui/lab'; +import { AlertTitle } from '@material-ui/core'; ``` You can learn more about the difference by [reading this guide](/guides/minimizing-bundle-size/). @@ -47,7 +47,7 @@ You can override the style of the component thanks to one of these customization - With a [global class name](/customization/components/#overriding-styles-with-global-class-names). - With a theme and an [`overrides` property](/customization/globals/#css). -If that's not sufficient, you can check the [implementation of the component](https://github.com/mui-org/material-ui/blob/next/packages/material-ui-lab/src/AlertTitle/AlertTitle.js) for more detail. +If that's not sufficient, you can check the [implementation of the component](https://github.com/mui-org/material-ui/blob/next/packages/material-ui/src/AlertTitle/AlertTitle.js) for more detail. ## Demos diff --git a/docs/pages/api-docs/alert.md b/docs/pages/api-docs/alert.md index a53256cd28bb05..72000a25bf4295 100644 --- a/docs/pages/api-docs/alert.md +++ b/docs/pages/api-docs/alert.md @@ -1,5 +1,5 @@ --- -filename: /packages/material-ui-lab/src/Alert/Alert.js +filename: /packages/material-ui/src/Alert/Alert.js --- @@ -11,9 +11,9 @@ filename: /packages/material-ui-lab/src/Alert/Alert.js ## Import ```js -import Alert from '@material-ui/lab/Alert'; +import Alert from '@material-ui/core/Alert'; // or -import { Alert } from '@material-ui/lab'; +import { Alert } from '@material-ui/core'; ``` You can learn more about the difference by [reading this guide](/guides/minimizing-bundle-size/). @@ -74,7 +74,7 @@ You can override the style of the component thanks to one of these customization - With a [global class name](/customization/components/#overriding-styles-with-global-class-names). - With a theme and an [`overrides` property](/customization/globals/#css). -If that's not sufficient, you can check the [implementation of the component](https://github.com/mui-org/material-ui/blob/next/packages/material-ui-lab/src/Alert/Alert.js) for more detail. +If that's not sufficient, you can check the [implementation of the component](https://github.com/mui-org/material-ui/blob/next/packages/material-ui/src/Alert/Alert.js) for more detail. ## Inheritance diff --git a/docs/src/pages/components/alert/ActionAlerts.js b/docs/src/pages/components/alert/ActionAlerts.js index 3d7f5d56b860c5..0e38f5001e2843 100644 --- a/docs/src/pages/components/alert/ActionAlerts.js +++ b/docs/src/pages/components/alert/ActionAlerts.js @@ -1,6 +1,6 @@ import * as React from 'react'; import { makeStyles } from '@material-ui/core/styles'; -import Alert from '@material-ui/lab/Alert'; +import Alert from '@material-ui/core/Alert'; import Button from '@material-ui/core/Button'; const useStyles = makeStyles((theme) => ({ diff --git a/docs/src/pages/components/alert/ActionAlerts.tsx b/docs/src/pages/components/alert/ActionAlerts.tsx index bbe3c8079bd519..59087f33295375 100644 --- a/docs/src/pages/components/alert/ActionAlerts.tsx +++ b/docs/src/pages/components/alert/ActionAlerts.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { makeStyles, Theme, createStyles } from '@material-ui/core/styles'; -import Alert from '@material-ui/lab/Alert'; +import Alert from '@material-ui/core/Alert'; import Button from '@material-ui/core/Button'; const useStyles = makeStyles((theme: Theme) => diff --git a/docs/src/pages/components/alert/ColorAlerts.js b/docs/src/pages/components/alert/ColorAlerts.js index bd554e45e88f08..0e263792caaaa4 100644 --- a/docs/src/pages/components/alert/ColorAlerts.js +++ b/docs/src/pages/components/alert/ColorAlerts.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import Alert from '@material-ui/lab/Alert'; +import Alert from '@material-ui/core/Alert'; export default function ColorAlerts() { return ( diff --git a/docs/src/pages/components/alert/ColorAlerts.tsx b/docs/src/pages/components/alert/ColorAlerts.tsx index bd554e45e88f08..0e263792caaaa4 100644 --- a/docs/src/pages/components/alert/ColorAlerts.tsx +++ b/docs/src/pages/components/alert/ColorAlerts.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import Alert from '@material-ui/lab/Alert'; +import Alert from '@material-ui/core/Alert'; export default function ColorAlerts() { return ( diff --git a/docs/src/pages/components/alert/FilledAlerts.js b/docs/src/pages/components/alert/FilledAlerts.js index 3dc06e78b7eab0..a054a7845b7272 100644 --- a/docs/src/pages/components/alert/FilledAlerts.js +++ b/docs/src/pages/components/alert/FilledAlerts.js @@ -1,6 +1,6 @@ import * as React from 'react'; import { makeStyles } from '@material-ui/core/styles'; -import Alert from '@material-ui/lab/Alert'; +import Alert from '@material-ui/core/Alert'; const useStyles = makeStyles((theme) => ({ root: { diff --git a/docs/src/pages/components/alert/FilledAlerts.tsx b/docs/src/pages/components/alert/FilledAlerts.tsx index 30cd7ac85626f8..15c18bc558861a 100644 --- a/docs/src/pages/components/alert/FilledAlerts.tsx +++ b/docs/src/pages/components/alert/FilledAlerts.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { makeStyles, Theme, createStyles } from '@material-ui/core/styles'; -import Alert from '@material-ui/lab/Alert'; +import Alert from '@material-ui/core/Alert'; const useStyles = makeStyles((theme: Theme) => createStyles({ diff --git a/docs/src/pages/components/alert/IconAlerts.js b/docs/src/pages/components/alert/IconAlerts.js index 69267c447232dd..c123253a2f2a49 100644 --- a/docs/src/pages/components/alert/IconAlerts.js +++ b/docs/src/pages/components/alert/IconAlerts.js @@ -1,6 +1,6 @@ import * as React from 'react'; import { makeStyles } from '@material-ui/core/styles'; -import Alert from '@material-ui/lab/Alert'; +import Alert from '@material-ui/core/Alert'; import CheckIcon from '@material-ui/icons/Check'; import CheckCircleOutlineIcon from '@material-ui/icons/CheckCircleOutline'; diff --git a/docs/src/pages/components/alert/IconAlerts.tsx b/docs/src/pages/components/alert/IconAlerts.tsx index 8fc34f4ab4d18a..f8537a4d4b5114 100644 --- a/docs/src/pages/components/alert/IconAlerts.tsx +++ b/docs/src/pages/components/alert/IconAlerts.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { makeStyles, Theme, createStyles } from '@material-ui/core/styles'; -import Alert from '@material-ui/lab/Alert'; +import Alert from '@material-ui/core/Alert'; import CheckIcon from '@material-ui/icons/Check'; import CheckCircleOutlineIcon from '@material-ui/icons/CheckCircleOutline'; diff --git a/docs/src/pages/components/alert/OutlinedAlerts.js b/docs/src/pages/components/alert/OutlinedAlerts.js index 4a9ba659ac9ee4..9b5ca82dc0fb59 100644 --- a/docs/src/pages/components/alert/OutlinedAlerts.js +++ b/docs/src/pages/components/alert/OutlinedAlerts.js @@ -1,6 +1,6 @@ import * as React from 'react'; import { makeStyles } from '@material-ui/core/styles'; -import Alert from '@material-ui/lab/Alert'; +import Alert from '@material-ui/core/Alert'; const useStyles = makeStyles((theme) => ({ root: { diff --git a/docs/src/pages/components/alert/OutlinedAlerts.tsx b/docs/src/pages/components/alert/OutlinedAlerts.tsx index 279538ba321101..1293a44ef3ccc8 100644 --- a/docs/src/pages/components/alert/OutlinedAlerts.tsx +++ b/docs/src/pages/components/alert/OutlinedAlerts.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { makeStyles, Theme, createStyles } from '@material-ui/core/styles'; -import Alert from '@material-ui/lab/Alert'; +import Alert from '@material-ui/core/Alert'; const useStyles = makeStyles((theme: Theme) => createStyles({ diff --git a/docs/src/pages/components/alert/SimpleAlerts.js b/docs/src/pages/components/alert/SimpleAlerts.js index dea11b8b01d74b..5a07412ac09c53 100644 --- a/docs/src/pages/components/alert/SimpleAlerts.js +++ b/docs/src/pages/components/alert/SimpleAlerts.js @@ -1,6 +1,6 @@ import * as React from 'react'; import { makeStyles } from '@material-ui/core/styles'; -import Alert from '@material-ui/lab/Alert'; +import Alert from '@material-ui/core/Alert'; const useStyles = makeStyles((theme) => ({ root: { diff --git a/docs/src/pages/components/alert/SimpleAlerts.tsx b/docs/src/pages/components/alert/SimpleAlerts.tsx index b2aeb9ac666c51..b47510a7dbaed4 100644 --- a/docs/src/pages/components/alert/SimpleAlerts.tsx +++ b/docs/src/pages/components/alert/SimpleAlerts.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { makeStyles, Theme, createStyles } from '@material-ui/core/styles'; -import Alert from '@material-ui/lab/Alert'; +import Alert from '@material-ui/core/Alert'; const useStyles = makeStyles((theme: Theme) => createStyles({ diff --git a/docs/src/pages/components/alert/TransitionAlerts.js b/docs/src/pages/components/alert/TransitionAlerts.js index 6e5bac8f1e79ff..b71bc081a31a81 100644 --- a/docs/src/pages/components/alert/TransitionAlerts.js +++ b/docs/src/pages/components/alert/TransitionAlerts.js @@ -1,6 +1,6 @@ import * as React from 'react'; import { makeStyles } from '@material-ui/core/styles'; -import Alert from '@material-ui/lab/Alert'; +import Alert from '@material-ui/core/Alert'; import IconButton from '@material-ui/core/IconButton'; import Collapse from '@material-ui/core/Collapse'; import Button from '@material-ui/core/Button'; diff --git a/docs/src/pages/components/alert/TransitionAlerts.tsx b/docs/src/pages/components/alert/TransitionAlerts.tsx index 8c7032ddc386a4..d4056df314d12c 100644 --- a/docs/src/pages/components/alert/TransitionAlerts.tsx +++ b/docs/src/pages/components/alert/TransitionAlerts.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { makeStyles, Theme, createStyles } from '@material-ui/core/styles'; -import Alert from '@material-ui/lab/Alert'; +import Alert from '@material-ui/core/Alert'; import IconButton from '@material-ui/core/IconButton'; import Collapse from '@material-ui/core/Collapse'; import Button from '@material-ui/core/Button'; diff --git a/docs/src/pages/components/snackbars/CustomizedSnackbars.js b/docs/src/pages/components/snackbars/CustomizedSnackbars.js index 12b02846cd317c..f2032c00cc1d1a 100644 --- a/docs/src/pages/components/snackbars/CustomizedSnackbars.js +++ b/docs/src/pages/components/snackbars/CustomizedSnackbars.js @@ -1,7 +1,7 @@ import * as React from 'react'; import Button from '@material-ui/core/Button'; import Snackbar from '@material-ui/core/Snackbar'; -import MuiAlert from '@material-ui/lab/Alert'; +import MuiAlert from '@material-ui/core/Alert'; import { makeStyles } from '@material-ui/core/styles'; const Alert = React.forwardRef(function Alert(props, ref) { diff --git a/docs/src/pages/components/snackbars/CustomizedSnackbars.tsx b/docs/src/pages/components/snackbars/CustomizedSnackbars.tsx index b72652930c367d..6bdc53bdccb0f6 100644 --- a/docs/src/pages/components/snackbars/CustomizedSnackbars.tsx +++ b/docs/src/pages/components/snackbars/CustomizedSnackbars.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import Button from '@material-ui/core/Button'; import Snackbar from '@material-ui/core/Snackbar'; -import MuiAlert, { AlertProps } from '@material-ui/lab/Alert'; +import MuiAlert, { AlertProps } from '@material-ui/core/Alert'; import { makeStyles, Theme } from '@material-ui/core/styles'; const Alert = React.forwardRef(function Alert(props: AlertProps, ref) { diff --git a/packages/material-ui-lab/src/index.d.ts b/packages/material-ui-lab/src/index.d.ts index 25f8395255926e..304a09b93325d5 100644 --- a/packages/material-ui-lab/src/index.d.ts +++ b/packages/material-ui-lab/src/index.d.ts @@ -1,9 +1,3 @@ -export { default as Alert } from './Alert'; -export * from './Alert'; - -export { default as AlertTitle } from './AlertTitle'; -export * from './AlertTitle'; - export { default as Autocomplete } from './Autocomplete'; export * from './Autocomplete'; diff --git a/packages/material-ui-lab/src/index.js b/packages/material-ui-lab/src/index.js index 3038c1de672a3e..1b37028ed54b40 100644 --- a/packages/material-ui-lab/src/index.js +++ b/packages/material-ui-lab/src/index.js @@ -1,10 +1,4 @@ /* eslint-disable import/export */ -export { default as Alert } from './Alert'; -export * from './Alert'; - -export { default as AlertTitle } from './AlertTitle'; -export * from './AlertTitle'; - export { default as Autocomplete } from './Autocomplete'; export * from './Autocomplete'; diff --git a/packages/material-ui-lab/src/index.test.js b/packages/material-ui-lab/src/index.test.js index e6b1dfb9f9d9f8..2b364d08f0a9e6 100644 --- a/packages/material-ui-lab/src/index.test.js +++ b/packages/material-ui-lab/src/index.test.js @@ -12,7 +12,7 @@ describe('@material-ui/lab', () => { expect(typeof MaterialUI).to.equal('object'); }); - it('should not do undefined exports', () => { + it('should not have undefined exports', () => { Object.keys(MaterialUI).forEach((exportKey) => expect(Boolean(MaterialUI[exportKey])).to.equal(true), ); diff --git a/packages/material-ui-lab/src/themeAugmentation/components.d.ts b/packages/material-ui-lab/src/themeAugmentation/components.d.ts index 06f8a1cf446116..9e3e3bd7a7cbef 100644 --- a/packages/material-ui-lab/src/themeAugmentation/components.d.ts +++ b/packages/material-ui-lab/src/themeAugmentation/components.d.ts @@ -1,15 +1,6 @@ import { ComponentsProps, ComponentsOverrides, ComponentsVariants } from '@material-ui/core'; export interface LabComponents { - MuiAlert?: { - defaultProps?: ComponentsProps['MuiAlert']; - styleOverrides?: ComponentsOverrides['MuiAlert']; - variants?: ComponentsVariants['MuiAlert']; - }; - MuiAlertTitle?: { - defaultProps?: ComponentsProps['MuiAlertTitle']; - styleOverrides?: ComponentsOverrides['MuiAlertTitle']; - }; MuiAutocomplete?: { defaultProps?: ComponentsProps['MuiAutocomplete']; styleOverrides?: ComponentsOverrides['MuiAutocomplete']; diff --git a/packages/material-ui-lab/src/themeAugmentation/overrides.d.ts b/packages/material-ui-lab/src/themeAugmentation/overrides.d.ts index 12f996396185b6..01e87f683316cc 100644 --- a/packages/material-ui-lab/src/themeAugmentation/overrides.d.ts +++ b/packages/material-ui-lab/src/themeAugmentation/overrides.d.ts @@ -1,5 +1,3 @@ -import { AlertClassKey } from '../Alert'; -import { AlertTitleClassKey } from '../AlertTitle'; import { AutocompleteClassKey } from '../Autocomplete'; import { AvatarGroupClassKey } from '../AvatarGroup'; import { PaginationClassKey } from '../Pagination'; @@ -24,8 +22,6 @@ import { TreeItemClassKey } from '../TreeItem'; import { TreeViewClassKey } from '../TreeView'; export interface LabComponentNameToClassKey { - MuiAlert: AlertClassKey; - MuiAlertTitle: AlertTitleClassKey; MuiAutocomplete: AutocompleteClassKey; MuiAvatarGroup: AvatarGroupClassKey; MuiPagination: PaginationClassKey; diff --git a/packages/material-ui-lab/src/themeAugmentation/props.d.ts b/packages/material-ui-lab/src/themeAugmentation/props.d.ts index 0750efcde0ec44..c13dbfc17e1dcd 100644 --- a/packages/material-ui-lab/src/themeAugmentation/props.d.ts +++ b/packages/material-ui-lab/src/themeAugmentation/props.d.ts @@ -1,5 +1,3 @@ -import { AlertProps } from '../Alert'; -import { AlertTitleProps } from '../AlertTitle'; import { AutocompleteProps } from '../Autocomplete'; import { AvatarGroupProps } from '../AvatarGroup'; import { PaginationProps } from '../Pagination'; @@ -24,8 +22,6 @@ import { TreeItemProps } from '../TreeItem'; import { TreeViewProps } from '../TreeView'; export interface LabComponentsPropsList { - MuiAlert: AlertProps; - MuiAlertTitle: AlertTitleProps; MuiAutocomplete: AutocompleteProps; MuiAvatarGroup: AvatarGroupProps; MuiPagination: PaginationProps; diff --git a/packages/material-ui-lab/src/Alert/Alert.d.ts b/packages/material-ui/src/Alert/Alert.d.ts similarity index 97% rename from packages/material-ui-lab/src/Alert/Alert.d.ts rename to packages/material-ui/src/Alert/Alert.d.ts index 5f6a7a22fa1bb5..e13764ef9dd5fe 100644 --- a/packages/material-ui-lab/src/Alert/Alert.d.ts +++ b/packages/material-ui/src/Alert/Alert.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { OverridableStringUnion } from '@material-ui/types'; -import { InternalStandardProps as StandardProps } from '@material-ui/core'; -import { PaperProps } from '@material-ui/core/Paper'; +import { InternalStandardProps as StandardProps } from '..'; +import { PaperProps } from '../Paper'; export type Color = 'success' | 'info' | 'warning' | 'error'; diff --git a/packages/material-ui-lab/src/Alert/Alert.js b/packages/material-ui/src/Alert/Alert.js similarity index 97% rename from packages/material-ui-lab/src/Alert/Alert.js rename to packages/material-ui/src/Alert/Alert.js index 0708b331dd6d91..0eca98c4075665 100644 --- a/packages/material-ui-lab/src/Alert/Alert.js +++ b/packages/material-ui/src/Alert/Alert.js @@ -1,10 +1,12 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; -import { withStyles, lighten, darken, useThemeVariants } from '@material-ui/core/styles'; -import Paper from '@material-ui/core/Paper'; -import IconButton from '@material-ui/core/IconButton'; -import { capitalize } from '@material-ui/core/utils'; +import { useThemeVariants } from '@material-ui/styles'; +import withStyles from '../styles/withStyles'; +import { darken, lighten } from '../styles/colorManipulator'; +import capitalize from '../utils/capitalize'; +import Paper from '../Paper'; +import IconButton from '../IconButton'; import SuccessOutlinedIcon from '../internal/svg-icons/SuccessOutlined'; import ReportProblemOutlinedIcon from '../internal/svg-icons/ReportProblemOutlined'; import ErrorOutlineIcon from '../internal/svg-icons/ErrorOutline'; diff --git a/packages/material-ui-lab/src/Alert/Alert.test.js b/packages/material-ui/src/Alert/Alert.test.js similarity index 90% rename from packages/material-ui-lab/src/Alert/Alert.test.js rename to packages/material-ui/src/Alert/Alert.test.js index d35e44cd931fbf..635ea6c1612023 100644 --- a/packages/material-ui-lab/src/Alert/Alert.test.js +++ b/packages/material-ui/src/Alert/Alert.test.js @@ -1,6 +1,6 @@ import * as React from 'react'; import { getClasses, createMount, describeConformance } from 'test/utils'; -import Paper from '@material-ui/core/Paper'; +import Paper from '../Paper'; import Alert from './Alert'; describe('', () => { diff --git a/packages/material-ui-lab/src/Alert/index.d.ts b/packages/material-ui/src/Alert/index.d.ts similarity index 100% rename from packages/material-ui-lab/src/Alert/index.d.ts rename to packages/material-ui/src/Alert/index.d.ts diff --git a/packages/material-ui-lab/src/Alert/index.js b/packages/material-ui/src/Alert/index.js similarity index 100% rename from packages/material-ui-lab/src/Alert/index.js rename to packages/material-ui/src/Alert/index.js diff --git a/packages/material-ui-lab/src/AlertTitle/AlertTitle.d.ts b/packages/material-ui/src/AlertTitle/AlertTitle.d.ts similarity index 89% rename from packages/material-ui-lab/src/AlertTitle/AlertTitle.d.ts rename to packages/material-ui/src/AlertTitle/AlertTitle.d.ts index 320cdf3458435f..5e455ee03ee7d5 100644 --- a/packages/material-ui-lab/src/AlertTitle/AlertTitle.d.ts +++ b/packages/material-ui/src/AlertTitle/AlertTitle.d.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import { InternalStandardProps as StandardProps } from '@material-ui/core'; +import { InternalStandardProps as StandardProps } from '..'; export interface AlertTitleProps extends StandardProps> { /** diff --git a/packages/material-ui-lab/src/AlertTitle/AlertTitle.js b/packages/material-ui/src/AlertTitle/AlertTitle.js similarity index 92% rename from packages/material-ui-lab/src/AlertTitle/AlertTitle.js rename to packages/material-ui/src/AlertTitle/AlertTitle.js index 2a03595e3c53f9..659ac9404b6bd5 100644 --- a/packages/material-ui-lab/src/AlertTitle/AlertTitle.js +++ b/packages/material-ui/src/AlertTitle/AlertTitle.js @@ -1,8 +1,8 @@ import * as React from 'react'; import PropTypes from 'prop-types'; -import { withStyles } from '@material-ui/core/styles'; -import { Typography } from '@material-ui/core'; import clsx from 'clsx'; +import withStyles from '../styles/withStyles'; +import Typography from '../Typography'; export const styles = (theme) => ({ /* Styles applied to the root element. */ diff --git a/packages/material-ui-lab/src/AlertTitle/AlertTitle.test.js b/packages/material-ui/src/AlertTitle/AlertTitle.test.js similarity index 100% rename from packages/material-ui-lab/src/AlertTitle/AlertTitle.test.js rename to packages/material-ui/src/AlertTitle/AlertTitle.test.js diff --git a/packages/material-ui-lab/src/AlertTitle/index.d.ts b/packages/material-ui/src/AlertTitle/index.d.ts similarity index 100% rename from packages/material-ui-lab/src/AlertTitle/index.d.ts rename to packages/material-ui/src/AlertTitle/index.d.ts diff --git a/packages/material-ui-lab/src/AlertTitle/index.js b/packages/material-ui/src/AlertTitle/index.js similarity index 100% rename from packages/material-ui-lab/src/AlertTitle/index.js rename to packages/material-ui/src/AlertTitle/index.js diff --git a/packages/material-ui/src/index.d.ts b/packages/material-ui/src/index.d.ts index e099b26876a12a..35108fbe2391f8 100644 --- a/packages/material-ui/src/index.d.ts +++ b/packages/material-ui/src/index.d.ts @@ -92,6 +92,12 @@ export * from './AccordionDetails'; export { default as AccordionSummary } from './AccordionSummary'; export * from './AccordionSummary'; +export { default as Alert } from './Alert'; +export * from './Alert'; + +export { default as AlertTitle } from './AlertTitle'; +export * from './AlertTitle'; + export { default as AppBar } from './AppBar'; export * from './AppBar'; diff --git a/packages/material-ui/src/index.js b/packages/material-ui/src/index.js index 6440c4c8fead9a..0cb8381dc7924c 100644 --- a/packages/material-ui/src/index.js +++ b/packages/material-ui/src/index.js @@ -18,6 +18,12 @@ export * from './AccordionDetails'; export { default as AccordionSummary } from './AccordionSummary'; export * from './AccordionSummary'; +export { default as Alert } from './Alert'; +export * from './Alert'; + +export { default as AlertTitle } from './AlertTitle'; +export * from './AlertTitle'; + export { default as AppBar } from './AppBar'; export * from './AppBar'; diff --git a/packages/material-ui/src/index.test.js b/packages/material-ui/src/index.test.js index 8ec96e142e14bd..5205d82131619f 100644 --- a/packages/material-ui/src/index.test.js +++ b/packages/material-ui/src/index.test.js @@ -12,7 +12,7 @@ describe('material-ui', () => { expect(typeof MaterialUI).to.equal('object'); }); - it('should not do undefined exports', () => { + it('should not have undefined exports', () => { Object.keys(MaterialUI).forEach((exportKey) => expect(Boolean(MaterialUI[exportKey])).to.equal(true), ); diff --git a/packages/material-ui-lab/src/internal/svg-icons/ErrorOutline.js b/packages/material-ui/src/internal/svg-icons/ErrorOutline.js similarity index 84% rename from packages/material-ui-lab/src/internal/svg-icons/ErrorOutline.js rename to packages/material-ui/src/internal/svg-icons/ErrorOutline.js index b582fdc0787059..12ba853dbadf57 100644 --- a/packages/material-ui-lab/src/internal/svg-icons/ErrorOutline.js +++ b/packages/material-ui/src/internal/svg-icons/ErrorOutline.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import { createSvgIcon } from '@material-ui/core/utils'; +import createSvgIcon from '../../utils/createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui-lab/src/internal/svg-icons/InfoOutlined.js b/packages/material-ui/src/internal/svg-icons/InfoOutlined.js similarity index 85% rename from packages/material-ui-lab/src/internal/svg-icons/InfoOutlined.js rename to packages/material-ui/src/internal/svg-icons/InfoOutlined.js index 0c3ed4e8e19cc8..d2f3643c5d4baf 100644 --- a/packages/material-ui-lab/src/internal/svg-icons/InfoOutlined.js +++ b/packages/material-ui/src/internal/svg-icons/InfoOutlined.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import { createSvgIcon } from '@material-ui/core/utils'; +import createSvgIcon from '../../utils/createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui-lab/src/internal/svg-icons/ReportProblemOutlined.js b/packages/material-ui/src/internal/svg-icons/ReportProblemOutlined.js similarity index 80% rename from packages/material-ui-lab/src/internal/svg-icons/ReportProblemOutlined.js rename to packages/material-ui/src/internal/svg-icons/ReportProblemOutlined.js index 11b860048db4bd..64cdca28dc88b0 100644 --- a/packages/material-ui-lab/src/internal/svg-icons/ReportProblemOutlined.js +++ b/packages/material-ui/src/internal/svg-icons/ReportProblemOutlined.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import { createSvgIcon } from '@material-ui/core/utils'; +import createSvgIcon from '../../utils/createSvgIcon'; /** * @ignore - internal component. diff --git a/packages/material-ui-lab/src/internal/svg-icons/SuccessOutlined.js b/packages/material-ui/src/internal/svg-icons/SuccessOutlined.js similarity index 86% rename from packages/material-ui-lab/src/internal/svg-icons/SuccessOutlined.js rename to packages/material-ui/src/internal/svg-icons/SuccessOutlined.js index bac970504d94a3..cd2a12cc9a7db8 100644 --- a/packages/material-ui-lab/src/internal/svg-icons/SuccessOutlined.js +++ b/packages/material-ui/src/internal/svg-icons/SuccessOutlined.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import { createSvgIcon } from '@material-ui/core/utils'; +import createSvgIcon from '../../utils/createSvgIcon'; /** * @ignore - internal component. From 2b39a90fb356ec9b156238249a201189fb421c19 Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 19 Sep 2020 21:34:14 +0100 Subject: [PATCH 02/18] fix docs demo import --- docs/src/pages/components/alert/DescriptionAlerts.js | 3 ++- docs/src/pages/components/alert/DescriptionAlerts.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/src/pages/components/alert/DescriptionAlerts.js b/docs/src/pages/components/alert/DescriptionAlerts.js index b67a3849943292..a23d313441de1b 100644 --- a/docs/src/pages/components/alert/DescriptionAlerts.js +++ b/docs/src/pages/components/alert/DescriptionAlerts.js @@ -1,6 +1,7 @@ import * as React from 'react'; import { makeStyles } from '@material-ui/core/styles'; -import { Alert, AlertTitle } from '@material-ui/lab'; +import Alert from '@material-ui/core/Alert'; +import AlertTitle from '@material-ui/core/AlertTitle'; const useStyles = makeStyles((theme) => ({ root: { diff --git a/docs/src/pages/components/alert/DescriptionAlerts.tsx b/docs/src/pages/components/alert/DescriptionAlerts.tsx index 24e81081d52a68..988624cb7812c4 100644 --- a/docs/src/pages/components/alert/DescriptionAlerts.tsx +++ b/docs/src/pages/components/alert/DescriptionAlerts.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; import { makeStyles, Theme, createStyles } from '@material-ui/core/styles'; -import { Alert, AlertTitle } from '@material-ui/lab'; +import Alert from '@material-ui/core/Alert'; +import AlertTitle from '@material-ui/core/AlertTitle'; const useStyles = makeStyles((theme: Theme) => createStyles({ From c1f78a6488aa198ad3a75e33573c17ffd6580bb4 Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 19 Sep 2020 21:38:18 +0100 Subject: [PATCH 03/18] move nav link --- docs/src/pages.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/pages.js b/docs/src/pages.js index 56bf47e7242d93..6481ce74f825f4 100644 --- a/docs/src/pages.js +++ b/docs/src/pages.js @@ -73,6 +73,7 @@ const pages = [ pathname: '/components', subheader: '/components/feedback', children: [ + { pathname: '/components/alert' }, { pathname: '/components/backdrop' }, { pathname: '/components/dialogs' }, { pathname: '/components/progress' }, @@ -116,7 +117,6 @@ const pages = [ subheader: '/components/lab', children: [ { pathname: '/components/about-the-lab' }, - { pathname: '/components/alert' }, { pathname: '/components/autocomplete' }, { pathname: '/components/pagination' }, { pathname: '/components/rating' }, From 5fc4c1496d007fe6bb530ff8073aaa05163a84cf Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 20 Sep 2020 21:26:38 +0100 Subject: [PATCH 04/18] re-export core from lab I've forgotten what goes into an empty type definition file... --- packages/material-ui-lab/src/Alert/Alert.d.ts | 0 packages/material-ui-lab/src/Alert/Alert.js | 14 ++++++++++++++ packages/material-ui-lab/src/Alert/index.d.ts | 2 ++ packages/material-ui-lab/src/Alert/index.js | 1 + .../src/AlertTitle/AlertTitle.d.ts | 0 .../material-ui-lab/src/AlertTitle/AlertTitle.js | 15 +++++++++++++++ .../material-ui-lab/src/AlertTitle/index.d.ts | 2 ++ packages/material-ui-lab/src/AlertTitle/index.js | 1 + packages/material-ui-lab/src/index.js | 6 ++++++ 9 files changed, 41 insertions(+) create mode 100644 packages/material-ui-lab/src/Alert/Alert.d.ts create mode 100644 packages/material-ui-lab/src/Alert/Alert.js create mode 100644 packages/material-ui-lab/src/Alert/index.d.ts create mode 100644 packages/material-ui-lab/src/Alert/index.js create mode 100644 packages/material-ui-lab/src/AlertTitle/AlertTitle.d.ts create mode 100644 packages/material-ui-lab/src/AlertTitle/AlertTitle.js create mode 100644 packages/material-ui-lab/src/AlertTitle/index.d.ts create mode 100644 packages/material-ui-lab/src/AlertTitle/index.js diff --git a/packages/material-ui-lab/src/Alert/Alert.d.ts b/packages/material-ui-lab/src/Alert/Alert.d.ts new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/packages/material-ui-lab/src/Alert/Alert.js b/packages/material-ui-lab/src/Alert/Alert.js new file mode 100644 index 00000000000000..4193a18e1aabce --- /dev/null +++ b/packages/material-ui-lab/src/Alert/Alert.js @@ -0,0 +1,14 @@ +import Alert from '@material-ui/core/Alert'; + +// To remove in v5 +let warnOnce = false; +if (!warnOnce) { + console.warn( + [ + 'Material-UI: Alert from @material-ui/lab is deprecated.', + 'Please use @material-ui/core/Alert', + ].join('\n'), + ); + warnOnce = true; +} +export default Alert; diff --git a/packages/material-ui-lab/src/Alert/index.d.ts b/packages/material-ui-lab/src/Alert/index.d.ts new file mode 100644 index 00000000000000..f8bf7e6b67860c --- /dev/null +++ b/packages/material-ui-lab/src/Alert/index.d.ts @@ -0,0 +1,2 @@ +export { default } from './Alert'; +export * from './Alert'; diff --git a/packages/material-ui-lab/src/Alert/index.js b/packages/material-ui-lab/src/Alert/index.js new file mode 100644 index 00000000000000..becaea750b71e9 --- /dev/null +++ b/packages/material-ui-lab/src/Alert/index.js @@ -0,0 +1 @@ +export { default } from './Alert'; diff --git a/packages/material-ui-lab/src/AlertTitle/AlertTitle.d.ts b/packages/material-ui-lab/src/AlertTitle/AlertTitle.d.ts new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/packages/material-ui-lab/src/AlertTitle/AlertTitle.js b/packages/material-ui-lab/src/AlertTitle/AlertTitle.js new file mode 100644 index 00000000000000..eb47d5f596e454 --- /dev/null +++ b/packages/material-ui-lab/src/AlertTitle/AlertTitle.js @@ -0,0 +1,15 @@ +import AlertTitle from '@material-ui/core/AlertTitle'; + +// To remove in v5 +let warnOnce = false; +if (!warnOnce) { + console.warn( + [ + 'Material-UI: AlertTitle from @material-ui/lab is deprecated.', + 'Please use @material-ui/core/AlertTitle', + ].join('\n'), + ); + warnOnce = true; +}; + +export default AlertTitle; diff --git a/packages/material-ui-lab/src/AlertTitle/index.d.ts b/packages/material-ui-lab/src/AlertTitle/index.d.ts new file mode 100644 index 00000000000000..92625eccbf49a6 --- /dev/null +++ b/packages/material-ui-lab/src/AlertTitle/index.d.ts @@ -0,0 +1,2 @@ +export { default } from './AlertTitle'; +export * from './AlertTitle'; diff --git a/packages/material-ui-lab/src/AlertTitle/index.js b/packages/material-ui-lab/src/AlertTitle/index.js new file mode 100644 index 00000000000000..5277f016a42856 --- /dev/null +++ b/packages/material-ui-lab/src/AlertTitle/index.js @@ -0,0 +1 @@ +export { default } from './AlertTitle'; diff --git a/packages/material-ui-lab/src/index.js b/packages/material-ui-lab/src/index.js index 1b37028ed54b40..3038c1de672a3e 100644 --- a/packages/material-ui-lab/src/index.js +++ b/packages/material-ui-lab/src/index.js @@ -1,4 +1,10 @@ /* eslint-disable import/export */ +export { default as Alert } from './Alert'; +export * from './Alert'; + +export { default as AlertTitle } from './AlertTitle'; +export * from './AlertTitle'; + export { default as Autocomplete } from './Autocomplete'; export * from './Autocomplete'; From f293a76a7a924eb49a1bbc29065fa8624b1cbb7f Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 20 Sep 2020 21:58:40 +0100 Subject: [PATCH 05/18] rename simple demo to basic --- .../pages/components/alert/{SimpleAlerts.js => BasicAlerts.js} | 2 +- .../components/alert/{SimpleAlerts.tsx => BasicAlerts.tsx} | 2 +- docs/src/pages/components/alert/FilledAlerts.js | 2 +- docs/src/pages/components/alert/FilledAlerts.tsx | 2 +- docs/src/pages/components/alert/OutlinedAlerts.js | 2 +- docs/src/pages/components/alert/OutlinedAlerts.tsx | 2 +- docs/src/pages/components/alert/alert-de.md | 2 +- docs/src/pages/components/alert/alert-es.md | 2 +- docs/src/pages/components/alert/alert-fr.md | 2 +- docs/src/pages/components/alert/alert-ja.md | 2 +- docs/src/pages/components/alert/alert-pt.md | 2 +- docs/src/pages/components/alert/alert-ru.md | 2 +- docs/src/pages/components/alert/alert-zh.md | 2 +- docs/src/pages/components/alert/alert.md | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) rename docs/src/pages/components/alert/{SimpleAlerts.js => BasicAlerts.js} (94%) rename docs/src/pages/components/alert/{SimpleAlerts.tsx => BasicAlerts.tsx} (94%) diff --git a/docs/src/pages/components/alert/SimpleAlerts.js b/docs/src/pages/components/alert/BasicAlerts.js similarity index 94% rename from docs/src/pages/components/alert/SimpleAlerts.js rename to docs/src/pages/components/alert/BasicAlerts.js index 5a07412ac09c53..8a4eea30d4c296 100644 --- a/docs/src/pages/components/alert/SimpleAlerts.js +++ b/docs/src/pages/components/alert/BasicAlerts.js @@ -11,7 +11,7 @@ const useStyles = makeStyles((theme) => ({ }, })); -export default function SimpleAlerts() { +export default function BasicAlerts() { const classes = useStyles(); return ( diff --git a/docs/src/pages/components/alert/SimpleAlerts.tsx b/docs/src/pages/components/alert/BasicAlerts.tsx similarity index 94% rename from docs/src/pages/components/alert/SimpleAlerts.tsx rename to docs/src/pages/components/alert/BasicAlerts.tsx index b47510a7dbaed4..b0525db44cf9ea 100644 --- a/docs/src/pages/components/alert/SimpleAlerts.tsx +++ b/docs/src/pages/components/alert/BasicAlerts.tsx @@ -13,7 +13,7 @@ const useStyles = makeStyles((theme: Theme) => }), ); -export default function SimpleAlerts() { +export default function BasicAlerts() { const classes = useStyles(); return ( diff --git a/docs/src/pages/components/alert/FilledAlerts.js b/docs/src/pages/components/alert/FilledAlerts.js index a054a7845b7272..e38a32d19c2d45 100644 --- a/docs/src/pages/components/alert/FilledAlerts.js +++ b/docs/src/pages/components/alert/FilledAlerts.js @@ -11,7 +11,7 @@ const useStyles = makeStyles((theme) => ({ }, })); -export default function SimpleAlerts() { +export default function BasicAlerts() { const classes = useStyles(); return ( diff --git a/docs/src/pages/components/alert/FilledAlerts.tsx b/docs/src/pages/components/alert/FilledAlerts.tsx index 15c18bc558861a..90df449f7ba089 100644 --- a/docs/src/pages/components/alert/FilledAlerts.tsx +++ b/docs/src/pages/components/alert/FilledAlerts.tsx @@ -13,7 +13,7 @@ const useStyles = makeStyles((theme: Theme) => }), ); -export default function SimpleAlerts() { +export default function BasicAlerts() { const classes = useStyles(); return ( diff --git a/docs/src/pages/components/alert/OutlinedAlerts.js b/docs/src/pages/components/alert/OutlinedAlerts.js index 9b5ca82dc0fb59..df2e151730ab50 100644 --- a/docs/src/pages/components/alert/OutlinedAlerts.js +++ b/docs/src/pages/components/alert/OutlinedAlerts.js @@ -11,7 +11,7 @@ const useStyles = makeStyles((theme) => ({ }, })); -export default function SimpleAlerts() { +export default function BasicAlerts() { const classes = useStyles(); return ( diff --git a/docs/src/pages/components/alert/OutlinedAlerts.tsx b/docs/src/pages/components/alert/OutlinedAlerts.tsx index 1293a44ef3ccc8..df1b441a0c9bc7 100644 --- a/docs/src/pages/components/alert/OutlinedAlerts.tsx +++ b/docs/src/pages/components/alert/OutlinedAlerts.tsx @@ -13,7 +13,7 @@ const useStyles = makeStyles((theme: Theme) => }), ); -export default function SimpleAlerts() { +export default function BasicAlerts() { const classes = useStyles(); return ( diff --git a/docs/src/pages/components/alert/alert-de.md b/docs/src/pages/components/alert/alert-de.md index 15319d2452a6fa..12caf0c8587dc6 100644 --- a/docs/src/pages/components/alert/alert-de.md +++ b/docs/src/pages/components/alert/alert-de.md @@ -19,7 +19,7 @@ waiAria: 'https://www.w3.org/TR/wai-aria-practices/#alert' Der Hinweis bietet vier Schweregrade an, welche je ein eigenes Icon und eine eigene Farbe besitzen. -{{"demo": "pages/components/alert/SimpleAlerts.js"}} +{{"demo": "pages/components/alert/BasicAlerts.js"}} ## Beschreibung diff --git a/docs/src/pages/components/alert/alert-es.md b/docs/src/pages/components/alert/alert-es.md index f8a00ee7dce94c..baa5166435515c 100644 --- a/docs/src/pages/components/alert/alert-es.md +++ b/docs/src/pages/components/alert/alert-es.md @@ -19,7 +19,7 @@ waiAria: 'https://www.w3.org/TR/wai-aria-practices/#alert' La alerta ofrece cuatro niveles de severidad que distintivamente establecen un icono y un color. -{{"demo": "pages/components/alert/SimpleAlerts.js"}} +{{"demo": "pages/components/alert/BasicAlerts.js"}} ## Descripción diff --git a/docs/src/pages/components/alert/alert-fr.md b/docs/src/pages/components/alert/alert-fr.md index 91791a4aa2954f..95edba60ce0fae 100644 --- a/docs/src/pages/components/alert/alert-fr.md +++ b/docs/src/pages/components/alert/alert-fr.md @@ -19,7 +19,7 @@ waiAria: 'https://www.w3.org/TR/wai-aria-practices/#alert' L'alerte offre quatre niveaux de sévérité qui définissent une icône et une couleur distinctes. -{{"demo": "pages/components/alert/SimpleAlerts.js"}} +{{"demo": "pages/components/alert/BasicAlerts.js"}} ## Description diff --git a/docs/src/pages/components/alert/alert-ja.md b/docs/src/pages/components/alert/alert-ja.md index 0dd61249a944af..7c6b44c72e338e 100644 --- a/docs/src/pages/components/alert/alert-ja.md +++ b/docs/src/pages/components/alert/alert-ja.md @@ -19,7 +19,7 @@ waiAria: 'https://www.w3.org/TR/wai-aria-practices/#alert' このアラートは、特徴的なアイコンと色を設定する4つの重要度レベルを提供します。 -{{"demo": "pages/components/alert/SimpleAlerts.js"}} +{{"demo": "pages/components/alert/BasicAlerts.js"}} ## Description diff --git a/docs/src/pages/components/alert/alert-pt.md b/docs/src/pages/components/alert/alert-pt.md index 4fef0f37eb9c27..a5a605c01902f6 100644 --- a/docs/src/pages/components/alert/alert-pt.md +++ b/docs/src/pages/components/alert/alert-pt.md @@ -19,7 +19,7 @@ waiAria: 'https://www.w3.org/TR/wai-aria-practices/#alert' O alerta oferece quatro níveis de severidade que se distinguem em diferentes ícones e cores. -{{"demo": "pages/components/alert/SimpleAlerts.js"}} +{{"demo": "pages/components/alert/BasicAlerts.js"}} ## Descrição diff --git a/docs/src/pages/components/alert/alert-ru.md b/docs/src/pages/components/alert/alert-ru.md index c98d06fb78d28f..b0a97368681bbf 100644 --- a/docs/src/pages/components/alert/alert-ru.md +++ b/docs/src/pages/components/alert/alert-ru.md @@ -19,7 +19,7 @@ waiAria: 'https://www.w3.org/TR/wai-aria-practices/#alert' Alert предлагает 4 уровня предупреждения с уникальным цветом и значком. -{{"demo": "pages/components/alert/SimpleAlerts.js"}} +{{"demo": "pages/components/alert/BasicAlerts.js"}} ## Описание diff --git a/docs/src/pages/components/alert/alert-zh.md b/docs/src/pages/components/alert/alert-zh.md index 3d5ca02563e2d4..b515c83c165627 100644 --- a/docs/src/pages/components/alert/alert-zh.md +++ b/docs/src/pages/components/alert/alert-zh.md @@ -19,7 +19,7 @@ waiAria: 'https://www.w3.org/TR/wai-aria-practices/#alert' 警告提示有四种不同程度的级别,每种都有自己独特的颜色和图标。 -{{"demo": "pages/components/alert/SimpleAlerts.js"}} +{{"demo": "pages/components/alert/BasicAlerts.js"}} ## 描述 diff --git a/docs/src/pages/components/alert/alert.md b/docs/src/pages/components/alert/alert.md index 593dcdf08aa700..ebbdc56d9a081c 100644 --- a/docs/src/pages/components/alert/alert.md +++ b/docs/src/pages/components/alert/alert.md @@ -18,7 +18,7 @@ waiAria: https://www.w3.org/TR/wai-aria-practices/#alert The alert offers four severity levels that set a distinctive icon and color. -{{"demo": "pages/components/alert/SimpleAlerts.js"}} +{{"demo": "pages/components/alert/BasicAlerts.js"}} ## Description From a1ad646f2d9bc5319829f64f8ef8230b4673e840 Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 20 Sep 2020 22:01:48 +0100 Subject: [PATCH 06/18] prettier --- packages/material-ui-lab/src/AlertTitle/AlertTitle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/material-ui-lab/src/AlertTitle/AlertTitle.js b/packages/material-ui-lab/src/AlertTitle/AlertTitle.js index eb47d5f596e454..0b7b9b1c01326f 100644 --- a/packages/material-ui-lab/src/AlertTitle/AlertTitle.js +++ b/packages/material-ui-lab/src/AlertTitle/AlertTitle.js @@ -10,6 +10,6 @@ if (!warnOnce) { ].join('\n'), ); warnOnce = true; -}; +} export default AlertTitle; From d2f1f7dea416900b63cca9434b8659b59138694d Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 20 Sep 2020 22:14:52 +0100 Subject: [PATCH 07/18] Fix .d.ts warnings? --- packages/material-ui-lab/src/Alert/Alert.d.ts | 1 + packages/material-ui-lab/src/AlertTitle/AlertTitle.d.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/material-ui-lab/src/Alert/Alert.d.ts b/packages/material-ui-lab/src/Alert/Alert.d.ts index e69de29bb2d1d6..6649f9effef497 100644 --- a/packages/material-ui-lab/src/Alert/Alert.d.ts +++ b/packages/material-ui-lab/src/Alert/Alert.d.ts @@ -0,0 +1 @@ +export function Alert(): void; diff --git a/packages/material-ui-lab/src/AlertTitle/AlertTitle.d.ts b/packages/material-ui-lab/src/AlertTitle/AlertTitle.d.ts index e69de29bb2d1d6..cc18646d4d72d6 100644 --- a/packages/material-ui-lab/src/AlertTitle/AlertTitle.d.ts +++ b/packages/material-ui-lab/src/AlertTitle/AlertTitle.d.ts @@ -0,0 +1 @@ +export function AlertTitle(): void; From 99b8ddb17b359446cb04609169f9ff09cafe6c91 Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 20 Sep 2020 23:23:34 +0100 Subject: [PATCH 08/18] Fix up exports --- packages/material-ui-lab/src/Alert/Alert.d.ts | 3 ++- packages/material-ui-lab/src/Alert/Alert.js | 23 +++++++++++-------- .../src/AlertTitle/AlertTitle.d.ts | 3 ++- .../src/AlertTitle/AlertTitle.js | 22 ++++++++++-------- 4 files changed, 31 insertions(+), 20 deletions(-) diff --git a/packages/material-ui-lab/src/Alert/Alert.d.ts b/packages/material-ui-lab/src/Alert/Alert.d.ts index 6649f9effef497..e761cb5c2ac815 100644 --- a/packages/material-ui-lab/src/Alert/Alert.d.ts +++ b/packages/material-ui-lab/src/Alert/Alert.d.ts @@ -1 +1,2 @@ -export function Alert(): void; +import Alert from '@material-ui/core/Alert'; +export default Alert; diff --git a/packages/material-ui-lab/src/Alert/Alert.js b/packages/material-ui-lab/src/Alert/Alert.js index 4193a18e1aabce..a7932027c84d8f 100644 --- a/packages/material-ui-lab/src/Alert/Alert.js +++ b/packages/material-ui-lab/src/Alert/Alert.js @@ -1,14 +1,19 @@ +import React from 'react'; +import warning from 'warning'; import Alert from '@material-ui/core/Alert'; -// To remove in v5 -let warnOnce = false; -if (!warnOnce) { - console.warn( +export default React.forwardRef(function DeprecatedAlert(props, ref) { + warning( + false, [ - 'Material-UI: Alert from @material-ui/lab is deprecated.', - 'Please use @material-ui/core/Alert', + 'Material-UI: the Alert component was moved from the lab to the core.', + '', + 'Yay, the component is stable! 🎉', + '', + "You should use `import { Alert } from '@material-ui/core'`", + "or `import Alert from '@material-ui/core/Alert'`", ].join('\n'), ); - warnOnce = true; -} -export default Alert; + + return ; +}); diff --git a/packages/material-ui-lab/src/AlertTitle/AlertTitle.d.ts b/packages/material-ui-lab/src/AlertTitle/AlertTitle.d.ts index cc18646d4d72d6..e636fcee3cdfd2 100644 --- a/packages/material-ui-lab/src/AlertTitle/AlertTitle.d.ts +++ b/packages/material-ui-lab/src/AlertTitle/AlertTitle.d.ts @@ -1 +1,2 @@ -export function AlertTitle(): void; +import AlertTitle from '@material-ui/core/AlertTitle'; +export default AlertTitle; diff --git a/packages/material-ui-lab/src/AlertTitle/AlertTitle.js b/packages/material-ui-lab/src/AlertTitle/AlertTitle.js index 0b7b9b1c01326f..ae7e68b0bbf6f9 100644 --- a/packages/material-ui-lab/src/AlertTitle/AlertTitle.js +++ b/packages/material-ui-lab/src/AlertTitle/AlertTitle.js @@ -1,15 +1,19 @@ +import React from 'react'; +import warning from 'warning'; import AlertTitle from '@material-ui/core/AlertTitle'; -// To remove in v5 -let warnOnce = false; -if (!warnOnce) { - console.warn( +export default React.forwardRef(function DeprecatedAlertTitle(props, ref) { + warning( + false, [ - 'Material-UI: AlertTitle from @material-ui/lab is deprecated.', - 'Please use @material-ui/core/AlertTitle', + 'Material-UI: the AlertTitle component was moved from the lab to the core.', + '', + 'Yay, the component is stable! 🎉', + '', + "You should use `import { AlertTitle } from '@material-ui/core'`", + "or `import AlertTitle from '@material-ui/core/AlertTitle'`", ].join('\n'), ); - warnOnce = true; -} -export default AlertTitle; + return ; +}); From 7c45334c88b6d9c6fa8bee7ac51771865f04272b Mon Sep 17 00:00:00 2001 From: Matt Date: Mon, 21 Sep 2020 00:46:58 +0100 Subject: [PATCH 09/18] most devs are older than 5 --- packages/material-ui-lab/src/Alert/Alert.js | 2 -- packages/material-ui-lab/src/Alert/Alert.test.js | 0 packages/material-ui-lab/src/AlertTitle/AlertTitle.js | 2 -- packages/material-ui-lab/src/AlertTitle/AlertTitle.test.js | 0 4 files changed, 4 deletions(-) create mode 100644 packages/material-ui-lab/src/Alert/Alert.test.js create mode 100644 packages/material-ui-lab/src/AlertTitle/AlertTitle.test.js diff --git a/packages/material-ui-lab/src/Alert/Alert.js b/packages/material-ui-lab/src/Alert/Alert.js index a7932027c84d8f..d4de97f106a44a 100644 --- a/packages/material-ui-lab/src/Alert/Alert.js +++ b/packages/material-ui-lab/src/Alert/Alert.js @@ -8,8 +8,6 @@ export default React.forwardRef(function DeprecatedAlert(props, ref) { [ 'Material-UI: the Alert component was moved from the lab to the core.', '', - 'Yay, the component is stable! 🎉', - '', "You should use `import { Alert } from '@material-ui/core'`", "or `import Alert from '@material-ui/core/Alert'`", ].join('\n'), diff --git a/packages/material-ui-lab/src/Alert/Alert.test.js b/packages/material-ui-lab/src/Alert/Alert.test.js new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/packages/material-ui-lab/src/AlertTitle/AlertTitle.js b/packages/material-ui-lab/src/AlertTitle/AlertTitle.js index ae7e68b0bbf6f9..c8aafa03272f37 100644 --- a/packages/material-ui-lab/src/AlertTitle/AlertTitle.js +++ b/packages/material-ui-lab/src/AlertTitle/AlertTitle.js @@ -8,8 +8,6 @@ export default React.forwardRef(function DeprecatedAlertTitle(props, ref) { [ 'Material-UI: the AlertTitle component was moved from the lab to the core.', '', - 'Yay, the component is stable! 🎉', - '', "You should use `import { AlertTitle } from '@material-ui/core'`", "or `import AlertTitle from '@material-ui/core/AlertTitle'`", ].join('\n'), diff --git a/packages/material-ui-lab/src/AlertTitle/AlertTitle.test.js b/packages/material-ui-lab/src/AlertTitle/AlertTitle.test.js new file mode 100644 index 00000000000000..e69de29bb2d1d6 From ad93b2154e6308b3fa8b4b0303bc89ebc24b55c8 Mon Sep 17 00:00:00 2001 From: Matt Date: Mon, 21 Sep 2020 00:50:40 +0100 Subject: [PATCH 10/18] warn once --- packages/material-ui-lab/src/Alert/Alert.js | 7 ++++++- packages/material-ui-lab/src/AlertTitle/AlertTitle.js | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/material-ui-lab/src/Alert/Alert.js b/packages/material-ui-lab/src/Alert/Alert.js index d4de97f106a44a..0c7bed2838ddc2 100644 --- a/packages/material-ui-lab/src/Alert/Alert.js +++ b/packages/material-ui-lab/src/Alert/Alert.js @@ -3,8 +3,11 @@ import warning from 'warning'; import Alert from '@material-ui/core/Alert'; export default React.forwardRef(function DeprecatedAlert(props, ref) { + let warnOnce = false; + warning( - false, + warnOnce, + [ 'Material-UI: the Alert component was moved from the lab to the core.', '', @@ -13,5 +16,7 @@ export default React.forwardRef(function DeprecatedAlert(props, ref) { ].join('\n'), ); + warnOnce = true; + return ; }); diff --git a/packages/material-ui-lab/src/AlertTitle/AlertTitle.js b/packages/material-ui-lab/src/AlertTitle/AlertTitle.js index c8aafa03272f37..77c08fd55ddbb0 100644 --- a/packages/material-ui-lab/src/AlertTitle/AlertTitle.js +++ b/packages/material-ui-lab/src/AlertTitle/AlertTitle.js @@ -3,8 +3,10 @@ import warning from 'warning'; import AlertTitle from '@material-ui/core/AlertTitle'; export default React.forwardRef(function DeprecatedAlertTitle(props, ref) { + let warnOnce = false; + warning( - false, + warnOnce, [ 'Material-UI: the AlertTitle component was moved from the lab to the core.', '', @@ -12,6 +14,8 @@ export default React.forwardRef(function DeprecatedAlertTitle(props, ref) { "or `import AlertTitle from '@material-ui/core/AlertTitle'`", ].join('\n'), ); + + warnOnce = true; return ; }); From c9c54c852c335a593c75b099e7e3ce86feb69e0d Mon Sep 17 00:00:00 2001 From: Matt Date: Mon, 21 Sep 2020 14:03:11 +0100 Subject: [PATCH 11/18] Update packages/material-ui-lab/src/Alert/Alert.js Co-authored-by: Olivier Tassinari --- packages/material-ui-lab/src/Alert/Alert.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/material-ui-lab/src/Alert/Alert.js b/packages/material-ui-lab/src/Alert/Alert.js index 0c7bed2838ddc2..f71dce6dbacf0b 100644 --- a/packages/material-ui-lab/src/Alert/Alert.js +++ b/packages/material-ui-lab/src/Alert/Alert.js @@ -2,8 +2,9 @@ import React from 'react'; import warning from 'warning'; import Alert from '@material-ui/core/Alert'; +let warnedOnce = false; + export default React.forwardRef(function DeprecatedAlert(props, ref) { - let warnOnce = false; warning( warnOnce, From e574525bfade2d1a4af25e77832405518b2f98dd Mon Sep 17 00:00:00 2001 From: Matt Date: Mon, 21 Sep 2020 14:49:01 +0100 Subject: [PATCH 12/18] don't use warning --- packages/material-ui-lab/src/Alert/Alert.d.ts | 1 + packages/material-ui-lab/src/Alert/Alert.js | 26 +++++++++---------- .../src/AlertTitle/AlertTitle.d.ts | 1 + .../src/AlertTitle/AlertTitle.js | 26 +++++++++---------- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/packages/material-ui-lab/src/Alert/Alert.d.ts b/packages/material-ui-lab/src/Alert/Alert.d.ts index e761cb5c2ac815..7dca614cfefb44 100644 --- a/packages/material-ui-lab/src/Alert/Alert.d.ts +++ b/packages/material-ui-lab/src/Alert/Alert.d.ts @@ -1,2 +1,3 @@ import Alert from '@material-ui/core/Alert'; + export default Alert; diff --git a/packages/material-ui-lab/src/Alert/Alert.js b/packages/material-ui-lab/src/Alert/Alert.js index f71dce6dbacf0b..e15e2229123781 100644 --- a/packages/material-ui-lab/src/Alert/Alert.js +++ b/packages/material-ui-lab/src/Alert/Alert.js @@ -1,23 +1,21 @@ import React from 'react'; -import warning from 'warning'; import Alert from '@material-ui/core/Alert'; -let warnedOnce = false; - export default React.forwardRef(function DeprecatedAlert(props, ref) { + let warnedOnce = false; - warning( - warnOnce, + if (!warnedOnce) { + console.warn( + [ + 'Material-UI: the Alert component was moved from the lab to the core.', + '', + "You should use `import { Alert } from '@material-ui/core'`", + "or `import Alert from '@material-ui/core/Alert'`", + ].join('\n'), + ); - [ - 'Material-UI: the Alert component was moved from the lab to the core.', - '', - "You should use `import { Alert } from '@material-ui/core'`", - "or `import Alert from '@material-ui/core/Alert'`", - ].join('\n'), - ); - - warnOnce = true; + warnedOnce = true; + } return ; }); diff --git a/packages/material-ui-lab/src/AlertTitle/AlertTitle.d.ts b/packages/material-ui-lab/src/AlertTitle/AlertTitle.d.ts index e636fcee3cdfd2..b19569472d820e 100644 --- a/packages/material-ui-lab/src/AlertTitle/AlertTitle.d.ts +++ b/packages/material-ui-lab/src/AlertTitle/AlertTitle.d.ts @@ -1,2 +1,3 @@ import AlertTitle from '@material-ui/core/AlertTitle'; + export default AlertTitle; diff --git a/packages/material-ui-lab/src/AlertTitle/AlertTitle.js b/packages/material-ui-lab/src/AlertTitle/AlertTitle.js index 77c08fd55ddbb0..f39ae66b7aae44 100644 --- a/packages/material-ui-lab/src/AlertTitle/AlertTitle.js +++ b/packages/material-ui-lab/src/AlertTitle/AlertTitle.js @@ -1,21 +1,21 @@ import React from 'react'; -import warning from 'warning'; import AlertTitle from '@material-ui/core/AlertTitle'; export default React.forwardRef(function DeprecatedAlertTitle(props, ref) { - let warnOnce = false; + let warnedOnce = false; - warning( - warnOnce, - [ - 'Material-UI: the AlertTitle component was moved from the lab to the core.', - '', - "You should use `import { AlertTitle } from '@material-ui/core'`", - "or `import AlertTitle from '@material-ui/core/AlertTitle'`", - ].join('\n'), - ); - - warnOnce = true; + if (!warnedOnce) { + console.warn( + [ + 'Material-UI: the AlertTitle component was moved from the lab to the core.', + '', + "You should use `import { AlertTitle } from '@material-ui/core'`", + "or `import AlertTitle from '@material-ui/core/AlertTitle'`", + ].join('\n'), + ); + + warnedOnce = true; + } return ; }); From c3ea87ebb262028d283fe06c43433a65f957c37a Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Wed, 23 Sep 2020 15:34:14 +0200 Subject: [PATCH 13/18] fix ci --- packages/material-ui-lab/src/Alert/Alert.js | 6 +++--- packages/material-ui-lab/src/AlertTitle/AlertTitle.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/material-ui-lab/src/Alert/Alert.js b/packages/material-ui-lab/src/Alert/Alert.js index e15e2229123781..41661e9f81fd96 100644 --- a/packages/material-ui-lab/src/Alert/Alert.js +++ b/packages/material-ui-lab/src/Alert/Alert.js @@ -1,13 +1,13 @@ import React from 'react'; import Alert from '@material-ui/core/Alert'; -export default React.forwardRef(function DeprecatedAlert(props, ref) { - let warnedOnce = false; +let warnedOnce = false; +export default React.forwardRef(function DeprecatedAlert(props, ref) { if (!warnedOnce) { console.warn( [ - 'Material-UI: the Alert component was moved from the lab to the core.', + 'Material-UI: The Alert component was moved from the lab to the core.', '', "You should use `import { Alert } from '@material-ui/core'`", "or `import Alert from '@material-ui/core/Alert'`", diff --git a/packages/material-ui-lab/src/AlertTitle/AlertTitle.js b/packages/material-ui-lab/src/AlertTitle/AlertTitle.js index f39ae66b7aae44..9f8459c0e81285 100644 --- a/packages/material-ui-lab/src/AlertTitle/AlertTitle.js +++ b/packages/material-ui-lab/src/AlertTitle/AlertTitle.js @@ -1,13 +1,13 @@ import React from 'react'; import AlertTitle from '@material-ui/core/AlertTitle'; -export default React.forwardRef(function DeprecatedAlertTitle(props, ref) { - let warnedOnce = false; +let warnedOnce = false; +export default React.forwardRef(function DeprecatedAlertTitle(props, ref) { if (!warnedOnce) { console.warn( [ - 'Material-UI: the AlertTitle component was moved from the lab to the core.', + 'Material-UI: The AlertTitle component was moved from the lab to the core.', '', "You should use `import { AlertTitle } from '@material-ui/core'`", "or `import AlertTitle from '@material-ui/core/AlertTitle'`", From 7b252e9ba4e011985d3c46b4694e30d043c98cde Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Wed, 23 Sep 2020 15:39:55 +0200 Subject: [PATCH 14/18] fix yarn docs:api --- packages/material-ui-lab/src/Alert/Alert.js | 3 +++ packages/material-ui-lab/src/AlertTitle/AlertTitle.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/packages/material-ui-lab/src/Alert/Alert.js b/packages/material-ui-lab/src/Alert/Alert.js index 41661e9f81fd96..32f8bca4e66b73 100644 --- a/packages/material-ui-lab/src/Alert/Alert.js +++ b/packages/material-ui-lab/src/Alert/Alert.js @@ -3,6 +3,9 @@ import Alert from '@material-ui/core/Alert'; let warnedOnce = false; +/** + * @ignore - do not document. + */ export default React.forwardRef(function DeprecatedAlert(props, ref) { if (!warnedOnce) { console.warn( diff --git a/packages/material-ui-lab/src/AlertTitle/AlertTitle.js b/packages/material-ui-lab/src/AlertTitle/AlertTitle.js index 9f8459c0e81285..6d3f5484df35b3 100644 --- a/packages/material-ui-lab/src/AlertTitle/AlertTitle.js +++ b/packages/material-ui-lab/src/AlertTitle/AlertTitle.js @@ -3,6 +3,9 @@ import AlertTitle from '@material-ui/core/AlertTitle'; let warnedOnce = false; +/** + * @ignore - do not document. + */ export default React.forwardRef(function DeprecatedAlertTitle(props, ref) { if (!warnedOnce) { console.warn( From 7d9fbec16b14af6e57d0983efda02d0a45527035 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Wed, 23 Sep 2020 15:41:00 +0200 Subject: [PATCH 15/18] export all the types --- packages/material-ui-lab/src/Alert/Alert.d.ts | 5 ++--- packages/material-ui-lab/src/AlertTitle/AlertTitle.d.ts | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/material-ui-lab/src/Alert/Alert.d.ts b/packages/material-ui-lab/src/Alert/Alert.d.ts index 7dca614cfefb44..f4510343f6d3fa 100644 --- a/packages/material-ui-lab/src/Alert/Alert.d.ts +++ b/packages/material-ui-lab/src/Alert/Alert.d.ts @@ -1,3 +1,2 @@ -import Alert from '@material-ui/core/Alert'; - -export default Alert; +export { default } from '@material-ui/core/Alert'; +export * from '@material-ui/core/Alert'; diff --git a/packages/material-ui-lab/src/AlertTitle/AlertTitle.d.ts b/packages/material-ui-lab/src/AlertTitle/AlertTitle.d.ts index b19569472d820e..c0c459d838997e 100644 --- a/packages/material-ui-lab/src/AlertTitle/AlertTitle.d.ts +++ b/packages/material-ui-lab/src/AlertTitle/AlertTitle.d.ts @@ -1,3 +1,2 @@ -import AlertTitle from '@material-ui/core/AlertTitle'; - -export default AlertTitle; +export { default } from '@material-ui/core/AlertTitle'; +export * from '@material-ui/core/AlertTitle'; From db4423741fb7cfce754918c0688a83ba3f59d8db Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Wed, 23 Sep 2020 15:46:19 +0200 Subject: [PATCH 16/18] [docs] Add migration instructions --- docs/src/pages/guides/migration-v4/migration-v4.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/src/pages/guides/migration-v4/migration-v4.md b/docs/src/pages/guides/migration-v4/migration-v4.md index 306691fc3f9b69..f679b23667fa48 100644 --- a/docs/src/pages/guides/migration-v4/migration-v4.md +++ b/docs/src/pages/guides/migration-v4/migration-v4.md @@ -196,6 +196,17 @@ const theme = createMuitheme({ +theme.breakpoints.up('sm') // '@media (min-width:600px)' ``` +### Alert + +- Move the component from the lab to the core. The component is now stable. + + ```diff + -import Alert from '@material-ui/lab/Alert'; + -import AlertTitle from '@material-ui/lab/AlertTitle'; + +import Alert from '@material-ui/core/Alert'; + +import AlertTitle from '@material-ui/core/AlertTitle'; + ``` + ### Avatar - Rename `circle` to `circular` for consistency. The possible values should be adjectives, not nouns: From 0b1507b0bb1e1e84e3a7547c9bb125fdabf588ea Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Wed, 23 Sep 2020 16:03:34 +0200 Subject: [PATCH 17/18] add theme customization api --- packages/material-ui/src/styles/overrides.d.ts | 4 ++++ packages/material-ui/src/styles/props.d.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/packages/material-ui/src/styles/overrides.d.ts b/packages/material-ui/src/styles/overrides.d.ts index f006fa484c6dea..7e35ad6e14a672 100644 --- a/packages/material-ui/src/styles/overrides.d.ts +++ b/packages/material-ui/src/styles/overrides.d.ts @@ -1,4 +1,6 @@ import { CSSProperties, StyleRules } from './withStyles'; +import { AlertClassKey } from '../Alert'; +import { AlertTitleClassKey } from '../AlertTitle'; import { AppBarClassKey } from '../AppBar'; import { AvatarClassKey } from '../Avatar'; import { BackdropClassKey } from '../Backdrop'; @@ -107,6 +109,8 @@ export type ComponentsOverrides = { }; export interface ComponentNameToClassKey { + MuiAlert: AlertClassKey; + MuiAlertTitle: AlertTitleClassKey; MuiAppBar: AppBarClassKey; MuiAvatar: AvatarClassKey; MuiBackdrop: BackdropClassKey; diff --git a/packages/material-ui/src/styles/props.d.ts b/packages/material-ui/src/styles/props.d.ts index ee42fc215fc661..73cb9aaa6370c8 100644 --- a/packages/material-ui/src/styles/props.d.ts +++ b/packages/material-ui/src/styles/props.d.ts @@ -1,3 +1,5 @@ +import { AlertProps } from '../Alert'; +import { AlertTitleProps } from '../AlertTitle'; import { AppBarProps } from '../AppBar'; import { AvatarProps } from '../Avatar'; import { BackdropProps } from '../Backdrop'; @@ -107,6 +109,8 @@ export type ComponentsProps = { }; export interface ComponentsPropsList { + MuiAlert: AlertProps; + MuiAlertTitle: AlertTitleProps; MuiAppBar: AppBarProps; MuiAvatar: AvatarProps; MuiBackdrop: BackdropProps; From 2554cad06e1e3449aac7c81240e2e1f663abef83 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Wed, 23 Sep 2020 16:11:14 +0200 Subject: [PATCH 18/18] it's in the core now --- docs/src/pages/components/alert/alert.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/src/pages/components/alert/alert.md b/docs/src/pages/components/alert/alert.md index ebbdc56d9a081c..545f0bdd46d0fd 100644 --- a/docs/src/pages/components/alert/alert.md +++ b/docs/src/pages/components/alert/alert.md @@ -2,7 +2,6 @@ title: Alert React component components: Alert, AlertTitle githubLabel: 'component: Alert' -packageName: '@material-ui/lab' waiAria: https://www.w3.org/TR/wai-aria-practices/#alert ---