{"version":3,"file":"HyvePrimaryButton.B3f120B2.mjs","names":["React.useState","__esmMin","init_ssg_sandbox_shims","_e","c","init_jsx_runtime","init_npm_react_18_3_1","ce","window","addPropertyControls","init_framer_DKgW_P28","ControlType","init_IconSelectAdapter","ICONS","init_BaseButton","reduceShadowBlur","shadow","match","hOffset","vOffset","blur","spread","rest","blurMatch","blurValue","blurUnit","newBlur","vOffsetMatch","vValue","vUnit","newVOffset","HyvePrimaryButton","props","pressed","setPressed","baseShadow","setBaseShadow","brand600","v","brand700","dest600","dest700","grey100","grey400","tone","disabled","shadowValue","base","hover","BaseButton","init_HyvePrimaryButton","name","fallback","p"],"sources":["https:/framerusercontent.com/modules/s8IZws9r8d0hruPvc8nZ/NogS19872nSpX2c1sfjB/HyvePrimaryButton.js"],"sourcesContent":["/**\n *  © 2025 Hyve Digital // All rights reserved. // https://hyve.digital\n * HyvePrimaryButton - v1.7.0\n * Last updated: 2025-01-10\n * Hyve Digital Button System\n * Changelog v1.7.0: Rebranded from PrimaryButton - CSS vars now use --hyve-* prefix\n * Changelog v1.6.2: EXACT heights via BaseButton v1.6.2 (direct values + height not minHeight)\n * Changelog v1.6.1: Fixed height rendering via BaseButton v1.6.1 (direct pixel values prevent CSS var conflicts)\n * Changelog v1.6.0: Fixed heights via BaseButton v1.6.0 (buttons maintain consistent height with icons)\n * Changelog v1.5.11: Safari fix via BaseButton v1.5.11 (explicit stroke on paths, proper dimensions)\n * Changelog v1.5.10: Added explicit SVG dimensions via BaseButton v1.5.10 (matching Lucide)\n * Changelog v1.5.9: Major Safari fix via BaseButton v1.5.9 (simplified to use SVG inheritance)\n * Changelog v1.5.8: Critical fix via BaseButton v1.5.8 (preserves self-closing SVG tags)\n * Changelog v1.5.7: Safari SVG fix via BaseButton v1.5.7 (stroke added to child elements)\n * Changelog v1.5.6: Safari SVG fix via BaseButton v1.5.6 (icons now render correctly)\n * Changelog v1.5.5: Mobile touch fix via BaseButton v1.5.5 (no more stuck pressed state)\n * Changelog v1.5.4: Accessibility improvements via BaseButton v1.5.4 (ARIA tags)\n * Changelog v1.5.3: Now works with Framer Fill/Fit Content (requires BaseButton v1.5.3)\n * Changelog v1.5.2: Restored Disabled/Loading toggles + conditional Loading Text field\n * Changelog v1.5.1: Made loadingText always visible (not conditionally hidden)\n * Changelog v1.5.0: Added loadingText prop for per-instance loading messages\n * Changelog v1.4.0: Refactored UX - moved Disabled/Loading to Developer section (commented out for MVP)\n * Changelog v1.3.4: UI polish - moved Link to top of properties panel\n * Changelog v1.3.3: Fixed initial shadow load timing (use useEffect)\n * Changelog v1.3.2: Fixed shadow rendering bug (removed useMemo caching)\n * Changelog v1.3.1: Added Link support for navigation\n * Changelog v1.3.0: Added pressed state shadow reduction for tactile feedback\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 * Example: \"0 4px 8px 0 rgba(0,0,0,0.1)\" -> \"0 2px 2px 0 rgba(0,0,0,0.1)\"\n */function reduceShadowBlur(shadow){if(!shadow||shadow===\"none\")return\"none\";// Match box-shadow pattern: h-offset v-offset blur [spread] color\nconst 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;// Parse blur value and unit\nconst blurMatch=blur.match(/^([+-]?\\d+(?:\\.\\d+)?)(px|rem|em)?$/);if(!blurMatch)return shadow;const blurValue=parseFloat(blurMatch[1]);const blurUnit=blurMatch[2]||\"px\";// Reduce blur to 20% with minimum of 1px (pressed effect)\nconst reducedBlur=Math.max(1,blurValue*.2);const newBlur=`${reducedBlur}${blurUnit}`;// Also slightly reduce vertical offset for \"pressed down\" feel\nconst 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}`;// Reconstruct shadow\nif(spread){return`${hOffset} ${newVOffset} ${newBlur} ${spread}${rest}`;}return`${hOffset} ${newVOffset} ${newBlur}${rest}`;}// Fallback if v-offset parsing fails\nif(spread){return`${hOffset} ${vOffset} ${newBlur} ${spread}${rest}`;}return`${hOffset} ${vOffset} ${newBlur}${rest}`;}export function HyvePrimaryButton(props){const{tone=\"default\",disabled=false,loadingText,...rest}=props;const[pressed,setPressed]=React.useState(false);const[baseShadow,setBaseShadow]=React.useState(\"none\");/**\n     * PRIMARY SPEC:\n     * Basic: Fill brand-600, Stroke brand-600, Text white\n     * Hover: Fill brand-700, Stroke brand-700, Text white\n     * Disabled: Fill grey-100, Stroke grey-200, Text grey-400\n     * Shadow: Only on default tone when not disabled\n     * Pressed: Shadow blur reduced to 20% for tactile feedback\n     */const brand600=v(\"--hyve-brand-600\",\"#006EFC\");const brand700=v(\"--hyve-brand-700\",\"#0059C9\");const dest600=v(\"--hyve-destructive-600\",\"#DC2626\");const dest700=v(\"--hyve-destructive-700\",\"#B91C1C\");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(tone!==\"default\"||disabled){setBaseShadow(\"none\");return;}const shadowValue=getComputedStyle(document.documentElement).getPropertyValue(\"--hyve-shadow\").trim();setBaseShadow(shadowValue||\"none\");},[tone,disabled]);// Apply pressed shadow reduction\nconst shadow=pressed&&baseShadow!==\"none\"?reduceShadowBlur(baseShadow):baseShadow;const base=tone===\"destructive\"?dest600:brand600;const hover=tone===\"destructive\"?dest700:brand700;return /*#__PURE__*/_jsx(BaseButton,{...rest,disabled:disabled,loadingText:loadingText,background:base,backgroundHover:hover,backgroundPressed:hover,backgroundDisabled:grey100,color:\"#ffffff\",colorDisabled:grey400,borderColor:base,borderColorHover:hover,borderColorPressed:hover,borderColorDisabled:grey100,borderStyle:\"full\",boxShadow:shadow,onPressedChange:setPressed});}addPropertyControls(HyvePrimaryButton,{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},tone:{type:ControlType.Enum,title:\"Tone\",options:[\"default\",\"destructive\"],defaultValue:\"default\"},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\":{\"HyvePrimaryButton\":{\"type\":\"reactComponent\",\"name\":\"HyvePrimaryButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"A,6PA+BG,SAASe,EAAiB,EAAO,CAAC,GAAG,CAACC,GAAQA,IAAS,OAAO,MAAM,OAC4G,IAAMC,EAAMD,EAAO,KAAK,CAAC,CAAC,MAAM,8JAAa,EAAE,GAAG,CAACC,EAAM,OAAOD,EAAO,GAAK,EAAEE,EAAQC,EAAQC,EAAKC,EAAOC,GAAML,EAC7RM,EAAUH,EAAK,MAAM,oCAAoC,EAAE,GAAG,CAACG,EAAU,OAAOP,EAAO,IAAMQ,EAAU,WAAWD,EAAU,EAAE,EAAQE,EAASF,EAAU,IAAI,KAClHG,EAAQ,GAAvC,KAAK,IAAI,EAAEF,EAAU,EAA+B,IAAIC,IACpEE,EAAaR,EAAQ,MAAM,oCAAoC,EAAE,GAAGQ,EAAa,CAAC,IAAMC,EAAO,WAAWD,EAAa,EAAE,EAAQE,EAAMF,EAAa,IAAI,KAAsDG,EAAW,GAAvC,KAAK,IAAI,EAAEF,EAAO,EAAqC,IAAIC,IAC1K,OAAtER,EAAc,GAAGH,EAAQ,GAAGY,EAAW,GAAGJ,EAAQ,GAAGL,IAASC,IAAc,GAAGJ,EAAQ,GAAGY,EAAW,GAAGJ,IAAUJ,GAAO,CACtD,OAAnED,EAAc,GAAGH,EAAQ,GAAGC,EAAQ,GAAGO,EAAQ,GAAGL,IAASC,IAAc,GAAGJ,EAAQ,GAAGC,EA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