import{r as m,j as e}from"./iframe-p4aYZyoq.js";import{c as h}from"./index-Dx18ixSn.js";import{B as f}from"./bubble-DIKFBco8.js";import{S as g,a as x}from"./chevron-up-Cc03wLY6.js";const o=16,j=({accordionTitle:a,count:n=0,children:r,alwaysOpen:t,initialOpen:c=!1,className:s,...l})=>{const[i,d]=m.useState(c),p=()=>{d(u=>!u)};return e.jsxs("div",{className:h(s,"accordion"),...l,children:[e.jsxs("button",{type:"button",className:"accordion__title",onClick:p,children:[e.jsx("span",{children:a}),n>0&&e.jsx(f,{size:"small",children:n}),!t&&(i?e.jsx(g,{width:o,height:o}):e.jsx(x,{width:o,height:o}))]}),(i||t)&&e.jsx("div",{className:"accordion__content",children:r})]})};try{accordion.displayName="accordion",accordion.__docgenInfo={description:"",displayName:"accordion",props:{accordionTitle:{defaultValue:null,description:"The title, works as a trigger to open/close",name:"accordionTitle",required:!0,type:{name:"ReactNode"}},count:{defaultValue:{value:"0"},description:`Number displayed at the right of the accordion. This could, for example, be used to inform
the user how many checkboxes have selected in the accodion's hidden content.`,name:"count",required:!1,type:{name:"number"}},alwaysOpen:{defaultValue:null,description:"Disable toggling and always open accordion",name:"alwaysOpen",required:!1,type:{name:"boolean"}},initialOpen:{defaultValue:{value:"false"},description:"",name:"initialOpen",required:!1,type:{name:"boolean"}}}}}catch{}export{j as A};
