"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const rem = require("../../core/utils/units-converters/rem.cjs");
require("react");
const getSize = require("../../core/utils/get-size/get-size.cjs");
const createVarsResolver = require("../../core/styles-api/create-vars-resolver/create-vars-resolver.cjs");
require("clsx");
const useProps = require("../../core/MantineProvider/use-props/use-props.cjs");
const useStyles = require("../../core/styles-api/use-styles/use-styles.cjs");
const Box = require("../../core/Box/Box.cjs");
const factory = require("../../core/factory/factory.cjs");
const Skeleton_module_css = require("./Skeleton.module.css.cjs");
const defaultProps = {
  visible: true,
  animate: true
};
const varsResolver = createVarsResolver.createVarsResolver(
  (_, { width, height, radius, circle }) => ({
    root: {
      "--skeleton-height": rem.rem(height),
      "--skeleton-width": circle ? rem.rem(height) : rem.rem(width),
      "--skeleton-radius": circle ? "1000px" : radius === void 0 ? void 0 : getSize.getRadius(radius)
    }
  })
);
const Skeleton = factory.factory((_props, ref) => {
  const props = useProps.useProps("Skeleton", defaultProps, _props);
  const {
    classNames,
    className,
    style,
    styles,
    unstyled,
    vars,
    width,
    height,
    circle,
    visible,
    radius,
    animate,
    mod,
    ...others
  } = props;
  const getStyles = useStyles.useStyles({
    name: "Skeleton",
    classes: Skeleton_module_css.default,
    props,
    className,
    style,
    classNames,
    styles,
    unstyled,
    vars,
    varsResolver
  });
  return /* @__PURE__ */ jsxRuntime.jsx(Box.Box, { ref, ...getStyles("root"), mod: [{ visible, animate }, mod], ...others });
});
Skeleton.classes = Skeleton_module_css.default;
Skeleton.displayName = "@mantine/core/Skeleton";
exports.Skeleton = Skeleton;
