{"version":3,"file":"FAQAccordion.C90PyQCB.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/bhxRfnRQsRWDIpQFOSZP/KGZuv9SMyJMhDDRBS3oE/FAQAccordion.js"],"sourcesContent":["// FAQ Accordion component with 27 questions that opens one at a time\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\";function parseAnswer(answer){const lines=answer.split(\"\\n\");const elements=[];let currentParagraph=[];let currentList=[];let key=0;const flushParagraph=()=>{if(currentParagraph.length>0){elements.push(/*#__PURE__*/_jsx(\"p\",{style:{margin:\"0 0 12px 0\"},children:currentParagraph.join(\" \")},key++));currentParagraph=[];}};const flushList=()=>{if(currentList.length>0){elements.push(/*#__PURE__*/_jsx(\"ul\",{style:{margin:\"0 0 12px 0\",paddingLeft:\"0\",listStyle:\"none\"},children:currentList.map((item,i)=>/*#__PURE__*/_jsx(\"li\",{style:{marginBottom:\"8px\",display:\"block\"},children:item},i))},key++));currentList=[];}};lines.forEach(line=>{const trimmedLine=line.trim();if(trimmedLine===\"\"){flushParagraph();flushList();}else if(trimmedLine.startsWith(\"✅\")||trimmedLine.startsWith(\"✨\")||trimmedLine.startsWith(\"- \")||trimmedLine.startsWith(\"* \")){flushParagraph();currentList.push(trimmedLine);}else{flushList();currentParagraph.push(trimmedLine);}});flushParagraph();flushList();// Remove margin from last element\nif(elements.length>0){const lastElement=elements[elements.length-1];elements[elements.length-1]={...lastElement,props:{...lastElement.props,style:{...lastElement.props.style,margin:0}}};}return elements;}/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function FAQAccordion(props){const{items=[],backgroundColor,itemBackgroundColor,textColor,iconColor,borderRadius,gap,itemPaddingX,itemPaddingY,questionFont,answerFont,borderColor,borderWidth,style}=props;const[openIndex,setOpenIndex]=useState(null);const toggleItem=index=>{startTransition(()=>{setOpenIndex(openIndex===index?null:index);});};return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",backgroundColor,display:\"grid\",gridTemplateColumns:\"repeat(auto-fit, minmax(min(100%, 400px), 1fr))\",gap:`${gap}px`},children:items.map((item,index)=>{const question=item?.question||item?.Question||\"\";const answer=item?.answer||item?.Answer||\"\";return /*#__PURE__*/_jsxs(\"div\",{style:{backgroundColor:itemBackgroundColor,borderRadius:`${borderRadius}px`,overflow:\"hidden\",cursor:\"pointer\",borderBottom:index<items.length-1?`${borderWidth}px solid ${borderColor}`:\"none\"},onClick:()=>toggleItem(index),children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",padding:`${itemPaddingY}px ${itemPaddingX}px`,gap:\"16px\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{...questionFont,color:textColor,flex:1},children:question}),/*#__PURE__*/_jsx(motion.div,{animate:{rotate:openIndex===index?180:0},transition:{duration:.2},style:{flexShrink:0,width:\"20px\",height:\"20px\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:/*#__PURE__*/_jsx(\"svg\",{width:\"20\",height:\"20\",viewBox:\"0 0 24 24\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M6 9L12 15L18 9\",stroke:iconColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})})]}),/*#__PURE__*/_jsx(AnimatePresence,{initial:false,children:openIndex===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:`0 ${itemPaddingX}px ${itemPaddingY}px ${itemPaddingX}px`,...answerFont,color:textColor},children:parseAnswer(answer)})})})]},index);})});}addPropertyControls(FAQAccordion,{items:{type:ControlType.Array,title:\"FAQ Items\",control:{type:ControlType.Object,controls:{question:{type:ControlType.String,title:\"Question\",defaultValue:\"What is this?\"},answer:{type:ControlType.String,title:\"Answer\",defaultValue:\"This is an answer to the question.\"}}},defaultValue:[{question:\"What is your return policy?\",answer:\"We offer a 30-day return policy on all items. Products must be in original condition with tags attached.\"},{question:\"How long does shipping take?\",answer:\"Standard shipping takes 5-7 business days. Express shipping is available for 2-3 business days.\"},{question:\"Do you ship internationally?\",answer:\"Yes, we ship to over 50 countries worldwide. International shipping times vary by location.\"}]},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},itemBackgroundColor:{type:ControlType.Color,title:\"Item Background\",defaultValue:\"#F5F5F5\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},iconColor:{type:ControlType.Color,title:\"Icon Color\",defaultValue:\"#000000\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:32,step:1,unit:\"px\"},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:12,min:0,max:48,step:1,unit:\"px\"},itemPaddingX:{type:ControlType.Number,title:\"Item Padding X\",defaultValue:20,min:0,max:48,step:1,unit:\"px\"},itemPaddingY:{type:ControlType.Number,title:\"Item Padding Y\",defaultValue:20,min:0,max:48,step:1,unit:\"px\"},borderColor:{type:ControlType.Color,title:\"Border Color\",defaultValue:\"#EEEEEE\"},borderWidth:{type:ControlType.Number,title:\"Border Width\",defaultValue:1,min:0,max:10,step:1,unit:\"px\"},questionFont:{type:ControlType.Font,title:\"Question Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}},answerFont:{type:ControlType.Font,title:\"Answer Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FAQAccordion\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FAQAccordion.map"],"mappings":"gPAC2M,SAAS,EAAY,EAAO,CAAC,IAAM,EAAM,EAAO,MAAM;EAAK,CAAO,EAAS,EAAE,CAAK,EAAiB,EAAE,CAAK,EAAY,EAAE,CAAK,EAAI,EAAQ,MAAmB,CAAI,EAAiB,OAAO,IAAG,EAAS,KAAkB,EAAK,IAAI,CAAC,MAAM,CAAC,OAAO,aAAa,CAAC,SAAS,EAAiB,KAAK,IAAI,CAAC,CAAC,IAAM,CAAC,CAAC,EAAiB,EAAE,GAAU,MAAc,CAAI,EAAY,OAAO,IAAG,EAAS,KAAkB,EAAK,KAAK,CAAC,MAAM,CAAC,OAAO,aAAa,YAAY,IAAI,UAAU,OAAO,CAAC,SAAS,EAAY,KAAK,EAAK,IAAiB,EAAK,KAAK,CAAC,MAAM,CAAC,aAAa,MAAM,QAAQ,QAAQ,CAAC,SAAS,EAAK,CAAC,EAAE,CAAC,CAAC,CAAC,IAAM,CAAC,CAAC,EAAY,EAAE,GAC5yB,GADgzB,EAAM,QAAQ,GAAM,CAAC,IAAM,EAAY,EAAK,MAAM,CAAI,IAAc,IAAI,GAAgB,CAAC,GAAW,EAAU,EAAY,WAAW,IAAI,EAAE,EAAY,WAAW,IAAI,EAAE,EAAY,WAAW,KAAK,EAAE,EAAY,WAAW,KAAK,EAAE,GAAgB,CAAC,EAAY,KAAK,EAAY,GAAO,GAAW,CAAC,EAAiB,KAAK,EAAY,GAAI,CAAC,GAAgB,CAAC,GAAW,CACrpC,EAAS,OAAO,EAAE,CAAC,IAAM,EAAY,EAAS,EAAS,OAAO,GAAG,EAAS,EAAS,OAAO,GAAG,CAAC,GAAG,EAAY,MAAM,CAAC,GAAG,EAAY,MAAM,M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