{"version":3,"file":"FAQ_V3.ryirSo4e.mjs","names":["React.useState","React.useRef"],"sources":["https:/framerusercontent.com/modules/m5ikwn10zB8vjxJvsMGa/B3BAHgGdA1u1WXgDducd/FAQ_V3.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function FAQComponent(props){const{faqs,limit,gap,borderRadius,borderColor,questionColor,openQuestionColor,questionBackground,openBackground,questionFontSize,questionFontFamily,questionFontWeight,openQuestionFontWeight,answerColor,answerFontSize,answerFontFamily,answerFontWeight,iconColor,lineColor,questionPadding,answerPadding,buttonTextColor,buttonFontSize,buttonFontWeight}=props;const[openIndex,setOpenIndex]=React.useState(null);const[showAll,setShowAll]=React.useState(false);const answerRefs=React.useRef([]);const toggleFAQ=index=>{setOpenIndex(openIndex===index?null:index);};const displayedFAQs=showAll?faqs:faqs.slice(0,limit);const shouldShowButton=faqs.length>limit;return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap},children:[displayedFAQs.map((faq,index)=>{const isOpen=openIndex===index;const height=answerRefs.current[index]?.scrollHeight||0;return /*#__PURE__*/_jsxs(\"div\",{style:{borderRadius,padding:questionPadding,cursor:\"pointer\",border:`1px solid ${borderColor}`,display:\"flex\",flexDirection:\"column\",backgroundColor:isOpen?openBackground:questionBackground,transition:\"background 0.3s ease\"},onClick:()=>toggleFAQ(index),children:[/*#__PURE__*/_jsxs(\"div\",{style:{color:isOpen?openQuestionColor:questionColor,fontSize:questionFontSize,fontFamily:questionFontFamily,fontWeight:isOpen?openQuestionFontWeight:questionFontWeight,display:\"flex\",justifyContent:\"space-between\",alignItems:\"center\",lineHeight:\"1.4\",transition:\"all 0.3s ease\"},children:[/*#__PURE__*/_jsx(\"div\",{children:faq.question}),/*#__PURE__*/_jsx(\"div\",{style:{fontSize:\"24px\",color:iconColor,transition:\"transform 0.3s ease\",transform:isOpen?\"rotate(45deg)\":\"rotate(0deg)\"},children:\"+\"})]}),/*#__PURE__*/_jsx(\"div\",{ref:el=>answerRefs.current[index]=el,style:{color:answerColor,fontSize:answerFontSize,fontFamily:answerFontFamily,fontWeight:answerFontWeight,overflow:\"hidden\",transition:\"all 0.3s ease\",maxHeight:isOpen?`${height}px`:\"0px\",marginTop:isOpen?\"12px\":\"0px\",padding:answerPadding,lineHeight:\"1.6\"},children:faq.answer}),/*#__PURE__*/_jsx(\"div\",{style:{borderBottom:`1px solid ${lineColor}`,marginTop:\"16px\"}})]},index);}),shouldShowButton&&/*#__PURE__*/_jsx(\"div\",{onClick:()=>{setShowAll(!showAll);setOpenIndex(null);},style:{cursor:\"pointer\",textAlign:\"center\",marginTop:\"8px\",color:buttonTextColor,fontSize:buttonFontSize,fontWeight:buttonFontWeight},children:showAll?\"View Less\":\"View All\"})]});}/* ---------------- Default Props ---------------- */FAQComponent.defaultProps={limit:3,gap:12,borderRadius:12,borderColor:\"#E5E5E5\",questionColor:\"#111111\",openQuestionColor:\"#000000\",questionBackground:\"transparent\",openBackground:\"#F7F7F7\",questionFontSize:18,questionFontFamily:\"Urbanist\",questionFontWeight:500,openQuestionFontWeight:700,answerColor:\"#555555\",answerFontSize:16,answerFontFamily:\"Inter\",answerFontWeight:400,iconColor:\"#111111\",lineColor:\"#E5E5E5\",questionPadding:\"16px 20px\",answerPadding:\"0px\",buttonTextColor:\"#000000\",buttonFontSize:16,buttonFontWeight:600,faqs:[{question:\"What services do you offer?\",answer:\"We provide digital solutions.\"}]};/* ---------------- Property Controls ---------------- */addPropertyControls(FAQComponent,{faqs:{type:ControlType.Array,title:\"FAQs\",propertyControl:{type:ControlType.Object,controls:{question:{type:ControlType.String},answer:{type:ControlType.String}}}},limit:{type:ControlType.Number,title:\"Limit\"},gap:{type:ControlType.Number},borderRadius:{type:ControlType.Number},borderColor:{type:ControlType.Color},questionColor:{type:ControlType.Color},openQuestionColor:{type:ControlType.Color},questionBackground:{type:ControlType.Color},openBackground:{type:ControlType.Color},questionFontSize:{type:ControlType.Number},questionFontFamily:{type:ControlType.String},questionFontWeight:{type:ControlType.Number},openQuestionFontWeight:{type:ControlType.Number},answerColor:{type:ControlType.Color},answerFontSize:{type:ControlType.Number},answerFontFamily:{type:ControlType.String},answerFontWeight:{type:ControlType.Number},iconColor:{type:ControlType.Color},lineColor:{type:ControlType.Color},questionPadding:{type:ControlType.String},answerPadding:{type:ControlType.String},buttonTextColor:{type:ControlType.Color,title:\"Btn Color\"},buttonFontSize:{type:ControlType.Number,title:\"Btn Size\"},buttonFontWeight:{type:ControlType.Number,title:\"Btn Weight\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FAQComponent\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FAQ_V3.map"],"mappings":"wLAAyI,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,OAAK,QAAM,MAAI,eAAa,cAAY,gBAAc,oBAAkB,qBAAmB,iBAAe,mBAAiB,qBAAmB,qBAAmB,yBAAuB,cAAY,iBAAe,mBAAiB,mBAAiB,YAAU,YAAU,kBAAgB,gBAAc,kBAAgB,iBAAe,oBAAkB,EAAW,CAAC,EAAU,GAAcA,EAAe,KAAK,CAAM,CAAC,EAAQ,GAAYA,EAAe,GAAM,CAAO,EAAWC,EAAa,EAAE,CAAC,CAAO,EAAU,GAAO,CAAC,EAAa,IAAY,EAAM,KAAK,EAAM,EAAS,EAAc,EAAQ,EAAK,EAAK,MAAM,EAAE,EAAM,CAAO,EAAiB,EAAK,OAAO,EAAM,OAAoB,EAAM,MAAM,CAAC,MAAM,CAAC,QAAQ,OAAO,cAAc,SAAS,MAAI,CAAC,SAAS,CAAC,EAAc,KAAK,EAAI,IAAQ,CAAC,IAAM,EAAO,IAAY,EAAY,EAAO,EAAW,QAAQ,IAAQ,cAAc,EAAE,OAAoB,EAAM,MAAM,CAAC,MAA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