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