@accounter/client
Version:
Accounter client application
7 lines (4 loc) • 4.82 kB
JavaScript
import{Eu as e,Jl as t,Nd as n,Rd as r,Su as i,Tu as a,au as o,bu as s,cu as c,du as ee,fu as l,iu as te,lu as u,ou as d,ql as f,ru as p,su as m,uu as ne,wu as re}from"./index-BdWApCqi.js";var h=r(n(),1),g=a(),_=`AlertDialog`,[v,ie]=i(_,[l]),y=l(),b=e=>{let{__scopeAlertDialog:t,...n}=e,r=y(t);return(0,g.jsx)(c,{...r,...n,modal:!0})};b.displayName=_;var ae=`AlertDialogTrigger`,x=h.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=y(n);return(0,g.jsx)(ne,{...i,...r,ref:t})});x.displayName=ae;var oe=`AlertDialogPortal`,S=e=>{let{__scopeAlertDialog:t,...n}=e,r=y(t);return(0,g.jsx)(m,{...r,...n})};S.displayName=oe;var se=`AlertDialogOverlay`,C=h.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=y(n);return(0,g.jsx)(d,{...i,...r,ref:t})});C.displayName=se;var w=`AlertDialogContent`,[T,E]=v(w),D=re(`AlertDialogContent`),O=h.forwardRef((t,n)=>{let{__scopeAlertDialog:r,children:i,...a}=t,o=y(r),c=h.useRef(null),l=e(n,c),u=h.useRef(null);return(0,g.jsx)(ee,{contentName:w,titleName:k,docsSlug:`alert-dialog`,children:(0,g.jsx)(T,{scope:r,cancelRef:u,children:(0,g.jsxs)(te,{role:`alertdialog`,...o,...a,ref:l,onOpenAutoFocus:s(a.onOpenAutoFocus,e=>{e.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,g.jsx)(D,{children:i}),(0,g.jsx)(I,{contentRef:c})]})})})});O.displayName=w;var k=`AlertDialogTitle`,A=h.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=y(n);return(0,g.jsx)(u,{...i,...r,ref:t})});A.displayName=k;var j=`AlertDialogDescription`,M=h.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=y(n);return(0,g.jsx)(o,{...i,...r,ref:t})});M.displayName=j;var ce=`AlertDialogAction`,N=h.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=y(n);return(0,g.jsx)(p,{...i,...r,ref:t})});N.displayName=ce;var P=`AlertDialogCancel`,F=h.forwardRef((t,n)=>{let{__scopeAlertDialog:r,...i}=t,{cancelRef:a}=E(P,r),o=y(r),s=e(n,a);return(0,g.jsx)(p,{...o,...i,ref:s})});F.displayName=P;var I=({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},L=b,R=x,z=S,B=C,V=O,H=N,U=F,W=A,G=M,le=L,ue=R,de=z,K=h.forwardRef(({className:e,...n},r)=>(0,g.jsx)(B,{className:t(`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),...n,ref:r}));K.displayName=B.displayName;var q=h.forwardRef(({className:e,...n},r)=>(0,g.jsxs)(de,{children:[(0,g.jsx)(K,{}),(0,g.jsx)(V,{ref:r,className:t(`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),...n})]}));q.displayName=V.displayName;var J=({className:e,...n})=>(0,g.jsx)(`div`,{className:t(`flex flex-col space-y-2 text-center sm:text-left`,e),...n});J.displayName=`AlertDialogHeader`;var Y=({className:e,...n})=>(0,g.jsx)(`div`,{className:t(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...n});Y.displayName=`AlertDialogFooter`;var X=h.forwardRef(({className:e,...n},r)=>(0,g.jsx)(W,{ref:r,className:t(`text-lg font-semibold`,e),...n}));X.displayName=W.displayName;var Z=h.forwardRef(({className:e,...n},r)=>(0,g.jsx)(G,{ref:r,className:t(`text-sm text-gray-500 dark:text-gray-400`,e),...n}));Z.displayName=G.displayName;var Q=h.forwardRef(({className:e,...n},r)=>(0,g.jsx)(H,{ref:r,className:t(f(),e),...n}));Q.displayName=H.displayName;var $=h.forwardRef(({className:e,...n},r)=>(0,g.jsx)(U,{ref:r,className:t(f({variant:`outline`}),`mt-2 sm:mt-0`,e),...n}));$.displayName=U.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,le as t};