2 lines
1.5 KiB
JavaScript
2 lines
1.5 KiB
JavaScript
import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{r as d}from"./index-JhL3uwfD.js";import{m as i}from"./proxy-ZkTvaR74.js";import{C as l}from"./chevron-down-CuGyZVZ6.js";import{A as c}from"./index-CNXKWNLp.js";function m({title:r,icon:s,defaultOpen:o=!1,children:a}){const[t,n]=d.useState(o);return e.jsxs("div",{className:"border border-border/60 rounded-xl overflow-hidden bg-card",children:[e.jsxs("button",{type:"button",onClick:()=>n(!t),className:"w-full flex items-center justify-between p-4 text-left hover:bg-muted/30 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(s,{className:"w-4 h-4 text-primary"}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:r})]}),e.jsx(i.div,{animate:{rotate:t?180:0},transition:{duration:.2},children:e.jsx(l,{className:"w-4 h-4 text-muted-foreground"})})]}),e.jsx(c,{initial:!1,children:t&&e.jsx(i.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.3,ease:"easeOut"},style:{overflow:"hidden"},children:e.jsx("div",{className:"p-4 pt-0 border-t border-border/60",children:a})})})]})}m.__docgenInfo={description:"",methods:[],displayName:"CollapsibleSection",props:{title:{required:!0,tsType:{name:"string"},description:""},icon:{required:!0,tsType:{name:"ElementType"},description:""},defaultOpen:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},children:{required:!0,tsType:{name:"ReactNode"},description:""}}};export{m as C};
|