UNPKG

@selfcommunity/react-ui

Version:

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

47 lines (40 loc) 2.39 kB
"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 material_1 = require("@mui/material"); const BaseItem_1 = tslib_1.__importDefault(require("../../shared/BaseItem")); const constants_1 = require("./constants"); const classes = { root: `${constants_1.PREFIX}-skeleton-root`, image: `${constants_1.PREFIX}-image`, primary: `${constants_1.PREFIX}-primary`, secondary: `${constants_1.PREFIX}-secondary`, button: `${constants_1.PREFIX}-button`, action: `${constants_1.PREFIX}-action` }; const Root = (0, styles_1.styled)(BaseItem_1.default, { name: constants_1.PREFIX, slot: 'SkeletonRoot' })(() => ({})); /** * > API documentation for the Community-JS Category Skeleton component. Learn about the available props and the CSS API. #### Import ```jsx import {CategorySkeleton} from '@selfcommunity/react-ui'; ``` #### Component Name The name `SCCategory-skeleton-root` can be used when providing style overrides in the theme. #### CSS |Rule Name|Global class|Description| |---|---|---| |root|.SCCategory-skeleton-root|Styles applied to the root element.| * */ function CategorySkeleton(props) { const theme = (0, material_1.useTheme)(); return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: classes.root }, props, { image: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "rectangular", width: theme.selfcommunity.category.icon.sizeMedium, height: theme.selfcommunity.category.icon.sizeMedium, className: classes.image }), primary: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 10, width: 120, className: classes.primary }), secondary: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 10, width: 70, className: classes.secondary }), actions: props.actions !== undefined ? (props.actions) : ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "outlined", disabled: true, className: classes.button }, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 10, width: 50, className: classes.action }) }))) }))); } exports.default = CategorySkeleton;