blockiesui
Version:
A UI library for Blockies
45 lines (42 loc) • 3.85 kB
JavaScript
import { __rest, __assign } from '../../node_modules/.pnpm/@rollup_plugin-typescript@1_1c5553510af13619ab22a8c63104fe51/node_modules/tslib/tslib.es6.js';
import { jsx, jsxs } from 'react/jsx-runtime';
import * as React from 'react';
import { Overlay, Portal, Content, Close, Title, Description, Root, Trigger } from '../../node_modules/.pnpm/@radix-ui_react-dialog@1.1._6fb400f3bbe3d7c4c31990790be0171a/node_modules/@radix-ui/react-dialog/dist/index.js';
import { cn } from '../../utils/cn.js';
import X from '../../node_modules/.pnpm/lucide-react@0.483.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/x.js';
var Dialog = Root;
var DialogTrigger = Trigger;
var DialogPortal = Portal;
var DialogClose = Close;
var DialogOverlay = React.forwardRef(function (_a, ref) {
var className = _a.className, props = __rest(_a, ["className"]);
return (jsx(Overlay, __assign({ ref: ref, className: cn("fixed inset-0 z-50 bg-black/60 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className || "") }, props)));
});
DialogOverlay.displayName = Overlay.displayName;
var DialogContent = React.forwardRef(function (_a, ref) {
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
return (jsxs(DialogPortal, { children: [jsx(DialogOverlay, {}), jsxs(Content, __assign({ ref: ref, className: cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className || "") }, props, { children: [children, jsxs(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-accent data-[state=open]:text-muted-foreground", children: [jsx(X, { className: "h-4 w-4" }), jsx("span", { className: "sr-only", children: "Close" })] })] }))] }));
});
DialogContent.displayName = Content.displayName;
var DialogHeader = function (_a) {
var className = _a.className, props = __rest(_a, ["className"]);
return (jsx("div", __assign({ className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className || "") }, props)));
};
DialogHeader.displayName = "DialogHeader";
var DialogFooter = function (_a) {
var className = _a.className, props = __rest(_a, ["className"]);
return (jsx("div", __assign({ className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className || "") }, props)));
};
DialogFooter.displayName = "DialogFooter";
var DialogTitle = React.forwardRef(function (_a, ref) {
var className = _a.className, props = __rest(_a, ["className"]);
return (jsx(Title, __assign({ ref: ref, className: cn("text-lg font-semibold leading-none tracking-tight", className || "") }, props)));
});
DialogTitle.displayName = Title.displayName;
var DialogDescription = React.forwardRef(function (_a, ref) {
var className = _a.className, props = __rest(_a, ["className"]);
return (jsx(Description, __assign({ ref: ref, className: cn("text-sm text-muted-foreground", className || "") }, props)));
});
DialogDescription.displayName = Description.displayName;
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
//# sourceMappingURL=dialog.js.map