import{jsx as e,jsxs as l}from"react/jsx-runtime";import y from"../icons/ico-caret-right.js";import z from"../icons/ico-dismiss.js";import{cn as R}from"../../lib/cn.js";import{callout as S}from"../../recipes/callout.js";import{forwardRef as k,useState as p,useRef as A}from"react";import{useButton as B}from"react-aria";import{StatusIcon as D}from"./status-icon.js";const i={sm:"1rem",md:"1.25rem",lg:"1.5rem"},u=k((h,b)=>{const{label:N,description:r,size:a="md",variant:o="branded",icon:n=!1,dismissible:m=!1,onPress:t}=h,[x,w]=p(!0),[g,v]=p(!1),c=r?i.sm:i[a],s=S({size:a,variant:o,icon:n,description:!!r,isDismissed:g,dismissible:m,interactive:!!t}),j=()=>{v(!0)},C=A(null),d=b||C,{buttonProps:P}=B({onPress:t},d),f=()=>l("div",{className:R(t?"":s.container,"flex flex-row items-center gap-2"),onAnimationEnd:()=>w(!1),ref:d,children:[l("div",{className:"flex flex-col items-start gap-1.5",children:[l("div",{className:"flex flex-row items-center justify-between w-full gap-2.5",children:[l("div",{className:"flex flex-row items-center gap-2.5",children:[n&&e(D,{variant:o,className:s.icon,width:c,height:c}),e("p",{className:s.label,children:N})]}),m&&e("button",{className:s.button,onClick:j,"aria-label":"dismiss callout",children:e(z,{className:s.button,width:i.sm,height:i.sm})})]}),!!r&&e("p",{className:s.description,children:r})]}),!!t&&e(y,{className:s.button,width:i.sm,height:i.sm})]});return x?t?e("button",{...P,className:s.container,children:e(f,{})}):e(f,{}):null});u.displayName="Callout";export{u as Callout};
//# sourceMappingURL=callout.js.map
