"use client";
const require_rem = require("../../core/utils/units-converters/rem.cjs");
const require_get_size = require("../../core/utils/get-size/get-size.cjs");
const require_create_vars_resolver = require("../../core/styles-api/create-vars-resolver/create-vars-resolver.cjs");
const require_get_theme_color = require("../../core/MantineProvider/color-functions/get-theme-color/get-theme-color.cjs");
const require_get_contrast_color = require("../../core/MantineProvider/color-functions/get-contrast-color/get-contrast-color.cjs");
const require_get_auto_contrast_value = require("../../core/MantineProvider/color-functions/get-auto-contrast-value/get-auto-contrast-value.cjs");
const require_use_props = require("../../core/MantineProvider/use-props/use-props.cjs");
const require_use_styles = require("../../core/styles-api/use-styles/use-styles.cjs");
const require_factory = require("../../core/factory/factory.cjs");
const require_Box = require("../../core/Box/Box.cjs");
const require_Timeline_context = require("./Timeline.context.cjs");
const require_Timeline_module = require("./Timeline.module.cjs");
const require_TimelineItem = require("./TimelineItem/TimelineItem.cjs");
let react = require("react");
let react_jsx_runtime = require("react/jsx-runtime");
//#region packages/@mantine/core/src/components/Timeline/Timeline.tsx
const defaultProps = {
	active: -1,
	align: "left"
};
const varsResolver = require_create_vars_resolver.createVarsResolver((theme, { bulletSize, lineWidth, radius, color, autoContrast }) => ({ root: {
	"--tl-bullet-size": require_rem.rem(bulletSize),
	"--tl-line-width": require_rem.rem(lineWidth),
	"--tl-radius": radius === void 0 ? void 0 : require_get_size.getRadius(radius),
	"--tl-color": color ? require_get_theme_color.getThemeColor(color, theme) : void 0,
	"--tl-icon-color": require_get_auto_contrast_value.getAutoContrastValue(autoContrast, theme) ? require_get_contrast_color.getContrastColor({
		color,
		theme,
		autoContrast
	}) : void 0
} }));
const Timeline = require_factory.factory((_props) => {
	const props = require_use_props.useProps("Timeline", defaultProps, _props);
	const { classNames, className, style, styles, unstyled, vars, children, active, color, radius, bulletSize, align, lineWidth, reverseActive, mod, autoContrast, attributes, ...others } = props;
	const getStyles = require_use_styles.useStyles({
		name: "Timeline",
		classes: require_Timeline_module.default,
		props,
		className,
		style,
		classNames,
		styles,
		unstyled,
		attributes,
		vars,
		varsResolver
	});
	const _children = react.Children.toArray(children);
	const items = _children.map((item, index) => (0, react.cloneElement)(item, {
		unstyled,
		__align: align,
		__active: item.props?.active || (reverseActive ? active >= _children.length - index - 1 : active >= index),
		__lineActive: item.props?.lineActive || (reverseActive ? active >= _children.length - index - 1 : active - 1 >= index)
	}));
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Timeline_context.TimelineProvider, {
		value: { getStyles },
		children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Box.Box, {
			...getStyles("root"),
			mod: [{ align }, mod],
			...others,
			children: items
		})
	});
});
Timeline.classes = require_Timeline_module.default;
Timeline.varsResolver = varsResolver;
Timeline.displayName = "@mantine/core/Timeline";
Timeline.Item = require_TimelineItem.TimelineItem;
//#endregion
exports.Timeline = Timeline;

//# sourceMappingURL=Timeline.cjs.map