"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = void 0;
var _react = _interopRequireWildcard(require("react"));
var _Toggle = _interopRequireDefault(require("../Transition/Toggle"));
var _constants = require("../Transition/constants");
var _CollapseSt = require("./Collapse.st.css.js");
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/Collapse/Collapse.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); }
/** Use `<Collapse/>` for hideable content.
 *
 * For example, create an accordion within `<Card/>` to collapse its `<Card.Content/>`
 * or to wrap <TopBanner/>.
 */
var Collapse = _ref => {
  var {
    children,
    open = true,
    position = 'static',
    dataHook,
    mountOnEnter = true,
    unmountOnExit = true,
    onExpandAnimationEnd,
    onCollapseAnimationEnd
  } = _ref;
  var wrapperRef = (0, _react.useRef)(null);
  return /*#__PURE__*/_react.default.createElement("div", {
    "data-hook": dataHook,
    "data-open": open,
    ref: wrapperRef,
    className: (0, _CollapseSt.st)(_CollapseSt.classes.root, {
      position
    }),
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 24,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react.default.createElement(_Toggle.default, {
    timeout: _constants.timingMap['medium01'],
    show: open,
    unmountOnExit: unmountOnExit,
    mountOnEnter: mountOnEnter,
    onStart: onExpandAnimationEnd,
    onEnd: onCollapseAnimationEnd,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 30,
      columnNumber: 7
    }
  }, children));
};
Collapse.displayName = 'Collapse';
var _default = exports.default = Collapse;
//# sourceMappingURL=Collapse.js.map