"use client";import"./chunk-CMC7VUXZ.mjs";import{a as i}from"./chunk-EI3IJHIE.mjs";import"./chunk-MSXDLSXH.mjs";import{c as e}from"./chunk-S7CSCIW4.mjs";import"./chunk-JZXLCA2E.mjs";import{useCallback as L,useState as S}from"react";import{UniformSlot as V}from"@uniformdev/canvas-next-rsc/component";import{jsx as s}from"react/jsx-runtime";var h=({className:t,...o})=>s("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",className:e("size-5",t),...o,children:s("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})}),y=({onClose:t,iconColor:o})=>s("button",{onClick:t,className:e("absolute right-5 top-1/2 -translate-y-1/2",{[`text-${o}`]:o}),children:s(h,{})}),C=y;var f=({variant:t,floating:o})=>e({"!w-11/12 left-1/2 -translate-x-1/2 my-4":o&&!!t,"fixed top-0 w-full z-10":t==="top","fixed bottom-0 w-full z-10":t==="bottom","p-4":o&&!t}),u=({contentAlignment:t,iconColor:o,fluidContent:r,floating:n})=>e("flex flex-row gap-x-4",{"justify-start":t==="left","justify-center":t==="center","justify-end":t==="right","pr-10":t==="right"&&o,"!mx-0":!r,"rounded-lg":n});import{jsx as p,jsxs as k}from"react/jsx-runtime";var X=({component:t,context:o,backgroundColor:r,spacing:n,border:c,fluidContent:a,slots:P,iconColor:l,contentAlignment:x="center",floating:m=!1})=>{let[d,B]=S(!0),g=L(()=>{B(!1)},[]);if(!d)return null;let w=f({variant:t.variant,floating:m}),b=u({contentAlignment:x,iconColor:l,fluidContent:a,floating:m});return p(i,{className:w,fluidContent:a,border:c,children:k(i,{className:e("relative w-full",b),backgroundColor:r,spacing:n,fluidContent:a,children:[p(V,{data:t,context:o,slot:P.bannerContent}),l&&p(C,{onClose:g,iconColor:l})]})})};export{X as Banner};
