diff --git a/docs/pages/api-docs/icon-button.md b/docs/pages/api-docs/icon-button.md index 48fc4f0331325c..ac17db2d44c0ae 100644 --- a/docs/pages/api-docs/icon-button.md +++ b/docs/pages/api-docs/icon-button.md @@ -72,5 +72,5 @@ You can take advantage of this behavior to [target nested components](/guides/ap ## Demos - [Buttons](/components/buttons/) -- [Grid List](/components/grid-list/) +- [Image List](/components/image-list/) diff --git a/docs/pages/api-docs/grid-list-tile-bar.js b/docs/pages/api-docs/image-list-tile-bar.js similarity index 73% rename from docs/pages/api-docs/grid-list-tile-bar.js rename to docs/pages/api-docs/image-list-tile-bar.js index 0fdfabb707f500..cf3b33ee40c355 100644 --- a/docs/pages/api-docs/grid-list-tile-bar.js +++ b/docs/pages/api-docs/image-list-tile-bar.js @@ -2,8 +2,8 @@ import React from 'react'; import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown'; -const pageFilename = 'api/grid-list-tile-bar'; -const requireRaw = require.context('!raw-loader!./', false, /\/grid-list-tile-bar\.md$/); +const pageFilename = 'api/image-list-tile-bar'; +const requireRaw = require.context('!raw-loader!./', false, /\/image-list-tile-bar\.md$/); export default function Page({ docs }) { return ; diff --git a/docs/pages/api-docs/grid-list-tile-bar.md b/docs/pages/api-docs/image-list-tile-bar.md similarity index 59% rename from docs/pages/api-docs/grid-list-tile-bar.md rename to docs/pages/api-docs/image-list-tile-bar.md index bb2f87f8e0e53e..89a54290542279 100644 --- a/docs/pages/api-docs/grid-list-tile-bar.md +++ b/docs/pages/api-docs/image-list-tile-bar.md @@ -1,19 +1,19 @@ --- -filename: /packages/material-ui/src/GridListTileBar/GridListTileBar.js +filename: /packages/material-ui/src/ImageListTileBar/ImageListTileBar.js --- -# GridListTileBar API +# ImageListTileBar API -

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

+

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

## Import ```js -import GridListTileBar from '@material-ui/core/GridListTileBar'; +import ImageListTileBar from '@material-ui/core/ImageListTileBar'; // or -import { GridListTileBar } from '@material-ui/core'; +import { ImageListTileBar } from '@material-ui/core'; ``` You can learn more about the difference by [reading this guide](/guides/minimizing-bundle-size/). @@ -22,7 +22,7 @@ You can learn more about the difference by [reading this guide](/guides/minimizi ## Component name -The `MuiGridListTileBar` name can be used for providing [default props](/customization/globals/#default-props) or [style overrides](/customization/globals/#css) at the theme level. +The `MuiImageListTileBar` name can be used for providing [default props](/customization/globals/#default-props) or [style overrides](/customization/globals/#css) at the theme level. ## Props @@ -43,17 +43,17 @@ Any other props supplied will be provided to the root element (native element). | Rule name | Global class | Description | |:-----|:-------------|:------------| -| root | .MuiGridListTileBar-root | Styles applied to the root element. -| titlePositionBottom | .MuiGridListTileBar-titlePositionBottom | Styles applied to the root element if `titlePosition="bottom"`. -| titlePositionTop | .MuiGridListTileBar-titlePositionTop | Styles applied to the root element if `titlePosition="top"`. -| rootSubtitle | .MuiGridListTileBar-rootSubtitle | Styles applied to the root element if a `subtitle` is provided. -| titleWrap | .MuiGridListTileBar-titleWrap | Styles applied to the title and subtitle container element. -| titleWrapActionPosLeft | .MuiGridListTileBar-titleWrapActionPosLeft | Styles applied to the container element if `actionPosition="left"`. -| titleWrapActionPosRight | .MuiGridListTileBar-titleWrapActionPosRight | Styles applied to the container element if `actionPosition="right"`. -| title | .MuiGridListTileBar-title | Styles applied to the title container element. -| subtitle | .MuiGridListTileBar-subtitle | Styles applied to the subtitle container element. -| actionIcon | .MuiGridListTileBar-actionIcon | Styles applied to the actionIcon if supplied. -| actionIconActionPosLeft | .MuiGridListTileBar-actionIconActionPosLeft | Styles applied to the actionIcon if `actionPosition="left"`. +| root | .MuiImageListTileBar-root | Styles applied to the root element. +| titlePositionBottom | .MuiImageListTileBar-titlePositionBottom | Styles applied to the root element if `titlePosition="bottom"`. +| titlePositionTop | .MuiImageListTileBar-titlePositionTop | Styles applied to the root element if `titlePosition="top"`. +| rootSubtitle | .MuiImageListTileBar-rootSubtitle | Styles applied to the root element if a `subtitle` is provided. +| titleWrap | .MuiImageListTileBar-titleWrap | Styles applied to the title and subtitle container element. +| titleWrapActionPosLeft | .MuiImageListTileBar-titleWrapActionPosLeft | Styles applied to the container element if `actionPosition="left"`. +| titleWrapActionPosRight | .MuiImageListTileBar-titleWrapActionPosRight | Styles applied to the container element if `actionPosition="right"`. +| title | .MuiImageListTileBar-title | Styles applied to the title container element. +| subtitle | .MuiImageListTileBar-subtitle | Styles applied to the subtitle container element. +| actionIcon | .MuiImageListTileBar-actionIcon | Styles applied to the actionIcon if supplied. +| actionIconActionPosLeft | .MuiImageListTileBar-actionIconActionPosLeft | Styles applied to the actionIcon if `actionPosition="left"`. You can override the style of the component thanks to one of these customization points: @@ -61,9 +61,9 @@ 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/src/GridListTileBar/GridListTileBar.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/ImageListTileBar/ImageListTileBar.js) for more detail. ## Demos -- [Grid List](/components/grid-list/) +- [Image List](/components/image-list/) diff --git a/docs/pages/api-docs/grid-list-tile.js b/docs/pages/api-docs/image-list-tile.js similarity index 74% rename from docs/pages/api-docs/grid-list-tile.js rename to docs/pages/api-docs/image-list-tile.js index 254ce412024784..87e81591cb6d14 100644 --- a/docs/pages/api-docs/grid-list-tile.js +++ b/docs/pages/api-docs/image-list-tile.js @@ -2,8 +2,8 @@ import React from 'react'; import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown'; -const pageFilename = 'api/grid-list-tile'; -const requireRaw = require.context('!raw-loader!./', false, /\/grid-list-tile\.md$/); +const pageFilename = 'api/image-list-tile'; +const requireRaw = require.context('!raw-loader!./', false, /\/image-list-tile\.md$/); export default function Page({ docs }) { return ; diff --git a/docs/pages/api-docs/grid-list-tile.md b/docs/pages/api-docs/image-list-tile.md similarity index 63% rename from docs/pages/api-docs/grid-list-tile.md rename to docs/pages/api-docs/image-list-tile.md index 20524fc14d74d0..4cb791943a90eb 100644 --- a/docs/pages/api-docs/grid-list-tile.md +++ b/docs/pages/api-docs/image-list-tile.md @@ -1,19 +1,19 @@ --- -filename: /packages/material-ui/src/GridListTile/GridListTile.js +filename: /packages/material-ui/src/ImageListTile/ImageListTile.js --- -# GridListTile API +# ImageListTile API -

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

+

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

## Import ```js -import GridListTile from '@material-ui/core/GridListTile'; +import ImageListTile from '@material-ui/core/ImageListTile'; // or -import { GridListTile } from '@material-ui/core'; +import { ImageListTile } from '@material-ui/core'; ``` You can learn more about the difference by [reading this guide](/guides/minimizing-bundle-size/). @@ -22,13 +22,13 @@ You can learn more about the difference by [reading this guide](/guides/minimizi ## Component name -The `MuiGridListTile` name can be used for providing [default props](/customization/globals/#default-props) or [style overrides](/customization/globals/#css) at the theme level. +The `MuiImageListTile` 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 | |:-----|:-----|:--------|:------------| -| children | node | | Theoretically you can pass any node as children, but the main use case is to pass an img, in which case GridListTile takes care of making the image "cover" available space (similar to `background-size: cover` or to `object-fit: cover`). | +| children | node | | Theoretically you can pass any node as children, but the main use case is to pass an img, in which case ImageListTile takes care of making the image "cover" available space (similar to `background-size: cover` or to `object-fit: cover`). | | classes | object | | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. | | cols | number | 1 | Width of the tile in number of grid cells. | | component | elementType | 'li' | The component used for the root node. Either a string to use a HTML element or a component. | @@ -42,10 +42,10 @@ Any other props supplied will be provided to the root element (native element). | Rule name | Global class | Description | |:-----|:-------------|:------------| -| root | .MuiGridListTile-root | Styles applied to the root element. -| tile | .MuiGridListTile-tile | Styles applied to the `div` element that wraps the children. -| imgFullHeight | .MuiGridListTile-imgFullHeight | Styles applied to an `img` element child, if needed to ensure it covers the tile. -| imgFullWidth | .MuiGridListTile-imgFullWidth | Styles applied to an `img` element child, if needed to ensure it covers the tile. +| root | .MuiImageListTile-root | Styles applied to the root element. +| tile | .MuiImageListTile-tile | Styles applied to the `div` element that wraps the children. +| imgFullHeight | .MuiImageListTile-imgFullHeight | Styles applied to an `img` element child, if needed to ensure it covers the tile. +| imgFullWidth | .MuiImageListTile-imgFullWidth | Styles applied to an `img` element child, if needed to ensure it covers the tile. You can override the style of the component thanks to one of these customization points: @@ -53,9 +53,9 @@ 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/src/GridListTile/GridListTile.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/ImageListTile/ImageListTile.js) for more detail. ## Demos -- [Grid List](/components/grid-list/) +- [Image List](/components/image-list/) diff --git a/docs/pages/api-docs/grid-list.js b/docs/pages/api-docs/image-list.js similarity index 76% rename from docs/pages/api-docs/grid-list.js rename to docs/pages/api-docs/image-list.js index 004dd933dede76..0c2fa21ec58007 100644 --- a/docs/pages/api-docs/grid-list.js +++ b/docs/pages/api-docs/image-list.js @@ -2,8 +2,8 @@ import React from 'react'; import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown'; -const pageFilename = 'api/grid-list'; -const requireRaw = require.context('!raw-loader!./', false, /\/grid-list\.md$/); +const pageFilename = 'api/image-list'; +const requireRaw = require.context('!raw-loader!./', false, /\/image-list\.md$/); export default function Page({ docs }) { return ; diff --git a/docs/pages/api-docs/grid-list.md b/docs/pages/api-docs/image-list.md similarity index 73% rename from docs/pages/api-docs/grid-list.md rename to docs/pages/api-docs/image-list.md index 3bb55d49e50617..a3efa736c73b84 100644 --- a/docs/pages/api-docs/grid-list.md +++ b/docs/pages/api-docs/image-list.md @@ -1,19 +1,19 @@ --- -filename: /packages/material-ui/src/GridList/GridList.js +filename: /packages/material-ui/src/ImageList/ImageList.js --- -# GridList API +# ImageList API -

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

+

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

## Import ```js -import GridList from '@material-ui/core/GridList'; +import ImageList from '@material-ui/core/ImageList'; // or -import { GridList } from '@material-ui/core'; +import { ImageList } from '@material-ui/core'; ``` You can learn more about the difference by [reading this guide](/guides/minimizing-bundle-size/). @@ -22,14 +22,14 @@ You can learn more about the difference by [reading this guide](/guides/minimizi ## Component name -The `MuiGridList` name can be used for providing [default props](/customization/globals/#default-props) or [style overrides](/customization/globals/#css) at the theme level. +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 | |:-----|:-----|:--------|:------------| | cellHeight | 'auto'
| number
| 180 | Number of px for one cell height. You can set `'auto'` if you want to let the children determine the height. | -| children* | node | | Grid Tiles that will be in Grid List. | +| children* | node | | Image Tiles that will be in Image List. | | classes | object | | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. | | cols | number | 2 | Number of columns. | | component | elementType | 'ul' | The component used for the root node. Either a string to use a HTML element or a component. | @@ -43,7 +43,7 @@ Any other props supplied will be provided to the root element (native element). | Rule name | Global class | Description | |:-----|:-------------|:------------| -| root | .MuiGridList-root | Styles applied to the root element. +| root | .MuiImageList-root | Styles applied to the root element. You can override the style of the component thanks to one of these customization points: @@ -51,9 +51,9 @@ 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/src/GridList/GridList.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/ImageList/ImageList.js) for more detail. ## Demos -- [Grid List](/components/grid-list/) +- [Image List](/components/image-list/) diff --git a/docs/pages/api-docs/list-subheader.md b/docs/pages/api-docs/list-subheader.md index 64cf45d3e4061e..3f1f62ae4e78cf 100644 --- a/docs/pages/api-docs/list-subheader.md +++ b/docs/pages/api-docs/list-subheader.md @@ -61,6 +61,6 @@ If that's not sufficient, you can check the [implementation of the component](ht ## Demos -- [Grid List](/components/grid-list/) +- [Image List](/components/image-list/) - [Lists](/components/lists/) diff --git a/docs/pages/components/grid-list.js b/docs/pages/components/image-list.js similarity index 71% rename from docs/pages/components/grid-list.js rename to docs/pages/components/image-list.js index 2e290836adb4c6..baeeb2c5e17286 100644 --- a/docs/pages/components/grid-list.js +++ b/docs/pages/components/image-list.js @@ -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)$/, ); diff --git a/docs/public/static/images/grid-list/bike.jpg b/docs/public/static/images/image-list/bike.jpg similarity index 100% rename from docs/public/static/images/grid-list/bike.jpg rename to docs/public/static/images/image-list/bike.jpg diff --git a/docs/public/static/images/grid-list/breakfast.jpg b/docs/public/static/images/image-list/breakfast.jpg similarity index 100% rename from docs/public/static/images/grid-list/breakfast.jpg rename to docs/public/static/images/image-list/breakfast.jpg diff --git a/docs/public/static/images/grid-list/burgers.jpg b/docs/public/static/images/image-list/burgers.jpg similarity index 100% rename from docs/public/static/images/grid-list/burgers.jpg rename to docs/public/static/images/image-list/burgers.jpg diff --git a/docs/public/static/images/grid-list/camera.jpg b/docs/public/static/images/image-list/camera.jpg similarity index 100% rename from docs/public/static/images/grid-list/camera.jpg rename to docs/public/static/images/image-list/camera.jpg diff --git a/docs/public/static/images/grid-list/hats.jpg b/docs/public/static/images/image-list/hats.jpg similarity index 100% rename from docs/public/static/images/grid-list/hats.jpg rename to docs/public/static/images/image-list/hats.jpg diff --git a/docs/public/static/images/grid-list/honey.jpg b/docs/public/static/images/image-list/honey.jpg similarity index 100% rename from docs/public/static/images/grid-list/honey.jpg rename to docs/public/static/images/image-list/honey.jpg diff --git a/docs/public/static/images/grid-list/morning.jpg b/docs/public/static/images/image-list/morning.jpg similarity index 100% rename from docs/public/static/images/grid-list/morning.jpg rename to docs/public/static/images/image-list/morning.jpg diff --git a/docs/public/static/images/grid-list/mushroom.jpg b/docs/public/static/images/image-list/mushroom.jpg similarity index 100% rename from docs/public/static/images/grid-list/mushroom.jpg rename to docs/public/static/images/image-list/mushroom.jpg diff --git a/docs/public/static/images/grid-list/olive.jpg b/docs/public/static/images/image-list/olive.jpg similarity index 100% rename from docs/public/static/images/grid-list/olive.jpg rename to docs/public/static/images/image-list/olive.jpg diff --git a/docs/public/static/images/grid-list/plant.jpg b/docs/public/static/images/image-list/plant.jpg similarity index 100% rename from docs/public/static/images/grid-list/plant.jpg rename to docs/public/static/images/image-list/plant.jpg diff --git a/docs/public/static/images/grid-list/star.jpg b/docs/public/static/images/image-list/star.jpg similarity index 100% rename from docs/public/static/images/grid-list/star.jpg rename to docs/public/static/images/image-list/star.jpg diff --git a/docs/public/static/images/grid-list/vegetables.jpg b/docs/public/static/images/image-list/vegetables.jpg similarity index 100% rename from docs/public/static/images/grid-list/vegetables.jpg rename to docs/public/static/images/image-list/vegetables.jpg diff --git a/docs/src/pages.js b/docs/src/pages.js index c5547070b29a61..9b9749f76ac750 100644 --- a/docs/src/pages.js +++ b/docs/src/pages.js @@ -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' }, ], }, { diff --git a/docs/src/pages/components/buttons/ButtonBase.js b/docs/src/pages/components/buttons/ButtonBase.js index 81fef234023b3f..3958b8cef24c06 100644 --- a/docs/src/pages/components/buttons/ButtonBase.js +++ b/docs/src/pages/components/buttons/ButtonBase.js @@ -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%', }, diff --git a/docs/src/pages/components/buttons/ButtonBase.tsx b/docs/src/pages/components/buttons/ButtonBase.tsx index 38108f098f2790..c6e7ebf1643866 100644 --- a/docs/src/pages/components/buttons/ButtonBase.tsx +++ b/docs/src/pages/components/buttons/ButtonBase.tsx @@ -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%', }, diff --git a/docs/src/pages/components/grid-list/grid-list.md b/docs/src/pages/components/grid-list/grid-list.md deleted file mode 100644 index 9c3318113f1da9..00000000000000 --- a/docs/src/pages/components/grid-list/grid-list.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: Grid List React component -components: GridList, GridListTile, GridListTileBar, ListSubheader, IconButton -materialDesign: https://material.io/components/image-lists -githubLabel: component: GridList ---- - -# Grid List - -

