@veracity/vui
Version:
Veracity UI is a React component library crafted for use within Veracity applications and pages. Based on Styled Components and @xstyled.
34 lines (32 loc) • 1.21 kB
JavaScript
import { filterUndefined } from "../utils/object.js";
import { cs } from "../utils/styles.js";
import { omitThemingProps, useStyleConfig } from "../core/theme.js";
import styled from "../core/styled.js";
import vui from "../core/vui.js";
import { Fragment, jsx } from "react/jsx-runtime";
//#region src/skeleton/skeleton.tsx
const SkeletonBase = styled.divBox`
animation: vui-pulse 1.5s ease-in-out 0.5s infinite;
`;
/**
* Displays one or more animated skeleton elements to signify loading content.
*/
const Skeleton = vui((props, ref) => {
const { className, repeat = 1, ...rest } = omitThemingProps(props);
const styles = useStyleConfig("Skeleton", props);
const arr = Array(repeat).fill(0);
const aliasedProps = filterUndefined({ w: props.variant === "circle" ? styles.h : void 0 });
return /* @__PURE__ */ jsx(Fragment, { children: arr.map((_, i) => /* @__PURE__ */ jsx(SkeletonBase, {
"aria-hidden": "true",
className: cs("vui-skeleton", className),
ref,
...styles,
...aliasedProps,
...rest
}, i)) });
});
Skeleton.displayName = "Skeleton";
//#endregion
export { Skeleton, Skeleton as default, SkeletonBase };
globalThis.__vuiVersion__ = "5.3.1"
//# sourceMappingURL=skeleton.js.map