{"version":3,"file":"ButtonLinkVerticalScrollText.DUAL7oOC.mjs","names":["React.useId","React.useMemo"],"sources":["https:/framerusercontent.com/modules/9eIz0520WVAYllHWe91o/n1gfYLkIfRDT58A4cSJE/ButtonLinkVerticalScrollText.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * User instructions:\n * Crea un componente Button Link con effetto Vertical Scrolling Text animato all'hover.\n * Auto-width con padding orizzontale e overflow hidden; testo tra parentesi quadre [ TESTO ] sempre fisse.\n * Props: Text, Font (monospace), Color, Animation Speed, Stagger Delay, Direction.\n * Ogni lettera wrappata in container overflow hidden con 2 copie verticali e animazione loop seamless in hover.\n *//**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function VerticalRollText(props){const isStatic=useIsStaticRenderer();const{text,link,openIn,font,color,animationSpeed,staggerDelay,direction,showBrackets,paddingX,paddingY,style}=props;const reactId=React.useId();const scopeClass=React.useMemo(()=>{const safe=reactId.replace(/[^a-zA-Z0-9_-]/g,\"\");return`vsbt_${safe}`;},[reactId]);const lineHeight=React.useMemo(()=>{if(!font?.lineHeight)return\"1.2em\";return font.lineHeight;},[font?.lineHeight]);const computedFontSize=React.useMemo(()=>{const raw=font?.fontSize??\"14px\";const preferred=typeof raw===\"number\"?`${raw}px`:raw;return`clamp(0px, ${preferred}, 16px)`;},[font?.fontSize]);const chars=React.useMemo(()=>Array.from(text??\"\"),[text]);const maskPad=1;const bracketSpread=4;const css=React.useMemo(()=>{const dur=Math.max(.1,animationSpeed||.6);return`\n.${scopeClass} { -webkit-tap-highlight-color: transparent; }\n.${scopeClass} .vsbt_letterWrap { padding: ${maskPad}px 0; box-sizing: content-box; line-height: ${typeof lineHeight===\"number\"?`${lineHeight}em`:lineHeight}; height: calc(1lh + ${maskPad*2}px); }\n.${scopeClass} .vsbt_inner { display: flex; flex-direction: column; transition: transform ${dur}s ease-in-out; will-change: transform; }\n.${scopeClass} .vsbt_inner > span { height: 1lh; display: flex; align-items: center; }\n.${scopeClass} .vsbt_bracket { transition: transform ${dur}s ease-in-out; will-change: transform; }\n.${scopeClass}:hover .vsbt_bracket[data-side=\"left\"],\n.${scopeClass}:active .vsbt_bracket[data-side=\"left\"],\n.${scopeClass}:focus-visible .vsbt_bracket[data-side=\"left\"] { transform: translateX(-${bracketSpread}px); }\n.${scopeClass}:hover .vsbt_bracket[data-side=\"right\"],\n.${scopeClass}:active .vsbt_bracket[data-side=\"right\"],\n.${scopeClass}:focus-visible .vsbt_bracket[data-side=\"right\"] { transform: translateX(${bracketSpread}px); }\n.${scopeClass}:hover .vsbt_inner[data-dir=\"up\"],\n.${scopeClass}:active .vsbt_inner[data-dir=\"up\"],\n.${scopeClass}:focus-visible .vsbt_inner[data-dir=\"up\"] { transform: translateY(-50%); }\n.${scopeClass}:hover .vsbt_inner[data-dir=\"down\"],\n.${scopeClass}:active .vsbt_inner[data-dir=\"down\"],\n.${scopeClass}:focus-visible .vsbt_inner[data-dir=\"down\"] { transform: translateY(50%); }\n@media (prefers-reduced-motion: reduce) {\n  .${scopeClass} .vsbt_inner, .${scopeClass} .vsbt_bracket { transition: none !important; transform: translateY(0%) !important; }\n}\n        `.trim();},[animationSpeed,bracketSpread,lineHeight,scopeClass]);const isFixedWidth=style?.width===\"100%\";const isFixedHeight=style?.height===\"100%\";const baseFontStyle={...font,fontSize:computedFontSize,fontWeight:550,letterSpacing:\"0.05em\",lineHeight,color};const bracketStyle={...baseFontStyle,display:\"inline-flex\",alignItems:\"center\",flex:\"0 0 auto\",userSelect:\"none\"};return /*#__PURE__*/_jsxs(\"a\",{className:scopeClass,href:link,target:openIn===\"new\"?\"_blank\":undefined,rel:openIn===\"new\"?\"noopener noreferrer\":undefined,style:{position:\"relative\",display:\"inline-flex\",alignItems:\"center\",gap:0,padding:`${paddingY}px ${paddingX}px`,textDecoration:\"none\",cursor:\"pointer\",overflow:\"hidden\",color,...isFixedWidth?{width:\"100%\"}:{width:\"max-content\"},...isFixedHeight?{height:\"100%\"}:undefined,...style},\"aria-label\":text,children:[/*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:css}}),showBrackets&&/*#__PURE__*/_jsx(\"span\",{className:\"vsbt_bracket\",\"data-side\":\"left\",style:bracketStyle,\"aria-hidden\":\"true\",children:\"[\"}),/*#__PURE__*/_jsx(\"span\",{style:{position:\"relative\",display:\"inline-flex\",alignItems:\"center\",whiteSpace:\"pre\",flex:\"0 0 auto\"},children:chars.map((ch,i)=>{const delay=Math.max(0,staggerDelay||0)*i;return /*#__PURE__*/_jsx(\"span\",{className:\"vsbt_letterWrap\",style:{position:\"relative\",display:\"inline-block\",verticalAlign:\"top\",overflow:\"hidden\",whiteSpace:\"pre\",flex:\"0 0 auto\"},\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsxs(\"span\",{className:\"vsbt_inner\",\"data-dir\":direction,style:{display:\"block\",transitionDelay:`${delay}s`,...isStatic?{transition:\"none\"}:undefined},children:[/*#__PURE__*/_jsx(\"span\",{style:{...baseFontStyle,display:\"block\",whiteSpace:\"pre\"},children:ch}),/*#__PURE__*/_jsx(\"span\",{style:{...baseFontStyle,display:\"block\",whiteSpace:\"pre\"},children:ch})]})},`${ch}-${i}`);})}),showBrackets&&/*#__PURE__*/_jsx(\"span\",{className:\"vsbt_bracket\",\"data-side\":\"right\",style:bracketStyle,\"aria-hidden\":\"true\",children:\"]\"})]});}addPropertyControls(VerticalRollText,{text:{type:ControlType.String,title:\"Text\",defaultValue:\" ROLL TEXT \"},link:{type:ControlType.Link,title:\"Link\",defaultValue:\"https://framer.link/francescocaronte\"},openIn:{type:ControlType.Enum,title:\"Open In\",options:[\"same\",\"new\"],optionTitles:[\"Same Tab\",\"New Tab\"],defaultValue:\"same\",displaySegmentedControl:true},font:{type:ControlType.Font,title:\"Font\",description:\"⚠ To increase the size of the component, use Transform > Scale\",controls:\"extended\",defaultFontType:\"monospace\",defaultValue:{fontSize:\"14px\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"}},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\"},animationSpeed:{type:ControlType.Number,title:\"Anim Speed\",defaultValue:.2,min:.1,max:2,step:.05,unit:\"s\"},staggerDelay:{type:ControlType.Number,title:\"Stagger\",defaultValue:.02,min:.02,max:.15,step:.005,unit:\"s\"},direction:{type:ControlType.Enum,title:\"Direction\",options:[\"up\",\"down\"],optionTitles:[\"Up\",\"Down\"],defaultValue:\"up\",displaySegmentedControl:true},showBrackets:{type:ControlType.Boolean,title:\"Brackets\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},paddingX:{type:ControlType.Number,title:\"Padding X\",defaultValue:12,min:0,max:48,step:1,unit:\"px\"},paddingY:{type:ControlType.Number,title:\"Padding Y\",defaultValue:8,min:0,max:48,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VerticalRollText\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ButtonLinkVerticalScrollText.map"],"mappings":"gMASG,SAAwB,EAAiB,EAAM,CAAC,IAAM,EAAS,GAAqB,CAAM,CAAC,OAAK,OAAK,SAAO,OAAK,QAAM,iBAAe,eAAa,YAAU,eAAa,WAAS,WAAS,SAAO,EAAY,EAAQA,GAAa,CAAO,EAAWC,MAA0E,QAA5C,EAAQ,QAAQ,kBAAkB,GAAG,GAAwB,CAAC,EAAQ,CAAC,CAAO,EAAWA,MAAuB,GAAM,WAAgC,EAAK,WAApB,QAAiC,CAAC,GAAM,WAAW,CAAC,CAAO,EAAiBA,MAAkB,CAAC,IAAM,EAAI,GAAM,UAAU,OAA4D,MAAM,cAA3C,OAAO,GAAM,SAAS,GAAG,E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