@braineet/ui
Version:
Braineet design system
40 lines (38 loc) • 4.56 kB
JavaScript
"use strict";
exports.__esModule = true;
exports.ScrollbarContainer = void 0;
var _styledComponents = _interopRequireWildcard(require("styled-components"));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
/* eslint-disable import/prefer-default-export */
var ScrollbarContainer = _styledComponents.default.div.withConfig({
displayName: "scscrollbars__ScrollbarContainer",
componentId: "sc-1aljqvx-0"
})(["width:100%;height:100%;.ScrollbarsCustom{position:relative;width:100%;height:100%;}.ScrollbarsCustom-Wrapper{right:1rem;top:0;bottom:1rem;left:0;}.ScrollbarsCustom-Content{width:100%;height:100%;}.ScrollbarsCustom-Track{position:absolute;overflow:hidden;border-radius:4px;user-select:none;background:", ";", " &.ScrollbarsCustom-TrackX{height:8px;width:", ";bottom:", ";left:", ";}&.ScrollbarsCustom-TrackY{width:8px;height:", ";top:", ";right:", ";}}.ScrollbarsCustom-Thumb{cursor:pointer;border-radius:4px;background:", ";&.ScrollbarsCustom-ThumbX{height:100%;width:0;}&.ScrollbarsCustom-ThumbY{width:100%;height:0;}}", ""], function (p) {
return p.showTracks ? p.theme.colors.blackOpacity10 : 'transparent';
}, function (p) {
return p.autoHide ? (0, _styledComponents.css)(["transition:opacity 0.2s ease-in-out;opacity:0;&:hover{opacity:1;}"]) : '';
}, function (p) {
var _p$trackXOptions, _p$trackXOptions$offs, _p$trackXOptions2, _p$trackXOptions2$off;
return p != null && (_p$trackXOptions = p.trackXOptions) != null && (_p$trackXOptions$offs = _p$trackXOptions.offset) != null && _p$trackXOptions$offs.x ? "calc(100% - " + (p == null ? void 0 : (_p$trackXOptions2 = p.trackXOptions) == null ? void 0 : (_p$trackXOptions2$off = _p$trackXOptions2.offset) == null ? void 0 : _p$trackXOptions2$off.x) + ")" : '100%';
}, function (p) {
var _p$trackXOptions3, _p$trackXOptions3$off;
return (p == null ? void 0 : (_p$trackXOptions3 = p.trackXOptions) == null ? void 0 : (_p$trackXOptions3$off = _p$trackXOptions3.offset) == null ? void 0 : _p$trackXOptions3$off.y) || 0;
}, function (p) {
var _p$trackXOptions4, _p$trackXOptions4$off;
return (p == null ? void 0 : (_p$trackXOptions4 = p.trackXOptions) == null ? void 0 : (_p$trackXOptions4$off = _p$trackXOptions4.offset) == null ? void 0 : _p$trackXOptions4$off.x) || 0;
}, function (p) {
var _p$trackYOptions, _p$trackYOptions$offs, _p$trackYOptions2, _p$trackYOptions2$off;
return p != null && (_p$trackYOptions = p.trackYOptions) != null && (_p$trackYOptions$offs = _p$trackYOptions.offset) != null && _p$trackYOptions$offs.y ? "calc(100% - " + (p == null ? void 0 : (_p$trackYOptions2 = p.trackYOptions) == null ? void 0 : (_p$trackYOptions2$off = _p$trackYOptions2.offset) == null ? void 0 : _p$trackYOptions2$off.y) + ")" : '100%';
}, function (p) {
var _p$trackYOptions3, _p$trackYOptions3$off;
return (p == null ? void 0 : (_p$trackYOptions3 = p.trackYOptions) == null ? void 0 : (_p$trackYOptions3$off = _p$trackYOptions3.offset) == null ? void 0 : _p$trackYOptions3$off.y) || 0;
}, function (p) {
var _p$trackYOptions4, _p$trackYOptions4$off;
return (p == null ? void 0 : (_p$trackYOptions4 = p.trackYOptions) == null ? void 0 : (_p$trackYOptions4$off = _p$trackYOptions4.offset) == null ? void 0 : _p$trackYOptions4$off.x) || 0;
}, function (p) {
return p.theme.colors.blackOpacity20;
}, function (p) {
return p.autoHide ? (0, _styledComponents.css)(["&:hover{.ScrollbarsCustom-Track{opacity:1;}}"]) : '';
});
exports.ScrollbarContainer = ScrollbarContainer;