{"version":3,"file":"FAQAccordion.DBZ9727f.mjs","names":["useState","isMobile"],"sources":["https:/framerusercontent.com/modules/gswLZ1sIgG7vDh7HN8sF/27XTKkfhmQ3ZUAgxZ3Dw/FAQAccordion.js"],"sourcesContent":["// FAQAccordion component with expandable questions and answers\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 FAQAccordion(props){const{items,questionFont,answerFont,questionColor,answerColor,backgroundColor,iconColor,padding,spacing,viewMode}=props;const[expandedItems,setExpandedItems]=useState(new Set([0]));const toggleItem=index=>{startTransition(()=>{setExpandedItems(prev=>{const newSet=new Set(prev);if(newSet.has(index)){newSet.delete(index);}else{newSet.add(index);}return newSet;});});};const isFixedWidth=props?.style&&props.style.width===\"100%\";const isMobile=viewMode===\"mobile\";// Function to get responsive font sizes\nconst getResponsiveFont=(baseFont,isBody=false,isMobile=false)=>{if(!baseFont)return{};const fontSize=baseFont.fontSize||\"16px\";const numericSize=parseFloat(fontSize);const unit=fontSize.replace(/[\\d.]/g,\"\");const mobileSize=isMobile?isBody?15:20:numericSize;return{...baseFont,fontSize:`${mobileSize}${unit}`};};return /*#__PURE__*/_jsx(\"div\",{style:{...props.style,position:\"relative\",...isFixedWidth?{...props?.style}:{minWidth:\"max-content\"},display:\"flex\",flexDirection:\"column\",gap:spacing},children:items.map((item,index)=>{const isExpanded=expandedItems.has(index);return /*#__PURE__*/_jsxs(\"div\",{style:{overflow:\"hidden\",cursor:\"pointer\"},onClick:()=>toggleItem(index),role:\"button\",tabIndex:0,\"aria-expanded\":isExpanded,onKeyDown:e=>{if(e.key===\"Enter\"||e.key===\" \"){e.preventDefault();toggleItem(index);}},children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"space-between\",padding,gap:16},children:[/*#__PURE__*/_jsx(\"span\",{style:{flex:1,color:questionColor,...getResponsiveFont(questionFont,false,isMobile)},children:item.question}),/*#__PURE__*/_jsx(\"span\",{style:{color:iconColor,fontSize:isMobile?\"16px\":\"20px\",fontWeight:\"bold\",lineHeight:1,transition:\"transform 0.2s ease\"},\"aria-hidden\":\"true\",children:isExpanded?\"–\":\"+\"})]}),isExpanded&&/*#__PURE__*/_jsx(\"div\",{style:{padding:`0 ${padding}px ${padding}px ${padding}px`,color:answerColor,...getResponsiveFont(answerFont,true,isMobile)},children:item.answer}),/*#__PURE__*/_jsx(\"hr\",{style:{color:iconColor,borderTop:\"3px solid\",margin:\"20px 0 0 0\"}})]},index);})});}addPropertyControls(FAQAccordion,{items:{type:ControlType.Array,title:\"FAQAccordion 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 the answer to your question.\",displayTextArea:true}}},defaultValue:[{question:\"What is this component?\",answer:\"This is a FAQAccordion component that allows you to display frequently asked questions with expandable answers.\"},{question:\"How do I add more questions?\",answer:\"You can add more questions by using the array control in the property panel.\"},{question:\"Can I customize the styling?\",answer:\"Yes, you can customize colors, fonts, spacing, and other visual properties through the property controls.\"}]},viewMode:{type:ControlType.Enum,title:\"View Mode\",options:[\"desktop\",\"mobile\"],optionTitles:[\"Desktop\",\"Mobile\"],defaultValue:\"desktop\",displaySegmentedControl:true},questionFont:{type:ControlType.Font,title:\"Question Font\",defaultValue:{fontSize:\"16px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},answerFont:{type:ControlType.Font,title:\"Answer Font\",defaultValue:{fontSize:\"14px\",variant:\"Regular\",letterSpacing:\"-0.01em\",lineHeight:\"1.4em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},questionColor:{type:ControlType.Color,title:\"Question Color\",defaultValue:\"#000000\"},answerColor:{type:ControlType.Color,title:\"Answer Color\",defaultValue:\"#666666\"},backgroundColor:{type:ControlType.Color,title:\"Background Color\",defaultValue:\"transparent\"},iconColor:{type:ControlType.Color,title:\"Icon Color\",defaultValue:\"#000000\"},padding:{type:ControlType.Number,title:\"Padding\",defaultValue:20,min:8,max:40,unit:\"px\"},spacing:{type:ControlType.Number,title:\"Item Spacing\",defaultValue:12,min:0,max:32,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FAQAccordion\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FAQAccordion.map"],"mappings":"wLAIG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,QAAM,eAAa,aAAW,gBAAc,cAAY,kBAAgB,YAAU,UAAQ,UAAQ,YAAU,EAAW,CAAC,EAAc,GAAkBA,EAAS,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC,CAAO,EAAW,GAAO,CAAC,MAAoB,CAAC,EAAiB,GAAM,CAAC,IAAM,EAAO,IAAI,IAAI,EAAK,CAAqE,OAAjE,EAAO,IAAI,EAAM,CAAE,EAAO,OAAO,EAAM,CAAO,EAAO,IAAI,EAAM,CAAS,GAAS,EAAG,EAAS,EAAa,GAAO,OAAO,EAAM,MAAM,QAAQ,OAAa,EAAS,IAAW,SAC/e,GAAmB,EAAS,EAAO,GAAM,EAAS,KAAQ,CAAC,GAAG,CAAC,EAAS,MAAM,EAAE,CAAC,IAAM,EAAS,EAAS,UAAU,OAAa,EAAY,WAAW,EAAS,CAAO,EAAK,EAAS,QAAQ,SAAS,GAAG,CAAO,EAAWC,EAAS,EAAO,GAAG,GAAG,EAAY,MAAM,CAAC,GAAG,EAAS,SAAS,GAAG,IAAa,IAAO,EAAG,OAAoB,EAAK,MAAM,CAAC,MAAM,CAAC,G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