UNPKG

ivt

Version:

Ivt Components Library

3 lines (2 loc) 5.58 kB
import*as e from"react";import{c as t}from"../chunks/index-BXKQJZ6z.mjs";import{u as a,c as r}from"../chunks/index-BgU_7G37.mjs";import{c as o,R as n,P as s,O as l,b as i,W as c,a as d,T as m,D as u,C as p}from"../chunks/index-CD0qf5ak.mjs";import{createSlottable as f}from"@radix-ui/react-slot";import{jsx as g,jsxs as h}from"react/jsx-runtime";import{c as x}from"../chunks/utils-B4HRExF_.mjs";import{b as v}from"../chunks/button-BiUJlCbP.mjs";import"../chunks/index-C99OdH8-.mjs";import"../chunks/index-BclYsZHn.mjs";import"../chunks/index-CJw5YZXp.mjs";import"../chunks/index-DX37fts-.mjs";import"../chunks/index-Bj6b6xW8.mjs";import"react-dom";import"../chunks/index-DwSoQWco.mjs";import"../chunks/index-CDzNhFWE.mjs";import"../chunks/tslib.es6-B8aZ0Vi5.mjs";import"../chunks/bundle-mjs-DdsKEIOo.mjs";import"class-variance-authority";var N="AlertDialog",[y,D]=t(N,[o]),A=o(),b=e=>{const{__scopeAlertDialog:t,...a}=e,r=A(t);return g(n,{...r,...a,modal:!0})};b.displayName=N;var j=e.forwardRef(((e,t)=>{const{__scopeAlertDialog:a,...r}=e,o=A(a);return g(i,{...o,...r,ref:t})}));j.displayName="AlertDialogTrigger";var _=e=>{const{__scopeAlertDialog:t,...a}=e,r=A(t);return g(s,{...r,...a})};_.displayName="AlertDialogPortal";var k=e.forwardRef(((e,t)=>{const{__scopeAlertDialog:a,...r}=e,o=A(a);return g(l,{...o,...r,ref:t})}));k.displayName="AlertDialogOverlay";var w="AlertDialogContent",[E,R]=y(w),O=f("AlertDialogContent"),z=e.forwardRef(((t,o)=>{const{__scopeAlertDialog:n,children:s,...l}=t,i=A(n),m=e.useRef(null),u=a(o,m),p=e.useRef(null);return g(c,{contentName:w,titleName:C,docsSlug:"alert-dialog",children:g(E,{scope:n,cancelRef:p,children:h(d,{role:"alertdialog",...i,...l,ref:u,onOpenAutoFocus:r(l.onOpenAutoFocus,(e=>{e.preventDefault(),p.current?.focus({preventScroll:!0})})),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[g(O,{children:s}),g(q,{contentRef:m})]})})})}));z.displayName=w;var C="AlertDialogTitle",$=e.forwardRef(((e,t)=>{const{__scopeAlertDialog:a,...r}=e,o=A(a);return g(m,{...o,...r,ref:t})}));$.displayName=C;var F="AlertDialogDescription",I=e.forwardRef(((e,t)=>{const{__scopeAlertDialog:a,...r}=e,o=A(a);return g(u,{...o,...r,ref:t})}));I.displayName=F;var P=e.forwardRef(((e,t)=>{const{__scopeAlertDialog:a,...r}=e,o=A(a);return g(p,{...o,...r,ref:t})}));P.displayName="AlertDialogAction";var T="AlertDialogCancel",S=e.forwardRef(((e,t)=>{const{__scopeAlertDialog:r,...o}=e,{cancelRef:n}=R(T,r),s=A(r),l=a(t,n);return g(p,{...s,...o,ref:l})}));S.displayName=T;var q=({contentRef:t})=>{const a=`\`${w}\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \`${w}\` by passing a \`${F}\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${w}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return e.useEffect((()=>{document.getElementById(t.current?.getAttribute("aria-describedby"))}),[a,t]),null},B=b,W=j,Y=_,G=k,H=z,J=P,K=S,L=$,M=I;function Q({...t}){return e.createElement(B,{"data-slot":"alert-dialog",...t})}function U({...t}){return e.createElement(W,{"data-slot":"alert-dialog-trigger",...t})}function V({...t}){return e.createElement(Y,{"data-slot":"alert-dialog-portal",...t})}function X({className:t,...a}){return e.createElement(G,{"data-slot":"alert-dialog-overlay",className:x("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",t),...a})}function Z({className:t,...a}){return e.createElement(V,null,e.createElement(X,null),e.createElement(H,{"data-slot":"alert-dialog-content",className:x("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",t),...a}))}function ee({className:t,...a}){return e.createElement("div",{"data-slot":"alert-dialog-header",className:x("flex flex-col gap-2 text-center sm:text-left",t),...a})}function te({className:t,...a}){return e.createElement("div",{"data-slot":"alert-dialog-footer",className:x("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function ae({className:t,...a}){return e.createElement(L,{"data-slot":"alert-dialog-title",className:x("text-lg font-semibold",t),...a})}function re({className:t,...a}){return e.createElement(M,{"data-slot":"alert-dialog-description",className:x("text-muted-foreground text-sm",t),...a})}function oe({className:t,...a}){return e.createElement(J,{className:x(v(),t),...a})}function ne({className:t,...a}){return e.createElement(K,{className:x(v({variant:"outline"}),t),...a})}export{Q as AlertDialog,oe as AlertDialogAction,ne as AlertDialogCancel,Z as AlertDialogContent,re as AlertDialogDescription,te as AlertDialogFooter,ee as AlertDialogHeader,X as AlertDialogOverlay,V as AlertDialogPortal,ae as AlertDialogTitle,U as AlertDialogTrigger}; //# sourceMappingURL=index.mjs.map