{"version":3,"file":"TextStyleMixer.BHGCj47W.mjs","names":["__esmMin","c","init_jsx_runtime","motion","init_framer_motion_DhsWWWsN","init_framer_Dt_XqoQa","addPropertyControls","TextStyleMixer","props","renderMixedText","regex","mix","m","content","mixItem","part","color","index","Tag","tag","font","textWrap","init_TextStyleMixer","ControlType"],"sources":["https:/framerusercontent.com/modules/L2GMBO4NszJGhG39YZAU/RaUJyLv1BLyqwxtqGxQI/TextStyleMixer.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";/**\n * @copyright ©framersnippets.com\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any\n * @framerIntrinsicWidth 221\n * @framerDisableUnlink\n **/export default function TextStyleMixer(props){const{content,font,color,mix,textWrap,tag}=props;const renderMixedText=()=>{const regex=new RegExp(`(${mix.map(m=>m.text).join(\"|\")})`,\"gi\");const parts=content.split(regex);return parts.map((part,index)=>{const mixItem=mix.find(m=>m.text.toLowerCase()===part.toLowerCase());if(mixItem){return /*#__PURE__*/_jsx(\"span\",{style:{...mixItem.font,color:mixItem.useColor?mixItem.color:color,marginLeft:mixItem.useGap?`${mixItem.leftGap}px`:0,marginRight:mixItem.useGap?`${mixItem.rightGap}px`:0,lineHeight:\"inherit\"},children:part},index);}return part;});};const Tag=tag||\"p\";return /*#__PURE__*/_jsx(motion.div,{style:{...font,display:\"block\",overflow:\"visible\",color:color,alignItems:\"baseline\",whiteSpace:\"normal\",wordWrap:\"break-word\",textWrap:textWrap?\"balance\":\"unset\"},children:/*#__PURE__*/_jsx(Tag,{style:{all:\"unset\",fontSize:font.fontSize},children:renderMixedText()})});}TextStyleMixer.defaultProps={content:\"Blend styles to craft unique headlines for your designs\",font:{fontSize:16},color:\"#000\",mix:[{text:\"unique\",useColor:true,color:\"#0599ff\",font:{},useGap:false,leftGap:0,rightGap:0}],textWrap:true,tag:\"h1\"};addPropertyControls(TextStyleMixer,{content:{type:ControlType.String,title:\"Content\",placeholder:\"Your content..\",displayTextArea:true},font:{type:ControlType.Font,controls:\"extended\",displayFontSize:true,defaultFontType:\"sans-serif\",defaultValue:{fontSize:15,lineHeight:1.4,letterSpacing:0}},color:{type:ControlType.Color,title:\"Color\"},mix:{type:ControlType.Array,title:\"Mix\",propertyControl:{type:ControlType.Object,controls:{text:{type:ControlType.String,title:\"Text\",placeholder:\"Text to style...\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",displayFontSize:true,displayTextAlignment:false,defaultFontType:\"sans-serif\",defaultValue:{fontSize:15,lineHeight:1.4,letterSpacing:0}},useColor:{type:ControlType.Boolean,title:\"Color\",defaultValue:false},color:{type:ControlType.Color,title:\"‎\",hidden:props=>!props.useColor},useGap:{type:ControlType.Boolean,title:\"Gap\",defaultValue:false},leftGap:{type:ControlType.Number,title:\"Left\",min:0,max:100,step:1,defaultValue:0,displayStepper:true,hidden:props=>!props.useGap},rightGap:{type:ControlType.Number,title:\"Right\",min:0,max:100,step:1,defaultValue:0,displayStepper:true,hidden:props=>!props.useGap}}}},textWrap:{type:ControlType.Boolean,title:\"Balance\",defaultValue:true},tag:{type:ControlType.Enum,title:\"Tag\",options:[\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"p\",\"span\"],optionTitles:[\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"p\",\"span\"],defaultValue:\"h1\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TextStyleMixer\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"221\",\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TextStyleMixer.map"],"mappings":"A,wMAMI,SAAwBO,EAAe,EAAM,CAAC,GAAK,CAAC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