UNPKG

2.59 kBJavaScriptView Raw
1"use strict";
2
3var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
4
5var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
7Object.defineProperty(exports, "__esModule", {
8 value: true
9});
10exports.default = exports.styles = void 0;
11
12var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
14var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
15
16var React = _interopRequireWildcard(require("react"));
17
18var _propTypes = _interopRequireDefault(require("prop-types"));
19
20var _clsx = _interopRequireDefault(require("clsx"));
21
22var _withStyles = _interopRequireDefault(require("../styles/withStyles"));
23
24var styles = {
25 /* Styles applied to the root element. */
26 root: {
27 display: 'flex',
28 alignItems: 'center',
29 padding: 8
30 },
31
32 /* Styles applied to the root element if `disableSpacing={false}`. */
33 spacing: {
34 '& > :not(:first-child)': {
35 marginLeft: 8
36 }
37 }
38};
39exports.styles = styles;
40var CardActions = /*#__PURE__*/React.forwardRef(function CardActions(props, ref) {
41 var _props$disableSpacing = props.disableSpacing,
42 disableSpacing = _props$disableSpacing === void 0 ? false : _props$disableSpacing,
43 classes = props.classes,
44 className = props.className,
45 other = (0, _objectWithoutProperties2.default)(props, ["disableSpacing", "classes", "className"]);
46 return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
47 className: (0, _clsx.default)(classes.root, className, !disableSpacing && classes.spacing),
48 ref: ref
49 }, other));
50});
51process.env.NODE_ENV !== "production" ? CardActions.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.default.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.default.object,
67
68 /**
69 * @ignore
70 */
71 className: _propTypes.default.string,
72
73 /**
74 * If `true`, the actions do not have additional margin.
75 */
76 disableSpacing: _propTypes.default.bool
77} : void 0;
78
79var _default = (0, _withStyles.default)(styles, {
80 name: 'MuiCardActions'
81})(CardActions);
82
83exports.default = _default;
\No newline at end of file