UNPKG

1.14 kBJavaScriptView Raw
1import { __rest } from "tslib";
2import * as React from 'react';
3import styles from '@patternfly/react-styles/css/components/Skeleton/skeleton';
4import { css } from '@patternfly/react-styles';
5export const Skeleton = (_a) => {
6 var { className, width, height, fontSize, shape, screenreaderText } = _a, props = __rest(_a, ["className", "width", "height", "fontSize", "shape", "screenreaderText"]);
7 const fontHeightClassName = fontSize
8 ? Object.values(styles.modifiers).find(key => key === `pf-m-text-${fontSize}`)
9 : undefined;
10 return (React.createElement("div", Object.assign({}, props, { className: css(styles.skeleton, fontSize && fontHeightClassName, shape === 'circle' && styles.modifiers.circle, shape === 'square' && styles.modifiers.square, className) }, ((width || height) && {
11 style: Object.assign({ '--pf-c-skeleton--Width': width ? width : undefined, '--pf-c-skeleton--Height': height ? height : undefined }, props.style)
12 })),
13 React.createElement("span", { className: "pf-u-screen-reader" }, screenreaderText)));
14};
15Skeleton.displayName = 'Skeleton';
16//# sourceMappingURL=Skeleton.js.map
\No newline at end of file