import { jsx } from 'react/jsx-runtime';
import { c as cn } from './utils-BJnb9o5c.js';
import * as React from 'react';
import { P as Primitive } from './index-DhnfW8wQ.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;

function Label({
  className,
  ...props
}) {
  return /* @__PURE__ */ jsx(
    Root,
    {
      "data-slot": "label",
      className: cn(
        "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
        className
      ),
      ...props
    }
  );
}

export { Label as L };
//# sourceMappingURL=label-BgLSVt4u.js.map
