@navinc/base-react-components
Version:
Nav's Pattern Library
67 lines (65 loc) • 3.02 kB
JavaScript
;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
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;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
const styled_components_1 = __importDefault(require("styled-components"));
const cdn_illustration_1 = __importDefault(require("./cdn-illustration"));
const loading_dots_1 = __importDefault(require("./loading-dots"));
const theme = __importStar(require("./theme"));
const GoldenCenter = styled_components_1.default.div `
display: flex;
align-items: center;
justify-content: center;
height: calc(100vh * 1 / ${theme.goldenRatio});
`;
const LoadingContent = styled_components_1.default.div `
display: flex;
flex-flow: column nowrap;
align-items: center;
& > ${loading_dots_1.default} {
color: ${theme.azure};
margin: 24px 0;
}
& > ${cdn_illustration_1.default} {
height: 190px;
}
`;
const LoadingView = (_a) => {
var { className, message = null, illustration, children } = _a, props = __rest(_a, ["className", "message", "illustration", "children"]);
return ((0, jsx_runtime_1.jsx)(GoldenCenter, Object.assign({ className: className, "data-testid": "loading-view" }, props, { children: (0, jsx_runtime_1.jsxs)(LoadingContent, { children: [message, (0, jsx_runtime_1.jsx)(loading_dots_1.default, {}, void 0), illustration ? (0, jsx_runtime_1.jsx)(cdn_illustration_1.default, { filename: illustration }, void 0) : null] }, void 0) }), void 0));
};
LoadingView.displayName = 'LoadingView';
exports.default = LoadingView;
//# sourceMappingURL=loading-view.js.map