{"version":3,"file":"GradientText.DMBRMpSA.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/064jA9ah8CH3wDoklNHZ/qBket1U4baEqjXCMwIq2/GradientText.js"],"sourcesContent":["// Heading with gradient on selected words\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";/**\n * Heading with gradient on selected words\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function GradientText(props){const{text,gradientWords,gradientFrom,gradientTo,font,color,style}=props;// Extract font styles without color\nconst{color:fontColor,...fontStyles}=font||{};// Split text and wrap gradient words\nconst content=useMemo(()=>{if(!gradientWords)return text;const words=gradientWords.split(\",\").map(w=>w.trim()).filter(Boolean);if(words.length===0)return text;// Regex to match any of the gradient words (whole word match)\nconst regex=new RegExp(`\\\\b(${words.map(w=>w.replace(/[.*+?^${}()|[\\\\]\\\\\\\\]/g,\"\\\\$&\")).join(\"|\")})\\\\b`,\"gi\");const parts=[];let lastIndex=0;let match;let key=0;while((match=regex.exec(text))!==null){if(match.index>lastIndex){parts.push(text.slice(lastIndex,match.index));}parts.push(/*#__PURE__*/_jsx(\"span\",{style:{background:`linear-gradient(90deg, ${gradientFrom}, ${gradientTo})`,WebkitBackgroundClip:\"text\",WebkitTextFillColor:\"transparent\"},children:match[0]},key++));lastIndex=match.index+match[0].length;}if(lastIndex<text.length){parts.push(text.slice(lastIndex));}return parts;},[text,gradientWords,gradientFrom,gradientTo,font]);return /*#__PURE__*/_jsx(\"span\",{style:{display:\"inline-block\",...fontStyles,color,...style},children:content});}addPropertyControls(GradientText,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"This is a Gradient Heading\"},gradientWords:{type:ControlType.String,title:\"Gradient Words\",placeholder:\"word1, word2\",defaultValue:\"Gradient\"},gradientFrom:{type:ControlType.Color,title:\"Gradient From\",defaultValue:\"#0099FF\"},gradientTo:{type:ControlType.Color,title:\"Gradient To\",defaultValue:\"#8855FF\"},color:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"40px\",variant:\"Bold\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GradientText\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GradientText.map"],"mappings":"kQAMG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,OAAK,gBAAc,eAAa,aAAW,OAAK,QAAM,SAAO,EAC7G,CAAC,MAAM,EAAU,GAAG,GAAY,GAAM,EAAE,CACvC,EAAQA,MAAY,CAAC,GAAG,CAAC,EAAc,OAAO,EAAK,IAAM,EAAM,EAAc,MAAM,IAAI,CAAC,IAAI,GAAG,EAAE,MAAM,CAAC,CAAC,OAAO,QAAQ,CAAC,GAAG,EAAM,SAAS,EAAE,OAAO,EAC1J,IAAM,EAAU,OAAO,OAAO,EAAM,IAAI,GAAG,EAAE,QAAQ,yBAAyB,OAAO,CAAC,CAAC,KAAK,IAAI,CAAC,MAAM,KAAK,CAAO,EAAM,EAAE,CAAK,EAAU,EAAM,EAAU,EAAI,EAAE,MAAO,EAAM,EAAM,KAAK,EAAK,IAAI,MAAS,EAAM,MAAM,GAAW,EAAM,KAAK,EAAK,MAAM,EAAU,EAAM,MAAM,CAAC,CAAE,EAAM,KAAkB,EAAK,OAAO,CAAC,MAAM,CAAC,WAAW,0BAA0B,EAAa,IAAI,EAAW,GAAG,qBAAqB,OAAO,oBAAoB,cAAc,CAAC,SAAS,EAAM,GAAG,CAAC,IAAM,CAAC,CAAC,EAAU,EAAM,MAAM,EAAM,GAAG,OAAqE,OAA1D,EAAU,EAAK,QAAQ,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