@chayns-components/core
Version:
A set of beautiful React components for developing your own applications with chayns.
73 lines (71 loc) • 2.64 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.StyledSmallWaitCursorWaitCursor = exports.StyledSmallWaitCursorBackground = exports.StyledSmallWaitCursor = 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 StyledSmallWaitCursor = exports.StyledSmallWaitCursor = _styledComponents.default.div`
position: relative;
height: ${({
$size
}) => $size}px;
width: ${({
$size
}) => $size}px;
opacity: ${({
$shouldShowWaitCursor
}) => $shouldShowWaitCursor ? 1 : 0};
`;
const StyledSmallWaitCursorBackground = exports.StyledSmallWaitCursorBackground = _styledComponents.default.div`
background-color: white;
border-radius: 50%;
height: 100%;
width: 100%;
position: relative;
z-index: 1;
box-shadow:
0 4px 12px 0 rgba(0, 0, 0, 0.2),
0 1px 1px rgba(0, 0, 0, 0.2);
`;
const spin = (0, _styledComponents.keyframes)`
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
`;
const StyledSmallWaitCursorWaitCursor = exports.StyledSmallWaitCursorWaitCursor = _styledComponents.default.div`
position: absolute;
top: ${({
$shouldHideBackground
}) => $shouldHideBackground ? 0 : 5}px;
left: ${({
$shouldHideBackground
}) => $shouldHideBackground ? 0 : 5}px;
z-index: 2;
border-style: solid;
border-width: 3px;
border-color: ${({
theme,
$shouldHideBackground,
$color
}) => {
if ($color) {
return $color;
}
return theme.colorMode === 'dark' && $shouldHideBackground ? theme.headline : theme.primary;
}};
height: ${({
$shouldHideBackground,
$size
}) => $shouldHideBackground ? '100%' : `${$size - 10}px`};
width: ${({
$shouldHideBackground,
$size
}) => $shouldHideBackground ? '100%' : `${$size - 10}px`};
border-radius: 50%;
display: inline-block;
border-top: 3px solid transparent;
animation: ${spin} ${({
$speed
}) => $speed}s linear infinite;
`;
//# sourceMappingURL=SmallWaitCursor.styles.js.map