UNPKG

1.94 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};
23const AccordionActions = /*#__PURE__*/React.forwardRef(function AccordionActions(props, ref) {
24 const {
25 classes,
26 className,
27 disableSpacing = false
28 } = props,
29 other = _objectWithoutPropertiesLoose(props, ["classes", "className", "disableSpacing"]);
30
31 return /*#__PURE__*/React.createElement("div", _extends({
32 className: clsx(classes.root, className, !disableSpacing && classes.spacing),
33 ref: ref
34 }, other));
35});
36process.env.NODE_ENV !== "production" ? AccordionActions.propTypes = {
37 // ----------------------------- Warning --------------------------------
38 // | These PropTypes are generated from the TypeScript type definitions |
39 // | To update them edit the d.ts file and run "yarn proptypes" |
40 // ----------------------------------------------------------------------
41
42 /**
43 * The content of the component.
44 */
45 children: PropTypes.node,
46
47 /**
48 * Override or extend the styles applied to the component.
49 * See [CSS API](#css) below for more details.
50 */
51 classes: PropTypes.object,
52
53 /**
54 * @ignore
55 */
56 className: PropTypes.string,
57
58 /**
59 * If `true`, the actions do not have additional margin.
60 */
61 disableSpacing: PropTypes.bool
62} : void 0;
63export default withStyles(styles, {
64 name: 'MuiAccordionActions'
65})(AccordionActions);
\No newline at end of file