{"version":3,"file":"FAQCard.DMEiPIrA.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/cbWi9VCRq6tJcpe4BrDj/wPMSGooMWXfnwtfY7hfp/FAQCard.js"],"sourcesContent":["// FAQ Accordion with multiple cards - accordion or independent mode\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,startTransition,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * FAQ Accordion\n * \n * Display multiple FAQ cards with accordion or independent behavior\n *\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight auto\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function FAQCard(props){const{items,colors,typography,borderRadius,border,gap,style}=props;// Initialize open states based on defaultOpen values\nconst[openIndexes,setOpenIndexes]=useState(()=>{const initialOpen=new Set;items.forEach((item,index)=>{if(item.defaultOpen){initialOpen.add(index);}});// Only keep the first open item\nif(initialOpen.size>0){const firstOpen=Array.from(initialOpen)[0];return new Set([firstOpen]);}return initialOpen;});const[showPlusButton,setShowPlusButton]=useState(true);useEffect(()=>{const checkWidth=()=>{startTransition(()=>{setShowPlusButton(window.innerWidth>=400);});};checkWidth();window.addEventListener(\"resize\",checkWidth);return()=>window.removeEventListener(\"resize\",checkWidth);},[]);const toggleItem=index=>{startTransition(()=>{// Accordion mode: only one can be open at a time\nsetOpenIndexes(prev=>{if(prev.has(index)){return new Set// Close if already open\n;}return new Set([index])// Open this one, close others\n;});});};// Calculate icon button height to match card height\nconst fontSize=parseFloat(typography.questionFont.fontSize)||18;const lineHeight=parseFloat(typography.questionFont.lineHeight)||1.4;const padding=20;const iconButtonHeight=fontSize*lineHeight+padding*2;return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                @media (max-width: 400px) {\n                    .faq-icon-button {\n                        display: none !important;\n                    }\n                }\n            `}),/*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",display:\"flex\",flexDirection:\"column\",gap:`${gap}px`,borderRadius},children:items.map((item,index)=>{const isOpen=openIndexes.has(index);return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",display:\"flex\",alignItems:\"flex-start\",gap:\"16px\"},children:[showPlusButton&&/*#__PURE__*/_jsx(\"button\",{className:\"faq-icon-button\",onClick:()=>toggleItem(index),style:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",flexShrink:0,width:`${iconButtonHeight}px`,height:`${iconButtonHeight}px`,backgroundColor:colors.cardBackground,...border,borderRadius,cursor:\"pointer\",padding:0,boxShadow:\"0 2px 8px rgba(0, 0, 0, 0.08)\"},\"aria-expanded\":isOpen,\"aria-label\":isOpen?\"Collapse\":\"Expand\",children:/*#__PURE__*/_jsx(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",children:isOpen?/*#__PURE__*/_jsx(\"path\",{d:\"M6 12H18\",stroke:colors.iconColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"}):/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"path\",{d:\"M12 6V18\",stroke:colors.iconColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M6 12H18\",stroke:colors.iconColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})]})})}),/*#__PURE__*/_jsxs(\"div\",{style:{flex:1,backgroundColor:colors.cardBackground,borderRadius,...border,overflow:\"hidden\",boxShadow:\"0 2px 8px rgba(0, 0, 0, 0.08)\"},children:[/*#__PURE__*/_jsx(\"div\",{onClick:()=>toggleItem(index),style:{width:\"100%\",display:\"flex\",justifyContent:\"space-between\",alignItems:\"center\",padding:\"20px\",cursor:\"pointer\",textAlign:\"left\"},children:/*#__PURE__*/_jsx(\"span\",{style:{...typography.questionFont,color:colors.questionColor,flex:1},children:item.question})}),/*#__PURE__*/_jsx(AnimatePresence,{initial:false,children:isOpen&&/*#__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:\"0 20px 20px 20px\",...typography.answerFont,color:colors.answerColor},children:item.answer})})})]})]},index);})})]});}addPropertyControls(FAQCard,{items:{type:ControlType.Array,title:\"FAQ Items\",control:{type:ControlType.Object,controls:{question:{type:ControlType.String,title:\"Question\",defaultValue:\"What is your question?\"},answer:{type:ControlType.String,title:\"Answer\",defaultValue:\"This is the answer to your question.\",displayTextArea:true},defaultOpen:{type:ControlType.Boolean,title:\"Default Open\",defaultValue:false,enabledTitle:\"Open\",disabledTitle:\"Closed\"}}},defaultValue:[{question:\"What is Framer?\",answer:\"Framer is a powerful design and prototyping tool that allows you to create interactive designs and ship them as real websites.\",defaultOpen:false},{question:\"How do I get started?\",answer:\"You can start by signing up for a free account and exploring the templates and tutorials available in the Framer community.\",defaultOpen:false},{question:\"Can I use custom code?\",answer:\"Yes! Framer supports React components, allowing you to add custom functionality and integrate with external APIs.\",defaultOpen:false}]},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:12,min:0,max:48,step:1,unit:\"px\"},colors:{type:ControlType.Object,title:\"Colors\",controls:{cardBackground:{type:ControlType.Color,title:\"Card Background\",defaultValue:\"#1A1A1A\"},questionColor:{type:ControlType.Color,title:\"Question\",defaultValue:\"#FFFFFF\"},answerColor:{type:ControlType.Color,title:\"Answer\",defaultValue:\"#A0A0A0\"},iconColor:{type:ControlType.Color,title:\"Icon\",defaultValue:\"#FFFFFF\"}}},typography:{type:ControlType.Object,title:\"Typography\",controls:{questionFont:{type:ControlType.Font,title:\"Question\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"18px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1.4em\"}},answerFont:{type:ControlType.Font,title:\"Answer\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Regular\",letterSpacing:\"-0.01em\",lineHeight:\"1.5em\"}}}},border:{type:ControlType.Border,title:\"Border\",defaultValue:{borderWidth:1,borderStyle:\"solid\",borderColor:\"#2A2A2A\"}},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:12,min:0,max:32,step:1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FAQCard\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"600\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FAQCard.map"],"mappings":"6QAWG,SAAwB,EAAQ,EAAM,CAAC,GAAK,CAAC,QAAM,SAAO,aAAW,eAAa,SAAO,MAAI,SAAO,EAClG,CAAC,EAAY,GAAgBA,MAAa,CAAC,IAAM,EAAY,IAAI,IACtE,GAD0E,EAAM,SAAS,EAAK,IAAQ,CAAI,EAAK,aAAa,EAAY,IAAI,EAAM,EAAI,CACnJ,EAAY,KAAK,EAAE,CAAC,IAAM,EAAU,MAAM,KAAK,EAAY,CAAC,GAAG,OAAO,IAAI,IAAI,CAAC,EAAU,CAAC,CAAE,OAAO,GAAc,CAAM,CAAC,EAAe,GAAmBA,EAAS,GAAK,CAAC,MAAc,CAAC,IAAM,MAAe,CAAC,MAAoB,CAAC,EAAkB,EAAO,YAAY,IAAI,EAAG,EAA6D,OAA1D,GAAY,CAAC,EAAO,iBAAiB,SAAS,EAAW,KAAW,EAAO,oBAAoB,SAAS,EAAW,EAAG,EAAE,CAAC,CAAC,IAAM,EAAW,GAAO,CAAC,MAAoB,CAC5b,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