@navinc/base-react-components
Version:
Nav's Pattern Library
42 lines (40 loc) • 1.85 kB
JavaScript
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import styled from 'styled-components';
import { CDNAsset } from './cdn-asset.js';
import { LoadingDots } from './loading-dots.js';
const GoldenCenter = styled.div.withConfig({ displayName: "brc-sc-GoldenCenter", componentId: "brc-sc-zgl3am" }) `
display: flex;
align-items: center;
justify-content: center;
height: calc(100vh * 1 / ${({ theme }) => theme.goldenRatio});
`;
const LoadingContent = styled.div.withConfig({ displayName: "brc-sc-LoadingContent", componentId: "brc-sc-18zolej" }) `
display: flex;
flex-flow: column nowrap;
align-items: center;
& > ${LoadingDots} {
color: ${({ theme }) => theme.navPrimary};
margin: 24px 0;
}
& > ${CDNAsset} {
height: 190px;
}
`;
export const LoadingView = (_a) => {
var { className, message = null, illustration } = _a, props = __rest(_a, ["className", "message", "illustration"]);
const defaultDirectory = 'illustrations';
return (_jsx(GoldenCenter, Object.assign({ className: className, "data-testid": "loading-view" }, props, { children: _jsxs(LoadingContent, { children: [message, _jsx(LoadingDots, {}), illustration ? _jsx(CDNAsset, { directory: defaultDirectory, filename: illustration }) : null] }) })));
};
LoadingView.displayName = 'LoadingView';
//# sourceMappingURL=loading-view.js.map