@wulperstudio/cms
Version:
Wulper Studio Library Components CMS
49 lines (48 loc) • 2.06 kB
JavaScript
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireDefault(require("react"));
var _styled = require("./styled");
var _jsxRuntime = require("react/jsx-runtime");
var _excluded = ["variant", "direction", "animation", "backgroundColor", "boxShadow", "padding", "border", "width", "mainContainerProps", "contentProps"];
var DrawerV2 = function DrawerV2(_ref) {
var _ref$variant = _ref.variant,
variant = _ref$variant === void 0 ? 'persistent' : _ref$variant,
_ref$direction = _ref.direction,
direction = _ref$direction === void 0 ? 'left' : _ref$direction,
_ref$animation = _ref.animation,
animation = _ref$animation === void 0 ? false : _ref$animation,
backgroundColor = _ref.backgroundColor,
boxShadow = _ref.boxShadow,
_ref$padding = _ref.padding,
padding = _ref$padding === void 0 ? '15px' : _ref$padding,
_ref$border = _ref.border,
border = _ref$border === void 0 ? 'none' : _ref$border,
width = _ref.width,
mainContainerProps = _ref.mainContainerProps,
contentProps = _ref.contentProps,
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styled.WrapperDrawer, Object.assign({
variant: variant,
direction: direction,
animation: animation
}, mainContainerProps, {
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styled.Content, Object.assign({
variant: variant,
width: width,
backgroundColor: backgroundColor,
boxShadow: boxShadow,
padding: padding,
border: border
}, contentProps, {
children: props.children
})), variant === 'temporary' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styled.BackDrop, {
onClick: props.onClose
})]
}));
};
var _default = exports["default"] = DrawerV2;