"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: all[name]
    });
}
_export(exports, {
    Sheet: function() {
        return Sheet;
    },
    SheetClose: function() {
        return SheetClose;
    },
    SheetContent: function() {
        return SheetContent;
    },
    SheetDescription: function() {
        return SheetDescription;
    },
    SheetFooter: function() {
        return SheetFooter;
    },
    SheetHeader: function() {
        return SheetHeader;
    },
    SheetTitle: function() {
        return SheetTitle;
    },
    SheetTrigger: function() {
        return SheetTrigger;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
const _reactdialog = /*#__PURE__*/ _interop_require_wildcard(require("@radix-ui/react-dialog"));
const _classvarianceauthority = require("class-variance-authority");
const _css = require("../utils/css");
const _icon = require("../icon");
function _getRequireWildcardCache(nodeInterop) {
    if (typeof WeakMap !== "function") return null;
    var cacheBabelInterop = new WeakMap();
    var cacheNodeInterop = new WeakMap();
    return (_getRequireWildcardCache = function(nodeInterop) {
        return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
    })(nodeInterop);
}
function _interop_require_wildcard(obj, nodeInterop) {
    if (!nodeInterop && obj && obj.__esModule) {
        return obj;
    }
    if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
        return {
            default: obj
        };
    }
    var cache = _getRequireWildcardCache(nodeInterop);
    if (cache && cache.has(obj)) {
        return cache.get(obj);
    }
    var newObj = {
        __proto__: null
    };
    var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
    for(var key in obj){
        if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
            var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
            if (desc && (desc.get || desc.set)) {
                Object.defineProperty(newObj, key, desc);
            } else {
                newObj[key] = obj[key];
            }
        }
    }
    newObj.default = obj;
    if (cache) {
        cache.set(obj, newObj);
    }
    return newObj;
}
const Sheet = _reactdialog.Root;
const SheetTrigger = _reactdialog.Trigger;
const SheetClose = _reactdialog.Close;
const SheetPortal = ({ //@ts-ignore
className, ...props })=>//@ts-ignore
    /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactdialog.Portal, {
        className: (0, _css.cn)(className),
        ...props
    });
SheetPortal.displayName = _reactdialog.Portal.displayName;
const SheetOverlay = /*#__PURE__*/ _react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_reactdialog.Overlay, {
        className: (0, _css.cn)("orderly-sheet-overlay orderly-fixed orderly-inset-0 orderly-z-50 orderly-bg-black/60 orderly-backdrop-blur-sm data-[state=open]:orderly-animate-in data-[state=closed]:orderly-animate-out data-[state=closed]:orderly-fade-out-0 data-[state=open]:orderly-fade-in-0", className),
        ...props,
        ref: ref
    }));
SheetOverlay.displayName = _reactdialog.Overlay.displayName;
const sheetVariants = (0, _classvarianceauthority.cva)("orderly-fixed orderly-z-50 orderly-gap-4 orderly-bg-base-700 orderly-p-[20px] orderly-shadow-lg orderly-transition orderly-ease-in-out data-[state=open]:orderly-animate-in data-[state=closed]:orderly-animate-out data-[state=closed]:orderly-duration-260 data-[state=open]:orderly-duration-300", {
    variants: {
        side: {
            top: "orderly-inset-x-0 orderly-top-0 orderly-border-b data-[state=closed]:orderly-slide-out-to-top data-[state=open]:orderly-slide-in-from-top",
            bottom: "orderly-inset-x-0 orderly-bottom-0 orderly-rounded-t-2xl data-[state=closed]:orderly-slide-out-to-bottom data-[state=open]:orderly-slide-in-from-bottom",
            left: "orderly-inset-y-0 orderly-left-0 orderly-h-full orderly-w-3/4 data-[state=closed]:orderly-slide-out-to-left data-[state=open]:orderly-slide-in-from-left sm:orderly-max-w-sm",
            right: "orderly-inset-y-0 orderly-right-0 orderly-h-full orderly-w-3/4 orderly-border-l data-[state=closed]:orderly-slide-out-to-right data-[state=open]:orderly-slide-in-from-right sm:orderly-max-w-sm"
        }
    },
    defaultVariants: {
        side: "bottom"
    }
});
const SheetContent = /*#__PURE__*/ _react.forwardRef(({ side = "bottom", closeable = true, className, children, ...props }, ref)=>/*#__PURE__*/ (0, _jsxruntime.jsxs)(SheetPortal, {
        children: [
            /*#__PURE__*/ (0, _jsxruntime.jsx)(SheetOverlay, {}),
            /*#__PURE__*/ (0, _jsxruntime.jsxs)(_reactdialog.Content, {
                ref: ref,
                className: (0, _css.cn)("orderly-sheet-content", sheetVariants({
                    side
                }), className),
                ...props,
                children: [
                    children,
                    closeable && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_reactdialog.Close, {
                        className: "orderly-absolute orderly-right-[24px] orderly-top-[24px] orderly-rounded-sm orderly-opacity-70 orderly-ring-offset-base-700 orderly-transition-opacity hover:orderly-opacity-100 focus:orderly-outline-none focus:orderly-ring-2 focus:orderly-ring-ring focus:orderly-ring-offset-2 disabled:orderly-pointer-events-none data-[state=open]:orderly-bg-secondary",
                        children: [
                            /*#__PURE__*/ (0, _jsxruntime.jsx)(_icon.CloseIcon, {
                                size: 20
                            }),
                            /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
                                className: "orderly-sr-only",
                                children: "Close"
                            })
                        ]
                    })
                ]
            })
        ]
    }));
SheetContent.displayName = _reactdialog.Content.displayName;
const SheetHeader = ({ className, leading, ...props })=>/*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
        className: "orderly-sheet-header orderly-grid orderly-grid-cols-[40px_1fr_40px] orderly-items-center",
        children: [
            /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
                children: leading
            }),
            /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
                className: (0, _css.cn)("orderly-flex orderly-flex-col orderly-space-y-2 orderly-text-center orderly-text-lg orderly-text-base-contrast", className),
                ...props
            })
        ]
    });
SheetHeader.displayName = "SheetHeader";
const SheetFooter = ({ className, ...props })=>/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
        className: (0, _css.cn)("orderly-sheet-footer orderly-flex orderly-flex-col-reverse sm:orderly-flex-row sm:orderly-justify-end sm:orderly-space-x-2", className),
        ...props
    });
SheetFooter.displayName = "SheetFooter";
const SheetTitle = /*#__PURE__*/ _react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_reactdialog.Title, {
        ref: ref,
        className: (0, _css.cn)("orderly-sheet-title orderly-text-lg orderly-text-base-contrast", className),
        ...props
    }));
SheetTitle.displayName = _reactdialog.Title.displayName;
const SheetDescription = /*#__PURE__*/ _react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_reactdialog.Description, {
        ref: ref,
        className: (0, _css.cn)("orderly-sheet-description orderly-text-2xs orderly-text-base-contrast-54", className),
        ...props
    }));
SheetDescription.displayName = _reactdialog.Description.displayName;

//# sourceMappingURL=sheet.js.map