@stackshift-ui/dialog 1.0.0-beta.5 → 1.0.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ var g=Object.create;var f=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(a=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(a,{get:(b,c)=>(typeof require!="undefined"?require:b)[c]}):a)(function(a){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var l=(a,b,c,e)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&f(a,d,{get:()=>b[d],enumerable:!(e=h(b,d))||e.enumerable});return a};var o=(a,b,c)=>(c=a!=null?g(j(a)):{},l(b||!a||!a.__esModule?f(c,"default",{value:a,enumerable:!0}):c,a));export{m as a,n as b,o as c};
@@ -0,0 +1 @@
1
+ import*as a from"@radix-ui/react-dialog";import{XIcon as w}from"lucide-react";import*as n from"react";import{cn as m,DefaultComponent as s,useStackShiftUIComponents as r}from"@stackshift-ui/system";import{jsx as i,jsxs as d}from"react/jsx-runtime";var c="Dialog",p="DialogTrigger",f="DialogPortal",g="DialogClose",R="DialogOverlay",D="DialogContent",y="DialogHeader",v="DialogFooter",u="DialogTitle",P="DialogDescription",b=n.forwardRef(({...e},t)=>{let{[c]:o=s}=r();return i(o,{as:a.Root,ref:t,"data-slot":"dialog",...e})});b.displayName=c;var T=n.forwardRef(({...e},t)=>{let{[p]:o=s}=r();return i(o,{as:a.Trigger,ref:t,"data-slot":"dialog-trigger",...e})});T.displayName=p;var C=n.forwardRef(({...e},t)=>{let{[f]:o=s}=r();return i(o,{as:a.Portal,ref:t,"data-slot":"dialog-portal",...e})});C.displayName=f;var E=n.forwardRef(({...e},t)=>{let{[g]:o=s}=r();return i(o,{as:a.Close,ref:t,"data-slot":"dialog-close",...e})});E.displayName=g;var N=n.forwardRef(({className:e,...t},o)=>{let{[R]:l=s}=r();return i(l,{as:a.Overlay,ref:o,"data-slot":"dialog-overlay",className:m("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/50",e),...t})});N.displayName=R;var W=n.forwardRef(({className:e,children:t,showCloseButton:o=!0,...l},h)=>{let{[D]:x=s}=r();return d(C,{"data-slot":"dialog-portal",children:[i(N,{}),d(x,{as:a.Content,ref:h,"data-slot":"dialog-content",className:m("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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...l,children:[t,o&&d(a.Close,{"data-slot":"dialog-close",className:"ring-offset-background focus-visible:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[i(w,{}),i("span",{className:"sr-only",children:"Close"})]})]})]})});W.displayName=D;var z=n.forwardRef(({className:e,...t},o)=>{let{[y]:l=s}=r();return i(l,{ref:o,"data-slot":"dialog-header",className:m("flex flex-col gap-2 text-center sm:text-left",e),...t})});z.displayName=y;var O=n.forwardRef(({className:e,...t},o)=>{let{[v]:l=s}=r();return i(l,{ref:o,"data-slot":"dialog-footer",className:m("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})});O.displayName=v;var k=n.forwardRef(({className:e,...t},o)=>{let{[u]:l=s}=r();return i(l,{as:a.Title,ref:o,"data-slot":"dialog-title",className:m("text-lg leading-none font-semibold",e),...t})});k.displayName=u;var F=n.forwardRef(({className:e,...t},o)=>{let{[P]:l=s}=r();return i(l,{as:a.Description,ref:o,"data-slot":"dialog-description",className:m("text-muted-foreground text-sm",e),...t})});F.displayName=P;export{b as a,T as b,C as c,E as d,N as e,W as f,z as g,O as h,k as i,F as j};
@@ -0,0 +1,15 @@
1
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
2
+ import * as React from "react";
3
+ declare const Dialog: React.ForwardRefExoticComponent<DialogPrimitive.DialogProps & React.RefAttributes<never>>;
4
+ declare const DialogTrigger: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
5
+ declare const DialogPortal: React.ForwardRefExoticComponent<DialogPrimitive.DialogPortalProps & React.RefAttributes<never>>;
6
+ declare const DialogClose: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
7
+ declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
+ declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
9
+ showCloseButton?: boolean;
10
+ } & React.RefAttributes<HTMLDivElement>>;
11
+ declare const DialogHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
+ declare const DialogFooter: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
+ declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
14
+ declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
15
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
package/dist/dialog.js ADDED
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";var H=Object.create;var m=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var U=(e,t)=>{for(var a in t)m(e,a,{get:t[a],enumerable:!0})},p=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of I(t))!B.call(e,r)&&r!==a&&m(e,r,{get:()=>t[r],enumerable:!(n=_(t,r))||n.enumerable});return e};var f=(e,t,a)=>(a=e!=null?H(S(e)):{},p(t||!e||!e.__esModule?m(a,"default",{value:e,enumerable:!0}):a,e)),X=e=>p(m({},"__esModule",{value:!0}),e);var j={};U(j,{Dialog:()=>w,DialogClose:()=>T,DialogContent:()=>E,DialogDescription:()=>k,DialogFooter:()=>z,DialogHeader:()=>W,DialogOverlay:()=>c,DialogPortal:()=>d,DialogTitle:()=>O,DialogTrigger:()=>b});module.exports=X(j);var l=f(require("@radix-ui/react-dialog")),g=require("lucide-react"),s=f(require("react")),o=require("@stackshift-ui/system"),i=require("react/jsx-runtime"),R="Dialog",D="DialogTrigger",y="DialogPortal",v="DialogClose",u="DialogOverlay",P="DialogContent",C="DialogHeader",N="DialogFooter",h="DialogTitle",x="DialogDescription",w=s.forwardRef(({...e},t)=>{let{[R]:a=o.DefaultComponent}=(0,o.useStackShiftUIComponents)();return(0,i.jsx)(a,{as:l.Root,ref:t,"data-slot":"dialog",...e})});w.displayName=R;var b=s.forwardRef(({...e},t)=>{let{[D]:a=o.DefaultComponent}=(0,o.useStackShiftUIComponents)();return(0,i.jsx)(a,{as:l.Trigger,ref:t,"data-slot":"dialog-trigger",...e})});b.displayName=D;var d=s.forwardRef(({...e},t)=>{let{[y]:a=o.DefaultComponent}=(0,o.useStackShiftUIComponents)();return(0,i.jsx)(a,{as:l.Portal,ref:t,"data-slot":"dialog-portal",...e})});d.displayName=y;var T=s.forwardRef(({...e},t)=>{let{[v]:a=o.DefaultComponent}=(0,o.useStackShiftUIComponents)();return(0,i.jsx)(a,{as:l.Close,ref:t,"data-slot":"dialog-close",...e})});T.displayName=v;var c=s.forwardRef(({className:e,...t},a)=>{let{[u]:n=o.DefaultComponent}=(0,o.useStackShiftUIComponents)();return(0,i.jsx)(n,{as:l.Overlay,ref:a,"data-slot":"dialog-overlay",className:(0,o.cn)("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/50",e),...t})});c.displayName=u;var E=s.forwardRef(({className:e,children:t,showCloseButton:a=!0,...n},r)=>{let{[P]:F=o.DefaultComponent}=(0,o.useStackShiftUIComponents)();return(0,i.jsxs)(d,{"data-slot":"dialog-portal",children:[(0,i.jsx)(c,{}),(0,i.jsxs)(F,{as:l.Content,ref:r,"data-slot":"dialog-content",className:(0,o.cn)("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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...n,children:[t,a&&(0,i.jsxs)(l.Close,{"data-slot":"dialog-close",className:"ring-offset-background focus-visible:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,i.jsx)(g.XIcon,{}),(0,i.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});E.displayName=P;var W=s.forwardRef(({className:e,...t},a)=>{let{[C]:n=o.DefaultComponent}=(0,o.useStackShiftUIComponents)();return(0,i.jsx)(n,{ref:a,"data-slot":"dialog-header",className:(0,o.cn)("flex flex-col gap-2 text-center sm:text-left",e),...t})});W.displayName=C;var z=s.forwardRef(({className:e,...t},a)=>{let{[N]:n=o.DefaultComponent}=(0,o.useStackShiftUIComponents)();return(0,i.jsx)(n,{ref:a,"data-slot":"dialog-footer",className:(0,o.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})});z.displayName=N;var O=s.forwardRef(({className:e,...t},a)=>{let{[h]:n=o.DefaultComponent}=(0,o.useStackShiftUIComponents)();return(0,i.jsx)(n,{as:l.Title,ref:a,"data-slot":"dialog-title",className:(0,o.cn)("text-lg leading-none font-semibold",e),...t})});O.displayName=h;var k=s.forwardRef(({className:e,...t},a)=>{let{[x]:n=o.DefaultComponent}=(0,o.useStackShiftUIComponents)();return(0,i.jsx)(n,{as:l.Description,ref:a,"data-slot":"dialog-description",className:(0,o.cn)("text-muted-foreground text-sm",e),...t})});k.displayName=x;0&&(module.exports={Dialog,DialogClose,DialogContent,DialogDescription,DialogFooter,DialogHeader,DialogOverlay,DialogPortal,DialogTitle,DialogTrigger});
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";import{a,b,c,d,e,f,g,h,i,j}from"./chunk-NJ4HWVJQ.mjs";import"./chunk-3EYN2AKU.mjs";export{a as Dialog,d as DialogClose,f as DialogContent,j as DialogDescription,h as DialogFooter,g as DialogHeader,e as DialogOverlay,c as DialogPortal,i as DialogTitle,b as DialogTrigger};
@@ -0,0 +1 @@
1
+ export * from "./dialog";
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";var H=Object.create;var m=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var U=(e,t)=>{for(var a in t)m(e,a,{get:t[a],enumerable:!0})},p=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of I(t))!B.call(e,r)&&r!==a&&m(e,r,{get:()=>t[r],enumerable:!(n=_(t,r))||n.enumerable});return e};var f=(e,t,a)=>(a=e!=null?H(S(e)):{},p(t||!e||!e.__esModule?m(a,"default",{value:e,enumerable:!0}):a,e)),X=e=>p(m({},"__esModule",{value:!0}),e);var j={};U(j,{Dialog:()=>w,DialogClose:()=>T,DialogContent:()=>E,DialogDescription:()=>k,DialogFooter:()=>z,DialogHeader:()=>W,DialogOverlay:()=>c,DialogPortal:()=>d,DialogTitle:()=>O,DialogTrigger:()=>b});module.exports=X(j);var l=f(require("@radix-ui/react-dialog")),g=require("lucide-react"),s=f(require("react")),o=require("@stackshift-ui/system"),i=require("react/jsx-runtime"),R="Dialog",D="DialogTrigger",y="DialogPortal",v="DialogClose",u="DialogOverlay",P="DialogContent",C="DialogHeader",N="DialogFooter",h="DialogTitle",x="DialogDescription",w=s.forwardRef(({...e},t)=>{let{[R]:a=o.DefaultComponent}=(0,o.useStackShiftUIComponents)();return(0,i.jsx)(a,{as:l.Root,ref:t,"data-slot":"dialog",...e})});w.displayName=R;var b=s.forwardRef(({...e},t)=>{let{[D]:a=o.DefaultComponent}=(0,o.useStackShiftUIComponents)();return(0,i.jsx)(a,{as:l.Trigger,ref:t,"data-slot":"dialog-trigger",...e})});b.displayName=D;var d=s.forwardRef(({...e},t)=>{let{[y]:a=o.DefaultComponent}=(0,o.useStackShiftUIComponents)();return(0,i.jsx)(a,{as:l.Portal,ref:t,"data-slot":"dialog-portal",...e})});d.displayName=y;var T=s.forwardRef(({...e},t)=>{let{[v]:a=o.DefaultComponent}=(0,o.useStackShiftUIComponents)();return(0,i.jsx)(a,{as:l.Close,ref:t,"data-slot":"dialog-close",...e})});T.displayName=v;var c=s.forwardRef(({className:e,...t},a)=>{let{[u]:n=o.DefaultComponent}=(0,o.useStackShiftUIComponents)();return(0,i.jsx)(n,{as:l.Overlay,ref:a,"data-slot":"dialog-overlay",className:(0,o.cn)("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/50",e),...t})});c.displayName=u;var E=s.forwardRef(({className:e,children:t,showCloseButton:a=!0,...n},r)=>{let{[P]:F=o.DefaultComponent}=(0,o.useStackShiftUIComponents)();return(0,i.jsxs)(d,{"data-slot":"dialog-portal",children:[(0,i.jsx)(c,{}),(0,i.jsxs)(F,{as:l.Content,ref:r,"data-slot":"dialog-content",className:(0,o.cn)("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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...n,children:[t,a&&(0,i.jsxs)(l.Close,{"data-slot":"dialog-close",className:"ring-offset-background focus-visible:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,i.jsx)(g.XIcon,{}),(0,i.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});E.displayName=P;var W=s.forwardRef(({className:e,...t},a)=>{let{[C]:n=o.DefaultComponent}=(0,o.useStackShiftUIComponents)();return(0,i.jsx)(n,{ref:a,"data-slot":"dialog-header",className:(0,o.cn)("flex flex-col gap-2 text-center sm:text-left",e),...t})});W.displayName=C;var z=s.forwardRef(({className:e,...t},a)=>{let{[N]:n=o.DefaultComponent}=(0,o.useStackShiftUIComponents)();return(0,i.jsx)(n,{ref:a,"data-slot":"dialog-footer",className:(0,o.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})});z.displayName=N;var O=s.forwardRef(({className:e,...t},a)=>{let{[h]:n=o.DefaultComponent}=(0,o.useStackShiftUIComponents)();return(0,i.jsx)(n,{as:l.Title,ref:a,"data-slot":"dialog-title",className:(0,o.cn)("text-lg leading-none font-semibold",e),...t})});O.displayName=h;var k=s.forwardRef(({className:e,...t},a)=>{let{[x]:n=o.DefaultComponent}=(0,o.useStackShiftUIComponents)();return(0,i.jsx)(n,{as:l.Description,ref:a,"data-slot":"dialog-description",className:(0,o.cn)("text-muted-foreground text-sm",e),...t})});k.displayName=x;0&&(module.exports={Dialog,DialogClose,DialogContent,DialogDescription,DialogFooter,DialogHeader,DialogOverlay,DialogPortal,DialogTitle,DialogTrigger});
package/dist/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";import{a as e,b as o,c as r,d as t,e as c,f,g as i,h as l,i as m,j as n}from"./chunk-NJ4HWVJQ.mjs";import"./chunk-3EYN2AKU.mjs";export{e as Dialog,t as DialogClose,f as DialogContent,n as DialogDescription,l as DialogFooter,i as DialogHeader,c as DialogOverlay,r as DialogPortal,m as DialogTitle,o as DialogTrigger};
@@ -0,0 +1,2 @@
1
+ import '@testing-library/jest-dom';
2
+ export {};