{"version":3,"file":"SlideInButton.CFCSc0DA.mjs","names":["React.useState","React.useRef"],"sources":["https:/framerusercontent.com/modules/WBJJ480qolgFnBYcNfw2/otu6gcayLFZwtzLPB8HH/SlideInButton.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";const VARIANTS={primaire:{bg:\"rgb(201, 230, 161)\",hoverFill:\"rgb(142, 194, 97)\",text:\"rgb(2, 2, 2)\",textHover:\"rgb(2, 2, 2)\",border:\"none\"},secondaire:{bg:\"rgb(255, 252, 250)\",hoverFill:\"rgb(223, 95, 36)\",text:\"rgb(223, 95, 36)\",textHover:\"rgb(255, 252, 250)\",border:\"1.5px solid rgb(223, 95, 36)\"}};function SlideInButton({label=\"D\\xe9marrer mon projet\",variant=\"primaire\",couleurs={},link=\"\",linkOpenInNewTab=false,fontSize=1.2,fontWeight=600,letterSpacing=-.02,padding=\"14px 26px\"}){const[hovered,setHovered]=React.useState(false);const containerRef=React.useRef(null);const[circleSize,setCircleSize]=React.useState(600);React.useEffect(()=>{if(containerRef.current){const{width,height}=containerRef.current.getBoundingClientRect();const diameter=Math.ceil(Math.sqrt(width*width+height*height))*2.2;setCircleSize(diameter);}},[label,padding,fontSize]);const base=VARIANTS[variant]??VARIANTS.primaire;const c=couleurs??{};const bg=c.bg??base.bg;const hoverFill=c.hoverFill??base.hoverFill;const text=c.text??base.text;const textHover=c.textHover??base.textHover;const border=c.border?`1.5px solid ${c.border}`:base.border;const Tag=link?\"a\":\"div\";const linkProps=link?{href:link,target:linkOpenInNewTab?\"_blank\":\"_self\",rel:linkOpenInNewTab?\"noopener noreferrer\":undefined}:{};const half=circleSize/2;return /*#__PURE__*/_jsx(Tag,{...linkProps,style:{display:\"flex\",alignItems:\"stretch\",width:\"100%\",height:\"100%\",textDecoration:\"none\",cursor:\"pointer\"},children:/*#__PURE__*/_jsxs(\"div\",{ref:containerRef,onMouseEnter:()=>setHovered(true),onMouseLeave:()=>setHovered(false),style:{position:\"relative\",width:\"100%\",height:\"100%\",padding,borderRadius:39,overflow:\"hidden\",border:border,backgroundColor:bg,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",cursor:\"pointer\",boxSizing:\"border-box\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",width:hovered?circleSize:8,height:hovered?circleSize:8,bottom:hovered?-half:-8,left:\"50%\",marginLeft:hovered?-half:-4,borderRadius:\"50%\",backgroundColor:hoverFill,zIndex:1,pointerEvents:\"none\",transition:\"width 0.8s ease, height 0.8s ease, bottom 0.8s ease, margin-left 0.8s ease\"}}),/*#__PURE__*/_jsx(\"span\",{style:{position:\"relative\",zIndex:2,fontFamily:'\"Bricolage Grotesque\", sans-serif',fontWeight,fontSize:`${fontSize}rem`,lineHeight:1,letterSpacing:`${letterSpacing}em`,color:hovered?textHover:text,whiteSpace:\"nowrap\",userSelect:\"none\",transition:\"color 0.5s ease\"},children:label})]})});}addPropertyControls(SlideInButton,{variant:{type:ControlType.Enum,title:\"Variant\",options:[\"primaire\",\"secondaire\"],optionTitles:[\"Primaire\",\"Secondaire\"],defaultValue:\"primaire\"},label:{type:ControlType.String,title:\"Label\",defaultValue:\"D\\xe9marrer mon projet\"},link:{type:ControlType.Link,title:\"Lien\"},linkOpenInNewTab:{type:ControlType.Boolean,title:\"Nouvel onglet\",defaultValue:false,enabledTitle:\"Oui\",disabledTitle:\"Non\"},fontSize:{type:ControlType.Number,title:\"Taille (rem)\",defaultValue:1.2,min:.6,max:3,step:.05,displayStepper:true},fontWeight:{type:ControlType.Enum,title:\"Graisse\",options:[400,500,600,700,800],optionTitles:[\"Regular\",\"Medium\",\"SemiBold\",\"Bold\",\"ExtraBold\"],defaultValue:600},letterSpacing:{type:ControlType.Number,title:\"Espacement (em)\",defaultValue:-.02,min:-.1,max:.2,step:.005,displayStepper:true},padding:{type:ControlType.String,title:\"Padding\",defaultValue:\"14px 26px\"},couleurs:{type:ControlType.Object,title:\"Couleurs\",optional:true,controls:{bg:{type:ControlType.Color,title:\"Fond\",optional:true},hoverFill:{type:ControlType.Color,title:\"Fond hover\",optional:true},text:{type:ControlType.Color,title:\"Texte\",optional:true},textHover:{type:ControlType.Color,title:\"Texte hover\",optional:true},border:{type:ControlType.Color,title:\"Bordure\",optional:true,hidden(props){return props.variant===\"primaire\";}}}}});export{SlideInButton};export default SlideInButton;\nexport const __FramerMetadata__ = {\"exports\":{\"SlideInButton\":{\"type\":\"reactComponent\",\"name\":\"SlideInButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"SlideInButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SlideInButton.map"],"mappings":"+LAAqb,SAAS,EAAc,CAAC,QAAM,sBAAyB,UAAQ,WAAW,WAAS,EAAE,CAAC,OAAK,GAAG,mBAAiB,GAAM,WAAS,IAAI,aAAW,IAAI,gBAAc,KAAK,UAAQ,aAAa,CAAC,GAAK,CAAC,EAAQ,GAAYA,EAAe,GAAM,CAAO,EAAaC,EAAa,KAAK,CAAM,CAAC,EAAW,GAAeD,EAAe,IAAI,CAAC,MAAoB,CAAC,GAAG,EAAa,QAAQ,CAAC,GAAK,CAAC,QAAM,UAAQ,EAAa,QAAQ,uBAAuB,CAAoE,EAApD,KAAK,KAAK,KAAK,KAAK,EAAM,EAAM,EAAO,EAAO,CAAC,CAAC,IAA2B,GAAI,CAAC,EAAM,EAAQ,EAAS,CAAC,CAAC,IAAM,EAAK,EAAS,IAAU,EAAS,SAAe,EAAE,GAAU,EAAE,CAAO,EAAG,EAAE,IAAI,EAAK,GAAS,EAAU,EAAE,WAAW,EAAK,UAAgB,EAAK,EAAE,MAAM,EAAK,KAAW,EAAU,EAAE,WAAW,EAAK,UAAgB,EAAO,EAAE,OAAO,eAAe,EAAE,SAAS,EAAK,OAAa,EAAI,EA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