'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react"),r=require("tailwind-merge"),a=require("../../../lib/shape.cjs"),l=require("../../../lib/theme.cjs"),s=require("../../../lib/utils.cjs");require("../../../contexts/BaseColorContext.cjs"),require("../../../contexts/HoveredValueContext.cjs");var o=require("../../../contexts/RootStylesContext.cjs");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../../../contexts/SelectedValueContext.cjs");var n=d(t);const i=s.makeClassName("Accordion"),c=t.createContext({isExpanded:!1,setIsExpanded:void 0}),u=n.default.forwardRef(((d,u)=>{var x;const{expanded:m=!1,children:C,className:f}=d,p=e.__rest(d,["expanded","children","className"]),[v,b]=t.useState(m),g=null!==(x=t.useContext(o))&&void 0!==x?x:r.twMerge(a.border.sm.all,a.borderRadius.lg.all);return n.default.createElement("div",Object.assign({ref:u,className:r.twMerge(i("root"),"overflow-hidden",s.getColorClassNames(l.DEFAULT_COLOR,l.colorPalette.lightRing).borderColor,s.getColorClassNames("white").bgColor,g,f)},p),n.default.Children.map(C,((e,t)=>0===t?n.default.createElement(c.Provider,{value:{isExpanded:v,setIsExpanded:b}},n.default.cloneElement(e)):n.default.createElement("div",{className:v?"":"hidden"},e))))}));u.displayName="Accordion",exports.ExpandedContext=c,exports.default=u;
