{"version":3,"file":"FAQ.kHOUaDPq.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/pCqVS24spC3pXm3P5nV7/0KIpNVxdNoJcF2QrKDF1/FAQ.js"],"sourcesContent":["// FAQ component with expandable questions and answers\n// - Icon upload option (24x24)\n// - Title with 8px gap from icon, 1.125rem (18px), 140% line height, Literata regular\n// - Plus symbol with 8px gap from title, rotates to X on open\n// - Answer supports paragraphs + bullet points (lines starting with \"- \", \"* \", or \"• \")\n// - Answer text field with 1rem Plus Jakarta Sans, 150% line height\n// - Adjustable font color, background color, radius, and border\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function FAQ(props){const{items=[],fontColor,backgroundColor,borderRadius,border}=props;const[openIndex,setOpenIndex]=useState(null);const toggleItem=index=>{startTransition(()=>{setOpenIndex(prev=>prev===index?null:index);});};// Parses plain text into paragraphs and bullet lists.\n// Bullet syntax: lines starting with \"- \", \"* \", or \"• \".\nconst renderAnswer=answer=>{const lines=(answer||\"\").replace(/\\r\\n/g,\"\\n\").split(\"\\n\");const blocks=[];let currentBullets=[];let currentParagraph=[];const flushParagraph=()=>{const text=currentParagraph.join(\" \").trim();if(text){blocks.push(/*#__PURE__*/_jsx(\"p\",{style:{margin:\"0 0 10px 0\"},children:text},`p-${blocks.length}`));}currentParagraph=[];};const flushBullets=()=>{if(currentBullets.length){blocks.push(/*#__PURE__*/_jsx(\"ul\",{style:{margin:\"0 0 10px 0\",paddingLeft:\"18px\"},children:currentBullets.map((b,i)=>/*#__PURE__*/_jsx(\"li\",{style:{margin:\"0 0 6px 0\"},children:b},i))},`ul-${blocks.length}`));}currentBullets=[];};const isBulletLine=line=>{const t=line.trim();return t.startsWith(\"- \")||t.startsWith(\"* \")||t.startsWith(\"• \");};const stripBullet=line=>{const t=line.trim();if(t.startsWith(\"- \"))return t.slice(2).trim();if(t.startsWith(\"* \"))return t.slice(2).trim();if(t.startsWith(\"• \"))return t.slice(2).trim();return t;};for(const raw of lines){const line=raw.trim();// Blank line ends current block(s)\nif(!line){flushParagraph();flushBullets();continue;}if(isBulletLine(line)){// Switch from paragraph to bullets\nflushParagraph();currentBullets.push(stripBullet(line));}else{// Switch from bullets to paragraph\nflushBullets();currentParagraph.push(line);}}// Flush any remaining content\nflushParagraph();flushBullets();return blocks.length?blocks:null;};return /*#__PURE__*/_jsxs(\"div\",{style:{...props.style,display:\"flex\",flexDirection:\"column\",gap:\"12px\",width:\"100%\"},children:[/*#__PURE__*/_jsx(\"link\",{href:\"https://fonts.googleapis.com/css2?family=Literata:wght@400&family=Plus+Jakarta+Sans:wght@400&display=swap\",rel:\"stylesheet\"}),items.map((item,index)=>{const isOpen=openIndex===index;return /*#__PURE__*/_jsxs(\"div\",{style:{backgroundColor,borderRadius:`${borderRadius}px`,overflow:\"hidden\",...border},children:[/*#__PURE__*/_jsxs(\"button\",{onClick:()=>toggleItem(index),style:{width:\"100%\",display:\"flex\",alignItems:\"center\",padding:\"16px\",border:\"none\",background:\"transparent\",cursor:\"pointer\",color:fontColor,textAlign:\"left\"},children:[item.icon?.src&&/*#__PURE__*/_jsx(\"img\",{src:item.icon.src,alt:item.icon.alt||\"\",style:{width:\"24px\",height:\"24px\",flexShrink:0}}),/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:\"Literata, serif\",fontSize:\"1.125rem\",lineHeight:\"140%\",fontWeight:400,marginLeft:item.icon?.src?\"8px\":\"0\",flex:1},children:item.question}),/*#__PURE__*/_jsx(\"div\",{style:{marginLeft:\"8px\",width:\"24px\",height:\"24px\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",transition:\"transform 0.4s ease-out\",transform:isOpen?\"rotate(45deg)\":\"rotate(0deg)\",flexShrink:0},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:fontColor,strokeWidth:\"2\",strokeLinecap:\"round\"})})})]}),/*#__PURE__*/_jsx(\"div\",{style:{maxHeight:isOpen?\"700px\":\"0\",overflow:\"hidden\",transition:\"max-height 0.4s ease-out\"},children:/*#__PURE__*/_jsx(\"div\",{style:{padding:\"0 16px 16px 16px\",fontFamily:\"Plus Jakarta Sans, sans-serif\",fontSize:\"1rem\",lineHeight:\"150%\",fontWeight:400,color:fontColor},children:renderAnswer(item.answer)})})]},index);})]});}addPropertyControls(FAQ,{items:{type:ControlType.Array,title:\"FAQ Items\",control:{type:ControlType.Object,controls:{icon:{type:ControlType.ResponsiveImage,title:\"Icon\"},question:{type:ControlType.String,title:\"Question\",defaultValue:\"What is this FAQ about?\"},answer:{type:ControlType.String,title:\"Answer\",displayTextArea:true,defaultValue:\"This is a paragraph answer.\\n\\n- First bullet\\n- Second bullet\\n\\nAnother paragraph after bullets.\"}}},defaultValue:[{icon:{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Icon 1\"},question:\"What is this FAQ about?\",answer:\"This is a paragraph.\\n\\n- Bullet one\\n- Bullet two\"},{icon:{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Icon 2\"},question:\"How do I use this component?\",answer:\"Add text normally for paragraphs.\\nUse '- ' at the start of a line for bullets.\\n\\n- Like this\\n- And this\"}]},fontColor:{type:ControlType.Color,title:\"Font Color\",defaultValue:\"#000000\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#F5F5F5\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:32,unit:\"px\"},border:{type:ControlType.Border,title:\"Border\",defaultValue:{borderWidth:1,borderStyle:\"solid\",borderColor:\"#EEEEEE\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FAQ\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FAQ.map"],"mappings":"yLAUG,SAAwB,EAAI,EAAM,CAAC,GAAK,CAAC,QAAM,CAAC,EAAE,YAAU,kBAAgB,eAAa,UAAQ,EAAW,CAAC,EAAU,GAAcA,EAAS,IAAI,EAAQ,EAAW,GAAO,CAAC,MAAoB,CAAC,EAAa,GAAM,IAAO,EAAM,KAAK,CAAK,CAAE,CAAC,CAAE,EAE9O,EAAa,GAAQ,CAAC,IAAM,GAAO,GAAQ,GAAA,CAAI,QAAQ,QAAQ;CAAI,CAAC,CAAC,MAAM;CAAI,EAAQ,EAAO,CAAC,EAAM,EAAe,CAAC,EAAM,EAAiB,CAAC,EAAQ,MAAmB,CAAC,IAAM,EAAK,EAAiB,KAAK,GAAG,CAAC,CAAC,KAAK,EAAK,GAAM,EAAO,KAAkB,EAAK,IAAI,CAAC,MAAM,CAAC,OAAO,YAAY,EAAE,SAAS,CAAI,EAAE,KAAK,EAAO,QAAQ,CAAC,EAAG,EAAiB,CAAC,CAAE,EAAQ,MAAiB,CAAI,EAAe,QAAQ,EAAO,KAAkB,EAAK,KAAK,CAAC,MAAM,CAAC,OAAO,aAAa,YAAY,MAAM,EAAE,SAAS,EAAe,KAAK,EAAE,IAAiB,EAAK,KAAK,CAAC,MAAM,CAAC,OAAO,WAAW,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAO,QAAQ,CAAC,EAAG,EAAe,CAAC,CAAE,EAAQ,EAAa,GAAM,CAAC,IAAM,EAAE,EAAK,KAAK,EAAE,OAAO,EAAE,WAAW,IAAI,GAAG,EAAE,WAAW,IAAI,GAAG,EAAE,WAAW,IAAI,CAAE,EAAQ,EAAY,GAAM,CAAC,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