UNPKG

@navinc/base-react-components

Version:
49 lines (47 loc) 2.35 kB
"use strict"; 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 }); exports.LoadingView = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); const styled_components_1 = __importDefault(require("styled-components")); const cdn_asset_js_1 = require("./cdn-asset.js"); const loading_dots_js_1 = require("./loading-dots.js"); const GoldenCenter = styled_components_1.default.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_components_1.default.div.withConfig({ displayName: "brc-sc-LoadingContent", componentId: "brc-sc-18zolej" }) ` display: flex; flex-flow: column nowrap; align-items: center; & > ${loading_dots_js_1.LoadingDots} { color: ${({ theme }) => theme.navPrimary}; margin: 24px 0; } & > ${cdn_asset_js_1.CDNAsset} { height: 190px; } `; const LoadingView = (_a) => { var { className, message = null, illustration } = _a, props = __rest(_a, ["className", "message", "illustration"]); const defaultDirectory = 'illustrations'; 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_js_1.LoadingDots, {}), illustration ? (0, jsx_runtime_1.jsx)(cdn_asset_js_1.CDNAsset, { directory: defaultDirectory, filename: illustration }) : null] }) }))); }; exports.LoadingView = LoadingView; exports.LoadingView.displayName = 'LoadingView'; //# sourceMappingURL=loading-view.js.map