@chayns-components/core
Version:
A set of beautiful React components for developing your own applications with chayns.
49 lines (48 loc) • 2.2 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.StyledBadge = void 0;
var _styledComponents = _interopRequireWildcard(require("styled-components"));
var _badge = require("../../types/badge");
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 StyledBadge = exports.StyledBadge = _styledComponents.default.div`
${({
$backgroundColor,
theme,
$fontColor,
$design,
$cursor,
$borderRadius,
$size,
$minWidth
}) => {
switch ($design) {
case _badge.BadgeDesign.BORDER:
return (0, _styledComponents.css)`
border-radius: 50px;
border: 1px solid ${theme.primary};
color: ${theme.primary};
font-size: ${$size === null || $size === void 0 ? void 0 : $size.font};
padding: ${$size === null || $size === void 0 ? void 0 : $size.padding};
user-select: none;
width: fit-content;
`;
case _badge.BadgeDesign.DEFAULT:
default:
return (0, _styledComponents.css)`
background-color: ${$backgroundColor ?? theme['secondary-202']};
border-radius: ${$borderRadius};
color: ${$fontColor ?? theme.text};
display: inline-block;
font-size: 0.8rem;
min-width: ${$minWidth};
padding: 2px 6px;
line-height: 20px;
text-align: center;
cursor: ${$cursor};
`;
}
}}
`;
//# sourceMappingURL=Badge.styles.js.map