{"version":3,"file":"Text_highlight.CArfXbRV.mjs","names":[],"sources":["https:/framerusercontent.com/modules/aPd3fxKcZdTaQn4OHlip/NKXHbAGpi842y2Py1Rli/Text_highlight.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";export default function TextHighlight(props){const{text,highlightPhrase,highlightColor=\"rgba(255, 255, 0, 0.5)\",fontFamily=\"Inter\",fontSize=16,fontWeight=400,fontColor=\"#000000\",lineHeight=1.5}=props;// Set up container styles for the main text block\nconst containerStyle={fontFamily,fontSize:`${fontSize}px`,fontWeight,color:fontColor,lineHeight};if(!text||!highlightPhrase){return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:text});}const parts=text.split(highlightPhrase);if(parts.length===1){return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:text});}// Define base text style for regular text\nconst textStyle=`font-family: ${fontFamily}; font-size: ${fontSize}px; font-weight: ${fontWeight}; color: ${fontColor};`;// Define style for highlighted text, using #0F101A as the text color\nconst highlightStyle=`font-family: ${fontFamily}; font-size: ${fontSize}px; font-weight: ${fontWeight}; color: #0F101A; background-color: ${highlightColor};`;// Map through text parts and apply appropriate styling\nconst result=parts.map((part,index)=>index===parts.length-1?`<span style=\"${textStyle}\">${part}</span>`:`<span style=\"${textStyle}\">${part}<span style=\"${highlightStyle}\">${highlightPhrase}</span></span>`).join(\"\");return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,dangerouslySetInnerHTML:{__html:result}});}addPropertyControls(TextHighlight,{text:{type:ControlType.String,title:\"Text Content\",defaultValue:\"Sample text to highlight\"},highlightPhrase:{type:ControlType.String,title:\"Highlight Text\",defaultValue:\"text\"},highlightColor:{type:ControlType.Color,title:\"Highlight Color\",defaultValue:\"rgba(255, 255, 0, 0.5)\"},fontFamily:{type:ControlType.Enum,title:\"Font\",options:[\"Inter\",\"Helvetica\",\"Arial\",\"Arial Black\",\"Avenir\",\"Avenir Next\",\"Comic Sans MS\",\"Courier\",\"Courier New\",\"Georgia\",\"Impact\",\"Lucida Grande\",\"Monaco\",\"Palatino\",\"Tahoma\",\"Times\",\"Times New Roman\",\"Trebuchet MS\",\"Verdana\"],defaultValue:\"Inter\"},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:16,min:8,max:144,unit:\"px\"},fontWeight:{type:ControlType.Number,title:\"Font Weight\",defaultValue:400,min:100,max:900,step:100,displayStepper:true},fontColor:{type:ControlType.Color,title:\"Font Color\",defaultValue:\"#000000\"},lineHeight:{type:ControlType.Number,title:\"Line Height\",defaultValue:1.5,min:.5,max:3,step:.1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TextHighlight\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Text_highlight.map"],"mappings":"4JAA+F,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,OAAK,kBAAgB,iBAAe,yBAAyB,aAAW,QAAQ,WAAS,GAAG,aAAW,IAAI,YAAU,UAAU,aAAW,KAAK,EAC3R,EAAe,CAAC,aAAW,SAAS,GAAG,EAAS,IAAI,aAAW,MAAM,EAAU,aAAW,CAAC,GAAG,CAAC,GAAM,CAAC,EAAiB,OAAoB,EAAK,MAAM,CAAC,MAAM,EAAe,SAAS,EAAK,CAAC,CAAE,IAAM,EAAM,EAAK,MAAM,EAAgB,CAAC,GAAG,EAAM,SAAS,EAAG,OAAoB,EAAK,MAAM,CAAC,MAAM,EAAe,SAAS,EAAK,CAAC,CACpU,IAAM,EAAU,gBAAgB,EAAW,eAAe,EAAS,mBAAmB,EAAW,WAAW,EAAU,GAChH,EAAe,gBAAgB,EAAW,eAAe,EAAS,mBAAmB,EAAW,sCAAsC,EAAe,GAC4D,OAAoB,EAAK,MAAM,CAAC,MAAM,EAAe,wBAAwB,CAAC,OAAxR,EAAM,KAAK,EAAK,IAAQ,IAAQ,EAAM,OAAO,E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