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