"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");
const createVarsResolver = require("../../core/styles-api/create-vars-resolver/create-vars-resolver.cjs");
require("clsx");
const getThemeColor = require("../../core/MantineProvider/color-functions/get-theme-color/get-theme-color.cjs");
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 Divider_module_css = require("./Divider.module.css.cjs");
const defaultProps = {
  orientation: "horizontal"
};
const varsResolver = createVarsResolver.createVarsResolver((theme, { color, variant, size }) => ({
  root: {
    "--divider-color": color ? getThemeColor.getThemeColor(color, theme) : void 0,
    "--divider-border-style": variant,
    "--divider-size": getSize.getSize(size, "divider-size")
  }
}));
const Divider = factory.factory((_props, ref) => {
  const props = useProps.useProps("Divider", defaultProps, _props);
  const {
    classNames,
    className,
    style,
    styles,
    unstyled,
    vars,
    color,
    orientation,
    label,
    labelPosition,
    mod,
    ...others
  } = props;
  const getStyles = useStyles.useStyles({
    name: "Divider",
    classes: Divider_module_css.default,
    props,
    className,
    style,
    classNames,
    styles,
    unstyled,
    vars,
    varsResolver
  });
  return /* @__PURE__ */ jsxRuntime.jsx(
    Box.Box,
    {
      ref,
      mod: [{ orientation, "with-label": !!label }, mod],
      ...getStyles("root"),
      ...others,
      role: "separator",
      children: label && /* @__PURE__ */ jsxRuntime.jsx(Box.Box, { component: "span", mod: { position: labelPosition }, ...getStyles("label"), children: label })
    }
  );
});
Divider.classes = Divider_module_css.default;
Divider.displayName = "@mantine/core/Divider";
exports.Divider = Divider;
