import { jsx } from "react/jsx-runtime";
import "react";
import { createVarsResolver } from "../../core/styles-api/create-vars-resolver/create-vars-resolver.mjs";
import "clsx";
import { useProps } from "../../core/MantineProvider/use-props/use-props.mjs";
import { useStyles } from "../../core/styles-api/use-styles/use-styles.mjs";
import { Box } from "../../core/Box/Box.mjs";
import { factory } from "../../core/factory/factory.mjs";
import classes from "./AspectRatio.module.css.mjs";
const defaultProps = {};
const varsResolver = createVarsResolver((_, { ratio }) => ({
  root: {
    "--ar-ratio": ratio == null ? void 0 : ratio.toString()
  }
}));
const AspectRatio = factory((_props, ref) => {
  const props = useProps("AspectRatio", defaultProps, _props);
  const { classNames, className, style, styles, unstyled, vars, ratio, ...others } = props;
  const getStyles = useStyles({
    name: "AspectRatio",
    classes,
    props,
    className,
    style,
    classNames,
    styles,
    unstyled,
    vars,
    varsResolver
  });
  return /* @__PURE__ */ jsx(Box, { ref, ...getStyles("root"), ...others });
});
AspectRatio.classes = classes;
AspectRatio.displayName = "@mantine/core/AspectRatio";
export {
  AspectRatio
};
