UNPKG

2.68 kBJavaScriptView Raw
1import _extends from "@babel/runtime/helpers/esm/extends";
2import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3import * as React from 'react';
4import PropTypes from 'prop-types';
5import clsx from 'clsx';
6import withStyles from '../styles/withStyles';
7export const styles = {
8 /* Styles applied to the root element. */
9 root: {
10 display: 'flex',
11 alignItems: 'center',
12 padding: 8,
13 justifyContent: 'flex-end'
14 },
15
16 /* Styles applied to the root element if `disableSpacing={false}`. */
17 spacing: {
18 '& > :not(:first-child)': {
19 marginLeft: 8
20 }
21 }
22};
23let warnedOnce = false;
24/**
25 * ⚠️ The ExpansionPanelActions component was renamed to AccordionActions to use a more common naming convention.
26 *
27 * You should use `import { AccordionActions } from '@material-ui/core'`
28 * or `import AccordionActions from '@material-ui/core/AccordionActions'`.
29 */
30
31const ExpansionPanelActions = /*#__PURE__*/React.forwardRef(function ExpansionPanelActions(props, ref) {
32 if (process.env.NODE_ENV !== 'production') {
33 if (!warnedOnce) {
34 warnedOnce = true;
35 console.error(['Material-UI: the ExpansionPanelActions component was renamed to AccordionActions to use a more common naming convention.', '', "You should use `import { AccordionActions } from '@material-ui/core'`", "or `import AccordionActions from '@material-ui/core/AccordionActions'`"].join('\n'));
36 }
37 }
38
39 const {
40 classes,
41 className,
42 disableSpacing = false
43 } = props,
44 other = _objectWithoutPropertiesLoose(props, ["classes", "className", "disableSpacing"]);
45
46 return /*#__PURE__*/React.createElement("div", _extends({
47 className: clsx(classes.root, className, !disableSpacing && classes.spacing),
48 ref: ref
49 }, other));
50});
51process.env.NODE_ENV !== "production" ? ExpansionPanelActions.propTypes = {
52 // ----------------------------- Warning --------------------------------
53 // | These PropTypes are generated from the TypeScript type definitions |
54 // | To update them edit the d.ts file and run "yarn proptypes" |
55 // ----------------------------------------------------------------------
56
57 /**
58 * The content of the component.
59 */
60 children: PropTypes.node,
61
62 /**
63 * Override or extend the styles applied to the component.
64 * See [CSS API](#css) below for more details.
65 */
66 classes: PropTypes.object,
67
68 /**
69 * @ignore
70 */
71 className: PropTypes.string,
72
73 /**
74 * If `true`, the actions do not have additional margin.
75 */
76 disableSpacing: PropTypes.bool
77} : void 0;
78export default withStyles(styles, {
79 name: 'MuiExpansionPanelActions'
80})(ExpansionPanelActions);
\No newline at end of file