'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/Drawer/index.ts
var Drawer_exports = {};
__export(Drawer_exports, {
  Drawer: () => Drawer,
  DrawerClose: () => DrawerClose,
  DrawerContent: () => DrawerContent,
  DrawerDescription: () => DrawerDescription,
  DrawerFooter: () => DrawerFooter,
  DrawerHeader: () => DrawerHeader,
  DrawerOverlay: () => DrawerOverlay,
  DrawerPortal: () => DrawerPortal,
  DrawerRoot: () => DrawerRoot,
  DrawerTitle: () => DrawerTitle,
  DrawerTrigger: () => DrawerTrigger
});
module.exports = __toCommonJS(Drawer_exports);

// src/components/Drawer/Drawer.tsx
var React = __toESM(require("react"), 1);
var import_lib = require("@paalan/react-shared/lib");
var import_vaul = require("vaul");
var import_jsx_runtime = require("react/jsx-runtime");
var DrawerRoot = ({ shouldScaleBackground = true, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_vaul.Drawer.Root, { shouldScaleBackground, ...props });
DrawerRoot.displayName = "DrawerRoot";
var DrawerTrigger = import_vaul.Drawer.Trigger;
var DrawerPortal = import_vaul.Drawer.Portal;
var DrawerClose = import_vaul.Drawer.Close;
var DrawerOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_vaul.Drawer.Overlay, { ref, className: (0, import_lib.cn)("fixed inset-0 z-50 bg-black/80", className), ...props }));
DrawerOverlay.displayName = import_vaul.Drawer.Overlay.displayName;
var DrawerContent = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DrawerPortal, { children: [
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DrawerOverlay, {}),
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
    import_vaul.Drawer.Content,
    {
      ref,
      className: (0, import_lib.cn)(
        "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
        className
      ),
      ...props,
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" }),
        children
      ]
    }
  )
] }));
DrawerContent.displayName = "DrawerContent";
var DrawerHeader = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_lib.cn)("grid gap-1.5 p-4 text-center sm:text-left", className), ...props });
DrawerHeader.displayName = "DrawerHeader";
var DrawerFooter = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_lib.cn)("mt-auto flex flex-col gap-2 p-4", className), ...props });
DrawerFooter.displayName = "DrawerFooter";
var DrawerTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
  import_vaul.Drawer.Title,
  {
    ref,
    className: (0, import_lib.cn)("text-lg font-semibold leading-none tracking-tight", className),
    ...props
  }
));
DrawerTitle.displayName = import_vaul.Drawer.Title.displayName;
var DrawerDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_vaul.Drawer.Description, { ref, className: (0, import_lib.cn)("text-sm text-muted-foreground", className), ...props }));
DrawerDescription.displayName = import_vaul.Drawer.Description.displayName;
var Drawer = ({
  trigger,
  triggerClassName,
  contentClassName,
  content,
  header,
  footer,
  children,
  drawerCloseButton,
  drawerCloseButtonClassName,
  ...props
}) => {
  const drawerContent = content || children;
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DrawerRoot, { ...props, children: [
    trigger && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DrawerTrigger, { asChild: true, className: triggerClassName, children: trigger }),
    drawerContent && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DrawerContent, { className: contentClassName, children: [
      header && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DrawerHeader, { className: header.className, children: [
        header.title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DrawerTitle, { children: header.title }),
        header.description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DrawerDescription, { children: header.description })
      ] }),
      drawerContent,
      footer && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DrawerFooter, { className: footer.className, children: footer.content }),
      drawerCloseButton && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DrawerFooter, { className: (0, import_lib.cn)("pt-2", drawerCloseButtonClassName), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DrawerClose, { asChild: true, children: drawerCloseButton }) })
    ] })
  ] });
};
Drawer.displayName = "Drawer";
