{"version":3,"file":"Ext_Button.BefCCqIm.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/FceVsIY45ZtU663fMTZC/q06uEtw78vEtYapEil1d/Ext_Button.js"],"sourcesContent":["/**\n * @framerDisableUnlink\n * @framerIntrinsicWidth 160\n * @framerIntrinsicHeight 44\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function ExtButton(props){const{label,href,target,font,color,hoverColor,background,hoverBackground,backdropBlur,borderRadius,borderWidth,borderColor,paddingTop,paddingRight,paddingBottom,paddingLeft,underline,leadingIcon,trailingIcon,iconGap,textAlign,style}=props;const[hovered,setHovered]=useState(false);const hasLeading=Array.isArray(leadingIcon)?leadingIcon.length>0:!!leadingIcon;const hasTrailing=Array.isArray(trailingIcon)?trailingIcon.length>0:!!trailingIcon;const justifyMap={left:\"flex-start\",center:\"center\",right:\"flex-end\"};// Extract hash from href: matches \"#section\" or \"https://site.com/page#section\"\nconst getHash=url=>{if(!url)return null;if(url.startsWith(\"#\"))return url.slice(1);const hashIndex=url.indexOf(\"#\");if(hashIndex===-1)return null;const hash=url.slice(hashIndex+1);return hash||null;};// Check if the URL points to the current page (or is a bare hash)\nconst isSamePage=url=>{if(url.startsWith(\"#\"))return true;try{const target=new URL(url,window.location.href);return target.origin===window.location.origin&&target.pathname===window.location.pathname;}catch{return false;}};const handleClick=e=>{if(!href||typeof window===\"undefined\")return;if(target===\"_blank\")return;const hash=getHash(href);if(!hash)return;if(!isSamePage(href))return;const el=document.getElementById(hash);if(!el)return;e.preventDefault();el.scrollIntoView({behavior:\"smooth\",block:\"start\"});history.pushState(null,\"\",`#${hash}`);};return /*#__PURE__*/_jsxs(\"a\",{href:href||\"#\",target:target,rel:target===\"_blank\"?\"noopener noreferrer\":undefined,onClick:handleClick,onMouseEnter:()=>setHovered(true),onMouseLeave:()=>setHovered(false),style:{...font,color:hovered?hoverColor:color,background:hovered?hoverBackground:background,backdropFilter:backdropBlur>0?`blur(${backdropBlur}px)`:undefined,WebkitBackdropFilter:backdropBlur>0?`blur(${backdropBlur}px)`:undefined,borderRadius,borderWidth,borderColor,borderStyle:borderWidth>0?\"solid\":\"none\",paddingTop,paddingRight,paddingBottom,paddingLeft,textAlign,textDecoration:underline?\"underline\":\"none\",whiteSpace:\"nowrap\",userSelect:\"none\",cursor:\"pointer\",display:\"flex\",flexDirection:\"row\",alignItems:\"center\",justifyContent:justifyMap[textAlign]||\"center\",gap:hasLeading||hasTrailing?iconGap:0,boxSizing:\"border-box\",transition:\"color 0.2s ease, background 0.2s ease\",...style},children:[hasLeading&&/*#__PURE__*/_jsx(\"div\",{style:{flexShrink:0},children:Array.isArray(leadingIcon)?leadingIcon[0]:leadingIcon}),/*#__PURE__*/_jsx(\"span\",{children:label}),hasTrailing&&/*#__PURE__*/_jsx(\"div\",{style:{flexShrink:0},children:Array.isArray(trailingIcon)?trailingIcon[0]:trailingIcon})]});}ExtButton.defaultProps={label:\"Button\",href:\"https://\",target:\"_self\",color:\"#ffffff\",hoverColor:\"#ffffff\",background:\"#000000\",hoverBackground:\"#333333\",backdropBlur:0,borderRadius:8,borderWidth:0,borderColor:\"#000000\",paddingTop:12,paddingRight:24,paddingBottom:12,paddingLeft:24,underline:false,iconGap:8,textAlign:\"center\"};addPropertyControls(ExtButton,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Button\"},href:{type:ControlType.String,title:\"URL\",defaultValue:\"https://\"},target:{type:ControlType.Enum,title:\"Target\",options:[\"_self\",\"_blank\"],optionTitles:[\"Same tab\",\"New tab\"],defaultValue:\"_self\"},leadingIcon:{type:ControlType.ComponentInstance,title:\"Leading icon\"},trailingIcon:{type:ControlType.ComponentInstance,title:\"Trailing icon\"},iconGap:{type:ControlType.Number,title:\"Icon gap\",defaultValue:8,min:0,max:32,step:1,unit:\"px\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\"},color:{type:ControlType.Color,title:\"Text\",defaultValue:\"#ffffff\"},hoverColor:{type:ControlType.Color,title:\"Text hover\",defaultValue:\"#ffffff\"},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"},hoverBackground:{type:ControlType.Color,title:\"BG hover\",defaultValue:\"#333333\"},backdropBlur:{type:ControlType.Number,title:\"BG blur\",defaultValue:0,min:0,max:40,step:1,unit:\"px\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:999,step:1,unit:\"px\"},borderWidth:{type:ControlType.Number,title:\"Border\",defaultValue:0,min:0,max:10,step:.5,unit:\"px\"},borderColor:{type:ControlType.Color,title:\"Border color\",defaultValue:\"#000000\"},paddingTop:{type:ControlType.Number,title:\"Pad top\",defaultValue:12,min:0,step:1,unit:\"px\"},paddingRight:{type:ControlType.Number,title:\"Pad right\",defaultValue:24,min:0,step:1,unit:\"px\"},paddingBottom:{type:ControlType.Number,title:\"Pad bottom\",defaultValue:12,min:0,step:1,unit:\"px\"},paddingLeft:{type:ControlType.Number,title:\"Pad left\",defaultValue:24,min:0,step:1,unit:\"px\"},textAlign:{type:ControlType.Enum,title:\"Align\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"center\",displaySegmentedControl:true},underline:{type:ControlType.Boolean,title:\"Underline\",defaultValue:false}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ExtButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Ext_Button.map"],"mappings":"gMAM4I,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,QAAM,OAAK,SAAO,OAAK,QAAM,aAAW,aAAW,kBAAgB,eAAa,eAAa,cAAY,cAAY,aAAW,eAAa,gBAAc,cAAY,YAAU,cAAY,eAAa,UAAQ,YAAU,SAAO,EAAW,CAAC,EAAQ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