| 1 |
import { __rest } from "tslib"; |
| 2 |
import { jsx as _jsx } from "react/jsx-runtime"; |
| 3 |
import styles from '@patternfly/react-styles/css/components/Skeleton/skeleton.mjs'; |
| 4 |
import { css } from '@patternfly/react-styles'; |
| 5 |
import cssHeight from '@patternfly/react-tokens/dist/esm/c_skeleton_Height'; |
| 6 |
import cssWidth from '@patternfly/react-tokens/dist/esm/c_skeleton_Width'; |
| 7 |
export const Skeleton = (_a) => { |
| 8 |
var { className, width, height, fontSize, shape, screenreaderText } = _a, props = __rest(_a, ["className", "width", "height", "fontSize", "shape", "screenreaderText"]); |
| 9 |
const fontHeightClassName = fontSize |
| 10 |
? Object.values(styles.modifiers).find((key) => key === `pf-m-text-${fontSize}`) |
| 11 |
: undefined; |
| 12 |
return (_jsx("div", Object.assign({}, props, { className: css(styles.skeleton, fontSize && fontHeightClassName, shape === 'circle' && styles.modifiers.circle, shape === 'square' && styles.modifiers.square, className) }, ((width || height) && { |
| 13 |
style: Object.assign({ [cssWidth.name]: width ? width : undefined, [cssHeight.name]: height ? height : undefined }, props.style) |
| 14 |
}), { children: _jsx("span", { className: "pf-v6-screen-reader", children: screenreaderText }) }))); |
| 15 |
}; |
| 16 |
Skeleton.displayName = 'Skeleton'; |
| 17 |
//# sourceMappingURL=Skeleton.js.map |