import { jsx } from "react/jsx-runtime";
import * as React from "react";
import { P as Primitive } from "../../index-BEpjRf6p.js";
import { c as cn } from "../../cn-FAaWYZ6x.js";
var NAME = "Label";
var Label$1 = React.forwardRef((props, forwardedRef) => {
  return /* @__PURE__ */ jsx(
    Primitive.label,
    {
      ...props,
      ref: forwardedRef,
      onMouseDown: (event) => {
        const target = event.target;
        if (target.closest("button, input, select, textarea")) return;
        props.onMouseDown?.(event);
        if (!event.defaultPrevented && event.detail > 1) event.preventDefault();
      }
    }
  );
});
Label$1.displayName = NAME;
var Root = Label$1;
const Label = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
  Root,
  {
    ref,
    className: cn(
      "text-sm font-medium leading-none text-primary cursor-pointer peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
      className
    ),
    ...props
  }
));
Label.displayName = "Label";
export {
  Label
};
