{"version":3,"file":"MultiColorText.Cfp2qWuz.mjs","names":[],"sources":["https:/framerusercontent.com/modules/cyfdmji0DDvXtm9FdcSz/LT68fXfXeoCiSl6DuE8J/MultiColorText.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 500\n * @framerIntrinsicHeight 50\n */export default function ColorText(props){const{segments,font,textAlign,wordGap,lineGap,tag,style}=props;const items=[];(segments||[]).forEach((segment,segIndex)=>{if(!segment?.text)return;const parts=segment.text.split(/(<br\\s*\\/?>)/gi);parts.forEach((part,partIndex)=>{if(/^<br\\s*\\/?>$/i.test(part)){items.push({type:\"break\",key:`${segIndex}-br-${partIndex}`});return;}const segmentWords=part.split(/\\s+/).filter(w=>w.length>0);segmentWords.forEach((word,wordIndex)=>{items.push({type:\"word\",text:word,color:segment.color||\"#000000\",key:`${segIndex}-${partIndex}-${wordIndex}`});});});});const justifyMap={left:\"flex-start\",center:\"center\",right:\"flex-end\"};const Tag=tag||\"h2\";return /*#__PURE__*/_jsx(Tag,{style:{display:\"flex\",flexWrap:\"wrap\",margin:0,marginBottom:`${-lineGap}px`,padding:0,width:\"100%\",justifyContent:justifyMap[textAlign]||\"flex-start\",columnGap:`${wordGap}px`,...style},children:items.map(item=>item.type===\"break\"?/*#__PURE__*/_jsx(\"span\",{style:{flexBasis:\"100%\",height:0},\"aria-hidden\":\"true\"},item.key):/*#__PURE__*/_jsx(\"span\",{style:{...font,color:item.color,display:\"inline-block\",whiteSpace:\"nowrap\",marginBottom:`${lineGap}px`},children:item.text},item.key))});}ColorText.defaultProps={segments:[{text:\"You will be\",color:\"#000000\"},{text:\"fit\",color:\"#8B5CF6\"},{text:\"in <br> 30 minutes\",color:\"#000000\"}],tag:\"h2\",textAlign:\"left\",wordGap:8,lineGap:4};addPropertyControls(ColorText,{tag:{type:ControlType.Enum,title:\"HTML Tag\",description:\"Sets the semantic HTML element for SEO. Use h1 for main titles, h2 for subtitles, p for body text.\",options:[\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"p\",\"span\"],optionTitles:[\"H1\",\"H2\",\"H3\",\"H4\",\"H5\",\"H6\",\"P\",\"Span\"],defaultValue:\"h2\"},segments:{type:ControlType.Array,title:\"Text Segments\",description:\"Each segment has its own text and color. Words flow inline as one continuous sentence. Use <br> anywhere in the text to force a line break.\",control:{type:ControlType.Object,controls:{text:{type:ControlType.String,title:\"Text\",defaultValue:\"words here\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\"}}},defaultValue:[{text:\"You will be\",color:\"#000000\"},{text:\"fit\",color:\"#8B5CF6\"},{text:\"in <br> 30 minutes\",color:\"#000000\"}]},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",displayFontSize:true,displayTextAlignment:false,defaultFontType:\"sans-serif\",defaultValue:{fontSize:32,fontWeight:700,lineHeight:1}},textAlign:{type:ControlType.Enum,title:\"Alignment\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],displaySegmentedControl:true,defaultValue:\"left\"},wordGap:{type:ControlType.Number,title:\"Word Gap\",description:\"Horizontal space between individual words\",defaultValue:8,min:0,max:60,step:1,unit:\"px\"},lineGap:{type:ControlType.Number,title:\"Line Gap\",description:\"Vertical space between wrapped lines. Use negative values to tighten.\",defaultValue:4,min:-40,max:60,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ColorText\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerIntrinsicWidth\":\"500\",\"framerIntrinsicHeight\":\"50\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MultiColorText.map"],"mappings":"6JAKG,SAAwB,EAAU,EAAM,CAAC,GAAK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