UNPKG

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