import{o as e}from"./chunk.DuxOD-Sk.js";import{r as t}from"./emotion-is-prop-valid.esm.DV_OErv-.js";import{c as n}from"./emotion-styled.browser.esm.BPUx6WuE.js";import{Lt as r,Rt as i,_t as a,ft as o,ht as s,vt as c,zt as l}from"./src.sR_9Xh2m.js";import{t as u}from"./iconPosition.CAyE8Pjc.js";var d=e(t());function f(e){let{disabled:t,element:f,widgetMgr:p,fragmentId:m}=e,h=f.shortcut?f.shortcut:void 0,g=i.SECONDARY;f.type===`primary`?g=i.PRIMARY:f.type===`tertiary`&&(g=i.TERTIARY);let _=(0,d.useCallback)(()=>{t||p.setTriggerValue(f,{fromUi:!0},m)},[t,p,f,m]);return s({shortcut:h,disabled:t,onActivate:_}),n(c,{className:`stButton`,"data-testid":`stButton`,children:n(a,{help:f.help,containerWidth:!0,children:n(r,{kind:g,size:l.SMALL,disabled:t,containerWidth:!0,onClick:_,children:n(o,{icon:f.icon,iconPosition:u(f.iconPosition),label:f.label,shortcut:h})})})})}var p=(0,d.memo)(f);export{p as default};