{"version":3,"file":"WordTransition_1.c4IIvmE8.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/qLv9O7MfnY1alBR7Lcip/w38cnZseQuYkC1sRnXoA/WordTransition_1.js"],"sourcesContent":["// Animated text component that cycles through different words with subtle transitions\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,startTransition,useMemo}from\"react\";import{motion,AnimatePresence}from\"framer-motion\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function WordTransition(props){const{words=[\"palabra\",\"texto\",\"elemento\"],duration=2e3,animationType=\"fade\",font,color=\"#000000\"}=props;const[currentIndex,setCurrentIndex]=useState(0);const isStatic=useIsStaticRenderer();// Find the longest word to reserve space\nconst longestWord=useMemo(()=>{return words.reduce((longest,current)=>current.length>longest.length?current:longest,words[0]||\"palabra\");},[words]);useEffect(()=>{if(isStatic||words.length<=1)return;const interval=setInterval(()=>{startTransition(()=>{setCurrentIndex(prev=>(prev+1)%words.length);});},duration);return()=>clearInterval(interval);},[duration,words.length,isStatic]);const getAnimationVariants=()=>{switch(animationType){case\"slideUp\":return{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20}};case\"slideDown\":return{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},exit:{opacity:0,y:20}};case\"scale\":return{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8}};default:return{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}};}};const variants=getAnimationVariants();if(isStatic){return /*#__PURE__*/_jsx(\"span\",{style:{...font,color,display:\"inline-block\"},children:words[0]||\"palabra\"});}return /*#__PURE__*/_jsx(\"span\",{style:{display:\"inline-block\",position:\"relative\"},children:/*#__PURE__*/_jsx(AnimatePresence,{mode:\"wait\",children:/*#__PURE__*/_jsx(motion.span,{initial:variants.initial,animate:variants.animate,exit:variants.exit,transition:{duration:.3,ease:\"easeInOut\"},style:{...font,color,display:\"inline-block\"},children:words[currentIndex]},currentIndex)})});}addPropertyControls(WordTransition,{words:{type:ControlType.Array,title:\"Palabras\",control:{type:ControlType.String,placeholder:\"Escribe una palabra...\"},defaultValue:[\"palabra\",\"texto\",\"elemento\"],maxCount:10},duration:{type:ControlType.Number,title:\"Duraci\\xf3n\",defaultValue:2e3,min:500,max:1e4,step:100,unit:\"ms\"},animationType:{type:ControlType.Enum,title:\"Animaci\\xf3n\",options:[\"fade\",\"slideUp\",\"slideDown\",\"scale\"],optionTitles:[\"Desvanecer\",\"Deslizar Arriba\",\"Deslizar Abajo\",\"Escalar\"],defaultValue:\"fade\",displaySegmentedControl:true},font:{type:ControlType.Font,title:\"Fuente\",defaultValue:{fontSize:\"16px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"WordTransition\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WordTransition_1.map"],"mappings":"0PAIG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,QAAM,CAAC,UAAU,QAAQ,WAAW,CAAC,WAAS,IAAI,gBAAc,OAAO,OAAK,QAAM,WAAW,EAAW,CAAC,EAAa,GAAiBA,EAAS,EAAE,CAAO,EAAS,GAAqB,CAC5N,MAAoB,EAAM,QAAQ,EAAQ,IAAU,EAAQ,OAAO,EAAQ,OAAO,EAAQ,EAAQ,EAAM,IAAI,UAAU,CAAG,CAAC,EAAM,CAAC,CAAC,MAAc,CAAC,GAAG,GAAU,EAAM,QAAQ,EAAE,OAAO,IAAM,EAAS,gBAAgB,CAAC,MAAoB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