"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
require("react");
const getSize = require("../../../core/utils/get-size/get-size.cjs");
require("clsx");
const getThemeColor = require("../../../core/MantineProvider/color-functions/get-theme-color/get-theme-color.cjs");
const MantineThemeProvider = require("../../../core/MantineProvider/MantineThemeProvider/MantineThemeProvider.cjs");
const useProps = require("../../../core/MantineProvider/use-props/use-props.cjs");
const Box = require("../../../core/Box/Box.cjs");
const factory = require("../../../core/factory/factory.cjs");
const Timeline_context = require("../Timeline.context.cjs");
const Timeline_module_css = require("../Timeline.module.css.cjs");
const defaultProps = {};
const TimelineItem = factory.factory((_props, ref) => {
  const props = useProps.useProps("TimelineItem", defaultProps, _props);
  const {
    classNames,
    className,
    style,
    styles,
    vars,
    __active,
    __align,
    __lineActive,
    __vars,
    bullet,
    radius,
    color,
    lineVariant,
    children,
    title,
    mod,
    ...others
  } = props;
  const ctx = Timeline_context.useTimelineContext();
  const theme = MantineThemeProvider.useMantineTheme();
  const stylesApiProps = { classNames, styles };
  return /* @__PURE__ */ jsxRuntime.jsxs(
    Box.Box,
    {
      ...ctx.getStyles("item", { ...stylesApiProps, className, style }),
      mod: [{ "line-active": __lineActive, active: __active }, mod],
      ref,
      __vars: {
        "--tli-radius": radius ? getSize.getRadius(radius) : void 0,
        "--tli-color": color ? getThemeColor.getThemeColor(color, theme) : void 0,
        "--tli-border-style": lineVariant || void 0
      },
      ...others,
      children: [
        /* @__PURE__ */ jsxRuntime.jsx(
          Box.Box,
          {
            ...ctx.getStyles("itemBullet", stylesApiProps),
            mod: { "with-child": !!bullet, align: __align, active: __active },
            children: bullet
          }
        ),
        /* @__PURE__ */ jsxRuntime.jsxs("div", { ...ctx.getStyles("itemBody", stylesApiProps), children: [
          title && /* @__PURE__ */ jsxRuntime.jsx("div", { ...ctx.getStyles("itemTitle", stylesApiProps), children: title }),
          /* @__PURE__ */ jsxRuntime.jsx("div", { ...ctx.getStyles("itemContent", stylesApiProps), children })
        ] })
      ]
    }
  );
});
TimelineItem.classes = Timeline_module_css.default;
TimelineItem.displayName = "@mantine/core/TimelineItem";
exports.TimelineItem = TimelineItem;
