{"version":3,"file":"FAQSection.DsLCoGCv.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/pCaSHBxgbP5cMVDTPhfS/RQhnMaqaCxuYe1IfcGZ9/FAQSection.js"],"sourcesContent":["// FAQ Section with expandable/collapsible items\n// User can edit questions and answers, add/remove FAQs\n// Smooth animations for expand/collapse\n// Width is flexible, height fits content\n// Text wraps to multiple lines when width is constrained\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 FAQSection(props){const{faqs,questionFont,answerFont,questionColor,answerColor,borderColor,iconColor,style}=props;const[openIndexes,setOpenIndexes]=useState(new Set);const toggleFAQ=index=>{startTransition(()=>{setOpenIndexes(prev=>{const newSet=new Set(prev);if(newSet.has(index)){newSet.delete(index);}else{newSet.add(index);}return newSet;});});};return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",display:\"flex\",flexDirection:\"column\",gap:0},children:faqs.map((faq,index)=>{const isOpen=openIndexes.has(index);const isLast=index===faqs.length-1;return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",borderBottom:`1px solid ${borderColor}`,paddingTop:index===0?0:22.4,paddingBottom:22.4},children:[/*#__PURE__*/_jsxs(\"button\",{onClick:()=>toggleFAQ(index),style:{width:\"100%\",display:\"flex\",justifyContent:\"space-between\",alignItems:\"flex-start\",gap:16.8,background:\"none\",border:\"none\",padding:0,cursor:\"pointer\",textAlign:\"left\"},\"aria-expanded\":isOpen,children:[/*#__PURE__*/_jsx(\"span\",{style:{flex:1,color:questionColor,...questionFont,wordBreak:\"break-word\",overflowWrap:\"break-word\"},children:faq.question}),/*#__PURE__*/_jsx(motion.div,{animate:{rotate:isOpen?45:0},transition:{duration:.3,ease:[.4,0,.2,1]},style:{flexShrink:0,width:24,height:24,display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:/*#__PURE__*/_jsx(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M12 5V19M5 12H19\",stroke:iconColor,strokeWidth:\"2\",strokeLinecap:\"square\"})})})]}),/*#__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:{height:{duration:.4,ease:[.4,0,.2,1]},opacity:{duration:.3,ease:[.4,0,.2,1]}},style:{overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"div\",{style:{paddingTop:16.8,paddingRight:33.6},children:/*#__PURE__*/_jsx(\"p\",{style:{margin:0,color:answerColor,...answerFont,wordBreak:\"break-word\",overflowWrap:\"break-word\",whiteSpace:\"pre-wrap\"},children:faq.answer})})})})]},index);})});}addPropertyControls(FAQSection,{faqs:{type:ControlType.Array,title:\"FAQs\",control:{type:ControlType.Object,controls:{question:{type:ControlType.String,title:\"Question\",defaultValue:\"What is your question?\",displayTextArea:true},answer:{type:ControlType.String,title:\"Answer\",defaultValue:\"This is the answer to your question.\",displayTextArea:true}}},defaultValue:[{question:\"WHAT WARRANTY COMES WITH A CASLY HOME?\",answer:\"\"},{question:\"WHAT DOES THE FIRST YEAR WARRANTY COVER?\",answer:\"The first year covers defects in workmanship and materials that do not meet QBW performance standards. This includes issues related to construction quality identified during normal use of the home.\"},{question:\"WHAT SYSTEMS ARE COVERED AFTER THE FIRST YEAR?\",answer:\"\"},{question:\"IS THERE LONG-TERM STRUCTURAL PROTECTION?\",answer:\"\"},{question:\"WHO HANDLES WARRANTY CLAIMS?\",answer:\"\"},{question:\"WHY IS A QBW WARRANTY IMPORTANT?\",answer:\"\"},{question:\"WHEN DOES WARRANTY COVERAGE BEGIN?\",answer:\"\"}]},questionFont:{type:ControlType.Font,title:\"Question Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"18px\",variant:\"Regular\",letterSpacing:\"0.02em\",lineHeight:\"1.4em\"}},answerFont:{type:ControlType.Font,title:\"Answer Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"18px\",variant:\"Regular\",letterSpacing:\"0em\",lineHeight:\"1.6em\"}},questionColor:{type:ControlType.Color,title:\"Question Color\",defaultValue:\"#000000\"},answerColor:{type:ControlType.Color,title:\"Answer Color\",defaultValue:\"#000000\"},borderColor:{type:ControlType.Color,title:\"Border Color\",defaultValue:\"#000000\"},iconColor:{type:ControlType.Color,title:\"Icon Color\",defaultValue:\"#000000\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FAQSection\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FAQSection.map"],"mappings":"2OAQG,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,OAAK,eAAa,aAAW,gBAAc,cAAY,cAAY,YAAU,SAAO,EAAW,CAAC,EAAY,GAAgBA,EAAS,IAAI,IAAI,CAAO,EAAU,GAAO,CAAC,MAAoB,CAAC,EAAe,GAAM,CAAC,IAAM,EAAO,IAAI,IAAI,EAAK,CAAqE,OAAjE,EAAO,IAAI,EAAM,CAAE,EAAO,OAAO,EAAM,CAAO,EAAO,IAAI,EAAM,CAAS,GAAS,EAAG,EAAG,OAAoB,EAAK,MAAM,CAAC,MAAM,CAAC,GAAG,EAAM,MAAM,OAAO,QAAQ,OAAO,cAAc,SAAS,IAAI,EAAE,CAAC,SAAS,EAAK,KAAK,EAAI,IAAQ,CAAC,IAAM,EAAO,EAAY,IAAI,EAAM,CAAoC,OAAd,EAAK,OAAO,EAAsB,EAAM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