'use client';
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/Label/Label.tsx
var Label_exports = {};
__export(Label_exports, {
  Label: () => Label
});
module.exports = __toCommonJS(Label_exports);
var React2 = __toESM(require("react"), 1);
var import_react_icons = require("@paalan/react-icons");
var import_lib2 = require("@paalan/react-shared/lib");
var LabelPrimitive = __toESM(require("@radix-ui/react-label"), 1);
var import_class_variance_authority = require("class-variance-authority");

// src/components/Tooltip/Tooltip.tsx
var React = __toESM(require("react"), 1);
var import_react_hooks = require("@paalan/react-hooks");
var import_lib = require("@paalan/react-shared/lib");
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
var import_jsx_runtime = require("react/jsx-runtime");
var TooltipProvider = TooltipPrimitive.Provider;
var TooltipRoot = TooltipPrimitive.Root;
var TooltipTrigger = TooltipPrimitive.Trigger;
var TooltipPortal = TooltipPrimitive.Portal;
var TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
  TooltipPrimitive.Content,
  {
    ref,
    sideOffset,
    className: (0, import_lib.cn)(
      "z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
      className
    ),
    ...props
  }
));
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
var Tooltip = React.forwardRef(
  ({
    className,
    trigger,
    asPortal,
    content,
    side = "top",
    align = "center",
    defaultOpen,
    open,
    onOpenChange,
    ...props
  }, ref) => {
    const TooltipPortalComponent = asPortal ? TooltipPortal : React.Fragment;
    const [localOpen, setLocalOpen] = (0, import_react_hooks.useControllableState)({
      defaultValue: defaultOpen,
      value: open,
      onChange: onOpenChange
    });
    return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipProvider, { delayDuration: 100, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TooltipRoot, { open: localOpen, onOpenChange: setLocalOpen, children: [
      /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipTrigger, { asChild: true, children: trigger }),
      /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPortalComponent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
        TooltipContent,
        {
          ref,
          className: (0, import_lib.cn)("bg-secondary fill-secondary text-secondary-foreground", className),
          side,
          align,
          ...props,
          children: [
            content,
            /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPrimitive.Arrow, { width: 11, height: 5 })
          ]
        }
      ) })
    ] }) });
  }
);

// src/components/Label/Label.tsx
var import_jsx_runtime2 = require("react/jsx-runtime");
var labelVariants = (0, import_class_variance_authority.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
var Label = React2.forwardRef(
  ({ className, required = false, labelDescription, text, isInvalid, children, disabled, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
    LabelPrimitive.Root,
    {
      ref,
      className: (0, import_lib2.cn)(labelVariants(), { "text-danger": isInvalid, "opacity-70": disabled }, className),
      ...props,
      children: [
        text || children,
        required && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "text-danger/70", children: "*" }),
        labelDescription && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
          Tooltip,
          {
            trigger: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_icons.InfoOutlineIcon, { className: "ml-1 text-muted-foreground", "aria-hidden": "true" }),
            content: labelDescription
          }
        )
      ]
    }
  )
);
Label.displayName = LabelPrimitive.Root.displayName;
