{"version":3,"file":"PulseButton.CmAJKnIm.mjs","names":[],"sources":["https:/framerusercontent.com/modules/Jas4GDN68042ZQYr8Mxs/W0EPAisvvSNQejcp1Rqw/PulseButton.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";/**\n * Pulse Button\n *\n * @framerIntrinsicWidth 160\n * @framerIntrinsicHeight 50\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function PulseButton(props){const{text=\"Click Me\",font,textColor=\"#FFFFFF\",backgroundColor=\"#0099FF\",pulseColor=\"#0099FF\",borderRadius=\"50px\",padding=\"12px 24px 12px 24px\",onTap,glow=true,pulseIntensity=1.5,variant=\"Ripple\",style,className,// --- MODIFICA 1: Aggiungiamo 'action' alle props ---\naction,link,openInNewTab=true}=props;const isRipple=variant===\"Ripple\";const isScale=variant===\"Scale\";const isShadow=variant===\"Shadow\";const rippleDuration=2;const rippleInterval=.6;const ringCount=Math.max(1,Math.ceil(rippleDuration/rippleInterval));const ripplePeriod=ringCount*rippleInterval;const rippleRepeatDelay=Math.max(0,ripplePeriod-rippleDuration);const scaleValue=1+(pulseIntensity-1)*.1;const animationProps=isScale?{scale:[1,scaleValue,1],transition:{duration:2,repeat:Infinity,ease:\"easeInOut\"}}:isShadow?{boxShadow:[`0 0 0px ${pulseColor}`,`0 0 ${10*pulseIntensity}px ${pulseColor}`,`0 0 0px ${pulseColor}`],transition:{duration:2,repeat:Infinity,ease:\"easeInOut\"}}:undefined;const hoverProps={scale:isScale?scaleValue+.05:1.05,filter:\"brightness(1.1)\",boxShadow:`0 0 25px ${pulseColor}`,transition:{type:\"spring\",stiffness:400,damping:25}};const tapProps={scale:.95,filter:\"brightness(0.9)\",transition:{type:\"spring\",stiffness:400,damping:25}};// --- MODIFICA 2: Cambiamo la gestione del click ---\nconst handleTap=async event=>{// 1. Esegui l'evento onTap se presente\nif(onTap)onTap(event);// 2. Esegui l'azione di Framer (QUESTO APRE L'OVERLAY)\nif(action){await action();}// 3. Gestisci il link se presente\nif(link&&typeof window!==\"undefined\"){window.open(link,openInNewTab?\"_blank\":\"_self\");}};return /*#__PURE__*/_jsxs(\"div\",{className:className,style:{...style,width:\"100%\",height:\"auto\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",position:\"relative\"},children:[isRipple&&Array.from({length:ringCount}).map((_,i)=>/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",inset:0,borderRadius:borderRadius,backgroundColor:pulseColor,zIndex:0,pointerEvents:\"none\"},initial:{scale:1,opacity:.35},animate:{scale:pulseIntensity,opacity:0},transition:{duration:rippleDuration,ease:\"easeOut\",repeat:Infinity,repeatDelay:rippleRepeatDelay,delay:i*rippleInterval}},i)),/*#__PURE__*/_jsx(motion.button,{onTap:handleTap,whileHover:hoverProps,whileTap:tapProps,animate:animationProps,style:{position:\"relative\",zIndex:1,background:backgroundColor,color:textColor,border:\"none\",borderRadius:borderRadius,padding:padding,cursor:\"pointer\",width:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",boxShadow:glow&&!isShadow?`0 0 20px ${pulseColor}`:\"none\",...font},children:text})]});}// --- MODIFICA 3: Aggiungiamo il controllo nell'interfaccia ---\naddPropertyControls(PulseButton,{variant:{type:ControlType.Enum,title:\"Variant\",options:[\"Ripple\",\"Scale\",\"Shadow\"],defaultValue:\"Ripple\"},// QUESTA RIGA AGGIUNGE IL COMANDO NEL PANNELLO A DESTRA\naction:{type:ControlType.Action,title:\"Action\"},text:{type:ControlType.String,title:\"Label\",defaultValue:\"Click Me\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#0099FF\"},pulseColor:{type:ControlType.Color,title:\"Pulse Color\",defaultValue:\"#0099FF\"},pulseIntensity:{type:ControlType.Number,title:\"Intensity\",defaultValue:1.5,min:1.1,max:3,step:.1},borderRadius:{type:ControlType.BorderRadius,title:\"Radius\",defaultValue:\"50px\"},padding:{type:ControlType.Padding,title:\"Padding\",defaultValue:\"12px 24px\"},glow:{type:ControlType.Boolean,title:\"Glow\",defaultValue:true},onTap:{type:ControlType.EventHandler},link:{type:ControlType.Link,title:\"Link\"},openInNewTab:{type:ControlType.Boolean,title:\"New Tab\",defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PulseButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"160\",\"framerIntrinsicHeight\":\"50\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PulseButton.map"],"mappings":"kOAQG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,OAAK,WAAW,OAAK,YAAU,UAAU,kBAAgB,UAAU,aAAW,UAAU,eAAa,OAAO,UAAQ,sBAAsB,QAAM,OAAK,GAAK,iBAAe,IAAI,UAAQ,SAAS,QAAM,YACxP,SAAO,OAAK,eAAa,IAAM,EAAY,EAAS,IAAU,SAAe,EAAQ,IAAU,QAAc,EAAS,IAAU,SAAsC,EAAe,GAAS,EAAU,KAAK,IAAI,EAAE,KAAK,KAAK,EAAe,EAAe,CAAC,CAAO,EAAa,EAAU,EAAqB,EAAkB,KAAK,IAAI,EAAE,EAAa,EAAe,CAAO,EAAW,GAAG,EAAe,GAAG,GAAS,EAAe,EAAQ,CAAC,MAAM,CAAC,EAAE,EAAW,EAAE,CAAC,WAAW,CAAC,SAAS,EAAE,OAAO,IAAS,KAAK,YAAY,CAAC,CAAC,EAAS,CAAC,UAAU,CAAC,WAAW,IAAa,OAAO,GAAG,EAAe,KAAK,IAAa,WAAW,IAAa,CAAC,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