@atlas-kitchen/adyen-web
Version:
3 lines (2 loc) • 816 B
JavaScript
import{createElement as e}from"../../../external/preact/dist/preact.js";import t from"../../../_virtual/index.js";function a({classNameModifiers:a=[],selectedValue:n,disabled:o=!1,options:c,onChange:s}){return c&&0!==c.length?e("div",{className:t("adyen-checkout__segmented-control",{"adyen-checkout__segmented-control--disabled":o},...a.map((e=>`adyen-checkout__segmented-control--${e}`))),role:"group"},c.map((({label:a,value:c,controls:l,htmlProps:d})=>e("button",{disabled:o,key:c,onClick:e=>s(c,e),className:t("adyen-checkout__segmented-control-segment",{"adyen-checkout__segmented-control-segment--selected":n===c}),"aria-controls":l,"aria-expanded":n===c,type:"button",...d},n===c&&e("span",{className:"adyen-checkout-checkmark"}),a)))):null}export{a as default};
//# sourceMappingURL=SegmentedControl.js.map