UNPKG

@eccenca/gui-elements

Version:

GUI elements based on other libraries, usable in React application, written in Typescript.

24 lines 926 B
import React from "react"; import { SKELETON } from "./classnames.js"; /** * `<Skeleton />` provides a loading state display of its children elements. * It does not provide its own content. */ export function Skeleton(_a) { var children = _a.children; var alteredChildren = React.Children.map(children, function (child) { var originalChild = child; if (originalChild.props) { return React.cloneElement(originalChild, { className: originalChild.props.className ? originalChild.props.className + " " + SKELETON : SKELETON, // @see https://blueprintjs.com/docs/versions/4/#core/components/skeleton disabled: true, tabIndex: -1, }); } return originalChild; }); return React.createElement(React.Fragment, null, alteredChildren); } export default Skeleton; //# sourceMappingURL=Skeleton.js.map