UNPKG

lucid-ui

Version:

A UI component library from AppNexus.

72 lines (68 loc) 3.15 kB
import _toNumber from "lodash/toNumber"; function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } import React from 'react'; import { cxBackgroundGray } from './LoadingSkeletonsSvgUtil'; import LoadingSkeleton from './LoadingSkeleton'; export var GroupSkeleton = function GroupSkeleton(props) { var _props$width = props.width, width = _props$width === void 0 ? 300 : _props$width, _props$height = props.height, height = _props$height === void 0 ? 55 : _props$height, className = props.className; var bottomRectWidth = _toNumber(width) - _toNumber(width) / 3; return /*#__PURE__*/React.createElement("div", { "data-test-id": "loadingSkeleton-GroupSkeleton" }, /*#__PURE__*/React.createElement("svg", { "data-test-id": "loadingSkeleton-GroupSkeleton-svg", width: width, height: height, version: "1.1", xmlns: "http://www.w3.org/2000/svg" }, /*#__PURE__*/React.createElement("g", { id: "GroupSkeleton-Details", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd" }, /*#__PURE__*/React.createElement("g", { id: "GroupSkeleton-Group" }, /*#__PURE__*/React.createElement("g", { id: "GGroupSkeleton-Group-1", className: cxBackgroundGray('&', className) }, /*#__PURE__*/React.createElement("rect", { id: "Rectangle", x: "0", y: "0" })), /*#__PURE__*/React.createElement("rect", { className: cxBackgroundGray('&', className), id: "GroupSkeleton-Rectangle-1", x: "10", y: "13", width: width, height: "10" }), /*#__PURE__*/React.createElement("rect", { className: cxBackgroundGray('&', className), id: "GroupSkeleton-Rectangle-2", x: "10", y: "32", width: bottomRectWidth, height: "18" }))))); }; var GroupLoadingSkeleton = function GroupLoadingSkeleton(props) { return /*#__PURE__*/React.createElement(LoadingSkeleton, _extends({ "data-test-id": "loadingSkeleton-GroupLoadingSkeleton", Skeleton: GroupSkeleton }, props)); }; GroupLoadingSkeleton.displayName = 'GroupLoadingSkeleton'; GroupLoadingSkeleton.peek = { description: "\n\t\tA loading indicator wrapper with optional overlay.\n\t", notes: { overview: "\n\t\t\tA visual indication that a section or component of the interface is loading. Designed to indicate loading data\n\t\t", intendedUse: "\n\t\t\t- Use in places where data takes time to load. GroupLoadingSkeleton lets users know that the information they expect to see will appear shortly.\t\t\n\t\t", technicalRecommendations: "\n\t\t\tIf a page is displaying a lot of data coming from multiple sources, try as best as possible to load the \n\t\t\tindividual parts of the UI, so as not to disrupt the user and block them from interacting with the entire page until all data is loaded.\n\t\t" }, categories: ['Loading Indicator'] }; export default GroupLoadingSkeleton;