Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GridList] Rename to ImageList & add deprecation warnings #22363

Merged
merged 29 commits into from
Sep 22, 2020
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
63fba73
[GridList] Rename to ImageList & add deprecation warnings
mbrookes Aug 22, 2020
e5e6181
fix tests
mbrookes Aug 25, 2020
3d24592
Olivier's review + yarn proptypes
mbrookes Aug 25, 2020
b83873a
v4 types
mbrookes Aug 25, 2020
75fab97
lint
mbrookes Aug 26, 2020
faf6feb
missed one
mbrookes Aug 26, 2020
109d878
remove migration guide
mbrookes Aug 26, 2020
59bd813
docs:api
mbrookes Aug 26, 2020
ad07e37
Tile -> Item
mbrookes Aug 27, 2020
5443b1a
review
mbrookes Aug 28, 2020
35d0027
Add 301
oliviertassinari Aug 29, 2020
0068e2c
fix 404
oliviertassinari Aug 29, 2020
c703a68
remove API redirects
mbrookes Aug 29, 2020
627133e
More tile -> item
mbrookes Aug 29, 2020
eedd212
more grid -> image
mbrookes Aug 29, 2020
d0a18fa
yet more tile -> item
mbrookes Aug 29, 2020
c399060
spacing -> gap
mbrookes Sep 14, 2020
481891c
cellHeight -> rowHeight
mbrookes Sep 15, 2020
0d39555
titlePosition -> position
mbrookes Sep 15, 2020
d44589b
deprecations
mbrookes Sep 15, 2020
7b3c1c8
prettier
mbrookes Sep 16, 2020
2bc243d
proptypes
mbrookes Sep 16, 2020
80bf913
yarn proptypes --disable-cache
oliviertassinari Sep 16, 2020
f73b694
yarn docs:typescript:formatted --disable-cache
oliviertassinari Sep 16, 2020
1b98f79
yarn docs:api
oliviertassinari Sep 16, 2020
3e4c48f
Matt review
oliviertassinari Sep 18, 2020
90e7679
add more descriptions
oliviertassinari Sep 18, 2020
8e280c2
Restore yet more prop descriptions mysteriously killed by 'yarn propt…
mbrookes Sep 19, 2020
3e8b0ee
prettier
mbrookes Sep 19, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions docs/pages/api-docs/grid-list-tile-bar.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ import { GridListTileBar } from '@material-ui/core';

You can learn more about the difference by [reading this guide](/guides/minimizing-bundle-size/).

⚠️ The GridListTileBar component was renamed to ImageListTileBar to align with the current Material Design naming.

You should use `import { ImageListTileBar } from '@material-ui/core'`
or `import ImageListTileBar from '@material-ui/core/ImageListTileBar'`.

## Component name

Expand Down Expand Up @@ -63,7 +66,3 @@ You can override the style of the component thanks to one of these customization

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/src/GridListTileBar/GridListTileBar.js) for more detail.

## Demos

- [Grid List](/components/grid-list/)

7 changes: 3 additions & 4 deletions docs/pages/api-docs/grid-list-tile.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ import { GridListTile } from '@material-ui/core';

You can learn more about the difference by [reading this guide](/guides/minimizing-bundle-size/).

⚠️ The GridList component was renamed to ImageList to align with the current Material Design naming.

You should use `import { ImageListTile } from '@material-ui/core'`
or `import ImageListTile from '@material-ui/core/ImageListTile'`.

## Component name

Expand Down Expand Up @@ -55,7 +58,3 @@ You can override the style of the component thanks to one of these customization

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/src/GridListTile/GridListTile.js) for more detail.

## Demos

- [Grid List](/components/grid-list/)

7 changes: 3 additions & 4 deletions docs/pages/api-docs/grid-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ import { GridList } from '@material-ui/core';

You can learn more about the difference by [reading this guide](/guides/minimizing-bundle-size/).

⚠️ The GridList component was renamed to ImageList to align with the current Material Design naming.

You should use `import { ImageList } from '@material-ui/core'`
or `import ImageList from '@material-ui/core/ImageList'`.

## Component name

Expand Down Expand Up @@ -53,7 +56,3 @@ You can override the style of the component thanks to one of these customization

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/src/GridList/GridList.js) for more detail.

## Demos

- [Grid List](/components/grid-list/)

