@accounter/client
Version:
Accounter client application
7 lines (4 loc) • 4.82 kB
JavaScript
import{Cu as e,Gl as t,Id as n,Kl as r,Su as i,au as a,bu as o,cu as s,iu as c,jd as ee,lu as l,nu as u,ou as te,ru as ne,su as d,tu as f,uu as p,vu as re,wu as m}from"./index-CSYTUOOk.js";var h=n(ee(),1),g=e(),_=`AlertDialog`,[ie,ae]=o(_,[p]),v=p(),y=e=>{let{__scopeAlertDialog:t,...n}=e,r=v(t);return(0,g.jsx)(te,{...r,...n,modal:!0})};y.displayName=_;var oe=`AlertDialogTrigger`,b=h.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=v(n);return(0,g.jsx)(s,{...i,...r,ref:t})});b.displayName=oe;var se=`AlertDialogPortal`,x=e=>{let{__scopeAlertDialog:t,...n}=e,r=v(t);return(0,g.jsx)(a,{...r,...n})};x.displayName=se;var ce=`AlertDialogOverlay`,S=h.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=v(n);return(0,g.jsx)(c,{...i,...r,ref:t})});S.displayName=ce;var C=`AlertDialogContent`,[w,T]=ie(C),E=i(`AlertDialogContent`),D=h.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=v(n),o=h.useRef(null),s=m(t,o),c=h.useRef(null);return(0,g.jsx)(l,{contentName:C,titleName:O,docsSlug:`alert-dialog`,children:(0,g.jsx)(w,{scope:n,cancelRef:c,children:(0,g.jsxs)(u,{role:`alertdialog`,...a,...i,ref:s,onOpenAutoFocus:re(i.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,g.jsx)(E,{children:r}),(0,g.jsx)(F,{contentRef:o})]})})})});D.displayName=C;var O=`AlertDialogTitle`,k=h.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=v(n);return(0,g.jsx)(d,{...i,...r,ref:t})});k.displayName=O;var A=`AlertDialogDescription`,j=h.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=v(n);return(0,g.jsx)(ne,{...i,...r,ref:t})});j.displayName=A;var le=`AlertDialogAction`,M=h.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=v(n);return(0,g.jsx)(f,{...i,...r,ref:t})});M.displayName=le;var N=`AlertDialogCancel`,P=h.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=T(N,n),a=v(n),o=m(t,i);return(0,g.jsx)(f,{...a,...r,ref:o})});P.displayName=N;var F=({contentRef:e})=>{let t=`\`${C}\` requires a description for the component to be accessible for screen reader users.
You can add a description to the \`${C}\` by passing a \`${A}\` 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 \`${C}\`. 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=b,R=x,z=S,B=D,V=M,H=P,U=k,W=j,G=I,ue=L,de=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)(de,{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,...n},i)=>(0,g.jsx)(V,{ref:i,className:r(t(),e),...n}));Q.displayName=V.displayName;var $=h.forwardRef(({className:e,...n},i)=>(0,g.jsx)(H,{ref:i,className:r(t({variant:`outline`}),`mt-2 sm:mt-0`,e),...n}));$.displayName=H.displayName;export{Z as a,X as c,q as i,ue as l,Q as n,Y as o,$ as r,J as s,G as t};