@selfcommunity/react-ui
Version:
React UI Components to integrate a Community created with SelfCommunity Platform.
52 lines (45 loc) • 3.46 kB
JavaScript
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 material_1 = require("@mui/material");
const constants_1 = require("./constants");
const classes = {
root: `${constants_1.PREFIX}-skeleton-root`,
title: `${constants_1.PREFIX}-title`,
content: `${constants_1.PREFIX}-content`,
consent: `${constants_1.PREFIX}-consent`,
consentSwitch: `${constants_1.PREFIX}-consent-switch`,
consentSwitchLabel: `${constants_1.PREFIX}-consent-switch-label`,
actions: `${constants_1.PREFIX}-actions`
};
const Root = (0, styles_1.styled)(material_1.Box, {
name: constants_1.PREFIX,
slot: 'SkeletonRoot'
})(() => ({}));
/**
* > API documentation for the Community-JS ConsentSolution Skeleton component. Learn about the available props and the CSS API.
#### Import
```jsx
import {ConsentSolutionSkeleton} from '@selfcommunity/react-ui';
```
#### Component Name
The name `SCConsentSolution-skeleton-root` can be used when providing style overrides in the theme.
#### CSS
|Rule Name|Global class|Description|
|---|---|---|
|root|.SCConsentSolution-skeleton-root|Styles applied to the root element.|
|title|.SCConsentSolution-title|Styles applied to the title element.|
|content|.SCConsentSolution-content|Styles applied to the content element.|
|consent|.SCConsentSolution-consent|Styles applied to the consent element.|
|consentSwitch|.SCConsentSolution-consent-switch|Styles applied to the switch skeleton element.|
|actions|.SCConsentSolution-actions|Styles applied to the actions section.|
*
*/
function ConsentSolutionSkeleton() {
const ContentSection = () => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 20, width: "100%" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 20, width: "80%" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 20, width: "60%" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 20, width: "30%" }), (0, jsx_runtime_1.jsx)("br", {})] }));
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root }, { children: [(0, jsx_runtime_1.jsx)(material_1.DialogTitle, Object.assign({ className: classes.title }, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 25, width: "70%" }) })), (0, jsx_runtime_1.jsx)(material_1.DialogContent, Object.assign({ className: classes.content, dividers: true }, { children: [...Array(2)].map((_, i) => ((0, jsx_runtime_1.jsx)(ContentSection, {}, i))) })), (0, jsx_runtime_1.jsxs)(material_1.DialogContent, Object.assign({ className: classes.consent, dividers: true }, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { height: 64, className: classes.consentSwitch }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 20, width: "50%", variant: 'text', className: classes.consentSwitchLabel })] })), (0, jsx_runtime_1.jsx)(material_1.DialogActions, Object.assign({ className: classes.actions }, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 40, width: "20%" }) }))] })));
}
exports.default = ConsentSolutionSkeleton;
;