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

[ImageList] Refactor using CSS grid & React context #22395

Merged
merged 40 commits into from
Sep 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
c136a7e
ImageList] use CSS grid
mbrookes Aug 28, 2020
ea3a542
Use context
mbrookes Aug 28, 2020
aa16e1e
ImageListItem - No fragement child
mbrookes Aug 29, 2020
54702ea
No IE11
mbrookes Aug 29, 2020
54cd5c4
grid -> image
mbrookes Aug 29, 2020
436e0a8
remove legacy tests
mbrookes Aug 29, 2020
db7ff55
proptypes
mbrookes Aug 29, 2020
d1dadd0
even more tile -> item
mbrookes Aug 29, 2020
3a2ebd0
lint & prettier
mbrookes Aug 29, 2020
86b9cfd
docs:api
mbrookes Aug 29, 2020
facb776
Update demos
mbrookes Aug 30, 2020
057ee9f
Woven image list demo
mbrookes Aug 30, 2020
408e94b
masonry image list
mbrookes Aug 30, 2020
fa7e8bf
Clean up demos
mbrookes Aug 30, 2020
f3e9644
docs:api
mbrookes Aug 30, 2020
1dfb130
lint
mbrookes Aug 30, 2020
e9e594d
Fix woven
mbrookes Aug 30, 2020
532677b
refine image chice
mbrookes Aug 30, 2020
fdf1364
Image order
mbrookes Aug 30, 2020
0f77775
Title bar below image
mbrookes Sep 2, 2020
8249046
tests
mbrookes Sep 5, 2020
76bb54d
Update IE11 error message
mbrookes Sep 6, 2020
e3d4507
Olivier's review
mbrookes Sep 6, 2020
8561fc1
spacing -> gap
mbrookes Sep 7, 2020
ac99c3d
Apply suggestions from code review
mbrookes Sep 7, 2020
04cebaf
Use imagesplash for non-"peer" item data
mbrookes Sep 7, 2020
3f26171
Use unsplash for "peer" images
mbrookes Sep 7, 2020
a12ccfa
image order
mbrookes Sep 7, 2020
69b75c9
lint, remove dead images
mbrookes Sep 8, 2020
f01de28
skip jsdom in tests for computed styles
mbrookes Sep 8, 2020
31fbba6
don't hide edit button
mbrookes Sep 8, 2020
889b3e4
skip?
mbrookes Sep 8, 2020
93938dd
Update packages/material-ui/src/ImageList/ImageList.d.ts
mbrookes Sep 8, 2020
ade0ef8
remove contentious tests
mbrookes Sep 8, 2020
622741e
Merge branch 'imagelist-use-grid' of https://github.com/mbrookes/mate…
mbrookes Sep 9, 2020
f6aa905
Use padding for title alignment
mbrookes Sep 9, 2020
5dc4251
remove redundant tests
mbrookes Sep 9, 2020
8a3581c
revert px/pixels
mbrookes Sep 10, 2020
c37046a
Update migration guide
mbrookes Sep 11, 2020
adb9d62
prettier
mbrookes Sep 11, 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
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/)
- [Image List](/components/image-list/)

13 changes: 7 additions & 6 deletions docs/pages/api-docs/image-list-item-bar.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ The `MuiImageListItemBar` name can be used for providing [default props](/custom

| 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 tile itself). |
| <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">'below'<br>&#124;&nbsp;'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 tile. |
| <span class="prop-name">titlePosition</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">title</span> | <span class="prop-type">node</span> | | Title to be displayed. |

The `ref` is forwarded to the root element.

