"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));

var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));

var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

var _react = _interopRequireDefault(require("react"));

var _styles = require("@material-ui/core/styles");

var _propTypes = _interopRequireDefault(require("prop-types"));

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

var PreviewLayout = /*#__PURE__*/function (_React$Component) {
  (0, _inherits2["default"])(PreviewLayout, _React$Component);

  var _super = _createSuper(PreviewLayout);

  function PreviewLayout() {
    (0, _classCallCheck2["default"])(this, PreviewLayout);
    return _super.apply(this, arguments);
  }

  (0, _createClass2["default"])(PreviewLayout, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
          children = _this$props.children,
          classes = _this$props.classes,
          ariaLabel = _this$props.ariaLabel,
          role = _this$props.role;
      var accessibility = ariaLabel ? {
        'aria-label': ariaLabel,
        role: role
      } : {};
      return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
        className: classes.container
      }, accessibility), children);
    }
  }]);
  return PreviewLayout;
}(_react["default"].Component);

(0, _defineProperty2["default"])(PreviewLayout, "propTypes", {
  ariaLabel: _propTypes["default"].string,
  children: _propTypes["default"].oneOfType([_propTypes["default"].arrayOf(_propTypes["default"].node), _propTypes["default"].node]).isRequired,
  classes: _propTypes["default"].object,
  role: _propTypes["default"].string
});

var styles = function styles() {
  return {
    container: {
      display: 'flex',
      flexDirection: 'column',
      position: 'relative'
    }
  };
};

var theme = (0, _styles.createMuiTheme)({
  typography: {
    useNextVariants: true
  },
  palette: {
    action: {
      disabled: 'rgba(0, 0, 0, 0.54);'
    }
  },
  overrides: {
    MuiRadio: {
      root: {
        '&$checked': {
          color: '#3f51b5 !important'
        }
      }
    },
    MuiCheckbox: {
      root: {
        '&$checked': {
          color: '#3f51b5 !important'
        }
      }
    },
    MuiTabs: {
      root: {
        borderBottom: '1px solid #eee'
      }
    },
    MuiSwitch: {
      root: {
        '&$checked': {
          color: '#3f51b5 !important',
          '& + $bar': {
            backgroundColor: '#3f51b5 !important',
            opacity: 0.5
          }
        }
      }
    }
  }
});
var Styled = (0, _styles.withStyles)(styles)(PreviewLayout);

var RootElem = function RootElem(props) {
  return /*#__PURE__*/_react["default"].createElement(_styles.MuiThemeProvider, {
    theme: theme
  }, /*#__PURE__*/_react["default"].createElement(Styled, props));
};

var _default = RootElem;
exports["default"] = _default;
//# sourceMappingURL=preview-layout.js.map