{"version":3,"file":"TextStagger.Dfx90cKS.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/y7kfxPYj76hTk5620eDF/23HsQgeGFUacDLHuycyG/TextStagger.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerDisableUnlink\n */export function StaggerTextSame(props){const{text,font,color,staggerDuration,animDuration,textDecoration,textTransform,backgroundColor,padding}=props;const[isHovered,setIsHovered]=React.useState(false);// Helper function to transform text via JS instead of CSS\nconst getTransformedText=(str,transform)=>{if(!str)return\"\";switch(transform){case\"uppercase\":return str.toUpperCase();case\"lowercase\":return str.toLowerCase();case\"capitalize\":return str.toLowerCase().replace(/\\b\\w/g,c=>c.toUpperCase());default:return str;}};// Process the text before sending it to the render function\nconst displayedText=getTransformedText(text,textTransform);return /*#__PURE__*/_jsx(\"div\",{onMouseEnter:()=>setIsHovered(true),onMouseLeave:()=>setIsHovered(false),style:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",overflow:\"hidden\",cursor:\"pointer\",perspective:1e3,// New styles applied here\nbackgroundColor:backgroundColor,padding:padding},children:/*#__PURE__*/_jsxs(motion.div,{initial:\"initial\",animate:isHovered?\"hover\":\"initial\",style:{position:\"relative\",whiteSpace:\"pre\",fontSize:font?.fontSize||48,fontFamily:font?.fontFamily||\"Inter\",fontWeight:font?.fontWeight||700,letterSpacing:font?.letterSpacing,// textDecoration passed down via props to children spans\ncolor:color,lineHeight:1,// Kept this tiny internal padding to prevent underline clipping\npadding:\"0px 0px 2px 0px\"},children:[/*#__PURE__*/_jsx(TextBlock,{text:displayedText,isSecondary:false,staggerDuration:staggerDuration,animDuration:animDuration,textDecoration:textDecoration}),/*#__PURE__*/_jsx(TextBlock,{text:displayedText,isSecondary:true,staggerDuration:staggerDuration,animDuration:animDuration,textDecoration:textDecoration})]})});}const TextBlock=({text,isSecondary,staggerDuration,animDuration,textDecoration})=>{return /*#__PURE__*/_jsx(motion.div,{variants:{initial:{transition:{staggerChildren:staggerDuration}},hover:{transition:{staggerChildren:staggerDuration}}},style:{display:\"block\",position:isSecondary?\"absolute\":\"relative\",top:0,left:0},children:text.split(\"\").map((char,i)=>/*#__PURE__*/_jsx(Letter,{char:char,isSecondary:isSecondary,animDuration:animDuration,textDecoration:textDecoration},i))});};const Letter=({char,isSecondary,animDuration,textDecoration})=>{const primaryVariants={initial:{y:0,rotateX:0,opacity:1,transition:{duration:animDuration,ease:\"easeInOut\"}},hover:{y:\"-100%\",rotateX:90,opacity:0,transition:{duration:animDuration,ease:\"easeInOut\"}}};const secondaryVariants={initial:{y:\"100%\",rotateX:-90,opacity:0,transition:{duration:animDuration,ease:\"easeInOut\"}},hover:{y:0,rotateX:0,opacity:1,transition:{duration:animDuration,ease:\"easeInOut\"}}};return /*#__PURE__*/_jsx(motion.span,{variants:isSecondary?secondaryVariants:primaryVariants,style:{display:\"inline-block\",transformStyle:\"preserve-3d\",textDecoration:textDecoration},children:char});};StaggerTextSame.defaultProps={text:\"ABOUT US\",color:\"#000000\",backgroundColor:\"transparent\",padding:0,staggerDuration:.03,animDuration:.4,textDecoration:\"none\",textTransform:\"none\"};addPropertyControls(StaggerTextSame,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"ABOUT US\"},font:{type:ControlType.Font,controls:\"extended\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#333\"},// New Control: Background Color\nbackgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"transparent\"},// New Control: Padding\npadding:{type:ControlType.Padding,title:\"Padding\"},textDecoration:{type:ControlType.Enum,title:\"Decoration\",options:[\"none\",\"underline\",\"line-through\",\"overline\"],optionTitles:[\"None\",\"Underline\",\"Line-through\",\"Overline\"],defaultValue:\"none\"},textTransform:{type:ControlType.Enum,title:\"Transform\",options:[\"none\",\"uppercase\",\"lowercase\",\"capitalize\"],optionTitles:[\"None\",\"Uppercase\",\"Lowercase\",\"Capitalize\"],defaultValue:\"none\"},staggerDuration:{type:ControlType.Number,title:\"Stagger\",defaultValue:.03,step:.005,min:0,max:.5,displayStepper:true},animDuration:{type:ControlType.Number,title:\"Speed\",defaultValue:.4,step:.1,min:.1,max:2}});\nexport const __FramerMetadata__ = {\"exports\":{\"StaggerTextSame\":{\"type\":\"reactComponent\",\"name\":\"StaggerTextSame\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TextStagger.map"],"mappings":"kOAEG,SAAgB,EAAgB,EAAM,CAAC,GAAK,CAAC,OAAK,OAAK,QAAM,kBAAgB,eAAa,iBAAe,gBAAc,kBAAgB,WAAS,EAAW,CAAC,EAAU,GAAcA,EAAe,GAAM,CAEtM,IADoB,EAAI,IAAY,CAAC,GAAG,CAAC,EAAI,MAAM,GAAG,OAAO,EAAP,CAAkB,IAAI,YAAY,OAAO,EAAI,aAAa,CAAC,IAAI,YAAY,OAAO,EAAI,aAAa,CAAC,IAAI,aAAa,OAAO,EAAI,aAAa,CAAC,QAAQ,QAAQ,GAAG,EAAE,aAAa,CAAC,CAAC,QAAQ,OAAO,KACtN,EAAK,EAAc,CAAC,OAAoB,EAAK,MAAM,CAAC,iBAAiB,EAAa,GAAK,CAAC,iBAAiB,EAAa,GAAM,CAAC,MAAM,CAAC,QAAQ,OAAO,WAAW,SAAS,eAAe,SAAS,SAAS,SAAS,OAAO,UAAU,YAAY,IACrQ,kBAAwB,UAAQ,CAAC,SAAsB,EAAM,EAAO,IAAI,CAAC,QAAQ,UAAU,QAAQ,EAAU,QAAQ,UAAU,MAAM,CAAC,SAAS,WAAW,WAAW,MAAM,SAAS,GAAM,UAAU,GAAG,WAAW,GAAM,YAAY,QAAQ,WAAW,GAAM,YAAY,IAAI,cAAc,GAAM,cAC3S,QAAM,WAAW,EACvB,QAAQ,kBAAkB,CAAC,SAAS,CAAc,EAAK,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