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

[ExpansionPanel] Rename to Accordion, add warning to current exports #21560

Merged
merged 24 commits into from
Jun 29, 2020
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
109e334
[ExpansionPanel] Rename to Accordion (#21494)
mnajdova Jun 23, 2020
135bd37
docs:api
mnajdova Jun 24, 2020
3094403
added page, improved deprecation messages
mnajdova Jun 25, 2020
8238b90
page
mnajdova Jun 25, 2020
20ff449
prettier
mnajdova Jun 25, 2020
3679f16
page
mnajdova Jun 25, 2020
6481947
reverted some changes
mnajdova Jun 25, 2020
4658919
reverted components
mnajdova Jun 25, 2020
564000f
reverted all expansion panel files, disabled tests
mnajdova Jun 25, 2020
7754e97
polish
oliviertassinari Jun 25, 2020
ee388b9
warn once
oliviertassinari Jun 26, 2020
4f5f5fb
Update packages/material-ui/src/ExpansionPanel/ExpansionPanel.js
mnajdova Jun 27, 2020
7a98666
Update packages/material-ui/src/ExpansionPanel/ExpansionPanel.js
mnajdova Jun 27, 2020
0ba4db1
Update packages/material-ui/src/ExpansionPanelActions/ExpansionPanelA…
mnajdova Jun 27, 2020
707dfc0
Update packages/material-ui/src/ExpansionPanelActions/ExpansionPanelA…
mnajdova Jun 27, 2020
f1ee7d4
Update packages/material-ui/src/ExpansionPanelDetails/ExpansionPanelD…
mnajdova Jun 27, 2020
ccab9f3
Update packages/material-ui/src/ExpansionPanelDetails/ExpansionPanelD…
mnajdova Jun 27, 2020
3c60655
Update packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelS…
mnajdova Jun 27, 2020
e8b682b
Update packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelS…
mnajdova Jun 27, 2020
f57af1e
Update packages/material-ui/src/ExpansionPanelDetails/ExpansionPanelD…
mnajdova Jun 27, 2020
7f1dfbc
Update packages/material-ui/src/ExpansionPanel/ExpansionPanel.d.ts
mnajdova Jun 27, 2020
646b65a
Update packages/material-ui/src/ExpansionPanelActions/ExpansionPanelA…
mnajdova Jun 27, 2020
8294bfd
Update packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelS…
mnajdova Jun 27, 2020
39b2241
yarn docs:api
oliviertassinari Jun 27, 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
15 changes: 15 additions & 0 deletions docs/pages/api-docs/accordion-actions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown';

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

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

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

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

# AccordionActions API

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

## Import

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

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



## Component name

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

## Props

| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|
| <span class="prop-name">children</span> | <span class="prop-type">node</span> | | The content of the component. |
| <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">disableSpacing</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, the actions do not have additional margin. |

The `ref` is forwarded to the root element.

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

## CSS

| Rule name | Global class | Description |
|:-----|:-------------|:------------|
| <span class="prop-name">root</span> | <span class="prop-name">.MuiAccordionActions-root</span> | Styles applied to the root element.
| <span class="prop-name">spacing</span> | <span class="prop-name">.MuiAccordionActions-spacing</span> | Styles applied to the root element if `disableSpacing={false}`.

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

- With a rule name of the [`classes` object prop](/customization/components/#overriding-styles-with-classes).
- With a [global class name](/customization/components/#overriding-styles-with-global-class-names).
- With a theme and an [`overrides` property](/customization/globals/#css).

If that's not sufficient, you can check the [implementation of the component](https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/AccordionActions/AccordionActions.js) for more detail.

## Demos

- [Accordion](/components/accordion/)

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

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

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

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

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

# AccordionDetails API

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

## Import

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

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



## Component name

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

## Props

| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|
| <span class="prop-name">children</span> | <span class="prop-type">node</span> | | The content of the accordion details. |
| <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. |

The `ref` is forwarded to the root element.

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

## CSS

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

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

- With a rule name of the [`classes` object prop](/customization/components/#overriding-styles-with-classes).
- With a [global class name](/customization/components/#overriding-styles-with-global-class-names).
- With a theme and an [`overrides` property](/customization/globals/#css).

If that's not sufficient, you can check the [implementation of the component](https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/AccordionDetails/AccordionDetails.js) for more detail.

## Demos

- [Accordion](/components/accordion/)

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

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

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

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

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

# AccordionSummary API

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

## Import

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

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



## Component name

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

## Props

| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|
| <span class="prop-name">children</span> | <span class="prop-type">node</span> | | The content of the accordion summary. |
| <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">expandIcon</span> | <span class="prop-type">node</span> | | The icon to display as the expand indicator. |
| <span class="prop-name">IconButtonProps</span> | <span class="prop-type">object</span> | | Props applied to the `IconButton` element wrapping the expand icon. |

The `ref` is forwarded to the root element.

Any other props supplied will be provided to the root element ([ButtonBase](/api/button-base/)).

## CSS

| Rule name | Global class | Description |
|:-----|:-------------|:------------|
| <span class="prop-name">root</span> | <span class="prop-name">.MuiAccordionSummary-root</span> | Styles applied to the root element.
| <span class="prop-name">expanded</span> | <span class="prop-name">.Mui-expanded</span> | Pseudo-class applied to the root element, children wrapper element and `IconButton` component if `expanded={true}`.
| <span class="prop-name">focused</span> | <span class="prop-name">.Mui-focused</span> | Pseudo-class applied to the root element if `focused={true}`.
| <span class="prop-name">disabled</span> | <span class="prop-name">.Mui-disabled</span> | Pseudo-class applied to the root element if `disabled={true}`.
| <span class="prop-name">content</span> | <span class="prop-name">.MuiAccordionSummary-content</span> | Styles applied to the children wrapper element.
| <span class="prop-name">expandIcon</span> | <span class="prop-name">.MuiAccordionSummary-expandIcon</span> | Styles applied to the `IconButton` component when `expandIcon` is supplied.

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

- With a rule name of the [`classes` object prop](/customization/components/#overriding-styles-with-classes).
- With a [global class name](/customization/components/#overriding-styles-with-global-class-names).
- With a theme and an [`overrides` property](/customization/globals/#css).

If that's not sufficient, you can check the [implementation of the component](https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/AccordionSummary/AccordionSummary.js) for more detail.

## Inheritance

The props of the [ButtonBase](/api/button-base/) component are also available.
You can take advantage of this behavior to [target nested components](/guides/api/#spread).

## Demos

- [Accordion](/components/accordion/)

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

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

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

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

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

# Accordion API

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

## Import

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

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



## Component name

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

## Props

| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|
| <span class="prop-name required">children<abbr title="required">*</abbr></span> | <span class="prop-type">node</span> | | The content of the accordion. |
| <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">defaultExpanded</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, expands the accordion by default. |
| <span class="prop-name">disabled</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, the accordion will be displayed in a disabled state. |
| <span class="prop-name">expanded</span> | <span class="prop-type">bool</span> | | If `true`, expands the accordion, otherwise collapse it. Setting this prop enables control over the accordion. |
| <span class="prop-name">onChange</span> | <span class="prop-type">func</span> | | Callback fired when the expand/collapse state is changed.<br><br>**Signature:**<br>`function(event: object, expanded: boolean) => void`<br>*event:* The event source of the callback.<br>*expanded:* The `expanded` state of the accordion. |
| <span class="prop-name">square</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, rounded corners are disabled. |
| <span class="prop-name">TransitionComponent</span> | <span class="prop-type">elementType</span> | <span class="prop-default">Collapse</span> | The component used for the collapse effect. [Follow this guide](/components/transitions/#transitioncomponent-prop) to learn more about the requirements for this component. |
| <span class="prop-name">TransitionProps</span> | <span class="prop-type">object</span> | | Props applied to the [`Transition`](http://reactcommunity.org/react-transition-group/transition#Transition-props) element. |

The `ref` is forwarded to the root element.

Any other props supplied will be provided to the root element ([Paper](/api/paper/)).

## CSS

| Rule name | Global class | Description |
|:-----|:-------------|:------------|
| <span class="prop-name">root</span> | <span class="prop-name">.MuiAccordion-root</span> | Styles applied to the root element.
| <span class="prop-name">rounded</span> | <span class="prop-name">.MuiAccordion-rounded</span> | Styles applied to the root element if `square={false}`.
| <span class="prop-name">expanded</span> | <span class="prop-name">.Mui-expanded</span> | Styles applied to the root element if `expanded={true}`.
| <span class="prop-name">disabled</span> | <span class="prop-name">.Mui-disabled</span> | Styles applied to the root element if `disabled={true}`.

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

- With a rule name of the [`classes` object prop](/customization/components/#overriding-styles-with-classes).
- With a [global class name](/customization/components/#overriding-styles-with-global-class-names).
- With a theme and an [`overrides` property](/customization/globals/#css).

If that's not sufficient, you can check the [implementation of the component](https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/Accordion/Accordion.js) for more detail.

## Inheritance

The props of the [Paper](/api/paper/) component are also available.
You can take advantage of this behavior to [target nested components](/guides/api/#spread).

## Demos

- [Accordion](/components/accordion/)

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

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

⚠️ The ExpansionPanelActions component was renamed to AccordionActions to match the naming convention of the community.

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

## Component name

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

If that's not sufficient, you can check the [implementation of the component](https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/ExpansionPanelActions/ExpansionPanelActions.js) for more detail.

## Demos

- [Expansion Panels](/components/expansion-panels/)

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

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

⚠️ The ExpansionPanelDetails component was renamed to AccordionDetails to match the naming convention of the community.

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

## Component name

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

If that's not sufficient, you can check the [implementation of the component](https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/ExpansionPanelDetails/ExpansionPanelDetails.js) for more detail.

## Demos

- [Expansion Panels](/components/expansion-panels/)

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

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

⚠️ The ExpansionPanelSummary component was renamed to AccordionSummary to match the naming convention of the community.

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

## Component name

Expand All @@ -32,6 +35,7 @@ The `MuiExpansionPanelSummary` name can be used for providing [default props](/c
| <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">expandIcon</span> | <span class="prop-type">node</span> | | The icon to display as the expand indicator. |
| <span class="prop-name">IconButtonProps</span> | <span class="prop-type">object</span> | | Props applied to the `IconButton` element wrapping the expand icon. |
| <span class="prop-name">onFocusVisible</span> | <span class="prop-type">func</span> | | Callback fired when the component is focused with a keyboard. We trigger a `onFocus` callback too. |

The `ref` is forwarded to the root element.

Expand Down Expand Up @@ -61,7 +65,3 @@ If that's not sufficient, you can check the [implementation of the component](ht
The props of the [ButtonBase](/api/button-base/) component are also available.
You can take advantage of this behavior to [target nested components](/guides/api/#spread).

## Demos

- [Expansion Panels](/components/expansion-panels/)

Loading