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