@chayns-components/core
Version:
A set of beautiful React components for developing your own applications with chayns.
58 lines (55 loc) • 2 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.StyledIconWrapper = exports.StyledIcon = 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 StyledIconWrapper = exports.StyledIconWrapper = _styledComponents.default.span`
align-items: center;
cursor: ${({
$isDisabled,
$isOnClick
}) => $isOnClick && !$isDisabled ? 'pointer' : 'inherit'};
display: inline-flex;
min-height: ${({
$size
}) => `${$size}px`};
justify-content: center;
opacity: ${({
$isDisabled
}) => $isDisabled ? 0.5 : 1};
position: relative;
transition: opacity 0.3s ease;
min-width: ${({
$size
}) => `${$size}px`};
// To insure that stacked icons have the same size as normal icons.
&&.fa-stack {
height: fit-content;
width: fit-content;
line-height: ${({
$size
}) => $size}px;
}
`;
const StyledIcon = exports.StyledIcon = _styledComponents.default.i`
color: ${({
$color,
theme
}) => $color || theme.headline};
display: ${({
$isStacked
}) => $isStacked ? undefined : 'inline-flex'};
font-size: ${({
$fontSize
}) => `${$fontSize}px`};
${({
$fontSize,
$size
}) => $fontSize !== $size && (0, _styledComponents.css)`
top: 50%;
transform: translateY(-50%);
`}
`;
//# sourceMappingURL=Icon.styles.js.map