{"version":3,"file":"MixedFontText.CUybSxPy.mjs","names":[],"sources":["https:/framerusercontent.com/modules/JwilHZma1SU7ROBEj3yZ/7LpAwNhALxvaVKkgWjmx/MixedFontText.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function MixedFontText(props){const containerStyle={height:\"100%\",fontFamily:props.fontFamily,fontSize:`${props.fontSize}px`,lineHeight:`${props.lineHeight}px`,color:props.color,display:\"-webkit-box\",overflow:\"visible\",WebkitBoxOrient:\"vertical\",textAlign:props.textAlign,textWrap:props.textBalance?\"balance\":\"initial\",fontWeight:400};const italicsStyle={fontFamily:props.highlightFontFamily,color:props.highlight,fontStyle:\"normal\"};// Function to replace asterisks with <em> tags\nconst parseText=text=>{const regex=/(\\*.*?\\*)/g;const parts=text.split(regex);return parts.map((part,index)=>{if(part.startsWith(\"*\")&&part.endsWith(\"*\")){const content=part.substring(1,part.length-1);return /*#__PURE__*/_jsx(\"em\",{style:italicsStyle,children:content},index);}return part;});};// Conditional rendering based on textElementType prop\nconst Element=props.textElementType===\"h1\"?\"h1\":\"p\";return /*#__PURE__*/_jsx(Element,{style:containerStyle,children:parseText(props.text)});}MixedFontText.defaultProps={text:\"This is my case study *summary* with *highlighted words*.\",fontFamily:\"'Haas Grot Disp R Web 55 Roman'\",highlightFontFamily:\"'Haas Grot Disp R Web 75 Bold'\",fontSize:20,lineHeight:24,color:\"black\",highlight:\"blue\",textElementType:\"p\"};addPropertyControls(MixedFontText,{text:{type:ControlType.String,title:\"Text\"},fontFamily:{type:ControlType.String,title:\"Font family\"},highlightFontFamily:{type:ControlType.String,title:\"Highlight font family\"},fontSize:{title:\"Font size\",type:ControlType.Number},lineHeight:{title:\"Line height\",type:ControlType.Number},color:{title:\"Color\",type:ControlType.Color},highlight:{title:\"Highlight color\",type:ControlType.Color},textAlign:{type:ControlType.Enum,defaultValue:\"left\",displaySegmentedControl:true,options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"]},textBalance:{type:ControlType.Boolean,defaultValue:false,title:\"Balance\",enabledTitle:\"Yes\",disabledTitle:\"No\"},textElementType:{type:ControlType.Enum,title:\"Element Type\",options:[\"h1\",\"p\"],optionTitles:[\"Heading 1 (h1)\",\"Paragraph (p)\"],defaultValue:\"p\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MixedFontText\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MixedFontText.map"],"mappings":"iOAMG,SAAwB,EAAc,EAAM,CAAC,IAAM,EAAe,CAAC,OAAO,OAAO,WAAW,EAAM,WAAW,SAAS,GAAG,EAAM,SAAS,IAAI,WAAW,GAAG,EAAM,WAAW,IAAI,MAAM,EAAM,MAAM,QAAQ,cAAc,SAAS,UAAU,gBAAgB,WAAW,UAAU,EAAM,UAAU,SAAS,EAAM,YAAY,UAAU,UAAU,WAAW,IAAI,CAAO,EAAa,CAAC,WAAW,EAAM,oBAAoB,MAAM,EAAM,UAAU,UAAU,SAAS,CAC7b,EAAU,GAA4C,EAAK,MAA9B,aAA0C,CAAc,KAAK,EAAK,IAAQ,CAAC,GAAG,EAAK,WAAW,IAAI,EAAE,EAAK,SAAS,IAAI,CAAC,CAAC,IAAM,EAAQ,EAAK,UAAU,EAAE,EAAK,OAAO,EAAE,CAAC,OAAoB,EAAK,KAAK,CAAC,MAAM,EAAa,SAAS,EAAQ,CAAC,EAAM,CAAE,OAAO,GAAO,CAC7R,EAAQ,EAAM,kBAAkB,KAAK,KAAK,IAAI,OAAoB,EAAK,EAAQ,CAAC,MAAM,EAAe,SAAS,E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