UNPKG

@chayns-components/core

Version:

A set of beautiful React components for developing your own applications with chayns.

73 lines (69 loc) 2.83 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StyledGroupedImage = exports.StyledGroupImageElement = exports.StyledCornerImage = exports.ImageSize = void 0; var _styledComponents = _interopRequireWildcard(require("styled-components")); function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (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 (const 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); } const StyledGroupedImage = exports.StyledGroupedImage = _styledComponents.default.div` flex: 0 0 auto; height: ${({ $height }) => $height}; position: relative; width: ${({ $height }) => $height}; `; let ImageSize = exports.ImageSize = /*#__PURE__*/function (ImageSize) { ImageSize["Full"] = "100%"; ImageSize["Small"] = "75%"; ImageSize["Grouped"] = "80%"; ImageSize["GroupedSmall"] = "65%"; return ImageSize; }({}); const StyledGroupImageElement = exports.StyledGroupImageElement = _styledComponents.default.img` aspect-ratio: 1; border-radius: ${({ $shouldShowRoundImage }) => $shouldShowRoundImage ? '50%' : '0'}; height: ${({ $imageSize }) => $imageSize}; object-fit: cover; position: absolute; ${({ $imageSize, $isSecondImage }) => $isSecondImage ? (0, _styledComponents.css)` bottom: ${$imageSize === ImageSize.GroupedSmall ? '15%' : 0}; right: ${$imageSize === ImageSize.GroupedSmall ? '15%' : 0}; ` : (0, _styledComponents.css)` top: 0; left: 0; `} ${({ $background, $shouldPreventBackground, theme }) => !$shouldPreventBackground && (0, _styledComponents.css)` background: ${$background || `rgba(${theme['text-rgb'] ?? '0,0,0'}, 0.1)`}; box-shadow: 0 0 0 1px rgba(${theme['009-rgb']}, 0.08) inset; `} `; const StyledCornerImage = exports.StyledCornerImage = _styledComponents.default.img` aspect-ratio: 1; bottom: 0; height: 50%; position: absolute; right: 0; ${({ $background, $shouldPreventBackground, theme }) => !$shouldPreventBackground && (0, _styledComponents.css)` background: ${$background || `rgba(${theme['text-rgb'] ?? '0,0,0'}, 0.1)`}; box-shadow: 0 0 0 1px rgba(${theme['009-rgb']}, 0.08) inset; `} `; //# sourceMappingURL=GroupedImage.styles.js.map