Skip to content

Commit

Permalink
[ExpansionPanelSummary] Add IconButtonProps property (#12035)
Browse files Browse the repository at this point in the history
* add expandIcon Props

* fix lint-issues

* add @ignore

* rename IconButtonProps
  • Loading branch information
dakotamurphyucf authored and oliviertassinari committed Jul 2, 2018
1 parent 1d39b99 commit 06bac3e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import * as React from 'react';
import { StandardProps } from '..';
import { ButtonBaseProps } from '../ButtonBase';
import { IconButtonProps } from '../IconButton';

export interface ExpansionPanelSummaryProps
extends StandardProps<ButtonBaseProps, ExpansionPanelSummaryClassKey> {
disabled?: boolean;
expanded?: boolean;
expandIcon?: React.ReactNode;
IconButtonProps?: Partial<IconButtonProps>;
onChange?: React.ReactEventHandler<{}>;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class ExpansionPanelSummary extends React.Component {
disabled,
expanded,
expandIcon,
IconButtonProps,
onChange,
...other
} = this.props;
Expand Down Expand Up @@ -137,6 +138,7 @@ class ExpansionPanelSummary extends React.Component {
component="div"
tabIndex={-1}
aria-hidden="true"
{...IconButtonProps}
>
{expandIcon}
</IconButton>
Expand Down Expand Up @@ -174,6 +176,10 @@ ExpansionPanelSummary.propTypes = {
* The icon to display as the expand indicator.
*/
expandIcon: PropTypes.node,
/**
* Properties applied to the `TouchRipple` element wrapping the expand icon.
*/
IconButtonProps: PropTypes.object,
/**
* @ignore
*/
Expand Down
1 change: 1 addition & 0 deletions pages/api/expansion-panel-summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ title: ExpansionPanelSummary API
| <span class="prop-name">children</span> | <span class="prop-type">node |   | The content of the expansion panel summary. |
| <span class="prop-name">classes</span> | <span class="prop-type">object |   | Override or extend the styles applied to the component. See [CSS API](#css-api) below for more details. |
| <span class="prop-name">expandIcon</span> | <span class="prop-type">node |   | The icon to display as the expand indicator. |
| <span class="prop-name">IconButtonProps</span> | <span class="prop-type">object |   | Properties applied to the `TouchRipple` element wrapping the expand icon. |

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

Expand Down

0 comments on commit 06bac3e

Please sign in to comment.