import { jsx } from 'react/jsx-runtime';
import { forwardRef } from 'react';
import { c as cx } from './index-SvGbrGuT.js';
import { u as useLayoutPropsUtil } from './useLayoutPropsUtil-loxbyklF.js';

import './Skeleton.css';const skeleton = "_skeleton_unbyv_2";
const shade = "_shade_unbyv_17";
const pulser = "_pulser_unbyv_1";
const text = "_text_unbyv_29";
const body = "_body_unbyv_33";
const line = "_line_unbyv_33";
const headline = "_headline_unbyv_40";
const circle = "_circle_unbyv_44";
const rectangle = "_rectangle_unbyv_49";
const pill = "_pill_unbyv_53";
const styles = {
	skeleton: skeleton,
	shade: shade,
	pulser: pulser,
	text: text,
	body: body,
	line: line,
	headline: headline,
	circle: circle,
	rectangle: rectangle,
	pill: pill
};

const SkeletonCircle = forwardRef(
  (props, ref) => {
    const { layoutStyles, componentProps } = useLayoutPropsUtil(props);
    const {
      className,
      diameter,
      "aria-label": ariaLabel = "Loading content",
      style,
      ...rest
    } = componentProps;
    const SkeletonClassNames = cx(
      [styles["skeleton"]],
      [styles["circle"]],
      styles["shade"],
      className
    );
    const styleCombined = {
      ...style,
      ...layoutStyles,
      "--diameter": diameter
    };
    return /* @__PURE__ */ jsx(
      "div",
      {
        ...rest,
        "data-anv": "skeleton-circle",
        role: "progressbar",
        "aria-busy": "true",
        className: SkeletonClassNames,
        style: styleCombined,
        "aria-label": ariaLabel,
        ref
      }
    );
  }
);
SkeletonCircle.displayName = "SkeletonCircle";

const SkeletonPill = forwardRef(
  (props, ref) => {
    const { layoutStyles, componentProps } = useLayoutPropsUtil(props);
    const {
      className,
      width,
      "aria-label": ariaLabel = "Loading content",
      style,
      ...rest
    } = componentProps;
    const SkeletonClassNames = cx(
      [styles["skeleton"]],
      [styles["pill"]],
      styles["shade"],
      className
    );
    const styleCombined = {
      ...style,
      ...layoutStyles,
      "--width": width
    };
    return /* @__PURE__ */ jsx(
      "div",
      {
        ...rest,
        "data-anv": "skeleton-pill",
        role: "progressbar",
        "aria-busy": "true",
        className: SkeletonClassNames,
        style: styleCombined,
        "aria-label": ariaLabel,
        ref
      }
    );
  }
);
SkeletonPill.displayName = "SkeletonPill";

const SkeletonRectangle = forwardRef((props, ref) => {
  const { layoutStyles, componentProps } = useLayoutPropsUtil(props);
  const {
    className,
    height,
    "aria-label": ariaLabel = "Loading content",
    style,
    ...rest
  } = componentProps;
  const SkeletonClassNames = cx(
    [styles["skeleton"]],
    [styles["rectangle"]],
    styles["shade"],
    className
  );
  const styleCombined = {
    ...style,
    ...layoutStyles,
    "--height": height
  };
  return /* @__PURE__ */ jsx(
    "div",
    {
      ...rest,
      "data-anv": "skeleton-rectangle",
      role: "progressbar",
      "aria-busy": "true",
      className: SkeletonClassNames,
      style: styleCombined,
      "aria-label": ariaLabel,
      ref
    }
  );
});
SkeletonRectangle.displayName = "SkeletonRectangle";

const SkeletonText = forwardRef(
  (props, ref) => {
    const { layoutStyles, componentProps } = useLayoutPropsUtil(props);
    const {
      className,
      "aria-label": ariaLabel = "Loading content",
      variant = "body",
      style,
      ...rest
    } = componentProps;
    const SkeletonClassNames = cx(
      [styles["skeleton"]],
      [styles["text"]],
      [styles[variant]],
      className
    );
    const styleCombined = {
      ...style,
      ...layoutStyles
    };
    const ShaderClassName = cx(styles["line"], styles["shade"]);
    return /* @__PURE__ */ jsx(
      "div",
      {
        ...rest,
        "data-anv": "skeleton-text",
        role: "progressbar",
        "aria-busy": "true",
        className: SkeletonClassNames,
        style: styleCombined,
        "aria-label": ariaLabel,
        ref,
        children: "rows" in rest ? Array.from({ length: rest.rows ?? 1 }, (_, i) => i).map((i) => /* @__PURE__ */ jsx("div", { className: ShaderClassName }, `line-${i}`)) : /* @__PURE__ */ jsx("div", { className: ShaderClassName })
      }
    );
  }
);
SkeletonText.displayName = "SkeletonText";

const Skeleton = Object.assign(
  {},
  {
    Circle: SkeletonCircle,
    Pill: SkeletonPill,
    Rectangle: SkeletonRectangle,
    Text: SkeletonText
  }
);

export { Skeleton, SkeletonCircle, SkeletonPill, SkeletonRectangle, SkeletonText };
//# sourceMappingURL=Skeleton.js.map
