'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/Sheet/Sheet.tsx
var Sheet_exports = {};
__export(Sheet_exports, {
  Sheet: () => Sheet,
  SheetClose: () => SheetClose,
  SheetContent: () => SheetContent,
  SheetDescription: () => SheetDescription,
  SheetFooter: () => SheetFooter,
  SheetHeader: () => SheetHeader,
  SheetRoot: () => SheetRoot,
  SheetTitle: () => SheetTitle,
  SheetTrigger: () => SheetTrigger
});
module.exports = __toCommonJS(Sheet_exports);
var React = __toESM(require("react"), 1);
var import_react_icons = require("@paalan/react-icons");
var import_lib = require("@paalan/react-shared/lib");
var SheetPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
var import_class_variance_authority = require("class-variance-authority");
var import_jsx_runtime = require("react/jsx-runtime");
var SheetRoot = SheetPrimitive.Root;
var SheetTrigger = SheetPrimitive.Trigger;
var SheetClose = SheetPrimitive.Close;
var SheetPortal = ({ ...props }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetPrimitive.Portal, { ...props });
SheetPortal.displayName = SheetPrimitive.Portal.displayName;
var SheetOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
  SheetPrimitive.Overlay,
  {
    className: (0, import_lib.cn)(
      "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
      className
    ),
    ...props,
    ref
  }
));
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
var sheetVariants = (0, import_class_variance_authority.cva)(
  "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",
  {
    variants: {
      side: {
        top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
        bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
        left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
        right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
      }
    },
    defaultVariants: {
      side: "right"
    }
  }
);
var SheetContent = React.forwardRef(
  ({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SheetPortal, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetOverlay, {}),
    /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SheetPrimitive.Content, { ref, className: (0, import_lib.cn)(sheetVariants({ side }), className), ...props, children: [
      children,
      /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
        /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_icons.Cross2Icon, { className: "size-4" }),
        /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sr-only", children: "Close" })
      ] })
    ] })
  ] })
);
SheetContent.displayName = SheetPrimitive.Content.displayName;
var SheetHeader = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_lib.cn)("flex flex-col space-y-2 text-center sm:text-left", className), ...props });
SheetHeader.displayName = "SheetHeader";
var SheetFooter = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_lib.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className), ...props });
SheetFooter.displayName = "SheetFooter";
var SheetTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetPrimitive.Title, { ref, className: (0, import_lib.cn)("text-lg font-semibold text-foreground", className), ...props }));
SheetTitle.displayName = SheetPrimitive.Title.displayName;
var SheetDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetPrimitive.Description, { ref, className: (0, import_lib.cn)("text-sm text-muted-foreground", className), ...props }));
SheetDescription.displayName = SheetPrimitive.Description.displayName;
var Sheet = ({
  side = "right",
  trigger,
  header,
  footer,
  children,
  className,
  ...props
}) => {
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SheetRoot, { ...props, children: [
    /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetTrigger, { asChild: true, children: trigger }),
    /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SheetContent, { side, className, children: [
      /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SheetHeader, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetTitle, { children: header.title }),
        header.description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetDescription, { children: header.description })
      ] }),
      children,
      /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SheetFooter, { className: "my-4", children: [
        footer?.secondaryAction && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetClose, { asChild: true, children: footer.secondaryAction }),
        footer?.primaryAction
      ] })
    ] })
  ] });
};
