"use client";
import { getSize } from "../../core/utils/get-size/get-size.mjs";
import { createVarsResolver } from "../../core/styles-api/create-vars-resolver/create-vars-resolver.mjs";
import { getThemeColor } from "../../core/MantineProvider/color-functions/get-theme-color/get-theme-color.mjs";
import { useProps } from "../../core/MantineProvider/use-props/use-props.mjs";
import { useStyles } from "../../core/styles-api/use-styles/use-styles.mjs";
import { factory } from "../../core/factory/factory.mjs";
import { Box } from "../../core/Box/Box.mjs";
import Loader_module_default from "./Loader.module.mjs";
import { Bars } from "./loaders/Bars.mjs";
import { Dots } from "./loaders/Dots.mjs";
import { Oval } from "./loaders/Oval.mjs";
import { jsx } from "react/jsx-runtime";
//#region packages/@mantine/core/src/components/Loader/Loader.tsx
const defaultLoaders = {
	bars: Bars,
	oval: Oval,
	dots: Dots
};
const defaultProps = {
	loaders: defaultLoaders,
	type: "oval"
};
const varsResolver = createVarsResolver((theme, { size, color }) => ({ root: {
	"--loader-size": getSize(size, "loader-size"),
	"--loader-color": color ? getThemeColor(color, theme) : void 0
} }));
const Loader = factory((_props) => {
	const props = useProps("Loader", defaultProps, _props);
	const { size, color, type, vars, className, style, classNames, styles, unstyled, loaders, variant, children, attributes, ...others } = props;
	const getStyles = useStyles({
		name: "Loader",
		props,
		classes: Loader_module_default,
		className,
		style,
		classNames,
		styles,
		unstyled,
		attributes,
		vars,
		varsResolver
	});
	if (children) return /* @__PURE__ */ jsx(Box, {
		...getStyles("root"),
		...others,
		children
	});
	return /* @__PURE__ */ jsx(Box, {
		...getStyles("root"),
		component: loaders[type],
		variant,
		size,
		...others
	});
});
Loader.defaultLoaders = defaultLoaders;
Loader.classes = Loader_module_default;
Loader.varsResolver = varsResolver;
Loader.displayName = "@mantine/core/Loader";
//#endregion
export { Loader, defaultLoaders };

//# sourceMappingURL=Loader.mjs.map