Debian Codegraph @

node/@patternfly/react-core/dist/js/components/Skeleton/Skeleton.js

raw
1 "use strict";
2 Object.defineProperty(exports, "__esModule", { value: true });
3 exports.Skeleton = void 0;
4 const tslib_1 = require("tslib");
5 const jsx_runtime_1 = require("react/jsx-runtime");
6 const skeleton_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/components/Skeleton/skeleton"));
7 const react_styles_1 = require("@patternfly/react-styles");
8 const c_skeleton_Height_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/c_skeleton_Height'));
9 const c_skeleton_Width_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/c_skeleton_Width'));
10 const Skeleton = (_a) => {
11 var { className, width, height, fontSize, shape, screenreaderText } = _a, props = tslib_1.__rest(_a, ["className", "width", "height", "fontSize", "shape", "screenreaderText"]);
12 const fontHeightClassName = fontSize
13 ? Object.values(skeleton_1.default.modifiers).find((key) => key === `pf-m-text-${fontSize}`)
14 : undefined;
15 return ((0, jsx_runtime_1.jsx)("div", Object.assign({}, props, { className: (0, react_styles_1.css)(skeleton_1.default.skeleton, fontSize && fontHeightClassName, shape === 'circle' && skeleton_1.default.modifiers.circle, shape === 'square' && skeleton_1.default.modifiers.square, className) }, ((width || height) && {
16 style: Object.assign({ [c_skeleton_Width_1.default.name]: width ? width : undefined, [c_skeleton_Height_1.default.name]: height ? height : undefined }, props.style)
17 }), { children: (0, jsx_runtime_1.jsx)("span", { className: "pf-v6-screen-reader", children: screenreaderText }) })));
18 };
19 exports.Skeleton = Skeleton;
20 exports.Skeleton.displayName = 'Skeleton';
21 //# sourceMappingURL=Skeleton.js.map