1 change: 0 additions & 1 deletion docs/pages/api-docs/icon-button.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,4 @@ You can take advantage of this behavior to [target nested components](/guides/ap
## Demos

- [Buttons](/components/buttons/)
- [Grid List](/components/grid-list/)

15 changes: 15 additions & 0 deletions docs/pages/api-docs/image-list-item-bar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown';

const pageFilename = 'api/image-list-item-bar';
const requireRaw = require.context('!raw-loader!./', false, /\/image-list-item-bar\.md$/);

export default function Page({ docs }) {
return <MarkdownDocs docs={docs} />;
}

Page.getInitialProps = () => {
const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw });
return { demos, docs };
};
69 changes: 69 additions & 0 deletions docs/pages/api-docs/image-list-item-bar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
filename: /packages/material-ui/src/ImageListItemBar/ImageListItemBar.js
---

<!--- This documentation is automatically generated, do not try to edit it. -->

# ImageListItemBar API

<p class="description">The API documentation of the ImageListItemBar React component. Learn more about the props and the CSS customization points.</p>

## Import

```js
import ImageListItemBar from '@material-ui/core/ImageListItemBar';
// or
import { ImageListItemBar } from '@material-ui/core';
```

You can learn more about the difference by [reading this guide](/guides/minimizing-bundle-size/).



## Component name

The `MuiImageListItemBar` name can be used for providing [default props](/customization/globals/#default-props) or [style overrides](/customization/globals/#css) at the theme level.

## Props

| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|
| <span class="prop-name">actionIcon</span> | <span class="prop-type">node</span> | | An IconButton element to be used as secondary action target (primary action target is the item itself). |
| <span class="prop-name">actionPosition</span> | <span class="prop-type">'left'<br>&#124;&nbsp;'right'</span> | <span class="prop-default">'right'</span> | Position of secondary action IconButton. |
| <span class="prop-name">classes</span> | <span class="prop-type">object</span> | | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. |
| <span class="prop-name">position</span> | <span class="prop-type">'bottom'<br>&#124;&nbsp;'top'</span> | <span class="prop-default">'bottom'</span> | Position of the title bar. |
| <span class="prop-name">subtitle</span> | <span class="prop-type">node</span> | | String or element serving as subtitle (support text). |
| <span class="prop-name">title</span> | <span class="prop-type">node</span> | | Title to be displayed on item. |

The `ref` is forwarded to the root element.

Any other props supplied will be provided to the root element (native element).

## CSS

| Rule name | Global class | Description |
|:-----|:-------------|:------------|
| <span class="prop-name">root</span> | <span class="prop-name">.MuiImageListItemBar-root</span> | Styles applied to the root element.
| <span class="prop-name">positionBottom</span> | <span class="prop-name">.MuiImageListItemBar-positionBottom</span> | Styles applied to the root element if `position="bottom"`.
| <span class="prop-name">positionTop</span> | <span class="prop-name">.MuiImageListItemBar-positionTop</span> | Styles applied to the root element if `position="top"`.
| <span class="prop-name">rootSubtitle</span> | <span class="prop-name">.MuiImageListItemBar-rootSubtitle</span> | Styles applied to the root element if a `subtitle` is provided.
| <span class="prop-name">titleWrap</span> | <span class="prop-name">.MuiImageListItemBar-titleWrap</span> | Styles applied to the title and subtitle container element.
| <span class="prop-name">titleWrapActionPosLeft</span> | <span class="prop-name">.MuiImageListItemBar-titleWrapActionPosLeft</span> | Styles applied to the container element if `actionPosition="left"`.
| <span class="prop-name">titleWrapActionPosRight</span> | <span class="prop-name">.MuiImageListItemBar-titleWrapActionPosRight</span> | Styles applied to the container element if `actionPosition="right"`.
| <span class="prop-name">title</span> | <span class="prop-name">.MuiImageListItemBar-title</span> | Styles applied to the title container element.
| <span class="prop-name">subtitle</span> | <span class="prop-name">.MuiImageListItemBar-subtitle</span> | Styles applied to the subtitle container element.
| <span class="prop-name">actionIcon</span> | <span class="prop-name">.MuiImageListItemBar-actionIcon</span> | Styles applied to the actionIcon if supplied.
| <span class="prop-name">actionIconActionPosLeft</span> | <span class="prop-name">.MuiImageListItemBar-actionIconActionPosLeft</span> | Styles applied to the actionIcon if `actionPosition="left"`.

You can override the style of the component thanks to one of these customization points:

- With a rule name of the [`classes` object prop](/customization/components/#overriding-styles-with-classes).
- 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/src/ImageListItemBar/ImageListItemBar.js) for more detail.

## Demos

- [Image List](/components/image-list/)

15 changes: 15 additions & 0 deletions docs/pages/api-docs/image-list-item.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown';

const pageFilename = 'api/image-list-item';
const requireRaw = require.context('!raw-loader!./', false, /\/image-list-item\.md$/);

export default function Page({ docs }) {
return <MarkdownDocs docs={docs} />;
}

Page.getInitialProps = () => {
const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw });
return { demos, docs };
};
58 changes: 58 additions & 0 deletions docs/pages/api-docs/image-list-item.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
filename: /packages/material-ui/src/ImageListItem/ImageListItem.js
---

