@naturacosmeticos/natds-react
Version:
A collection of components from Natura Design System for React
78 lines • 2.87 kB
JavaScript
;
/* eslint-disable @typescript-eslint/no-non-null-assertion */
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_jss_1 = require("react-jss");
var getSize = function (size) {
var width = {
small: 256,
medium: 375,
large: 600
};
return width[size];
};
var styles = (0, react_jss_1.createUseStyles)(function (theme) { return ({
overlayContainer: function (_a) {
var open = _a.open;
return ({
backgroundColor: theme.color.highlight,
display: !open && 'none',
height: '100%',
left: 0,
opacity: theme.opacity.mediumHigh,
position: 'fixed',
top: 0,
width: '100%',
overflow: 'hidden',
zIndex: 1199
});
},
drawer: function (_a) {
var _b = _a.open, open = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? 'small' : _c, _d = _a.position, position = _d === void 0 ? 'left' : _d;
var x = open ? getSize(size) : 0;
var y = open ? getSize(size) : getSize(size) + getSize(size);
var pos = {
left: {
height: '100%',
left: getSize(size) * -1,
top: 0,
transform: "translateX(".concat(x, "px)"),
width: getSize(size)
},
right: {
height: '100%',
right: getSize(size),
top: 0,
transform: "translateX(".concat(y, "px)"),
width: getSize(size)
},
top: {
height: getSize(size),
left: 0,
top: getSize(size) * -1,
transform: "translateY(".concat(x, "px)"),
width: '100%'
},
bottom: {
height: getSize(size),
left: 0,
bottom: getSize(size),
transform: "translateY(".concat(y, "px)"),
width: '100%'
}
};
return __assign(__assign({ display: 'flex', flexFlow: 'column nowrap', backgroundColor: theme.color.surface, color: theme.color.highEmphasis, boxShadow: theme.elevation.small }, pos[position]), { justifyContent: 'space-between', overflow: 'hidden', position: 'absolute', transition: '0.3s ease-in-out', zIndex: 1200 });
}
}); });
exports.default = styles;
//# sourceMappingURL=Drawer.styles.js.map