{"version":3,"file":"TextHighlighter.o7FR2fLz.mjs","names":[],"sources":["https:/framerusercontent.com/modules/3SbtycDMg6xREq9sE51K/rWJlhYk2lmFgzgf74kpI/TextHighlighter.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";function parseTextWithHighlight(text,highlightColor,textStyle){const parts=[];const regex=/<u>(.*?)<\\/u>/g;let lastIndex=0;let match;let id=0;while((match=regex.exec(text))!==null){if(match.index>lastIndex){parts.push(/*#__PURE__*/_jsx(\"span\",{style:textStyle,children:text.slice(lastIndex,match.index)},`plain-${id}`));}parts.push(/*#__PURE__*/_jsx(\"span\",{style:{...textStyle,backgroundColor:highlightColor,borderRadius:2,padding:\"0 2px\"},children:match[1]},`highlight-${id}`));lastIndex=regex.lastIndex;id++;}if(lastIndex<text.length){parts.push(/*#__PURE__*/_jsx(\"span\",{style:textStyle,children:text.slice(lastIndex)},`end-${id}`));}return parts;}export function HighlightedText(props){const{text,highlightColor,fontFamily,fontSize,fontWeight,lineHeight,textAlign,textColor}=props;const textStyle={fontFamily,fontSize,fontWeight,lineHeight,textAlign,color:textColor,display:\"inline\",whiteSpace:\"pre-wrap\"};return /*#__PURE__*/_jsx(\"div\",{style:{lineHeight,textAlign},children:parseTextWithHighlight(text,highlightColor,textStyle)});}addPropertyControls(HighlightedText,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"This is <u>highlighted</u> text and <u>another</u> one.\"},highlightColor:{type:ControlType.Color,title:\"Highlight\",defaultValue:\"#FFEB3B\"},fontFamily:{type:ControlType.String,title:\"Font\",defaultValue:\"Inter\"},fontSize:{type:ControlType.Number,title:\"Size\",defaultValue:16,min:8,max:100,unit:\"px\"},fontWeight:{type:ControlType.Enum,title:\"Weight\",options:[\"100\",\"200\",\"300\",\"400\",\"500\",\"600\",\"700\",\"800\",\"900\"],optionTitles:[\"Thin\",\"Extra Light\",\"Light\",\"Regular\",\"Medium\",\"Semi Bold\",\"Bold\",\"Extra Bold\",\"Black\"],defaultValue:\"400\"},lineHeight:{type:ControlType.Number,title:\"Line Height\",defaultValue:1.5,min:.5,max:3,step:.1},textAlign:{type:ControlType.Enum,title:\"Align\",options:[\"left\",\"center\",\"right\",\"justify\"],optionTitles:[\"Left\",\"Center\",\"Right\",\"Justify\"],defaultValue:\"left\"},textColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"HighlightedText\":{\"type\":\"reactComponent\",\"name\":\"HighlightedText\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TextHighlighter.map"],"mappings":"4JAA+F,SAAS,EAAuB,EAAK,EAAe,EAAU,CAAC,IAAM,EAAM,EAAE,CAAO,EAAM,iBAAqB,EAAU,EAAM,EAAU,EAAG,EAAE,MAAO,EAAM,EAAM,KAAK,EAAK,IAAI,MAAS,EAAM,MAAM,GAAW,EAAM,KAAkB,EAAK,OAAO,CAAC,MAAM,EAAU,SAAS,EAAK,MAAM,EAAU,EAAM,MAAM,CAAC,CAAC,SAAS,IAAK,CAAC,CAAE,EAAM,KAAkB,EAAK,OAAO,CAAC,MAAM,CAAC,GAAG,EAAU,gBAAgB,EAAe,aAAa,EAAE,QAAQ,QAAQ,CAAC,SAAS,EAAM,GAAG,CAAC,aAAa,IAAK,CAAC,CAAC,EAAU,EAAM,UAAU,IAAoI,OAA3H,EAAU,EAAK,QAAQ,EAAM,KAAkB,EAAK,OAAO,CAAC,MAAM,EAAU,SAAS,EAAK,MAAM,EAAU,CAAC,CAAC,OAAO,IAAK,CAAC,CAAS,EAAO,SAAgB,EAAgB,EAAM,CAAC,GAAK,CAAC,OAAK,iBAAe,aAAW,WAAS,aAAW,aAAW,YAAU,aAAW,EAAmI,OAAoB,EAAK,MAAM,CAAC,MAAM,CAAC,aAAW,YAAU,CAAC,SAAS,EAAuB,EAAK,EAA/M,CAAC,aAAW,W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