import e,{useState as t,useCallback as l}from"react";import a from"../../node_modules/classnames/index.js";import r from"./FancyToggle.module.scss.js";import o from"../Card/Card.js";import i from"../Stack/Stack.js";import n from"../Text/Text.js";import{Hoverable as s}from"../Hoverable/Hoverable.js";const m=({defaultSelected:m,nowrap:c,onChange:d,options:p,textCentered:f,textSize:b=1,tight:g,value:v,vertical:u})=>{const[y,E]=t(m),h=v??y,j=l(((e,t)=>{e.preventDefault(),t!==h&&(E(t),d(t))}),[d,h,E]);return e.createElement("div",null,e.createElement("div",{className:a(r.wrapper,u?r.vertical:r.horizontal)},p.map((t=>e.createElement(s,{key:t.key,hoverText:t.tooltip},e.createElement(o,{"aria-label":t["aria-label"]??("string"==typeof t.label?t.label:""),disabled:t.disabled,fill:!1,fullHeight:!0,onClick:!0===t.disabled?void 0:e=>j(e,t.key),selected:t.key===h,tight:g},e.createElement(i,{spacing:1},e.createElement(i,{alignItems:"center",justifyContent:f?"center":void 0,row:!0},"string"==typeof t.label?e.createElement(n,{bold:!0,nowrap:c,size:b},t.label):t.label),t.description&&e.createElement(n,{light:!0},t.description))))))))};export{m as default};
//# sourceMappingURL=FancyToggle.js.map
