"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireWildcard(require("react"));
var _CustomModalLayoutSt = require("./CustomModalLayout.st.css.js");
var _BaseModalLayout = _interopRequireDefault(require("../BaseModalLayout"));
var _deprecationLog = _interopRequireDefault(require("../utils/deprecationLog"));
var _excluded = ["theme", "actionsSize", "removeContentPadding", "showHeaderDivider", "showFooterDivider", "overflowY", "style"],
  _excluded2 = ["children", "width", "maxWidth", "height", "maxHeight", "className", "footnoteSkin"];
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/CustomModalLayout/CustomModalLayout.tsx";
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var CustomModalLayout = _ref => {
  var {
      theme = 'standard',
      // TODO: add default value for skin once theme is removed
      actionsSize = 'small',
      removeContentPadding = false,
      showHeaderDivider = 'auto',
      showFooterDivider = 'auto',
      overflowY = 'auto',
      style = {}
    } = _ref,
    propsWithNoDefaults = (0, _objectWithoutProperties2.default)(_ref, _excluded);
  var _theme$actionsSize$pr = _objectSpread({
      theme,
      actionsSize
    }, propsWithNoDefaults),
    {
      children,
      width,
      maxWidth,
      height,
      maxHeight,
      className,
      footnoteSkin
    } = _theme$actionsSize$pr,
    restProps = (0, _objectWithoutProperties2.default)(_theme$actionsSize$pr, _excluded2);
  var skin = restProps.skin || theme;
  (0, _react.useEffect)(() => {
    if (theme) {
      (0, _deprecationLog.default)('<CustomModalLayout/> - prop "theme" is deprecated and will be removed in next major release, please use "skin" property instead.');
    }
    if (overflowY === 'none') {
      (0, _deprecationLog.default)('<CustomModalLayout/> - prop "overflowY" value "none" is deprecated and will be removed in next major release, please use "visible" value instead.');
    }
  }, [theme, overflowY]);
  return /*#__PURE__*/_react.default.createElement(_BaseModalLayout.default, (0, _extends2.default)({}, restProps, {
    skin: skin,
    className: (0, _CustomModalLayoutSt.st)(_CustomModalLayoutSt.classes.root, {
      removeContentPadding,
      showHeaderDivider: showHeaderDivider === true,
      showFooterDivider: showFooterDivider === true
    }, className),
    style: _objectSpread(_objectSpread({}, style), {}, {
      width: width !== undefined ? width : style.width,
      maxWidth: maxWidth !== undefined ? maxWidth : style.maxWidth,
      height: height !== undefined ? height : style.height,
      maxHeight: maxHeight !== undefined ? maxHeight : style.maxHeight
    }),
    "data-contentpadding": !removeContentPadding,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 47,
      columnNumber: 5
    }
  }), /*#__PURE__*/_react.default.createElement(_BaseModalLayout.default.Header, {
    showHeaderDivider: showHeaderDivider === true,
    titleSize: "medium",
    titleTag: "h2",
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 68,
      columnNumber: 7
    }
  }), /*#__PURE__*/_react.default.createElement(_BaseModalLayout.default.Content, {
    // TODO: remove type cast with major, once the 'none' value is removed
    overflowY: overflowY,
    hideTopScrollDivider: showHeaderDivider !== 'auto',
    hideBottomScrollDivider: showFooterDivider !== 'auto',
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 73,
      columnNumber: 7
    }
  }, children), /*#__PURE__*/_react.default.createElement(_BaseModalLayout.default.Footer, {
    showFooterDivider: showFooterDivider === true,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 81,
      columnNumber: 7
    }
  }), /*#__PURE__*/_react.default.createElement(_BaseModalLayout.default.Footnote, {
    skin: footnoteSkin,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 82,
      columnNumber: 7
    }
  }));
};
CustomModalLayout.Title = _BaseModalLayout.default.Header.Title;
CustomModalLayout.displayName = 'CustomModalLayout';
var _default = exports.default = CustomModalLayout;
//# sourceMappingURL=CustomModalLayout.js.map