Skip to content

Commit

Permalink
deprecation instead of breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Mar 22, 2019
1 parent a21542a commit f5e4a65
Show file tree
Hide file tree
Showing 23 changed files with 257 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/scripts/buildApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ function buildDocs(options) {
reactAPI.pagesMarkdown = pagesMarkdown;
reactAPI.src = src;
reactAPI.spread = spread;
reactAPI.props = reactAPI.props || {};

// if (reactAPI.name !== 'TableCell') {
// return;
Expand Down
16 changes: 16 additions & 0 deletions packages/material-ui/src/GridList/GridList.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import * as React from 'react';
import { StandardProps } from '..';

export interface GridListProps
extends StandardProps<React.HTMLAttributes<HTMLUListElement>, GridListClassKey> {
cellHeight?: number | 'auto';
cols?: number;
component?: React.ElementType<GridListProps>;
spacing?: number;
}

export type GridListClassKey = 'root';

declare const GridList: React.ComponentType<GridListProps>;

export default GridList;
19 changes: 19 additions & 0 deletions packages/material-ui/src/GridList/GridList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// @inheritedComponent GridList

import React from 'react';
import warning from 'warning';
import ImageList from '../ImageList';

/**
* Deprecated, use ImageList instead.
*/
export default function GridList(props) {
warning(
false,
[
'Material-UI: the GridList component is deprecated.',
'The component was renamed to ImageList.',
].join('\n'),
);
return <ImageList {...props} />;
}
2 changes: 2 additions & 0 deletions packages/material-ui/src/GridList/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default } from './GridList';
export * from './GridList';
1 change: 1 addition & 0 deletions packages/material-ui/src/GridList/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './GridList';
15 changes: 15 additions & 0 deletions packages/material-ui/src/GridListTile/GridListTile.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import * as React from 'react';
import { StandardProps } from '..';

export interface GridListTileProps
extends StandardProps<React.HTMLAttributes<HTMLLIElement>, GridListTileClassKey> {
cols?: number;
component?: React.ElementType<GridListTileProps>;
rows?: number;
}

export type GridListTileClassKey = 'root' | 'tile' | 'imgFullHeight' | 'imgFullWidth';

declare const GridListTile: React.ComponentType<GridListTileProps>;

export default GridListTile;
19 changes: 19 additions & 0 deletions packages/material-ui/src/GridListTile/GridListTile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// @inheritedComponent GridListTile

import React from 'react';
import warning from 'warning';
import ImageListTile from '../ImageListTile';

/**
* Deprecated, use ImageListTile instead.
*/
export default function GridListTile(props) {
warning(
false,
[
'Material-UI: the GridListTile component is deprecated.',
'The component was renamed to ImageListTile.',
].join('\n'),
);
return <ImageListTile {...props} />;
}
2 changes: 2 additions & 0 deletions packages/material-ui/src/GridListTile/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default } from './GridListTile';
export * from './GridListTile';
1 change: 1 addition & 0 deletions packages/material-ui/src/GridListTile/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './GridListTile';
27 changes: 27 additions & 0 deletions packages/material-ui/src/GridListTileBar/GridListTileBar.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import * as React from 'react';
import { StandardProps } from '..';

export interface GridListTileBarProps extends StandardProps<{}, GridListTileBarClassKey> {
actionIcon?: React.ReactNode;
actionPosition?: 'left' | 'right';
subtitle?: React.ReactNode;
title?: React.ReactNode;
titlePosition?: 'top' | 'bottom';
}

export type GridListTileBarClassKey =
| 'root'
| 'titlePositionBottom'
| 'titlePositionTop'
| 'rootSubtitle'
| 'titleWrap'
| 'titleWrapActionPosLeft'
| 'titleWrapActionPosRight'
| 'title'
| 'subtitle'
| 'actionIcon'
| 'actionIconActionPosLeft';

declare const GridListTileBar: React.ComponentType<GridListTileBarProps>;

export default GridListTileBar;
19 changes: 19 additions & 0 deletions packages/material-ui/src/GridListTileBar/GridListTileBar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// @inheritedComponent GridListTileBar

import React from 'react';
import warning from 'warning';
import ImageListTileBar from '../ImageListTileBar';

