UNPKG

@postenbring/hedwig-react

Version:

React components for [Hedwig Design System](https://github.com/bring/hedwig-design-system).

60 lines (58 loc) 1.35 kB
import { __objRest, __spreadProps, __spreadValues } from "./chunk-YOSPWY5K.mjs"; // src/skeleton/skeleton.tsx import { clsx } from "@postenbring/hedwig-css/typed-classname"; import { Slot } from "@radix-ui/react-slot"; import { forwardRef } from "react"; import { jsx } from "react/jsx-runtime"; var Skeleton = forwardRef( (_a, ref) => { var _b = _a, { as: Tag = "div", asChild, children, animation = true, variant = "text", width, height, className, style } = _b, rest = __objRest(_b, [ "as", "asChild", "children", "animation", "variant", "width", "height", "className", "style" ]); const Component = asChild ? Slot : Tag; return /* @__PURE__ */ jsx( Component, __spreadProps(__spreadValues(__spreadProps(__spreadValues({ className: clsx( "hds-skeleton", `hds-skeleton--${variant}`, !animation && `hds-skeleton--no-animation`, className ), style: __spreadProps(__spreadValues({}, style), { width, height }), "aria-hidden": true }, { inert: "true" }), { ref }), rest), { children }) ); } ); Skeleton.displayName = "Skeleton"; export { Skeleton }; //# sourceMappingURL=chunk-WLESNP6Z.mjs.map