{"version":3,"file":"HighlightText.Dmdv9a74.mjs","names":["useMemo","_Fragment"],"sources":["https:/framerusercontent.com/modules/aLDu84rTFWmBd2z60Nxw/R6eDmlQGBua5T70jqLcn/HighlightText.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function HighlightText(props){const{text,highlight,highlightType,highlightColor,gradientStart,gradientEnd,gradientType,gradientAngle,textColor,font,style}=props;const renderedContent=useMemo(()=>{if(!text)return null;if(!highlight||highlightType===\"none\")return text;// Case-insensitive search\nconst lowerText=text.toLowerCase();const lowerHighlight=highlight.toLowerCase();const index=lowerText.indexOf(lowerHighlight);// If highlight not found, return the original text\nif(index===-1)return text;const before=text.substring(0,index);const matched=text.substring(index,index+highlight.length);const after=text.substring(index+highlight.length);let highlightStyle={};if(highlightType===\"color\"){highlightStyle={color:highlightColor};}else if(highlightType===\"gradient\"){const gradientDirection=gradientType===\"linear\"?`linear-gradient(${gradientAngle}deg, ${gradientStart}, ${gradientEnd})`:`radial-gradient(circle, ${gradientStart}, ${gradientEnd})`;highlightStyle={background:gradientDirection,WebkitBackgroundClip:\"text\",WebkitTextFillColor:\"transparent\",backgroundClip:\"text\",display:\"inline\"};}return /*#__PURE__*/_jsxs(_Fragment,{children:[before,/*#__PURE__*/_jsx(\"span\",{style:highlightStyle,children:matched}),after]});},[text,highlight,highlightType,highlightColor,gradientStart,gradientEnd,gradientType,gradientAngle]);return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",color:textColor,width:\"100%\",...font,...style},children:renderedContent});}addPropertyControls(HighlightText,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"This is an example sentence with a gradient\",displayTextArea:true},highlight:{type:ControlType.String,title:\"Highlight\",defaultValue:\"example sentence\"},highlightType:{type:ControlType.Enum,title:\"Highlight Type\",options:[\"none\",\"color\",\"gradient\"],optionTitles:[\"None\",\"Color\",\"Gradient\"],defaultValue:\"gradient\"},highlightColor:{type:ControlType.Color,title:\"Highlight Color\",defaultValue:\"#FF5588\",hidden:({highlightType})=>highlightType!==\"color\"},gradientStart:{type:ControlType.Color,title:\"Gradient Start\",defaultValue:\"#0099FF\",hidden:({highlightType})=>highlightType!==\"gradient\"},gradientEnd:{type:ControlType.Color,title:\"Gradient End\",defaultValue:\"#8855FF\",hidden:({highlightType})=>highlightType!==\"gradient\"},gradientType:{type:ControlType.Enum,title:\"Gradient Type\",options:[\"linear\",\"radial\"],optionTitles:[\"Linear\",\"Radial\"],defaultValue:\"linear\",hidden:({highlightType})=>highlightType!==\"gradient\"},gradientAngle:{type:ControlType.Number,title:\"Gradient Angle\",defaultValue:120,min:0,max:360,step:1,unit:\"\\xb0\",hidden:({highlightType,gradientType})=>highlightType!==\"gradient\"||gradientType!==\"linear\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"16px\",lineHeight:\"1.5em\",letterSpacing:\"-0.01em\",textAlign:\"left\",variant:\"Regular\"},controls:\"extended\",defaultFontType:\"sans-serif\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HighlightText\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HighlightText.map"],"mappings":"yLAGG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,OAAK,YAAU,gBAAc,iBAAe,gBAAc,cAAY,eAAa,gBAAc,YAAU,OAAK,SAAO,EAAY,EAAgBA,MAAY,CAAC,GAAG,CAAC,EAAK,OAAO,KAAK,GAAG,CAAC,GAAW,IAAgB,OAAO,OAAO,EACxR,IAAM,EAAU,EAAK,aA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