UNPKG

2.65 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 justifyContent: 'flex-end',
31 flex: '0 0 auto'
32 },
33
34 /* Styles applied to the root element if `disableSpacing={false}`. */
35 spacing: {
36 '& > :not(:first-child)': {
37 marginLeft: 8
38 }
39 }
40};
41exports.styles = styles;
42var DialogActions = /*#__PURE__*/React.forwardRef(function DialogActions(props, ref) {
43 var _props$disableSpacing = props.disableSpacing,
44 disableSpacing = _props$disableSpacing === void 0 ? false : _props$disableSpacing,
45 classes = props.classes,
46 className = props.className,
47 other = (0, _objectWithoutProperties2.default)(props, ["disableSpacing", "classes", "className"]);
48 return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
49 className: (0, _clsx.default)(classes.root, className, !disableSpacing && classes.spacing),
50 ref: ref
51 }, other));
52});
53process.env.NODE_ENV !== "production" ? DialogActions.propTypes = {
54 // ----------------------------- Warning --------------------------------
55 // | These PropTypes are generated from the TypeScript type definitions |
56 // | To update them edit the d.ts file and run "yarn proptypes" |
57 // ----------------------------------------------------------------------
58
59 /**
60 * The content of the component.
61 */
62 children: _propTypes.default.node,
63
64 /**
65 * Override or extend the styles applied to the component.
66 * See [CSS API](#css) below for more details.
67 */
68 classes: _propTypes.default.object,
69
70 /**
71 * @ignore
72 */
73 className: _propTypes.default.string,
74
75 /**
76 * If `true`, the actions do not have additional margin.
77 */
78 disableSpacing: _propTypes.default.bool
79} : void 0;
80
81var _default = (0, _withStyles.default)(styles, {
82 name: 'MuiDialogActions'
83})(DialogActions);
84
85exports.default = _default;
\No newline at end of file