import{r as u,B as n,u as d,j as o,a as B,b as m,c as h,D as p,d as f}from"./index.RuhrnD1v.js";import{m as g}from"./iconPosition.BnTrQB0J.js";function b(l){const{disabled:e,element:t,widgetMgr:a,fragmentId:s}=l,r=t.shortcut?t.shortcut:void 0;let i=n.SECONDARY;t.type==="primary"?i=n.PRIMARY:t.type==="tertiary"&&(i=n.TERTIARY);const c=u.useCallback(()=>{e||a.setTriggerValue(t,{fromUi:!0},s)},[e,a,t,s]);return d({shortcut:r,disabled:e,onActivate:c}),o(f,{className:"stButton","data-testid":"stButton",children:o(B,{help:t.help,containerWidth:!0,children:o(m,{kind:i,size:h.SMALL,disabled:e,containerWidth:!0,onClick:c,children:o(p,{icon:t.icon,iconPosition:g(t.iconPosition),label:t.label,shortcut:r})})})})}const A=u.memo(b);export{A as default};
