'use client';
"use strict";var e=require("tslib"),l=require("react"),t=require("tailwind-merge"),r=require("../../../contexts/BaseColorContext.cjs");require("../../../contexts/HoveredValueContext.cjs"),require("../../../contexts/RootStylesContext.cjs");var a=require("../../../contexts/SelectedValueContext.cjs"),s=require("../../../hooks/useInternalState.cjs"),o=require("../../../lib/constants.cjs"),u=require("../../../lib/shape.cjs"),n=require("../../../lib/spacing.cjs"),i=require("../../../lib/theme.cjs"),c=require("../../../lib/utils.cjs");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=d(l);const g=c.makeClassName("Toggle"),m=f.default.forwardRef(((l,d)=>{const{defaultValue:m,value:C,onValueChange:j,color:q=o.BaseColors.Blue,children:h,className:v}=l,x=e.__rest(l,["defaultValue","value","onValueChange","color","children","className"]),[b,p]=s(m,C);return f.default.createElement("div",Object.assign({ref:d,className:t.twMerge(g("root"),"flex-nowrap inline-flex justify-start",c.getColorClassNames(i.DEFAULT_COLOR,i.colorPalette.lightBackground).bgColor,n.spacing.twoXs.paddingAll,u.borderRadius.lg.all,v)},x),f.default.createElement(a.Provider,{value:{selectedValue:b,handleValueChange:e=>{null==j||j(e),p(e)}}},f.default.createElement(r.Provider,{value:q},f.default.Children.map(h,(e=>f.default.cloneElement(e))))))}));m.displayName="Toggle",module.exports=m;
