{"version":3,"file":"FAQ.gm2M5abv.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/HEy6TGlaFtuIhdCIDisp/TJJebWPn7MCss3aFZCde/FAQ.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";import{useState}from\"react\";// Code component provided by Eleveight Supply™. All rights reserved 2024.\n/**\n * @framerDisableUnlink\n *\n * @framerIntrinsicWidth 300\n * @framerIntrinsicHeight 300\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight 100%\n */export default function FAQ(props){const{items:passedItems,questionStyles,answerStyles,faqStyles,linkStyles,transition}=props;// Fallback to default items if passed-in items is empty or undefined\nconst items=passedItems&&passedItems.length>0?passedItems:FAQ.defaultProps.items;const[openIndex,setOpenIndex]=useState(null);const toggle=index=>{setOpenIndex(openIndex===index?null:index);};return /*#__PURE__*/_jsx(\"div\",{children:items.map((item,index)=>/*#__PURE__*/_jsx(FAQItem,{question:item.question,answer:item.answer,isOpen:openIndex===index,toggle:()=>toggle(index),questionStyles:questionStyles,answerStyles:answerStyles,linkStyles:linkStyles,isLastItem:index===items.length-1,faqStyles:faqStyles,transition:transition},index))});}const FAQItem=({question,answer,isOpen,toggle,questionStyles,answerStyles,linkStyles,isLastItem,faqStyles,transition})=>{const containerStyle={padding:`${faqStyles.faqPaddingTop}px ${faqStyles.faqPaddingRight}px ${faqStyles.faqPaddingBottom}px ${faqStyles.faqPaddingLeft}px`,backgroundColor:faqStyles.faqFill,borderTopLeftRadius:`${faqStyles.faqBorderRadiusTopLeft}px`,borderTopRightRadius:`${faqStyles.faqBorderRadiusTopRight}px`,borderBottomRightRadius:`${faqStyles.faqBorderRadiusBottomRight}px`,borderBottomLeftRadius:`${faqStyles.faqBorderRadiusBottomLeft}px`,border:`${faqStyles.faqBorder.width}px ${faqStyles.faqBorder.style} ${faqStyles.faqBorder.color}`,marginBottom:isLastItem?\"0\":`${faqStyles.containerSpacing}px`,cursor:\"pointer\",userSelect:\"none\",boxSizing:\"border-box\"};const questionStyle={color:questionStyles.questionColor,...questionStyles.questionFont,display:\"flex\",justifyContent:\"space-between\",alignItems:\"flex-start\",userSelect:\"none\",margin:0};const answerContainerStyle={overflow:\"hidden\"};const answerStyle={color:answerStyles.answerColor,...answerStyles.answerFont,marginTop:`${questionStyles.questionAnswerSpacing}px`,userSelect:\"none\"};const iconStyle={display:\"flex\",alignItems:\"center\",justifyContent:\"center\",margin:0,padding:0,marginLeft:\"12px\"};// Link styling and adding `onClick=\"event.stopPropagation()\"`\nconst linkStyle={color:linkStyles.linkColor,textDecoration:linkStyles.underline?\"underline\":\"none\"};return /*#__PURE__*/_jsxs(\"div\",{style:containerStyle,onClick:toggle,children:[/*#__PURE__*/_jsxs(motion.div,{initial:{opacity:1},animate:{opacity:1},transition:transition,style:questionStyle,children:[/*#__PURE__*/_jsx(\"div\",{style:{margin:0,flex:1},children:question}),/*#__PURE__*/_jsx(motion.div,{initial:{rotate:0,opacity:1},animate:{rotate:isOpen?180:0,opacity:isOpen?.5:1},transition:transition,style:iconStyle,children:/*#__PURE__*/_jsx(\"svg\",{width:faqStyles.chevronSize,viewBox:\"6 1 12 20\",xmlns:\"http://www.w3.org/2000/svg\",children:/*#__PURE__*/_jsx(\"path\",{fill:\"none\",stroke:\"currentColor\",strokeLinecap:\"round\",strokeLinejoin:\"round\",strokeWidth:\"2\",d:\"M17 10l-5 5-5-5\"})})})]}),/*#__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:transition,style:answerContainerStyle,children:/*#__PURE__*/_jsx(\"div\",{style:answerStyle,dangerouslySetInnerHTML:{__html:answer.replace(/<a\\b([^>]*)>/gi,`<a onclick=\"event.stopPropagation()\" style=\"color: ${linkStyle.color}; text-decoration: ${linkStyle.textDecoration};\" $1>`)}})})})]});};FAQ.defaultProps={items:[{question:\"How do I set it up, is it easy?\",answer:\"It's pretty simple, just go to the property controls, start adding your questions, then play around with the font styling.\"},{question:\"Oh it also uses Framer's native transitions?\",answer:\"Yes, this uses Framer's native transition library, Framer motion, so you won't miss anything.\"},{question:\"Thank you for using Eleveight Supply!\",answer:\"Enjoy your new components, keep saving precious time and continue creating amazing stuff\"}],questionStyles:{questionFont:{family:\"Inter\",size:16,weight:400,letterSpacing:\"normal\",lineHeight:\"normal\"},questionColor:\"#ffffff\",questionAnswerSpacing:10},answerStyles:{answerFont:{family:\"Inter\",size:16,weight:400,letterSpacing:\"normal\",lineHeight:\"normal\"},answerColor:\"#ffffff\"},linkStyles:{linkColor:\"#007aff\",underline:true},faqStyles:{faqFill:\"#0d0d0d\",faqBorder:{color:\"#171717\",width:1,style:\"solid\"},containerSpacing:8,faqBorderRadiusTopLeft:10,faqBorderRadiusTopRight:10,faqBorderRadiusBottomRight:10,faqBorderRadiusBottomLeft:10,faqPaddingTop:16,faqPaddingRight:16,faqPaddingBottom:16,faqPaddingLeft:16,chevronSize:12},transition:{type:\"spring\",stiffness:400,damping:50}};addPropertyControls(FAQ,{items:{type:ControlType.Array,defaultValue:[{question:\"How do I set it up, is it easy?\",answer:\"It's pretty simple, just go to the property controls, start adding your questions, then play around with the font styling.\"},{question:\"Oh it also uses Framer's native transitions?\",answer:\"Yes, this uses Framer's native transition library, Framer motion, so you won't miss anything.\"},{question:\"Thank you for using Eleveight Supply!\",answer:\"Enjoy your new components, keep saving precious time and continue creating amazing stuff\"}],propertyControl:{type:ControlType.Object,controls:{question:{type:ControlType.String,title:\"Question\"},answer:{type:ControlType.String,title:\"Answer\",control:ControlType.StringArea,defaultValue:\"\",description:\"For links use: <a href='yourlink'>text</a>\"}}},title:\"FAQ Items\"},questionStyles:{type:ControlType.Object,title:\"[Q] Font\",controls:{questionFont:{type:ControlType.Font,title:\"Font\",defaultValue:\"Inter\",controls:\"extended\"},questionColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000\"},questionAnswerSpacing:{type:ControlType.Number,title:\"Gap\",defaultValue:10,displayStepper:true,unit:\"px\",description:\"Gap between the Question and answer\"}}},answerStyles:{type:ControlType.Object,title:\"[A] Font\",controls:{answerFont:{type:ControlType.Font,title:\"Font\",defaultValue:\"Inter\",controls:\"extended\"},answerColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000\"}}},linkStyles:{type:ControlType.Object,title:\"[Link] Style\",controls:{linkColor:{type:ControlType.Color,title:\"Link Color\",defaultValue:\"#007aff\"},underline:{type:ControlType.Boolean,title:\"Underline\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"}}},faqStyles:{type:ControlType.Object,title:\"Styles\",controls:{faqFill:{type:ControlType.Color,title:\"Fill\",defaultValue:\"#fff\"},faqBorder:{type:ControlType.Object,title:\"Border\",controls:{color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#171717\"},width:{type:ControlType.Number,title:\"Width\",min:0,max:10,defaultValue:1,unit:\"px\"},style:{type:ControlType.Enum,title:\"Style\",options:[\"solid\",\"dashed\",\"dotted\"],optionTitles:[\"Solid\",\"Dashed\",\"Dotted\"],defaultValue:\"solid\"}}},containerSpacing:{type:ControlType.Number,title:\"Rows Gap\",defaultValue:16,unit:\"px\"},faqBorderRadius:{type:ControlType.FusedNumber,title:\"Radius\",defaultValue:10,toggleKey:\"uniformBorderRadius\",toggleTitles:[\"All\",\"Individual\"],valueKeys:[\"faqBorderRadiusTopLeft\",\"faqBorderRadiusTopRight\",\"faqBorderRadiusBottomRight\",\"faqBorderRadiusBottomLeft\"],valueLabels:[\"TL\",\"TR\",\"BR\",\"BL\"],min:0},faqPadding:{type:ControlType.FusedNumber,title:\"Padding\",defaultValue:16,toggleKey:\"uniformPadding\",toggleTitles:[\"All\",\"Individual\"],valueKeys:[\"faqPaddingTop\",\"faqPaddingRight\",\"faqPaddingBottom\",\"faqPaddingLeft\"],valueLabels:[\"T\",\"R\",\"B\",\"L\"],min:0},chevronSize:{type:ControlType.Number,title:\"Chevron Size\",defaultValue:12,unit:\"px\",min:1,max:30,displayStepper:true}}},transition:{type:ControlType.Transition,title:\"Transition\",defaultValue:{type:\"spring\",stiffness:400,damping:50}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FAQ\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"100%\",\"framerDisableUnlink\":\"*\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"300\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"300\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FAQ.map"],"mappings":"yOASG,SAAwB,EAAI,EAAM,CAAC,GAAK,CAAC,MAAM,EAAY,iBAAe,eAAa,YAAU,aAAW,cAAY,EACrH,EAAM,GAAa,EAAY,OAAO,EAAE,EAAY,EAAI,aAAa,MAAW,CAAC,EAAU,GAAcA,EAAS,KAAK,CAAO,EAAO,GAAO,CAAC,EAAa,IAAY,EAAM,KAAK,EAAM,EAAG,OAAoB,EAAK,MAAM,CAAC,SAAS,EAAM,KAAK,EAAK,IAAqB,EAAK,EAAQ,CAAC,SAAS,EAAK,SAAS,OAAO,EAAK,OAAO,OAAO,IAAY,EAAM,WAAW,EAAO,EAAM,CAAgB,iBAA4B,eAAwB,aAAW,WAAW,IAAQ,EAAM,OAAO,EAAY,YAAqB,aAAW,CAAC,EAAM,CAAC,CAAC,CAAC,oBAVne,IAAoD,IAAkD,IAA4B,CAUyW,GAAS,CAAC,WAAS,SAAO,SAAO,SAAO,iBAAe,eAAa,aAAW,aAAW,YAAU,gBAAc,CAAC,IAAM,EAAe,CAAC,QAAQ,GAAG,EAAU,cAAc,KAAK,EAAU,gBAAgB,KAAK,EAAU,iBAAiB,KAAK,EAAU,eAAe,IAAI,gBAAgB,EAAU,QAAQ,oBAAoB,GAAG,EAAU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