From 1b50dd10543e537a2e8922ef379fe8739506d3da Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Fri, 13 Dec 2019 15:16:21 -0500 Subject: [PATCH] Changes to AlertContent and provides functionality for text or container --- ...{alert-description.js => alert-content.js} | 2 +- ...{alert-description.md => alert-content.md} | 15 ++--- .../src/pages/components/alert/SimpleAlert.js | 7 +-- .../pages/components/alert/SimpleAlert.tsx | 6 +- .../src/AlertContent/AlertContent.d.ts | 13 +++++ .../src/AlertContent/AlertContent.js | 58 +++++++++++++++++++ .../AlertContent.test.js} | 8 +-- .../src/AlertContent/index.d.ts | 2 + .../material-ui-lab/src/AlertContent/index.js | 1 + .../AlertDescription/AlertDescription.d.ts | 11 ---- .../src/AlertDescription/AlertDescription.js | 40 ------------- .../src/AlertDescription/index.d.ts | 2 - .../src/AlertDescription/index.js | 1 - packages/material-ui-lab/src/index.d.ts | 4 +- packages/material-ui-lab/src/index.js | 4 +- 15 files changed, 97 insertions(+), 77 deletions(-) rename docs/pages/api/{alert-description.js => alert-content.js} (79%) rename docs/pages/api/{alert-description.md => alert-content.md} (60%) create mode 100644 packages/material-ui-lab/src/AlertContent/AlertContent.d.ts create mode 100644 packages/material-ui-lab/src/AlertContent/AlertContent.js rename packages/material-ui-lab/src/{AlertDescription/AlertDescription.test.js => AlertContent/AlertContent.test.js} (70%) create mode 100644 packages/material-ui-lab/src/AlertContent/index.d.ts create mode 100644 packages/material-ui-lab/src/AlertContent/index.js delete mode 100644 packages/material-ui-lab/src/AlertDescription/AlertDescription.d.ts delete mode 100644 packages/material-ui-lab/src/AlertDescription/AlertDescription.js delete mode 100644 packages/material-ui-lab/src/AlertDescription/index.d.ts delete mode 100644 packages/material-ui-lab/src/AlertDescription/index.js diff --git a/docs/pages/api/alert-description.js b/docs/pages/api/alert-content.js similarity index 79% rename from docs/pages/api/alert-description.js rename to docs/pages/api/alert-content.js index ea68a33ba8b520..83d6486e419d4e 100644 --- a/docs/pages/api/alert-description.js +++ b/docs/pages/api/alert-content.js @@ -1,6 +1,6 @@ import React from 'react'; import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; -import markdown from './alert-description.md'; +import markdown from './alert-content.md'; export default function Page() { return ; diff --git a/docs/pages/api/alert-description.md b/docs/pages/api/alert-content.md similarity index 60% rename from docs/pages/api/alert-description.md rename to docs/pages/api/alert-content.md index eeee2355d46daa..f1b3e490cd9129 100644 --- a/docs/pages/api/alert-description.md +++ b/docs/pages/api/alert-content.md @@ -1,19 +1,19 @@ --- -filename: /packages/material-ui-lab/src/AlertDescription/AlertDescription.js +filename: /packages/material-ui-lab/src/AlertContent/AlertContent.js --- -# AlertDescription API +# AlertContent API -

The API documentation of the AlertDescription React component. Learn more about the props and the CSS customization points.

+

The API documentation of the AlertContent React component. Learn more about the props and the CSS customization points.

## Import ```js -import AlertDescription from '@material-ui/lab/AlertDescription'; +import AlertContent from '@material-ui/lab/AlertContent'; // or -import { AlertDescription } from '@material-ui/lab'; +import { AlertContent } from '@material-ui/lab'; ``` You can learn more about the difference by [reading this guide](/guides/minimizing-bundle-size/). @@ -25,6 +25,7 @@ You can learn more about the difference by [reading this guide](/guides/minimizi | Name | Type | Default | Description | |:-----|:-----|:--------|:------------| | classes | object | | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. | +| variant | 'text'
| 'container'
| 'text' | The variant to use. Use `text` to conditionally wrap the description with a "Typography". Use `container` to leave the children unchanged. | The `ref` is forwarded to the root element. @@ -32,7 +33,7 @@ Any other props supplied will be provided to the root element (native element). ## CSS -- Style sheet name: `MuiAlertDescription`. +- Style sheet name: `MuiAlertContent`. - Style sheet details: - `root` @@ -43,5 +44,5 @@ 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/master/packages/material-ui-lab/src/AlertDescription/AlertDescription.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/master/packages/material-ui-lab/src/AlertContent/AlertContent.js) for more detail. diff --git a/docs/src/pages/components/alert/SimpleAlert.js b/docs/src/pages/components/alert/SimpleAlert.js index 879c2b0330057b..07a5fb6021f2ed 100644 --- a/docs/src/pages/components/alert/SimpleAlert.js +++ b/docs/src/pages/components/alert/SimpleAlert.js @@ -1,9 +1,8 @@ import React from 'react'; import { Button } from '@material-ui/core'; -import { Alert, AlertTitle, AlertDescription, AlertActions } from '@material-ui/lab'; +import { Alert, AlertTitle, AlertContent, AlertActions } from '@material-ui/lab'; import InfoIcon from '@material-ui/icons/Info'; -// not sure why this rule is firing... /* eslint-disable react/jsx-filename-extension */ export default function SimpleAlert() { @@ -15,9 +14,9 @@ export default function SimpleAlert() { }} > Sorry, results couldn't be loaded - + There was an error while processing your request. Refresh your page for loading results. - +