/**
* Deprecated, use ImageListTileBar instead.
*/
export default function GridListTileBar(props) {
warning(
false,
[
'Material-UI: the GridListTileBar component is deprecated.',
'The component was renamed to ImageListTileBar.',
].join('\n'),
);
return <ImageListTileBar {...props} />;
}
2 changes: 2 additions & 0 deletions packages/material-ui/src/GridListTileBar/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default } from './GridListTileBar';
export * from './GridListTileBar';
1 change: 1 addition & 0 deletions packages/material-ui/src/GridListTileBar/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './GridListTileBar';
3 changes: 3 additions & 0 deletions packages/material-ui/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ export { default as FormGroup } from './FormGroup';
export { default as FormHelperText } from './FormHelperText';
export { default as FormLabel } from './FormLabel';
export { default as Grid } from './Grid';
export { default as GridList } from './GridList';
export { default as GridListTile } from './GridListTile';
export { default as GridListTileBar } from './GridListTileBar';
export { default as Grow } from './Grow';
export { default as Hidden } from './Hidden';
export { default as Icon } from './Icon';
Expand Down
3 changes: 3 additions & 0 deletions packages/material-ui/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ export { default as FormGroup } from './FormGroup';
export { default as FormHelperText } from './FormHelperText';
export { default as FormLabel } from './FormLabel';
export { default as Grid } from './Grid';
export { default as GridList } from './GridList';
export { default as GridListTile } from './GridListTile';
export { default as GridListTileBar } from './GridListTileBar';
export { default as Grow } from './Grow';
export { default as Hidden } from './Hidden';
export { default as Icon } from './Icon';
Expand Down
3 changes: 3 additions & 0 deletions packages/material-ui/src/styles/overrides.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ import { FormGroupClassKey } from '../FormGroup';
import { FormHelperTextClassKey } from '../FormHelperText';
import { FormLabelClassKey } from '../FormLabel';
import { GridClassKey } from '../Grid';
import { GridListClassKey } from '../GridList';
import { GridListTileClassKey } from '../GridListTile';
import { GridListTileBarClassKey } from '../GridListTileBar';
import { IconButtonClassKey } from '../IconButton';
import { IconClassKey } from '../Icon';
import { ImageListClassKey } from '../ImageList';
Expand Down
6 changes: 6 additions & 0 deletions packages/material-ui/src/styles/props.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ import { FormGroupProps } from '../FormGroup';
import { FormHelperTextProps } from '../FormHelperText';
import { FormLabelProps } from '../FormLabel';
import { GridProps } from '../Grid';
import { GridListProps } from '../GridList';
import { GridListTileBarProps } from '../GridListTileBar';
import { GridListTileProps } from '../GridListTile';
import { IconButtonProps } from '../IconButton';
import { IconProps } from '../Icon';
import { ImageListProps } from '../ImageList';
Expand Down Expand Up @@ -127,6 +130,9 @@ export interface ComponentsPropsList {
MuiFormHelperText: FormHelperTextProps;
MuiFormLabel: FormLabelProps;
MuiGrid: GridProps;
MuiGridList: GridListProps;
MuiGridListTile: GridListTileProps;
MuiGridListTileBar: GridListTileBarProps;
MuiIcon: IconProps;
MuiIconButton: IconButtonProps;
MuiImageList: ImageListProps;
Expand Down
11 changes: 11 additions & 0 deletions pages/api/grid-list-tile-bar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import 'docs/src/modules/components/bootstrap';
// --- Post bootstrap -----
import React from 'react';
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
import markdown from './grid-list-tile-bar.md';

function Page() {
return <MarkdownDocs markdown={markdown} />;
}

export default Page;
28 changes: 28 additions & 0 deletions pages/api/grid-list-tile-bar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
filename: /packages/material-ui/src/GridListTileBar/GridListTileBar.js
---

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

# GridListTileBar API

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

```js
import GridListTileBar from '@material-ui/core/GridListTileBar';
```

Deprecated, use ImageListTileBar instead.

## Props

| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|

Any other properties supplied will be spread to the root element ([GridListTileBar](/api/grid-list-tile-bar/)).

## Inheritance

The properties of the [GridListTileBar](/api/grid-list-tile-bar/) component are also available.
You can take advantage of this behavior to [target nested components](/guides/api/#spread).

11 changes: 11 additions & 0 deletions pages/api/grid-list-tile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import 'docs/src/modules/components/bootstrap';
// --- Post bootstrap -----
import React from 'react';
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
import markdown from './grid-list-tile.md';

function Page() {
return <MarkdownDocs markdown={markdown} />;
}

export default Page;
28 changes: 28 additions & 0 deletions pages/api/grid-list-tile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
filename: /packages/material-ui/src/GridListTile/GridListTile.js
---

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

# GridListTile API

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

```js
import GridListTile from '@material-ui/core/GridListTile';
```

Deprecated, use ImageListTile instead.

## Props

| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|

Any other properties supplied will be spread to the root element ([GridListTile](/api/grid-list-tile/)).

## Inheritance

The properties of the [GridListTile](/api/grid-list-tile/) component are also available.
You can take advantage of this behavior to [target nested components](/guides/api/#spread).

11 changes: 11 additions & 0 deletions pages/api/grid-list.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import 'docs/src/modules/components/bootstrap';
// --- Post bootstrap -----
import React from 'react';
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
import markdown from './grid-list.md';

function Page() {
return <MarkdownDocs markdown={markdown} />;
}

export default Page;
28 changes: 28 additions & 0 deletions pages/api/grid-list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
filename: /packages/material-ui/src/GridList/GridList.js
---

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

# GridList API

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

```js
import GridList from '@material-ui/core/GridList';
```

Deprecated, use ImageList instead.

## Props

| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|

Any other properties supplied will be spread to the root element ([GridList](/api/grid-list/)).

## Inheritance

The properties of the [GridList](/api/grid-list/) component are also available.
You can take advantage of this behavior to [target nested components](/guides/api/#spread).

0 comments on commit f5e4a65

Please sign in to comment.