Expand All @@ -44,10 +44,11 @@ Any other props supplied will be provided to the root element (native element).
| 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">titlePositionBottom</span> | <span class="prop-name">.MuiImageListItemBar-titlePositionBottom</span> | Styles applied to the root element if `titlePosition="bottom"`.
| <span class="prop-name">titlePositionTop</span> | <span class="prop-name">.MuiImageListItemBar-titlePositionTop</span> | Styles applied to the root element if `titlePosition="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">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">positionBelow</span> | <span class="prop-name">.MuiImageListItemBar-positionBelow</span> | Styles applied to the root element if `position="below"`.
| <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">titleWrapBelow</span> | <span class="prop-name">.MuiImageListItemBar-titleWrapBelow</span> | Styles applied to the title and subtitle container element if `position="below"`.
| <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.
Expand Down
12 changes: 6 additions & 6 deletions docs/pages/api-docs/image-list-item.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ The `MuiImageListItem` name can be used for providing [default props](/customiza

| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|
| <span class="prop-name">children</span> | <span class="prop-type">node</span> | | Theoretically you can pass any node as children, but the main use case is to pass an img, in which case ImageListItem takes care of making the image "cover" available space (similar to `background-size: cover` or to `object-fit: cover`). |
| <span class="prop-name">children</span> | <span class="prop-type">node</span> | | While you can pass any node as children, the main use case is for an img. |
| <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">cols</span> | <span class="prop-type">number</span> | <span class="prop-default">1</span> | Width of the tile in number of grid cells. |
| <span class="prop-name">cols</span> | <span class="prop-type">number</span> | <span class="prop-default">1</span> | Width of the item in number of grid columns. |
| <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. |
| <span class="prop-name">rows</span> | <span class="prop-type">number</span> | <span class="prop-default">1</span> | Height of the tile in number of grid cells. |
| <span class="prop-name">rows</span> | <span class="prop-type">number</span> | <span class="prop-default">1</span> | Height of the item in number of grid rows. |

The `ref` is forwarded to the root element.

Expand All @@ -43,9 +43,9 @@ Any other props supplied will be provided to the root element (native element).
| 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">tile</span> | <span class="prop-name">.MuiImageListItem-tile</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 tile.
| <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 tile.
| <span class="prop-name">img</span> | <span class="prop-name">.MuiImageListItem-img</span> | Styles applied to an `img` element to ensure it covers the item.
| <span class="prop-name">standard</span> | <span class="prop-name">.MuiImageListItem-standard</span> | Styles applied to the root element if `variant="standard"`.
| <span class="prop-name">woven</span> | <span class="prop-name">.MuiImageListItem-woven</span> | Styles applied to the root element if `variant="woven"`.

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

Expand Down
11 changes: 8 additions & 3 deletions docs/pages/api-docs/image-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ The `MuiImageList` name can be used for providing [default props](/customization

| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|
| <span class="prop-name">cellHeight</span> | <span class="prop-type">'auto'<br>&#124;&nbsp;number</span> | <span class="prop-default">180</span> | Number of px for one cell height. You can set `'auto'` if you want to let the children determine the height. |
| <span class="prop-name required">children<abbr title="required">*</abbr></span> | <span class="prop-type">node</span> | | Image Tiles that will be in Image List. |
| <span class="prop-name required">children<abbr title="required">*</abbr></span> | <span class="prop-type">node</span> | | Items that will be in the image list. |
| <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">cols</span> | <span class="prop-type">number</span> | <span class="prop-default">2</span> | Number of columns. |
| <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> | <span class="prop-default">4</span> | Number of px for the spacing between tiles. |
| <span class="prop-name">gap</span> | <span class="prop-type">number</span> | <span class="prop-default">4</span> | The gap between items in px. |
| <span class="prop-name">rowHeight</span> | <span class="prop-type">'auto'<br>&#124;&nbsp;number</span> | <span class="prop-default">'auto'</span> | The height of one row in px. |
| <span class="prop-name">variant</span> | <span class="prop-type">'masonry'<br>&#124;&nbsp;'quilted'<br>&#124;&nbsp;'standard'<br>&#124;&nbsp;'woven'<br>&#124;&nbsp;string</span> | <span class="prop-default">'standard'</span> | The variant to use. |

The `ref` is forwarded to the root element.

Expand All @@ -44,6 +45,10 @@ Any other props supplied will be provided to the root element (native element).
| Rule name | Global class | Description |
|:-----|:-------------|:------------|
| <span class="prop-name">root</span> | <span class="prop-name">.MuiImageList-root</span> | Styles applied to the root element.
| <span class="prop-name">masonry</span> | <span class="prop-name">.MuiImageList-masonry</span> | Styles applied to the root element if `variant="masonry"`.
| <span class="prop-name">quilted</span> | <span class="prop-name">.MuiImageList-quilted</span> | Styles applied to the root element if `variant="quilted"`.
| <span class="prop-name">standard</span> | <span class="prop-name">.MuiImageList-standard</span> | Styles applied to the root element if `variant="standard"`.
| <span class="prop-name">woven</span> | <span class="prop-name">.MuiImageList-woven</span> | Styles applied to the root element if `variant="woven"`.

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

Expand Down
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

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

Binary file removed docs/public/static/images/image-list/bike.jpg
Binary file not shown.
Binary file removed docs/public/static/images/image-list/breakfast.jpg
Binary file not shown.
Binary file removed docs/public/static/images/image-list/burgers.jpg
Binary file not shown.
Binary file removed docs/public/static/images/image-list/camera.jpg
Binary file not shown.
Binary file removed docs/public/static/images/image-list/hats.jpg
Binary file not shown.
Binary file removed docs/public/static/images/image-list/honey.jpg
Binary file not shown.
Binary file removed docs/public/static/images/image-list/morning.jpg
Binary file not shown.
Binary file removed docs/public/static/images/image-list/mushroom.jpg
Binary file not shown.
Binary file removed docs/public/static/images/image-list/olive.jpg
Binary file not shown.
Binary file removed docs/public/static/images/image-list/plant.jpg
Binary file not shown.
Binary file removed docs/public/static/images/image-list/star.jpg
Binary file not shown.
Binary file not shown.
84 changes: 0 additions & 84 deletions docs/src/pages/components/image-list/AdvancedImageList.js

This file was deleted.

86 changes: 0 additions & 86 deletions docs/src/pages/components/image-list/AdvancedImageList.tsx

This file was deleted.

53 changes: 0 additions & 53 deletions docs/src/pages/components/image-list/BasicImageList.js

This file was deleted.

55 changes: 0 additions & 55 deletions docs/src/pages/components/image-list/BasicImageList.tsx

This file was deleted.

Loading