2 lines
3.2 KiB
JavaScript
2 lines
3.2 KiB
JavaScript
import{t as b,b as j,P as y,r as o,j as e,d,e as N,T as n,D as c,C as u,f as T,V as l,A as p,O as R}from"./.pnpm-CAIuqsZ0.js";import{u as V}from"./use-toast-DO4tfD4I.js";function r(...t){return b(j(t))}const C=y,f=o.forwardRef(({className:t,...a},s)=>e.jsx(l,{ref:s,className:r("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...a}));f.displayName=l.displayName;const k=N("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),m=o.forwardRef(({className:t,variant:a,...s},i)=>e.jsx(d,{ref:i,className:r(k({variant:a}),t),...s}));m.displayName=d.displayName;const A=o.forwardRef(({className:t,...a},s)=>e.jsx(p,{ref:s,className:r("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...a}));A.displayName=p.displayName;const x=o.forwardRef(({className:t,...a},s)=>e.jsx(u,{ref:s,className:r("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...a,children:e.jsx(T,{className:"h-4 w-4"})}));x.displayName=u.displayName;const v=o.forwardRef(({className:t,...a},s)=>e.jsx(n,{ref:s,className:r("text-sm font-semibold [&+div]:text-xs",t),...a}));v.displayName=n.displayName;const g=o.forwardRef(({className:t,...a},s)=>e.jsx(c,{ref:s,className:r("text-sm opacity-90",t),...a}));g.displayName=c.displayName;function D(){const{toasts:t}=V();return e.jsxs(C,{children:[t.map(function({id:a,title:s,description:i,action:h,...w}){return e.jsxs(m,{...w,children:[e.jsxs("div",{className:"grid gap-1",children:[s&&e.jsx(v,{children:s}),i&&e.jsx(g,{children:i})]}),h,e.jsx(x,{})]},a)}),e.jsx(f,{})]})}function L(){return e.jsx(e.Fragment,{children:e.jsxs("div",{className:r("h-screen bg-background font-sans antialiased"),children:[e.jsx(R,{}),e.jsx(D,{})]})})}export{L as default};
|