{"version":3,"file":"ToggleDropdown.DDBIlrN3.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/6AJedWFGYF6ixxnDM4Wm/48auFEOr8HPbch4boRoD/ToggleDropdown.js"],"sourcesContent":["// Simple toggle dropdown text component - expands on click, collapses on second click\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function ToggleDropdown(props){const{items,titleFont,contentFont,titleColor,contentColor,backgroundColor,borderRadius,padding,showIcon,iconColor,buttonText,buttonFont,buttonColor,buttonTextColor,gap,style}=props;const[openItems,setOpenItems]=useState([true,false,false,false]);const[allOpen,setAllOpen]=useState(false);const handleToggle=index=>{startTransition(()=>{setOpenItems(prev=>{const newState=[...prev];newState[index]=!newState[index];return newState;});});};const handleCollapseAll=()=>{startTransition(()=>{const newState=!allOpen;setAllOpen(newState);setOpenItems(items.map(()=>newState));});};return /*#__PURE__*/_jsxs(\"div\",{style:{...style,width:\"100%\",display:\"flex\",flexDirection:\"column\",gap},children:[items.map((item,index)=>/*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",backgroundColor,borderRadius,overflow:\"hidden\",cursor:\"pointer\"},onClick:()=>handleToggle(index),children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"space-between\",padding,gap:12},children:[/*#__PURE__*/_jsx(\"span\",{style:{...titleFont,color:titleColor,flex:1},children:item.title}),showIcon&&/*#__PURE__*/_jsx(motion.svg,{width:\"20\",height:\"20\",viewBox:\"0 0 20 20\",fill:\"none\",animate:{rotate:openItems[index]?180:0},transition:{duration:.3},children:/*#__PURE__*/_jsx(\"path\",{d:\"M5 7.5L10 12.5L15 7.5\",stroke:iconColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})]}),/*#__PURE__*/_jsx(AnimatePresence,{initial:false,children:openItems[index]&&/*#__PURE__*/_jsx(motion.div,{initial:{height:0,opacity:0},animate:{height:\"auto\",opacity:1},exit:{height:0,opacity:0},transition:{duration:.3,ease:\"easeInOut\"},style:{overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"div\",{style:{padding,paddingTop:0},children:/*#__PURE__*/_jsx(\"p\",{style:{...contentFont,color:contentColor,margin:0,whiteSpace:\"pre-wrap\"},children:item.content})})})})]},index)),/*#__PURE__*/_jsx(\"button\",{onClick:handleCollapseAll,style:{...buttonFont,backgroundColor:\"transparent\",color:buttonTextColor,border:\"none\",padding:0,cursor:\"pointer\",textDecoration:\"underline\",alignSelf:\"flex-start\",marginTop:8},onMouseEnter:e=>{e.currentTarget.style.opacity=\"0.7\";},onMouseLeave:e=>{e.currentTarget.style.opacity=\"1\";},children:buttonText})]});}addPropertyControls(ToggleDropdown,{items:{type:ControlType.Array,title:\"Items\",control:{type:ControlType.Object,controls:{title:{type:ControlType.String,title:\"Title\",defaultValue:\"Click to expand\"},content:{type:ControlType.String,title:\"Content\",defaultValue:\"This is the dropdown content.\",displayTextArea:true}}},defaultValue:[{title:\"Section 1\",content:\"This is the content for section 1. Click to collapse.\"},{title:\"Section 2\",content:\"This is the content for section 2. Click to expand.\"},{title:\"Section 3\",content:\"This is the content for section 3. Click to expand.\"},{title:\"Section 4\",content:\"This is the content for section 4. Click to expand.\"}]},buttonText:{type:ControlType.String,title:\"Button Text\",defaultValue:\"Collapse All\"},buttonFont:{type:ControlType.Font,title:\"Button Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},buttonColor:{type:ControlType.Color,title:\"Button Color\",defaultValue:\"#000000\"},buttonTextColor:{type:ControlType.Color,title:\"Button Text\",defaultValue:\"#FFFFFF\"},titleFont:{type:ControlType.Font,title:\"Title Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"22px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"}},contentFont:{type:ControlType.Font,title:\"Content Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}},titleColor:{type:ControlType.Color,title:\"Title Color\",defaultValue:\"#000000\"},contentColor:{type:ControlType.Color,title:\"Content Color\",defaultValue:\"#000000\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#F5F5F5\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:32,step:1},padding:{type:ControlType.Number,title:\"Padding\",defaultValue:20,min:0,max:50,step:1},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:12,min:0,max:50,step:1},showIcon:{type:ControlType.Boolean,title:\"Show Icon\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},iconColor:{type:ControlType.Color,title:\"Icon Color\",defaultValue:\"#000000\",hidden:({showIcon})=>!showIcon}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ToggleDropdown\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ToggleDropdown.map"],"mappings":"2OAIG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,QAAM,YAAU,cAAY,aAAW,eAAa,kBAAgB,eAAa,UAAQ,WAAS,YAAU,aAAW,aAAW,cAAY,kBAAgB,MAAI,SAAO,EAAW,CAAC,EAAU,GAAcA,EAAS,CAAC,GAAK,GAAM,GAAM,GAAM,CAAC,CAAM,CAAC,EAAQ,GAAYA,EAAS,GAAM,CAAO,EAAa,GAAO,CAAC,MAAoB,CAAC,EAAa,GAAM,C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