{"version":3,"file":"HyveGradientButton.4Ee5D62U.mjs","names":["React.useState","React.useMemo","p"],"sources":["https:/framerusercontent.com/modules/MEffOSjtkbPtVU5lYF9g/tt9RpgmpYXXktxSwIc4y/HyveGradientButton.js"],"sourcesContent":["/**\n *  © 2025 Hyve Digital // All rights reserved. // https://hyve.digital\n * HyveGradientButton - v1.0.1\n * Last updated: 2025-01-26\n * Hyve Digital Button System - ROGUE VARIANT\n * Eye-catching gradient button with smooth hover transitions\n * Perfect for CTAs, hero sections, and premium features\n */import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{BaseButton}from\"https://framerusercontent.com/modules/1iq69sT5EHowdsAyHkWm/7k6MAmHEEGHEdtg47rP5/BaseButton.js\";import{ICONS}from\"https://framerusercontent.com/modules/ScPIzZV2nYt49GMDbLGr/wXpGoJja7aWBVIIgpRgs/IconSelectAdapter.js\";// Helper for CSS variables\nconst v=(name,fallback)=>`var(${name}, ${fallback})`;/**\n * Parse a CSS box-shadow and reduce the blur radius for pressed state\n */function reduceShadowBlur(shadow){if(!shadow||shadow===\"none\")return\"none\";const shadowPattern=/^([+-]?\\d+(?:\\.\\d+)?(?:px|rem|em)?)\\s+([+-]?\\d+(?:\\.\\d+)?(?:px|rem|em)?)\\s+([+-]?\\d+(?:\\.\\d+)?(?:px|rem|em)?)(?:\\s+([+-]?\\d+(?:\\.\\d+)?(?:px|rem|em)?))?(.*)$/;const match=shadow.trim().match(shadowPattern);if(!match)return shadow;const[,hOffset,vOffset,blur,spread,rest]=match;const blurMatch=blur.match(/^([+-]?\\d+(?:\\.\\d+)?)(px|rem|em)?$/);if(!blurMatch)return shadow;const blurValue=parseFloat(blurMatch[1]);const blurUnit=blurMatch[2]||\"px\";const reducedBlur=Math.max(1,blurValue*.2);const newBlur=`${reducedBlur}${blurUnit}`;const vOffsetMatch=vOffset.match(/^([+-]?\\d+(?:\\.\\d+)?)(px|rem|em)?$/);if(vOffsetMatch){const vValue=parseFloat(vOffsetMatch[1]);const vUnit=vOffsetMatch[2]||\"px\";const reducedVOffset=Math.max(1,vValue*.5);const newVOffset=`${reducedVOffset}${vUnit}`;if(spread){return`${hOffset} ${newVOffset} ${newBlur} ${spread}${rest}`;}return`${hOffset} ${newVOffset} ${newBlur}${rest}`;}if(spread){return`${hOffset} ${vOffset} ${newBlur} ${spread}${rest}`;}return`${hOffset} ${vOffset} ${newBlur}${rest}`;}export function HyveGradientButton(props){const{disabled=false,loadingText,gradientIntensity=1,...rest}=props;const[hover,setHover]=React.useState(false);const[pressed,setPressed]=React.useState(false);const[baseShadow,setBaseShadow]=React.useState(\"none\");/**\n     * GRADIENT SPEC:\n     * Basic: Linear gradient from start to end color\n     * Hover: Shift gradient angle by 20deg for subtle animation\n     * Disabled: Desaturated gradient (grey tones)\n     * No border (gradient is the feature)\n     * Text: Always white for contrast\n     * Shadow: Applied from theme when not disabled\n     */const gradientStart=v(\"--hyve-gradient-start\",\"#006EFC\");const gradientEnd=v(\"--hyve-gradient-end\",\"#00D4FF\");const grey100=v(\"--hyve-grey-100\",\"#F3F4F6\");const grey200=v(\"--hyve-grey-200\",\"#E5E7EB\");const grey400=v(\"--hyve-grey-400\",\"#9CA3AF\");// Read shadow after mount when CSS is ready\nReact.useEffect(()=>{if(typeof window===\"undefined\")return;if(disabled){setBaseShadow(\"none\");return;}const shadowValue=getComputedStyle(document.documentElement).getPropertyValue(\"--hyve-shadow\").trim();setBaseShadow(shadowValue||\"none\");},[disabled]);// Read gradient angle from CSS variable\nconst baseAngle=React.useMemo(()=>{if(typeof window===\"undefined\")return 135;const angle=getComputedStyle(document.documentElement).getPropertyValue(\"--hyve-gradient-angle\").trim();return parseInt(angle)||135;},[]);// Calculate gradient backgrounds\nconst normalGradient=`linear-gradient(${baseAngle}deg, ${gradientStart}, ${gradientEnd})`;//const hoverGradient = `linear-gradient(${baseAngle + 30}deg, ${gradientStart}, ${gradientEnd})`\nconst hoverGradient=`linear-gradient(${baseAngle+5}deg, \n        color-mix(in srgb, ${gradientStart} 85%, black), \n        color-mix(in srgb, ${gradientEnd} 85%, black))`;const pressedGradient=`linear-gradient(${baseAngle+15}deg, ${gradientStart}, ${gradientEnd})`;const disabledGradient=`linear-gradient(${baseAngle}deg, ${grey100}, ${grey200})`;// Current state gradient\nconst currentGradient=disabled?disabledGradient:pressed?pressedGradient:hover?hoverGradient:normalGradient;// Apply pressed shadow reduction\nconst shadow=pressed&&baseShadow!==\"none\"?reduceShadowBlur(baseShadow):baseShadow;return /*#__PURE__*/_jsx(BaseButton,{...rest,disabled:disabled,loadingText:loadingText,background:currentGradient,backgroundHover:hoverGradient,backgroundPressed:pressedGradient,backgroundDisabled:disabledGradient,color:\"#ffffff\",colorDisabled:grey400,borderColor:\"transparent\",borderColorHover:\"transparent\",borderColorPressed:\"transparent\",borderColorDisabled:\"transparent\",borderStyle:\"none\",boxShadow:shadow,onPressedChange:p=>{setPressed(p);setHover(false);}});}addPropertyControls(HyveGradientButton,{text:{type:ControlType.String,title:\"Label\",defaultValue:\"Button\"},link:{type:ControlType.Link,title:\"Link\"},openInNewTab:{type:ControlType.Boolean,title:\"Open in New Tab\",defaultValue:false,hidden:props=>!props.link},size:{type:ControlType.Enum,title:\"Size\",options:[\"s\",\"m\",\"l\",\"xl\",\"xxl\"],defaultValue:\"m\"},leadingIconName:{type:ControlType.Enum,title:\"Leading Icon\",options:[null,...Object.keys(ICONS)],optionTitles:[\"None\",...Object.keys(ICONS)],hidden:p=>!!p.leadingIconSvg},trailingIconName:{type:ControlType.Enum,title:\"Trailing Icon\",options:[null,...Object.keys(ICONS)],optionTitles:[\"None\",...Object.keys(ICONS)],hidden:p=>!!p.trailingIconSvg},leadingIconSvg:{type:ControlType.String,title:\"Leading SVG\",displayTextArea:true,hidden:p=>!!p.leadingIconName},trailingIconSvg:{type:ControlType.String,title:\"Trailing SVG\",displayTextArea:true,hidden:p=>!!p.trailingIconName},iconOnly:{type:ControlType.Boolean,title:\"Icon Only\",defaultValue:false},animateTrailingIcon:{type:ControlType.Boolean,title:\"Animate Trailing Icon\",defaultValue:true,hidden:p=>!p.trailingIconName&&!p.trailingIconSvg},disabled:{type:ControlType.Boolean,title:\"Disabled\",defaultValue:false},loading:{type:ControlType.Boolean,title:\"Loading\",defaultValue:false},loadingText:{type:ControlType.String,title:\"Loading Text\",defaultValue:\"\",placeholder:\"e.g. Submitting...\",hidden:props=>!props.loading}});\nexport const __FramerMetadata__ = {\"exports\":{\"HyveGradientButton\":{\"type\":\"reactComponent\",\"name\":\"HyveGradientButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HyveGradientButton.map"],"mappings":"wQAUG,SAAS,EAAiB,EAAO,CAAC,GAAG,CAAC,GAAQ,IAAS,OAAO,MAAM,OAA0L,IAAM,EAAM,EAAO,MAAM,CAAC,MAAzL,+JAA6M,CAAC,GAAG,CAAC,EAAM,OAAO,EAAO,GAAK,EAAE,EAAQ,EAAQ,EAAK,EAAO,GAAM,EAAY,EAAU,EAAK,MAAM,qCAAqC,CAAC,GAAG,CAAC,EAAU,OAAO,EAAO,IAAM,EAAU,WAAW,EAAU,GAAG,CAAO,EAAS,EAAU,IAAI,KAAsD,EAAQ,GAAvC,KAAK,IAAI,EAAE,EAAU,GAAG,GAAgC,IAAiB,EAAa,EAAQ,MAAM,qCAAqC,CAAC,GAAG,EAAa,CAAC,IAAM,EAAO,WAAW,EAAa,GAAG,CAAO,EAAM,EAAa,IAAI,KAAsD,EAAW,GAAvC,KAAK,IAAI,EAAE,EAAO,GAAG,GAAsC,IAAiF,OAAtE,EAAc,GAAG,EAAQ,GAAG,EAAW,GAAG,EAAQ,GAAG,IAAS,IAAc,GAAG,EAAQ,GAAG,EAAW,GAAG,IAAU,IAA8E,OAAnE,EAAc,GAAG,EAAQ,GAAG,EAAQ,GAAG,EAAQ,GAAG,IAAS,IAAc,GAAG,EAAQ,GAAG,EAAQ,GA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