<!--- This documentation is automatically generated, do not try to edit it. -->

# ImageListItem API

<p class="description">The API documentation of the ImageListItem React component. Learn more about the props and the CSS customization points.</p>

## Import

```js
import ImageListItem from '@material-ui/core/ImageListItem';
// or
import { ImageListItem } from '@material-ui/core';
```

You can learn more about the difference by [reading this guide](/guides/minimizing-bundle-size/).



## Component name

The `MuiImageListItem` name can be used for providing [default props](/customization/globals/#default-props) or [style overrides](/customization/globals/#css) at the theme level.

## Props

| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|
| <span class="prop-name">classes</span> | <span class="prop-type">object</span> | | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. |
| <span class="prop-name">component</span> | <span class="prop-type">elementType</span> | <span class="prop-default">'li'</span> | The component used for the root node. Either a string to use a HTML element or a component. |

The `ref` is forwarded to the root element.

Any other props supplied will be provided to the root element (native element).

## CSS

| Rule name | Global class | Description |
|:-----|:-------------|:------------|
| <span class="prop-name">root</span> | <span class="prop-name">.MuiImageListItem-root</span> | Styles applied to the root element.
| <span class="prop-name">item</span> | <span class="prop-name">.MuiImageListItem-item</span> | Styles applied to the `div` element that wraps the children.
| <span class="prop-name">imgFullHeight</span> | <span class="prop-name">.MuiImageListItem-imgFullHeight</span> | Styles applied to an `img` element child, if needed to ensure it covers the item.
| <span class="prop-name">imgFullWidth</span> | <span class="prop-name">.MuiImageListItem-imgFullWidth</span> | Styles applied to an `img` element child, if needed to ensure it covers the item.

You can override the style of the component thanks to one of these customization points:

- With a rule name of the [`classes` object prop](/customization/components/#overriding-styles-with-classes).
- 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/src/ImageListItem/ImageListItem.js) for more detail.

## Demos

- [Image List](/components/image-list/)

15 changes: 15 additions & 0 deletions docs/pages/api-docs/image-list.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown';

const pageFilename = 'api/image-list';
const requireRaw = require.context('!raw-loader!./', false, /\/image-list\.md$/);

export default function Page({ docs }) {
return <MarkdownDocs docs={docs} />;
}

Page.getInitialProps = () => {
const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw });
return { demos, docs };
};
57 changes: 57 additions & 0 deletions docs/pages/api-docs/image-list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
filename: /packages/material-ui/src/ImageList/ImageList.js
---

<!--- This documentation is automatically generated, do not try to edit it. -->

# ImageList API

<p class="description">The API documentation of the ImageList React component. Learn more about the props and the CSS customization points.</p>

## Import

```js
import ImageList from '@material-ui/core/ImageList';
// or
import { ImageList } from '@material-ui/core';
```

You can learn more about the difference by [reading this guide](/guides/minimizing-bundle-size/).



## Component name

