{"version":3,"file":"StickyBottomRightButton.Bop85etP.mjs","names":["useState","useMemo","useCallback"],"sources":["https:/framerusercontent.com/modules/nMKGNCtIIERtqdNiAtda/6o5qpJqcNTenvcotOBSN/StickyBottomRightButton.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{startTransition,useCallback,useEffect,useMemo,useState}from\"react\";import{motion}from\"framer-motion\";// Instructions: Create a Framer component that follows the Framer component rules and achieves the user's goal.\n// Goal: as i said a button which would be sticky at botton right\n/**\n * Sticky Right Center Enquire Tab\n *\n * @framerIntrinsicWidth 220\n * @framerIntrinsicHeight 64\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function StickyBottomRightButton(props){const{label,link,openInNewTab,show,rightOffset,backgroundColor,textColor,borderRadius,shadow,paddingY,font,zIndex,onTap,style}=props;const isStatic=useIsStaticRenderer();const[isMobile,setIsMobile]=useState(false);useEffect(()=>{if(typeof window===\"undefined\")return;const mq=window.matchMedia(\"(max-width: 810px)\");const update=()=>{startTransition(()=>setIsMobile(!!mq.matches));};update();if(mq.addEventListener)mq.addEventListener(\"change\",update);else mq.addListener(update);return()=>{if(mq.removeEventListener)mq.removeEventListener(\"change\",update);else mq.removeListener(update);};},[]);const hoverBackground=useMemo(()=>{const hex=(backgroundColor||\"\").trim();const m=/^#?([0-9a-fA-F]{6})$/.exec(hex);if(!m)return backgroundColor;const v=parseInt(m[1],16);const r=v>>16&255;const g=v>>8&255;const b=v&255;const darken=c=>Math.max(0,Math.min(255,Math.round(c*.9)));const rr=darken(r);const gg=darken(g);const bb=darken(b);const toHex=n=>n.toString(16).padStart(2,\"0\");return`#${toHex(rr)}${toHex(gg)}${toHex(bb)}`;},[backgroundColor]);const handleClick=useCallback(e=>{if(onTap){e.preventDefault();// No state update, but keep pattern safe for future edits\nstartTransition(()=>onTap());return;}},[onTap]);const isWidth100=style?.width===\"100%\";const isHeight100=style?.height===\"100%\";// Avoid 0x0 components on the canvas (must be selectable)\nif(!show){return /*#__PURE__*/_jsx(\"div\",{style:{...style,position:\"relative\",width:isWidth100?\"100%\":5,height:isHeight100?\"100%\":5,minWidth:5,minHeight:5}});}const buttonStyle={position:\"fixed\",right:rightOffset,top:\"50%\",transform:\"translateY(-50%)\",zIndex:Math.max(99,zIndex),display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",width:48,padding:`${Math.max(10,isMobile?Math.round(paddingY*.75):paddingY)}px 0px`,borderRadius,border:\"none\",background:backgroundColor,color:textColor,boxShadow:shadow,textDecoration:\"none\",cursor:\"pointer\",userSelect:\"none\",WebkitTapHighlightColor:\"transparent\",pointerEvents:\"auto\",...font,textTransform:\"uppercase\",letterSpacing:\"1px\"};return /*#__PURE__*/_jsx(\"div\",{style:{...style,position:\"relative\",width:isWidth100?\"100%\":5,height:isHeight100?\"100%\":5,minWidth:5,minHeight:5,pointerEvents:\"none\",overflow:\"visible\"},children:/*#__PURE__*/_jsx(motion.a,{href:link||undefined,target:openInNewTab?\"_blank\":undefined,rel:openInNewTab?\"noreferrer noopener\":undefined,style:buttonStyle,onClick:handleClick,role:\"button\",\"aria-label\":label,tabIndex:0,onKeyDown:e=>{if(e.key===\"Enter\"||e.key===\" \"){e.currentTarget.click();}},whileHover:isStatic?undefined:{x:-5,backgroundColor:hoverBackground},whileTap:isStatic?undefined:{scale:.95},transition:{type:\"tween\",duration:.18},...isStatic?{onClick:e=>{if(onTap){e.preventDefault();startTransition(()=>onTap());}else{e.preventDefault();}}}:null,children:/*#__PURE__*/_jsx(\"span\",{style:{lineHeight:font&&font.lineHeight||\"1em\",display:\"inline-block\",fontSize:isMobile?\"13px\":font&&font.fontSize||\"14px\",whiteSpace:\"nowrap\",writingMode:\"vertical-rl\",textOrientation:\"mixed\",transform:\"rotate(180deg)\"},children:label})})});}addPropertyControls(StickyBottomRightButton,{show:{type:ControlType.Boolean,title:\"Show\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},label:{type:ControlType.String,title:\"Label\",defaultValue:\"Enquire Now\"},link:{type:ControlType.Link,title:\"Link\",defaultValue:\"\"},openInNewTab:{type:ControlType.Boolean,title:\"New Tab\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},onTap:{type:ControlType.EventHandler,title:\"Tap\"},rightOffset:{type:ControlType.Number,title:\"Right\",defaultValue:0,min:0,max:100,step:1,unit:\"px\"},zIndex:{type:ControlType.Number,title:\"Z-Index\",defaultValue:999,min:0,max:99999,step:1},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#A67C00\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#FFFFFF\"},borderRadius:{type:ControlType.BorderRadius,title:\"Radius\",defaultValue:\"8px 0px 0px 8px\"},shadow:{type:ControlType.BoxShadow,title:\"Shadow\",defaultValue:\"0 12px 30px rgba(0,0,0,0.18)\"},paddingY:{type:ControlType.Number,title:\"Pad Y\",defaultValue:32,min:10,max:80,step:1,unit:\"px\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Semibold\",letterSpacing:\"1px\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"StickyBottomRightButton\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"220\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"64\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./StickyBottomRightButton.map"],"mappings":"8QAUG,SAAwB,EAAwB,EAAM,CAAC,GAAK,CAAC,QAAM,OAAK,eAAa,OAAK,cAAY,kBAAgB,YAAU,eAAa,SAAO,WAAS,OAAK,SAAO,QAAM,SAAO,EAAY,EAAS,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