{"version":3,"file":"FAQList.CSykIThe.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/gKv1lD3ncALK8S8XPp2g/g0ShO6o53WOx7LJmfLRb/FAQList.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";export default function FAQList(props){const{items,allowMultipleOpen,defaultOpenIndex,questionColor,answerColor,dividerColor,accentColor,fontFamily,questionSize,answerSize,gap,padding}=props;// Track open state as a Set so either single- or multi-open mode works\n// with the same logic.\nconst[openIndices,setOpenIndices]=useState(()=>{const initial=new Set;if(defaultOpenIndex>=0&&defaultOpenIndex<items.length){initial.add(defaultOpenIndex);}return initial;});function toggle(index){setOpenIndices(prev=>{const next=new Set(prev);if(next.has(index)){next.delete(index);}else{if(!allowMultipleOpen)next.clear();next.add(index);}return next;});}if(!items||items.length===0){return /*#__PURE__*/_jsx(\"div\",{style:{fontFamily,color:answerColor,padding,fontSize:answerSize},children:'No FAQ items yet — add some in the \"Items\" property.'});}return /*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",flexDirection:\"column\",width:\"100%\",gap,fontFamily},children:items.map((item,index)=>{const isOpen=openIndices.has(index);return /*#__PURE__*/_jsxs(\"div\",{style:{borderBottom:`1px solid ${dividerColor}`,paddingBottom:gap},children:[/*#__PURE__*/_jsxs(\"button\",{onClick:()=>toggle(index),\"aria-expanded\":isOpen,style:{display:\"flex\",alignItems:\"center\",justifyContent:\"space-between\",width:\"100%\",background:\"transparent\",border:\"none\",cursor:\"pointer\",padding:`${padding}px 0`,textAlign:\"left\",fontFamily:\"inherit\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{color:questionColor,fontSize:questionSize,fontWeight:600,marginRight:16},children:item.question}),/*#__PURE__*/_jsx(motion.span,{animate:{rotate:isOpen?45:0},transition:{duration:.2},style:{flexShrink:0,width:20,height:20,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",color:accentColor,fontSize:20,lineHeight:1},children:\"+\"})]}),/*#__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:{duration:.25,ease:\"easeInOut\"},style:{overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"div\",{style:{color:answerColor,fontSize:answerSize,paddingBottom:padding,lineHeight:1.5,whiteSpace:\"pre-line\"},children:item.answer})},\"content\")})]},index);})});}FAQList.defaultProps={items:[{question:\"What is Framer?\",answer:\"Framer is a design and publishing tool for building production websites.\"},{question:\"Can I add more questions?\",answer:\"Yes — use the Items list in the properties panel to add as many as you need.\"}],allowMultipleOpen:false,defaultOpenIndex:-1,questionColor:\"#111111\",answerColor:\"#555555\",dividerColor:\"#E0E0E0\",accentColor:\"#111111\",fontFamily:\"Inter, sans-serif\",questionSize:16,answerSize:14,gap:12,padding:8};addPropertyControls(FAQList,{items:{type:ControlType.Array,title:\"Items\",control:{type:ControlType.Object,controls:{question:{type:ControlType.String,title:\"Question\",defaultValue:\"Question\",displayTextArea:false},answer:{type:ControlType.String,title:\"Answer\",defaultValue:\"Answer\",displayTextArea:true}}}},allowMultipleOpen:{type:ControlType.Boolean,title:\"Multi-open\",defaultValue:false,enabledTitle:\"Allow multiple\",disabledTitle:\"Accordion (one at a time)\"},defaultOpenIndex:{type:ControlType.Number,title:\"Default Open\",defaultValue:-1,min:-1,step:1,displayStepper:true},questionColor:{type:ControlType.Color,title:\"Question Color\",defaultValue:\"#111111\"},answerColor:{type:ControlType.Color,title:\"Answer Color\",defaultValue:\"#555555\"},dividerColor:{type:ControlType.Color,title:\"Divider Color\",defaultValue:\"#E0E0E0\"},accentColor:{type:ControlType.Color,title:\"Accent Color\",defaultValue:\"#111111\"},fontFamily:{type:ControlType.String,title:\"Font Family\",defaultValue:\"Inter, sans-serif\"},questionSize:{type:ControlType.Number,title:\"Question Size\",defaultValue:16,min:8,max:64},answerSize:{type:ControlType.Number,title:\"Answer Size\",defaultValue:14,min:8,max:64},gap:{type:ControlType.Number,title:\"Item Gap\",defaultValue:12,min:0,max:64},padding:{type:ControlType.Number,title:\"Padding\",defaultValue:8,min:0,max:64}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FAQList\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FAQList.map"],"mappings":"yOAA2L,SAAwB,EAAQ,EAAM,CAAC,GAAK,CAAC,QAAM,oBAAkB,mBAAiB,gBAAc,cAAY,eAAa,cAAY,aAAW,eAAa,aAAW,MAAI,WAAS,EAE/W,CAAC,EAAY,GAAgBA,MAAa,CAAC,IAAM,EAAQ,IAAI,IAA0F,OAAnF,GAAkB,GAAG,EAAiB,EAAM,QAAQ,EAAQ,IAAI,CAAgB,EAAU,CAAQ,CAAC,EAAE,SAAS,EAAO,EAAM,CAAC,EAAe,GAAM,CAAC,IAAM,EAAK,IAAI,IAAI,CAAI,EAAmG,OAA9F,EAAK,IAAI,CAAK,EAAG,EAAK,OAAO,CAAK,GAAY,GAAkB,EAAK,MAAM,EAAE,EAAK,IAAI,CAAK,GAAU,CAAK,CAAC,CAAE,CAAkM,MAA9L,CAAC,GAAO,EAAM,SAAS,EAAuB,EAAK,MAAM,CAAC,MAAM,CAAC,aAAW,MAAM,EAAY,UAAQ,SAAS,CAAU,EAAE,SAAS,sDAAsD,CAAC,EAAuB,EAAK,MAAM,CAAC,MAAM,CAAC,QAAQ,OAAO,cAAc,SAAS,MAAM,OAAO,MAAI,YAAU,EAAE,SAAS,EAAM,KAAK,EAAK,IAAQ,CAAC,IAAM,EAAO,EAAY,IAAI,CAAK,EAAE,OAAoB,EAAM,MAAM,CAAC,MAAM,CAAC,aAAa,aAAa,IAAe,cAAc,CAAG,EAAE,SAAS,CAAc,EAAM,SAAS,CAAC,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