"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const rem = require("../../../core/utils/units-converters/rem.cjs");
require("react");
const createVarsResolver = require("../../../core/styles-api/create-vars-resolver/create-vars-resolver.cjs");
require("clsx");
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 Button_module_css = require("../Button.module.css.cjs");
const defaultProps = {
  orientation: "horizontal"
};
const varsResolver = createVarsResolver.createVarsResolver((_, { borderWidth }) => ({
  group: { "--button-border-width": rem.rem(borderWidth) }
}));
const ButtonGroup = factory.factory((_props, ref) => {
  const props = useProps.useProps("ButtonGroup", defaultProps, _props);
  const {
    className,
    style,
    classNames,
    styles,
    unstyled,
    orientation,
    vars,
    borderWidth,
    variant,
    mod,
    ...others
  } = useProps.useProps("ButtonGroup", defaultProps, _props);
  const getStyles = useStyles.useStyles({
    name: "ButtonGroup",
    props,
    classes: Button_module_css.default,
    className,
    style,
    classNames,
    styles,
    unstyled,
    vars,
    varsResolver,
    rootSelector: "group"
  });
  return /* @__PURE__ */ jsxRuntime.jsx(
    Box.Box,
    {
      ...getStyles("group"),
      ref,
      variant,
      mod: [{ "data-orientation": orientation }, mod],
      role: "group",
      ...others
    }
  );
});
ButtonGroup.classes = Button_module_css.default;
ButtonGroup.displayName = "@mantine/core/ButtonGroup";
exports.ButtonGroup = ButtonGroup;
