import{Ja as e,Qa as t,an as n,er as r,in as i,io as a,nr as o,on as s,rn as c,tr as l}from"./index.dkY5s53S.js";import{t as u}from"./iconPosition.CY47f4C7.js";var d=a(t(),1);function f(t){let{disabled:a,element:f,widgetMgr:p,fragmentId:m}=t,h=f.shortcut?f.shortcut:void 0,g=l.SECONDARY;f.type===`primary`?g=l.PRIMARY:f.type===`tertiary`&&(g=l.TERTIARY);let _=(0,d.useCallback)(()=>{a||p.setTriggerValue(f,{fromUi:!0},m)},[a,p,f,m]);return i({shortcut:h,disabled:a,onActivate:_}),e(s,{className:`stButton`,"data-testid":`stButton`,children:e(n,{help:f.help,containerWidth:!0,children:e(r,{kind:g,size:o.SMALL,disabled:a,containerWidth:!0,onClick:_,children:e(c,{icon:f.icon,iconPosition:u(f.iconPosition),label:f.label,shortcut:h})})})})}var p=(0,d.memo)(f);export{p as default};