{"version":3,"file":"GridBackground.nraAudnI.mjs","names":["React.useMemo"],"sources":["https:/framerusercontent.com/modules/tPJAoPudEKcczlVmEmv2/LuRso7tFRm0gHvUdliGs/GridBackground.js"],"sourcesContent":["// User request: generate a grid background for my design and make the color a changeable variable\nimport{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function GridBackground(props){const{gridColor,backgroundColor,cellSize,lineWidth,gridOpacity,style}=props;const safeCellSize=Number.isFinite(cellSize)?Math.max(2,cellSize):24;const safeLineWidth=Number.isFinite(lineWidth)?Math.max(.5,lineWidth):1;const safeOpacity=Number.isFinite(gridOpacity)?Math.max(0,Math.min(1,gridOpacity)):.35;const backgroundImage=React.useMemo(()=>{const c=gridColor;const lw=`${safeLineWidth}px`;return[`linear-gradient(to right, ${c} 0, ${c} ${lw}, transparent ${lw}, transparent 100%)`,`linear-gradient(to bottom, ${c} 0, ${c} ${lw}, transparent ${lw}, transparent 100%)`].join(\", \");},[gridColor,safeLineWidth]);return /*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",backgroundColor,backgroundImage,backgroundSize:`${safeCellSize}px ${safeCellSize}px`,backgroundPosition:\"0 0\",opacity:safeOpacity,...style}});}addPropertyControls(GridBackground,{gridColor:{type:ControlType.Color,title:\"Grid Color\",defaultValue:\"#EEEEEE\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},cellSize:{type:ControlType.Number,title:\"Cell Size\",defaultValue:24,min:2,max:200,step:1,unit:\"px\"},lineWidth:{type:ControlType.Number,title:\"Line Width\",defaultValue:1,min:.5,max:10,step:.5,unit:\"px\"},gridOpacity:{type:ControlType.Number,title:\"Opacity\",defaultValue:.35,min:0,max:1,step:.05}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GridBackground\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GridBackground.map"],"mappings":"qKAIG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,YAAU,kBAAgB,WAAS,YAAU,cAAY,SAAO,EAAY,EAAa,OAAO,SAAS,CAAQ,EAAE,KAAK,IAAI,EAAE,CAAQ,EAAE,GAAS,EAAc,OAAO,SAAS,CAAS,EAAE,KAAK,IAAI,GAAG,CAAS,EAAE,EAAQ,EAAY,OAAO,SAAS,CAAW,EAAE,KAAK,IAAI,EAAE,KAAK,IAAI,EAAE,CAAW,CAAC,EAAE,IAAwT,OAAoB,EAAK,MAAM,CAAC,cAAc,OAAO,MAAM,CAAC,SAAS,WAAW,MAAM,OAAO,OAAO,OAAO,SAAS,SAAS,kBAAgB,gBAA3aA,MAAkB,CAAC,IAAM,EAAE,EAAgB,EAAG,GAAG,EAAc,IAAI,MAAM,CAAC,6BAA6B,EAAE,MAAM,EAAE,GAAG,EAAG,gBAAgB,EAAG,qBAAqB,8BAA8B,EAAE,MAAM,EAAE,GAAG,EAAG,gBAAgB,EAAG,oBAAoB,CAAC,CAAC,KAAK,IAAI,CAAE,EAAE,CAAC,EAAU,CAAa,CAA8J,EAAE,eAAe,GAAG,EAAa,KAAK,EAAa,IAAI,mBAAmB,MAAM,QAAQ,EAAY,GAAG,CAAK,CAAC,CAAC,CAAE,iBAHt3B,IAA4B,IAAoD,EAGuyB,EAAoB,EAAe,CAAC,UAAU,CAAC,KAAK,EAAY,MAAM,MAAM,aAAa,aAAa,SAAS,EAAE,gBAAgB,CAAC,KAAK,EAAY,MAAM,MAAM,aAAa,aAAa,SAAS,EAAE,SAAS,CAAC,KAAK,EAAY,OAAO,MAAM,YAAY,aAAa,GAAG,IAAI,EAAE,IAAI,IAAI,KAAK,EAAE,KAAK,IAAI,EAAE,UAAU,CAAC,KAAK,EAAY,OAAO,MAAM,aAAa,aAAa,EAAE,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,IAAI,EAAE,YAAY,CAAC,KAAK,EAAY,OAAO,MAAM,UAAU,aAAa,IAAI,IAAI,EAAE,IAAI,EAAE,KAAK,GAAG,CAAC,CAAC"}