Grid lists display a collection of images in an organized grid.

- -Grid lists represent a collection of items in a repeated pattern. They help improve the visual comprehension of the content they hold. - -{{"component": "modules/components/ComponentLinkHeader.js"}} - -## Image-only Grid list - -A simple example of a scrollable image `GridList`. - -{{"demo": "pages/components/grid-list/ImageGridList.js", "hideEditButton": true}} - -## Grid list with titlebars - -This example demonstrates the use of the `GridListTileBar` to add an overlay to each `GridListTile`. -The overlay can accommodate a `title`, `subtitle` and secondary action - in this example an `IconButton`. - -{{"demo": "pages/components/grid-list/TitlebarGridList.js", "hideEditButton": true}} - -## Single line Grid list - -This example demonstrates a horizontal scrollable single-line grid list of images. -Horizontally scrolling grid lists are discouraged because the scrolling interferes with typical reading patterns, affecting comprehension. -One notable exception is a horizontally-scrolling, single-line grid list of images, such as a gallery. - -{{"demo": "pages/components/grid-list/SingleLineGridList.js", "hideEditButton": true}} - -## Advanced Grid list - -This example demonstrates "featured" tiles, using the `rows` and `cols` props to adjust the size of the tile, and the `padding` prop to adjust the spacing. -The tiles have a customized titlebar, positioned at the top and with a custom gradient `titleBackground`. -The secondary action `IconButton` is positioned on the left. - -{{"demo": "pages/components/grid-list/AdvancedGridList.js", "hideEditButton": true, "defaultCodeOpen": false}} diff --git a/docs/src/pages/components/grid-list/AdvancedGridList.js b/docs/src/pages/components/image-list/AdvancedImageList.js similarity index 81% rename from docs/src/pages/components/grid-list/AdvancedGridList.js rename to docs/src/pages/components/image-list/AdvancedImageList.js index 58562c2f28f58a..def1a24757ab68 100644 --- a/docs/src/pages/components/grid-list/AdvancedGridList.js +++ b/docs/src/pages/components/image-list/AdvancedImageList.js @@ -1,8 +1,8 @@ import * as React from 'react'; import { makeStyles } from '@material-ui/core/styles'; -import GridList from '@material-ui/core/GridList'; -import GridListTile from '@material-ui/core/GridListTile'; -import GridListTileBar from '@material-ui/core/GridListTileBar'; +import ImageList from '@material-ui/core/ImageList'; +import ImageListTile from '@material-ui/core/ImageListTile'; +import ImageListTileBar from '@material-ui/core/ImageListTileBar'; import IconButton from '@material-ui/core/IconButton'; import StarBorderIcon from '@material-ui/icons/StarBorder'; import tileData from './tileData'; @@ -49,20 +49,20 @@ const useStyles = makeStyles((theme) => ({ * }, * ]; */ -export default function AdvancedGridList() { +export default function AdvancedImageList() { const classes = useStyles(); return (
- + {tileData.map((tile) => ( - {tile.title} - - + ))} - +
); } diff --git a/docs/src/pages/components/grid-list/AdvancedGridList.tsx b/docs/src/pages/components/image-list/AdvancedImageList.tsx similarity index 82% rename from docs/src/pages/components/grid-list/AdvancedGridList.tsx rename to docs/src/pages/components/image-list/AdvancedImageList.tsx index 2d74fdba316998..33ac2b6abaa500 100644 --- a/docs/src/pages/components/grid-list/AdvancedGridList.tsx +++ b/docs/src/pages/components/image-list/AdvancedImageList.tsx @@ -1,8 +1,8 @@ import * as React from 'react'; import { createStyles, Theme, makeStyles } from '@material-ui/core/styles'; -import GridList from '@material-ui/core/GridList'; -import GridListTile from '@material-ui/core/GridListTile'; -import GridListTileBar from '@material-ui/core/GridListTileBar'; +import ImageList from '@material-ui/core/ImageList'; +import ImageListTile from '@material-ui/core/ImageListTile'; +import ImageListTileBar from '@material-ui/core/ImageListTileBar'; import IconButton from '@material-ui/core/IconButton'; import StarBorderIcon from '@material-ui/icons/StarBorder'; import tileData from './tileData'; @@ -51,20 +51,20 @@ const useStyles = makeStyles((theme: Theme) => * }, * ]; */ -export default function AdvancedGridList() { +export default function AdvancedImageList() { const classes = useStyles(); return (
- + {tileData.map((tile) => ( - {tile.title} - - + ))} - +
); } diff --git a/docs/src/pages/components/grid-list/ImageGridList.js b/docs/src/pages/components/image-list/BasicImageList.js similarity index 71% rename from docs/src/pages/components/grid-list/ImageGridList.js rename to docs/src/pages/components/image-list/BasicImageList.js index ac31e9271075e7..8eb566e828e4ff 100644 --- a/docs/src/pages/components/grid-list/ImageGridList.js +++ b/docs/src/pages/components/image-list/BasicImageList.js @@ -1,7 +1,7 @@ import * as React from 'react'; import { makeStyles } from '@material-ui/core/styles'; -import GridList from '@material-ui/core/GridList'; -import GridListTile from '@material-ui/core/GridListTile'; +import ImageList from '@material-ui/core/ImageList'; +import ImageListTile from '@material-ui/core/ImageListTile'; import tileData from './tileData'; const useStyles = makeStyles((theme) => ({ @@ -36,18 +36,18 @@ const useStyles = makeStyles((theme) => ({ * }, * ]; */ -export default function ImageGridList() { +export default function BasicImageList() { const classes = useStyles(); return (
- + {tileData.map((tile) => ( - + {tile.title} - + ))} - +
); } diff --git a/docs/src/pages/components/grid-list/ImageGridList.tsx b/docs/src/pages/components/image-list/BasicImageList.tsx similarity index 73% rename from docs/src/pages/components/grid-list/ImageGridList.tsx rename to docs/src/pages/components/image-list/BasicImageList.tsx index b0dd133da367fc..4a5e415f467352 100644 --- a/docs/src/pages/components/grid-list/ImageGridList.tsx +++ b/docs/src/pages/components/image-list/BasicImageList.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { Theme, createStyles, makeStyles } from '@material-ui/core/styles'; -import GridList from '@material-ui/core/GridList'; -import GridListTile from '@material-ui/core/GridListTile'; +import ImageList from '@material-ui/core/ImageList'; +import ImageListTile from '@material-ui/core/ImageListTile'; import tileData from './tileData'; const useStyles = makeStyles((theme: Theme) => @@ -38,18 +38,18 @@ const useStyles = makeStyles((theme: Theme) => * }, * ]; */ -export default function ImageGridList() { +export default function BasicImageList() { const classes = useStyles(); return (
- + {tileData.map((tile) => ( - + {tile.title} - + ))} - +
); } diff --git a/docs/src/pages/components/grid-list/SingleLineGridList.js b/docs/src/pages/components/image-list/SingleLineImageList.js similarity index 80% rename from docs/src/pages/components/grid-list/SingleLineGridList.js rename to docs/src/pages/components/image-list/SingleLineImageList.js index 4defaac4263d28..61ec41809c37bf 100644 --- a/docs/src/pages/components/grid-list/SingleLineGridList.js +++ b/docs/src/pages/components/image-list/SingleLineImageList.js @@ -1,8 +1,8 @@ import * as React from 'react'; import { makeStyles } from '@material-ui/core/styles'; -import GridList from '@material-ui/core/GridList'; -import GridListTile from '@material-ui/core/GridListTile'; -import GridListTileBar from '@material-ui/core/GridListTileBar'; +import ImageList from '@material-ui/core/ImageList'; +import ImageListTile from '@material-ui/core/ImageListTile'; +import ImageListTileBar from '@material-ui/core/ImageListTileBar'; import IconButton from '@material-ui/core/IconButton'; import StarBorderIcon from '@material-ui/icons/StarBorder'; import tileData from './tileData'; @@ -46,16 +46,16 @@ const useStyles = makeStyles((theme) => ({ * }, * ]; */ -export default function SingleLineGridList() { +export default function SingleLineImageList() { const classes = useStyles(); return (
- + {tileData.map((tile) => ( - + {tile.title} - } /> - + ))} - +
); } diff --git a/docs/src/pages/components/grid-list/SingleLineGridList.tsx b/docs/src/pages/components/image-list/SingleLineImageList.tsx similarity index 80% rename from docs/src/pages/components/grid-list/SingleLineGridList.tsx rename to docs/src/pages/components/image-list/SingleLineImageList.tsx index d3fa1476332e1a..7c97df4e0be094 100644 --- a/docs/src/pages/components/grid-list/SingleLineGridList.tsx +++ b/docs/src/pages/components/image-list/SingleLineImageList.tsx @@ -1,8 +1,8 @@ import * as React from 'react'; import { Theme, createStyles, makeStyles } from '@material-ui/core/styles'; -import GridList from '@material-ui/core/GridList'; -import GridListTile from '@material-ui/core/GridListTile'; -import GridListTileBar from '@material-ui/core/GridListTileBar'; +import ImageList from '@material-ui/core/ImageList'; +import ImageListTile from '@material-ui/core/ImageListTile'; +import ImageListTileBar from '@material-ui/core/ImageListTileBar'; import IconButton from '@material-ui/core/IconButton'; import StarBorderIcon from '@material-ui/icons/StarBorder'; import tileData from './tileData'; @@ -48,16 +48,16 @@ const useStyles = makeStyles((theme: Theme) => * }, * ]; */ -export default function SingleLineGridList() { +export default function SingleLineImageList() { const classes = useStyles(); return (
- + {tileData.map((tile) => ( - + {tile.title} - } /> - + ))} - +
); } diff --git a/docs/src/pages/components/grid-list/TitlebarGridList.js b/docs/src/pages/components/image-list/TitlebarImageList.js similarity index 74% rename from docs/src/pages/components/grid-list/TitlebarGridList.js rename to docs/src/pages/components/image-list/TitlebarImageList.js index 5bc88c11c7cd37..f5a6b19c538ae2 100644 --- a/docs/src/pages/components/grid-list/TitlebarGridList.js +++ b/docs/src/pages/components/image-list/TitlebarImageList.js @@ -1,8 +1,8 @@ import * as React from 'react'; import { makeStyles } from '@material-ui/core/styles'; -import GridList from '@material-ui/core/GridList'; -import GridListTile from '@material-ui/core/GridListTile'; -import GridListTileBar from '@material-ui/core/GridListTileBar'; +import ImageList from '@material-ui/core/ImageList'; +import ImageListTile from '@material-ui/core/ImageListTile'; +import ImageListTileBar from '@material-ui/core/ImageListTileBar'; import ListSubheader from '@material-ui/core/ListSubheader'; import IconButton from '@material-ui/core/IconButton'; import InfoIcon from '@material-ui/icons/Info'; @@ -42,19 +42,19 @@ const useStyles = makeStyles((theme) => ({ * }, * ]; */ -export default function TitlebarGridList() { +export default function TitlebarImageList() { const classes = useStyles(); return (
- - + + December - + {tileData.map((tile) => ( - + {tile.title} - by: {tile.author}} actionIcon={ @@ -66,9 +66,9 @@ export default function TitlebarGridList() { } /> - + ))} - +
); } diff --git a/docs/src/pages/components/grid-list/TitlebarGridList.tsx b/docs/src/pages/components/image-list/TitlebarImageList.tsx similarity index 75% rename from docs/src/pages/components/grid-list/TitlebarGridList.tsx rename to docs/src/pages/components/image-list/TitlebarImageList.tsx index 83b57479ab18e8..7baa6bf2d563b6 100644 --- a/docs/src/pages/components/grid-list/TitlebarGridList.tsx +++ b/docs/src/pages/components/image-list/TitlebarImageList.tsx @@ -1,8 +1,8 @@ import * as React from 'react'; import { Theme, createStyles, makeStyles } from '@material-ui/core/styles'; -import GridList from '@material-ui/core/GridList'; -import GridListTile from '@material-ui/core/GridListTile'; -import GridListTileBar from '@material-ui/core/GridListTileBar'; +import ImageList from '@material-ui/core/ImageList'; +import ImageListTile from '@material-ui/core/ImageListTile'; +import ImageListTileBar from '@material-ui/core/ImageListTileBar'; import ListSubheader from '@material-ui/core/ListSubheader'; import IconButton from '@material-ui/core/IconButton'; import InfoIcon from '@material-ui/icons/Info'; @@ -44,19 +44,19 @@ const useStyles = makeStyles((theme: Theme) => * }, * ]; */ -export default function TitlebarGridList() { +export default function TitlebarImageList() { const classes = useStyles(); return (
- - + + December - + {tileData.map((tile) => ( - + {tile.title} - by: {tile.author}} actionIcon={ @@ -68,9 +68,9 @@ export default function TitlebarGridList() { } /> - + ))} - +
); } diff --git a/docs/src/pages/components/grid-list/grid-list-de.md b/docs/src/pages/components/image-list/image-list-de.md similarity index 65% rename from docs/src/pages/components/grid-list/grid-list-de.md rename to docs/src/pages/components/image-list/image-list-de.md index dbfb643d84e7c3..96a1c7a2256877 100644 --- a/docs/src/pages/components/grid-list/grid-list-de.md +++ b/docs/src/pages/components/image-list/image-list-de.md @@ -1,6 +1,6 @@ --- title: Grid List React Komponente -components: GridList, GridListTile, GridListTileBar, ListSubheader, IconButton +components: ImageList, ImageListTile, ImageListTileBar, ListSubheader, IconButton --- # Rasterliste (Grid List) @@ -13,22 +13,22 @@ components: GridList, GridListTile, GridListTileBar, ListSubheader, IconButton Ein einfaches Beispiel für ein scrollbare `RasterList` mit Bildern. -{{"demo": "pages/components/grid-list/ImageGridList.js", "hideEditButton": true}} +{{"demo": "pages/components/image-list/ImageImageList.js", "hideEditButton": true}} ## Rasterliste mit Titelleisten -In diesem Beispiel wird die Verwendung der `GridListTileBar` veranschaulicht, um jeweils eine Überlagerung zu jedem `GridListTile`hinzuzufügen. Die Überlagerung kann einen `title`, `subtitle` und eine sekundäre Aktion aufnehmen - in diesem Beispiel ein `IconButton`. +In diesem Beispiel wird die Verwendung der `ImageListTileBar` veranschaulicht, um jeweils eine Überlagerung zu jedem `ImageListTile`hinzuzufügen. Die Überlagerung kann einen `title`, `subtitle` und eine sekundäre Aktion aufnehmen - in diesem Beispiel ein `IconButton`. -{{"demo": "pages/components/grid-list/TitlebarGridList.js", "hideEditButton": true}} +{{"demo": "pages/components/image-list/TitlebarImageList.js", "hideEditButton": true}} ## Einzeilige Rasterliste Dieses Beispiel zeigt eine horizontale, durchlaufbare, einzeilige Rasterliste von Bildern. Horizontales Scrollen von Rasterlisten wird empfohlen, da das Scrollen typische Lesemuster stört und das Verständnis beeinträchtigt. Eine Ausnahme ist eine horizontal scrollende, einzeilige Rasterliste von Bildern, z. B. einer Galerie. -{{"demo": "pages/components/grid-list/SingleLineGridList.js", "hideEditButton": true}} +{{"demo": "pages/components/image-list/SingleLineImageList.js", "hideEditButton": true}} ## Erweiterte Rasterliste In diesem Beispiel werden "vorgestellte" Fliesen dargestellt, wobei die Eigenschaften `rows` und `cols` die Größe der Kacheln festlegen und der Abstand durch die `padding` Eigenschaft einstellen wird. Die Kacheln haben eine angepasste Titleleiste, an der Spitze positioniert ist und einem benutzerdefinierten Gradienten `titleBackground` hat. Die sekundäre Aktion `IconButton` befindet sich links. -{{"demo": "pages/components/grid-list/AdvancedGridList.js", "hideEditButton": true, "defaultCodeOpen": false}} \ No newline at end of file +{{"demo": "pages/components/image-list/AdvancedImageList.js", "hideEditButton": true, "defaultCodeOpen": false}} \ No newline at end of file diff --git a/docs/src/pages/components/grid-list/grid-list-es.md b/docs/src/pages/components/image-list/image-list-es.md similarity index 65% rename from docs/src/pages/components/grid-list/grid-list-es.md rename to docs/src/pages/components/image-list/image-list-es.md index 60c2860d1894d7..efe2485f488393 100644 --- a/docs/src/pages/components/grid-list/grid-list-es.md +++ b/docs/src/pages/components/image-list/image-list-es.md @@ -1,6 +1,6 @@ --- title: Componente React para Lista cuadriculada -components: GridList, GridListTile, GridListTileBar, ListSubheader, IconButton +components: ImageList, ImageListTile, ImageListTileBar, ListSubheader, IconButton --- # Lista cuadriculada @@ -11,24 +11,24 @@ Las [Listas cuadriculadas](https://material.io/design/components/image-lists.htm ## Lista cuadriculada sólo con imágenes -Un ejemplo simple de una lista cuadriculada (`GridList`) con imágenes desplazables. +Un ejemplo simple de una lista cuadriculada (`ImageList`) con imágenes desplazables. -{{"demo": "pages/components/grid-list/ImageGridList.js", "hideEditButton": true}} +{{"demo": "pages/components/image-list/ImageImageList.js", "hideEditButton": true}} ## Lista cuadriculada con barras de título -Este ejemplo demuestra el uso de una barra para cuadro de lista cuadriculada (`GridListTileBar`) que agrega una capa sobrepuesta a cada cuadro en una lista cuadriculada (`GridListTile`). La capa sobrepuesta puede acomodar un título (`title`), subtítulo (`subtitle`), y acción secundaria (en este ejemplo un `IconButton`). +Este ejemplo demuestra el uso de una barra para cuadro de lista cuadriculada (`ImageListTileBar`) que agrega una capa sobrepuesta a cada cuadro en una lista cuadriculada (`ImageListTile`). La capa sobrepuesta puede acomodar un título (`title`), subtítulo (`subtitle`), y acción secundaria (en este ejemplo un `IconButton`). -{{"demo": "pages/components/grid-list/TitlebarGridList.js", "hideEditButton": true}} +{{"demo": "pages/components/image-list/TitlebarImageList.js", "hideEditButton": true}} ## Lista cuadriculada con una línea Este ejemplo muestra una lista cuadrícula con una sola línea desplazable horizontalmente. Se desaconseja usar listas cuadriculadas con desplazamiento horizontal ya que estas interfieren con los patrones típicos de lectura, afectando la comprensión. Una excepción notable es una lista cuadriculada que desplaza imágenes horizontalmente en una sola línea, como una galería. -{{"demo": "pages/components/grid-list/SingleLineGridList.js", "hideEditButton": true}} +{{"demo": "pages/components/image-list/SingleLineImageList.js", "hideEditButton": true}} ## Lista cuadriculada avanzada Este ejemplo muestra cuadros "destacados" usando los props filas (`rows`) y columnas (`cols`) para ajustar el tamaño del cuadro, y la prop relleno (`padding`) para ajustar el espaciado. Los cuadros tienen una barra de título personalizada, ubicada en la parte superior y un fondo de titulo (`titleBackground`) con degradado personalizado. La acción secundaria `IconButton` está ubicada a la izquierda. -{{"demo": "pages/components/grid-list/AdvancedGridList.js", "hideEditButton": true, "defaultCodeOpen": false}} \ No newline at end of file +{{"demo": "pages/components/image-list/AdvancedImageList.js", "hideEditButton": true, "defaultCodeOpen": false}} \ No newline at end of file diff --git a/docs/src/pages/components/grid-list/grid-list-fr.md b/docs/src/pages/components/image-list/image-list-fr.md similarity index 63% rename from docs/src/pages/components/grid-list/grid-list-fr.md rename to docs/src/pages/components/image-list/image-list-fr.md index fc2fa512f7c3db..ee0eb86516004b 100644 --- a/docs/src/pages/components/grid-list/grid-list-fr.md +++ b/docs/src/pages/components/image-list/image-list-fr.md @@ -1,6 +1,6 @@ --- title: Composant React Grid List -components: GridList, GridListTile, GridListTileBar, ListSubheader, IconButton +components: ImageList, ImageListTile, ImageListTileBar, ListSubheader, IconButton --- # Grid list @@ -11,24 +11,24 @@ components: GridList, GridListTile, GridListTileBar, ListSubheader, IconButton ## Grid list contenant uniquement des images -Un exemple simple d'image défilable `GridList`. +Un exemple simple d'image défilable `ImageList`. -{{"demo": "pages/components/grid-list/ImageGridList.js", "hideEditButton": true}} +{{"demo": "pages/components/image-list/ImageImageList.js", "hideEditButton": true}} ## Grid list avec barres de titre -Cet exemple illustre l'utilisation de `GridListTileBar` pour ajouter une superposition à chaque `GridListTile`. La superposition peut accueillir un `titre`, `sous - titre` et une action secondaire - dans cet exemple un `IconButton`. +Cet exemple illustre l'utilisation de `ImageListTileBar` pour ajouter une superposition à chaque `ImageListTile`. La superposition peut accueillir un `titre`, `sous - titre` et une action secondaire - dans cet exemple un `IconButton`. -{{"demo": "pages/components/grid-list/TitlebarGridList.js", "hideEditButton": true}} +{{"demo": "pages/components/image-list/TitlebarImageList.js", "hideEditButton": true}} ## Grid List sur une ligne Cet exemple illustre une grid list défilante horizontale d'images. Les listes de grille défilant horizontalement sont déconseillées car le défilement interfère avec les habitudes de lecture, ce qui affecte la compréhension. Une exception notable est la liste d'images comportant une seule ligne, telle qu'une galerie, qui défile horizontalement. -{{"demo": "pages/components/grid-list/SingleLineGridList.js", "hideEditButton": true}} +{{"demo": "pages/components/image-list/SingleLineImageList.js", "hideEditButton": true}} ## Grid list avancée Cet exemple montre des tuiles , en utilisant les `rows` et `cols`props pour ajuster la taille de la tuile, et le `padding` prop pour ajuster l'espacement. Les tuiles ont une barre de titre personnalisée, placée en haut et avec un dégradé personnalisé `titleBackground`. L'action secondaire `IconButton` est positionnée sur la gauche. -{{"demo": "pages/components/grid-list/AdvancedGridList.js", "hideEditButton": true, "defaultCodeOpen": false}} \ No newline at end of file +{{"demo": "pages/components/image-list/AdvancedImageList.js", "hideEditButton": true, "defaultCodeOpen": false}} \ No newline at end of file diff --git a/docs/src/pages/components/grid-list/grid-list-ja.md b/docs/src/pages/components/image-list/image-list-ja.md similarity index 65% rename from docs/src/pages/components/grid-list/grid-list-ja.md rename to docs/src/pages/components/image-list/image-list-ja.md index c1a8b299941a7c..83474bd42f2321 100644 --- a/docs/src/pages/components/grid-list/grid-list-ja.md +++ b/docs/src/pages/components/image-list/image-list-ja.md @@ -1,6 +1,6 @@ --- title: Grid List React component -components: GridList, GridListTile, GridListTileBar, ListSubheader, IconButton +components: ImageList, ImageListTile, ImageListTileBar, ListSubheader, IconButton --- # Grid List @@ -11,24 +11,24 @@ components: GridList, GridListTile, GridListTileBar, ListSubheader, IconButton ## 画像のみのGrid list -スクロール可能な画像の簡単な `GridList`の例。 +スクロール可能な画像の簡単な `ImageList`の例。 -{{"demo": "pages/components/grid-list/ImageGridList.js", "hideEditButton": true}} +{{"demo": "pages/components/image-list/ImageImageList.js", "hideEditButton": true}} ## タイトルバー付きのGrid list -この例は、 `GridListTileBar` を使用して、各 `GridListTile`オーバーレイを追加する方法を示しています。 オーバーレイには、 `title`, `subtitle` および副次的アクション例えば`IconButton`を含めることができます。 +この例は、 `ImageListTileBar` を使用して、各 `ImageListTile`オーバーレイを追加する方法を示しています。 オーバーレイには、 `title`, `subtitle` および副次的アクション例えば`IconButton`を含めることができます。 -{{"demo": "pages/components/grid-list/TitlebarGridList.js", "hideEditButton": true}} +{{"demo": "pages/components/image-list/TitlebarImageList.js", "hideEditButton": true}} ## Single line Grid list 単一行グリッドリスト この例では、水平スクロール可能な単一行グリッドの画像リストを示します。 水平方向のスクロールグリッドリストは、スクロールが一般的な読み方の邪魔になり理解に影響を与えるため、推奨されません。 注目すべき例外の1つは、水平にスクロールする、ギャラリーなどの画像の1行グリッドリストです。 -{{"demo": "pages/components/grid-list/SingleLineGridList.js", "hideEditButton": true}} +{{"demo": "pages/components/image-list/SingleLineImageList.js", "hideEditButton": true}} ## 高度なグリッドリスト この例では、`rows` and `cols` プロップを使用してタイルのサイズを調整し、 `padding`プロップを使用して間隔を調整する方法を示します。 タイルには、上部にカスタムのタイトルバーがあり、カスタムのグラデーション`titleBackground`があります。 セカンダリアクション `IconButton` は左側に配置されます。 -{{"demo": "pages/components/grid-list/AdvancedGridList.js", "hideEditButton": true, "defaultCodeOpen": false}} \ No newline at end of file +{{"demo": "pages/components/image-list/AdvancedImageList.js", "hideEditButton": true, "defaultCodeOpen": false}} \ No newline at end of file diff --git a/docs/src/pages/components/grid-list/grid-list-pt.md b/docs/src/pages/components/image-list/image-list-pt.md similarity index 64% rename from docs/src/pages/components/grid-list/grid-list-pt.md rename to docs/src/pages/components/image-list/image-list-pt.md index 6668c6374fb932..56ac37297109f2 100644 --- a/docs/src/pages/components/grid-list/grid-list-pt.md +++ b/docs/src/pages/components/image-list/image-list-pt.md @@ -1,6 +1,6 @@ --- title: Componente React para Lista de Grade -components: GridList, GridListTile, GridListTileBar, ListSubheader, IconButton +components: ImageList, ImageListTile, ImageListTileBar, ListSubheader, IconButton --- # Lista de Grade @@ -11,24 +11,24 @@ components: GridList, GridListTile, GridListTileBar, ListSubheader, IconButton ## Lista de grade com imagens -Um exemplo simples de uma `GridList` com imagens. +Um exemplo simples de uma `ImageList` com imagens. -{{"demo": "pages/components/grid-list/ImageGridList.js", "hideEditButton": true}} +{{"demo": "pages/components/image-list/ImageImageList.js", "hideEditButton": true}} ## Lista de grade com barras de título -Este exemplo demonstra o uso do `GridListTileBar` para adicionar uma sobreposição a cada `GridListTile`. A sobreposição pode acomodar um `title`, `subtitle` e ação secundária - neste exemplo utilizamos um `IconButton`. +Este exemplo demonstra o uso do `ImageListTileBar` para adicionar uma sobreposição a cada `ImageListTile`. A sobreposição pode acomodar um `title`, `subtitle` e ação secundária - neste exemplo utilizamos um `IconButton`. -{{"demo": "pages/components/grid-list/TitlebarGridList.js", "hideEditButton": true}} +{{"demo": "pages/components/image-list/TitlebarImageList.js", "hideEditButton": true}} ## Lista de grade em linha única Este exemplo demonstra uma lista de grade com imagens, em linha unica e rolável horizontalmente. As listas de grade de rolagem horizontal não são recomendadas porque a rolagem interfere nos padrões de leitura típicos, afetando a compreensão. Uma exceção notável para rolagem horizontal, seria uma lista de grade com imagens em linha única, como uma galeria. -{{"demo": "pages/components/grid-list/SingleLineGridList.js", "hideEditButton": true}} +{{"demo": "pages/components/image-list/SingleLineImageList.js", "hideEditButton": true}} ## Lista de grade avançada Este exemplo demonstra blocos "em destaque", usando as propriedades `rows` e `cols` para ajustar o tamanho do bloco, e a propriedade `padding` para ajustar o espaçamento. Os blocos tem uma barra de título customizada, posicionada no topo e com um gradiente personalizado `titleBackground`. A ação secundária `IconButton` está posicionada à esquerda. -{{"demo": "pages/components/grid-list/AdvancedGridList.js", "hideEditButton": true, "defaultCodeOpen": false}} \ No newline at end of file +{{"demo": "pages/components/image-list/AdvancedImageList.js", "hideEditButton": true, "defaultCodeOpen": false}} \ No newline at end of file diff --git a/docs/src/pages/components/grid-list/grid-list-ru.md b/docs/src/pages/components/image-list/image-list-ru.md similarity index 86% rename from docs/src/pages/components/grid-list/grid-list-ru.md rename to docs/src/pages/components/image-list/image-list-ru.md index 206ff993f7aa1d..218cd94fd080ce 100644 --- a/docs/src/pages/components/grid-list/grid-list-ru.md +++ b/docs/src/pages/components/image-list/image-list-ru.md @@ -1,6 +1,6 @@ --- title: Сеть изображений, компонент React -components: GridList, GridListTile, GridListTileBar, ListSubheader, IconButton +components: ImageList, ImageListTile, ImageListTileBar, ListSubheader, IconButton --- # Сеть изображений @@ -13,22 +13,22 @@ components: GridList, GridListTile, GridListTileBar, ListSubheader, IconButton Простой пример прокручиваемой `Сети изображений`. -{{"demo": "pages/components/grid-list/ImageGridList.js", "hideEditButton": true}} +{{"demo": "pages/components/image-list/ImageImageList.js", "hideEditButton": true}} ## Сеть изображений с заголовками Этот пример демонстрирует использование `Полосы заголовка сети изображений`, которую следует добавить в каждый `Заголовок сети изображений`. Мы можем указать `заголовок`, `подзаголовок` и дополнительное действие - в этом примере `кнопка-иконка`. -{{"demo": "pages/components/grid-list/TitlebarGridList.js", "hideEditButton": true}} +{{"demo": "pages/components/image-list/TitlebarImageList.js", "hideEditButton": true}} ## Сеть изображений в одну строку Данный пример показывает сеть изображений в одну строку с горизонтальной прокруткой. Сети изображений с горизонтальнйо прокруткой не рекомендуется применять, так как это может вызвать дискомфорт у пользователей, ведь обычно при чтении используется вертикальная прокрутка. Исключением из этого правила являются сети с горизонтальной прокруткой в одну строку, например галерея. -{{"demo": "pages/components/grid-list/SingleLineGridList.js", "hideEditButton": true}} +{{"demo": "pages/components/image-list/SingleLineImageList.js", "hideEditButton": true}} ## Более сложный пример В этом примере демонстрирует «рекомендуемые» листы, в которых используются свойства `rows` и `cols` чтобы отрегулировать размер плитки, и свойство `padding` чтобы отрегулировать поля между плитками. На плитках можно видеть пользовательскую полосу расположенную вверху с даным значением градиента в свойстве `titleBackground`. Дополнительное действие в `Кнопке-иконке` распложенно по левую сторону. -{{"demo": "pages/components/grid-list/AdvancedGridList.js", "hideEditButton": true, "defaultCodeOpen": false}} \ No newline at end of file +{{"demo": "pages/components/image-list/AdvancedImageList.js", "hideEditButton": true, "defaultCodeOpen": false}} \ No newline at end of file diff --git a/docs/src/pages/components/grid-list/grid-list-zh.md b/docs/src/pages/components/image-list/image-list-zh.md similarity index 64% rename from docs/src/pages/components/grid-list/grid-list-zh.md rename to docs/src/pages/components/image-list/image-list-zh.md index 12dfd4947bcfbe..c615a6cd9fbe65 100644 --- a/docs/src/pages/components/grid-list/grid-list-zh.md +++ b/docs/src/pages/components/image-list/image-list-zh.md @@ -1,6 +1,6 @@ --- title: React Grid List 网格列表组件 -components: GridList, GridListTile, GridListTileBar, ListSubheader, IconButton +components: ImageList, ImageListTile, ImageListTileBar, ListSubheader, IconButton --- # Grid List 网格列表 @@ -13,22 +13,22 @@ components: GridList, GridListTile, GridListTileBar, ListSubheader, IconButton 这是一个可滚动的图像的`网格列表`的简单示例。 -{{"demo": "pages/components/grid-list/ImageGridList.js", "hideEditButton": true}} +{{"demo": "pages/components/image-list/ImageImageList.js", "hideEditButton": true}} ## 带有标题栏的网格列表 -此示例演示如何使用 `GridListTileBar` 为每个 `GridListTile` 添加一个叠加层。 叠加层可以容纳 `title`, `subtitle` 和辅助操作—在本例中为 `IconButton`。 +此示例演示如何使用 `ImageListTileBar` 为每个 `ImageListTile` 添加一个叠加层。 叠加层可以容纳 `title`, `subtitle` 和辅助操作—在本例中为 `IconButton`。 -{{"demo": "pages/components/grid-list/TitlebarGridList.js", "hideEditButton": true}} +{{"demo": "pages/components/image-list/TitlebarImageList.js", "hideEditButton": true}} ## 单行网格列表 此示例演示了可以在水平方向滚动的单行纯图像网格列表。 我们其实不鼓励水平滚动网格列表,因为滚动会干扰典型的阅读模式,从而影响用户的理解。 一个值得注意的例外是水平滚动的单行网格图像列表,例如图库。 -{{"demo": "pages/components/grid-list/SingleLineGridList.js", "hideEditButton": true}} +{{"demo": "pages/components/image-list/SingleLineImageList.js", "hideEditButton": true}} ## 高级网格列表 此示例演示了“精选的”瓷砖效果 ,使用 `rows` 和 `cols` props 来调整磁贴的大小,并使用 `padding` 属性来调整间距。 瓷砖有一个位于顶部的自定义标题栏,并带有自定义渐变的 `titleBackground `。 而辅助操作的 `IconButton` 则位于左侧。 -{{"demo": "pages/components/grid-list/AdvancedGridList.js", "hideEditButton": true, "defaultCodeOpen": false}} \ No newline at end of file +{{"demo": "pages/components/image-list/AdvancedImageList.js", "hideEditButton": true, "defaultCodeOpen": false}} \ No newline at end of file diff --git a/docs/src/pages/components/image-list/image-list.md b/docs/src/pages/components/image-list/image-list.md new file mode 100644 index 00000000000000..b1f1c0b9c57914 --- /dev/null +++ b/docs/src/pages/components/image-list/image-list.md @@ -0,0 +1,43 @@ +--- +title: Image list React component +components: ImageList, ImageListTile, ImageListTileBar, ListSubheader, IconButton +materialDesign: https://material.io/components/image-lists +githubLabel: component: ImageList +--- + +# Image list + +

Image lists display a collection of images in an organized grid.

+ +Image lists represent a collection of items in a repeated pattern. They help improve the visual comprehension of the content they hold. + +{{"component": "modules/components/ComponentLinkHeader.js"}} + +## Basic image list + +A simple example of a scrollable image `ImageList`. + +{{"demo": "pages/components/image-list/BasicImageList.js", "hideEditButton": true}} + +## Image list with titlebars + +This example demonstrates the use of the `ImageListTileBar` to add an overlay to each `ImageListTile`. +The overlay can accommodate a `title`, `subtitle` and secondary action - in this example an `IconButton`. + +{{"demo": "pages/components/image-list/TitlebarImageList.js", "hideEditButton": true}} + +## Single line image list + +This example demonstrates a horizontal scrollable single-line image list of images. +Horizontally scrolling image lists are discouraged because the scrolling interferes with typical reading patterns, affecting comprehension. +One notable exception is a horizontally-scrolling, single-line image list of images, such as a gallery. + +{{"demo": "pages/components/image-list/SingleLineImageList.js", "hideEditButton": true}} + +## Advanced image list + +This example demonstrates "featured" tiles, using the `rows` and `cols` props to adjust the size of the tile, and the `padding` prop to adjust the spacing. +The tiles have a customized titlebar, positioned at the top and with a custom gradient `titleBackground`. +The secondary action `IconButton` is positioned on the left. + +{{"demo": "pages/components/image-list/AdvancedImageList.js", "hideEditButton": true, "defaultCodeOpen": false}} diff --git a/docs/src/pages/components/grid-list/tileData.d.ts b/docs/src/pages/components/image-list/tileData.d.ts similarity index 100% rename from docs/src/pages/components/grid-list/tileData.d.ts rename to docs/src/pages/components/image-list/tileData.d.ts diff --git a/docs/src/pages/components/grid-list/tileData.js b/docs/src/pages/components/image-list/tileData.js similarity index 58% rename from docs/src/pages/components/grid-list/tileData.js rename to docs/src/pages/components/image-list/tileData.js index 4884061233189d..4bd4f5614428f4 100644 --- a/docs/src/pages/components/grid-list/tileData.js +++ b/docs/src/pages/components/image-list/tileData.js @@ -1,66 +1,66 @@ const tileData = [ { - img: '/static/images/grid-list/breakfast.jpg', + img: '/static/images/image-list/breakfast.jpg', title: 'Breakfast', author: 'jill111', cols: 2, featured: true, }, { - img: '/static/images/grid-list/burgers.jpg', + img: '/static/images/image-list/burgers.jpg', title: 'Tasty burger', author: 'director90', }, { - img: '/static/images/grid-list/camera.jpg', + img: '/static/images/image-list/camera.jpg', title: 'Camera', author: 'Danson67', }, { - img: '/static/images/grid-list/morning.jpg', + img: '/static/images/image-list/morning.jpg', title: 'Morning', author: 'fancycrave1', featured: true, }, { - img: '/static/images/grid-list/hats.jpg', + img: '/static/images/image-list/hats.jpg', title: 'Hats', author: 'Hans', }, { - img: '/static/images/grid-list/honey.jpg', + img: '/static/images/image-list/honey.jpg', title: 'Honey', author: 'fancycravel', }, { - img: '/static/images/grid-list/vegetables.jpg', + img: '/static/images/image-list/vegetables.jpg', title: 'Vegetables', author: 'jill111', cols: 2, }, { - img: '/static/images/grid-list/plant.jpg', + img: '/static/images/image-list/plant.jpg', title: 'Water plant', author: 'BkrmadtyaKarki', }, { - img: '/static/images/grid-list/mushroom.jpg', + img: '/static/images/image-list/mushroom.jpg', title: 'Mushrooms', author: 'PublicDomainPictures', }, { - img: '/static/images/grid-list/olive.jpg', + img: '/static/images/image-list/olive.jpg', title: 'Olive oil', author: 'congerdesign', }, { - img: '/static/images/grid-list/star.jpg', + img: '/static/images/image-list/star.jpg', title: 'Sea star', cols: 2, author: '821292', }, { - img: '/static/images/grid-list/bike.jpg', + img: '/static/images/image-list/bike.jpg', title: 'Bike', author: 'danfador', }, diff --git a/docs/src/pages/components/grid-list/tslint.json b/docs/src/pages/components/image-list/tslint.json similarity index 100% rename from docs/src/pages/components/grid-list/tslint.json rename to docs/src/pages/components/image-list/tslint.json diff --git a/docs/src/pages/getting-started/supported-components/supported-components.md b/docs/src/pages/getting-started/supported-components/supported-components.md index 2df91f12874186..174cbef3a97305 100644 --- a/docs/src/pages/getting-started/supported-components/supported-components.md +++ b/docs/src/pages/getting-started/supported-components/supported-components.md @@ -50,7 +50,7 @@ to discuss the approach before submitting a pull request. - **[Inset](https://material.io/design/components/dividers.html#types) ✓** - **[Middle](https://material.io/design/components/dividers.html#types) ✓** - **[Subheader](https://material.io/design/components/dividers.html#types) ✓** -- **[Image lists](https://material.io/design/components/image-lists.html) ✓** (AKA Grid Lists) +- **[Image lists](https://material.io/components/image-lists) ✓** - **[Lists](https://material.io/design/components/lists.html) ✓** - [Types:](https://material.io/design/components/lists.html#types) - **Single line ✓** diff --git a/docs/src/pages/guides/migration-v4/migration-v4.md b/docs/src/pages/guides/migration-v4/migration-v4.md index 54cbcbe0478520..2fe067d7e87e65 100644 --- a/docs/src/pages/guides/migration-v4/migration-v4.md +++ b/docs/src/pages/guides/migration-v4/migration-v4.md @@ -257,7 +257,7 @@ For a smoother transition, the `adaptV4Theme` helper allows you to iteratively u ### ExpansionPanel -- Rename the `ExpansionPanel` components with `Accordion` to use a more common naming convention: +- Rename the `ExpansionPanel` components to `Accordion` to use a more common naming convention: ```diff -import ExpansionPanel from '@material-ui/core/ExpansionPanel'; @@ -319,6 +319,34 @@ For a smoother transition, the `adaptV4Theme` helper allows you to iteratively u + ``` +### GridList + +- Rename the `GridList` components to `ImageList` to align with the current Material Design naming. + +```diff +-import GridList from '@material-ui/core/GridList'; +-import GridListTile from '@material-ui/core/GridListTile'; +-import GridListTileBar from '@material-ui/core/GridListTileBar'; ++import ImageList from '@material-ui/core/ImageList'; ++import ImageListTile from '@material-ui/core/ImageListTile'; ++import ImageListTileBar from '@material-ui/core/ImageListTileBar'; + +- +- ++ ++ + Image title +- +- +- ++ ++ +``` + ### Menu - The onE\* transition props were removed. Use TransitionProps instead. diff --git a/packages/material-ui-codemod/src/v4.0.0/optimal-imports.test/actual.js b/packages/material-ui-codemod/src/v4.0.0/optimal-imports.test/actual.js index 0b0bc64d6e84fe..8c029483ee2999 100644 --- a/packages/material-ui-codemod/src/v4.0.0/optimal-imports.test/actual.js +++ b/packages/material-ui-codemod/src/v4.0.0/optimal-imports.test/actual.js @@ -33,8 +33,6 @@ import ExpansionPanelActions from '@material-ui/core/ExpansionPanelActions'; import ExpansionPanelDetails from '@material-ui/core/ExpansionPanelDetails'; import ExpansionPanelSummary from '@material-ui/core/ExpansionPanelSummary'; import ExpansionPanel from '@material-ui/core/ExpansionPanel'; -import GridListTile from '@material-ui/core/GridListTile'; -import GridList from '@material-ui/core/GridList'; import CircularProgress from '@material-ui/core/CircularProgress'; import MuiLinearProgress from '@material-ui/core/LinearProgress'; import FormHelperText from '@material-ui/core/FormHelperText'; diff --git a/packages/material-ui-codemod/src/v4.0.0/optimal-imports.test/expected.js b/packages/material-ui-codemod/src/v4.0.0/optimal-imports.test/expected.js index 5231dd4a80aaea..9190fca48d9460 100644 --- a/packages/material-ui-codemod/src/v4.0.0/optimal-imports.test/expected.js +++ b/packages/material-ui-codemod/src/v4.0.0/optimal-imports.test/expected.js @@ -31,8 +31,6 @@ import ExpansionPanelActions from '@material-ui/core/ExpansionPanelActions'; import ExpansionPanelDetails from '@material-ui/core/ExpansionPanelDetails'; import ExpansionPanelSummary from '@material-ui/core/ExpansionPanelSummary'; import ExpansionPanel from '@material-ui/core/ExpansionPanel'; -import GridListTile from '@material-ui/core/GridListTile'; -import GridList from '@material-ui/core/GridList'; import CircularProgress from '@material-ui/core/CircularProgress'; import MuiLinearProgress from '@material-ui/core/LinearProgress'; import FormHelperText from '@material-ui/core/FormHelperText'; diff --git a/packages/material-ui-codemod/src/v4.0.0/top-level-imports.test/actual.js b/packages/material-ui-codemod/src/v4.0.0/top-level-imports.test/actual.js index 86199a3a0f86ec..75de417f482faa 100644 --- a/packages/material-ui-codemod/src/v4.0.0/top-level-imports.test/actual.js +++ b/packages/material-ui-codemod/src/v4.0.0/top-level-imports.test/actual.js @@ -31,8 +31,6 @@ import AccordionActions from '@material-ui/core/AccordionActions'; import AccordionDetails from '@material-ui/core/AccordionDetails'; import AccordionSummary from '@material-ui/core/AccordionSummary'; import Accordion from '@material-ui/core/Accordion'; -import GridListTile from '@material-ui/core/GridListTile'; -import GridList from '@material-ui/core/GridList'; import CircularProgress from '@material-ui/core/CircularProgress'; import MuiLinearProgress from '@material-ui/core/LinearProgress'; import FormHelperText from '@material-ui/core/FormHelperText'; diff --git a/packages/material-ui-codemod/src/v4.0.0/top-level-imports.test/expected.js b/packages/material-ui-codemod/src/v4.0.0/top-level-imports.test/expected.js index 97f0c772ba0cbc..d76e6c6ede9131 100644 --- a/packages/material-ui-codemod/src/v4.0.0/top-level-imports.test/expected.js +++ b/packages/material-ui-codemod/src/v4.0.0/top-level-imports.test/expected.js @@ -33,8 +33,6 @@ import { AccordionDetails, AccordionSummary, Accordion, - GridListTile, - GridList, CircularProgress, LinearProgress as MuiLinearProgress, FormHelperText, diff --git a/packages/material-ui/src/GridList/index.d.ts b/packages/material-ui/src/GridList/index.d.ts deleted file mode 100644 index ccb08b003a8dbd..00000000000000 --- a/packages/material-ui/src/GridList/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from './GridList'; -export * from './GridList'; diff --git a/packages/material-ui/src/GridList/index.js b/packages/material-ui/src/GridList/index.js deleted file mode 100644 index b31386ab5ae4dc..00000000000000 --- a/packages/material-ui/src/GridList/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './GridList'; diff --git a/packages/material-ui/src/GridListTile/GridListTile.d.ts b/packages/material-ui/src/GridListTile/GridListTile.d.ts deleted file mode 100644 index bac195f107f7f3..00000000000000 --- a/packages/material-ui/src/GridListTile/GridListTile.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -import * as React from 'react'; -import { OverridableComponent, OverrideProps } from '../OverridableComponent'; - -export interface GridListTileTypeMap

{ - props: P & { - /** - * Theoretically you can pass any node as children, but the main use case is to pass an img, - * in which case GridListTile takes care of making the image "cover" available space - * (similar to `background-size: cover` or to `object-fit: cover`). - */ - children?: React.ReactNode; - /** - * Override or extend the styles applied to the component. - */ - classes?: { - /** Styles applied to the root element. */ - root?: string; - /** Styles applied to the `div` element that wraps the children. */ - tile?: string; - /** Styles applied to an `img` element child, if needed to ensure it covers the tile. */ - imgFullHeight?: string; - /** Styles applied to an `img` element child, if needed to ensure it covers the tile. */ - imgFullWidth?: string; - }; - /** - * Width of the tile in number of grid cells. - */ - cols?: number; - /** - * Height of the tile in number of grid cells. - */ - rows?: number; - }; - defaultComponent: D; -} -/** - * - * Demos: - * - * - [Grid List](https://material-ui.com/components/grid-list/) - * - * API: - * - * - [GridListTile API](https://material-ui.com/api/grid-list-tile/) - */ -declare const GridListTile: OverridableComponent; - -export type GridListTileClassKey = keyof NonNullable; - -export type GridListTileProps< - D extends React.ElementType = GridListTileTypeMap['defaultComponent'], - P = {} -> = OverrideProps, D>; - -export default GridListTile; diff --git a/packages/material-ui/src/GridListTile/index.d.ts b/packages/material-ui/src/GridListTile/index.d.ts deleted file mode 100644 index 25a1add1cf5966..00000000000000 --- a/packages/material-ui/src/GridListTile/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from './GridListTile'; -export * from './GridListTile'; diff --git a/packages/material-ui/src/GridListTile/index.js b/packages/material-ui/src/GridListTile/index.js deleted file mode 100644 index a2f96968c37576..00000000000000 --- a/packages/material-ui/src/GridListTile/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './GridListTile'; diff --git a/packages/material-ui/src/GridListTileBar/index.d.ts b/packages/material-ui/src/GridListTileBar/index.d.ts deleted file mode 100644 index 3ecc2f66424d24..00000000000000 --- a/packages/material-ui/src/GridListTileBar/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from './GridListTileBar'; -export * from './GridListTileBar'; diff --git a/packages/material-ui/src/GridListTileBar/index.js b/packages/material-ui/src/GridListTileBar/index.js deleted file mode 100644 index 5b368926b920fc..00000000000000 --- a/packages/material-ui/src/GridListTileBar/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './GridListTileBar'; diff --git a/packages/material-ui/src/IconButton/IconButton.d.ts b/packages/material-ui/src/IconButton/IconButton.d.ts index 04a36137cb008e..1b8b7c81f1e3e0 100644 --- a/packages/material-ui/src/IconButton/IconButton.d.ts +++ b/packages/material-ui/src/IconButton/IconButton.d.ts @@ -68,7 +68,7 @@ export type IconButtonTypeMap< * Demos: * * - [Buttons](https://material-ui.com/components/buttons/) - * - [Grid List](https://material-ui.com/components/grid-list/) + * - [Image List](https://material-ui.com/components/image-list/) * * API: * diff --git a/packages/material-ui/src/GridList/GridList.d.ts b/packages/material-ui/src/ImageList/ImageList.d.ts similarity index 56% rename from packages/material-ui/src/GridList/GridList.d.ts rename to packages/material-ui/src/ImageList/ImageList.d.ts index a8e2776a2755a8..0e6d3bcff93264 100644 --- a/packages/material-ui/src/GridList/GridList.d.ts +++ b/packages/material-ui/src/ImageList/ImageList.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; -export interface GridListTypeMap

{ +export interface ImageListTypeMap

{ props: P & { /** * Number of px for one cell height. @@ -9,7 +9,7 @@ export interface GridListTypeMap

{ */ cellHeight?: number | 'auto'; /** - * Grid Tiles that will be in Grid List. + * Image Tiles that will be in Image List. */ children: NonNullable; /** @@ -34,19 +34,19 @@ export interface GridListTypeMap

{ * * Demos: * - * - [Grid List](https://material-ui.com/components/grid-list/) + * - [Image List](https://material-ui.com/components/image-list/) * * API: * - * - [GridList API](https://material-ui.com/api/grid-list/) + * - [ImageList API](https://material-ui.com/api/image-list/) */ -declare const GridList: OverridableComponent; +declare const ImageList: OverridableComponent; -export type GridListClassKey = keyof NonNullable; +export type ImageListClassKey = keyof NonNullable; -export type GridListProps< - D extends React.ElementType = GridListTypeMap['defaultComponent'], +export type ImageListProps< + D extends React.ElementType = ImageListTypeMap['defaultComponent'], P = {} -> = OverrideProps, D>; +> = OverrideProps, D>; -export default GridList; +export default ImageList; diff --git a/packages/material-ui/src/GridList/GridList.js b/packages/material-ui/src/ImageList/ImageList.js similarity index 89% rename from packages/material-ui/src/GridList/GridList.js rename to packages/material-ui/src/ImageList/ImageList.js index 86b6194e218496..0a043f88f34da5 100644 --- a/packages/material-ui/src/GridList/GridList.js +++ b/packages/material-ui/src/ImageList/ImageList.js @@ -16,7 +16,7 @@ export const styles = { }, }; -const GridList = React.forwardRef(function GridList(props, ref) { +const ImageList = React.forwardRef(function ImageList(props, ref) { const { cellHeight = 180, children, @@ -45,7 +45,7 @@ const GridList = React.forwardRef(function GridList(props, ref) { if (isFragment(child)) { console.error( [ - "Material-UI: The GridList component doesn't accept a Fragment as a child.", + "Material-UI: The ImageList component doesn't accept a Fragment as a child.", 'Consider providing an array instead.', ].join('\n'), ); @@ -68,7 +68,7 @@ const GridList = React.forwardRef(function GridList(props, ref) { ); }); -GridList.propTypes = { +ImageList.propTypes = { // ----------------------------- Warning -------------------------------- // | These PropTypes are generated from the TypeScript type definitions | // | To update them edit the d.ts file and run "yarn proptypes" | @@ -79,7 +79,7 @@ GridList.propTypes = { */ cellHeight: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]), /** - * Grid Tiles that will be in Grid List. + * Image Tiles that will be in Image List. */ children: PropTypes /* @typescript-to-proptypes-ignore */.node.isRequired, /** @@ -109,4 +109,4 @@ GridList.propTypes = { style: PropTypes.object, }; -export default withStyles(styles, { name: 'MuiGridList' })(GridList); +export default withStyles(styles, { name: 'MuiImageList' })(ImageList); diff --git a/packages/material-ui/src/GridList/GridList.test.js b/packages/material-ui/src/ImageList/ImageList.test.js similarity index 83% rename from packages/material-ui/src/GridList/GridList.test.js rename to packages/material-ui/src/ImageList/ImageList.test.js index 5e7fb8f1e56614..6a1d405ef647bf 100644 --- a/packages/material-ui/src/GridList/GridList.test.js +++ b/packages/material-ui/src/ImageList/ImageList.test.js @@ -1,35 +1,35 @@ import * as React from 'react'; import { expect } from 'chai'; import { createShallow, getClasses, createMount, describeConformance } from 'test/utils'; -import GridList from './GridList'; +import ImageList from './ImageList'; const tilesData = [ { - img: 'images/grid-list/00-52-29-429_640.jpg', + img: 'images/image-list/00-52-29-429_640.jpg', title: 'Breakfast', author: 'jill111', }, { - img: 'images/grid-list/burger-827309_640.jpg', + img: 'images/image-list/burger-827309_640.jpg', title: 'Tasty burger', author: 'director90', }, ]; -describe('', () => { +describe('', () => { let classes; const mount = createMount(); let shallow; before(() => { - classes = getClasses(); + classes = getClasses(); shallow = createShallow({ dive: true }); }); describeConformance( - +

- , + , () => ({ classes, inheritComponent: 'ul', @@ -42,7 +42,7 @@ describe('', () => { it('should render children and change cellHeight', () => { const cellHeight = 250; const wrapper = shallow( - + {tilesData.map((tile) => ( ', () => { foo ))} - , + , ); expect(wrapper.find('.grid-tile').length).to.equal(2); @@ -62,7 +62,7 @@ describe('', () => { it('renders children by default', () => { const wrapper = shallow( - + {tilesData.map((tile) => ( ', () => { ))} {false && this is a null child} - , + , ); expect(wrapper.find('.grid-tile').length).to.equal(2); @@ -82,7 +82,7 @@ describe('', () => { it('renders children and change cols', () => { const wrapper = shallow( - + {tilesData.map((tile) => ( ', () => { foo ))} - , + , ); expect(wrapper.find('.grid-tile').length).to.equal(2); @@ -103,7 +103,7 @@ describe('', () => { it('renders children and change spacing', () => { const spacing = 10; const wrapper = shallow( - + {tilesData.map((tile) => ( ', () => { foo ))} - , + , ); expect(wrapper.find('.grid-tile').length).to.equal(2); @@ -124,7 +124,7 @@ describe('', () => { it('should render children and overwrite style', () => { const style = { backgroundColor: 'red' }; const wrapper = shallow( - + {tilesData.map((tile) => ( ', () => { foo ))} - , + , ); expect(wrapper.find('.grid-tile').length).to.equal(2); @@ -145,9 +145,9 @@ describe('', () => { describe('prop: cellHeight', () => { it('should accept auto as a property', () => { const wrapper = shallow( - +
-
, + , ); expect(wrapper.children().at(0).props().style.height).to.equal('auto'); @@ -157,10 +157,10 @@ describe('', () => { it('warns a Fragment is passed as a child', () => { expect(() => { mount( - + - , + , ); - }).toErrorDev("Material-UI: The GridList component doesn't accept a Fragment as a child."); + }).toErrorDev("Material-UI: The ImageList component doesn't accept a Fragment as a child."); }); }); diff --git a/packages/material-ui/src/ImageList/index.d.ts b/packages/material-ui/src/ImageList/index.d.ts new file mode 100644 index 00000000000000..f38037f0bc3a5a --- /dev/null +++ b/packages/material-ui/src/ImageList/index.d.ts @@ -0,0 +1,2 @@ +export { default } from './ImageList'; +export * from './ImageList'; diff --git a/packages/material-ui/src/ImageList/index.js b/packages/material-ui/src/ImageList/index.js new file mode 100644 index 00000000000000..a5ec3349f1e072 --- /dev/null +++ b/packages/material-ui/src/ImageList/index.js @@ -0,0 +1 @@ +export { default } from './ImageList'; diff --git a/packages/material-ui/src/ImageListTile/ImageListTile.d.ts b/packages/material-ui/src/ImageListTile/ImageListTile.d.ts new file mode 100644 index 00000000000000..a4db88b76b9bf0 --- /dev/null +++ b/packages/material-ui/src/ImageListTile/ImageListTile.d.ts @@ -0,0 +1,43 @@ +import * as React from 'react'; +import { OverridableComponent, OverrideProps } from '../OverridableComponent'; + +export interface ImageListTileTypeMap

{ + props: P & { + /** + * Theoretically you can pass any node as children, but the main use case is to pass an img, + * in which case ImageListTile takes care of making the image "cover" available space + * (similar to `background-size: cover` or to `object-fit: cover`). + */ + children?: React.ReactNode; + /** + * Width of the tile in number of grid cells. + */ + cols?: number; + /** + * Height of the tile in number of grid cells. + */ + rows?: number; + }; + defaultComponent: D; + classKey: ImageListTileClassKey; +} +/** + * + * Demos: + * + * - [Image List](https://material-ui.com/components/image-list/) + * + * API: + * + * - [ImageListTile API](https://material-ui.com/api/image-list-tile/) + */ +declare const ImageListTile: OverridableComponent; + +export type ImageListTileClassKey = 'root' | 'tile' | 'imgFullHeight' | 'imgFullWidth'; + +export type ImageListTileProps< + D extends React.ElementType = ImageListTileTypeMap['defaultComponent'], + P = {} +> = OverrideProps, D>; + +export default ImageListTile; diff --git a/packages/material-ui/src/GridListTile/GridListTile.js b/packages/material-ui/src/ImageListTile/ImageListTile.js similarity index 93% rename from packages/material-ui/src/GridListTile/GridListTile.js rename to packages/material-ui/src/ImageListTile/ImageListTile.js index f3b5dce32c3747..f9b4ae1516db7d 100644 --- a/packages/material-ui/src/GridListTile/GridListTile.js +++ b/packages/material-ui/src/ImageListTile/ImageListTile.js @@ -52,7 +52,7 @@ const fit = (imgEl, classes) => { } }; -const GridListTile = React.forwardRef(function GridListTile(props, ref) { +const ImageListTile = React.forwardRef(function ImageListTile(props, ref) { // cols rows default values are for docs only const { children, @@ -127,14 +127,14 @@ const GridListTile = React.forwardRef(function GridListTile(props, ref) { ); }); -GridListTile.propTypes = { +ImageListTile.propTypes = { // ----------------------------- Warning -------------------------------- // | These PropTypes are generated from the TypeScript type definitions | // | To update them edit the d.ts file and run "yarn proptypes" | // ---------------------------------------------------------------------- /** * Theoretically you can pass any node as children, but the main use case is to pass an img, - * in which case GridListTile takes care of making the image "cover" available space + * in which case ImageListTile takes care of making the image "cover" available space * (similar to `background-size: cover` or to `object-fit: cover`). */ children: PropTypes.node, @@ -161,4 +161,4 @@ GridListTile.propTypes = { rows: PropTypes.number, }; -export default withStyles(styles, { name: 'MuiGridListTile' })(GridListTile); +export default withStyles(styles, { name: 'MuiImageListTile' })(ImageListTile); diff --git a/packages/material-ui/src/GridListTile/GridListTile.test.js b/packages/material-ui/src/ImageListTile/ImageListTile.test.js similarity index 89% rename from packages/material-ui/src/GridListTile/GridListTile.test.js rename to packages/material-ui/src/ImageListTile/ImageListTile.test.js index 43648acb0225c0..1032ce81c67930 100644 --- a/packages/material-ui/src/GridListTile/GridListTile.test.js +++ b/packages/material-ui/src/ImageListTile/ImageListTile.test.js @@ -2,17 +2,17 @@ import * as React from 'react'; import { expect } from 'chai'; import { spy, useFakeTimers } from 'sinon'; import { getClasses, createMount, describeConformance } from 'test/utils'; -import GridListTile from './GridListTile'; +import ImageListTile from './ImageListTile'; -describe('', () => { +describe('', () => { const mount = createMount(); let classes; before(() => { - classes = getClasses(); + classes = getClasses(); }); - describeConformance(, () => ({ + describeConformance(, () => ({ classes, inheritComponent: 'li', mount, @@ -21,7 +21,7 @@ describe('', () => { })); const tileData = { - img: 'images/grid-list/00-52-29-429_640.jpg', + img: 'images/image-list/00-52-29-429_640.jpg', title: 'Breakfast', author: 'jill111', }; @@ -29,14 +29,14 @@ describe('', () => { describe('prop: children', () => { it('should render children by default', () => { const children = foo; - const wrapper = mount({children}); + const wrapper = mount({children}); expect(wrapper.containsMatchingElement(children)).to.equal(true); }); it('should not change non image child', () => { const children =

; - const wrapper = mount({children}); + const wrapper = mount({children}); expect(wrapper.containsMatchingElement(children)).to.equal(true); }); }); @@ -50,10 +50,10 @@ describe('', () => { Image.muiName = 'Image'; return mount( - + {null} - , + , ); } diff --git a/packages/material-ui/src/ImageListTile/index.d.ts b/packages/material-ui/src/ImageListTile/index.d.ts new file mode 100644 index 00000000000000..eec68107fd6333 --- /dev/null +++ b/packages/material-ui/src/ImageListTile/index.d.ts @@ -0,0 +1,2 @@ +export { default } from './ImageListTile'; +export * from './ImageListTile'; diff --git a/packages/material-ui/src/ImageListTile/index.js b/packages/material-ui/src/ImageListTile/index.js new file mode 100644 index 00000000000000..cd45ce9f207f1f --- /dev/null +++ b/packages/material-ui/src/ImageListTile/index.js @@ -0,0 +1 @@ +export { default } from './ImageListTile'; diff --git a/packages/material-ui/src/GridListTileBar/GridListTileBar.d.ts b/packages/material-ui/src/ImageListTileBar/ImageListTileBar.d.ts similarity index 83% rename from packages/material-ui/src/GridListTileBar/GridListTileBar.d.ts rename to packages/material-ui/src/ImageListTileBar/ImageListTileBar.d.ts index 9c94e91fcf36a4..db0c79f6759951 100644 --- a/packages/material-ui/src/GridListTileBar/GridListTileBar.d.ts +++ b/packages/material-ui/src/ImageListTileBar/ImageListTileBar.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { InternalStandardProps as StandardProps } from '..'; -export interface GridListTileBarProps +export interface ImageListTileBarProps extends StandardProps, 'title'> { /** * An IconButton element to be used as secondary action target @@ -53,16 +53,16 @@ export interface GridListTileBarProps titlePosition?: 'top' | 'bottom'; } -export type GridListTileBarClassKey = keyof NonNullable; +export type ImageListTileBarClassKey = keyof NonNullable; /** * * Demos: * - * - [Grid List](https://material-ui.com/components/grid-list/) + * - [Image List](https://material-ui.com/components/image-list/) * * API: * - * - [GridListTileBar API](https://material-ui.com/api/grid-list-tile-bar/) + * - [ImageListTileBar API](https://material-ui.com/api/image-list-tile-bar/) */ -export default function GridListTileBar(props: GridListTileBarProps): JSX.Element; +export default function ImageListTileBar(props: ImageListTileBarProps): JSX.Element; diff --git a/packages/material-ui/src/GridListTileBar/GridListTileBar.js b/packages/material-ui/src/ImageListTileBar/ImageListTileBar.js similarity index 95% rename from packages/material-ui/src/GridListTileBar/GridListTileBar.js rename to packages/material-ui/src/ImageListTileBar/ImageListTileBar.js index 6f84bb71fdde9b..7a1632fd68f6e6 100644 --- a/packages/material-ui/src/GridListTileBar/GridListTileBar.js +++ b/packages/material-ui/src/ImageListTileBar/ImageListTileBar.js @@ -67,7 +67,7 @@ export const styles = (theme) => ({ }, }); -const GridListTileBar = React.forwardRef(function GridListTileBar(props, ref) { +const ImageListTileBar = React.forwardRef(function ImageListTileBar(props, ref) { const { actionIcon, actionPosition = 'right', @@ -117,7 +117,7 @@ const GridListTileBar = React.forwardRef(function GridListTileBar(props, ref) { ); }); -GridListTileBar.propTypes = { +ImageListTileBar.propTypes = { // ----------------------------- Warning -------------------------------- // | These PropTypes are generated from the TypeScript type definitions | // | To update them edit the d.ts file and run "yarn proptypes" | @@ -157,4 +157,4 @@ GridListTileBar.propTypes = { titlePosition: PropTypes.oneOf(['bottom', 'top']), }; -export default withStyles(styles, { name: 'MuiGridListTileBar' })(GridListTileBar); +export default withStyles(styles, { name: 'MuiImageListTileBar' })(ImageListTileBar); diff --git a/packages/material-ui/src/GridListTileBar/GridListTileBar.test.js b/packages/material-ui/src/ImageListTileBar/ImageListTileBar.test.js similarity index 64% rename from packages/material-ui/src/GridListTileBar/GridListTileBar.test.js rename to packages/material-ui/src/ImageListTileBar/ImageListTileBar.test.js index 2440da0100a3fe..b37615713e4caa 100644 --- a/packages/material-ui/src/GridListTileBar/GridListTileBar.test.js +++ b/packages/material-ui/src/ImageListTileBar/ImageListTileBar.test.js @@ -1,19 +1,19 @@ import * as React from 'react'; import { expect } from 'chai'; import { createShallow, getClasses, createMount, describeConformance } from 'test/utils'; -import GridListTileBar from './GridListTileBar'; +import ImageListTileBar from './ImageListTileBar'; -describe('', () => { +describe('', () => { let classes; const mount = createMount(); let shallow; before(() => { - classes = getClasses(); + classes = getClasses(); shallow = createShallow({ dive: true }); }); - describeConformance(, () => ({ + describeConformance(, () => ({ classes, inheritComponent: 'div', mount, @@ -22,14 +22,14 @@ describe('', () => { })); const tileData = { - img: 'images/grid-list/00-52-29-429_640.jpg', + img: 'images/image-list/00-52-29-429_640.jpg', title: 'Breakfast', author: 'jill111', }; describe('prop: title', () => { it('should renders title', () => { - const wrapper = shallow(); + const wrapper = shallow(); expect(wrapper.children('div').text()).to.equal(tileData.title); }); diff --git a/packages/material-ui/src/ImageListTileBar/index.d.ts b/packages/material-ui/src/ImageListTileBar/index.d.ts new file mode 100644 index 00000000000000..f6c234d372d026 --- /dev/null +++ b/packages/material-ui/src/ImageListTileBar/index.d.ts @@ -0,0 +1,2 @@ +export { default } from './ImageListTileBar'; +export * from './ImageListTileBar'; diff --git a/packages/material-ui/src/ImageListTileBar/index.js b/packages/material-ui/src/ImageListTileBar/index.js new file mode 100644 index 00000000000000..351e42c714ee66 --- /dev/null +++ b/packages/material-ui/src/ImageListTileBar/index.js @@ -0,0 +1 @@ +export { default } from './ImageListTileBar'; diff --git a/packages/material-ui/src/ListSubheader/ListSubheader.d.ts b/packages/material-ui/src/ListSubheader/ListSubheader.d.ts index 5f709564c07030..404c57c63c592e 100644 --- a/packages/material-ui/src/ListSubheader/ListSubheader.d.ts +++ b/packages/material-ui/src/ListSubheader/ListSubheader.d.ts @@ -48,7 +48,7 @@ export interface ListSubheaderTypeMap

( ); -const GridListTest = () => ( - log(e)}> - log(e)}> +const ImageListTest = () => ( + log(e)}> + log(e)}> alt text - + , - + ); const ListTest = () => ( diff --git a/test/regressions/index.js b/test/regressions/index.js index 3234080a62313c..5fe4f191d3fe19 100644 --- a/test/regressions/index.js +++ b/test/regressions/index.js @@ -49,7 +49,7 @@ const blacklist = [ 'docs-components-drawers/SwipeableTemporaryDrawer.png', // Needs interaction 'docs-components-drawers/TemporaryDrawer.png', // Needs interaction 'docs-components-floating-action-button/FloatingActionButtonZoom.png', // Needs interaction - 'docs-components-grid-list', // Image don't load + 'docs-components-image-list', // Image don't load 'docs-components-grid/InteractiveGrid.png', // Redux isolation 'docs-components-grid/SpacingGrid.png', // Needs interaction 'docs-components-hidden', // Need to dynamically resize to test