dgz-ui-shared
Version:
Custom ui library using React.js, Shadcn/ui, TailwindCSS, Typescript, dgz-ui library
7 lines (6 loc) • 3.68 kB
JavaScript
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../jsx-runtime-DUiatUiq.cjs"),o=require("../../index-DqTIeHVj-DlSOwhuZ.cjs"),g=require("react"),s=require("../../index-sde7W6lA-DX6VW7zF.cjs"),d=require("../../utils-B6fNqzRf-BNysSCt9.cjs"),N=require("../../createLucideIcon-B950nf2d-CFaVx9a3.cjs");function y(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const c=y(g);/**
* @license lucide-react v0.511.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const h=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],b=N.k("x",h),w=s.ve,R=s.xe,v=s.Ce,i=c.forwardRef(({className:e,...a},t)=>o.ae.jsx(s.Re,{ref:t,className:d.mo("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",e),...a}));i.displayName=s.Re.displayName;const m=c.forwardRef(({className:e,children:a,...t},r)=>o.ae.jsxs(v,{children:[o.ae.jsx(i,{}),o.ae.jsxs(s._e,{ref:r,className:d.mo("bg-background 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%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...t,children:[a,o.ae.jsxs(s.Pe,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[o.ae.jsx(b,{className:"h-4 w-4"}),o.ae.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));m.displayName=s._e.displayName;const x=({className:e,...a})=>o.ae.jsx("div",{className:d.mo("flex flex-col space-y-1.5 text-center sm:text-left",e),...a});x.displayName="DialogHeader";const f=({className:e,...a})=>o.ae.jsx("div",{className:d.mo("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...a});f.displayName="DialogFooter";const u=c.forwardRef(({className:e,...a},t)=>o.ae.jsx(s.he,{ref:t,className:d.mo("text-lg leading-none font-semibold tracking-tight",e),...a}));u.displayName=s.he.displayName;const p=c.forwardRef(({className:e,...a},t)=>o.ae.jsx(s.Ee,{ref:t,className:d.mo("text-muted-foreground text-sm",e),...a}));p.displayName=s.Ee.displayName;const k=({header:e,footer:a,trigger:t,children:r,size:l="lg",...j})=>n.jsxRuntimeExports.jsxs(w,{...j,children:[t&&n.jsxRuntimeExports.jsx(R,{asChild:!0,children:t}),n.jsxRuntimeExports.jsxs(m,{className:d.mo("data-[state=open]:animate-contentShowTop fixed top-4 bottom-auto max-h-[calc(100vh-2rem)] w-full max-w-lg translate-y-0 overflow-y-auto",l==="xl"&&"max-w-xl",l==="2xl"&&"max-w-2xl",l==="3xl"&&"max-w-3xl",l==="4xl"&&"max-w-5xl",l==="5xl"&&"max-w-5xl",l==="6xl"&&"max-w-6xl",l==="7xl"&&"max-w-7xl",l==="full"&&"max-w-[95%]"),children:[n.jsxRuntimeExports.jsxs(x,{children:[n.jsxRuntimeExports.jsx(u,{children:e}),n.jsxRuntimeExports.jsx(p,{className:"hidden"})]}),r,a&&n.jsxRuntimeExports.jsx(f,{children:a})]})]});exports.MyModal=k;