{"version":3,"file":"GlassyButton.CjB3OOsm.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/EdxZd56kodPAJ6vy1r20/ofD176Kckqmt7O2iRbpO/GlassyButton.js"],"sourcesContent":["// GlassyButton: A glassmorphic button with animated highlight/reflection, hover effect, and configurable light direction\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useMemo}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * GlassyButton\n *\n * @framerIntrinsicWidth 160\n * @framerIntrinsicHeight 48\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight fixed\n */export default function GlassyButton(props){const{label,background,textColor,borderRadius,blur,lightDirection,font,style,link}=props;const isStatic=useIsStaticRenderer();// Light direction mapping to gradient angles and highlight positions\nconst lightMap={\"top-left\":{angle:135,x:\"10%\",y:\"10%\"},\"top\":{angle:180,x:\"50%\",y:\"8%\"},\"top-right\":{angle:225,x:\"90%\",y:\"10%\"},\"right\":{angle:270,x:\"92%\",y:\"50%\"},\"bottom-right\":{angle:315,x:\"90%\",y:\"90%\"},\"bottom\":{angle:0,x:\"50%\",y:\"92%\"},\"bottom-left\":{angle:45,x:\"10%\",y:\"90%\"},\"left\":{angle:90,x:\"8%\",y:\"50%\"}};const{angle,x,y}=lightMap[lightDirection];// Highlight and reflection styles\nconst highlightStyle=useMemo(()=>{return{position:\"absolute\",left:x,top:y,width:\"60%\",height:\"30%\",background:\"linear-gradient(120deg, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0.12) 100%)\",borderRadius:\"50%\",filter:\"blur(14px)\",opacity:.5,pointerEvents:\"none\",transform:\"translate(-50%, -50%)\",zIndex:2};},[x,y]);const reflectionStyle=useMemo(()=>{return{position:\"absolute\",left:x,top:y,width:\"30%\",height:\"14%\",background:\"linear-gradient(120deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.04) 100%)\",borderRadius:\"50%\",filter:\"blur(7px)\",opacity:.28,pointerEvents:\"none\",transform:\"translate(-50%, -50%)\",zIndex:1};},[x,y]);// Glassy background style\nconst glassStyle=useMemo(()=>({position:\"relative\",width:\"100%\",height:\"100%\",borderRadius,background:`linear-gradient(${angle}deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.04) 100%), ${background}`,boxShadow:\"0 6px 18px 0 rgba(0,0,0,0.10)\",backdropFilter:`blur(${blur}px) saturate(1.2)`,WebkitBackdropFilter:`blur(${blur}px) saturate(1.2)`,border:\"1.5px solid rgba(255,255,255,0.22)\",boxSizing:\"border-box\",overflow:\"hidden\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",...style}),[angle,background,borderRadius,blur,style]);// Text style\nconst textStyle=useMemo(()=>({color:textColor,zIndex:3,userSelect:\"none\",...font,fontWeight:font?.variant===\"Bold\"?700:undefined,fontSize:font?.fontSize,letterSpacing:font?.letterSpacing,lineHeight:font?.lineHeight,textAlign:font?.textAlign,fontStyle:font?.fontStyle,fontFamily:font?.fontFamily,minWidth:\"max-content\",width:\"max-content\",pointerEvents:\"none\"}),[textColor,font]);// Accessibility: role=button, tabIndex=0\nconst content=/*#__PURE__*/_jsxs(\"div\",{style:glassStyle,role:\"button\",tabIndex:0,\"aria-label\":label,children:[/*#__PURE__*/_jsx(\"div\",{style:highlightStyle}),/*#__PURE__*/_jsx(\"div\",{style:reflectionStyle}),/*#__PURE__*/_jsx(\"span\",{style:textStyle,children:label}),/*#__PURE__*/_jsx(\"div\",{style:{pointerEvents:\"none\",position:\"absolute\",inset:0,borderRadius,border:\"1.5px solid rgba(255,255,255,0.22)\",boxShadow:\"inset 0 1.5px 8px 0 rgba(255,255,255,0.10), 0 1.5px 8px 0 rgba(0,0,0,0.06)\",zIndex:4}})]});return link?/*#__PURE__*/_jsx(\"a\",{href:link,style:{display:\"block\",width:\"100%\",height:\"100%\",textDecoration:\"none\"},tabIndex:-1,\"aria-label\":label,children:content}):content;}addPropertyControls(GlassyButton,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Glassy Button\"},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF33\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:16,min:0,max:48},blur:{type:ControlType.Number,title:\"Blur\",defaultValue:18,min:4,max:32,step:1},lightDirection:{type:ControlType.Enum,title:\"Light Dir\",options:[\"top-left\",\"top\",\"top-right\",\"right\",\"bottom-right\",\"bottom\",\"bottom-left\",\"left\"],optionTitles:[\"Top Left\",\"Top\",\"Top Right\",\"Right\",\"Bottom Right\",\"Bottom\",\"Bottom Left\",\"Left\"],defaultValue:\"top-left\",displaySegmentedControl:false},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"16px\",variant:\"Bold\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\",textAlign:\"center\"}},link:{type:ControlType.Link,title:\"Button Link\",defaultValue:\"\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GlassyButton\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"160\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"48\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GlassyButton.map"],"mappings":"yLASG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,QAAM,aAAW,YAAU,eAAa,OAAK,iBAAe,OAAK,QAAM,QAAM,EAAqB,EAAoB,EACkJ,GAAK,CAAC,QAAM,IAAE,KAAG,CAA9T,WAAW,CAAC,MAAM,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAM,CAAC,MAAM,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,CAAC,MAAM,IAAI,EAAE,MAAM,EAA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