{"version":3,"file":"TextHighlighter.TeV1TTxz.mjs","names":["__esmMin","c","init_jsx_runtime","addPropertyControls","init_framer_DcGZRLrs","ControlType","TextHighlighter","props","highlights","highlight","s","b","a","escapeRegExp","string","regex","renderText","text","h","part","highlightBg","highlightColor","i","style","font","textColor","init_TextHighlighter"],"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":"A,4JAMG,SAASM,EAAgB,EAAM,CAAC,GAAK,CAAC,OAAK,YAAU,iBAAe,cAAY,OAAK,QAAM,aAAWC,EACnGC,EAAWC,EAAU,MAAM,OAAO,CAAC,CAAC,IAAI,GAAGC,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,EAAE,IAAIC,EAAE,OAAOC,EAAE,MAAM,EAExG,SAASC,EAAa,EAAO,CAAC,OAAOC,EAAO,QAAQ,sBAAsB,MAAM,CAAE,CAClF,IAAMC,EAA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