The `MuiImageList` name can be used for providing [default props](/customization/globals/#default-props) or [style overrides](/customization/globals/#css) at the theme level.

## Props

| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|
| ~~<span class="prop-name">cellHeight</span>~~ | <span class="prop-type">oneOfType([PropTypes.number</span> | | *Deprecated*. Use the `rowHeight` prop instead.<br><br> |
| <span class="prop-name">classes</span> | <span class="prop-type">object</span> | | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. |
| <span class="prop-name">component</span> | <span class="prop-type">elementType</span> | <span class="prop-default">'ul'</span> | The component used for the root node. Either a string to use a HTML element or a component. |
| ~~<span class="prop-name">spacing</span>~~ | <span class="prop-type">number</span> | | *Deprecated*. Use the `rowHeight` prop instead.<br><br> |
oliviertassinari marked this conversation as resolved.
Show resolved Hide resolved

The `ref` is forwarded to the root element.

Any other props supplied will be provided to the root element (native element).

## CSS

| Rule name | Global class | Description |
|:-----|:-------------|:------------|
| <span class="prop-name">root</span> | <span class="prop-name">.MuiImageList-root</span> | Styles applied to the root element.

You can override the style of the component thanks to one of these customization points:

- With a rule name of the [`classes` object prop](/customization/components/#overriding-styles-with-classes).
- 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/src/ImageList/ImageList.js) for more detail.

## Demos

- [Image List](/components/image-list/)

1 change: 0 additions & 1 deletion docs/pages/api-docs/list-subheader.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,5 @@ If that's not sufficient, you can check the [implementation of the component](ht

## Demos

- [Grid List](/components/grid-list/)
- [Lists](/components/lists/)

Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import React from 'react';
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown';

const pageFilename = 'components/grid-list';
const requireDemo = require.context('docs/src/pages/components/grid-list', false, /\.(js|tsx)$/);
const pageFilename = 'components/image-list';
const requireDemo = require.context('docs/src/pages/components/image-list', false, /\.(js|tsx)$/);
const requireRaw = require.context(
'!raw-loader!../../src/pages/components/grid-list',
'!raw-loader!../../src/pages/components/image-list',
false,
/\.(js|md|tsx)$/,
);
Expand Down
6 changes: 2 additions & 4 deletions docs/public/_redirects
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@ https://material-ui.dev/* https://material-ui.com/:splat 301!
/api/mui-theme-provider/ /styles/api/ 301
/components/expansion-panels/ /components/accordion/ 301
/:userLanguage/components/expansion-panels/ /:userLanguage/components/accordion/ 301
/api/expansion-panel/ /api/accordion/ 301
/api/expansion-panel-actions/ /api/accordion-actions/ 301
/api/expansion-panel-details/ /api/accordion-details/ 301
/api/expansion-panel-summary/ /api/accordion-summary/ 301
/components/grid-list/ /components/image-list/ 301
/:userLanguage/components/grid-list/ /:userLanguage/components/image-list/ 301

# To remove at some point (2022).
/premium-themes* https://material-ui.com/store/ 301
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const pages = [
{ pathname: '/components/box' },
{ pathname: '/components/container' },
{ pathname: '/components/grid' },
{ pathname: '/components/grid-list' },
{ pathname: '/components/hidden' },
{ pathname: '/components/image-list' },
],
},
{
Expand Down
6 changes: 3 additions & 3 deletions docs/src/pages/components/buttons/ButtonBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import Typography from '@material-ui/core/Typography';

const images = [
{
url: '/static/images/grid-list/breakfast.jpg',
url: '/static/images/image-list/breakfast.jpg',
title: 'Breakfast',
width: '40%',
},
{
url: '/static/images/grid-list/burgers.jpg',
url: '/static/images/image-list/burgers.jpg',
title: 'Burgers',
width: '30%',
},
{
url: '/static/images/grid-list/camera.jpg',
url: '/static/images/image-list/camera.jpg',
title: 'Camera',
width: '30%',
},
Expand Down
6 changes: 3 additions & 3 deletions docs/src/pages/components/buttons/ButtonBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import Typography from '@material-ui/core/Typography';

const images = [
{
url: '/static/images/grid-list/breakfast.jpg',
url: '/static/images/image-list/breakfast.jpg',
title: 'Breakfast',
width: '40%',
},
{
url: '/static/images/grid-list/burgers.jpg',
url: '/static/images/image-list/burgers.jpg',
title: 'Burgers',
width: '30%',
},
{
url: '/static/images/grid-list/camera.jpg',
url: '/static/images/image-list/camera.jpg',
title: 'Camera',
width: '30%',
},
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/components/cards/cards.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Set `variant="outlined"` to render an outlined card.

## Complex Interaction

On desktop, card content can expand.
On desktop, card content can expand. (Click the downward chevron to view the recipe.)

{{"demo": "pages/components/cards/RecipeReviewCard.js", "bg": true}}

Expand Down
Loading