{"version":3,"file":"TextHighlighter.BaedInKj.mjs","names":[],"sources":["https:/framerusercontent.com/modules/7AY4RRX6kkbiAbnvtzlK/tzYPUx4iAHBDgps3JmgH/TextHighlighter.js"],"sourcesContent":["// Two text fields: one for default text, one for highlight text. Highlighted words in the default text are wrapped in a styled span.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * TextHighlighter\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */function TextHighlighter(props){const{text,highlight,highlightColor,highlightBg,font,style,textColor}=props;// Split highlight by comma or space, trim, remove empty\nconst highlights=highlight.split(/[,\\n]/).map(s=>s.trim()).filter(Boolean).sort((a,b)=>b.length-a.length)// longest first to avoid partial matches\n;// Escape regex special chars\nfunction escapeRegExp(string){return string.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\");}// Build regex for all highlights\nconst regex=highlights.length?new RegExp(`(${highlights.map(escapeRegExp).join(\"|\")})`,\"gi\"):null;// Split and wrap\nfunction renderText(){if(!regex)return text;const parts=text.split(regex);return parts.map((part,i)=>{if(highlights.some(h=>h&&part&&part.toLowerCase()===h.toLowerCase())){return /*#__PURE__*/_jsx(\"span\",{style:{background:highlightBg,color:highlightColor,padding:\"0 2px\",fontWeight:\"inherit\"},children:part},i);}return part;});}return /*#__PURE__*/_jsx(\"div\",{style:{...style,...font,width:props.width===\"fixed\"?400:props.width===\"relative\"?\"80%\":props.width===\"fill\"?\"100%\":props.width===\"fit-content\"?\"fit-content\":undefined,minWidth:0,wordBreak:\"break-word\",whiteSpace:\"pre-wrap\",display:\"block\",boxSizing:\"border-box\",padding:0,color:textColor},children:renderText()});}addPropertyControls(TextHighlighter,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"I’m a UI/UX Designer and Front-End Developer with a passion for crafting visually appealing and highly functional digital experiences. With a strong foundation in design principles and an eye for detail, I create intuitive interfaces that are both user-friendly and conversion-focused.\",displayTextArea:true},highlight:{type:ControlType.String,title:\"Highlight\",defaultValue:\"\",placeholder:\"Comma or line separated\",displayTextArea:true},highlightColor:{type:ControlType.Color,title:\"Highlight Color\",defaultValue:\"#111\"},highlightBg:{type:ControlType.Color,title:\"Highlight BG\",defaultValue:\"#FFEB3B\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"monospace\",defaultValue:{fontSize:\"18px\",variant:\"Regular\",letterSpacing:\"0em\",lineHeight:\"1.2em\"}},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},width:{type:ControlType.Enum,title:\"Width\",defaultValue:\"fit\",options:[\"fit\",\"fixed\",\"relative\",\"fill\",\"fit-content\"],optionTitles:[\"Fit\",\"Fixed\",\"Relative\",\"Fill\",\"Fit Content\"],displaySegmentedControl:false}});export default TextHighlighter;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TextHighlighter\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TextHighlighter.map"],"mappings":"4JAMG,SAAS,EAAgB,EAAM,CAAC,GAAK,CAAC,OAAK,YAAU,iBAAe,cAAY,OAAK,QAAM,aAAW,EACnG,EAAW,EAAU,MAAM,QAAQ,CAAC,IAAI,GAAG,EAAE,MAAM,CAAC,CAAC,OAAO,QAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,CAEzG,SAAS,EAAa,EAAO,CAAC,OAAO,EAAO,QAAQ,sBAAsB,OAAO,CACjF,IAAM,EAAM,EAAW,OAAW,OAAO,IAAI,EAAW,IAAI,EAAa,CAAC,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,KAC7F,SAAS,GAAY,CAAqD,OAAhD,EAA8B,EAAK,MAAM,EAAM,CAAc,KAAK,EAAK,IAAQ,EAAW,KAAK,G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