import{b as u,ay as i,az as d,c as o,aA as B,b4 as m,ax as h,aB as p,aC as f}from"./index.BdH_oWMm.js";import{m as g}from"./iconPosition.BmsruyBM.js";function b(l){const{disabled:e,element:t,widgetMgr:n,fragmentId:s}=l,r=t.shortcut?t.shortcut:void 0;let a=i.SECONDARY;t.type==="primary"?a=i.PRIMARY:t.type==="tertiary"&&(a=i.TERTIARY);const c=u.useCallback(()=>{e||n.setTriggerValue(t,{fromUi:!0},s)},[e,n,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:a,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 R=u.memo(b);export{R as default};
