@selfcommunity/react-ui
Version:
React UI Components to integrate a Community created with SelfCommunity Platform.
49 lines (42 loc) • 3.75 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const styles_1 = require("@mui/material/styles");
const Skeleton_1 = tslib_1.__importDefault(require("@mui/material/Skeleton"));
const Widget_1 = tslib_1.__importDefault(require("../Widget"));
const material_1 = require("@mui/material");
const constants_1 = require("./constants");
const classes = {
root: `${constants_1.PREFIX}-skeleton-root`,
primary: `${constants_1.PREFIX}-primary`,
secondary: `${constants_1.PREFIX}-secondary`,
progressBar: `${constants_1.PREFIX}-progress-bar`,
action: `${constants_1.PREFIX}-action`
};
const Root = (0, styles_1.styled)(Widget_1.default, {
name: constants_1.PREFIX,
slot: 'SkeletonRoot'
})(() => ({}));
/**
* > API documentation for the Community-JS Incubator Skeleton component. Learn about the available props and the CSS API.
#### Import
```jsx
import {IncubatorSkeleton} from '@selfcommunity/react-ui';
```
#### Component Name
The name `SCIncubator-skeleton-root` can be used when providing style overrides in the theme.
#### CSS
|Rule Name|Global class|Description|
|---|---|---|
|root|.SCIncubator-skeleton-root|Styles applied to the root element.|
|primary|.SCIncubator-primary|Styles applied to the primary text element.|
|secondary|.SCIncubator-secondary|Styles applied to the secondary text element.|
|progressBar|.SCIncubator-progress-bar|Styles applied to the progress bar section.|
|action|.SCIncubator-action|Styles applied to the action button element.|
*
*/
function IncubatorSkeleton(props) {
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root }, props, { children: [(0, jsx_runtime_1.jsxs)(material_1.CardContent, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.primary }, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 20, width: "40%", variant: "text" }) })), (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: classes.secondary }, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 10, width: "50%", variant: "text" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 10, width: "80%", variant: "text" })] })), (0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ container: true, spacing: 1, className: classes.progressBar }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 12 }, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 20, width: "100%", variant: "rectangular" }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: true }, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 10, width: "100%", variant: "text" }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: true }, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 10, width: "100%", variant: "text" }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: true }, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 10, width: "100%", variant: "text" }) }))] }))] }), (0, jsx_runtime_1.jsx)(material_1.CardActions, Object.assign({ className: classes.action }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ disabled: true, variant: 'outlined', size: 'small' }, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 20, width: 50, variant: "text" }) })) }))] })));
}
exports.default = IncubatorSkeleton;