UNPKG

@selfcommunity/react-ui

Version:

React UI Components to integrate a Community created with SelfCommunity Platform.

48 lines (41 loc) 2.8 kB
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime"; import { styled } from '@mui/material/styles'; import Skeleton from '@mui/material/Skeleton'; import { Box, DialogActions, DialogContent, DialogTitle } from '@mui/material'; import { PREFIX } from './constants'; const classes = { root: `${PREFIX}-skeleton-root`, title: `${PREFIX}-title`, content: `${PREFIX}-content`, consent: `${PREFIX}-consent`, consentSwitch: `${PREFIX}-consent-switch`, consentSwitchLabel: `${PREFIX}-consent-switch-label`, actions: `${PREFIX}-actions` }; const Root = styled(Box, { name: 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.| * */ export default function ConsentSolutionSkeleton() { const ContentSection = () => (_jsxs(_Fragment, { children: [_jsx(Skeleton, { animation: "wave", height: 20, width: "100%" }), _jsx(Skeleton, { animation: "wave", height: 20, width: "80%" }), _jsx(Skeleton, { animation: "wave", height: 20, width: "60%" }), _jsx(Skeleton, { animation: "wave", height: 20, width: "30%" }), _jsx("br", {})] })); return (_jsxs(Root, Object.assign({ className: classes.root }, { children: [_jsx(DialogTitle, Object.assign({ className: classes.title }, { children: _jsx(Skeleton, { animation: "wave", height: 25, width: "70%" }) })), _jsx(DialogContent, Object.assign({ className: classes.content, dividers: true }, { children: [...Array(2)].map((_, i) => (_jsx(ContentSection, {}, i))) })), _jsxs(DialogContent, Object.assign({ className: classes.consent, dividers: true }, { children: [_jsx(Skeleton, { height: 64, className: classes.consentSwitch }), _jsx(Skeleton, { animation: "wave", height: 20, width: "50%", variant: 'text', className: classes.consentSwitchLabel })] })), _jsx(DialogActions, Object.assign({ className: classes.actions }, { children: _jsx(Skeleton, { animation: "wave", height: 40, width: "20%" }) }))] }))); }