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