"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 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 PillsInput_context = require("../../PillsInput/PillsInput.context.cjs");
const PillGroup_context = require("../PillGroup.context.cjs");
const Pill_module_css = require("../Pill.module.css.cjs");
const defaultProps = {};
const varsResolver = createVarsResolver.createVarsResolver((_, { gap }, { size }) => ({
  group: {
    "--pg-gap": gap !== void 0 ? getSize.getSize(gap) : getSize.getSize(size, "pg-gap")
  }
}));
const PillGroup = factory.factory((_props, ref) => {
  const props = useProps.useProps("PillGroup", defaultProps, _props);
  const { classNames, className, style, styles, unstyled, vars, size, disabled, ...others } = props;
  const pillsInputCtx = PillsInput_context.usePillsInputContext();
  const _size = (pillsInputCtx == null ? void 0 : pillsInputCtx.size) || size || void 0;
  const getStyles = useStyles.useStyles({
    name: "PillGroup",
    classes: Pill_module_css.default,
    props,
    className,
    style,
    classNames,
    styles,
    unstyled,
    vars,
    varsResolver,
    stylesCtx: { size: _size },
    rootSelector: "group"
  });
  return /* @__PURE__ */ jsxRuntime.jsx(PillGroup_context.PillGroupProvider, { value: { size: _size, disabled }, children: /* @__PURE__ */ jsxRuntime.jsx(Box.Box, { ref, size: _size, ...getStyles("group"), ...others }) });
});
PillGroup.classes = Pill_module_css.default;
PillGroup.displayName = "@mantine/core/PillGroup";
exports.PillGroup = PillGroup;
