PageSourceSearch

https://portcity-ai.com/assets/alert-dialog-CRQDWUvC.js

js portcity-ai.com collected 2026-10-06 02:47:18 UTC 5,180 bytes, 7 lines download raw bytes

1import{r as s,j as o}from"./index-Ddgspcr2.js";import{c as m,R as q,P as B,W as J,d as K,C as Q,e as U,b as X,D as Z,a as A,O as ee,T as ae}from"./index-D8Z5Tn5z.js";import{u as D,S as te,c as n,b as x}from"./index-DRT6_wRf.js";function Ne(e,[a,t]){return Math.min(t,Math.max(a,e))}var oe=s.createContext(void 0);function ye(e){const a=s.useContext(oe);return e||a||"ltr"}var v="AlertDialog",[re,je]=K(v,[m]),i=m(),N=e=>{const{__scopeAlertDialog:a,...t}=e,r=i(a);return o.jsx(q,{...r,...t,modal:!0})};N.displayName=v;var se="AlertDialogTrigger",le=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...r}=e,l=i(t);return o.jsx(ae,{...l,...r,ref:a})});le.displayName=se;var ie="AlertDialogPortal",y=e=>{const{__scopeAlertDialog:a,...t}=e,r=i(a);return o.jsx(B,{...r,...t})};y.displayName=ie;var ne="AlertDialogOverlay",j=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...r}=e,l=i(t);return o.jsx(ee,{...l,...r,ref:a})});j.displayName=ne;var c="AlertDialogContent",[ce,de]=re(c),h=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,children:r,...l}=e,g=i(t),p=s.useRef(null),Y=D(a,p),u=s.useRef(null);return o.jsx(J,{contentName:c,titleName:R,docsSlug:"alert-dialog",children:o.jsx(ce,{scope:t,cancelRef:u,children:o.jsxs(Q,{role:"alertdialog",...g,...l,ref:Y,onOpenAutoFocus:U(l.onOpenAutoFocus,d=>{var f;d.preventDefault(),(f=u.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[o.jsx(te,{children:r}),o.jsx(ge,{contentRef:p})]})})})});h.displayName=c;var R="AlertDialogTitle",C=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...r}=e,l=i(t);return o.jsx(X,{...l,...r,ref:a})});C.displayName=R;var _="AlertDialogDescription",b=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...r}=e,l=i(t);return o.jsx(Z,{...l,...r,ref:a})});b.displayName=_;var pe="AlertDialogAction",w=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...r}=e,l=i(t);return o.jsx(A,{...l,...r,ref:a})});w.displayName=pe;var E="AlertDialogCancel",P=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...r}=e,{cancelRef:l}=de(E,t),g=i(t),p=D(a,l);return o.jsx(A,{...g,...r,ref:p})});P.displayName=E;var ge=({contentRef:e})=>{const a=`\`${c}\` requires a description for the component to be accessible for screen reader users.
2
3You can add a description to the \`${c}\` by passing a \`${_}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
4
5Alternatively, 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.
6
7For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return s.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(a)},[a,e]),null},ue=N,fe=y,S=j,T=h,O=w,M=P,$=C,I=b;const me=ue,Ae=fe,F=s.forwardRef(({className:e,...a},t)=>o.jsx(S,{className:n("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),...a,ref:t}));F.displayName=S.displayName;const k=s.forwardRef(({className:e,...a},t)=>o.jsxs(Ae,{children:[o.jsx(F,{}),o.jsx(T,{ref:t,className:n("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background 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",e),...a})]}));k.displayName=T.displayName;const z=({className:e,...a})=>o.jsx("div",{className:n("flex flex-col space-y-2 text-center sm:text-left",e),...a});z.displayName="AlertDialogHeader";const L=({className:e,...a})=>o.jsx("div",{className:n("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...a});L.displayName="AlertDialogFooter";const G=s.forwardRef(({className:e,...a},t)=>o.jsx($,{ref:t,className:n("text-lg font-semibold",e),...a}));G.displayName=$.displayName;const H=s.forwardRef(({className:e,...a},t)=>o.jsx(I,{ref:t,className:n("text-sm text-muted-foreground",e),...a}));H.displayName=I.displayName;const W=s.forwardRef(({className:e,...a},t)=>o.jsx(O,{ref:t,className:n(x(),e),...a}));W.displayName=O.displayName;const V=s.forwardRef(({className:e,...a},t)=>o.jsx(M,{ref:t,className:n(x({variant:"outline"}),"mt-2 sm:mt-0",e),...a}));V.displayName=M.displayName;const he=({text:e,header:a,confirmText:t,showCancel:r,onClose:l})=>o.jsx(me,{open:!0,children:o.jsxs(k,{children:[o.jsxs(z,{children:[o.jsx(G,{children:a}),o.jsx(H,{children:e})]}),o.jsxs(L,{children:[r&&o.jsx(V,{onClick:()=>{l(!1)},children:"Cancel"}),o.jsx(W,{onClick:()=>{l(!0)},children:t||"Continue"})]})]})});export{he as A,Ne as c,ye as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.