{"version":3,"file":"SupaButton.C6mjHhoF.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/dK6VZxXLftODU4pyAOmD/te9wA5Jb50DGS0Jxczaq/SupaButton.js"],"sourcesContent":["// supagateway-runtime v1 — installed by the SupaGateway plugin. Updates overwrite this file.\n//\n// The kit's primary button, shared so the hover treatment is written once instead of eight\n// times. Every component keeps building its own resting appearance in styles.button(disabled)\n// and hands it here untouched: this file only adds behaviour on top. The hover is two colours\n// the host component exposes as its own property controls — a panel of hoverBackground slides\n// up from the bottom edge and the label turns hoverTextColor — whose defaults reproduce the\n// kit's old inversion of the resting fill and label, so an unrestyled button is unchanged.\n// Inline styles cannot express :hover, so the state lives in React.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";// CSS has NO native spring: the design's curve is a Framer spring (0.4 s, bounce 0.2) and this\n// cubic-bezier only approximates it with a small overshoot past the resting position. It is a\n// stand-in, not the same motion — do not treat the two as equivalent.\nconst SLIDE_EASING=\"cubic-bezier(0.33, 1.3, 0.5, 1)\";const DURATION=\"0.4s\";export function SupaButton(props){const{style,hoverBackground,hoverTextColor,children,type=\"button\",disabled=false,onClick}=props;const[hovered,setHovered]=useState(false);const[focused,setFocused]=useState(false);const[reducedMotion,setReducedMotion]=useState(false);// A media query cannot live inside an inline style, so the preference is read from\n// matchMedia. Guarded for SSR and for export renders, where there is no window.\nuseEffect(()=>{if(typeof window===\"undefined\"||typeof window.matchMedia!==\"function\")return;const query=window.matchMedia(\"(prefers-reduced-motion: reduce)\");setReducedMotion(query.matches);const handleChange=event=>setReducedMotion(event.matches);query.addEventListener(\"change\",handleChange);return()=>query.removeEventListener(\"change\",handleChange);},[]);// A disabled button must not react at all: no slide, no colour inversion. Keyboard focus\n// raises the panel too, so the affordance is not mouse-only.\nconst raised=!disabled&&(hovered||focused);// Reduced motion drops BOTH transitions, not just the transform: an instant panel with a\n// fading label would leave the light label unreadable on the light panel mid-fade.\nconst slideTransition=reducedMotion?\"none\":`transform ${DURATION} ${SLIDE_EASING}`;const labelTransition=reducedMotion?\"none\":`color ${DURATION} ${SLIDE_EASING}`;return /*#__PURE__*/_jsxs(\"button\",{type:type,disabled:disabled,onClick:onClick,onMouseEnter:()=>setHovered(true),onMouseLeave:()=>setHovered(false),onFocus:()=>setFocused(true),onBlur:()=>setFocused(false),style:{...style,// The panel is clipped by the button itself, exactly like the Framer original.\nposition:\"relative\",overflow:\"hidden\",color:raised?hoverTextColor:style.color,transition:labelTransition},children:[/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{position:\"absolute\",inset:0,borderRadius:\"inherit\",background:hoverBackground,transform:raised?\"translateY(0)\":\"translateY(100%)\",transition:slideTransition,pointerEvents:\"none\"}}),/*#__PURE__*/_jsx(\"span\",{style:{position:\"relative\",zIndex:1},children:children})]});}\nexport const __FramerMetadata__ = {\"exports\":{\"SupaButton\":{\"type\":\"reactComponent\",\"name\":\"SupaButton\",\"slots\":[\"children\"],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SupaButton.map"],"mappings":"yIAY2E,SAAgB,EAAW,EAAM,CAAC,GAAK,CAAC,QAAM,kBAAgB,iBAAe,WAAS,OAAK,SAAS,WAAS,GAAM,WAAS,EAAW,CAAC,EAAQ,GAAYA,EAAS,EAAK,EAAO,CAAC,EAAQ,GAAYA,EAAS,EAAK,EAAO,CAAC,EAAc,GAAkBA,EAAS,EAAK,EAErV,MAAc,CAAC,GAAU,IAAS,QAAa,OAAO,EAAO,YAAa,WAAW,OAAO,IAAM,EAAM,EAAO,WAAW,kCAAkC,EAAE,EAAiB,EAAM,OAAO,EAAE,IAAM,EAAa,GAAO,EAAiB,EAAM,OAAO,EAAgD,OAA9C,EAAM,iBAAiB,SAAS,CAAY,MAAY,EAAM,oBAAoB,SAAS,CAAY,CAAE,EAAE,CAAC,CAAC,EAErW,IAAM,EAAO,CAAC,IAA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