@accounter/client
Version:
Accounter client application
7 lines (4 loc) • 4.9 kB
JavaScript
import{s as e}from"./dist-BBBZL-zT.js";import{i as t,o as n,t as r}from"./utils-C9b7NsUD.js";import{B as i,F as a,I as o,L as s,M as c,N as l,P as u,R as ee,V as d,it as te,ot as ne,z as re}from"./select-D5MmcncR.js";import{a as f,n as p,s as m}from"./button-DATCl8sW.js";var h=e(n(),1),g=t(),_=`AlertDialog`,[ie,ae]=ne(_,[d]),v=d(),y=e=>{let{__scopeAlertDialog:t,...n}=e,r=v(t);return(0,g.jsx)(s,{...r,...n,modal:!0})};y.displayName=_;var b=`AlertDialogTrigger`,x=h.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=v(n);return(0,g.jsx)(re,{...i,...r,ref:t})});x.displayName=b;var oe=`AlertDialogPortal`,S=e=>{let{__scopeAlertDialog:t,...n}=e,r=v(t);return(0,g.jsx)(o,{...r,...n})};S.displayName=oe;var se=`AlertDialogOverlay`,C=h.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=v(n);return(0,g.jsx)(a,{...i,...r,ref:t})});C.displayName=se;var w=`AlertDialogContent`,[T,E]=ie(w),D=f(`AlertDialogContent`),O=h.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...a}=e,o=v(n),s=h.useRef(null),c=m(t,s),u=h.useRef(null);return(0,g.jsx)(i,{contentName:w,titleName:k,docsSlug:`alert-dialog`,children:(0,g.jsx)(T,{scope:n,cancelRef:u,children:(0,g.jsxs)(l,{role:`alertdialog`,...o,...a,ref:c,onOpenAutoFocus:te(a.onOpenAutoFocus,e=>{e.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,g.jsx)(D,{children:r}),(0,g.jsx)(le,{contentRef:s})]})})})});O.displayName=w;var k=`AlertDialogTitle`,A=h.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=v(n);return(0,g.jsx)(ee,{...i,...r,ref:t})});A.displayName=k;var j=`AlertDialogDescription`,M=h.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=v(n);return(0,g.jsx)(u,{...i,...r,ref:t})});M.displayName=j;var ce=`AlertDialogAction`,N=h.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=v(n);return(0,g.jsx)(c,{...i,...r,ref:t})});N.displayName=ce;var P=`AlertDialogCancel`,F=h.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=E(P,n),a=v(n),o=m(t,i);return(0,g.jsx)(c,{...a,...r,ref:o})});F.displayName=P;var le=({contentRef:e})=>{let t=`\`${w}\` requires a description for the component to be accessible for screen reader users.
You can add a description to the \`${w}\` by passing a \`${j}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
Alternatively, 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.
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return h.useEffect(()=>{document.getElementById(e.current?.getAttribute(`aria-describedby`))||console.warn(t)},[t,e]),null},I=y,L=x,R=S,z=C,B=O,V=N,H=F,U=A,W=M,ue=I,de=L,G=R,K=h.forwardRef(({className:e,...t},n)=>(0,g.jsx)(z,{className:r(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t,ref:n}));K.displayName=z.displayName;var q=h.forwardRef(({className:e,...t},n)=>(0,g.jsxs)(G,{children:[(0,g.jsx)(K,{}),(0,g.jsx)(B,{ref:n,className:r(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-gray-200 bg-white 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 dark:border-gray-800 dark:bg-gray-950`,e),...t})]}));q.displayName=B.displayName;var J=({className:e,...t})=>(0,g.jsx)(`div`,{className:r(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});J.displayName=`AlertDialogHeader`;var Y=({className:e,...t})=>(0,g.jsx)(`div`,{className:r(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});Y.displayName=`AlertDialogFooter`;var X=h.forwardRef(({className:e,...t},n)=>(0,g.jsx)(U,{ref:n,className:r(`text-lg font-semibold`,e),...t}));X.displayName=U.displayName;var Z=h.forwardRef(({className:e,...t},n)=>(0,g.jsx)(W,{ref:n,className:r(`text-sm text-gray-500 dark:text-gray-400`,e),...t}));Z.displayName=W.displayName;var Q=h.forwardRef(({className:e,...t},n)=>(0,g.jsx)(V,{ref:n,className:r(p(),e),...t}));Q.displayName=V.displayName;var $=h.forwardRef(({className:e,...t},n)=>(0,g.jsx)(H,{ref:n,className:r(p({variant:`outline`}),`mt-2 sm:mt-0`,e),...t}));$.displayName=H.displayName;export{Z as a,X as c,q as i,de as l,Q as n,Y as o,$ as r,J as s,ue as t};