{"version":3,"file":"TextCycle.BER1-3HZ.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/yfaAuENfSdpw4ct9liCJ/xnUbKLVSrcZ1ZHLBZ3bC/TextCycle.js"],"sourcesContent":["// Text Cycle Component - Infinitely loops through customizable words with configurable styling\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function TextCycle(props){const{words=[\"Design\",\"Build\",\"Ship\",\"Iterate\",\"Repeat\"],textColor=\"#000000\",font,cycleSpeed=2e3,animationDuration=.5}=props;const[currentIndex,setCurrentIndex]=useState(0);useEffect(()=>{const interval=setInterval(()=>{startTransition(()=>{setCurrentIndex(prevIndex=>(prevIndex+1)%words.length);});},cycleSpeed);return()=>clearInterval(interval);},[cycleSpeed,words.length]);return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",display:\"inline-block\",textAlign:\"left\",overflow:\"visible\"},children:/*#__PURE__*/_jsx(AnimatePresence,{mode:\"wait\",children:/*#__PURE__*/_jsx(motion.span,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:animationDuration},style:{position:\"relative\",display:\"inline-block\",color:textColor,whiteSpace:\"nowrap\",...font},children:words[currentIndex]},currentIndex)})});}addPropertyControls(TextCycle,{words:{type:ControlType.Array,title:\"Words\",control:{type:ControlType.String},defaultValue:[\"Design\",\"Build\",\"Ship\",\"Iterate\",\"Repeat\"],maxCount:10},textColor:{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\"}},cycleSpeed:{type:ControlType.Number,title:\"Cycle Speed\",defaultValue:2e3,min:500,max:1e4,step:100,unit:\"ms\"},animationDuration:{type:ControlType.Number,title:\"Animation Duration\",defaultValue:.5,min:.1,max:2,step:.1,unit:\"s\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TextCycle\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TextCycle.map"],"mappings":"gPAIG,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,QAAM,CAAC,SAAS,QAAQ,OAAO,UAAU,SAAS,CAAC,YAAU,UAAU,OAAK,aAAW,IAAI,oBAAkB,IAAI,EAAW,CAAC,EAAa,GAAiBA,EAAS,EAAE,CAA4M,OAA3M,MAAc,CAAC,IAAM,EAAS,gBAAgB,CAAC,MAAoB,CAAC,EAAgB,IAAY,EAAU,GAAG,EAAM,OAAO,EAAG,EAAG,EAAW,CAAC,UAAU,cAAc,EAAS,EAAG,CAAC,EAAW,EAAM,OAAO,CAAC,CAAqB,EAAK,MAAM,CAAC,MAAM,CAAC,SAAS,WAAW,QAAQ,eAAe,UAAU,OAAO,SAAS,UAAU,CAAC,SAAsB,EAAK,EAAgB,CAAC,KAAK,OAAO,SAAsB,EAAK,EAAO,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,SAAS,EAAkB,CAAC,MAAM,CAAC,SAAS,WAAW,QAAQ,eAAe,MAAM,EAAU,WAAW,SAAS,GAAG,EAAK,CAAC,SAAS,EAAM,GAAc,CAAC,EAAa,CAAC,CAAC,CAAC,CAAC,kBAH90B,IAAsD,IAAoD,IAAkD,CAGorB,EAAoB,EAAU,CAAC,MAAM,CAAC,KAAK,EAAY,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