UNPKG

dgz-ui-shared

Version:

Custom ui library using React.js, Shadcn/ui, TailwindCSS, Typescript, dgz-ui library

7 lines (6 loc) 3.72 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../jsx-runtime-h4oGeKUK.cjs"),o=require("../../index-BL59b1Bz-COeLljOH.cjs"),N=require("react"),s=require("../../index-C4qYhCZt-DWBiWQ93.cjs"),y=require("../../createLucideIcon-B950nf2d-DrrWmvZU.cjs"),d=require("../../utils-B6fNqzRf-BNysSCt9.cjs");function h(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=h(N);/** * @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 b=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],w=y.k("x",b),R=s.xe,k=s.Ce,v=s.Re,i=c.forwardRef(({className:e,...a},t)=>o.ae.jsx(s._e,{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._e.displayName;const m=c.forwardRef(({className:e,children:a,hasCloseButton:t,...r},l)=>o.ae.jsxs(v,{children:[o.ae.jsx(i,{}),o.ae.jsxs(s.he,{ref:l,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),...r,children:[a,t&&o.ae.jsxs(s.ye,{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(w,{className:"size-4"}),o.ae.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));m.displayName=s.he.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 u=({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});u.displayName="DialogFooter";const f=c.forwardRef(({className:e,...a},t)=>o.ae.jsx(s.Ee,{ref:t,className:d.mo("text-lg leading-none font-semibold tracking-tight",e),...a}));f.displayName=s.Ee.displayName;const p=c.forwardRef(({className:e,...a},t)=>o.ae.jsx(s.Pe,{ref:t,className:d.mo("text-muted-foreground text-sm",e),...a}));p.displayName=s.Pe.displayName;const E=({header:e,footer:a,trigger:t,children:r,size:l="lg",className:j,...g})=>n.jsxRuntimeExports.jsxs(R,{...g,children:[t&&n.jsxRuntimeExports.jsx(k,{asChild:!0,children:t}),n.jsxRuntimeExports.jsxs(m,{className:d.mo("data-[state=open]:animate-contentShowTop top-4 bottom-auto max-h-[calc(100vh-2rem)] 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%]",j),children:[n.jsxRuntimeExports.jsxs(x,{children:[n.jsxRuntimeExports.jsx(f,{className:"mb-0",children:e}),n.jsxRuntimeExports.jsx(p,{className:"hidden"})]}),r,a&&n.jsxRuntimeExports.jsx(u,{children:a})]})]});exports.MyModal=E;