"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = exports.FillPreview = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireWildcard(require("react"));
var _ButtonCore = _interopRequireDefault(require("../Button/ButtonCore"));
var _Proportion = _interopRequireDefault(require("../Proportion"));
var _FillPreview = require("./FillPreview.constants");
var _FillPreviewSt = require("./FillPreview.st.css.js");
var _useStyledContent = require("./hooks/useStyledContent");
var _excluded = ["selected", "className", "aspectRatio", "dataHook", "disabled", "fill", "size", "contentClassName"];
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/FillPreview/FillPreview.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); }
var FillPreview = exports.FillPreview = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
  var {
      selected = false,
      className,
      aspectRatio,
      dataHook,
      disabled,
      fill,
      size,
      contentClassName
    } = _ref,
    rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
  var {
    children,
    contentClassName: updatedContentClassName,
    style
  } = (0, _useStyledContent.useStyledContent)({
    contentClassName,
    disabled,
    fill
  });
  return /*#__PURE__*/_react.default.createElement("div", {
    ref: ref,
    className: (0, _FillPreviewSt.st)(_FillPreviewSt.classes.root, {
      size
    }, className),
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 36,
      columnNumber: 7
    }
  }, /*#__PURE__*/_react.default.createElement(_Proportion.default, {
    dataHook: dataHook,
    aspectRatio: aspectRatio,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 37,
      columnNumber: 9
    }
  }, /*#__PURE__*/_react.default.createElement(_ButtonCore.default, (0, _extends2.default)({}, rest, {
    "data-selected": selected,
    className: (0, _FillPreviewSt.st)(_FillPreviewSt.classes.button, {
      selected,
      empty: !fill && !disabled
    }),
    "data-hook": _FillPreview.dataHooks.button,
    disabled: disabled,
    style: style,
    contentClassName: updatedContentClassName,
    children: children,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 38,
      columnNumber: 11
    }
  }))));
});
FillPreview.displayName = 'FillPreview';
var _default = exports.default = FillPreview;
//# sourceMappingURL=FillPreview.js.map