"use client";
const require_use_props = require("../../core/MantineProvider/use-props/use-props.cjs");
const require_factory = require("../../core/factory/factory.cjs");
const require_InputBase = require("../InputBase/InputBase.cjs");
const require_PillsInput_context = require("./PillsInput.context.cjs");
const require_PillsInputField = require("./PillsInputField/PillsInputField.cjs");
let react = require("react");
let react_jsx_runtime = require("react/jsx-runtime");
//#region packages/@mantine/core/src/components/PillsInput/PillsInput.tsx
const defaultProps = { size: "sm" };
const PillsInput = require_factory.factory((_props) => {
	const { children, onMouseDown, onClick, size, disabled, __staticSelector, error, variant, ...others } = require_use_props.useProps([
		"Input",
		"InputWrapper",
		"PillsInput"
	], defaultProps, _props);
	const fieldRef = (0, react.useRef)(null);
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_PillsInput_context.PillsInputContext, {
		value: {
			fieldRef,
			size,
			disabled,
			hasError: !!error,
			variant
		},
		children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_InputBase.InputBase, {
			size,
			error,
			variant,
			component: "div",
			"data-no-overflow": true,
			onMouseDown: (event) => {
				event.preventDefault();
				onMouseDown?.(event);
				fieldRef.current?.focus();
			},
			onClick: (event) => {
				event.preventDefault();
				if (!event.currentTarget.closest("fieldset")?.disabled) {
					fieldRef.current?.focus();
					onClick?.(event);
				}
			},
			...others,
			multiline: true,
			disabled,
			__staticSelector: __staticSelector || "PillsInput",
			withAria: false,
			children
		})
	});
});
PillsInput.displayName = "@mantine/core/PillsInput";
PillsInput.classes = require_InputBase.InputBase.classes;
PillsInput.Field = require_PillsInputField.PillsInputField;
//#endregion
exports.PillsInput = PillsInput;

//# sourceMappingURL=PillsInput.cjs.map