{"version":3,"file":"HighlightText.CuExkMOe.mjs","names":["useMemo","useMemo"],"sources":["https:/framerusercontent.com/modules/GM6FIRxx8wED18lUZUZa/FgizxC0VyVrvoP8QafcE/GradientHeadline_1.js","https:/framerusercontent.com/modules/bUOIzmoZe1eoNG7o48q4/5C4VgVYVo8VoNGf1sZHi/HighlightText.js"],"sourcesContent":["// Headline component with gradient highlight for selected words, tag selection, full font controls, and reusable text via prop\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useMemo,createElement}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const tagOptions=[\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"p\"];/**\n * Headline with Gradient Highlight\n *\n * - Select tag (h1-h6, p)\n * - Full font controls\n * - Highlight single/multiple words with gradient\n * - Text is reusable via prop\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function GradientHeadline(props){const{text,tag,highlightWords,gradientFrom,gradientTo,gradientAngle,font,style,textColor}=props;// Parse highlightWords (comma-separated or array)\nconst highlightList=useMemo(()=>{if(!highlightWords)return[];if(Array.isArray(highlightWords))return highlightWords;return highlightWords.split(\",\").map(w=>w.trim()).filter(Boolean);},[highlightWords]);// Split text into words, preserving spaces\nconst wordRegex=/\\S+|\\s+/g;const words=useMemo(()=>{if(!text)return[];return text.match(wordRegex)||[];},[text]);// Render with highlights\nconst renderWords=()=>{if(!highlightList.length)return words.map((word,i)=>/*#__PURE__*/_jsx(\"span\",{children:word},i));// Join all words into a string, find all highlight substrings, and split accordingly\nlet result=[];let str=text;let lastIndex=0;// Build a regex to match any of the highlight phrases (escape special chars)\nconst highlightRegex=new RegExp(highlightList.map(w=>w.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\")).join(\"|\"),\"gi\");let match;let idx=0;while((match=highlightRegex.exec(str))!==null){if(match.index>lastIndex){result.push(/*#__PURE__*/_jsx(\"span\",{children:str.slice(lastIndex,match.index)},idx++));}result.push(/*#__PURE__*/_jsx(\"span\",{style:{backgroundImage:`linear-gradient(${gradientAngle}deg, ${gradientFrom}, ${gradientTo})`,WebkitBackgroundClip:\"text\",WebkitTextFillColor:\"transparent\",backgroundClip:\"text\",color:undefined,fontWeight:font?.variant?.includes(\"Bold\")?\"bold\":undefined},children:match[0]},idx++));lastIndex=match.index+match[0].length;}if(lastIndex<str.length){result.push(/*#__PURE__*/_jsx(\"span\",{children:str.slice(lastIndex)},idx++));}return result;};const Tag=tagOptions.includes(tag)?tag:\"h1\";// Check if width is set to 100% (fill mode) or auto (fit content mode)\nconst isFixedWidth=style?.width===\"100%\";const elementStyle={...style,...font,margin:0,width:isFixedWidth?\"100%\":\"max-content\",minWidth:isFixedWidth?undefined:\"max-content\",display:isFixedWidth?\"block\":\"inline-block\",color:textColor};return /*#__PURE__*/createElement(Tag,{style:elementStyle},renderWords());}addPropertyControls(GradientHeadline,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"This is a gradient headline\",displayTextArea:true},tag:{type:ControlType.Enum,title:\"Tag\",options:tagOptions,optionTitles:tagOptions.map(t=>t.toUpperCase()),defaultValue:\"h1\"},highlightWords:{type:ControlType.String,title:\"Highlight Words\",placeholder:\"word1, word2\",defaultValue:\"gradient\",description:\"Comma-separated words to highlight\"},gradientFrom:{type:ControlType.Color,title:\"Gradient From\",defaultValue:\"#0099FF\"},gradientTo:{type:ControlType.Color,title:\"Gradient To\",defaultValue:\"#FF5588\"},gradientAngle:{type:ControlType.Number,title:\"Gradient Angle\",defaultValue:90,min:0,max:360,unit:\"deg\",step:1,displayStepper:true},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"40px\",variant:\"Bold\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"}},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GradientHeadline\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GradientHeadline_1.map","// Highlighting Text Component - Allows users to emphasize specific words or phrases within a sentence using customizable background highlights\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function HighlightText(props){const{text,highlightWords,highlightColor,textColor,highlightTextColor,font,padding,backgroundColor,borderRadius,highlightBorderRadius,enableAnimation,animationType,style}=props;const wordsToHighlight=useMemo(()=>{if(!highlightWords.trim())return[];return highlightWords.split(\",\").map(word=>word.trim().toLowerCase()).filter(word=>word.length>0);},[highlightWords]);const processedText=useMemo(()=>{if(wordsToHighlight.length===0){return[{text,isHighlighted:false}];}const parts=[];let currentIndex=0;while(currentIndex<text.length){let foundMatch=false;let earliestMatch={index:text.length,word:\"\",length:0};// Find the earliest match from current position\nfor(const word of wordsToHighlight){const index=text.toLowerCase().indexOf(word,currentIndex);if(index!==-1&&index<earliestMatch.index){earliestMatch={index,word:text.substring(index,index+word.length),length:word.length};foundMatch=true;}}if(foundMatch){// Add non-highlighted text before the match\nif(earliestMatch.index>currentIndex){parts.push({text:text.substring(currentIndex,earliestMatch.index),isHighlighted:false});}// Add highlighted text\nparts.push({text:earliestMatch.word,isHighlighted:true});currentIndex=earliestMatch.index+earliestMatch.length;}else{// No more matches, add remaining text\nparts.push({text:text.substring(currentIndex),isHighlighted:false});break;}}return parts;},[text,wordsToHighlight]);const animationVariants={fade:{initial:{opacity:0},animate:{opacity:1},transition:{duration:.5}},slide:{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.5}}};const selectedAnimation=animationVariants[animationType];return /*#__PURE__*/_jsx(\"div\",{style:{...style,position:\"relative\",width:\"100%\",padding,backgroundColor,borderRadius,boxSizing:\"border-box\",...font,color:textColor},children:/*#__PURE__*/_jsx(\"p\",{style:{margin:0,whiteSpace:\"pre-wrap\",wordBreak:\"break-word\",overflowWrap:\"break-word\",width:\"100%\"},children:processedText.map((part,index)=>{if(part.isHighlighted){if(enableAnimation){return /*#__PURE__*/_jsx(motion.span,{initial:selectedAnimation.initial,whileInView:selectedAnimation.animate,viewport:{once:true,amount:.5},transition:selectedAnimation.transition,style:{backgroundColor:highlightColor,color:highlightTextColor,borderRadius:highlightBorderRadius,padding:\"2px 4px\",display:\"inline\",boxDecorationBreak:\"clone\",WebkitBoxDecorationBreak:\"clone\"},children:part.text},index);}return /*#__PURE__*/_jsx(\"span\",{style:{backgroundColor:highlightColor,color:highlightTextColor,borderRadius:highlightBorderRadius,padding:\"2px 4px\",boxDecorationBreak:\"clone\",WebkitBoxDecorationBreak:\"clone\"},children:part.text},index);}return /*#__PURE__*/_jsx(\"span\",{children:part.text},index);})})});}addPropertyControls(HighlightText,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"The simplicity of this tool has given me real confidence in managing SEO for my clients, and it's an absolute steal vs other platforms on the market.\",displayTextArea:true},highlightWords:{type:ControlType.String,title:\"Highlight Words\",defaultValue:\"simplicity, real confidence, absolute steal\",placeholder:\"word1, word2, phrase\"},highlightColor:{type:ControlType.Color,title:\"Highlight Color\",defaultValue:\"#FFBB00\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},highlightTextColor:{type:ControlType.Color,title:\"Highlight Text Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.5em\"}},padding:{type:ControlType.Padding,title:\"Padding\",defaultValue:\"20px\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"rgba(255, 255, 255, 0)\"},borderRadius:{type:ControlType.Number,title:\"Container Radius\",defaultValue:0,min:0,max:100,step:1,unit:\"px\"},highlightBorderRadius:{type:ControlType.Number,title:\"Highlight Radius\",defaultValue:4,min:0,max:100,step:1,unit:\"px\"},enableAnimation:{type:ControlType.Boolean,title:\"Animation\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},animationType:{type:ControlType.Enum,title:\"Animation Type\",options:[\"fade\",\"slide\"],optionTitles:[\"Fade In\",\"Slide Up\"],defaultValue:\"fade\",displaySegmentedControl:true,hidden:({enableAnimation})=>!enableAnimation}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HighlightText\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HighlightText.map"],"mappings":"yVAWG,SAAwB,EAAiB,EAAM,CAAC,GAAK,CAAC,OAAK,MAAI,iBAAe,eAAa,aAAW,gBAAc,OAAK,QAAM,aAAW,EACvI,EAAcC,MAAiB,EAA2B,MAAM,QAAQ,EAAe,CAAQ,EAAsB,EAAe,MAAM,IAAI,CAAC,IAAI,GAAG,EAAE,MAAM,CAAC,CAAC,OAAO,QAAQ,CAA3H,EAAE,CAA4H,CAAC,EAAe,CAAC,CACnM,EAAU,WAAiB,EAAMA,MAAiB,GAAqB,EAAK,MAAM,EAAU,EAA/B,EAAE,CAAoC,CAAC,EAAK,CAAC,CAC1G,MAAgB,CAAC,GAAG,CAAC,EAAc,OAAO,OAAO,EAAM,KAAK,EAAK,IAAiB,EAAK,OAAO,CAAC,SAAS,EAAK,CAAC,EAAE,CAAC,CACvH,IAAI,EAAO,EAAE,CAAK,EAAI,EAAS,EAAU,EACnC,EAAe,IAAI,OAAO,EAAc,IAAI,GAAG,EAAE,QAAQ,sBAAsB,OAAO,CAAC,CAAC,KAAK,IAAI,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